From 59857efe7fb0b57cd86ab387312bdf18dbfeca76 Mon Sep 17 00:00:00 2001 From: Chris Cassano Date: Fri, 28 Mar 2025 09:15:04 -0700 Subject: [PATCH] add module support --- lerna.json | 2 +- local-tests/index.js | 126058 +++++++++++++++ .../access-control-conditions/package.json | 4 +- packages/auth-browser/package.json | 4 +- packages/auth-helpers/package.json | 4 +- packages/constants/package.json | 4 +- packages/constants/src/lib/version.ts | 2 +- packages/contracts-sdk/package.json | 4 +- packages/core/package.json | 4 +- packages/crypto/package.json | 4 +- packages/encryption/package.json | 4 +- packages/event-listener/package.json | 4 +- packages/lit-auth-client/package.json | 4 +- packages/lit-node-client-nodejs/package.json | 4 +- packages/lit-node-client/package.json | 4 +- packages/logger/package.json | 4 +- packages/misc-browser/package.json | 4 +- packages/misc/package.json | 4 +- packages/nacl/package.json | 4 +- packages/pkp-base/package.json | 4 +- packages/pkp-cosmos/package.json | 4 +- packages/pkp-ethers/package.json | 4 +- packages/pkp-sui/package.json | 4 +- packages/pkp-walletconnect/package.json | 4 +- packages/types/package.json | 4 +- packages/types/src/lib/interfaces.ts | 5 + packages/uint8arrays/package.json | 4 +- packages/wasm/package.json | 4 +- packages/wasm/rust/rust-toolchain.toml | 4 + .../wrapped-keys-lit-actions/package.json | 4 +- packages/wrapped-keys/package.json | 4 +- 31 files changed, 126121 insertions(+), 54 deletions(-) create mode 100644 local-tests/index.js create mode 100644 packages/wasm/rust/rust-toolchain.toml diff --git a/lerna.json b/lerna.json index d684edf17..2a83410b8 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useNx": true, "useWorkspaces": true, - "version": "7.0.9" + "version": "7.0.10-alpha.0" } diff --git a/local-tests/index.js b/local-tests/index.js new file mode 100644 index 000000000..82a9ec5c1 --- /dev/null +++ b/local-tests/index.js @@ -0,0 +1,126058 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __defNormalProp = (obj, key2, value) => + key2 in obj + ? __defProp(obj, key2, { + enumerable: true, + configurable: true, + writable: true, + value, + }) + : (obj[key2] = value); +var __require = /* @__PURE__ */ ((x) => + typeof require !== 'undefined' + ? require + : typeof Proxy !== 'undefined' + ? new Proxy(x, { + get: (a2, b) => (typeof require !== 'undefined' ? require : a2)[b], + }) + : x)(function (x) { + if (typeof require !== 'undefined') return require.apply(this, arguments); + throw new Error('Dynamic require of "' + x + '" is not supported'); +}); +var __esm = (fn, res) => + function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])((fn = 0))), res; + }; +var __commonJS = (cb, mod) => + function __require2() { + return ( + mod || + (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), + mod.exports + ); + }; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if ((from && typeof from === 'object') || typeof from === 'function') { + for (let key2 of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key2) && key2 !== except) + __defProp(to, key2, { + get: () => from[key2], + enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable, + }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => ( + (target = mod != null ? __create(__getProtoOf(mod)) : {}), + __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule + ? __defProp(target, 'default', { value: mod, enumerable: true }) + : target, + mod + ) +); +var __toCommonJS = (mod) => + __copyProps(__defProp({}, '__esModule', { value: true }), mod); +var __publicField = (obj, key2, value) => { + __defNormalProp(obj, typeof key2 !== 'symbol' ? key2 + '' : key2, value); + return value; +}; + +// local-tests/shim.mjs +import { createRequire } from 'module'; +var require2; +var init_shim = __esm({ + 'local-tests/shim.mjs'() { + require2 = createRequire(import.meta.url); + global.require = require2; + }, +}); + +// node_modules/@ethersproject/bignumber/node_modules/bn.js/lib/bn.js +var require_bn = __commonJS({ + 'node_modules/@ethersproject/bignumber/node_modules/bn.js/lib/bn.js'( + exports, + module2 + ) { + init_shim(); + (function (module3, exports2) { + 'use strict'; + function assert2(val, msg) { + if (!val) throw new Error(msg || 'Assertion failed'); + } + function inherits(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function () {}; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN3(number, base2, endian) { + if (BN3.isBN(number)) { + return number; + } + this.negative = 0; + this.words = null; + this.length = 0; + this.red = null; + if (number !== null) { + if (base2 === 'le' || base2 === 'be') { + endian = base2; + base2 = 10; + } + this._init(number || 0, base2 || 10, endian || 'be'); + } + } + if (typeof module3 === 'object') { + module3.exports = BN3; + } else { + exports2.BN = BN3; + } + BN3.BN = BN3; + BN3.wordSize = 26; + var Buffer4; + try { + if ( + typeof window !== 'undefined' && + typeof window.Buffer !== 'undefined' + ) { + Buffer4 = window.Buffer; + } else { + Buffer4 = __require('buffer').Buffer; + } + } catch (e2) {} + BN3.isBN = function isBN(num) { + if (num instanceof BN3) { + return true; + } + return ( + num !== null && + typeof num === 'object' && + num.constructor.wordSize === BN3.wordSize && + Array.isArray(num.words) + ); + }; + BN3.max = function max(left, right) { + if (left.cmp(right) > 0) return left; + return right; + }; + BN3.min = function min(left, right) { + if (left.cmp(right) < 0) return left; + return right; + }; + BN3.prototype._init = function init2(number, base2, endian) { + if (typeof number === 'number') { + return this._initNumber(number, base2, endian); + } + if (typeof number === 'object') { + return this._initArray(number, base2, endian); + } + if (base2 === 'hex') { + base2 = 16; + } + assert2(base2 === (base2 | 0) && base2 >= 2 && base2 <= 36); + number = number.toString().replace(/\s+/g, ''); + var start = 0; + if (number[0] === '-') { + start++; + this.negative = 1; + } + if (start < number.length) { + if (base2 === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base2, start); + if (endian === 'le') { + this._initArray(this.toArray(), base2, endian); + } + } + } + }; + BN3.prototype._initNumber = function _initNumber(number, base2, endian) { + if (number < 0) { + this.negative = 1; + number = -number; + } + if (number < 67108864) { + this.words = [number & 67108863]; + this.length = 1; + } else if (number < 4503599627370496) { + this.words = [number & 67108863, (number / 67108864) & 67108863]; + this.length = 2; + } else { + assert2(number < 9007199254740992); + this.words = [number & 67108863, (number / 67108864) & 67108863, 1]; + this.length = 3; + } + if (endian !== 'le') return; + this._initArray(this.toArray(), base2, endian); + }; + BN3.prototype._initArray = function _initArray(number, base2, endian) { + assert2(typeof number.length === 'number'); + if (number.length <= 0) { + this.words = [0]; + this.length = 1; + return this; + } + this.length = Math.ceil(number.length / 3); + this.words = new Array(this.length); + for (var i2 = 0; i2 < this.length; i2++) { + this.words[i2] = 0; + } + var j, w; + var off = 0; + if (endian === 'be') { + for (i2 = number.length - 1, j = 0; i2 >= 0; i2 -= 3) { + w = number[i2] | (number[i2 - 1] << 8) | (number[i2 - 2] << 16); + this.words[j] |= (w << off) & 67108863; + this.words[j + 1] = (w >>> (26 - off)) & 67108863; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + } else if (endian === 'le') { + for (i2 = 0, j = 0; i2 < number.length; i2 += 3) { + w = number[i2] | (number[i2 + 1] << 8) | (number[i2 + 2] << 16); + this.words[j] |= (w << off) & 67108863; + this.words[j + 1] = (w >>> (26 - off)) & 67108863; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + } + return this._strip(); + }; + function parseHex4Bits(string, index) { + var c = string.charCodeAt(index); + if (c >= 48 && c <= 57) { + return c - 48; + } else if (c >= 65 && c <= 70) { + return c - 55; + } else if (c >= 97 && c <= 102) { + return c - 87; + } else { + assert2(false, 'Invalid character in ' + string); + } + } + function parseHexByte(string, lowerBound, index) { + var r3 = parseHex4Bits(string, index); + if (index - 1 >= lowerBound) { + r3 |= parseHex4Bits(string, index - 1) << 4; + } + return r3; + } + BN3.prototype._parseHex = function _parseHex(number, start, endian) { + this.length = Math.ceil((number.length - start) / 6); + this.words = new Array(this.length); + for (var i2 = 0; i2 < this.length; i2++) { + this.words[i2] = 0; + } + var off = 0; + var j = 0; + var w; + if (endian === 'be') { + for (i2 = number.length - 1; i2 >= start; i2 -= 2) { + w = parseHexByte(number, start, i2) << off; + this.words[j] |= w & 67108863; + if (off >= 18) { + off -= 18; + j += 1; + this.words[j] |= w >>> 26; + } else { + off += 8; + } + } + } else { + var parseLength = number.length - start; + for ( + i2 = parseLength % 2 === 0 ? start + 1 : start; + i2 < number.length; + i2 += 2 + ) { + w = parseHexByte(number, start, i2) << off; + this.words[j] |= w & 67108863; + if (off >= 18) { + off -= 18; + j += 1; + this.words[j] |= w >>> 26; + } else { + off += 8; + } + } + } + this._strip(); + }; + function parseBase(str, start, end, mul3) { + var r3 = 0; + var b = 0; + var len = Math.min(str.length, end); + for (var i2 = start; i2 < len; i2++) { + var c = str.charCodeAt(i2) - 48; + r3 *= mul3; + if (c >= 49) { + b = c - 49 + 10; + } else if (c >= 17) { + b = c - 17 + 10; + } else { + b = c; + } + assert2(c >= 0 && b < mul3, 'Invalid character'); + r3 += b; + } + return r3; + } + BN3.prototype._parseBase = function _parseBase(number, base2, start) { + this.words = [0]; + this.length = 1; + for ( + var limbLen = 0, limbPow = 1; + limbPow <= 67108863; + limbPow *= base2 + ) { + limbLen++; + } + limbLen--; + limbPow = (limbPow / base2) | 0; + var total = number.length - start; + var mod = total % limbLen; + var end = Math.min(total, total - mod) + start; + var word = 0; + for (var i2 = start; i2 < end; i2 += limbLen) { + word = parseBase(number, i2, i2 + limbLen, base2); + this.imuln(limbPow); + if (this.words[0] + word < 67108864) { + this.words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod !== 0) { + var pow = 1; + word = parseBase(number, i2, number.length, base2); + for (i2 = 0; i2 < mod; i2++) { + pow *= base2; + } + this.imuln(pow); + if (this.words[0] + word < 67108864) { + this.words[0] += word; + } else { + this._iaddn(word); + } + } + this._strip(); + }; + BN3.prototype.copy = function copy(dest) { + dest.words = new Array(this.length); + for (var i2 = 0; i2 < this.length; i2++) { + dest.words[i2] = this.words[i2]; + } + dest.length = this.length; + dest.negative = this.negative; + dest.red = this.red; + }; + function move(dest, src) { + dest.words = src.words; + dest.length = src.length; + dest.negative = src.negative; + dest.red = src.red; + } + BN3.prototype._move = function _move(dest) { + move(dest, this); + }; + BN3.prototype.clone = function clone() { + var r3 = new BN3(null); + this.copy(r3); + return r3; + }; + BN3.prototype._expand = function _expand(size) { + while (this.length < size) { + this.words[this.length++] = 0; + } + return this; + }; + BN3.prototype._strip = function strip() { + while (this.length > 1 && this.words[this.length - 1] === 0) { + this.length--; + } + return this._normSign(); + }; + BN3.prototype._normSign = function _normSign() { + if (this.length === 1 && this.words[0] === 0) { + this.negative = 0; + } + return this; + }; + if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') { + try { + BN3.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect4; + } catch (e2) { + BN3.prototype.inspect = inspect4; + } + } else { + BN3.prototype.inspect = inspect4; + } + function inspect4() { + return (this.red ? ''; + } + var zeros2 = [ + '', + '0', + '00', + '000', + '0000', + '00000', + '000000', + '0000000', + '00000000', + '000000000', + '0000000000', + '00000000000', + '000000000000', + '0000000000000', + '00000000000000', + '000000000000000', + '0000000000000000', + '00000000000000000', + '000000000000000000', + '0000000000000000000', + '00000000000000000000', + '000000000000000000000', + '0000000000000000000000', + '00000000000000000000000', + '000000000000000000000000', + '0000000000000000000000000', + ]; + var groupSizes = [ + 0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + ]; + var groupBases = [ + 0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, + 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, + 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, + 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, + 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, + 60466176, + ]; + BN3.prototype.toString = function toString2(base2, padding2) { + base2 = base2 || 10; + padding2 = padding2 | 0 || 1; + var out; + if (base2 === 16 || base2 === 'hex') { + out = ''; + var off = 0; + var carry = 0; + for (var i2 = 0; i2 < this.length; i2++) { + var w = this.words[i2]; + var word = (((w << off) | carry) & 16777215).toString(16); + carry = (w >>> (24 - off)) & 16777215; + off += 2; + if (off >= 26) { + off -= 26; + i2--; + } + if (carry !== 0 || i2 !== this.length - 1) { + out = zeros2[6 - word.length] + word + out; + } else { + out = word + out; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding2 !== 0) { + out = '0' + out; + } + if (this.negative !== 0) { + out = '-' + out; + } + return out; + } + if (base2 === (base2 | 0) && base2 >= 2 && base2 <= 36) { + var groupSize = groupSizes[base2]; + var groupBase = groupBases[base2]; + out = ''; + var c = this.clone(); + c.negative = 0; + while (!c.isZero()) { + var r3 = c.modrn(groupBase).toString(base2); + c = c.idivn(groupBase); + if (!c.isZero()) { + out = zeros2[groupSize - r3.length] + r3 + out; + } else { + out = r3 + out; + } + } + if (this.isZero()) { + out = '0' + out; + } + while (out.length % padding2 !== 0) { + out = '0' + out; + } + if (this.negative !== 0) { + out = '-' + out; + } + return out; + } + assert2(false, 'Base should be between 2 and 36'); + }; + BN3.prototype.toNumber = function toNumber() { + var ret = this.words[0]; + if (this.length === 2) { + ret += this.words[1] * 67108864; + } else if (this.length === 3 && this.words[2] === 1) { + ret += 4503599627370496 + this.words[1] * 67108864; + } else if (this.length > 2) { + assert2(false, 'Number can only safely store up to 53 bits'); + } + return this.negative !== 0 ? -ret : ret; + }; + BN3.prototype.toJSON = function toJSON2() { + return this.toString(16, 2); + }; + if (Buffer4) { + BN3.prototype.toBuffer = function toBuffer(endian, length) { + return this.toArrayLike(Buffer4, endian, length); + }; + } + BN3.prototype.toArray = function toArray(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + var allocate = function allocate2(ArrayType, size) { + if (ArrayType.allocUnsafe) { + return ArrayType.allocUnsafe(size); + } + return new ArrayType(size); + }; + BN3.prototype.toArrayLike = function toArrayLike( + ArrayType, + endian, + length + ) { + this._strip(); + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert2( + byteLength <= reqLength, + 'byte array longer than desired length' + ); + assert2(reqLength > 0, 'Requested array length <= 0'); + var res = allocate(ArrayType, reqLength); + var postfix = endian === 'le' ? 'LE' : 'BE'; + this['_toArrayLike' + postfix](res, byteLength); + return res; + }; + BN3.prototype._toArrayLikeLE = function _toArrayLikeLE(res, byteLength) { + var position = 0; + var carry = 0; + for (var i2 = 0, shift = 0; i2 < this.length; i2++) { + var word = (this.words[i2] << shift) | carry; + res[position++] = word & 255; + if (position < res.length) { + res[position++] = (word >> 8) & 255; + } + if (position < res.length) { + res[position++] = (word >> 16) & 255; + } + if (shift === 6) { + if (position < res.length) { + res[position++] = (word >> 24) & 255; + } + carry = 0; + shift = 0; + } else { + carry = word >>> 24; + shift += 2; + } + } + if (position < res.length) { + res[position++] = carry; + while (position < res.length) { + res[position++] = 0; + } + } + }; + BN3.prototype._toArrayLikeBE = function _toArrayLikeBE(res, byteLength) { + var position = res.length - 1; + var carry = 0; + for (var i2 = 0, shift = 0; i2 < this.length; i2++) { + var word = (this.words[i2] << shift) | carry; + res[position--] = word & 255; + if (position >= 0) { + res[position--] = (word >> 8) & 255; + } + if (position >= 0) { + res[position--] = (word >> 16) & 255; + } + if (shift === 6) { + if (position >= 0) { + res[position--] = (word >> 24) & 255; + } + carry = 0; + shift = 0; + } else { + carry = word >>> 24; + shift += 2; + } + } + if (position >= 0) { + res[position--] = carry; + while (position >= 0) { + res[position--] = 0; + } + } + }; + if (Math.clz32) { + BN3.prototype._countBits = function _countBits(w) { + return 32 - Math.clz32(w); + }; + } else { + BN3.prototype._countBits = function _countBits(w) { + var t2 = w; + var r3 = 0; + if (t2 >= 4096) { + r3 += 13; + t2 >>>= 13; + } + if (t2 >= 64) { + r3 += 7; + t2 >>>= 7; + } + if (t2 >= 8) { + r3 += 4; + t2 >>>= 4; + } + if (t2 >= 2) { + r3 += 2; + t2 >>>= 2; + } + return r3 + t2; + }; + } + BN3.prototype._zeroBits = function _zeroBits(w) { + if (w === 0) return 26; + var t2 = w; + var r3 = 0; + if ((t2 & 8191) === 0) { + r3 += 13; + t2 >>>= 13; + } + if ((t2 & 127) === 0) { + r3 += 7; + t2 >>>= 7; + } + if ((t2 & 15) === 0) { + r3 += 4; + t2 >>>= 4; + } + if ((t2 & 3) === 0) { + r3 += 2; + t2 >>>= 2; + } + if ((t2 & 1) === 0) { + r3++; + } + return r3; + }; + BN3.prototype.bitLength = function bitLength() { + var w = this.words[this.length - 1]; + var hi = this._countBits(w); + return (this.length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w = new Array(num.bitLength()); + for (var bit = 0; bit < w.length; bit++) { + var off = (bit / 26) | 0; + var wbit = bit % 26; + w[bit] = (num.words[off] >>> wbit) & 1; + } + return w; + } + BN3.prototype.zeroBits = function zeroBits() { + if (this.isZero()) return 0; + var r3 = 0; + for (var i2 = 0; i2 < this.length; i2++) { + var b = this._zeroBits(this.words[i2]); + r3 += b; + if (b !== 26) break; + } + return r3; + }; + BN3.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN3.prototype.toTwos = function toTwos(width) { + if (this.negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN3.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN3.prototype.isNeg = function isNeg() { + return this.negative !== 0; + }; + BN3.prototype.neg = function neg3() { + return this.clone().ineg(); + }; + BN3.prototype.ineg = function ineg() { + if (!this.isZero()) { + this.negative ^= 1; + } + return this; + }; + BN3.prototype.iuor = function iuor(num) { + while (this.length < num.length) { + this.words[this.length++] = 0; + } + for (var i2 = 0; i2 < num.length; i2++) { + this.words[i2] = this.words[i2] | num.words[i2]; + } + return this._strip(); + }; + BN3.prototype.ior = function ior(num) { + assert2((this.negative | num.negative) === 0); + return this.iuor(num); + }; + BN3.prototype.or = function or(num) { + if (this.length > num.length) return this.clone().ior(num); + return num.clone().ior(this); + }; + BN3.prototype.uor = function uor(num) { + if (this.length > num.length) return this.clone().iuor(num); + return num.clone().iuor(this); + }; + BN3.prototype.iuand = function iuand(num) { + var b; + if (this.length > num.length) { + b = num; + } else { + b = this; + } + for (var i2 = 0; i2 < b.length; i2++) { + this.words[i2] = this.words[i2] & num.words[i2]; + } + this.length = b.length; + return this._strip(); + }; + BN3.prototype.iand = function iand(num) { + assert2((this.negative | num.negative) === 0); + return this.iuand(num); + }; + BN3.prototype.and = function and(num) { + if (this.length > num.length) return this.clone().iand(num); + return num.clone().iand(this); + }; + BN3.prototype.uand = function uand(num) { + if (this.length > num.length) return this.clone().iuand(num); + return num.clone().iuand(this); + }; + BN3.prototype.iuxor = function iuxor(num) { + var a2; + var b; + if (this.length > num.length) { + a2 = this; + b = num; + } else { + a2 = num; + b = this; + } + for (var i2 = 0; i2 < b.length; i2++) { + this.words[i2] = a2.words[i2] ^ b.words[i2]; + } + if (this !== a2) { + for (; i2 < a2.length; i2++) { + this.words[i2] = a2.words[i2]; + } + } + this.length = a2.length; + return this._strip(); + }; + BN3.prototype.ixor = function ixor(num) { + assert2((this.negative | num.negative) === 0); + return this.iuxor(num); + }; + BN3.prototype.xor = function xor(num) { + if (this.length > num.length) return this.clone().ixor(num); + return num.clone().ixor(this); + }; + BN3.prototype.uxor = function uxor(num) { + if (this.length > num.length) return this.clone().iuxor(num); + return num.clone().iuxor(this); + }; + BN3.prototype.inotn = function inotn(width) { + assert2(typeof width === 'number' && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i2 = 0; i2 < bytesNeeded; i2++) { + this.words[i2] = ~this.words[i2] & 67108863; + } + if (bitsLeft > 0) { + this.words[i2] = ~this.words[i2] & (67108863 >> (26 - bitsLeft)); + } + return this._strip(); + }; + BN3.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN3.prototype.setn = function setn(bit, val) { + assert2(typeof bit === 'number' && bit >= 0); + var off = (bit / 26) | 0; + var wbit = bit % 26; + this._expand(off + 1); + if (val) { + this.words[off] = this.words[off] | (1 << wbit); + } else { + this.words[off] = this.words[off] & ~(1 << wbit); + } + return this._strip(); + }; + BN3.prototype.iadd = function iadd(num) { + var r3; + if (this.negative !== 0 && num.negative === 0) { + this.negative = 0; + r3 = this.isub(num); + this.negative ^= 1; + return this._normSign(); + } else if (this.negative === 0 && num.negative !== 0) { + num.negative = 0; + r3 = this.isub(num); + num.negative = 1; + return r3._normSign(); + } + var a2, b; + if (this.length > num.length) { + a2 = this; + b = num; + } else { + a2 = num; + b = this; + } + var carry = 0; + for (var i2 = 0; i2 < b.length; i2++) { + r3 = (a2.words[i2] | 0) + (b.words[i2] | 0) + carry; + this.words[i2] = r3 & 67108863; + carry = r3 >>> 26; + } + for (; carry !== 0 && i2 < a2.length; i2++) { + r3 = (a2.words[i2] | 0) + carry; + this.words[i2] = r3 & 67108863; + carry = r3 >>> 26; + } + this.length = a2.length; + if (carry !== 0) { + this.words[this.length] = carry; + this.length++; + } else if (a2 !== this) { + for (; i2 < a2.length; i2++) { + this.words[i2] = a2.words[i2]; + } + } + return this; + }; + BN3.prototype.add = function add5(num) { + var res; + if (num.negative !== 0 && this.negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && this.negative !== 0) { + this.negative = 0; + res = num.sub(this); + this.negative = 1; + return res; + } + if (this.length > num.length) return this.clone().iadd(num); + return num.clone().iadd(this); + }; + BN3.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r3 = this.iadd(num); + num.negative = 1; + return r3._normSign(); + } else if (this.negative !== 0) { + this.negative = 0; + this.iadd(num); + this.negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + this.negative = 0; + this.length = 1; + this.words[0] = 0; + return this; + } + var a2, b; + if (cmp > 0) { + a2 = this; + b = num; + } else { + a2 = num; + b = this; + } + var carry = 0; + for (var i2 = 0; i2 < b.length; i2++) { + r3 = (a2.words[i2] | 0) - (b.words[i2] | 0) + carry; + carry = r3 >> 26; + this.words[i2] = r3 & 67108863; + } + for (; carry !== 0 && i2 < a2.length; i2++) { + r3 = (a2.words[i2] | 0) + carry; + carry = r3 >> 26; + this.words[i2] = r3 & 67108863; + } + if (carry === 0 && i2 < a2.length && a2 !== this) { + for (; i2 < a2.length; i2++) { + this.words[i2] = a2.words[i2]; + } + } + this.length = Math.max(this.length, i2); + if (a2 !== this) { + this.negative = 1; + } + return this._strip(); + }; + BN3.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = (self2.length + num.length) | 0; + out.length = len; + len = (len - 1) | 0; + var a2 = self2.words[0] | 0; + var b = num.words[0] | 0; + var r3 = a2 * b; + var lo = r3 & 67108863; + var carry = (r3 / 67108864) | 0; + out.words[0] = lo; + for (var k = 1; k < len; k++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k, num.length - 1); + for (var j = Math.max(0, k - self2.length + 1); j <= maxJ; j++) { + var i2 = (k - j) | 0; + a2 = self2.words[i2] | 0; + b = num.words[j] | 0; + r3 = a2 * b + rword; + ncarry += (r3 / 67108864) | 0; + rword = r3 & 67108863; + } + out.words[k] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k] = carry | 0; + } else { + out.length--; + } + return out._strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a2 = self2.words; + var b = num.words; + var o2 = out.words; + var c = 0; + var lo; + var mid; + var hi; + var a0 = a2[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a2[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a2[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a3 = a2[3] | 0; + var al3 = a3 & 8191; + var ah3 = a3 >>> 13; + var a4 = a2[4] | 0; + var al4 = a4 & 8191; + var ah4 = a4 >>> 13; + var a5 = a2[5] | 0; + var al5 = a5 & 8191; + var ah5 = a5 >>> 13; + var a6 = a2[6] | 0; + var al6 = a6 & 8191; + var ah6 = a6 >>> 13; + var a7 = a2[7] | 0; + var al7 = a7 & 8191; + var ah7 = a7 >>> 13; + var a8 = a2[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a2[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b2 = b[2] | 0; + var bl2 = b2 & 8191; + var bh2 = b2 >>> 13; + var b3 = b[3] | 0; + var bl3 = b3 & 8191; + var bh3 = b3 >>> 13; + var b4 = b[4] | 0; + var bl4 = b4 & 8191; + var bh4 = b4 >>> 13; + var b5 = b[5] | 0; + var bl5 = b5 & 8191; + var bh5 = b5 >>> 13; + var b6 = b[6] | 0; + var bl6 = b6 & 8191; + var bh6 = b6 >>> 13; + var b7 = b[7] | 0; + var bl7 = b7 & 8191; + var bh7 = b7 >>> 13; + var b8 = b[8] | 0; + var bl8 = b8 & 8191; + var bh8 = b8 >>> 13; + var b9 = b[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = (mid + Math.imul(ah0, bl0)) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = (mid + Math.imul(ah1, bl0)) | 0; + hi = Math.imul(ah1, bh0); + lo = (lo + Math.imul(al0, bl1)) | 0; + mid = (mid + Math.imul(al0, bh1)) | 0; + mid = (mid + Math.imul(ah0, bl1)) | 0; + hi = (hi + Math.imul(ah0, bh1)) | 0; + var w1 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = (mid + Math.imul(ah2, bl0)) | 0; + hi = Math.imul(ah2, bh0); + lo = (lo + Math.imul(al1, bl1)) | 0; + mid = (mid + Math.imul(al1, bh1)) | 0; + mid = (mid + Math.imul(ah1, bl1)) | 0; + hi = (hi + Math.imul(ah1, bh1)) | 0; + lo = (lo + Math.imul(al0, bl2)) | 0; + mid = (mid + Math.imul(al0, bh2)) | 0; + mid = (mid + Math.imul(ah0, bl2)) | 0; + hi = (hi + Math.imul(ah0, bh2)) | 0; + var w2 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0; + w2 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = (mid + Math.imul(ah3, bl0)) | 0; + hi = Math.imul(ah3, bh0); + lo = (lo + Math.imul(al2, bl1)) | 0; + mid = (mid + Math.imul(al2, bh1)) | 0; + mid = (mid + Math.imul(ah2, bl1)) | 0; + hi = (hi + Math.imul(ah2, bh1)) | 0; + lo = (lo + Math.imul(al1, bl2)) | 0; + mid = (mid + Math.imul(al1, bh2)) | 0; + mid = (mid + Math.imul(ah1, bl2)) | 0; + hi = (hi + Math.imul(ah1, bh2)) | 0; + lo = (lo + Math.imul(al0, bl3)) | 0; + mid = (mid + Math.imul(al0, bh3)) | 0; + mid = (mid + Math.imul(ah0, bl3)) | 0; + hi = (hi + Math.imul(ah0, bh3)) | 0; + var w3 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0; + w3 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = (mid + Math.imul(ah4, bl0)) | 0; + hi = Math.imul(ah4, bh0); + lo = (lo + Math.imul(al3, bl1)) | 0; + mid = (mid + Math.imul(al3, bh1)) | 0; + mid = (mid + Math.imul(ah3, bl1)) | 0; + hi = (hi + Math.imul(ah3, bh1)) | 0; + lo = (lo + Math.imul(al2, bl2)) | 0; + mid = (mid + Math.imul(al2, bh2)) | 0; + mid = (mid + Math.imul(ah2, bl2)) | 0; + hi = (hi + Math.imul(ah2, bh2)) | 0; + lo = (lo + Math.imul(al1, bl3)) | 0; + mid = (mid + Math.imul(al1, bh3)) | 0; + mid = (mid + Math.imul(ah1, bl3)) | 0; + hi = (hi + Math.imul(ah1, bh3)) | 0; + lo = (lo + Math.imul(al0, bl4)) | 0; + mid = (mid + Math.imul(al0, bh4)) | 0; + mid = (mid + Math.imul(ah0, bl4)) | 0; + hi = (hi + Math.imul(ah0, bh4)) | 0; + var w4 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0; + w4 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = (mid + Math.imul(ah5, bl0)) | 0; + hi = Math.imul(ah5, bh0); + lo = (lo + Math.imul(al4, bl1)) | 0; + mid = (mid + Math.imul(al4, bh1)) | 0; + mid = (mid + Math.imul(ah4, bl1)) | 0; + hi = (hi + Math.imul(ah4, bh1)) | 0; + lo = (lo + Math.imul(al3, bl2)) | 0; + mid = (mid + Math.imul(al3, bh2)) | 0; + mid = (mid + Math.imul(ah3, bl2)) | 0; + hi = (hi + Math.imul(ah3, bh2)) | 0; + lo = (lo + Math.imul(al2, bl3)) | 0; + mid = (mid + Math.imul(al2, bh3)) | 0; + mid = (mid + Math.imul(ah2, bl3)) | 0; + hi = (hi + Math.imul(ah2, bh3)) | 0; + lo = (lo + Math.imul(al1, bl4)) | 0; + mid = (mid + Math.imul(al1, bh4)) | 0; + mid = (mid + Math.imul(ah1, bl4)) | 0; + hi = (hi + Math.imul(ah1, bh4)) | 0; + lo = (lo + Math.imul(al0, bl5)) | 0; + mid = (mid + Math.imul(al0, bh5)) | 0; + mid = (mid + Math.imul(ah0, bl5)) | 0; + hi = (hi + Math.imul(ah0, bh5)) | 0; + var w5 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0; + w5 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = (mid + Math.imul(ah6, bl0)) | 0; + hi = Math.imul(ah6, bh0); + lo = (lo + Math.imul(al5, bl1)) | 0; + mid = (mid + Math.imul(al5, bh1)) | 0; + mid = (mid + Math.imul(ah5, bl1)) | 0; + hi = (hi + Math.imul(ah5, bh1)) | 0; + lo = (lo + Math.imul(al4, bl2)) | 0; + mid = (mid + Math.imul(al4, bh2)) | 0; + mid = (mid + Math.imul(ah4, bl2)) | 0; + hi = (hi + Math.imul(ah4, bh2)) | 0; + lo = (lo + Math.imul(al3, bl3)) | 0; + mid = (mid + Math.imul(al3, bh3)) | 0; + mid = (mid + Math.imul(ah3, bl3)) | 0; + hi = (hi + Math.imul(ah3, bh3)) | 0; + lo = (lo + Math.imul(al2, bl4)) | 0; + mid = (mid + Math.imul(al2, bh4)) | 0; + mid = (mid + Math.imul(ah2, bl4)) | 0; + hi = (hi + Math.imul(ah2, bh4)) | 0; + lo = (lo + Math.imul(al1, bl5)) | 0; + mid = (mid + Math.imul(al1, bh5)) | 0; + mid = (mid + Math.imul(ah1, bl5)) | 0; + hi = (hi + Math.imul(ah1, bh5)) | 0; + lo = (lo + Math.imul(al0, bl6)) | 0; + mid = (mid + Math.imul(al0, bh6)) | 0; + mid = (mid + Math.imul(ah0, bl6)) | 0; + hi = (hi + Math.imul(ah0, bh6)) | 0; + var w6 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = (mid + Math.imul(ah7, bl0)) | 0; + hi = Math.imul(ah7, bh0); + lo = (lo + Math.imul(al6, bl1)) | 0; + mid = (mid + Math.imul(al6, bh1)) | 0; + mid = (mid + Math.imul(ah6, bl1)) | 0; + hi = (hi + Math.imul(ah6, bh1)) | 0; + lo = (lo + Math.imul(al5, bl2)) | 0; + mid = (mid + Math.imul(al5, bh2)) | 0; + mid = (mid + Math.imul(ah5, bl2)) | 0; + hi = (hi + Math.imul(ah5, bh2)) | 0; + lo = (lo + Math.imul(al4, bl3)) | 0; + mid = (mid + Math.imul(al4, bh3)) | 0; + mid = (mid + Math.imul(ah4, bl3)) | 0; + hi = (hi + Math.imul(ah4, bh3)) | 0; + lo = (lo + Math.imul(al3, bl4)) | 0; + mid = (mid + Math.imul(al3, bh4)) | 0; + mid = (mid + Math.imul(ah3, bl4)) | 0; + hi = (hi + Math.imul(ah3, bh4)) | 0; + lo = (lo + Math.imul(al2, bl5)) | 0; + mid = (mid + Math.imul(al2, bh5)) | 0; + mid = (mid + Math.imul(ah2, bl5)) | 0; + hi = (hi + Math.imul(ah2, bh5)) | 0; + lo = (lo + Math.imul(al1, bl6)) | 0; + mid = (mid + Math.imul(al1, bh6)) | 0; + mid = (mid + Math.imul(ah1, bl6)) | 0; + hi = (hi + Math.imul(ah1, bh6)) | 0; + lo = (lo + Math.imul(al0, bl7)) | 0; + mid = (mid + Math.imul(al0, bh7)) | 0; + mid = (mid + Math.imul(ah0, bl7)) | 0; + hi = (hi + Math.imul(ah0, bh7)) | 0; + var w7 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = (mid + Math.imul(ah8, bl0)) | 0; + hi = Math.imul(ah8, bh0); + lo = (lo + Math.imul(al7, bl1)) | 0; + mid = (mid + Math.imul(al7, bh1)) | 0; + mid = (mid + Math.imul(ah7, bl1)) | 0; + hi = (hi + Math.imul(ah7, bh1)) | 0; + lo = (lo + Math.imul(al6, bl2)) | 0; + mid = (mid + Math.imul(al6, bh2)) | 0; + mid = (mid + Math.imul(ah6, bl2)) | 0; + hi = (hi + Math.imul(ah6, bh2)) | 0; + lo = (lo + Math.imul(al5, bl3)) | 0; + mid = (mid + Math.imul(al5, bh3)) | 0; + mid = (mid + Math.imul(ah5, bl3)) | 0; + hi = (hi + Math.imul(ah5, bh3)) | 0; + lo = (lo + Math.imul(al4, bl4)) | 0; + mid = (mid + Math.imul(al4, bh4)) | 0; + mid = (mid + Math.imul(ah4, bl4)) | 0; + hi = (hi + Math.imul(ah4, bh4)) | 0; + lo = (lo + Math.imul(al3, bl5)) | 0; + mid = (mid + Math.imul(al3, bh5)) | 0; + mid = (mid + Math.imul(ah3, bl5)) | 0; + hi = (hi + Math.imul(ah3, bh5)) | 0; + lo = (lo + Math.imul(al2, bl6)) | 0; + mid = (mid + Math.imul(al2, bh6)) | 0; + mid = (mid + Math.imul(ah2, bl6)) | 0; + hi = (hi + Math.imul(ah2, bh6)) | 0; + lo = (lo + Math.imul(al1, bl7)) | 0; + mid = (mid + Math.imul(al1, bh7)) | 0; + mid = (mid + Math.imul(ah1, bl7)) | 0; + hi = (hi + Math.imul(ah1, bh7)) | 0; + lo = (lo + Math.imul(al0, bl8)) | 0; + mid = (mid + Math.imul(al0, bh8)) | 0; + mid = (mid + Math.imul(ah0, bl8)) | 0; + hi = (hi + Math.imul(ah0, bh8)) | 0; + var w8 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = (mid + Math.imul(ah9, bl0)) | 0; + hi = Math.imul(ah9, bh0); + lo = (lo + Math.imul(al8, bl1)) | 0; + mid = (mid + Math.imul(al8, bh1)) | 0; + mid = (mid + Math.imul(ah8, bl1)) | 0; + hi = (hi + Math.imul(ah8, bh1)) | 0; + lo = (lo + Math.imul(al7, bl2)) | 0; + mid = (mid + Math.imul(al7, bh2)) | 0; + mid = (mid + Math.imul(ah7, bl2)) | 0; + hi = (hi + Math.imul(ah7, bh2)) | 0; + lo = (lo + Math.imul(al6, bl3)) | 0; + mid = (mid + Math.imul(al6, bh3)) | 0; + mid = (mid + Math.imul(ah6, bl3)) | 0; + hi = (hi + Math.imul(ah6, bh3)) | 0; + lo = (lo + Math.imul(al5, bl4)) | 0; + mid = (mid + Math.imul(al5, bh4)) | 0; + mid = (mid + Math.imul(ah5, bl4)) | 0; + hi = (hi + Math.imul(ah5, bh4)) | 0; + lo = (lo + Math.imul(al4, bl5)) | 0; + mid = (mid + Math.imul(al4, bh5)) | 0; + mid = (mid + Math.imul(ah4, bl5)) | 0; + hi = (hi + Math.imul(ah4, bh5)) | 0; + lo = (lo + Math.imul(al3, bl6)) | 0; + mid = (mid + Math.imul(al3, bh6)) | 0; + mid = (mid + Math.imul(ah3, bl6)) | 0; + hi = (hi + Math.imul(ah3, bh6)) | 0; + lo = (lo + Math.imul(al2, bl7)) | 0; + mid = (mid + Math.imul(al2, bh7)) | 0; + mid = (mid + Math.imul(ah2, bl7)) | 0; + hi = (hi + Math.imul(ah2, bh7)) | 0; + lo = (lo + Math.imul(al1, bl8)) | 0; + mid = (mid + Math.imul(al1, bh8)) | 0; + mid = (mid + Math.imul(ah1, bl8)) | 0; + hi = (hi + Math.imul(ah1, bh8)) | 0; + lo = (lo + Math.imul(al0, bl9)) | 0; + mid = (mid + Math.imul(al0, bh9)) | 0; + mid = (mid + Math.imul(ah0, bl9)) | 0; + hi = (hi + Math.imul(ah0, bh9)) | 0; + var w9 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = (mid + Math.imul(ah9, bl1)) | 0; + hi = Math.imul(ah9, bh1); + lo = (lo + Math.imul(al8, bl2)) | 0; + mid = (mid + Math.imul(al8, bh2)) | 0; + mid = (mid + Math.imul(ah8, bl2)) | 0; + hi = (hi + Math.imul(ah8, bh2)) | 0; + lo = (lo + Math.imul(al7, bl3)) | 0; + mid = (mid + Math.imul(al7, bh3)) | 0; + mid = (mid + Math.imul(ah7, bl3)) | 0; + hi = (hi + Math.imul(ah7, bh3)) | 0; + lo = (lo + Math.imul(al6, bl4)) | 0; + mid = (mid + Math.imul(al6, bh4)) | 0; + mid = (mid + Math.imul(ah6, bl4)) | 0; + hi = (hi + Math.imul(ah6, bh4)) | 0; + lo = (lo + Math.imul(al5, bl5)) | 0; + mid = (mid + Math.imul(al5, bh5)) | 0; + mid = (mid + Math.imul(ah5, bl5)) | 0; + hi = (hi + Math.imul(ah5, bh5)) | 0; + lo = (lo + Math.imul(al4, bl6)) | 0; + mid = (mid + Math.imul(al4, bh6)) | 0; + mid = (mid + Math.imul(ah4, bl6)) | 0; + hi = (hi + Math.imul(ah4, bh6)) | 0; + lo = (lo + Math.imul(al3, bl7)) | 0; + mid = (mid + Math.imul(al3, bh7)) | 0; + mid = (mid + Math.imul(ah3, bl7)) | 0; + hi = (hi + Math.imul(ah3, bh7)) | 0; + lo = (lo + Math.imul(al2, bl8)) | 0; + mid = (mid + Math.imul(al2, bh8)) | 0; + mid = (mid + Math.imul(ah2, bl8)) | 0; + hi = (hi + Math.imul(ah2, bh8)) | 0; + lo = (lo + Math.imul(al1, bl9)) | 0; + mid = (mid + Math.imul(al1, bh9)) | 0; + mid = (mid + Math.imul(ah1, bl9)) | 0; + hi = (hi + Math.imul(ah1, bh9)) | 0; + var w10 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = (mid + Math.imul(ah9, bl2)) | 0; + hi = Math.imul(ah9, bh2); + lo = (lo + Math.imul(al8, bl3)) | 0; + mid = (mid + Math.imul(al8, bh3)) | 0; + mid = (mid + Math.imul(ah8, bl3)) | 0; + hi = (hi + Math.imul(ah8, bh3)) | 0; + lo = (lo + Math.imul(al7, bl4)) | 0; + mid = (mid + Math.imul(al7, bh4)) | 0; + mid = (mid + Math.imul(ah7, bl4)) | 0; + hi = (hi + Math.imul(ah7, bh4)) | 0; + lo = (lo + Math.imul(al6, bl5)) | 0; + mid = (mid + Math.imul(al6, bh5)) | 0; + mid = (mid + Math.imul(ah6, bl5)) | 0; + hi = (hi + Math.imul(ah6, bh5)) | 0; + lo = (lo + Math.imul(al5, bl6)) | 0; + mid = (mid + Math.imul(al5, bh6)) | 0; + mid = (mid + Math.imul(ah5, bl6)) | 0; + hi = (hi + Math.imul(ah5, bh6)) | 0; + lo = (lo + Math.imul(al4, bl7)) | 0; + mid = (mid + Math.imul(al4, bh7)) | 0; + mid = (mid + Math.imul(ah4, bl7)) | 0; + hi = (hi + Math.imul(ah4, bh7)) | 0; + lo = (lo + Math.imul(al3, bl8)) | 0; + mid = (mid + Math.imul(al3, bh8)) | 0; + mid = (mid + Math.imul(ah3, bl8)) | 0; + hi = (hi + Math.imul(ah3, bh8)) | 0; + lo = (lo + Math.imul(al2, bl9)) | 0; + mid = (mid + Math.imul(al2, bh9)) | 0; + mid = (mid + Math.imul(ah2, bl9)) | 0; + hi = (hi + Math.imul(ah2, bh9)) | 0; + var w11 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = (mid + Math.imul(ah9, bl3)) | 0; + hi = Math.imul(ah9, bh3); + lo = (lo + Math.imul(al8, bl4)) | 0; + mid = (mid + Math.imul(al8, bh4)) | 0; + mid = (mid + Math.imul(ah8, bl4)) | 0; + hi = (hi + Math.imul(ah8, bh4)) | 0; + lo = (lo + Math.imul(al7, bl5)) | 0; + mid = (mid + Math.imul(al7, bh5)) | 0; + mid = (mid + Math.imul(ah7, bl5)) | 0; + hi = (hi + Math.imul(ah7, bh5)) | 0; + lo = (lo + Math.imul(al6, bl6)) | 0; + mid = (mid + Math.imul(al6, bh6)) | 0; + mid = (mid + Math.imul(ah6, bl6)) | 0; + hi = (hi + Math.imul(ah6, bh6)) | 0; + lo = (lo + Math.imul(al5, bl7)) | 0; + mid = (mid + Math.imul(al5, bh7)) | 0; + mid = (mid + Math.imul(ah5, bl7)) | 0; + hi = (hi + Math.imul(ah5, bh7)) | 0; + lo = (lo + Math.imul(al4, bl8)) | 0; + mid = (mid + Math.imul(al4, bh8)) | 0; + mid = (mid + Math.imul(ah4, bl8)) | 0; + hi = (hi + Math.imul(ah4, bh8)) | 0; + lo = (lo + Math.imul(al3, bl9)) | 0; + mid = (mid + Math.imul(al3, bh9)) | 0; + mid = (mid + Math.imul(ah3, bl9)) | 0; + hi = (hi + Math.imul(ah3, bh9)) | 0; + var w12 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = (mid + Math.imul(ah9, bl4)) | 0; + hi = Math.imul(ah9, bh4); + lo = (lo + Math.imul(al8, bl5)) | 0; + mid = (mid + Math.imul(al8, bh5)) | 0; + mid = (mid + Math.imul(ah8, bl5)) | 0; + hi = (hi + Math.imul(ah8, bh5)) | 0; + lo = (lo + Math.imul(al7, bl6)) | 0; + mid = (mid + Math.imul(al7, bh6)) | 0; + mid = (mid + Math.imul(ah7, bl6)) | 0; + hi = (hi + Math.imul(ah7, bh6)) | 0; + lo = (lo + Math.imul(al6, bl7)) | 0; + mid = (mid + Math.imul(al6, bh7)) | 0; + mid = (mid + Math.imul(ah6, bl7)) | 0; + hi = (hi + Math.imul(ah6, bh7)) | 0; + lo = (lo + Math.imul(al5, bl8)) | 0; + mid = (mid + Math.imul(al5, bh8)) | 0; + mid = (mid + Math.imul(ah5, bl8)) | 0; + hi = (hi + Math.imul(ah5, bh8)) | 0; + lo = (lo + Math.imul(al4, bl9)) | 0; + mid = (mid + Math.imul(al4, bh9)) | 0; + mid = (mid + Math.imul(ah4, bl9)) | 0; + hi = (hi + Math.imul(ah4, bh9)) | 0; + var w13 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = (mid + Math.imul(ah9, bl5)) | 0; + hi = Math.imul(ah9, bh5); + lo = (lo + Math.imul(al8, bl6)) | 0; + mid = (mid + Math.imul(al8, bh6)) | 0; + mid = (mid + Math.imul(ah8, bl6)) | 0; + hi = (hi + Math.imul(ah8, bh6)) | 0; + lo = (lo + Math.imul(al7, bl7)) | 0; + mid = (mid + Math.imul(al7, bh7)) | 0; + mid = (mid + Math.imul(ah7, bl7)) | 0; + hi = (hi + Math.imul(ah7, bh7)) | 0; + lo = (lo + Math.imul(al6, bl8)) | 0; + mid = (mid + Math.imul(al6, bh8)) | 0; + mid = (mid + Math.imul(ah6, bl8)) | 0; + hi = (hi + Math.imul(ah6, bh8)) | 0; + lo = (lo + Math.imul(al5, bl9)) | 0; + mid = (mid + Math.imul(al5, bh9)) | 0; + mid = (mid + Math.imul(ah5, bl9)) | 0; + hi = (hi + Math.imul(ah5, bh9)) | 0; + var w14 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = (mid + Math.imul(ah9, bl6)) | 0; + hi = Math.imul(ah9, bh6); + lo = (lo + Math.imul(al8, bl7)) | 0; + mid = (mid + Math.imul(al8, bh7)) | 0; + mid = (mid + Math.imul(ah8, bl7)) | 0; + hi = (hi + Math.imul(ah8, bh7)) | 0; + lo = (lo + Math.imul(al7, bl8)) | 0; + mid = (mid + Math.imul(al7, bh8)) | 0; + mid = (mid + Math.imul(ah7, bl8)) | 0; + hi = (hi + Math.imul(ah7, bh8)) | 0; + lo = (lo + Math.imul(al6, bl9)) | 0; + mid = (mid + Math.imul(al6, bh9)) | 0; + mid = (mid + Math.imul(ah6, bl9)) | 0; + hi = (hi + Math.imul(ah6, bh9)) | 0; + var w15 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = (mid + Math.imul(ah9, bl7)) | 0; + hi = Math.imul(ah9, bh7); + lo = (lo + Math.imul(al8, bl8)) | 0; + mid = (mid + Math.imul(al8, bh8)) | 0; + mid = (mid + Math.imul(ah8, bl8)) | 0; + hi = (hi + Math.imul(ah8, bh8)) | 0; + lo = (lo + Math.imul(al7, bl9)) | 0; + mid = (mid + Math.imul(al7, bh9)) | 0; + mid = (mid + Math.imul(ah7, bl9)) | 0; + hi = (hi + Math.imul(ah7, bh9)) | 0; + var w16 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = (mid + Math.imul(ah9, bl8)) | 0; + hi = Math.imul(ah9, bh8); + lo = (lo + Math.imul(al8, bl9)) | 0; + mid = (mid + Math.imul(al8, bh9)) | 0; + mid = (mid + Math.imul(ah8, bl9)) | 0; + hi = (hi + Math.imul(ah8, bh9)) | 0; + var w17 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = (mid + Math.imul(ah9, bl9)) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0; + w18 &= 67108863; + o2[0] = w0; + o2[1] = w1; + o2[2] = w2; + o2[3] = w3; + o2[4] = w4; + o2[5] = w5; + o2[6] = w6; + o2[7] = w7; + o2[8] = w8; + o2[9] = w9; + o2[10] = w10; + o2[11] = w11; + o2[12] = w12; + o2[13] = w13; + o2[14] = w14; + o2[15] = w15; + o2[16] = w16; + o2[17] = w17; + o2[18] = w18; + if (c !== 0) { + o2[19] = c; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k = 0; k < out.length - 1; k++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k, num.length - 1); + for (var j = Math.max(0, k - self2.length + 1); j <= maxJ; j++) { + var i2 = k - j; + var a2 = self2.words[i2] | 0; + var b = num.words[j] | 0; + var r3 = a2 * b; + var lo = r3 & 67108863; + ncarry = (ncarry + ((r3 / 67108864) | 0)) | 0; + lo = (lo + rword) | 0; + rword = lo & 67108863; + ncarry = (ncarry + (lo >>> 26)) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k] = carry; + } else { + out.length--; + } + return out._strip(); + } + function jumboMulTo(self2, num, out) { + return bigMulTo(self2, num, out); + } + BN3.prototype.mulTo = function mulTo(num, out) { + var res; + var len = this.length + num.length; + if (this.length === 10 && num.length === 10) { + res = comb10MulTo(this, num, out); + } else if (len < 63) { + res = smallMulTo(this, num, out); + } else if (len < 1024) { + res = bigMulTo(this, num, out); + } else { + res = jumboMulTo(this, num, out); + } + return res; + }; + function FFTM(x, y) { + this.x = x; + this.y = y; + } + FFTM.prototype.makeRBT = function makeRBT(N2) { + var t2 = new Array(N2); + var l2 = BN3.prototype._countBits(N2) - 1; + for (var i2 = 0; i2 < N2; i2++) { + t2[i2] = this.revBin(i2, l2, N2); + } + return t2; + }; + FFTM.prototype.revBin = function revBin(x, l2, N2) { + if (x === 0 || x === N2 - 1) return x; + var rb = 0; + for (var i2 = 0; i2 < l2; i2++) { + rb |= (x & 1) << (l2 - i2 - 1); + x >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N2) { + for (var i2 = 0; i2 < N2; i2++) { + rtws[i2] = rws[rbt[i2]]; + itws[i2] = iws[rbt[i2]]; + } + }; + FFTM.prototype.transform = function transform( + rws, + iws, + rtws, + itws, + N2, + rbt + ) { + this.permute(rbt, rws, iws, rtws, itws, N2); + for (var s2 = 1; s2 < N2; s2 <<= 1) { + var l2 = s2 << 1; + var rtwdf = Math.cos((2 * Math.PI) / l2); + var itwdf = Math.sin((2 * Math.PI) / l2); + for (var p = 0; p < N2; p += l2) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j = 0; j < s2; j++) { + var re = rtws[p + j]; + var ie = itws[p + j]; + var ro = rtws[p + j + s2]; + var io = itws[p + j + s2]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p + j] = re + ro; + itws[p + j] = ie + io; + rtws[p + j + s2] = re - ro; + itws[p + j + s2] = ie - io; + if (j !== l2) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n2, m) { + var N2 = Math.max(m, n2) | 1; + var odd = N2 & 1; + var i2 = 0; + for (N2 = (N2 / 2) | 0; N2; N2 = N2 >>> 1) { + i2++; + } + return 1 << (i2 + 1 + odd); + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N2) { + if (N2 <= 1) return; + for (var i2 = 0; i2 < N2 / 2; i2++) { + var t2 = rws[i2]; + rws[i2] = rws[N2 - i2 - 1]; + rws[N2 - i2 - 1] = t2; + t2 = iws[i2]; + iws[i2] = -iws[N2 - i2 - 1]; + iws[N2 - i2 - 1] = -t2; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N2) { + var carry = 0; + for (var i2 = 0; i2 < N2 / 2; i2++) { + var w = + Math.round(ws[2 * i2 + 1] / N2) * 8192 + + Math.round(ws[2 * i2] / N2) + + carry; + ws[i2] = w & 67108863; + if (w < 67108864) { + carry = 0; + } else { + carry = (w / 67108864) | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N2) { + var carry = 0; + for (var i2 = 0; i2 < len; i2++) { + carry = carry + (ws[i2] | 0); + rws[2 * i2] = carry & 8191; + carry = carry >>> 13; + rws[2 * i2 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i2 = 2 * len; i2 < N2; ++i2) { + rws[i2] = 0; + } + assert2(carry === 0); + assert2((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N2) { + var ph = new Array(N2); + for (var i2 = 0; i2 < N2; i2++) { + ph[i2] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x, y, out) { + var N2 = 2 * this.guessLen13b(x.length, y.length); + var rbt = this.makeRBT(N2); + var _ = this.stub(N2); + var rws = new Array(N2); + var rwst = new Array(N2); + var iwst = new Array(N2); + var nrws = new Array(N2); + var nrwst = new Array(N2); + var niwst = new Array(N2); + var rmws = out.words; + rmws.length = N2; + this.convert13b(x.words, x.length, rws, N2); + this.convert13b(y.words, y.length, nrws, N2); + this.transform(rws, _, rwst, iwst, N2, rbt); + this.transform(nrws, _, nrwst, niwst, N2, rbt); + for (var i2 = 0; i2 < N2; i2++) { + var rx = rwst[i2] * nrwst[i2] - iwst[i2] * niwst[i2]; + iwst[i2] = rwst[i2] * niwst[i2] + iwst[i2] * nrwst[i2]; + rwst[i2] = rx; + } + this.conjugate(rwst, iwst, N2); + this.transform(rwst, iwst, rmws, _, N2, rbt); + this.conjugate(rmws, _, N2); + this.normalize13b(rmws, N2); + out.negative = x.negative ^ y.negative; + out.length = x.length + y.length; + return out._strip(); + }; + BN3.prototype.mul = function mul3(num) { + var out = new BN3(null); + out.words = new Array(this.length + num.length); + return this.mulTo(num, out); + }; + BN3.prototype.mulf = function mulf(num) { + var out = new BN3(null); + out.words = new Array(this.length + num.length); + return jumboMulTo(this, num, out); + }; + BN3.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this); + }; + BN3.prototype.imuln = function imuln(num) { + var isNegNum = num < 0; + if (isNegNum) num = -num; + assert2(typeof num === 'number'); + assert2(num < 67108864); + var carry = 0; + for (var i2 = 0; i2 < this.length; i2++) { + var w = (this.words[i2] | 0) * num; + var lo = (w & 67108863) + (carry & 67108863); + carry >>= 26; + carry += (w / 67108864) | 0; + carry += lo >>> 26; + this.words[i2] = lo & 67108863; + } + if (carry !== 0) { + this.words[i2] = carry; + this.length++; + } + return isNegNum ? this.ineg() : this; + }; + BN3.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN3.prototype.sqr = function sqr() { + return this.mul(this); + }; + BN3.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN3.prototype.pow = function pow(num) { + var w = toBitArray(num); + if (w.length === 0) return new BN3(1); + var res = this; + for (var i2 = 0; i2 < w.length; i2++, res = res.sqr()) { + if (w[i2] !== 0) break; + } + if (++i2 < w.length) { + for (var q = res.sqr(); i2 < w.length; i2++, q = q.sqr()) { + if (w[i2] === 0) continue; + res = res.mul(q); + } + } + return res; + }; + BN3.prototype.iushln = function iushln(bits) { + assert2(typeof bits === 'number' && bits >= 0); + var r3 = bits % 26; + var s2 = (bits - r3) / 26; + var carryMask = (67108863 >>> (26 - r3)) << (26 - r3); + var i2; + if (r3 !== 0) { + var carry = 0; + for (i2 = 0; i2 < this.length; i2++) { + var newCarry = this.words[i2] & carryMask; + var c = ((this.words[i2] | 0) - newCarry) << r3; + this.words[i2] = c | carry; + carry = newCarry >>> (26 - r3); + } + if (carry) { + this.words[i2] = carry; + this.length++; + } + } + if (s2 !== 0) { + for (i2 = this.length - 1; i2 >= 0; i2--) { + this.words[i2 + s2] = this.words[i2]; + } + for (i2 = 0; i2 < s2; i2++) { + this.words[i2] = 0; + } + this.length += s2; + } + return this._strip(); + }; + BN3.prototype.ishln = function ishln(bits) { + assert2(this.negative === 0); + return this.iushln(bits); + }; + BN3.prototype.iushrn = function iushrn(bits, hint, extended) { + assert2(typeof bits === 'number' && bits >= 0); + var h; + if (hint) { + h = (hint - (hint % 26)) / 26; + } else { + h = 0; + } + var r3 = bits % 26; + var s2 = Math.min((bits - r3) / 26, this.length); + var mask = 67108863 ^ ((67108863 >>> r3) << r3); + var maskedWords = extended; + h -= s2; + h = Math.max(0, h); + if (maskedWords) { + for (var i2 = 0; i2 < s2; i2++) { + maskedWords.words[i2] = this.words[i2]; + } + maskedWords.length = s2; + } + if (s2 === 0) { + } else if (this.length > s2) { + this.length -= s2; + for (i2 = 0; i2 < this.length; i2++) { + this.words[i2] = this.words[i2 + s2]; + } + } else { + this.words[0] = 0; + this.length = 1; + } + var carry = 0; + for (i2 = this.length - 1; i2 >= 0 && (carry !== 0 || i2 >= h); i2--) { + var word = this.words[i2] | 0; + this.words[i2] = (carry << (26 - r3)) | (word >>> r3); + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if (this.length === 0) { + this.words[0] = 0; + this.length = 1; + } + return this._strip(); + }; + BN3.prototype.ishrn = function ishrn(bits, hint, extended) { + assert2(this.negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN3.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN3.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN3.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN3.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN3.prototype.testn = function testn(bit) { + assert2(typeof bit === 'number' && bit >= 0); + var r3 = bit % 26; + var s2 = (bit - r3) / 26; + var q = 1 << r3; + if (this.length <= s2) return false; + var w = this.words[s2]; + return !!(w & q); + }; + BN3.prototype.imaskn = function imaskn(bits) { + assert2(typeof bits === 'number' && bits >= 0); + var r3 = bits % 26; + var s2 = (bits - r3) / 26; + assert2(this.negative === 0, 'imaskn works only with positive numbers'); + if (this.length <= s2) { + return this; + } + if (r3 !== 0) { + s2++; + } + this.length = Math.min(s2, this.length); + if (r3 !== 0) { + var mask = 67108863 ^ ((67108863 >>> r3) << r3); + this.words[this.length - 1] &= mask; + } + return this._strip(); + }; + BN3.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN3.prototype.iaddn = function iaddn(num) { + assert2(typeof num === 'number'); + assert2(num < 67108864); + if (num < 0) return this.isubn(-num); + if (this.negative !== 0) { + if (this.length === 1 && (this.words[0] | 0) <= num) { + this.words[0] = num - (this.words[0] | 0); + this.negative = 0; + return this; + } + this.negative = 0; + this.isubn(num); + this.negative = 1; + return this; + } + return this._iaddn(num); + }; + BN3.prototype._iaddn = function _iaddn(num) { + this.words[0] += num; + for (var i2 = 0; i2 < this.length && this.words[i2] >= 67108864; i2++) { + this.words[i2] -= 67108864; + if (i2 === this.length - 1) { + this.words[i2 + 1] = 1; + } else { + this.words[i2 + 1]++; + } + } + this.length = Math.max(this.length, i2 + 1); + return this; + }; + BN3.prototype.isubn = function isubn(num) { + assert2(typeof num === 'number'); + assert2(num < 67108864); + if (num < 0) return this.iaddn(-num); + if (this.negative !== 0) { + this.negative = 0; + this.iaddn(num); + this.negative = 1; + return this; + } + this.words[0] -= num; + if (this.length === 1 && this.words[0] < 0) { + this.words[0] = -this.words[0]; + this.negative = 1; + } else { + for (var i2 = 0; i2 < this.length && this.words[i2] < 0; i2++) { + this.words[i2] += 67108864; + this.words[i2 + 1] -= 1; + } + } + return this._strip(); + }; + BN3.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN3.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN3.prototype.iabs = function iabs() { + this.negative = 0; + return this; + }; + BN3.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN3.prototype._ishlnsubmul = function _ishlnsubmul(num, mul3, shift) { + var len = num.length + shift; + var i2; + this._expand(len); + var w; + var carry = 0; + for (i2 = 0; i2 < num.length; i2++) { + w = (this.words[i2 + shift] | 0) + carry; + var right = (num.words[i2] | 0) * mul3; + w -= right & 67108863; + carry = (w >> 26) - ((right / 67108864) | 0); + this.words[i2 + shift] = w & 67108863; + } + for (; i2 < this.length - shift; i2++) { + w = (this.words[i2 + shift] | 0) + carry; + carry = w >> 26; + this.words[i2 + shift] = w & 67108863; + } + if (carry === 0) return this._strip(); + assert2(carry === -1); + carry = 0; + for (i2 = 0; i2 < this.length; i2++) { + w = -(this.words[i2] | 0) + carry; + carry = w >> 26; + this.words[i2] = w & 67108863; + } + this.negative = 1; + return this._strip(); + }; + BN3.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = this.length - num.length; + var a2 = this.clone(); + var b = num; + var bhi = b.words[b.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b = b.ushln(shift); + a2.iushln(shift); + bhi = b.words[b.length - 1] | 0; + } + var m = a2.length - b.length; + var q; + if (mode !== 'mod') { + q = new BN3(null); + q.length = m + 1; + q.words = new Array(q.length); + for (var i2 = 0; i2 < q.length; i2++) { + q.words[i2] = 0; + } + } + var diff = a2.clone()._ishlnsubmul(b, 1, m); + if (diff.negative === 0) { + a2 = diff; + if (q) { + q.words[m] = 1; + } + } + for (var j = m - 1; j >= 0; j--) { + var qj = + (a2.words[b.length + j] | 0) * 67108864 + + (a2.words[b.length + j - 1] | 0); + qj = Math.min((qj / bhi) | 0, 67108863); + a2._ishlnsubmul(b, qj, j); + while (a2.negative !== 0) { + qj--; + a2.negative = 0; + a2._ishlnsubmul(b, 1, j); + if (!a2.isZero()) { + a2.negative ^= 1; + } + } + if (q) { + q.words[j] = qj; + } + } + if (q) { + q._strip(); + } + a2._strip(); + if (mode !== 'div' && shift !== 0) { + a2.iushrn(shift); + } + return { + div: q || null, + mod: a2, + }; + }; + BN3.prototype.divmod = function divmod(num, mode, positive) { + assert2(!num.isZero()); + if (this.isZero()) { + return { + div: new BN3(0), + mod: new BN3(0), + }; + } + var div, mod, res; + if (this.negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== 'mod') { + div = res.div.neg(); + } + if (mode !== 'div') { + mod = res.mod.neg(); + if (positive && mod.negative !== 0) { + mod.iadd(num); + } + } + return { + div, + mod, + }; + } + if (this.negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== 'mod') { + div = res.div.neg(); + } + return { + div, + mod: res.mod, + }; + } + if ((this.negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== 'div') { + mod = res.mod.neg(); + if (positive && mod.negative !== 0) { + mod.isub(num); + } + } + return { + div: res.div, + mod, + }; + } + if (num.length > this.length || this.cmp(num) < 0) { + return { + div: new BN3(0), + mod: this, + }; + } + if (num.length === 1) { + if (mode === 'div') { + return { + div: this.divn(num.words[0]), + mod: null, + }; + } + if (mode === 'mod') { + return { + div: null, + mod: new BN3(this.modrn(num.words[0])), + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN3(this.modrn(num.words[0])), + }; + } + return this._wordDiv(num, mode); + }; + BN3.prototype.div = function div(num) { + return this.divmod(num, 'div', false).div; + }; + BN3.prototype.mod = function mod(num) { + return this.divmod(num, 'mod', false).mod; + }; + BN3.prototype.umod = function umod(num) { + return this.divmod(num, 'mod', true).mod; + }; + BN3.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) return dm.div; + var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod.cmp(half); + if (cmp < 0 || (r22 === 1 && cmp === 0)) return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN3.prototype.modrn = function modrn(num) { + var isNegNum = num < 0; + if (isNegNum) num = -num; + assert2(num <= 67108863); + var p = (1 << 26) % num; + var acc = 0; + for (var i2 = this.length - 1; i2 >= 0; i2--) { + acc = (p * acc + (this.words[i2] | 0)) % num; + } + return isNegNum ? -acc : acc; + }; + BN3.prototype.modn = function modn(num) { + return this.modrn(num); + }; + BN3.prototype.idivn = function idivn(num) { + var isNegNum = num < 0; + if (isNegNum) num = -num; + assert2(num <= 67108863); + var carry = 0; + for (var i2 = this.length - 1; i2 >= 0; i2--) { + var w = (this.words[i2] | 0) + carry * 67108864; + this.words[i2] = (w / num) | 0; + carry = w % num; + } + this._strip(); + return isNegNum ? this.ineg() : this; + }; + BN3.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN3.prototype.egcd = function egcd(p) { + assert2(p.negative === 0); + assert2(!p.isZero()); + var x = this; + var y = p.clone(); + if (x.negative !== 0) { + x = x.umod(p); + } else { + x = x.clone(); + } + var A2 = new BN3(1); + var B = new BN3(0); + var C = new BN3(0); + var D3 = new BN3(1); + var g = 0; + while (x.isEven() && y.isEven()) { + x.iushrn(1); + y.iushrn(1); + ++g; + } + var yp = y.clone(); + var xp = x.clone(); + while (!x.isZero()) { + for ( + var i2 = 0, im = 1; + (x.words[0] & im) === 0 && i2 < 26; + ++i2, im <<= 1 + ); + if (i2 > 0) { + x.iushrn(i2); + while (i2-- > 0) { + if (A2.isOdd() || B.isOdd()) { + A2.iadd(yp); + B.isub(xp); + } + A2.iushrn(1); + B.iushrn(1); + } + } + for ( + var j = 0, jm = 1; + (y.words[0] & jm) === 0 && j < 26; + ++j, jm <<= 1 + ); + if (j > 0) { + y.iushrn(j); + while (j-- > 0) { + if (C.isOdd() || D3.isOdd()) { + C.iadd(yp); + D3.isub(xp); + } + C.iushrn(1); + D3.iushrn(1); + } + } + if (x.cmp(y) >= 0) { + x.isub(y); + A2.isub(C); + B.isub(D3); + } else { + y.isub(x); + C.isub(A2); + D3.isub(B); + } + } + return { + a: C, + b: D3, + gcd: y.iushln(g), + }; + }; + BN3.prototype._invmp = function _invmp(p) { + assert2(p.negative === 0); + assert2(!p.isZero()); + var a2 = this; + var b = p.clone(); + if (a2.negative !== 0) { + a2 = a2.umod(p); + } else { + a2 = a2.clone(); + } + var x1 = new BN3(1); + var x2 = new BN3(0); + var delta = b.clone(); + while (a2.cmpn(1) > 0 && b.cmpn(1) > 0) { + for ( + var i2 = 0, im = 1; + (a2.words[0] & im) === 0 && i2 < 26; + ++i2, im <<= 1 + ); + if (i2 > 0) { + a2.iushrn(i2); + while (i2-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for ( + var j = 0, jm = 1; + (b.words[0] & jm) === 0 && j < 26; + ++j, jm <<= 1 + ); + if (j > 0) { + b.iushrn(j); + while (j-- > 0) { + if (x2.isOdd()) { + x2.iadd(delta); + } + x2.iushrn(1); + } + } + if (a2.cmp(b) >= 0) { + a2.isub(b); + x1.isub(x2); + } else { + b.isub(a2); + x2.isub(x1); + } + } + var res; + if (a2.cmpn(1) === 0) { + res = x1; + } else { + res = x2; + } + if (res.cmpn(0) < 0) { + res.iadd(p); + } + return res; + }; + BN3.prototype.gcd = function gcd(num) { + if (this.isZero()) return num.abs(); + if (num.isZero()) return this.abs(); + var a2 = this.clone(); + var b = num.clone(); + a2.negative = 0; + b.negative = 0; + for (var shift = 0; a2.isEven() && b.isEven(); shift++) { + a2.iushrn(1); + b.iushrn(1); + } + do { + while (a2.isEven()) { + a2.iushrn(1); + } + while (b.isEven()) { + b.iushrn(1); + } + var r3 = a2.cmp(b); + if (r3 < 0) { + var t2 = a2; + a2 = b; + b = t2; + } else if (r3 === 0 || b.cmpn(1) === 0) { + break; + } + a2.isub(b); + } while (true); + return b.iushln(shift); + }; + BN3.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN3.prototype.isEven = function isEven() { + return (this.words[0] & 1) === 0; + }; + BN3.prototype.isOdd = function isOdd() { + return (this.words[0] & 1) === 1; + }; + BN3.prototype.andln = function andln(num) { + return this.words[0] & num; + }; + BN3.prototype.bincn = function bincn(bit) { + assert2(typeof bit === 'number'); + var r3 = bit % 26; + var s2 = (bit - r3) / 26; + var q = 1 << r3; + if (this.length <= s2) { + this._expand(s2 + 1); + this.words[s2] |= q; + return this; + } + var carry = q; + for (var i2 = s2; carry !== 0 && i2 < this.length; i2++) { + var w = this.words[i2] | 0; + w += carry; + carry = w >>> 26; + w &= 67108863; + this.words[i2] = w; + } + if (carry !== 0) { + this.words[i2] = carry; + this.length++; + } + return this; + }; + BN3.prototype.isZero = function isZero() { + return this.length === 1 && this.words[0] === 0; + }; + BN3.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if (this.negative !== 0 && !negative) return -1; + if (this.negative === 0 && negative) return 1; + this._strip(); + var res; + if (this.length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert2(num <= 67108863, 'Number is too big'); + var w = this.words[0] | 0; + res = w === num ? 0 : w < num ? -1 : 1; + } + if (this.negative !== 0) return -res | 0; + return res; + }; + BN3.prototype.cmp = function cmp(num) { + if (this.negative !== 0 && num.negative === 0) return -1; + if (this.negative === 0 && num.negative !== 0) return 1; + var res = this.ucmp(num); + if (this.negative !== 0) return -res | 0; + return res; + }; + BN3.prototype.ucmp = function ucmp(num) { + if (this.length > num.length) return 1; + if (this.length < num.length) return -1; + var res = 0; + for (var i2 = this.length - 1; i2 >= 0; i2--) { + var a2 = this.words[i2] | 0; + var b = num.words[i2] | 0; + if (a2 === b) continue; + if (a2 < b) { + res = -1; + } else if (a2 > b) { + res = 1; + } + break; + } + return res; + }; + BN3.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN3.prototype.gt = function gt(num) { + return this.cmp(num) === 1; + }; + BN3.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN3.prototype.gte = function gte(num) { + return this.cmp(num) >= 0; + }; + BN3.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN3.prototype.lt = function lt(num) { + return this.cmp(num) === -1; + }; + BN3.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN3.prototype.lte = function lte(num) { + return this.cmp(num) <= 0; + }; + BN3.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN3.prototype.eq = function eq4(num) { + return this.cmp(num) === 0; + }; + BN3.red = function red(num) { + return new Red(num); + }; + BN3.prototype.toRed = function toRed(ctx) { + assert2(!this.red, 'Already a number in reduction context'); + assert2(this.negative === 0, 'red works only with positives'); + return ctx.convertTo(this)._forceRed(ctx); + }; + BN3.prototype.fromRed = function fromRed() { + assert2( + this.red, + 'fromRed works only with numbers in reduction context' + ); + return this.red.convertFrom(this); + }; + BN3.prototype._forceRed = function _forceRed(ctx) { + this.red = ctx; + return this; + }; + BN3.prototype.forceRed = function forceRed(ctx) { + assert2(!this.red, 'Already a number in reduction context'); + return this._forceRed(ctx); + }; + BN3.prototype.redAdd = function redAdd(num) { + assert2(this.red, 'redAdd works only with red numbers'); + return this.red.add(this, num); + }; + BN3.prototype.redIAdd = function redIAdd(num) { + assert2(this.red, 'redIAdd works only with red numbers'); + return this.red.iadd(this, num); + }; + BN3.prototype.redSub = function redSub(num) { + assert2(this.red, 'redSub works only with red numbers'); + return this.red.sub(this, num); + }; + BN3.prototype.redISub = function redISub(num) { + assert2(this.red, 'redISub works only with red numbers'); + return this.red.isub(this, num); + }; + BN3.prototype.redShl = function redShl(num) { + assert2(this.red, 'redShl works only with red numbers'); + return this.red.shl(this, num); + }; + BN3.prototype.redMul = function redMul(num) { + assert2(this.red, 'redMul works only with red numbers'); + this.red._verify2(this, num); + return this.red.mul(this, num); + }; + BN3.prototype.redIMul = function redIMul(num) { + assert2(this.red, 'redMul works only with red numbers'); + this.red._verify2(this, num); + return this.red.imul(this, num); + }; + BN3.prototype.redSqr = function redSqr() { + assert2(this.red, 'redSqr works only with red numbers'); + this.red._verify1(this); + return this.red.sqr(this); + }; + BN3.prototype.redISqr = function redISqr() { + assert2(this.red, 'redISqr works only with red numbers'); + this.red._verify1(this); + return this.red.isqr(this); + }; + BN3.prototype.redSqrt = function redSqrt() { + assert2(this.red, 'redSqrt works only with red numbers'); + this.red._verify1(this); + return this.red.sqrt(this); + }; + BN3.prototype.redInvm = function redInvm() { + assert2(this.red, 'redInvm works only with red numbers'); + this.red._verify1(this); + return this.red.invm(this); + }; + BN3.prototype.redNeg = function redNeg() { + assert2(this.red, 'redNeg works only with red numbers'); + this.red._verify1(this); + return this.red.neg(this); + }; + BN3.prototype.redPow = function redPow(num) { + assert2(this.red && !num.red, 'redPow(normalNum)'); + this.red._verify1(this); + return this.red.pow(this, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null, + }; + function MPrime(name, p) { + this.name = name; + this.p = new BN3(p, 16); + this.n = this.p.bitLength(); + this.k = new BN3(1).iushln(this.n).isub(this.p); + this.tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN3(null); + tmp.words = new Array(Math.ceil(this.n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r3 = num; + var rlen; + do { + this.split(r3, this.tmp); + r3 = this.imulK(r3); + r3 = r3.iadd(this.tmp); + rlen = r3.bitLength(); + } while (rlen > this.n); + var cmp = rlen < this.n ? -1 : r3.ucmp(this.p); + if (cmp === 0) { + r3.words[0] = 0; + r3.length = 1; + } else if (cmp > 0) { + r3.isub(this.p); + } else { + if (r3.strip !== void 0) { + r3.strip(); + } else { + r3._strip(); + } + } + return r3; + }; + MPrime.prototype.split = function split(input, out) { + input.iushrn(this.n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul(this.k); + }; + function K256() { + MPrime.call( + this, + 'k256', + 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f' + ); + } + inherits(K256, MPrime); + K256.prototype.split = function split(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i2 = 0; i2 < outLen; i2++) { + output.words[i2] = input.words[i2]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i2 = 10; i2 < input.length; i2++) { + var next = input.words[i2] | 0; + input.words[i2 - 10] = ((next & mask) << 4) | (prev >>> 22); + prev = next; + } + prev >>>= 22; + input.words[i2 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i2 = 0; i2 < num.length; i2++) { + var w = num.words[i2] | 0; + lo += w * 977; + num.words[i2] = lo & 67108863; + lo = w * 64 + ((lo / 67108864) | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call( + this, + 'p224', + 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001' + ); + } + inherits(P224, MPrime); + function P192() { + MPrime.call( + this, + 'p192', + 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff' + ); + } + inherits(P192, MPrime); + function P25519() { + MPrime.call( + this, + '25519', + '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed' + ); + } + inherits(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i2 = 0; i2 < num.length; i2++) { + var hi = (num.words[i2] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i2] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN3._prime = function prime(name) { + if (primes[name]) return primes[name]; + var prime2; + if (name === 'k256') { + prime2 = new K256(); + } else if (name === 'p224') { + prime2 = new P224(); + } else if (name === 'p192') { + prime2 = new P192(); + } else if (name === 'p25519') { + prime2 = new P25519(); + } else { + throw new Error('Unknown prime ' + name); + } + primes[name] = prime2; + return prime2; + }; + function Red(m) { + if (typeof m === 'string') { + var prime = BN3._prime(m); + this.m = prime.p; + this.prime = prime; + } else { + assert2(m.gtn(1), 'modulus must be greater than 1'); + this.m = m; + this.prime = null; + } + } + Red.prototype._verify1 = function _verify1(a2) { + assert2(a2.negative === 0, 'red works only with positives'); + assert2(a2.red, 'red works only with red numbers'); + }; + Red.prototype._verify2 = function _verify2(a2, b) { + assert2( + (a2.negative | b.negative) === 0, + 'red works only with positives' + ); + assert2(a2.red && a2.red === b.red, 'red works only with red numbers'); + }; + Red.prototype.imod = function imod(a2) { + if (this.prime) return this.prime.ireduce(a2)._forceRed(this); + move(a2, a2.umod(this.m)._forceRed(this)); + return a2; + }; + Red.prototype.neg = function neg3(a2) { + if (a2.isZero()) { + return a2.clone(); + } + return this.m.sub(a2)._forceRed(this); + }; + Red.prototype.add = function add5(a2, b) { + this._verify2(a2, b); + var res = a2.add(b); + if (res.cmp(this.m) >= 0) { + res.isub(this.m); + } + return res._forceRed(this); + }; + Red.prototype.iadd = function iadd(a2, b) { + this._verify2(a2, b); + var res = a2.iadd(b); + if (res.cmp(this.m) >= 0) { + res.isub(this.m); + } + return res; + }; + Red.prototype.sub = function sub(a2, b) { + this._verify2(a2, b); + var res = a2.sub(b); + if (res.cmpn(0) < 0) { + res.iadd(this.m); + } + return res._forceRed(this); + }; + Red.prototype.isub = function isub(a2, b) { + this._verify2(a2, b); + var res = a2.isub(b); + if (res.cmpn(0) < 0) { + res.iadd(this.m); + } + return res; + }; + Red.prototype.shl = function shl(a2, num) { + this._verify1(a2); + return this.imod(a2.ushln(num)); + }; + Red.prototype.imul = function imul(a2, b) { + this._verify2(a2, b); + return this.imod(a2.imul(b)); + }; + Red.prototype.mul = function mul3(a2, b) { + this._verify2(a2, b); + return this.imod(a2.mul(b)); + }; + Red.prototype.isqr = function isqr(a2) { + return this.imul(a2, a2.clone()); + }; + Red.prototype.sqr = function sqr(a2) { + return this.mul(a2, a2); + }; + Red.prototype.sqrt = function sqrt(a2) { + if (a2.isZero()) return a2.clone(); + var mod3 = this.m.andln(3); + assert2(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = this.m.add(new BN3(1)).iushrn(2); + return this.pow(a2, pow); + } + var q = this.m.subn(1); + var s2 = 0; + while (!q.isZero() && q.andln(1) === 0) { + s2++; + q.iushrn(1); + } + assert2(!q.isZero()); + var one = new BN3(1).toRed(this); + var nOne = one.redNeg(); + var lpow = this.m.subn(1).iushrn(1); + var z = this.m.bitLength(); + z = new BN3(2 * z * z).toRed(this); + while (this.pow(z, lpow).cmp(nOne) !== 0) { + z.redIAdd(nOne); + } + var c = this.pow(z, q); + var r3 = this.pow(a2, q.addn(1).iushrn(1)); + var t2 = this.pow(a2, q); + var m = s2; + while (t2.cmp(one) !== 0) { + var tmp = t2; + for (var i2 = 0; tmp.cmp(one) !== 0; i2++) { + tmp = tmp.redSqr(); + } + assert2(i2 < m); + var b = this.pow(c, new BN3(1).iushln(m - i2 - 1)); + r3 = r3.redMul(b); + c = b.redSqr(); + t2 = t2.redMul(c); + m = i2; + } + return r3; + }; + Red.prototype.invm = function invm(a2) { + var inv = a2._invmp(this.m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a2, num) { + if (num.isZero()) return new BN3(1).toRed(this); + if (num.cmpn(1) === 0) return a2.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN3(1).toRed(this); + wnd[1] = a2; + for (var i2 = 2; i2 < wnd.length; i2++) { + wnd[i2] = this.mul(wnd[i2 - 1], a2); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i2 = num.length - 1; i2 >= 0; i2--) { + var word = num.words[i2]; + for (var j = start - 1; j >= 0; j--) { + var bit = (word >> j) & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i2 !== 0 || j !== 0)) continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r3 = num.umod(this.m); + return r3 === num ? r3.clone() : r3; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN3.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m) { + Red.call(this, m); + this.shift = this.m.bitLength(); + if (this.shift % 26 !== 0) { + this.shift += 26 - (this.shift % 26); + } + this.r = new BN3(1).iushln(this.shift); + this.r2 = this.imod(this.r.sqr()); + this.rinv = this.r._invmp(this.m); + this.minv = this.rinv.mul(this.r).isubn(1).div(this.m); + this.minv = this.minv.umod(this.r); + this.minv = this.r.sub(this.minv); + } + inherits(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln(this.shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r3 = this.imod(num.mul(this.rinv)); + r3.red = null; + return r3; + }; + Mont.prototype.imul = function imul(a2, b) { + if (a2.isZero() || b.isZero()) { + a2.words[0] = 0; + a2.length = 1; + return a2; + } + var t2 = a2.imul(b); + var c = t2 + .maskn(this.shift) + .mul(this.minv) + .imaskn(this.shift) + .mul(this.m); + var u = t2.isub(c).iushrn(this.shift); + var res = u; + if (u.cmp(this.m) >= 0) { + res = u.isub(this.m); + } else if (u.cmpn(0) < 0) { + res = u.iadd(this.m); + } + return res._forceRed(this); + }; + Mont.prototype.mul = function mul3(a2, b) { + if (a2.isZero() || b.isZero()) return new BN3(0)._forceRed(this); + var t2 = a2.mul(b); + var c = t2 + .maskn(this.shift) + .mul(this.minv) + .imaskn(this.shift) + .mul(this.m); + var u = t2.isub(c).iushrn(this.shift); + var res = u; + if (u.cmp(this.m) >= 0) { + res = u.isub(this.m); + } else if (u.cmpn(0) < 0) { + res = u.iadd(this.m); + } + return res._forceRed(this); + }; + Mont.prototype.invm = function invm(a2) { + var res = this.imod(a2._invmp(this.m).mul(this.r2)); + return res._forceRed(this); + }; + })(typeof module2 === 'undefined' || module2, exports); + }, +}); + +// node_modules/@ethersproject/logger/lib.esm/_version.js +var version2; +var init_version = __esm({ + 'node_modules/@ethersproject/logger/lib.esm/_version.js'() { + init_shim(); + version2 = 'logger/5.7.0'; + }, +}); + +// node_modules/@ethersproject/logger/lib.esm/index.js +var lib_exports = {}; +__export(lib_exports, { + ErrorCode: () => ErrorCode, + LogLevel: () => LogLevel2, + Logger: () => Logger, +}); +function _checkNormalize() { + try { + const missing = []; + ['NFD', 'NFC', 'NFKD', 'NFKC'].forEach((form) => { + try { + if ('test'.normalize(form) !== 'test') { + throw new Error('bad normalize'); + } + } catch (error) { + missing.push(form); + } + }); + if (missing.length) { + throw new Error('missing ' + missing.join(', ')); + } + if ( + String.fromCharCode(233).normalize('NFD') !== + String.fromCharCode(101, 769) + ) { + throw new Error('broken implementation'); + } + } catch (error) { + return error.message; + } + return null; +} +var _permanentCensorErrors, + _censorErrors, + LogLevels, + _logLevel, + _globalLogger, + _normalizeError, + LogLevel2, + ErrorCode, + HEX, + Logger; +var init_lib = __esm({ + 'node_modules/@ethersproject/logger/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_version(); + _permanentCensorErrors = false; + _censorErrors = false; + LogLevels = { debug: 1, default: 2, info: 2, warning: 3, error: 4, off: 5 }; + _logLevel = LogLevels['default']; + _globalLogger = null; + _normalizeError = _checkNormalize(); + (function (LogLevel3) { + LogLevel3['DEBUG'] = 'DEBUG'; + LogLevel3['INFO'] = 'INFO'; + LogLevel3['WARNING'] = 'WARNING'; + LogLevel3['ERROR'] = 'ERROR'; + LogLevel3['OFF'] = 'OFF'; + })(LogLevel2 || (LogLevel2 = {})); + (function (ErrorCode2) { + ErrorCode2['UNKNOWN_ERROR'] = 'UNKNOWN_ERROR'; + ErrorCode2['NOT_IMPLEMENTED'] = 'NOT_IMPLEMENTED'; + ErrorCode2['UNSUPPORTED_OPERATION'] = 'UNSUPPORTED_OPERATION'; + ErrorCode2['NETWORK_ERROR'] = 'NETWORK_ERROR'; + ErrorCode2['SERVER_ERROR'] = 'SERVER_ERROR'; + ErrorCode2['TIMEOUT'] = 'TIMEOUT'; + ErrorCode2['BUFFER_OVERRUN'] = 'BUFFER_OVERRUN'; + ErrorCode2['NUMERIC_FAULT'] = 'NUMERIC_FAULT'; + ErrorCode2['MISSING_NEW'] = 'MISSING_NEW'; + ErrorCode2['INVALID_ARGUMENT'] = 'INVALID_ARGUMENT'; + ErrorCode2['MISSING_ARGUMENT'] = 'MISSING_ARGUMENT'; + ErrorCode2['UNEXPECTED_ARGUMENT'] = 'UNEXPECTED_ARGUMENT'; + ErrorCode2['CALL_EXCEPTION'] = 'CALL_EXCEPTION'; + ErrorCode2['INSUFFICIENT_FUNDS'] = 'INSUFFICIENT_FUNDS'; + ErrorCode2['NONCE_EXPIRED'] = 'NONCE_EXPIRED'; + ErrorCode2['REPLACEMENT_UNDERPRICED'] = 'REPLACEMENT_UNDERPRICED'; + ErrorCode2['UNPREDICTABLE_GAS_LIMIT'] = 'UNPREDICTABLE_GAS_LIMIT'; + ErrorCode2['TRANSACTION_REPLACED'] = 'TRANSACTION_REPLACED'; + ErrorCode2['ACTION_REJECTED'] = 'ACTION_REJECTED'; + })(ErrorCode || (ErrorCode = {})); + HEX = '0123456789abcdef'; + Logger = class { + constructor(version28) { + Object.defineProperty(this, 'version', { + enumerable: true, + value: version28, + writable: false, + }); + } + _log(logLevel, args) { + const level = logLevel.toLowerCase(); + if (LogLevels[level] == null) { + this.throwArgumentError( + 'invalid log level name', + 'logLevel', + logLevel + ); + } + if (_logLevel > LogLevels[level]) { + return; + } + console.log.apply(console, args); + } + debug(...args) { + this._log(Logger.levels.DEBUG, args); + } + info(...args) { + this._log(Logger.levels.INFO, args); + } + warn(...args) { + this._log(Logger.levels.WARNING, args); + } + makeError(message, code9, params) { + if (_censorErrors) { + return this.makeError('censored error', code9, {}); + } + if (!code9) { + code9 = Logger.errors.UNKNOWN_ERROR; + } + if (!params) { + params = {}; + } + const messageDetails = []; + Object.keys(params).forEach((key2) => { + const value = params[key2]; + try { + if (value instanceof Uint8Array) { + let hex = ''; + for (let i2 = 0; i2 < value.length; i2++) { + hex += HEX[value[i2] >> 4]; + hex += HEX[value[i2] & 15]; + } + messageDetails.push(key2 + '=Uint8Array(0x' + hex + ')'); + } else { + messageDetails.push(key2 + '=' + JSON.stringify(value)); + } + } catch (error2) { + messageDetails.push( + key2 + '=' + JSON.stringify(params[key2].toString()) + ); + } + }); + messageDetails.push(`code=${code9}`); + messageDetails.push(`version=${this.version}`); + const reason = message; + let url = ''; + switch (code9) { + case ErrorCode.NUMERIC_FAULT: { + url = 'NUMERIC_FAULT'; + const fault = message; + switch (fault) { + case 'overflow': + case 'underflow': + case 'division-by-zero': + url += '-' + fault; + break; + case 'negative-power': + case 'negative-width': + url += '-unsupported'; + break; + case 'unbound-bitwise-result': + url += '-unbound-result'; + break; + } + break; + } + case ErrorCode.CALL_EXCEPTION: + case ErrorCode.INSUFFICIENT_FUNDS: + case ErrorCode.MISSING_NEW: + case ErrorCode.NONCE_EXPIRED: + case ErrorCode.REPLACEMENT_UNDERPRICED: + case ErrorCode.TRANSACTION_REPLACED: + case ErrorCode.UNPREDICTABLE_GAS_LIMIT: + url = code9; + break; + } + if (url) { + message += ' [ See: https://links.ethers.org/v5-errors-' + url + ' ]'; + } + if (messageDetails.length) { + message += ' (' + messageDetails.join(', ') + ')'; + } + const error = new Error(message); + error.reason = reason; + error.code = code9; + Object.keys(params).forEach(function (key2) { + error[key2] = params[key2]; + }); + return error; + } + throwError(message, code9, params) { + throw this.makeError(message, code9, params); + } + throwArgumentError(message, name, value) { + return this.throwError(message, Logger.errors.INVALID_ARGUMENT, { + argument: name, + value, + }); + } + assert(condition, message, code9, params) { + if (!!condition) { + return; + } + this.throwError(message, code9, params); + } + assertArgument(condition, message, name, value) { + if (!!condition) { + return; + } + this.throwArgumentError(message, name, value); + } + checkNormalize(message) { + if (message == null) { + message = 'platform missing String.prototype.normalize'; + } + if (_normalizeError) { + this.throwError( + 'platform missing String.prototype.normalize', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'String.prototype.normalize', + form: _normalizeError, + } + ); + } + } + checkSafeUint53(value, message) { + if (typeof value !== 'number') { + return; + } + if (message == null) { + message = 'value not safe'; + } + if (value < 0 || value >= 9007199254740991) { + this.throwError(message, Logger.errors.NUMERIC_FAULT, { + operation: 'checkSafeInteger', + fault: 'out-of-safe-range', + value, + }); + } + if (value % 1) { + this.throwError(message, Logger.errors.NUMERIC_FAULT, { + operation: 'checkSafeInteger', + fault: 'non-integer', + value, + }); + } + } + checkArgumentCount(count, expectedCount, message) { + if (message) { + message = ': ' + message; + } else { + message = ''; + } + if (count < expectedCount) { + this.throwError( + 'missing argument' + message, + Logger.errors.MISSING_ARGUMENT, + { + count, + expectedCount, + } + ); + } + if (count > expectedCount) { + this.throwError( + 'too many arguments' + message, + Logger.errors.UNEXPECTED_ARGUMENT, + { + count, + expectedCount, + } + ); + } + } + checkNew(target, kind) { + if (target === Object || target == null) { + this.throwError('missing new', Logger.errors.MISSING_NEW, { + name: kind.name, + }); + } + } + checkAbstract(target, kind) { + if (target === kind) { + this.throwError( + 'cannot instantiate abstract class ' + + JSON.stringify(kind.name) + + ' directly; use a sub-class', + Logger.errors.UNSUPPORTED_OPERATION, + { name: target.name, operation: 'new' } + ); + } else if (target === Object || target == null) { + this.throwError('missing new', Logger.errors.MISSING_NEW, { + name: kind.name, + }); + } + } + static globalLogger() { + if (!_globalLogger) { + _globalLogger = new Logger(version2); + } + return _globalLogger; + } + static setCensorship(censorship, permanent) { + if (!censorship && permanent) { + this.globalLogger().throwError( + 'cannot permanently disable censorship', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'setCensorship', + } + ); + } + if (_permanentCensorErrors) { + if (!censorship) { + return; + } + this.globalLogger().throwError( + 'error censorship permanent', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'setCensorship', + } + ); + } + _censorErrors = !!censorship; + _permanentCensorErrors = !!permanent; + } + static setLogLevel(logLevel) { + const level = LogLevels[logLevel.toLowerCase()]; + if (level == null) { + Logger.globalLogger().warn('invalid log level - ' + logLevel); + return; + } + _logLevel = level; + } + static from(version28) { + return new Logger(version28); + } + }; + Logger.errors = ErrorCode; + Logger.levels = LogLevel2; + }, +}); + +// node_modules/@ethersproject/bytes/lib.esm/_version.js +var version3; +var init_version2 = __esm({ + 'node_modules/@ethersproject/bytes/lib.esm/_version.js'() { + init_shim(); + version3 = 'bytes/5.7.0'; + }, +}); + +// node_modules/@ethersproject/bytes/lib.esm/index.js +var lib_exports2 = {}; +__export(lib_exports2, { + arrayify: () => arrayify, + concat: () => concat, + hexConcat: () => hexConcat, + hexDataLength: () => hexDataLength, + hexDataSlice: () => hexDataSlice, + hexStripZeros: () => hexStripZeros, + hexValue: () => hexValue, + hexZeroPad: () => hexZeroPad, + hexlify: () => hexlify, + isBytes: () => isBytes, + isBytesLike: () => isBytesLike, + isHexString: () => isHexString, + joinSignature: () => joinSignature, + splitSignature: () => splitSignature, + stripZeros: () => stripZeros, + zeroPad: () => zeroPad, +}); +function isHexable(value) { + return !!value.toHexString; +} +function addSlice(array) { + if (array.slice) { + return array; + } + array.slice = function () { + const args = Array.prototype.slice.call(arguments); + return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args))); + }; + return array; +} +function isBytesLike(value) { + return (isHexString(value) && !(value.length % 2)) || isBytes(value); +} +function isInteger(value) { + return typeof value === 'number' && value == value && value % 1 === 0; +} +function isBytes(value) { + if (value == null) { + return false; + } + if (value.constructor === Uint8Array) { + return true; + } + if (typeof value === 'string') { + return false; + } + if (!isInteger(value.length) || value.length < 0) { + return false; + } + for (let i2 = 0; i2 < value.length; i2++) { + const v = value[i2]; + if (!isInteger(v) || v < 0 || v >= 256) { + return false; + } + } + return true; +} +function arrayify(value, options) { + if (!options) { + options = {}; + } + if (typeof value === 'number') { + logger.checkSafeUint53(value, 'invalid arrayify value'); + const result = []; + while (value) { + result.unshift(value & 255); + value = parseInt(String(value / 256)); + } + if (result.length === 0) { + result.push(0); + } + return addSlice(new Uint8Array(result)); + } + if ( + options.allowMissingPrefix && + typeof value === 'string' && + value.substring(0, 2) !== '0x' + ) { + value = '0x' + value; + } + if (isHexable(value)) { + value = value.toHexString(); + } + if (isHexString(value)) { + let hex = value.substring(2); + if (hex.length % 2) { + if (options.hexPad === 'left') { + hex = '0' + hex; + } else if (options.hexPad === 'right') { + hex += '0'; + } else { + logger.throwArgumentError('hex data is odd-length', 'value', value); + } + } + const result = []; + for (let i2 = 0; i2 < hex.length; i2 += 2) { + result.push(parseInt(hex.substring(i2, i2 + 2), 16)); + } + return addSlice(new Uint8Array(result)); + } + if (isBytes(value)) { + return addSlice(new Uint8Array(value)); + } + return logger.throwArgumentError('invalid arrayify value', 'value', value); +} +function concat(items) { + const objects = items.map((item) => arrayify(item)); + const length = objects.reduce((accum, item) => accum + item.length, 0); + const result = new Uint8Array(length); + objects.reduce((offset, object) => { + result.set(object, offset); + return offset + object.length; + }, 0); + return addSlice(result); +} +function stripZeros(value) { + let result = arrayify(value); + if (result.length === 0) { + return result; + } + let start = 0; + while (start < result.length && result[start] === 0) { + start++; + } + if (start) { + result = result.slice(start); + } + return result; +} +function zeroPad(value, length) { + value = arrayify(value); + if (value.length > length) { + logger.throwArgumentError('value out of range', 'value', arguments[0]); + } + const result = new Uint8Array(length); + result.set(value, length - value.length); + return addSlice(result); +} +function isHexString(value, length) { + if (typeof value !== 'string' || !value.match(/^0x[0-9A-Fa-f]*$/)) { + return false; + } + if (length && value.length !== 2 + 2 * length) { + return false; + } + return true; +} +function hexlify(value, options) { + if (!options) { + options = {}; + } + if (typeof value === 'number') { + logger.checkSafeUint53(value, 'invalid hexlify value'); + let hex = ''; + while (value) { + hex = HexCharacters[value & 15] + hex; + value = Math.floor(value / 16); + } + if (hex.length) { + if (hex.length % 2) { + hex = '0' + hex; + } + return '0x' + hex; + } + return '0x00'; + } + if (typeof value === 'bigint') { + value = value.toString(16); + if (value.length % 2) { + return '0x0' + value; + } + return '0x' + value; + } + if ( + options.allowMissingPrefix && + typeof value === 'string' && + value.substring(0, 2) !== '0x' + ) { + value = '0x' + value; + } + if (isHexable(value)) { + return value.toHexString(); + } + if (isHexString(value)) { + if (value.length % 2) { + if (options.hexPad === 'left') { + value = '0x0' + value.substring(2); + } else if (options.hexPad === 'right') { + value += '0'; + } else { + logger.throwArgumentError('hex data is odd-length', 'value', value); + } + } + return value.toLowerCase(); + } + if (isBytes(value)) { + let result = '0x'; + for (let i2 = 0; i2 < value.length; i2++) { + let v = value[i2]; + result += HexCharacters[(v & 240) >> 4] + HexCharacters[v & 15]; + } + return result; + } + return logger.throwArgumentError('invalid hexlify value', 'value', value); +} +function hexDataLength(data) { + if (typeof data !== 'string') { + data = hexlify(data); + } else if (!isHexString(data) || data.length % 2) { + return null; + } + return (data.length - 2) / 2; +} +function hexDataSlice(data, offset, endOffset) { + if (typeof data !== 'string') { + data = hexlify(data); + } else if (!isHexString(data) || data.length % 2) { + logger.throwArgumentError('invalid hexData', 'value', data); + } + offset = 2 + 2 * offset; + if (endOffset != null) { + return '0x' + data.substring(offset, 2 + 2 * endOffset); + } + return '0x' + data.substring(offset); +} +function hexConcat(items) { + let result = '0x'; + items.forEach((item) => { + result += hexlify(item).substring(2); + }); + return result; +} +function hexValue(value) { + const trimmed = hexStripZeros(hexlify(value, { hexPad: 'left' })); + if (trimmed === '0x') { + return '0x0'; + } + return trimmed; +} +function hexStripZeros(value) { + if (typeof value !== 'string') { + value = hexlify(value); + } + if (!isHexString(value)) { + logger.throwArgumentError('invalid hex string', 'value', value); + } + value = value.substring(2); + let offset = 0; + while (offset < value.length && value[offset] === '0') { + offset++; + } + return '0x' + value.substring(offset); +} +function hexZeroPad(value, length) { + if (typeof value !== 'string') { + value = hexlify(value); + } else if (!isHexString(value)) { + logger.throwArgumentError('invalid hex string', 'value', value); + } + if (value.length > 2 * length + 2) { + logger.throwArgumentError('value out of range', 'value', arguments[1]); + } + while (value.length < 2 * length + 2) { + value = '0x0' + value.substring(2); + } + return value; +} +function splitSignature(signature2) { + const result = { + r: '0x', + s: '0x', + _vs: '0x', + recoveryParam: 0, + v: 0, + yParityAndS: '0x', + compact: '0x', + }; + if (isBytesLike(signature2)) { + let bytes = arrayify(signature2); + if (bytes.length === 64) { + result.v = 27 + (bytes[32] >> 7); + bytes[32] &= 127; + result.r = hexlify(bytes.slice(0, 32)); + result.s = hexlify(bytes.slice(32, 64)); + } else if (bytes.length === 65) { + result.r = hexlify(bytes.slice(0, 32)); + result.s = hexlify(bytes.slice(32, 64)); + result.v = bytes[64]; + } else { + logger.throwArgumentError( + 'invalid signature string', + 'signature', + signature2 + ); + } + if (result.v < 27) { + if (result.v === 0 || result.v === 1) { + result.v += 27; + } else { + logger.throwArgumentError( + 'signature invalid v byte', + 'signature', + signature2 + ); + } + } + result.recoveryParam = 1 - (result.v % 2); + if (result.recoveryParam) { + bytes[32] |= 128; + } + result._vs = hexlify(bytes.slice(32, 64)); + } else { + result.r = signature2.r; + result.s = signature2.s; + result.v = signature2.v; + result.recoveryParam = signature2.recoveryParam; + result._vs = signature2._vs; + if (result._vs != null) { + const vs2 = zeroPad(arrayify(result._vs), 32); + result._vs = hexlify(vs2); + const recoveryParam = vs2[0] >= 128 ? 1 : 0; + if (result.recoveryParam == null) { + result.recoveryParam = recoveryParam; + } else if (result.recoveryParam !== recoveryParam) { + logger.throwArgumentError( + 'signature recoveryParam mismatch _vs', + 'signature', + signature2 + ); + } + vs2[0] &= 127; + const s2 = hexlify(vs2); + if (result.s == null) { + result.s = s2; + } else if (result.s !== s2) { + logger.throwArgumentError( + 'signature v mismatch _vs', + 'signature', + signature2 + ); + } + } + if (result.recoveryParam == null) { + if (result.v == null) { + logger.throwArgumentError( + 'signature missing v and recoveryParam', + 'signature', + signature2 + ); + } else if (result.v === 0 || result.v === 1) { + result.recoveryParam = result.v; + } else { + result.recoveryParam = 1 - (result.v % 2); + } + } else { + if (result.v == null) { + result.v = 27 + result.recoveryParam; + } else { + const recId = + result.v === 0 || result.v === 1 ? result.v : 1 - (result.v % 2); + if (result.recoveryParam !== recId) { + logger.throwArgumentError( + 'signature recoveryParam mismatch v', + 'signature', + signature2 + ); + } + } + } + if (result.r == null || !isHexString(result.r)) { + logger.throwArgumentError( + 'signature missing or invalid r', + 'signature', + signature2 + ); + } else { + result.r = hexZeroPad(result.r, 32); + } + if (result.s == null || !isHexString(result.s)) { + logger.throwArgumentError( + 'signature missing or invalid s', + 'signature', + signature2 + ); + } else { + result.s = hexZeroPad(result.s, 32); + } + const vs = arrayify(result.s); + if (vs[0] >= 128) { + logger.throwArgumentError( + 'signature s out of range', + 'signature', + signature2 + ); + } + if (result.recoveryParam) { + vs[0] |= 128; + } + const _vs = hexlify(vs); + if (result._vs) { + if (!isHexString(result._vs)) { + logger.throwArgumentError( + 'signature invalid _vs', + 'signature', + signature2 + ); + } + result._vs = hexZeroPad(result._vs, 32); + } + if (result._vs == null) { + result._vs = _vs; + } else if (result._vs !== _vs) { + logger.throwArgumentError( + 'signature _vs mismatch v and s', + 'signature', + signature2 + ); + } + } + result.yParityAndS = result._vs; + result.compact = result.r + result.yParityAndS.substring(2); + return result; +} +function joinSignature(signature2) { + signature2 = splitSignature(signature2); + return hexlify( + concat([ + signature2.r, + signature2.s, + signature2.recoveryParam ? '0x1c' : '0x1b', + ]) + ); +} +var logger, HexCharacters; +var init_lib2 = __esm({ + 'node_modules/@ethersproject/bytes/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_lib(); + init_version2(); + logger = new Logger(version3); + HexCharacters = '0123456789abcdef'; + }, +}); + +// node_modules/@ethersproject/bignumber/lib.esm/_version.js +var version4; +var init_version3 = __esm({ + 'node_modules/@ethersproject/bignumber/lib.esm/_version.js'() { + init_shim(); + version4 = 'bignumber/5.7.0'; + }, +}); + +// node_modules/@ethersproject/bignumber/lib.esm/bignumber.js +function isBigNumberish(value) { + return ( + value != null && + (BigNumber.isBigNumber(value) || + (typeof value === 'number' && value % 1 === 0) || + (typeof value === 'string' && !!value.match(/^-?[0-9]+$/)) || + isHexString(value) || + typeof value === 'bigint' || + isBytes(value)) + ); +} +function toHex(value) { + if (typeof value !== 'string') { + return toHex(value.toString(16)); + } + if (value[0] === '-') { + value = value.substring(1); + if (value[0] === '-') { + logger2.throwArgumentError('invalid hex', 'value', value); + } + value = toHex(value); + if (value === '0x00') { + return value; + } + return '-' + value; + } + if (value.substring(0, 2) !== '0x') { + value = '0x' + value; + } + if (value === '0x') { + return '0x00'; + } + if (value.length % 2) { + value = '0x0' + value.substring(2); + } + while (value.length > 4 && value.substring(0, 4) === '0x00') { + value = '0x' + value.substring(4); + } + return value; +} +function toBigNumber(value) { + return BigNumber.from(toHex(value)); +} +function toBN(value) { + const hex = BigNumber.from(value).toHexString(); + if (hex[0] === '-') { + return new BN('-' + hex.substring(3), 16); + } + return new BN(hex.substring(2), 16); +} +function throwFault(fault, operation, value) { + const params = { fault, operation }; + if (value != null) { + params.value = value; + } + return logger2.throwError(fault, Logger.errors.NUMERIC_FAULT, params); +} +function _base36To16(value) { + return new BN(value, 36).toString(16); +} +function _base16To36(value) { + return new BN(value, 16).toString(36); +} +var import_bn, + BN, + logger2, + _constructorGuard, + MAX_SAFE, + _warnedToStringRadix, + BigNumber; +var init_bignumber = __esm({ + 'node_modules/@ethersproject/bignumber/lib.esm/bignumber.js'() { + 'use strict'; + init_shim(); + import_bn = __toESM(require_bn()); + init_lib2(); + init_lib(); + init_version3(); + BN = import_bn.default.BN; + logger2 = new Logger(version4); + _constructorGuard = {}; + MAX_SAFE = 9007199254740991; + _warnedToStringRadix = false; + BigNumber = class { + constructor(constructorGuard, hex) { + if (constructorGuard !== _constructorGuard) { + logger2.throwError( + 'cannot call constructor directly; use BigNumber.from', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'new (BigNumber)', + } + ); + } + this._hex = hex; + this._isBigNumber = true; + Object.freeze(this); + } + fromTwos(value) { + return toBigNumber(toBN(this).fromTwos(value)); + } + toTwos(value) { + return toBigNumber(toBN(this).toTwos(value)); + } + abs() { + if (this._hex[0] === '-') { + return BigNumber.from(this._hex.substring(1)); + } + return this; + } + add(other) { + return toBigNumber(toBN(this).add(toBN(other))); + } + sub(other) { + return toBigNumber(toBN(this).sub(toBN(other))); + } + div(other) { + const o2 = BigNumber.from(other); + if (o2.isZero()) { + throwFault('division-by-zero', 'div'); + } + return toBigNumber(toBN(this).div(toBN(other))); + } + mul(other) { + return toBigNumber(toBN(this).mul(toBN(other))); + } + mod(other) { + const value = toBN(other); + if (value.isNeg()) { + throwFault('division-by-zero', 'mod'); + } + return toBigNumber(toBN(this).umod(value)); + } + pow(other) { + const value = toBN(other); + if (value.isNeg()) { + throwFault('negative-power', 'pow'); + } + return toBigNumber(toBN(this).pow(value)); + } + and(other) { + const value = toBN(other); + if (this.isNegative() || value.isNeg()) { + throwFault('unbound-bitwise-result', 'and'); + } + return toBigNumber(toBN(this).and(value)); + } + or(other) { + const value = toBN(other); + if (this.isNegative() || value.isNeg()) { + throwFault('unbound-bitwise-result', 'or'); + } + return toBigNumber(toBN(this).or(value)); + } + xor(other) { + const value = toBN(other); + if (this.isNegative() || value.isNeg()) { + throwFault('unbound-bitwise-result', 'xor'); + } + return toBigNumber(toBN(this).xor(value)); + } + mask(value) { + if (this.isNegative() || value < 0) { + throwFault('negative-width', 'mask'); + } + return toBigNumber(toBN(this).maskn(value)); + } + shl(value) { + if (this.isNegative() || value < 0) { + throwFault('negative-width', 'shl'); + } + return toBigNumber(toBN(this).shln(value)); + } + shr(value) { + if (this.isNegative() || value < 0) { + throwFault('negative-width', 'shr'); + } + return toBigNumber(toBN(this).shrn(value)); + } + eq(other) { + return toBN(this).eq(toBN(other)); + } + lt(other) { + return toBN(this).lt(toBN(other)); + } + lte(other) { + return toBN(this).lte(toBN(other)); + } + gt(other) { + return toBN(this).gt(toBN(other)); + } + gte(other) { + return toBN(this).gte(toBN(other)); + } + isNegative() { + return this._hex[0] === '-'; + } + isZero() { + return toBN(this).isZero(); + } + toNumber() { + try { + return toBN(this).toNumber(); + } catch (error) { + throwFault('overflow', 'toNumber', this.toString()); + } + return null; + } + toBigInt() { + try { + return BigInt(this.toString()); + } catch (e2) {} + return logger2.throwError( + 'this platform does not support BigInt', + Logger.errors.UNSUPPORTED_OPERATION, + { + value: this.toString(), + } + ); + } + toString() { + if (arguments.length > 0) { + if (arguments[0] === 10) { + if (!_warnedToStringRadix) { + _warnedToStringRadix = true; + logger2.warn( + 'BigNumber.toString does not accept any parameters; base-10 is assumed' + ); + } + } else if (arguments[0] === 16) { + logger2.throwError( + 'BigNumber.toString does not accept any parameters; use bigNumber.toHexString()', + Logger.errors.UNEXPECTED_ARGUMENT, + {} + ); + } else { + logger2.throwError( + 'BigNumber.toString does not accept parameters', + Logger.errors.UNEXPECTED_ARGUMENT, + {} + ); + } + } + return toBN(this).toString(10); + } + toHexString() { + return this._hex; + } + toJSON(key2) { + return { type: 'BigNumber', hex: this.toHexString() }; + } + static from(value) { + if (value instanceof BigNumber) { + return value; + } + if (typeof value === 'string') { + if (value.match(/^-?0x[0-9a-f]+$/i)) { + return new BigNumber(_constructorGuard, toHex(value)); + } + if (value.match(/^-?[0-9]+$/)) { + return new BigNumber(_constructorGuard, toHex(new BN(value))); + } + return logger2.throwArgumentError( + 'invalid BigNumber string', + 'value', + value + ); + } + if (typeof value === 'number') { + if (value % 1) { + throwFault('underflow', 'BigNumber.from', value); + } + if (value >= MAX_SAFE || value <= -MAX_SAFE) { + throwFault('overflow', 'BigNumber.from', value); + } + return BigNumber.from(String(value)); + } + const anyValue = value; + if (typeof anyValue === 'bigint') { + return BigNumber.from(anyValue.toString()); + } + if (isBytes(anyValue)) { + return BigNumber.from(hexlify(anyValue)); + } + if (anyValue) { + if (anyValue.toHexString) { + const hex = anyValue.toHexString(); + if (typeof hex === 'string') { + return BigNumber.from(hex); + } + } else { + let hex = anyValue._hex; + if (hex == null && anyValue.type === 'BigNumber') { + hex = anyValue.hex; + } + if (typeof hex === 'string') { + if ( + isHexString(hex) || + (hex[0] === '-' && isHexString(hex.substring(1))) + ) { + return BigNumber.from(hex); + } + } + } + } + return logger2.throwArgumentError( + 'invalid BigNumber value', + 'value', + value + ); + } + static isBigNumber(value) { + return !!(value && value._isBigNumber); + } + }; + }, +}); + +// node_modules/@ethersproject/bignumber/lib.esm/fixednumber.js +function throwFault2(message, fault, operation, value) { + const params = { fault, operation }; + if (value !== void 0) { + params.value = value; + } + return logger3.throwError(message, Logger.errors.NUMERIC_FAULT, params); +} +function getMultiplier(decimals) { + if (typeof decimals !== 'number') { + try { + decimals = BigNumber.from(decimals).toNumber(); + } catch (e2) {} + } + if ( + typeof decimals === 'number' && + decimals >= 0 && + decimals <= 256 && + !(decimals % 1) + ) { + return '1' + zeros.substring(0, decimals); + } + return logger3.throwArgumentError( + 'invalid decimal size', + 'decimals', + decimals + ); +} +function formatFixed(value, decimals) { + if (decimals == null) { + decimals = 0; + } + const multiplier = getMultiplier(decimals); + value = BigNumber.from(value); + const negative = value.lt(Zero); + if (negative) { + value = value.mul(NegativeOne); + } + let fraction = value.mod(multiplier).toString(); + while (fraction.length < multiplier.length - 1) { + fraction = '0' + fraction; + } + fraction = fraction.match(/^([0-9]*[1-9]|0)(0*)/)[1]; + const whole = value.div(multiplier).toString(); + if (multiplier.length === 1) { + value = whole; + } else { + value = whole + '.' + fraction; + } + if (negative) { + value = '-' + value; + } + return value; +} +function parseFixed(value, decimals) { + if (decimals == null) { + decimals = 0; + } + const multiplier = getMultiplier(decimals); + if (typeof value !== 'string' || !value.match(/^-?[0-9.]+$/)) { + logger3.throwArgumentError('invalid decimal value', 'value', value); + } + const negative = value.substring(0, 1) === '-'; + if (negative) { + value = value.substring(1); + } + if (value === '.') { + logger3.throwArgumentError('missing value', 'value', value); + } + const comps = value.split('.'); + if (comps.length > 2) { + logger3.throwArgumentError('too many decimal points', 'value', value); + } + let whole = comps[0], + fraction = comps[1]; + if (!whole) { + whole = '0'; + } + if (!fraction) { + fraction = '0'; + } + while (fraction[fraction.length - 1] === '0') { + fraction = fraction.substring(0, fraction.length - 1); + } + if (fraction.length > multiplier.length - 1) { + throwFault2( + 'fractional component exceeds decimals', + 'underflow', + 'parseFixed' + ); + } + if (fraction === '') { + fraction = '0'; + } + while (fraction.length < multiplier.length - 1) { + fraction += '0'; + } + const wholeValue = BigNumber.from(whole); + const fractionValue = BigNumber.from(fraction); + let wei = wholeValue.mul(multiplier).add(fractionValue); + if (negative) { + wei = wei.mul(NegativeOne); + } + return wei; +} +var logger3, + _constructorGuard2, + Zero, + NegativeOne, + zeros, + FixedFormat, + FixedNumber, + ONE, + BUMP; +var init_fixednumber = __esm({ + 'node_modules/@ethersproject/bignumber/lib.esm/fixednumber.js'() { + 'use strict'; + init_shim(); + init_lib2(); + init_lib(); + init_version3(); + init_bignumber(); + logger3 = new Logger(version4); + _constructorGuard2 = {}; + Zero = BigNumber.from(0); + NegativeOne = BigNumber.from(-1); + zeros = '0'; + while (zeros.length < 256) { + zeros += zeros; + } + FixedFormat = class { + constructor(constructorGuard, signed2, width, decimals) { + if (constructorGuard !== _constructorGuard2) { + logger3.throwError( + 'cannot use FixedFormat constructor; use FixedFormat.from', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'new FixedFormat', + } + ); + } + this.signed = signed2; + this.width = width; + this.decimals = decimals; + this.name = + (signed2 ? '' : 'u') + + 'fixed' + + String(width) + + 'x' + + String(decimals); + this._multiplier = getMultiplier(decimals); + Object.freeze(this); + } + static from(value) { + if (value instanceof FixedFormat) { + return value; + } + if (typeof value === 'number') { + value = `fixed128x${value}`; + } + let signed2 = true; + let width = 128; + let decimals = 18; + if (typeof value === 'string') { + if (value === 'fixed') { + } else if (value === 'ufixed') { + signed2 = false; + } else { + const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/); + if (!match) { + logger3.throwArgumentError( + 'invalid fixed format', + 'format', + value + ); + } + signed2 = match[1] !== 'u'; + width = parseInt(match[2]); + decimals = parseInt(match[3]); + } + } else if (value) { + const check = (key2, type, defaultValue) => { + if (value[key2] == null) { + return defaultValue; + } + if (typeof value[key2] !== type) { + logger3.throwArgumentError( + 'invalid fixed format (' + key2 + ' not ' + type + ')', + 'format.' + key2, + value[key2] + ); + } + return value[key2]; + }; + signed2 = check('signed', 'boolean', signed2); + width = check('width', 'number', width); + decimals = check('decimals', 'number', decimals); + } + if (width % 8) { + logger3.throwArgumentError( + 'invalid fixed format width (not byte aligned)', + 'format.width', + width + ); + } + if (decimals > 80) { + logger3.throwArgumentError( + 'invalid fixed format (decimals too large)', + 'format.decimals', + decimals + ); + } + return new FixedFormat(_constructorGuard2, signed2, width, decimals); + } + }; + FixedNumber = class { + constructor(constructorGuard, hex, value, format) { + if (constructorGuard !== _constructorGuard2) { + logger3.throwError( + 'cannot use FixedNumber constructor; use FixedNumber.from', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'new FixedFormat', + } + ); + } + this.format = format; + this._hex = hex; + this._value = value; + this._isFixedNumber = true; + Object.freeze(this); + } + _checkFormat(other) { + if (this.format.name !== other.format.name) { + logger3.throwArgumentError( + 'incompatible format; use fixedNumber.toFormat', + 'other', + other + ); + } + } + addUnsafe(other) { + this._checkFormat(other); + const a2 = parseFixed(this._value, this.format.decimals); + const b = parseFixed(other._value, other.format.decimals); + return FixedNumber.fromValue( + a2.add(b), + this.format.decimals, + this.format + ); + } + subUnsafe(other) { + this._checkFormat(other); + const a2 = parseFixed(this._value, this.format.decimals); + const b = parseFixed(other._value, other.format.decimals); + return FixedNumber.fromValue( + a2.sub(b), + this.format.decimals, + this.format + ); + } + mulUnsafe(other) { + this._checkFormat(other); + const a2 = parseFixed(this._value, this.format.decimals); + const b = parseFixed(other._value, other.format.decimals); + return FixedNumber.fromValue( + a2.mul(b).div(this.format._multiplier), + this.format.decimals, + this.format + ); + } + divUnsafe(other) { + this._checkFormat(other); + const a2 = parseFixed(this._value, this.format.decimals); + const b = parseFixed(other._value, other.format.decimals); + return FixedNumber.fromValue( + a2.mul(this.format._multiplier).div(b), + this.format.decimals, + this.format + ); + } + floor() { + const comps = this.toString().split('.'); + if (comps.length === 1) { + comps.push('0'); + } + let result = FixedNumber.from(comps[0], this.format); + const hasFraction = !comps[1].match(/^(0*)$/); + if (this.isNegative() && hasFraction) { + result = result.subUnsafe(ONE.toFormat(result.format)); + } + return result; + } + ceiling() { + const comps = this.toString().split('.'); + if (comps.length === 1) { + comps.push('0'); + } + let result = FixedNumber.from(comps[0], this.format); + const hasFraction = !comps[1].match(/^(0*)$/); + if (!this.isNegative() && hasFraction) { + result = result.addUnsafe(ONE.toFormat(result.format)); + } + return result; + } + // @TODO: Support other rounding algorithms + round(decimals) { + if (decimals == null) { + decimals = 0; + } + const comps = this.toString().split('.'); + if (comps.length === 1) { + comps.push('0'); + } + if (decimals < 0 || decimals > 80 || decimals % 1) { + logger3.throwArgumentError( + 'invalid decimal count', + 'decimals', + decimals + ); + } + if (comps[1].length <= decimals) { + return this; + } + const factor = FixedNumber.from( + '1' + zeros.substring(0, decimals), + this.format + ); + const bump = BUMP.toFormat(this.format); + return this.mulUnsafe(factor).addUnsafe(bump).floor().divUnsafe(factor); + } + isZero() { + return this._value === '0.0' || this._value === '0'; + } + isNegative() { + return this._value[0] === '-'; + } + toString() { + return this._value; + } + toHexString(width) { + if (width == null) { + return this._hex; + } + if (width % 8) { + logger3.throwArgumentError('invalid byte width', 'width', width); + } + const hex = BigNumber.from(this._hex) + .fromTwos(this.format.width) + .toTwos(width) + .toHexString(); + return hexZeroPad(hex, width / 8); + } + toUnsafeFloat() { + return parseFloat(this.toString()); + } + toFormat(format) { + return FixedNumber.fromString(this._value, format); + } + static fromValue(value, decimals, format) { + if (format == null && decimals != null && !isBigNumberish(decimals)) { + format = decimals; + decimals = null; + } + if (decimals == null) { + decimals = 0; + } + if (format == null) { + format = 'fixed'; + } + return FixedNumber.fromString( + formatFixed(value, decimals), + FixedFormat.from(format) + ); + } + static fromString(value, format) { + if (format == null) { + format = 'fixed'; + } + const fixedFormat = FixedFormat.from(format); + const numeric = parseFixed(value, fixedFormat.decimals); + if (!fixedFormat.signed && numeric.lt(Zero)) { + throwFault2( + 'unsigned value cannot be negative', + 'overflow', + 'value', + value + ); + } + let hex = null; + if (fixedFormat.signed) { + hex = numeric.toTwos(fixedFormat.width).toHexString(); + } else { + hex = numeric.toHexString(); + hex = hexZeroPad(hex, fixedFormat.width / 8); + } + const decimal = formatFixed(numeric, fixedFormat.decimals); + return new FixedNumber(_constructorGuard2, hex, decimal, fixedFormat); + } + static fromBytes(value, format) { + if (format == null) { + format = 'fixed'; + } + const fixedFormat = FixedFormat.from(format); + if (arrayify(value).length > fixedFormat.width / 8) { + throw new Error('overflow'); + } + let numeric = BigNumber.from(value); + if (fixedFormat.signed) { + numeric = numeric.fromTwos(fixedFormat.width); + } + const hex = numeric + .toTwos((fixedFormat.signed ? 0 : 1) + fixedFormat.width) + .toHexString(); + const decimal = formatFixed(numeric, fixedFormat.decimals); + return new FixedNumber(_constructorGuard2, hex, decimal, fixedFormat); + } + static from(value, format) { + if (typeof value === 'string') { + return FixedNumber.fromString(value, format); + } + if (isBytes(value)) { + return FixedNumber.fromBytes(value, format); + } + try { + return FixedNumber.fromValue(value, 0, format); + } catch (error) { + if (error.code !== Logger.errors.INVALID_ARGUMENT) { + throw error; + } + } + return logger3.throwArgumentError( + 'invalid FixedNumber value', + 'value', + value + ); + } + static isFixedNumber(value) { + return !!(value && value._isFixedNumber); + } + }; + ONE = FixedNumber.from(1); + BUMP = FixedNumber.from('0.5'); + }, +}); + +// node_modules/@ethersproject/bignumber/lib.esm/index.js +var init_lib3 = __esm({ + 'node_modules/@ethersproject/bignumber/lib.esm/index.js'() { + init_shim(); + init_bignumber(); + init_fixednumber(); + init_bignumber(); + }, +}); + +// node_modules/@ethersproject/properties/lib.esm/_version.js +var version5; +var init_version4 = __esm({ + 'node_modules/@ethersproject/properties/lib.esm/_version.js'() { + init_shim(); + version5 = 'properties/5.7.0'; + }, +}); + +// node_modules/@ethersproject/properties/lib.esm/index.js +var lib_exports3 = {}; +__export(lib_exports3, { + Description: () => Description, + checkProperties: () => checkProperties, + deepCopy: () => deepCopy, + defineReadOnly: () => defineReadOnly, + getStatic: () => getStatic, + resolveProperties: () => resolveProperties, + shallowCopy: () => shallowCopy, +}); +function defineReadOnly(object, name, value) { + Object.defineProperty(object, name, { + enumerable: true, + value, + writable: false, + }); +} +function getStatic(ctor, key2) { + for (let i2 = 0; i2 < 32; i2++) { + if (ctor[key2]) { + return ctor[key2]; + } + if (!ctor.prototype || typeof ctor.prototype !== 'object') { + break; + } + ctor = Object.getPrototypeOf(ctor.prototype).constructor; + } + return null; +} +function resolveProperties(object) { + return __awaiter(this, void 0, void 0, function* () { + const promises = Object.keys(object).map((key2) => { + const value = object[key2]; + return Promise.resolve(value).then((v) => ({ key: key2, value: v })); + }); + const results = yield Promise.all(promises); + return results.reduce((accum, result) => { + accum[result.key] = result.value; + return accum; + }, {}); + }); +} +function checkProperties(object, properties) { + if (!object || typeof object !== 'object') { + logger4.throwArgumentError('invalid object', 'object', object); + } + Object.keys(object).forEach((key2) => { + if (!properties[key2]) { + logger4.throwArgumentError( + 'invalid object key - ' + key2, + 'transaction:' + key2, + object + ); + } + }); +} +function shallowCopy(object) { + const result = {}; + for (const key2 in object) { + result[key2] = object[key2]; + } + return result; +} +function _isFrozen(object) { + if (object === void 0 || object === null || opaque[typeof object]) { + return true; + } + if (Array.isArray(object) || typeof object === 'object') { + if (!Object.isFrozen(object)) { + return false; + } + const keys = Object.keys(object); + for (let i2 = 0; i2 < keys.length; i2++) { + let value = null; + try { + value = object[keys[i2]]; + } catch (error) { + continue; + } + if (!_isFrozen(value)) { + return false; + } + } + return true; + } + return logger4.throwArgumentError( + `Cannot deepCopy ${typeof object}`, + 'object', + object + ); +} +function _deepCopy(object) { + if (_isFrozen(object)) { + return object; + } + if (Array.isArray(object)) { + return Object.freeze(object.map((item) => deepCopy(item))); + } + if (typeof object === 'object') { + const result = {}; + for (const key2 in object) { + const value = object[key2]; + if (value === void 0) { + continue; + } + defineReadOnly(result, key2, deepCopy(value)); + } + return result; + } + return logger4.throwArgumentError( + `Cannot deepCopy ${typeof object}`, + 'object', + object + ); +} +function deepCopy(object) { + return _deepCopy(object); +} +var __awaiter, logger4, opaque, Description; +var init_lib4 = __esm({ + 'node_modules/@ethersproject/properties/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_lib(); + init_version4(); + __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 (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + logger4 = new Logger(version5); + opaque = { + bigint: true, + boolean: true, + function: true, + number: true, + string: true, + }; + Description = class { + constructor(info) { + for (const key2 in info) { + this[key2] = deepCopy(info[key2]); + } + } + }; + }, +}); + +// node_modules/@ethersproject/abi/lib.esm/_version.js +var version6; +var init_version5 = __esm({ + 'node_modules/@ethersproject/abi/lib.esm/_version.js'() { + init_shim(); + version6 = 'abi/5.7.0'; + }, +}); + +// node_modules/@ethersproject/abi/lib.esm/fragments.js +function checkModifier(type, name) { + if (type === 'bytes' || type === 'string') { + if (ModifiersBytes[name]) { + return true; + } + } else if (type === 'address') { + if (name === 'payable') { + return true; + } + } else if (type.indexOf('[') >= 0 || type === 'tuple') { + if (ModifiersNest[name]) { + return true; + } + } + if (ModifiersBytes[name] || name === 'payable') { + logger5.throwArgumentError('invalid modifier', 'name', name); + } + return false; +} +function parseParamType(param, allowIndexed) { + let originalParam = param; + function throwError(i2) { + logger5.throwArgumentError( + `unexpected character at position ${i2}`, + 'param', + param + ); + } + param = param.replace(/\s/g, ' '); + function newNode(parent2) { + let node2 = { + type: '', + name: '', + parent: parent2, + state: { allowType: true }, + }; + if (allowIndexed) { + node2.indexed = false; + } + return node2; + } + let parent = { type: '', name: '', state: { allowType: true } }; + let node = parent; + for (let i2 = 0; i2 < param.length; i2++) { + let c = param[i2]; + switch (c) { + case '(': + if (node.state.allowType && node.type === '') { + node.type = 'tuple'; + } else if (!node.state.allowParams) { + throwError(i2); + } + node.state.allowType = false; + node.type = verifyType(node.type); + node.components = [newNode(node)]; + node = node.components[0]; + break; + case ')': + delete node.state; + if (node.name === 'indexed') { + if (!allowIndexed) { + throwError(i2); + } + node.indexed = true; + node.name = ''; + } + if (checkModifier(node.type, node.name)) { + node.name = ''; + } + node.type = verifyType(node.type); + let child = node; + node = node.parent; + if (!node) { + throwError(i2); + } + delete child.parent; + node.state.allowParams = false; + node.state.allowName = true; + node.state.allowArray = true; + break; + case ',': + delete node.state; + if (node.name === 'indexed') { + if (!allowIndexed) { + throwError(i2); + } + node.indexed = true; + node.name = ''; + } + if (checkModifier(node.type, node.name)) { + node.name = ''; + } + node.type = verifyType(node.type); + let sibling = newNode(node.parent); + node.parent.components.push(sibling); + delete node.parent; + node = sibling; + break; + case ' ': + if (node.state.allowType) { + if (node.type !== '') { + node.type = verifyType(node.type); + delete node.state.allowType; + node.state.allowName = true; + node.state.allowParams = true; + } + } + if (node.state.allowName) { + if (node.name !== '') { + if (node.name === 'indexed') { + if (!allowIndexed) { + throwError(i2); + } + if (node.indexed) { + throwError(i2); + } + node.indexed = true; + node.name = ''; + } else if (checkModifier(node.type, node.name)) { + node.name = ''; + } else { + node.state.allowName = false; + } + } + } + break; + case '[': + if (!node.state.allowArray) { + throwError(i2); + } + node.type += c; + node.state.allowArray = false; + node.state.allowName = false; + node.state.readArray = true; + break; + case ']': + if (!node.state.readArray) { + throwError(i2); + } + node.type += c; + node.state.readArray = false; + node.state.allowArray = true; + node.state.allowName = true; + break; + default: + if (node.state.allowType) { + node.type += c; + node.state.allowParams = true; + node.state.allowArray = true; + } else if (node.state.allowName) { + node.name += c; + delete node.state.allowArray; + } else if (node.state.readArray) { + node.type += c; + } else { + throwError(i2); + } + } + } + if (node.parent) { + logger5.throwArgumentError('unexpected eof', 'param', param); + } + delete parent.state; + if (node.name === 'indexed') { + if (!allowIndexed) { + throwError(originalParam.length - 7); + } + if (node.indexed) { + throwError(originalParam.length - 7); + } + node.indexed = true; + node.name = ''; + } else if (checkModifier(node.type, node.name)) { + node.name = ''; + } + parent.type = verifyType(parent.type); + return parent; +} +function populate(object, params) { + for (let key2 in params) { + defineReadOnly(object, key2, params[key2]); + } +} +function parseParams(value, allowIndex) { + return splitNesting(value).map((param) => + ParamType.fromString(param, allowIndex) + ); +} +function parseGas(value, params) { + params.gas = null; + let comps = value.split('@'); + if (comps.length !== 1) { + if (comps.length > 2) { + logger5.throwArgumentError( + 'invalid human-readable ABI signature', + 'value', + value + ); + } + if (!comps[1].match(/^[0-9]+$/)) { + logger5.throwArgumentError( + 'invalid human-readable ABI signature gas', + 'value', + value + ); + } + params.gas = BigNumber.from(comps[1]); + return comps[0]; + } + return value; +} +function parseModifiers(value, params) { + params.constant = false; + params.payable = false; + params.stateMutability = 'nonpayable'; + value.split(' ').forEach((modifier) => { + switch (modifier.trim()) { + case 'constant': + params.constant = true; + break; + case 'payable': + params.payable = true; + params.stateMutability = 'payable'; + break; + case 'nonpayable': + params.payable = false; + params.stateMutability = 'nonpayable'; + break; + case 'pure': + params.constant = true; + params.stateMutability = 'pure'; + break; + case 'view': + params.constant = true; + params.stateMutability = 'view'; + break; + case 'external': + case 'public': + case '': + break; + default: + console.log('unknown modifier: ' + modifier); + } + }); +} +function verifyState(value) { + let result = { + constant: false, + payable: true, + stateMutability: 'payable', + }; + if (value.stateMutability != null) { + result.stateMutability = value.stateMutability; + result.constant = + result.stateMutability === 'view' || result.stateMutability === 'pure'; + if (value.constant != null) { + if (!!value.constant !== result.constant) { + logger5.throwArgumentError( + 'cannot have constant function with mutability ' + + result.stateMutability, + 'value', + value + ); + } + } + result.payable = result.stateMutability === 'payable'; + if (value.payable != null) { + if (!!value.payable !== result.payable) { + logger5.throwArgumentError( + 'cannot have payable function with mutability ' + + result.stateMutability, + 'value', + value + ); + } + } + } else if (value.payable != null) { + result.payable = !!value.payable; + if ( + value.constant == null && + !result.payable && + value.type !== 'constructor' + ) { + logger5.throwArgumentError( + 'unable to determine stateMutability', + 'value', + value + ); + } + result.constant = !!value.constant; + if (result.constant) { + result.stateMutability = 'view'; + } else { + result.stateMutability = result.payable ? 'payable' : 'nonpayable'; + } + if (result.payable && result.constant) { + logger5.throwArgumentError( + 'cannot have constant payable function', + 'value', + value + ); + } + } else if (value.constant != null) { + result.constant = !!value.constant; + result.payable = !result.constant; + result.stateMutability = result.constant ? 'view' : 'payable'; + } else if (value.type !== 'constructor') { + logger5.throwArgumentError( + 'unable to determine stateMutability', + 'value', + value + ); + } + return result; +} +function checkForbidden(fragment) { + const sig = fragment.format(); + if (sig === 'Error(string)' || sig === 'Panic(uint256)') { + logger5.throwArgumentError( + `cannot specify user defined ${sig} error`, + 'fragment', + fragment + ); + } + return fragment; +} +function verifyType(type) { + if (type.match(/^uint($|[^1-9])/)) { + type = 'uint256' + type.substring(4); + } else if (type.match(/^int($|[^1-9])/)) { + type = 'int256' + type.substring(3); + } + return type; +} +function verifyIdentifier(value) { + if (!value || !value.match(regexIdentifier)) { + logger5.throwArgumentError(`invalid identifier "${value}"`, 'value', value); + } + return value; +} +function splitNesting(value) { + value = value.trim(); + let result = []; + let accum = ''; + let depth = 0; + for (let offset = 0; offset < value.length; offset++) { + let c = value[offset]; + if (c === ',' && depth === 0) { + result.push(accum); + accum = ''; + } else { + accum += c; + if (c === '(') { + depth++; + } else if (c === ')') { + depth--; + if (depth === -1) { + logger5.throwArgumentError('unbalanced parenthesis', 'value', value); + } + } + } + } + if (accum) { + result.push(accum); + } + return result; +} +var logger5, + _constructorGuard3, + ModifiersBytes, + ModifiersNest, + FormatTypes, + paramTypeArray, + ParamType, + Fragment, + EventFragment, + ConstructorFragment, + FunctionFragment, + ErrorFragment, + regexIdentifier, + regexParen; +var init_fragments = __esm({ + 'node_modules/@ethersproject/abi/lib.esm/fragments.js'() { + 'use strict'; + init_shim(); + init_lib3(); + init_lib4(); + init_lib(); + init_version5(); + logger5 = new Logger(version6); + _constructorGuard3 = {}; + ModifiersBytes = { calldata: true, memory: true, storage: true }; + ModifiersNest = { calldata: true, memory: true }; + FormatTypes = Object.freeze({ + // Bare formatting, as is needed for computing a sighash of an event or function + sighash: 'sighash', + // Human-Readable with Minimal spacing and without names (compact human-readable) + minimal: 'minimal', + // Human-Readable with nice spacing, including all names + full: 'full', + // JSON-format a la Solidity + json: 'json', + }); + paramTypeArray = new RegExp(/^(.*)\[([0-9]*)\]$/); + ParamType = class { + constructor(constructorGuard, params) { + if (constructorGuard !== _constructorGuard3) { + logger5.throwError( + 'use fromString', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'new ParamType()', + } + ); + } + populate(this, params); + let match = this.type.match(paramTypeArray); + if (match) { + populate(this, { + arrayLength: parseInt(match[2] || '-1'), + arrayChildren: ParamType.fromObject({ + type: match[1], + components: this.components, + }), + baseType: 'array', + }); + } else { + populate(this, { + arrayLength: null, + arrayChildren: null, + baseType: this.components != null ? 'tuple' : this.type, + }); + } + this._isParamType = true; + Object.freeze(this); + } + // Format the parameter fragment + // - sighash: "(uint256,address)" + // - minimal: "tuple(uint256,address) indexed" + // - full: "tuple(uint256 foo, address bar) indexed baz" + format(format) { + if (!format) { + format = FormatTypes.sighash; + } + if (!FormatTypes[format]) { + logger5.throwArgumentError('invalid format type', 'format', format); + } + if (format === FormatTypes.json) { + let result2 = { + type: this.baseType === 'tuple' ? 'tuple' : this.type, + name: this.name || void 0, + }; + if (typeof this.indexed === 'boolean') { + result2.indexed = this.indexed; + } + if (this.components) { + result2.components = this.components.map((comp) => + JSON.parse(comp.format(format)) + ); + } + return JSON.stringify(result2); + } + let result = ''; + if (this.baseType === 'array') { + result += this.arrayChildren.format(format); + result += + '[' + (this.arrayLength < 0 ? '' : String(this.arrayLength)) + ']'; + } else { + if (this.baseType === 'tuple') { + if (format !== FormatTypes.sighash) { + result += this.type; + } + result += + '(' + + this.components + .map((comp) => comp.format(format)) + .join(format === FormatTypes.full ? ', ' : ',') + + ')'; + } else { + result += this.type; + } + } + if (format !== FormatTypes.sighash) { + if (this.indexed === true) { + result += ' indexed'; + } + if (format === FormatTypes.full && this.name) { + result += ' ' + this.name; + } + } + return result; + } + static from(value, allowIndexed) { + if (typeof value === 'string') { + return ParamType.fromString(value, allowIndexed); + } + return ParamType.fromObject(value); + } + static fromObject(value) { + if (ParamType.isParamType(value)) { + return value; + } + return new ParamType(_constructorGuard3, { + name: value.name || null, + type: verifyType(value.type), + indexed: value.indexed == null ? null : !!value.indexed, + components: value.components + ? value.components.map(ParamType.fromObject) + : null, + }); + } + static fromString(value, allowIndexed) { + function ParamTypify(node) { + return ParamType.fromObject({ + name: node.name, + type: node.type, + indexed: node.indexed, + components: node.components, + }); + } + return ParamTypify(parseParamType(value, !!allowIndexed)); + } + static isParamType(value) { + return !!(value != null && value._isParamType); + } + }; + Fragment = class { + constructor(constructorGuard, params) { + if (constructorGuard !== _constructorGuard3) { + logger5.throwError( + 'use a static from method', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'new Fragment()', + } + ); + } + populate(this, params); + this._isFragment = true; + Object.freeze(this); + } + static from(value) { + if (Fragment.isFragment(value)) { + return value; + } + if (typeof value === 'string') { + return Fragment.fromString(value); + } + return Fragment.fromObject(value); + } + static fromObject(value) { + if (Fragment.isFragment(value)) { + return value; + } + switch (value.type) { + case 'function': + return FunctionFragment.fromObject(value); + case 'event': + return EventFragment.fromObject(value); + case 'constructor': + return ConstructorFragment.fromObject(value); + case 'error': + return ErrorFragment.fromObject(value); + case 'fallback': + case 'receive': + return null; + } + return logger5.throwArgumentError( + 'invalid fragment object', + 'value', + value + ); + } + static fromString(value) { + value = value.replace(/\s/g, ' '); + value = value + .replace(/\(/g, ' (') + .replace(/\)/g, ') ') + .replace(/\s+/g, ' '); + value = value.trim(); + if (value.split(' ')[0] === 'event') { + return EventFragment.fromString(value.substring(5).trim()); + } else if (value.split(' ')[0] === 'function') { + return FunctionFragment.fromString(value.substring(8).trim()); + } else if (value.split('(')[0].trim() === 'constructor') { + return ConstructorFragment.fromString(value.trim()); + } else if (value.split(' ')[0] === 'error') { + return ErrorFragment.fromString(value.substring(5).trim()); + } + return logger5.throwArgumentError( + 'unsupported fragment', + 'value', + value + ); + } + static isFragment(value) { + return !!(value && value._isFragment); + } + }; + EventFragment = class extends Fragment { + format(format) { + if (!format) { + format = FormatTypes.sighash; + } + if (!FormatTypes[format]) { + logger5.throwArgumentError('invalid format type', 'format', format); + } + if (format === FormatTypes.json) { + return JSON.stringify({ + type: 'event', + anonymous: this.anonymous, + name: this.name, + inputs: this.inputs.map((input) => + JSON.parse(input.format(format)) + ), + }); + } + let result = ''; + if (format !== FormatTypes.sighash) { + result += 'event '; + } + result += + this.name + + '(' + + this.inputs + .map((input) => input.format(format)) + .join(format === FormatTypes.full ? ', ' : ',') + + ') '; + if (format !== FormatTypes.sighash) { + if (this.anonymous) { + result += 'anonymous '; + } + } + return result.trim(); + } + static from(value) { + if (typeof value === 'string') { + return EventFragment.fromString(value); + } + return EventFragment.fromObject(value); + } + static fromObject(value) { + if (EventFragment.isEventFragment(value)) { + return value; + } + if (value.type !== 'event') { + logger5.throwArgumentError('invalid event object', 'value', value); + } + const params = { + name: verifyIdentifier(value.name), + anonymous: value.anonymous, + inputs: value.inputs ? value.inputs.map(ParamType.fromObject) : [], + type: 'event', + }; + return new EventFragment(_constructorGuard3, params); + } + static fromString(value) { + let match = value.match(regexParen); + if (!match) { + logger5.throwArgumentError('invalid event string', 'value', value); + } + let anonymous = false; + match[3].split(' ').forEach((modifier) => { + switch (modifier.trim()) { + case 'anonymous': + anonymous = true; + break; + case '': + break; + default: + logger5.warn('unknown modifier: ' + modifier); + } + }); + return EventFragment.fromObject({ + name: match[1].trim(), + anonymous, + inputs: parseParams(match[2], true), + type: 'event', + }); + } + static isEventFragment(value) { + return value && value._isFragment && value.type === 'event'; + } + }; + ConstructorFragment = class extends Fragment { + format(format) { + if (!format) { + format = FormatTypes.sighash; + } + if (!FormatTypes[format]) { + logger5.throwArgumentError('invalid format type', 'format', format); + } + if (format === FormatTypes.json) { + return JSON.stringify({ + type: 'constructor', + stateMutability: + this.stateMutability !== 'nonpayable' + ? this.stateMutability + : void 0, + payable: this.payable, + gas: this.gas ? this.gas.toNumber() : void 0, + inputs: this.inputs.map((input) => + JSON.parse(input.format(format)) + ), + }); + } + if (format === FormatTypes.sighash) { + logger5.throwError( + 'cannot format a constructor for sighash', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'format(sighash)', + } + ); + } + let result = + 'constructor(' + + this.inputs + .map((input) => input.format(format)) + .join(format === FormatTypes.full ? ', ' : ',') + + ') '; + if (this.stateMutability && this.stateMutability !== 'nonpayable') { + result += this.stateMutability + ' '; + } + return result.trim(); + } + static from(value) { + if (typeof value === 'string') { + return ConstructorFragment.fromString(value); + } + return ConstructorFragment.fromObject(value); + } + static fromObject(value) { + if (ConstructorFragment.isConstructorFragment(value)) { + return value; + } + if (value.type !== 'constructor') { + logger5.throwArgumentError( + 'invalid constructor object', + 'value', + value + ); + } + let state = verifyState(value); + if (state.constant) { + logger5.throwArgumentError( + 'constructor cannot be constant', + 'value', + value + ); + } + const params = { + name: null, + type: value.type, + inputs: value.inputs ? value.inputs.map(ParamType.fromObject) : [], + payable: state.payable, + stateMutability: state.stateMutability, + gas: value.gas ? BigNumber.from(value.gas) : null, + }; + return new ConstructorFragment(_constructorGuard3, params); + } + static fromString(value) { + let params = { type: 'constructor' }; + value = parseGas(value, params); + let parens = value.match(regexParen); + if (!parens || parens[1].trim() !== 'constructor') { + logger5.throwArgumentError( + 'invalid constructor string', + 'value', + value + ); + } + params.inputs = parseParams(parens[2].trim(), false); + parseModifiers(parens[3].trim(), params); + return ConstructorFragment.fromObject(params); + } + static isConstructorFragment(value) { + return value && value._isFragment && value.type === 'constructor'; + } + }; + FunctionFragment = class extends ConstructorFragment { + format(format) { + if (!format) { + format = FormatTypes.sighash; + } + if (!FormatTypes[format]) { + logger5.throwArgumentError('invalid format type', 'format', format); + } + if (format === FormatTypes.json) { + return JSON.stringify({ + type: 'function', + name: this.name, + constant: this.constant, + stateMutability: + this.stateMutability !== 'nonpayable' + ? this.stateMutability + : void 0, + payable: this.payable, + gas: this.gas ? this.gas.toNumber() : void 0, + inputs: this.inputs.map((input) => + JSON.parse(input.format(format)) + ), + outputs: this.outputs.map((output) => + JSON.parse(output.format(format)) + ), + }); + } + let result = ''; + if (format !== FormatTypes.sighash) { + result += 'function '; + } + result += + this.name + + '(' + + this.inputs + .map((input) => input.format(format)) + .join(format === FormatTypes.full ? ', ' : ',') + + ') '; + if (format !== FormatTypes.sighash) { + if (this.stateMutability) { + if (this.stateMutability !== 'nonpayable') { + result += this.stateMutability + ' '; + } + } else if (this.constant) { + result += 'view '; + } + if (this.outputs && this.outputs.length) { + result += + 'returns (' + + this.outputs.map((output) => output.format(format)).join(', ') + + ') '; + } + if (this.gas != null) { + result += '@' + this.gas.toString() + ' '; + } + } + return result.trim(); + } + static from(value) { + if (typeof value === 'string') { + return FunctionFragment.fromString(value); + } + return FunctionFragment.fromObject(value); + } + static fromObject(value) { + if (FunctionFragment.isFunctionFragment(value)) { + return value; + } + if (value.type !== 'function') { + logger5.throwArgumentError('invalid function object', 'value', value); + } + let state = verifyState(value); + const params = { + type: value.type, + name: verifyIdentifier(value.name), + constant: state.constant, + inputs: value.inputs ? value.inputs.map(ParamType.fromObject) : [], + outputs: value.outputs ? value.outputs.map(ParamType.fromObject) : [], + payable: state.payable, + stateMutability: state.stateMutability, + gas: value.gas ? BigNumber.from(value.gas) : null, + }; + return new FunctionFragment(_constructorGuard3, params); + } + static fromString(value) { + let params = { type: 'function' }; + value = parseGas(value, params); + let comps = value.split(' returns '); + if (comps.length > 2) { + logger5.throwArgumentError('invalid function string', 'value', value); + } + let parens = comps[0].match(regexParen); + if (!parens) { + logger5.throwArgumentError( + 'invalid function signature', + 'value', + value + ); + } + params.name = parens[1].trim(); + if (params.name) { + verifyIdentifier(params.name); + } + params.inputs = parseParams(parens[2], false); + parseModifiers(parens[3].trim(), params); + if (comps.length > 1) { + let returns = comps[1].match(regexParen); + if (returns[1].trim() != '' || returns[3].trim() != '') { + logger5.throwArgumentError('unexpected tokens', 'value', value); + } + params.outputs = parseParams(returns[2], false); + } else { + params.outputs = []; + } + return FunctionFragment.fromObject(params); + } + static isFunctionFragment(value) { + return value && value._isFragment && value.type === 'function'; + } + }; + ErrorFragment = class extends Fragment { + format(format) { + if (!format) { + format = FormatTypes.sighash; + } + if (!FormatTypes[format]) { + logger5.throwArgumentError('invalid format type', 'format', format); + } + if (format === FormatTypes.json) { + return JSON.stringify({ + type: 'error', + name: this.name, + inputs: this.inputs.map((input) => + JSON.parse(input.format(format)) + ), + }); + } + let result = ''; + if (format !== FormatTypes.sighash) { + result += 'error '; + } + result += + this.name + + '(' + + this.inputs + .map((input) => input.format(format)) + .join(format === FormatTypes.full ? ', ' : ',') + + ') '; + return result.trim(); + } + static from(value) { + if (typeof value === 'string') { + return ErrorFragment.fromString(value); + } + return ErrorFragment.fromObject(value); + } + static fromObject(value) { + if (ErrorFragment.isErrorFragment(value)) { + return value; + } + if (value.type !== 'error') { + logger5.throwArgumentError('invalid error object', 'value', value); + } + const params = { + type: value.type, + name: verifyIdentifier(value.name), + inputs: value.inputs ? value.inputs.map(ParamType.fromObject) : [], + }; + return checkForbidden(new ErrorFragment(_constructorGuard3, params)); + } + static fromString(value) { + let params = { type: 'error' }; + let parens = value.match(regexParen); + if (!parens) { + logger5.throwArgumentError('invalid error signature', 'value', value); + } + params.name = parens[1].trim(); + if (params.name) { + verifyIdentifier(params.name); + } + params.inputs = parseParams(parens[2], false); + return checkForbidden(ErrorFragment.fromObject(params)); + } + static isErrorFragment(value) { + return value && value._isFragment && value.type === 'error'; + } + }; + regexIdentifier = new RegExp('^[a-zA-Z$_][a-zA-Z0-9$_]*$'); + regexParen = new RegExp('^([^)(]*)\\((.*)\\)([^)(]*)$'); + }, +}); + +// node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js +function checkResultErrors(result) { + const errors = []; + const checkErrors = function (path, object) { + if (!Array.isArray(object)) { + return; + } + for (let key2 in object) { + const childPath = path.slice(); + childPath.push(key2); + try { + checkErrors(childPath, object[key2]); + } catch (error) { + errors.push({ path: childPath, error }); + } + } + }; + checkErrors([], result); + return errors; +} +var logger6, Coder, Writer, Reader; +var init_abstract_coder = __esm({ + 'node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js'() { + 'use strict'; + init_shim(); + init_lib2(); + init_lib3(); + init_lib4(); + init_lib(); + init_version5(); + logger6 = new Logger(version6); + Coder = class { + constructor(name, type, localName, dynamic) { + this.name = name; + this.type = type; + this.localName = localName; + this.dynamic = dynamic; + } + _throwError(message, value) { + logger6.throwArgumentError(message, this.localName, value); + } + }; + Writer = class { + constructor(wordSize) { + defineReadOnly(this, 'wordSize', wordSize || 32); + this._data = []; + this._dataLength = 0; + this._padding = new Uint8Array(wordSize); + } + get data() { + return hexConcat(this._data); + } + get length() { + return this._dataLength; + } + _writeData(data) { + this._data.push(data); + this._dataLength += data.length; + return data.length; + } + appendWriter(writer) { + return this._writeData(concat(writer._data)); + } + // Arrayish items; padded on the right to wordSize + writeBytes(value) { + let bytes = arrayify(value); + const paddingOffset = bytes.length % this.wordSize; + if (paddingOffset) { + bytes = concat([bytes, this._padding.slice(paddingOffset)]); + } + return this._writeData(bytes); + } + _getValue(value) { + let bytes = arrayify(BigNumber.from(value)); + if (bytes.length > this.wordSize) { + logger6.throwError( + 'value out-of-bounds', + Logger.errors.BUFFER_OVERRUN, + { + length: this.wordSize, + offset: bytes.length, + } + ); + } + if (bytes.length % this.wordSize) { + bytes = concat([ + this._padding.slice(bytes.length % this.wordSize), + bytes, + ]); + } + return bytes; + } + // BigNumberish items; padded on the left to wordSize + writeValue(value) { + return this._writeData(this._getValue(value)); + } + writeUpdatableValue() { + const offset = this._data.length; + this._data.push(this._padding); + this._dataLength += this.wordSize; + return (value) => { + this._data[offset] = this._getValue(value); + }; + } + }; + Reader = class { + constructor(data, wordSize, coerceFunc, allowLoose) { + defineReadOnly(this, '_data', arrayify(data)); + defineReadOnly(this, 'wordSize', wordSize || 32); + defineReadOnly(this, '_coerceFunc', coerceFunc); + defineReadOnly(this, 'allowLoose', allowLoose); + this._offset = 0; + } + get data() { + return hexlify(this._data); + } + get consumed() { + return this._offset; + } + // The default Coerce function + static coerce(name, value) { + let match = name.match('^u?int([0-9]+)$'); + if (match && parseInt(match[1]) <= 48) { + value = value.toNumber(); + } + return value; + } + coerce(name, value) { + if (this._coerceFunc) { + return this._coerceFunc(name, value); + } + return Reader.coerce(name, value); + } + _peekBytes(offset, length, loose) { + let alignedLength = Math.ceil(length / this.wordSize) * this.wordSize; + if (this._offset + alignedLength > this._data.length) { + if ( + this.allowLoose && + loose && + this._offset + length <= this._data.length + ) { + alignedLength = length; + } else { + logger6.throwError( + 'data out-of-bounds', + Logger.errors.BUFFER_OVERRUN, + { + length: this._data.length, + offset: this._offset + alignedLength, + } + ); + } + } + return this._data.slice(this._offset, this._offset + alignedLength); + } + subReader(offset) { + return new Reader( + this._data.slice(this._offset + offset), + this.wordSize, + this._coerceFunc, + this.allowLoose + ); + } + readBytes(length, loose) { + let bytes = this._peekBytes(0, length, !!loose); + this._offset += bytes.length; + return bytes.slice(0, length); + } + readValue() { + return BigNumber.from(this.readBytes(this.wordSize)); + } + }; + }, +}); + +// node_modules/@ethersproject/keccak256/node_modules/js-sha3/src/sha3.js +var require_sha3 = __commonJS({ + 'node_modules/@ethersproject/keccak256/node_modules/js-sha3/src/sha3.js'( + exports, + module2 + ) { + init_shim(); + (function () { + 'use strict'; + var INPUT_ERROR = 'input is invalid type'; + var FINALIZE_ERROR = 'finalize already called'; + var WINDOW = typeof window === 'object'; + var root = WINDOW ? window : {}; + if (root.JS_SHA3_NO_WINDOW) { + WINDOW = false; + } + var WEB_WORKER = !WINDOW && typeof self === 'object'; + var NODE_JS = + !root.JS_SHA3_NO_NODE_JS && + typeof process === 'object' && + process.versions && + process.versions.node; + if (NODE_JS) { + root = global; + } else if (WEB_WORKER) { + root = self; + } + var COMMON_JS = + !root.JS_SHA3_NO_COMMON_JS && + typeof module2 === 'object' && + module2.exports; + var AMD = typeof define === 'function' && define.amd; + var ARRAY_BUFFER = + !root.JS_SHA3_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined'; + var HEX_CHARS = '0123456789abcdef'.split(''); + var SHAKE_PADDING = [31, 7936, 2031616, 520093696]; + var CSHAKE_PADDING = [4, 1024, 262144, 67108864]; + var KECCAK_PADDING = [1, 256, 65536, 16777216]; + var PADDING = [6, 1536, 393216, 100663296]; + var SHIFT = [0, 8, 16, 24]; + var RC = [ + 1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, + 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, + 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, + 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, + 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, + 2147483648, 2147483649, 0, 2147516424, 2147483648, + ]; + var BITS = [224, 256, 384, 512]; + var SHAKE_BITS = [128, 256]; + var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array', 'digest']; + var CSHAKE_BYTEPAD = { + 128: 168, + 256: 136, + }; + if (root.JS_SHA3_NO_NODE_JS || !Array.isArray) { + Array.isArray = function (obj) { + return Object.prototype.toString.call(obj) === '[object Array]'; + }; + } + if ( + ARRAY_BUFFER && + (root.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView) + ) { + ArrayBuffer.isView = function (obj) { + return ( + typeof obj === 'object' && + obj.buffer && + obj.buffer.constructor === ArrayBuffer + ); + }; + } + var createOutputMethod = function (bits2, padding2, outputType) { + return function (message) { + return new Keccak(bits2, padding2, bits2) + .update(message) + [outputType](); + }; + }; + var createShakeOutputMethod = function (bits2, padding2, outputType) { + return function (message, outputBits) { + return new Keccak(bits2, padding2, outputBits) + .update(message) + [outputType](); + }; + }; + var createCshakeOutputMethod = function (bits2, padding2, outputType) { + return function (message, outputBits, n2, s2) { + return methods['cshake' + bits2] + .update(message, outputBits, n2, s2) + [outputType](); + }; + }; + var createKmacOutputMethod = function (bits2, padding2, outputType) { + return function (key2, message, outputBits, s2) { + return methods['kmac' + bits2] + .update(key2, message, outputBits, s2) + [outputType](); + }; + }; + var createOutputMethods = function ( + method, + createMethod2, + bits2, + padding2 + ) { + for (var i3 = 0; i3 < OUTPUT_TYPES.length; ++i3) { + var type = OUTPUT_TYPES[i3]; + method[type] = createMethod2(bits2, padding2, type); + } + return method; + }; + var createMethod = function (bits2, padding2) { + var method = createOutputMethod(bits2, padding2, 'hex'); + method.create = function () { + return new Keccak(bits2, padding2, bits2); + }; + method.update = function (message) { + return method.create().update(message); + }; + return createOutputMethods(method, createOutputMethod, bits2, padding2); + }; + var createShakeMethod = function (bits2, padding2) { + var method = createShakeOutputMethod(bits2, padding2, 'hex'); + method.create = function (outputBits) { + return new Keccak(bits2, padding2, outputBits); + }; + method.update = function (message, outputBits) { + return method.create(outputBits).update(message); + }; + return createOutputMethods( + method, + createShakeOutputMethod, + bits2, + padding2 + ); + }; + var createCshakeMethod = function (bits2, padding2) { + var w = CSHAKE_BYTEPAD[bits2]; + var method = createCshakeOutputMethod(bits2, padding2, 'hex'); + method.create = function (outputBits, n2, s2) { + if (!n2 && !s2) { + return methods['shake' + bits2].create(outputBits); + } else { + return new Keccak(bits2, padding2, outputBits).bytepad([n2, s2], w); + } + }; + method.update = function (message, outputBits, n2, s2) { + return method.create(outputBits, n2, s2).update(message); + }; + return createOutputMethods( + method, + createCshakeOutputMethod, + bits2, + padding2 + ); + }; + var createKmacMethod = function (bits2, padding2) { + var w = CSHAKE_BYTEPAD[bits2]; + var method = createKmacOutputMethod(bits2, padding2, 'hex'); + method.create = function (key2, outputBits, s2) { + return new Kmac(bits2, padding2, outputBits) + .bytepad(['KMAC', s2], w) + .bytepad([key2], w); + }; + method.update = function (key2, message, outputBits, s2) { + return method.create(key2, outputBits, s2).update(message); + }; + return createOutputMethods( + method, + createKmacOutputMethod, + bits2, + padding2 + ); + }; + var algorithms = [ + { name: 'keccak', padding: KECCAK_PADDING, bits: BITS, createMethod }, + { name: 'sha3', padding: PADDING, bits: BITS, createMethod }, + { + name: 'shake', + padding: SHAKE_PADDING, + bits: SHAKE_BITS, + createMethod: createShakeMethod, + }, + { + name: 'cshake', + padding: CSHAKE_PADDING, + bits: SHAKE_BITS, + createMethod: createCshakeMethod, + }, + { + name: 'kmac', + padding: CSHAKE_PADDING, + bits: SHAKE_BITS, + createMethod: createKmacMethod, + }, + ]; + var methods = {}, + methodNames = []; + for (var i2 = 0; i2 < algorithms.length; ++i2) { + var algorithm = algorithms[i2]; + var bits = algorithm.bits; + for (var j = 0; j < bits.length; ++j) { + var methodName = algorithm.name + '_' + bits[j]; + methodNames.push(methodName); + methods[methodName] = algorithm.createMethod( + bits[j], + algorithm.padding + ); + if (algorithm.name !== 'sha3') { + var newMethodName = algorithm.name + bits[j]; + methodNames.push(newMethodName); + methods[newMethodName] = methods[methodName]; + } + } + } + function Keccak(bits2, padding2, outputBits) { + this.blocks = []; + this.s = []; + this.padding = padding2; + this.outputBits = outputBits; + this.reset = true; + this.finalized = false; + this.block = 0; + this.start = 0; + this.blockCount = (1600 - (bits2 << 1)) >> 5; + this.byteCount = this.blockCount << 2; + this.outputBlocks = outputBits >> 5; + this.extraBytes = (outputBits & 31) >> 3; + for (var i3 = 0; i3 < 50; ++i3) { + this.s[i3] = 0; + } + } + Keccak.prototype.update = function (message) { + if (this.finalized) { + throw new Error(FINALIZE_ERROR); + } + var notString, + type = typeof message; + if (type !== 'string') { + if (type === 'object') { + if (message === null) { + throw new Error(INPUT_ERROR); + } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) { + message = new Uint8Array(message); + } else if (!Array.isArray(message)) { + if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) { + throw new Error(INPUT_ERROR); + } + } + } else { + throw new Error(INPUT_ERROR); + } + notString = true; + } + var blocks = this.blocks, + byteCount = this.byteCount, + length = message.length, + blockCount = this.blockCount, + index = 0, + s2 = this.s, + i3, + code9; + while (index < length) { + if (this.reset) { + this.reset = false; + blocks[0] = this.block; + for (i3 = 1; i3 < blockCount + 1; ++i3) { + blocks[i3] = 0; + } + } + if (notString) { + for (i3 = this.start; index < length && i3 < byteCount; ++index) { + blocks[i3 >> 2] |= message[index] << SHIFT[i3++ & 3]; + } + } else { + for (i3 = this.start; index < length && i3 < byteCount; ++index) { + code9 = message.charCodeAt(index); + if (code9 < 128) { + blocks[i3 >> 2] |= code9 << SHIFT[i3++ & 3]; + } else if (code9 < 2048) { + blocks[i3 >> 2] |= (192 | (code9 >> 6)) << SHIFT[i3++ & 3]; + blocks[i3 >> 2] |= (128 | (code9 & 63)) << SHIFT[i3++ & 3]; + } else if (code9 < 55296 || code9 >= 57344) { + blocks[i3 >> 2] |= (224 | (code9 >> 12)) << SHIFT[i3++ & 3]; + blocks[i3 >> 2] |= + (128 | ((code9 >> 6) & 63)) << SHIFT[i3++ & 3]; + blocks[i3 >> 2] |= (128 | (code9 & 63)) << SHIFT[i3++ & 3]; + } else { + code9 = + 65536 + + (((code9 & 1023) << 10) | + (message.charCodeAt(++index) & 1023)); + blocks[i3 >> 2] |= (240 | (code9 >> 18)) << SHIFT[i3++ & 3]; + blocks[i3 >> 2] |= + (128 | ((code9 >> 12) & 63)) << SHIFT[i3++ & 3]; + blocks[i3 >> 2] |= + (128 | ((code9 >> 6) & 63)) << SHIFT[i3++ & 3]; + blocks[i3 >> 2] |= (128 | (code9 & 63)) << SHIFT[i3++ & 3]; + } + } + } + this.lastByteIndex = i3; + if (i3 >= byteCount) { + this.start = i3 - byteCount; + this.block = blocks[blockCount]; + for (i3 = 0; i3 < blockCount; ++i3) { + s2[i3] ^= blocks[i3]; + } + f(s2); + this.reset = true; + } else { + this.start = i3; + } + } + return this; + }; + Keccak.prototype.encode = function (x, right) { + var o2 = x & 255, + n2 = 1; + var bytes = [o2]; + x = x >> 8; + o2 = x & 255; + while (o2 > 0) { + bytes.unshift(o2); + x = x >> 8; + o2 = x & 255; + ++n2; + } + if (right) { + bytes.push(n2); + } else { + bytes.unshift(n2); + } + this.update(bytes); + return bytes.length; + }; + Keccak.prototype.encodeString = function (str) { + var notString, + type = typeof str; + if (type !== 'string') { + if (type === 'object') { + if (str === null) { + throw new Error(INPUT_ERROR); + } else if (ARRAY_BUFFER && str.constructor === ArrayBuffer) { + str = new Uint8Array(str); + } else if (!Array.isArray(str)) { + if (!ARRAY_BUFFER || !ArrayBuffer.isView(str)) { + throw new Error(INPUT_ERROR); + } + } + } else { + throw new Error(INPUT_ERROR); + } + notString = true; + } + var bytes = 0, + length = str.length; + if (notString) { + bytes = length; + } else { + for (var i3 = 0; i3 < str.length; ++i3) { + var code9 = str.charCodeAt(i3); + if (code9 < 128) { + bytes += 1; + } else if (code9 < 2048) { + bytes += 2; + } else if (code9 < 55296 || code9 >= 57344) { + bytes += 3; + } else { + code9 = + 65536 + + (((code9 & 1023) << 10) | (str.charCodeAt(++i3) & 1023)); + bytes += 4; + } + } + } + bytes += this.encode(bytes * 8); + this.update(str); + return bytes; + }; + Keccak.prototype.bytepad = function (strs, w) { + var bytes = this.encode(w); + for (var i3 = 0; i3 < strs.length; ++i3) { + bytes += this.encodeString(strs[i3]); + } + var paddingBytes = w - (bytes % w); + var zeros2 = []; + zeros2.length = paddingBytes; + this.update(zeros2); + return this; + }; + Keccak.prototype.finalize = function () { + if (this.finalized) { + return; + } + this.finalized = true; + var blocks = this.blocks, + i3 = this.lastByteIndex, + blockCount = this.blockCount, + s2 = this.s; + blocks[i3 >> 2] |= this.padding[i3 & 3]; + if (this.lastByteIndex === this.byteCount) { + blocks[0] = blocks[blockCount]; + for (i3 = 1; i3 < blockCount + 1; ++i3) { + blocks[i3] = 0; + } + } + blocks[blockCount - 1] |= 2147483648; + for (i3 = 0; i3 < blockCount; ++i3) { + s2[i3] ^= blocks[i3]; + } + f(s2); + }; + Keccak.prototype.toString = Keccak.prototype.hex = function () { + this.finalize(); + var blockCount = this.blockCount, + s2 = this.s, + outputBlocks = this.outputBlocks, + extraBytes = this.extraBytes, + i3 = 0, + j2 = 0; + var hex = '', + block; + while (j2 < outputBlocks) { + for (i3 = 0; i3 < blockCount && j2 < outputBlocks; ++i3, ++j2) { + block = s2[i3]; + hex += + HEX_CHARS[(block >> 4) & 15] + + HEX_CHARS[block & 15] + + HEX_CHARS[(block >> 12) & 15] + + HEX_CHARS[(block >> 8) & 15] + + HEX_CHARS[(block >> 20) & 15] + + HEX_CHARS[(block >> 16) & 15] + + HEX_CHARS[(block >> 28) & 15] + + HEX_CHARS[(block >> 24) & 15]; + } + if (j2 % blockCount === 0) { + f(s2); + i3 = 0; + } + } + if (extraBytes) { + block = s2[i3]; + hex += HEX_CHARS[(block >> 4) & 15] + HEX_CHARS[block & 15]; + if (extraBytes > 1) { + hex += HEX_CHARS[(block >> 12) & 15] + HEX_CHARS[(block >> 8) & 15]; + } + if (extraBytes > 2) { + hex += + HEX_CHARS[(block >> 20) & 15] + HEX_CHARS[(block >> 16) & 15]; + } + } + return hex; + }; + Keccak.prototype.arrayBuffer = function () { + this.finalize(); + var blockCount = this.blockCount, + s2 = this.s, + outputBlocks = this.outputBlocks, + extraBytes = this.extraBytes, + i3 = 0, + j2 = 0; + var bytes = this.outputBits >> 3; + var buffer; + if (extraBytes) { + buffer = new ArrayBuffer((outputBlocks + 1) << 2); + } else { + buffer = new ArrayBuffer(bytes); + } + var array = new Uint32Array(buffer); + while (j2 < outputBlocks) { + for (i3 = 0; i3 < blockCount && j2 < outputBlocks; ++i3, ++j2) { + array[j2] = s2[i3]; + } + if (j2 % blockCount === 0) { + f(s2); + } + } + if (extraBytes) { + array[i3] = s2[i3]; + buffer = buffer.slice(0, bytes); + } + return buffer; + }; + Keccak.prototype.buffer = Keccak.prototype.arrayBuffer; + Keccak.prototype.digest = Keccak.prototype.array = function () { + this.finalize(); + var blockCount = this.blockCount, + s2 = this.s, + outputBlocks = this.outputBlocks, + extraBytes = this.extraBytes, + i3 = 0, + j2 = 0; + var array = [], + offset, + block; + while (j2 < outputBlocks) { + for (i3 = 0; i3 < blockCount && j2 < outputBlocks; ++i3, ++j2) { + offset = j2 << 2; + block = s2[i3]; + array[offset] = block & 255; + array[offset + 1] = (block >> 8) & 255; + array[offset + 2] = (block >> 16) & 255; + array[offset + 3] = (block >> 24) & 255; + } + if (j2 % blockCount === 0) { + f(s2); + } + } + if (extraBytes) { + offset = j2 << 2; + block = s2[i3]; + array[offset] = block & 255; + if (extraBytes > 1) { + array[offset + 1] = (block >> 8) & 255; + } + if (extraBytes > 2) { + array[offset + 2] = (block >> 16) & 255; + } + } + return array; + }; + function Kmac(bits2, padding2, outputBits) { + Keccak.call(this, bits2, padding2, outputBits); + } + Kmac.prototype = new Keccak(); + Kmac.prototype.finalize = function () { + this.encode(this.outputBits, true); + return Keccak.prototype.finalize.call(this); + }; + var f = function (s2) { + var h, + l2, + n2, + c0, + c1, + c2, + c3, + c4, + c5, + c6, + c7, + c8, + c9, + b0, + b1, + b2, + b3, + b4, + b5, + b6, + b7, + b8, + b9, + b10, + b11, + b12, + b13, + b14, + b15, + b16, + b17, + b18, + b19, + b20, + b21, + b22, + b23, + b24, + b25, + b26, + b27, + b28, + b29, + b30, + b31, + b32, + b33, + b34, + b35, + b36, + b37, + b38, + b39, + b40, + b41, + b42, + b43, + b44, + b45, + b46, + b47, + b48, + b49; + for (n2 = 0; n2 < 48; n2 += 2) { + c0 = s2[0] ^ s2[10] ^ s2[20] ^ s2[30] ^ s2[40]; + c1 = s2[1] ^ s2[11] ^ s2[21] ^ s2[31] ^ s2[41]; + c2 = s2[2] ^ s2[12] ^ s2[22] ^ s2[32] ^ s2[42]; + c3 = s2[3] ^ s2[13] ^ s2[23] ^ s2[33] ^ s2[43]; + c4 = s2[4] ^ s2[14] ^ s2[24] ^ s2[34] ^ s2[44]; + c5 = s2[5] ^ s2[15] ^ s2[25] ^ s2[35] ^ s2[45]; + c6 = s2[6] ^ s2[16] ^ s2[26] ^ s2[36] ^ s2[46]; + c7 = s2[7] ^ s2[17] ^ s2[27] ^ s2[37] ^ s2[47]; + c8 = s2[8] ^ s2[18] ^ s2[28] ^ s2[38] ^ s2[48]; + c9 = s2[9] ^ s2[19] ^ s2[29] ^ s2[39] ^ s2[49]; + h = c8 ^ ((c2 << 1) | (c3 >>> 31)); + l2 = c9 ^ ((c3 << 1) | (c2 >>> 31)); + s2[0] ^= h; + s2[1] ^= l2; + s2[10] ^= h; + s2[11] ^= l2; + s2[20] ^= h; + s2[21] ^= l2; + s2[30] ^= h; + s2[31] ^= l2; + s2[40] ^= h; + s2[41] ^= l2; + h = c0 ^ ((c4 << 1) | (c5 >>> 31)); + l2 = c1 ^ ((c5 << 1) | (c4 >>> 31)); + s2[2] ^= h; + s2[3] ^= l2; + s2[12] ^= h; + s2[13] ^= l2; + s2[22] ^= h; + s2[23] ^= l2; + s2[32] ^= h; + s2[33] ^= l2; + s2[42] ^= h; + s2[43] ^= l2; + h = c2 ^ ((c6 << 1) | (c7 >>> 31)); + l2 = c3 ^ ((c7 << 1) | (c6 >>> 31)); + s2[4] ^= h; + s2[5] ^= l2; + s2[14] ^= h; + s2[15] ^= l2; + s2[24] ^= h; + s2[25] ^= l2; + s2[34] ^= h; + s2[35] ^= l2; + s2[44] ^= h; + s2[45] ^= l2; + h = c4 ^ ((c8 << 1) | (c9 >>> 31)); + l2 = c5 ^ ((c9 << 1) | (c8 >>> 31)); + s2[6] ^= h; + s2[7] ^= l2; + s2[16] ^= h; + s2[17] ^= l2; + s2[26] ^= h; + s2[27] ^= l2; + s2[36] ^= h; + s2[37] ^= l2; + s2[46] ^= h; + s2[47] ^= l2; + h = c6 ^ ((c0 << 1) | (c1 >>> 31)); + l2 = c7 ^ ((c1 << 1) | (c0 >>> 31)); + s2[8] ^= h; + s2[9] ^= l2; + s2[18] ^= h; + s2[19] ^= l2; + s2[28] ^= h; + s2[29] ^= l2; + s2[38] ^= h; + s2[39] ^= l2; + s2[48] ^= h; + s2[49] ^= l2; + b0 = s2[0]; + b1 = s2[1]; + b32 = (s2[11] << 4) | (s2[10] >>> 28); + b33 = (s2[10] << 4) | (s2[11] >>> 28); + b14 = (s2[20] << 3) | (s2[21] >>> 29); + b15 = (s2[21] << 3) | (s2[20] >>> 29); + b46 = (s2[31] << 9) | (s2[30] >>> 23); + b47 = (s2[30] << 9) | (s2[31] >>> 23); + b28 = (s2[40] << 18) | (s2[41] >>> 14); + b29 = (s2[41] << 18) | (s2[40] >>> 14); + b20 = (s2[2] << 1) | (s2[3] >>> 31); + b21 = (s2[3] << 1) | (s2[2] >>> 31); + b2 = (s2[13] << 12) | (s2[12] >>> 20); + b3 = (s2[12] << 12) | (s2[13] >>> 20); + b34 = (s2[22] << 10) | (s2[23] >>> 22); + b35 = (s2[23] << 10) | (s2[22] >>> 22); + b16 = (s2[33] << 13) | (s2[32] >>> 19); + b17 = (s2[32] << 13) | (s2[33] >>> 19); + b48 = (s2[42] << 2) | (s2[43] >>> 30); + b49 = (s2[43] << 2) | (s2[42] >>> 30); + b40 = (s2[5] << 30) | (s2[4] >>> 2); + b41 = (s2[4] << 30) | (s2[5] >>> 2); + b22 = (s2[14] << 6) | (s2[15] >>> 26); + b23 = (s2[15] << 6) | (s2[14] >>> 26); + b4 = (s2[25] << 11) | (s2[24] >>> 21); + b5 = (s2[24] << 11) | (s2[25] >>> 21); + b36 = (s2[34] << 15) | (s2[35] >>> 17); + b37 = (s2[35] << 15) | (s2[34] >>> 17); + b18 = (s2[45] << 29) | (s2[44] >>> 3); + b19 = (s2[44] << 29) | (s2[45] >>> 3); + b10 = (s2[6] << 28) | (s2[7] >>> 4); + b11 = (s2[7] << 28) | (s2[6] >>> 4); + b42 = (s2[17] << 23) | (s2[16] >>> 9); + b43 = (s2[16] << 23) | (s2[17] >>> 9); + b24 = (s2[26] << 25) | (s2[27] >>> 7); + b25 = (s2[27] << 25) | (s2[26] >>> 7); + b6 = (s2[36] << 21) | (s2[37] >>> 11); + b7 = (s2[37] << 21) | (s2[36] >>> 11); + b38 = (s2[47] << 24) | (s2[46] >>> 8); + b39 = (s2[46] << 24) | (s2[47] >>> 8); + b30 = (s2[8] << 27) | (s2[9] >>> 5); + b31 = (s2[9] << 27) | (s2[8] >>> 5); + b12 = (s2[18] << 20) | (s2[19] >>> 12); + b13 = (s2[19] << 20) | (s2[18] >>> 12); + b44 = (s2[29] << 7) | (s2[28] >>> 25); + b45 = (s2[28] << 7) | (s2[29] >>> 25); + b26 = (s2[38] << 8) | (s2[39] >>> 24); + b27 = (s2[39] << 8) | (s2[38] >>> 24); + b8 = (s2[48] << 14) | (s2[49] >>> 18); + b9 = (s2[49] << 14) | (s2[48] >>> 18); + s2[0] = b0 ^ (~b2 & b4); + s2[1] = b1 ^ (~b3 & b5); + s2[10] = b10 ^ (~b12 & b14); + s2[11] = b11 ^ (~b13 & b15); + s2[20] = b20 ^ (~b22 & b24); + s2[21] = b21 ^ (~b23 & b25); + s2[30] = b30 ^ (~b32 & b34); + s2[31] = b31 ^ (~b33 & b35); + s2[40] = b40 ^ (~b42 & b44); + s2[41] = b41 ^ (~b43 & b45); + s2[2] = b2 ^ (~b4 & b6); + s2[3] = b3 ^ (~b5 & b7); + s2[12] = b12 ^ (~b14 & b16); + s2[13] = b13 ^ (~b15 & b17); + s2[22] = b22 ^ (~b24 & b26); + s2[23] = b23 ^ (~b25 & b27); + s2[32] = b32 ^ (~b34 & b36); + s2[33] = b33 ^ (~b35 & b37); + s2[42] = b42 ^ (~b44 & b46); + s2[43] = b43 ^ (~b45 & b47); + s2[4] = b4 ^ (~b6 & b8); + s2[5] = b5 ^ (~b7 & b9); + s2[14] = b14 ^ (~b16 & b18); + s2[15] = b15 ^ (~b17 & b19); + s2[24] = b24 ^ (~b26 & b28); + s2[25] = b25 ^ (~b27 & b29); + s2[34] = b34 ^ (~b36 & b38); + s2[35] = b35 ^ (~b37 & b39); + s2[44] = b44 ^ (~b46 & b48); + s2[45] = b45 ^ (~b47 & b49); + s2[6] = b6 ^ (~b8 & b0); + s2[7] = b7 ^ (~b9 & b1); + s2[16] = b16 ^ (~b18 & b10); + s2[17] = b17 ^ (~b19 & b11); + s2[26] = b26 ^ (~b28 & b20); + s2[27] = b27 ^ (~b29 & b21); + s2[36] = b36 ^ (~b38 & b30); + s2[37] = b37 ^ (~b39 & b31); + s2[46] = b46 ^ (~b48 & b40); + s2[47] = b47 ^ (~b49 & b41); + s2[8] = b8 ^ (~b0 & b2); + s2[9] = b9 ^ (~b1 & b3); + s2[18] = b18 ^ (~b10 & b12); + s2[19] = b19 ^ (~b11 & b13); + s2[28] = b28 ^ (~b20 & b22); + s2[29] = b29 ^ (~b21 & b23); + s2[38] = b38 ^ (~b30 & b32); + s2[39] = b39 ^ (~b31 & b33); + s2[48] = b48 ^ (~b40 & b42); + s2[49] = b49 ^ (~b41 & b43); + s2[0] ^= RC[n2]; + s2[1] ^= RC[n2 + 1]; + } + }; + if (COMMON_JS) { + module2.exports = methods; + } else { + for (i2 = 0; i2 < methodNames.length; ++i2) { + root[methodNames[i2]] = methods[methodNames[i2]]; + } + if (AMD) { + define(function () { + return methods; + }); + } + } + })(); + }, +}); + +// node_modules/@ethersproject/keccak256/lib.esm/index.js +var lib_exports4 = {}; +__export(lib_exports4, { + keccak256: () => keccak256, +}); +function keccak256(data) { + return '0x' + import_js_sha3.default.keccak_256(arrayify(data)); +} +var import_js_sha3; +var init_lib5 = __esm({ + 'node_modules/@ethersproject/keccak256/lib.esm/index.js'() { + 'use strict'; + init_shim(); + import_js_sha3 = __toESM(require_sha3()); + init_lib2(); + }, +}); + +// node_modules/@ethersproject/rlp/lib.esm/_version.js +var version7; +var init_version6 = __esm({ + 'node_modules/@ethersproject/rlp/lib.esm/_version.js'() { + init_shim(); + version7 = 'rlp/5.7.0'; + }, +}); + +// node_modules/@ethersproject/rlp/lib.esm/index.js +var lib_exports5 = {}; +__export(lib_exports5, { + decode: () => decode, + encode: () => encode, +}); +function arrayifyInteger(value) { + const result = []; + while (value) { + result.unshift(value & 255); + value >>= 8; + } + return result; +} +function unarrayifyInteger(data, offset, length) { + let result = 0; + for (let i2 = 0; i2 < length; i2++) { + result = result * 256 + data[offset + i2]; + } + return result; +} +function _encode(object) { + if (Array.isArray(object)) { + let payload = []; + object.forEach(function (child) { + payload = payload.concat(_encode(child)); + }); + if (payload.length <= 55) { + payload.unshift(192 + payload.length); + return payload; + } + const length2 = arrayifyInteger(payload.length); + length2.unshift(247 + length2.length); + return length2.concat(payload); + } + if (!isBytesLike(object)) { + logger7.throwArgumentError( + 'RLP object must be BytesLike', + 'object', + object + ); + } + const data = Array.prototype.slice.call(arrayify(object)); + if (data.length === 1 && data[0] <= 127) { + return data; + } else if (data.length <= 55) { + data.unshift(128 + data.length); + return data; + } + const length = arrayifyInteger(data.length); + length.unshift(183 + length.length); + return length.concat(data); +} +function encode(object) { + return hexlify(_encode(object)); +} +function _decodeChildren(data, offset, childOffset, length) { + const result = []; + while (childOffset < offset + 1 + length) { + const decoded = _decode(data, childOffset); + result.push(decoded.result); + childOffset += decoded.consumed; + if (childOffset > offset + 1 + length) { + logger7.throwError( + 'child data too short', + Logger.errors.BUFFER_OVERRUN, + {} + ); + } + } + return { consumed: 1 + length, result }; +} +function _decode(data, offset) { + if (data.length === 0) { + logger7.throwError('data too short', Logger.errors.BUFFER_OVERRUN, {}); + } + if (data[offset] >= 248) { + const lengthLength = data[offset] - 247; + if (offset + 1 + lengthLength > data.length) { + logger7.throwError( + 'data short segment too short', + Logger.errors.BUFFER_OVERRUN, + {} + ); + } + const length = unarrayifyInteger(data, offset + 1, lengthLength); + if (offset + 1 + lengthLength + length > data.length) { + logger7.throwError( + 'data long segment too short', + Logger.errors.BUFFER_OVERRUN, + {} + ); + } + return _decodeChildren( + data, + offset, + offset + 1 + lengthLength, + lengthLength + length + ); + } else if (data[offset] >= 192) { + const length = data[offset] - 192; + if (offset + 1 + length > data.length) { + logger7.throwError( + 'data array too short', + Logger.errors.BUFFER_OVERRUN, + {} + ); + } + return _decodeChildren(data, offset, offset + 1, length); + } else if (data[offset] >= 184) { + const lengthLength = data[offset] - 183; + if (offset + 1 + lengthLength > data.length) { + logger7.throwError( + 'data array too short', + Logger.errors.BUFFER_OVERRUN, + {} + ); + } + const length = unarrayifyInteger(data, offset + 1, lengthLength); + if (offset + 1 + lengthLength + length > data.length) { + logger7.throwError( + 'data array too short', + Logger.errors.BUFFER_OVERRUN, + {} + ); + } + const result = hexlify( + data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length) + ); + return { consumed: 1 + lengthLength + length, result }; + } else if (data[offset] >= 128) { + const length = data[offset] - 128; + if (offset + 1 + length > data.length) { + logger7.throwError('data too short', Logger.errors.BUFFER_OVERRUN, {}); + } + const result = hexlify(data.slice(offset + 1, offset + 1 + length)); + return { consumed: 1 + length, result }; + } + return { consumed: 1, result: hexlify(data[offset]) }; +} +function decode(data) { + const bytes = arrayify(data); + const decoded = _decode(bytes, 0); + if (decoded.consumed !== bytes.length) { + logger7.throwArgumentError('invalid rlp data', 'data', data); + } + return decoded.result; +} +var logger7; +var init_lib6 = __esm({ + 'node_modules/@ethersproject/rlp/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_lib2(); + init_lib(); + init_version6(); + logger7 = new Logger(version7); + }, +}); + +// node_modules/@ethersproject/address/lib.esm/_version.js +var version8; +var init_version7 = __esm({ + 'node_modules/@ethersproject/address/lib.esm/_version.js'() { + init_shim(); + version8 = 'address/5.7.0'; + }, +}); + +// node_modules/@ethersproject/address/lib.esm/index.js +var lib_exports6 = {}; +__export(lib_exports6, { + getAddress: () => getAddress, + getContractAddress: () => getContractAddress, + getCreate2Address: () => getCreate2Address, + getIcapAddress: () => getIcapAddress, + isAddress: () => isAddress, +}); +function getChecksumAddress(address) { + if (!isHexString(address, 20)) { + logger8.throwArgumentError('invalid address', 'address', address); + } + address = address.toLowerCase(); + const chars = address.substring(2).split(''); + const expanded = new Uint8Array(40); + for (let i2 = 0; i2 < 40; i2++) { + expanded[i2] = chars[i2].charCodeAt(0); + } + const hashed = arrayify(keccak256(expanded)); + for (let i2 = 0; i2 < 40; i2 += 2) { + if (hashed[i2 >> 1] >> 4 >= 8) { + chars[i2] = chars[i2].toUpperCase(); + } + if ((hashed[i2 >> 1] & 15) >= 8) { + chars[i2 + 1] = chars[i2 + 1].toUpperCase(); + } + } + return '0x' + chars.join(''); +} +function log10(x) { + if (Math.log10) { + return Math.log10(x); + } + return Math.log(x) / Math.LN10; +} +function ibanChecksum(address) { + address = address.toUpperCase(); + address = address.substring(4) + address.substring(0, 2) + '00'; + let expanded = address + .split('') + .map((c) => { + return ibanLookup[c]; + }) + .join(''); + while (expanded.length >= safeDigits) { + let block = expanded.substring(0, safeDigits); + expanded = (parseInt(block, 10) % 97) + expanded.substring(block.length); + } + let checksum = String(98 - (parseInt(expanded, 10) % 97)); + while (checksum.length < 2) { + checksum = '0' + checksum; + } + return checksum; +} +function getAddress(address) { + let result = null; + if (typeof address !== 'string') { + logger8.throwArgumentError('invalid address', 'address', address); + } + if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) { + if (address.substring(0, 2) !== '0x') { + address = '0x' + address; + } + result = getChecksumAddress(address); + if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) { + logger8.throwArgumentError('bad address checksum', 'address', address); + } + } else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) { + if (address.substring(2, 4) !== ibanChecksum(address)) { + logger8.throwArgumentError('bad icap checksum', 'address', address); + } + result = _base36To16(address.substring(4)); + while (result.length < 40) { + result = '0' + result; + } + result = getChecksumAddress('0x' + result); + } else { + logger8.throwArgumentError('invalid address', 'address', address); + } + return result; +} +function isAddress(address) { + try { + getAddress(address); + return true; + } catch (error) {} + return false; +} +function getIcapAddress(address) { + let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase(); + while (base36.length < 30) { + base36 = '0' + base36; + } + return 'XE' + ibanChecksum('XE00' + base36) + base36; +} +function getContractAddress(transaction) { + let from = null; + try { + from = getAddress(transaction.from); + } catch (error) { + logger8.throwArgumentError( + 'missing from address', + 'transaction', + transaction + ); + } + const nonce = stripZeros( + arrayify(BigNumber.from(transaction.nonce).toHexString()) + ); + return getAddress(hexDataSlice(keccak256(encode([from, nonce])), 12)); +} +function getCreate2Address(from, salt, initCodeHash) { + if (hexDataLength(salt) !== 32) { + logger8.throwArgumentError('salt must be 32 bytes', 'salt', salt); + } + if (hexDataLength(initCodeHash) !== 32) { + logger8.throwArgumentError( + 'initCodeHash must be 32 bytes', + 'initCodeHash', + initCodeHash + ); + } + return getAddress( + hexDataSlice( + keccak256(concat(['0xff', getAddress(from), salt, initCodeHash])), + 12 + ) + ); +} +var logger8, MAX_SAFE_INTEGER, ibanLookup, safeDigits; +var init_lib7 = __esm({ + 'node_modules/@ethersproject/address/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_lib2(); + init_lib3(); + init_lib5(); + init_lib6(); + init_lib(); + init_version7(); + logger8 = new Logger(version8); + MAX_SAFE_INTEGER = 9007199254740991; + ibanLookup = {}; + for (let i2 = 0; i2 < 10; i2++) { + ibanLookup[String(i2)] = String(i2); + } + for (let i2 = 0; i2 < 26; i2++) { + ibanLookup[String.fromCharCode(65 + i2)] = String(10 + i2); + } + safeDigits = Math.floor(log10(MAX_SAFE_INTEGER)); + }, +}); + +// node_modules/@ethersproject/abi/lib.esm/coders/address.js +var AddressCoder; +var init_address = __esm({ + 'node_modules/@ethersproject/abi/lib.esm/coders/address.js'() { + 'use strict'; + init_shim(); + init_lib7(); + init_lib2(); + init_abstract_coder(); + AddressCoder = class extends Coder { + constructor(localName) { + super('address', 'address', localName, false); + } + defaultValue() { + return '0x0000000000000000000000000000000000000000'; + } + encode(writer, value) { + try { + value = getAddress(value); + } catch (error) { + this._throwError(error.message, value); + } + return writer.writeValue(value); + } + decode(reader) { + return getAddress(hexZeroPad(reader.readValue().toHexString(), 20)); + } + }; + }, +}); + +// node_modules/@ethersproject/abi/lib.esm/coders/anonymous.js +var AnonymousCoder; +var init_anonymous = __esm({ + 'node_modules/@ethersproject/abi/lib.esm/coders/anonymous.js'() { + 'use strict'; + init_shim(); + init_abstract_coder(); + AnonymousCoder = class extends Coder { + constructor(coder) { + super(coder.name, coder.type, void 0, coder.dynamic); + this.coder = coder; + } + defaultValue() { + return this.coder.defaultValue(); + } + encode(writer, value) { + return this.coder.encode(writer, value); + } + decode(reader) { + return this.coder.decode(reader); + } + }; + }, +}); + +// node_modules/@ethersproject/abi/lib.esm/coders/array.js +function pack(writer, coders, values) { + let arrayValues = null; + if (Array.isArray(values)) { + arrayValues = values; + } else if (values && typeof values === 'object') { + let unique = {}; + arrayValues = coders.map((coder) => { + const name = coder.localName; + if (!name) { + logger9.throwError( + 'cannot encode object for signature with missing names', + Logger.errors.INVALID_ARGUMENT, + { + argument: 'values', + coder, + value: values, + } + ); + } + if (unique[name]) { + logger9.throwError( + 'cannot encode object for signature with duplicate names', + Logger.errors.INVALID_ARGUMENT, + { + argument: 'values', + coder, + value: values, + } + ); + } + unique[name] = true; + return values[name]; + }); + } else { + logger9.throwArgumentError('invalid tuple value', 'tuple', values); + } + if (coders.length !== arrayValues.length) { + logger9.throwArgumentError('types/value length mismatch', 'tuple', values); + } + let staticWriter = new Writer(writer.wordSize); + let dynamicWriter = new Writer(writer.wordSize); + let updateFuncs = []; + coders.forEach((coder, index) => { + let value = arrayValues[index]; + if (coder.dynamic) { + let dynamicOffset = dynamicWriter.length; + coder.encode(dynamicWriter, value); + let updateFunc = staticWriter.writeUpdatableValue(); + updateFuncs.push((baseOffset) => { + updateFunc(baseOffset + dynamicOffset); + }); + } else { + coder.encode(staticWriter, value); + } + }); + updateFuncs.forEach((func) => { + func(staticWriter.length); + }); + let length = writer.appendWriter(staticWriter); + length += writer.appendWriter(dynamicWriter); + return length; +} +function unpack(reader, coders) { + let values = []; + let baseReader = reader.subReader(0); + coders.forEach((coder) => { + let value = null; + if (coder.dynamic) { + let offset = reader.readValue(); + let offsetReader = baseReader.subReader(offset.toNumber()); + try { + value = coder.decode(offsetReader); + } catch (error) { + if (error.code === Logger.errors.BUFFER_OVERRUN) { + throw error; + } + value = error; + value.baseType = coder.name; + value.name = coder.localName; + value.type = coder.type; + } + } else { + try { + value = coder.decode(reader); + } catch (error) { + if (error.code === Logger.errors.BUFFER_OVERRUN) { + throw error; + } + value = error; + value.baseType = coder.name; + value.name = coder.localName; + value.type = coder.type; + } + } + if (value != void 0) { + values.push(value); + } + }); + const uniqueNames = coders.reduce((accum, coder) => { + const name = coder.localName; + if (name) { + if (!accum[name]) { + accum[name] = 0; + } + accum[name]++; + } + return accum; + }, {}); + coders.forEach((coder, index) => { + let name = coder.localName; + if (!name || uniqueNames[name] !== 1) { + return; + } + if (name === 'length') { + name = '_length'; + } + if (values[name] != null) { + return; + } + const value = values[index]; + if (value instanceof Error) { + Object.defineProperty(values, name, { + enumerable: true, + get: () => { + throw value; + }, + }); + } else { + values[name] = value; + } + }); + for (let i2 = 0; i2 < values.length; i2++) { + const value = values[i2]; + if (value instanceof Error) { + Object.defineProperty(values, i2, { + enumerable: true, + get: () => { + throw value; + }, + }); + } + } + return Object.freeze(values); +} +var logger9, ArrayCoder; +var init_array = __esm({ + 'node_modules/@ethersproject/abi/lib.esm/coders/array.js'() { + 'use strict'; + init_shim(); + init_lib(); + init_version5(); + init_abstract_coder(); + init_anonymous(); + logger9 = new Logger(version6); + ArrayCoder = class extends Coder { + constructor(coder, length, localName) { + const type = coder.type + '[' + (length >= 0 ? length : '') + ']'; + const dynamic = length === -1 || coder.dynamic; + super('array', type, localName, dynamic); + this.coder = coder; + this.length = length; + } + defaultValue() { + const defaultChild = this.coder.defaultValue(); + const result = []; + for (let i2 = 0; i2 < this.length; i2++) { + result.push(defaultChild); + } + return result; + } + encode(writer, value) { + if (!Array.isArray(value)) { + this._throwError('expected array value', value); + } + let count = this.length; + if (count === -1) { + count = value.length; + writer.writeValue(value.length); + } + logger9.checkArgumentCount( + value.length, + count, + 'coder array' + (this.localName ? ' ' + this.localName : '') + ); + let coders = []; + for (let i2 = 0; i2 < value.length; i2++) { + coders.push(this.coder); + } + return pack(writer, coders, value); + } + decode(reader) { + let count = this.length; + if (count === -1) { + count = reader.readValue().toNumber(); + if (count * 32 > reader._data.length) { + logger9.throwError( + 'insufficient data length', + Logger.errors.BUFFER_OVERRUN, + { + length: reader._data.length, + count, + } + ); + } + } + let coders = []; + for (let i2 = 0; i2 < count; i2++) { + coders.push(new AnonymousCoder(this.coder)); + } + return reader.coerce(this.name, unpack(reader, coders)); + } + }; + }, +}); + +// node_modules/@ethersproject/abi/lib.esm/coders/boolean.js +var BooleanCoder; +var init_boolean = __esm({ + 'node_modules/@ethersproject/abi/lib.esm/coders/boolean.js'() { + 'use strict'; + init_shim(); + init_abstract_coder(); + BooleanCoder = class extends Coder { + constructor(localName) { + super('bool', 'bool', localName, false); + } + defaultValue() { + return false; + } + encode(writer, value) { + return writer.writeValue(value ? 1 : 0); + } + decode(reader) { + return reader.coerce(this.type, !reader.readValue().isZero()); + } + }; + }, +}); + +// node_modules/@ethersproject/abi/lib.esm/coders/bytes.js +var DynamicBytesCoder, BytesCoder; +var init_bytes = __esm({ + 'node_modules/@ethersproject/abi/lib.esm/coders/bytes.js'() { + 'use strict'; + init_shim(); + init_lib2(); + init_abstract_coder(); + DynamicBytesCoder = class extends Coder { + constructor(type, localName) { + super(type, type, localName, true); + } + defaultValue() { + return '0x'; + } + encode(writer, value) { + value = arrayify(value); + let length = writer.writeValue(value.length); + length += writer.writeBytes(value); + return length; + } + decode(reader) { + return reader.readBytes(reader.readValue().toNumber(), true); + } + }; + BytesCoder = class extends DynamicBytesCoder { + constructor(localName) { + super('bytes', localName); + } + decode(reader) { + return reader.coerce(this.name, hexlify(super.decode(reader))); + } + }; + }, +}); + +// node_modules/@ethersproject/abi/lib.esm/coders/fixed-bytes.js +var FixedBytesCoder; +var init_fixed_bytes = __esm({ + 'node_modules/@ethersproject/abi/lib.esm/coders/fixed-bytes.js'() { + 'use strict'; + init_shim(); + init_lib2(); + init_abstract_coder(); + FixedBytesCoder = class extends Coder { + constructor(size, localName) { + let name = 'bytes' + String(size); + super(name, name, localName, false); + this.size = size; + } + defaultValue() { + return '0x0000000000000000000000000000000000000000000000000000000000000000'.substring( + 0, + 2 + this.size * 2 + ); + } + encode(writer, value) { + let data = arrayify(value); + if (data.length !== this.size) { + this._throwError('incorrect data length', value); + } + return writer.writeBytes(data); + } + decode(reader) { + return reader.coerce(this.name, hexlify(reader.readBytes(this.size))); + } + }; + }, +}); + +// node_modules/@ethersproject/abi/lib.esm/coders/null.js +var NullCoder; +var init_null = __esm({ + 'node_modules/@ethersproject/abi/lib.esm/coders/null.js'() { + 'use strict'; + init_shim(); + init_abstract_coder(); + NullCoder = class extends Coder { + constructor(localName) { + super('null', '', localName, false); + } + defaultValue() { + return null; + } + encode(writer, value) { + if (value != null) { + this._throwError('not null', value); + } + return writer.writeBytes([]); + } + decode(reader) { + reader.readBytes(0); + return reader.coerce(this.name, null); + } + }; + }, +}); + +// node_modules/@ethersproject/constants/lib.esm/addresses.js +var AddressZero; +var init_addresses = __esm({ + 'node_modules/@ethersproject/constants/lib.esm/addresses.js'() { + init_shim(); + AddressZero = '0x0000000000000000000000000000000000000000'; + }, +}); + +// node_modules/@ethersproject/constants/lib.esm/bignumbers.js +var NegativeOne2, + Zero2, + One, + Two, + WeiPerEther, + MaxUint256, + MinInt256, + MaxInt256; +var init_bignumbers = __esm({ + 'node_modules/@ethersproject/constants/lib.esm/bignumbers.js'() { + init_shim(); + init_lib3(); + NegativeOne2 = /* @__PURE__ */ BigNumber.from(-1); + Zero2 = /* @__PURE__ */ BigNumber.from(0); + One = /* @__PURE__ */ BigNumber.from(1); + Two = /* @__PURE__ */ BigNumber.from(2); + WeiPerEther = /* @__PURE__ */ BigNumber.from('1000000000000000000'); + MaxUint256 = /* @__PURE__ */ BigNumber.from( + '0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' + ); + MinInt256 = /* @__PURE__ */ BigNumber.from( + '-0x8000000000000000000000000000000000000000000000000000000000000000' + ); + MaxInt256 = /* @__PURE__ */ BigNumber.from( + '0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' + ); + }, +}); + +// node_modules/@ethersproject/constants/lib.esm/hashes.js +var HashZero; +var init_hashes = __esm({ + 'node_modules/@ethersproject/constants/lib.esm/hashes.js'() { + init_shim(); + HashZero = + '0x0000000000000000000000000000000000000000000000000000000000000000'; + }, +}); + +// node_modules/@ethersproject/constants/lib.esm/strings.js +var EtherSymbol; +var init_strings = __esm({ + 'node_modules/@ethersproject/constants/lib.esm/strings.js'() { + init_shim(); + EtherSymbol = '\u039E'; + }, +}); + +// node_modules/@ethersproject/constants/lib.esm/index.js +var lib_exports7 = {}; +__export(lib_exports7, { + AddressZero: () => AddressZero, + EtherSymbol: () => EtherSymbol, + HashZero: () => HashZero, + MaxInt256: () => MaxInt256, + MaxUint256: () => MaxUint256, + MinInt256: () => MinInt256, + NegativeOne: () => NegativeOne2, + One: () => One, + Two: () => Two, + WeiPerEther: () => WeiPerEther, + Zero: () => Zero2, +}); +var init_lib8 = __esm({ + 'node_modules/@ethersproject/constants/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_addresses(); + init_bignumbers(); + init_hashes(); + init_strings(); + }, +}); + +// node_modules/@ethersproject/abi/lib.esm/coders/number.js +var NumberCoder; +var init_number = __esm({ + 'node_modules/@ethersproject/abi/lib.esm/coders/number.js'() { + 'use strict'; + init_shim(); + init_lib3(); + init_lib8(); + init_abstract_coder(); + NumberCoder = class extends Coder { + constructor(size, signed2, localName) { + const name = (signed2 ? 'int' : 'uint') + size * 8; + super(name, name, localName, false); + this.size = size; + this.signed = signed2; + } + defaultValue() { + return 0; + } + encode(writer, value) { + let v = BigNumber.from(value); + let maxUintValue = MaxUint256.mask(writer.wordSize * 8); + if (this.signed) { + let bounds = maxUintValue.mask(this.size * 8 - 1); + if (v.gt(bounds) || v.lt(bounds.add(One).mul(NegativeOne2))) { + this._throwError('value out-of-bounds', value); + } + } else if (v.lt(Zero2) || v.gt(maxUintValue.mask(this.size * 8))) { + this._throwError('value out-of-bounds', value); + } + v = v.toTwos(this.size * 8).mask(this.size * 8); + if (this.signed) { + v = v.fromTwos(this.size * 8).toTwos(8 * writer.wordSize); + } + return writer.writeValue(v); + } + decode(reader) { + let value = reader.readValue().mask(this.size * 8); + if (this.signed) { + value = value.fromTwos(this.size * 8); + } + return reader.coerce(this.name, value); + } + }; + }, +}); + +// node_modules/@ethersproject/strings/lib.esm/_version.js +var version9; +var init_version8 = __esm({ + 'node_modules/@ethersproject/strings/lib.esm/_version.js'() { + init_shim(); + version9 = 'strings/5.7.0'; + }, +}); + +// node_modules/@ethersproject/strings/lib.esm/utf8.js +function errorFunc(reason, offset, bytes, output, badCodepoint) { + return logger10.throwArgumentError( + `invalid codepoint at offset ${offset}; ${reason}`, + 'bytes', + bytes + ); +} +function ignoreFunc(reason, offset, bytes, output, badCodepoint) { + if ( + reason === Utf8ErrorReason.BAD_PREFIX || + reason === Utf8ErrorReason.UNEXPECTED_CONTINUE + ) { + let i2 = 0; + for (let o2 = offset + 1; o2 < bytes.length; o2++) { + if (bytes[o2] >> 6 !== 2) { + break; + } + i2++; + } + return i2; + } + if (reason === Utf8ErrorReason.OVERRUN) { + return bytes.length - offset - 1; + } + return 0; +} +function replaceFunc(reason, offset, bytes, output, badCodepoint) { + if (reason === Utf8ErrorReason.OVERLONG) { + output.push(badCodepoint); + return 0; + } + output.push(65533); + return ignoreFunc(reason, offset, bytes, output, badCodepoint); +} +function getUtf8CodePoints(bytes, onError) { + if (onError == null) { + onError = Utf8ErrorFuncs.error; + } + bytes = arrayify(bytes); + const result = []; + let i2 = 0; + while (i2 < bytes.length) { + const c = bytes[i2++]; + if (c >> 7 === 0) { + result.push(c); + continue; + } + let extraLength = null; + let overlongMask = null; + if ((c & 224) === 192) { + extraLength = 1; + overlongMask = 127; + } else if ((c & 240) === 224) { + extraLength = 2; + overlongMask = 2047; + } else if ((c & 248) === 240) { + extraLength = 3; + overlongMask = 65535; + } else { + if ((c & 192) === 128) { + i2 += onError( + Utf8ErrorReason.UNEXPECTED_CONTINUE, + i2 - 1, + bytes, + result + ); + } else { + i2 += onError(Utf8ErrorReason.BAD_PREFIX, i2 - 1, bytes, result); + } + continue; + } + if (i2 - 1 + extraLength >= bytes.length) { + i2 += onError(Utf8ErrorReason.OVERRUN, i2 - 1, bytes, result); + continue; + } + let res = c & ((1 << (8 - extraLength - 1)) - 1); + for (let j = 0; j < extraLength; j++) { + let nextChar = bytes[i2]; + if ((nextChar & 192) != 128) { + i2 += onError(Utf8ErrorReason.MISSING_CONTINUE, i2, bytes, result); + res = null; + break; + } + res = (res << 6) | (nextChar & 63); + i2++; + } + if (res === null) { + continue; + } + if (res > 1114111) { + i2 += onError( + Utf8ErrorReason.OUT_OF_RANGE, + i2 - 1 - extraLength, + bytes, + result, + res + ); + continue; + } + if (res >= 55296 && res <= 57343) { + i2 += onError( + Utf8ErrorReason.UTF16_SURROGATE, + i2 - 1 - extraLength, + bytes, + result, + res + ); + continue; + } + if (res <= overlongMask) { + i2 += onError( + Utf8ErrorReason.OVERLONG, + i2 - 1 - extraLength, + bytes, + result, + res + ); + continue; + } + result.push(res); + } + return result; +} +function toUtf8Bytes(str, form = UnicodeNormalizationForm.current) { + if (form != UnicodeNormalizationForm.current) { + logger10.checkNormalize(); + str = str.normalize(form); + } + let result = []; + for (let i2 = 0; i2 < str.length; i2++) { + const c = str.charCodeAt(i2); + if (c < 128) { + result.push(c); + } else if (c < 2048) { + result.push((c >> 6) | 192); + result.push((c & 63) | 128); + } else if ((c & 64512) == 55296) { + i2++; + const c2 = str.charCodeAt(i2); + if (i2 >= str.length || (c2 & 64512) !== 56320) { + throw new Error('invalid utf-8 string'); + } + const pair = 65536 + ((c & 1023) << 10) + (c2 & 1023); + result.push((pair >> 18) | 240); + result.push(((pair >> 12) & 63) | 128); + result.push(((pair >> 6) & 63) | 128); + result.push((pair & 63) | 128); + } else { + result.push((c >> 12) | 224); + result.push(((c >> 6) & 63) | 128); + result.push((c & 63) | 128); + } + } + return arrayify(result); +} +function escapeChar(value) { + const hex = '0000' + value.toString(16); + return '\\u' + hex.substring(hex.length - 4); +} +function _toEscapedUtf8String(bytes, onError) { + return ( + '"' + + getUtf8CodePoints(bytes, onError) + .map((codePoint) => { + if (codePoint < 256) { + switch (codePoint) { + case 8: + return '\\b'; + case 9: + return '\\t'; + case 10: + return '\\n'; + case 13: + return '\\r'; + case 34: + return '\\"'; + case 92: + return '\\\\'; + } + if (codePoint >= 32 && codePoint < 127) { + return String.fromCharCode(codePoint); + } + } + if (codePoint <= 65535) { + return escapeChar(codePoint); + } + codePoint -= 65536; + return ( + escapeChar(((codePoint >> 10) & 1023) + 55296) + + escapeChar((codePoint & 1023) + 56320) + ); + }) + .join('') + + '"' + ); +} +function _toUtf8String(codePoints) { + return codePoints + .map((codePoint) => { + if (codePoint <= 65535) { + return String.fromCharCode(codePoint); + } + codePoint -= 65536; + return String.fromCharCode( + ((codePoint >> 10) & 1023) + 55296, + (codePoint & 1023) + 56320 + ); + }) + .join(''); +} +function toUtf8String(bytes, onError) { + return _toUtf8String(getUtf8CodePoints(bytes, onError)); +} +function toUtf8CodePoints(str, form = UnicodeNormalizationForm.current) { + return getUtf8CodePoints(toUtf8Bytes(str, form)); +} +var logger10, UnicodeNormalizationForm, Utf8ErrorReason, Utf8ErrorFuncs; +var init_utf8 = __esm({ + 'node_modules/@ethersproject/strings/lib.esm/utf8.js'() { + 'use strict'; + init_shim(); + init_lib2(); + init_lib(); + init_version8(); + logger10 = new Logger(version9); + (function (UnicodeNormalizationForm2) { + UnicodeNormalizationForm2['current'] = ''; + UnicodeNormalizationForm2['NFC'] = 'NFC'; + UnicodeNormalizationForm2['NFD'] = 'NFD'; + UnicodeNormalizationForm2['NFKC'] = 'NFKC'; + UnicodeNormalizationForm2['NFKD'] = 'NFKD'; + })(UnicodeNormalizationForm || (UnicodeNormalizationForm = {})); + (function (Utf8ErrorReason2) { + Utf8ErrorReason2['UNEXPECTED_CONTINUE'] = 'unexpected continuation byte'; + Utf8ErrorReason2['BAD_PREFIX'] = 'bad codepoint prefix'; + Utf8ErrorReason2['OVERRUN'] = 'string overrun'; + Utf8ErrorReason2['MISSING_CONTINUE'] = 'missing continuation byte'; + Utf8ErrorReason2['OUT_OF_RANGE'] = 'out of UTF-8 range'; + Utf8ErrorReason2['UTF16_SURROGATE'] = 'UTF-16 surrogate'; + Utf8ErrorReason2['OVERLONG'] = 'overlong representation'; + })(Utf8ErrorReason || (Utf8ErrorReason = {})); + Utf8ErrorFuncs = Object.freeze({ + error: errorFunc, + ignore: ignoreFunc, + replace: replaceFunc, + }); + }, +}); + +// node_modules/@ethersproject/strings/lib.esm/bytes32.js +function formatBytes32String(text) { + const bytes = toUtf8Bytes(text); + if (bytes.length > 31) { + throw new Error('bytes32 string must be less than 32 bytes'); + } + return hexlify(concat([bytes, HashZero]).slice(0, 32)); +} +function parseBytes32String(bytes) { + const data = arrayify(bytes); + if (data.length !== 32) { + throw new Error('invalid bytes32 - not 32 bytes long'); + } + if (data[31] !== 0) { + throw new Error('invalid bytes32 string - no null terminator'); + } + let length = 31; + while (data[length - 1] === 0) { + length--; + } + return toUtf8String(data.slice(0, length)); +} +var init_bytes32 = __esm({ + 'node_modules/@ethersproject/strings/lib.esm/bytes32.js'() { + 'use strict'; + init_shim(); + init_lib8(); + init_lib2(); + init_utf8(); + }, +}); + +// node_modules/@ethersproject/strings/lib.esm/idna.js +function bytes2(data) { + if (data.length % 4 !== 0) { + throw new Error('bad data'); + } + let result = []; + for (let i2 = 0; i2 < data.length; i2 += 4) { + result.push(parseInt(data.substring(i2, i2 + 4), 16)); + } + return result; +} +function createTable(data, func) { + if (!func) { + func = function (value) { + return [parseInt(value, 16)]; + }; + } + let lo = 0; + let result = {}; + data.split(',').forEach((pair) => { + let comps = pair.split(':'); + lo += parseInt(comps[0], 16); + result[lo] = func(comps[1]); + }); + return result; +} +function createRangeTable(data) { + let hi = 0; + return data.split(',').map((v) => { + let comps = v.split('-'); + if (comps.length === 1) { + comps[1] = '0'; + } else if (comps[1] === '') { + comps[1] = '1'; + } + let lo = hi + parseInt(comps[0], 16); + hi = parseInt(comps[1], 16); + return { l: lo, h: hi }; + }); +} +function matchMap(value, ranges) { + let lo = 0; + for (let i2 = 0; i2 < ranges.length; i2++) { + let range = ranges[i2]; + lo += range.l; + if ( + value >= lo && + value <= lo + range.h && + (value - lo) % (range.d || 1) === 0 + ) { + if (range.e && range.e.indexOf(value - lo) !== -1) { + continue; + } + return range; + } + } + return null; +} +function flatten(values) { + return values.reduce((accum, value) => { + value.forEach((value2) => { + accum.push(value2); + }); + return accum; + }, []); +} +function _nameprepTableA1(codepoint) { + return !!matchMap(codepoint, Table_A_1_ranges); +} +function _nameprepTableB2(codepoint) { + let range = matchMap(codepoint, Table_B_2_ranges); + if (range) { + return [codepoint + range.s]; + } + let codes = Table_B_2_lut_abs[codepoint]; + if (codes) { + return codes; + } + let shift = Table_B_2_lut_rel[codepoint]; + if (shift) { + return [codepoint + shift[0]]; + } + let complex = Table_B_2_complex[codepoint]; + if (complex) { + return complex; + } + return null; +} +function _nameprepTableC(codepoint) { + return !!matchMap(codepoint, Table_C_ranges); +} +function nameprep(value) { + if (value.match(/^[a-z0-9-]*$/i) && value.length <= 59) { + return value.toLowerCase(); + } + let codes = toUtf8CodePoints(value); + codes = flatten( + codes.map((code9) => { + if (Table_B_1_flags.indexOf(code9) >= 0) { + return []; + } + if (code9 >= 65024 && code9 <= 65039) { + return []; + } + let codesTableB2 = _nameprepTableB2(code9); + if (codesTableB2) { + return codesTableB2; + } + return [code9]; + }) + ); + codes = toUtf8CodePoints(_toUtf8String(codes), UnicodeNormalizationForm.NFKC); + codes.forEach((code9) => { + if (_nameprepTableC(code9)) { + throw new Error('STRINGPREP_CONTAINS_PROHIBITED'); + } + }); + codes.forEach((code9) => { + if (_nameprepTableA1(code9)) { + throw new Error('STRINGPREP_CONTAINS_UNASSIGNED'); + } + }); + let name = _toUtf8String(codes); + if ( + name.substring(0, 1) === '-' || + name.substring(2, 4) === '--' || + name.substring(name.length - 1) === '-' + ) { + throw new Error('invalid hyphen'); + } + return name; +} +var Table_A_1_ranges, + Table_B_1_flags, + Table_B_2_ranges, + Table_B_2_lut_abs, + Table_B_2_lut_rel, + Table_B_2_complex, + Table_C_ranges; +var init_idna = __esm({ + 'node_modules/@ethersproject/strings/lib.esm/idna.js'() { + 'use strict'; + init_shim(); + init_utf8(); + Table_A_1_ranges = createRangeTable( + '221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d' + ); + Table_B_1_flags = 'ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff' + .split(',') + .map((v) => parseInt(v, 16)); + Table_B_2_ranges = [ + { h: 25, s: 32, l: 65 }, + { h: 30, s: 32, e: [23], l: 127 }, + { h: 54, s: 1, e: [48], l: 64, d: 2 }, + { h: 14, s: 1, l: 57, d: 2 }, + { h: 44, s: 1, l: 17, d: 2 }, + { h: 10, s: 1, e: [2, 6, 8], l: 61, d: 2 }, + { h: 16, s: 1, l: 68, d: 2 }, + { h: 84, s: 1, e: [18, 24, 66], l: 19, d: 2 }, + { h: 26, s: 32, e: [17], l: 435 }, + { h: 22, s: 1, l: 71, d: 2 }, + { h: 15, s: 80, l: 40 }, + { h: 31, s: 32, l: 16 }, + { h: 32, s: 1, l: 80, d: 2 }, + { h: 52, s: 1, l: 42, d: 2 }, + { h: 12, s: 1, l: 55, d: 2 }, + { h: 40, s: 1, e: [38], l: 15, d: 2 }, + { h: 14, s: 1, l: 48, d: 2 }, + { h: 37, s: 48, l: 49 }, + { h: 148, s: 1, l: 6351, d: 2 }, + { h: 88, s: 1, l: 160, d: 2 }, + { h: 15, s: 16, l: 704 }, + { h: 25, s: 26, l: 854 }, + { h: 25, s: 32, l: 55915 }, + { h: 37, s: 40, l: 1247 }, + { h: 25, s: -119711, l: 53248 }, + { h: 25, s: -119763, l: 52 }, + { h: 25, s: -119815, l: 52 }, + { h: 25, s: -119867, e: [1, 4, 5, 7, 8, 11, 12, 17], l: 52 }, + { h: 25, s: -119919, l: 52 }, + { h: 24, s: -119971, e: [2, 7, 8, 17], l: 52 }, + { h: 24, s: -120023, e: [2, 7, 13, 15, 16, 17], l: 52 }, + { h: 25, s: -120075, l: 52 }, + { h: 25, s: -120127, l: 52 }, + { h: 25, s: -120179, l: 52 }, + { h: 25, s: -120231, l: 52 }, + { h: 25, s: -120283, l: 52 }, + { h: 25, s: -120335, l: 52 }, + { h: 24, s: -119543, e: [17], l: 56 }, + { h: 24, s: -119601, e: [17], l: 58 }, + { h: 24, s: -119659, e: [17], l: 58 }, + { h: 24, s: -119717, e: [17], l: 58 }, + { h: 24, s: -119775, e: [17], l: 58 }, + ]; + Table_B_2_lut_abs = createTable( + 'b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3' + ); + Table_B_2_lut_rel = createTable( + '179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7' + ); + Table_B_2_complex = createTable( + 'df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D', + bytes2 + ); + Table_C_ranges = createRangeTable( + '80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001' + ); + }, +}); + +// node_modules/@ethersproject/strings/lib.esm/index.js +var lib_exports8 = {}; +__export(lib_exports8, { + UnicodeNormalizationForm: () => UnicodeNormalizationForm, + Utf8ErrorFuncs: () => Utf8ErrorFuncs, + Utf8ErrorReason: () => Utf8ErrorReason, + _toEscapedUtf8String: () => _toEscapedUtf8String, + formatBytes32String: () => formatBytes32String, + nameprep: () => nameprep, + parseBytes32String: () => parseBytes32String, + toUtf8Bytes: () => toUtf8Bytes, + toUtf8CodePoints: () => toUtf8CodePoints, + toUtf8String: () => toUtf8String, +}); +var init_lib9 = __esm({ + 'node_modules/@ethersproject/strings/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_bytes32(); + init_idna(); + init_utf8(); + }, +}); + +// node_modules/@ethersproject/abi/lib.esm/coders/string.js +var StringCoder; +var init_string = __esm({ + 'node_modules/@ethersproject/abi/lib.esm/coders/string.js'() { + 'use strict'; + init_shim(); + init_lib9(); + init_bytes(); + StringCoder = class extends DynamicBytesCoder { + constructor(localName) { + super('string', localName); + } + defaultValue() { + return ''; + } + encode(writer, value) { + return super.encode(writer, toUtf8Bytes(value)); + } + decode(reader) { + return toUtf8String(super.decode(reader)); + } + }; + }, +}); + +// node_modules/@ethersproject/abi/lib.esm/coders/tuple.js +var TupleCoder; +var init_tuple = __esm({ + 'node_modules/@ethersproject/abi/lib.esm/coders/tuple.js'() { + 'use strict'; + init_shim(); + init_abstract_coder(); + init_array(); + TupleCoder = class extends Coder { + constructor(coders, localName) { + let dynamic = false; + const types = []; + coders.forEach((coder) => { + if (coder.dynamic) { + dynamic = true; + } + types.push(coder.type); + }); + const type = 'tuple(' + types.join(',') + ')'; + super('tuple', type, localName, dynamic); + this.coders = coders; + } + defaultValue() { + const values = []; + this.coders.forEach((coder) => { + values.push(coder.defaultValue()); + }); + const uniqueNames = this.coders.reduce((accum, coder) => { + const name = coder.localName; + if (name) { + if (!accum[name]) { + accum[name] = 0; + } + accum[name]++; + } + return accum; + }, {}); + this.coders.forEach((coder, index) => { + let name = coder.localName; + if (!name || uniqueNames[name] !== 1) { + return; + } + if (name === 'length') { + name = '_length'; + } + if (values[name] != null) { + return; + } + values[name] = values[index]; + }); + return Object.freeze(values); + } + encode(writer, value) { + return pack(writer, this.coders, value); + } + decode(reader) { + return reader.coerce(this.name, unpack(reader, this.coders)); + } + }; + }, +}); + +// node_modules/@ethersproject/abi/lib.esm/abi-coder.js +var logger11, paramTypeBytes, paramTypeNumber, AbiCoder, defaultAbiCoder; +var init_abi_coder = __esm({ + 'node_modules/@ethersproject/abi/lib.esm/abi-coder.js'() { + 'use strict'; + init_shim(); + init_lib2(); + init_lib4(); + init_lib(); + init_version5(); + init_abstract_coder(); + init_address(); + init_array(); + init_boolean(); + init_bytes(); + init_fixed_bytes(); + init_null(); + init_number(); + init_string(); + init_tuple(); + init_fragments(); + logger11 = new Logger(version6); + paramTypeBytes = new RegExp(/^bytes([0-9]*)$/); + paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/); + AbiCoder = class { + constructor(coerceFunc) { + defineReadOnly(this, 'coerceFunc', coerceFunc || null); + } + _getCoder(param) { + switch (param.baseType) { + case 'address': + return new AddressCoder(param.name); + case 'bool': + return new BooleanCoder(param.name); + case 'string': + return new StringCoder(param.name); + case 'bytes': + return new BytesCoder(param.name); + case 'array': + return new ArrayCoder( + this._getCoder(param.arrayChildren), + param.arrayLength, + param.name + ); + case 'tuple': + return new TupleCoder( + (param.components || []).map((component) => { + return this._getCoder(component); + }), + param.name + ); + case '': + return new NullCoder(param.name); + } + let match = param.type.match(paramTypeNumber); + if (match) { + let size = parseInt(match[2] || '256'); + if (size === 0 || size > 256 || size % 8 !== 0) { + logger11.throwArgumentError( + 'invalid ' + match[1] + ' bit length', + 'param', + param + ); + } + return new NumberCoder(size / 8, match[1] === 'int', param.name); + } + match = param.type.match(paramTypeBytes); + if (match) { + let size = parseInt(match[1]); + if (size === 0 || size > 32) { + logger11.throwArgumentError('invalid bytes length', 'param', param); + } + return new FixedBytesCoder(size, param.name); + } + return logger11.throwArgumentError('invalid type', 'type', param.type); + } + _getWordSize() { + return 32; + } + _getReader(data, allowLoose) { + return new Reader( + data, + this._getWordSize(), + this.coerceFunc, + allowLoose + ); + } + _getWriter() { + return new Writer(this._getWordSize()); + } + getDefaultValue(types) { + const coders = types.map((type) => + this._getCoder(ParamType.from(type)) + ); + const coder = new TupleCoder(coders, '_'); + return coder.defaultValue(); + } + encode(types, values) { + if (types.length !== values.length) { + logger11.throwError( + 'types/values length mismatch', + Logger.errors.INVALID_ARGUMENT, + { + count: { types: types.length, values: values.length }, + value: { types, values }, + } + ); + } + const coders = types.map((type) => + this._getCoder(ParamType.from(type)) + ); + const coder = new TupleCoder(coders, '_'); + const writer = this._getWriter(); + coder.encode(writer, values); + return writer.data; + } + decode(types, data, loose) { + const coders = types.map((type) => + this._getCoder(ParamType.from(type)) + ); + const coder = new TupleCoder(coders, '_'); + return coder.decode(this._getReader(arrayify(data), loose)); + } + }; + defaultAbiCoder = new AbiCoder(); + }, +}); + +// node_modules/@ethersproject/hash/lib.esm/id.js +function id(text) { + return keccak256(toUtf8Bytes(text)); +} +var init_id = __esm({ + 'node_modules/@ethersproject/hash/lib.esm/id.js'() { + init_shim(); + init_lib5(); + init_lib9(); + }, +}); + +// node_modules/@ethersproject/hash/lib.esm/_version.js +var version10; +var init_version9 = __esm({ + 'node_modules/@ethersproject/hash/lib.esm/_version.js'() { + init_shim(); + version10 = 'hash/5.7.0'; + }, +}); + +// node_modules/@ethersproject/base64/lib.esm/base64.js +function decode2(textData) { + textData = atob(textData); + const data = []; + for (let i2 = 0; i2 < textData.length; i2++) { + data.push(textData.charCodeAt(i2)); + } + return arrayify(data); +} +function encode2(data) { + data = arrayify(data); + let textData = ''; + for (let i2 = 0; i2 < data.length; i2++) { + textData += String.fromCharCode(data[i2]); + } + return btoa(textData); +} +var init_base64 = __esm({ + 'node_modules/@ethersproject/base64/lib.esm/base64.js'() { + 'use strict'; + init_shim(); + init_lib2(); + }, +}); + +// node_modules/@ethersproject/base64/lib.esm/index.js +var lib_exports9 = {}; +__export(lib_exports9, { + decode: () => decode2, + encode: () => encode2, +}); +var init_lib10 = __esm({ + 'node_modules/@ethersproject/base64/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_base64(); + }, +}); + +// node_modules/@ethersproject/hash/lib.esm/ens-normalize/decoder.js +function flat(array, depth) { + if (depth == null) { + depth = 1; + } + const result = []; + const forEach = result.forEach; + const flatDeep = function (arr, depth2) { + forEach.call(arr, function (val) { + if (depth2 > 0 && Array.isArray(val)) { + flatDeep(val, depth2 - 1); + } else { + result.push(val); + } + }); + }; + flatDeep(array, depth); + return result; +} +function fromEntries(array) { + const result = {}; + for (let i2 = 0; i2 < array.length; i2++) { + const value = array[i2]; + result[value[0]] = value[1]; + } + return result; +} +function decode_arithmetic(bytes) { + let pos = 0; + function u16() { + return (bytes[pos++] << 8) | bytes[pos++]; + } + let symbol_count = u16(); + let total = 1; + let acc = [0, 1]; + for (let i2 = 1; i2 < symbol_count; i2++) { + acc.push((total += u16())); + } + let skip = u16(); + let pos_payload = pos; + pos += skip; + let read_width = 0; + let read_buffer = 0; + function read_bit() { + if (read_width == 0) { + read_buffer = (read_buffer << 8) | bytes[pos++]; + read_width = 8; + } + return (read_buffer >> --read_width) & 1; + } + const N2 = 31; + const FULL = Math.pow(2, N2); + const HALF = FULL >>> 1; + const QRTR = HALF >> 1; + const MASK = FULL - 1; + let register = 0; + for (let i2 = 0; i2 < N2; i2++) register = (register << 1) | read_bit(); + let symbols = []; + let low = 0; + let range = FULL; + while (true) { + let value = Math.floor(((register - low + 1) * total - 1) / range); + let start = 0; + let end = symbol_count; + while (end - start > 1) { + let mid = (start + end) >>> 1; + if (value < acc[mid]) { + end = mid; + } else { + start = mid; + } + } + if (start == 0) break; + symbols.push(start); + let a2 = low + Math.floor((range * acc[start]) / total); + let b = low + Math.floor((range * acc[start + 1]) / total) - 1; + while (((a2 ^ b) & HALF) == 0) { + register = ((register << 1) & MASK) | read_bit(); + a2 = (a2 << 1) & MASK; + b = ((b << 1) & MASK) | 1; + } + while (a2 & ~b & QRTR) { + register = + (register & HALF) | ((register << 1) & (MASK >>> 1)) | read_bit(); + a2 = (a2 << 1) ^ HALF; + b = ((b ^ HALF) << 1) | HALF | 1; + } + low = a2; + range = 1 + b - a2; + } + let offset = symbol_count - 4; + return symbols.map((x) => { + switch (x - offset) { + case 3: + return ( + offset + + 65792 + + ((bytes[pos_payload++] << 16) | + (bytes[pos_payload++] << 8) | + bytes[pos_payload++]) + ); + case 2: + return ( + offset + 256 + ((bytes[pos_payload++] << 8) | bytes[pos_payload++]) + ); + case 1: + return offset + bytes[pos_payload++]; + default: + return x - 1; + } + }); +} +function read_payload(v) { + let pos = 0; + return () => v[pos++]; +} +function read_compressed_payload(bytes) { + return read_payload(decode_arithmetic(bytes)); +} +function signed(i2) { + return i2 & 1 ? ~i2 >> 1 : i2 >> 1; +} +function read_counts(n2, next) { + let v = Array(n2); + for (let i2 = 0; i2 < n2; i2++) v[i2] = 1 + next(); + return v; +} +function read_ascending(n2, next) { + let v = Array(n2); + for (let i2 = 0, x = -1; i2 < n2; i2++) v[i2] = x += 1 + next(); + return v; +} +function read_deltas(n2, next) { + let v = Array(n2); + for (let i2 = 0, x = 0; i2 < n2; i2++) v[i2] = x += signed(next()); + return v; +} +function read_member_array(next, lookup) { + let v = read_ascending(next(), next); + let n2 = next(); + let vX = read_ascending(n2, next); + let vN = read_counts(n2, next); + for (let i2 = 0; i2 < n2; i2++) { + for (let j = 0; j < vN[i2]; j++) { + v.push(vX[i2] + j); + } + } + return lookup ? v.map((x) => lookup[x]) : v; +} +function read_mapped_map(next) { + let ret = []; + while (true) { + let w = next(); + if (w == 0) break; + ret.push(read_linear_table(w, next)); + } + while (true) { + let w = next() - 1; + if (w < 0) break; + ret.push(read_replacement_table(w, next)); + } + return fromEntries(flat(ret)); +} +function read_zero_terminated_array(next) { + let v = []; + while (true) { + let i2 = next(); + if (i2 == 0) break; + v.push(i2); + } + return v; +} +function read_transposed(n2, w, next) { + let m = Array(n2) + .fill(void 0) + .map(() => []); + for (let i2 = 0; i2 < w; i2++) { + read_deltas(n2, next).forEach((x, j) => m[j].push(x)); + } + return m; +} +function read_linear_table(w, next) { + let dx = 1 + next(); + let dy = next(); + let vN = read_zero_terminated_array(next); + let m = read_transposed(vN.length, 1 + w, next); + return flat( + m.map((v, i2) => { + const x = v[0], + ys = v.slice(1); + return Array(vN[i2]) + .fill(void 0) + .map((_, j) => { + let j_dy = j * dy; + return [x + j * dx, ys.map((y) => y + j_dy)]; + }); + }) + ); +} +function read_replacement_table(w, next) { + let n2 = 1 + next(); + let m = read_transposed(n2, 1 + w, next); + return m.map((v) => [v[0], v.slice(1)]); +} +function read_emoji_trie(next) { + let sorted = read_member_array(next).sort((a2, b) => a2 - b); + return read(); + function read() { + let branches = []; + while (true) { + let keys = read_member_array(next, sorted); + if (keys.length == 0) break; + branches.push({ set: new Set(keys), node: read() }); + } + branches.sort((a2, b) => b.set.size - a2.set.size); + let temp = next(); + let valid = temp % 3; + temp = (temp / 3) | 0; + let fe0f = !!(temp & 1); + temp >>= 1; + let save = temp == 1; + let check = temp == 2; + return { branches, valid, fe0f, save, check }; + } +} +var init_decoder = __esm({ + 'node_modules/@ethersproject/hash/lib.esm/ens-normalize/decoder.js'() { + init_shim(); + }, +}); + +// node_modules/@ethersproject/hash/lib.esm/ens-normalize/include.js +function getData() { + return read_compressed_payload( + decode2( + 'AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==' + ) + ); +} +var init_include = __esm({ + 'node_modules/@ethersproject/hash/lib.esm/ens-normalize/include.js'() { + init_shim(); + init_lib10(); + init_decoder(); + }, +}); + +// node_modules/@ethersproject/hash/lib.esm/ens-normalize/lib.js +function explode_cp(name) { + return toUtf8CodePoints(name); +} +function filter_fe0f(cps) { + return cps.filter((cp) => cp != 65039); +} +function ens_normalize_post_check(name) { + for (let label of name.split('.')) { + let cps = explode_cp(label); + try { + for (let i2 = cps.lastIndexOf(UNDERSCORE) - 1; i2 >= 0; i2--) { + if (cps[i2] !== UNDERSCORE) { + throw new Error(`underscore only allowed at start`); + } + } + if ( + cps.length >= 4 && + cps.every((cp) => cp < 128) && + cps[2] === HYPHEN && + cps[3] === HYPHEN + ) { + throw new Error(`invalid label extension`); + } + } catch (err) { + throw new Error(`Invalid label "${label}": ${err.message}`); + } + } + return name; +} +function ens_normalize(name) { + return ens_normalize_post_check(normalize(name, filter_fe0f)); +} +function normalize(name, emoji_filter) { + let input = explode_cp(name).reverse(); + let output = []; + while (input.length) { + let emoji = consume_emoji_reversed(input); + if (emoji) { + output.push(...emoji_filter(emoji)); + continue; + } + let cp = input.pop(); + if (VALID.has(cp)) { + output.push(cp); + continue; + } + if (IGNORED.has(cp)) { + continue; + } + let cps = MAPPED[cp]; + if (cps) { + output.push(...cps); + continue; + } + throw new Error(`Disallowed codepoint: 0x${cp.toString(16).toUpperCase()}`); + } + return ens_normalize_post_check(nfc(String.fromCodePoint(...output))); +} +function nfc(s2) { + return s2.normalize('NFC'); +} +function consume_emoji_reversed(cps, eaten) { + var _a; + let node = EMOJI_ROOT; + let emoji; + let saved; + let stack = []; + let pos = cps.length; + if (eaten) eaten.length = 0; + while (pos) { + let cp = cps[--pos]; + node = + (_a = node.branches.find((x) => x.set.has(cp))) === null || _a === void 0 + ? void 0 + : _a.node; + if (!node) break; + if (node.save) { + saved = cp; + } else if (node.check) { + if (cp === saved) break; + } + stack.push(cp); + if (node.fe0f) { + stack.push(65039); + if (pos > 0 && cps[pos - 1] == 65039) pos--; + } + if (node.valid) { + emoji = stack.slice(); + if (node.valid == 2) emoji.splice(1, 1); + if (eaten) eaten.push(...cps.slice(pos).reverse()); + cps.length = pos; + } + } + return emoji; +} +var r, VALID, IGNORED, MAPPED, EMOJI_ROOT, HYPHEN, UNDERSCORE; +var init_lib11 = __esm({ + 'node_modules/@ethersproject/hash/lib.esm/ens-normalize/lib.js'() { + init_shim(); + init_lib9(); + init_include(); + init_decoder(); + r = getData(); + VALID = new Set(read_member_array(r)); + IGNORED = new Set(read_member_array(r)); + MAPPED = read_mapped_map(r); + EMOJI_ROOT = read_emoji_trie(r); + HYPHEN = 45; + UNDERSCORE = 95; + }, +}); + +// node_modules/@ethersproject/hash/lib.esm/namehash.js +function checkComponent(comp) { + if (comp.length === 0) { + throw new Error('invalid ENS name; empty component'); + } + return comp; +} +function ensNameSplit(name) { + const bytes = toUtf8Bytes(ens_normalize(name)); + const comps = []; + if (name.length === 0) { + return comps; + } + let last = 0; + for (let i2 = 0; i2 < bytes.length; i2++) { + const d = bytes[i2]; + if (d === 46) { + comps.push(checkComponent(bytes.slice(last, i2))); + last = i2 + 1; + } + } + if (last >= bytes.length) { + throw new Error('invalid ENS name; empty component'); + } + comps.push(checkComponent(bytes.slice(last))); + return comps; +} +function ensNormalize(name) { + return ensNameSplit(name) + .map((comp) => toUtf8String(comp)) + .join('.'); +} +function isValidName(name) { + try { + return ensNameSplit(name).length !== 0; + } catch (error) {} + return false; +} +function namehash(name) { + if (typeof name !== 'string') { + logger12.throwArgumentError('invalid ENS name; not a string', 'name', name); + } + let result = Zeros; + const comps = ensNameSplit(name); + while (comps.length) { + result = keccak256(concat([result, keccak256(comps.pop())])); + } + return hexlify(result); +} +function dnsEncode(name) { + return ( + hexlify( + concat( + ensNameSplit(name).map((comp) => { + if (comp.length > 63) { + throw new Error( + 'invalid DNS encoded entry; length exceeds 63 bytes' + ); + } + const bytes = new Uint8Array(comp.length + 1); + bytes.set(comp, 1); + bytes[0] = bytes.length - 1; + return bytes; + }) + ) + ) + '00' + ); +} +var logger12, Zeros; +var init_namehash = __esm({ + 'node_modules/@ethersproject/hash/lib.esm/namehash.js'() { + init_shim(); + init_lib2(); + init_lib9(); + init_lib5(); + init_lib(); + init_version9(); + init_lib11(); + logger12 = new Logger(version10); + Zeros = new Uint8Array(32); + Zeros.fill(0); + }, +}); + +// node_modules/@ethersproject/hash/lib.esm/message.js +function hashMessage(message) { + if (typeof message === 'string') { + message = toUtf8Bytes(message); + } + return keccak256( + concat([ + toUtf8Bytes(messagePrefix), + toUtf8Bytes(String(message.length)), + message, + ]) + ); +} +var messagePrefix; +var init_message = __esm({ + 'node_modules/@ethersproject/hash/lib.esm/message.js'() { + init_shim(); + init_lib2(); + init_lib5(); + init_lib9(); + messagePrefix = 'Ethereum Signed Message:\n'; + }, +}); + +// node_modules/@ethersproject/hash/lib.esm/typed-data.js +function hexPadRight(value) { + const bytes = arrayify(value); + const padOffset = bytes.length % 32; + if (padOffset) { + return hexConcat([bytes, padding.slice(padOffset)]); + } + return hexlify(bytes); +} +function checkString(key2) { + return function (value) { + if (typeof value !== 'string') { + logger13.throwArgumentError( + `invalid domain value for ${JSON.stringify(key2)}`, + `domain.${key2}`, + value + ); + } + return value; + }; +} +function getBaseEncoder(type) { + { + const match = type.match(/^(u?)int(\d*)$/); + if (match) { + const signed2 = match[1] === ''; + const width = parseInt(match[2] || '256'); + if ( + width % 8 !== 0 || + width > 256 || + (match[2] && match[2] !== String(width)) + ) { + logger13.throwArgumentError('invalid numeric width', 'type', type); + } + const boundsUpper = MaxUint2562.mask(signed2 ? width - 1 : width); + const boundsLower = signed2 + ? boundsUpper.add(One2).mul(NegativeOne3) + : Zero3; + return function (value) { + const v = BigNumber.from(value); + if (v.lt(boundsLower) || v.gt(boundsUpper)) { + logger13.throwArgumentError( + `value out-of-bounds for ${type}`, + 'value', + value + ); + } + return hexZeroPad(v.toTwos(256).toHexString(), 32); + }; + } + } + { + const match = type.match(/^bytes(\d+)$/); + if (match) { + const width = parseInt(match[1]); + if (width === 0 || width > 32 || match[1] !== String(width)) { + logger13.throwArgumentError('invalid bytes width', 'type', type); + } + return function (value) { + const bytes = arrayify(value); + if (bytes.length !== width) { + logger13.throwArgumentError( + `invalid length for ${type}`, + 'value', + value + ); + } + return hexPadRight(value); + }; + } + } + switch (type) { + case 'address': + return function (value) { + return hexZeroPad(getAddress(value), 32); + }; + case 'bool': + return function (value) { + return !value ? hexFalse : hexTrue; + }; + case 'bytes': + return function (value) { + return keccak256(value); + }; + case 'string': + return function (value) { + return id(value); + }; + } + return null; +} +function encodeType(name, fields) { + return `${name}(${fields + .map(({ name: name2, type }) => type + ' ' + name2) + .join(',')})`; +} +var __awaiter2, + logger13, + padding, + NegativeOne3, + Zero3, + One2, + MaxUint2562, + hexTrue, + hexFalse, + domainFieldTypes, + domainFieldNames, + domainChecks, + TypedDataEncoder; +var init_typed_data = __esm({ + 'node_modules/@ethersproject/hash/lib.esm/typed-data.js'() { + init_shim(); + init_lib7(); + init_lib3(); + init_lib2(); + init_lib5(); + init_lib4(); + init_lib(); + init_version9(); + init_id(); + __awaiter2 = 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 (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + logger13 = new Logger(version10); + padding = new Uint8Array(32); + padding.fill(0); + NegativeOne3 = BigNumber.from(-1); + Zero3 = BigNumber.from(0); + One2 = BigNumber.from(1); + MaxUint2562 = BigNumber.from( + '0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' + ); + hexTrue = hexZeroPad(One2.toHexString(), 32); + hexFalse = hexZeroPad(Zero3.toHexString(), 32); + domainFieldTypes = { + name: 'string', + version: 'string', + chainId: 'uint256', + verifyingContract: 'address', + salt: 'bytes32', + }; + domainFieldNames = [ + 'name', + 'version', + 'chainId', + 'verifyingContract', + 'salt', + ]; + domainChecks = { + name: checkString('name'), + version: checkString('version'), + chainId: function (value) { + try { + return BigNumber.from(value).toString(); + } catch (error) {} + return logger13.throwArgumentError( + `invalid domain value for "chainId"`, + 'domain.chainId', + value + ); + }, + verifyingContract: function (value) { + try { + return getAddress(value).toLowerCase(); + } catch (error) {} + return logger13.throwArgumentError( + `invalid domain value "verifyingContract"`, + 'domain.verifyingContract', + value + ); + }, + salt: function (value) { + try { + const bytes = arrayify(value); + if (bytes.length !== 32) { + throw new Error('bad length'); + } + return hexlify(bytes); + } catch (error) {} + return logger13.throwArgumentError( + `invalid domain value "salt"`, + 'domain.salt', + value + ); + }, + }; + TypedDataEncoder = class { + constructor(types) { + defineReadOnly(this, 'types', Object.freeze(deepCopy(types))); + defineReadOnly(this, '_encoderCache', {}); + defineReadOnly(this, '_types', {}); + const links = {}; + const parents = {}; + const subtypes = {}; + Object.keys(types).forEach((type) => { + links[type] = {}; + parents[type] = []; + subtypes[type] = {}; + }); + for (const name in types) { + const uniqueNames = {}; + types[name].forEach((field) => { + if (uniqueNames[field.name]) { + logger13.throwArgumentError( + `duplicate variable name ${JSON.stringify( + field.name + )} in ${JSON.stringify(name)}`, + 'types', + types + ); + } + uniqueNames[field.name] = true; + const baseType = field.type.match(/^([^\x5b]*)(\x5b|$)/)[1]; + if (baseType === name) { + logger13.throwArgumentError( + `circular type reference to ${JSON.stringify(baseType)}`, + 'types', + types + ); + } + const encoder = getBaseEncoder(baseType); + if (encoder) { + return; + } + if (!parents[baseType]) { + logger13.throwArgumentError( + `unknown type ${JSON.stringify(baseType)}`, + 'types', + types + ); + } + parents[baseType].push(name); + links[name][baseType] = true; + }); + } + const primaryTypes = Object.keys(parents).filter( + (n2) => parents[n2].length === 0 + ); + if (primaryTypes.length === 0) { + logger13.throwArgumentError('missing primary type', 'types', types); + } else if (primaryTypes.length > 1) { + logger13.throwArgumentError( + `ambiguous primary types or unused types: ${primaryTypes + .map((t2) => JSON.stringify(t2)) + .join(', ')}`, + 'types', + types + ); + } + defineReadOnly(this, 'primaryType', primaryTypes[0]); + function checkCircular(type, found) { + if (found[type]) { + logger13.throwArgumentError( + `circular type reference to ${JSON.stringify(type)}`, + 'types', + types + ); + } + found[type] = true; + Object.keys(links[type]).forEach((child) => { + if (!parents[child]) { + return; + } + checkCircular(child, found); + Object.keys(found).forEach((subtype) => { + subtypes[subtype][child] = true; + }); + }); + delete found[type]; + } + checkCircular(this.primaryType, {}); + for (const name in subtypes) { + const st = Object.keys(subtypes[name]); + st.sort(); + this._types[name] = + encodeType(name, types[name]) + + st.map((t2) => encodeType(t2, types[t2])).join(''); + } + } + getEncoder(type) { + let encoder = this._encoderCache[type]; + if (!encoder) { + encoder = this._encoderCache[type] = this._getEncoder(type); + } + return encoder; + } + _getEncoder(type) { + { + const encoder = getBaseEncoder(type); + if (encoder) { + return encoder; + } + } + const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); + if (match) { + const subtype = match[1]; + const subEncoder = this.getEncoder(subtype); + const length = parseInt(match[3]); + return (value) => { + if (length >= 0 && value.length !== length) { + logger13.throwArgumentError( + 'array length mismatch; expected length ${ arrayLength }', + 'value', + value + ); + } + let result = value.map(subEncoder); + if (this._types[subtype]) { + result = result.map(keccak256); + } + return keccak256(hexConcat(result)); + }; + } + const fields = this.types[type]; + if (fields) { + const encodedType = id(this._types[type]); + return (value) => { + const values = fields.map(({ name, type: type2 }) => { + const result = this.getEncoder(type2)(value[name]); + if (this._types[type2]) { + return keccak256(result); + } + return result; + }); + values.unshift(encodedType); + return hexConcat(values); + }; + } + return logger13.throwArgumentError( + `unknown type: ${type}`, + 'type', + type + ); + } + encodeType(name) { + const result = this._types[name]; + if (!result) { + logger13.throwArgumentError( + `unknown type: ${JSON.stringify(name)}`, + 'name', + name + ); + } + return result; + } + encodeData(type, value) { + return this.getEncoder(type)(value); + } + hashStruct(name, value) { + return keccak256(this.encodeData(name, value)); + } + encode(value) { + return this.encodeData(this.primaryType, value); + } + hash(value) { + return this.hashStruct(this.primaryType, value); + } + _visit(type, value, callback) { + { + const encoder = getBaseEncoder(type); + if (encoder) { + return callback(type, value); + } + } + const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); + if (match) { + const subtype = match[1]; + const length = parseInt(match[3]); + if (length >= 0 && value.length !== length) { + logger13.throwArgumentError( + 'array length mismatch; expected length ${ arrayLength }', + 'value', + value + ); + } + return value.map((v) => this._visit(subtype, v, callback)); + } + const fields = this.types[type]; + if (fields) { + return fields.reduce((accum, { name, type: type2 }) => { + accum[name] = this._visit(type2, value[name], callback); + return accum; + }, {}); + } + return logger13.throwArgumentError( + `unknown type: ${type}`, + 'type', + type + ); + } + visit(value, callback) { + return this._visit(this.primaryType, value, callback); + } + static from(types) { + return new TypedDataEncoder(types); + } + static getPrimaryType(types) { + return TypedDataEncoder.from(types).primaryType; + } + static hashStruct(name, types, value) { + return TypedDataEncoder.from(types).hashStruct(name, value); + } + static hashDomain(domain) { + const domainFields = []; + for (const name in domain) { + const type = domainFieldTypes[name]; + if (!type) { + logger13.throwArgumentError( + `invalid typed-data domain key: ${JSON.stringify(name)}`, + 'domain', + domain + ); + } + domainFields.push({ name, type }); + } + domainFields.sort((a2, b) => { + return ( + domainFieldNames.indexOf(a2.name) - domainFieldNames.indexOf(b.name) + ); + }); + return TypedDataEncoder.hashStruct( + 'EIP712Domain', + { EIP712Domain: domainFields }, + domain + ); + } + static encode(domain, types, value) { + return hexConcat([ + '0x1901', + TypedDataEncoder.hashDomain(domain), + TypedDataEncoder.from(types).hash(value), + ]); + } + static hash(domain, types, value) { + return keccak256(TypedDataEncoder.encode(domain, types, value)); + } + // Replaces all address types with ENS names with their looked up address + static resolveNames(domain, types, value, resolveName2) { + return __awaiter2(this, void 0, void 0, function* () { + domain = shallowCopy(domain); + const ensCache = {}; + if ( + domain.verifyingContract && + !isHexString(domain.verifyingContract, 20) + ) { + ensCache[domain.verifyingContract] = '0x'; + } + const encoder = TypedDataEncoder.from(types); + encoder.visit(value, (type, value2) => { + if (type === 'address' && !isHexString(value2, 20)) { + ensCache[value2] = '0x'; + } + return value2; + }); + for (const name in ensCache) { + ensCache[name] = yield resolveName2(name); + } + if (domain.verifyingContract && ensCache[domain.verifyingContract]) { + domain.verifyingContract = ensCache[domain.verifyingContract]; + } + value = encoder.visit(value, (type, value2) => { + if (type === 'address' && ensCache[value2]) { + return ensCache[value2]; + } + return value2; + }); + return { domain, value }; + }); + } + static getPayload(domain, types, value) { + TypedDataEncoder.hashDomain(domain); + const domainValues = {}; + const domainTypes = []; + domainFieldNames.forEach((name) => { + const value2 = domain[name]; + if (value2 == null) { + return; + } + domainValues[name] = domainChecks[name](value2); + domainTypes.push({ name, type: domainFieldTypes[name] }); + }); + const encoder = TypedDataEncoder.from(types); + const typesWithDomain = shallowCopy(types); + if (typesWithDomain.EIP712Domain) { + logger13.throwArgumentError( + 'types must not contain EIP712Domain type', + 'types.EIP712Domain', + types + ); + } else { + typesWithDomain.EIP712Domain = domainTypes; + } + encoder.encode(value); + return { + types: typesWithDomain, + domain: domainValues, + primaryType: encoder.primaryType, + message: encoder.visit(value, (type, value2) => { + if (type.match(/^bytes(\d*)/)) { + return hexlify(arrayify(value2)); + } + if (type.match(/^u?int/)) { + return BigNumber.from(value2).toString(); + } + switch (type) { + case 'address': + return value2.toLowerCase(); + case 'bool': + return !!value2; + case 'string': + if (typeof value2 !== 'string') { + logger13.throwArgumentError( + `invalid string`, + 'value', + value2 + ); + } + return value2; + } + return logger13.throwArgumentError( + 'unsupported type', + 'type', + type + ); + }), + }; + } + }; + }, +}); + +// node_modules/@ethersproject/hash/lib.esm/index.js +var lib_exports10 = {}; +__export(lib_exports10, { + _TypedDataEncoder: () => TypedDataEncoder, + dnsEncode: () => dnsEncode, + ensNormalize: () => ensNormalize, + hashMessage: () => hashMessage, + id: () => id, + isValidName: () => isValidName, + messagePrefix: () => messagePrefix, + namehash: () => namehash, +}); +var init_lib12 = __esm({ + 'node_modules/@ethersproject/hash/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_id(); + init_namehash(); + init_message(); + init_namehash(); + init_typed_data(); + }, +}); + +// node_modules/@ethersproject/abi/lib.esm/interface.js +function wrapAccessError(property, error) { + const wrap = new Error( + `deferred error during ABI decoding triggered accessing ${property}` + ); + wrap.error = error; + return wrap; +} +var logger14, + LogDescription, + TransactionDescription, + ErrorDescription, + Indexed, + BuiltinErrors, + Interface; +var init_interface = __esm({ + 'node_modules/@ethersproject/abi/lib.esm/interface.js'() { + 'use strict'; + init_shim(); + init_lib7(); + init_lib3(); + init_lib2(); + init_lib12(); + init_lib5(); + init_lib4(); + init_abi_coder(); + init_abstract_coder(); + init_fragments(); + init_lib(); + init_version5(); + logger14 = new Logger(version6); + LogDescription = class extends Description {}; + TransactionDescription = class extends Description {}; + ErrorDescription = class extends Description {}; + Indexed = class extends Description { + static isIndexed(value) { + return !!(value && value._isIndexed); + } + }; + BuiltinErrors = { + '0x08c379a0': { + signature: 'Error(string)', + name: 'Error', + inputs: ['string'], + reason: true, + }, + '0x4e487b71': { + signature: 'Panic(uint256)', + name: 'Panic', + inputs: ['uint256'], + }, + }; + Interface = class { + constructor(fragments) { + let abi = []; + if (typeof fragments === 'string') { + abi = JSON.parse(fragments); + } else { + abi = fragments; + } + defineReadOnly( + this, + 'fragments', + abi + .map((fragment) => { + return Fragment.from(fragment); + }) + .filter((fragment) => fragment != null) + ); + defineReadOnly( + this, + '_abiCoder', + getStatic(new.target, 'getAbiCoder')() + ); + defineReadOnly(this, 'functions', {}); + defineReadOnly(this, 'errors', {}); + defineReadOnly(this, 'events', {}); + defineReadOnly(this, 'structs', {}); + this.fragments.forEach((fragment) => { + let bucket = null; + switch (fragment.type) { + case 'constructor': + if (this.deploy) { + logger14.warn('duplicate definition - constructor'); + return; + } + defineReadOnly(this, 'deploy', fragment); + return; + case 'function': + bucket = this.functions; + break; + case 'event': + bucket = this.events; + break; + case 'error': + bucket = this.errors; + break; + default: + return; + } + let signature2 = fragment.format(); + if (bucket[signature2]) { + logger14.warn('duplicate definition - ' + signature2); + return; + } + bucket[signature2] = fragment; + }); + if (!this.deploy) { + defineReadOnly( + this, + 'deploy', + ConstructorFragment.from({ + payable: false, + type: 'constructor', + }) + ); + } + defineReadOnly(this, '_isInterface', true); + } + format(format) { + if (!format) { + format = FormatTypes.full; + } + if (format === FormatTypes.sighash) { + logger14.throwArgumentError( + 'interface does not support formatting sighash', + 'format', + format + ); + } + const abi = this.fragments.map((fragment) => fragment.format(format)); + if (format === FormatTypes.json) { + return JSON.stringify(abi.map((j) => JSON.parse(j))); + } + return abi; + } + // Sub-classes can override these to handle other blockchains + static getAbiCoder() { + return defaultAbiCoder; + } + static getAddress(address) { + return getAddress(address); + } + static getSighash(fragment) { + return hexDataSlice(id(fragment.format()), 0, 4); + } + static getEventTopic(eventFragment) { + return id(eventFragment.format()); + } + // Find a function definition by any means necessary (unless it is ambiguous) + getFunction(nameOrSignatureOrSighash) { + if (isHexString(nameOrSignatureOrSighash)) { + for (const name in this.functions) { + if (nameOrSignatureOrSighash === this.getSighash(name)) { + return this.functions[name]; + } + } + logger14.throwArgumentError( + 'no matching function', + 'sighash', + nameOrSignatureOrSighash + ); + } + if (nameOrSignatureOrSighash.indexOf('(') === -1) { + const name = nameOrSignatureOrSighash.trim(); + const matching = Object.keys(this.functions).filter( + (f) => + f.split( + '(' + /* fix:) */ + )[0] === name + ); + if (matching.length === 0) { + logger14.throwArgumentError('no matching function', 'name', name); + } else if (matching.length > 1) { + logger14.throwArgumentError( + 'multiple matching functions', + 'name', + name + ); + } + return this.functions[matching[0]]; + } + const result = + this.functions[ + FunctionFragment.fromString(nameOrSignatureOrSighash).format() + ]; + if (!result) { + logger14.throwArgumentError( + 'no matching function', + 'signature', + nameOrSignatureOrSighash + ); + } + return result; + } + // Find an event definition by any means necessary (unless it is ambiguous) + getEvent(nameOrSignatureOrTopic) { + if (isHexString(nameOrSignatureOrTopic)) { + const topichash = nameOrSignatureOrTopic.toLowerCase(); + for (const name in this.events) { + if (topichash === this.getEventTopic(name)) { + return this.events[name]; + } + } + logger14.throwArgumentError( + 'no matching event', + 'topichash', + topichash + ); + } + if (nameOrSignatureOrTopic.indexOf('(') === -1) { + const name = nameOrSignatureOrTopic.trim(); + const matching = Object.keys(this.events).filter( + (f) => + f.split( + '(' + /* fix:) */ + )[0] === name + ); + if (matching.length === 0) { + logger14.throwArgumentError('no matching event', 'name', name); + } else if (matching.length > 1) { + logger14.throwArgumentError( + 'multiple matching events', + 'name', + name + ); + } + return this.events[matching[0]]; + } + const result = + this.events[ + EventFragment.fromString(nameOrSignatureOrTopic).format() + ]; + if (!result) { + logger14.throwArgumentError( + 'no matching event', + 'signature', + nameOrSignatureOrTopic + ); + } + return result; + } + // Find a function definition by any means necessary (unless it is ambiguous) + getError(nameOrSignatureOrSighash) { + if (isHexString(nameOrSignatureOrSighash)) { + const getSighash = getStatic(this.constructor, 'getSighash'); + for (const name in this.errors) { + const error = this.errors[name]; + if (nameOrSignatureOrSighash === getSighash(error)) { + return this.errors[name]; + } + } + logger14.throwArgumentError( + 'no matching error', + 'sighash', + nameOrSignatureOrSighash + ); + } + if (nameOrSignatureOrSighash.indexOf('(') === -1) { + const name = nameOrSignatureOrSighash.trim(); + const matching = Object.keys(this.errors).filter( + (f) => + f.split( + '(' + /* fix:) */ + )[0] === name + ); + if (matching.length === 0) { + logger14.throwArgumentError('no matching error', 'name', name); + } else if (matching.length > 1) { + logger14.throwArgumentError( + 'multiple matching errors', + 'name', + name + ); + } + return this.errors[matching[0]]; + } + const result = + this.errors[ + FunctionFragment.fromString(nameOrSignatureOrSighash).format() + ]; + if (!result) { + logger14.throwArgumentError( + 'no matching error', + 'signature', + nameOrSignatureOrSighash + ); + } + return result; + } + // Get the sighash (the bytes4 selector) used by Solidity to identify a function + getSighash(fragment) { + if (typeof fragment === 'string') { + try { + fragment = this.getFunction(fragment); + } catch (error) { + try { + fragment = this.getError(fragment); + } catch (_) { + throw error; + } + } + } + return getStatic(this.constructor, 'getSighash')(fragment); + } + // Get the topic (the bytes32 hash) used by Solidity to identify an event + getEventTopic(eventFragment) { + if (typeof eventFragment === 'string') { + eventFragment = this.getEvent(eventFragment); + } + return getStatic(this.constructor, 'getEventTopic')(eventFragment); + } + _decodeParams(params, data) { + return this._abiCoder.decode(params, data); + } + _encodeParams(params, values) { + return this._abiCoder.encode(params, values); + } + encodeDeploy(values) { + return this._encodeParams(this.deploy.inputs, values || []); + } + decodeErrorResult(fragment, data) { + if (typeof fragment === 'string') { + fragment = this.getError(fragment); + } + const bytes = arrayify(data); + if (hexlify(bytes.slice(0, 4)) !== this.getSighash(fragment)) { + logger14.throwArgumentError( + `data signature does not match error ${fragment.name}.`, + 'data', + hexlify(bytes) + ); + } + return this._decodeParams(fragment.inputs, bytes.slice(4)); + } + encodeErrorResult(fragment, values) { + if (typeof fragment === 'string') { + fragment = this.getError(fragment); + } + return hexlify( + concat([ + this.getSighash(fragment), + this._encodeParams(fragment.inputs, values || []), + ]) + ); + } + // Decode the data for a function call (e.g. tx.data) + decodeFunctionData(functionFragment, data) { + if (typeof functionFragment === 'string') { + functionFragment = this.getFunction(functionFragment); + } + const bytes = arrayify(data); + if (hexlify(bytes.slice(0, 4)) !== this.getSighash(functionFragment)) { + logger14.throwArgumentError( + `data signature does not match function ${functionFragment.name}.`, + 'data', + hexlify(bytes) + ); + } + return this._decodeParams(functionFragment.inputs, bytes.slice(4)); + } + // Encode the data for a function call (e.g. tx.data) + encodeFunctionData(functionFragment, values) { + if (typeof functionFragment === 'string') { + functionFragment = this.getFunction(functionFragment); + } + return hexlify( + concat([ + this.getSighash(functionFragment), + this._encodeParams(functionFragment.inputs, values || []), + ]) + ); + } + // Decode the result from a function call (e.g. from eth_call) + decodeFunctionResult(functionFragment, data) { + if (typeof functionFragment === 'string') { + functionFragment = this.getFunction(functionFragment); + } + let bytes = arrayify(data); + let reason = null; + let message = ''; + let errorArgs = null; + let errorName = null; + let errorSignature = null; + switch (bytes.length % this._abiCoder._getWordSize()) { + case 0: + try { + return this._abiCoder.decode(functionFragment.outputs, bytes); + } catch (error) {} + break; + case 4: { + const selector = hexlify(bytes.slice(0, 4)); + const builtin = BuiltinErrors[selector]; + if (builtin) { + errorArgs = this._abiCoder.decode(builtin.inputs, bytes.slice(4)); + errorName = builtin.name; + errorSignature = builtin.signature; + if (builtin.reason) { + reason = errorArgs[0]; + } + if (errorName === 'Error') { + message = `; VM Exception while processing transaction: reverted with reason string ${JSON.stringify( + errorArgs[0] + )}`; + } else if (errorName === 'Panic') { + message = `; VM Exception while processing transaction: reverted with panic code ${errorArgs[0]}`; + } + } else { + try { + const error = this.getError(selector); + errorArgs = this._abiCoder.decode(error.inputs, bytes.slice(4)); + errorName = error.name; + errorSignature = error.format(); + } catch (error) {} + } + break; + } + } + return logger14.throwError( + 'call revert exception' + message, + Logger.errors.CALL_EXCEPTION, + { + method: functionFragment.format(), + data: hexlify(data), + errorArgs, + errorName, + errorSignature, + reason, + } + ); + } + // Encode the result for a function call (e.g. for eth_call) + encodeFunctionResult(functionFragment, values) { + if (typeof functionFragment === 'string') { + functionFragment = this.getFunction(functionFragment); + } + return hexlify( + this._abiCoder.encode(functionFragment.outputs, values || []) + ); + } + // Create the filter for the event with search criteria (e.g. for eth_filterLog) + encodeFilterTopics(eventFragment, values) { + if (typeof eventFragment === 'string') { + eventFragment = this.getEvent(eventFragment); + } + if (values.length > eventFragment.inputs.length) { + logger14.throwError( + 'too many arguments for ' + eventFragment.format(), + Logger.errors.UNEXPECTED_ARGUMENT, + { + argument: 'values', + value: values, + } + ); + } + let topics = []; + if (!eventFragment.anonymous) { + topics.push(this.getEventTopic(eventFragment)); + } + const encodeTopic = (param, value) => { + if (param.type === 'string') { + return id(value); + } else if (param.type === 'bytes') { + return keccak256(hexlify(value)); + } + if (param.type === 'bool' && typeof value === 'boolean') { + value = value ? '0x01' : '0x00'; + } + if (param.type.match(/^u?int/)) { + value = BigNumber.from(value).toHexString(); + } + if (param.type === 'address') { + this._abiCoder.encode(['address'], [value]); + } + return hexZeroPad(hexlify(value), 32); + }; + values.forEach((value, index) => { + let param = eventFragment.inputs[index]; + if (!param.indexed) { + if (value != null) { + logger14.throwArgumentError( + 'cannot filter non-indexed parameters; must be null', + 'contract.' + param.name, + value + ); + } + return; + } + if (value == null) { + topics.push(null); + } else if (param.baseType === 'array' || param.baseType === 'tuple') { + logger14.throwArgumentError( + 'filtering with tuples or arrays not supported', + 'contract.' + param.name, + value + ); + } else if (Array.isArray(value)) { + topics.push(value.map((value2) => encodeTopic(param, value2))); + } else { + topics.push(encodeTopic(param, value)); + } + }); + while (topics.length && topics[topics.length - 1] === null) { + topics.pop(); + } + return topics; + } + encodeEventLog(eventFragment, values) { + if (typeof eventFragment === 'string') { + eventFragment = this.getEvent(eventFragment); + } + const topics = []; + const dataTypes = []; + const dataValues = []; + if (!eventFragment.anonymous) { + topics.push(this.getEventTopic(eventFragment)); + } + if (values.length !== eventFragment.inputs.length) { + logger14.throwArgumentError( + 'event arguments/values mismatch', + 'values', + values + ); + } + eventFragment.inputs.forEach((param, index) => { + const value = values[index]; + if (param.indexed) { + if (param.type === 'string') { + topics.push(id(value)); + } else if (param.type === 'bytes') { + topics.push(keccak256(value)); + } else if ( + param.baseType === 'tuple' || + param.baseType === 'array' + ) { + throw new Error('not implemented'); + } else { + topics.push(this._abiCoder.encode([param.type], [value])); + } + } else { + dataTypes.push(param); + dataValues.push(value); + } + }); + return { + data: this._abiCoder.encode(dataTypes, dataValues), + topics, + }; + } + // Decode a filter for the event and the search criteria + decodeEventLog(eventFragment, data, topics) { + if (typeof eventFragment === 'string') { + eventFragment = this.getEvent(eventFragment); + } + if (topics != null && !eventFragment.anonymous) { + let topicHash = this.getEventTopic(eventFragment); + if ( + !isHexString(topics[0], 32) || + topics[0].toLowerCase() !== topicHash + ) { + logger14.throwError( + 'fragment/topic mismatch', + Logger.errors.INVALID_ARGUMENT, + { argument: 'topics[0]', expected: topicHash, value: topics[0] } + ); + } + topics = topics.slice(1); + } + let indexed = []; + let nonIndexed = []; + let dynamic = []; + eventFragment.inputs.forEach((param, index) => { + if (param.indexed) { + if ( + param.type === 'string' || + param.type === 'bytes' || + param.baseType === 'tuple' || + param.baseType === 'array' + ) { + indexed.push( + ParamType.fromObject({ type: 'bytes32', name: param.name }) + ); + dynamic.push(true); + } else { + indexed.push(param); + dynamic.push(false); + } + } else { + nonIndexed.push(param); + dynamic.push(false); + } + }); + let resultIndexed = + topics != null + ? this._abiCoder.decode(indexed, concat(topics)) + : null; + let resultNonIndexed = this._abiCoder.decode(nonIndexed, data, true); + let result = []; + let nonIndexedIndex = 0, + indexedIndex = 0; + eventFragment.inputs.forEach((param, index) => { + if (param.indexed) { + if (resultIndexed == null) { + result[index] = new Indexed({ _isIndexed: true, hash: null }); + } else if (dynamic[index]) { + result[index] = new Indexed({ + _isIndexed: true, + hash: resultIndexed[indexedIndex++], + }); + } else { + try { + result[index] = resultIndexed[indexedIndex++]; + } catch (error) { + result[index] = error; + } + } + } else { + try { + result[index] = resultNonIndexed[nonIndexedIndex++]; + } catch (error) { + result[index] = error; + } + } + if (param.name && result[param.name] == null) { + const value = result[index]; + if (value instanceof Error) { + Object.defineProperty(result, param.name, { + enumerable: true, + get: () => { + throw wrapAccessError( + `property ${JSON.stringify(param.name)}`, + value + ); + }, + }); + } else { + result[param.name] = value; + } + } + }); + for (let i2 = 0; i2 < result.length; i2++) { + const value = result[i2]; + if (value instanceof Error) { + Object.defineProperty(result, i2, { + enumerable: true, + get: () => { + throw wrapAccessError(`index ${i2}`, value); + }, + }); + } + } + return Object.freeze(result); + } + // Given a transaction, find the matching function fragment (if any) and + // determine all its properties and call parameters + parseTransaction(tx) { + let fragment = this.getFunction(tx.data.substring(0, 10).toLowerCase()); + if (!fragment) { + return null; + } + return new TransactionDescription({ + args: this._abiCoder.decode( + fragment.inputs, + '0x' + tx.data.substring(10) + ), + functionFragment: fragment, + name: fragment.name, + signature: fragment.format(), + sighash: this.getSighash(fragment), + value: BigNumber.from(tx.value || '0'), + }); + } + // @TODO + //parseCallResult(data: BytesLike): ?? + // Given an event log, find the matching event fragment (if any) and + // determine all its properties and values + parseLog(log3) { + let fragment = this.getEvent(log3.topics[0]); + if (!fragment || fragment.anonymous) { + return null; + } + return new LogDescription({ + eventFragment: fragment, + name: fragment.name, + signature: fragment.format(), + topic: this.getEventTopic(fragment), + args: this.decodeEventLog(fragment, log3.data, log3.topics), + }); + } + parseError(data) { + const hexData = hexlify(data); + let fragment = this.getError(hexData.substring(0, 10).toLowerCase()); + if (!fragment) { + return null; + } + return new ErrorDescription({ + args: this._abiCoder.decode( + fragment.inputs, + '0x' + hexData.substring(10) + ), + errorFragment: fragment, + name: fragment.name, + signature: fragment.format(), + sighash: this.getSighash(fragment), + }); + } + /* + static from(value: Array | string | Interface) { + if (Interface.isInterface(value)) { + return value; + } + if (typeof(value) === "string") { + return new Interface(JSON.parse(value)); + } + return new Interface(value); + } + */ + static isInterface(value) { + return !!(value && value._isInterface); + } + }; + }, +}); + +// node_modules/@ethersproject/abi/lib.esm/index.js +var lib_exports11 = {}; +__export(lib_exports11, { + AbiCoder: () => AbiCoder, + ConstructorFragment: () => ConstructorFragment, + ErrorFragment: () => ErrorFragment, + EventFragment: () => EventFragment, + FormatTypes: () => FormatTypes, + Fragment: () => Fragment, + FunctionFragment: () => FunctionFragment, + Indexed: () => Indexed, + Interface: () => Interface, + LogDescription: () => LogDescription, + ParamType: () => ParamType, + TransactionDescription: () => TransactionDescription, + checkResultErrors: () => checkResultErrors, + defaultAbiCoder: () => defaultAbiCoder, +}); +var init_lib13 = __esm({ + 'node_modules/@ethersproject/abi/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_fragments(); + init_abi_coder(); + init_interface(); + }, +}); + +// node_modules/@ethersproject/abstract-provider/lib.esm/_version.js +var version11; +var init_version10 = __esm({ + 'node_modules/@ethersproject/abstract-provider/lib.esm/_version.js'() { + init_shim(); + version11 = 'abstract-provider/5.7.0'; + }, +}); + +// node_modules/@ethersproject/abstract-provider/lib.esm/index.js +var __awaiter3, logger15, ForkEvent, Provider; +var init_lib14 = __esm({ + 'node_modules/@ethersproject/abstract-provider/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_lib3(); + init_lib4(); + init_lib(); + init_version10(); + __awaiter3 = 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 (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + logger15 = new Logger(version11); + ForkEvent = class extends Description { + static isForkEvent(value) { + return !!(value && value._isForkEvent); + } + }; + Provider = class { + constructor() { + logger15.checkAbstract(new.target, Provider); + defineReadOnly(this, '_isProvider', true); + } + getFeeData() { + return __awaiter3(this, void 0, void 0, function* () { + const { block, gasPrice } = yield resolveProperties({ + block: this.getBlock('latest'), + gasPrice: this.getGasPrice().catch((error) => { + return null; + }), + }); + let lastBaseFeePerGas = null, + maxFeePerGas = null, + maxPriorityFeePerGas = null; + if (block && block.baseFeePerGas) { + lastBaseFeePerGas = block.baseFeePerGas; + maxPriorityFeePerGas = BigNumber.from('1500000000'); + maxFeePerGas = block.baseFeePerGas.mul(2).add(maxPriorityFeePerGas); + } + return { + lastBaseFeePerGas, + maxFeePerGas, + maxPriorityFeePerGas, + gasPrice, + }; + }); + } + // Alias for "on" + addListener(eventName, listener) { + return this.on(eventName, listener); + } + // Alias for "off" + removeListener(eventName, listener) { + return this.off(eventName, listener); + } + static isProvider(value) { + return !!(value && value._isProvider); + } + }; + }, +}); + +// node_modules/@ethersproject/abstract-signer/lib.esm/_version.js +var version12; +var init_version11 = __esm({ + 'node_modules/@ethersproject/abstract-signer/lib.esm/_version.js'() { + init_shim(); + version12 = 'abstract-signer/5.7.0'; + }, +}); + +// node_modules/@ethersproject/abstract-signer/lib.esm/index.js +var __awaiter4, + logger16, + allowedTransactionKeys, + forwardErrors, + Signer, + VoidSigner; +var init_lib15 = __esm({ + 'node_modules/@ethersproject/abstract-signer/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_lib4(); + init_lib(); + init_version11(); + __awaiter4 = 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 (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + logger16 = new Logger(version12); + allowedTransactionKeys = [ + 'accessList', + 'ccipReadEnabled', + 'chainId', + 'customData', + 'data', + 'from', + 'gasLimit', + 'gasPrice', + 'maxFeePerGas', + 'maxPriorityFeePerGas', + 'nonce', + 'to', + 'type', + 'value', + ]; + forwardErrors = [ + Logger.errors.INSUFFICIENT_FUNDS, + Logger.errors.NONCE_EXPIRED, + Logger.errors.REPLACEMENT_UNDERPRICED, + ]; + Signer = class { + /////////////////// + // Sub-classes MUST call super + constructor() { + logger16.checkAbstract(new.target, Signer); + defineReadOnly(this, '_isSigner', true); + } + /////////////////// + // Sub-classes MAY override these + getBalance(blockTag) { + return __awaiter4(this, void 0, void 0, function* () { + this._checkProvider('getBalance'); + return yield this.provider.getBalance(this.getAddress(), blockTag); + }); + } + getTransactionCount(blockTag) { + return __awaiter4(this, void 0, void 0, function* () { + this._checkProvider('getTransactionCount'); + return yield this.provider.getTransactionCount( + this.getAddress(), + blockTag + ); + }); + } + // Populates "from" if unspecified, and estimates the gas for the transaction + estimateGas(transaction) { + return __awaiter4(this, void 0, void 0, function* () { + this._checkProvider('estimateGas'); + const tx = yield resolveProperties( + this.checkTransaction(transaction) + ); + return yield this.provider.estimateGas(tx); + }); + } + // Populates "from" if unspecified, and calls with the transaction + call(transaction, blockTag) { + return __awaiter4(this, void 0, void 0, function* () { + this._checkProvider('call'); + const tx = yield resolveProperties( + this.checkTransaction(transaction) + ); + return yield this.provider.call(tx, blockTag); + }); + } + // Populates all fields in a transaction, signs it and sends it to the network + sendTransaction(transaction) { + return __awaiter4(this, void 0, void 0, function* () { + this._checkProvider('sendTransaction'); + const tx = yield this.populateTransaction(transaction); + const signedTx = yield this.signTransaction(tx); + return yield this.provider.sendTransaction(signedTx); + }); + } + getChainId() { + return __awaiter4(this, void 0, void 0, function* () { + this._checkProvider('getChainId'); + const network = yield this.provider.getNetwork(); + return network.chainId; + }); + } + getGasPrice() { + return __awaiter4(this, void 0, void 0, function* () { + this._checkProvider('getGasPrice'); + return yield this.provider.getGasPrice(); + }); + } + getFeeData() { + return __awaiter4(this, void 0, void 0, function* () { + this._checkProvider('getFeeData'); + return yield this.provider.getFeeData(); + }); + } + resolveName(name) { + return __awaiter4(this, void 0, void 0, function* () { + this._checkProvider('resolveName'); + return yield this.provider.resolveName(name); + }); + } + // Checks a transaction does not contain invalid keys and if + // no "from" is provided, populates it. + // - does NOT require a provider + // - adds "from" is not present + // - returns a COPY (safe to mutate the result) + // By default called from: (overriding these prevents it) + // - call + // - estimateGas + // - populateTransaction (and therefor sendTransaction) + checkTransaction(transaction) { + for (const key2 in transaction) { + if (allowedTransactionKeys.indexOf(key2) === -1) { + logger16.throwArgumentError( + 'invalid transaction key: ' + key2, + 'transaction', + transaction + ); + } + } + const tx = shallowCopy(transaction); + if (tx.from == null) { + tx.from = this.getAddress(); + } else { + tx.from = Promise.all([ + Promise.resolve(tx.from), + this.getAddress(), + ]).then((result) => { + if (result[0].toLowerCase() !== result[1].toLowerCase()) { + logger16.throwArgumentError( + 'from address mismatch', + 'transaction', + transaction + ); + } + return result[0]; + }); + } + return tx; + } + // Populates ALL keys for a transaction and checks that "from" matches + // this Signer. Should be used by sendTransaction but NOT by signTransaction. + // By default called from: (overriding these prevents it) + // - sendTransaction + // + // Notes: + // - We allow gasPrice for EIP-1559 as long as it matches maxFeePerGas + populateTransaction(transaction) { + return __awaiter4(this, void 0, void 0, function* () { + const tx = yield resolveProperties( + this.checkTransaction(transaction) + ); + if (tx.to != null) { + tx.to = Promise.resolve(tx.to).then((to) => + __awaiter4(this, void 0, void 0, function* () { + if (to == null) { + return null; + } + const address = yield this.resolveName(to); + if (address == null) { + logger16.throwArgumentError( + 'provided ENS name resolves to null', + 'tx.to', + to + ); + } + return address; + }) + ); + tx.to.catch((error) => {}); + } + const hasEip1559 = + tx.maxFeePerGas != null || tx.maxPriorityFeePerGas != null; + if (tx.gasPrice != null && (tx.type === 2 || hasEip1559)) { + logger16.throwArgumentError( + 'eip-1559 transaction do not support gasPrice', + 'transaction', + transaction + ); + } else if ((tx.type === 0 || tx.type === 1) && hasEip1559) { + logger16.throwArgumentError( + 'pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas', + 'transaction', + transaction + ); + } + if ( + (tx.type === 2 || tx.type == null) && + tx.maxFeePerGas != null && + tx.maxPriorityFeePerGas != null + ) { + tx.type = 2; + } else if (tx.type === 0 || tx.type === 1) { + if (tx.gasPrice == null) { + tx.gasPrice = this.getGasPrice(); + } + } else { + const feeData = yield this.getFeeData(); + if (tx.type == null) { + if ( + feeData.maxFeePerGas != null && + feeData.maxPriorityFeePerGas != null + ) { + tx.type = 2; + if (tx.gasPrice != null) { + const gasPrice = tx.gasPrice; + delete tx.gasPrice; + tx.maxFeePerGas = gasPrice; + tx.maxPriorityFeePerGas = gasPrice; + } else { + if (tx.maxFeePerGas == null) { + tx.maxFeePerGas = feeData.maxFeePerGas; + } + if (tx.maxPriorityFeePerGas == null) { + tx.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; + } + } + } else if (feeData.gasPrice != null) { + if (hasEip1559) { + logger16.throwError( + 'network does not support EIP-1559', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'populateTransaction', + } + ); + } + if (tx.gasPrice == null) { + tx.gasPrice = feeData.gasPrice; + } + tx.type = 0; + } else { + logger16.throwError( + 'failed to get consistent fee data', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'signer.getFeeData', + } + ); + } + } else if (tx.type === 2) { + if (tx.maxFeePerGas == null) { + tx.maxFeePerGas = feeData.maxFeePerGas; + } + if (tx.maxPriorityFeePerGas == null) { + tx.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; + } + } + } + if (tx.nonce == null) { + tx.nonce = this.getTransactionCount('pending'); + } + if (tx.gasLimit == null) { + tx.gasLimit = this.estimateGas(tx).catch((error) => { + if (forwardErrors.indexOf(error.code) >= 0) { + throw error; + } + return logger16.throwError( + 'cannot estimate gas; transaction may fail or may require manual gas limit', + Logger.errors.UNPREDICTABLE_GAS_LIMIT, + { + error, + tx, + } + ); + }); + } + if (tx.chainId == null) { + tx.chainId = this.getChainId(); + } else { + tx.chainId = Promise.all([ + Promise.resolve(tx.chainId), + this.getChainId(), + ]).then((results) => { + if (results[1] !== 0 && results[0] !== results[1]) { + logger16.throwArgumentError( + 'chainId address mismatch', + 'transaction', + transaction + ); + } + return results[0]; + }); + } + return yield resolveProperties(tx); + }); + } + /////////////////// + // Sub-classes SHOULD leave these alone + _checkProvider(operation) { + if (!this.provider) { + logger16.throwError( + 'missing provider', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: operation || '_checkProvider', + } + ); + } + } + static isSigner(value) { + return !!(value && value._isSigner); + } + }; + VoidSigner = class extends Signer { + constructor(address, provider) { + super(); + defineReadOnly(this, 'address', address); + defineReadOnly(this, 'provider', provider || null); + } + getAddress() { + return Promise.resolve(this.address); + } + _fail(message, operation) { + return Promise.resolve().then(() => { + logger16.throwError(message, Logger.errors.UNSUPPORTED_OPERATION, { + operation, + }); + }); + } + signMessage(message) { + return this._fail('VoidSigner cannot sign messages', 'signMessage'); + } + signTransaction(transaction) { + return this._fail( + 'VoidSigner cannot sign transactions', + 'signTransaction' + ); + } + _signTypedData(domain, types, value) { + return this._fail('VoidSigner cannot sign typed data', 'signTypedData'); + } + connect(provider) { + return new VoidSigner(this.address, provider); + } + }; + }, +}); + +// node_modules/@ethersproject/signing-key/node_modules/bn.js/lib/bn.js +var require_bn2 = __commonJS({ + 'node_modules/@ethersproject/signing-key/node_modules/bn.js/lib/bn.js'( + exports, + module2 + ) { + init_shim(); + (function (module3, exports2) { + 'use strict'; + function assert2(val, msg) { + if (!val) throw new Error(msg || 'Assertion failed'); + } + function inherits(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function () {}; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN3(number, base2, endian) { + if (BN3.isBN(number)) { + return number; + } + this.negative = 0; + this.words = null; + this.length = 0; + this.red = null; + if (number !== null) { + if (base2 === 'le' || base2 === 'be') { + endian = base2; + base2 = 10; + } + this._init(number || 0, base2 || 10, endian || 'be'); + } + } + if (typeof module3 === 'object') { + module3.exports = BN3; + } else { + exports2.BN = BN3; + } + BN3.BN = BN3; + BN3.wordSize = 26; + var Buffer4; + try { + if ( + typeof window !== 'undefined' && + typeof window.Buffer !== 'undefined' + ) { + Buffer4 = window.Buffer; + } else { + Buffer4 = __require('buffer').Buffer; + } + } catch (e2) {} + BN3.isBN = function isBN(num) { + if (num instanceof BN3) { + return true; + } + return ( + num !== null && + typeof num === 'object' && + num.constructor.wordSize === BN3.wordSize && + Array.isArray(num.words) + ); + }; + BN3.max = function max(left, right) { + if (left.cmp(right) > 0) return left; + return right; + }; + BN3.min = function min(left, right) { + if (left.cmp(right) < 0) return left; + return right; + }; + BN3.prototype._init = function init2(number, base2, endian) { + if (typeof number === 'number') { + return this._initNumber(number, base2, endian); + } + if (typeof number === 'object') { + return this._initArray(number, base2, endian); + } + if (base2 === 'hex') { + base2 = 16; + } + assert2(base2 === (base2 | 0) && base2 >= 2 && base2 <= 36); + number = number.toString().replace(/\s+/g, ''); + var start = 0; + if (number[0] === '-') { + start++; + this.negative = 1; + } + if (start < number.length) { + if (base2 === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base2, start); + if (endian === 'le') { + this._initArray(this.toArray(), base2, endian); + } + } + } + }; + BN3.prototype._initNumber = function _initNumber(number, base2, endian) { + if (number < 0) { + this.negative = 1; + number = -number; + } + if (number < 67108864) { + this.words = [number & 67108863]; + this.length = 1; + } else if (number < 4503599627370496) { + this.words = [number & 67108863, (number / 67108864) & 67108863]; + this.length = 2; + } else { + assert2(number < 9007199254740992); + this.words = [number & 67108863, (number / 67108864) & 67108863, 1]; + this.length = 3; + } + if (endian !== 'le') return; + this._initArray(this.toArray(), base2, endian); + }; + BN3.prototype._initArray = function _initArray(number, base2, endian) { + assert2(typeof number.length === 'number'); + if (number.length <= 0) { + this.words = [0]; + this.length = 1; + return this; + } + this.length = Math.ceil(number.length / 3); + this.words = new Array(this.length); + for (var i2 = 0; i2 < this.length; i2++) { + this.words[i2] = 0; + } + var j, w; + var off = 0; + if (endian === 'be') { + for (i2 = number.length - 1, j = 0; i2 >= 0; i2 -= 3) { + w = number[i2] | (number[i2 - 1] << 8) | (number[i2 - 2] << 16); + this.words[j] |= (w << off) & 67108863; + this.words[j + 1] = (w >>> (26 - off)) & 67108863; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + } else if (endian === 'le') { + for (i2 = 0, j = 0; i2 < number.length; i2 += 3) { + w = number[i2] | (number[i2 + 1] << 8) | (number[i2 + 2] << 16); + this.words[j] |= (w << off) & 67108863; + this.words[j + 1] = (w >>> (26 - off)) & 67108863; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + } + return this._strip(); + }; + function parseHex4Bits(string, index) { + var c = string.charCodeAt(index); + if (c >= 48 && c <= 57) { + return c - 48; + } else if (c >= 65 && c <= 70) { + return c - 55; + } else if (c >= 97 && c <= 102) { + return c - 87; + } else { + assert2(false, 'Invalid character in ' + string); + } + } + function parseHexByte(string, lowerBound, index) { + var r3 = parseHex4Bits(string, index); + if (index - 1 >= lowerBound) { + r3 |= parseHex4Bits(string, index - 1) << 4; + } + return r3; + } + BN3.prototype._parseHex = function _parseHex(number, start, endian) { + this.length = Math.ceil((number.length - start) / 6); + this.words = new Array(this.length); + for (var i2 = 0; i2 < this.length; i2++) { + this.words[i2] = 0; + } + var off = 0; + var j = 0; + var w; + if (endian === 'be') { + for (i2 = number.length - 1; i2 >= start; i2 -= 2) { + w = parseHexByte(number, start, i2) << off; + this.words[j] |= w & 67108863; + if (off >= 18) { + off -= 18; + j += 1; + this.words[j] |= w >>> 26; + } else { + off += 8; + } + } + } else { + var parseLength = number.length - start; + for ( + i2 = parseLength % 2 === 0 ? start + 1 : start; + i2 < number.length; + i2 += 2 + ) { + w = parseHexByte(number, start, i2) << off; + this.words[j] |= w & 67108863; + if (off >= 18) { + off -= 18; + j += 1; + this.words[j] |= w >>> 26; + } else { + off += 8; + } + } + } + this._strip(); + }; + function parseBase(str, start, end, mul3) { + var r3 = 0; + var b = 0; + var len = Math.min(str.length, end); + for (var i2 = start; i2 < len; i2++) { + var c = str.charCodeAt(i2) - 48; + r3 *= mul3; + if (c >= 49) { + b = c - 49 + 10; + } else if (c >= 17) { + b = c - 17 + 10; + } else { + b = c; + } + assert2(c >= 0 && b < mul3, 'Invalid character'); + r3 += b; + } + return r3; + } + BN3.prototype._parseBase = function _parseBase(number, base2, start) { + this.words = [0]; + this.length = 1; + for ( + var limbLen = 0, limbPow = 1; + limbPow <= 67108863; + limbPow *= base2 + ) { + limbLen++; + } + limbLen--; + limbPow = (limbPow / base2) | 0; + var total = number.length - start; + var mod = total % limbLen; + var end = Math.min(total, total - mod) + start; + var word = 0; + for (var i2 = start; i2 < end; i2 += limbLen) { + word = parseBase(number, i2, i2 + limbLen, base2); + this.imuln(limbPow); + if (this.words[0] + word < 67108864) { + this.words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod !== 0) { + var pow = 1; + word = parseBase(number, i2, number.length, base2); + for (i2 = 0; i2 < mod; i2++) { + pow *= base2; + } + this.imuln(pow); + if (this.words[0] + word < 67108864) { + this.words[0] += word; + } else { + this._iaddn(word); + } + } + this._strip(); + }; + BN3.prototype.copy = function copy(dest) { + dest.words = new Array(this.length); + for (var i2 = 0; i2 < this.length; i2++) { + dest.words[i2] = this.words[i2]; + } + dest.length = this.length; + dest.negative = this.negative; + dest.red = this.red; + }; + function move(dest, src) { + dest.words = src.words; + dest.length = src.length; + dest.negative = src.negative; + dest.red = src.red; + } + BN3.prototype._move = function _move(dest) { + move(dest, this); + }; + BN3.prototype.clone = function clone() { + var r3 = new BN3(null); + this.copy(r3); + return r3; + }; + BN3.prototype._expand = function _expand(size) { + while (this.length < size) { + this.words[this.length++] = 0; + } + return this; + }; + BN3.prototype._strip = function strip() { + while (this.length > 1 && this.words[this.length - 1] === 0) { + this.length--; + } + return this._normSign(); + }; + BN3.prototype._normSign = function _normSign() { + if (this.length === 1 && this.words[0] === 0) { + this.negative = 0; + } + return this; + }; + if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') { + try { + BN3.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect4; + } catch (e2) { + BN3.prototype.inspect = inspect4; + } + } else { + BN3.prototype.inspect = inspect4; + } + function inspect4() { + return (this.red ? ''; + } + var zeros2 = [ + '', + '0', + '00', + '000', + '0000', + '00000', + '000000', + '0000000', + '00000000', + '000000000', + '0000000000', + '00000000000', + '000000000000', + '0000000000000', + '00000000000000', + '000000000000000', + '0000000000000000', + '00000000000000000', + '000000000000000000', + '0000000000000000000', + '00000000000000000000', + '000000000000000000000', + '0000000000000000000000', + '00000000000000000000000', + '000000000000000000000000', + '0000000000000000000000000', + ]; + var groupSizes = [ + 0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + ]; + var groupBases = [ + 0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, + 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, + 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, + 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, + 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, + 60466176, + ]; + BN3.prototype.toString = function toString2(base2, padding2) { + base2 = base2 || 10; + padding2 = padding2 | 0 || 1; + var out; + if (base2 === 16 || base2 === 'hex') { + out = ''; + var off = 0; + var carry = 0; + for (var i2 = 0; i2 < this.length; i2++) { + var w = this.words[i2]; + var word = (((w << off) | carry) & 16777215).toString(16); + carry = (w >>> (24 - off)) & 16777215; + off += 2; + if (off >= 26) { + off -= 26; + i2--; + } + if (carry !== 0 || i2 !== this.length - 1) { + out = zeros2[6 - word.length] + word + out; + } else { + out = word + out; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding2 !== 0) { + out = '0' + out; + } + if (this.negative !== 0) { + out = '-' + out; + } + return out; + } + if (base2 === (base2 | 0) && base2 >= 2 && base2 <= 36) { + var groupSize = groupSizes[base2]; + var groupBase = groupBases[base2]; + out = ''; + var c = this.clone(); + c.negative = 0; + while (!c.isZero()) { + var r3 = c.modrn(groupBase).toString(base2); + c = c.idivn(groupBase); + if (!c.isZero()) { + out = zeros2[groupSize - r3.length] + r3 + out; + } else { + out = r3 + out; + } + } + if (this.isZero()) { + out = '0' + out; + } + while (out.length % padding2 !== 0) { + out = '0' + out; + } + if (this.negative !== 0) { + out = '-' + out; + } + return out; + } + assert2(false, 'Base should be between 2 and 36'); + }; + BN3.prototype.toNumber = function toNumber() { + var ret = this.words[0]; + if (this.length === 2) { + ret += this.words[1] * 67108864; + } else if (this.length === 3 && this.words[2] === 1) { + ret += 4503599627370496 + this.words[1] * 67108864; + } else if (this.length > 2) { + assert2(false, 'Number can only safely store up to 53 bits'); + } + return this.negative !== 0 ? -ret : ret; + }; + BN3.prototype.toJSON = function toJSON2() { + return this.toString(16, 2); + }; + if (Buffer4) { + BN3.prototype.toBuffer = function toBuffer(endian, length) { + return this.toArrayLike(Buffer4, endian, length); + }; + } + BN3.prototype.toArray = function toArray(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + var allocate = function allocate2(ArrayType, size) { + if (ArrayType.allocUnsafe) { + return ArrayType.allocUnsafe(size); + } + return new ArrayType(size); + }; + BN3.prototype.toArrayLike = function toArrayLike( + ArrayType, + endian, + length + ) { + this._strip(); + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert2( + byteLength <= reqLength, + 'byte array longer than desired length' + ); + assert2(reqLength > 0, 'Requested array length <= 0'); + var res = allocate(ArrayType, reqLength); + var postfix = endian === 'le' ? 'LE' : 'BE'; + this['_toArrayLike' + postfix](res, byteLength); + return res; + }; + BN3.prototype._toArrayLikeLE = function _toArrayLikeLE(res, byteLength) { + var position = 0; + var carry = 0; + for (var i2 = 0, shift = 0; i2 < this.length; i2++) { + var word = (this.words[i2] << shift) | carry; + res[position++] = word & 255; + if (position < res.length) { + res[position++] = (word >> 8) & 255; + } + if (position < res.length) { + res[position++] = (word >> 16) & 255; + } + if (shift === 6) { + if (position < res.length) { + res[position++] = (word >> 24) & 255; + } + carry = 0; + shift = 0; + } else { + carry = word >>> 24; + shift += 2; + } + } + if (position < res.length) { + res[position++] = carry; + while (position < res.length) { + res[position++] = 0; + } + } + }; + BN3.prototype._toArrayLikeBE = function _toArrayLikeBE(res, byteLength) { + var position = res.length - 1; + var carry = 0; + for (var i2 = 0, shift = 0; i2 < this.length; i2++) { + var word = (this.words[i2] << shift) | carry; + res[position--] = word & 255; + if (position >= 0) { + res[position--] = (word >> 8) & 255; + } + if (position >= 0) { + res[position--] = (word >> 16) & 255; + } + if (shift === 6) { + if (position >= 0) { + res[position--] = (word >> 24) & 255; + } + carry = 0; + shift = 0; + } else { + carry = word >>> 24; + shift += 2; + } + } + if (position >= 0) { + res[position--] = carry; + while (position >= 0) { + res[position--] = 0; + } + } + }; + if (Math.clz32) { + BN3.prototype._countBits = function _countBits(w) { + return 32 - Math.clz32(w); + }; + } else { + BN3.prototype._countBits = function _countBits(w) { + var t2 = w; + var r3 = 0; + if (t2 >= 4096) { + r3 += 13; + t2 >>>= 13; + } + if (t2 >= 64) { + r3 += 7; + t2 >>>= 7; + } + if (t2 >= 8) { + r3 += 4; + t2 >>>= 4; + } + if (t2 >= 2) { + r3 += 2; + t2 >>>= 2; + } + return r3 + t2; + }; + } + BN3.prototype._zeroBits = function _zeroBits(w) { + if (w === 0) return 26; + var t2 = w; + var r3 = 0; + if ((t2 & 8191) === 0) { + r3 += 13; + t2 >>>= 13; + } + if ((t2 & 127) === 0) { + r3 += 7; + t2 >>>= 7; + } + if ((t2 & 15) === 0) { + r3 += 4; + t2 >>>= 4; + } + if ((t2 & 3) === 0) { + r3 += 2; + t2 >>>= 2; + } + if ((t2 & 1) === 0) { + r3++; + } + return r3; + }; + BN3.prototype.bitLength = function bitLength() { + var w = this.words[this.length - 1]; + var hi = this._countBits(w); + return (this.length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w = new Array(num.bitLength()); + for (var bit = 0; bit < w.length; bit++) { + var off = (bit / 26) | 0; + var wbit = bit % 26; + w[bit] = (num.words[off] >>> wbit) & 1; + } + return w; + } + BN3.prototype.zeroBits = function zeroBits() { + if (this.isZero()) return 0; + var r3 = 0; + for (var i2 = 0; i2 < this.length; i2++) { + var b = this._zeroBits(this.words[i2]); + r3 += b; + if (b !== 26) break; + } + return r3; + }; + BN3.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN3.prototype.toTwos = function toTwos(width) { + if (this.negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN3.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN3.prototype.isNeg = function isNeg() { + return this.negative !== 0; + }; + BN3.prototype.neg = function neg3() { + return this.clone().ineg(); + }; + BN3.prototype.ineg = function ineg() { + if (!this.isZero()) { + this.negative ^= 1; + } + return this; + }; + BN3.prototype.iuor = function iuor(num) { + while (this.length < num.length) { + this.words[this.length++] = 0; + } + for (var i2 = 0; i2 < num.length; i2++) { + this.words[i2] = this.words[i2] | num.words[i2]; + } + return this._strip(); + }; + BN3.prototype.ior = function ior(num) { + assert2((this.negative | num.negative) === 0); + return this.iuor(num); + }; + BN3.prototype.or = function or(num) { + if (this.length > num.length) return this.clone().ior(num); + return num.clone().ior(this); + }; + BN3.prototype.uor = function uor(num) { + if (this.length > num.length) return this.clone().iuor(num); + return num.clone().iuor(this); + }; + BN3.prototype.iuand = function iuand(num) { + var b; + if (this.length > num.length) { + b = num; + } else { + b = this; + } + for (var i2 = 0; i2 < b.length; i2++) { + this.words[i2] = this.words[i2] & num.words[i2]; + } + this.length = b.length; + return this._strip(); + }; + BN3.prototype.iand = function iand(num) { + assert2((this.negative | num.negative) === 0); + return this.iuand(num); + }; + BN3.prototype.and = function and(num) { + if (this.length > num.length) return this.clone().iand(num); + return num.clone().iand(this); + }; + BN3.prototype.uand = function uand(num) { + if (this.length > num.length) return this.clone().iuand(num); + return num.clone().iuand(this); + }; + BN3.prototype.iuxor = function iuxor(num) { + var a2; + var b; + if (this.length > num.length) { + a2 = this; + b = num; + } else { + a2 = num; + b = this; + } + for (var i2 = 0; i2 < b.length; i2++) { + this.words[i2] = a2.words[i2] ^ b.words[i2]; + } + if (this !== a2) { + for (; i2 < a2.length; i2++) { + this.words[i2] = a2.words[i2]; + } + } + this.length = a2.length; + return this._strip(); + }; + BN3.prototype.ixor = function ixor(num) { + assert2((this.negative | num.negative) === 0); + return this.iuxor(num); + }; + BN3.prototype.xor = function xor(num) { + if (this.length > num.length) return this.clone().ixor(num); + return num.clone().ixor(this); + }; + BN3.prototype.uxor = function uxor(num) { + if (this.length > num.length) return this.clone().iuxor(num); + return num.clone().iuxor(this); + }; + BN3.prototype.inotn = function inotn(width) { + assert2(typeof width === 'number' && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i2 = 0; i2 < bytesNeeded; i2++) { + this.words[i2] = ~this.words[i2] & 67108863; + } + if (bitsLeft > 0) { + this.words[i2] = ~this.words[i2] & (67108863 >> (26 - bitsLeft)); + } + return this._strip(); + }; + BN3.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN3.prototype.setn = function setn(bit, val) { + assert2(typeof bit === 'number' && bit >= 0); + var off = (bit / 26) | 0; + var wbit = bit % 26; + this._expand(off + 1); + if (val) { + this.words[off] = this.words[off] | (1 << wbit); + } else { + this.words[off] = this.words[off] & ~(1 << wbit); + } + return this._strip(); + }; + BN3.prototype.iadd = function iadd(num) { + var r3; + if (this.negative !== 0 && num.negative === 0) { + this.negative = 0; + r3 = this.isub(num); + this.negative ^= 1; + return this._normSign(); + } else if (this.negative === 0 && num.negative !== 0) { + num.negative = 0; + r3 = this.isub(num); + num.negative = 1; + return r3._normSign(); + } + var a2, b; + if (this.length > num.length) { + a2 = this; + b = num; + } else { + a2 = num; + b = this; + } + var carry = 0; + for (var i2 = 0; i2 < b.length; i2++) { + r3 = (a2.words[i2] | 0) + (b.words[i2] | 0) + carry; + this.words[i2] = r3 & 67108863; + carry = r3 >>> 26; + } + for (; carry !== 0 && i2 < a2.length; i2++) { + r3 = (a2.words[i2] | 0) + carry; + this.words[i2] = r3 & 67108863; + carry = r3 >>> 26; + } + this.length = a2.length; + if (carry !== 0) { + this.words[this.length] = carry; + this.length++; + } else if (a2 !== this) { + for (; i2 < a2.length; i2++) { + this.words[i2] = a2.words[i2]; + } + } + return this; + }; + BN3.prototype.add = function add5(num) { + var res; + if (num.negative !== 0 && this.negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && this.negative !== 0) { + this.negative = 0; + res = num.sub(this); + this.negative = 1; + return res; + } + if (this.length > num.length) return this.clone().iadd(num); + return num.clone().iadd(this); + }; + BN3.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r3 = this.iadd(num); + num.negative = 1; + return r3._normSign(); + } else if (this.negative !== 0) { + this.negative = 0; + this.iadd(num); + this.negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + this.negative = 0; + this.length = 1; + this.words[0] = 0; + return this; + } + var a2, b; + if (cmp > 0) { + a2 = this; + b = num; + } else { + a2 = num; + b = this; + } + var carry = 0; + for (var i2 = 0; i2 < b.length; i2++) { + r3 = (a2.words[i2] | 0) - (b.words[i2] | 0) + carry; + carry = r3 >> 26; + this.words[i2] = r3 & 67108863; + } + for (; carry !== 0 && i2 < a2.length; i2++) { + r3 = (a2.words[i2] | 0) + carry; + carry = r3 >> 26; + this.words[i2] = r3 & 67108863; + } + if (carry === 0 && i2 < a2.length && a2 !== this) { + for (; i2 < a2.length; i2++) { + this.words[i2] = a2.words[i2]; + } + } + this.length = Math.max(this.length, i2); + if (a2 !== this) { + this.negative = 1; + } + return this._strip(); + }; + BN3.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = (self2.length + num.length) | 0; + out.length = len; + len = (len - 1) | 0; + var a2 = self2.words[0] | 0; + var b = num.words[0] | 0; + var r3 = a2 * b; + var lo = r3 & 67108863; + var carry = (r3 / 67108864) | 0; + out.words[0] = lo; + for (var k = 1; k < len; k++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k, num.length - 1); + for (var j = Math.max(0, k - self2.length + 1); j <= maxJ; j++) { + var i2 = (k - j) | 0; + a2 = self2.words[i2] | 0; + b = num.words[j] | 0; + r3 = a2 * b + rword; + ncarry += (r3 / 67108864) | 0; + rword = r3 & 67108863; + } + out.words[k] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k] = carry | 0; + } else { + out.length--; + } + return out._strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a2 = self2.words; + var b = num.words; + var o2 = out.words; + var c = 0; + var lo; + var mid; + var hi; + var a0 = a2[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a2[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a2[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a3 = a2[3] | 0; + var al3 = a3 & 8191; + var ah3 = a3 >>> 13; + var a4 = a2[4] | 0; + var al4 = a4 & 8191; + var ah4 = a4 >>> 13; + var a5 = a2[5] | 0; + var al5 = a5 & 8191; + var ah5 = a5 >>> 13; + var a6 = a2[6] | 0; + var al6 = a6 & 8191; + var ah6 = a6 >>> 13; + var a7 = a2[7] | 0; + var al7 = a7 & 8191; + var ah7 = a7 >>> 13; + var a8 = a2[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a2[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b2 = b[2] | 0; + var bl2 = b2 & 8191; + var bh2 = b2 >>> 13; + var b3 = b[3] | 0; + var bl3 = b3 & 8191; + var bh3 = b3 >>> 13; + var b4 = b[4] | 0; + var bl4 = b4 & 8191; + var bh4 = b4 >>> 13; + var b5 = b[5] | 0; + var bl5 = b5 & 8191; + var bh5 = b5 >>> 13; + var b6 = b[6] | 0; + var bl6 = b6 & 8191; + var bh6 = b6 >>> 13; + var b7 = b[7] | 0; + var bl7 = b7 & 8191; + var bh7 = b7 >>> 13; + var b8 = b[8] | 0; + var bl8 = b8 & 8191; + var bh8 = b8 >>> 13; + var b9 = b[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = (mid + Math.imul(ah0, bl0)) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = (mid + Math.imul(ah1, bl0)) | 0; + hi = Math.imul(ah1, bh0); + lo = (lo + Math.imul(al0, bl1)) | 0; + mid = (mid + Math.imul(al0, bh1)) | 0; + mid = (mid + Math.imul(ah0, bl1)) | 0; + hi = (hi + Math.imul(ah0, bh1)) | 0; + var w1 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = (mid + Math.imul(ah2, bl0)) | 0; + hi = Math.imul(ah2, bh0); + lo = (lo + Math.imul(al1, bl1)) | 0; + mid = (mid + Math.imul(al1, bh1)) | 0; + mid = (mid + Math.imul(ah1, bl1)) | 0; + hi = (hi + Math.imul(ah1, bh1)) | 0; + lo = (lo + Math.imul(al0, bl2)) | 0; + mid = (mid + Math.imul(al0, bh2)) | 0; + mid = (mid + Math.imul(ah0, bl2)) | 0; + hi = (hi + Math.imul(ah0, bh2)) | 0; + var w2 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0; + w2 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = (mid + Math.imul(ah3, bl0)) | 0; + hi = Math.imul(ah3, bh0); + lo = (lo + Math.imul(al2, bl1)) | 0; + mid = (mid + Math.imul(al2, bh1)) | 0; + mid = (mid + Math.imul(ah2, bl1)) | 0; + hi = (hi + Math.imul(ah2, bh1)) | 0; + lo = (lo + Math.imul(al1, bl2)) | 0; + mid = (mid + Math.imul(al1, bh2)) | 0; + mid = (mid + Math.imul(ah1, bl2)) | 0; + hi = (hi + Math.imul(ah1, bh2)) | 0; + lo = (lo + Math.imul(al0, bl3)) | 0; + mid = (mid + Math.imul(al0, bh3)) | 0; + mid = (mid + Math.imul(ah0, bl3)) | 0; + hi = (hi + Math.imul(ah0, bh3)) | 0; + var w3 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0; + w3 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = (mid + Math.imul(ah4, bl0)) | 0; + hi = Math.imul(ah4, bh0); + lo = (lo + Math.imul(al3, bl1)) | 0; + mid = (mid + Math.imul(al3, bh1)) | 0; + mid = (mid + Math.imul(ah3, bl1)) | 0; + hi = (hi + Math.imul(ah3, bh1)) | 0; + lo = (lo + Math.imul(al2, bl2)) | 0; + mid = (mid + Math.imul(al2, bh2)) | 0; + mid = (mid + Math.imul(ah2, bl2)) | 0; + hi = (hi + Math.imul(ah2, bh2)) | 0; + lo = (lo + Math.imul(al1, bl3)) | 0; + mid = (mid + Math.imul(al1, bh3)) | 0; + mid = (mid + Math.imul(ah1, bl3)) | 0; + hi = (hi + Math.imul(ah1, bh3)) | 0; + lo = (lo + Math.imul(al0, bl4)) | 0; + mid = (mid + Math.imul(al0, bh4)) | 0; + mid = (mid + Math.imul(ah0, bl4)) | 0; + hi = (hi + Math.imul(ah0, bh4)) | 0; + var w4 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0; + w4 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = (mid + Math.imul(ah5, bl0)) | 0; + hi = Math.imul(ah5, bh0); + lo = (lo + Math.imul(al4, bl1)) | 0; + mid = (mid + Math.imul(al4, bh1)) | 0; + mid = (mid + Math.imul(ah4, bl1)) | 0; + hi = (hi + Math.imul(ah4, bh1)) | 0; + lo = (lo + Math.imul(al3, bl2)) | 0; + mid = (mid + Math.imul(al3, bh2)) | 0; + mid = (mid + Math.imul(ah3, bl2)) | 0; + hi = (hi + Math.imul(ah3, bh2)) | 0; + lo = (lo + Math.imul(al2, bl3)) | 0; + mid = (mid + Math.imul(al2, bh3)) | 0; + mid = (mid + Math.imul(ah2, bl3)) | 0; + hi = (hi + Math.imul(ah2, bh3)) | 0; + lo = (lo + Math.imul(al1, bl4)) | 0; + mid = (mid + Math.imul(al1, bh4)) | 0; + mid = (mid + Math.imul(ah1, bl4)) | 0; + hi = (hi + Math.imul(ah1, bh4)) | 0; + lo = (lo + Math.imul(al0, bl5)) | 0; + mid = (mid + Math.imul(al0, bh5)) | 0; + mid = (mid + Math.imul(ah0, bl5)) | 0; + hi = (hi + Math.imul(ah0, bh5)) | 0; + var w5 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0; + w5 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = (mid + Math.imul(ah6, bl0)) | 0; + hi = Math.imul(ah6, bh0); + lo = (lo + Math.imul(al5, bl1)) | 0; + mid = (mid + Math.imul(al5, bh1)) | 0; + mid = (mid + Math.imul(ah5, bl1)) | 0; + hi = (hi + Math.imul(ah5, bh1)) | 0; + lo = (lo + Math.imul(al4, bl2)) | 0; + mid = (mid + Math.imul(al4, bh2)) | 0; + mid = (mid + Math.imul(ah4, bl2)) | 0; + hi = (hi + Math.imul(ah4, bh2)) | 0; + lo = (lo + Math.imul(al3, bl3)) | 0; + mid = (mid + Math.imul(al3, bh3)) | 0; + mid = (mid + Math.imul(ah3, bl3)) | 0; + hi = (hi + Math.imul(ah3, bh3)) | 0; + lo = (lo + Math.imul(al2, bl4)) | 0; + mid = (mid + Math.imul(al2, bh4)) | 0; + mid = (mid + Math.imul(ah2, bl4)) | 0; + hi = (hi + Math.imul(ah2, bh4)) | 0; + lo = (lo + Math.imul(al1, bl5)) | 0; + mid = (mid + Math.imul(al1, bh5)) | 0; + mid = (mid + Math.imul(ah1, bl5)) | 0; + hi = (hi + Math.imul(ah1, bh5)) | 0; + lo = (lo + Math.imul(al0, bl6)) | 0; + mid = (mid + Math.imul(al0, bh6)) | 0; + mid = (mid + Math.imul(ah0, bl6)) | 0; + hi = (hi + Math.imul(ah0, bh6)) | 0; + var w6 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = (mid + Math.imul(ah7, bl0)) | 0; + hi = Math.imul(ah7, bh0); + lo = (lo + Math.imul(al6, bl1)) | 0; + mid = (mid + Math.imul(al6, bh1)) | 0; + mid = (mid + Math.imul(ah6, bl1)) | 0; + hi = (hi + Math.imul(ah6, bh1)) | 0; + lo = (lo + Math.imul(al5, bl2)) | 0; + mid = (mid + Math.imul(al5, bh2)) | 0; + mid = (mid + Math.imul(ah5, bl2)) | 0; + hi = (hi + Math.imul(ah5, bh2)) | 0; + lo = (lo + Math.imul(al4, bl3)) | 0; + mid = (mid + Math.imul(al4, bh3)) | 0; + mid = (mid + Math.imul(ah4, bl3)) | 0; + hi = (hi + Math.imul(ah4, bh3)) | 0; + lo = (lo + Math.imul(al3, bl4)) | 0; + mid = (mid + Math.imul(al3, bh4)) | 0; + mid = (mid + Math.imul(ah3, bl4)) | 0; + hi = (hi + Math.imul(ah3, bh4)) | 0; + lo = (lo + Math.imul(al2, bl5)) | 0; + mid = (mid + Math.imul(al2, bh5)) | 0; + mid = (mid + Math.imul(ah2, bl5)) | 0; + hi = (hi + Math.imul(ah2, bh5)) | 0; + lo = (lo + Math.imul(al1, bl6)) | 0; + mid = (mid + Math.imul(al1, bh6)) | 0; + mid = (mid + Math.imul(ah1, bl6)) | 0; + hi = (hi + Math.imul(ah1, bh6)) | 0; + lo = (lo + Math.imul(al0, bl7)) | 0; + mid = (mid + Math.imul(al0, bh7)) | 0; + mid = (mid + Math.imul(ah0, bl7)) | 0; + hi = (hi + Math.imul(ah0, bh7)) | 0; + var w7 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = (mid + Math.imul(ah8, bl0)) | 0; + hi = Math.imul(ah8, bh0); + lo = (lo + Math.imul(al7, bl1)) | 0; + mid = (mid + Math.imul(al7, bh1)) | 0; + mid = (mid + Math.imul(ah7, bl1)) | 0; + hi = (hi + Math.imul(ah7, bh1)) | 0; + lo = (lo + Math.imul(al6, bl2)) | 0; + mid = (mid + Math.imul(al6, bh2)) | 0; + mid = (mid + Math.imul(ah6, bl2)) | 0; + hi = (hi + Math.imul(ah6, bh2)) | 0; + lo = (lo + Math.imul(al5, bl3)) | 0; + mid = (mid + Math.imul(al5, bh3)) | 0; + mid = (mid + Math.imul(ah5, bl3)) | 0; + hi = (hi + Math.imul(ah5, bh3)) | 0; + lo = (lo + Math.imul(al4, bl4)) | 0; + mid = (mid + Math.imul(al4, bh4)) | 0; + mid = (mid + Math.imul(ah4, bl4)) | 0; + hi = (hi + Math.imul(ah4, bh4)) | 0; + lo = (lo + Math.imul(al3, bl5)) | 0; + mid = (mid + Math.imul(al3, bh5)) | 0; + mid = (mid + Math.imul(ah3, bl5)) | 0; + hi = (hi + Math.imul(ah3, bh5)) | 0; + lo = (lo + Math.imul(al2, bl6)) | 0; + mid = (mid + Math.imul(al2, bh6)) | 0; + mid = (mid + Math.imul(ah2, bl6)) | 0; + hi = (hi + Math.imul(ah2, bh6)) | 0; + lo = (lo + Math.imul(al1, bl7)) | 0; + mid = (mid + Math.imul(al1, bh7)) | 0; + mid = (mid + Math.imul(ah1, bl7)) | 0; + hi = (hi + Math.imul(ah1, bh7)) | 0; + lo = (lo + Math.imul(al0, bl8)) | 0; + mid = (mid + Math.imul(al0, bh8)) | 0; + mid = (mid + Math.imul(ah0, bl8)) | 0; + hi = (hi + Math.imul(ah0, bh8)) | 0; + var w8 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = (mid + Math.imul(ah9, bl0)) | 0; + hi = Math.imul(ah9, bh0); + lo = (lo + Math.imul(al8, bl1)) | 0; + mid = (mid + Math.imul(al8, bh1)) | 0; + mid = (mid + Math.imul(ah8, bl1)) | 0; + hi = (hi + Math.imul(ah8, bh1)) | 0; + lo = (lo + Math.imul(al7, bl2)) | 0; + mid = (mid + Math.imul(al7, bh2)) | 0; + mid = (mid + Math.imul(ah7, bl2)) | 0; + hi = (hi + Math.imul(ah7, bh2)) | 0; + lo = (lo + Math.imul(al6, bl3)) | 0; + mid = (mid + Math.imul(al6, bh3)) | 0; + mid = (mid + Math.imul(ah6, bl3)) | 0; + hi = (hi + Math.imul(ah6, bh3)) | 0; + lo = (lo + Math.imul(al5, bl4)) | 0; + mid = (mid + Math.imul(al5, bh4)) | 0; + mid = (mid + Math.imul(ah5, bl4)) | 0; + hi = (hi + Math.imul(ah5, bh4)) | 0; + lo = (lo + Math.imul(al4, bl5)) | 0; + mid = (mid + Math.imul(al4, bh5)) | 0; + mid = (mid + Math.imul(ah4, bl5)) | 0; + hi = (hi + Math.imul(ah4, bh5)) | 0; + lo = (lo + Math.imul(al3, bl6)) | 0; + mid = (mid + Math.imul(al3, bh6)) | 0; + mid = (mid + Math.imul(ah3, bl6)) | 0; + hi = (hi + Math.imul(ah3, bh6)) | 0; + lo = (lo + Math.imul(al2, bl7)) | 0; + mid = (mid + Math.imul(al2, bh7)) | 0; + mid = (mid + Math.imul(ah2, bl7)) | 0; + hi = (hi + Math.imul(ah2, bh7)) | 0; + lo = (lo + Math.imul(al1, bl8)) | 0; + mid = (mid + Math.imul(al1, bh8)) | 0; + mid = (mid + Math.imul(ah1, bl8)) | 0; + hi = (hi + Math.imul(ah1, bh8)) | 0; + lo = (lo + Math.imul(al0, bl9)) | 0; + mid = (mid + Math.imul(al0, bh9)) | 0; + mid = (mid + Math.imul(ah0, bl9)) | 0; + hi = (hi + Math.imul(ah0, bh9)) | 0; + var w9 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = (mid + Math.imul(ah9, bl1)) | 0; + hi = Math.imul(ah9, bh1); + lo = (lo + Math.imul(al8, bl2)) | 0; + mid = (mid + Math.imul(al8, bh2)) | 0; + mid = (mid + Math.imul(ah8, bl2)) | 0; + hi = (hi + Math.imul(ah8, bh2)) | 0; + lo = (lo + Math.imul(al7, bl3)) | 0; + mid = (mid + Math.imul(al7, bh3)) | 0; + mid = (mid + Math.imul(ah7, bl3)) | 0; + hi = (hi + Math.imul(ah7, bh3)) | 0; + lo = (lo + Math.imul(al6, bl4)) | 0; + mid = (mid + Math.imul(al6, bh4)) | 0; + mid = (mid + Math.imul(ah6, bl4)) | 0; + hi = (hi + Math.imul(ah6, bh4)) | 0; + lo = (lo + Math.imul(al5, bl5)) | 0; + mid = (mid + Math.imul(al5, bh5)) | 0; + mid = (mid + Math.imul(ah5, bl5)) | 0; + hi = (hi + Math.imul(ah5, bh5)) | 0; + lo = (lo + Math.imul(al4, bl6)) | 0; + mid = (mid + Math.imul(al4, bh6)) | 0; + mid = (mid + Math.imul(ah4, bl6)) | 0; + hi = (hi + Math.imul(ah4, bh6)) | 0; + lo = (lo + Math.imul(al3, bl7)) | 0; + mid = (mid + Math.imul(al3, bh7)) | 0; + mid = (mid + Math.imul(ah3, bl7)) | 0; + hi = (hi + Math.imul(ah3, bh7)) | 0; + lo = (lo + Math.imul(al2, bl8)) | 0; + mid = (mid + Math.imul(al2, bh8)) | 0; + mid = (mid + Math.imul(ah2, bl8)) | 0; + hi = (hi + Math.imul(ah2, bh8)) | 0; + lo = (lo + Math.imul(al1, bl9)) | 0; + mid = (mid + Math.imul(al1, bh9)) | 0; + mid = (mid + Math.imul(ah1, bl9)) | 0; + hi = (hi + Math.imul(ah1, bh9)) | 0; + var w10 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = (mid + Math.imul(ah9, bl2)) | 0; + hi = Math.imul(ah9, bh2); + lo = (lo + Math.imul(al8, bl3)) | 0; + mid = (mid + Math.imul(al8, bh3)) | 0; + mid = (mid + Math.imul(ah8, bl3)) | 0; + hi = (hi + Math.imul(ah8, bh3)) | 0; + lo = (lo + Math.imul(al7, bl4)) | 0; + mid = (mid + Math.imul(al7, bh4)) | 0; + mid = (mid + Math.imul(ah7, bl4)) | 0; + hi = (hi + Math.imul(ah7, bh4)) | 0; + lo = (lo + Math.imul(al6, bl5)) | 0; + mid = (mid + Math.imul(al6, bh5)) | 0; + mid = (mid + Math.imul(ah6, bl5)) | 0; + hi = (hi + Math.imul(ah6, bh5)) | 0; + lo = (lo + Math.imul(al5, bl6)) | 0; + mid = (mid + Math.imul(al5, bh6)) | 0; + mid = (mid + Math.imul(ah5, bl6)) | 0; + hi = (hi + Math.imul(ah5, bh6)) | 0; + lo = (lo + Math.imul(al4, bl7)) | 0; + mid = (mid + Math.imul(al4, bh7)) | 0; + mid = (mid + Math.imul(ah4, bl7)) | 0; + hi = (hi + Math.imul(ah4, bh7)) | 0; + lo = (lo + Math.imul(al3, bl8)) | 0; + mid = (mid + Math.imul(al3, bh8)) | 0; + mid = (mid + Math.imul(ah3, bl8)) | 0; + hi = (hi + Math.imul(ah3, bh8)) | 0; + lo = (lo + Math.imul(al2, bl9)) | 0; + mid = (mid + Math.imul(al2, bh9)) | 0; + mid = (mid + Math.imul(ah2, bl9)) | 0; + hi = (hi + Math.imul(ah2, bh9)) | 0; + var w11 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = (mid + Math.imul(ah9, bl3)) | 0; + hi = Math.imul(ah9, bh3); + lo = (lo + Math.imul(al8, bl4)) | 0; + mid = (mid + Math.imul(al8, bh4)) | 0; + mid = (mid + Math.imul(ah8, bl4)) | 0; + hi = (hi + Math.imul(ah8, bh4)) | 0; + lo = (lo + Math.imul(al7, bl5)) | 0; + mid = (mid + Math.imul(al7, bh5)) | 0; + mid = (mid + Math.imul(ah7, bl5)) | 0; + hi = (hi + Math.imul(ah7, bh5)) | 0; + lo = (lo + Math.imul(al6, bl6)) | 0; + mid = (mid + Math.imul(al6, bh6)) | 0; + mid = (mid + Math.imul(ah6, bl6)) | 0; + hi = (hi + Math.imul(ah6, bh6)) | 0; + lo = (lo + Math.imul(al5, bl7)) | 0; + mid = (mid + Math.imul(al5, bh7)) | 0; + mid = (mid + Math.imul(ah5, bl7)) | 0; + hi = (hi + Math.imul(ah5, bh7)) | 0; + lo = (lo + Math.imul(al4, bl8)) | 0; + mid = (mid + Math.imul(al4, bh8)) | 0; + mid = (mid + Math.imul(ah4, bl8)) | 0; + hi = (hi + Math.imul(ah4, bh8)) | 0; + lo = (lo + Math.imul(al3, bl9)) | 0; + mid = (mid + Math.imul(al3, bh9)) | 0; + mid = (mid + Math.imul(ah3, bl9)) | 0; + hi = (hi + Math.imul(ah3, bh9)) | 0; + var w12 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = (mid + Math.imul(ah9, bl4)) | 0; + hi = Math.imul(ah9, bh4); + lo = (lo + Math.imul(al8, bl5)) | 0; + mid = (mid + Math.imul(al8, bh5)) | 0; + mid = (mid + Math.imul(ah8, bl5)) | 0; + hi = (hi + Math.imul(ah8, bh5)) | 0; + lo = (lo + Math.imul(al7, bl6)) | 0; + mid = (mid + Math.imul(al7, bh6)) | 0; + mid = (mid + Math.imul(ah7, bl6)) | 0; + hi = (hi + Math.imul(ah7, bh6)) | 0; + lo = (lo + Math.imul(al6, bl7)) | 0; + mid = (mid + Math.imul(al6, bh7)) | 0; + mid = (mid + Math.imul(ah6, bl7)) | 0; + hi = (hi + Math.imul(ah6, bh7)) | 0; + lo = (lo + Math.imul(al5, bl8)) | 0; + mid = (mid + Math.imul(al5, bh8)) | 0; + mid = (mid + Math.imul(ah5, bl8)) | 0; + hi = (hi + Math.imul(ah5, bh8)) | 0; + lo = (lo + Math.imul(al4, bl9)) | 0; + mid = (mid + Math.imul(al4, bh9)) | 0; + mid = (mid + Math.imul(ah4, bl9)) | 0; + hi = (hi + Math.imul(ah4, bh9)) | 0; + var w13 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = (mid + Math.imul(ah9, bl5)) | 0; + hi = Math.imul(ah9, bh5); + lo = (lo + Math.imul(al8, bl6)) | 0; + mid = (mid + Math.imul(al8, bh6)) | 0; + mid = (mid + Math.imul(ah8, bl6)) | 0; + hi = (hi + Math.imul(ah8, bh6)) | 0; + lo = (lo + Math.imul(al7, bl7)) | 0; + mid = (mid + Math.imul(al7, bh7)) | 0; + mid = (mid + Math.imul(ah7, bl7)) | 0; + hi = (hi + Math.imul(ah7, bh7)) | 0; + lo = (lo + Math.imul(al6, bl8)) | 0; + mid = (mid + Math.imul(al6, bh8)) | 0; + mid = (mid + Math.imul(ah6, bl8)) | 0; + hi = (hi + Math.imul(ah6, bh8)) | 0; + lo = (lo + Math.imul(al5, bl9)) | 0; + mid = (mid + Math.imul(al5, bh9)) | 0; + mid = (mid + Math.imul(ah5, bl9)) | 0; + hi = (hi + Math.imul(ah5, bh9)) | 0; + var w14 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = (mid + Math.imul(ah9, bl6)) | 0; + hi = Math.imul(ah9, bh6); + lo = (lo + Math.imul(al8, bl7)) | 0; + mid = (mid + Math.imul(al8, bh7)) | 0; + mid = (mid + Math.imul(ah8, bl7)) | 0; + hi = (hi + Math.imul(ah8, bh7)) | 0; + lo = (lo + Math.imul(al7, bl8)) | 0; + mid = (mid + Math.imul(al7, bh8)) | 0; + mid = (mid + Math.imul(ah7, bl8)) | 0; + hi = (hi + Math.imul(ah7, bh8)) | 0; + lo = (lo + Math.imul(al6, bl9)) | 0; + mid = (mid + Math.imul(al6, bh9)) | 0; + mid = (mid + Math.imul(ah6, bl9)) | 0; + hi = (hi + Math.imul(ah6, bh9)) | 0; + var w15 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = (mid + Math.imul(ah9, bl7)) | 0; + hi = Math.imul(ah9, bh7); + lo = (lo + Math.imul(al8, bl8)) | 0; + mid = (mid + Math.imul(al8, bh8)) | 0; + mid = (mid + Math.imul(ah8, bl8)) | 0; + hi = (hi + Math.imul(ah8, bh8)) | 0; + lo = (lo + Math.imul(al7, bl9)) | 0; + mid = (mid + Math.imul(al7, bh9)) | 0; + mid = (mid + Math.imul(ah7, bl9)) | 0; + hi = (hi + Math.imul(ah7, bh9)) | 0; + var w16 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = (mid + Math.imul(ah9, bl8)) | 0; + hi = Math.imul(ah9, bh8); + lo = (lo + Math.imul(al8, bl9)) | 0; + mid = (mid + Math.imul(al8, bh9)) | 0; + mid = (mid + Math.imul(ah8, bl9)) | 0; + hi = (hi + Math.imul(ah8, bh9)) | 0; + var w17 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = (mid + Math.imul(ah9, bl9)) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0; + w18 &= 67108863; + o2[0] = w0; + o2[1] = w1; + o2[2] = w2; + o2[3] = w3; + o2[4] = w4; + o2[5] = w5; + o2[6] = w6; + o2[7] = w7; + o2[8] = w8; + o2[9] = w9; + o2[10] = w10; + o2[11] = w11; + o2[12] = w12; + o2[13] = w13; + o2[14] = w14; + o2[15] = w15; + o2[16] = w16; + o2[17] = w17; + o2[18] = w18; + if (c !== 0) { + o2[19] = c; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k = 0; k < out.length - 1; k++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k, num.length - 1); + for (var j = Math.max(0, k - self2.length + 1); j <= maxJ; j++) { + var i2 = k - j; + var a2 = self2.words[i2] | 0; + var b = num.words[j] | 0; + var r3 = a2 * b; + var lo = r3 & 67108863; + ncarry = (ncarry + ((r3 / 67108864) | 0)) | 0; + lo = (lo + rword) | 0; + rword = lo & 67108863; + ncarry = (ncarry + (lo >>> 26)) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k] = carry; + } else { + out.length--; + } + return out._strip(); + } + function jumboMulTo(self2, num, out) { + return bigMulTo(self2, num, out); + } + BN3.prototype.mulTo = function mulTo(num, out) { + var res; + var len = this.length + num.length; + if (this.length === 10 && num.length === 10) { + res = comb10MulTo(this, num, out); + } else if (len < 63) { + res = smallMulTo(this, num, out); + } else if (len < 1024) { + res = bigMulTo(this, num, out); + } else { + res = jumboMulTo(this, num, out); + } + return res; + }; + function FFTM(x, y) { + this.x = x; + this.y = y; + } + FFTM.prototype.makeRBT = function makeRBT(N2) { + var t2 = new Array(N2); + var l2 = BN3.prototype._countBits(N2) - 1; + for (var i2 = 0; i2 < N2; i2++) { + t2[i2] = this.revBin(i2, l2, N2); + } + return t2; + }; + FFTM.prototype.revBin = function revBin(x, l2, N2) { + if (x === 0 || x === N2 - 1) return x; + var rb = 0; + for (var i2 = 0; i2 < l2; i2++) { + rb |= (x & 1) << (l2 - i2 - 1); + x >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N2) { + for (var i2 = 0; i2 < N2; i2++) { + rtws[i2] = rws[rbt[i2]]; + itws[i2] = iws[rbt[i2]]; + } + }; + FFTM.prototype.transform = function transform( + rws, + iws, + rtws, + itws, + N2, + rbt + ) { + this.permute(rbt, rws, iws, rtws, itws, N2); + for (var s2 = 1; s2 < N2; s2 <<= 1) { + var l2 = s2 << 1; + var rtwdf = Math.cos((2 * Math.PI) / l2); + var itwdf = Math.sin((2 * Math.PI) / l2); + for (var p = 0; p < N2; p += l2) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j = 0; j < s2; j++) { + var re = rtws[p + j]; + var ie = itws[p + j]; + var ro = rtws[p + j + s2]; + var io = itws[p + j + s2]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p + j] = re + ro; + itws[p + j] = ie + io; + rtws[p + j + s2] = re - ro; + itws[p + j + s2] = ie - io; + if (j !== l2) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n2, m) { + var N2 = Math.max(m, n2) | 1; + var odd = N2 & 1; + var i2 = 0; + for (N2 = (N2 / 2) | 0; N2; N2 = N2 >>> 1) { + i2++; + } + return 1 << (i2 + 1 + odd); + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N2) { + if (N2 <= 1) return; + for (var i2 = 0; i2 < N2 / 2; i2++) { + var t2 = rws[i2]; + rws[i2] = rws[N2 - i2 - 1]; + rws[N2 - i2 - 1] = t2; + t2 = iws[i2]; + iws[i2] = -iws[N2 - i2 - 1]; + iws[N2 - i2 - 1] = -t2; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N2) { + var carry = 0; + for (var i2 = 0; i2 < N2 / 2; i2++) { + var w = + Math.round(ws[2 * i2 + 1] / N2) * 8192 + + Math.round(ws[2 * i2] / N2) + + carry; + ws[i2] = w & 67108863; + if (w < 67108864) { + carry = 0; + } else { + carry = (w / 67108864) | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N2) { + var carry = 0; + for (var i2 = 0; i2 < len; i2++) { + carry = carry + (ws[i2] | 0); + rws[2 * i2] = carry & 8191; + carry = carry >>> 13; + rws[2 * i2 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i2 = 2 * len; i2 < N2; ++i2) { + rws[i2] = 0; + } + assert2(carry === 0); + assert2((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N2) { + var ph = new Array(N2); + for (var i2 = 0; i2 < N2; i2++) { + ph[i2] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x, y, out) { + var N2 = 2 * this.guessLen13b(x.length, y.length); + var rbt = this.makeRBT(N2); + var _ = this.stub(N2); + var rws = new Array(N2); + var rwst = new Array(N2); + var iwst = new Array(N2); + var nrws = new Array(N2); + var nrwst = new Array(N2); + var niwst = new Array(N2); + var rmws = out.words; + rmws.length = N2; + this.convert13b(x.words, x.length, rws, N2); + this.convert13b(y.words, y.length, nrws, N2); + this.transform(rws, _, rwst, iwst, N2, rbt); + this.transform(nrws, _, nrwst, niwst, N2, rbt); + for (var i2 = 0; i2 < N2; i2++) { + var rx = rwst[i2] * nrwst[i2] - iwst[i2] * niwst[i2]; + iwst[i2] = rwst[i2] * niwst[i2] + iwst[i2] * nrwst[i2]; + rwst[i2] = rx; + } + this.conjugate(rwst, iwst, N2); + this.transform(rwst, iwst, rmws, _, N2, rbt); + this.conjugate(rmws, _, N2); + this.normalize13b(rmws, N2); + out.negative = x.negative ^ y.negative; + out.length = x.length + y.length; + return out._strip(); + }; + BN3.prototype.mul = function mul3(num) { + var out = new BN3(null); + out.words = new Array(this.length + num.length); + return this.mulTo(num, out); + }; + BN3.prototype.mulf = function mulf(num) { + var out = new BN3(null); + out.words = new Array(this.length + num.length); + return jumboMulTo(this, num, out); + }; + BN3.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this); + }; + BN3.prototype.imuln = function imuln(num) { + var isNegNum = num < 0; + if (isNegNum) num = -num; + assert2(typeof num === 'number'); + assert2(num < 67108864); + var carry = 0; + for (var i2 = 0; i2 < this.length; i2++) { + var w = (this.words[i2] | 0) * num; + var lo = (w & 67108863) + (carry & 67108863); + carry >>= 26; + carry += (w / 67108864) | 0; + carry += lo >>> 26; + this.words[i2] = lo & 67108863; + } + if (carry !== 0) { + this.words[i2] = carry; + this.length++; + } + return isNegNum ? this.ineg() : this; + }; + BN3.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN3.prototype.sqr = function sqr() { + return this.mul(this); + }; + BN3.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN3.prototype.pow = function pow(num) { + var w = toBitArray(num); + if (w.length === 0) return new BN3(1); + var res = this; + for (var i2 = 0; i2 < w.length; i2++, res = res.sqr()) { + if (w[i2] !== 0) break; + } + if (++i2 < w.length) { + for (var q = res.sqr(); i2 < w.length; i2++, q = q.sqr()) { + if (w[i2] === 0) continue; + res = res.mul(q); + } + } + return res; + }; + BN3.prototype.iushln = function iushln(bits) { + assert2(typeof bits === 'number' && bits >= 0); + var r3 = bits % 26; + var s2 = (bits - r3) / 26; + var carryMask = (67108863 >>> (26 - r3)) << (26 - r3); + var i2; + if (r3 !== 0) { + var carry = 0; + for (i2 = 0; i2 < this.length; i2++) { + var newCarry = this.words[i2] & carryMask; + var c = ((this.words[i2] | 0) - newCarry) << r3; + this.words[i2] = c | carry; + carry = newCarry >>> (26 - r3); + } + if (carry) { + this.words[i2] = carry; + this.length++; + } + } + if (s2 !== 0) { + for (i2 = this.length - 1; i2 >= 0; i2--) { + this.words[i2 + s2] = this.words[i2]; + } + for (i2 = 0; i2 < s2; i2++) { + this.words[i2] = 0; + } + this.length += s2; + } + return this._strip(); + }; + BN3.prototype.ishln = function ishln(bits) { + assert2(this.negative === 0); + return this.iushln(bits); + }; + BN3.prototype.iushrn = function iushrn(bits, hint, extended) { + assert2(typeof bits === 'number' && bits >= 0); + var h; + if (hint) { + h = (hint - (hint % 26)) / 26; + } else { + h = 0; + } + var r3 = bits % 26; + var s2 = Math.min((bits - r3) / 26, this.length); + var mask = 67108863 ^ ((67108863 >>> r3) << r3); + var maskedWords = extended; + h -= s2; + h = Math.max(0, h); + if (maskedWords) { + for (var i2 = 0; i2 < s2; i2++) { + maskedWords.words[i2] = this.words[i2]; + } + maskedWords.length = s2; + } + if (s2 === 0) { + } else if (this.length > s2) { + this.length -= s2; + for (i2 = 0; i2 < this.length; i2++) { + this.words[i2] = this.words[i2 + s2]; + } + } else { + this.words[0] = 0; + this.length = 1; + } + var carry = 0; + for (i2 = this.length - 1; i2 >= 0 && (carry !== 0 || i2 >= h); i2--) { + var word = this.words[i2] | 0; + this.words[i2] = (carry << (26 - r3)) | (word >>> r3); + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if (this.length === 0) { + this.words[0] = 0; + this.length = 1; + } + return this._strip(); + }; + BN3.prototype.ishrn = function ishrn(bits, hint, extended) { + assert2(this.negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN3.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN3.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN3.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN3.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN3.prototype.testn = function testn(bit) { + assert2(typeof bit === 'number' && bit >= 0); + var r3 = bit % 26; + var s2 = (bit - r3) / 26; + var q = 1 << r3; + if (this.length <= s2) return false; + var w = this.words[s2]; + return !!(w & q); + }; + BN3.prototype.imaskn = function imaskn(bits) { + assert2(typeof bits === 'number' && bits >= 0); + var r3 = bits % 26; + var s2 = (bits - r3) / 26; + assert2(this.negative === 0, 'imaskn works only with positive numbers'); + if (this.length <= s2) { + return this; + } + if (r3 !== 0) { + s2++; + } + this.length = Math.min(s2, this.length); + if (r3 !== 0) { + var mask = 67108863 ^ ((67108863 >>> r3) << r3); + this.words[this.length - 1] &= mask; + } + return this._strip(); + }; + BN3.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN3.prototype.iaddn = function iaddn(num) { + assert2(typeof num === 'number'); + assert2(num < 67108864); + if (num < 0) return this.isubn(-num); + if (this.negative !== 0) { + if (this.length === 1 && (this.words[0] | 0) <= num) { + this.words[0] = num - (this.words[0] | 0); + this.negative = 0; + return this; + } + this.negative = 0; + this.isubn(num); + this.negative = 1; + return this; + } + return this._iaddn(num); + }; + BN3.prototype._iaddn = function _iaddn(num) { + this.words[0] += num; + for (var i2 = 0; i2 < this.length && this.words[i2] >= 67108864; i2++) { + this.words[i2] -= 67108864; + if (i2 === this.length - 1) { + this.words[i2 + 1] = 1; + } else { + this.words[i2 + 1]++; + } + } + this.length = Math.max(this.length, i2 + 1); + return this; + }; + BN3.prototype.isubn = function isubn(num) { + assert2(typeof num === 'number'); + assert2(num < 67108864); + if (num < 0) return this.iaddn(-num); + if (this.negative !== 0) { + this.negative = 0; + this.iaddn(num); + this.negative = 1; + return this; + } + this.words[0] -= num; + if (this.length === 1 && this.words[0] < 0) { + this.words[0] = -this.words[0]; + this.negative = 1; + } else { + for (var i2 = 0; i2 < this.length && this.words[i2] < 0; i2++) { + this.words[i2] += 67108864; + this.words[i2 + 1] -= 1; + } + } + return this._strip(); + }; + BN3.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN3.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN3.prototype.iabs = function iabs() { + this.negative = 0; + return this; + }; + BN3.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN3.prototype._ishlnsubmul = function _ishlnsubmul(num, mul3, shift) { + var len = num.length + shift; + var i2; + this._expand(len); + var w; + var carry = 0; + for (i2 = 0; i2 < num.length; i2++) { + w = (this.words[i2 + shift] | 0) + carry; + var right = (num.words[i2] | 0) * mul3; + w -= right & 67108863; + carry = (w >> 26) - ((right / 67108864) | 0); + this.words[i2 + shift] = w & 67108863; + } + for (; i2 < this.length - shift; i2++) { + w = (this.words[i2 + shift] | 0) + carry; + carry = w >> 26; + this.words[i2 + shift] = w & 67108863; + } + if (carry === 0) return this._strip(); + assert2(carry === -1); + carry = 0; + for (i2 = 0; i2 < this.length; i2++) { + w = -(this.words[i2] | 0) + carry; + carry = w >> 26; + this.words[i2] = w & 67108863; + } + this.negative = 1; + return this._strip(); + }; + BN3.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = this.length - num.length; + var a2 = this.clone(); + var b = num; + var bhi = b.words[b.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b = b.ushln(shift); + a2.iushln(shift); + bhi = b.words[b.length - 1] | 0; + } + var m = a2.length - b.length; + var q; + if (mode !== 'mod') { + q = new BN3(null); + q.length = m + 1; + q.words = new Array(q.length); + for (var i2 = 0; i2 < q.length; i2++) { + q.words[i2] = 0; + } + } + var diff = a2.clone()._ishlnsubmul(b, 1, m); + if (diff.negative === 0) { + a2 = diff; + if (q) { + q.words[m] = 1; + } + } + for (var j = m - 1; j >= 0; j--) { + var qj = + (a2.words[b.length + j] | 0) * 67108864 + + (a2.words[b.length + j - 1] | 0); + qj = Math.min((qj / bhi) | 0, 67108863); + a2._ishlnsubmul(b, qj, j); + while (a2.negative !== 0) { + qj--; + a2.negative = 0; + a2._ishlnsubmul(b, 1, j); + if (!a2.isZero()) { + a2.negative ^= 1; + } + } + if (q) { + q.words[j] = qj; + } + } + if (q) { + q._strip(); + } + a2._strip(); + if (mode !== 'div' && shift !== 0) { + a2.iushrn(shift); + } + return { + div: q || null, + mod: a2, + }; + }; + BN3.prototype.divmod = function divmod(num, mode, positive) { + assert2(!num.isZero()); + if (this.isZero()) { + return { + div: new BN3(0), + mod: new BN3(0), + }; + } + var div, mod, res; + if (this.negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== 'mod') { + div = res.div.neg(); + } + if (mode !== 'div') { + mod = res.mod.neg(); + if (positive && mod.negative !== 0) { + mod.iadd(num); + } + } + return { + div, + mod, + }; + } + if (this.negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== 'mod') { + div = res.div.neg(); + } + return { + div, + mod: res.mod, + }; + } + if ((this.negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== 'div') { + mod = res.mod.neg(); + if (positive && mod.negative !== 0) { + mod.isub(num); + } + } + return { + div: res.div, + mod, + }; + } + if (num.length > this.length || this.cmp(num) < 0) { + return { + div: new BN3(0), + mod: this, + }; + } + if (num.length === 1) { + if (mode === 'div') { + return { + div: this.divn(num.words[0]), + mod: null, + }; + } + if (mode === 'mod') { + return { + div: null, + mod: new BN3(this.modrn(num.words[0])), + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN3(this.modrn(num.words[0])), + }; + } + return this._wordDiv(num, mode); + }; + BN3.prototype.div = function div(num) { + return this.divmod(num, 'div', false).div; + }; + BN3.prototype.mod = function mod(num) { + return this.divmod(num, 'mod', false).mod; + }; + BN3.prototype.umod = function umod(num) { + return this.divmod(num, 'mod', true).mod; + }; + BN3.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) return dm.div; + var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod.cmp(half); + if (cmp < 0 || (r22 === 1 && cmp === 0)) return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN3.prototype.modrn = function modrn(num) { + var isNegNum = num < 0; + if (isNegNum) num = -num; + assert2(num <= 67108863); + var p = (1 << 26) % num; + var acc = 0; + for (var i2 = this.length - 1; i2 >= 0; i2--) { + acc = (p * acc + (this.words[i2] | 0)) % num; + } + return isNegNum ? -acc : acc; + }; + BN3.prototype.modn = function modn(num) { + return this.modrn(num); + }; + BN3.prototype.idivn = function idivn(num) { + var isNegNum = num < 0; + if (isNegNum) num = -num; + assert2(num <= 67108863); + var carry = 0; + for (var i2 = this.length - 1; i2 >= 0; i2--) { + var w = (this.words[i2] | 0) + carry * 67108864; + this.words[i2] = (w / num) | 0; + carry = w % num; + } + this._strip(); + return isNegNum ? this.ineg() : this; + }; + BN3.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN3.prototype.egcd = function egcd(p) { + assert2(p.negative === 0); + assert2(!p.isZero()); + var x = this; + var y = p.clone(); + if (x.negative !== 0) { + x = x.umod(p); + } else { + x = x.clone(); + } + var A2 = new BN3(1); + var B = new BN3(0); + var C = new BN3(0); + var D3 = new BN3(1); + var g = 0; + while (x.isEven() && y.isEven()) { + x.iushrn(1); + y.iushrn(1); + ++g; + } + var yp = y.clone(); + var xp = x.clone(); + while (!x.isZero()) { + for ( + var i2 = 0, im = 1; + (x.words[0] & im) === 0 && i2 < 26; + ++i2, im <<= 1 + ); + if (i2 > 0) { + x.iushrn(i2); + while (i2-- > 0) { + if (A2.isOdd() || B.isOdd()) { + A2.iadd(yp); + B.isub(xp); + } + A2.iushrn(1); + B.iushrn(1); + } + } + for ( + var j = 0, jm = 1; + (y.words[0] & jm) === 0 && j < 26; + ++j, jm <<= 1 + ); + if (j > 0) { + y.iushrn(j); + while (j-- > 0) { + if (C.isOdd() || D3.isOdd()) { + C.iadd(yp); + D3.isub(xp); + } + C.iushrn(1); + D3.iushrn(1); + } + } + if (x.cmp(y) >= 0) { + x.isub(y); + A2.isub(C); + B.isub(D3); + } else { + y.isub(x); + C.isub(A2); + D3.isub(B); + } + } + return { + a: C, + b: D3, + gcd: y.iushln(g), + }; + }; + BN3.prototype._invmp = function _invmp(p) { + assert2(p.negative === 0); + assert2(!p.isZero()); + var a2 = this; + var b = p.clone(); + if (a2.negative !== 0) { + a2 = a2.umod(p); + } else { + a2 = a2.clone(); + } + var x1 = new BN3(1); + var x2 = new BN3(0); + var delta = b.clone(); + while (a2.cmpn(1) > 0 && b.cmpn(1) > 0) { + for ( + var i2 = 0, im = 1; + (a2.words[0] & im) === 0 && i2 < 26; + ++i2, im <<= 1 + ); + if (i2 > 0) { + a2.iushrn(i2); + while (i2-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for ( + var j = 0, jm = 1; + (b.words[0] & jm) === 0 && j < 26; + ++j, jm <<= 1 + ); + if (j > 0) { + b.iushrn(j); + while (j-- > 0) { + if (x2.isOdd()) { + x2.iadd(delta); + } + x2.iushrn(1); + } + } + if (a2.cmp(b) >= 0) { + a2.isub(b); + x1.isub(x2); + } else { + b.isub(a2); + x2.isub(x1); + } + } + var res; + if (a2.cmpn(1) === 0) { + res = x1; + } else { + res = x2; + } + if (res.cmpn(0) < 0) { + res.iadd(p); + } + return res; + }; + BN3.prototype.gcd = function gcd(num) { + if (this.isZero()) return num.abs(); + if (num.isZero()) return this.abs(); + var a2 = this.clone(); + var b = num.clone(); + a2.negative = 0; + b.negative = 0; + for (var shift = 0; a2.isEven() && b.isEven(); shift++) { + a2.iushrn(1); + b.iushrn(1); + } + do { + while (a2.isEven()) { + a2.iushrn(1); + } + while (b.isEven()) { + b.iushrn(1); + } + var r3 = a2.cmp(b); + if (r3 < 0) { + var t2 = a2; + a2 = b; + b = t2; + } else if (r3 === 0 || b.cmpn(1) === 0) { + break; + } + a2.isub(b); + } while (true); + return b.iushln(shift); + }; + BN3.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN3.prototype.isEven = function isEven() { + return (this.words[0] & 1) === 0; + }; + BN3.prototype.isOdd = function isOdd() { + return (this.words[0] & 1) === 1; + }; + BN3.prototype.andln = function andln(num) { + return this.words[0] & num; + }; + BN3.prototype.bincn = function bincn(bit) { + assert2(typeof bit === 'number'); + var r3 = bit % 26; + var s2 = (bit - r3) / 26; + var q = 1 << r3; + if (this.length <= s2) { + this._expand(s2 + 1); + this.words[s2] |= q; + return this; + } + var carry = q; + for (var i2 = s2; carry !== 0 && i2 < this.length; i2++) { + var w = this.words[i2] | 0; + w += carry; + carry = w >>> 26; + w &= 67108863; + this.words[i2] = w; + } + if (carry !== 0) { + this.words[i2] = carry; + this.length++; + } + return this; + }; + BN3.prototype.isZero = function isZero() { + return this.length === 1 && this.words[0] === 0; + }; + BN3.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if (this.negative !== 0 && !negative) return -1; + if (this.negative === 0 && negative) return 1; + this._strip(); + var res; + if (this.length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert2(num <= 67108863, 'Number is too big'); + var w = this.words[0] | 0; + res = w === num ? 0 : w < num ? -1 : 1; + } + if (this.negative !== 0) return -res | 0; + return res; + }; + BN3.prototype.cmp = function cmp(num) { + if (this.negative !== 0 && num.negative === 0) return -1; + if (this.negative === 0 && num.negative !== 0) return 1; + var res = this.ucmp(num); + if (this.negative !== 0) return -res | 0; + return res; + }; + BN3.prototype.ucmp = function ucmp(num) { + if (this.length > num.length) return 1; + if (this.length < num.length) return -1; + var res = 0; + for (var i2 = this.length - 1; i2 >= 0; i2--) { + var a2 = this.words[i2] | 0; + var b = num.words[i2] | 0; + if (a2 === b) continue; + if (a2 < b) { + res = -1; + } else if (a2 > b) { + res = 1; + } + break; + } + return res; + }; + BN3.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN3.prototype.gt = function gt(num) { + return this.cmp(num) === 1; + }; + BN3.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN3.prototype.gte = function gte(num) { + return this.cmp(num) >= 0; + }; + BN3.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN3.prototype.lt = function lt(num) { + return this.cmp(num) === -1; + }; + BN3.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN3.prototype.lte = function lte(num) { + return this.cmp(num) <= 0; + }; + BN3.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN3.prototype.eq = function eq4(num) { + return this.cmp(num) === 0; + }; + BN3.red = function red(num) { + return new Red(num); + }; + BN3.prototype.toRed = function toRed(ctx) { + assert2(!this.red, 'Already a number in reduction context'); + assert2(this.negative === 0, 'red works only with positives'); + return ctx.convertTo(this)._forceRed(ctx); + }; + BN3.prototype.fromRed = function fromRed() { + assert2( + this.red, + 'fromRed works only with numbers in reduction context' + ); + return this.red.convertFrom(this); + }; + BN3.prototype._forceRed = function _forceRed(ctx) { + this.red = ctx; + return this; + }; + BN3.prototype.forceRed = function forceRed(ctx) { + assert2(!this.red, 'Already a number in reduction context'); + return this._forceRed(ctx); + }; + BN3.prototype.redAdd = function redAdd(num) { + assert2(this.red, 'redAdd works only with red numbers'); + return this.red.add(this, num); + }; + BN3.prototype.redIAdd = function redIAdd(num) { + assert2(this.red, 'redIAdd works only with red numbers'); + return this.red.iadd(this, num); + }; + BN3.prototype.redSub = function redSub(num) { + assert2(this.red, 'redSub works only with red numbers'); + return this.red.sub(this, num); + }; + BN3.prototype.redISub = function redISub(num) { + assert2(this.red, 'redISub works only with red numbers'); + return this.red.isub(this, num); + }; + BN3.prototype.redShl = function redShl(num) { + assert2(this.red, 'redShl works only with red numbers'); + return this.red.shl(this, num); + }; + BN3.prototype.redMul = function redMul(num) { + assert2(this.red, 'redMul works only with red numbers'); + this.red._verify2(this, num); + return this.red.mul(this, num); + }; + BN3.prototype.redIMul = function redIMul(num) { + assert2(this.red, 'redMul works only with red numbers'); + this.red._verify2(this, num); + return this.red.imul(this, num); + }; + BN3.prototype.redSqr = function redSqr() { + assert2(this.red, 'redSqr works only with red numbers'); + this.red._verify1(this); + return this.red.sqr(this); + }; + BN3.prototype.redISqr = function redISqr() { + assert2(this.red, 'redISqr works only with red numbers'); + this.red._verify1(this); + return this.red.isqr(this); + }; + BN3.prototype.redSqrt = function redSqrt() { + assert2(this.red, 'redSqrt works only with red numbers'); + this.red._verify1(this); + return this.red.sqrt(this); + }; + BN3.prototype.redInvm = function redInvm() { + assert2(this.red, 'redInvm works only with red numbers'); + this.red._verify1(this); + return this.red.invm(this); + }; + BN3.prototype.redNeg = function redNeg() { + assert2(this.red, 'redNeg works only with red numbers'); + this.red._verify1(this); + return this.red.neg(this); + }; + BN3.prototype.redPow = function redPow(num) { + assert2(this.red && !num.red, 'redPow(normalNum)'); + this.red._verify1(this); + return this.red.pow(this, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null, + }; + function MPrime(name, p) { + this.name = name; + this.p = new BN3(p, 16); + this.n = this.p.bitLength(); + this.k = new BN3(1).iushln(this.n).isub(this.p); + this.tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN3(null); + tmp.words = new Array(Math.ceil(this.n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r3 = num; + var rlen; + do { + this.split(r3, this.tmp); + r3 = this.imulK(r3); + r3 = r3.iadd(this.tmp); + rlen = r3.bitLength(); + } while (rlen > this.n); + var cmp = rlen < this.n ? -1 : r3.ucmp(this.p); + if (cmp === 0) { + r3.words[0] = 0; + r3.length = 1; + } else if (cmp > 0) { + r3.isub(this.p); + } else { + if (r3.strip !== void 0) { + r3.strip(); + } else { + r3._strip(); + } + } + return r3; + }; + MPrime.prototype.split = function split(input, out) { + input.iushrn(this.n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul(this.k); + }; + function K256() { + MPrime.call( + this, + 'k256', + 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f' + ); + } + inherits(K256, MPrime); + K256.prototype.split = function split(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i2 = 0; i2 < outLen; i2++) { + output.words[i2] = input.words[i2]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i2 = 10; i2 < input.length; i2++) { + var next = input.words[i2] | 0; + input.words[i2 - 10] = ((next & mask) << 4) | (prev >>> 22); + prev = next; + } + prev >>>= 22; + input.words[i2 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i2 = 0; i2 < num.length; i2++) { + var w = num.words[i2] | 0; + lo += w * 977; + num.words[i2] = lo & 67108863; + lo = w * 64 + ((lo / 67108864) | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call( + this, + 'p224', + 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001' + ); + } + inherits(P224, MPrime); + function P192() { + MPrime.call( + this, + 'p192', + 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff' + ); + } + inherits(P192, MPrime); + function P25519() { + MPrime.call( + this, + '25519', + '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed' + ); + } + inherits(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i2 = 0; i2 < num.length; i2++) { + var hi = (num.words[i2] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i2] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN3._prime = function prime(name) { + if (primes[name]) return primes[name]; + var prime2; + if (name === 'k256') { + prime2 = new K256(); + } else if (name === 'p224') { + prime2 = new P224(); + } else if (name === 'p192') { + prime2 = new P192(); + } else if (name === 'p25519') { + prime2 = new P25519(); + } else { + throw new Error('Unknown prime ' + name); + } + primes[name] = prime2; + return prime2; + }; + function Red(m) { + if (typeof m === 'string') { + var prime = BN3._prime(m); + this.m = prime.p; + this.prime = prime; + } else { + assert2(m.gtn(1), 'modulus must be greater than 1'); + this.m = m; + this.prime = null; + } + } + Red.prototype._verify1 = function _verify1(a2) { + assert2(a2.negative === 0, 'red works only with positives'); + assert2(a2.red, 'red works only with red numbers'); + }; + Red.prototype._verify2 = function _verify2(a2, b) { + assert2( + (a2.negative | b.negative) === 0, + 'red works only with positives' + ); + assert2(a2.red && a2.red === b.red, 'red works only with red numbers'); + }; + Red.prototype.imod = function imod(a2) { + if (this.prime) return this.prime.ireduce(a2)._forceRed(this); + move(a2, a2.umod(this.m)._forceRed(this)); + return a2; + }; + Red.prototype.neg = function neg3(a2) { + if (a2.isZero()) { + return a2.clone(); + } + return this.m.sub(a2)._forceRed(this); + }; + Red.prototype.add = function add5(a2, b) { + this._verify2(a2, b); + var res = a2.add(b); + if (res.cmp(this.m) >= 0) { + res.isub(this.m); + } + return res._forceRed(this); + }; + Red.prototype.iadd = function iadd(a2, b) { + this._verify2(a2, b); + var res = a2.iadd(b); + if (res.cmp(this.m) >= 0) { + res.isub(this.m); + } + return res; + }; + Red.prototype.sub = function sub(a2, b) { + this._verify2(a2, b); + var res = a2.sub(b); + if (res.cmpn(0) < 0) { + res.iadd(this.m); + } + return res._forceRed(this); + }; + Red.prototype.isub = function isub(a2, b) { + this._verify2(a2, b); + var res = a2.isub(b); + if (res.cmpn(0) < 0) { + res.iadd(this.m); + } + return res; + }; + Red.prototype.shl = function shl(a2, num) { + this._verify1(a2); + return this.imod(a2.ushln(num)); + }; + Red.prototype.imul = function imul(a2, b) { + this._verify2(a2, b); + return this.imod(a2.imul(b)); + }; + Red.prototype.mul = function mul3(a2, b) { + this._verify2(a2, b); + return this.imod(a2.mul(b)); + }; + Red.prototype.isqr = function isqr(a2) { + return this.imul(a2, a2.clone()); + }; + Red.prototype.sqr = function sqr(a2) { + return this.mul(a2, a2); + }; + Red.prototype.sqrt = function sqrt(a2) { + if (a2.isZero()) return a2.clone(); + var mod3 = this.m.andln(3); + assert2(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = this.m.add(new BN3(1)).iushrn(2); + return this.pow(a2, pow); + } + var q = this.m.subn(1); + var s2 = 0; + while (!q.isZero() && q.andln(1) === 0) { + s2++; + q.iushrn(1); + } + assert2(!q.isZero()); + var one = new BN3(1).toRed(this); + var nOne = one.redNeg(); + var lpow = this.m.subn(1).iushrn(1); + var z = this.m.bitLength(); + z = new BN3(2 * z * z).toRed(this); + while (this.pow(z, lpow).cmp(nOne) !== 0) { + z.redIAdd(nOne); + } + var c = this.pow(z, q); + var r3 = this.pow(a2, q.addn(1).iushrn(1)); + var t2 = this.pow(a2, q); + var m = s2; + while (t2.cmp(one) !== 0) { + var tmp = t2; + for (var i2 = 0; tmp.cmp(one) !== 0; i2++) { + tmp = tmp.redSqr(); + } + assert2(i2 < m); + var b = this.pow(c, new BN3(1).iushln(m - i2 - 1)); + r3 = r3.redMul(b); + c = b.redSqr(); + t2 = t2.redMul(c); + m = i2; + } + return r3; + }; + Red.prototype.invm = function invm(a2) { + var inv = a2._invmp(this.m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a2, num) { + if (num.isZero()) return new BN3(1).toRed(this); + if (num.cmpn(1) === 0) return a2.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN3(1).toRed(this); + wnd[1] = a2; + for (var i2 = 2; i2 < wnd.length; i2++) { + wnd[i2] = this.mul(wnd[i2 - 1], a2); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i2 = num.length - 1; i2 >= 0; i2--) { + var word = num.words[i2]; + for (var j = start - 1; j >= 0; j--) { + var bit = (word >> j) & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i2 !== 0 || j !== 0)) continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r3 = num.umod(this.m); + return r3 === num ? r3.clone() : r3; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN3.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m) { + Red.call(this, m); + this.shift = this.m.bitLength(); + if (this.shift % 26 !== 0) { + this.shift += 26 - (this.shift % 26); + } + this.r = new BN3(1).iushln(this.shift); + this.r2 = this.imod(this.r.sqr()); + this.rinv = this.r._invmp(this.m); + this.minv = this.rinv.mul(this.r).isubn(1).div(this.m); + this.minv = this.minv.umod(this.r); + this.minv = this.r.sub(this.minv); + } + inherits(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln(this.shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r3 = this.imod(num.mul(this.rinv)); + r3.red = null; + return r3; + }; + Mont.prototype.imul = function imul(a2, b) { + if (a2.isZero() || b.isZero()) { + a2.words[0] = 0; + a2.length = 1; + return a2; + } + var t2 = a2.imul(b); + var c = t2 + .maskn(this.shift) + .mul(this.minv) + .imaskn(this.shift) + .mul(this.m); + var u = t2.isub(c).iushrn(this.shift); + var res = u; + if (u.cmp(this.m) >= 0) { + res = u.isub(this.m); + } else if (u.cmpn(0) < 0) { + res = u.iadd(this.m); + } + return res._forceRed(this); + }; + Mont.prototype.mul = function mul3(a2, b) { + if (a2.isZero() || b.isZero()) return new BN3(0)._forceRed(this); + var t2 = a2.mul(b); + var c = t2 + .maskn(this.shift) + .mul(this.minv) + .imaskn(this.shift) + .mul(this.m); + var u = t2.isub(c).iushrn(this.shift); + var res = u; + if (u.cmp(this.m) >= 0) { + res = u.isub(this.m); + } else if (u.cmpn(0) < 0) { + res = u.iadd(this.m); + } + return res._forceRed(this); + }; + Mont.prototype.invm = function invm(a2) { + var res = this.imod(a2._invmp(this.m).mul(this.r2)); + return res._forceRed(this); + }; + })(typeof module2 === 'undefined' || module2, exports); + }, +}); + +// node_modules/minimalistic-assert/index.js +var require_minimalistic_assert = __commonJS({ + 'node_modules/minimalistic-assert/index.js'(exports, module2) { + init_shim(); + module2.exports = assert2; + function assert2(val, msg) { + if (!val) throw new Error(msg || 'Assertion failed'); + } + assert2.equal = function assertEqual2(l2, r3, msg) { + if (l2 != r3) + throw new Error(msg || 'Assertion failed: ' + l2 + ' != ' + r3); + }; + }, +}); + +// node_modules/inherits/inherits_browser.js +var require_inherits_browser = __commonJS({ + 'node_modules/inherits/inherits_browser.js'(exports, module2) { + init_shim(); + if (typeof Object.create === 'function') { + module2.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true, + }, + }); + } + }; + } else { + module2.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + var TempCtor = function () {}; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + }; + } + }, +}); + +// node_modules/inherits/inherits.js +var require_inherits = __commonJS({ + 'node_modules/inherits/inherits.js'(exports, module2) { + init_shim(); + try { + util = __require('util'); + if (typeof util.inherits !== 'function') throw ''; + module2.exports = util.inherits; + } catch (e2) { + module2.exports = require_inherits_browser(); + } + var util; + }, +}); + +// node_modules/hash.js/lib/hash/utils.js +var require_utils = __commonJS({ + 'node_modules/hash.js/lib/hash/utils.js'(exports) { + 'use strict'; + init_shim(); + var assert2 = require_minimalistic_assert(); + var inherits = require_inherits(); + exports.inherits = inherits; + function isSurrogatePair(msg, i2) { + if ((msg.charCodeAt(i2) & 64512) !== 55296) { + return false; + } + if (i2 < 0 || i2 + 1 >= msg.length) { + return false; + } + return (msg.charCodeAt(i2 + 1) & 64512) === 56320; + } + function toArray(msg, enc) { + if (Array.isArray(msg)) return msg.slice(); + if (!msg) return []; + var res = []; + if (typeof msg === 'string') { + if (!enc) { + var p = 0; + for (var i2 = 0; i2 < msg.length; i2++) { + var c = msg.charCodeAt(i2); + if (c < 128) { + res[p++] = c; + } else if (c < 2048) { + res[p++] = (c >> 6) | 192; + res[p++] = (c & 63) | 128; + } else if (isSurrogatePair(msg, i2)) { + c = 65536 + ((c & 1023) << 10) + (msg.charCodeAt(++i2) & 1023); + res[p++] = (c >> 18) | 240; + res[p++] = ((c >> 12) & 63) | 128; + res[p++] = ((c >> 6) & 63) | 128; + res[p++] = (c & 63) | 128; + } else { + res[p++] = (c >> 12) | 224; + res[p++] = ((c >> 6) & 63) | 128; + res[p++] = (c & 63) | 128; + } + } + } else if (enc === 'hex') { + msg = msg.replace(/[^a-z0-9]+/gi, ''); + if (msg.length % 2 !== 0) msg = '0' + msg; + for (i2 = 0; i2 < msg.length; i2 += 2) + res.push(parseInt(msg[i2] + msg[i2 + 1], 16)); + } + } else { + for (i2 = 0; i2 < msg.length; i2++) res[i2] = msg[i2] | 0; + } + return res; + } + exports.toArray = toArray; + function toHex2(msg) { + var res = ''; + for (var i2 = 0; i2 < msg.length; i2++) + res += zero2(msg[i2].toString(16)); + return res; + } + exports.toHex = toHex2; + function htonl(w) { + var res = + (w >>> 24) | + ((w >>> 8) & 65280) | + ((w << 8) & 16711680) | + ((w & 255) << 24); + return res >>> 0; + } + exports.htonl = htonl; + function toHex32(msg, endian) { + var res = ''; + for (var i2 = 0; i2 < msg.length; i2++) { + var w = msg[i2]; + if (endian === 'little') w = htonl(w); + res += zero8(w.toString(16)); + } + return res; + } + exports.toHex32 = toHex32; + function zero2(word) { + if (word.length === 1) return '0' + word; + else return word; + } + exports.zero2 = zero2; + function zero8(word) { + if (word.length === 7) return '0' + word; + else if (word.length === 6) return '00' + word; + else if (word.length === 5) return '000' + word; + else if (word.length === 4) return '0000' + word; + else if (word.length === 3) return '00000' + word; + else if (word.length === 2) return '000000' + word; + else if (word.length === 1) return '0000000' + word; + else return word; + } + exports.zero8 = zero8; + function join32(msg, start, end, endian) { + var len = end - start; + assert2(len % 4 === 0); + var res = new Array(len / 4); + for (var i2 = 0, k = start; i2 < res.length; i2++, k += 4) { + var w; + if (endian === 'big') + w = + (msg[k] << 24) | + (msg[k + 1] << 16) | + (msg[k + 2] << 8) | + msg[k + 3]; + else + w = + (msg[k + 3] << 24) | + (msg[k + 2] << 16) | + (msg[k + 1] << 8) | + msg[k]; + res[i2] = w >>> 0; + } + return res; + } + exports.join32 = join32; + function split32(msg, endian) { + var res = new Array(msg.length * 4); + for (var i2 = 0, k = 0; i2 < msg.length; i2++, k += 4) { + var m = msg[i2]; + if (endian === 'big') { + res[k] = m >>> 24; + res[k + 1] = (m >>> 16) & 255; + res[k + 2] = (m >>> 8) & 255; + res[k + 3] = m & 255; + } else { + res[k + 3] = m >>> 24; + res[k + 2] = (m >>> 16) & 255; + res[k + 1] = (m >>> 8) & 255; + res[k] = m & 255; + } + } + return res; + } + exports.split32 = split32; + function rotr32(w, b) { + return (w >>> b) | (w << (32 - b)); + } + exports.rotr32 = rotr32; + function rotl32(w, b) { + return (w << b) | (w >>> (32 - b)); + } + exports.rotl32 = rotl32; + function sum32(a2, b) { + return (a2 + b) >>> 0; + } + exports.sum32 = sum32; + function sum32_3(a2, b, c) { + return (a2 + b + c) >>> 0; + } + exports.sum32_3 = sum32_3; + function sum32_4(a2, b, c, d) { + return (a2 + b + c + d) >>> 0; + } + exports.sum32_4 = sum32_4; + function sum32_5(a2, b, c, d, e2) { + return (a2 + b + c + d + e2) >>> 0; + } + exports.sum32_5 = sum32_5; + function sum64(buf, pos, ah, al) { + var bh = buf[pos]; + var bl = buf[pos + 1]; + var lo = (al + bl) >>> 0; + var hi = (lo < al ? 1 : 0) + ah + bh; + buf[pos] = hi >>> 0; + buf[pos + 1] = lo; + } + exports.sum64 = sum64; + function sum64_hi(ah, al, bh, bl) { + var lo = (al + bl) >>> 0; + var hi = (lo < al ? 1 : 0) + ah + bh; + return hi >>> 0; + } + exports.sum64_hi = sum64_hi; + function sum64_lo(ah, al, bh, bl) { + var lo = al + bl; + return lo >>> 0; + } + exports.sum64_lo = sum64_lo; + function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) { + var carry = 0; + var lo = al; + lo = (lo + bl) >>> 0; + carry += lo < al ? 1 : 0; + lo = (lo + cl) >>> 0; + carry += lo < cl ? 1 : 0; + lo = (lo + dl) >>> 0; + carry += lo < dl ? 1 : 0; + var hi = ah + bh + ch + dh + carry; + return hi >>> 0; + } + exports.sum64_4_hi = sum64_4_hi; + function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) { + var lo = al + bl + cl + dl; + return lo >>> 0; + } + exports.sum64_4_lo = sum64_4_lo; + function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { + var carry = 0; + var lo = al; + lo = (lo + bl) >>> 0; + carry += lo < al ? 1 : 0; + lo = (lo + cl) >>> 0; + carry += lo < cl ? 1 : 0; + lo = (lo + dl) >>> 0; + carry += lo < dl ? 1 : 0; + lo = (lo + el) >>> 0; + carry += lo < el ? 1 : 0; + var hi = ah + bh + ch + dh + eh + carry; + return hi >>> 0; + } + exports.sum64_5_hi = sum64_5_hi; + function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { + var lo = al + bl + cl + dl + el; + return lo >>> 0; + } + exports.sum64_5_lo = sum64_5_lo; + function rotr64_hi(ah, al, num) { + var r3 = (al << (32 - num)) | (ah >>> num); + return r3 >>> 0; + } + exports.rotr64_hi = rotr64_hi; + function rotr64_lo(ah, al, num) { + var r3 = (ah << (32 - num)) | (al >>> num); + return r3 >>> 0; + } + exports.rotr64_lo = rotr64_lo; + function shr64_hi(ah, al, num) { + return ah >>> num; + } + exports.shr64_hi = shr64_hi; + function shr64_lo(ah, al, num) { + var r3 = (ah << (32 - num)) | (al >>> num); + return r3 >>> 0; + } + exports.shr64_lo = shr64_lo; + }, +}); + +// node_modules/hash.js/lib/hash/common.js +var require_common = __commonJS({ + 'node_modules/hash.js/lib/hash/common.js'(exports) { + 'use strict'; + init_shim(); + var utils = require_utils(); + var assert2 = require_minimalistic_assert(); + function BlockHash() { + this.pending = null; + this.pendingTotal = 0; + this.blockSize = this.constructor.blockSize; + this.outSize = this.constructor.outSize; + this.hmacStrength = this.constructor.hmacStrength; + this.padLength = this.constructor.padLength / 8; + this.endian = 'big'; + this._delta8 = this.blockSize / 8; + this._delta32 = this.blockSize / 32; + } + exports.BlockHash = BlockHash; + BlockHash.prototype.update = function update2(msg, enc) { + msg = utils.toArray(msg, enc); + if (!this.pending) this.pending = msg; + else this.pending = this.pending.concat(msg); + this.pendingTotal += msg.length; + if (this.pending.length >= this._delta8) { + msg = this.pending; + var r3 = msg.length % this._delta8; + this.pending = msg.slice(msg.length - r3, msg.length); + if (this.pending.length === 0) this.pending = null; + msg = utils.join32(msg, 0, msg.length - r3, this.endian); + for (var i2 = 0; i2 < msg.length; i2 += this._delta32) + this._update(msg, i2, i2 + this._delta32); + } + return this; + }; + BlockHash.prototype.digest = function digest(enc) { + this.update(this._pad()); + assert2(this.pending === null); + return this._digest(enc); + }; + BlockHash.prototype._pad = function pad() { + var len = this.pendingTotal; + var bytes = this._delta8; + var k = bytes - ((len + this.padLength) % bytes); + var res = new Array(k + this.padLength); + res[0] = 128; + for (var i2 = 1; i2 < k; i2++) res[i2] = 0; + len <<= 3; + if (this.endian === 'big') { + for (var t2 = 8; t2 < this.padLength; t2++) res[i2++] = 0; + res[i2++] = 0; + res[i2++] = 0; + res[i2++] = 0; + res[i2++] = 0; + res[i2++] = (len >>> 24) & 255; + res[i2++] = (len >>> 16) & 255; + res[i2++] = (len >>> 8) & 255; + res[i2++] = len & 255; + } else { + res[i2++] = len & 255; + res[i2++] = (len >>> 8) & 255; + res[i2++] = (len >>> 16) & 255; + res[i2++] = (len >>> 24) & 255; + res[i2++] = 0; + res[i2++] = 0; + res[i2++] = 0; + res[i2++] = 0; + for (t2 = 8; t2 < this.padLength; t2++) res[i2++] = 0; + } + return res; + }; + }, +}); + +// node_modules/hash.js/lib/hash/sha/common.js +var require_common2 = __commonJS({ + 'node_modules/hash.js/lib/hash/sha/common.js'(exports) { + 'use strict'; + init_shim(); + var utils = require_utils(); + var rotr32 = utils.rotr32; + function ft_1(s2, x, y, z) { + if (s2 === 0) return ch32(x, y, z); + if (s2 === 1 || s2 === 3) return p32(x, y, z); + if (s2 === 2) return maj32(x, y, z); + } + exports.ft_1 = ft_1; + function ch32(x, y, z) { + return (x & y) ^ (~x & z); + } + exports.ch32 = ch32; + function maj32(x, y, z) { + return (x & y) ^ (x & z) ^ (y & z); + } + exports.maj32 = maj32; + function p32(x, y, z) { + return x ^ y ^ z; + } + exports.p32 = p32; + function s0_256(x) { + return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22); + } + exports.s0_256 = s0_256; + function s1_256(x) { + return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25); + } + exports.s1_256 = s1_256; + function g0_256(x) { + return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3); + } + exports.g0_256 = g0_256; + function g1_256(x) { + return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10); + } + exports.g1_256 = g1_256; + }, +}); + +// node_modules/hash.js/lib/hash/sha/1.js +var require__ = __commonJS({ + 'node_modules/hash.js/lib/hash/sha/1.js'(exports, module2) { + 'use strict'; + init_shim(); + var utils = require_utils(); + var common = require_common(); + var shaCommon = require_common2(); + var rotl32 = utils.rotl32; + var sum32 = utils.sum32; + var sum32_5 = utils.sum32_5; + var ft_1 = shaCommon.ft_1; + var BlockHash = common.BlockHash; + var sha1_K = [1518500249, 1859775393, 2400959708, 3395469782]; + function SHA1() { + if (!(this instanceof SHA1)) return new SHA1(); + BlockHash.call(this); + this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]; + this.W = new Array(80); + } + utils.inherits(SHA1, BlockHash); + module2.exports = SHA1; + SHA1.blockSize = 512; + SHA1.outSize = 160; + SHA1.hmacStrength = 80; + SHA1.padLength = 64; + SHA1.prototype._update = function _update(msg, start) { + var W = this.W; + for (var i2 = 0; i2 < 16; i2++) W[i2] = msg[start + i2]; + for (; i2 < W.length; i2++) + W[i2] = rotl32(W[i2 - 3] ^ W[i2 - 8] ^ W[i2 - 14] ^ W[i2 - 16], 1); + var a2 = this.h[0]; + var b = this.h[1]; + var c = this.h[2]; + var d = this.h[3]; + var e2 = this.h[4]; + for (i2 = 0; i2 < W.length; i2++) { + var s2 = ~~(i2 / 20); + var t2 = sum32_5( + rotl32(a2, 5), + ft_1(s2, b, c, d), + e2, + W[i2], + sha1_K[s2] + ); + e2 = d; + d = c; + c = rotl32(b, 30); + b = a2; + a2 = t2; + } + this.h[0] = sum32(this.h[0], a2); + this.h[1] = sum32(this.h[1], b); + this.h[2] = sum32(this.h[2], c); + this.h[3] = sum32(this.h[3], d); + this.h[4] = sum32(this.h[4], e2); + }; + SHA1.prototype._digest = function digest(enc) { + if (enc === 'hex') return utils.toHex32(this.h, 'big'); + else return utils.split32(this.h, 'big'); + }; + }, +}); + +// node_modules/hash.js/lib/hash/sha/256.js +var require__2 = __commonJS({ + 'node_modules/hash.js/lib/hash/sha/256.js'(exports, module2) { + 'use strict'; + init_shim(); + var utils = require_utils(); + var common = require_common(); + var shaCommon = require_common2(); + var assert2 = require_minimalistic_assert(); + var sum32 = utils.sum32; + var sum32_4 = utils.sum32_4; + var sum32_5 = utils.sum32_5; + var ch32 = shaCommon.ch32; + var maj32 = shaCommon.maj32; + var s0_256 = shaCommon.s0_256; + var s1_256 = shaCommon.s1_256; + var g0_256 = shaCommon.g0_256; + var g1_256 = shaCommon.g1_256; + var BlockHash = common.BlockHash; + var sha256_K = [ + 1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, + 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, + 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, + 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, + 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, + 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, + 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, + 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, + 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, + 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, + 2428436474, 2756734187, 3204031479, 3329325298, + ]; + function SHA256() { + if (!(this instanceof SHA256)) return new SHA256(); + BlockHash.call(this); + this.h = [ + 1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, + 528734635, 1541459225, + ]; + this.k = sha256_K; + this.W = new Array(64); + } + utils.inherits(SHA256, BlockHash); + module2.exports = SHA256; + SHA256.blockSize = 512; + SHA256.outSize = 256; + SHA256.hmacStrength = 192; + SHA256.padLength = 64; + SHA256.prototype._update = function _update(msg, start) { + var W = this.W; + for (var i2 = 0; i2 < 16; i2++) W[i2] = msg[start + i2]; + for (; i2 < W.length; i2++) + W[i2] = sum32_4( + g1_256(W[i2 - 2]), + W[i2 - 7], + g0_256(W[i2 - 15]), + W[i2 - 16] + ); + var a2 = this.h[0]; + var b = this.h[1]; + var c = this.h[2]; + var d = this.h[3]; + var e2 = this.h[4]; + var f = this.h[5]; + var g = this.h[6]; + var h = this.h[7]; + assert2(this.k.length === W.length); + for (i2 = 0; i2 < W.length; i2++) { + var T1 = sum32_5(h, s1_256(e2), ch32(e2, f, g), this.k[i2], W[i2]); + var T2 = sum32(s0_256(a2), maj32(a2, b, c)); + h = g; + g = f; + f = e2; + e2 = sum32(d, T1); + d = c; + c = b; + b = a2; + a2 = sum32(T1, T2); + } + this.h[0] = sum32(this.h[0], a2); + this.h[1] = sum32(this.h[1], b); + this.h[2] = sum32(this.h[2], c); + this.h[3] = sum32(this.h[3], d); + this.h[4] = sum32(this.h[4], e2); + this.h[5] = sum32(this.h[5], f); + this.h[6] = sum32(this.h[6], g); + this.h[7] = sum32(this.h[7], h); + }; + SHA256.prototype._digest = function digest(enc) { + if (enc === 'hex') return utils.toHex32(this.h, 'big'); + else return utils.split32(this.h, 'big'); + }; + }, +}); + +// node_modules/hash.js/lib/hash/sha/224.js +var require__3 = __commonJS({ + 'node_modules/hash.js/lib/hash/sha/224.js'(exports, module2) { + 'use strict'; + init_shim(); + var utils = require_utils(); + var SHA256 = require__2(); + function SHA224() { + if (!(this instanceof SHA224)) return new SHA224(); + SHA256.call(this); + this.h = [ + 3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, + 1694076839, 3204075428, + ]; + } + utils.inherits(SHA224, SHA256); + module2.exports = SHA224; + SHA224.blockSize = 512; + SHA224.outSize = 224; + SHA224.hmacStrength = 192; + SHA224.padLength = 64; + SHA224.prototype._digest = function digest(enc) { + if (enc === 'hex') return utils.toHex32(this.h.slice(0, 7), 'big'); + else return utils.split32(this.h.slice(0, 7), 'big'); + }; + }, +}); + +// node_modules/hash.js/lib/hash/sha/512.js +var require__4 = __commonJS({ + 'node_modules/hash.js/lib/hash/sha/512.js'(exports, module2) { + 'use strict'; + init_shim(); + var utils = require_utils(); + var common = require_common(); + var assert2 = require_minimalistic_assert(); + var rotr64_hi = utils.rotr64_hi; + var rotr64_lo = utils.rotr64_lo; + var shr64_hi = utils.shr64_hi; + var shr64_lo = utils.shr64_lo; + var sum64 = utils.sum64; + var sum64_hi = utils.sum64_hi; + var sum64_lo = utils.sum64_lo; + var sum64_4_hi = utils.sum64_4_hi; + var sum64_4_lo = utils.sum64_4_lo; + var sum64_5_hi = utils.sum64_5_hi; + var sum64_5_lo = utils.sum64_5_lo; + var BlockHash = common.BlockHash; + var sha512_K = [ + 1116352408, 3609767458, 1899447441, 602891725, 3049323471, 3964484399, + 3921009573, 2173295548, 961987163, 4081628472, 1508970993, 3053834265, + 2453635748, 2937671579, 2870763221, 3664609560, 3624381080, 2734883394, + 310598401, 1164996542, 607225278, 1323610764, 1426881987, 3590304994, + 1925078388, 4068182383, 2162078206, 991336113, 2614888103, 633803317, + 3248222580, 3479774868, 3835390401, 2666613458, 4022224774, 944711139, + 264347078, 2341262773, 604807628, 2007800933, 770255983, 1495990901, + 1249150122, 1856431235, 1555081692, 3175218132, 1996064986, 2198950837, + 2554220882, 3999719339, 2821834349, 766784016, 2952996808, 2566594879, + 3210313671, 3203337956, 3336571891, 1034457026, 3584528711, 2466948901, + 113926993, 3758326383, 338241895, 168717936, 666307205, 1188179964, + 773529912, 1546045734, 1294757372, 1522805485, 1396182291, 2643833823, + 1695183700, 2343527390, 1986661051, 1014477480, 2177026350, 1206759142, + 2456956037, 344077627, 2730485921, 1290863460, 2820302411, 3158454273, + 3259730800, 3505952657, 3345764771, 106217008, 3516065817, 3606008344, + 3600352804, 1432725776, 4094571909, 1467031594, 275423344, 851169720, + 430227734, 3100823752, 506948616, 1363258195, 659060556, 3750685593, + 883997877, 3785050280, 958139571, 3318307427, 1322822218, 3812723403, + 1537002063, 2003034995, 1747873779, 3602036899, 1955562222, 1575990012, + 2024104815, 1125592928, 2227730452, 2716904306, 2361852424, 442776044, + 2428436474, 593698344, 2756734187, 3733110249, 3204031479, 2999351573, + 3329325298, 3815920427, 3391569614, 3928383900, 3515267271, 566280711, + 3940187606, 3454069534, 4118630271, 4000239992, 116418474, 1914138554, + 174292421, 2731055270, 289380356, 3203993006, 460393269, 320620315, + 685471733, 587496836, 852142971, 1086792851, 1017036298, 365543100, + 1126000580, 2618297676, 1288033470, 3409855158, 1501505948, 4234509866, + 1607167915, 987167468, 1816402316, 1246189591, + ]; + function SHA512() { + if (!(this instanceof SHA512)) return new SHA512(); + BlockHash.call(this); + this.h = [ + 1779033703, 4089235720, 3144134277, 2227873595, 1013904242, 4271175723, + 2773480762, 1595750129, 1359893119, 2917565137, 2600822924, 725511199, + 528734635, 4215389547, 1541459225, 327033209, + ]; + this.k = sha512_K; + this.W = new Array(160); + } + utils.inherits(SHA512, BlockHash); + module2.exports = SHA512; + SHA512.blockSize = 1024; + SHA512.outSize = 512; + SHA512.hmacStrength = 192; + SHA512.padLength = 128; + SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) { + var W = this.W; + for (var i2 = 0; i2 < 32; i2++) W[i2] = msg[start + i2]; + for (; i2 < W.length; i2 += 2) { + var c0_hi = g1_512_hi(W[i2 - 4], W[i2 - 3]); + var c0_lo = g1_512_lo(W[i2 - 4], W[i2 - 3]); + var c1_hi = W[i2 - 14]; + var c1_lo = W[i2 - 13]; + var c2_hi = g0_512_hi(W[i2 - 30], W[i2 - 29]); + var c2_lo = g0_512_lo(W[i2 - 30], W[i2 - 29]); + var c3_hi = W[i2 - 32]; + var c3_lo = W[i2 - 31]; + W[i2] = sum64_4_hi( + c0_hi, + c0_lo, + c1_hi, + c1_lo, + c2_hi, + c2_lo, + c3_hi, + c3_lo + ); + W[i2 + 1] = sum64_4_lo( + c0_hi, + c0_lo, + c1_hi, + c1_lo, + c2_hi, + c2_lo, + c3_hi, + c3_lo + ); + } + }; + SHA512.prototype._update = function _update(msg, start) { + this._prepareBlock(msg, start); + var W = this.W; + var ah = this.h[0]; + var al = this.h[1]; + var bh = this.h[2]; + var bl = this.h[3]; + var ch = this.h[4]; + var cl = this.h[5]; + var dh = this.h[6]; + var dl = this.h[7]; + var eh = this.h[8]; + var el = this.h[9]; + var fh = this.h[10]; + var fl = this.h[11]; + var gh = this.h[12]; + var gl = this.h[13]; + var hh = this.h[14]; + var hl = this.h[15]; + assert2(this.k.length === W.length); + for (var i2 = 0; i2 < W.length; i2 += 2) { + var c0_hi = hh; + var c0_lo = hl; + var c1_hi = s1_512_hi(eh, el); + var c1_lo = s1_512_lo(eh, el); + var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl); + var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl); + var c3_hi = this.k[i2]; + var c3_lo = this.k[i2 + 1]; + var c4_hi = W[i2]; + var c4_lo = W[i2 + 1]; + var T1_hi = sum64_5_hi( + c0_hi, + c0_lo, + c1_hi, + c1_lo, + c2_hi, + c2_lo, + c3_hi, + c3_lo, + c4_hi, + c4_lo + ); + var T1_lo = sum64_5_lo( + c0_hi, + c0_lo, + c1_hi, + c1_lo, + c2_hi, + c2_lo, + c3_hi, + c3_lo, + c4_hi, + c4_lo + ); + c0_hi = s0_512_hi(ah, al); + c0_lo = s0_512_lo(ah, al); + c1_hi = maj64_hi(ah, al, bh, bl, ch, cl); + c1_lo = maj64_lo(ah, al, bh, bl, ch, cl); + var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo); + var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo); + hh = gh; + hl = gl; + gh = fh; + gl = fl; + fh = eh; + fl = el; + eh = sum64_hi(dh, dl, T1_hi, T1_lo); + el = sum64_lo(dl, dl, T1_hi, T1_lo); + dh = ch; + dl = cl; + ch = bh; + cl = bl; + bh = ah; + bl = al; + ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo); + al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo); + } + sum64(this.h, 0, ah, al); + sum64(this.h, 2, bh, bl); + sum64(this.h, 4, ch, cl); + sum64(this.h, 6, dh, dl); + sum64(this.h, 8, eh, el); + sum64(this.h, 10, fh, fl); + sum64(this.h, 12, gh, gl); + sum64(this.h, 14, hh, hl); + }; + SHA512.prototype._digest = function digest(enc) { + if (enc === 'hex') return utils.toHex32(this.h, 'big'); + else return utils.split32(this.h, 'big'); + }; + function ch64_hi(xh, xl, yh, yl, zh) { + var r3 = (xh & yh) ^ (~xh & zh); + if (r3 < 0) r3 += 4294967296; + return r3; + } + function ch64_lo(xh, xl, yh, yl, zh, zl) { + var r3 = (xl & yl) ^ (~xl & zl); + if (r3 < 0) r3 += 4294967296; + return r3; + } + function maj64_hi(xh, xl, yh, yl, zh) { + var r3 = (xh & yh) ^ (xh & zh) ^ (yh & zh); + if (r3 < 0) r3 += 4294967296; + return r3; + } + function maj64_lo(xh, xl, yh, yl, zh, zl) { + var r3 = (xl & yl) ^ (xl & zl) ^ (yl & zl); + if (r3 < 0) r3 += 4294967296; + return r3; + } + function s0_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 28); + var c1_hi = rotr64_hi(xl, xh, 2); + var c2_hi = rotr64_hi(xl, xh, 7); + var r3 = c0_hi ^ c1_hi ^ c2_hi; + if (r3 < 0) r3 += 4294967296; + return r3; + } + function s0_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 28); + var c1_lo = rotr64_lo(xl, xh, 2); + var c2_lo = rotr64_lo(xl, xh, 7); + var r3 = c0_lo ^ c1_lo ^ c2_lo; + if (r3 < 0) r3 += 4294967296; + return r3; + } + function s1_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 14); + var c1_hi = rotr64_hi(xh, xl, 18); + var c2_hi = rotr64_hi(xl, xh, 9); + var r3 = c0_hi ^ c1_hi ^ c2_hi; + if (r3 < 0) r3 += 4294967296; + return r3; + } + function s1_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 14); + var c1_lo = rotr64_lo(xh, xl, 18); + var c2_lo = rotr64_lo(xl, xh, 9); + var r3 = c0_lo ^ c1_lo ^ c2_lo; + if (r3 < 0) r3 += 4294967296; + return r3; + } + function g0_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 1); + var c1_hi = rotr64_hi(xh, xl, 8); + var c2_hi = shr64_hi(xh, xl, 7); + var r3 = c0_hi ^ c1_hi ^ c2_hi; + if (r3 < 0) r3 += 4294967296; + return r3; + } + function g0_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 1); + var c1_lo = rotr64_lo(xh, xl, 8); + var c2_lo = shr64_lo(xh, xl, 7); + var r3 = c0_lo ^ c1_lo ^ c2_lo; + if (r3 < 0) r3 += 4294967296; + return r3; + } + function g1_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 19); + var c1_hi = rotr64_hi(xl, xh, 29); + var c2_hi = shr64_hi(xh, xl, 6); + var r3 = c0_hi ^ c1_hi ^ c2_hi; + if (r3 < 0) r3 += 4294967296; + return r3; + } + function g1_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 19); + var c1_lo = rotr64_lo(xl, xh, 29); + var c2_lo = shr64_lo(xh, xl, 6); + var r3 = c0_lo ^ c1_lo ^ c2_lo; + if (r3 < 0) r3 += 4294967296; + return r3; + } + }, +}); + +// node_modules/hash.js/lib/hash/sha/384.js +var require__5 = __commonJS({ + 'node_modules/hash.js/lib/hash/sha/384.js'(exports, module2) { + 'use strict'; + init_shim(); + var utils = require_utils(); + var SHA512 = require__4(); + function SHA384() { + if (!(this instanceof SHA384)) return new SHA384(); + SHA512.call(this); + this.h = [ + 3418070365, 3238371032, 1654270250, 914150663, 2438529370, 812702999, + 355462360, 4144912697, 1731405415, 4290775857, 2394180231, 1750603025, + 3675008525, 1694076839, 1203062813, 3204075428, + ]; + } + utils.inherits(SHA384, SHA512); + module2.exports = SHA384; + SHA384.blockSize = 1024; + SHA384.outSize = 384; + SHA384.hmacStrength = 192; + SHA384.padLength = 128; + SHA384.prototype._digest = function digest(enc) { + if (enc === 'hex') return utils.toHex32(this.h.slice(0, 12), 'big'); + else return utils.split32(this.h.slice(0, 12), 'big'); + }; + }, +}); + +// node_modules/hash.js/lib/hash/sha.js +var require_sha = __commonJS({ + 'node_modules/hash.js/lib/hash/sha.js'(exports) { + 'use strict'; + init_shim(); + exports.sha1 = require__(); + exports.sha224 = require__3(); + exports.sha256 = require__2(); + exports.sha384 = require__5(); + exports.sha512 = require__4(); + }, +}); + +// node_modules/hash.js/lib/hash/ripemd.js +var require_ripemd = __commonJS({ + 'node_modules/hash.js/lib/hash/ripemd.js'(exports) { + 'use strict'; + init_shim(); + var utils = require_utils(); + var common = require_common(); + var rotl32 = utils.rotl32; + var sum32 = utils.sum32; + var sum32_3 = utils.sum32_3; + var sum32_4 = utils.sum32_4; + var BlockHash = common.BlockHash; + function RIPEMD160() { + if (!(this instanceof RIPEMD160)) return new RIPEMD160(); + BlockHash.call(this); + this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]; + this.endian = 'little'; + } + utils.inherits(RIPEMD160, BlockHash); + exports.ripemd160 = RIPEMD160; + RIPEMD160.blockSize = 512; + RIPEMD160.outSize = 160; + RIPEMD160.hmacStrength = 192; + RIPEMD160.padLength = 64; + RIPEMD160.prototype._update = function update2(msg, start) { + var A2 = this.h[0]; + var B = this.h[1]; + var C = this.h[2]; + var D3 = this.h[3]; + var E = this.h[4]; + var Ah = A2; + var Bh = B; + var Ch2 = C; + var Dh = D3; + var Eh = E; + for (var j = 0; j < 80; j++) { + var T = sum32( + rotl32(sum32_4(A2, f(j, B, C, D3), msg[r3[j] + start], K2(j)), s2[j]), + E + ); + A2 = E; + E = D3; + D3 = rotl32(C, 10); + C = B; + B = T; + T = sum32( + rotl32( + sum32_4(Ah, f(79 - j, Bh, Ch2, Dh), msg[rh[j] + start], Kh(j)), + sh[j] + ), + Eh + ); + Ah = Eh; + Eh = Dh; + Dh = rotl32(Ch2, 10); + Ch2 = Bh; + Bh = T; + } + T = sum32_3(this.h[1], C, Dh); + this.h[1] = sum32_3(this.h[2], D3, Eh); + this.h[2] = sum32_3(this.h[3], E, Ah); + this.h[3] = sum32_3(this.h[4], A2, Bh); + this.h[4] = sum32_3(this.h[0], B, Ch2); + this.h[0] = T; + }; + RIPEMD160.prototype._digest = function digest(enc) { + if (enc === 'hex') return utils.toHex32(this.h, 'little'); + else return utils.split32(this.h, 'little'); + }; + function f(j, x, y, z) { + if (j <= 15) return x ^ y ^ z; + else if (j <= 31) return (x & y) | (~x & z); + else if (j <= 47) return (x | ~y) ^ z; + else if (j <= 63) return (x & z) | (y & ~z); + else return x ^ (y | ~z); + } + function K2(j) { + if (j <= 15) return 0; + else if (j <= 31) return 1518500249; + else if (j <= 47) return 1859775393; + else if (j <= 63) return 2400959708; + else return 2840853838; + } + function Kh(j) { + if (j <= 15) return 1352829926; + else if (j <= 31) return 1548603684; + else if (j <= 47) return 1836072691; + else if (j <= 63) return 2053994217; + else return 0; + } + var r3 = [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, + 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, + 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, + 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13, + ]; + var rh = [ + 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, + 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, + 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, + 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11, + ]; + var s2 = [ + 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, + 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, + 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, + 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6, + ]; + var sh = [ + 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, + 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, + 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, + 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11, + ]; + }, +}); + +// node_modules/hash.js/lib/hash/hmac.js +var require_hmac = __commonJS({ + 'node_modules/hash.js/lib/hash/hmac.js'(exports, module2) { + 'use strict'; + init_shim(); + var utils = require_utils(); + var assert2 = require_minimalistic_assert(); + function Hmac(hash3, key2, enc) { + if (!(this instanceof Hmac)) return new Hmac(hash3, key2, enc); + this.Hash = hash3; + this.blockSize = hash3.blockSize / 8; + this.outSize = hash3.outSize / 8; + this.inner = null; + this.outer = null; + this._init(utils.toArray(key2, enc)); + } + module2.exports = Hmac; + Hmac.prototype._init = function init2(key2) { + if (key2.length > this.blockSize) + key2 = new this.Hash().update(key2).digest(); + assert2(key2.length <= this.blockSize); + for (var i2 = key2.length; i2 < this.blockSize; i2++) key2.push(0); + for (i2 = 0; i2 < key2.length; i2++) key2[i2] ^= 54; + this.inner = new this.Hash().update(key2); + for (i2 = 0; i2 < key2.length; i2++) key2[i2] ^= 106; + this.outer = new this.Hash().update(key2); + }; + Hmac.prototype.update = function update2(msg, enc) { + this.inner.update(msg, enc); + return this; + }; + Hmac.prototype.digest = function digest(enc) { + this.outer.update(this.inner.digest()); + return this.outer.digest(enc); + }; + }, +}); + +// node_modules/hash.js/lib/hash.js +var require_hash = __commonJS({ + 'node_modules/hash.js/lib/hash.js'(exports) { + init_shim(); + var hash3 = exports; + hash3.utils = require_utils(); + hash3.common = require_common(); + hash3.sha = require_sha(); + hash3.ripemd = require_ripemd(); + hash3.hmac = require_hmac(); + hash3.sha1 = hash3.sha.sha1; + hash3.sha256 = hash3.sha.sha256; + hash3.sha224 = hash3.sha.sha224; + hash3.sha384 = hash3.sha.sha384; + hash3.sha512 = hash3.sha.sha512; + hash3.ripemd160 = hash3.ripemd.ripemd160; + }, +}); + +// node_modules/@ethersproject/signing-key/lib.esm/elliptic.js +function createCommonjsModule(fn, basedir, module2) { + return ( + (module2 = { + path: basedir, + exports: {}, + require: function (path, base2) { + return commonjsRequire( + path, + base2 === void 0 || base2 === null ? module2.path : base2 + ); + }, + }), + fn(module2, module2.exports), + module2.exports + ); +} +function commonjsRequire() { + throw new Error( + 'Dynamic requires are not currently supported by @rollup/plugin-commonjs' + ); +} +function assert(val, msg) { + if (!val) throw new Error(msg || 'Assertion failed'); +} +function BaseCurve(type, conf) { + this.type = type; + this.p = new import_bn2.default(conf.p, 16); + this.red = conf.prime + ? import_bn2.default.red(conf.prime) + : import_bn2.default.mont(this.p); + this.zero = new import_bn2.default(0).toRed(this.red); + this.one = new import_bn2.default(1).toRed(this.red); + this.two = new import_bn2.default(2).toRed(this.red); + this.n = conf.n && new import_bn2.default(conf.n, 16); + this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed); + this._wnafT1 = new Array(4); + this._wnafT2 = new Array(4); + this._wnafT3 = new Array(4); + this._wnafT4 = new Array(4); + this._bitLength = this.n ? this.n.bitLength() : 0; + var adjustCount = this.n && this.p.div(this.n); + if (!adjustCount || adjustCount.cmpn(100) > 0) { + this.redN = null; + } else { + this._maxwellTrick = true; + this.redN = this.n.toRed(this.red); + } +} +function BasePoint(curve, type) { + this.curve = curve; + this.type = type; + this.precomputed = null; +} +function ShortCurve(conf) { + base.call(this, 'short', conf); + this.a = new import_bn2.default(conf.a, 16).toRed(this.red); + this.b = new import_bn2.default(conf.b, 16).toRed(this.red); + this.tinv = this.two.redInvm(); + this.zeroA = this.a.fromRed().cmpn(0) === 0; + this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0; + this.endo = this._getEndomorphism(conf); + this._endoWnafT1 = new Array(4); + this._endoWnafT2 = new Array(4); +} +function Point(curve, x, y, isRed) { + base.BasePoint.call(this, curve, 'affine'); + if (x === null && y === null) { + this.x = null; + this.y = null; + this.inf = true; + } else { + this.x = new import_bn2.default(x, 16); + this.y = new import_bn2.default(y, 16); + if (isRed) { + this.x.forceRed(this.curve.red); + this.y.forceRed(this.curve.red); + } + if (!this.x.red) this.x = this.x.toRed(this.curve.red); + if (!this.y.red) this.y = this.y.toRed(this.curve.red); + this.inf = false; + } +} +function JPoint(curve, x, y, z) { + base.BasePoint.call(this, curve, 'jacobian'); + if (x === null && y === null && z === null) { + this.x = this.curve.one; + this.y = this.curve.one; + this.z = new import_bn2.default(0); + } else { + this.x = new import_bn2.default(x, 16); + this.y = new import_bn2.default(y, 16); + this.z = new import_bn2.default(z, 16); + } + if (!this.x.red) this.x = this.x.toRed(this.curve.red); + if (!this.y.red) this.y = this.y.toRed(this.curve.red); + if (!this.z.red) this.z = this.z.toRed(this.curve.red); + this.zOne = this.z === this.curve.one; +} +function HmacDRBG(options) { + if (!(this instanceof HmacDRBG)) return new HmacDRBG(options); + this.hash = options.hash; + this.predResist = !!options.predResist; + this.outLen = this.hash.outSize; + this.minEntropy = options.minEntropy || this.hash.hmacStrength; + this._reseed = null; + this.reseedInterval = null; + this.K = null; + this.V = null; + var entropy = utils_1.toArray(options.entropy, options.entropyEnc || 'hex'); + var nonce = utils_1.toArray(options.nonce, options.nonceEnc || 'hex'); + var pers = utils_1.toArray(options.pers, options.persEnc || 'hex'); + minimalisticAssert( + entropy.length >= this.minEntropy / 8, + 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits' + ); + this._init(entropy, nonce, pers); +} +function KeyPair(ec2, options) { + this.ec = ec2; + this.priv = null; + this.pub = null; + if (options.priv) this._importPrivate(options.priv, options.privEnc); + if (options.pub) this._importPublic(options.pub, options.pubEnc); +} +function Signature(options, enc) { + if (options instanceof Signature) return options; + if (this._importDER(options, enc)) return; + assert$4(options.r && options.s, 'Signature without r or s'); + this.r = new import_bn2.default(options.r, 16); + this.s = new import_bn2.default(options.s, 16); + if (options.recoveryParam === void 0) this.recoveryParam = null; + else this.recoveryParam = options.recoveryParam; +} +function Position() { + this.place = 0; +} +function getLength(buf, p) { + var initial = buf[p.place++]; + if (!(initial & 128)) { + return initial; + } + var octetLen = initial & 15; + if (octetLen === 0 || octetLen > 4) { + return false; + } + var val = 0; + for (var i2 = 0, off = p.place; i2 < octetLen; i2++, off++) { + val <<= 8; + val |= buf[off]; + val >>>= 0; + } + if (val <= 127) { + return false; + } + p.place = off; + return val; +} +function rmPadding(buf) { + var i2 = 0; + var len = buf.length - 1; + while (!buf[i2] && !(buf[i2 + 1] & 128) && i2 < len) { + i2++; + } + if (i2 === 0) { + return buf; + } + return buf.slice(i2); +} +function constructLength(arr, len) { + if (len < 128) { + arr.push(len); + return; + } + var octets = 1 + ((Math.log(len) / Math.LN2) >>> 3); + arr.push(octets | 128); + while (--octets) { + arr.push((len >>> (octets << 3)) & 255); + } + arr.push(len); +} +function EC(options) { + if (!(this instanceof EC)) return new EC(options); + if (typeof options === 'string') { + assert$5( + Object.prototype.hasOwnProperty.call(curves_1, options), + 'Unknown curve ' + options + ); + options = curves_1[options]; + } + if (options instanceof curves_1.PresetCurve) options = { curve: options }; + this.curve = options.curve.curve; + this.n = this.curve.n; + this.nh = this.n.ushrn(1); + this.g = this.curve.g; + this.g = options.curve.g; + this.g.precompute(options.curve.n.bitLength() + 1); + this.hash = options.hash || options.curve.hash; +} +var import_bn2, + import_hash2, + minimalisticAssert, + utils_1, + utils_1$1, + getNAF, + getJSF, + assert$1, + base, + inherits_browser, + assert$2, + short_1, + curve_1, + curves_1, + hmacDrbg, + assert$3, + key, + assert$4, + signature, + rand, + assert$5, + ec, + elliptic_1, + EC$1; +var init_elliptic = __esm({ + 'node_modules/@ethersproject/signing-key/lib.esm/elliptic.js'() { + init_shim(); + import_bn2 = __toESM(require_bn2()); + import_hash2 = __toESM(require_hash()); + minimalisticAssert = assert; + assert.equal = function assertEqual(l2, r3, msg) { + if (l2 != r3) + throw new Error(msg || 'Assertion failed: ' + l2 + ' != ' + r3); + }; + utils_1 = createCommonjsModule(function (module2, exports) { + 'use strict'; + var utils = exports; + function toArray(msg, enc) { + if (Array.isArray(msg)) return msg.slice(); + if (!msg) return []; + var res = []; + if (typeof msg !== 'string') { + for (var i2 = 0; i2 < msg.length; i2++) res[i2] = msg[i2] | 0; + return res; + } + if (enc === 'hex') { + msg = msg.replace(/[^a-z0-9]+/gi, ''); + if (msg.length % 2 !== 0) msg = '0' + msg; + for (var i2 = 0; i2 < msg.length; i2 += 2) + res.push(parseInt(msg[i2] + msg[i2 + 1], 16)); + } else { + for (var i2 = 0; i2 < msg.length; i2++) { + var c = msg.charCodeAt(i2); + var hi = c >> 8; + var lo = c & 255; + if (hi) res.push(hi, lo); + else res.push(lo); + } + } + return res; + } + utils.toArray = toArray; + function zero2(word) { + if (word.length === 1) return '0' + word; + else return word; + } + utils.zero2 = zero2; + function toHex2(msg) { + var res = ''; + for (var i2 = 0; i2 < msg.length; i2++) + res += zero2(msg[i2].toString(16)); + return res; + } + utils.toHex = toHex2; + utils.encode = function encode6(arr, enc) { + if (enc === 'hex') return toHex2(arr); + else return arr; + }; + }); + utils_1$1 = createCommonjsModule(function (module2, exports) { + 'use strict'; + var utils = exports; + utils.assert = minimalisticAssert; + utils.toArray = utils_1.toArray; + utils.zero2 = utils_1.zero2; + utils.toHex = utils_1.toHex; + utils.encode = utils_1.encode; + function getNAF2(num, w, bits) { + var naf = new Array(Math.max(num.bitLength(), bits) + 1); + naf.fill(0); + var ws = 1 << (w + 1); + var k = num.clone(); + for (var i2 = 0; i2 < naf.length; i2++) { + var z; + var mod = k.andln(ws - 1); + if (k.isOdd()) { + if (mod > (ws >> 1) - 1) z = (ws >> 1) - mod; + else z = mod; + k.isubn(z); + } else { + z = 0; + } + naf[i2] = z; + k.iushrn(1); + } + return naf; + } + utils.getNAF = getNAF2; + function getJSF2(k1, k2) { + var jsf = [[], []]; + k1 = k1.clone(); + k2 = k2.clone(); + var d1 = 0; + var d2 = 0; + var m8; + while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) { + var m14 = (k1.andln(3) + d1) & 3; + var m24 = (k2.andln(3) + d2) & 3; + if (m14 === 3) m14 = -1; + if (m24 === 3) m24 = -1; + var u1; + if ((m14 & 1) === 0) { + u1 = 0; + } else { + m8 = (k1.andln(7) + d1) & 7; + if ((m8 === 3 || m8 === 5) && m24 === 2) u1 = -m14; + else u1 = m14; + } + jsf[0].push(u1); + var u2; + if ((m24 & 1) === 0) { + u2 = 0; + } else { + m8 = (k2.andln(7) + d2) & 7; + if ((m8 === 3 || m8 === 5) && m14 === 2) u2 = -m24; + else u2 = m24; + } + jsf[1].push(u2); + if (2 * d1 === u1 + 1) d1 = 1 - d1; + if (2 * d2 === u2 + 1) d2 = 1 - d2; + k1.iushrn(1); + k2.iushrn(1); + } + return jsf; + } + utils.getJSF = getJSF2; + function cachedProperty(obj, name, computer) { + var key2 = '_' + name; + obj.prototype[name] = function cachedProperty2() { + return this[key2] !== void 0 + ? this[key2] + : (this[key2] = computer.call(this)); + }; + } + utils.cachedProperty = cachedProperty; + function parseBytes(bytes) { + return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') : bytes; + } + utils.parseBytes = parseBytes; + function intFromLE(bytes) { + return new import_bn2.default(bytes, 'hex', 'le'); + } + utils.intFromLE = intFromLE; + }); + getNAF = utils_1$1.getNAF; + getJSF = utils_1$1.getJSF; + assert$1 = utils_1$1.assert; + base = BaseCurve; + BaseCurve.prototype.point = function point() { + throw new Error('Not implemented'); + }; + BaseCurve.prototype.validate = function validate() { + throw new Error('Not implemented'); + }; + BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) { + assert$1(p.precomputed); + var doubles = p._getDoubles(); + var naf = getNAF(k, 1, this._bitLength); + var I2 = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1); + I2 /= 3; + var repr = []; + var j; + var nafW; + for (j = 0; j < naf.length; j += doubles.step) { + nafW = 0; + for (var l2 = j + doubles.step - 1; l2 >= j; l2--) + nafW = (nafW << 1) + naf[l2]; + repr.push(nafW); + } + var a2 = this.jpoint(null, null, null); + var b = this.jpoint(null, null, null); + for (var i2 = I2; i2 > 0; i2--) { + for (j = 0; j < repr.length; j++) { + nafW = repr[j]; + if (nafW === i2) b = b.mixedAdd(doubles.points[j]); + else if (nafW === -i2) b = b.mixedAdd(doubles.points[j].neg()); + } + a2 = a2.add(b); + } + return a2.toP(); + }; + BaseCurve.prototype._wnafMul = function _wnafMul(p, k) { + var w = 4; + var nafPoints = p._getNAFPoints(w); + w = nafPoints.wnd; + var wnd = nafPoints.points; + var naf = getNAF(k, w, this._bitLength); + var acc = this.jpoint(null, null, null); + for (var i2 = naf.length - 1; i2 >= 0; i2--) { + for (var l2 = 0; i2 >= 0 && naf[i2] === 0; i2--) l2++; + if (i2 >= 0) l2++; + acc = acc.dblp(l2); + if (i2 < 0) break; + var z = naf[i2]; + assert$1(z !== 0); + if (p.type === 'affine') { + if (z > 0) acc = acc.mixedAdd(wnd[(z - 1) >> 1]); + else acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg()); + } else { + if (z > 0) acc = acc.add(wnd[(z - 1) >> 1]); + else acc = acc.add(wnd[(-z - 1) >> 1].neg()); + } + } + return p.type === 'affine' ? acc.toP() : acc; + }; + BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd( + defW, + points, + coeffs, + len, + jacobianResult + ) { + var wndWidth = this._wnafT1; + var wnd = this._wnafT2; + var naf = this._wnafT3; + var max = 0; + var i2; + var j; + var p; + for (i2 = 0; i2 < len; i2++) { + p = points[i2]; + var nafPoints = p._getNAFPoints(defW); + wndWidth[i2] = nafPoints.wnd; + wnd[i2] = nafPoints.points; + } + for (i2 = len - 1; i2 >= 1; i2 -= 2) { + var a2 = i2 - 1; + var b = i2; + if (wndWidth[a2] !== 1 || wndWidth[b] !== 1) { + naf[a2] = getNAF(coeffs[a2], wndWidth[a2], this._bitLength); + naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength); + max = Math.max(naf[a2].length, max); + max = Math.max(naf[b].length, max); + continue; + } + var comb = [ + points[a2], + /* 1 */ + null, + /* 3 */ + null, + /* 5 */ + points[b], + /* 7 */ + ]; + if (points[a2].y.cmp(points[b].y) === 0) { + comb[1] = points[a2].add(points[b]); + comb[2] = points[a2].toJ().mixedAdd(points[b].neg()); + } else if (points[a2].y.cmp(points[b].y.redNeg()) === 0) { + comb[1] = points[a2].toJ().mixedAdd(points[b]); + comb[2] = points[a2].add(points[b].neg()); + } else { + comb[1] = points[a2].toJ().mixedAdd(points[b]); + comb[2] = points[a2].toJ().mixedAdd(points[b].neg()); + } + var index = [ + -3, /* -1 -1 */ + -1, /* -1 0 */ + -5, /* -1 1 */ + -7, /* 0 -1 */ + 0, /* 0 0 */ + 7, /* 0 1 */ + 5, /* 1 -1 */ + 1, /* 1 0 */ + 3, + /* 1 1 */ + ]; + var jsf = getJSF(coeffs[a2], coeffs[b]); + max = Math.max(jsf[0].length, max); + naf[a2] = new Array(max); + naf[b] = new Array(max); + for (j = 0; j < max; j++) { + var ja = jsf[0][j] | 0; + var jb = jsf[1][j] | 0; + naf[a2][j] = index[(ja + 1) * 3 + (jb + 1)]; + naf[b][j] = 0; + wnd[a2] = comb; + } + } + var acc = this.jpoint(null, null, null); + var tmp = this._wnafT4; + for (i2 = max; i2 >= 0; i2--) { + var k = 0; + while (i2 >= 0) { + var zero = true; + for (j = 0; j < len; j++) { + tmp[j] = naf[j][i2] | 0; + if (tmp[j] !== 0) zero = false; + } + if (!zero) break; + k++; + i2--; + } + if (i2 >= 0) k++; + acc = acc.dblp(k); + if (i2 < 0) break; + for (j = 0; j < len; j++) { + var z = tmp[j]; + p; + if (z === 0) continue; + else if (z > 0) p = wnd[j][(z - 1) >> 1]; + else if (z < 0) p = wnd[j][(-z - 1) >> 1].neg(); + if (p.type === 'affine') acc = acc.mixedAdd(p); + else acc = acc.add(p); + } + } + for (i2 = 0; i2 < len; i2++) wnd[i2] = null; + if (jacobianResult) return acc; + else return acc.toP(); + }; + BaseCurve.BasePoint = BasePoint; + BasePoint.prototype.eq = function eq() { + throw new Error('Not implemented'); + }; + BasePoint.prototype.validate = function validate2() { + return this.curve.validate(this); + }; + BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) { + bytes = utils_1$1.toArray(bytes, enc); + var len = this.p.byteLength(); + if ( + (bytes[0] === 4 || bytes[0] === 6 || bytes[0] === 7) && + bytes.length - 1 === 2 * len + ) { + if (bytes[0] === 6) assert$1(bytes[bytes.length - 1] % 2 === 0); + else if (bytes[0] === 7) assert$1(bytes[bytes.length - 1] % 2 === 1); + var res = this.point( + bytes.slice(1, 1 + len), + bytes.slice(1 + len, 1 + 2 * len) + ); + return res; + } else if ( + (bytes[0] === 2 || bytes[0] === 3) && + bytes.length - 1 === len + ) { + return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 3); + } + throw new Error('Unknown point format'); + }; + BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) { + return this.encode(enc, true); + }; + BasePoint.prototype._encode = function _encode2(compact) { + var len = this.curve.p.byteLength(); + var x = this.getX().toArray('be', len); + if (compact) return [this.getY().isEven() ? 2 : 3].concat(x); + return [4].concat(x, this.getY().toArray('be', len)); + }; + BasePoint.prototype.encode = function encode3(enc, compact) { + return utils_1$1.encode(this._encode(compact), enc); + }; + BasePoint.prototype.precompute = function precompute(power) { + if (this.precomputed) return this; + var precomputed = { + doubles: null, + naf: null, + beta: null, + }; + precomputed.naf = this._getNAFPoints(8); + precomputed.doubles = this._getDoubles(4, power); + precomputed.beta = this._getBeta(); + this.precomputed = precomputed; + return this; + }; + BasePoint.prototype._hasDoubles = function _hasDoubles(k) { + if (!this.precomputed) return false; + var doubles = this.precomputed.doubles; + if (!doubles) return false; + return ( + doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step) + ); + }; + BasePoint.prototype._getDoubles = function _getDoubles(step, power) { + if (this.precomputed && this.precomputed.doubles) + return this.precomputed.doubles; + var doubles = [this]; + var acc = this; + for (var i2 = 0; i2 < power; i2 += step) { + for (var j = 0; j < step; j++) acc = acc.dbl(); + doubles.push(acc); + } + return { + step, + points: doubles, + }; + }; + BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) { + if (this.precomputed && this.precomputed.naf) return this.precomputed.naf; + var res = [this]; + var max = (1 << wnd) - 1; + var dbl3 = max === 1 ? null : this.dbl(); + for (var i2 = 1; i2 < max; i2++) res[i2] = res[i2 - 1].add(dbl3); + return { + wnd, + points: res, + }; + }; + BasePoint.prototype._getBeta = function _getBeta() { + return null; + }; + BasePoint.prototype.dblp = function dblp(k) { + var r3 = this; + for (var i2 = 0; i2 < k; i2++) r3 = r3.dbl(); + return r3; + }; + inherits_browser = createCommonjsModule(function (module2) { + if (typeof Object.create === 'function') { + module2.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true, + }, + }); + } + }; + } else { + module2.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + var TempCtor = function () {}; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + }; + } + }); + assert$2 = utils_1$1.assert; + inherits_browser(ShortCurve, base); + short_1 = ShortCurve; + ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) { + if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1) return; + var beta; + var lambda; + if (conf.beta) { + beta = new import_bn2.default(conf.beta, 16).toRed(this.red); + } else { + var betas = this._getEndoRoots(this.p); + beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1]; + beta = beta.toRed(this.red); + } + if (conf.lambda) { + lambda = new import_bn2.default(conf.lambda, 16); + } else { + var lambdas = this._getEndoRoots(this.n); + if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) { + lambda = lambdas[0]; + } else { + lambda = lambdas[1]; + assert$2(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0); + } + } + var basis; + if (conf.basis) { + basis = conf.basis.map(function (vec) { + return { + a: new import_bn2.default(vec.a, 16), + b: new import_bn2.default(vec.b, 16), + }; + }); + } else { + basis = this._getEndoBasis(lambda); + } + return { + beta, + lambda, + basis, + }; + }; + ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) { + var red = num === this.p ? this.red : import_bn2.default.mont(num); + var tinv = new import_bn2.default(2).toRed(red).redInvm(); + var ntinv = tinv.redNeg(); + var s2 = new import_bn2.default(3) + .toRed(red) + .redNeg() + .redSqrt() + .redMul(tinv); + var l1 = ntinv.redAdd(s2).fromRed(); + var l2 = ntinv.redSub(s2).fromRed(); + return [l1, l2]; + }; + ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) { + var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)); + var u = lambda; + var v = this.n.clone(); + var x1 = new import_bn2.default(1); + var y1 = new import_bn2.default(0); + var x2 = new import_bn2.default(0); + var y2 = new import_bn2.default(1); + var a0; + var b0; + var a1; + var b1; + var a2; + var b2; + var prevR; + var i2 = 0; + var r3; + var x; + while (u.cmpn(0) !== 0) { + var q = v.div(u); + r3 = v.sub(q.mul(u)); + x = x2.sub(q.mul(x1)); + var y = y2.sub(q.mul(y1)); + if (!a1 && r3.cmp(aprxSqrt) < 0) { + a0 = prevR.neg(); + b0 = x1; + a1 = r3.neg(); + b1 = x; + } else if (a1 && ++i2 === 2) { + break; + } + prevR = r3; + v = u; + u = r3; + x2 = x1; + x1 = x; + y2 = y1; + y1 = y; + } + a2 = r3.neg(); + b2 = x; + var len1 = a1.sqr().add(b1.sqr()); + var len2 = a2.sqr().add(b2.sqr()); + if (len2.cmp(len1) >= 0) { + a2 = a0; + b2 = b0; + } + if (a1.negative) { + a1 = a1.neg(); + b1 = b1.neg(); + } + if (a2.negative) { + a2 = a2.neg(); + b2 = b2.neg(); + } + return [ + { a: a1, b: b1 }, + { a: a2, b: b2 }, + ]; + }; + ShortCurve.prototype._endoSplit = function _endoSplit(k) { + var basis = this.endo.basis; + var v1 = basis[0]; + var v2 = basis[1]; + var c1 = v2.b.mul(k).divRound(this.n); + var c2 = v1.b.neg().mul(k).divRound(this.n); + var p1 = c1.mul(v1.a); + var p2 = c2.mul(v2.a); + var q1 = c1.mul(v1.b); + var q2 = c2.mul(v2.b); + var k1 = k.sub(p1).sub(p2); + var k2 = q1.add(q2).neg(); + return { k1, k2 }; + }; + ShortCurve.prototype.pointFromX = function pointFromX(x, odd) { + x = new import_bn2.default(x, 16); + if (!x.red) x = x.toRed(this.red); + var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b); + var y = y2.redSqrt(); + if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) + throw new Error('invalid point'); + var isOdd = y.fromRed().isOdd(); + if ((odd && !isOdd) || (!odd && isOdd)) y = y.redNeg(); + return this.point(x, y); + }; + ShortCurve.prototype.validate = function validate3(point3) { + if (point3.inf) return true; + var x = point3.x; + var y = point3.y; + var ax = this.a.redMul(x); + var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b); + return y.redSqr().redISub(rhs).cmpn(0) === 0; + }; + ShortCurve.prototype._endoWnafMulAdd = function _endoWnafMulAdd( + points, + coeffs, + jacobianResult + ) { + var npoints = this._endoWnafT1; + var ncoeffs = this._endoWnafT2; + for (var i2 = 0; i2 < points.length; i2++) { + var split = this._endoSplit(coeffs[i2]); + var p = points[i2]; + var beta = p._getBeta(); + if (split.k1.negative) { + split.k1.ineg(); + p = p.neg(true); + } + if (split.k2.negative) { + split.k2.ineg(); + beta = beta.neg(true); + } + npoints[i2 * 2] = p; + npoints[i2 * 2 + 1] = beta; + ncoeffs[i2 * 2] = split.k1; + ncoeffs[i2 * 2 + 1] = split.k2; + } + var res = this._wnafMulAdd(1, npoints, ncoeffs, i2 * 2, jacobianResult); + for (var j = 0; j < i2 * 2; j++) { + npoints[j] = null; + ncoeffs[j] = null; + } + return res; + }; + inherits_browser(Point, base.BasePoint); + ShortCurve.prototype.point = function point2(x, y, isRed) { + return new Point(this, x, y, isRed); + }; + ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) { + return Point.fromJSON(this, obj, red); + }; + Point.prototype._getBeta = function _getBeta2() { + if (!this.curve.endo) return; + var pre = this.precomputed; + if (pre && pre.beta) return pre.beta; + var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); + if (pre) { + var curve = this.curve; + var endoMul = function (p) { + return curve.point(p.x.redMul(curve.endo.beta), p.y); + }; + pre.beta = beta; + beta.precomputed = { + beta: null, + naf: pre.naf && { + wnd: pre.naf.wnd, + points: pre.naf.points.map(endoMul), + }, + doubles: pre.doubles && { + step: pre.doubles.step, + points: pre.doubles.points.map(endoMul), + }, + }; + } + return beta; + }; + Point.prototype.toJSON = function toJSON() { + if (!this.precomputed) return [this.x, this.y]; + return [ + this.x, + this.y, + this.precomputed && { + doubles: this.precomputed.doubles && { + step: this.precomputed.doubles.step, + points: this.precomputed.doubles.points.slice(1), + }, + naf: this.precomputed.naf && { + wnd: this.precomputed.naf.wnd, + points: this.precomputed.naf.points.slice(1), + }, + }, + ]; + }; + Point.fromJSON = function fromJSON(curve, obj, red) { + if (typeof obj === 'string') obj = JSON.parse(obj); + var res = curve.point(obj[0], obj[1], red); + if (!obj[2]) return res; + function obj2point(obj2) { + return curve.point(obj2[0], obj2[1], red); + } + var pre = obj[2]; + res.precomputed = { + beta: null, + doubles: pre.doubles && { + step: pre.doubles.step, + points: [res].concat(pre.doubles.points.map(obj2point)), + }, + naf: pre.naf && { + wnd: pre.naf.wnd, + points: [res].concat(pre.naf.points.map(obj2point)), + }, + }; + return res; + }; + Point.prototype.inspect = function inspect() { + if (this.isInfinity()) return ''; + return ( + '' + ); + }; + Point.prototype.isInfinity = function isInfinity() { + return this.inf; + }; + Point.prototype.add = function add(p) { + if (this.inf) return p; + if (p.inf) return this; + if (this.eq(p)) return this.dbl(); + if (this.neg().eq(p)) return this.curve.point(null, null); + if (this.x.cmp(p.x) === 0) return this.curve.point(null, null); + var c = this.y.redSub(p.y); + if (c.cmpn(0) !== 0) c = c.redMul(this.x.redSub(p.x).redInvm()); + var nx = c.redSqr().redISub(this.x).redISub(p.x); + var ny = c.redMul(this.x.redSub(nx)).redISub(this.y); + return this.curve.point(nx, ny); + }; + Point.prototype.dbl = function dbl() { + if (this.inf) return this; + var ys1 = this.y.redAdd(this.y); + if (ys1.cmpn(0) === 0) return this.curve.point(null, null); + var a2 = this.curve.a; + var x2 = this.x.redSqr(); + var dyinv = ys1.redInvm(); + var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a2).redMul(dyinv); + var nx = c.redSqr().redISub(this.x.redAdd(this.x)); + var ny = c.redMul(this.x.redSub(nx)).redISub(this.y); + return this.curve.point(nx, ny); + }; + Point.prototype.getX = function getX() { + return this.x.fromRed(); + }; + Point.prototype.getY = function getY() { + return this.y.fromRed(); + }; + Point.prototype.mul = function mul(k) { + k = new import_bn2.default(k, 16); + if (this.isInfinity()) return this; + else if (this._hasDoubles(k)) return this.curve._fixedNafMul(this, k); + else if (this.curve.endo) return this.curve._endoWnafMulAdd([this], [k]); + else return this.curve._wnafMul(this, k); + }; + Point.prototype.mulAdd = function mulAdd(k1, p2, k2) { + var points = [this, p2]; + var coeffs = [k1, k2]; + if (this.curve.endo) return this.curve._endoWnafMulAdd(points, coeffs); + else return this.curve._wnafMulAdd(1, points, coeffs, 2); + }; + Point.prototype.jmulAdd = function jmulAdd(k1, p2, k2) { + var points = [this, p2]; + var coeffs = [k1, k2]; + if (this.curve.endo) + return this.curve._endoWnafMulAdd(points, coeffs, true); + else return this.curve._wnafMulAdd(1, points, coeffs, 2, true); + }; + Point.prototype.eq = function eq2(p) { + return ( + this === p || + (this.inf === p.inf && + (this.inf || (this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0))) + ); + }; + Point.prototype.neg = function neg(_precompute) { + if (this.inf) return this; + var res = this.curve.point(this.x, this.y.redNeg()); + if (_precompute && this.precomputed) { + var pre = this.precomputed; + var negate = function (p) { + return p.neg(); + }; + res.precomputed = { + naf: pre.naf && { + wnd: pre.naf.wnd, + points: pre.naf.points.map(negate), + }, + doubles: pre.doubles && { + step: pre.doubles.step, + points: pre.doubles.points.map(negate), + }, + }; + } + return res; + }; + Point.prototype.toJ = function toJ() { + if (this.inf) return this.curve.jpoint(null, null, null); + var res = this.curve.jpoint(this.x, this.y, this.curve.one); + return res; + }; + inherits_browser(JPoint, base.BasePoint); + ShortCurve.prototype.jpoint = function jpoint(x, y, z) { + return new JPoint(this, x, y, z); + }; + JPoint.prototype.toP = function toP() { + if (this.isInfinity()) return this.curve.point(null, null); + var zinv = this.z.redInvm(); + var zinv2 = zinv.redSqr(); + var ax = this.x.redMul(zinv2); + var ay = this.y.redMul(zinv2).redMul(zinv); + return this.curve.point(ax, ay); + }; + JPoint.prototype.neg = function neg2() { + return this.curve.jpoint(this.x, this.y.redNeg(), this.z); + }; + JPoint.prototype.add = function add2(p) { + if (this.isInfinity()) return p; + if (p.isInfinity()) return this; + var pz2 = p.z.redSqr(); + var z2 = this.z.redSqr(); + var u1 = this.x.redMul(pz2); + var u2 = p.x.redMul(z2); + var s1 = this.y.redMul(pz2.redMul(p.z)); + var s2 = p.y.redMul(z2.redMul(this.z)); + var h = u1.redSub(u2); + var r3 = s1.redSub(s2); + if (h.cmpn(0) === 0) { + if (r3.cmpn(0) !== 0) return this.curve.jpoint(null, null, null); + else return this.dbl(); + } + var h2 = h.redSqr(); + var h3 = h2.redMul(h); + var v = u1.redMul(h2); + var nx = r3.redSqr().redIAdd(h3).redISub(v).redISub(v); + var ny = r3.redMul(v.redISub(nx)).redISub(s1.redMul(h3)); + var nz = this.z.redMul(p.z).redMul(h); + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype.mixedAdd = function mixedAdd(p) { + if (this.isInfinity()) return p.toJ(); + if (p.isInfinity()) return this; + var z2 = this.z.redSqr(); + var u1 = this.x; + var u2 = p.x.redMul(z2); + var s1 = this.y; + var s2 = p.y.redMul(z2).redMul(this.z); + var h = u1.redSub(u2); + var r3 = s1.redSub(s2); + if (h.cmpn(0) === 0) { + if (r3.cmpn(0) !== 0) return this.curve.jpoint(null, null, null); + else return this.dbl(); + } + var h2 = h.redSqr(); + var h3 = h2.redMul(h); + var v = u1.redMul(h2); + var nx = r3.redSqr().redIAdd(h3).redISub(v).redISub(v); + var ny = r3.redMul(v.redISub(nx)).redISub(s1.redMul(h3)); + var nz = this.z.redMul(h); + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype.dblp = function dblp2(pow) { + if (pow === 0) return this; + if (this.isInfinity()) return this; + if (!pow) return this.dbl(); + var i2; + if (this.curve.zeroA || this.curve.threeA) { + var r3 = this; + for (i2 = 0; i2 < pow; i2++) r3 = r3.dbl(); + return r3; + } + var a2 = this.curve.a; + var tinv = this.curve.tinv; + var jx = this.x; + var jy = this.y; + var jz = this.z; + var jz4 = jz.redSqr().redSqr(); + var jyd = jy.redAdd(jy); + for (i2 = 0; i2 < pow; i2++) { + var jx2 = jx.redSqr(); + var jyd2 = jyd.redSqr(); + var jyd4 = jyd2.redSqr(); + var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a2.redMul(jz4)); + var t1 = jx.redMul(jyd2); + var nx = c.redSqr().redISub(t1.redAdd(t1)); + var t2 = t1.redISub(nx); + var dny = c.redMul(t2); + dny = dny.redIAdd(dny).redISub(jyd4); + var nz = jyd.redMul(jz); + if (i2 + 1 < pow) jz4 = jz4.redMul(jyd4); + jx = nx; + jz = nz; + jyd = dny; + } + return this.curve.jpoint(jx, jyd.redMul(tinv), jz); + }; + JPoint.prototype.dbl = function dbl2() { + if (this.isInfinity()) return this; + if (this.curve.zeroA) return this._zeroDbl(); + else if (this.curve.threeA) return this._threeDbl(); + else return this._dbl(); + }; + JPoint.prototype._zeroDbl = function _zeroDbl() { + var nx; + var ny; + var nz; + if (this.zOne) { + var xx = this.x.redSqr(); + var yy = this.y.redSqr(); + var yyyy = yy.redSqr(); + var s2 = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + s2 = s2.redIAdd(s2); + var m = xx.redAdd(xx).redIAdd(xx); + var t2 = m.redSqr().redISub(s2).redISub(s2); + var yyyy8 = yyyy.redIAdd(yyyy); + yyyy8 = yyyy8.redIAdd(yyyy8); + yyyy8 = yyyy8.redIAdd(yyyy8); + nx = t2; + ny = m.redMul(s2.redISub(t2)).redISub(yyyy8); + nz = this.y.redAdd(this.y); + } else { + var a2 = this.x.redSqr(); + var b = this.y.redSqr(); + var c = b.redSqr(); + var d = this.x.redAdd(b).redSqr().redISub(a2).redISub(c); + d = d.redIAdd(d); + var e2 = a2.redAdd(a2).redIAdd(a2); + var f = e2.redSqr(); + var c8 = c.redIAdd(c); + c8 = c8.redIAdd(c8); + c8 = c8.redIAdd(c8); + nx = f.redISub(d).redISub(d); + ny = e2.redMul(d.redISub(nx)).redISub(c8); + nz = this.y.redMul(this.z); + nz = nz.redIAdd(nz); + } + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype._threeDbl = function _threeDbl() { + var nx; + var ny; + var nz; + if (this.zOne) { + var xx = this.x.redSqr(); + var yy = this.y.redSqr(); + var yyyy = yy.redSqr(); + var s2 = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + s2 = s2.redIAdd(s2); + var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a); + var t2 = m.redSqr().redISub(s2).redISub(s2); + nx = t2; + var yyyy8 = yyyy.redIAdd(yyyy); + yyyy8 = yyyy8.redIAdd(yyyy8); + yyyy8 = yyyy8.redIAdd(yyyy8); + ny = m.redMul(s2.redISub(t2)).redISub(yyyy8); + nz = this.y.redAdd(this.y); + } else { + var delta = this.z.redSqr(); + var gamma = this.y.redSqr(); + var beta = this.x.redMul(gamma); + var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta)); + alpha = alpha.redAdd(alpha).redIAdd(alpha); + var beta4 = beta.redIAdd(beta); + beta4 = beta4.redIAdd(beta4); + var beta8 = beta4.redAdd(beta4); + nx = alpha.redSqr().redISub(beta8); + nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta); + var ggamma8 = gamma.redSqr(); + ggamma8 = ggamma8.redIAdd(ggamma8); + ggamma8 = ggamma8.redIAdd(ggamma8); + ggamma8 = ggamma8.redIAdd(ggamma8); + ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8); + } + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype._dbl = function _dbl() { + var a2 = this.curve.a; + var jx = this.x; + var jy = this.y; + var jz = this.z; + var jz4 = jz.redSqr().redSqr(); + var jx2 = jx.redSqr(); + var jy2 = jy.redSqr(); + var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a2.redMul(jz4)); + var jxd4 = jx.redAdd(jx); + jxd4 = jxd4.redIAdd(jxd4); + var t1 = jxd4.redMul(jy2); + var nx = c.redSqr().redISub(t1.redAdd(t1)); + var t2 = t1.redISub(nx); + var jyd8 = jy2.redSqr(); + jyd8 = jyd8.redIAdd(jyd8); + jyd8 = jyd8.redIAdd(jyd8); + jyd8 = jyd8.redIAdd(jyd8); + var ny = c.redMul(t2).redISub(jyd8); + var nz = jy.redAdd(jy).redMul(jz); + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype.trpl = function trpl() { + if (!this.curve.zeroA) return this.dbl().add(this); + var xx = this.x.redSqr(); + var yy = this.y.redSqr(); + var zz = this.z.redSqr(); + var yyyy = yy.redSqr(); + var m = xx.redAdd(xx).redIAdd(xx); + var mm = m.redSqr(); + var e2 = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + e2 = e2.redIAdd(e2); + e2 = e2.redAdd(e2).redIAdd(e2); + e2 = e2.redISub(mm); + var ee = e2.redSqr(); + var t2 = yyyy.redIAdd(yyyy); + t2 = t2.redIAdd(t2); + t2 = t2.redIAdd(t2); + t2 = t2.redIAdd(t2); + var u = m.redIAdd(e2).redSqr().redISub(mm).redISub(ee).redISub(t2); + var yyu4 = yy.redMul(u); + yyu4 = yyu4.redIAdd(yyu4); + yyu4 = yyu4.redIAdd(yyu4); + var nx = this.x.redMul(ee).redISub(yyu4); + nx = nx.redIAdd(nx); + nx = nx.redIAdd(nx); + var ny = this.y.redMul(u.redMul(t2.redISub(u)).redISub(e2.redMul(ee))); + ny = ny.redIAdd(ny); + ny = ny.redIAdd(ny); + ny = ny.redIAdd(ny); + var nz = this.z.redAdd(e2).redSqr().redISub(zz).redISub(ee); + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype.mul = function mul2(k, kbase) { + k = new import_bn2.default(k, kbase); + return this.curve._wnafMul(this, k); + }; + JPoint.prototype.eq = function eq3(p) { + if (p.type === 'affine') return this.eq(p.toJ()); + if (this === p) return true; + var z2 = this.z.redSqr(); + var pz2 = p.z.redSqr(); + if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0) + return false; + var z3 = z2.redMul(this.z); + var pz3 = pz2.redMul(p.z); + return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0; + }; + JPoint.prototype.eqXToP = function eqXToP(x) { + var zs = this.z.redSqr(); + var rx = x.toRed(this.curve.red).redMul(zs); + if (this.x.cmp(rx) === 0) return true; + var xc = x.clone(); + var t2 = this.curve.redN.redMul(zs); + for (;;) { + xc.iadd(this.curve.n); + if (xc.cmp(this.curve.p) >= 0) return false; + rx.redIAdd(t2); + if (this.x.cmp(rx) === 0) return true; + } + }; + JPoint.prototype.inspect = function inspect2() { + if (this.isInfinity()) return ''; + return ( + '' + ); + }; + JPoint.prototype.isInfinity = function isInfinity2() { + return this.z.cmpn(0) === 0; + }; + curve_1 = createCommonjsModule(function (module2, exports) { + 'use strict'; + var curve = exports; + curve.base = base; + curve.short = short_1; + curve.mont = /*RicMoo:ethers:require(./mont)*/ null; + curve.edwards = /*RicMoo:ethers:require(./edwards)*/ null; + }); + curves_1 = createCommonjsModule(function (module2, exports) { + 'use strict'; + var curves = exports; + var assert2 = utils_1$1.assert; + function PresetCurve(options) { + if (options.type === 'short') this.curve = new curve_1.short(options); + else if (options.type === 'edwards') + this.curve = new curve_1.edwards(options); + else this.curve = new curve_1.mont(options); + this.g = this.curve.g; + this.n = this.curve.n; + this.hash = options.hash; + assert2(this.g.validate(), 'Invalid curve'); + assert2(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O'); + } + curves.PresetCurve = PresetCurve; + function defineCurve(name, options) { + Object.defineProperty(curves, name, { + configurable: true, + enumerable: true, + get: function () { + var curve = new PresetCurve(options); + Object.defineProperty(curves, name, { + configurable: true, + enumerable: true, + value: curve, + }); + return curve; + }, + }); + } + defineCurve('p192', { + type: 'short', + prime: 'p192', + p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff', + a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc', + b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1', + n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831', + hash: import_hash2.default.sha256, + gRed: false, + g: [ + '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012', + '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811', + ], + }); + defineCurve('p224', { + type: 'short', + prime: 'p224', + p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001', + a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe', + b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4', + n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d', + hash: import_hash2.default.sha256, + gRed: false, + g: [ + 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21', + 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34', + ], + }); + defineCurve('p256', { + type: 'short', + prime: null, + p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff', + a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc', + b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b', + n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551', + hash: import_hash2.default.sha256, + gRed: false, + g: [ + '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296', + '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5', + ], + }); + defineCurve('p384', { + type: 'short', + prime: null, + p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff', + a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc', + b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef', + n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973', + hash: import_hash2.default.sha384, + gRed: false, + g: [ + 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7', + '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f', + ], + }); + defineCurve('p521', { + type: 'short', + prime: null, + p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff', + a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc', + b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00', + n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409', + hash: import_hash2.default.sha512, + gRed: false, + g: [ + '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66', + '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650', + ], + }); + defineCurve('curve25519', { + type: 'mont', + prime: 'p25519', + p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', + a: '76d06', + b: '1', + n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed', + hash: import_hash2.default.sha256, + gRed: false, + g: ['9'], + }); + defineCurve('ed25519', { + type: 'edwards', + prime: 'p25519', + p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', + a: '-1', + c: '1', + // -121665 * (121666^(-1)) (mod P) + d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3', + n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed', + hash: import_hash2.default.sha256, + gRed: false, + g: [ + '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a', + // 4/5 + '6666666666666666666666666666666666666666666666666666666666666658', + ], + }); + var pre; + try { + pre = /*RicMoo:ethers:require(./precomputed/secp256k1)*/ null.crash(); + } catch (e2) { + pre = void 0; + } + defineCurve('secp256k1', { + type: 'short', + prime: 'k256', + p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f', + a: '0', + b: '7', + n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141', + h: '1', + hash: import_hash2.default.sha256, + // Precomputed endomorphism + beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee', + lambda: + '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72', + basis: [ + { + a: '3086d221a7d46bcde86c90e49284eb15', + b: '-e4437ed6010e88286f547fa90abfe4c3', + }, + { + a: '114ca50f7a8e2f3f657c1108d9d44cfd8', + b: '3086d221a7d46bcde86c90e49284eb15', + }, + ], + gRed: false, + g: [ + '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', + '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8', + pre, + ], + }); + }); + hmacDrbg = HmacDRBG; + HmacDRBG.prototype._init = function init(entropy, nonce, pers) { + var seed = entropy.concat(nonce).concat(pers); + this.K = new Array(this.outLen / 8); + this.V = new Array(this.outLen / 8); + for (var i2 = 0; i2 < this.V.length; i2++) { + this.K[i2] = 0; + this.V[i2] = 1; + } + this._update(seed); + this._reseed = 1; + this.reseedInterval = 281474976710656; + }; + HmacDRBG.prototype._hmac = function hmac() { + return new import_hash2.default.hmac(this.hash, this.K); + }; + HmacDRBG.prototype._update = function update(seed) { + var kmac = this._hmac().update(this.V).update([0]); + if (seed) kmac = kmac.update(seed); + this.K = kmac.digest(); + this.V = this._hmac().update(this.V).digest(); + if (!seed) return; + this.K = this._hmac().update(this.V).update([1]).update(seed).digest(); + this.V = this._hmac().update(this.V).digest(); + }; + HmacDRBG.prototype.reseed = function reseed( + entropy, + entropyEnc, + add5, + addEnc + ) { + if (typeof entropyEnc !== 'string') { + addEnc = add5; + add5 = entropyEnc; + entropyEnc = null; + } + entropy = utils_1.toArray(entropy, entropyEnc); + add5 = utils_1.toArray(add5, addEnc); + minimalisticAssert( + entropy.length >= this.minEntropy / 8, + 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits' + ); + this._update(entropy.concat(add5 || [])); + this._reseed = 1; + }; + HmacDRBG.prototype.generate = function generate(len, enc, add5, addEnc) { + if (this._reseed > this.reseedInterval) + throw new Error('Reseed is required'); + if (typeof enc !== 'string') { + addEnc = add5; + add5 = enc; + enc = null; + } + if (add5) { + add5 = utils_1.toArray(add5, addEnc || 'hex'); + this._update(add5); + } + var temp = []; + while (temp.length < len) { + this.V = this._hmac().update(this.V).digest(); + temp = temp.concat(this.V); + } + var res = temp.slice(0, len); + this._update(add5); + this._reseed++; + return utils_1.encode(res, enc); + }; + assert$3 = utils_1$1.assert; + key = KeyPair; + KeyPair.fromPublic = function fromPublic(ec2, pub, enc) { + if (pub instanceof KeyPair) return pub; + return new KeyPair(ec2, { + pub, + pubEnc: enc, + }); + }; + KeyPair.fromPrivate = function fromPrivate(ec2, priv, enc) { + if (priv instanceof KeyPair) return priv; + return new KeyPair(ec2, { + priv, + privEnc: enc, + }); + }; + KeyPair.prototype.validate = function validate4() { + var pub = this.getPublic(); + if (pub.isInfinity()) + return { result: false, reason: 'Invalid public key' }; + if (!pub.validate()) + return { result: false, reason: 'Public key is not a point' }; + if (!pub.mul(this.ec.curve.n).isInfinity()) + return { result: false, reason: 'Public key * N != O' }; + return { result: true, reason: null }; + }; + KeyPair.prototype.getPublic = function getPublic(compact, enc) { + if (typeof compact === 'string') { + enc = compact; + compact = null; + } + if (!this.pub) this.pub = this.ec.g.mul(this.priv); + if (!enc) return this.pub; + return this.pub.encode(enc, compact); + }; + KeyPair.prototype.getPrivate = function getPrivate(enc) { + if (enc === 'hex') return this.priv.toString(16, 2); + else return this.priv; + }; + KeyPair.prototype._importPrivate = function _importPrivate(key2, enc) { + this.priv = new import_bn2.default(key2, enc || 16); + this.priv = this.priv.umod(this.ec.curve.n); + }; + KeyPair.prototype._importPublic = function _importPublic(key2, enc) { + if (key2.x || key2.y) { + if (this.ec.curve.type === 'mont') { + assert$3(key2.x, 'Need x coordinate'); + } else if ( + this.ec.curve.type === 'short' || + this.ec.curve.type === 'edwards' + ) { + assert$3(key2.x && key2.y, 'Need both x and y coordinate'); + } + this.pub = this.ec.curve.point(key2.x, key2.y); + return; + } + this.pub = this.ec.curve.decodePoint(key2, enc); + }; + KeyPair.prototype.derive = function derive(pub) { + if (!pub.validate()) { + assert$3(pub.validate(), 'public point not validated'); + } + return pub.mul(this.priv).getX(); + }; + KeyPair.prototype.sign = function sign(msg, enc, options) { + return this.ec.sign(msg, this, enc, options); + }; + KeyPair.prototype.verify = function verify(msg, signature2) { + return this.ec.verify(msg, signature2, this); + }; + KeyPair.prototype.inspect = function inspect3() { + return ( + '' + ); + }; + assert$4 = utils_1$1.assert; + signature = Signature; + Signature.prototype._importDER = function _importDER(data, enc) { + data = utils_1$1.toArray(data, enc); + var p = new Position(); + if (data[p.place++] !== 48) { + return false; + } + var len = getLength(data, p); + if (len === false) { + return false; + } + if (len + p.place !== data.length) { + return false; + } + if (data[p.place++] !== 2) { + return false; + } + var rlen = getLength(data, p); + if (rlen === false) { + return false; + } + var r3 = data.slice(p.place, rlen + p.place); + p.place += rlen; + if (data[p.place++] !== 2) { + return false; + } + var slen = getLength(data, p); + if (slen === false) { + return false; + } + if (data.length !== slen + p.place) { + return false; + } + var s2 = data.slice(p.place, slen + p.place); + if (r3[0] === 0) { + if (r3[1] & 128) { + r3 = r3.slice(1); + } else { + return false; + } + } + if (s2[0] === 0) { + if (s2[1] & 128) { + s2 = s2.slice(1); + } else { + return false; + } + } + this.r = new import_bn2.default(r3); + this.s = new import_bn2.default(s2); + this.recoveryParam = null; + return true; + }; + Signature.prototype.toDER = function toDER(enc) { + var r3 = this.r.toArray(); + var s2 = this.s.toArray(); + if (r3[0] & 128) r3 = [0].concat(r3); + if (s2[0] & 128) s2 = [0].concat(s2); + r3 = rmPadding(r3); + s2 = rmPadding(s2); + while (!s2[0] && !(s2[1] & 128)) { + s2 = s2.slice(1); + } + var arr = [2]; + constructLength(arr, r3.length); + arr = arr.concat(r3); + arr.push(2); + constructLength(arr, s2.length); + var backHalf = arr.concat(s2); + var res = [48]; + constructLength(res, backHalf.length); + res = res.concat(backHalf); + return utils_1$1.encode(res, enc); + }; + rand = + /*RicMoo:ethers:require(brorand)*/ + function () { + throw new Error('unsupported'); + }; + assert$5 = utils_1$1.assert; + ec = EC; + EC.prototype.keyPair = function keyPair(options) { + return new key(this, options); + }; + EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) { + return key.fromPrivate(this, priv, enc); + }; + EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) { + return key.fromPublic(this, pub, enc); + }; + EC.prototype.genKeyPair = function genKeyPair(options) { + if (!options) options = {}; + var drbg = new hmacDrbg({ + hash: this.hash, + pers: options.pers, + persEnc: options.persEnc || 'utf8', + entropy: options.entropy || rand(this.hash.hmacStrength), + entropyEnc: (options.entropy && options.entropyEnc) || 'utf8', + nonce: this.n.toArray(), + }); + var bytes = this.n.byteLength(); + var ns2 = this.n.sub(new import_bn2.default(2)); + for (;;) { + var priv = new import_bn2.default(drbg.generate(bytes)); + if (priv.cmp(ns2) > 0) continue; + priv.iaddn(1); + return this.keyFromPrivate(priv); + } + }; + EC.prototype._truncateToN = function _truncateToN(msg, truncOnly) { + var delta = msg.byteLength() * 8 - this.n.bitLength(); + if (delta > 0) msg = msg.ushrn(delta); + if (!truncOnly && msg.cmp(this.n) >= 0) return msg.sub(this.n); + else return msg; + }; + EC.prototype.sign = function sign2(msg, key2, enc, options) { + if (typeof enc === 'object') { + options = enc; + enc = null; + } + if (!options) options = {}; + key2 = this.keyFromPrivate(key2, enc); + msg = this._truncateToN(new import_bn2.default(msg, 16)); + var bytes = this.n.byteLength(); + var bkey = key2.getPrivate().toArray('be', bytes); + var nonce = msg.toArray('be', bytes); + var drbg = new hmacDrbg({ + hash: this.hash, + entropy: bkey, + nonce, + pers: options.pers, + persEnc: options.persEnc || 'utf8', + }); + var ns1 = this.n.sub(new import_bn2.default(1)); + for (var iter = 0; ; iter++) { + var k = options.k + ? options.k(iter) + : new import_bn2.default(drbg.generate(this.n.byteLength())); + k = this._truncateToN(k, true); + if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0) continue; + var kp = this.g.mul(k); + if (kp.isInfinity()) continue; + var kpX = kp.getX(); + var r3 = kpX.umod(this.n); + if (r3.cmpn(0) === 0) continue; + var s2 = k.invm(this.n).mul(r3.mul(key2.getPrivate()).iadd(msg)); + s2 = s2.umod(this.n); + if (s2.cmpn(0) === 0) continue; + var recoveryParam = + (kp.getY().isOdd() ? 1 : 0) | (kpX.cmp(r3) !== 0 ? 2 : 0); + if (options.canonical && s2.cmp(this.nh) > 0) { + s2 = this.n.sub(s2); + recoveryParam ^= 1; + } + return new signature({ r: r3, s: s2, recoveryParam }); + } + }; + EC.prototype.verify = function verify2(msg, signature$1, key2, enc) { + msg = this._truncateToN(new import_bn2.default(msg, 16)); + key2 = this.keyFromPublic(key2, enc); + signature$1 = new signature(signature$1, 'hex'); + var r3 = signature$1.r; + var s2 = signature$1.s; + if (r3.cmpn(1) < 0 || r3.cmp(this.n) >= 0) return false; + if (s2.cmpn(1) < 0 || s2.cmp(this.n) >= 0) return false; + var sinv = s2.invm(this.n); + var u1 = sinv.mul(msg).umod(this.n); + var u2 = sinv.mul(r3).umod(this.n); + var p; + if (!this.curve._maxwellTrick) { + p = this.g.mulAdd(u1, key2.getPublic(), u2); + if (p.isInfinity()) return false; + return p.getX().umod(this.n).cmp(r3) === 0; + } + p = this.g.jmulAdd(u1, key2.getPublic(), u2); + if (p.isInfinity()) return false; + return p.eqXToP(r3); + }; + EC.prototype.recoverPubKey = function (msg, signature$1, j, enc) { + assert$5((3 & j) === j, 'The recovery param is more than two bits'); + signature$1 = new signature(signature$1, enc); + var n2 = this.n; + var e2 = new import_bn2.default(msg); + var r3 = signature$1.r; + var s2 = signature$1.s; + var isYOdd = j & 1; + var isSecondKey = j >> 1; + if (r3.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey) + throw new Error('Unable to find sencond key candinate'); + if (isSecondKey) r3 = this.curve.pointFromX(r3.add(this.curve.n), isYOdd); + else r3 = this.curve.pointFromX(r3, isYOdd); + var rInv = signature$1.r.invm(n2); + var s1 = n2.sub(e2).mul(rInv).umod(n2); + var s22 = s2.mul(rInv).umod(n2); + return this.g.mulAdd(s1, r3, s22); + }; + EC.prototype.getKeyRecoveryParam = function (e2, signature$1, Q, enc) { + signature$1 = new signature(signature$1, enc); + if (signature$1.recoveryParam !== null) return signature$1.recoveryParam; + for (var i2 = 0; i2 < 4; i2++) { + var Qprime; + try { + Qprime = this.recoverPubKey(e2, signature$1, i2); + } catch (e3) { + continue; + } + if (Qprime.eq(Q)) return i2; + } + throw new Error('Unable to find valid recovery factor'); + }; + elliptic_1 = createCommonjsModule(function (module2, exports) { + 'use strict'; + var elliptic = exports; + elliptic.version = /*RicMoo:ethers*/ { version: '6.5.4' }.version; + elliptic.utils = utils_1$1; + elliptic.rand = + /*RicMoo:ethers:require(brorand)*/ + function () { + throw new Error('unsupported'); + }; + elliptic.curve = curve_1; + elliptic.curves = curves_1; + elliptic.ec = ec; + elliptic.eddsa = /*RicMoo:ethers:require(./elliptic/eddsa)*/ null; + }); + EC$1 = elliptic_1.ec; + }, +}); + +// node_modules/@ethersproject/signing-key/lib.esm/_version.js +var version13; +var init_version12 = __esm({ + 'node_modules/@ethersproject/signing-key/lib.esm/_version.js'() { + init_shim(); + version13 = 'signing-key/5.7.0'; + }, +}); + +// node_modules/@ethersproject/signing-key/lib.esm/index.js +var lib_exports12 = {}; +__export(lib_exports12, { + SigningKey: () => SigningKey, + computePublicKey: () => computePublicKey, + recoverPublicKey: () => recoverPublicKey, +}); +function getCurve() { + if (!_curve) { + _curve = new EC$1('secp256k1'); + } + return _curve; +} +function recoverPublicKey(digest, signature2) { + const sig = splitSignature(signature2); + const rs = { r: arrayify(sig.r), s: arrayify(sig.s) }; + return ( + '0x' + + getCurve() + .recoverPubKey(arrayify(digest), rs, sig.recoveryParam) + .encode('hex', false) + ); +} +function computePublicKey(key2, compressed) { + const bytes = arrayify(key2); + if (bytes.length === 32) { + const signingKey = new SigningKey(bytes); + if (compressed) { + return '0x' + getCurve().keyFromPrivate(bytes).getPublic(true, 'hex'); + } + return signingKey.publicKey; + } else if (bytes.length === 33) { + if (compressed) { + return hexlify(bytes); + } + return '0x' + getCurve().keyFromPublic(bytes).getPublic(false, 'hex'); + } else if (bytes.length === 65) { + if (!compressed) { + return hexlify(bytes); + } + return '0x' + getCurve().keyFromPublic(bytes).getPublic(true, 'hex'); + } + return logger17.throwArgumentError( + 'invalid public or private key', + 'key', + '[REDACTED]' + ); +} +var logger17, _curve, SigningKey; +var init_lib16 = __esm({ + 'node_modules/@ethersproject/signing-key/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_elliptic(); + init_lib2(); + init_lib4(); + init_lib(); + init_version12(); + logger17 = new Logger(version13); + _curve = null; + SigningKey = class { + constructor(privateKey) { + defineReadOnly(this, 'curve', 'secp256k1'); + defineReadOnly(this, 'privateKey', hexlify(privateKey)); + if (hexDataLength(this.privateKey) !== 32) { + logger17.throwArgumentError( + 'invalid private key', + 'privateKey', + '[[ REDACTED ]]' + ); + } + const keyPair2 = getCurve().keyFromPrivate(arrayify(this.privateKey)); + defineReadOnly( + this, + 'publicKey', + '0x' + keyPair2.getPublic(false, 'hex') + ); + defineReadOnly( + this, + 'compressedPublicKey', + '0x' + keyPair2.getPublic(true, 'hex') + ); + defineReadOnly(this, '_isSigningKey', true); + } + _addPoint(other) { + const p0 = getCurve().keyFromPublic(arrayify(this.publicKey)); + const p1 = getCurve().keyFromPublic(arrayify(other)); + return '0x' + p0.pub.add(p1.pub).encodeCompressed('hex'); + } + signDigest(digest) { + const keyPair2 = getCurve().keyFromPrivate(arrayify(this.privateKey)); + const digestBytes = arrayify(digest); + if (digestBytes.length !== 32) { + logger17.throwArgumentError('bad digest length', 'digest', digest); + } + const signature2 = keyPair2.sign(digestBytes, { canonical: true }); + return splitSignature({ + recoveryParam: signature2.recoveryParam, + r: hexZeroPad('0x' + signature2.r.toString(16), 32), + s: hexZeroPad('0x' + signature2.s.toString(16), 32), + }); + } + computeSharedSecret(otherKey) { + const keyPair2 = getCurve().keyFromPrivate(arrayify(this.privateKey)); + const otherKeyPair = getCurve().keyFromPublic( + arrayify(computePublicKey(otherKey)) + ); + return hexZeroPad( + '0x' + keyPair2.derive(otherKeyPair.getPublic()).toString(16), + 32 + ); + } + static isSigningKey(value) { + return !!(value && value._isSigningKey); + } + }; + }, +}); + +// node_modules/@ethersproject/transactions/lib.esm/_version.js +var version14; +var init_version13 = __esm({ + 'node_modules/@ethersproject/transactions/lib.esm/_version.js'() { + init_shim(); + version14 = 'transactions/5.7.0'; + }, +}); + +// node_modules/@ethersproject/transactions/lib.esm/index.js +var lib_exports13 = {}; +__export(lib_exports13, { + TransactionTypes: () => TransactionTypes, + accessListify: () => accessListify, + computeAddress: () => computeAddress, + parse: () => parse, + recoverAddress: () => recoverAddress, + serialize: () => serialize, +}); +function handleAddress(value) { + if (value === '0x') { + return null; + } + return getAddress(value); +} +function handleNumber(value) { + if (value === '0x') { + return Zero2; + } + return BigNumber.from(value); +} +function computeAddress(key2) { + const publicKey = computePublicKey(key2); + return getAddress(hexDataSlice(keccak256(hexDataSlice(publicKey, 1)), 12)); +} +function recoverAddress(digest, signature2) { + return computeAddress(recoverPublicKey(arrayify(digest), signature2)); +} +function formatNumber(value, name) { + const result = stripZeros(BigNumber.from(value).toHexString()); + if (result.length > 32) { + logger18.throwArgumentError( + 'invalid length for ' + name, + 'transaction:' + name, + value + ); + } + return result; +} +function accessSetify(addr, storageKeys) { + return { + address: getAddress(addr), + storageKeys: (storageKeys || []).map((storageKey, index) => { + if (hexDataLength(storageKey) !== 32) { + logger18.throwArgumentError( + 'invalid access list storageKey', + `accessList[${addr}:${index}]`, + storageKey + ); + } + return storageKey.toLowerCase(); + }), + }; +} +function accessListify(value) { + if (Array.isArray(value)) { + return value.map((set, index) => { + if (Array.isArray(set)) { + if (set.length > 2) { + logger18.throwArgumentError( + 'access list expected to be [ address, storageKeys[] ]', + `value[${index}]`, + set + ); + } + return accessSetify(set[0], set[1]); + } + return accessSetify(set.address, set.storageKeys); + }); + } + const result = Object.keys(value).map((addr) => { + const storageKeys = value[addr].reduce((accum, storageKey) => { + accum[storageKey] = true; + return accum; + }, {}); + return accessSetify(addr, Object.keys(storageKeys).sort()); + }); + result.sort((a2, b) => a2.address.localeCompare(b.address)); + return result; +} +function formatAccessList(value) { + return accessListify(value).map((set) => [set.address, set.storageKeys]); +} +function _serializeEip1559(transaction, signature2) { + if (transaction.gasPrice != null) { + const gasPrice = BigNumber.from(transaction.gasPrice); + const maxFeePerGas = BigNumber.from(transaction.maxFeePerGas || 0); + if (!gasPrice.eq(maxFeePerGas)) { + logger18.throwArgumentError( + 'mismatch EIP-1559 gasPrice != maxFeePerGas', + 'tx', + { + gasPrice, + maxFeePerGas, + } + ); + } + } + const fields = [ + formatNumber(transaction.chainId || 0, 'chainId'), + formatNumber(transaction.nonce || 0, 'nonce'), + formatNumber(transaction.maxPriorityFeePerGas || 0, 'maxPriorityFeePerGas'), + formatNumber(transaction.maxFeePerGas || 0, 'maxFeePerGas'), + formatNumber(transaction.gasLimit || 0, 'gasLimit'), + transaction.to != null ? getAddress(transaction.to) : '0x', + formatNumber(transaction.value || 0, 'value'), + transaction.data || '0x', + formatAccessList(transaction.accessList || []), + ]; + if (signature2) { + const sig = splitSignature(signature2); + fields.push(formatNumber(sig.recoveryParam, 'recoveryParam')); + fields.push(stripZeros(sig.r)); + fields.push(stripZeros(sig.s)); + } + return hexConcat(['0x02', encode(fields)]); +} +function _serializeEip2930(transaction, signature2) { + const fields = [ + formatNumber(transaction.chainId || 0, 'chainId'), + formatNumber(transaction.nonce || 0, 'nonce'), + formatNumber(transaction.gasPrice || 0, 'gasPrice'), + formatNumber(transaction.gasLimit || 0, 'gasLimit'), + transaction.to != null ? getAddress(transaction.to) : '0x', + formatNumber(transaction.value || 0, 'value'), + transaction.data || '0x', + formatAccessList(transaction.accessList || []), + ]; + if (signature2) { + const sig = splitSignature(signature2); + fields.push(formatNumber(sig.recoveryParam, 'recoveryParam')); + fields.push(stripZeros(sig.r)); + fields.push(stripZeros(sig.s)); + } + return hexConcat(['0x01', encode(fields)]); +} +function _serialize(transaction, signature2) { + checkProperties(transaction, allowedTransactionKeys2); + const raw = []; + transactionFields.forEach(function (fieldInfo) { + let value = transaction[fieldInfo.name] || []; + const options = {}; + if (fieldInfo.numeric) { + options.hexPad = 'left'; + } + value = arrayify(hexlify(value, options)); + if ( + fieldInfo.length && + value.length !== fieldInfo.length && + value.length > 0 + ) { + logger18.throwArgumentError( + 'invalid length for ' + fieldInfo.name, + 'transaction:' + fieldInfo.name, + value + ); + } + if (fieldInfo.maxLength) { + value = stripZeros(value); + if (value.length > fieldInfo.maxLength) { + logger18.throwArgumentError( + 'invalid length for ' + fieldInfo.name, + 'transaction:' + fieldInfo.name, + value + ); + } + } + raw.push(hexlify(value)); + }); + let chainId = 0; + if (transaction.chainId != null) { + chainId = transaction.chainId; + if (typeof chainId !== 'number') { + logger18.throwArgumentError( + 'invalid transaction.chainId', + 'transaction', + transaction + ); + } + } else if (signature2 && !isBytesLike(signature2) && signature2.v > 28) { + chainId = Math.floor((signature2.v - 35) / 2); + } + if (chainId !== 0) { + raw.push(hexlify(chainId)); + raw.push('0x'); + raw.push('0x'); + } + if (!signature2) { + return encode(raw); + } + const sig = splitSignature(signature2); + let v = 27 + sig.recoveryParam; + if (chainId !== 0) { + raw.pop(); + raw.pop(); + raw.pop(); + v += chainId * 2 + 8; + if (sig.v > 28 && sig.v !== v) { + logger18.throwArgumentError( + 'transaction.chainId/signature.v mismatch', + 'signature', + signature2 + ); + } + } else if (sig.v !== v) { + logger18.throwArgumentError( + 'transaction.chainId/signature.v mismatch', + 'signature', + signature2 + ); + } + raw.push(hexlify(v)); + raw.push(stripZeros(arrayify(sig.r))); + raw.push(stripZeros(arrayify(sig.s))); + return encode(raw); +} +function serialize(transaction, signature2) { + if (transaction.type == null || transaction.type === 0) { + if (transaction.accessList != null) { + logger18.throwArgumentError( + 'untyped transactions do not support accessList; include type: 1', + 'transaction', + transaction + ); + } + return _serialize(transaction, signature2); + } + switch (transaction.type) { + case 1: + return _serializeEip2930(transaction, signature2); + case 2: + return _serializeEip1559(transaction, signature2); + default: + break; + } + return logger18.throwError( + `unsupported transaction type: ${transaction.type}`, + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'serializeTransaction', + transactionType: transaction.type, + } + ); +} +function _parseEipSignature(tx, fields, serialize3) { + try { + const recid = handleNumber(fields[0]).toNumber(); + if (recid !== 0 && recid !== 1) { + throw new Error('bad recid'); + } + tx.v = recid; + } catch (error) { + logger18.throwArgumentError( + 'invalid v for transaction type: 1', + 'v', + fields[0] + ); + } + tx.r = hexZeroPad(fields[1], 32); + tx.s = hexZeroPad(fields[2], 32); + try { + const digest = keccak256(serialize3(tx)); + tx.from = recoverAddress(digest, { r: tx.r, s: tx.s, recoveryParam: tx.v }); + } catch (error) {} +} +function _parseEip1559(payload) { + const transaction = decode(payload.slice(1)); + if (transaction.length !== 9 && transaction.length !== 12) { + logger18.throwArgumentError( + 'invalid component count for transaction type: 2', + 'payload', + hexlify(payload) + ); + } + const maxPriorityFeePerGas = handleNumber(transaction[2]); + const maxFeePerGas = handleNumber(transaction[3]); + const tx = { + type: 2, + chainId: handleNumber(transaction[0]).toNumber(), + nonce: handleNumber(transaction[1]).toNumber(), + maxPriorityFeePerGas, + maxFeePerGas, + gasPrice: null, + gasLimit: handleNumber(transaction[4]), + to: handleAddress(transaction[5]), + value: handleNumber(transaction[6]), + data: transaction[7], + accessList: accessListify(transaction[8]), + }; + if (transaction.length === 9) { + return tx; + } + tx.hash = keccak256(payload); + _parseEipSignature(tx, transaction.slice(9), _serializeEip1559); + return tx; +} +function _parseEip2930(payload) { + const transaction = decode(payload.slice(1)); + if (transaction.length !== 8 && transaction.length !== 11) { + logger18.throwArgumentError( + 'invalid component count for transaction type: 1', + 'payload', + hexlify(payload) + ); + } + const tx = { + type: 1, + chainId: handleNumber(transaction[0]).toNumber(), + nonce: handleNumber(transaction[1]).toNumber(), + gasPrice: handleNumber(transaction[2]), + gasLimit: handleNumber(transaction[3]), + to: handleAddress(transaction[4]), + value: handleNumber(transaction[5]), + data: transaction[6], + accessList: accessListify(transaction[7]), + }; + if (transaction.length === 8) { + return tx; + } + tx.hash = keccak256(payload); + _parseEipSignature(tx, transaction.slice(8), _serializeEip2930); + return tx; +} +function _parse(rawTransaction) { + const transaction = decode(rawTransaction); + if (transaction.length !== 9 && transaction.length !== 6) { + logger18.throwArgumentError( + 'invalid raw transaction', + 'rawTransaction', + rawTransaction + ); + } + const tx = { + nonce: handleNumber(transaction[0]).toNumber(), + gasPrice: handleNumber(transaction[1]), + gasLimit: handleNumber(transaction[2]), + to: handleAddress(transaction[3]), + value: handleNumber(transaction[4]), + data: transaction[5], + chainId: 0, + }; + if (transaction.length === 6) { + return tx; + } + try { + tx.v = BigNumber.from(transaction[6]).toNumber(); + } catch (error) { + return tx; + } + tx.r = hexZeroPad(transaction[7], 32); + tx.s = hexZeroPad(transaction[8], 32); + if (BigNumber.from(tx.r).isZero() && BigNumber.from(tx.s).isZero()) { + tx.chainId = tx.v; + tx.v = 0; + } else { + tx.chainId = Math.floor((tx.v - 35) / 2); + if (tx.chainId < 0) { + tx.chainId = 0; + } + let recoveryParam = tx.v - 27; + const raw = transaction.slice(0, 6); + if (tx.chainId !== 0) { + raw.push(hexlify(tx.chainId)); + raw.push('0x'); + raw.push('0x'); + recoveryParam -= tx.chainId * 2 + 8; + } + const digest = keccak256(encode(raw)); + try { + tx.from = recoverAddress(digest, { + r: hexlify(tx.r), + s: hexlify(tx.s), + recoveryParam, + }); + } catch (error) {} + tx.hash = keccak256(rawTransaction); + } + tx.type = null; + return tx; +} +function parse(rawTransaction) { + const payload = arrayify(rawTransaction); + if (payload[0] > 127) { + return _parse(payload); + } + switch (payload[0]) { + case 1: + return _parseEip2930(payload); + case 2: + return _parseEip1559(payload); + default: + break; + } + return logger18.throwError( + `unsupported transaction type: ${payload[0]}`, + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'parseTransaction', + transactionType: payload[0], + } + ); +} +var logger18, TransactionTypes, transactionFields, allowedTransactionKeys2; +var init_lib17 = __esm({ + 'node_modules/@ethersproject/transactions/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_lib7(); + init_lib3(); + init_lib2(); + init_lib8(); + init_lib5(); + init_lib4(); + init_lib6(); + init_lib16(); + init_lib(); + init_version13(); + logger18 = new Logger(version14); + (function (TransactionTypes2) { + TransactionTypes2[(TransactionTypes2['legacy'] = 0)] = 'legacy'; + TransactionTypes2[(TransactionTypes2['eip2930'] = 1)] = 'eip2930'; + TransactionTypes2[(TransactionTypes2['eip1559'] = 2)] = 'eip1559'; + })(TransactionTypes || (TransactionTypes = {})); + transactionFields = [ + { name: 'nonce', maxLength: 32, numeric: true }, + { name: 'gasPrice', maxLength: 32, numeric: true }, + { name: 'gasLimit', maxLength: 32, numeric: true }, + { name: 'to', length: 20 }, + { name: 'value', maxLength: 32, numeric: true }, + { name: 'data' }, + ]; + allowedTransactionKeys2 = { + chainId: true, + data: true, + gasLimit: true, + gasPrice: true, + nonce: true, + to: true, + type: true, + value: true, + }; + }, +}); + +// node_modules/@ethersproject/basex/lib.esm/index.js +var lib_exports14 = {}; +__export(lib_exports14, { + Base32: () => Base32, + Base58: () => Base58, + BaseX: () => BaseX, +}); +var BaseX, Base32, Base58; +var init_lib18 = __esm({ + 'node_modules/@ethersproject/basex/lib.esm/index.js'() { + init_shim(); + init_lib2(); + init_lib4(); + BaseX = class { + constructor(alphabet) { + defineReadOnly(this, 'alphabet', alphabet); + defineReadOnly(this, 'base', alphabet.length); + defineReadOnly(this, '_alphabetMap', {}); + defineReadOnly(this, '_leader', alphabet.charAt(0)); + for (let i2 = 0; i2 < alphabet.length; i2++) { + this._alphabetMap[alphabet.charAt(i2)] = i2; + } + } + encode(value) { + let source = arrayify(value); + if (source.length === 0) { + return ''; + } + let digits = [0]; + for (let i2 = 0; i2 < source.length; ++i2) { + let carry = source[i2]; + for (let j = 0; j < digits.length; ++j) { + carry += digits[j] << 8; + digits[j] = carry % this.base; + carry = (carry / this.base) | 0; + } + while (carry > 0) { + digits.push(carry % this.base); + carry = (carry / this.base) | 0; + } + } + let string = ''; + for (let k = 0; source[k] === 0 && k < source.length - 1; ++k) { + string += this._leader; + } + for (let q = digits.length - 1; q >= 0; --q) { + string += this.alphabet[digits[q]]; + } + return string; + } + decode(value) { + if (typeof value !== 'string') { + throw new TypeError('Expected String'); + } + let bytes = []; + if (value.length === 0) { + return new Uint8Array(bytes); + } + bytes.push(0); + for (let i2 = 0; i2 < value.length; i2++) { + let byte = this._alphabetMap[value[i2]]; + if (byte === void 0) { + throw new Error('Non-base' + this.base + ' character'); + } + let carry = byte; + for (let j = 0; j < bytes.length; ++j) { + carry += bytes[j] * this.base; + bytes[j] = carry & 255; + carry >>= 8; + } + while (carry > 0) { + bytes.push(carry & 255); + carry >>= 8; + } + } + for ( + let k = 0; + value[k] === this._leader && k < value.length - 1; + ++k + ) { + bytes.push(0); + } + return arrayify(new Uint8Array(bytes.reverse())); + } + }; + Base32 = new BaseX('abcdefghijklmnopqrstuvwxyz234567'); + Base58 = new BaseX( + '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' + ); + }, +}); + +// node_modules/@ethersproject/sha2/lib.esm/types.js +var SupportedAlgorithm; +var init_types = __esm({ + 'node_modules/@ethersproject/sha2/lib.esm/types.js'() { + init_shim(); + (function (SupportedAlgorithm2) { + SupportedAlgorithm2['sha256'] = 'sha256'; + SupportedAlgorithm2['sha512'] = 'sha512'; + })(SupportedAlgorithm || (SupportedAlgorithm = {})); + }, +}); + +// node_modules/@ethersproject/sha2/lib.esm/_version.js +var version16; +var init_version14 = __esm({ + 'node_modules/@ethersproject/sha2/lib.esm/_version.js'() { + init_shim(); + version16 = 'sha2/5.7.0'; + }, +}); + +// node_modules/@ethersproject/sha2/lib.esm/sha2.js +function ripemd160(data) { + return ( + '0x' + import_hash3.default.ripemd160().update(arrayify(data)).digest('hex') + ); +} +function sha256(data) { + return ( + '0x' + import_hash3.default.sha256().update(arrayify(data)).digest('hex') + ); +} +function sha512(data) { + return ( + '0x' + import_hash3.default.sha512().update(arrayify(data)).digest('hex') + ); +} +function computeHmac(algorithm, key2, data) { + if (!SupportedAlgorithm[algorithm]) { + logger20.throwError( + 'unsupported algorithm ' + algorithm, + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'hmac', + algorithm, + } + ); + } + return ( + '0x' + + import_hash3.default + .hmac(import_hash3.default[algorithm], arrayify(key2)) + .update(arrayify(data)) + .digest('hex') + ); +} +var import_hash3, logger20; +var init_sha2 = __esm({ + 'node_modules/@ethersproject/sha2/lib.esm/sha2.js'() { + 'use strict'; + init_shim(); + import_hash3 = __toESM(require_hash()); + init_lib2(); + init_types(); + init_lib(); + init_version14(); + logger20 = new Logger(version16); + }, +}); + +// node_modules/@ethersproject/sha2/lib.esm/index.js +var lib_exports15 = {}; +__export(lib_exports15, { + SupportedAlgorithm: () => SupportedAlgorithm, + computeHmac: () => computeHmac, + ripemd160: () => ripemd160, + sha256: () => sha256, + sha512: () => sha512, +}); +var init_lib19 = __esm({ + 'node_modules/@ethersproject/sha2/lib.esm/index.js'() { + init_shim(); + init_sha2(); + init_types(); + }, +}); + +// node_modules/@ethersproject/pbkdf2/lib.esm/pbkdf2.js +function pbkdf2(password, salt, iterations, keylen, hashAlgorithm) { + password = arrayify(password); + salt = arrayify(salt); + let hLen; + let l2 = 1; + const DK = new Uint8Array(keylen); + const block1 = new Uint8Array(salt.length + 4); + block1.set(salt); + let r3; + let T; + for (let i2 = 1; i2 <= l2; i2++) { + block1[salt.length] = (i2 >> 24) & 255; + block1[salt.length + 1] = (i2 >> 16) & 255; + block1[salt.length + 2] = (i2 >> 8) & 255; + block1[salt.length + 3] = i2 & 255; + let U = arrayify(computeHmac(hashAlgorithm, password, block1)); + if (!hLen) { + hLen = U.length; + T = new Uint8Array(hLen); + l2 = Math.ceil(keylen / hLen); + r3 = keylen - (l2 - 1) * hLen; + } + T.set(U); + for (let j = 1; j < iterations; j++) { + U = arrayify(computeHmac(hashAlgorithm, password, U)); + for (let k = 0; k < hLen; k++) T[k] ^= U[k]; + } + const destPos = (i2 - 1) * hLen; + const len = i2 === l2 ? r3 : hLen; + DK.set(arrayify(T).slice(0, len), destPos); + } + return hexlify(DK); +} +var init_pbkdf2 = __esm({ + 'node_modules/@ethersproject/pbkdf2/lib.esm/pbkdf2.js'() { + 'use strict'; + init_shim(); + init_lib2(); + init_lib19(); + }, +}); + +// node_modules/@ethersproject/pbkdf2/lib.esm/index.js +var init_lib20 = __esm({ + 'node_modules/@ethersproject/pbkdf2/lib.esm/index.js'() { + init_shim(); + init_pbkdf2(); + }, +}); + +// node_modules/@ethersproject/wordlists/lib.esm/_version.js +var version17; +var init_version15 = __esm({ + 'node_modules/@ethersproject/wordlists/lib.esm/_version.js'() { + init_shim(); + version17 = 'wordlists/5.7.0'; + }, +}); + +// node_modules/@ethersproject/wordlists/lib.esm/wordlist.js +var exportWordlist, logger21, Wordlist; +var init_wordlist = __esm({ + 'node_modules/@ethersproject/wordlists/lib.esm/wordlist.js'() { + 'use strict'; + init_shim(); + init_lib12(); + init_lib4(); + init_lib(); + init_version15(); + exportWordlist = false; + logger21 = new Logger(version17); + Wordlist = class { + constructor(locale) { + logger21.checkAbstract(new.target, Wordlist); + defineReadOnly(this, 'locale', locale); + } + // Subclasses may override this + split(mnemonic) { + return mnemonic.toLowerCase().split(/ +/g); + } + // Subclasses may override this + join(words2) { + return words2.join(' '); + } + static check(wordlist2) { + const words2 = []; + for (let i2 = 0; i2 < 2048; i2++) { + const word = wordlist2.getWord(i2); + if (i2 !== wordlist2.getWordIndex(word)) { + return '0x'; + } + words2.push(word); + } + return id(words2.join('\n') + '\n'); + } + static register(lang, name) { + if (!name) { + name = lang.locale; + } + if (exportWordlist) { + try { + const anyGlobal2 = window; + if (anyGlobal2._ethers && anyGlobal2._ethers.wordlists) { + if (!anyGlobal2._ethers.wordlists[name]) { + defineReadOnly(anyGlobal2._ethers.wordlists, name, lang); + } + } + } catch (error) {} + } + } + }; + }, +}); + +// node_modules/@ethersproject/wordlists/lib.esm/lang-en.js +function loadWords(lang) { + if (wordlist != null) { + return; + } + wordlist = words + .replace(/([A-Z])/g, ' $1') + .toLowerCase() + .substring(1) + .split(' '); + if ( + Wordlist.check(lang) !== + '0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60' + ) { + wordlist = null; + throw new Error('BIP39 Wordlist for en (English) FAILED'); + } +} +var words, wordlist, LangEn, langEn; +var init_lang_en = __esm({ + 'node_modules/@ethersproject/wordlists/lib.esm/lang-en.js'() { + 'use strict'; + init_shim(); + init_wordlist(); + words = + 'AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo'; + wordlist = null; + LangEn = class extends Wordlist { + constructor() { + super('en'); + } + getWord(index) { + loadWords(this); + return wordlist[index]; + } + getWordIndex(word) { + loadWords(this); + return wordlist.indexOf(word); + } + }; + langEn = new LangEn(); + Wordlist.register(langEn); + }, +}); + +// node_modules/@ethersproject/wordlists/lib.esm/wordlists.js +var wordlists; +var init_wordlists = __esm({ + 'node_modules/@ethersproject/wordlists/lib.esm/wordlists.js'() { + 'use strict'; + init_shim(); + init_lang_en(); + wordlists = { + en: langEn, + }; + }, +}); + +// node_modules/@ethersproject/wordlists/lib.esm/index.js +var init_lib21 = __esm({ + 'node_modules/@ethersproject/wordlists/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_wordlist(); + init_wordlists(); + }, +}); + +// node_modules/@ethersproject/hdnode/lib.esm/_version.js +var version18; +var init_version16 = __esm({ + 'node_modules/@ethersproject/hdnode/lib.esm/_version.js'() { + init_shim(); + version18 = 'hdnode/5.7.0'; + }, +}); + +// node_modules/@ethersproject/hdnode/lib.esm/index.js +var lib_exports16 = {}; +__export(lib_exports16, { + HDNode: () => HDNode, + defaultPath: () => defaultPath, + entropyToMnemonic: () => entropyToMnemonic, + getAccountPath: () => getAccountPath, + isValidMnemonic: () => isValidMnemonic, + mnemonicToEntropy: () => mnemonicToEntropy, + mnemonicToSeed: () => mnemonicToSeed, +}); +function getUpperMask(bits) { + return ((1 << bits) - 1) << (8 - bits); +} +function getLowerMask(bits) { + return (1 << bits) - 1; +} +function bytes32(value) { + return hexZeroPad(hexlify(value), 32); +} +function base58check(data) { + return Base58.encode( + concat([data, hexDataSlice(sha256(sha256(data)), 0, 4)]) + ); +} +function getWordlist(wordlist2) { + if (wordlist2 == null) { + return wordlists['en']; + } + if (typeof wordlist2 === 'string') { + const words2 = wordlists[wordlist2]; + if (words2 == null) { + logger22.throwArgumentError('unknown locale', 'wordlist', wordlist2); + } + return words2; + } + return wordlist2; +} +function mnemonicToSeed(mnemonic, password) { + if (!password) { + password = ''; + } + const salt = toUtf8Bytes( + 'mnemonic' + password, + UnicodeNormalizationForm.NFKD + ); + return pbkdf2( + toUtf8Bytes(mnemonic, UnicodeNormalizationForm.NFKD), + salt, + 2048, + 64, + 'sha512' + ); +} +function mnemonicToEntropy(mnemonic, wordlist2) { + wordlist2 = getWordlist(wordlist2); + logger22.checkNormalize(); + const words2 = wordlist2.split(mnemonic); + if (words2.length % 3 !== 0) { + throw new Error('invalid mnemonic'); + } + const entropy = arrayify(new Uint8Array(Math.ceil((11 * words2.length) / 8))); + let offset = 0; + for (let i2 = 0; i2 < words2.length; i2++) { + let index = wordlist2.getWordIndex(words2[i2].normalize('NFKD')); + if (index === -1) { + throw new Error('invalid mnemonic'); + } + for (let bit = 0; bit < 11; bit++) { + if (index & (1 << (10 - bit))) { + entropy[offset >> 3] |= 1 << (7 - (offset % 8)); + } + offset++; + } + } + const entropyBits = (32 * words2.length) / 3; + const checksumBits = words2.length / 3; + const checksumMask = getUpperMask(checksumBits); + const checksum = + arrayify(sha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask; + if (checksum !== (entropy[entropy.length - 1] & checksumMask)) { + throw new Error('invalid checksum'); + } + return hexlify(entropy.slice(0, entropyBits / 8)); +} +function entropyToMnemonic(entropy, wordlist2) { + wordlist2 = getWordlist(wordlist2); + entropy = arrayify(entropy); + if (entropy.length % 4 !== 0 || entropy.length < 16 || entropy.length > 32) { + throw new Error('invalid entropy'); + } + const indices = [0]; + let remainingBits = 11; + for (let i2 = 0; i2 < entropy.length; i2++) { + if (remainingBits > 8) { + indices[indices.length - 1] <<= 8; + indices[indices.length - 1] |= entropy[i2]; + remainingBits -= 8; + } else { + indices[indices.length - 1] <<= remainingBits; + indices[indices.length - 1] |= entropy[i2] >> (8 - remainingBits); + indices.push(entropy[i2] & getLowerMask(8 - remainingBits)); + remainingBits += 3; + } + } + const checksumBits = entropy.length / 4; + const checksum = arrayify(sha256(entropy))[0] & getUpperMask(checksumBits); + indices[indices.length - 1] <<= checksumBits; + indices[indices.length - 1] |= checksum >> (8 - checksumBits); + return wordlist2.join(indices.map((index) => wordlist2.getWord(index))); +} +function isValidMnemonic(mnemonic, wordlist2) { + try { + mnemonicToEntropy(mnemonic, wordlist2); + return true; + } catch (error) {} + return false; +} +function getAccountPath(index) { + if ( + typeof index !== 'number' || + index < 0 || + index >= HardenedBit || + index % 1 + ) { + logger22.throwArgumentError('invalid account index', 'index', index); + } + return `m/44'/60'/${index}'/0/0`; +} +var logger22, + N, + MasterSecret, + HardenedBit, + _constructorGuard4, + defaultPath, + HDNode; +var init_lib22 = __esm({ + 'node_modules/@ethersproject/hdnode/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_lib18(); + init_lib2(); + init_lib3(); + init_lib9(); + init_lib20(); + init_lib4(); + init_lib16(); + init_lib19(); + init_lib17(); + init_lib21(); + init_lib(); + init_version16(); + logger22 = new Logger(version18); + N = BigNumber.from( + '0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141' + ); + MasterSecret = toUtf8Bytes('Bitcoin seed'); + HardenedBit = 2147483648; + _constructorGuard4 = {}; + defaultPath = "m/44'/60'/0'/0/0"; + HDNode = class { + /** + * This constructor should not be called directly. + * + * Please use: + * - fromMnemonic + * - fromSeed + */ + constructor( + constructorGuard, + privateKey, + publicKey, + parentFingerprint, + chainCode, + index, + depth, + mnemonicOrPath + ) { + if (constructorGuard !== _constructorGuard4) { + throw new Error('HDNode constructor cannot be called directly'); + } + if (privateKey) { + const signingKey = new SigningKey(privateKey); + defineReadOnly(this, 'privateKey', signingKey.privateKey); + defineReadOnly(this, 'publicKey', signingKey.compressedPublicKey); + } else { + defineReadOnly(this, 'privateKey', null); + defineReadOnly(this, 'publicKey', hexlify(publicKey)); + } + defineReadOnly(this, 'parentFingerprint', parentFingerprint); + defineReadOnly( + this, + 'fingerprint', + hexDataSlice(ripemd160(sha256(this.publicKey)), 0, 4) + ); + defineReadOnly(this, 'address', computeAddress(this.publicKey)); + defineReadOnly(this, 'chainCode', chainCode); + defineReadOnly(this, 'index', index); + defineReadOnly(this, 'depth', depth); + if (mnemonicOrPath == null) { + defineReadOnly(this, 'mnemonic', null); + defineReadOnly(this, 'path', null); + } else if (typeof mnemonicOrPath === 'string') { + defineReadOnly(this, 'mnemonic', null); + defineReadOnly(this, 'path', mnemonicOrPath); + } else { + defineReadOnly(this, 'mnemonic', mnemonicOrPath); + defineReadOnly(this, 'path', mnemonicOrPath.path); + } + } + get extendedKey() { + if (this.depth >= 256) { + throw new Error('Depth too large!'); + } + return base58check( + concat([ + this.privateKey != null ? '0x0488ADE4' : '0x0488B21E', + hexlify(this.depth), + this.parentFingerprint, + hexZeroPad(hexlify(this.index), 4), + this.chainCode, + this.privateKey != null + ? concat(['0x00', this.privateKey]) + : this.publicKey, + ]) + ); + } + neuter() { + return new HDNode( + _constructorGuard4, + null, + this.publicKey, + this.parentFingerprint, + this.chainCode, + this.index, + this.depth, + this.path + ); + } + _derive(index) { + if (index > 4294967295) { + throw new Error('invalid index - ' + String(index)); + } + let path = this.path; + if (path) { + path += '/' + (index & ~HardenedBit); + } + const data = new Uint8Array(37); + if (index & HardenedBit) { + if (!this.privateKey) { + throw new Error('cannot derive child of neutered node'); + } + data.set(arrayify(this.privateKey), 1); + if (path) { + path += "'"; + } + } else { + data.set(arrayify(this.publicKey)); + } + for (let i2 = 24; i2 >= 0; i2 -= 8) { + data[33 + (i2 >> 3)] = (index >> (24 - i2)) & 255; + } + const I2 = arrayify( + computeHmac(SupportedAlgorithm.sha512, this.chainCode, data) + ); + const IL = I2.slice(0, 32); + const IR = I2.slice(32); + let ki = null; + let Ki = null; + if (this.privateKey) { + ki = bytes32(BigNumber.from(IL).add(this.privateKey).mod(N)); + } else { + const ek = new SigningKey(hexlify(IL)); + Ki = ek._addPoint(this.publicKey); + } + let mnemonicOrPath = path; + const srcMnemonic = this.mnemonic; + if (srcMnemonic) { + mnemonicOrPath = Object.freeze({ + phrase: srcMnemonic.phrase, + path, + locale: srcMnemonic.locale || 'en', + }); + } + return new HDNode( + _constructorGuard4, + ki, + Ki, + this.fingerprint, + bytes32(IR), + index, + this.depth + 1, + mnemonicOrPath + ); + } + derivePath(path) { + const components = path.split('/'); + if ( + components.length === 0 || + (components[0] === 'm' && this.depth !== 0) + ) { + throw new Error('invalid path - ' + path); + } + if (components[0] === 'm') { + components.shift(); + } + let result = this; + for (let i2 = 0; i2 < components.length; i2++) { + const component = components[i2]; + if (component.match(/^[0-9]+'$/)) { + const index = parseInt( + component.substring(0, component.length - 1) + ); + if (index >= HardenedBit) { + throw new Error('invalid path index - ' + component); + } + result = result._derive(HardenedBit + index); + } else if (component.match(/^[0-9]+$/)) { + const index = parseInt(component); + if (index >= HardenedBit) { + throw new Error('invalid path index - ' + component); + } + result = result._derive(index); + } else { + throw new Error('invalid path component - ' + component); + } + } + return result; + } + static _fromSeed(seed, mnemonic) { + const seedArray = arrayify(seed); + if (seedArray.length < 16 || seedArray.length > 64) { + throw new Error('invalid seed'); + } + const I2 = arrayify( + computeHmac(SupportedAlgorithm.sha512, MasterSecret, seedArray) + ); + return new HDNode( + _constructorGuard4, + bytes32(I2.slice(0, 32)), + null, + '0x00000000', + bytes32(I2.slice(32)), + 0, + 0, + mnemonic + ); + } + static fromMnemonic(mnemonic, password, wordlist2) { + wordlist2 = getWordlist(wordlist2); + mnemonic = entropyToMnemonic( + mnemonicToEntropy(mnemonic, wordlist2), + wordlist2 + ); + return HDNode._fromSeed(mnemonicToSeed(mnemonic, password), { + phrase: mnemonic, + path: 'm', + locale: wordlist2.locale, + }); + } + static fromSeed(seed) { + return HDNode._fromSeed(seed, null); + } + static fromExtendedKey(extendedKey) { + const bytes = Base58.decode(extendedKey); + if ( + bytes.length !== 82 || + base58check(bytes.slice(0, 78)) !== extendedKey + ) { + logger22.throwArgumentError( + 'invalid extended key', + 'extendedKey', + '[REDACTED]' + ); + } + const depth = bytes[4]; + const parentFingerprint = hexlify(bytes.slice(5, 9)); + const index = parseInt(hexlify(bytes.slice(9, 13)).substring(2), 16); + const chainCode = hexlify(bytes.slice(13, 45)); + const key2 = bytes.slice(45, 78); + switch (hexlify(bytes.slice(0, 4))) { + case '0x0488b21e': + case '0x043587cf': + return new HDNode( + _constructorGuard4, + null, + hexlify(key2), + parentFingerprint, + chainCode, + index, + depth, + null + ); + case '0x0488ade4': + case '0x04358394 ': + if (key2[0] !== 0) { + break; + } + return new HDNode( + _constructorGuard4, + hexlify(key2.slice(1)), + null, + parentFingerprint, + chainCode, + index, + depth, + null + ); + } + return logger22.throwArgumentError( + 'invalid extended key', + 'extendedKey', + '[REDACTED]' + ); + } + }; + }, +}); + +// node_modules/@ethersproject/random/lib.esm/_version.js +var version19; +var init_version17 = __esm({ + 'node_modules/@ethersproject/random/lib.esm/_version.js'() { + init_shim(); + version19 = 'random/5.7.0'; + }, +}); + +// node_modules/@ethersproject/random/lib.esm/random.js +function getGlobal() { + if (typeof self !== 'undefined') { + return self; + } + if (typeof window !== 'undefined') { + return window; + } + if (typeof global !== 'undefined') { + return global; + } + throw new Error('unable to locate global object'); +} +function randomBytes(length) { + if (length <= 0 || length > 1024 || length % 1 || length != length) { + logger23.throwArgumentError('invalid length', 'length', length); + } + const result = new Uint8Array(length); + crypto2.getRandomValues(result); + return arrayify(result); +} +var logger23, anyGlobal, crypto2; +var init_random = __esm({ + 'node_modules/@ethersproject/random/lib.esm/random.js'() { + 'use strict'; + init_shim(); + init_lib2(); + init_lib(); + init_version17(); + logger23 = new Logger(version19); + anyGlobal = getGlobal(); + crypto2 = anyGlobal.crypto || anyGlobal.msCrypto; + if (!crypto2 || !crypto2.getRandomValues) { + logger23.warn('WARNING: Missing strong random number source'); + crypto2 = { + getRandomValues: function (buffer) { + return logger23.throwError( + 'no secure random source avaialble', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'crypto.getRandomValues', + } + ); + }, + }; + } + }, +}); + +// node_modules/@ethersproject/random/lib.esm/shuffle.js +function shuffled(array) { + array = array.slice(); + for (let i2 = array.length - 1; i2 > 0; i2--) { + const j = Math.floor(Math.random() * (i2 + 1)); + const tmp = array[i2]; + array[i2] = array[j]; + array[j] = tmp; + } + return array; +} +var init_shuffle = __esm({ + 'node_modules/@ethersproject/random/lib.esm/shuffle.js'() { + 'use strict'; + init_shim(); + }, +}); + +// node_modules/@ethersproject/random/lib.esm/index.js +var lib_exports17 = {}; +__export(lib_exports17, { + randomBytes: () => randomBytes, + shuffled: () => shuffled, +}); +var init_lib23 = __esm({ + 'node_modules/@ethersproject/random/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_random(); + init_shuffle(); + }, +}); + +// node_modules/aes-js/index.js +var require_aes_js = __commonJS({ + 'node_modules/aes-js/index.js'(exports, module2) { + 'use strict'; + init_shim(); + (function (root) { + function checkInt(value) { + return parseInt(value) === value; + } + function checkInts(arrayish) { + if (!checkInt(arrayish.length)) { + return false; + } + for (var i2 = 0; i2 < arrayish.length; i2++) { + if ( + !checkInt(arrayish[i2]) || + arrayish[i2] < 0 || + arrayish[i2] > 255 + ) { + return false; + } + } + return true; + } + function coerceArray(arg, copy) { + if ( + arg.buffer && + ArrayBuffer.isView(arg) && + arg.name === 'Uint8Array' + ) { + if (copy) { + if (arg.slice) { + arg = arg.slice(); + } else { + arg = Array.prototype.slice.call(arg); + } + } + return arg; + } + if (Array.isArray(arg)) { + if (!checkInts(arg)) { + throw new Error('Array contains invalid value: ' + arg); + } + return new Uint8Array(arg); + } + if (checkInt(arg.length) && checkInts(arg)) { + return new Uint8Array(arg); + } + throw new Error('unsupported array-like object'); + } + function createArray(length) { + return new Uint8Array(length); + } + function copyArray( + sourceArray, + targetArray, + targetStart, + sourceStart, + sourceEnd + ) { + if (sourceStart != null || sourceEnd != null) { + if (sourceArray.slice) { + sourceArray = sourceArray.slice(sourceStart, sourceEnd); + } else { + sourceArray = Array.prototype.slice.call( + sourceArray, + sourceStart, + sourceEnd + ); + } + } + targetArray.set(sourceArray, targetStart); + } + var convertUtf8 = (function () { + function toBytes(text) { + var result = [], + i2 = 0; + text = encodeURI(text); + while (i2 < text.length) { + var c = text.charCodeAt(i2++); + if (c === 37) { + result.push(parseInt(text.substr(i2, 2), 16)); + i2 += 2; + } else { + result.push(c); + } + } + return coerceArray(result); + } + function fromBytes(bytes) { + var result = [], + i2 = 0; + while (i2 < bytes.length) { + var c = bytes[i2]; + if (c < 128) { + result.push(String.fromCharCode(c)); + i2++; + } else if (c > 191 && c < 224) { + result.push( + String.fromCharCode(((c & 31) << 6) | (bytes[i2 + 1] & 63)) + ); + i2 += 2; + } else { + result.push( + String.fromCharCode( + ((c & 15) << 12) | + ((bytes[i2 + 1] & 63) << 6) | + (bytes[i2 + 2] & 63) + ) + ); + i2 += 3; + } + } + return result.join(''); + } + return { + toBytes, + fromBytes, + }; + })(); + var convertHex = (function () { + function toBytes(text) { + var result = []; + for (var i2 = 0; i2 < text.length; i2 += 2) { + result.push(parseInt(text.substr(i2, 2), 16)); + } + return result; + } + var Hex = '0123456789abcdef'; + function fromBytes(bytes) { + var result = []; + for (var i2 = 0; i2 < bytes.length; i2++) { + var v = bytes[i2]; + result.push(Hex[(v & 240) >> 4] + Hex[v & 15]); + } + return result.join(''); + } + return { + toBytes, + fromBytes, + }; + })(); + var numberOfRounds = { 16: 10, 24: 12, 32: 14 }; + var rcon = [ + 1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, + 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145, + ]; + var S2 = [ + 99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, + 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, + 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, + 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, + 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, + 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, + 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, + 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, + 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, + 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, + 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, + 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, + 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, + 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, + 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, + 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, + 65, 153, 45, 15, 176, 84, 187, 22, + ]; + var Si = [ + 82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, + 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, + 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, + 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, + 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, + 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, + 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, + 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, + 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, + 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, + 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, + 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, + 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, + 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, + 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, + 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, + 105, 20, 99, 85, 33, 12, 125, + ]; + var T1 = [ + 3328402341, 4168907908, 4000806809, 4135287693, 4294111757, 3597364157, + 3731845041, 2445657428, 1613770832, 33620227, 3462883241, 1445669757, + 3892248089, 3050821474, 1303096294, 3967186586, 2412431941, 528646813, + 2311702848, 4202528135, 4026202645, 2992200171, 2387036105, 4226871307, + 1101901292, 3017069671, 1604494077, 1169141738, 597466303, 1403299063, + 3832705686, 2613100635, 1974974402, 3791519004, 1033081774, 1277568618, + 1815492186, 2118074177, 4126668546, 2211236943, 1748251740, 1369810420, + 3521504564, 4193382664, 3799085459, 2883115123, 1647391059, 706024767, + 134480908, 2512897874, 1176707941, 2646852446, 806885416, 932615841, + 168101135, 798661301, 235341577, 605164086, 461406363, 3756188221, + 3454790438, 1311188841, 2142417613, 3933566367, 302582043, 495158174, + 1479289972, 874125870, 907746093, 3698224818, 3025820398, 1537253627, + 2756858614, 1983593293, 3084310113, 2108928974, 1378429307, 3722699582, + 1580150641, 327451799, 2790478837, 3117535592, 0, 3253595436, + 1075847264, 3825007647, 2041688520, 3059440621, 3563743934, 2378943302, + 1740553945, 1916352843, 2487896798, 2555137236, 2958579944, 2244988746, + 3151024235, 3320835882, 1336584933, 3992714006, 2252555205, 2588757463, + 1714631509, 293963156, 2319795663, 3925473552, 67240454, 4269768577, + 2689618160, 2017213508, 631218106, 1269344483, 2723238387, 1571005438, + 2151694528, 93294474, 1066570413, 563977660, 1882732616, 4059428100, + 1673313503, 2008463041, 2950355573, 1109467491, 537923632, 3858759450, + 4260623118, 3218264685, 2177748300, 403442708, 638784309, 3287084079, + 3193921505, 899127202, 2286175436, 773265209, 2479146071, 1437050866, + 4236148354, 2050833735, 3362022572, 3126681063, 840505643, 3866325909, + 3227541664, 427917720, 2655997905, 2749160575, 1143087718, 1412049534, + 999329963, 193497219, 2353415882, 3354324521, 1807268051, 672404540, + 2816401017, 3160301282, 369822493, 2916866934, 3688947771, 1681011286, + 1949973070, 336202270, 2454276571, 201721354, 1210328172, 3093060836, + 2680341085, 3184776046, 1135389935, 3294782118, 965841320, 831886756, + 3554993207, 4068047243, 3588745010, 2345191491, 1849112409, 3664604599, + 26054028, 2983581028, 2622377682, 1235855840, 3630984372, 2891339514, + 4092916743, 3488279077, 3395642799, 4101667470, 1202630377, 268961816, + 1874508501, 4034427016, 1243948399, 1546530418, 941366308, 1470539505, + 1941222599, 2546386513, 3421038627, 2715671932, 3899946140, 1042226977, + 2521517021, 1639824860, 227249030, 260737669, 3765465232, 2084453954, + 1907733956, 3429263018, 2420656344, 100860677, 4160157185, 470683154, + 3261161891, 1781871967, 2924959737, 1773779408, 394692241, 2579611992, + 974986535, 664706745, 3655459128, 3958962195, 731420851, 571543859, + 3530123707, 2849626480, 126783113, 865375399, 765172662, 1008606754, + 361203602, 3387549984, 2278477385, 2857719295, 1344809080, 2782912378, + 59542671, 1503764984, 160008576, 437062935, 1707065306, 3622233649, + 2218934982, 3496503480, 2185314755, 697932208, 1512910199, 504303377, + 2075177163, 2824099068, 1841019862, 739644986, + ]; + var T2 = [ + 2781242211, 2230877308, 2582542199, 2381740923, 234877682, 3184946027, + 2984144751, 1418839493, 1348481072, 50462977, 2848876391, 2102799147, + 434634494, 1656084439, 3863849899, 2599188086, 1167051466, 2636087938, + 1082771913, 2281340285, 368048890, 3954334041, 3381544775, 201060592, + 3963727277, 1739838676, 4250903202, 3930435503, 3206782108, 4149453988, + 2531553906, 1536934080, 3262494647, 484572669, 2923271059, 1783375398, + 1517041206, 1098792767, 49674231, 1334037708, 1550332980, 4098991525, + 886171109, 150598129, 2481090929, 1940642008, 1398944049, 1059722517, + 201851908, 1385547719, 1699095331, 1587397571, 674240536, 2704774806, + 252314885, 3039795866, 151914247, 908333586, 2602270848, 1038082786, + 651029483, 1766729511, 3447698098, 2682942837, 454166793, 2652734339, + 1951935532, 775166490, 758520603, 3000790638, 4004797018, 4217086112, + 4137964114, 1299594043, 1639438038, 3464344499, 2068982057, 1054729187, + 1901997871, 2534638724, 4121318227, 1757008337, 0, 750906861, + 1614815264, 535035132, 3363418545, 3988151131, 3201591914, 1183697867, + 3647454910, 1265776953, 3734260298, 3566750796, 3903871064, 1250283471, + 1807470800, 717615087, 3847203498, 384695291, 3313910595, 3617213773, + 1432761139, 2484176261, 3481945413, 283769337, 100925954, 2180939647, + 4037038160, 1148730428, 3123027871, 3813386408, 4087501137, 4267549603, + 3229630528, 2315620239, 2906624658, 3156319645, 1215313976, 82966005, + 3747855548, 3245848246, 1974459098, 1665278241, 807407632, 451280895, + 251524083, 1841287890, 1283575245, 337120268, 891687699, 801369324, + 3787349855, 2721421207, 3431482436, 959321879, 1469301956, 4065699751, + 2197585534, 1199193405, 2898814052, 3887750493, 724703513, 2514908019, + 2696962144, 2551808385, 3516813135, 2141445340, 1715741218, 2119445034, + 2872807568, 2198571144, 3398190662, 700968686, 3547052216, 1009259540, + 2041044702, 3803995742, 487983883, 1991105499, 1004265696, 1449407026, + 1316239930, 504629770, 3683797321, 168560134, 1816667172, 3837287516, + 1570751170, 1857934291, 4014189740, 2797888098, 2822345105, 2754712981, + 936633572, 2347923833, 852879335, 1133234376, 1500395319, 3084545389, + 2348912013, 1689376213, 3533459022, 3762923945, 3034082412, 4205598294, + 133428468, 634383082, 2949277029, 2398386810, 3913789102, 403703816, + 3580869306, 2297460856, 1867130149, 1918643758, 607656988, 4049053350, + 3346248884, 1368901318, 600565992, 2090982877, 2632479860, 557719327, + 3717614411, 3697393085, 2249034635, 2232388234, 2430627952, 1115438654, + 3295786421, 2865522278, 3633334344, 84280067, 33027830, 303828494, + 2747425121, 1600795957, 4188952407, 3496589753, 2434238086, 1486471617, + 658119965, 3106381470, 953803233, 334231800, 3005978776, 857870609, + 3151128937, 1890179545, 2298973838, 2805175444, 3056442267, 574365214, + 2450884487, 550103529, 1233637070, 4289353045, 2018519080, 2057691103, + 2399374476, 4166623649, 2148108681, 387583245, 3664101311, 836232934, + 3330556482, 3100665960, 3280093505, 2955516313, 2002398509, 287182607, + 3413881008, 4238890068, 3597515707, 975967766, + ]; + var T3 = [ + 1671808611, 2089089148, 2006576759, 2072901243, 4061003762, 1807603307, + 1873927791, 3310653893, 810573872, 16974337, 1739181671, 729634347, + 4263110654, 3613570519, 2883997099, 1989864566, 3393556426, 2191335298, + 3376449993, 2106063485, 4195741690, 1508618841, 1204391495, 4027317232, + 2917941677, 3563566036, 2734514082, 2951366063, 2629772188, 2767672228, + 1922491506, 3227229120, 3082974647, 4246528509, 2477669779, 644500518, + 911895606, 1061256767, 4144166391, 3427763148, 878471220, 2784252325, + 3845444069, 4043897329, 1905517169, 3631459288, 827548209, 356461077, + 67897348, 3344078279, 593839651, 3277757891, 405286936, 2527147926, + 84871685, 2595565466, 118033927, 305538066, 2157648768, 3795705826, + 3945188843, 661212711, 2999812018, 1973414517, 152769033, 2208177539, + 745822252, 439235610, 455947803, 1857215598, 1525593178, 2700827552, + 1391895634, 994932283, 3596728278, 3016654259, 695947817, 3812548067, + 795958831, 2224493444, 1408607827, 3513301457, 0, 3979133421, 543178784, + 4229948412, 2982705585, 1542305371, 1790891114, 3410398667, 3201918910, + 961245753, 1256100938, 1289001036, 1491644504, 3477767631, 3496721360, + 4012557807, 2867154858, 4212583931, 1137018435, 1305975373, 861234739, + 2241073541, 1171229253, 4178635257, 33948674, 2139225727, 1357946960, + 1011120188, 2679776671, 2833468328, 1374921297, 2751356323, 1086357568, + 2408187279, 2460827538, 2646352285, 944271416, 4110742005, 3168756668, + 3066132406, 3665145818, 560153121, 271589392, 4279952895, 4077846003, + 3530407890, 3444343245, 202643468, 322250259, 3962553324, 1608629855, + 2543990167, 1154254916, 389623319, 3294073796, 2817676711, 2122513534, + 1028094525, 1689045092, 1575467613, 422261273, 1939203699, 1621147744, + 2174228865, 1339137615, 3699352540, 577127458, 712922154, 2427141008, + 2290289544, 1187679302, 3995715566, 3100863416, 339486740, 3732514782, + 1591917662, 186455563, 3681988059, 3762019296, 844522546, 978220090, + 169743370, 1239126601, 101321734, 611076132, 1558493276, 3260915650, + 3547250131, 2901361580, 1655096418, 2443721105, 2510565781, 3828863972, + 2039214713, 3878868455, 3359869896, 928607799, 1840765549, 2374762893, + 3580146133, 1322425422, 2850048425, 1823791212, 1459268694, 4094161908, + 3928346602, 1706019429, 2056189050, 2934523822, 135794696, 3134549946, + 2022240376, 628050469, 779246638, 472135708, 2800834470, 3032970164, + 3327236038, 3894660072, 3715932637, 1956440180, 522272287, 1272813131, + 3185336765, 2340818315, 2323976074, 1888542832, 1044544574, 3049550261, + 1722469478, 1222152264, 50660867, 4127324150, 236067854, 1638122081, + 895445557, 1475980887, 3117443513, 2257655686, 3243809217, 489110045, + 2662934430, 3778599393, 4162055160, 2561878936, 288563729, 1773916777, + 3648039385, 2391345038, 2493985684, 2612407707, 505560094, 2274497927, + 3911240169, 3460925390, 1442818645, 678973480, 3749357023, 2358182796, + 2717407649, 2306869641, 219617805, 3218761151, 3862026214, 1120306242, + 1756942440, 1103331905, 2578459033, 762796589, 252780047, 2966125488, + 1425844308, 3151392187, 372911126, + ]; + var T4 = [ + 1667474886, 2088535288, 2004326894, 2071694838, 4075949567, 1802223062, + 1869591006, 3318043793, 808472672, 16843522, 1734846926, 724270422, + 4278065639, 3621216949, 2880169549, 1987484396, 3402253711, 2189597983, + 3385409673, 2105378810, 4210693615, 1499065266, 1195886990, 4042263547, + 2913856577, 3570689971, 2728590687, 2947541573, 2627518243, 2762274643, + 1920112356, 3233831835, 3082273397, 4261223649, 2475929149, 640051788, + 909531756, 1061110142, 4160160501, 3435941763, 875846760, 2779116625, + 3857003729, 4059105529, 1903268834, 3638064043, 825316194, 353713962, + 67374088, 3351728789, 589522246, 3284360861, 404236336, 2526454071, + 84217610, 2593830191, 117901582, 303183396, 2155911963, 3806477791, + 3958056653, 656894286, 2998062463, 1970642922, 151591698, 2206440989, + 741110872, 437923380, 454765878, 1852748508, 1515908788, 2694904667, + 1381168804, 993742198, 3604373943, 3014905469, 690584402, 3823320797, + 791638366, 2223281939, 1398011302, 3520161977, 0, 3991743681, 538992704, + 4244381667, 2981218425, 1532751286, 1785380564, 3419096717, 3200178535, + 960056178, 1246420628, 1280103576, 1482221744, 3486468741, 3503319995, + 4025428677, 2863326543, 4227536621, 1128514950, 1296947098, 859002214, + 2240123921, 1162203018, 4193849577, 33687044, 2139062782, 1347481760, + 1010582648, 2678045221, 2829640523, 1364325282, 2745433693, 1077985408, + 2408548869, 2459086143, 2644360225, 943212656, 4126475505, 3166494563, + 3065430391, 3671750063, 555836226, 269496352, 4294908645, 4092792573, + 3537006015, 3452783745, 202118168, 320025894, 3974901699, 1600119230, + 2543297077, 1145359496, 387397934, 3301201811, 2812801621, 2122220284, + 1027426170, 1684319432, 1566435258, 421079858, 1936954854, 1616945344, + 2172753945, 1330631070, 3705438115, 572679748, 707427924, 2425400123, + 2290647819, 1179044492, 4008585671, 3099120491, 336870440, 3739122087, + 1583276732, 185277718, 3688593069, 3772791771, 842159716, 976899700, + 168435220, 1229577106, 101059084, 606366792, 1549591736, 3267517855, + 3553849021, 2897014595, 1650632388, 2442242105, 2509612081, 3840161747, + 2038008818, 3890688725, 3368567691, 926374254, 1835907034, 2374863873, + 3587531953, 1313788572, 2846482505, 1819063512, 1448540844, 4109633523, + 3941213647, 1701162954, 2054852340, 2930698567, 134748176, 3132806511, + 2021165296, 623210314, 774795868, 471606328, 2795958615, 3031746419, + 3334885783, 3907527627, 3722280097, 1953799400, 522133822, 1263263126, + 3183336545, 2341176845, 2324333839, 1886425312, 1044267644, 3048588401, + 1718004428, 1212733584, 50529542, 4143317495, 235803164, 1633788866, + 892690282, 1465383342, 3115962473, 2256965911, 3250673817, 488449850, + 2661202215, 3789633753, 4177007595, 2560144171, 286339874, 1768537042, + 3654906025, 2391705863, 2492770099, 2610673197, 505291324, 2273808917, + 3924369609, 3469625735, 1431699370, 673740880, 3755965093, 2358021891, + 2711746649, 2307489801, 218961690, 3217021541, 3873845719, 1111672452, + 1751693520, 1094828930, 2576986153, 757954394, 252645662, 2964376443, + 1414855848, 3149649517, 370555436, + ]; + var T5 = [ + 1374988112, 2118214995, 437757123, 975658646, 1001089995, 530400753, + 2902087851, 1273168787, 540080725, 2910219766, 2295101073, 4110568485, + 1340463100, 3307916247, 641025152, 3043140495, 3736164937, 632953703, + 1172967064, 1576976609, 3274667266, 2169303058, 2370213795, 1809054150, + 59727847, 361929877, 3211623147, 2505202138, 3569255213, 1484005843, + 1239443753, 2395588676, 1975683434, 4102977912, 2572697195, 666464733, + 3202437046, 4035489047, 3374361702, 2110667444, 1675577880, 3843699074, + 2538681184, 1649639237, 2976151520, 3144396420, 4269907996, 4178062228, + 1883793496, 2403728665, 2497604743, 1383856311, 2876494627, 1917518562, + 3810496343, 1716890410, 3001755655, 800440835, 2261089178, 3543599269, + 807962610, 599762354, 33778362, 3977675356, 2328828971, 2809771154, + 4077384432, 1315562145, 1708848333, 101039829, 3509871135, 3299278474, + 875451293, 2733856160, 92987698, 2767645557, 193195065, 1080094634, + 1584504582, 3178106961, 1042385657, 2531067453, 3711829422, 1306967366, + 2438237621, 1908694277, 67556463, 1615861247, 429456164, 3602770327, + 2302690252, 1742315127, 2968011453, 126454664, 3877198648, 2043211483, + 2709260871, 2084704233, 4169408201, 0, 159417987, 841739592, 504459436, + 1817866830, 4245618683, 260388950, 1034867998, 908933415, 168810852, + 1750902305, 2606453969, 607530554, 202008497, 2472011535, 3035535058, + 463180190, 2160117071, 1641816226, 1517767529, 470948374, 3801332234, + 3231722213, 1008918595, 303765277, 235474187, 4069246893, 766945465, + 337553864, 1475418501, 2943682380, 4003061179, 2743034109, 4144047775, + 1551037884, 1147550661, 1543208500, 2336434550, 3408119516, 3069049960, + 3102011747, 3610369226, 1113818384, 328671808, 2227573024, 2236228733, + 3535486456, 2935566865, 3341394285, 496906059, 3702665459, 226906860, + 2009195472, 733156972, 2842737049, 294930682, 1206477858, 2835123396, + 2700099354, 1451044056, 573804783, 2269728455, 3644379585, 2362090238, + 2564033334, 2801107407, 2776292904, 3669462566, 1068351396, 742039012, + 1350078989, 1784663195, 1417561698, 4136440770, 2430122216, 775550814, + 2193862645, 2673705150, 1775276924, 1876241833, 3475313331, 3366754619, + 270040487, 3902563182, 3678124923, 3441850377, 1851332852, 3969562369, + 2203032232, 3868552805, 2868897406, 566021896, 4011190502, 3135740889, + 1248802510, 3936291284, 699432150, 832877231, 708780849, 3332740144, + 899835584, 1951317047, 4236429990, 3767586992, 866637845, 4043610186, + 1106041591, 2144161806, 395441711, 1984812685, 1139781709, 3433712980, + 3835036895, 2664543715, 1282050075, 3240894392, 1181045119, 2640243204, + 25965917, 4203181171, 4211818798, 3009879386, 2463879762, 3910161971, + 1842759443, 2597806476, 933301370, 1509430414, 3943906441, 3467192302, + 3076639029, 3776767469, 2051518780, 2631065433, 1441952575, 404016761, + 1942435775, 1408749034, 1610459739, 3745345300, 2017778566, 3400528769, + 3110650942, 941896748, 3265478751, 371049330, 3168937228, 675039627, + 4279080257, 967311729, 135050206, 3635733660, 1683407248, 2076935265, + 3576870512, 1215061108, 3501741890, + ]; + var T6 = [ + 1347548327, 1400783205, 3273267108, 2520393566, 3409685355, 4045380933, + 2880240216, 2471224067, 1428173050, 4138563181, 2441661558, 636813900, + 4233094615, 3620022987, 2149987652, 2411029155, 1239331162, 1730525723, + 2554718734, 3781033664, 46346101, 310463728, 2743944855, 3328955385, + 3875770207, 2501218972, 3955191162, 3667219033, 768917123, 3545789473, + 692707433, 1150208456, 1786102409, 2029293177, 1805211710, 3710368113, + 3065962831, 401639597, 1724457132, 3028143674, 409198410, 2196052529, + 1620529459, 1164071807, 3769721975, 2226875310, 486441376, 2499348523, + 1483753576, 428819965, 2274680428, 3075636216, 598438867, 3799141122, + 1474502543, 711349675, 129166120, 53458370, 2592523643, 2782082824, + 4063242375, 2988687269, 3120694122, 1559041666, 730517276, 2460449204, + 4042459122, 2706270690, 3446004468, 3573941694, 533804130, 2328143614, + 2637442643, 2695033685, 839224033, 1973745387, 957055980, 2856345839, + 106852767, 1371368976, 4181598602, 1033297158, 2933734917, 1179510461, + 3046200461, 91341917, 1862534868, 4284502037, 605657339, 2547432937, + 3431546947, 2003294622, 3182487618, 2282195339, 954669403, 3682191598, + 1201765386, 3917234703, 3388507166, 0, 2198438022, 1211247597, + 2887651696, 1315723890, 4227665663, 1443857720, 507358933, 657861945, + 1678381017, 560487590, 3516619604, 975451694, 2970356327, 261314535, + 3535072918, 2652609425, 1333838021, 2724322336, 1767536459, 370938394, + 182621114, 3854606378, 1128014560, 487725847, 185469197, 2918353863, + 3106780840, 3356761769, 2237133081, 1286567175, 3152976349, 4255350624, + 2683765030, 3160175349, 3309594171, 878443390, 1988838185, 3704300486, + 1756818940, 1673061617, 3403100636, 272786309, 1075025698, 545572369, + 2105887268, 4174560061, 296679730, 1841768865, 1260232239, 4091327024, + 3960309330, 3497509347, 1814803222, 2578018489, 4195456072, 575138148, + 3299409036, 446754879, 3629546796, 4011996048, 3347532110, 3252238545, + 4270639778, 915985419, 3483825537, 681933534, 651868046, 2755636671, + 3828103837, 223377554, 2607439820, 1649704518, 3270937875, 3901806776, + 1580087799, 4118987695, 3198115200, 2087309459, 2842678573, 3016697106, + 1003007129, 2802849917, 1860738147, 2077965243, 164439672, 4100872472, + 32283319, 2827177882, 1709610350, 2125135846, 136428751, 3874428392, + 3652904859, 3460984630, 3572145929, 3593056380, 2939266226, 824852259, + 818324884, 3224740454, 930369212, 2801566410, 2967507152, 355706840, + 1257309336, 4148292826, 243256656, 790073846, 2373340630, 1296297904, + 1422699085, 3756299780, 3818836405, 457992840, 3099667487, 2135319889, + 77422314, 1560382517, 1945798516, 788204353, 1521706781, 1385356242, + 870912086, 325965383, 2358957921, 2050466060, 2388260884, 2313884476, + 4006521127, 901210569, 3990953189, 1014646705, 1503449823, 1062597235, + 2031621326, 3212035895, 3931371469, 1533017514, 350174575, 2256028891, + 2177544179, 1052338372, 741876788, 1606591296, 1914052035, 213705253, + 2334669897, 1107234197, 1899603969, 3725069491, 2631447780, 2422494913, + 1635502980, 1893020342, 1950903388, 1120974935, + ]; + var T7 = [ + 2807058932, 1699970625, 2764249623, 1586903591, 1808481195, 1173430173, + 1487645946, 59984867, 4199882800, 1844882806, 1989249228, 1277555970, + 3623636965, 3419915562, 1149249077, 2744104290, 1514790577, 459744698, + 244860394, 3235995134, 1963115311, 4027744588, 2544078150, 4190530515, + 1608975247, 2627016082, 2062270317, 1507497298, 2200818878, 567498868, + 1764313568, 3359936201, 2305455554, 2037970062, 1047239e3, 1910319033, + 1337376481, 2904027272, 2892417312, 984907214, 1243112415, 830661914, + 861968209, 2135253587, 2011214180, 2927934315, 2686254721, 731183368, + 1750626376, 4246310725, 1820824798, 4172763771, 3542330227, 48394827, + 2404901663, 2871682645, 671593195, 3254988725, 2073724613, 145085239, + 2280796200, 2779915199, 1790575107, 2187128086, 472615631, 3029510009, + 4075877127, 3802222185, 4107101658, 3201631749, 1646252340, 4270507174, + 1402811438, 1436590835, 3778151818, 3950355702, 3963161475, 4020912224, + 2667994737, 273792366, 2331590177, 104699613, 95345982, 3175501286, + 2377486676, 1560637892, 3564045318, 369057872, 4213447064, 3919042237, + 1137477952, 2658625497, 1119727848, 2340947849, 1530455833, 4007360968, + 172466556, 266959938, 516552836, 0, 2256734592, 3980931627, 1890328081, + 1917742170, 4294704398, 945164165, 3575528878, 958871085, 3647212047, + 2787207260, 1423022939, 775562294, 1739656202, 3876557655, 2530391278, + 2443058075, 3310321856, 547512796, 1265195639, 437656594, 3121275539, + 719700128, 3762502690, 387781147, 218828297, 3350065803, 2830708150, + 2848461854, 428169201, 122466165, 3720081049, 1627235199, 648017665, + 4122762354, 1002783846, 2117360635, 695634755, 3336358691, 4234721005, + 4049844452, 3704280881, 2232435299, 574624663, 287343814, 612205898, + 1039717051, 840019705, 2708326185, 793451934, 821288114, 1391201670, + 3822090177, 376187827, 3113855344, 1224348052, 1679968233, 2361698556, + 1058709744, 752375421, 2431590963, 1321699145, 3519142200, 2734591178, + 188127444, 2177869557, 3727205754, 2384911031, 3215212461, 2648976442, + 2450346104, 3432737375, 1180849278, 331544205, 3102249176, 4150144569, + 2952102595, 2159976285, 2474404304, 766078933, 313773861, 2570832044, + 2108100632, 1668212892, 3145456443, 2013908262, 418672217, 3070356634, + 2594734927, 1852171925, 3867060991, 3473416636, 3907448597, 2614737639, + 919489135, 164948639, 2094410160, 2997825956, 590424639, 2486224549, + 1723872674, 3157750862, 3399941250, 3501252752, 3625268135, 2555048196, + 3673637356, 1343127501, 4130281361, 3599595085, 2957853679, 1297403050, + 81781910, 3051593425, 2283490410, 532201772, 1367295589, 3926170974, + 895287692, 1953757831, 1093597963, 492483431, 3528626907, 1446242576, + 1192455638, 1636604631, 209336225, 344873464, 1015671571, 669961897, + 3375740769, 3857572124, 2973530695, 3747192018, 1933530610, 3464042516, + 935293895, 3454686199, 2858115069, 1863638845, 3683022916, 4085369519, + 3292445032, 875313188, 1080017571, 3279033885, 621591778, 1233856572, + 2504130317, 24197544, 3017672716, 3835484340, 3247465558, 2220981195, + 3060847922, 1551124588, 1463996600, + ]; + var T8 = [ + 4104605777, 1097159550, 396673818, 660510266, 2875968315, 2638606623, + 4200115116, 3808662347, 821712160, 1986918061, 3430322568, 38544885, + 3856137295, 718002117, 893681702, 1654886325, 2975484382, 3122358053, + 3926825029, 4274053469, 796197571, 1290801793, 1184342925, 3556361835, + 2405426947, 2459735317, 1836772287, 1381620373, 3196267988, 1948373848, + 3764988233, 3385345166, 3263785589, 2390325492, 1480485785, 3111247143, + 3780097726, 2293045232, 548169417, 3459953789, 3746175075, 439452389, + 1362321559, 1400849762, 1685577905, 1806599355, 2174754046, 137073913, + 1214797936, 1174215055, 3731654548, 2079897426, 1943217067, 1258480242, + 529487843, 1437280870, 3945269170, 3049390895, 3313212038, 923313619, + 679998e3, 3215307299, 57326082, 377642221, 3474729866, 2041877159, + 133361907, 1776460110, 3673476453, 96392454, 878845905, 2801699524, + 777231668, 4082475170, 2330014213, 4142626212, 2213296395, 1626319424, + 1906247262, 1846563261, 562755902, 3708173718, 1040559837, 3871163981, + 1418573201, 3294430577, 114585348, 1343618912, 2566595609, 3186202582, + 1078185097, 3651041127, 3896688048, 2307622919, 425408743, 3371096953, + 2081048481, 1108339068, 2216610296, 0, 2156299017, 736970802, 292596766, + 1517440620, 251657213, 2235061775, 2933202493, 758720310, 265905162, + 1554391400, 1532285339, 908999204, 174567692, 1474760595, 4002861748, + 2610011675, 3234156416, 3693126241, 2001430874, 303699484, 2478443234, + 2687165888, 585122620, 454499602, 151849742, 2345119218, 3064510765, + 514443284, 4044981591, 1963412655, 2581445614, 2137062819, 19308535, + 1928707164, 1715193156, 4219352155, 1126790795, 600235211, 3992742070, + 3841024952, 836553431, 1669664834, 2535604243, 3323011204, 1243905413, + 3141400786, 4180808110, 698445255, 2653899549, 2989552604, 2253581325, + 3252932727, 3004591147, 1891211689, 2487810577, 3915653703, 4237083816, + 4030667424, 2100090966, 865136418, 1229899655, 953270745, 3399679628, + 3557504664, 4118925222, 2061379749, 3079546586, 2915017791, 983426092, + 2022837584, 1607244650, 2118541908, 2366882550, 3635996816, 972512814, + 3283088770, 1568718495, 3499326569, 3576539503, 621982671, 2895723464, + 410887952, 2623762152, 1002142683, 645401037, 1494807662, 2595684844, + 1335535747, 2507040230, 4293295786, 3167684641, 367585007, 3885750714, + 1865862730, 2668221674, 2960971305, 2763173681, 1059270954, 2777952454, + 2724642869, 1320957812, 2194319100, 2429595872, 2815956275, 77089521, + 3973773121, 3444575871, 2448830231, 1305906550, 4021308739, 2857194700, + 2516901860, 3518358430, 1787304780, 740276417, 1699839814, 1592394909, + 2352307457, 2272556026, 188821243, 1729977011, 3687994002, 274084841, + 3594982253, 3613494426, 2701949495, 4162096729, 322734571, 2837966542, + 1640576439, 484830689, 1202797690, 3537852828, 4067639125, 349075736, + 3342319475, 4157467219, 4255800159, 1030690015, 1155237496, 2951971274, + 1757691577, 607398968, 2738905026, 499347990, 3794078908, 1011452712, + 227885567, 2818666809, 213114376, 3034881240, 1455525988, 3414450555, + 850817237, 1817998408, 3092726480, + ]; + var U1 = [ + 0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554, + 708780849, 1883793496, 2118214995, 1817866830, 1649639237, 1215061108, + 1181045119, 1417561698, 1517767529, 3767586992, 4003061179, 4236429990, + 4069246893, 3635733660, 3602770327, 3299278474, 3400528769, 2430122216, + 2664543715, 2362090238, 2193862645, 2835123396, 2801107407, 3035535058, + 3135740889, 3678124923, 3576870512, 3341394285, 3374361702, 3810496343, + 3977675356, 4279080257, 4043610186, 2876494627, 2776292904, 3076639029, + 3110650942, 2472011535, 2640243204, 2403728665, 2169303058, 1001089995, + 899835584, 666464733, 699432150, 59727847, 226906860, 530400753, + 294930682, 1273168787, 1172967064, 1475418501, 1509430414, 1942435775, + 2110667444, 1876241833, 1641816226, 2910219766, 2743034109, 2976151520, + 3211623147, 2505202138, 2606453969, 2302690252, 2269728455, 3711829422, + 3543599269, 3240894392, 3475313331, 3843699074, 3943906441, 4178062228, + 4144047775, 1306967366, 1139781709, 1374988112, 1610459739, 1975683434, + 2076935265, 1775276924, 1742315127, 1034867998, 866637845, 566021896, + 800440835, 92987698, 193195065, 429456164, 395441711, 1984812685, + 2017778566, 1784663195, 1683407248, 1315562145, 1080094634, 1383856311, + 1551037884, 101039829, 135050206, 437757123, 337553864, 1042385657, + 807962610, 573804783, 742039012, 2531067453, 2564033334, 2328828971, + 2227573024, 2935566865, 2700099354, 3001755655, 3168937228, 3868552805, + 3902563182, 4203181171, 4102977912, 3736164937, 3501741890, 3265478751, + 3433712980, 1106041591, 1340463100, 1576976609, 1408749034, 2043211483, + 2009195472, 1708848333, 1809054150, 832877231, 1068351396, 766945465, + 599762354, 159417987, 126454664, 361929877, 463180190, 2709260871, + 2943682380, 3178106961, 3009879386, 2572697195, 2538681184, 2236228733, + 2336434550, 3509871135, 3745345300, 3441850377, 3274667266, 3910161971, + 3877198648, 4110568485, 4211818798, 2597806476, 2497604743, 2261089178, + 2295101073, 2733856160, 2902087851, 3202437046, 2968011453, 3936291284, + 3835036895, 4136440770, 4169408201, 3535486456, 3702665459, 3467192302, + 3231722213, 2051518780, 1951317047, 1716890410, 1750902305, 1113818384, + 1282050075, 1584504582, 1350078989, 168810852, 67556463, 371049330, + 404016761, 841739592, 1008918595, 775550814, 540080725, 3969562369, + 3801332234, 4035489047, 4269907996, 3569255213, 3669462566, 3366754619, + 3332740144, 2631065433, 2463879762, 2160117071, 2395588676, 2767645557, + 2868897406, 3102011747, 3069049960, 202008497, 33778362, 270040487, + 504459436, 875451293, 975658646, 675039627, 641025152, 2084704233, + 1917518562, 1615861247, 1851332852, 1147550661, 1248802510, 1484005843, + 1451044056, 933301370, 967311729, 733156972, 632953703, 260388950, + 25965917, 328671808, 496906059, 1206477858, 1239443753, 1543208500, + 1441952575, 2144161806, 1908694277, 1675577880, 1842759443, 3610369226, + 3644379585, 3408119516, 3307916247, 4011190502, 3776767469, 4077384432, + 4245618683, 2809771154, 2842737049, 3144396420, 3043140495, 2673705150, + 2438237621, 2203032232, 2370213795, + ]; + var U2 = [ + 0, 185469197, 370938394, 487725847, 741876788, 657861945, 975451694, + 824852259, 1483753576, 1400783205, 1315723890, 1164071807, 1950903388, + 2135319889, 1649704518, 1767536459, 2967507152, 3152976349, 2801566410, + 2918353863, 2631447780, 2547432937, 2328143614, 2177544179, 3901806776, + 3818836405, 4270639778, 4118987695, 3299409036, 3483825537, 3535072918, + 3652904859, 2077965243, 1893020342, 1841768865, 1724457132, 1474502543, + 1559041666, 1107234197, 1257309336, 598438867, 681933534, 901210569, + 1052338372, 261314535, 77422314, 428819965, 310463728, 3409685355, + 3224740454, 3710368113, 3593056380, 3875770207, 3960309330, 4045380933, + 4195456072, 2471224067, 2554718734, 2237133081, 2388260884, 3212035895, + 3028143674, 2842678573, 2724322336, 4138563181, 4255350624, 3769721975, + 3955191162, 3667219033, 3516619604, 3431546947, 3347532110, 2933734917, + 2782082824, 3099667487, 3016697106, 2196052529, 2313884476, 2499348523, + 2683765030, 1179510461, 1296297904, 1347548327, 1533017514, 1786102409, + 1635502980, 2087309459, 2003294622, 507358933, 355706840, 136428751, + 53458370, 839224033, 957055980, 605657339, 790073846, 2373340630, + 2256028891, 2607439820, 2422494913, 2706270690, 2856345839, 3075636216, + 3160175349, 3573941694, 3725069491, 3273267108, 3356761769, 4181598602, + 4063242375, 4011996048, 3828103837, 1033297158, 915985419, 730517276, + 545572369, 296679730, 446754879, 129166120, 213705253, 1709610350, + 1860738147, 1945798516, 2029293177, 1239331162, 1120974935, 1606591296, + 1422699085, 4148292826, 4233094615, 3781033664, 3931371469, 3682191598, + 3497509347, 3446004468, 3328955385, 2939266226, 2755636671, 3106780840, + 2988687269, 2198438022, 2282195339, 2501218972, 2652609425, 1201765386, + 1286567175, 1371368976, 1521706781, 1805211710, 1620529459, 2105887268, + 1988838185, 533804130, 350174575, 164439672, 46346101, 870912086, + 954669403, 636813900, 788204353, 2358957921, 2274680428, 2592523643, + 2441661558, 2695033685, 2880240216, 3065962831, 3182487618, 3572145929, + 3756299780, 3270937875, 3388507166, 4174560061, 4091327024, 4006521127, + 3854606378, 1014646705, 930369212, 711349675, 560487590, 272786309, + 457992840, 106852767, 223377554, 1678381017, 1862534868, 1914052035, + 2031621326, 1211247597, 1128014560, 1580087799, 1428173050, 32283319, + 182621114, 401639597, 486441376, 768917123, 651868046, 1003007129, + 818324884, 1503449823, 1385356242, 1333838021, 1150208456, 1973745387, + 2125135846, 1673061617, 1756818940, 2970356327, 3120694122, 2802849917, + 2887651696, 2637442643, 2520393566, 2334669897, 2149987652, 3917234703, + 3799141122, 4284502037, 4100872472, 3309594171, 3460984630, 3545789473, + 3629546796, 2050466060, 1899603969, 1814803222, 1730525723, 1443857720, + 1560382517, 1075025698, 1260232239, 575138148, 692707433, 878443390, + 1062597235, 243256656, 91341917, 409198410, 325965383, 3403100636, + 3252238545, 3704300486, 3620022987, 3874428392, 3990953189, 4042459122, + 4227665663, 2460449204, 2578018489, 2226875310, 2411029155, 3198115200, + 3046200461, 2827177882, 2743944855, + ]; + var U3 = [ + 0, 218828297, 437656594, 387781147, 875313188, 958871085, 775562294, + 590424639, 1750626376, 1699970625, 1917742170, 2135253587, 1551124588, + 1367295589, 1180849278, 1265195639, 3501252752, 3720081049, 3399941250, + 3350065803, 3835484340, 3919042237, 4270507174, 4085369519, 3102249176, + 3051593425, 2734591178, 2952102595, 2361698556, 2177869557, 2530391278, + 2614737639, 3145456443, 3060847922, 2708326185, 2892417312, 2404901663, + 2187128086, 2504130317, 2555048196, 3542330227, 3727205754, 3375740769, + 3292445032, 3876557655, 3926170974, 4246310725, 4027744588, 1808481195, + 1723872674, 1910319033, 2094410160, 1608975247, 1391201670, 1173430173, + 1224348052, 59984867, 244860394, 428169201, 344873464, 935293895, + 984907214, 766078933, 547512796, 1844882806, 1627235199, 2011214180, + 2062270317, 1507497298, 1423022939, 1137477952, 1321699145, 95345982, + 145085239, 532201772, 313773861, 830661914, 1015671571, 731183368, + 648017665, 3175501286, 2957853679, 2807058932, 2858115069, 2305455554, + 2220981195, 2474404304, 2658625497, 3575528878, 3625268135, 3473416636, + 3254988725, 3778151818, 3963161475, 4213447064, 4130281361, 3599595085, + 3683022916, 3432737375, 3247465558, 3802222185, 4020912224, 4172763771, + 4122762354, 3201631749, 3017672716, 2764249623, 2848461854, 2331590177, + 2280796200, 2431590963, 2648976442, 104699613, 188127444, 472615631, + 287343814, 840019705, 1058709744, 671593195, 621591778, 1852171925, + 1668212892, 1953757831, 2037970062, 1514790577, 1463996600, 1080017571, + 1297403050, 3673637356, 3623636965, 3235995134, 3454686199, 4007360968, + 3822090177, 4107101658, 4190530515, 2997825956, 3215212461, 2830708150, + 2779915199, 2256734592, 2340947849, 2627016082, 2443058075, 172466556, + 122466165, 273792366, 492483431, 1047239e3, 861968209, 612205898, + 695634755, 1646252340, 1863638845, 2013908262, 1963115311, 1446242576, + 1530455833, 1277555970, 1093597963, 1636604631, 1820824798, 2073724613, + 1989249228, 1436590835, 1487645946, 1337376481, 1119727848, 164948639, + 81781910, 331544205, 516552836, 1039717051, 821288114, 669961897, + 719700128, 2973530695, 3157750862, 2871682645, 2787207260, 2232435299, + 2283490410, 2667994737, 2450346104, 3647212047, 3564045318, 3279033885, + 3464042516, 3980931627, 3762502690, 4150144569, 4199882800, 3070356634, + 3121275539, 2904027272, 2686254721, 2200818878, 2384911031, 2570832044, + 2486224549, 3747192018, 3528626907, 3310321856, 3359936201, 3950355702, + 3867060991, 4049844452, 4234721005, 1739656202, 1790575107, 2108100632, + 1890328081, 1402811438, 1586903591, 1233856572, 1149249077, 266959938, + 48394827, 369057872, 418672217, 1002783846, 919489135, 567498868, + 752375421, 209336225, 24197544, 376187827, 459744698, 945164165, + 895287692, 574624663, 793451934, 1679968233, 1764313568, 2117360635, + 1933530610, 1343127501, 1560637892, 1243112415, 1192455638, 3704280881, + 3519142200, 3336358691, 3419915562, 3907448597, 3857572124, 4075877127, + 4294704398, 3029510009, 3113855344, 2927934315, 2744104290, 2159976285, + 2377486676, 2594734927, 2544078150, + ]; + var U4 = [ + 0, 151849742, 303699484, 454499602, 607398968, 758720310, 908999204, + 1059270954, 1214797936, 1097159550, 1517440620, 1400849762, 1817998408, + 1699839814, 2118541908, 2001430874, 2429595872, 2581445614, 2194319100, + 2345119218, 3034881240, 3186202582, 2801699524, 2951971274, 3635996816, + 3518358430, 3399679628, 3283088770, 4237083816, 4118925222, 4002861748, + 3885750714, 1002142683, 850817237, 698445255, 548169417, 529487843, + 377642221, 227885567, 77089521, 1943217067, 2061379749, 1640576439, + 1757691577, 1474760595, 1592394909, 1174215055, 1290801793, 2875968315, + 2724642869, 3111247143, 2960971305, 2405426947, 2253581325, 2638606623, + 2487810577, 3808662347, 3926825029, 4044981591, 4162096729, 3342319475, + 3459953789, 3576539503, 3693126241, 1986918061, 2137062819, 1685577905, + 1836772287, 1381620373, 1532285339, 1078185097, 1229899655, 1040559837, + 923313619, 740276417, 621982671, 439452389, 322734571, 137073913, + 19308535, 3871163981, 4021308739, 4104605777, 4255800159, 3263785589, + 3414450555, 3499326569, 3651041127, 2933202493, 2815956275, 3167684641, + 3049390895, 2330014213, 2213296395, 2566595609, 2448830231, 1305906550, + 1155237496, 1607244650, 1455525988, 1776460110, 1626319424, 2079897426, + 1928707164, 96392454, 213114376, 396673818, 514443284, 562755902, + 679998e3, 865136418, 983426092, 3708173718, 3557504664, 3474729866, + 3323011204, 4180808110, 4030667424, 3945269170, 3794078908, 2507040230, + 2623762152, 2272556026, 2390325492, 2975484382, 3092726480, 2738905026, + 2857194700, 3973773121, 3856137295, 4274053469, 4157467219, 3371096953, + 3252932727, 3673476453, 3556361835, 2763173681, 2915017791, 3064510765, + 3215307299, 2156299017, 2307622919, 2459735317, 2610011675, 2081048481, + 1963412655, 1846563261, 1729977011, 1480485785, 1362321559, 1243905413, + 1126790795, 878845905, 1030690015, 645401037, 796197571, 274084841, + 425408743, 38544885, 188821243, 3613494426, 3731654548, 3313212038, + 3430322568, 4082475170, 4200115116, 3780097726, 3896688048, 2668221674, + 2516901860, 2366882550, 2216610296, 3141400786, 2989552604, 2837966542, + 2687165888, 1202797690, 1320957812, 1437280870, 1554391400, 1669664834, + 1787304780, 1906247262, 2022837584, 265905162, 114585348, 499347990, + 349075736, 736970802, 585122620, 972512814, 821712160, 2595684844, + 2478443234, 2293045232, 2174754046, 3196267988, 3079546586, 2895723464, + 2777952454, 3537852828, 3687994002, 3234156416, 3385345166, 4142626212, + 4293295786, 3841024952, 3992742070, 174567692, 57326082, 410887952, + 292596766, 777231668, 660510266, 1011452712, 893681702, 1108339068, + 1258480242, 1343618912, 1494807662, 1715193156, 1865862730, 1948373848, + 2100090966, 2701949495, 2818666809, 3004591147, 3122358053, 2235061775, + 2352307457, 2535604243, 2653899549, 3915653703, 3764988233, 4219352155, + 4067639125, 3444575871, 3294430577, 3746175075, 3594982253, 836553431, + 953270745, 600235211, 718002117, 367585007, 484830689, 133361907, + 251657213, 2041877159, 1891211689, 1806599355, 1654886325, 1568718495, + 1418573201, 1335535747, 1184342925, + ]; + function convertToInt32(bytes) { + var result = []; + for (var i2 = 0; i2 < bytes.length; i2 += 4) { + result.push( + (bytes[i2] << 24) | + (bytes[i2 + 1] << 16) | + (bytes[i2 + 2] << 8) | + bytes[i2 + 3] + ); + } + return result; + } + var AES = function (key2) { + if (!(this instanceof AES)) { + throw Error('AES must be instanitated with `new`'); + } + Object.defineProperty(this, 'key', { + value: coerceArray(key2, true), + }); + this._prepare(); + }; + AES.prototype._prepare = function () { + var rounds = numberOfRounds[this.key.length]; + if (rounds == null) { + throw new Error('invalid key size (must be 16, 24 or 32 bytes)'); + } + this._Ke = []; + this._Kd = []; + for (var i2 = 0; i2 <= rounds; i2++) { + this._Ke.push([0, 0, 0, 0]); + this._Kd.push([0, 0, 0, 0]); + } + var roundKeyCount = (rounds + 1) * 4; + var KC = this.key.length / 4; + var tk = convertToInt32(this.key); + var index; + for (var i2 = 0; i2 < KC; i2++) { + index = i2 >> 2; + this._Ke[index][i2 % 4] = tk[i2]; + this._Kd[rounds - index][i2 % 4] = tk[i2]; + } + var rconpointer = 0; + var t2 = KC, + tt; + while (t2 < roundKeyCount) { + tt = tk[KC - 1]; + tk[0] ^= + (S2[(tt >> 16) & 255] << 24) ^ + (S2[(tt >> 8) & 255] << 16) ^ + (S2[tt & 255] << 8) ^ + S2[(tt >> 24) & 255] ^ + (rcon[rconpointer] << 24); + rconpointer += 1; + if (KC != 8) { + for (var i2 = 1; i2 < KC; i2++) { + tk[i2] ^= tk[i2 - 1]; + } + } else { + for (var i2 = 1; i2 < KC / 2; i2++) { + tk[i2] ^= tk[i2 - 1]; + } + tt = tk[KC / 2 - 1]; + tk[KC / 2] ^= + S2[tt & 255] ^ + (S2[(tt >> 8) & 255] << 8) ^ + (S2[(tt >> 16) & 255] << 16) ^ + (S2[(tt >> 24) & 255] << 24); + for (var i2 = KC / 2 + 1; i2 < KC; i2++) { + tk[i2] ^= tk[i2 - 1]; + } + } + var i2 = 0, + r3, + c; + while (i2 < KC && t2 < roundKeyCount) { + r3 = t2 >> 2; + c = t2 % 4; + this._Ke[r3][c] = tk[i2]; + this._Kd[rounds - r3][c] = tk[i2++]; + t2++; + } + } + for (var r3 = 1; r3 < rounds; r3++) { + for (var c = 0; c < 4; c++) { + tt = this._Kd[r3][c]; + this._Kd[r3][c] = + U1[(tt >> 24) & 255] ^ + U2[(tt >> 16) & 255] ^ + U3[(tt >> 8) & 255] ^ + U4[tt & 255]; + } + } + }; + AES.prototype.encrypt = function (plaintext) { + if (plaintext.length != 16) { + throw new Error('invalid plaintext size (must be 16 bytes)'); + } + var rounds = this._Ke.length - 1; + var a2 = [0, 0, 0, 0]; + var t2 = convertToInt32(plaintext); + for (var i2 = 0; i2 < 4; i2++) { + t2[i2] ^= this._Ke[0][i2]; + } + for (var r3 = 1; r3 < rounds; r3++) { + for (var i2 = 0; i2 < 4; i2++) { + a2[i2] = + T1[(t2[i2] >> 24) & 255] ^ + T2[(t2[(i2 + 1) % 4] >> 16) & 255] ^ + T3[(t2[(i2 + 2) % 4] >> 8) & 255] ^ + T4[t2[(i2 + 3) % 4] & 255] ^ + this._Ke[r3][i2]; + } + t2 = a2.slice(); + } + var result = createArray(16), + tt; + for (var i2 = 0; i2 < 4; i2++) { + tt = this._Ke[rounds][i2]; + result[4 * i2] = (S2[(t2[i2] >> 24) & 255] ^ (tt >> 24)) & 255; + result[4 * i2 + 1] = + (S2[(t2[(i2 + 1) % 4] >> 16) & 255] ^ (tt >> 16)) & 255; + result[4 * i2 + 2] = + (S2[(t2[(i2 + 2) % 4] >> 8) & 255] ^ (tt >> 8)) & 255; + result[4 * i2 + 3] = (S2[t2[(i2 + 3) % 4] & 255] ^ tt) & 255; + } + return result; + }; + AES.prototype.decrypt = function (ciphertext) { + if (ciphertext.length != 16) { + throw new Error('invalid ciphertext size (must be 16 bytes)'); + } + var rounds = this._Kd.length - 1; + var a2 = [0, 0, 0, 0]; + var t2 = convertToInt32(ciphertext); + for (var i2 = 0; i2 < 4; i2++) { + t2[i2] ^= this._Kd[0][i2]; + } + for (var r3 = 1; r3 < rounds; r3++) { + for (var i2 = 0; i2 < 4; i2++) { + a2[i2] = + T5[(t2[i2] >> 24) & 255] ^ + T6[(t2[(i2 + 3) % 4] >> 16) & 255] ^ + T7[(t2[(i2 + 2) % 4] >> 8) & 255] ^ + T8[t2[(i2 + 1) % 4] & 255] ^ + this._Kd[r3][i2]; + } + t2 = a2.slice(); + } + var result = createArray(16), + tt; + for (var i2 = 0; i2 < 4; i2++) { + tt = this._Kd[rounds][i2]; + result[4 * i2] = (Si[(t2[i2] >> 24) & 255] ^ (tt >> 24)) & 255; + result[4 * i2 + 1] = + (Si[(t2[(i2 + 3) % 4] >> 16) & 255] ^ (tt >> 16)) & 255; + result[4 * i2 + 2] = + (Si[(t2[(i2 + 2) % 4] >> 8) & 255] ^ (tt >> 8)) & 255; + result[4 * i2 + 3] = (Si[t2[(i2 + 1) % 4] & 255] ^ tt) & 255; + } + return result; + }; + var ModeOfOperationECB = function (key2) { + if (!(this instanceof ModeOfOperationECB)) { + throw Error('AES must be instanitated with `new`'); + } + this.description = 'Electronic Code Block'; + this.name = 'ecb'; + this._aes = new AES(key2); + }; + ModeOfOperationECB.prototype.encrypt = function (plaintext) { + plaintext = coerceArray(plaintext); + if (plaintext.length % 16 !== 0) { + throw new Error( + 'invalid plaintext size (must be multiple of 16 bytes)' + ); + } + var ciphertext = createArray(plaintext.length); + var block = createArray(16); + for (var i2 = 0; i2 < plaintext.length; i2 += 16) { + copyArray(plaintext, block, 0, i2, i2 + 16); + block = this._aes.encrypt(block); + copyArray(block, ciphertext, i2); + } + return ciphertext; + }; + ModeOfOperationECB.prototype.decrypt = function (ciphertext) { + ciphertext = coerceArray(ciphertext); + if (ciphertext.length % 16 !== 0) { + throw new Error( + 'invalid ciphertext size (must be multiple of 16 bytes)' + ); + } + var plaintext = createArray(ciphertext.length); + var block = createArray(16); + for (var i2 = 0; i2 < ciphertext.length; i2 += 16) { + copyArray(ciphertext, block, 0, i2, i2 + 16); + block = this._aes.decrypt(block); + copyArray(block, plaintext, i2); + } + return plaintext; + }; + var ModeOfOperationCBC = function (key2, iv2) { + if (!(this instanceof ModeOfOperationCBC)) { + throw Error('AES must be instanitated with `new`'); + } + this.description = 'Cipher Block Chaining'; + this.name = 'cbc'; + if (!iv2) { + iv2 = createArray(16); + } else if (iv2.length != 16) { + throw new Error( + 'invalid initialation vector size (must be 16 bytes)' + ); + } + this._lastCipherblock = coerceArray(iv2, true); + this._aes = new AES(key2); + }; + ModeOfOperationCBC.prototype.encrypt = function (plaintext) { + plaintext = coerceArray(plaintext); + if (plaintext.length % 16 !== 0) { + throw new Error( + 'invalid plaintext size (must be multiple of 16 bytes)' + ); + } + var ciphertext = createArray(plaintext.length); + var block = createArray(16); + for (var i2 = 0; i2 < plaintext.length; i2 += 16) { + copyArray(plaintext, block, 0, i2, i2 + 16); + for (var j = 0; j < 16; j++) { + block[j] ^= this._lastCipherblock[j]; + } + this._lastCipherblock = this._aes.encrypt(block); + copyArray(this._lastCipherblock, ciphertext, i2); + } + return ciphertext; + }; + ModeOfOperationCBC.prototype.decrypt = function (ciphertext) { + ciphertext = coerceArray(ciphertext); + if (ciphertext.length % 16 !== 0) { + throw new Error( + 'invalid ciphertext size (must be multiple of 16 bytes)' + ); + } + var plaintext = createArray(ciphertext.length); + var block = createArray(16); + for (var i2 = 0; i2 < ciphertext.length; i2 += 16) { + copyArray(ciphertext, block, 0, i2, i2 + 16); + block = this._aes.decrypt(block); + for (var j = 0; j < 16; j++) { + plaintext[i2 + j] = block[j] ^ this._lastCipherblock[j]; + } + copyArray(ciphertext, this._lastCipherblock, 0, i2, i2 + 16); + } + return plaintext; + }; + var ModeOfOperationCFB = function (key2, iv2, segmentSize) { + if (!(this instanceof ModeOfOperationCFB)) { + throw Error('AES must be instanitated with `new`'); + } + this.description = 'Cipher Feedback'; + this.name = 'cfb'; + if (!iv2) { + iv2 = createArray(16); + } else if (iv2.length != 16) { + throw new Error('invalid initialation vector size (must be 16 size)'); + } + if (!segmentSize) { + segmentSize = 1; + } + this.segmentSize = segmentSize; + this._shiftRegister = coerceArray(iv2, true); + this._aes = new AES(key2); + }; + ModeOfOperationCFB.prototype.encrypt = function (plaintext) { + if (plaintext.length % this.segmentSize != 0) { + throw new Error('invalid plaintext size (must be segmentSize bytes)'); + } + var encrypted = coerceArray(plaintext, true); + var xorSegment; + for (var i2 = 0; i2 < encrypted.length; i2 += this.segmentSize) { + xorSegment = this._aes.encrypt(this._shiftRegister); + for (var j = 0; j < this.segmentSize; j++) { + encrypted[i2 + j] ^= xorSegment[j]; + } + copyArray( + this._shiftRegister, + this._shiftRegister, + 0, + this.segmentSize + ); + copyArray( + encrypted, + this._shiftRegister, + 16 - this.segmentSize, + i2, + i2 + this.segmentSize + ); + } + return encrypted; + }; + ModeOfOperationCFB.prototype.decrypt = function (ciphertext) { + if (ciphertext.length % this.segmentSize != 0) { + throw new Error( + 'invalid ciphertext size (must be segmentSize bytes)' + ); + } + var plaintext = coerceArray(ciphertext, true); + var xorSegment; + for (var i2 = 0; i2 < plaintext.length; i2 += this.segmentSize) { + xorSegment = this._aes.encrypt(this._shiftRegister); + for (var j = 0; j < this.segmentSize; j++) { + plaintext[i2 + j] ^= xorSegment[j]; + } + copyArray( + this._shiftRegister, + this._shiftRegister, + 0, + this.segmentSize + ); + copyArray( + ciphertext, + this._shiftRegister, + 16 - this.segmentSize, + i2, + i2 + this.segmentSize + ); + } + return plaintext; + }; + var ModeOfOperationOFB = function (key2, iv2) { + if (!(this instanceof ModeOfOperationOFB)) { + throw Error('AES must be instanitated with `new`'); + } + this.description = 'Output Feedback'; + this.name = 'ofb'; + if (!iv2) { + iv2 = createArray(16); + } else if (iv2.length != 16) { + throw new Error( + 'invalid initialation vector size (must be 16 bytes)' + ); + } + this._lastPrecipher = coerceArray(iv2, true); + this._lastPrecipherIndex = 16; + this._aes = new AES(key2); + }; + ModeOfOperationOFB.prototype.encrypt = function (plaintext) { + var encrypted = coerceArray(plaintext, true); + for (var i2 = 0; i2 < encrypted.length; i2++) { + if (this._lastPrecipherIndex === 16) { + this._lastPrecipher = this._aes.encrypt(this._lastPrecipher); + this._lastPrecipherIndex = 0; + } + encrypted[i2] ^= this._lastPrecipher[this._lastPrecipherIndex++]; + } + return encrypted; + }; + ModeOfOperationOFB.prototype.decrypt = + ModeOfOperationOFB.prototype.encrypt; + var Counter = function (initialValue) { + if (!(this instanceof Counter)) { + throw Error('Counter must be instanitated with `new`'); + } + if (initialValue !== 0 && !initialValue) { + initialValue = 1; + } + if (typeof initialValue === 'number') { + this._counter = createArray(16); + this.setValue(initialValue); + } else { + this.setBytes(initialValue); + } + }; + Counter.prototype.setValue = function (value) { + if (typeof value !== 'number' || parseInt(value) != value) { + throw new Error('invalid counter value (must be an integer)'); + } + for (var index = 15; index >= 0; --index) { + this._counter[index] = value % 256; + value = value >> 8; + } + }; + Counter.prototype.setBytes = function (bytes) { + bytes = coerceArray(bytes, true); + if (bytes.length != 16) { + throw new Error('invalid counter bytes size (must be 16 bytes)'); + } + this._counter = bytes; + }; + Counter.prototype.increment = function () { + for (var i2 = 15; i2 >= 0; i2--) { + if (this._counter[i2] === 255) { + this._counter[i2] = 0; + } else { + this._counter[i2]++; + break; + } + } + }; + var ModeOfOperationCTR = function (key2, counter) { + if (!(this instanceof ModeOfOperationCTR)) { + throw Error('AES must be instanitated with `new`'); + } + this.description = 'Counter'; + this.name = 'ctr'; + if (!(counter instanceof Counter)) { + counter = new Counter(counter); + } + this._counter = counter; + this._remainingCounter = null; + this._remainingCounterIndex = 16; + this._aes = new AES(key2); + }; + ModeOfOperationCTR.prototype.encrypt = function (plaintext) { + var encrypted = coerceArray(plaintext, true); + for (var i2 = 0; i2 < encrypted.length; i2++) { + if (this._remainingCounterIndex === 16) { + this._remainingCounter = this._aes.encrypt(this._counter._counter); + this._remainingCounterIndex = 0; + this._counter.increment(); + } + encrypted[i2] ^= + this._remainingCounter[this._remainingCounterIndex++]; + } + return encrypted; + }; + ModeOfOperationCTR.prototype.decrypt = + ModeOfOperationCTR.prototype.encrypt; + function pkcs7pad(data) { + data = coerceArray(data, true); + var padder = 16 - (data.length % 16); + var result = createArray(data.length + padder); + copyArray(data, result); + for (var i2 = data.length; i2 < result.length; i2++) { + result[i2] = padder; + } + return result; + } + function pkcs7strip(data) { + data = coerceArray(data, true); + if (data.length < 16) { + throw new Error('PKCS#7 invalid length'); + } + var padder = data[data.length - 1]; + if (padder > 16) { + throw new Error('PKCS#7 padding byte out of range'); + } + var length = data.length - padder; + for (var i2 = 0; i2 < padder; i2++) { + if (data[length + i2] !== padder) { + throw new Error('PKCS#7 invalid padding byte'); + } + } + var result = createArray(length); + copyArray(data, result, 0, 0, length); + return result; + } + var aesjs = { + AES, + Counter, + ModeOfOperation: { + ecb: ModeOfOperationECB, + cbc: ModeOfOperationCBC, + cfb: ModeOfOperationCFB, + ofb: ModeOfOperationOFB, + ctr: ModeOfOperationCTR, + }, + utils: { + hex: convertHex, + utf8: convertUtf8, + }, + padding: { + pkcs7: { + pad: pkcs7pad, + strip: pkcs7strip, + }, + }, + _arrayTest: { + coerceArray, + createArray, + copyArray, + }, + }; + if (typeof exports !== 'undefined') { + module2.exports = aesjs; + } else if (typeof define === 'function' && define.amd) { + define(aesjs); + } else { + if (root.aesjs) { + aesjs._aesjs = root.aesjs; + } + root.aesjs = aesjs; + } + })(exports); + }, +}); + +// node_modules/@ethersproject/json-wallets/lib.esm/_version.js +var version20; +var init_version18 = __esm({ + 'node_modules/@ethersproject/json-wallets/lib.esm/_version.js'() { + init_shim(); + version20 = 'json-wallets/5.7.0'; + }, +}); + +// node_modules/@ethersproject/json-wallets/lib.esm/utils.js +function looseArrayify(hexString) { + if (typeof hexString === 'string' && hexString.substring(0, 2) !== '0x') { + hexString = '0x' + hexString; + } + return arrayify(hexString); +} +function zpad(value, length) { + value = String(value); + while (value.length < length) { + value = '0' + value; + } + return value; +} +function getPassword(password) { + if (typeof password === 'string') { + return toUtf8Bytes(password, UnicodeNormalizationForm.NFKC); + } + return arrayify(password); +} +function searchPath(object, path) { + let currentChild = object; + const comps = path.toLowerCase().split('/'); + for (let i2 = 0; i2 < comps.length; i2++) { + let matchingChild = null; + for (const key2 in currentChild) { + if (key2.toLowerCase() === comps[i2]) { + matchingChild = currentChild[key2]; + break; + } + } + if (matchingChild === null) { + return null; + } + currentChild = matchingChild; + } + return currentChild; +} +function uuidV4(randomBytes2) { + const bytes = arrayify(randomBytes2); + bytes[6] = (bytes[6] & 15) | 64; + bytes[8] = (bytes[8] & 63) | 128; + const value = hexlify(bytes); + return [ + value.substring(2, 10), + value.substring(10, 14), + value.substring(14, 18), + value.substring(18, 22), + value.substring(22, 34), + ].join('-'); +} +var init_utils = __esm({ + 'node_modules/@ethersproject/json-wallets/lib.esm/utils.js'() { + 'use strict'; + init_shim(); + init_lib2(); + init_lib9(); + }, +}); + +// node_modules/@ethersproject/json-wallets/lib.esm/crowdsale.js +function decrypt(json, password) { + const data = JSON.parse(json); + password = getPassword(password); + const ethaddr = getAddress(searchPath(data, 'ethaddr')); + const encseed = looseArrayify(searchPath(data, 'encseed')); + if (!encseed || encseed.length % 16 !== 0) { + logger24.throwArgumentError('invalid encseed', 'json', json); + } + const key2 = arrayify(pbkdf2(password, password, 2e3, 32, 'sha256')).slice( + 0, + 16 + ); + const iv2 = encseed.slice(0, 16); + const encryptedSeed = encseed.slice(16); + const aesCbc = new import_aes_js.default.ModeOfOperation.cbc(key2, iv2); + const seed = import_aes_js.default.padding.pkcs7.strip( + arrayify(aesCbc.decrypt(encryptedSeed)) + ); + let seedHex = ''; + for (let i2 = 0; i2 < seed.length; i2++) { + seedHex += String.fromCharCode(seed[i2]); + } + const seedHexBytes = toUtf8Bytes(seedHex); + const privateKey = keccak256(seedHexBytes); + return new CrowdsaleAccount({ + _isCrowdsaleAccount: true, + address: ethaddr, + privateKey, + }); +} +var import_aes_js, logger24, CrowdsaleAccount; +var init_crowdsale = __esm({ + 'node_modules/@ethersproject/json-wallets/lib.esm/crowdsale.js'() { + 'use strict'; + init_shim(); + import_aes_js = __toESM(require_aes_js()); + init_lib7(); + init_lib2(); + init_lib5(); + init_lib20(); + init_lib9(); + init_lib4(); + init_lib(); + init_version18(); + init_utils(); + logger24 = new Logger(version20); + CrowdsaleAccount = class extends Description { + isCrowdsaleAccount(value) { + return !!(value && value._isCrowdsaleAccount); + } + }; + }, +}); + +// node_modules/@ethersproject/json-wallets/lib.esm/inspect.js +function isCrowdsaleWallet(json) { + let data = null; + try { + data = JSON.parse(json); + } catch (error) { + return false; + } + return data.encseed && data.ethaddr; +} +function isKeystoreWallet(json) { + let data = null; + try { + data = JSON.parse(json); + } catch (error) { + return false; + } + if ( + !data.version || + parseInt(data.version) !== data.version || + parseInt(data.version) !== 3 + ) { + return false; + } + return true; +} +function getJsonWalletAddress(json) { + if (isCrowdsaleWallet(json)) { + try { + return getAddress(JSON.parse(json).ethaddr); + } catch (error) { + return null; + } + } + if (isKeystoreWallet(json)) { + try { + return getAddress(JSON.parse(json).address); + } catch (error) { + return null; + } + } + return null; +} +var init_inspect = __esm({ + 'node_modules/@ethersproject/json-wallets/lib.esm/inspect.js'() { + 'use strict'; + init_shim(); + init_lib7(); + }, +}); + +// node_modules/scrypt-js/scrypt.js +var require_scrypt = __commonJS({ + 'node_modules/scrypt-js/scrypt.js'(exports, module2) { + 'use strict'; + init_shim(); + (function (root) { + const MAX_VALUE = 2147483647; + function SHA256(m) { + const K2 = new Uint32Array([ + 1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, + 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, + 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, + 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, + 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, + 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, + 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, + 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, + 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, + 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, + 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, + 2756734187, 3204031479, 3329325298, + ]); + let h0 = 1779033703, + h1 = 3144134277, + h2 = 1013904242, + h3 = 2773480762; + let h4 = 1359893119, + h5 = 2600822924, + h6 = 528734635, + h7 = 1541459225; + const w = new Uint32Array(64); + function blocks(p2) { + let off = 0, + len = p2.length; + while (len >= 64) { + let a2 = h0, + b = h1, + c = h2, + d = h3, + e2 = h4, + f = h5, + g = h6, + h = h7, + u, + i3, + j, + t1, + t2; + for (i3 = 0; i3 < 16; i3++) { + j = off + i3 * 4; + w[i3] = + ((p2[j] & 255) << 24) | + ((p2[j + 1] & 255) << 16) | + ((p2[j + 2] & 255) << 8) | + (p2[j + 3] & 255); + } + for (i3 = 16; i3 < 64; i3++) { + u = w[i3 - 2]; + t1 = + ((u >>> 17) | (u << (32 - 17))) ^ + ((u >>> 19) | (u << (32 - 19))) ^ + (u >>> 10); + u = w[i3 - 15]; + t2 = + ((u >>> 7) | (u << (32 - 7))) ^ + ((u >>> 18) | (u << (32 - 18))) ^ + (u >>> 3); + w[i3] = (((t1 + w[i3 - 7]) | 0) + ((t2 + w[i3 - 16]) | 0)) | 0; + } + for (i3 = 0; i3 < 64; i3++) { + t1 = + ((((((e2 >>> 6) | (e2 << (32 - 6))) ^ + ((e2 >>> 11) | (e2 << (32 - 11))) ^ + ((e2 >>> 25) | (e2 << (32 - 25)))) + + ((e2 & f) ^ (~e2 & g))) | + 0) + + ((h + ((K2[i3] + w[i3]) | 0)) | 0)) | + 0; + t2 = + ((((a2 >>> 2) | (a2 << (32 - 2))) ^ + ((a2 >>> 13) | (a2 << (32 - 13))) ^ + ((a2 >>> 22) | (a2 << (32 - 22)))) + + ((a2 & b) ^ (a2 & c) ^ (b & c))) | + 0; + h = g; + g = f; + f = e2; + e2 = (d + t1) | 0; + d = c; + c = b; + b = a2; + a2 = (t1 + t2) | 0; + } + h0 = (h0 + a2) | 0; + h1 = (h1 + b) | 0; + h2 = (h2 + c) | 0; + h3 = (h3 + d) | 0; + h4 = (h4 + e2) | 0; + h5 = (h5 + f) | 0; + h6 = (h6 + g) | 0; + h7 = (h7 + h) | 0; + off += 64; + len -= 64; + } + } + blocks(m); + let i2, + bytesLeft = m.length % 64, + bitLenHi = (m.length / 536870912) | 0, + bitLenLo = m.length << 3, + numZeros = bytesLeft < 56 ? 56 : 120, + p = m.slice(m.length - bytesLeft, m.length); + p.push(128); + for (i2 = bytesLeft + 1; i2 < numZeros; i2++) { + p.push(0); + } + p.push((bitLenHi >>> 24) & 255); + p.push((bitLenHi >>> 16) & 255); + p.push((bitLenHi >>> 8) & 255); + p.push((bitLenHi >>> 0) & 255); + p.push((bitLenLo >>> 24) & 255); + p.push((bitLenLo >>> 16) & 255); + p.push((bitLenLo >>> 8) & 255); + p.push((bitLenLo >>> 0) & 255); + blocks(p); + return [ + (h0 >>> 24) & 255, + (h0 >>> 16) & 255, + (h0 >>> 8) & 255, + (h0 >>> 0) & 255, + (h1 >>> 24) & 255, + (h1 >>> 16) & 255, + (h1 >>> 8) & 255, + (h1 >>> 0) & 255, + (h2 >>> 24) & 255, + (h2 >>> 16) & 255, + (h2 >>> 8) & 255, + (h2 >>> 0) & 255, + (h3 >>> 24) & 255, + (h3 >>> 16) & 255, + (h3 >>> 8) & 255, + (h3 >>> 0) & 255, + (h4 >>> 24) & 255, + (h4 >>> 16) & 255, + (h4 >>> 8) & 255, + (h4 >>> 0) & 255, + (h5 >>> 24) & 255, + (h5 >>> 16) & 255, + (h5 >>> 8) & 255, + (h5 >>> 0) & 255, + (h6 >>> 24) & 255, + (h6 >>> 16) & 255, + (h6 >>> 8) & 255, + (h6 >>> 0) & 255, + (h7 >>> 24) & 255, + (h7 >>> 16) & 255, + (h7 >>> 8) & 255, + (h7 >>> 0) & 255, + ]; + } + function PBKDF2_HMAC_SHA256_OneIter(password, salt, dkLen) { + password = password.length <= 64 ? password : SHA256(password); + const innerLen = 64 + salt.length + 4; + const inner = new Array(innerLen); + const outerKey = new Array(64); + let i2; + let dk = []; + for (i2 = 0; i2 < 64; i2++) { + inner[i2] = 54; + } + for (i2 = 0; i2 < password.length; i2++) { + inner[i2] ^= password[i2]; + } + for (i2 = 0; i2 < salt.length; i2++) { + inner[64 + i2] = salt[i2]; + } + for (i2 = innerLen - 4; i2 < innerLen; i2++) { + inner[i2] = 0; + } + for (i2 = 0; i2 < 64; i2++) outerKey[i2] = 92; + for (i2 = 0; i2 < password.length; i2++) outerKey[i2] ^= password[i2]; + function incrementCounter() { + for (let i3 = innerLen - 1; i3 >= innerLen - 4; i3--) { + inner[i3]++; + if (inner[i3] <= 255) return; + inner[i3] = 0; + } + } + while (dkLen >= 32) { + incrementCounter(); + dk = dk.concat(SHA256(outerKey.concat(SHA256(inner)))); + dkLen -= 32; + } + if (dkLen > 0) { + incrementCounter(); + dk = dk.concat( + SHA256(outerKey.concat(SHA256(inner))).slice(0, dkLen) + ); + } + return dk; + } + function blockmix_salsa8(BY, Yi, r3, x, _X) { + let i2; + arraycopy(BY, (2 * r3 - 1) * 16, _X, 0, 16); + for (i2 = 0; i2 < 2 * r3; i2++) { + blockxor(BY, i2 * 16, _X, 16); + salsa20_8(_X, x); + arraycopy(_X, 0, BY, Yi + i2 * 16, 16); + } + for (i2 = 0; i2 < r3; i2++) { + arraycopy(BY, Yi + i2 * 2 * 16, BY, i2 * 16, 16); + } + for (i2 = 0; i2 < r3; i2++) { + arraycopy(BY, Yi + (i2 * 2 + 1) * 16, BY, (i2 + r3) * 16, 16); + } + } + function R2(a2, b) { + return (a2 << b) | (a2 >>> (32 - b)); + } + function salsa20_8(B, x) { + arraycopy(B, 0, x, 0, 16); + for (let i2 = 8; i2 > 0; i2 -= 2) { + x[4] ^= R2(x[0] + x[12], 7); + x[8] ^= R2(x[4] + x[0], 9); + x[12] ^= R2(x[8] + x[4], 13); + x[0] ^= R2(x[12] + x[8], 18); + x[9] ^= R2(x[5] + x[1], 7); + x[13] ^= R2(x[9] + x[5], 9); + x[1] ^= R2(x[13] + x[9], 13); + x[5] ^= R2(x[1] + x[13], 18); + x[14] ^= R2(x[10] + x[6], 7); + x[2] ^= R2(x[14] + x[10], 9); + x[6] ^= R2(x[2] + x[14], 13); + x[10] ^= R2(x[6] + x[2], 18); + x[3] ^= R2(x[15] + x[11], 7); + x[7] ^= R2(x[3] + x[15], 9); + x[11] ^= R2(x[7] + x[3], 13); + x[15] ^= R2(x[11] + x[7], 18); + x[1] ^= R2(x[0] + x[3], 7); + x[2] ^= R2(x[1] + x[0], 9); + x[3] ^= R2(x[2] + x[1], 13); + x[0] ^= R2(x[3] + x[2], 18); + x[6] ^= R2(x[5] + x[4], 7); + x[7] ^= R2(x[6] + x[5], 9); + x[4] ^= R2(x[7] + x[6], 13); + x[5] ^= R2(x[4] + x[7], 18); + x[11] ^= R2(x[10] + x[9], 7); + x[8] ^= R2(x[11] + x[10], 9); + x[9] ^= R2(x[8] + x[11], 13); + x[10] ^= R2(x[9] + x[8], 18); + x[12] ^= R2(x[15] + x[14], 7); + x[13] ^= R2(x[12] + x[15], 9); + x[14] ^= R2(x[13] + x[12], 13); + x[15] ^= R2(x[14] + x[13], 18); + } + for (let i2 = 0; i2 < 16; ++i2) { + B[i2] += x[i2]; + } + } + function blockxor(S2, Si, D3, len) { + for (let i2 = 0; i2 < len; i2++) { + D3[i2] ^= S2[Si + i2]; + } + } + function arraycopy(src, srcPos, dest, destPos, length) { + while (length--) { + dest[destPos++] = src[srcPos++]; + } + } + function checkBufferish(o2) { + if (!o2 || typeof o2.length !== 'number') { + return false; + } + for (let i2 = 0; i2 < o2.length; i2++) { + const v = o2[i2]; + if (typeof v !== 'number' || v % 1 || v < 0 || v >= 256) { + return false; + } + } + return true; + } + function ensureInteger(value, name) { + if (typeof value !== 'number' || value % 1) { + throw new Error('invalid ' + name); + } + return value; + } + function _scrypt(password, salt, N2, r3, p, dkLen, callback) { + N2 = ensureInteger(N2, 'N'); + r3 = ensureInteger(r3, 'r'); + p = ensureInteger(p, 'p'); + dkLen = ensureInteger(dkLen, 'dkLen'); + if (N2 === 0 || (N2 & (N2 - 1)) !== 0) { + throw new Error('N must be power of 2'); + } + if (N2 > MAX_VALUE / 128 / r3) { + throw new Error('N too large'); + } + if (r3 > MAX_VALUE / 128 / p) { + throw new Error('r too large'); + } + if (!checkBufferish(password)) { + throw new Error('password must be an array or buffer'); + } + password = Array.prototype.slice.call(password); + if (!checkBufferish(salt)) { + throw new Error('salt must be an array or buffer'); + } + salt = Array.prototype.slice.call(salt); + let b = PBKDF2_HMAC_SHA256_OneIter(password, salt, p * 128 * r3); + const B = new Uint32Array(p * 32 * r3); + for (let i2 = 0; i2 < B.length; i2++) { + const j = i2 * 4; + B[i2] = + ((b[j + 3] & 255) << 24) | + ((b[j + 2] & 255) << 16) | + ((b[j + 1] & 255) << 8) | + ((b[j + 0] & 255) << 0); + } + const XY = new Uint32Array(64 * r3); + const V = new Uint32Array(32 * r3 * N2); + const Yi = 32 * r3; + const x = new Uint32Array(16); + const _X = new Uint32Array(16); + const totalOps = p * N2 * 2; + let currentOp = 0; + let lastPercent10 = null; + let stop = false; + let state = 0; + let i0 = 0, + i1; + let Bi; + const limit = callback ? parseInt(1e3 / r3) : 4294967295; + const nextTick = + typeof setImmediate !== 'undefined' ? setImmediate : setTimeout; + const incrementalSMix = function () { + if (stop) { + return callback(new Error('cancelled'), currentOp / totalOps); + } + let steps; + switch (state) { + case 0: + Bi = i0 * 32 * r3; + arraycopy(B, Bi, XY, 0, Yi); + state = 1; + i1 = 0; + case 1: + steps = N2 - i1; + if (steps > limit) { + steps = limit; + } + for (let i2 = 0; i2 < steps; i2++) { + arraycopy(XY, 0, V, (i1 + i2) * Yi, Yi); + blockmix_salsa8(XY, Yi, r3, x, _X); + } + i1 += steps; + currentOp += steps; + if (callback) { + const percent10 = parseInt((1e3 * currentOp) / totalOps); + if (percent10 !== lastPercent10) { + stop = callback(null, currentOp / totalOps); + if (stop) { + break; + } + lastPercent10 = percent10; + } + } + if (i1 < N2) { + break; + } + i1 = 0; + state = 2; + case 2: + steps = N2 - i1; + if (steps > limit) { + steps = limit; + } + for (let i2 = 0; i2 < steps; i2++) { + const offset = (2 * r3 - 1) * 16; + const j = XY[offset] & (N2 - 1); + blockxor(V, j * Yi, XY, Yi); + blockmix_salsa8(XY, Yi, r3, x, _X); + } + i1 += steps; + currentOp += steps; + if (callback) { + const percent10 = parseInt((1e3 * currentOp) / totalOps); + if (percent10 !== lastPercent10) { + stop = callback(null, currentOp / totalOps); + if (stop) { + break; + } + lastPercent10 = percent10; + } + } + if (i1 < N2) { + break; + } + arraycopy(XY, 0, B, Bi, Yi); + i0++; + if (i0 < p) { + state = 0; + break; + } + b = []; + for (let i2 = 0; i2 < B.length; i2++) { + b.push((B[i2] >> 0) & 255); + b.push((B[i2] >> 8) & 255); + b.push((B[i2] >> 16) & 255); + b.push((B[i2] >> 24) & 255); + } + const derivedKey = PBKDF2_HMAC_SHA256_OneIter(password, b, dkLen); + if (callback) { + callback(null, 1, derivedKey); + } + return derivedKey; + } + if (callback) { + nextTick(incrementalSMix); + } + }; + if (!callback) { + while (true) { + const derivedKey = incrementalSMix(); + if (derivedKey != void 0) { + return derivedKey; + } + } + } + incrementalSMix(); + } + const lib = { + scrypt: function (password, salt, N2, r3, p, dkLen, progressCallback) { + return new Promise(function (resolve, reject) { + let lastProgress = 0; + if (progressCallback) { + progressCallback(0); + } + _scrypt( + password, + salt, + N2, + r3, + p, + dkLen, + function (error, progress, key2) { + if (error) { + reject(error); + } else if (key2) { + if (progressCallback && lastProgress !== 1) { + progressCallback(1); + } + resolve(new Uint8Array(key2)); + } else if (progressCallback && progress !== lastProgress) { + lastProgress = progress; + return progressCallback(progress); + } + } + ); + }); + }, + syncScrypt: function (password, salt, N2, r3, p, dkLen) { + return new Uint8Array(_scrypt(password, salt, N2, r3, p, dkLen)); + }, + }; + if (typeof exports !== 'undefined') { + module2.exports = lib; + } else if (typeof define === 'function' && define.amd) { + define(lib); + } else if (root) { + if (root.scrypt) { + root._scrypt = root.scrypt; + } + root.scrypt = lib; + } + })(exports); + }, +}); + +// node_modules/@ethersproject/json-wallets/lib.esm/keystore.js +function hasMnemonic(value) { + return value != null && value.mnemonic && value.mnemonic.phrase; +} +function _decrypt(data, key2, ciphertext) { + const cipher = searchPath(data, 'crypto/cipher'); + if (cipher === 'aes-128-ctr') { + const iv2 = looseArrayify(searchPath(data, 'crypto/cipherparams/iv')); + const counter = new import_aes_js2.default.Counter(iv2); + const aesCtr = new import_aes_js2.default.ModeOfOperation.ctr( + key2, + counter + ); + return arrayify(aesCtr.decrypt(ciphertext)); + } + return null; +} +function _getAccount(data, key2) { + const ciphertext = looseArrayify(searchPath(data, 'crypto/ciphertext')); + const computedMAC = hexlify( + keccak256(concat([key2.slice(16, 32), ciphertext])) + ).substring(2); + if (computedMAC !== searchPath(data, 'crypto/mac').toLowerCase()) { + throw new Error('invalid password'); + } + const privateKey = _decrypt(data, key2.slice(0, 16), ciphertext); + if (!privateKey) { + logger25.throwError( + 'unsupported cipher', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'decrypt', + } + ); + } + const mnemonicKey = key2.slice(32, 64); + const address = computeAddress(privateKey); + if (data.address) { + let check = data.address.toLowerCase(); + if (check.substring(0, 2) !== '0x') { + check = '0x' + check; + } + if (getAddress(check) !== address) { + throw new Error('address mismatch'); + } + } + const account = { + _isKeystoreAccount: true, + address, + privateKey: hexlify(privateKey), + }; + if (searchPath(data, 'x-ethers/version') === '0.1') { + const mnemonicCiphertext = looseArrayify( + searchPath(data, 'x-ethers/mnemonicCiphertext') + ); + const mnemonicIv = looseArrayify( + searchPath(data, 'x-ethers/mnemonicCounter') + ); + const mnemonicCounter = new import_aes_js2.default.Counter(mnemonicIv); + const mnemonicAesCtr = new import_aes_js2.default.ModeOfOperation.ctr( + mnemonicKey, + mnemonicCounter + ); + const path = searchPath(data, 'x-ethers/path') || defaultPath; + const locale = searchPath(data, 'x-ethers/locale') || 'en'; + const entropy = arrayify(mnemonicAesCtr.decrypt(mnemonicCiphertext)); + try { + const mnemonic = entropyToMnemonic(entropy, locale); + const node = HDNode.fromMnemonic(mnemonic, null, locale).derivePath(path); + if (node.privateKey != account.privateKey) { + throw new Error('mnemonic mismatch'); + } + account.mnemonic = node.mnemonic; + } catch (error) { + if ( + error.code !== Logger.errors.INVALID_ARGUMENT || + error.argument !== 'wordlist' + ) { + throw error; + } + } + } + return new KeystoreAccount(account); +} +function pbkdf2Sync(passwordBytes, salt, count, dkLen, prfFunc) { + return arrayify(pbkdf2(passwordBytes, salt, count, dkLen, prfFunc)); +} +function pbkdf22(passwordBytes, salt, count, dkLen, prfFunc) { + return Promise.resolve( + pbkdf2Sync(passwordBytes, salt, count, dkLen, prfFunc) + ); +} +function _computeKdfKey( + data, + password, + pbkdf2Func, + scryptFunc, + progressCallback +) { + const passwordBytes = getPassword(password); + const kdf = searchPath(data, 'crypto/kdf'); + if (kdf && typeof kdf === 'string') { + const throwError = function (name, value) { + return logger25.throwArgumentError( + 'invalid key-derivation function parameters', + name, + value + ); + }; + if (kdf.toLowerCase() === 'scrypt') { + const salt = looseArrayify(searchPath(data, 'crypto/kdfparams/salt')); + const N2 = parseInt(searchPath(data, 'crypto/kdfparams/n')); + const r3 = parseInt(searchPath(data, 'crypto/kdfparams/r')); + const p = parseInt(searchPath(data, 'crypto/kdfparams/p')); + if (!N2 || !r3 || !p) { + throwError('kdf', kdf); + } + if ((N2 & (N2 - 1)) !== 0) { + throwError('N', N2); + } + const dkLen = parseInt(searchPath(data, 'crypto/kdfparams/dklen')); + if (dkLen !== 32) { + throwError('dklen', dkLen); + } + return scryptFunc(passwordBytes, salt, N2, r3, p, 64, progressCallback); + } else if (kdf.toLowerCase() === 'pbkdf2') { + const salt = looseArrayify(searchPath(data, 'crypto/kdfparams/salt')); + let prfFunc = null; + const prf = searchPath(data, 'crypto/kdfparams/prf'); + if (prf === 'hmac-sha256') { + prfFunc = 'sha256'; + } else if (prf === 'hmac-sha512') { + prfFunc = 'sha512'; + } else { + throwError('prf', prf); + } + const count = parseInt(searchPath(data, 'crypto/kdfparams/c')); + const dkLen = parseInt(searchPath(data, 'crypto/kdfparams/dklen')); + if (dkLen !== 32) { + throwError('dklen', dkLen); + } + return pbkdf2Func(passwordBytes, salt, count, dkLen, prfFunc); + } + } + return logger25.throwArgumentError( + 'unsupported key-derivation function', + 'kdf', + kdf + ); +} +function decryptSync(json, password) { + const data = JSON.parse(json); + const key2 = _computeKdfKey( + data, + password, + pbkdf2Sync, + import_scrypt_js.default.syncScrypt + ); + return _getAccount(data, key2); +} +function decrypt2(json, password, progressCallback) { + return __awaiter6(this, void 0, void 0, function* () { + const data = JSON.parse(json); + const key2 = yield _computeKdfKey( + data, + password, + pbkdf22, + import_scrypt_js.default.scrypt, + progressCallback + ); + return _getAccount(data, key2); + }); +} +function encrypt(account, password, options, progressCallback) { + try { + if (getAddress(account.address) !== computeAddress(account.privateKey)) { + throw new Error('address/privateKey mismatch'); + } + if (hasMnemonic(account)) { + const mnemonic = account.mnemonic; + const node = HDNode.fromMnemonic( + mnemonic.phrase, + null, + mnemonic.locale + ).derivePath(mnemonic.path || defaultPath); + if (node.privateKey != account.privateKey) { + throw new Error('mnemonic mismatch'); + } + } + } catch (e2) { + return Promise.reject(e2); + } + if (typeof options === 'function' && !progressCallback) { + progressCallback = options; + options = {}; + } + if (!options) { + options = {}; + } + const privateKey = arrayify(account.privateKey); + const passwordBytes = getPassword(password); + let entropy = null; + let path = null; + let locale = null; + if (hasMnemonic(account)) { + const srcMnemonic = account.mnemonic; + entropy = arrayify( + mnemonicToEntropy(srcMnemonic.phrase, srcMnemonic.locale || 'en') + ); + path = srcMnemonic.path || defaultPath; + locale = srcMnemonic.locale || 'en'; + } + let client = options.client; + if (!client) { + client = 'ethers.js'; + } + let salt = null; + if (options.salt) { + salt = arrayify(options.salt); + } else { + salt = randomBytes(32); + } + let iv2 = null; + if (options.iv) { + iv2 = arrayify(options.iv); + if (iv2.length !== 16) { + throw new Error('invalid iv'); + } + } else { + iv2 = randomBytes(16); + } + let uuidRandom = null; + if (options.uuid) { + uuidRandom = arrayify(options.uuid); + if (uuidRandom.length !== 16) { + throw new Error('invalid uuid'); + } + } else { + uuidRandom = randomBytes(16); + } + let N2 = 1 << 17, + r3 = 8, + p = 1; + if (options.scrypt) { + if (options.scrypt.N) { + N2 = options.scrypt.N; + } + if (options.scrypt.r) { + r3 = options.scrypt.r; + } + if (options.scrypt.p) { + p = options.scrypt.p; + } + } + return import_scrypt_js.default + .scrypt(passwordBytes, salt, N2, r3, p, 64, progressCallback) + .then((key2) => { + key2 = arrayify(key2); + const derivedKey = key2.slice(0, 16); + const macPrefix = key2.slice(16, 32); + const mnemonicKey = key2.slice(32, 64); + const counter = new import_aes_js2.default.Counter(iv2); + const aesCtr = new import_aes_js2.default.ModeOfOperation.ctr( + derivedKey, + counter + ); + const ciphertext = arrayify(aesCtr.encrypt(privateKey)); + const mac = keccak256(concat([macPrefix, ciphertext])); + const data = { + address: account.address.substring(2).toLowerCase(), + id: uuidV4(uuidRandom), + version: 3, + crypto: { + cipher: 'aes-128-ctr', + cipherparams: { + iv: hexlify(iv2).substring(2), + }, + ciphertext: hexlify(ciphertext).substring(2), + kdf: 'scrypt', + kdfparams: { + salt: hexlify(salt).substring(2), + n: N2, + dklen: 32, + p, + r: r3, + }, + mac: mac.substring(2), + }, + }; + if (entropy) { + const mnemonicIv = randomBytes(16); + const mnemonicCounter = new import_aes_js2.default.Counter(mnemonicIv); + const mnemonicAesCtr = new import_aes_js2.default.ModeOfOperation.ctr( + mnemonicKey, + mnemonicCounter + ); + const mnemonicCiphertext = arrayify(mnemonicAesCtr.encrypt(entropy)); + const now2 = /* @__PURE__ */ new Date(); + const timestamp = + now2.getUTCFullYear() + + '-' + + zpad(now2.getUTCMonth() + 1, 2) + + '-' + + zpad(now2.getUTCDate(), 2) + + 'T' + + zpad(now2.getUTCHours(), 2) + + '-' + + zpad(now2.getUTCMinutes(), 2) + + '-' + + zpad(now2.getUTCSeconds(), 2) + + '.0Z'; + data['x-ethers'] = { + client, + gethFilename: 'UTC--' + timestamp + '--' + data.address, + mnemonicCounter: hexlify(mnemonicIv).substring(2), + mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2), + path, + locale, + version: '0.1', + }; + } + return JSON.stringify(data); + }); +} +var import_aes_js2, import_scrypt_js, __awaiter6, logger25, KeystoreAccount; +var init_keystore = __esm({ + 'node_modules/@ethersproject/json-wallets/lib.esm/keystore.js'() { + 'use strict'; + init_shim(); + import_aes_js2 = __toESM(require_aes_js()); + import_scrypt_js = __toESM(require_scrypt()); + init_lib7(); + init_lib2(); + init_lib22(); + init_lib5(); + init_lib20(); + init_lib23(); + init_lib4(); + init_lib17(); + init_utils(); + init_lib(); + init_version18(); + __awaiter6 = 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 (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + logger25 = new Logger(version20); + KeystoreAccount = class extends Description { + isKeystoreAccount(value) { + return !!(value && value._isKeystoreAccount); + } + }; + }, +}); + +// node_modules/@ethersproject/json-wallets/lib.esm/index.js +var lib_exports18 = {}; +__export(lib_exports18, { + decryptCrowdsale: () => decrypt, + decryptJsonWallet: () => decryptJsonWallet, + decryptJsonWalletSync: () => decryptJsonWalletSync, + decryptKeystore: () => decrypt2, + decryptKeystoreSync: () => decryptSync, + encryptKeystore: () => encrypt, + getJsonWalletAddress: () => getJsonWalletAddress, + isCrowdsaleWallet: () => isCrowdsaleWallet, + isKeystoreWallet: () => isKeystoreWallet, +}); +function decryptJsonWallet(json, password, progressCallback) { + if (isCrowdsaleWallet(json)) { + if (progressCallback) { + progressCallback(0); + } + const account = decrypt(json, password); + if (progressCallback) { + progressCallback(1); + } + return Promise.resolve(account); + } + if (isKeystoreWallet(json)) { + return decrypt2(json, password, progressCallback); + } + return Promise.reject(new Error('invalid JSON wallet')); +} +function decryptJsonWalletSync(json, password) { + if (isCrowdsaleWallet(json)) { + return decrypt(json, password); + } + if (isKeystoreWallet(json)) { + return decryptSync(json, password); + } + throw new Error('invalid JSON wallet'); +} +var init_lib24 = __esm({ + 'node_modules/@ethersproject/json-wallets/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_crowdsale(); + init_inspect(); + init_keystore(); + }, +}); + +// node_modules/@ethersproject/wallet/lib.esm/_version.js +var version21; +var init_version19 = __esm({ + 'node_modules/@ethersproject/wallet/lib.esm/_version.js'() { + init_shim(); + version21 = 'wallet/5.7.0'; + }, +}); + +// node_modules/@ethersproject/wallet/lib.esm/index.js +var lib_exports19 = {}; +__export(lib_exports19, { + Wallet: () => Wallet, + verifyMessage: () => verifyMessage, + verifyTypedData: () => verifyTypedData, +}); +function isAccount(value) { + return ( + value != null && isHexString(value.privateKey, 32) && value.address != null + ); +} +function hasMnemonic2(value) { + const mnemonic = value.mnemonic; + return mnemonic && mnemonic.phrase; +} +function verifyMessage(message, signature2) { + return recoverAddress(hashMessage(message), signature2); +} +function verifyTypedData(domain, types, value, signature2) { + return recoverAddress( + TypedDataEncoder.hash(domain, types, value), + signature2 + ); +} +var __awaiter7, logger26, Wallet; +var init_lib25 = __esm({ + 'node_modules/@ethersproject/wallet/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_lib7(); + init_lib14(); + init_lib15(); + init_lib2(); + init_lib12(); + init_lib22(); + init_lib5(); + init_lib4(); + init_lib23(); + init_lib16(); + init_lib24(); + init_lib17(); + init_lib(); + init_version19(); + __awaiter7 = 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 (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + logger26 = new Logger(version21); + Wallet = class extends Signer { + constructor(privateKey, provider) { + super(); + if (isAccount(privateKey)) { + const signingKey = new SigningKey(privateKey.privateKey); + defineReadOnly(this, '_signingKey', () => signingKey); + defineReadOnly(this, 'address', computeAddress(this.publicKey)); + if (this.address !== getAddress(privateKey.address)) { + logger26.throwArgumentError( + 'privateKey/address mismatch', + 'privateKey', + '[REDACTED]' + ); + } + if (hasMnemonic2(privateKey)) { + const srcMnemonic = privateKey.mnemonic; + defineReadOnly(this, '_mnemonic', () => ({ + phrase: srcMnemonic.phrase, + path: srcMnemonic.path || defaultPath, + locale: srcMnemonic.locale || 'en', + })); + const mnemonic = this.mnemonic; + const node = HDNode.fromMnemonic( + mnemonic.phrase, + null, + mnemonic.locale + ).derivePath(mnemonic.path); + if (computeAddress(node.privateKey) !== this.address) { + logger26.throwArgumentError( + 'mnemonic/address mismatch', + 'privateKey', + '[REDACTED]' + ); + } + } else { + defineReadOnly(this, '_mnemonic', () => null); + } + } else { + if (SigningKey.isSigningKey(privateKey)) { + if (privateKey.curve !== 'secp256k1') { + logger26.throwArgumentError( + 'unsupported curve; must be secp256k1', + 'privateKey', + '[REDACTED]' + ); + } + defineReadOnly(this, '_signingKey', () => privateKey); + } else { + if (typeof privateKey === 'string') { + if ( + privateKey.match(/^[0-9a-f]*$/i) && + privateKey.length === 64 + ) { + privateKey = '0x' + privateKey; + } + } + const signingKey = new SigningKey(privateKey); + defineReadOnly(this, '_signingKey', () => signingKey); + } + defineReadOnly(this, '_mnemonic', () => null); + defineReadOnly(this, 'address', computeAddress(this.publicKey)); + } + if (provider && !Provider.isProvider(provider)) { + logger26.throwArgumentError('invalid provider', 'provider', provider); + } + defineReadOnly(this, 'provider', provider || null); + } + get mnemonic() { + return this._mnemonic(); + } + get privateKey() { + return this._signingKey().privateKey; + } + get publicKey() { + return this._signingKey().publicKey; + } + getAddress() { + return Promise.resolve(this.address); + } + connect(provider) { + return new Wallet(this, provider); + } + signTransaction(transaction) { + return resolveProperties(transaction).then((tx) => { + if (tx.from != null) { + if (getAddress(tx.from) !== this.address) { + logger26.throwArgumentError( + 'transaction from address mismatch', + 'transaction.from', + transaction.from + ); + } + delete tx.from; + } + const signature2 = this._signingKey().signDigest( + keccak256(serialize(tx)) + ); + return serialize(tx, signature2); + }); + } + signMessage(message) { + return __awaiter7(this, void 0, void 0, function* () { + return joinSignature( + this._signingKey().signDigest(hashMessage(message)) + ); + }); + } + _signTypedData(domain, types, value) { + return __awaiter7(this, void 0, void 0, function* () { + const populated = yield TypedDataEncoder.resolveNames( + domain, + types, + value, + (name) => { + if (this.provider == null) { + logger26.throwError( + 'cannot resolve ENS names without a provider', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'resolveName', + value: name, + } + ); + } + return this.provider.resolveName(name); + } + ); + return joinSignature( + this._signingKey().signDigest( + TypedDataEncoder.hash(populated.domain, types, populated.value) + ) + ); + }); + } + encrypt(password, options, progressCallback) { + if (typeof options === 'function' && !progressCallback) { + progressCallback = options; + options = {}; + } + if (progressCallback && typeof progressCallback !== 'function') { + throw new Error('invalid callback'); + } + if (!options) { + options = {}; + } + return encrypt(this, password, options, progressCallback); + } + /** + * Static methods to create Wallet instances. + */ + static createRandom(options) { + let entropy = randomBytes(16); + if (!options) { + options = {}; + } + if (options.extraEntropy) { + entropy = arrayify( + hexDataSlice( + keccak256(concat([entropy, options.extraEntropy])), + 0, + 16 + ) + ); + } + const mnemonic = entropyToMnemonic(entropy, options.locale); + return Wallet.fromMnemonic(mnemonic, options.path, options.locale); + } + static fromEncryptedJson(json, password, progressCallback) { + return decryptJsonWallet(json, password, progressCallback).then( + (account) => { + return new Wallet(account); + } + ); + } + static fromEncryptedJsonSync(json, password) { + return new Wallet(decryptJsonWalletSync(json, password)); + } + static fromMnemonic(mnemonic, path, wordlist2) { + if (!path) { + path = defaultPath; + } + return new Wallet( + HDNode.fromMnemonic(mnemonic, null, wordlist2).derivePath(path) + ); + } + }; + }, +}); + +// node_modules/@ethersproject/web/lib.esm/_version.js +var version23; +var init_version20 = __esm({ + 'node_modules/@ethersproject/web/lib.esm/_version.js'() { + init_shim(); + version23 = 'web/5.7.1'; + }, +}); + +// node_modules/@ethersproject/web/lib.esm/geturl.js +function getUrl(href, options) { + return __awaiter8(this, void 0, void 0, function* () { + if (options == null) { + options = {}; + } + const request = { + method: options.method || 'GET', + headers: options.headers || {}, + body: options.body || void 0, + }; + if (options.skipFetchSetup !== true) { + request.mode = 'cors'; + request.cache = 'no-cache'; + request.credentials = 'same-origin'; + request.redirect = 'follow'; + request.referrer = 'client'; + } + if (options.fetchOptions != null) { + const opts = options.fetchOptions; + if (opts.mode) { + request.mode = opts.mode; + } + if (opts.cache) { + request.cache = opts.cache; + } + if (opts.credentials) { + request.credentials = opts.credentials; + } + if (opts.redirect) { + request.redirect = opts.redirect; + } + if (opts.referrer) { + request.referrer = opts.referrer; + } + } + const response = yield fetch(href, request); + const body = yield response.arrayBuffer(); + const headers = {}; + if (response.headers.forEach) { + response.headers.forEach((value, key2) => { + headers[key2.toLowerCase()] = value; + }); + } else { + response.headers.keys().forEach((key2) => { + headers[key2.toLowerCase()] = response.headers.get(key2); + }); + } + return { + headers, + statusCode: response.status, + statusMessage: response.statusText, + body: arrayify(new Uint8Array(body)), + }; + }); +} +var __awaiter8; +var init_geturl = __esm({ + 'node_modules/@ethersproject/web/lib.esm/geturl.js'() { + 'use strict'; + init_shim(); + init_lib2(); + __awaiter8 = 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 (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + }, +}); + +// node_modules/@ethersproject/web/lib.esm/index.js +var lib_exports20 = {}; +__export(lib_exports20, { + _fetchData: () => _fetchData, + fetchJson: () => fetchJson, + poll: () => poll, +}); +function staller(duration) { + return new Promise((resolve) => { + setTimeout(resolve, duration); + }); +} +function bodyify(value, type) { + if (value == null) { + return null; + } + if (typeof value === 'string') { + return value; + } + if (isBytesLike(value)) { + if ( + type && + (type.split('/')[0] === 'text' || + type.split(';')[0].trim() === 'application/json') + ) { + try { + return toUtf8String(value); + } catch (error) {} + } + return hexlify(value); + } + return value; +} +function unpercent(value) { + return toUtf8Bytes( + value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code9) => { + return String.fromCharCode(parseInt(code9, 16)); + }) + ); +} +function _fetchData(connection, body, processFunc) { + const attemptLimit = + typeof connection === 'object' && connection.throttleLimit != null + ? connection.throttleLimit + : 12; + logger28.assertArgument( + attemptLimit > 0 && attemptLimit % 1 === 0, + 'invalid connection throttle limit', + 'connection.throttleLimit', + attemptLimit + ); + const throttleCallback = + typeof connection === 'object' ? connection.throttleCallback : null; + const throttleSlotInterval = + typeof connection === 'object' && + typeof connection.throttleSlotInterval === 'number' + ? connection.throttleSlotInterval + : 100; + logger28.assertArgument( + throttleSlotInterval > 0 && throttleSlotInterval % 1 === 0, + 'invalid connection throttle slot interval', + 'connection.throttleSlotInterval', + throttleSlotInterval + ); + const errorPassThrough = + typeof connection === 'object' ? !!connection.errorPassThrough : false; + const headers = {}; + let url = null; + const options = { + method: 'GET', + }; + let allow304 = false; + let timeout = 2 * 60 * 1e3; + if (typeof connection === 'string') { + url = connection; + } else if (typeof connection === 'object') { + if (connection == null || connection.url == null) { + logger28.throwArgumentError('missing URL', 'connection.url', connection); + } + url = connection.url; + if (typeof connection.timeout === 'number' && connection.timeout > 0) { + timeout = connection.timeout; + } + if (connection.headers) { + for (const key2 in connection.headers) { + headers[key2.toLowerCase()] = { + key: key2, + value: String(connection.headers[key2]), + }; + if ( + ['if-none-match', 'if-modified-since'].indexOf(key2.toLowerCase()) >= + 0 + ) { + allow304 = true; + } + } + } + options.allowGzip = !!connection.allowGzip; + if (connection.user != null && connection.password != null) { + if ( + url.substring(0, 6) !== 'https:' && + connection.allowInsecureAuthentication !== true + ) { + logger28.throwError( + 'basic authentication requires a secure https url', + Logger.errors.INVALID_ARGUMENT, + { + argument: 'url', + url, + user: connection.user, + password: '[REDACTED]', + } + ); + } + const authorization = connection.user + ':' + connection.password; + headers['authorization'] = { + key: 'Authorization', + value: 'Basic ' + encode2(toUtf8Bytes(authorization)), + }; + } + if (connection.skipFetchSetup != null) { + options.skipFetchSetup = !!connection.skipFetchSetup; + } + if (connection.fetchOptions != null) { + options.fetchOptions = shallowCopy(connection.fetchOptions); + } + } + const reData = new RegExp('^data:([^;:]*)?(;base64)?,(.*)$', 'i'); + const dataMatch = url ? url.match(reData) : null; + if (dataMatch) { + try { + const response = { + statusCode: 200, + statusMessage: 'OK', + headers: { 'content-type': dataMatch[1] || 'text/plain' }, + body: dataMatch[2] ? decode2(dataMatch[3]) : unpercent(dataMatch[3]), + }; + let result = response.body; + if (processFunc) { + result = processFunc(response.body, response); + } + return Promise.resolve(result); + } catch (error) { + logger28.throwError( + 'processing response error', + Logger.errors.SERVER_ERROR, + { + body: bodyify(dataMatch[1], dataMatch[2]), + error, + requestBody: null, + requestMethod: 'GET', + url, + } + ); + } + } + if (body) { + options.method = 'POST'; + options.body = body; + if (headers['content-type'] == null) { + headers['content-type'] = { + key: 'Content-Type', + value: 'application/octet-stream', + }; + } + if (headers['content-length'] == null) { + headers['content-length'] = { + key: 'Content-Length', + value: String(body.length), + }; + } + } + const flatHeaders = {}; + Object.keys(headers).forEach((key2) => { + const header = headers[key2]; + flatHeaders[header.key] = header.value; + }); + options.headers = flatHeaders; + const runningTimeout = (function () { + let timer2 = null; + const promise = new Promise(function (resolve, reject) { + if (timeout) { + timer2 = setTimeout(() => { + if (timer2 == null) { + return; + } + timer2 = null; + reject( + logger28.makeError('timeout', Logger.errors.TIMEOUT, { + requestBody: bodyify(options.body, flatHeaders['content-type']), + requestMethod: options.method, + timeout, + url, + }) + ); + }, timeout); + } + }); + const cancel = function () { + if (timer2 == null) { + return; + } + clearTimeout(timer2); + timer2 = null; + }; + return { promise, cancel }; + })(); + const runningFetch = (function () { + return __awaiter9(this, void 0, void 0, function* () { + for (let attempt = 0; attempt < attemptLimit; attempt++) { + let response = null; + try { + response = yield getUrl(url, options); + if (attempt < attemptLimit) { + if (response.statusCode === 301 || response.statusCode === 302) { + const location = response.headers.location || ''; + if (options.method === 'GET' && location.match(/^https:/)) { + url = response.headers.location; + continue; + } + } else if (response.statusCode === 429) { + let tryAgain = true; + if (throttleCallback) { + tryAgain = yield throttleCallback(attempt, url); + } + if (tryAgain) { + let stall3 = 0; + const retryAfter = response.headers['retry-after']; + if ( + typeof retryAfter === 'string' && + retryAfter.match(/^[1-9][0-9]*$/) + ) { + stall3 = parseInt(retryAfter) * 1e3; + } else { + stall3 = + throttleSlotInterval * + parseInt(String(Math.random() * Math.pow(2, attempt))); + } + yield staller(stall3); + continue; + } + } + } + } catch (error) { + response = error.response; + if (response == null) { + runningTimeout.cancel(); + logger28.throwError( + 'missing response', + Logger.errors.SERVER_ERROR, + { + requestBody: bodyify(options.body, flatHeaders['content-type']), + requestMethod: options.method, + serverError: error, + url, + } + ); + } + } + let body2 = response.body; + if (allow304 && response.statusCode === 304) { + body2 = null; + } else if ( + !errorPassThrough && + (response.statusCode < 200 || response.statusCode >= 300) + ) { + runningTimeout.cancel(); + logger28.throwError('bad response', Logger.errors.SERVER_ERROR, { + status: response.statusCode, + headers: response.headers, + body: bodyify( + body2, + response.headers ? response.headers['content-type'] : null + ), + requestBody: bodyify(options.body, flatHeaders['content-type']), + requestMethod: options.method, + url, + }); + } + if (processFunc) { + try { + const result = yield processFunc(body2, response); + runningTimeout.cancel(); + return result; + } catch (error) { + if (error.throttleRetry && attempt < attemptLimit) { + let tryAgain = true; + if (throttleCallback) { + tryAgain = yield throttleCallback(attempt, url); + } + if (tryAgain) { + const timeout2 = + throttleSlotInterval * + parseInt(String(Math.random() * Math.pow(2, attempt))); + yield staller(timeout2); + continue; + } + } + runningTimeout.cancel(); + logger28.throwError( + 'processing response error', + Logger.errors.SERVER_ERROR, + { + body: bodyify( + body2, + response.headers ? response.headers['content-type'] : null + ), + error, + requestBody: bodyify(options.body, flatHeaders['content-type']), + requestMethod: options.method, + url, + } + ); + } + } + runningTimeout.cancel(); + return body2; + } + return logger28.throwError( + 'failed response', + Logger.errors.SERVER_ERROR, + { + requestBody: bodyify(options.body, flatHeaders['content-type']), + requestMethod: options.method, + url, + } + ); + }); + })(); + return Promise.race([runningTimeout.promise, runningFetch]); +} +function fetchJson(connection, json, processFunc) { + let processJsonFunc = (value, response) => { + let result = null; + if (value != null) { + try { + result = JSON.parse(toUtf8String(value)); + } catch (error) { + logger28.throwError('invalid JSON', Logger.errors.SERVER_ERROR, { + body: value, + error, + }); + } + } + if (processFunc) { + result = processFunc(result, response); + } + return result; + }; + let body = null; + if (json != null) { + body = toUtf8Bytes(json); + const updated = + typeof connection === 'string' + ? { url: connection } + : shallowCopy(connection); + if (updated.headers) { + const hasContentType = + Object.keys(updated.headers).filter( + (k) => k.toLowerCase() === 'content-type' + ).length !== 0; + if (!hasContentType) { + updated.headers = shallowCopy(updated.headers); + updated.headers['content-type'] = 'application/json'; + } + } else { + updated.headers = { 'content-type': 'application/json' }; + } + connection = updated; + } + return _fetchData(connection, body, processJsonFunc); +} +function poll(func, options) { + if (!options) { + options = {}; + } + options = shallowCopy(options); + if (options.floor == null) { + options.floor = 0; + } + if (options.ceiling == null) { + options.ceiling = 1e4; + } + if (options.interval == null) { + options.interval = 250; + } + return new Promise(function (resolve, reject) { + let timer2 = null; + let done = false; + const cancel = () => { + if (done) { + return false; + } + done = true; + if (timer2) { + clearTimeout(timer2); + } + return true; + }; + if (options.timeout) { + timer2 = setTimeout(() => { + if (cancel()) { + reject(new Error('timeout')); + } + }, options.timeout); + } + const retryLimit = options.retryLimit; + let attempt = 0; + function check() { + return func().then( + function (result) { + if (result !== void 0) { + if (cancel()) { + resolve(result); + } + } else if (options.oncePoll) { + options.oncePoll.once('poll', check); + } else if (options.onceBlock) { + options.onceBlock.once('block', check); + } else if (!done) { + attempt++; + if (attempt > retryLimit) { + if (cancel()) { + reject(new Error('retry limit reached')); + } + return; + } + let timeout = + options.interval * + parseInt(String(Math.random() * Math.pow(2, attempt))); + if (timeout < options.floor) { + timeout = options.floor; + } + if (timeout > options.ceiling) { + timeout = options.ceiling; + } + setTimeout(check, timeout); + } + return null; + }, + function (error) { + if (cancel()) { + reject(error); + } + } + ); + } + check(); + }); +} +var __awaiter9, logger28; +var init_lib26 = __esm({ + 'node_modules/@ethersproject/web/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_lib10(); + init_lib2(); + init_lib4(); + init_lib9(); + init_lib(); + init_version20(); + init_geturl(); + __awaiter9 = 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 (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + logger28 = new Logger(version23); + }, +}); + +// node_modules/@ethersproject/solidity/lib.esm/_version.js +var version25; +var init_version21 = __esm({ + 'node_modules/@ethersproject/solidity/lib.esm/_version.js'() { + init_shim(); + version25 = 'solidity/5.7.0'; + }, +}); + +// node_modules/@ethersproject/solidity/lib.esm/index.js +var lib_exports22 = {}; +__export(lib_exports22, { + keccak256: () => keccak2562, + pack: () => pack2, + sha256: () => sha2562, +}); +function _pack(type, value, isArray) { + switch (type) { + case 'address': + if (isArray) { + return zeroPad(value, 32); + } + return arrayify(value); + case 'string': + return toUtf8Bytes(value); + case 'bytes': + return arrayify(value); + case 'bool': + value = value ? '0x01' : '0x00'; + if (isArray) { + return zeroPad(value, 32); + } + return arrayify(value); + } + let match = type.match(regexNumber); + if (match) { + let size = parseInt(match[2] || '256'); + if ( + (match[2] && String(size) !== match[2]) || + size % 8 !== 0 || + size === 0 || + size > 256 + ) { + logger44.throwArgumentError('invalid number type', 'type', type); + } + if (isArray) { + size = 256; + } + value = BigNumber.from(value).toTwos(size); + return zeroPad(value, size / 8); + } + match = type.match(regexBytes); + if (match) { + const size = parseInt(match[1]); + if (String(size) !== match[1] || size === 0 || size > 32) { + logger44.throwArgumentError('invalid bytes type', 'type', type); + } + if (arrayify(value).byteLength !== size) { + logger44.throwArgumentError(`invalid value for ${type}`, 'value', value); + } + if (isArray) { + return arrayify((value + Zeros2).substring(0, 66)); + } + return value; + } + match = type.match(regexArray); + if (match && Array.isArray(value)) { + const baseType = match[1]; + const count = parseInt(match[2] || String(value.length)); + if (count != value.length) { + logger44.throwArgumentError( + `invalid array length for ${type}`, + 'value', + value + ); + } + const result = []; + value.forEach(function (value2) { + result.push(_pack(baseType, value2, true)); + }); + return concat(result); + } + return logger44.throwArgumentError('invalid type', 'type', type); +} +function pack2(types, values) { + if (types.length != values.length) { + logger44.throwArgumentError( + 'wrong number of values; expected ${ types.length }', + 'values', + values + ); + } + const tight = []; + types.forEach(function (type, index) { + tight.push(_pack(type, values[index])); + }); + return hexlify(concat(tight)); +} +function keccak2562(types, values) { + return keccak256(pack2(types, values)); +} +function sha2562(types, values) { + return sha256(pack2(types, values)); +} +var regexBytes, regexNumber, regexArray, Zeros2, logger44; +var init_lib27 = __esm({ + 'node_modules/@ethersproject/solidity/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_lib3(); + init_lib2(); + init_lib5(); + init_lib19(); + init_lib9(); + init_lib(); + init_version21(); + regexBytes = new RegExp('^bytes([0-9]+)$'); + regexNumber = new RegExp('^(u?int)([0-9]*)$'); + regexArray = new RegExp('^(.*)\\[([0-9]*)\\]$'); + Zeros2 = '0000000000000000000000000000000000000000000000000000000000000000'; + logger44 = new Logger(version25); + }, +}); + +// node_modules/@ethersproject/units/lib.esm/_version.js +var version26; +var init_version22 = __esm({ + 'node_modules/@ethersproject/units/lib.esm/_version.js'() { + init_shim(); + version26 = 'units/5.7.0'; + }, +}); + +// node_modules/@ethersproject/units/lib.esm/index.js +var lib_exports23 = {}; +__export(lib_exports23, { + commify: () => commify, + formatEther: () => formatEther, + formatUnits: () => formatUnits, + parseEther: () => parseEther, + parseUnits: () => parseUnits, +}); +function commify(value) { + const comps = String(value).split('.'); + if ( + comps.length > 2 || + !comps[0].match(/^-?[0-9]*$/) || + (comps[1] && !comps[1].match(/^[0-9]*$/)) || + value === '.' || + value === '-.' + ) { + logger45.throwArgumentError('invalid value', 'value', value); + } + let whole = comps[0]; + let negative = ''; + if (whole.substring(0, 1) === '-') { + negative = '-'; + whole = whole.substring(1); + } + while (whole.substring(0, 1) === '0') { + whole = whole.substring(1); + } + if (whole === '') { + whole = '0'; + } + let suffix = ''; + if (comps.length === 2) { + suffix = '.' + (comps[1] || '0'); + } + while (suffix.length > 2 && suffix[suffix.length - 1] === '0') { + suffix = suffix.substring(0, suffix.length - 1); + } + const formatted = []; + while (whole.length) { + if (whole.length <= 3) { + formatted.unshift(whole); + break; + } else { + const index = whole.length - 3; + formatted.unshift(whole.substring(index)); + whole = whole.substring(0, index); + } + } + return negative + formatted.join(',') + suffix; +} +function formatUnits(value, unitName) { + if (typeof unitName === 'string') { + const index = names.indexOf(unitName); + if (index !== -1) { + unitName = 3 * index; + } + } + return formatFixed(value, unitName != null ? unitName : 18); +} +function parseUnits(value, unitName) { + if (typeof value !== 'string') { + logger45.throwArgumentError('value must be a string', 'value', value); + } + if (typeof unitName === 'string') { + const index = names.indexOf(unitName); + if (index !== -1) { + unitName = 3 * index; + } + } + return parseFixed(value, unitName != null ? unitName : 18); +} +function formatEther(wei) { + return formatUnits(wei, 18); +} +function parseEther(ether) { + return parseUnits(ether, 18); +} +var logger45, names; +var init_lib28 = __esm({ + 'node_modules/@ethersproject/units/lib.esm/index.js'() { + 'use strict'; + init_shim(); + init_lib3(); + init_lib(); + init_version22(); + logger45 = new Logger(version26); + names = ['wei', 'kwei', 'mwei', 'gwei', 'szabo', 'finney', 'ether']; + }, +}); + +// node_modules/ethers/lib/utils.js +var require_utils2 = __commonJS({ + 'node_modules/ethers/lib/utils.js'(exports) { + 'use strict'; + init_shim(); + var __createBinding = + (exports && exports.__createBinding) || + (Object.create + ? function (o2, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o2, k2, { + enumerable: true, + get: function () { + return m[k]; + }, + }); + } + : function (o2, m, k, k2) { + if (k2 === void 0) k2 = k; + o2[k2] = m[k]; + }); + var __setModuleDefault = + (exports && exports.__setModuleDefault) || + (Object.create + ? function (o2, v) { + Object.defineProperty(o2, 'default', { + enumerable: true, + value: v, + }); + } + : function (o2, v) { + o2['default'] = v; + }); + var __importStar = + (exports && exports.__importStar) || + function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) + if (k !== 'default' && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); + } + __setModuleDefault(result, mod); + return result; + }; + Object.defineProperty(exports, '__esModule', { value: true }); + exports.formatBytes32String = + exports.Utf8ErrorFuncs = + exports.toUtf8String = + exports.toUtf8CodePoints = + exports.toUtf8Bytes = + exports._toEscapedUtf8String = + exports.nameprep = + exports.hexDataSlice = + exports.hexDataLength = + exports.hexZeroPad = + exports.hexValue = + exports.hexStripZeros = + exports.hexConcat = + exports.isHexString = + exports.hexlify = + exports.base64 = + exports.base58 = + exports.TransactionDescription = + exports.LogDescription = + exports.Interface = + exports.SigningKey = + exports.HDNode = + exports.defaultPath = + exports.isBytesLike = + exports.isBytes = + exports.zeroPad = + exports.stripZeros = + exports.concat = + exports.arrayify = + exports.shallowCopy = + exports.resolveProperties = + exports.getStatic = + exports.defineReadOnly = + exports.deepCopy = + exports.checkProperties = + exports.poll = + exports.fetchJson = + exports._fetchData = + exports.RLP = + exports.Logger = + exports.checkResultErrors = + exports.FormatTypes = + exports.ParamType = + exports.FunctionFragment = + exports.EventFragment = + exports.ErrorFragment = + exports.ConstructorFragment = + exports.Fragment = + exports.defaultAbiCoder = + exports.AbiCoder = + void 0; + exports.Indexed = + exports.Utf8ErrorReason = + exports.UnicodeNormalizationForm = + exports.SupportedAlgorithm = + exports.mnemonicToSeed = + exports.isValidMnemonic = + exports.entropyToMnemonic = + exports.mnemonicToEntropy = + exports.getAccountPath = + exports.verifyTypedData = + exports.verifyMessage = + exports.recoverPublicKey = + exports.computePublicKey = + exports.recoverAddress = + exports.computeAddress = + exports.getJsonWalletAddress = + exports.TransactionTypes = + exports.serializeTransaction = + exports.parseTransaction = + exports.accessListify = + exports.joinSignature = + exports.splitSignature = + exports.soliditySha256 = + exports.solidityKeccak256 = + exports.solidityPack = + exports.shuffled = + exports.randomBytes = + exports.sha512 = + exports.sha256 = + exports.ripemd160 = + exports.keccak256 = + exports.computeHmac = + exports.commify = + exports.parseUnits = + exports.formatUnits = + exports.parseEther = + exports.formatEther = + exports.isAddress = + exports.getCreate2Address = + exports.getContractAddress = + exports.getIcapAddress = + exports.getAddress = + exports._TypedDataEncoder = + exports.id = + exports.isValidName = + exports.namehash = + exports.hashMessage = + exports.dnsEncode = + exports.parseBytes32String = + void 0; + var abi_1 = (init_lib13(), __toCommonJS(lib_exports11)); + Object.defineProperty(exports, 'AbiCoder', { + enumerable: true, + get: function () { + return abi_1.AbiCoder; + }, + }); + Object.defineProperty(exports, 'checkResultErrors', { + enumerable: true, + get: function () { + return abi_1.checkResultErrors; + }, + }); + Object.defineProperty(exports, 'ConstructorFragment', { + enumerable: true, + get: function () { + return abi_1.ConstructorFragment; + }, + }); + Object.defineProperty(exports, 'defaultAbiCoder', { + enumerable: true, + get: function () { + return abi_1.defaultAbiCoder; + }, + }); + Object.defineProperty(exports, 'ErrorFragment', { + enumerable: true, + get: function () { + return abi_1.ErrorFragment; + }, + }); + Object.defineProperty(exports, 'EventFragment', { + enumerable: true, + get: function () { + return abi_1.EventFragment; + }, + }); + Object.defineProperty(exports, 'FormatTypes', { + enumerable: true, + get: function () { + return abi_1.FormatTypes; + }, + }); + Object.defineProperty(exports, 'Fragment', { + enumerable: true, + get: function () { + return abi_1.Fragment; + }, + }); + Object.defineProperty(exports, 'FunctionFragment', { + enumerable: true, + get: function () { + return abi_1.FunctionFragment; + }, + }); + Object.defineProperty(exports, 'Indexed', { + enumerable: true, + get: function () { + return abi_1.Indexed; + }, + }); + Object.defineProperty(exports, 'Interface', { + enumerable: true, + get: function () { + return abi_1.Interface; + }, + }); + Object.defineProperty(exports, 'LogDescription', { + enumerable: true, + get: function () { + return abi_1.LogDescription; + }, + }); + Object.defineProperty(exports, 'ParamType', { + enumerable: true, + get: function () { + return abi_1.ParamType; + }, + }); + Object.defineProperty(exports, 'TransactionDescription', { + enumerable: true, + get: function () { + return abi_1.TransactionDescription; + }, + }); + var address_1 = (init_lib7(), __toCommonJS(lib_exports6)); + Object.defineProperty(exports, 'getAddress', { + enumerable: true, + get: function () { + return address_1.getAddress; + }, + }); + Object.defineProperty(exports, 'getCreate2Address', { + enumerable: true, + get: function () { + return address_1.getCreate2Address; + }, + }); + Object.defineProperty(exports, 'getContractAddress', { + enumerable: true, + get: function () { + return address_1.getContractAddress; + }, + }); + Object.defineProperty(exports, 'getIcapAddress', { + enumerable: true, + get: function () { + return address_1.getIcapAddress; + }, + }); + Object.defineProperty(exports, 'isAddress', { + enumerable: true, + get: function () { + return address_1.isAddress; + }, + }); + var base64 = __importStar((init_lib10(), __toCommonJS(lib_exports9))); + exports.base64 = base64; + var basex_1 = (init_lib18(), __toCommonJS(lib_exports14)); + Object.defineProperty(exports, 'base58', { + enumerable: true, + get: function () { + return basex_1.Base58; + }, + }); + var bytes_1 = (init_lib2(), __toCommonJS(lib_exports2)); + Object.defineProperty(exports, 'arrayify', { + enumerable: true, + get: function () { + return bytes_1.arrayify; + }, + }); + Object.defineProperty(exports, 'concat', { + enumerable: true, + get: function () { + return bytes_1.concat; + }, + }); + Object.defineProperty(exports, 'hexConcat', { + enumerable: true, + get: function () { + return bytes_1.hexConcat; + }, + }); + Object.defineProperty(exports, 'hexDataSlice', { + enumerable: true, + get: function () { + return bytes_1.hexDataSlice; + }, + }); + Object.defineProperty(exports, 'hexDataLength', { + enumerable: true, + get: function () { + return bytes_1.hexDataLength; + }, + }); + Object.defineProperty(exports, 'hexlify', { + enumerable: true, + get: function () { + return bytes_1.hexlify; + }, + }); + Object.defineProperty(exports, 'hexStripZeros', { + enumerable: true, + get: function () { + return bytes_1.hexStripZeros; + }, + }); + Object.defineProperty(exports, 'hexValue', { + enumerable: true, + get: function () { + return bytes_1.hexValue; + }, + }); + Object.defineProperty(exports, 'hexZeroPad', { + enumerable: true, + get: function () { + return bytes_1.hexZeroPad; + }, + }); + Object.defineProperty(exports, 'isBytes', { + enumerable: true, + get: function () { + return bytes_1.isBytes; + }, + }); + Object.defineProperty(exports, 'isBytesLike', { + enumerable: true, + get: function () { + return bytes_1.isBytesLike; + }, + }); + Object.defineProperty(exports, 'isHexString', { + enumerable: true, + get: function () { + return bytes_1.isHexString; + }, + }); + Object.defineProperty(exports, 'joinSignature', { + enumerable: true, + get: function () { + return bytes_1.joinSignature; + }, + }); + Object.defineProperty(exports, 'zeroPad', { + enumerable: true, + get: function () { + return bytes_1.zeroPad; + }, + }); + Object.defineProperty(exports, 'splitSignature', { + enumerable: true, + get: function () { + return bytes_1.splitSignature; + }, + }); + Object.defineProperty(exports, 'stripZeros', { + enumerable: true, + get: function () { + return bytes_1.stripZeros; + }, + }); + var hash_1 = (init_lib12(), __toCommonJS(lib_exports10)); + Object.defineProperty(exports, '_TypedDataEncoder', { + enumerable: true, + get: function () { + return hash_1._TypedDataEncoder; + }, + }); + Object.defineProperty(exports, 'dnsEncode', { + enumerable: true, + get: function () { + return hash_1.dnsEncode; + }, + }); + Object.defineProperty(exports, 'hashMessage', { + enumerable: true, + get: function () { + return hash_1.hashMessage; + }, + }); + Object.defineProperty(exports, 'id', { + enumerable: true, + get: function () { + return hash_1.id; + }, + }); + Object.defineProperty(exports, 'isValidName', { + enumerable: true, + get: function () { + return hash_1.isValidName; + }, + }); + Object.defineProperty(exports, 'namehash', { + enumerable: true, + get: function () { + return hash_1.namehash; + }, + }); + var hdnode_1 = (init_lib22(), __toCommonJS(lib_exports16)); + Object.defineProperty(exports, 'defaultPath', { + enumerable: true, + get: function () { + return hdnode_1.defaultPath; + }, + }); + Object.defineProperty(exports, 'entropyToMnemonic', { + enumerable: true, + get: function () { + return hdnode_1.entropyToMnemonic; + }, + }); + Object.defineProperty(exports, 'getAccountPath', { + enumerable: true, + get: function () { + return hdnode_1.getAccountPath; + }, + }); + Object.defineProperty(exports, 'HDNode', { + enumerable: true, + get: function () { + return hdnode_1.HDNode; + }, + }); + Object.defineProperty(exports, 'isValidMnemonic', { + enumerable: true, + get: function () { + return hdnode_1.isValidMnemonic; + }, + }); + Object.defineProperty(exports, 'mnemonicToEntropy', { + enumerable: true, + get: function () { + return hdnode_1.mnemonicToEntropy; + }, + }); + Object.defineProperty(exports, 'mnemonicToSeed', { + enumerable: true, + get: function () { + return hdnode_1.mnemonicToSeed; + }, + }); + var json_wallets_1 = (init_lib24(), __toCommonJS(lib_exports18)); + Object.defineProperty(exports, 'getJsonWalletAddress', { + enumerable: true, + get: function () { + return json_wallets_1.getJsonWalletAddress; + }, + }); + var keccak256_1 = (init_lib5(), __toCommonJS(lib_exports4)); + Object.defineProperty(exports, 'keccak256', { + enumerable: true, + get: function () { + return keccak256_1.keccak256; + }, + }); + var logger_1 = (init_lib(), __toCommonJS(lib_exports)); + Object.defineProperty(exports, 'Logger', { + enumerable: true, + get: function () { + return logger_1.Logger; + }, + }); + var sha2_1 = (init_lib19(), __toCommonJS(lib_exports15)); + Object.defineProperty(exports, 'computeHmac', { + enumerable: true, + get: function () { + return sha2_1.computeHmac; + }, + }); + Object.defineProperty(exports, 'ripemd160', { + enumerable: true, + get: function () { + return sha2_1.ripemd160; + }, + }); + Object.defineProperty(exports, 'sha256', { + enumerable: true, + get: function () { + return sha2_1.sha256; + }, + }); + Object.defineProperty(exports, 'sha512', { + enumerable: true, + get: function () { + return sha2_1.sha512; + }, + }); + var solidity_1 = (init_lib27(), __toCommonJS(lib_exports22)); + Object.defineProperty(exports, 'solidityKeccak256', { + enumerable: true, + get: function () { + return solidity_1.keccak256; + }, + }); + Object.defineProperty(exports, 'solidityPack', { + enumerable: true, + get: function () { + return solidity_1.pack; + }, + }); + Object.defineProperty(exports, 'soliditySha256', { + enumerable: true, + get: function () { + return solidity_1.sha256; + }, + }); + var random_1 = (init_lib23(), __toCommonJS(lib_exports17)); + Object.defineProperty(exports, 'randomBytes', { + enumerable: true, + get: function () { + return random_1.randomBytes; + }, + }); + Object.defineProperty(exports, 'shuffled', { + enumerable: true, + get: function () { + return random_1.shuffled; + }, + }); + var properties_1 = (init_lib4(), __toCommonJS(lib_exports3)); + Object.defineProperty(exports, 'checkProperties', { + enumerable: true, + get: function () { + return properties_1.checkProperties; + }, + }); + Object.defineProperty(exports, 'deepCopy', { + enumerable: true, + get: function () { + return properties_1.deepCopy; + }, + }); + Object.defineProperty(exports, 'defineReadOnly', { + enumerable: true, + get: function () { + return properties_1.defineReadOnly; + }, + }); + Object.defineProperty(exports, 'getStatic', { + enumerable: true, + get: function () { + return properties_1.getStatic; + }, + }); + Object.defineProperty(exports, 'resolveProperties', { + enumerable: true, + get: function () { + return properties_1.resolveProperties; + }, + }); + Object.defineProperty(exports, 'shallowCopy', { + enumerable: true, + get: function () { + return properties_1.shallowCopy; + }, + }); + var RLP = __importStar((init_lib6(), __toCommonJS(lib_exports5))); + exports.RLP = RLP; + var signing_key_1 = (init_lib16(), __toCommonJS(lib_exports12)); + Object.defineProperty(exports, 'computePublicKey', { + enumerable: true, + get: function () { + return signing_key_1.computePublicKey; + }, + }); + Object.defineProperty(exports, 'recoverPublicKey', { + enumerable: true, + get: function () { + return signing_key_1.recoverPublicKey; + }, + }); + Object.defineProperty(exports, 'SigningKey', { + enumerable: true, + get: function () { + return signing_key_1.SigningKey; + }, + }); + var strings_1 = (init_lib9(), __toCommonJS(lib_exports8)); + Object.defineProperty(exports, 'formatBytes32String', { + enumerable: true, + get: function () { + return strings_1.formatBytes32String; + }, + }); + Object.defineProperty(exports, 'nameprep', { + enumerable: true, + get: function () { + return strings_1.nameprep; + }, + }); + Object.defineProperty(exports, 'parseBytes32String', { + enumerable: true, + get: function () { + return strings_1.parseBytes32String; + }, + }); + Object.defineProperty(exports, '_toEscapedUtf8String', { + enumerable: true, + get: function () { + return strings_1._toEscapedUtf8String; + }, + }); + Object.defineProperty(exports, 'toUtf8Bytes', { + enumerable: true, + get: function () { + return strings_1.toUtf8Bytes; + }, + }); + Object.defineProperty(exports, 'toUtf8CodePoints', { + enumerable: true, + get: function () { + return strings_1.toUtf8CodePoints; + }, + }); + Object.defineProperty(exports, 'toUtf8String', { + enumerable: true, + get: function () { + return strings_1.toUtf8String; + }, + }); + Object.defineProperty(exports, 'Utf8ErrorFuncs', { + enumerable: true, + get: function () { + return strings_1.Utf8ErrorFuncs; + }, + }); + var transactions_1 = (init_lib17(), __toCommonJS(lib_exports13)); + Object.defineProperty(exports, 'accessListify', { + enumerable: true, + get: function () { + return transactions_1.accessListify; + }, + }); + Object.defineProperty(exports, 'computeAddress', { + enumerable: true, + get: function () { + return transactions_1.computeAddress; + }, + }); + Object.defineProperty(exports, 'parseTransaction', { + enumerable: true, + get: function () { + return transactions_1.parse; + }, + }); + Object.defineProperty(exports, 'recoverAddress', { + enumerable: true, + get: function () { + return transactions_1.recoverAddress; + }, + }); + Object.defineProperty(exports, 'serializeTransaction', { + enumerable: true, + get: function () { + return transactions_1.serialize; + }, + }); + Object.defineProperty(exports, 'TransactionTypes', { + enumerable: true, + get: function () { + return transactions_1.TransactionTypes; + }, + }); + var units_1 = (init_lib28(), __toCommonJS(lib_exports23)); + Object.defineProperty(exports, 'commify', { + enumerable: true, + get: function () { + return units_1.commify; + }, + }); + Object.defineProperty(exports, 'formatEther', { + enumerable: true, + get: function () { + return units_1.formatEther; + }, + }); + Object.defineProperty(exports, 'parseEther', { + enumerable: true, + get: function () { + return units_1.parseEther; + }, + }); + Object.defineProperty(exports, 'formatUnits', { + enumerable: true, + get: function () { + return units_1.formatUnits; + }, + }); + Object.defineProperty(exports, 'parseUnits', { + enumerable: true, + get: function () { + return units_1.parseUnits; + }, + }); + var wallet_1 = (init_lib25(), __toCommonJS(lib_exports19)); + Object.defineProperty(exports, 'verifyMessage', { + enumerable: true, + get: function () { + return wallet_1.verifyMessage; + }, + }); + Object.defineProperty(exports, 'verifyTypedData', { + enumerable: true, + get: function () { + return wallet_1.verifyTypedData; + }, + }); + var web_1 = (init_lib26(), __toCommonJS(lib_exports20)); + Object.defineProperty(exports, '_fetchData', { + enumerable: true, + get: function () { + return web_1._fetchData; + }, + }); + Object.defineProperty(exports, 'fetchJson', { + enumerable: true, + get: function () { + return web_1.fetchJson; + }, + }); + Object.defineProperty(exports, 'poll', { + enumerable: true, + get: function () { + return web_1.poll; + }, + }); + var sha2_2 = (init_lib19(), __toCommonJS(lib_exports15)); + Object.defineProperty(exports, 'SupportedAlgorithm', { + enumerable: true, + get: function () { + return sha2_2.SupportedAlgorithm; + }, + }); + var strings_2 = (init_lib9(), __toCommonJS(lib_exports8)); + Object.defineProperty(exports, 'UnicodeNormalizationForm', { + enumerable: true, + get: function () { + return strings_2.UnicodeNormalizationForm; + }, + }); + Object.defineProperty(exports, 'Utf8ErrorReason', { + enumerable: true, + get: function () { + return strings_2.Utf8ErrorReason; + }, + }); + }, +}); + +// node_modules/cross-fetch/dist/node-ponyfill.js +var require_node_ponyfill = __commonJS({ + 'node_modules/cross-fetch/dist/node-ponyfill.js'(exports, module2) { + init_shim(); + var nodeFetch = __require('node-fetch'); + var realFetch = nodeFetch.default || nodeFetch; + var fetch3 = function (url, options) { + if (/^\/\//.test(url)) { + url = 'https:' + url; + } + return realFetch.call(this, url, options); + }; + fetch3.ponyfill = true; + module2.exports = exports = fetch3; + exports.fetch = fetch3; + exports.Headers = nodeFetch.Headers; + exports.Request = nodeFetch.Request; + exports.Response = nodeFetch.Response; + exports.default = fetch3; + }, +}); + +// node_modules/@lit-protocol/accs-schemas/esm/schemas/LPACC_ATOM.json +var require_LPACC_ATOM = __commonJS({ + 'node_modules/@lit-protocol/accs-schemas/esm/schemas/LPACC_ATOM.json'( + exports, + module2 + ) { + module2.exports = { + $id: 'https://github.com/LIT-Protocol/accs-schemas/blob/main/src/generated/LPACC_EVM_ATOM.ts', + title: 'LPACC_EVM_ATOM', + description: '', + type: 'object', + properties: { + conditionType: { + type: 'string', + }, + path: { + type: 'string', + }, + chain: { + enum: [ + 'cosmos', + 'kyve', + 'evmosCosmos', + 'evmosCosmosTestnet', + 'cheqdMainnet', + 'cheqdTestnet', + 'juno', + ], + }, + method: { + type: 'string', + }, + parameters: { + type: 'array', + items: { + type: 'string', + }, + }, + returnValueTest: { + type: 'object', + properties: { + key: { + type: 'string', + }, + comparator: { + enum: ['contains', '=', '>', '>=', '<', '<='], + }, + value: { + type: 'string', + }, + }, + required: ['key', 'comparator', 'value'], + additionalProperties: false, + }, + }, + required: ['path', 'chain', 'returnValueTest'], + additionalProperties: false, + }; + }, +}); + +// node_modules/@lit-protocol/accs-schemas/esm/schemas/LPACC_EVM_BASIC.json +var require_LPACC_EVM_BASIC = __commonJS({ + 'node_modules/@lit-protocol/accs-schemas/esm/schemas/LPACC_EVM_BASIC.json'( + exports, + module2 + ) { + module2.exports = { + $id: 'https://github.com/LIT-Protocol/accs-schemas/blob/main/src/generated/LPACC_EVM_BASIC.json', + title: 'LPACC_EVM_BASIC', + description: '', + type: 'object', + properties: { + conditionType: { + type: 'string', + }, + contractAddress: { + type: 'string', + }, + chain: { + enum: [ + 'ethereum', + 'polygon', + 'fantom', + 'xdai', + 'bsc', + 'arbitrum', + 'arbitrumSepolia', + 'avalanche', + 'fuji', + 'harmony', + 'mumbai', + 'goerli', + 'cronos', + 'optimism', + 'celo', + 'aurora', + 'eluvio', + 'alfajores', + 'xdc', + 'evmos', + 'evmosTestnet', + 'bscTestnet', + 'baseGoerli', + 'baseSepolia', + 'moonbeam', + 'moonriver', + 'moonbaseAlpha', + 'filecoin', + 'filecoinCalibrationTestnet', + 'hyperspace', + 'sepolia', + 'scrollSepolia', + 'scroll', + 'zksync', + 'base', + 'lukso', + 'luksoTestnet', + 'zora', + 'zoraGoerli', + 'zksyncTestnet', + 'lineaGoerli', + 'lineaSepolia', + 'chronicleTestnet', + 'yellowstone', + 'lit', + 'chiado', + 'zkEvm', + 'mantleTestnet', + 'mantle', + 'klaytn', + 'publicGoodsNetwork', + 'optimismGoerli', + 'waevEclipseTestnet', + 'waevEclipseDevnet', + 'verifyTestnet', + 'fuse', + 'campNetwork', + 'vanar', + 'lisk', + 'chilizMainnet', + 'chilizTestnet', + 'skaleTestnet', + 'skale', + 'skaleCalypso', + 'skaleCalypsoTestnet', + 'skaleEuropaTestnet', + 'skaleEuropa', + 'skaleTitanTestnet', + 'skaleTitan', + 'fhenixHelium', + 'hederaTestnet', + 'bitTorrentTestnet', + 'storyOdyssey', + 'campTestnet', + 'hushedNorthstar', + 'amoy', + 'matchain', + 'coreDao', + 'zkCandySepoliaTestnet', + 'vana', + ], + }, + standardContractType: { + enum: [ + '', + 'ERC20', + 'ERC721', + 'ERC721MetadataName', + 'ERC1155', + 'CASK', + 'Creaton', + 'POAP', + 'timestamp', + 'MolochDAOv2.1', + 'ProofOfHumanity', + 'SIWE', + 'PKPPermissions', + 'LitAction', + ], + }, + method: { + type: 'string', + }, + parameters: { + type: 'array', + items: { + type: 'string', + }, + }, + returnValueTest: { + type: 'object', + properties: { + comparator: { + enum: ['contains', '=', '>', '>=', '<', '<='], + }, + value: { + type: 'string', + }, + }, + required: ['comparator', 'value'], + additionalProperties: false, + }, + }, + required: [ + 'contractAddress', + 'chain', + 'standardContractType', + 'method', + 'parameters', + 'returnValueTest', + ], + additionalProperties: false, + }; + }, +}); + +// node_modules/@lit-protocol/accs-schemas/esm/schemas/LPACC_EVM_CONTRACT.json +var require_LPACC_EVM_CONTRACT = __commonJS({ + 'node_modules/@lit-protocol/accs-schemas/esm/schemas/LPACC_EVM_CONTRACT.json'( + exports, + module2 + ) { + module2.exports = { + $id: 'https://github.com/LIT-Protocol/accs-schemas/blob/main/src/generated/LPACC_EVM_CONTRACT.json', + title: 'LPACC_EVM_CONTRACT', + description: '', + type: 'object', + properties: { + conditionType: { + type: 'string', + }, + contractAddress: { + type: 'string', + }, + chain: { + enum: [ + 'ethereum', + 'polygon', + 'fantom', + 'xdai', + 'bsc', + 'arbitrum', + 'arbitrumSepolia', + 'avalanche', + 'fuji', + 'harmony', + 'mumbai', + 'goerli', + 'cronos', + 'optimism', + 'celo', + 'aurora', + 'eluvio', + 'alfajores', + 'xdc', + 'evmos', + 'evmosTestnet', + 'bscTestnet', + 'baseGoerli', + 'baseSepolia', + 'moonbeam', + 'moonriver', + 'moonbaseAlpha', + 'filecoin', + 'filecoinCalibrationTestnet', + 'hyperspace', + 'sepolia', + 'scrollSepolia', + 'scroll', + 'zksync', + 'base', + 'lukso', + 'luksoTestnet', + 'zora', + 'zoraGoerli', + 'zksyncTestnet', + 'lineaGoerli', + 'lineaSepolia', + 'chronicleTestnet', + 'yellowstone', + 'lit', + 'chiado', + 'zkEvm', + 'mantleTestnet', + 'mantle', + 'klaytn', + 'publicGoodsNetwork', + 'optimismGoerli', + 'waevEclipseTestnet', + 'waevEclipseDevnet', + 'verifyTestnet', + 'fuse', + 'campNetwork', + 'vanar', + 'lisk', + 'chilizMainnet', + 'chilizTestnet', + 'skaleTestnet', + 'skale', + 'skaleCalypso', + 'skaleCalypsoTestnet', + 'skaleEuropaTestnet', + 'skaleEuropa', + 'skaleTitanTestnet', + 'skaleTitan', + 'fhenixHelium', + 'hederaTestnet', + 'bitTorrentTestnet', + 'storyOdyssey', + 'campTestnet', + 'hushedNorthstar', + 'amoy', + 'matchain', + 'coreDao', + 'zkCandySepoliaTestnet', + 'vana', + ], + }, + functionName: { + type: 'string', + }, + functionParams: { + type: 'array', + items: { + type: 'string', + }, + }, + functionAbi: { + type: 'object', + properties: { + name: { + type: 'string', + }, + type: { + type: 'string', + }, + stateMutability: { + type: 'string', + }, + constant: { + type: 'boolean', + }, + inputs: { + type: 'array', + items: { + type: 'object', + properties: { + name: { + type: 'string', + }, + type: { + type: 'string', + }, + internalType: { + type: 'string', + }, + }, + required: ['name', 'type'], + additionalProperties: false, + }, + }, + outputs: { + type: 'array', + items: { + type: 'object', + properties: { + name: { + type: 'string', + }, + type: { + type: 'string', + }, + internalType: { + type: 'string', + }, + }, + required: ['name', 'type'], + additionalProperties: false, + }, + }, + }, + required: ['name', 'stateMutability', 'inputs', 'outputs'], + additionalProperties: false, + }, + returnValueTest: { + type: 'object', + properties: { + key: { + type: 'string', + }, + comparator: { + enum: ['contains', '=', '>', '>=', '<', '<='], + }, + value: { + type: 'string', + }, + }, + required: ['key', 'comparator', 'value'], + additionalProperties: false, + }, + }, + required: [ + 'contractAddress', + 'chain', + 'functionName', + 'functionParams', + 'functionAbi', + 'returnValueTest', + ], + additionalProperties: false, + }; + }, +}); + +// node_modules/@lit-protocol/accs-schemas/esm/schemas/LPACC_SOL.json +var require_LPACC_SOL = __commonJS({ + 'node_modules/@lit-protocol/accs-schemas/esm/schemas/LPACC_SOL.json'( + exports, + module2 + ) { + module2.exports = { + $id: 'https://github.com/LIT-Protocol/accs-schemas/blob/main/src/generated/LPACC_SOL.json', + title: 'LPACC_SOL', + description: '', + type: 'object', + properties: { + conditionType: { + type: 'string', + }, + method: { + type: 'string', + }, + params: { + type: 'array', + items: { + type: 'string', + }, + }, + pdaParams: { + type: 'array', + items: { + type: 'string', + }, + }, + pdaInterface: { + type: 'object', + properties: { + offset: { + type: 'number', + }, + fields: { + type: 'object', + }, + }, + required: ['offset', 'fields'], + additionalProperties: false, + }, + pdaKey: { + type: 'string', + }, + chain: { + enum: ['solana', 'solanaDevnet', 'solanaTestnet'], + }, + returnValueTest: { + type: 'object', + properties: { + key: { + type: 'string', + }, + comparator: { + enum: ['contains', '=', '>', '>=', '<', '<='], + }, + value: { + type: 'string', + }, + }, + required: ['comparator', 'value', 'key'], + additionalProperties: false, + }, + }, + required: [ + 'method', + 'params', + 'chain', + 'pdaInterface', + 'pdaKey', + 'returnValueTest', + ], + additionalProperties: false, + }; + }, +}); + +// local-tests/setup/networkContext.json +var require_networkContext = __commonJS({ + 'local-tests/setup/networkContext.json'(exports, module2) { + module2.exports = { + Allowlist: { + address: '0x7a2088a1bFc9d81c55368AE168C2C02570cB814F', + abi: [ + { + inputs: [], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'ItemAllowed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'ItemNotAllowed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'addAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'allowAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + name: 'allowedItems', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'isAllowed', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'removeAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bool', + name: '_allowAll', + type: 'bool', + }, + ], + name: 'setAllowAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'setAllowed', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'setNotAllowed', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + name: 'Allowlist', + }, + LITToken: { + address: '0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82', + abi: [ + { + inputs: [ + { + internalType: 'uint256', + name: 'cap', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [], + name: 'InvalidShortString', + type: 'error', + }, + { + inputs: [ + { + internalType: 'string', + name: 'str', + type: 'string', + }, + ], + name: 'StringTooLong', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'delegator', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'fromDelegate', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'toDelegate', + type: 'address', + }, + ], + name: 'DelegateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'delegate', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'previousBalance', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newBalance', + type: 'uint256', + }, + ], + name: 'DelegateVotesChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [], + name: 'EIP712DomainChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'Paused', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'previousAdminRole', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'newAdminRole', + type: 'bytes32', + }, + ], + name: 'RoleAdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleGranted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleRevoked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'Unpaused', + type: 'event', + }, + { + inputs: [], + name: 'ADMIN_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'CLOCK_MODE', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DEFAULT_ADMIN_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DOMAIN_SEPARATOR', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'MINTER_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PAUSER_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'burnFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'cap', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint32', + name: 'pos', + type: 'uint32', + }, + ], + name: 'checkpoints', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'fromBlock', + type: 'uint32', + }, + { + internalType: 'uint224', + name: 'votes', + type: 'uint224', + }, + ], + internalType: 'struct ERC20Votes.Checkpoint', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'clock', + outputs: [ + { + internalType: 'uint48', + name: '', + type: 'uint48', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'subtractedValue', + type: 'uint256', + }, + ], + name: 'decreaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + ], + name: 'delegate', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + { + internalType: 'uint256', + name: 'nonce', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiry', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'delegateBySig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'delegates', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'eip712Domain', + outputs: [ + { + internalType: 'bytes1', + name: 'fields', + type: 'bytes1', + }, + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'version', + type: 'string', + }, + { + internalType: 'uint256', + name: 'chainId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'verifyingContract', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'salt', + type: 'bytes32', + }, + { + internalType: 'uint256[]', + name: 'extensions', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'timepoint', + type: 'uint256', + }, + ], + name: 'getPastTotalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'timepoint', + type: 'uint256', + }, + ], + name: 'getPastVotes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + ], + name: 'getRoleAdmin', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'getVotes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'grantRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'hasRole', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'addedValue', + type: 'uint256', + }, + ], + name: 'increaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + ], + name: 'mint', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'nonces', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'numCheckpoints', + outputs: [ + { + internalType: 'uint32', + name: '', + type: 'uint32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'pause', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'paused', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'permit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'renounceRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'revokeRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'unpause', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + name: 'LITToken', + }, + Multisender: { + address: '0x4826533B4897376654Bb4d4AD88B7faFD0C98528', + abi: [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: '_recipients', + type: 'address[]', + }, + ], + name: 'sendEth', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: '_recipients', + type: 'address[]', + }, + { + internalType: 'address', + name: 'tokenContract', + type: 'address', + }, + ], + name: 'sendTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'tokenContract', + type: 'address', + }, + ], + name: 'withdrawTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + name: 'Multisender', + }, + PKPHelper: { + address: '0xcbEAF3BDe82155F56486Fb5a1072cb8baAf547cc', + abi: [ + { + inputs: [ + { + internalType: 'address', + name: '_resolver', + type: 'address', + }, + { + internalType: 'enum ContractResolver.Env', + name: '_env', + type: 'uint8', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'previousAdminRole', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'newAdminRole', + type: 'bytes32', + }, + ], + name: 'RoleAdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleGranted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleRevoked', + type: 'event', + }, + { + inputs: [], + name: 'DEFAULT_ADMIN_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + ], + internalType: 'struct LibPKPNFTStorage.ClaimMaterial', + name: 'claimMaterial', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes[]', + name: 'permittedIpfsCIDs', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedIpfsCIDScopes', + type: 'uint256[][]', + }, + { + internalType: 'address[]', + name: 'permittedAddresses', + type: 'address[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAddressScopes', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + internalType: 'struct PKPHelper.AuthMethodData', + name: 'authMethodData', + type: 'tuple', + }, + ], + name: 'claimAndMintNextAndAddAuthMethods', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + ], + internalType: 'struct LibPKPNFTStorage.ClaimMaterial', + name: 'claimMaterial', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes[]', + name: 'permittedIpfsCIDs', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedIpfsCIDScopes', + type: 'uint256[][]', + }, + { + internalType: 'address[]', + name: 'permittedAddresses', + type: 'address[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAddressScopes', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + internalType: 'struct PKPHelper.AuthMethodData', + name: 'authMethodData', + type: 'tuple', + }, + ], + name: 'claimAndMintNextAndAddAuthMethodsWithTypes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + ], + internalType: 'struct LibPKPNFTStorage.ClaimMaterialV2', + name: 'claimMaterial', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes[]', + name: 'permittedIpfsCIDs', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedIpfsCIDScopes', + type: 'uint256[][]', + }, + { + internalType: 'address[]', + name: 'permittedAddresses', + type: 'address[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAddressScopes', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + internalType: 'struct PKPHelper.AuthMethodData', + name: 'authMethodData', + type: 'tuple', + }, + ], + name: 'claimAndMintNextAndAddAuthMethodsWithTypesV2', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'contractResolver', + outputs: [ + { + internalType: 'contract ContractResolver', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'env', + outputs: [ + { + internalType: 'enum ContractResolver.Env', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getDomainWalletRegistry', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPKPNftMetdataAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpPermissionsAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + ], + name: 'getRoleAdmin', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getStakingAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'grantRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'hasRole', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + name: 'mintNextAndAddAuthMethods', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes[]', + name: 'permittedIpfsCIDs', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedIpfsCIDScopes', + type: 'uint256[][]', + }, + { + internalType: 'address[]', + name: 'permittedAddresses', + type: 'address[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAddressScopes', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + name: 'mintNextAndAddAuthMethodsWithTypes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'string[]', + name: 'nftMetadata', + type: 'string[]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + name: 'mintNextAndAddDomainWalletMetadata', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + name: 'onERC721Received', + outputs: [ + { + internalType: 'bytes4', + name: '', + type: 'bytes4', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'removePkpMetadata', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'renounceRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'revokeRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'string[]', + name: 'nftMetadata', + type: 'string[]', + }, + ], + name: 'setPkpMetadata', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + name: 'PKPHelper', + }, + PKPNFT: { + address: '0xa82fF9aFd8f496c3d6ac40E2a0F282E47488CFc9', + abi: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'approved', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'ApprovalForAll', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newFreeMintSigner', + type: 'address', + }, + ], + name: 'FreeMintSignerSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint8', + name: 'version', + type: 'uint8', + }, + ], + name: 'Initialized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newMintCost', + type: 'uint256', + }, + ], + name: 'MintCostSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + ], + name: 'PKPMinted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Withdrew', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + ], + name: 'claimAndMint', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'exists', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'freeMintSigner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getApproved', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getEthAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getNextDerivedKeyId', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftMetadataAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpPermissionsAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getRouterAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getStakingAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + ], + name: 'isApprovedForAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'mintCost', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + ], + name: 'mintGrantAndBurnNext', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + name: 'mintNext', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'ownerOf', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'hash', + type: 'bytes32', + }, + ], + name: 'prefixed', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'redeemedFreeMintIds', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'setApprovalForAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newFreeMintSigner', + type: 'address', + }, + ], + name: 'setFreeMintSigner', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMintCost', + type: 'uint256', + }, + ], + name: 'setMintCost', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenOfOwnerByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'tokenURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + name: 'PKPNFT', + }, + PKPNFTMetadata: { + address: '0x5eb3Bc0a489C5A8288765d2336659EbCA68FCd00', + abi: [ + { + inputs: [ + { + internalType: 'address', + name: '_resolver', + type: 'address', + }, + { + internalType: 'enum ContractResolver.Env', + name: '_env', + type: 'uint8', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'buffer', + type: 'bytes', + }, + ], + name: 'bytesToHex', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [], + name: 'contractResolver', + outputs: [ + { + internalType: 'contract ContractResolver', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'env', + outputs: [ + { + internalType: 'enum ContractResolver.Env', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'removeProfileForPkp', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'removeUrlForPKP', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'string', + name: 'imgUrl', + type: 'string', + }, + ], + name: 'setProfileForPKP', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'string', + name: 'url', + type: 'string', + }, + ], + name: 'setUrlForPKP', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'pubKey', + type: 'bytes', + }, + { + internalType: 'address', + name: 'ethAddress', + type: 'address', + }, + ], + name: 'tokenURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + name: 'PKPNFTMetadata', + }, + PKPPermissions: { + address: '0xFD471836031dc5108809D173A067e8486B9047A3', + abi: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + indexed: false, + internalType: 'bytes', + name: 'userPubkey', + type: 'bytes', + }, + ], + name: 'PermittedAuthMethodAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'PermittedAuthMethodRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + indexed: false, + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'PermittedAuthMethodScopeAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + indexed: false, + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'PermittedAuthMethodScopeRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: true, + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'root', + type: 'bytes32', + }, + ], + name: 'RootHashUpdated', + type: 'event', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + { + internalType: 'uint256[]', + name: 'scopes', + type: 'uint256[]', + }, + ], + name: 'addPermittedAction', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'user', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'scopes', + type: 'uint256[]', + }, + ], + name: 'addPermittedAddress', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'userPubkey', + type: 'bytes', + }, + ], + internalType: 'struct LibPKPPermissionsStorage.AuthMethod', + name: 'authMethod', + type: 'tuple', + }, + { + internalType: 'uint256[]', + name: 'scopes', + type: 'uint256[]', + }, + ], + name: 'addPermittedAuthMethod', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'addPermittedAuthMethodScope', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypesToAdd', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIdsToAdd', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeysToAdd', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopesToAdd', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypesToRemove', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIdsToRemove', + type: 'bytes[]', + }, + ], + name: 'batchAddRemoveAuthMethods', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'getAuthMethodId', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getEthAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'getPKPPubKeysByAuthMethod', + outputs: [ + { + internalType: 'bytes[]', + name: '', + type: 'bytes[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPermittedActions', + outputs: [ + { + internalType: 'bytes[]', + name: '', + type: 'bytes[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPermittedAddresses', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'maxScopeId', + type: 'uint256', + }, + ], + name: 'getPermittedAuthMethodScopes', + outputs: [ + { + internalType: 'bool[]', + name: '', + type: 'bool[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPermittedAuthMethods', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'userPubkey', + type: 'bytes', + }, + ], + internalType: 'struct LibPKPPermissionsStorage.AuthMethod[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getRouterAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'getTokenIdsForAuthMethod', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'getUserPubkeyForAuthMethod', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + ], + name: 'isPermittedAction', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'isPermittedAddress', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'isPermittedAuthMethod', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'isPermittedAuthMethodScopePresent', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + ], + name: 'removePermittedAction', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'removePermittedAddress', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'removePermittedAuthMethod', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'removePermittedAuthMethodScope', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'root', + type: 'bytes32', + }, + ], + name: 'setRootHash', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + internalType: 'bytes32[]', + name: 'proof', + type: 'bytes32[]', + }, + { + internalType: 'bytes32', + name: 'leaf', + type: 'bytes32', + }, + ], + name: 'verifyState', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + internalType: 'bytes32[]', + name: 'proof', + type: 'bytes32[]', + }, + { + internalType: 'bool[]', + name: 'proofFlags', + type: 'bool[]', + }, + { + internalType: 'bytes32[]', + name: 'leaves', + type: 'bytes32[]', + }, + ], + name: 'verifyStates', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + name: 'PKPPermissions', + }, + PubkeyRouter: { + address: '0x70e0bA845a1A0F2DA3359C97E0285013525FFC49', + abi: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'string', + name: 'message', + type: 'string', + }, + { + indexed: false, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'DebugEvent', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + indexed: false, + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'PubkeyRoutingDataSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct IPubkeyRouter.RootKey', + name: 'rootKey', + type: 'tuple', + }, + ], + name: 'RootKeySet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + { + indexed: false, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'ToggleEvent', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + ], + name: 'adminResetRootKeys', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + internalType: 'struct IPubkeyRouter.RootKey[]', + name: 'rootKeys', + type: 'tuple[]', + }, + ], + name: 'adminSetRootKeys', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + { + internalType: 'bytes', + name: 'signedMessage', + type: 'bytes', + }, + ], + name: 'checkNodeSignatures', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + ], + name: 'deriveEthAddressFromPubkey', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'ethAddress', + type: 'address', + }, + ], + name: 'ethAddressToPkpId', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'getDerivedPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getEthAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + ], + name: 'getRootKeys', + outputs: [ + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + internalType: 'struct IPubkeyRouter.RootKey[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getRoutingData', + outputs: [ + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + internalType: 'struct LibPubkeyRouterStorage.PubkeyRoutingData', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'isRouted', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'pubkeys', + outputs: [ + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + internalType: 'struct LibPubkeyRouterStorage.PubkeyRoutingData', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'setRoutingData', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'setRoutingDataAsAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + internalType: 'struct IPubkeyRouter.RootKey[]', + name: 'newRootKeys', + type: 'tuple[]', + }, + ], + name: 'voteForRootKeys', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + name: 'PubkeyRouter', + }, + Staking: { + address: '0x4A679253410272dd5232B3Ff7cF5dbB88f295319', + abi: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'RealmIdNotFound', + type: 'error', + }, + { + inputs: [], + name: 'getAllUnkickedValidators', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'getRealmIdForStakerAddress', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getUnassignedValidators', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastActiveEpoch', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'commission', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'commissionRate', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastRewardEpoch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + ], + name: 'isRecentValidator', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'isValidatorInCurrentEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'isValidatorInCurrentOrNextEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'isValidatorInNextEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + ], + name: 'nodeAddressToStakerAddressAcrossRealms', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'validator_by_staker_address', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastActiveEpoch', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'commission', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'commissionRate', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastRewardEpoch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwnerOrDevopsAdmin', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInNextValidatorSetLockedOrReadyForNextEpochState', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'dataType', + type: 'uint256', + }, + ], + name: 'ClearOfflinePhaseData', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'tolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'intervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyPercent', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyDemerits', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct LibStakingStorage.ComplaintConfig', + name: 'config', + type: 'tuple', + }, + ], + name: 'ComplaintConfigSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'tokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'keyTypes', + type: 'uint256[]', + }, + { + indexed: false, + internalType: 'uint256', + name: 'minimumValidatorCount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'rewardEpochDuration', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'maxTimeLock', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'minTimeLock', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'bmin', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'bmax', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'k', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'p', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bool', + name: 'enableStakeAutolock', + type: 'bool', + }, + { + indexed: false, + internalType: 'bool', + name: 'permittedStakersOn', + type: 'bool', + }, + { + indexed: false, + internalType: 'uint256', + name: 'tokenPrice', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'profitMultiplier', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'usdCostPerMonth', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'maxEmissionRate', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'minStakeAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'maxStakeAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'minSelfStake', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'minSelfStakeTimelock', + type: 'uint256', + }, + ], + name: 'ConfigSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'dataType', + type: 'uint256', + }, + ], + name: 'CountOfflinePhaseData', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newDevopsAdmin', + type: 'address', + }, + ], + name: 'DevopsAdminSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newEpochEndTime', + type: 'uint256', + }, + ], + name: 'EpochEndTimeSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newEpochLength', + type: 'uint256', + }, + ], + name: 'EpochLengthSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newEpochTimeout', + type: 'uint256', + }, + ], + name: 'EpochTimeoutSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newKickPenaltyPercent', + type: 'uint256', + }, + ], + name: 'KickPenaltyPercentSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newTokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'newKeyTypes', + type: 'uint256[]', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMinimumValidatorCount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMaxConcurrentRequests', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMaxTripleCount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMinTripleCount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newPeerCheckingIntervalSecs', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMaxTripleConcurrency', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bool', + name: 'newRpcHealthcheckEnabled', + type: 'bool', + }, + ], + name: 'RealmConfigSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newStakingTokenAddress', + type: 'address', + }, + ], + name: 'StakingTokenSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'enum LibStakingStorage.States', + name: 'newState', + type: 'uint8', + }, + ], + name: 'StateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'ValidatorRejoinedNextEpoch', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + ], + name: 'adminKickValidatorInNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'adminRejoinValidator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'adminResetEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address[]', + name: 'validatorsForCurrentEpoch', + type: 'address[]', + }, + ], + name: 'adminSetValidatorsInCurrentEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amountToPenalize', + type: 'uint256', + }, + ], + name: 'adminSlashValidator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + internalType: 'uint256', + name: 'timeLock', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'adminStakeForValidator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'dataType', + type: 'uint256', + }, + ], + name: 'emitClearOfflinePhaseData', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'dataType', + type: 'uint256', + }, + ], + name: 'emitCountOfflinePhaseData', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'tolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'intervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyPercent', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyDemerits', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.ComplaintConfig', + name: 'config', + type: 'tuple', + }, + ], + name: 'setComplaintConfig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'tokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'keyTypes', + type: 'uint256[]', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'rewardEpochDuration', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTimeLock', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minTimeLock', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'bmin', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'bmax', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'k', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'p', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'enableStakeAutolock', + type: 'bool', + }, + { + internalType: 'bool', + name: 'permittedStakersOn', + type: 'bool', + }, + { + internalType: 'uint256', + name: 'tokenPrice', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'profitMultiplier', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'usdCostPerMonth', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxEmissionRate', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minStakeAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxStakeAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minSelfStake', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minSelfStakeTimelock', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.GlobalConfig', + name: 'newConfig', + type: 'tuple', + }, + ], + name: 'setConfig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newThreshold', + type: 'uint256', + }, + ], + name: 'setDemeritRejoinThreshold', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newDevopsAdmin', + type: 'address', + }, + ], + name: 'setDevopsAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'newEpochEndTime', + type: 'uint256', + }, + ], + name: 'setEpochEndTime', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'newEpochLength', + type: 'uint256', + }, + ], + name: 'setEpochLength', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'enum LibStakingStorage.States', + name: 'newState', + type: 'uint8', + }, + ], + name: 'setEpochState', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'newEpochTimeout', + type: 'uint256', + }, + ], + name: 'setEpochTimeout', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'newKickPenaltyPercent', + type: 'uint256', + }, + ], + name: 'setKickPenaltyPercent', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newTimeout', + type: 'uint256', + }, + ], + name: 'setPendingRejoinTimeout', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'maxConcurrentRequests', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'peerCheckingIntervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleConcurrency', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'rpcHealthcheckEnabled', + type: 'bool', + }, + ], + internalType: 'struct LibStakingStorage.RealmConfig', + name: 'newConfig', + type: 'tuple', + }, + ], + name: 'setRealmConfig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotContract', + type: 'error', + }, + { + inputs: [], + name: 'CannotMigrateFromValidator', + type: 'error', + }, + { + inputs: [], + name: 'CannotModifyUnfrozen', + type: 'error', + }, + { + inputs: [], + name: 'CannotStakeZero', + type: 'error', + }, + { + inputs: [], + name: 'CannotWithdrawFrozen', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'checkpoint', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'currentEpoch', + type: 'uint256', + }, + ], + name: 'CheckpointAheadOfCurrentEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'InsufficientSelfStake', + type: 'error', + }, + { + inputs: [], + name: 'InvalidNewSharePrice', + type: 'error', + }, + { + inputs: [], + name: 'InvalidRatio', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'timeLock', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minTimeLock', + type: 'uint256', + }, + ], + name: 'MinTimeLockNotMet', + type: 'error', + }, + { + inputs: [], + name: 'NewTimeLockMustBeGreaterThanCurrent', + type: 'error', + }, + { + inputs: [], + name: 'NoEmptyStakingSlot', + type: 'error', + }, + { + inputs: [], + name: 'RewardsMustBeClaimed', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'slahedAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'slashedRealmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'senderAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'senderRealmId', + type: 'uint256', + }, + ], + name: 'SlashingMustOccurInSameRealm', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'StakeAmountNotMet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'stakedAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minimumStake', + type: 'uint256', + }, + ], + name: 'StakeMustBeGreaterThanMinimumStake', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'stakeRecordId', + type: 'uint256', + }, + ], + name: 'StakeRecordNotFound', + type: 'error', + }, + { + inputs: [], + name: 'TimeLockNotMet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'validatorAddress', + type: 'address', + }, + ], + name: 'ValidatorNotRegistered', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverContractAddress', + type: 'address', + }, + ], + name: 'ResolverContractAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'recordId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'address', + name: 'stakerAddressClient', + type: 'address', + }, + ], + name: 'StakeRecordCreated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'userStakerAddress', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'recordId', + type: 'uint256', + }, + ], + name: 'StakeRecordRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'recordId', + type: 'uint256', + }, + ], + name: 'StakeRecordUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'recordId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'rewards', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'fromEpoch', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'toEpoch', + type: 'uint256', + }, + ], + name: 'StakeRewardsClaimed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Staked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'ValidatorRegistered', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Withdrawn', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'addPermittedStaker', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'percentage', + type: 'uint256', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'adminSlashValidator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'checkStakingAmounts', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'stakeRecordId', + type: 'uint256', + }, + ], + name: 'claimStakeRewards', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'claimValidatorCommission', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getMaximumStake', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getMinimumSelfStake', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getMinimumStake', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'rewardEpochNumber', + type: 'uint256', + }, + ], + name: 'getRewardEpoch', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'epochEnd', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'totalStakeWeight', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'totalRewards', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'slope', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'slopeIncrease', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'validatorSharePrice', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'stakeAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'validatorSharePriceAtLastUpdate', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'initial', + type: 'bool', + }, + ], + internalType: 'struct LibStakingStorage.RewardEpoch', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'stakeRecordId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'increaseStakeRecordAmount', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'stakeRecordId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'newTimeLock', + type: 'uint256', + }, + ], + name: 'increaseStakeRecordTimelock', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'rewardEpochNumber', + type: 'uint256', + }, + ], + name: 'initializeRewardEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'userStakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'stakeRecordId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'newStakerAddress', + type: 'address', + }, + ], + name: 'migrateStakeRecord', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'removePermittedStaker', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bool', + name: 'permittedStakersOn', + type: 'bool', + }, + ], + name: 'setPermittedStakersOn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'rate', + type: 'uint256', + }, + ], + name: 'setValidatorComissionRate', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'percentage', + type: 'uint256', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'slashValidator', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'stakeRecordId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'ratio', + type: 'uint256', + }, + ], + name: 'splitStakeRecord', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeLock', + type: 'uint256', + }, + { + internalType: 'address', + name: 'operatorStakerAddress', + type: 'address', + }, + ], + name: 'stake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'stakeId', + type: 'uint256', + }, + ], + name: 'unfreezeStake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'updateRewardEpoch', + outputs: [ + { + internalType: 'uint256', + name: 'currentRewardEpoch', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'stakeRecordId', + type: 'uint256', + }, + ], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'ActiveValidatorsCannotLeave', + type: 'error', + }, + { + inputs: [], + name: 'CannotKickBelowCurrentValidatorThreshold', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingAddress', + type: 'address', + }, + ], + name: 'CannotRejoinBecauseBanned', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingAddress', + type: 'address', + }, + ], + name: 'CannotRejoinUntilNextEpochBecauseKicked', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'CannotReuseCommsKeys', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'CannotVoteTwice', + type: 'error', + }, + { + inputs: [], + name: 'CannotWithdrawZero', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + ], + name: 'CouldNotMapNodeAddressToStakerAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInActiveOrUnlockedOrPausedState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInActiveOrUnlockedState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInNextValidatorSetLockedOrReadyForNextEpochOrRestoreState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInNextValidatorSetLockedState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInReadyForNextEpochState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'MustBeValidatorInNextEpochToKick', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentTimestamp', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'epochEndTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeout', + type: 'uint256', + }, + ], + name: 'NotEnoughTimeElapsedForTimeoutSinceLastEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentTimestamp', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'epochEndTime', + type: 'uint256', + }, + ], + name: 'NotEnoughTimeElapsedSinceLastEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'validatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCount', + type: 'uint256', + }, + ], + name: 'NotEnoughValidatorsInNextEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentReadyValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'nextReadyValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCountToBeReady', + type: 'uint256', + }, + ], + name: 'NotEnoughValidatorsReadyForNextEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentEpochNumber', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receivedEpochNumber', + type: 'uint256', + }, + ], + name: 'SignaledReadyForWrongEpochNumber', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'StakerNotPermitted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'yourBalance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'requestedWithdrawlAmount', + type: 'uint256', + }, + ], + name: 'TryingToWithdrawMoreThanStaked', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + internalType: 'uint256', + name: 'existingRealmId', + type: 'uint256', + }, + ], + name: 'ValidatorAlreadyInRealm', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'validator', + type: 'address', + }, + { + internalType: 'address[]', + name: 'validatorsInNextEpoch', + type: 'address[]', + }, + ], + name: 'ValidatorIsNotInNextEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'string', + name: 'valueName', + type: 'string', + }, + ], + name: 'ValueMustBeNonzero', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'epochNumber', + type: 'uint256', + }, + ], + name: 'AdvancedEpoch', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'attestedAddress', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'attestedPubKey', + type: 'uint256', + }, + ], + name: 'AttestedWalletRegistered', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newTokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'newKeyTypes', + type: 'uint256[]', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMinimumValidatorCount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMaxConcurrentRequests', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMaxTripleCount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMinTripleCount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newPeerCheckingIntervalSecs', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMaxTripleConcurrency', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bool', + name: 'newRpcHealthcheckEnabled', + type: 'bool', + }, + ], + name: 'ConfigSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'string', + name: 'message', + type: 'string', + }, + { + indexed: false, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'DebugEvent', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'epochNumber', + type: 'uint256', + }, + ], + name: 'ReadyForNextEpoch', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'token', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Recovered', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'RequestToJoin', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'RequestToLeave', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newDuration', + type: 'uint256', + }, + ], + name: 'RewardsDurationUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountBurned', + type: 'uint256', + }, + ], + name: 'ValidatorKickedFromNextEpoch', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'reporter', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'validatorToKickStakerAddress', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'VotedToKickValidatorInNextEpoch', + type: 'event', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'advanceEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'checkActiveOrUnlockedOrPausedState', + outputs: [], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [], + name: 'exit', + outputs: [], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'validatorToKickStakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'kickValidatorInNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'lockValidatorsForNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + internalType: 'address', + name: 'attestedAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'attestedPubKey', + type: 'uint256', + }, + ], + name: 'registerAttestedWallet', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'requestToJoin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'requestToJoinAsNode', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'requestToLeave', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'requestToLeaveAsNode', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'setIpPortNodeAddressAndCommunicationPubKeys', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'epochNumber', + type: 'uint256', + }, + ], + name: 'signalReadyForNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timelock', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'stakeAndJoin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'VersionRequirementsUpdated', + type: 'event', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'checkVersion', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getMaxVersion', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getMaxVersionString', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getMinVersion', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getMinVersionString', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'setMaxVersion', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'setMinVersion', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'InvalidTimeLock', + type: 'error', + }, + { + inputs: [], + name: 'NodeAddressNotFoundForStaker', + type: 'error', + }, + { + inputs: [], + name: 'StakeNotFound', + type: 'error', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'stakeAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'stakeWeight', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'rewards', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'isStarted', + type: 'bool', + }, + ], + internalType: 'struct LibStakingStorage.RewardEpochGlobalStats', + name: 'globalStats', + type: 'tuple', + }, + ], + name: 'calculateRewardsPerEpoch', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'timeLock', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'calculateStakeWeight', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + ], + name: 'complaintConfig', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'tolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'intervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyPercent', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyDemerits', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.ComplaintConfig', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'contractResolver', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'countOfCurrentValidatorsReadyForNextEpoch', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'countOfNextValidatorsReadyForNextEpoch', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'currentValidatorCountForConsensus', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'epoch', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'epochLength', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'number', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'rewardEpochNumber', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'endTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'retries', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'startTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastEpochStart', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Epoch', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getActiveUnkickedValidatorCount', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getActiveUnkickedValidatorStructs', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastActiveEpoch', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'commission', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'commissionRate', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastRewardEpoch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getActiveUnkickedValidatorStructsAndCounts', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'epochLength', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'number', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'rewardEpochNumber', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'endTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'retries', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'startTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastEpochStart', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Epoch', + name: '', + type: 'tuple', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastActiveEpoch', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'commission', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'commissionRate', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastRewardEpoch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getActiveUnkickedValidators', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getKeyTypes', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getKickedValidators', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getLitCirc', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'addresses', + type: 'address[]', + }, + ], + name: 'getNodeAttestedPubKeyMappings', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'pubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.PubKeyMapping[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'getNodeDemerits', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'addresses', + type: 'address[]', + }, + ], + name: 'getNodeStakerAddressMappings', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + internalType: 'struct LibStakingStorage.AddressMapping[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'epochNumber', + type: 'uint256', + }, + ], + name: 'getRewardEpochGlobalStats', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'stakeAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'stakeWeight', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'rewards', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'isStarted', + type: 'bool', + }, + ], + internalType: 'struct LibStakingStorage.RewardEpochGlobalStats', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getRewardEpochNumber', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'recordId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'userStakerAddress', + type: 'address', + }, + ], + name: 'getStakeRecord', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'unfreezeStart', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeLock', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastUpdateTimestamp', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'rewardEpochCheckpoint', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'initialSharePrice', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'loaded', + type: 'bool', + }, + { + internalType: 'bool', + name: 'frozen', + type: 'bool', + }, + ], + internalType: 'struct LibStakingStorage.StakeRecord', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'getStakeRecordCount', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'getStakeRecordsForValidator', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'unfreezeStart', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeLock', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastUpdateTimestamp', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'rewardEpochCheckpoint', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'initialSharePrice', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'loaded', + type: 'bool', + }, + { + internalType: 'bool', + name: 'frozen', + type: 'bool', + }, + ], + internalType: 'struct LibStakingStorage.StakeRecord[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + components: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'unfreezeStart', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeLock', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastUpdateTimestamp', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'rewardEpochCheckpoint', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'initialSharePrice', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'loaded', + type: 'bool', + }, + { + internalType: 'bool', + name: 'frozen', + type: 'bool', + }, + ], + internalType: 'struct LibStakingStorage.StakeRecord', + name: 'stakeRecord', + type: 'tuple', + }, + { + internalType: 'uint256', + name: 'rewardEpochNumber', + type: 'uint256', + }, + ], + name: 'getStakeWeightInEpoch', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + components: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'unfreezeStart', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeLock', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastUpdateTimestamp', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'rewardEpochCheckpoint', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'initialSharePrice', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'loaded', + type: 'bool', + }, + { + internalType: 'bool', + name: 'frozen', + type: 'bool', + }, + ], + internalType: 'struct LibStakingStorage.StakeRecord', + name: 'stakeRecord', + type: 'tuple', + }, + { + internalType: 'uint256', + name: 'rewardEpochNumber', + type: 'uint256', + }, + ], + name: 'getTimelockInEpoch', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getTokenContractAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getTokenPrice', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + components: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'unfreezeStart', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeLock', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastUpdateTimestamp', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'rewardEpochCheckpoint', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'initialSharePrice', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'loaded', + type: 'bool', + }, + { + internalType: 'bool', + name: 'frozen', + type: 'bool', + }, + ], + internalType: 'struct LibStakingStorage.StakeRecord', + name: 'stakeRecord', + type: 'tuple', + }, + { + internalType: 'uint256', + name: 'rewardEpochNumber', + type: 'uint256', + }, + ], + name: 'getTokensStaked', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'getTotalStake', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'getTotalStakeByUser', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'getValidatorsDelegated', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getValidatorsInCurrentEpoch', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getValidatorsInCurrentEpochLength', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getValidatorsInNextEpoch', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'stakerAddresses', + type: 'address[]', + }, + ], + name: 'getValidatorsStructs', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastActiveEpoch', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'commission', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'commissionRate', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastRewardEpoch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getValidatorsStructsInCurrentEpoch', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastActiveEpoch', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'commission', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'commissionRate', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastRewardEpoch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getValidatorsStructsInNextEpoch', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastActiveEpoch', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'commission', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'commissionRate', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastRewardEpoch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'epochNumber', + type: 'uint256', + }, + { + internalType: 'address', + name: 'validatorToBeKickedStakerAddress', + type: 'address', + }, + { + internalType: 'address', + name: 'voterStakerAddress', + type: 'address', + }, + ], + name: 'getVotingStatusToKickValidator', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'globalConfig', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'tokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'keyTypes', + type: 'uint256[]', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'rewardEpochDuration', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTimeLock', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minTimeLock', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'bmin', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'bmax', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'k', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'p', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'enableStakeAutolock', + type: 'bool', + }, + { + internalType: 'bool', + name: 'permittedStakersOn', + type: 'bool', + }, + { + internalType: 'uint256', + name: 'tokenPrice', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'profitMultiplier', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'usdCostPerMonth', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxEmissionRate', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minStakeAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxStakeAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minSelfStake', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minSelfStakeTimelock', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.GlobalConfig', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'isActiveValidator', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'isActiveValidatorByNodeAddress', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + ], + name: 'isActiveValidatorByNodeAddressForNextEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'isActiveValidatorForNextEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'isReadyForNextEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'stakerAddresses', + type: 'address', + }, + ], + name: 'isRecentValidator', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + ], + name: 'kickPenaltyPercentByReason', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxStake', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxTimeLock', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'minSelfStake', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'minStake', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'minTimeLock', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'nextValidatorCountForConsensus', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + ], + name: 'nodeAddressToStakerAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'base', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'exponent', + type: 'uint256', + }, + ], + name: 'pow', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'readyForNextEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'realmConfig', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'maxConcurrentRequests', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'peerCheckingIntervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleConcurrency', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'rpcHealthcheckEnabled', + type: 'bool', + }, + ], + internalType: 'struct LibStakingStorage.RealmConfig', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'shouldKickValidator', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'state', + outputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'validatorSelfStakeWillExpire', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'validators', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastActiveEpoch', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'commission', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'commissionRate', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastRewardEpoch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + name: 'Staking', + }, + ContractResolver: { + address: '0x5FbDB2315678afecb367f032d93F642f64180aa3', + abi: [ + { + inputs: [ + { + internalType: 'enum ContractResolver.Env', + name: 'env', + type: 'uint8', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [], + name: 'AdminRoleRequired', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'enum ContractResolver.Env', + name: 'env', + type: 'uint8', + }, + ], + name: 'AllowedEnvAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'enum ContractResolver.Env', + name: 'env', + type: 'uint8', + }, + ], + name: 'AllowedEnvRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'previousAdminRole', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'newAdminRole', + type: 'bytes32', + }, + ], + name: 'RoleAdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleGranted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleRevoked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'bytes32', + name: 'typ', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'enum ContractResolver.Env', + name: 'env', + type: 'uint8', + }, + { + indexed: false, + internalType: 'address', + name: 'addr', + type: 'address', + }, + ], + name: 'SetContract', + type: 'event', + }, + { + inputs: [], + name: 'ADMIN_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'ALLOWLIST_CONTRACT', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'BACKUP_RECOVERY_CONTRACT', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DEFAULT_ADMIN_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DOMAIN_WALLET_REGISTRY', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'HD_KEY_DERIVER_CONTRACT', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'HOST_COMMANDS_CONTRACT', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'LEDGER_CONTRACT', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'LIT_TOKEN_CONTRACT', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'MULTI_SENDER_CONTRACT', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PAYMENT_DELEGATION_CONTRACT', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PKP_HELPER_CONTRACT', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PKP_HELPER_V2_CONTRACT', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PKP_NFT_CONTRACT', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PKP_NFT_METADATA_CONTRACT', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PKP_PERMISSIONS_CONTRACT', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PRICE_FEED_CONTRACT', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PUB_KEY_ROUTER_CONTRACT', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'RATE_LIMIT_NFT_CONTRACT', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'RELEASE_REGISTER_CONTRACT', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'STAKING_BALANCES_CONTRACT', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'STAKING_CONTRACT', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'addAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'enum ContractResolver.Env', + name: 'env', + type: 'uint8', + }, + ], + name: 'addAllowedEnv', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'typ', + type: 'bytes32', + }, + { + internalType: 'enum ContractResolver.Env', + name: 'env', + type: 'uint8', + }, + ], + name: 'getContract', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + ], + name: 'getRoleAdmin', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'grantRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'hasRole', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'adminBeingRemoved', + type: 'address', + }, + ], + name: 'removeAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'enum ContractResolver.Env', + name: 'env', + type: 'uint8', + }, + ], + name: 'removeAllowedEnv', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'renounceRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'revokeRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'typ', + type: 'bytes32', + }, + { + internalType: 'enum ContractResolver.Env', + name: 'env', + type: 'uint8', + }, + { + internalType: 'address', + name: 'addr', + type: 'address', + }, + ], + name: 'setContract', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + { + internalType: 'enum ContractResolver.Env', + name: '', + type: 'uint8', + }, + ], + name: 'typeAddresses', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + name: 'ContractResolver', + }, + PriceFeed: { + address: '0x1c85638e118b37167e9298c2268758e058DdfDA0', + abi: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + inputs: [], + name: 'MustBeLessThan100', + type: 'error', + }, + { + inputs: [], + name: 'MustBeNonzero', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newPrice', + type: 'uint256', + }, + ], + name: 'BaseNetworkPriceSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newPrice', + type: 'uint256', + }, + ], + name: 'MaxNetworkPriceSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'stakingAddress', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'usagePercent', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'newPrices', + type: 'uint256[]', + }, + ], + name: 'UsageSet', + type: 'event', + }, + { + inputs: [ + { + internalType: 'uint256[]', + name: 'productIds', + type: 'uint256[]', + }, + ], + name: 'baseNetworkPrices', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'productIds', + type: 'uint256[]', + }, + ], + name: 'getNodesForRequest', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + components: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastActiveEpoch', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'commission', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'commissionRate', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastRewardEpoch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator', + name: 'validator', + type: 'tuple', + }, + { + internalType: 'uint256[]', + name: 'prices', + type: 'uint256[]', + }, + ], + internalType: 'struct LibPriceFeedStorage.NodeInfoAndPrices[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getStakingAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256[]', + name: 'productIds', + type: 'uint256[]', + }, + ], + name: 'maxNetworkPrices', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'node', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'productIds', + type: 'uint256[]', + }, + ], + name: 'price', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'price', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'productId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', + }, + ], + internalType: 'struct LibPriceFeedStorage.NodePriceData[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'productId', + type: 'uint256', + }, + ], + name: 'prices', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'price', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'productId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', + }, + ], + internalType: 'struct LibPriceFeedStorage.NodePriceData[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newPrice', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'productIds', + type: 'uint256[]', + }, + ], + name: 'setBaseNetworkPrices', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newPrice', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'productIds', + type: 'uint256[]', + }, + ], + name: 'setMaxNetworkPrices', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'usagePercent', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'productIds', + type: 'uint256[]', + }, + ], + name: 'setUsage', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'usagePercent', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'productId', + type: 'uint256', + }, + ], + name: 'usagePercentToPrice', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'usagePercent', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'productIds', + type: 'uint256[]', + }, + ], + name: 'usagePercentToPrices', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + name: 'PriceFeed', + }, + Ledger: { + address: '0xBEc49fA140aCaA83533fB00A2BB19bDdd0290f25', + abi: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'AmountMustBePositive', + type: 'error', + }, + { + inputs: [], + name: 'ArrayLengthsMustMatch', + type: 'error', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + inputs: [], + name: 'InsufficientFunds', + type: 'error', + }, + { + inputs: [], + name: 'InsufficientWithdrawAmount', + type: 'error', + }, + { + inputs: [], + name: 'MustBeNonzero', + type: 'error', + }, + { + inputs: [], + name: 'NodeNotStakingNode', + type: 'error', + }, + { + inputs: [], + name: 'PercentageMustBeLessThan100', + type: 'error', + }, + { + inputs: [], + name: 'SessionAlreadyUsed', + type: 'error', + }, + { + inputs: [], + name: 'ValueExceedsUint128MaxLimit', + type: 'error', + }, + { + inputs: [], + name: 'WithdrawalDelayNotPassed', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'node_address', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'batch_id', + type: 'uint256', + }, + ], + name: 'BatchCharged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Deposit', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'depositor', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'DepositForUser', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'FoundationRewardsWithdrawn', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'percentage', + type: 'uint256', + }, + ], + name: 'LitFoundationSplitPercentageSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'RewardWithdraw', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'delay', + type: 'uint256', + }, + ], + name: 'RewardWithdrawDelaySet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'RewardWithdrawRequest', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: false, + internalType: 'int256', + name: 'amount', + type: 'int256', + }, + ], + name: 'UserCharged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'delay', + type: 'uint256', + }, + ], + name: 'UserWithdrawDelaySet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: false, + internalType: 'int256', + name: 'amount', + type: 'int256', + }, + ], + name: 'Withdraw', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: false, + internalType: 'int256', + name: 'amount', + type: 'int256', + }, + ], + name: 'WithdrawRequest', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'balance', + outputs: [ + { + internalType: 'int256', + name: '', + type: 'int256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + { + internalType: 'int256', + name: 'amount', + type: 'int256', + }, + ], + name: 'chargeUser', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'users', + type: 'address[]', + }, + { + internalType: 'int256[]', + name: 'amounts', + type: 'int256[]', + }, + { + internalType: 'uint64', + name: 'batchId', + type: 'uint64', + }, + ], + name: 'chargeUsers', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'deposit', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'depositForUser', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'getStakingAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'latestRewardWithdrawRequest', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + internalType: 'struct LibLedgerStorage.WithdrawRequest', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'latestWithdrawRequest', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + internalType: 'struct LibLedgerStorage.WithdrawRequest', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'litFoundationRewards', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'litFoundationSplitPercentage', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'requestRewardWithdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'int256', + name: 'amount', + type: 'int256', + }, + ], + name: 'requestWithdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'rewardBalance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'rewardWithdrawDelay', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'percentage', + type: 'uint256', + }, + ], + name: 'setLitFoundationSplitPercentage', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'delay', + type: 'uint256', + }, + ], + name: 'setRewardWithdrawDelay', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'delay', + type: 'uint256', + }, + ], + name: 'setUserWithdrawDelay', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'userWithdrawDelay', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'int256', + name: 'amount', + type: 'int256', + }, + ], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'withdrawFoundationRewards', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'withdrawRewards', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + name: 'Ledger', + }, + }; + }, +}); + +// packages/wrapped-keys-lit-actions/src/generated/common/batchGenerateEncryptedKeys.js +var require_batchGenerateEncryptedKeys = __commonJS({ + 'packages/wrapped-keys-lit-actions/src/generated/common/batchGenerateEncryptedKeys.js'( + exports, + module2 + ) { + 'use strict'; + init_shim(); + var code9 = + '"use strict";(()=>{var Gc=Object.create;var $i=Object.defineProperty;var jc=Object.getOwnPropertyDescriptor;var Yc=Object.getOwnPropertyNames;var Zc=Object.getPrototypeOf,Xc=Object.prototype.hasOwnProperty;var Da=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw new Error(\'Dynamic require of "\'+r+\'" is not supported\')});var ae=(r,t)=>()=>(r&&(t=r(r=0)),t);var $e=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),Wa=(r,t)=>{for(var e in t)$i(r,e,{get:t[e],enumerable:!0})},Ha=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Yc(t))!Xc.call(r,o)&&o!==e&&$i(r,o,{get:()=>t[o],enumerable:!(n=jc(t,o))||n.enumerable});return r};var H=(r,t,e)=>(e=r!=null?Gc(Zc(r)):{},Ha(t||!r||!r.__esModule?$i(e,"default",{value:r,enumerable:!0}):e,r)),$a=r=>Ha($i({},"__esModule",{value:!0}),r);var ja=$e(Vi=>{"use strict";var Zd=H(V());Vi.byteLength=Qc;Vi.toByteArray=eh;Vi.fromByteArray=ih;var zr=[],Br=[],Jc=typeof Uint8Array<"u"?Uint8Array:Array,ns="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(En=0,Va=ns.length;En0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");e===-1&&(e=t);var n=e===t?0:4-e%4;return[e,n]}function Qc(r){var t=Ga(r),e=t[0],n=t[1];return(e+n)*3/4-n}function th(r,t,e){return(t+e)*3/4-e}function eh(r){var t,e=Ga(r),n=e[0],o=e[1],f=new Jc(th(r,n,o)),h=0,x=o>0?n-4:n,b;for(b=0;b>16&255,f[h++]=t>>8&255,f[h++]=t&255;return o===2&&(t=Br[r.charCodeAt(b)]<<2|Br[r.charCodeAt(b+1)]>>4,f[h++]=t&255),o===1&&(t=Br[r.charCodeAt(b)]<<10|Br[r.charCodeAt(b+1)]<<4|Br[r.charCodeAt(b+2)]>>2,f[h++]=t>>8&255,f[h++]=t&255),f}function rh(r){return zr[r>>18&63]+zr[r>>12&63]+zr[r>>6&63]+zr[r&63]}function nh(r,t,e){for(var n,o=[],f=t;fx?x:h+f));return n===1?(t=r[e-1],o.push(zr[t>>2]+zr[t<<4&63]+"==")):n===2&&(t=(r[e-2]<<8)+r[e-1],o.push(zr[t>>10]+zr[t>>4&63]+zr[t<<2&63]+"=")),o.join("")}});var Ya=$e(is=>{var Jd=H(V());is.read=function(r,t,e,n,o){var f,h,x=o*8-n-1,b=(1<>1,E=-7,L=e?o-1:0,O=e?-1:1,P=r[t+L];for(L+=O,f=P&(1<<-E)-1,P>>=-E,E+=x;E>0;f=f*256+r[t+L],L+=O,E-=8);for(h=f&(1<<-E)-1,f>>=-E,E+=n;E>0;h=h*256+r[t+L],L+=O,E-=8);if(f===0)f=1-_;else{if(f===b)return h?NaN:(P?-1:1)*(1/0);h=h+Math.pow(2,n),f=f-_}return(P?-1:1)*h*Math.pow(2,f-n)};is.write=function(r,t,e,n,o,f){var h,x,b,_=f*8-o-1,E=(1<<_)-1,L=E>>1,O=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,P=n?0:f-1,rt=n?1:-1,D=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(x=isNaN(t)?1:0,h=E):(h=Math.floor(Math.log(t)/Math.LN2),t*(b=Math.pow(2,-h))<1&&(h--,b*=2),h+L>=1?t+=O/b:t+=O*Math.pow(2,1-L),t*b>=2&&(h++,b/=2),h+L>=E?(x=0,h=E):h+L>=1?(x=(t*b-1)*Math.pow(2,o),h=h+L):(x=t*Math.pow(2,L-1)*Math.pow(2,o),h=0));o>=8;r[e+P]=x&255,P+=rt,x/=256,o-=8);for(h=h<0;r[e+P]=h&255,P+=rt,h/=256,_-=8);r[e+P-rt]|=D*128}});var An=$e(jn=>{"use strict";var ep=H(V());var os=ja(),Vn=Ya(),Za=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;jn.Buffer=G;jn.SlowBuffer=ch;jn.INSPECT_MAX_BYTES=50;var Gi=2147483647;jn.kMaxLength=Gi;G.TYPED_ARRAY_SUPPORT=oh();!G.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function oh(){try{let r=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(r,t),r.foo()===42}catch{return!1}}Object.defineProperty(G.prototype,"parent",{enumerable:!0,get:function(){if(G.isBuffer(this))return this.buffer}});Object.defineProperty(G.prototype,"offset",{enumerable:!0,get:function(){if(G.isBuffer(this))return this.byteOffset}});function $r(r){if(r>Gi)throw new RangeError(\'The value "\'+r+\'" is invalid for option "size"\');let t=new Uint8Array(r);return Object.setPrototypeOf(t,G.prototype),t}function G(r,t,e){if(typeof r=="number"){if(typeof t=="string")throw new TypeError(\'The "string" argument must be of type string. Received type number\');return us(r)}return tf(r,t,e)}G.poolSize=8192;function tf(r,t,e){if(typeof r=="string")return ah(r,t);if(ArrayBuffer.isView(r))return fh(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(Kr(r,ArrayBuffer)||r&&Kr(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Kr(r,SharedArrayBuffer)||r&&Kr(r.buffer,SharedArrayBuffer)))return as(r,t,e);if(typeof r=="number")throw new TypeError(\'The "value" argument must not be of type number. Received type number\');let n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return G.from(n,t,e);let o=uh(r);if(o)return o;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return G.from(r[Symbol.toPrimitive]("string"),t,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}G.from=function(r,t,e){return tf(r,t,e)};Object.setPrototypeOf(G.prototype,Uint8Array.prototype);Object.setPrototypeOf(G,Uint8Array);function ef(r){if(typeof r!="number")throw new TypeError(\'"size" argument must be of type number\');if(r<0)throw new RangeError(\'The value "\'+r+\'" is invalid for option "size"\')}function sh(r,t,e){return ef(r),r<=0?$r(r):t!==void 0?typeof e=="string"?$r(r).fill(t,e):$r(r).fill(t):$r(r)}G.alloc=function(r,t,e){return sh(r,t,e)};function us(r){return ef(r),$r(r<0?0:cs(r)|0)}G.allocUnsafe=function(r){return us(r)};G.allocUnsafeSlow=function(r){return us(r)};function ah(r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!G.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let e=rf(r,t)|0,n=$r(e),o=n.write(r,t);return o!==e&&(n=n.slice(0,o)),n}function ss(r){let t=r.length<0?0:cs(r.length)|0,e=$r(t);for(let n=0;n=Gi)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Gi.toString(16)+" bytes");return r|0}function ch(r){return+r!=r&&(r=0),G.alloc(+r)}G.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==G.prototype};G.compare=function(t,e){if(Kr(t,Uint8Array)&&(t=G.from(t,t.offset,t.byteLength)),Kr(e,Uint8Array)&&(e=G.from(e,e.offset,e.byteLength)),!G.isBuffer(t)||!G.isBuffer(e))throw new TypeError(\'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array\');if(t===e)return 0;let n=t.length,o=e.length;for(let f=0,h=Math.min(n,o);fo.length?(G.isBuffer(h)||(h=G.from(h)),h.copy(o,f)):Uint8Array.prototype.set.call(o,h,f);else if(G.isBuffer(h))h.copy(o,f);else throw new TypeError(\'"list" argument must be an Array of Buffers\');f+=h.length}return o};function rf(r,t){if(G.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||Kr(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError(\'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type \'+typeof r);let e=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&e===0)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return fs(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return lf(r).length;default:if(o)return n?-1:fs(r).length;t=(""+t).toLowerCase(),o=!0}}G.byteLength=rf;function hh(r,t,e){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return vh(this,t,e);case"utf8":case"utf-8":return of(this,t,e);case"ascii":return bh(this,t,e);case"latin1":case"binary":return xh(this,t,e);case"base64":return mh(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return kh(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}G.prototype._isBuffer=!0;function _n(r,t,e){let n=r[t];r[t]=r[e],r[e]=n}G.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;ee&&(t+=" ... "),""};Za&&(G.prototype[Za]=G.prototype.inspect);G.prototype.compare=function(t,e,n,o,f){if(Kr(t,Uint8Array)&&(t=G.from(t,t.offset,t.byteLength)),!G.isBuffer(t))throw new TypeError(\'The "target" argument must be one of type Buffer or Uint8Array. Received type \'+typeof t);if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),o===void 0&&(o=0),f===void 0&&(f=this.length),e<0||n>t.length||o<0||f>this.length)throw new RangeError("out of range index");if(o>=f&&e>=n)return 0;if(o>=f)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,f>>>=0,this===t)return 0;let h=f-o,x=n-e,b=Math.min(h,x),_=this.slice(o,f),E=t.slice(e,n);for(let L=0;L2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,ls(e)&&(e=o?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(o)return-1;e=r.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof t=="string"&&(t=G.from(t,n)),G.isBuffer(t))return t.length===0?-1:Xa(r,t,e,n,o);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):Xa(r,[t],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Xa(r,t,e,n,o){let f=1,h=r.length,x=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||t.length<2)return-1;f=2,h/=2,x/=2,e/=2}function b(E,L){return f===1?E[L]:E.readUInt16BE(L*f)}let _;if(o){let E=-1;for(_=e;_h&&(e=h-x),_=e;_>=0;_--){let E=!0;for(let L=0;Lo&&(n=o)):n=o;let f=t.length;n>f/2&&(n=f/2);let h;for(h=0;h>>0,isFinite(n)?(n=n>>>0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let f=this.length-e;if((n===void 0||n>f)&&(n=f),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");let h=!1;for(;;)switch(o){case"hex":return lh(this,t,e,n);case"utf8":case"utf-8":return dh(this,t,e,n);case"ascii":case"latin1":case"binary":return ph(this,t,e,n);case"base64":return yh(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gh(this,t,e,n);default:if(h)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),h=!0}};G.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function mh(r,t,e){return t===0&&e===r.length?os.fromByteArray(r):os.fromByteArray(r.slice(t,e))}function of(r,t,e){e=Math.min(r.length,e);let n=[],o=t;for(;o239?4:f>223?3:f>191?2:1;if(o+x<=e){let b,_,E,L;switch(x){case 1:f<128&&(h=f);break;case 2:b=r[o+1],(b&192)===128&&(L=(f&31)<<6|b&63,L>127&&(h=L));break;case 3:b=r[o+1],_=r[o+2],(b&192)===128&&(_&192)===128&&(L=(f&15)<<12|(b&63)<<6|_&63,L>2047&&(L<55296||L>57343)&&(h=L));break;case 4:b=r[o+1],_=r[o+2],E=r[o+3],(b&192)===128&&(_&192)===128&&(E&192)===128&&(L=(f&15)<<18|(b&63)<<12|(_&63)<<6|E&63,L>65535&&L<1114112&&(h=L))}}h===null?(h=65533,x=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|h&1023),n.push(h),o+=x}return wh(n)}var Ja=4096;function wh(r){let t=r.length;if(t<=Ja)return String.fromCharCode.apply(String,r);let e="",n=0;for(;nn)&&(e=n);let o="";for(let f=t;fn&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),ee)throw new RangeError("Trying to access beyond buffer length")}G.prototype.readUintLE=G.prototype.readUIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||Ze(t,e,this.length);let o=this[t],f=1,h=0;for(;++h>>0,e=e>>>0,n||Ze(t,e,this.length);let o=this[t+--e],f=1;for(;e>0&&(f*=256);)o+=this[t+--e]*f;return o};G.prototype.readUint8=G.prototype.readUInt8=function(t,e){return t=t>>>0,e||Ze(t,1,this.length),this[t]};G.prototype.readUint16LE=G.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||Ze(t,2,this.length),this[t]|this[t+1]<<8};G.prototype.readUint16BE=G.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||Ze(t,2,this.length),this[t]<<8|this[t+1]};G.prototype.readUint32LE=G.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||Ze(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};G.prototype.readUint32BE=G.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||Ze(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};G.prototype.readBigUInt64LE=nn(function(t){t=t>>>0,Gn(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&di(t,this.length-8);let o=e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,f=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(o)+(BigInt(f)<>>0,Gn(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&di(t,this.length-8);let o=e*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],f=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(o)<>>0,e=e>>>0,n||Ze(t,e,this.length);let o=this[t],f=1,h=0;for(;++h=f&&(o-=Math.pow(2,8*e)),o};G.prototype.readIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||Ze(t,e,this.length);let o=e,f=1,h=this[t+--o];for(;o>0&&(f*=256);)h+=this[t+--o]*f;return f*=128,h>=f&&(h-=Math.pow(2,8*e)),h};G.prototype.readInt8=function(t,e){return t=t>>>0,e||Ze(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};G.prototype.readInt16LE=function(t,e){t=t>>>0,e||Ze(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};G.prototype.readInt16BE=function(t,e){t=t>>>0,e||Ze(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};G.prototype.readInt32LE=function(t,e){return t=t>>>0,e||Ze(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};G.prototype.readInt32BE=function(t,e){return t=t>>>0,e||Ze(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};G.prototype.readBigInt64LE=nn(function(t){t=t>>>0,Gn(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&di(t,this.length-8);let o=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(o)<>>0,Gn(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&di(t,this.length-8);let o=(e<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(o)<>>0,e||Ze(t,4,this.length),Vn.read(this,t,!0,23,4)};G.prototype.readFloatBE=function(t,e){return t=t>>>0,e||Ze(t,4,this.length),Vn.read(this,t,!1,23,4)};G.prototype.readDoubleLE=function(t,e){return t=t>>>0,e||Ze(t,8,this.length),Vn.read(this,t,!0,52,8)};G.prototype.readDoubleBE=function(t,e){return t=t>>>0,e||Ze(t,8,this.length),Vn.read(this,t,!1,52,8)};function pr(r,t,e,n,o,f){if(!G.isBuffer(r))throw new TypeError(\'"buffer" argument must be a Buffer instance\');if(t>o||tr.length)throw new RangeError("Index out of range")}G.prototype.writeUintLE=G.prototype.writeUIntLE=function(t,e,n,o){if(t=+t,e=e>>>0,n=n>>>0,!o){let x=Math.pow(2,8*n)-1;pr(this,t,e,n,x,0)}let f=1,h=0;for(this[e]=t&255;++h>>0,n=n>>>0,!o){let x=Math.pow(2,8*n)-1;pr(this,t,e,n,x,0)}let f=n-1,h=1;for(this[e+f]=t&255;--f>=0&&(h*=256);)this[e+f]=t/h&255;return e+n};G.prototype.writeUint8=G.prototype.writeUInt8=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,1,255,0),this[e]=t&255,e+1};G.prototype.writeUint16LE=G.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2};G.prototype.writeUint16BE=G.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2};G.prototype.writeUint32LE=G.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4};G.prototype.writeUint32BE=G.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function sf(r,t,e,n,o){hf(t,n,o,r,e,7);let f=Number(t&BigInt(4294967295));r[e++]=f,f=f>>8,r[e++]=f,f=f>>8,r[e++]=f,f=f>>8,r[e++]=f;let h=Number(t>>BigInt(32)&BigInt(4294967295));return r[e++]=h,h=h>>8,r[e++]=h,h=h>>8,r[e++]=h,h=h>>8,r[e++]=h,e}function af(r,t,e,n,o){hf(t,n,o,r,e,7);let f=Number(t&BigInt(4294967295));r[e+7]=f,f=f>>8,r[e+6]=f,f=f>>8,r[e+5]=f,f=f>>8,r[e+4]=f;let h=Number(t>>BigInt(32)&BigInt(4294967295));return r[e+3]=h,h=h>>8,r[e+2]=h,h=h>>8,r[e+1]=h,h=h>>8,r[e]=h,e+8}G.prototype.writeBigUInt64LE=nn(function(t,e=0){return sf(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});G.prototype.writeBigUInt64BE=nn(function(t,e=0){return af(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});G.prototype.writeIntLE=function(t,e,n,o){if(t=+t,e=e>>>0,!o){let b=Math.pow(2,8*n-1);pr(this,t,e,n,b-1,-b)}let f=0,h=1,x=0;for(this[e]=t&255;++f>0)-x&255;return e+n};G.prototype.writeIntBE=function(t,e,n,o){if(t=+t,e=e>>>0,!o){let b=Math.pow(2,8*n-1);pr(this,t,e,n,b-1,-b)}let f=n-1,h=1,x=0;for(this[e+f]=t&255;--f>=0&&(h*=256);)t<0&&x===0&&this[e+f+1]!==0&&(x=1),this[e+f]=(t/h>>0)-x&255;return e+n};G.prototype.writeInt8=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1};G.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2};G.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2};G.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4};G.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};G.prototype.writeBigInt64LE=nn(function(t,e=0){return sf(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});G.prototype.writeBigInt64BE=nn(function(t,e=0){return af(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ff(r,t,e,n,o,f){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function uf(r,t,e,n,o){return t=+t,e=e>>>0,o||ff(r,t,e,4,34028234663852886e22,-34028234663852886e22),Vn.write(r,t,e,n,23,4),e+4}G.prototype.writeFloatLE=function(t,e,n){return uf(this,t,e,!0,n)};G.prototype.writeFloatBE=function(t,e,n){return uf(this,t,e,!1,n)};function cf(r,t,e,n,o){return t=+t,e=e>>>0,o||ff(r,t,e,8,17976931348623157e292,-17976931348623157e292),Vn.write(r,t,e,n,52,8),e+8}G.prototype.writeDoubleLE=function(t,e,n){return cf(this,t,e,!0,n)};G.prototype.writeDoubleBE=function(t,e,n){return cf(this,t,e,!1,n)};G.prototype.copy=function(t,e,n,o){if(!G.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!o&&o!==0&&(o=this.length),e>=t.length&&(e=t.length),e||(e=0),o>0&&o=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-e>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let f;if(typeof t=="number")for(f=e;f2**32?o=Qa(String(e)):typeof e=="bigint"&&(o=String(e),(e>BigInt(2)**BigInt(32)||e<-(BigInt(2)**BigInt(32)))&&(o=Qa(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);function Qa(r){let t="",e=r.length,n=r[0]==="-"?1:0;for(;e>=n+4;e-=3)t=`_${r.slice(e-3,e)}${t}`;return`${r.slice(0,e)}${t}`}function Sh(r,t,e){Gn(t,"offset"),(r[t]===void 0||r[t+e]===void 0)&&di(t,r.length-(e+1))}function hf(r,t,e,n,o,f){if(r>e||r3?t===0||t===BigInt(0)?x=`>= 0${h} and < 2${h} ** ${(f+1)*8}${h}`:x=`>= -(2${h} ** ${(f+1)*8-1}${h}) and < 2 ** ${(f+1)*8-1}${h}`:x=`>= ${t}${h} and <= ${e}${h}`,new $n.ERR_OUT_OF_RANGE("value",x,r)}Sh(n,o,f)}function Gn(r,t){if(typeof r!="number")throw new $n.ERR_INVALID_ARG_TYPE(t,"number",r)}function di(r,t,e){throw Math.floor(r)!==r?(Gn(r,e),new $n.ERR_OUT_OF_RANGE(e||"offset","an integer",r)):t<0?new $n.ERR_BUFFER_OUT_OF_BOUNDS:new $n.ERR_OUT_OF_RANGE(e||"offset",`>= ${e?1:0} and <= ${t}`,r)}var Bh=/[^+/0-9A-Za-z-_]/g;function Eh(r){if(r=r.split("=")[0],r=r.trim().replace(Bh,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function fs(r,t){t=t||1/0;let e,n=r.length,o=null,f=[];for(let h=0;h55295&&e<57344){if(!o){if(e>56319){(t-=3)>-1&&f.push(239,191,189);continue}else if(h+1===n){(t-=3)>-1&&f.push(239,191,189);continue}o=e;continue}if(e<56320){(t-=3)>-1&&f.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(t-=3)>-1&&f.push(239,191,189);if(o=null,e<128){if((t-=1)<0)break;f.push(e)}else if(e<2048){if((t-=2)<0)break;f.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;f.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;f.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return f}function _h(r){let t=[];for(let e=0;e>8,o=e%256,f.push(o),f.push(n);return f}function lf(r){return os.toByteArray(Eh(r))}function ji(r,t,e,n){let o;for(o=0;o=t.length||o>=r.length);++o)t[o+e]=r[o];return o}function Kr(r,t){return r instanceof t||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===t.name}function ls(r){return r!==r}var Mh=function(){let r="0123456789abcdef",t=new Array(256);for(let e=0;e<16;++e){let n=e*16;for(let o=0;o<16;++o)t[n+o]=r[e]+r[o]}return t}();function nn(r){return typeof BigInt>"u"?Ih:r}function Ih(){throw new Error("BigInt not supported")}});var V=$e(()=>{"use strict";var df=H(An());globalThis.Buffer=df.Buffer});var op,Yi,pf=ae(()=>{"use strict";op=H(V()),Yi=class extends Error{constructor(){super(...arguments);this.name="AbortError"}}});async function yf(r){try{let t=await r(),e=typeof t=="string"?t:JSON.stringify(t);Lit.Actions.setResponse({response:e})}catch(t){if(t instanceof Yi)return;Lit.Actions.setResponse({response:`Error: ${t.message}`})}}var fp,gf=ae(()=>{"use strict";fp=H(V());pf()});var cp,mf,wf=ae(()=>{"use strict";cp=H(V()),mf="lit_"});async function ds({accessControlConditions:r,privateKey:t,publicKey:e}){let{ciphertext:n,dataToEncryptHash:o}=await Lit.Actions.encrypt({accessControlConditions:r,to_encrypt:new TextEncoder().encode(mf+t)});return{ciphertext:n,dataToEncryptHash:o,publicKey:e}}var dp,bf=ae(()=>{"use strict";dp=H(V());wf()});function xf(){let r=ethers.Wallet.createRandom();return{privateKey:r.privateKey.toString(),publicKey:r.publicKey}}var yp,vf=ae(()=>{"use strict";yp=H(V())});async function Lh({privateKey:r,messageToSign:t}){try{let e=new ethers.Wallet(r);return{signature:await e.signMessage(t),walletAddress:e.address}}catch(e){throw e instanceof Error?new Error(`When signing message - ${e.message}`):new Error(`An unexpected error occurred: ${e}`)}}function Rh({messageToSign:r,signature:t}){try{return ethers.utils.verifyMessage(r,t)}catch(e){throw new Error(`When validating signed Ethereum message is valid: ${e.message}`)}}async function kf({privateKey:r,messageToSign:t}){let{signature:e,walletAddress:n}=await Lh({privateKey:r,messageToSign:t});if(Rh({messageToSign:t,signature:e})!==n)throw new Error("Recovered address from verifyMessage doesn\'t match the wallet address");return e}var mp,Sf=ae(()=>{"use strict";mp=H(V())});function pi(r){if(!Number.isSafeInteger(r)||r<0)throw new Error("positive integer expected, got "+r)}function Th(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function on(r,...t){if(!Th(r))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(r.length))throw new Error("Uint8Array expected of length "+t+", got length="+r.length)}function Bf(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");pi(r.outputLen),pi(r.blockLen)}function Vr(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}function Zi(r,t){on(r);let e=t.outputLen;if(r.length{bp=H(V(),1)});var vp,Mn,Ef=ae(()=>{vp=H(V(),1),Mn=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});function _f(r){return new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4))}function Xi(r){return new DataView(r.buffer,r.byteOffset,r.byteLength)}function Lr(r,t){return r<<32-t|r>>>t}function Ph(r){return r<<24&4278190080|r<<8&16711680|r>>>8&65280|r>>>24&255}function ys(r){for(let t=0;tr().update(an(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}function Mf(r){let t=(n,o)=>r(o).update(an(n)).digest(),e=r({});return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=n=>r(n),t}function Ji(r=32){if(Mn&&typeof Mn.getRandomValues=="function")return Mn.getRandomValues(new Uint8Array(r));if(Mn&&typeof Mn.randomBytes=="function")return Mn.randomBytes(r);throw new Error("crypto.getRandomValues must be defined")}var Ep,ps,sn,fn=ae(()=>{Ep=H(V(),1);Ef();yi();ps=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();sn=class{clone(){return this._cloneInto()}}});function Ch(r,t,e,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(t,e,n);let o=BigInt(32),f=BigInt(4294967295),h=Number(e>>o&f),x=Number(e&f),b=n?4:0,_=n?0:4;r.setUint32(t+b,h,n),r.setUint32(t+_,x,n)}function If(r,t,e){return r&t^~r&e}function Lf(r,t,e){return r&t^r&e^t&e}var Ip,Zn,ms=ae(()=>{Ip=H(V(),1);yi();fn();Zn=class extends sn{constructor(t,e,n,o){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Xi(this.buffer)}update(t){Vr(this);let{view:e,buffer:n,blockLen:o}=this;t=an(t);let f=t.length;for(let h=0;ho-h&&(this.process(n,0),h=0);for(let L=h;LE.length)throw new Error("_sha2: outputLen bigger than state");for(let L=0;L<_;L++)x.setUint32(4*L,E[L],f)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:n,length:o,finished:f,destroyed:h,pos:x}=this;return t.length=o,t.pos=x,t.finished=f,t.destroyed=h,o%e&&t.buffer.set(n),t}}});function Rf(r,t=!1){return t?{h:Number(r&Qi),l:Number(r>>ws&Qi)}:{h:Number(r>>ws&Qi)|0,l:Number(r&Qi)|0}}function bs(r,t=!1){let e=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let o=0;o>>0)+(n>>>0);return{h:r+e+(o/2**32|0)|0,l:o|0}}var Rp,Qi,ws,Uh,Oh,Nh,zh,Kh,qh,Fh,Dh,Wh,xs,vs,ks,Ss,$h,Vh,Gh,jh,Yh,Zh,Xh,ge,Bs=ae(()=>{Rp=H(V(),1),Qi=BigInt(4294967295),ws=BigInt(32);Uh=(r,t)=>BigInt(r>>>0)<>>0),Oh=(r,t,e)=>r>>>e,Nh=(r,t,e)=>r<<32-e|t>>>e,zh=(r,t,e)=>r>>>e|t<<32-e,Kh=(r,t,e)=>r<<32-e|t>>>e,qh=(r,t,e)=>r<<64-e|t>>>e-32,Fh=(r,t,e)=>r>>>e-32|t<<64-e,Dh=(r,t)=>t,Wh=(r,t)=>r,xs=(r,t,e)=>r<>>32-e,vs=(r,t,e)=>t<>>32-e,ks=(r,t,e)=>t<>>64-e,Ss=(r,t,e)=>r<>>64-e;$h=(r,t,e)=>(r>>>0)+(t>>>0)+(e>>>0),Vh=(r,t,e,n)=>t+e+n+(r/2**32|0)|0,Gh=(r,t,e,n)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0),jh=(r,t,e,n,o)=>t+e+n+o+(r/2**32|0)|0,Yh=(r,t,e,n,o)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0)+(o>>>0),Zh=(r,t,e,n,o,f)=>t+e+n+o+f+(r/2**32|0)|0,Xh={fromBig:Rf,split:bs,toBig:Uh,shrSH:Oh,shrSL:Nh,rotrSH:zh,rotrSL:Kh,rotrBH:qh,rotrBL:Fh,rotr32H:Dh,rotr32L:Wh,rotlSH:xs,rotlSL:vs,rotlBH:ks,rotlBL:Ss,add:Hh,add3L:$h,add3H:Vh,add4L:Gh,add4H:jh,add5H:Zh,add5L:Yh},ge=Xh});var Op,Jh,Qh,un,cn,Es,Tf,Pf=ae(()=>{Op=H(V(),1);ms();Bs();fn();[Jh,Qh]=(()=>ge.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))))(),un=new Uint32Array(80),cn=new Uint32Array(80),Es=class extends Zn{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:n,Bl:o,Ch:f,Cl:h,Dh:x,Dl:b,Eh:_,El:E,Fh:L,Fl:O,Gh:P,Gl:rt,Hh:D,Hl:C}=this;return[t,e,n,o,f,h,x,b,_,E,L,O,P,rt,D,C]}set(t,e,n,o,f,h,x,b,_,E,L,O,P,rt,D,C){this.Ah=t|0,this.Al=e|0,this.Bh=n|0,this.Bl=o|0,this.Ch=f|0,this.Cl=h|0,this.Dh=x|0,this.Dl=b|0,this.Eh=_|0,this.El=E|0,this.Fh=L|0,this.Fl=O|0,this.Gh=P|0,this.Gl=rt|0,this.Hh=D|0,this.Hl=C|0}process(t,e){for(let j=0;j<16;j++,e+=4)un[j]=t.getUint32(e),cn[j]=t.getUint32(e+=4);for(let j=16;j<80;j++){let it=un[j-15]|0,kt=cn[j-15]|0,st=ge.rotrSH(it,kt,1)^ge.rotrSH(it,kt,8)^ge.shrSH(it,kt,7),yt=ge.rotrSL(it,kt,1)^ge.rotrSL(it,kt,8)^ge.shrSL(it,kt,7),At=un[j-2]|0,Et=cn[j-2]|0,be=ge.rotrSH(At,Et,19)^ge.rotrBH(At,Et,61)^ge.shrSH(At,Et,6),ct=ge.rotrSL(At,Et,19)^ge.rotrBL(At,Et,61)^ge.shrSL(At,Et,6),Lt=ge.add4L(yt,ct,cn[j-7],cn[j-16]),g=ge.add4H(Lt,st,be,un[j-7],un[j-16]);un[j]=g|0,cn[j]=Lt|0}let{Ah:n,Al:o,Bh:f,Bl:h,Ch:x,Cl:b,Dh:_,Dl:E,Eh:L,El:O,Fh:P,Fl:rt,Gh:D,Gl:C,Hh:X,Hl:ot}=this;for(let j=0;j<80;j++){let it=ge.rotrSH(L,O,14)^ge.rotrSH(L,O,18)^ge.rotrBH(L,O,41),kt=ge.rotrSL(L,O,14)^ge.rotrSL(L,O,18)^ge.rotrBL(L,O,41),st=L&P^~L&D,yt=O&rt^~O&C,At=ge.add5L(ot,kt,yt,Qh[j],cn[j]),Et=ge.add5H(At,X,it,st,Jh[j],un[j]),be=At|0,ct=ge.rotrSH(n,o,28)^ge.rotrBH(n,o,34)^ge.rotrBH(n,o,39),Lt=ge.rotrSL(n,o,28)^ge.rotrBL(n,o,34)^ge.rotrBL(n,o,39),g=n&f^n&x^f&x,i=o&h^o&b^h&b;X=D|0,ot=C|0,D=P|0,C=rt|0,P=L|0,rt=O|0,{h:L,l:O}=ge.add(_|0,E|0,Et|0,be|0),_=x|0,E=b|0,x=f|0,b=h|0,f=n|0,h=o|0;let a=ge.add3L(be,Lt,i);n=ge.add3H(a,Et,ct,g),o=a|0}({h:n,l:o}=ge.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:f,l:h}=ge.add(this.Bh|0,this.Bl|0,f|0,h|0),{h:x,l:b}=ge.add(this.Ch|0,this.Cl|0,x|0,b|0),{h:_,l:E}=ge.add(this.Dh|0,this.Dl|0,_|0,E|0),{h:L,l:O}=ge.add(this.Eh|0,this.El|0,L|0,O|0),{h:P,l:rt}=ge.add(this.Fh|0,this.Fl|0,P|0,rt|0),{h:D,l:C}=ge.add(this.Gh|0,this.Gl|0,D|0,C|0),{h:X,l:ot}=ge.add(this.Hh|0,this.Hl|0,X|0,ot|0),this.set(n,o,f,h,x,b,_,E,L,O,P,rt,D,C,X,ot)}roundClean(){un.fill(0),cn.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Tf=Yn(()=>new Es)});var ro={};Wa(ro,{aInRange:()=>yr,abool:()=>Rr,abytes:()=>Xn,bitGet:()=>o0,bitLen:()=>Is,bitMask:()=>mi,bitSet:()=>s0,bytesToHex:()=>jr,bytesToNumberBE:()=>Yr,bytesToNumberLE:()=>ln,concatBytes:()=>Zr,createHmacDrbg:()=>Ls,ensureBytes:()=>Ke,equalBytes:()=>n0,hexToBytes:()=>Ln,hexToNumber:()=>Ms,inRange:()=>gi,isBytes:()=>hn,memoized:()=>Tn,notImplemented:()=>f0,numberToBytesBE:()=>dn,numberToBytesLE:()=>Rn,numberToHexUnpadded:()=>In,numberToVarBytesBE:()=>r0,utf8ToBytes:()=>i0,validateObject:()=>qr});function hn(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function Xn(r){if(!hn(r))throw new Error("Uint8Array expected")}function Rr(r,t){if(typeof t!="boolean")throw new Error(r+" boolean expected, got "+t)}function jr(r){Xn(r);let t="";for(let e=0;e=Gr._0&&r<=Gr._9)return r-Gr._0;if(r>=Gr.A&&r<=Gr.F)return r-(Gr.A-10);if(r>=Gr.a&&r<=Gr.f)return r-(Gr.a-10)}function Ln(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let t=r.length,e=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(e);for(let o=0,f=0;oto;r>>=eo,t+=1);return t}function o0(r,t){return r>>BigInt(t)&eo}function s0(r,t,e){return r|(e?eo:to)<{n.fill(1),o.fill(0),f=0},x=(...L)=>e(o,n,...L),b=(L=As())=>{o=x(Uf([0]),L),n=x(),L.length!==0&&(o=x(Uf([1]),L),n=x())},_=()=>{if(f++>=1e3)throw new Error("drbg: tried 1000 values");let L=0,O=[];for(;L{h(),b(L);let P;for(;!(P=O(_()));)b();return h(),P}}function qr(r,t,e={}){let n=(o,f,h)=>{let x=a0[f];if(typeof x!="function")throw new Error("invalid validator function");let b=r[o];if(!(h&&b===void 0)&&!x(b,r))throw new Error("param "+String(o)+" is invalid. Expected "+f+", got "+b)};for(let[o,f]of Object.entries(t))n(o,f,!1);for(let[o,f]of Object.entries(e))n(o,f,!0);return r}function Tn(r){let t=new WeakMap;return(e,...n)=>{let o=t.get(e);if(o!==void 0)return o;let f=r(e,...n);return t.set(e,f),f}}var Np,to,eo,t0,e0,Gr,_s,mi,As,Uf,a0,f0,Pn=ae(()=>{Np=H(V(),1);to=BigInt(0),eo=BigInt(1),t0=BigInt(2);e0=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));Gr={_0:48,_9:57,A:65,F:70,a:97,f:102};_s=r=>typeof r=="bigint"&&to<=r;mi=r=>(t0<new Uint8Array(r),Uf=r=>Uint8Array.from(r);a0={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||hn(r),isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,t)=>t.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};f0=()=>{throw new Error("not implemented")}});function Re(r,t){let e=r%t;return e>=Ge?e:t+e}function l0(r,t,e){if(tGe;)t&Oe&&(n=n*r%e),r=r*r%e,t>>=Oe;return n}function Ne(r,t,e){let n=r;for(;t-- >Ge;)n*=n,n%=e;return n}function no(r,t){if(r===Ge)throw new Error("invert: expected non-zero number");if(t<=Ge)throw new Error("invert: expected positive modulus, got "+t);let e=Re(r,t),n=t,o=Ge,f=Oe,h=Oe,x=Ge;for(;e!==Ge;){let _=n/e,E=n%e,L=o-h*_,O=f-x*_;n=e,e=E,o=h,f=x,h=L,x=O}if(n!==Oe)throw new Error("invert: does not exist");return Re(o,t)}function d0(r){let t=(r-Oe)/Cn,e,n,o;for(e=r-Oe,n=0;e%Cn===Ge;e/=Cn,n++);for(o=Cn;o1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){let h=(r+Oe)/Rs;return function(b,_){let E=b.pow(_,h);if(!b.eql(b.sqr(E),_))throw new Error("Cannot find square root");return E}}let f=(e+Oe)/Cn;return function(x,b){if(x.pow(b,t)===x.neg(x.ONE))throw new Error("Cannot find square root");let _=n,E=x.pow(x.mul(x.ONE,o),e),L=x.pow(b,f),O=x.pow(b,e);for(;!x.eql(O,x.ONE);){if(x.eql(O,x.ZERO))return x.ZERO;let P=1;for(let D=x.sqr(O);P<_&&!x.eql(D,x.ONE);P++)D=x.sqr(D);let rt=x.pow(E,Oe<(n[o]="function",n),t);return qr(r,e)}function g0(r,t,e){if(eGe;)e&Oe&&(n=r.mul(n,o)),o=r.sqr(o),e>>=Oe;return n}function m0(r,t){let e=new Array(t.length),n=t.reduce((f,h,x)=>r.is0(h)?f:(e[x]=f,r.mul(f,h)),r.ONE),o=r.inv(n);return t.reduceRight((f,h,x)=>r.is0(h)?f:(e[x]=r.mul(f,e[x]),r.mul(f,h)),o),e}function Ps(r,t){let e=t!==void 0?t:r.toString(2).length,n=Math.ceil(e/8);return{nBitLength:e,nByteLength:n}}function pn(r,t,e=!1,n={}){if(r<=Ge)throw new Error("invalid field: expected ORDER > 0, got "+r);let{nBitLength:o,nByteLength:f}=Ps(r,t);if(f>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let h,x=Object.freeze({ORDER:r,isLE:e,BITS:o,BYTES:f,MASK:mi(o),ZERO:Ge,ONE:Oe,create:b=>Re(b,r),isValid:b=>{if(typeof b!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof b);return Ge<=b&&bb===Ge,isOdd:b=>(b&Oe)===Oe,neg:b=>Re(-b,r),eql:(b,_)=>b===_,sqr:b=>Re(b*b,r),add:(b,_)=>Re(b+_,r),sub:(b,_)=>Re(b-_,r),mul:(b,_)=>Re(b*_,r),pow:(b,_)=>g0(x,b,_),div:(b,_)=>Re(b*no(_,r),r),sqrN:b=>b*b,addN:(b,_)=>b+_,subN:(b,_)=>b-_,mulN:(b,_)=>b*_,inv:b=>no(b,r),sqrt:n.sqrt||(b=>(h||(h=p0(r)),h(x,b))),invertBatch:b=>m0(x,b),cmov:(b,_,E)=>E?_:b,toBytes:b=>e?Rn(b,f):dn(b,f),fromBytes:b=>{if(b.length!==f)throw new Error("Field.fromBytes: expected "+f+" bytes, got "+b.length);return e?ln(b):Yr(b)}});return Object.freeze(x)}function Kf(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let t=r.toString(2).length;return Math.ceil(t/8)}function Cs(r){let t=Kf(r);return t+Math.ceil(t/2)}function qf(r,t,e=!1){let n=r.length,o=Kf(t),f=Cs(t);if(n<16||n1024)throw new Error("expected "+f+"-1024 bytes of input, got "+n);let h=e?ln(r):Yr(r),x=Re(h,t-Oe)+Oe;return e?Rn(x,o):dn(x,o)}var qp,Ge,Oe,Cn,u0,Rs,Of,Nf,c0,h0,zf,y0,Jn=ae(()=>{qp=H(V(),1);Pn();Ge=BigInt(0),Oe=BigInt(1),Cn=BigInt(2),u0=BigInt(3),Rs=BigInt(4),Of=BigInt(5),Nf=BigInt(8),c0=BigInt(9),h0=BigInt(16);zf=(r,t)=>(Re(r,t)&Oe)===Oe,y0=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function Us(r,t){let e=t.negate();return r?e:t}function Df(r,t){if(!Number.isSafeInteger(r)||r<=0||r>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+r)}function Os(r,t){Df(r,t);let e=Math.ceil(t/r)+1,n=2**(r-1);return{windows:e,windowSize:n}}function w0(r,t){if(!Array.isArray(r))throw new Error("array expected");r.forEach((e,n)=>{if(!(e instanceof t))throw new Error("invalid point at index "+n)})}function b0(r,t){if(!Array.isArray(r))throw new Error("array of scalars expected");r.forEach((e,n)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+n)})}function zs(r){return Wf.get(r)||1}function oo(r,t){return{constTimeNegate:Us,hasPrecomputes(e){return zs(e)!==1},unsafeLadder(e,n,o=r.ZERO){let f=e;for(;n>Ff;)n&io&&(o=o.add(f)),f=f.double(),n>>=io;return o},precomputeWindow(e,n){let{windows:o,windowSize:f}=Os(n,t),h=[],x=e,b=x;for(let _=0;_>=L,rt>h&&(rt-=E,o+=io);let D=P,C=P+Math.abs(rt)-1,X=O%2!==0,ot=rt<0;rt===0?b=b.add(Us(X,n[D])):x=x.add(Us(ot,n[C]))}return{p:x,f:b}},wNAFUnsafe(e,n,o,f=r.ZERO){let{windows:h,windowSize:x}=Os(e,t),b=BigInt(2**e-1),_=2**e,E=BigInt(e);for(let L=0;L>=E,P>x&&(P-=_,o+=io),P===0)continue;let rt=n[O+Math.abs(P)-1];P<0&&(rt=rt.negate()),f=f.add(rt)}return f},getPrecomputes(e,n,o){let f=Ns.get(n);return f||(f=this.precomputeWindow(n,e),e!==1&&Ns.set(n,o(f))),f},wNAFCached(e,n,o){let f=zs(e);return this.wNAF(f,this.getPrecomputes(f,e,o),n)},wNAFCachedUnsafe(e,n,o,f){let h=zs(e);return h===1?this.unsafeLadder(e,n,f):this.wNAFUnsafe(h,this.getPrecomputes(h,e,o),n,f)},setWindowSize(e,n){Df(n,t),Wf.set(e,n),Ns.delete(e)}}}function so(r,t,e,n){if(w0(e,r),b0(n,t),e.length!==n.length)throw new Error("arrays of points and scalars must have equal length");let o=r.ZERO,f=Is(BigInt(e.length)),h=f>12?f-3:f>4?f-2:f?2:1,x=(1<=0;L-=h){b.fill(o);for(let P=0;P>BigInt(L)&BigInt(x));b[D]=b[D].add(e[P])}let O=o;for(let P=b.length-1,rt=o;P>0;P--)rt=rt.add(b[P]),O=O.add(rt);if(E=E.add(O),L!==0)for(let P=0;P{Hp=H(V(),1);Jn();Pn();Ff=BigInt(0),io=BigInt(1);Ns=new WeakMap,Wf=new WeakMap});function k0(r){let t=wi(r);return qr(r,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function Hf(r){let t=k0(r),{Fp:e,n,prehash:o,hash:f,randomBytes:h,nByteLength:x,h:b}=t,_=ao<{try{return{isValid:!0,value:e.sqrt(u*e.inv(c))}}catch{return{isValid:!1,value:Tr}}}),P=t.adjustScalarBytes||(u=>u),rt=t.domain||((u,c,d)=>{if(Rr("phflag",d),c.length||d)throw new Error("Contexts/pre-hash are not supported");return u});function D(u,c){yr("coordinate "+u,c,Tr,_)}function C(u){if(!(u instanceof j))throw new Error("ExtendedPoint expected")}let X=Tn((u,c)=>{let{ex:d,ey:m,ez:v}=u,p=u.is0();c==null&&(c=p?x0:e.inv(v));let s=E(d*c),y=E(m*c),R=E(v*c);if(p)return{x:Tr,y:gr};if(R!==gr)throw new Error("invZ was invalid");return{x:s,y}}),ot=Tn(u=>{let{a:c,d}=t;if(u.is0())throw new Error("bad point: ZERO");let{ex:m,ey:v,ez:p,et:s}=u,y=E(m*m),R=E(v*v),U=E(p*p),W=E(U*U),tt=E(y*c),at=E(U*E(tt+R)),lt=E(W+E(d*E(y*R)));if(at!==lt)throw new Error("bad point: equation left != right (1)");let xe=E(m*v),gt=E(p*s);if(xe!==gt)throw new Error("bad point: equation left != right (2)");return!0});class j{constructor(c,d,m,v){this.ex=c,this.ey=d,this.ez=m,this.et=v,D("x",c),D("y",d),D("z",m),D("t",v),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(c){if(c instanceof j)throw new Error("extended point not allowed");let{x:d,y:m}=c||{};return D("x",d),D("y",m),new j(d,m,gr,E(d*m))}static normalizeZ(c){let d=e.invertBatch(c.map(m=>m.ez));return c.map((m,v)=>m.toAffine(d[v])).map(j.fromAffine)}static msm(c,d){return so(j,L,c,d)}_setWindowSize(c){st.setWindowSize(this,c)}assertValidity(){ot(this)}equals(c){C(c);let{ex:d,ey:m,ez:v}=this,{ex:p,ey:s,ez:y}=c,R=E(d*y),U=E(p*v),W=E(m*y),tt=E(s*v);return R===U&&W===tt}is0(){return this.equals(j.ZERO)}negate(){return new j(E(-this.ex),this.ey,this.ez,E(-this.et))}double(){let{a:c}=t,{ex:d,ey:m,ez:v}=this,p=E(d*d),s=E(m*m),y=E(ao*E(v*v)),R=E(c*p),U=d+m,W=E(E(U*U)-p-s),tt=R+s,at=tt-y,lt=R-s,xe=E(W*at),gt=E(tt*lt),St=E(W*lt),Ye=E(at*tt);return new j(xe,gt,Ye,St)}add(c){C(c);let{a:d,d:m}=t,{ex:v,ey:p,ez:s,et:y}=this,{ex:R,ey:U,ez:W,et:tt}=c;if(d===BigInt(-1)){let Zt=E((p-v)*(U+R)),Ht=E((p+v)*(U-R)),br=E(Ht-Zt);if(br===Tr)return this.double();let Dt=E(s*ao*tt),$t=E(y*ao*W),xr=$t+Dt,Vt=Ht+Zt,Gt=$t-Dt,Nr=E(xr*br),ie=E(Vt*Gt),Xt=E(xr*Gt),Mr=E(br*Vt);return new j(Nr,ie,Mr,Xt)}let at=E(v*R),lt=E(p*U),xe=E(y*m*tt),gt=E(s*W),St=E((v+p)*(R+U)-at-lt),Ye=gt-xe,Ct=gt+xe,Ft=E(lt-d*at),Or=E(St*Ye),ee=E(Ct*Ft),zt=E(St*Ft),kr=E(Ye*Ct);return new j(Or,ee,kr,zt)}subtract(c){return this.add(c.negate())}wNAF(c){return st.wNAFCached(this,c,j.normalizeZ)}multiply(c){let d=c;yr("scalar",d,gr,n);let{p:m,f:v}=this.wNAF(d);return j.normalizeZ([m,v])[0]}multiplyUnsafe(c,d=j.ZERO){let m=c;return yr("scalar",m,Tr,n),m===Tr?kt:this.is0()||m===gr?this:st.wNAFCachedUnsafe(this,m,j.normalizeZ,d)}isSmallOrder(){return this.multiplyUnsafe(b).is0()}isTorsionFree(){return st.unsafeLadder(this,n).is0()}toAffine(c){return X(this,c)}clearCofactor(){let{h:c}=t;return c===gr?this:this.multiplyUnsafe(c)}static fromHex(c,d=!1){let{d:m,a:v}=t,p=e.BYTES;c=Ke("pointHex",c,p),Rr("zip215",d);let s=c.slice(),y=c[p-1];s[p-1]=y&-129;let R=ln(s),U=d?_:e.ORDER;yr("pointHex.y",R,Tr,U);let W=E(R*R),tt=E(W-gr),at=E(m*W-v),{isValid:lt,value:xe}=O(tt,at);if(!lt)throw new Error("Point.fromHex: invalid y coordinate");let gt=(xe&gr)===gr,St=(y&128)!==0;if(!d&&xe===Tr&&St)throw new Error("Point.fromHex: x=0 and x_0=1");return St!==gt&&(xe=E(-xe)),j.fromAffine({x:xe,y:R})}static fromPrivateKey(c){return Et(c).point}toRawBytes(){let{x:c,y:d}=this.toAffine(),m=Rn(d,e.BYTES);return m[m.length-1]|=c&gr?128:0,m}toHex(){return jr(this.toRawBytes())}}j.BASE=new j(t.Gx,t.Gy,gr,E(t.Gx*t.Gy)),j.ZERO=new j(Tr,gr,gr,Tr);let{BASE:it,ZERO:kt}=j,st=oo(j,x*8);function yt(u){return Re(u,n)}function At(u){return yt(ln(u))}function Et(u){let c=e.BYTES;u=Ke("private key",u,c);let d=Ke("hashed private key",f(u),2*c),m=P(d.slice(0,c)),v=d.slice(c,2*c),p=At(m),s=it.multiply(p),y=s.toRawBytes();return{head:m,prefix:v,scalar:p,point:s,pointBytes:y}}function be(u){return Et(u).pointBytes}function ct(u=new Uint8Array,...c){let d=Zr(...c);return At(f(rt(d,Ke("context",u),!!o)))}function Lt(u,c,d={}){u=Ke("message",u),o&&(u=o(u));let{prefix:m,scalar:v,pointBytes:p}=Et(c),s=ct(d.context,m,u),y=it.multiply(s).toRawBytes(),R=ct(d.context,y,p,u),U=yt(s+R*v);yr("signature.s",U,Tr,n);let W=Zr(y,Rn(U,e.BYTES));return Ke("result",W,e.BYTES*2)}let g=v0;function i(u,c,d,m=g){let{context:v,zip215:p}=m,s=e.BYTES;u=Ke("signature",u,2*s),c=Ke("message",c),d=Ke("publicKey",d,s),p!==void 0&&Rr("zip215",p),o&&(c=o(c));let y=ln(u.slice(s,2*s)),R,U,W;try{R=j.fromHex(d,p),U=j.fromHex(u.slice(0,s),p),W=it.multiplyUnsafe(y)}catch{return!1}if(!p&&R.isSmallOrder())return!1;let tt=ct(v,U.toRawBytes(),R.toRawBytes(),c);return U.add(R.multiplyUnsafe(tt)).subtract(W).clearCofactor().equals(j.ZERO)}return it._setWindowSize(8),{CURVE:t,getPublicKey:be,sign:Lt,verify:i,ExtendedPoint:j,utils:{getExtendedPublicKey:Et,randomPrivateKey:()=>h(e.BYTES),precompute(u=8,c=j.BASE){return c._setWindowSize(u),c.multiply(BigInt(3)),c}}}}var Yp,Tr,gr,ao,x0,v0,$f=ae(()=>{Yp=H(V(),1);Ks();Jn();Pn();Pn();Tr=BigInt(0),gr=BigInt(1),ao=BigInt(2),x0=BigInt(8),v0={zip215:!0}});function _0(r){let t=BigInt(10),e=BigInt(20),n=BigInt(40),o=BigInt(80),f=qs,x=r*r%f*r%f,b=Ne(x,Gf,f)*x%f,_=Ne(b,S0,f)*r%f,E=Ne(_,B0,f)*_%f,L=Ne(E,t,f)*E%f,O=Ne(L,e,f)*L%f,P=Ne(O,n,f)*O%f,rt=Ne(P,o,f)*P%f,D=Ne(rt,o,f)*P%f,C=Ne(D,t,f)*E%f;return{pow_p_5_8:Ne(C,Gf,f)*r%f,b2:x}}function A0(r){return r[0]&=248,r[31]&=127,r[31]|=64,r}function M0(r,t){let e=qs,n=Re(t*t*t,e),o=Re(n*n*t,e),f=_0(r*o).pow_p_5_8,h=Re(r*n*f,e),x=Re(t*h*h,e),b=h,_=Re(h*Vf,e),E=x===r,L=x===Re(-r,e),O=x===Re(-r*Vf,e);return E&&(h=b),(L||O)&&(h=_),zf(h,e)&&(h=Re(-h,e)),{isValid:E||L,value:h}}var iy,qs,Vf,ey,S0,Gf,ry,B0,E0,I0,L0,Un,jf=ae(()=>{iy=H(V(),1);Pf();fn();$f();Jn();qs=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Vf=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),ey=BigInt(0),S0=BigInt(1),Gf=BigInt(2),ry=BigInt(3),B0=BigInt(5),E0=BigInt(8);I0=(()=>pn(qs,void 0,!0))(),L0=(()=>({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:I0,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:E0,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:Tf,randomBytes:Ji,adjustScalarBytes:A0,uvRatio:M0}))(),Un=(()=>Hf(L0))()});var Fs=$e(()=>{var ay=H(V())});var Zf=$e((Yf,Ds)=>{var fy=H(V());(function(r,t){"use strict";function e(g,i){if(!g)throw new Error(i||"Assertion failed")}function n(g,i){g.super_=i;var a=function(){};a.prototype=i.prototype,g.prototype=new a,g.prototype.constructor=g}function o(g,i,a){if(o.isBN(g))return g;this.negative=0,this.words=null,this.length=0,this.red=null,g!==null&&((i==="le"||i==="be")&&(a=i,i=10),this._init(g||0,i||10,a||"be"))}typeof r=="object"?r.exports=o:t.BN=o,o.BN=o,o.wordSize=26;var f;try{typeof window<"u"&&typeof window.Buffer<"u"?f=window.Buffer:f=Fs().Buffer}catch{}o.isBN=function(i){return i instanceof o?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===o.wordSize&&Array.isArray(i.words)},o.max=function(i,a){return i.cmp(a)>0?i:a},o.min=function(i,a){return i.cmp(a)<0?i:a},o.prototype._init=function(i,a,u){if(typeof i=="number")return this._initNumber(i,a,u);if(typeof i=="object")return this._initArray(i,a,u);a==="hex"&&(a=16),e(a===(a|0)&&a>=2&&a<=36),i=i.toString().replace(/\\s+/g,"");var c=0;i[0]==="-"&&(c++,this.negative=1),c=0;c-=3)m=i[c]|i[c-1]<<8|i[c-2]<<16,this.words[d]|=m<>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(u==="le")for(c=0,d=0;c>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this._strip()};function h(g,i){var a=g.charCodeAt(i);if(a>=48&&a<=57)return a-48;if(a>=65&&a<=70)return a-55;if(a>=97&&a<=102)return a-87;e(!1,"Invalid character in "+g)}function x(g,i,a){var u=h(g,a);return a-1>=i&&(u|=h(g,a-1)<<4),u}o.prototype._parseHex=function(i,a,u){this.length=Math.ceil((i.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)v=x(i,a,c)<=18?(d-=18,m+=1,this.words[m]|=v>>>26):d+=8;else{var p=i.length-a;for(c=p%2===0?a+1:a;c=18?(d-=18,m+=1,this.words[m]|=v>>>26):d+=8}this._strip()};function b(g,i,a,u){for(var c=0,d=0,m=Math.min(g.length,a),v=i;v=49?d=p-49+10:p>=17?d=p-17+10:d=p,e(p>=0&&d1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=E}catch{o.prototype.inspect=E}else o.prototype.inspect=E;function E(){return(this.red?""}var L=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],O=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(i,a){i=i||10,a=a|0||1;var u;if(i===16||i==="hex"){u="";for(var c=0,d=0,m=0;m>>24-c&16777215,c+=2,c>=26&&(c-=26,m--),d!==0||m!==this.length-1?u=L[6-p.length]+p+u:u=p+u}for(d!==0&&(u=d.toString(16)+u);u.length%a!==0;)u="0"+u;return this.negative!==0&&(u="-"+u),u}if(i===(i|0)&&i>=2&&i<=36){var s=O[i],y=P[i];u="";var R=this.clone();for(R.negative=0;!R.isZero();){var U=R.modrn(y).toString(i);R=R.idivn(y),R.isZero()?u=U+u:u=L[s-U.length]+U+u}for(this.isZero()&&(u="0"+u);u.length%a!==0;)u="0"+u;return this.negative!==0&&(u="-"+u),u}e(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&e(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},o.prototype.toJSON=function(){return this.toString(16,2)},f&&(o.prototype.toBuffer=function(i,a){return this.toArrayLike(f,i,a)}),o.prototype.toArray=function(i,a){return this.toArrayLike(Array,i,a)};var rt=function(i,a){return i.allocUnsafe?i.allocUnsafe(a):new i(a)};o.prototype.toArrayLike=function(i,a,u){this._strip();var c=this.byteLength(),d=u||Math.max(1,c);e(c<=d,"byte array longer than desired length"),e(d>0,"Requested array length <= 0");var m=rt(i,d),v=a==="le"?"LE":"BE";return this["_toArrayLike"+v](m,c),m},o.prototype._toArrayLikeLE=function(i,a){for(var u=0,c=0,d=0,m=0;d>8&255),u>16&255),m===6?(u>24&255),c=0,m=0):(c=v>>>24,m+=2)}if(u=0&&(i[u--]=v>>8&255),u>=0&&(i[u--]=v>>16&255),m===6?(u>=0&&(i[u--]=v>>24&255),c=0,m=0):(c=v>>>24,m+=2)}if(u>=0)for(i[u--]=c;u>=0;)i[u--]=0},Math.clz32?o.prototype._countBits=function(i){return 32-Math.clz32(i)}:o.prototype._countBits=function(i){var a=i,u=0;return a>=4096&&(u+=13,a>>>=13),a>=64&&(u+=7,a>>>=7),a>=8&&(u+=4,a>>>=4),a>=2&&(u+=2,a>>>=2),u+a},o.prototype._zeroBits=function(i){if(i===0)return 26;var a=i,u=0;return a&8191||(u+=13,a>>>=13),a&127||(u+=7,a>>>=7),a&15||(u+=4,a>>>=4),a&3||(u+=2,a>>>=2),a&1||u++,u},o.prototype.bitLength=function(){var i=this.words[this.length-1],a=this._countBits(i);return(this.length-1)*26+a};function D(g){for(var i=new Array(g.bitLength()),a=0;a>>c&1}return i}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,a=0;ai.length?this.clone().ior(i):i.clone().ior(this)},o.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},o.prototype.iuand=function(i){var a;this.length>i.length?a=i:a=this;for(var u=0;ui.length?this.clone().iand(i):i.clone().iand(this)},o.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},o.prototype.iuxor=function(i){var a,u;this.length>i.length?(a=this,u=i):(a=i,u=this);for(var c=0;ci.length?this.clone().ixor(i):i.clone().ixor(this)},o.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},o.prototype.inotn=function(i){e(typeof i=="number"&&i>=0);var a=Math.ceil(i/26)|0,u=i%26;this._expand(a),u>0&&a--;for(var c=0;c0&&(this.words[c]=~this.words[c]&67108863>>26-u),this._strip()},o.prototype.notn=function(i){return this.clone().inotn(i)},o.prototype.setn=function(i,a){e(typeof i=="number"&&i>=0);var u=i/26|0,c=i%26;return this._expand(u+1),a?this.words[u]=this.words[u]|1<i.length?(u=this,c=i):(u=i,c=this);for(var d=0,m=0;m>>26;for(;d!==0&&m>>26;if(this.length=u.length,d!==0)this.words[this.length]=d,this.length++;else if(u!==this)for(;mi.length?this.clone().iadd(i):i.clone().iadd(this)},o.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var a=this.iadd(i);return i.negative=1,a._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var u=this.cmp(i);if(u===0)return this.negative=0,this.length=1,this.words[0]=0,this;var c,d;u>0?(c=this,d=i):(c=i,d=this);for(var m=0,v=0;v>26,this.words[v]=a&67108863;for(;m!==0&&v>26,this.words[v]=a&67108863;if(m===0&&v>>26,R=p&67108863,U=Math.min(s,i.length-1),W=Math.max(0,s-g.length+1);W<=U;W++){var tt=s-W|0;c=g.words[tt]|0,d=i.words[W]|0,m=c*d+R,y+=m/67108864|0,R=m&67108863}a.words[s]=R|0,p=y|0}return p!==0?a.words[s]=p|0:a.length--,a._strip()}var X=function(i,a,u){var c=i.words,d=a.words,m=u.words,v=0,p,s,y,R=c[0]|0,U=R&8191,W=R>>>13,tt=c[1]|0,at=tt&8191,lt=tt>>>13,xe=c[2]|0,gt=xe&8191,St=xe>>>13,Ye=c[3]|0,Ct=Ye&8191,Ft=Ye>>>13,Or=c[4]|0,ee=Or&8191,zt=Or>>>13,kr=c[5]|0,Zt=kr&8191,Ht=kr>>>13,br=c[6]|0,Dt=br&8191,$t=br>>>13,xr=c[7]|0,Vt=xr&8191,Gt=xr>>>13,Nr=c[8]|0,ie=Nr&8191,Xt=Nr>>>13,Mr=c[9]|0,re=Mr&8191,Jt=Mr>>>13,Sr=d[0]|0,Qt=Sr&8191,ne=Sr>>>13,Ir=d[1]|0,te=Ir&8191,oe=Ir>>>13,rn=d[2]|0,he=rn&8191,le=rn>>>13,hr=d[3]|0,Wt=hr&8191,jt=hr>>>13,Hr=d[4]|0,se=Hr&8191,ue=Hr>>>13,Bn=d[5]|0,Mt=Bn&8191,ce=Bn>>>13,w=d[6]|0,S=w&8191,k=w>>>13,l=d[7]|0,B=l&8191,M=l>>>13,T=d[8]|0,N=T&8191,$=T>>>13,Bt=d[9]|0,J=Bt&8191,dt=Bt>>>13;u.negative=i.negative^a.negative,u.length=19,p=Math.imul(U,Qt),s=Math.imul(U,ne),s=s+Math.imul(W,Qt)|0,y=Math.imul(W,ne);var pt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(pt>>>26)|0,pt&=67108863,p=Math.imul(at,Qt),s=Math.imul(at,ne),s=s+Math.imul(lt,Qt)|0,y=Math.imul(lt,ne),p=p+Math.imul(U,te)|0,s=s+Math.imul(U,oe)|0,s=s+Math.imul(W,te)|0,y=y+Math.imul(W,oe)|0;var It=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(It>>>26)|0,It&=67108863,p=Math.imul(gt,Qt),s=Math.imul(gt,ne),s=s+Math.imul(St,Qt)|0,y=Math.imul(St,ne),p=p+Math.imul(at,te)|0,s=s+Math.imul(at,oe)|0,s=s+Math.imul(lt,te)|0,y=y+Math.imul(lt,oe)|0,p=p+Math.imul(U,he)|0,s=s+Math.imul(U,le)|0,s=s+Math.imul(W,he)|0,y=y+Math.imul(W,le)|0;var Rt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,p=Math.imul(Ct,Qt),s=Math.imul(Ct,ne),s=s+Math.imul(Ft,Qt)|0,y=Math.imul(Ft,ne),p=p+Math.imul(gt,te)|0,s=s+Math.imul(gt,oe)|0,s=s+Math.imul(St,te)|0,y=y+Math.imul(St,oe)|0,p=p+Math.imul(at,he)|0,s=s+Math.imul(at,le)|0,s=s+Math.imul(lt,he)|0,y=y+Math.imul(lt,le)|0,p=p+Math.imul(U,Wt)|0,s=s+Math.imul(U,jt)|0,s=s+Math.imul(W,Wt)|0,y=y+Math.imul(W,jt)|0;var qt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(qt>>>26)|0,qt&=67108863,p=Math.imul(ee,Qt),s=Math.imul(ee,ne),s=s+Math.imul(zt,Qt)|0,y=Math.imul(zt,ne),p=p+Math.imul(Ct,te)|0,s=s+Math.imul(Ct,oe)|0,s=s+Math.imul(Ft,te)|0,y=y+Math.imul(Ft,oe)|0,p=p+Math.imul(gt,he)|0,s=s+Math.imul(gt,le)|0,s=s+Math.imul(St,he)|0,y=y+Math.imul(St,le)|0,p=p+Math.imul(at,Wt)|0,s=s+Math.imul(at,jt)|0,s=s+Math.imul(lt,Wt)|0,y=y+Math.imul(lt,jt)|0,p=p+Math.imul(U,se)|0,s=s+Math.imul(U,ue)|0,s=s+Math.imul(W,se)|0,y=y+Math.imul(W,ue)|0;var Kt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,p=Math.imul(Zt,Qt),s=Math.imul(Zt,ne),s=s+Math.imul(Ht,Qt)|0,y=Math.imul(Ht,ne),p=p+Math.imul(ee,te)|0,s=s+Math.imul(ee,oe)|0,s=s+Math.imul(zt,te)|0,y=y+Math.imul(zt,oe)|0,p=p+Math.imul(Ct,he)|0,s=s+Math.imul(Ct,le)|0,s=s+Math.imul(Ft,he)|0,y=y+Math.imul(Ft,le)|0,p=p+Math.imul(gt,Wt)|0,s=s+Math.imul(gt,jt)|0,s=s+Math.imul(St,Wt)|0,y=y+Math.imul(St,jt)|0,p=p+Math.imul(at,se)|0,s=s+Math.imul(at,ue)|0,s=s+Math.imul(lt,se)|0,y=y+Math.imul(lt,ue)|0,p=p+Math.imul(U,Mt)|0,s=s+Math.imul(U,ce)|0,s=s+Math.imul(W,Mt)|0,y=y+Math.imul(W,ce)|0;var Tt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,p=Math.imul(Dt,Qt),s=Math.imul(Dt,ne),s=s+Math.imul($t,Qt)|0,y=Math.imul($t,ne),p=p+Math.imul(Zt,te)|0,s=s+Math.imul(Zt,oe)|0,s=s+Math.imul(Ht,te)|0,y=y+Math.imul(Ht,oe)|0,p=p+Math.imul(ee,he)|0,s=s+Math.imul(ee,le)|0,s=s+Math.imul(zt,he)|0,y=y+Math.imul(zt,le)|0,p=p+Math.imul(Ct,Wt)|0,s=s+Math.imul(Ct,jt)|0,s=s+Math.imul(Ft,Wt)|0,y=y+Math.imul(Ft,jt)|0,p=p+Math.imul(gt,se)|0,s=s+Math.imul(gt,ue)|0,s=s+Math.imul(St,se)|0,y=y+Math.imul(St,ue)|0,p=p+Math.imul(at,Mt)|0,s=s+Math.imul(at,ce)|0,s=s+Math.imul(lt,Mt)|0,y=y+Math.imul(lt,ce)|0,p=p+Math.imul(U,S)|0,s=s+Math.imul(U,k)|0,s=s+Math.imul(W,S)|0,y=y+Math.imul(W,k)|0;var Ut=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,p=Math.imul(Vt,Qt),s=Math.imul(Vt,ne),s=s+Math.imul(Gt,Qt)|0,y=Math.imul(Gt,ne),p=p+Math.imul(Dt,te)|0,s=s+Math.imul(Dt,oe)|0,s=s+Math.imul($t,te)|0,y=y+Math.imul($t,oe)|0,p=p+Math.imul(Zt,he)|0,s=s+Math.imul(Zt,le)|0,s=s+Math.imul(Ht,he)|0,y=y+Math.imul(Ht,le)|0,p=p+Math.imul(ee,Wt)|0,s=s+Math.imul(ee,jt)|0,s=s+Math.imul(zt,Wt)|0,y=y+Math.imul(zt,jt)|0,p=p+Math.imul(Ct,se)|0,s=s+Math.imul(Ct,ue)|0,s=s+Math.imul(Ft,se)|0,y=y+Math.imul(Ft,ue)|0,p=p+Math.imul(gt,Mt)|0,s=s+Math.imul(gt,ce)|0,s=s+Math.imul(St,Mt)|0,y=y+Math.imul(St,ce)|0,p=p+Math.imul(at,S)|0,s=s+Math.imul(at,k)|0,s=s+Math.imul(lt,S)|0,y=y+Math.imul(lt,k)|0,p=p+Math.imul(U,B)|0,s=s+Math.imul(U,M)|0,s=s+Math.imul(W,B)|0,y=y+Math.imul(W,M)|0;var Pt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,p=Math.imul(ie,Qt),s=Math.imul(ie,ne),s=s+Math.imul(Xt,Qt)|0,y=Math.imul(Xt,ne),p=p+Math.imul(Vt,te)|0,s=s+Math.imul(Vt,oe)|0,s=s+Math.imul(Gt,te)|0,y=y+Math.imul(Gt,oe)|0,p=p+Math.imul(Dt,he)|0,s=s+Math.imul(Dt,le)|0,s=s+Math.imul($t,he)|0,y=y+Math.imul($t,le)|0,p=p+Math.imul(Zt,Wt)|0,s=s+Math.imul(Zt,jt)|0,s=s+Math.imul(Ht,Wt)|0,y=y+Math.imul(Ht,jt)|0,p=p+Math.imul(ee,se)|0,s=s+Math.imul(ee,ue)|0,s=s+Math.imul(zt,se)|0,y=y+Math.imul(zt,ue)|0,p=p+Math.imul(Ct,Mt)|0,s=s+Math.imul(Ct,ce)|0,s=s+Math.imul(Ft,Mt)|0,y=y+Math.imul(Ft,ce)|0,p=p+Math.imul(gt,S)|0,s=s+Math.imul(gt,k)|0,s=s+Math.imul(St,S)|0,y=y+Math.imul(St,k)|0,p=p+Math.imul(at,B)|0,s=s+Math.imul(at,M)|0,s=s+Math.imul(lt,B)|0,y=y+Math.imul(lt,M)|0,p=p+Math.imul(U,N)|0,s=s+Math.imul(U,$)|0,s=s+Math.imul(W,N)|0,y=y+Math.imul(W,$)|0;var mt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(mt>>>26)|0,mt&=67108863,p=Math.imul(re,Qt),s=Math.imul(re,ne),s=s+Math.imul(Jt,Qt)|0,y=Math.imul(Jt,ne),p=p+Math.imul(ie,te)|0,s=s+Math.imul(ie,oe)|0,s=s+Math.imul(Xt,te)|0,y=y+Math.imul(Xt,oe)|0,p=p+Math.imul(Vt,he)|0,s=s+Math.imul(Vt,le)|0,s=s+Math.imul(Gt,he)|0,y=y+Math.imul(Gt,le)|0,p=p+Math.imul(Dt,Wt)|0,s=s+Math.imul(Dt,jt)|0,s=s+Math.imul($t,Wt)|0,y=y+Math.imul($t,jt)|0,p=p+Math.imul(Zt,se)|0,s=s+Math.imul(Zt,ue)|0,s=s+Math.imul(Ht,se)|0,y=y+Math.imul(Ht,ue)|0,p=p+Math.imul(ee,Mt)|0,s=s+Math.imul(ee,ce)|0,s=s+Math.imul(zt,Mt)|0,y=y+Math.imul(zt,ce)|0,p=p+Math.imul(Ct,S)|0,s=s+Math.imul(Ct,k)|0,s=s+Math.imul(Ft,S)|0,y=y+Math.imul(Ft,k)|0,p=p+Math.imul(gt,B)|0,s=s+Math.imul(gt,M)|0,s=s+Math.imul(St,B)|0,y=y+Math.imul(St,M)|0,p=p+Math.imul(at,N)|0,s=s+Math.imul(at,$)|0,s=s+Math.imul(lt,N)|0,y=y+Math.imul(lt,$)|0,p=p+Math.imul(U,J)|0,s=s+Math.imul(U,dt)|0,s=s+Math.imul(W,J)|0,y=y+Math.imul(W,dt)|0;var _t=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(_t>>>26)|0,_t&=67108863,p=Math.imul(re,te),s=Math.imul(re,oe),s=s+Math.imul(Jt,te)|0,y=Math.imul(Jt,oe),p=p+Math.imul(ie,he)|0,s=s+Math.imul(ie,le)|0,s=s+Math.imul(Xt,he)|0,y=y+Math.imul(Xt,le)|0,p=p+Math.imul(Vt,Wt)|0,s=s+Math.imul(Vt,jt)|0,s=s+Math.imul(Gt,Wt)|0,y=y+Math.imul(Gt,jt)|0,p=p+Math.imul(Dt,se)|0,s=s+Math.imul(Dt,ue)|0,s=s+Math.imul($t,se)|0,y=y+Math.imul($t,ue)|0,p=p+Math.imul(Zt,Mt)|0,s=s+Math.imul(Zt,ce)|0,s=s+Math.imul(Ht,Mt)|0,y=y+Math.imul(Ht,ce)|0,p=p+Math.imul(ee,S)|0,s=s+Math.imul(ee,k)|0,s=s+Math.imul(zt,S)|0,y=y+Math.imul(zt,k)|0,p=p+Math.imul(Ct,B)|0,s=s+Math.imul(Ct,M)|0,s=s+Math.imul(Ft,B)|0,y=y+Math.imul(Ft,M)|0,p=p+Math.imul(gt,N)|0,s=s+Math.imul(gt,$)|0,s=s+Math.imul(St,N)|0,y=y+Math.imul(St,$)|0,p=p+Math.imul(at,J)|0,s=s+Math.imul(at,dt)|0,s=s+Math.imul(lt,J)|0,y=y+Math.imul(lt,dt)|0;var ht=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(ht>>>26)|0,ht&=67108863,p=Math.imul(re,he),s=Math.imul(re,le),s=s+Math.imul(Jt,he)|0,y=Math.imul(Jt,le),p=p+Math.imul(ie,Wt)|0,s=s+Math.imul(ie,jt)|0,s=s+Math.imul(Xt,Wt)|0,y=y+Math.imul(Xt,jt)|0,p=p+Math.imul(Vt,se)|0,s=s+Math.imul(Vt,ue)|0,s=s+Math.imul(Gt,se)|0,y=y+Math.imul(Gt,ue)|0,p=p+Math.imul(Dt,Mt)|0,s=s+Math.imul(Dt,ce)|0,s=s+Math.imul($t,Mt)|0,y=y+Math.imul($t,ce)|0,p=p+Math.imul(Zt,S)|0,s=s+Math.imul(Zt,k)|0,s=s+Math.imul(Ht,S)|0,y=y+Math.imul(Ht,k)|0,p=p+Math.imul(ee,B)|0,s=s+Math.imul(ee,M)|0,s=s+Math.imul(zt,B)|0,y=y+Math.imul(zt,M)|0,p=p+Math.imul(Ct,N)|0,s=s+Math.imul(Ct,$)|0,s=s+Math.imul(Ft,N)|0,y=y+Math.imul(Ft,$)|0,p=p+Math.imul(gt,J)|0,s=s+Math.imul(gt,dt)|0,s=s+Math.imul(St,J)|0,y=y+Math.imul(St,dt)|0;var wt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(wt>>>26)|0,wt&=67108863,p=Math.imul(re,Wt),s=Math.imul(re,jt),s=s+Math.imul(Jt,Wt)|0,y=Math.imul(Jt,jt),p=p+Math.imul(ie,se)|0,s=s+Math.imul(ie,ue)|0,s=s+Math.imul(Xt,se)|0,y=y+Math.imul(Xt,ue)|0,p=p+Math.imul(Vt,Mt)|0,s=s+Math.imul(Vt,ce)|0,s=s+Math.imul(Gt,Mt)|0,y=y+Math.imul(Gt,ce)|0,p=p+Math.imul(Dt,S)|0,s=s+Math.imul(Dt,k)|0,s=s+Math.imul($t,S)|0,y=y+Math.imul($t,k)|0,p=p+Math.imul(Zt,B)|0,s=s+Math.imul(Zt,M)|0,s=s+Math.imul(Ht,B)|0,y=y+Math.imul(Ht,M)|0,p=p+Math.imul(ee,N)|0,s=s+Math.imul(ee,$)|0,s=s+Math.imul(zt,N)|0,y=y+Math.imul(zt,$)|0,p=p+Math.imul(Ct,J)|0,s=s+Math.imul(Ct,dt)|0,s=s+Math.imul(Ft,J)|0,y=y+Math.imul(Ft,dt)|0;var bt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(bt>>>26)|0,bt&=67108863,p=Math.imul(re,se),s=Math.imul(re,ue),s=s+Math.imul(Jt,se)|0,y=Math.imul(Jt,ue),p=p+Math.imul(ie,Mt)|0,s=s+Math.imul(ie,ce)|0,s=s+Math.imul(Xt,Mt)|0,y=y+Math.imul(Xt,ce)|0,p=p+Math.imul(Vt,S)|0,s=s+Math.imul(Vt,k)|0,s=s+Math.imul(Gt,S)|0,y=y+Math.imul(Gt,k)|0,p=p+Math.imul(Dt,B)|0,s=s+Math.imul(Dt,M)|0,s=s+Math.imul($t,B)|0,y=y+Math.imul($t,M)|0,p=p+Math.imul(Zt,N)|0,s=s+Math.imul(Zt,$)|0,s=s+Math.imul(Ht,N)|0,y=y+Math.imul(Ht,$)|0,p=p+Math.imul(ee,J)|0,s=s+Math.imul(ee,dt)|0,s=s+Math.imul(zt,J)|0,y=y+Math.imul(zt,dt)|0;var ut=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(ut>>>26)|0,ut&=67108863,p=Math.imul(re,Mt),s=Math.imul(re,ce),s=s+Math.imul(Jt,Mt)|0,y=Math.imul(Jt,ce),p=p+Math.imul(ie,S)|0,s=s+Math.imul(ie,k)|0,s=s+Math.imul(Xt,S)|0,y=y+Math.imul(Xt,k)|0,p=p+Math.imul(Vt,B)|0,s=s+Math.imul(Vt,M)|0,s=s+Math.imul(Gt,B)|0,y=y+Math.imul(Gt,M)|0,p=p+Math.imul(Dt,N)|0,s=s+Math.imul(Dt,$)|0,s=s+Math.imul($t,N)|0,y=y+Math.imul($t,$)|0,p=p+Math.imul(Zt,J)|0,s=s+Math.imul(Zt,dt)|0,s=s+Math.imul(Ht,J)|0,y=y+Math.imul(Ht,dt)|0;var q=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(q>>>26)|0,q&=67108863,p=Math.imul(re,S),s=Math.imul(re,k),s=s+Math.imul(Jt,S)|0,y=Math.imul(Jt,k),p=p+Math.imul(ie,B)|0,s=s+Math.imul(ie,M)|0,s=s+Math.imul(Xt,B)|0,y=y+Math.imul(Xt,M)|0,p=p+Math.imul(Vt,N)|0,s=s+Math.imul(Vt,$)|0,s=s+Math.imul(Gt,N)|0,y=y+Math.imul(Gt,$)|0,p=p+Math.imul(Dt,J)|0,s=s+Math.imul(Dt,dt)|0,s=s+Math.imul($t,J)|0,y=y+Math.imul($t,dt)|0;var F=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(F>>>26)|0,F&=67108863,p=Math.imul(re,B),s=Math.imul(re,M),s=s+Math.imul(Jt,B)|0,y=Math.imul(Jt,M),p=p+Math.imul(ie,N)|0,s=s+Math.imul(ie,$)|0,s=s+Math.imul(Xt,N)|0,y=y+Math.imul(Xt,$)|0,p=p+Math.imul(Vt,J)|0,s=s+Math.imul(Vt,dt)|0,s=s+Math.imul(Gt,J)|0,y=y+Math.imul(Gt,dt)|0;var Q=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Q>>>26)|0,Q&=67108863,p=Math.imul(re,N),s=Math.imul(re,$),s=s+Math.imul(Jt,N)|0,y=Math.imul(Jt,$),p=p+Math.imul(ie,J)|0,s=s+Math.imul(ie,dt)|0,s=s+Math.imul(Xt,J)|0,y=y+Math.imul(Xt,dt)|0;var Y=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Y>>>26)|0,Y&=67108863,p=Math.imul(re,J),s=Math.imul(re,dt),s=s+Math.imul(Jt,J)|0,y=Math.imul(Jt,dt);var Z=(v+p|0)+((s&8191)<<13)|0;return v=(y+(s>>>13)|0)+(Z>>>26)|0,Z&=67108863,m[0]=pt,m[1]=It,m[2]=Rt,m[3]=qt,m[4]=Kt,m[5]=Tt,m[6]=Ut,m[7]=Pt,m[8]=mt,m[9]=_t,m[10]=ht,m[11]=wt,m[12]=bt,m[13]=ut,m[14]=q,m[15]=F,m[16]=Q,m[17]=Y,m[18]=Z,v!==0&&(m[19]=v,u.length++),u};Math.imul||(X=C);function ot(g,i,a){a.negative=i.negative^g.negative,a.length=g.length+i.length;for(var u=0,c=0,d=0;d>>26)|0,c+=m>>>26,m&=67108863}a.words[d]=v,u=m,m=c}return u!==0?a.words[d]=u:a.length--,a._strip()}function j(g,i,a){return ot(g,i,a)}o.prototype.mulTo=function(i,a){var u,c=this.length+i.length;return this.length===10&&i.length===10?u=X(this,i,a):c<63?u=C(this,i,a):c<1024?u=ot(this,i,a):u=j(this,i,a),u};function it(g,i){this.x=g,this.y=i}it.prototype.makeRBT=function(i){for(var a=new Array(i),u=o.prototype._countBits(i)-1,c=0;c>=1;return c},it.prototype.permute=function(i,a,u,c,d,m){for(var v=0;v>>1)d++;return 1<>>13,u[2*m+1]=d&8191,d=d>>>13;for(m=2*a;m>=26,u+=d/67108864|0,u+=m>>>26,this.words[c]=m&67108863}return u!==0&&(this.words[c]=u,this.length++),a?this.ineg():this},o.prototype.muln=function(i){return this.clone().imuln(i)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(i){var a=D(i);if(a.length===0)return new o(1);for(var u=this,c=0;c=0);var a=i%26,u=(i-a)/26,c=67108863>>>26-a<<26-a,d;if(a!==0){var m=0;for(d=0;d>>26-a}m&&(this.words[d]=m,this.length++)}if(u!==0){for(d=this.length-1;d>=0;d--)this.words[d+u]=this.words[d];for(d=0;d=0);var c;a?c=(a-a%26)/26:c=0;var d=i%26,m=Math.min((i-d)/26,this.length),v=67108863^67108863>>>d<m)for(this.length-=m,s=0;s=0&&(y!==0||s>=c);s--){var R=this.words[s]|0;this.words[s]=y<<26-d|R>>>d,y=R&v}return p&&y!==0&&(p.words[p.length++]=y),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(i,a,u){return e(this.negative===0),this.iushrn(i,a,u)},o.prototype.shln=function(i){return this.clone().ishln(i)},o.prototype.ushln=function(i){return this.clone().iushln(i)},o.prototype.shrn=function(i){return this.clone().ishrn(i)},o.prototype.ushrn=function(i){return this.clone().iushrn(i)},o.prototype.testn=function(i){e(typeof i=="number"&&i>=0);var a=i%26,u=(i-a)/26,c=1<=0);var a=i%26,u=(i-a)/26;if(e(this.negative===0,"imaskn works only with positive numbers"),this.length<=u)return this;if(a!==0&&u++,this.length=Math.min(u,this.length),a!==0){var c=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},o.prototype.isubn=function(i){if(e(typeof i=="number"),e(i<67108864),i<0)return this.iaddn(-i);if(this.negative!==0)return this.negative=0,this.iaddn(i),this.negative=1,this;if(this.words[0]-=i,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(p/67108864|0),this.words[d+u]=m&67108863}for(;d>26,this.words[d+u]=m&67108863;if(v===0)return this._strip();for(e(v===-1),v=0,d=0;d>26,this.words[d]=m&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(i,a){var u=this.length-i.length,c=this.clone(),d=i,m=d.words[d.length-1]|0,v=this._countBits(m);u=26-v,u!==0&&(d=d.ushln(u),c.iushln(u),m=d.words[d.length-1]|0);var p=c.length-d.length,s;if(a!=="mod"){s=new o(null),s.length=p+1,s.words=new Array(s.length);for(var y=0;y=0;U--){var W=(c.words[d.length+U]|0)*67108864+(c.words[d.length+U-1]|0);for(W=Math.min(W/m|0,67108863),c._ishlnsubmul(d,W,U);c.negative!==0;)W--,c.negative=0,c._ishlnsubmul(d,1,U),c.isZero()||(c.negative^=1);s&&(s.words[U]=W)}return s&&s._strip(),c._strip(),a!=="div"&&u!==0&&c.iushrn(u),{div:s||null,mod:c}},o.prototype.divmod=function(i,a,u){if(e(!i.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var c,d,m;return this.negative!==0&&i.negative===0?(m=this.neg().divmod(i,a),a!=="mod"&&(c=m.div.neg()),a!=="div"&&(d=m.mod.neg(),u&&d.negative!==0&&d.iadd(i)),{div:c,mod:d}):this.negative===0&&i.negative!==0?(m=this.divmod(i.neg(),a),a!=="mod"&&(c=m.div.neg()),{div:c,mod:m.mod}):this.negative&i.negative?(m=this.neg().divmod(i.neg(),a),a!=="div"&&(d=m.mod.neg(),u&&d.negative!==0&&d.isub(i)),{div:m.div,mod:d}):i.length>this.length||this.cmp(i)<0?{div:new o(0),mod:this}:i.length===1?a==="div"?{div:this.divn(i.words[0]),mod:null}:a==="mod"?{div:null,mod:new o(this.modrn(i.words[0]))}:{div:this.divn(i.words[0]),mod:new o(this.modrn(i.words[0]))}:this._wordDiv(i,a)},o.prototype.div=function(i){return this.divmod(i,"div",!1).div},o.prototype.mod=function(i){return this.divmod(i,"mod",!1).mod},o.prototype.umod=function(i){return this.divmod(i,"mod",!0).mod},o.prototype.divRound=function(i){var a=this.divmod(i);if(a.mod.isZero())return a.div;var u=a.div.negative!==0?a.mod.isub(i):a.mod,c=i.ushrn(1),d=i.andln(1),m=u.cmp(c);return m<0||d===1&&m===0?a.div:a.div.negative!==0?a.div.isubn(1):a.div.iaddn(1)},o.prototype.modrn=function(i){var a=i<0;a&&(i=-i),e(i<=67108863);for(var u=(1<<26)%i,c=0,d=this.length-1;d>=0;d--)c=(u*c+(this.words[d]|0))%i;return a?-c:c},o.prototype.modn=function(i){return this.modrn(i)},o.prototype.idivn=function(i){var a=i<0;a&&(i=-i),e(i<=67108863);for(var u=0,c=this.length-1;c>=0;c--){var d=(this.words[c]|0)+u*67108864;this.words[c]=d/i|0,u=d%i}return this._strip(),a?this.ineg():this},o.prototype.divn=function(i){return this.clone().idivn(i)},o.prototype.egcd=function(i){e(i.negative===0),e(!i.isZero());var a=this,u=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var c=new o(1),d=new o(0),m=new o(0),v=new o(1),p=0;a.isEven()&&u.isEven();)a.iushrn(1),u.iushrn(1),++p;for(var s=u.clone(),y=a.clone();!a.isZero();){for(var R=0,U=1;!(a.words[0]&U)&&R<26;++R,U<<=1);if(R>0)for(a.iushrn(R);R-- >0;)(c.isOdd()||d.isOdd())&&(c.iadd(s),d.isub(y)),c.iushrn(1),d.iushrn(1);for(var W=0,tt=1;!(u.words[0]&tt)&&W<26;++W,tt<<=1);if(W>0)for(u.iushrn(W);W-- >0;)(m.isOdd()||v.isOdd())&&(m.iadd(s),v.isub(y)),m.iushrn(1),v.iushrn(1);a.cmp(u)>=0?(a.isub(u),c.isub(m),d.isub(v)):(u.isub(a),m.isub(c),v.isub(d))}return{a:m,b:v,gcd:u.iushln(p)}},o.prototype._invmp=function(i){e(i.negative===0),e(!i.isZero());var a=this,u=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var c=new o(1),d=new o(0),m=u.clone();a.cmpn(1)>0&&u.cmpn(1)>0;){for(var v=0,p=1;!(a.words[0]&p)&&v<26;++v,p<<=1);if(v>0)for(a.iushrn(v);v-- >0;)c.isOdd()&&c.iadd(m),c.iushrn(1);for(var s=0,y=1;!(u.words[0]&y)&&s<26;++s,y<<=1);if(s>0)for(u.iushrn(s);s-- >0;)d.isOdd()&&d.iadd(m),d.iushrn(1);a.cmp(u)>=0?(a.isub(u),c.isub(d)):(u.isub(a),d.isub(c))}var R;return a.cmpn(1)===0?R=c:R=d,R.cmpn(0)<0&&R.iadd(i),R},o.prototype.gcd=function(i){if(this.isZero())return i.abs();if(i.isZero())return this.abs();var a=this.clone(),u=i.clone();a.negative=0,u.negative=0;for(var c=0;a.isEven()&&u.isEven();c++)a.iushrn(1),u.iushrn(1);do{for(;a.isEven();)a.iushrn(1);for(;u.isEven();)u.iushrn(1);var d=a.cmp(u);if(d<0){var m=a;a=u,u=m}else if(d===0||u.cmpn(1)===0)break;a.isub(u)}while(!0);return u.iushln(c)},o.prototype.invm=function(i){return this.egcd(i).a.umod(i)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(i){return this.words[0]&i},o.prototype.bincn=function(i){e(typeof i=="number");var a=i%26,u=(i-a)/26,c=1<>>26,v&=67108863,this.words[m]=v}return d!==0&&(this.words[m]=d,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(i){var a=i<0;if(this.negative!==0&&!a)return-1;if(this.negative===0&&a)return 1;this._strip();var u;if(this.length>1)u=1;else{a&&(i=-i),e(i<=67108863,"Number is too big");var c=this.words[0]|0;u=c===i?0:ci.length)return 1;if(this.length=0;u--){var c=this.words[u]|0,d=i.words[u]|0;if(c!==d){cd&&(a=1);break}}return a},o.prototype.gtn=function(i){return this.cmpn(i)===1},o.prototype.gt=function(i){return this.cmp(i)===1},o.prototype.gten=function(i){return this.cmpn(i)>=0},o.prototype.gte=function(i){return this.cmp(i)>=0},o.prototype.ltn=function(i){return this.cmpn(i)===-1},o.prototype.lt=function(i){return this.cmp(i)===-1},o.prototype.lten=function(i){return this.cmpn(i)<=0},o.prototype.lte=function(i){return this.cmp(i)<=0},o.prototype.eqn=function(i){return this.cmpn(i)===0},o.prototype.eq=function(i){return this.cmp(i)===0},o.red=function(i){return new ct(i)},o.prototype.toRed=function(i){return e(!this.red,"Already a number in reduction context"),e(this.negative===0,"red works only with positives"),i.convertTo(this)._forceRed(i)},o.prototype.fromRed=function(){return e(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(i){return this.red=i,this},o.prototype.forceRed=function(i){return e(!this.red,"Already a number in reduction context"),this._forceRed(i)},o.prototype.redAdd=function(i){return e(this.red,"redAdd works only with red numbers"),this.red.add(this,i)},o.prototype.redIAdd=function(i){return e(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,i)},o.prototype.redSub=function(i){return e(this.red,"redSub works only with red numbers"),this.red.sub(this,i)},o.prototype.redISub=function(i){return e(this.red,"redISub works only with red numbers"),this.red.isub(this,i)},o.prototype.redShl=function(i){return e(this.red,"redShl works only with red numbers"),this.red.shl(this,i)},o.prototype.redMul=function(i){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.mul(this,i)},o.prototype.redIMul=function(i){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.imul(this,i)},o.prototype.redSqr=function(){return e(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return e(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return e(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return e(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return e(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(i){return e(this.red&&!i.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,i)};var kt={k256:null,p224:null,p192:null,p25519:null};function st(g,i){this.name=g,this.p=new o(i,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}st.prototype._tmp=function(){var i=new o(null);return i.words=new Array(Math.ceil(this.n/13)),i},st.prototype.ireduce=function(i){var a=i,u;do this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),u=a.bitLength();while(u>this.n);var c=u0?a.isub(this.p):a.strip!==void 0?a.strip():a._strip(),a},st.prototype.split=function(i,a){i.iushrn(this.n,0,a)},st.prototype.imulK=function(i){return i.imul(this.k)};function yt(){st.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(yt,st),yt.prototype.split=function(i,a){for(var u=4194303,c=Math.min(i.length,9),d=0;d>>22,m=v}m>>>=22,i.words[d-10]=m,m===0&&i.length>10?i.length-=10:i.length-=9},yt.prototype.imulK=function(i){i.words[i.length]=0,i.words[i.length+1]=0,i.length+=2;for(var a=0,u=0;u>>=26,i.words[u]=d,a=c}return a!==0&&(i.words[i.length++]=a),i},o._prime=function(i){if(kt[i])return kt[i];var a;if(i==="k256")a=new yt;else if(i==="p224")a=new At;else if(i==="p192")a=new Et;else if(i==="p25519")a=new be;else throw new Error("Unknown prime "+i);return kt[i]=a,a};function ct(g){if(typeof g=="string"){var i=o._prime(g);this.m=i.p,this.prime=i}else e(g.gtn(1),"modulus must be greater than 1"),this.m=g,this.prime=null}ct.prototype._verify1=function(i){e(i.negative===0,"red works only with positives"),e(i.red,"red works only with red numbers")},ct.prototype._verify2=function(i,a){e((i.negative|a.negative)===0,"red works only with positives"),e(i.red&&i.red===a.red,"red works only with red numbers")},ct.prototype.imod=function(i){return this.prime?this.prime.ireduce(i)._forceRed(this):(_(i,i.umod(this.m)._forceRed(this)),i)},ct.prototype.neg=function(i){return i.isZero()?i.clone():this.m.sub(i)._forceRed(this)},ct.prototype.add=function(i,a){this._verify2(i,a);var u=i.add(a);return u.cmp(this.m)>=0&&u.isub(this.m),u._forceRed(this)},ct.prototype.iadd=function(i,a){this._verify2(i,a);var u=i.iadd(a);return u.cmp(this.m)>=0&&u.isub(this.m),u},ct.prototype.sub=function(i,a){this._verify2(i,a);var u=i.sub(a);return u.cmpn(0)<0&&u.iadd(this.m),u._forceRed(this)},ct.prototype.isub=function(i,a){this._verify2(i,a);var u=i.isub(a);return u.cmpn(0)<0&&u.iadd(this.m),u},ct.prototype.shl=function(i,a){return this._verify1(i),this.imod(i.ushln(a))},ct.prototype.imul=function(i,a){return this._verify2(i,a),this.imod(i.imul(a))},ct.prototype.mul=function(i,a){return this._verify2(i,a),this.imod(i.mul(a))},ct.prototype.isqr=function(i){return this.imul(i,i.clone())},ct.prototype.sqr=function(i){return this.mul(i,i)},ct.prototype.sqrt=function(i){if(i.isZero())return i.clone();var a=this.m.andln(3);if(e(a%2===1),a===3){var u=this.m.add(new o(1)).iushrn(2);return this.pow(i,u)}for(var c=this.m.subn(1),d=0;!c.isZero()&&c.andln(1)===0;)d++,c.iushrn(1);e(!c.isZero());var m=new o(1).toRed(this),v=m.redNeg(),p=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new o(2*s*s).toRed(this);this.pow(s,p).cmp(v)!==0;)s.redIAdd(v);for(var y=this.pow(s,c),R=this.pow(i,c.addn(1).iushrn(1)),U=this.pow(i,c),W=d;U.cmp(m)!==0;){for(var tt=U,at=0;tt.cmp(m)!==0;at++)tt=tt.redSqr();e(at=0;d--){for(var y=a.words[d],R=s-1;R>=0;R--){var U=y>>R&1;if(m!==c[0]&&(m=this.sqr(m)),U===0&&v===0){p=0;continue}v<<=1,v|=U,p++,!(p!==u&&(d!==0||R!==0))&&(m=this.mul(m,c[v]),p=0,v=0)}s=26}return m},ct.prototype.convertTo=function(i){var a=i.umod(this.m);return a===i?a.clone():a},ct.prototype.convertFrom=function(i){var a=i.clone();return a.red=null,a},o.mont=function(i){return new Lt(i)};function Lt(g){ct.call(this,g),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(Lt,ct),Lt.prototype.convertTo=function(i){return this.imod(i.ushln(this.shift))},Lt.prototype.convertFrom=function(i){var a=this.imod(i.mul(this.rinv));return a.red=null,a},Lt.prototype.imul=function(i,a){if(i.isZero()||a.isZero())return i.words[0]=0,i.length=1,i;var u=i.imul(a),c=u.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=u.isub(c).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},Lt.prototype.mul=function(i,a){if(i.isZero()||a.isZero())return new o(0)._forceRed(this);var u=i.mul(a),c=u.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=u.isub(c).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},Lt.prototype.invm=function(i){var a=this.imod(i._invmp(this.m).mul(this.r2));return a._forceRed(this)}})(typeof Ds>"u"||Ds,Yf)});var Qf=$e((Ws,Jf)=>{var uy=H(V());var fo=An(),Fr=fo.Buffer;function Xf(r,t){for(var e in r)t[e]=r[e]}Fr.from&&Fr.alloc&&Fr.allocUnsafe&&Fr.allocUnsafeSlow?Jf.exports=fo:(Xf(fo,Ws),Ws.Buffer=On);function On(r,t,e){return Fr(r,t,e)}On.prototype=Object.create(Fr.prototype);Xf(Fr,On);On.from=function(r,t,e){if(typeof r=="number")throw new TypeError("Argument must not be a number");return Fr(r,t,e)};On.alloc=function(r,t,e){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=Fr(r);return t!==void 0?typeof e=="string"?n.fill(t,e):n.fill(t):n.fill(0),n};On.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Fr(r)};On.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return fo.SlowBuffer(r)}});var eu=$e((cy,tu)=>{"use strict";var hy=H(V()),uo=Qf().Buffer;function R0(r){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),e=0;e>>0,j=new Uint8Array(ot);C!==X;){for(var it=P[C],kt=0,st=ot-1;(it!==0||kt>>0,j[st]=it%h>>>0,it=it/h>>>0;if(it!==0)throw new Error("Non-zero carry");D=kt,C++}for(var yt=ot-D;yt!==ot&&j[yt]===0;)yt++;for(var At=x.repeat(rt);yt>>0,ot=new Uint8Array(X);rt>>0,ot[kt]=j%256>>>0,j=j/256>>>0;if(j!==0)throw new Error("Non-zero carry");C=it,rt++}for(var st=X-C;st!==X&&ot[st]===0;)st++;var yt=uo.allocUnsafe(D+(X-st));yt.fill(0,0,D);for(var At=D;st!==X;)yt[At++]=ot[st++];return yt}function O(P){var rt=L(P);if(rt)return rt;throw new Error("Non-base"+h+" character")}return{encode:E,decodeUnsafe:L,decode:O}}tu.exports=R0});var Hs=$e((ly,ru)=>{var dy=H(V()),T0=eu(),P0="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";ru.exports=T0(P0)});var my,C0,yn,gn,$s,bi,Vs=ae(()=>{my=H(V(),1);ms();fn();C0=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),yn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),gn=new Uint32Array(64),$s=class extends Zn{constructor(){super(64,32,8,!1),this.A=yn[0]|0,this.B=yn[1]|0,this.C=yn[2]|0,this.D=yn[3]|0,this.E=yn[4]|0,this.F=yn[5]|0,this.G=yn[6]|0,this.H=yn[7]|0}get(){let{A:t,B:e,C:n,D:o,E:f,F:h,G:x,H:b}=this;return[t,e,n,o,f,h,x,b]}set(t,e,n,o,f,h,x,b){this.A=t|0,this.B=e|0,this.C=n|0,this.D=o|0,this.E=f|0,this.F=h|0,this.G=x|0,this.H=b|0}process(t,e){for(let L=0;L<16;L++,e+=4)gn[L]=t.getUint32(e,!1);for(let L=16;L<64;L++){let O=gn[L-15],P=gn[L-2],rt=Lr(O,7)^Lr(O,18)^O>>>3,D=Lr(P,17)^Lr(P,19)^P>>>10;gn[L]=D+gn[L-7]+rt+gn[L-16]|0}let{A:n,B:o,C:f,D:h,E:x,F:b,G:_,H:E}=this;for(let L=0;L<64;L++){let O=Lr(x,6)^Lr(x,11)^Lr(x,25),P=E+O+If(x,b,_)+C0[L]+gn[L]|0,D=(Lr(n,2)^Lr(n,13)^Lr(n,22))+Lf(n,o,f)|0;E=_,_=b,b=x,x=h+P|0,h=f,f=o,o=n,n=P+D|0}n=n+this.A|0,o=o+this.B|0,f=f+this.C|0,h=h+this.D|0,x=x+this.E|0,b=b+this.F|0,_=_+this.G|0,E=E+this.H|0,this.set(n,o,f,h,x,b,_,E)}roundClean(){gn.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},bi=Yn(()=>new $s)});var iu=$e((nu,Gs)=>{var wy=H(V());(function(r,t){"use strict";function e(g,i){if(!g)throw new Error(i||"Assertion failed")}function n(g,i){g.super_=i;var a=function(){};a.prototype=i.prototype,g.prototype=new a,g.prototype.constructor=g}function o(g,i,a){if(o.isBN(g))return g;this.negative=0,this.words=null,this.length=0,this.red=null,g!==null&&((i==="le"||i==="be")&&(a=i,i=10),this._init(g||0,i||10,a||"be"))}typeof r=="object"?r.exports=o:t.BN=o,o.BN=o,o.wordSize=26;var f;try{typeof window<"u"&&typeof window.Buffer<"u"?f=window.Buffer:f=Fs().Buffer}catch{}o.isBN=function(i){return i instanceof o?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===o.wordSize&&Array.isArray(i.words)},o.max=function(i,a){return i.cmp(a)>0?i:a},o.min=function(i,a){return i.cmp(a)<0?i:a},o.prototype._init=function(i,a,u){if(typeof i=="number")return this._initNumber(i,a,u);if(typeof i=="object")return this._initArray(i,a,u);a==="hex"&&(a=16),e(a===(a|0)&&a>=2&&a<=36),i=i.toString().replace(/\\s+/g,"");var c=0;i[0]==="-"&&(c++,this.negative=1),c=0;c-=3)m=i[c]|i[c-1]<<8|i[c-2]<<16,this.words[d]|=m<>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(u==="le")for(c=0,d=0;c>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this._strip()};function h(g,i){var a=g.charCodeAt(i);if(a>=48&&a<=57)return a-48;if(a>=65&&a<=70)return a-55;if(a>=97&&a<=102)return a-87;e(!1,"Invalid character in "+g)}function x(g,i,a){var u=h(g,a);return a-1>=i&&(u|=h(g,a-1)<<4),u}o.prototype._parseHex=function(i,a,u){this.length=Math.ceil((i.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)v=x(i,a,c)<=18?(d-=18,m+=1,this.words[m]|=v>>>26):d+=8;else{var p=i.length-a;for(c=p%2===0?a+1:a;c=18?(d-=18,m+=1,this.words[m]|=v>>>26):d+=8}this._strip()};function b(g,i,a,u){for(var c=0,d=0,m=Math.min(g.length,a),v=i;v=49?d=p-49+10:p>=17?d=p-17+10:d=p,e(p>=0&&d1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=E}catch{o.prototype.inspect=E}else o.prototype.inspect=E;function E(){return(this.red?""}var L=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],O=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(i,a){i=i||10,a=a|0||1;var u;if(i===16||i==="hex"){u="";for(var c=0,d=0,m=0;m>>24-c&16777215,c+=2,c>=26&&(c-=26,m--),d!==0||m!==this.length-1?u=L[6-p.length]+p+u:u=p+u}for(d!==0&&(u=d.toString(16)+u);u.length%a!==0;)u="0"+u;return this.negative!==0&&(u="-"+u),u}if(i===(i|0)&&i>=2&&i<=36){var s=O[i],y=P[i];u="";var R=this.clone();for(R.negative=0;!R.isZero();){var U=R.modrn(y).toString(i);R=R.idivn(y),R.isZero()?u=U+u:u=L[s-U.length]+U+u}for(this.isZero()&&(u="0"+u);u.length%a!==0;)u="0"+u;return this.negative!==0&&(u="-"+u),u}e(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&e(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},o.prototype.toJSON=function(){return this.toString(16,2)},f&&(o.prototype.toBuffer=function(i,a){return this.toArrayLike(f,i,a)}),o.prototype.toArray=function(i,a){return this.toArrayLike(Array,i,a)};var rt=function(i,a){return i.allocUnsafe?i.allocUnsafe(a):new i(a)};o.prototype.toArrayLike=function(i,a,u){this._strip();var c=this.byteLength(),d=u||Math.max(1,c);e(c<=d,"byte array longer than desired length"),e(d>0,"Requested array length <= 0");var m=rt(i,d),v=a==="le"?"LE":"BE";return this["_toArrayLike"+v](m,c),m},o.prototype._toArrayLikeLE=function(i,a){for(var u=0,c=0,d=0,m=0;d>8&255),u>16&255),m===6?(u>24&255),c=0,m=0):(c=v>>>24,m+=2)}if(u=0&&(i[u--]=v>>8&255),u>=0&&(i[u--]=v>>16&255),m===6?(u>=0&&(i[u--]=v>>24&255),c=0,m=0):(c=v>>>24,m+=2)}if(u>=0)for(i[u--]=c;u>=0;)i[u--]=0},Math.clz32?o.prototype._countBits=function(i){return 32-Math.clz32(i)}:o.prototype._countBits=function(i){var a=i,u=0;return a>=4096&&(u+=13,a>>>=13),a>=64&&(u+=7,a>>>=7),a>=8&&(u+=4,a>>>=4),a>=2&&(u+=2,a>>>=2),u+a},o.prototype._zeroBits=function(i){if(i===0)return 26;var a=i,u=0;return a&8191||(u+=13,a>>>=13),a&127||(u+=7,a>>>=7),a&15||(u+=4,a>>>=4),a&3||(u+=2,a>>>=2),a&1||u++,u},o.prototype.bitLength=function(){var i=this.words[this.length-1],a=this._countBits(i);return(this.length-1)*26+a};function D(g){for(var i=new Array(g.bitLength()),a=0;a>>c&1}return i}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,a=0;ai.length?this.clone().ior(i):i.clone().ior(this)},o.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},o.prototype.iuand=function(i){var a;this.length>i.length?a=i:a=this;for(var u=0;ui.length?this.clone().iand(i):i.clone().iand(this)},o.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},o.prototype.iuxor=function(i){var a,u;this.length>i.length?(a=this,u=i):(a=i,u=this);for(var c=0;ci.length?this.clone().ixor(i):i.clone().ixor(this)},o.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},o.prototype.inotn=function(i){e(typeof i=="number"&&i>=0);var a=Math.ceil(i/26)|0,u=i%26;this._expand(a),u>0&&a--;for(var c=0;c0&&(this.words[c]=~this.words[c]&67108863>>26-u),this._strip()},o.prototype.notn=function(i){return this.clone().inotn(i)},o.prototype.setn=function(i,a){e(typeof i=="number"&&i>=0);var u=i/26|0,c=i%26;return this._expand(u+1),a?this.words[u]=this.words[u]|1<i.length?(u=this,c=i):(u=i,c=this);for(var d=0,m=0;m>>26;for(;d!==0&&m>>26;if(this.length=u.length,d!==0)this.words[this.length]=d,this.length++;else if(u!==this)for(;mi.length?this.clone().iadd(i):i.clone().iadd(this)},o.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var a=this.iadd(i);return i.negative=1,a._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var u=this.cmp(i);if(u===0)return this.negative=0,this.length=1,this.words[0]=0,this;var c,d;u>0?(c=this,d=i):(c=i,d=this);for(var m=0,v=0;v>26,this.words[v]=a&67108863;for(;m!==0&&v>26,this.words[v]=a&67108863;if(m===0&&v>>26,R=p&67108863,U=Math.min(s,i.length-1),W=Math.max(0,s-g.length+1);W<=U;W++){var tt=s-W|0;c=g.words[tt]|0,d=i.words[W]|0,m=c*d+R,y+=m/67108864|0,R=m&67108863}a.words[s]=R|0,p=y|0}return p!==0?a.words[s]=p|0:a.length--,a._strip()}var X=function(i,a,u){var c=i.words,d=a.words,m=u.words,v=0,p,s,y,R=c[0]|0,U=R&8191,W=R>>>13,tt=c[1]|0,at=tt&8191,lt=tt>>>13,xe=c[2]|0,gt=xe&8191,St=xe>>>13,Ye=c[3]|0,Ct=Ye&8191,Ft=Ye>>>13,Or=c[4]|0,ee=Or&8191,zt=Or>>>13,kr=c[5]|0,Zt=kr&8191,Ht=kr>>>13,br=c[6]|0,Dt=br&8191,$t=br>>>13,xr=c[7]|0,Vt=xr&8191,Gt=xr>>>13,Nr=c[8]|0,ie=Nr&8191,Xt=Nr>>>13,Mr=c[9]|0,re=Mr&8191,Jt=Mr>>>13,Sr=d[0]|0,Qt=Sr&8191,ne=Sr>>>13,Ir=d[1]|0,te=Ir&8191,oe=Ir>>>13,rn=d[2]|0,he=rn&8191,le=rn>>>13,hr=d[3]|0,Wt=hr&8191,jt=hr>>>13,Hr=d[4]|0,se=Hr&8191,ue=Hr>>>13,Bn=d[5]|0,Mt=Bn&8191,ce=Bn>>>13,w=d[6]|0,S=w&8191,k=w>>>13,l=d[7]|0,B=l&8191,M=l>>>13,T=d[8]|0,N=T&8191,$=T>>>13,Bt=d[9]|0,J=Bt&8191,dt=Bt>>>13;u.negative=i.negative^a.negative,u.length=19,p=Math.imul(U,Qt),s=Math.imul(U,ne),s=s+Math.imul(W,Qt)|0,y=Math.imul(W,ne);var pt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(pt>>>26)|0,pt&=67108863,p=Math.imul(at,Qt),s=Math.imul(at,ne),s=s+Math.imul(lt,Qt)|0,y=Math.imul(lt,ne),p=p+Math.imul(U,te)|0,s=s+Math.imul(U,oe)|0,s=s+Math.imul(W,te)|0,y=y+Math.imul(W,oe)|0;var It=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(It>>>26)|0,It&=67108863,p=Math.imul(gt,Qt),s=Math.imul(gt,ne),s=s+Math.imul(St,Qt)|0,y=Math.imul(St,ne),p=p+Math.imul(at,te)|0,s=s+Math.imul(at,oe)|0,s=s+Math.imul(lt,te)|0,y=y+Math.imul(lt,oe)|0,p=p+Math.imul(U,he)|0,s=s+Math.imul(U,le)|0,s=s+Math.imul(W,he)|0,y=y+Math.imul(W,le)|0;var Rt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,p=Math.imul(Ct,Qt),s=Math.imul(Ct,ne),s=s+Math.imul(Ft,Qt)|0,y=Math.imul(Ft,ne),p=p+Math.imul(gt,te)|0,s=s+Math.imul(gt,oe)|0,s=s+Math.imul(St,te)|0,y=y+Math.imul(St,oe)|0,p=p+Math.imul(at,he)|0,s=s+Math.imul(at,le)|0,s=s+Math.imul(lt,he)|0,y=y+Math.imul(lt,le)|0,p=p+Math.imul(U,Wt)|0,s=s+Math.imul(U,jt)|0,s=s+Math.imul(W,Wt)|0,y=y+Math.imul(W,jt)|0;var qt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(qt>>>26)|0,qt&=67108863,p=Math.imul(ee,Qt),s=Math.imul(ee,ne),s=s+Math.imul(zt,Qt)|0,y=Math.imul(zt,ne),p=p+Math.imul(Ct,te)|0,s=s+Math.imul(Ct,oe)|0,s=s+Math.imul(Ft,te)|0,y=y+Math.imul(Ft,oe)|0,p=p+Math.imul(gt,he)|0,s=s+Math.imul(gt,le)|0,s=s+Math.imul(St,he)|0,y=y+Math.imul(St,le)|0,p=p+Math.imul(at,Wt)|0,s=s+Math.imul(at,jt)|0,s=s+Math.imul(lt,Wt)|0,y=y+Math.imul(lt,jt)|0,p=p+Math.imul(U,se)|0,s=s+Math.imul(U,ue)|0,s=s+Math.imul(W,se)|0,y=y+Math.imul(W,ue)|0;var Kt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,p=Math.imul(Zt,Qt),s=Math.imul(Zt,ne),s=s+Math.imul(Ht,Qt)|0,y=Math.imul(Ht,ne),p=p+Math.imul(ee,te)|0,s=s+Math.imul(ee,oe)|0,s=s+Math.imul(zt,te)|0,y=y+Math.imul(zt,oe)|0,p=p+Math.imul(Ct,he)|0,s=s+Math.imul(Ct,le)|0,s=s+Math.imul(Ft,he)|0,y=y+Math.imul(Ft,le)|0,p=p+Math.imul(gt,Wt)|0,s=s+Math.imul(gt,jt)|0,s=s+Math.imul(St,Wt)|0,y=y+Math.imul(St,jt)|0,p=p+Math.imul(at,se)|0,s=s+Math.imul(at,ue)|0,s=s+Math.imul(lt,se)|0,y=y+Math.imul(lt,ue)|0,p=p+Math.imul(U,Mt)|0,s=s+Math.imul(U,ce)|0,s=s+Math.imul(W,Mt)|0,y=y+Math.imul(W,ce)|0;var Tt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,p=Math.imul(Dt,Qt),s=Math.imul(Dt,ne),s=s+Math.imul($t,Qt)|0,y=Math.imul($t,ne),p=p+Math.imul(Zt,te)|0,s=s+Math.imul(Zt,oe)|0,s=s+Math.imul(Ht,te)|0,y=y+Math.imul(Ht,oe)|0,p=p+Math.imul(ee,he)|0,s=s+Math.imul(ee,le)|0,s=s+Math.imul(zt,he)|0,y=y+Math.imul(zt,le)|0,p=p+Math.imul(Ct,Wt)|0,s=s+Math.imul(Ct,jt)|0,s=s+Math.imul(Ft,Wt)|0,y=y+Math.imul(Ft,jt)|0,p=p+Math.imul(gt,se)|0,s=s+Math.imul(gt,ue)|0,s=s+Math.imul(St,se)|0,y=y+Math.imul(St,ue)|0,p=p+Math.imul(at,Mt)|0,s=s+Math.imul(at,ce)|0,s=s+Math.imul(lt,Mt)|0,y=y+Math.imul(lt,ce)|0,p=p+Math.imul(U,S)|0,s=s+Math.imul(U,k)|0,s=s+Math.imul(W,S)|0,y=y+Math.imul(W,k)|0;var Ut=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,p=Math.imul(Vt,Qt),s=Math.imul(Vt,ne),s=s+Math.imul(Gt,Qt)|0,y=Math.imul(Gt,ne),p=p+Math.imul(Dt,te)|0,s=s+Math.imul(Dt,oe)|0,s=s+Math.imul($t,te)|0,y=y+Math.imul($t,oe)|0,p=p+Math.imul(Zt,he)|0,s=s+Math.imul(Zt,le)|0,s=s+Math.imul(Ht,he)|0,y=y+Math.imul(Ht,le)|0,p=p+Math.imul(ee,Wt)|0,s=s+Math.imul(ee,jt)|0,s=s+Math.imul(zt,Wt)|0,y=y+Math.imul(zt,jt)|0,p=p+Math.imul(Ct,se)|0,s=s+Math.imul(Ct,ue)|0,s=s+Math.imul(Ft,se)|0,y=y+Math.imul(Ft,ue)|0,p=p+Math.imul(gt,Mt)|0,s=s+Math.imul(gt,ce)|0,s=s+Math.imul(St,Mt)|0,y=y+Math.imul(St,ce)|0,p=p+Math.imul(at,S)|0,s=s+Math.imul(at,k)|0,s=s+Math.imul(lt,S)|0,y=y+Math.imul(lt,k)|0,p=p+Math.imul(U,B)|0,s=s+Math.imul(U,M)|0,s=s+Math.imul(W,B)|0,y=y+Math.imul(W,M)|0;var Pt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,p=Math.imul(ie,Qt),s=Math.imul(ie,ne),s=s+Math.imul(Xt,Qt)|0,y=Math.imul(Xt,ne),p=p+Math.imul(Vt,te)|0,s=s+Math.imul(Vt,oe)|0,s=s+Math.imul(Gt,te)|0,y=y+Math.imul(Gt,oe)|0,p=p+Math.imul(Dt,he)|0,s=s+Math.imul(Dt,le)|0,s=s+Math.imul($t,he)|0,y=y+Math.imul($t,le)|0,p=p+Math.imul(Zt,Wt)|0,s=s+Math.imul(Zt,jt)|0,s=s+Math.imul(Ht,Wt)|0,y=y+Math.imul(Ht,jt)|0,p=p+Math.imul(ee,se)|0,s=s+Math.imul(ee,ue)|0,s=s+Math.imul(zt,se)|0,y=y+Math.imul(zt,ue)|0,p=p+Math.imul(Ct,Mt)|0,s=s+Math.imul(Ct,ce)|0,s=s+Math.imul(Ft,Mt)|0,y=y+Math.imul(Ft,ce)|0,p=p+Math.imul(gt,S)|0,s=s+Math.imul(gt,k)|0,s=s+Math.imul(St,S)|0,y=y+Math.imul(St,k)|0,p=p+Math.imul(at,B)|0,s=s+Math.imul(at,M)|0,s=s+Math.imul(lt,B)|0,y=y+Math.imul(lt,M)|0,p=p+Math.imul(U,N)|0,s=s+Math.imul(U,$)|0,s=s+Math.imul(W,N)|0,y=y+Math.imul(W,$)|0;var mt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(mt>>>26)|0,mt&=67108863,p=Math.imul(re,Qt),s=Math.imul(re,ne),s=s+Math.imul(Jt,Qt)|0,y=Math.imul(Jt,ne),p=p+Math.imul(ie,te)|0,s=s+Math.imul(ie,oe)|0,s=s+Math.imul(Xt,te)|0,y=y+Math.imul(Xt,oe)|0,p=p+Math.imul(Vt,he)|0,s=s+Math.imul(Vt,le)|0,s=s+Math.imul(Gt,he)|0,y=y+Math.imul(Gt,le)|0,p=p+Math.imul(Dt,Wt)|0,s=s+Math.imul(Dt,jt)|0,s=s+Math.imul($t,Wt)|0,y=y+Math.imul($t,jt)|0,p=p+Math.imul(Zt,se)|0,s=s+Math.imul(Zt,ue)|0,s=s+Math.imul(Ht,se)|0,y=y+Math.imul(Ht,ue)|0,p=p+Math.imul(ee,Mt)|0,s=s+Math.imul(ee,ce)|0,s=s+Math.imul(zt,Mt)|0,y=y+Math.imul(zt,ce)|0,p=p+Math.imul(Ct,S)|0,s=s+Math.imul(Ct,k)|0,s=s+Math.imul(Ft,S)|0,y=y+Math.imul(Ft,k)|0,p=p+Math.imul(gt,B)|0,s=s+Math.imul(gt,M)|0,s=s+Math.imul(St,B)|0,y=y+Math.imul(St,M)|0,p=p+Math.imul(at,N)|0,s=s+Math.imul(at,$)|0,s=s+Math.imul(lt,N)|0,y=y+Math.imul(lt,$)|0,p=p+Math.imul(U,J)|0,s=s+Math.imul(U,dt)|0,s=s+Math.imul(W,J)|0,y=y+Math.imul(W,dt)|0;var _t=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(_t>>>26)|0,_t&=67108863,p=Math.imul(re,te),s=Math.imul(re,oe),s=s+Math.imul(Jt,te)|0,y=Math.imul(Jt,oe),p=p+Math.imul(ie,he)|0,s=s+Math.imul(ie,le)|0,s=s+Math.imul(Xt,he)|0,y=y+Math.imul(Xt,le)|0,p=p+Math.imul(Vt,Wt)|0,s=s+Math.imul(Vt,jt)|0,s=s+Math.imul(Gt,Wt)|0,y=y+Math.imul(Gt,jt)|0,p=p+Math.imul(Dt,se)|0,s=s+Math.imul(Dt,ue)|0,s=s+Math.imul($t,se)|0,y=y+Math.imul($t,ue)|0,p=p+Math.imul(Zt,Mt)|0,s=s+Math.imul(Zt,ce)|0,s=s+Math.imul(Ht,Mt)|0,y=y+Math.imul(Ht,ce)|0,p=p+Math.imul(ee,S)|0,s=s+Math.imul(ee,k)|0,s=s+Math.imul(zt,S)|0,y=y+Math.imul(zt,k)|0,p=p+Math.imul(Ct,B)|0,s=s+Math.imul(Ct,M)|0,s=s+Math.imul(Ft,B)|0,y=y+Math.imul(Ft,M)|0,p=p+Math.imul(gt,N)|0,s=s+Math.imul(gt,$)|0,s=s+Math.imul(St,N)|0,y=y+Math.imul(St,$)|0,p=p+Math.imul(at,J)|0,s=s+Math.imul(at,dt)|0,s=s+Math.imul(lt,J)|0,y=y+Math.imul(lt,dt)|0;var ht=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(ht>>>26)|0,ht&=67108863,p=Math.imul(re,he),s=Math.imul(re,le),s=s+Math.imul(Jt,he)|0,y=Math.imul(Jt,le),p=p+Math.imul(ie,Wt)|0,s=s+Math.imul(ie,jt)|0,s=s+Math.imul(Xt,Wt)|0,y=y+Math.imul(Xt,jt)|0,p=p+Math.imul(Vt,se)|0,s=s+Math.imul(Vt,ue)|0,s=s+Math.imul(Gt,se)|0,y=y+Math.imul(Gt,ue)|0,p=p+Math.imul(Dt,Mt)|0,s=s+Math.imul(Dt,ce)|0,s=s+Math.imul($t,Mt)|0,y=y+Math.imul($t,ce)|0,p=p+Math.imul(Zt,S)|0,s=s+Math.imul(Zt,k)|0,s=s+Math.imul(Ht,S)|0,y=y+Math.imul(Ht,k)|0,p=p+Math.imul(ee,B)|0,s=s+Math.imul(ee,M)|0,s=s+Math.imul(zt,B)|0,y=y+Math.imul(zt,M)|0,p=p+Math.imul(Ct,N)|0,s=s+Math.imul(Ct,$)|0,s=s+Math.imul(Ft,N)|0,y=y+Math.imul(Ft,$)|0,p=p+Math.imul(gt,J)|0,s=s+Math.imul(gt,dt)|0,s=s+Math.imul(St,J)|0,y=y+Math.imul(St,dt)|0;var wt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(wt>>>26)|0,wt&=67108863,p=Math.imul(re,Wt),s=Math.imul(re,jt),s=s+Math.imul(Jt,Wt)|0,y=Math.imul(Jt,jt),p=p+Math.imul(ie,se)|0,s=s+Math.imul(ie,ue)|0,s=s+Math.imul(Xt,se)|0,y=y+Math.imul(Xt,ue)|0,p=p+Math.imul(Vt,Mt)|0,s=s+Math.imul(Vt,ce)|0,s=s+Math.imul(Gt,Mt)|0,y=y+Math.imul(Gt,ce)|0,p=p+Math.imul(Dt,S)|0,s=s+Math.imul(Dt,k)|0,s=s+Math.imul($t,S)|0,y=y+Math.imul($t,k)|0,p=p+Math.imul(Zt,B)|0,s=s+Math.imul(Zt,M)|0,s=s+Math.imul(Ht,B)|0,y=y+Math.imul(Ht,M)|0,p=p+Math.imul(ee,N)|0,s=s+Math.imul(ee,$)|0,s=s+Math.imul(zt,N)|0,y=y+Math.imul(zt,$)|0,p=p+Math.imul(Ct,J)|0,s=s+Math.imul(Ct,dt)|0,s=s+Math.imul(Ft,J)|0,y=y+Math.imul(Ft,dt)|0;var bt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(bt>>>26)|0,bt&=67108863,p=Math.imul(re,se),s=Math.imul(re,ue),s=s+Math.imul(Jt,se)|0,y=Math.imul(Jt,ue),p=p+Math.imul(ie,Mt)|0,s=s+Math.imul(ie,ce)|0,s=s+Math.imul(Xt,Mt)|0,y=y+Math.imul(Xt,ce)|0,p=p+Math.imul(Vt,S)|0,s=s+Math.imul(Vt,k)|0,s=s+Math.imul(Gt,S)|0,y=y+Math.imul(Gt,k)|0,p=p+Math.imul(Dt,B)|0,s=s+Math.imul(Dt,M)|0,s=s+Math.imul($t,B)|0,y=y+Math.imul($t,M)|0,p=p+Math.imul(Zt,N)|0,s=s+Math.imul(Zt,$)|0,s=s+Math.imul(Ht,N)|0,y=y+Math.imul(Ht,$)|0,p=p+Math.imul(ee,J)|0,s=s+Math.imul(ee,dt)|0,s=s+Math.imul(zt,J)|0,y=y+Math.imul(zt,dt)|0;var ut=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(ut>>>26)|0,ut&=67108863,p=Math.imul(re,Mt),s=Math.imul(re,ce),s=s+Math.imul(Jt,Mt)|0,y=Math.imul(Jt,ce),p=p+Math.imul(ie,S)|0,s=s+Math.imul(ie,k)|0,s=s+Math.imul(Xt,S)|0,y=y+Math.imul(Xt,k)|0,p=p+Math.imul(Vt,B)|0,s=s+Math.imul(Vt,M)|0,s=s+Math.imul(Gt,B)|0,y=y+Math.imul(Gt,M)|0,p=p+Math.imul(Dt,N)|0,s=s+Math.imul(Dt,$)|0,s=s+Math.imul($t,N)|0,y=y+Math.imul($t,$)|0,p=p+Math.imul(Zt,J)|0,s=s+Math.imul(Zt,dt)|0,s=s+Math.imul(Ht,J)|0,y=y+Math.imul(Ht,dt)|0;var q=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(q>>>26)|0,q&=67108863,p=Math.imul(re,S),s=Math.imul(re,k),s=s+Math.imul(Jt,S)|0,y=Math.imul(Jt,k),p=p+Math.imul(ie,B)|0,s=s+Math.imul(ie,M)|0,s=s+Math.imul(Xt,B)|0,y=y+Math.imul(Xt,M)|0,p=p+Math.imul(Vt,N)|0,s=s+Math.imul(Vt,$)|0,s=s+Math.imul(Gt,N)|0,y=y+Math.imul(Gt,$)|0,p=p+Math.imul(Dt,J)|0,s=s+Math.imul(Dt,dt)|0,s=s+Math.imul($t,J)|0,y=y+Math.imul($t,dt)|0;var F=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(F>>>26)|0,F&=67108863,p=Math.imul(re,B),s=Math.imul(re,M),s=s+Math.imul(Jt,B)|0,y=Math.imul(Jt,M),p=p+Math.imul(ie,N)|0,s=s+Math.imul(ie,$)|0,s=s+Math.imul(Xt,N)|0,y=y+Math.imul(Xt,$)|0,p=p+Math.imul(Vt,J)|0,s=s+Math.imul(Vt,dt)|0,s=s+Math.imul(Gt,J)|0,y=y+Math.imul(Gt,dt)|0;var Q=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Q>>>26)|0,Q&=67108863,p=Math.imul(re,N),s=Math.imul(re,$),s=s+Math.imul(Jt,N)|0,y=Math.imul(Jt,$),p=p+Math.imul(ie,J)|0,s=s+Math.imul(ie,dt)|0,s=s+Math.imul(Xt,J)|0,y=y+Math.imul(Xt,dt)|0;var Y=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Y>>>26)|0,Y&=67108863,p=Math.imul(re,J),s=Math.imul(re,dt),s=s+Math.imul(Jt,J)|0,y=Math.imul(Jt,dt);var Z=(v+p|0)+((s&8191)<<13)|0;return v=(y+(s>>>13)|0)+(Z>>>26)|0,Z&=67108863,m[0]=pt,m[1]=It,m[2]=Rt,m[3]=qt,m[4]=Kt,m[5]=Tt,m[6]=Ut,m[7]=Pt,m[8]=mt,m[9]=_t,m[10]=ht,m[11]=wt,m[12]=bt,m[13]=ut,m[14]=q,m[15]=F,m[16]=Q,m[17]=Y,m[18]=Z,v!==0&&(m[19]=v,u.length++),u};Math.imul||(X=C);function ot(g,i,a){a.negative=i.negative^g.negative,a.length=g.length+i.length;for(var u=0,c=0,d=0;d>>26)|0,c+=m>>>26,m&=67108863}a.words[d]=v,u=m,m=c}return u!==0?a.words[d]=u:a.length--,a._strip()}function j(g,i,a){return ot(g,i,a)}o.prototype.mulTo=function(i,a){var u,c=this.length+i.length;return this.length===10&&i.length===10?u=X(this,i,a):c<63?u=C(this,i,a):c<1024?u=ot(this,i,a):u=j(this,i,a),u};function it(g,i){this.x=g,this.y=i}it.prototype.makeRBT=function(i){for(var a=new Array(i),u=o.prototype._countBits(i)-1,c=0;c>=1;return c},it.prototype.permute=function(i,a,u,c,d,m){for(var v=0;v>>1)d++;return 1<>>13,u[2*m+1]=d&8191,d=d>>>13;for(m=2*a;m>=26,u+=d/67108864|0,u+=m>>>26,this.words[c]=m&67108863}return u!==0&&(this.words[c]=u,this.length++),a?this.ineg():this},o.prototype.muln=function(i){return this.clone().imuln(i)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(i){var a=D(i);if(a.length===0)return new o(1);for(var u=this,c=0;c=0);var a=i%26,u=(i-a)/26,c=67108863>>>26-a<<26-a,d;if(a!==0){var m=0;for(d=0;d>>26-a}m&&(this.words[d]=m,this.length++)}if(u!==0){for(d=this.length-1;d>=0;d--)this.words[d+u]=this.words[d];for(d=0;d=0);var c;a?c=(a-a%26)/26:c=0;var d=i%26,m=Math.min((i-d)/26,this.length),v=67108863^67108863>>>d<m)for(this.length-=m,s=0;s=0&&(y!==0||s>=c);s--){var R=this.words[s]|0;this.words[s]=y<<26-d|R>>>d,y=R&v}return p&&y!==0&&(p.words[p.length++]=y),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(i,a,u){return e(this.negative===0),this.iushrn(i,a,u)},o.prototype.shln=function(i){return this.clone().ishln(i)},o.prototype.ushln=function(i){return this.clone().iushln(i)},o.prototype.shrn=function(i){return this.clone().ishrn(i)},o.prototype.ushrn=function(i){return this.clone().iushrn(i)},o.prototype.testn=function(i){e(typeof i=="number"&&i>=0);var a=i%26,u=(i-a)/26,c=1<=0);var a=i%26,u=(i-a)/26;if(e(this.negative===0,"imaskn works only with positive numbers"),this.length<=u)return this;if(a!==0&&u++,this.length=Math.min(u,this.length),a!==0){var c=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},o.prototype.isubn=function(i){if(e(typeof i=="number"),e(i<67108864),i<0)return this.iaddn(-i);if(this.negative!==0)return this.negative=0,this.iaddn(i),this.negative=1,this;if(this.words[0]-=i,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(p/67108864|0),this.words[d+u]=m&67108863}for(;d>26,this.words[d+u]=m&67108863;if(v===0)return this._strip();for(e(v===-1),v=0,d=0;d>26,this.words[d]=m&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(i,a){var u=this.length-i.length,c=this.clone(),d=i,m=d.words[d.length-1]|0,v=this._countBits(m);u=26-v,u!==0&&(d=d.ushln(u),c.iushln(u),m=d.words[d.length-1]|0);var p=c.length-d.length,s;if(a!=="mod"){s=new o(null),s.length=p+1,s.words=new Array(s.length);for(var y=0;y=0;U--){var W=(c.words[d.length+U]|0)*67108864+(c.words[d.length+U-1]|0);for(W=Math.min(W/m|0,67108863),c._ishlnsubmul(d,W,U);c.negative!==0;)W--,c.negative=0,c._ishlnsubmul(d,1,U),c.isZero()||(c.negative^=1);s&&(s.words[U]=W)}return s&&s._strip(),c._strip(),a!=="div"&&u!==0&&c.iushrn(u),{div:s||null,mod:c}},o.prototype.divmod=function(i,a,u){if(e(!i.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var c,d,m;return this.negative!==0&&i.negative===0?(m=this.neg().divmod(i,a),a!=="mod"&&(c=m.div.neg()),a!=="div"&&(d=m.mod.neg(),u&&d.negative!==0&&d.iadd(i)),{div:c,mod:d}):this.negative===0&&i.negative!==0?(m=this.divmod(i.neg(),a),a!=="mod"&&(c=m.div.neg()),{div:c,mod:m.mod}):this.negative&i.negative?(m=this.neg().divmod(i.neg(),a),a!=="div"&&(d=m.mod.neg(),u&&d.negative!==0&&d.isub(i)),{div:m.div,mod:d}):i.length>this.length||this.cmp(i)<0?{div:new o(0),mod:this}:i.length===1?a==="div"?{div:this.divn(i.words[0]),mod:null}:a==="mod"?{div:null,mod:new o(this.modrn(i.words[0]))}:{div:this.divn(i.words[0]),mod:new o(this.modrn(i.words[0]))}:this._wordDiv(i,a)},o.prototype.div=function(i){return this.divmod(i,"div",!1).div},o.prototype.mod=function(i){return this.divmod(i,"mod",!1).mod},o.prototype.umod=function(i){return this.divmod(i,"mod",!0).mod},o.prototype.divRound=function(i){var a=this.divmod(i);if(a.mod.isZero())return a.div;var u=a.div.negative!==0?a.mod.isub(i):a.mod,c=i.ushrn(1),d=i.andln(1),m=u.cmp(c);return m<0||d===1&&m===0?a.div:a.div.negative!==0?a.div.isubn(1):a.div.iaddn(1)},o.prototype.modrn=function(i){var a=i<0;a&&(i=-i),e(i<=67108863);for(var u=(1<<26)%i,c=0,d=this.length-1;d>=0;d--)c=(u*c+(this.words[d]|0))%i;return a?-c:c},o.prototype.modn=function(i){return this.modrn(i)},o.prototype.idivn=function(i){var a=i<0;a&&(i=-i),e(i<=67108863);for(var u=0,c=this.length-1;c>=0;c--){var d=(this.words[c]|0)+u*67108864;this.words[c]=d/i|0,u=d%i}return this._strip(),a?this.ineg():this},o.prototype.divn=function(i){return this.clone().idivn(i)},o.prototype.egcd=function(i){e(i.negative===0),e(!i.isZero());var a=this,u=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var c=new o(1),d=new o(0),m=new o(0),v=new o(1),p=0;a.isEven()&&u.isEven();)a.iushrn(1),u.iushrn(1),++p;for(var s=u.clone(),y=a.clone();!a.isZero();){for(var R=0,U=1;!(a.words[0]&U)&&R<26;++R,U<<=1);if(R>0)for(a.iushrn(R);R-- >0;)(c.isOdd()||d.isOdd())&&(c.iadd(s),d.isub(y)),c.iushrn(1),d.iushrn(1);for(var W=0,tt=1;!(u.words[0]&tt)&&W<26;++W,tt<<=1);if(W>0)for(u.iushrn(W);W-- >0;)(m.isOdd()||v.isOdd())&&(m.iadd(s),v.isub(y)),m.iushrn(1),v.iushrn(1);a.cmp(u)>=0?(a.isub(u),c.isub(m),d.isub(v)):(u.isub(a),m.isub(c),v.isub(d))}return{a:m,b:v,gcd:u.iushln(p)}},o.prototype._invmp=function(i){e(i.negative===0),e(!i.isZero());var a=this,u=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var c=new o(1),d=new o(0),m=u.clone();a.cmpn(1)>0&&u.cmpn(1)>0;){for(var v=0,p=1;!(a.words[0]&p)&&v<26;++v,p<<=1);if(v>0)for(a.iushrn(v);v-- >0;)c.isOdd()&&c.iadd(m),c.iushrn(1);for(var s=0,y=1;!(u.words[0]&y)&&s<26;++s,y<<=1);if(s>0)for(u.iushrn(s);s-- >0;)d.isOdd()&&d.iadd(m),d.iushrn(1);a.cmp(u)>=0?(a.isub(u),c.isub(d)):(u.isub(a),d.isub(c))}var R;return a.cmpn(1)===0?R=c:R=d,R.cmpn(0)<0&&R.iadd(i),R},o.prototype.gcd=function(i){if(this.isZero())return i.abs();if(i.isZero())return this.abs();var a=this.clone(),u=i.clone();a.negative=0,u.negative=0;for(var c=0;a.isEven()&&u.isEven();c++)a.iushrn(1),u.iushrn(1);do{for(;a.isEven();)a.iushrn(1);for(;u.isEven();)u.iushrn(1);var d=a.cmp(u);if(d<0){var m=a;a=u,u=m}else if(d===0||u.cmpn(1)===0)break;a.isub(u)}while(!0);return u.iushln(c)},o.prototype.invm=function(i){return this.egcd(i).a.umod(i)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(i){return this.words[0]&i},o.prototype.bincn=function(i){e(typeof i=="number");var a=i%26,u=(i-a)/26,c=1<>>26,v&=67108863,this.words[m]=v}return d!==0&&(this.words[m]=d,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(i){var a=i<0;if(this.negative!==0&&!a)return-1;if(this.negative===0&&a)return 1;this._strip();var u;if(this.length>1)u=1;else{a&&(i=-i),e(i<=67108863,"Number is too big");var c=this.words[0]|0;u=c===i?0:ci.length)return 1;if(this.length=0;u--){var c=this.words[u]|0,d=i.words[u]|0;if(c!==d){cd&&(a=1);break}}return a},o.prototype.gtn=function(i){return this.cmpn(i)===1},o.prototype.gt=function(i){return this.cmp(i)===1},o.prototype.gten=function(i){return this.cmpn(i)>=0},o.prototype.gte=function(i){return this.cmp(i)>=0},o.prototype.ltn=function(i){return this.cmpn(i)===-1},o.prototype.lt=function(i){return this.cmp(i)===-1},o.prototype.lten=function(i){return this.cmpn(i)<=0},o.prototype.lte=function(i){return this.cmp(i)<=0},o.prototype.eqn=function(i){return this.cmpn(i)===0},o.prototype.eq=function(i){return this.cmp(i)===0},o.red=function(i){return new ct(i)},o.prototype.toRed=function(i){return e(!this.red,"Already a number in reduction context"),e(this.negative===0,"red works only with positives"),i.convertTo(this)._forceRed(i)},o.prototype.fromRed=function(){return e(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(i){return this.red=i,this},o.prototype.forceRed=function(i){return e(!this.red,"Already a number in reduction context"),this._forceRed(i)},o.prototype.redAdd=function(i){return e(this.red,"redAdd works only with red numbers"),this.red.add(this,i)},o.prototype.redIAdd=function(i){return e(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,i)},o.prototype.redSub=function(i){return e(this.red,"redSub works only with red numbers"),this.red.sub(this,i)},o.prototype.redISub=function(i){return e(this.red,"redISub works only with red numbers"),this.red.isub(this,i)},o.prototype.redShl=function(i){return e(this.red,"redShl works only with red numbers"),this.red.shl(this,i)},o.prototype.redMul=function(i){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.mul(this,i)},o.prototype.redIMul=function(i){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.imul(this,i)},o.prototype.redSqr=function(){return e(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return e(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return e(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return e(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return e(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(i){return e(this.red&&!i.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,i)};var kt={k256:null,p224:null,p192:null,p25519:null};function st(g,i){this.name=g,this.p=new o(i,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}st.prototype._tmp=function(){var i=new o(null);return i.words=new Array(Math.ceil(this.n/13)),i},st.prototype.ireduce=function(i){var a=i,u;do this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),u=a.bitLength();while(u>this.n);var c=u0?a.isub(this.p):a.strip!==void 0?a.strip():a._strip(),a},st.prototype.split=function(i,a){i.iushrn(this.n,0,a)},st.prototype.imulK=function(i){return i.imul(this.k)};function yt(){st.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(yt,st),yt.prototype.split=function(i,a){for(var u=4194303,c=Math.min(i.length,9),d=0;d>>22,m=v}m>>>=22,i.words[d-10]=m,m===0&&i.length>10?i.length-=10:i.length-=9},yt.prototype.imulK=function(i){i.words[i.length]=0,i.words[i.length+1]=0,i.length+=2;for(var a=0,u=0;u>>=26,i.words[u]=d,a=c}return a!==0&&(i.words[i.length++]=a),i},o._prime=function(i){if(kt[i])return kt[i];var a;if(i==="k256")a=new yt;else if(i==="p224")a=new At;else if(i==="p192")a=new Et;else if(i==="p25519")a=new be;else throw new Error("Unknown prime "+i);return kt[i]=a,a};function ct(g){if(typeof g=="string"){var i=o._prime(g);this.m=i.p,this.prime=i}else e(g.gtn(1),"modulus must be greater than 1"),this.m=g,this.prime=null}ct.prototype._verify1=function(i){e(i.negative===0,"red works only with positives"),e(i.red,"red works only with red numbers")},ct.prototype._verify2=function(i,a){e((i.negative|a.negative)===0,"red works only with positives"),e(i.red&&i.red===a.red,"red works only with red numbers")},ct.prototype.imod=function(i){return this.prime?this.prime.ireduce(i)._forceRed(this):(_(i,i.umod(this.m)._forceRed(this)),i)},ct.prototype.neg=function(i){return i.isZero()?i.clone():this.m.sub(i)._forceRed(this)},ct.prototype.add=function(i,a){this._verify2(i,a);var u=i.add(a);return u.cmp(this.m)>=0&&u.isub(this.m),u._forceRed(this)},ct.prototype.iadd=function(i,a){this._verify2(i,a);var u=i.iadd(a);return u.cmp(this.m)>=0&&u.isub(this.m),u},ct.prototype.sub=function(i,a){this._verify2(i,a);var u=i.sub(a);return u.cmpn(0)<0&&u.iadd(this.m),u._forceRed(this)},ct.prototype.isub=function(i,a){this._verify2(i,a);var u=i.isub(a);return u.cmpn(0)<0&&u.iadd(this.m),u},ct.prototype.shl=function(i,a){return this._verify1(i),this.imod(i.ushln(a))},ct.prototype.imul=function(i,a){return this._verify2(i,a),this.imod(i.imul(a))},ct.prototype.mul=function(i,a){return this._verify2(i,a),this.imod(i.mul(a))},ct.prototype.isqr=function(i){return this.imul(i,i.clone())},ct.prototype.sqr=function(i){return this.mul(i,i)},ct.prototype.sqrt=function(i){if(i.isZero())return i.clone();var a=this.m.andln(3);if(e(a%2===1),a===3){var u=this.m.add(new o(1)).iushrn(2);return this.pow(i,u)}for(var c=this.m.subn(1),d=0;!c.isZero()&&c.andln(1)===0;)d++,c.iushrn(1);e(!c.isZero());var m=new o(1).toRed(this),v=m.redNeg(),p=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new o(2*s*s).toRed(this);this.pow(s,p).cmp(v)!==0;)s.redIAdd(v);for(var y=this.pow(s,c),R=this.pow(i,c.addn(1).iushrn(1)),U=this.pow(i,c),W=d;U.cmp(m)!==0;){for(var tt=U,at=0;tt.cmp(m)!==0;at++)tt=tt.redSqr();e(at=0;d--){for(var y=a.words[d],R=s-1;R>=0;R--){var U=y>>R&1;if(m!==c[0]&&(m=this.sqr(m)),U===0&&v===0){p=0;continue}v<<=1,v|=U,p++,!(p!==u&&(d!==0||R!==0))&&(m=this.mul(m,c[v]),p=0,v=0)}s=26}return m},ct.prototype.convertTo=function(i){var a=i.umod(this.m);return a===i?a.clone():a},ct.prototype.convertFrom=function(i){var a=i.clone();return a.red=null,a},o.mont=function(i){return new Lt(i)};function Lt(g){ct.call(this,g),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(Lt,ct),Lt.prototype.convertTo=function(i){return this.imod(i.ushln(this.shift))},Lt.prototype.convertFrom=function(i){var a=this.imod(i.mul(this.rinv));return a.red=null,a},Lt.prototype.imul=function(i,a){if(i.isZero()||a.isZero())return i.words[0]=0,i.length=1,i;var u=i.imul(a),c=u.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=u.isub(c).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},Lt.prototype.mul=function(i,a){if(i.isZero()||a.isZero())return new o(0)._forceRed(this);var u=i.mul(a),c=u.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=u.isub(c).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},Lt.prototype.invm=function(i){var a=this.imod(i._invmp(this.m).mul(this.r2));return a._forceRed(this)}})(typeof Gs>"u"||Gs,nu)});var ou=$e(Zs=>{"use strict";var xy=H(V());function Xr(r,t,e){return t<=r&&r<=e}function yo(r){if(r===void 0)return{};if(r===Object(r))return r;throw TypeError("Could not convert argument to dictionary")}function U0(r){for(var t=String(r),e=t.length,n=0,o=[];n57343)o.push(f);else if(56320<=f&&f<=57343)o.push(65533);else if(55296<=f&&f<=56319)if(n===e-1)o.push(65533);else{var h=r.charCodeAt(n+1);if(56320<=h&&h<=57343){var x=f&1023,b=h&1023;o.push(65536+(x<<10)+b),n+=1}else o.push(65533)}n+=1}return o}function O0(r){for(var t="",e=0;e>10)+55296,(n&1023)+56320))}return t}var co=-1;function Ys(r){this.tokens=[].slice.call(r)}Ys.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():co},prepend:function(r){if(Array.isArray(r))for(var t=r;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(r)},push:function(r){if(Array.isArray(r))for(var t=r;t.length;)this.tokens.push(t.shift());else this.tokens.push(r)}};var Qn=-1;function js(r,t){if(r)throw TypeError("Decoder error");return t||65533}var ho="utf-8";function lo(r,t){if(!(this instanceof lo))return new lo(r,t);if(r=r!==void 0?String(r).toLowerCase():ho,r!==ho)throw new Error("Encoding not supported. Only utf-8 is supported");t=yo(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!t.fatal,this._ignoreBOM=!!t.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}lo.prototype={decode:function(t,e){var n;typeof t=="object"&&t instanceof ArrayBuffer?n=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):n=new Uint8Array(0),e=yo(e),this._streaming||(this._decoder=new N0({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!e.stream;for(var o=new Ys(n),f=[],h;!o.endOfStream()&&(h=this._decoder.handler(o,o.read()),h!==Qn);)h!==null&&(Array.isArray(h)?f.push.apply(f,h):f.push(h));if(!this._streaming){do{if(h=this._decoder.handler(o,o.read()),h===Qn)break;h!==null&&(Array.isArray(h)?f.push.apply(f,h):f.push(h))}while(!o.endOfStream());this._decoder=null}return f.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(f[0]===65279?(this._BOMseen=!0,f.shift()):this._BOMseen=!0),O0(f)}};function po(r,t){if(!(this instanceof po))return new po(r,t);if(r=r!==void 0?String(r).toLowerCase():ho,r!==ho)throw new Error("Encoding not supported. Only utf-8 is supported");t=yo(t),this._streaming=!1,this._encoder=null,this._options={fatal:!!t.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}po.prototype={encode:function(t,e){t=t?String(t):"",e=yo(e),this._streaming||(this._encoder=new z0(this._options)),this._streaming=!!e.stream;for(var n=[],o=new Ys(U0(t)),f;!o.endOfStream()&&(f=this._encoder.handler(o,o.read()),f!==Qn);)Array.isArray(f)?n.push.apply(n,f):n.push(f);if(!this._streaming){for(;f=this._encoder.handler(o,o.read()),f!==Qn;)Array.isArray(f)?n.push.apply(n,f):n.push(f);this._encoder=null}return new Uint8Array(n)}};function N0(r){var t=r.fatal,e=0,n=0,o=0,f=128,h=191;this.handler=function(x,b){if(b===co&&o!==0)return o=0,js(t);if(b===co)return Qn;if(o===0){if(Xr(b,0,127))return b;if(Xr(b,194,223))o=1,e=b-192;else if(Xr(b,224,239))b===224&&(f=160),b===237&&(h=159),o=2,e=b-224;else if(Xr(b,240,244))b===240&&(f=144),b===244&&(h=143),o=3,e=b-240;else return js(t);return e=e<<6*o,null}if(!Xr(b,f,h))return e=o=n=0,f=128,h=191,x.prepend(b),js(t);if(f=128,h=191,n+=1,e+=b-128<<6*(o-n),n!==o)return null;var _=e;return e=o=n=0,_}}function z0(r){var t=r.fatal;this.handler=function(e,n){if(n===co)return Qn;if(Xr(n,0,127))return n;var o,f;Xr(n,128,2047)?(o=1,f=192):Xr(n,2048,65535)?(o=2,f=224):Xr(n,65536,1114111)&&(o=3,f=240);for(var h=[(n>>6*o)+f];o>0;){var x=n>>6*(o-1);h.push(128|x&63),o-=1}return h}}Zs.TextEncoder=po;Zs.TextDecoder=lo});var cu=$e(Te=>{"use strict";var ky=H(V()),K0=Te&&Te.__createBinding||(Object.create?function(r,t,e,n){n===void 0&&(n=e),Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[e]}})}:function(r,t,e,n){n===void 0&&(n=e),r[n]=t[e]}),q0=Te&&Te.__setModuleDefault||(Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t}),Dr=Te&&Te.__decorate||function(r,t,e,n){var o=arguments.length,f=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(r,t,e,n);else for(var x=r.length-1;x>=0;x--)(h=r[x])&&(f=(o<3?h(f):o>3?h(t,e,f):h(t,e))||f);return o>3&&f&&Object.defineProperty(t,e,f),f},F0=Te&&Te.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var e in r)e!=="default"&&Object.hasOwnProperty.call(r,e)&&K0(t,r,e);return q0(t,r),t},su=Te&&Te.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Te,"__esModule",{value:!0});Te.deserializeUnchecked=Te.deserialize=Te.serialize=Te.BinaryReader=Te.BinaryWriter=Te.BorshError=Te.baseDecode=Te.baseEncode=void 0;var mn=su(iu()),au=su(Hs()),D0=F0(ou()),W0=typeof TextDecoder!="function"?D0.TextDecoder:TextDecoder,H0=new W0("utf-8",{fatal:!0});function $0(r){return typeof r=="string"&&(r=Buffer.from(r,"utf8")),au.default.encode(Buffer.from(r))}Te.baseEncode=$0;function V0(r){return Buffer.from(au.default.decode(r))}Te.baseDecode=V0;var Xs=1024,Qe=class extends Error{constructor(t){super(t),this.fieldPath=[],this.originalMessage=t}addToFieldPath(t){this.fieldPath.splice(0,0,t),this.message=this.originalMessage+": "+this.fieldPath.join(".")}};Te.BorshError=Qe;var go=class{constructor(){this.buf=Buffer.alloc(Xs),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(Xs)]))}writeU8(t){this.maybeResize(),this.buf.writeUInt8(t,this.length),this.length+=1}writeU16(t){this.maybeResize(),this.buf.writeUInt16LE(t,this.length),this.length+=2}writeU32(t){this.maybeResize(),this.buf.writeUInt32LE(t,this.length),this.length+=4}writeU64(t){this.maybeResize(),this.writeBuffer(Buffer.from(new mn.default(t).toArray("le",8)))}writeU128(t){this.maybeResize(),this.writeBuffer(Buffer.from(new mn.default(t).toArray("le",16)))}writeU256(t){this.maybeResize(),this.writeBuffer(Buffer.from(new mn.default(t).toArray("le",32)))}writeU512(t){this.maybeResize(),this.writeBuffer(Buffer.from(new mn.default(t).toArray("le",64)))}writeBuffer(t){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),t,Buffer.alloc(Xs)]),this.length+=t.length}writeString(t){this.maybeResize();let e=Buffer.from(t,"utf8");this.writeU32(e.length),this.writeBuffer(e)}writeFixedArray(t){this.writeBuffer(Buffer.from(t))}writeArray(t,e){this.maybeResize(),this.writeU32(t.length);for(let n of t)this.maybeResize(),e(n)}toArray(){return this.buf.subarray(0,this.length)}};Te.BinaryWriter=go;function Wr(r,t,e){let n=e.value;e.value=function(...o){try{return n.apply(this,o)}catch(f){if(f instanceof RangeError){let h=f.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(h)>=0)throw new Qe("Reached the end of buffer when deserializing")}throw f}}}var lr=class{constructor(t){this.buf=t,this.offset=0}readU8(){let t=this.buf.readUInt8(this.offset);return this.offset+=1,t}readU16(){let t=this.buf.readUInt16LE(this.offset);return this.offset+=2,t}readU32(){let t=this.buf.readUInt32LE(this.offset);return this.offset+=4,t}readU64(){let t=this.readBuffer(8);return new mn.default(t,"le")}readU128(){let t=this.readBuffer(16);return new mn.default(t,"le")}readU256(){let t=this.readBuffer(32);return new mn.default(t,"le")}readU512(){let t=this.readBuffer(64);return new mn.default(t,"le")}readBuffer(t){if(this.offset+t>this.buf.length)throw new Qe(`Expected buffer length ${t} isn\'t within bounds`);let e=this.buf.slice(this.offset,this.offset+t);return this.offset+=t,e}readString(){let t=this.readU32(),e=this.readBuffer(t);try{return H0.decode(e)}catch(n){throw new Qe(`Error decoding UTF-8 string: ${n}`)}}readFixedArray(t){return new Uint8Array(this.readBuffer(t))}readArray(t){let e=this.readU32(),n=Array();for(let o=0;o{Nn(r,t,f,n[0],o)});else if(n.kind!==void 0)switch(n.kind){case"option":{e==null?o.writeU8(0):(o.writeU8(1),Nn(r,t,e,n.type,o));break}case"map":{o.writeU32(e.size),e.forEach((f,h)=>{Nn(r,t,h,n.key,o),Nn(r,t,f,n.value,o)});break}default:throw new Qe(`FieldType ${n} unrecognized`)}else uu(r,e,o)}catch(f){throw f instanceof Qe&&f.addToFieldPath(t),f}}function uu(r,t,e){if(typeof t.borshSerialize=="function"){t.borshSerialize(e);return}let n=r.get(t.constructor);if(!n)throw new Qe(`Class ${t.constructor.name} is missing in schema`);if(n.kind==="struct")n.fields.map(([o,f])=>{Nn(r,o,t[o],f,e)});else if(n.kind==="enum"){let o=t[n.field];for(let f=0;fzn(r,t,e[0],n))}if(e.kind==="option")return n.readU8()?zn(r,t,e.type,n):void 0;if(e.kind==="map"){let o=new Map,f=n.readU32();for(let h=0;h=n.values.length)throw new Qe(`Enum index: ${o} is out of range`);let[f,h]=n.values[o],x=zn(r,f,h,e);return new t({[f]:x})}throw new Qe(`Unexpected schema kind: ${n.kind} for ${t.constructor.name}`)}function j0(r,t,e,n=lr){let o=new n(e),f=Js(r,t,o);if(o.offset{"use strict";var By=H(V());Object.defineProperty(K,"__esModule",{value:!0});K.s16=K.s8=K.nu64be=K.u48be=K.u40be=K.u32be=K.u24be=K.u16be=K.nu64=K.u48=K.u40=K.u32=K.u24=K.u16=K.u8=K.offset=K.greedy=K.Constant=K.UTF8=K.CString=K.Blob=K.Boolean=K.BitField=K.BitStructure=K.VariantLayout=K.Union=K.UnionLayoutDiscriminator=K.UnionDiscriminator=K.Structure=K.Sequence=K.DoubleBE=K.Double=K.FloatBE=K.Float=K.NearInt64BE=K.NearInt64=K.NearUInt64BE=K.NearUInt64=K.IntBE=K.Int=K.UIntBE=K.UInt=K.OffsetLayout=K.GreedyCount=K.ExternalLayout=K.bindConstructorLayout=K.nameWithProperty=K.Layout=K.uint8ArrayToBuffer=K.checkUint8Array=void 0;K.constant=K.utf8=K.cstr=K.blob=K.unionLayoutDiscriminator=K.union=K.seq=K.bits=K.struct=K.f64be=K.f64=K.f32be=K.f32=K.ns64be=K.s48be=K.s40be=K.s32be=K.s24be=K.s16be=K.ns64=K.s48=K.s40=K.s32=K.s24=void 0;var ta=An();function ri(r){if(!(r instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}K.checkUint8Array=ri;function Ae(r){return ri(r),ta.Buffer.from(r.buffer,r.byteOffset,r.length)}K.uint8ArrayToBuffer=Ae;var Ie=class{constructor(t,e){if(!Number.isInteger(t))throw new TypeError("span must be an integer");this.span=t,this.property=e}makeDestinationObject(){return{}}getSpan(t,e){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(t){let e=Object.create(this.constructor.prototype);return Object.assign(e,this),e.property=t,e}fromArray(t){}};K.Layout=Ie;function ea(r,t){return t.property?r+"["+t.property+"]":r}K.nameWithProperty=ea;function Z0(r,t){if(typeof r!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(r,"layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof Ie))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(t,"boundConstructor_"))throw new Error("layout is already bound to a constructor");r.layout_=t,t.boundConstructor_=r,t.makeDestinationObject=()=>new r,Object.defineProperty(r.prototype,"encode",{value(e,n){return t.encode(this,e,n)},writable:!0}),Object.defineProperty(r,"decode",{value(e,n){return t.decode(e,n)},writable:!0})}K.bindConstructorLayout=Z0;var ir=class extends Ie{isCount(){throw new Error("ExternalLayout is abstract")}};K.ExternalLayout=ir;var mo=class extends ir{constructor(t=1,e){if(!Number.isInteger(t)||0>=t)throw new TypeError("elementSpan must be a (positive) integer");super(-1,e),this.elementSpan=t}isCount(){return!0}decode(t,e=0){ri(t);let n=t.length-e;return Math.floor(n/this.elementSpan)}encode(t,e,n){return 0}};K.GreedyCount=mo;var xi=class extends ir{constructor(t,e=0,n){if(!(t instanceof Ie))throw new TypeError("layout must be a Layout");if(!Number.isInteger(e))throw new TypeError("offset must be integer or undefined");super(t.span,n||t.property),this.layout=t,this.offset=e}isCount(){return this.layout instanceof mr||this.layout instanceof vr}decode(t,e=0){return this.layout.decode(t,e+this.offset)}encode(t,e,n=0){return this.layout.encode(t,e,n+this.offset)}};K.OffsetLayout=xi;var mr=class extends Ie{constructor(t,e){if(super(t,e),6h+o.encode(x,e,n+h),0);return this.count instanceof ir&&this.count.encode(t.length,e,n),f}};K.Sequence=_o;var Ao=class extends Ie{constructor(t,e,n){if(!(Array.isArray(t)&&t.reduce((f,h)=>f&&h instanceof Ie,!0)))throw new TypeError("fields must be array of Layout instances");typeof e=="boolean"&&n===void 0&&(n=e,e=void 0);for(let f of t)if(0>f.span&&f.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let o=-1;try{o=t.reduce((f,h)=>f+h.getSpan(),0)}catch{}super(o,e),this.fields=t,this.decodePrefixes=!!n}getSpan(t,e=0){if(0<=this.span)return this.span;let n=0;try{n=this.fields.reduce((o,f)=>{let h=f.getSpan(t,e);return e+=h,o+h},0)}catch{throw new RangeError("indeterminate span")}return n}decode(t,e=0){ri(t);let n=this.makeDestinationObject();for(let o of this.fields)if(o.property!==void 0&&(n[o.property]=o.decode(t,e)),e+=o.getSpan(t,e),this.decodePrefixes&&t.length===e)break;return n}encode(t,e,n=0){let o=n,f=0,h=0;for(let x of this.fields){let b=x.span;if(h=0b&&(b=x.getSpan(e,n)))}f=n,n+=b}return f+h-o}fromArray(t){let e=this.makeDestinationObject();for(let n of this.fields)n.property!==void 0&&0n.span?e=-1:0<=e&&(e+=n.span)}}};K.Structure=Ao;var vi=class{constructor(t){this.property=t}decode(t,e){throw new Error("UnionDiscriminator is abstract")}encode(t,e,n){throw new Error("UnionDiscriminator is abstract")}};K.UnionDiscriminator=vi;var ei=class extends vi{constructor(t,e){if(!(t instanceof ir&&t.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(e||t.property||"variant"),this.layout=t}decode(t,e){return this.layout.decode(t,e)}encode(t,e,n){return this.layout.encode(t,e,n)}};K.UnionLayoutDiscriminator=ei;var ki=class extends Ie{constructor(t,e,n){let o;if(t instanceof mr||t instanceof vr)o=new ei(new xi(t));else if(t instanceof ir&&t.isCount())o=new ei(t);else if(t instanceof vi)o=t;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(e===void 0&&(e=null),!(e===null||e instanceof Ie))throw new TypeError("defaultLayout must be null or a Layout");if(e!==null){if(0>e.span)throw new Error("defaultLayout must have constant span");e.property===void 0&&(e=e.replicate("content"))}let f=-1;e&&(f=e.span,0<=f&&(t instanceof mr||t instanceof vr)&&(f+=o.layout.span)),super(f,n),this.discriminator=o,this.usesPrefixDiscriminator=t instanceof mr||t instanceof vr,this.defaultLayout=e,this.registry={};let h=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(x){return h(x)},this.configGetSourceVariant=function(x){h=x.bind(this)}}getSpan(t,e=0){if(0<=this.span)return this.span;let n=this.getVariant(t,e);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(t,e)}defaultGetSourceVariant(t){if(Object.prototype.hasOwnProperty.call(t,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(t,this.defaultLayout.property))return;let e=this.registry[t[this.discriminator.property]];if(e&&(!e.layout||e.property&&Object.prototype.hasOwnProperty.call(t,e.property)))return e}else for(let e in this.registry){let n=this.registry[e];if(n.property&&Object.prototype.hasOwnProperty.call(t,n.property))return n}throw new Error("unable to infer src variant")}decode(t,e=0){let n,o=this.discriminator,f=o.decode(t,e),h=this.registry[f];if(h===void 0){let x=this.defaultLayout,b=0;this.usesPrefixDiscriminator&&(b=o.layout.span),n=this.makeDestinationObject(),n[o.property]=f,n[x.property]=x.decode(t,e+b)}else n=h.decode(t,e);return n}encode(t,e,n=0){let o=this.getSourceVariant(t);if(o===void 0){let f=this.discriminator,h=this.defaultLayout,x=0;return this.usesPrefixDiscriminator&&(x=f.layout.span),f.encode(t[f.property],e,n),x+h.encode(t[h.property],e,n+x)}return o.encode(t,e,n)}addVariant(t,e,n){let o=new Mo(this,t,e,n);return this.registry[t]=o,o}getVariant(t,e=0){let n;return t instanceof Uint8Array?n=this.discriminator.decode(t,e):n=t,this.registry[n]}};K.Union=ki;var Mo=class extends Ie{constructor(t,e,n,o){if(!(t instanceof ki))throw new TypeError("union must be a Union");if(!Number.isInteger(e)||0>e)throw new TypeError("variant must be a (non-negative) integer");if(typeof n=="string"&&o===void 0&&(o=n,n=null),n){if(!(n instanceof Ie))throw new TypeError("layout must be a Layout");if(t.defaultLayout!==null&&0<=n.span&&n.span>t.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof o!="string")throw new TypeError("variant must have a String property")}let f=t.span;0>t.span&&(f=n?n.span:0,0<=f&&t.usesPrefixDiscriminator&&(f+=t.discriminator.layout.span)),super(f,o),this.union=t,this.variant=e,this.layout=n||null}getSpan(t,e=0){if(0<=this.span)return this.span;let n=0;this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span);let o=0;return this.layout&&(o=this.layout.getSpan(t,e+n)),n+o}decode(t,e=0){let n=this.makeDestinationObject();if(this!==this.union.getVariant(t,e))throw new Error("variant mismatch");let o=0;return this.union.usesPrefixDiscriminator&&(o=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(t,e+o):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}encode(t,e,n=0){let o=0;if(this.union.usesPrefixDiscriminator&&(o=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(t,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,e,n);let f=o;if(this.layout&&(this.layout.encode(t[this.property],e,n+o),f+=this.layout.getSpan(e,n+o),0<=this.union.span&&f>this.union.span))throw new Error("encoded variant overruns containing union");return f}fromArray(t){if(this.layout)return this.layout.fromArray(t)}};K.VariantLayout=Mo;function ti(r){return 0>r&&(r+=4294967296),r}var Si=class extends Ie{constructor(t,e,n){if(!(t instanceof mr||t instanceof vr))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof e=="string"&&n===void 0&&(n=e,e=!1),4=e)throw new TypeError("bits must be positive integer");let o=8*t.span,f=t.fields.reduce((h,x)=>h+x.bits,0);if(e+f>o)throw new Error("bits too long for span remainder ("+(o-f)+" of "+o+" remain)");this.container=t,this.bits=e,this.valueMask=(1<>>this.start}encode(t){if(typeof t!="number"||!Number.isInteger(t)||t!==ti(t&this.valueMask))throw new TypeError(ea("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let e=this.container._packedGetValue(),n=ti(t<n&&(n=this.length.decode(t,e)),n}decode(t,e=0){let n=this.span;return 0>n&&(n=this.length.decode(t,e)),Ae(t).slice(e,e+n)}encode(t,e,n){let o=this.length;if(this.length instanceof ir&&(o=t.length),!(t instanceof Uint8Array&&o===t.length))throw new TypeError(ea("Blob.encode",this)+" requires (length "+o+") Uint8Array as src");if(n+o>e.length)throw new RangeError("encoding overruns Uint8Array");let f=Ae(t);return Ae(e).write(f.toString("hex"),n,o,"hex"),this.length instanceof ir&&this.length.encode(o,e,n),o}};K.Blob=Lo;var Ro=class extends Ie{constructor(t){super(-1,t)}getSpan(t,e=0){ri(t);let n=e;for(;ne.length)throw new RangeError("encoding overruns Buffer");let h=Ae(e);return o.copy(h,n),h[n+f]=0,f+1}};K.CString=Ro;var To=class extends Ie{constructor(t,e){if(typeof t=="string"&&e===void 0&&(e=t,t=void 0),t===void 0)t=-1;else if(!Number.isInteger(t))throw new TypeError("maxSpan must be an integer");super(-1,e),this.maxSpan=t}getSpan(t,e=0){return ri(t),t.length-e}decode(t,e=0){let n=this.getSpan(t,e);if(0<=this.maxSpan&&this.maxSpane.length)throw new RangeError("encoding overruns Buffer");return o.copy(Ae(e),n),f}};K.UTF8=To;var Po=class extends Ie{constructor(t,e){super(0,e),this.value=t}decode(t,e){return this.value}encode(t,e,n){return 0}};K.Constant=Po;K.greedy=(r,t)=>new mo(r,t);K.offset=(r,t,e)=>new xi(r,t,e);K.u8=r=>new mr(1,r);K.u16=r=>new mr(2,r);K.u24=r=>new mr(3,r);K.u32=r=>new mr(4,r);K.u40=r=>new mr(5,r);K.u48=r=>new mr(6,r);K.nu64=r=>new wo(r);K.u16be=r=>new vr(2,r);K.u24be=r=>new vr(3,r);K.u32be=r=>new vr(4,r);K.u40be=r=>new vr(5,r);K.u48be=r=>new vr(6,r);K.nu64be=r=>new bo(r);K.s8=r=>new Jr(1,r);K.s16=r=>new Jr(2,r);K.s24=r=>new Jr(3,r);K.s32=r=>new Jr(4,r);K.s40=r=>new Jr(5,r);K.s48=r=>new Jr(6,r);K.ns64=r=>new xo(r);K.s16be=r=>new wn(2,r);K.s24be=r=>new wn(3,r);K.s32be=r=>new wn(4,r);K.s40be=r=>new wn(5,r);K.s48be=r=>new wn(6,r);K.ns64be=r=>new vo(r);K.f32=r=>new ko(r);K.f32be=r=>new So(r);K.f64=r=>new Bo(r);K.f64be=r=>new Eo(r);K.struct=(r,t,e)=>new Ao(r,t,e);K.bits=(r,t,e)=>new Si(r,t,e);K.seq=(r,t,e)=>new _o(r,t,e);K.union=(r,t,e)=>new ki(r,t,e);K.unionLayoutDiscriminator=(r,t)=>new ei(r,t);K.blob=(r,t)=>new Lo(r,t);K.cstr=r=>new Ro(r);K.utf8=(r,t)=>new To(r,t);K.constant=(r,t)=>new Po(r,t)});var hu=$e(ni=>{"use strict";var _y=H(V());Object.defineProperty(ni,"__esModule",{value:!0});var Oo;function X0(r){{let t=Buffer.from(r);t.reverse();let e=t.toString("hex");return e.length===0?BigInt(0):BigInt(`0x${e}`)}return Oo.toBigInt(r,!1)}ni.toBigIntLE=X0;function J0(r){{let t=r.toString("hex");return t.length===0?BigInt(0):BigInt(`0x${t}`)}return Oo.toBigInt(r,!0)}ni.toBigIntBE=J0;function Q0(r,t){{let e=r.toString(16),n=Buffer.from(e.padStart(t*2,"0").slice(0,t*2),"hex");return n.reverse(),n}return Oo.fromBigInt(r,Buffer.allocUnsafe(t),!1)}ni.toBufferLE=Q0;function tl(r,t){{let e=r.toString(16);return Buffer.from(e.padStart(t*2,"0").slice(0,t*2),"hex")}return Oo.fromBigInt(r,Buffer.allocUnsafe(t),!0)}ni.toBufferBE=tl});function el(r){return Ei(r)&&typeof r[Symbol.iterator]=="function"}function Ei(r){return typeof r=="object"&&r!=null}function No(r){return Ei(r)&&!Array.isArray(r)}function Pr(r){return typeof r=="symbol"?r.toString():typeof r=="string"?JSON.stringify(r):`${r}`}function rl(r){let{done:t,value:e}=r.next();return t?void 0:e}function nl(r,t,e,n){if(r===!0)return;r===!1?r={}:typeof r=="string"&&(r={message:r});let{path:o,branch:f}=t,{type:h}=e,{refinement:x,message:b=`Expected a value of type \\`${h}\\`${x?` with refinement \\`${x}\\``:""}, but received: \\`${Pr(n)}\\``}=r;return{value:n,type:h,refinement:x,key:o[o.length-1],path:o,branch:f,...r,message:b}}function*lu(r,t,e,n){el(r)||(r=[r]);for(let o of r){let f=nl(o,t,e,n);f&&(yield f)}}function*ia(r,t,e={}){let{path:n=[],branch:o=[r],coerce:f=!1,mask:h=!1}=e,x={path:n,branch:o,mask:h};f&&(r=t.coercer(r,x));let b="valid";for(let _ of t.validator(r,x))_.explanation=e.message,b="not_valid",yield[_,void 0];for(let[_,E,L]of t.entries(r,x)){let O=ia(E,L,{path:_===void 0?n:[...n,_],branch:_===void 0?o:[...o,E],coerce:f,mask:h,message:e.message});for(let P of O)P[0]?(b=P[0].refinement!=null?"not_refined":"not_valid",yield[P[0],void 0]):f&&(E=P[1],_===void 0?r=E:r instanceof Map?r.set(_,E):r instanceof Set?r.add(E):Ei(r)&&(E!==void 0||_ in r)&&(r[_]=E))}if(b!=="not_valid")for(let _ of t.refiner(r,x))_.explanation=e.message,b="not_refined",yield[_,void 0];b==="valid"&&(yield[void 0,r])}function du(r,t,e){let n=_i(r,t,{message:e});if(n[0])throw n[0]}function ii(r,t,e){let n=_i(r,t,{coerce:!0,message:e});if(n[0])throw n[0];return n[1]}function il(r,t,e){let n=_i(r,t,{coerce:!0,mask:!0,message:e});if(n[0])throw n[0];return n[1]}function pu(r,t){return!_i(r,t)[0]}function _i(r,t,e={}){let n=ia(r,t,e),o=rl(n);return o[0]?[new na(o[0],function*(){for(let h of n)h[0]&&(yield h[0])}),void 0]:[void 0,o[1]]}function Kn(r,t){return new Er({type:r,schema:null,validator:t})}function yu(){return Kn("any",()=>!0)}function xt(r){return new Er({type:"array",schema:r,*entries(t){if(r&&Array.isArray(t))for(let[e,n]of t.entries())yield[e,n,r]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${Pr(t)}`}})}function Cr(){return Kn("boolean",r=>typeof r=="boolean")}function zo(r){return Kn("instance",t=>t instanceof r||`Expected a \\`${r.name}\\` instance, but received: ${Pr(t)}`)}function ze(r){let t=Pr(r),e=typeof r;return new Er({type:"literal",schema:e==="string"||e==="number"||e==="boolean"?r:null,validator(n){return n===r||`Expected the literal \\`${t}\\`, but received: ${Pr(n)}`}})}function ol(){return Kn("never",()=>!1)}function vt(r){return new Er({...r,validator:(t,e)=>t===null||r.validator(t,e),refiner:(t,e)=>t===null||r.refiner(t,e)})}function z(){return Kn("number",r=>typeof r=="number"&&!isNaN(r)||`Expected a number, but received: ${Pr(r)}`)}function Nt(r){return new Er({...r,validator:(t,e)=>t===void 0||r.validator(t,e),refiner:(t,e)=>t===void 0||r.refiner(t,e)})}function oa(r,t){return new Er({type:"record",schema:null,*entries(e){if(Ei(e))for(let n in e){let o=e[n];yield[n,n,r],yield[n,o,t]}},validator(e){return No(e)||`Expected an object, but received: ${Pr(e)}`},coercer(e){return No(e)?{...e}:e}})}function ft(){return Kn("string",r=>typeof r=="string"||`Expected a string, but received: ${Pr(r)}`)}function Ko(r){let t=ol();return new Er({type:"tuple",schema:null,*entries(e){if(Array.isArray(e)){let n=Math.max(r.length,e.length);for(let o=0;oe.type).join(" | ");return new Er({type:"union",schema:null,coercer(e,n){for(let o of r){let[f,h]=o.validate(e,{coerce:!0,mask:n.mask});if(!f)return h}return e},validator(e,n){let o=[];for(let f of r){let[...h]=ia(e,f,n),[x]=h;if(x[0])for(let[b]of h)b&&o.push(b);else return[]}return[`Expected the value to satisfy a union of \\`${t}\\`, but received: ${Pr(e)}`,...o]}})}function qn(){return Kn("unknown",()=>!0)}function oi(r,t,e){return new Er({...r,coercer:(n,o)=>pu(n,t)?r.coercer(e(n,o),o):r.coercer(n,o)})}var My,na,Er,gu=ae(()=>{My=H(V(),1),na=class extends TypeError{constructor(t,e){let n,{message:o,explanation:f,...h}=t,{path:x}=t,b=x.length===0?o:`At path: ${x.join(".")} -- ${o}`;super(f??b),f!=null&&(this.cause=b),Object.assign(this,h),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...e()])}};Er=class{constructor(t){let{type:e,schema:n,validator:o,refiner:f,coercer:h=b=>b,entries:x=function*(){}}=t;this.type=e,this.schema=n,this.entries=x,this.coercer=h,o?this.validator=(b,_)=>{let E=o(b,_);return lu(E,_,this,b)}:this.validator=()=>[],f?this.refiner=(b,_)=>{let E=f(b,_);return lu(E,_,this,b)}:this.refiner=()=>[]}assert(t,e){return du(t,this,e)}create(t,e){return ii(t,this,e)}is(t){return pu(t,this)}mask(t,e){return il(t,this,e)}validate(t,e={}){return _i(t,this,e)}}});function Ai(){if(!qo&&(qo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!qo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qo(sl)}var Ly,qo,sl,sa=ae(()=>{Ly=H(V()),sl=new Uint8Array(16)});var Ty,mu,wu=ae(()=>{Ty=H(V()),mu=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i});function al(r){return typeof r=="string"&&mu.test(r)}var Uy,bn,Mi=ae(()=>{Uy=H(V());wu();bn=al});function fl(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=(tr[r[t+0]]+tr[r[t+1]]+tr[r[t+2]]+tr[r[t+3]]+"-"+tr[r[t+4]]+tr[r[t+5]]+"-"+tr[r[t+6]]+tr[r[t+7]]+"-"+tr[r[t+8]]+tr[r[t+9]]+"-"+tr[r[t+10]]+tr[r[t+11]]+tr[r[t+12]]+tr[r[t+13]]+tr[r[t+14]]+tr[r[t+15]]).toLowerCase();if(!bn(e))throw TypeError("Stringified UUID is invalid");return e}var zy,tr,Fo,xn,Ii=ae(()=>{zy=H(V());Mi();tr=[];for(Fo=0;Fo<256;++Fo)tr.push((Fo+256).toString(16).substr(1));xn=fl});function ul(r,t,e){var n=t&&e||0,o=t||new Array(16);r=r||{};var f=r.node||bu,h=r.clockseq!==void 0?r.clockseq:aa;if(f==null||h==null){var x=r.random||(r.rng||Ai)();f==null&&(f=bu=[x[0]|1,x[1],x[2],x[3],x[4],x[5]]),h==null&&(h=aa=(x[6]<<8|x[7])&16383)}var b=r.msecs!==void 0?r.msecs:Date.now(),_=r.nsecs!==void 0?r.nsecs:ua+1,E=b-fa+(_-ua)/1e4;if(E<0&&r.clockseq===void 0&&(h=h+1&16383),(E<0||b>fa)&&r.nsecs===void 0&&(_=0),_>=1e4)throw new Error("uuid.v1(): Can\'t create more than 10M uuids/sec");fa=b,ua=_,aa=h,b+=122192928e5;var L=((b&268435455)*1e4+_)%4294967296;o[n++]=L>>>24&255,o[n++]=L>>>16&255,o[n++]=L>>>8&255,o[n++]=L&255;var O=b/4294967296*1e4&268435455;o[n++]=O>>>8&255,o[n++]=O&255,o[n++]=O>>>24&15|16,o[n++]=O>>>16&255,o[n++]=h>>>8|128,o[n++]=h&255;for(var P=0;P<6;++P)o[n+P]=f[P];return t||xn(o)}var Dy,bu,aa,fa,ua,xu,vu=ae(()=>{Dy=H(V());sa();Ii();fa=0,ua=0;xu=ul});function cl(r){if(!bn(r))throw TypeError("Invalid UUID");var t,e=new Uint8Array(16);return e[0]=(t=parseInt(r.slice(0,8),16))>>>24,e[1]=t>>>16&255,e[2]=t>>>8&255,e[3]=t&255,e[4]=(t=parseInt(r.slice(9,13),16))>>>8,e[5]=t&255,e[6]=(t=parseInt(r.slice(14,18),16))>>>8,e[7]=t&255,e[8]=(t=parseInt(r.slice(19,23),16))>>>8,e[9]=t&255,e[10]=(t=parseInt(r.slice(24,36),16))/1099511627776&255,e[11]=t/4294967296&255,e[12]=t>>>24&255,e[13]=t>>>16&255,e[14]=t>>>8&255,e[15]=t&255,e}var $y,Do,ca=ae(()=>{$y=H(V());Mi();Do=cl});function hl(r){r=unescape(encodeURIComponent(r));for(var t=[],e=0;e{Yy=H(V());Ii();ca();ll="6ba7b810-9dad-11d1-80b4-00c04fd430c8",dl="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function pl(r){if(typeof r=="string"){var t=unescape(encodeURIComponent(r));r=new Uint8Array(t.length);for(var e=0;e>5]>>>o%32&255,h=parseInt(n.charAt(f>>>4&15)+n.charAt(f&15),16);t.push(h)}return t}function ku(r){return(r+64>>>9<<4)+14+1}function gl(r,t){r[t>>5]|=128<>5]|=(r[n/8]&255)<>16)+(t>>16)+(e>>16);return n<<16|e&65535}function wl(r,t){return r<>>32-t}function Ho(r,t,e,n,o,f){return vn(wl(vn(vn(t,r),vn(n,f)),o),e)}function sr(r,t,e,n,o,f,h){return Ho(t&e|~t&n,r,t,o,f,h)}function ar(r,t,e,n,o,f,h){return Ho(t&n|e&~n,r,t,o,f,h)}function fr(r,t,e,n,o,f,h){return Ho(t^e^n,r,t,o,f,h)}function ur(r,t,e,n,o,f,h){return Ho(e^(t|~n),r,t,o,f,h)}var Xy,Su,Bu=ae(()=>{Xy=H(V());Su=pl});var e1,bl,Eu,_u=ae(()=>{e1=H(V());ha();Bu();bl=Wo("v3",48,Su),Eu=bl});function xl(r,t,e){r=r||{};var n=r.random||(r.rng||Ai)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){e=e||0;for(var o=0;o<16;++o)t[e+o]=n[o];return t}return xn(n)}var o1,Au,Mu=ae(()=>{o1=H(V());sa();Ii();Au=xl});function vl(r,t,e,n){switch(r){case 0:return t&e^~t&n;case 1:return t^e^n;case 2:return t&e^t&n^e&n;case 3:return t^e^n}}function la(r,t){return r<>>32-t}function kl(r){var t=[1518500249,1859775393,2400959708,3395469782],e=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof r=="string"){var n=unescape(encodeURIComponent(r));r=[];for(var o=0;o>>0;j=ot,ot=X,X=la(C,30)>>>0,C=D,D=st}e[0]=e[0]+D>>>0,e[1]=e[1]+C>>>0,e[2]=e[2]+X>>>0,e[3]=e[3]+ot>>>0,e[4]=e[4]+j>>>0}return[e[0]>>24&255,e[0]>>16&255,e[0]>>8&255,e[0]&255,e[1]>>24&255,e[1]>>16&255,e[1]>>8&255,e[1]&255,e[2]>>24&255,e[2]>>16&255,e[2]>>8&255,e[2]&255,e[3]>>24&255,e[3]>>16&255,e[3]>>8&255,e[3]&255,e[4]>>24&255,e[4]>>16&255,e[4]>>8&255,e[4]&255]}var a1,Iu,Lu=ae(()=>{a1=H(V());Iu=kl});var h1,Sl,Ru,Tu=ae(()=>{h1=H(V());ha();Lu();Sl=Wo("v5",80,Iu),Ru=Sl});var d1,Pu,Cu=ae(()=>{d1=H(V()),Pu="00000000-0000-0000-0000-000000000000"});function Bl(r){if(!bn(r))throw TypeError("Invalid UUID");return parseInt(r.substr(14,1),16)}var g1,Uu,Ou=ae(()=>{g1=H(V());Mi();Uu=Bl});var da={};Wa(da,{NIL:()=>Pu,parse:()=>Do,stringify:()=>xn,v1:()=>xu,v3:()=>Eu,v4:()=>Au,v5:()=>Ru,validate:()=>bn,version:()=>Uu});var m1,pa=ae(()=>{m1=H(V());vu();_u();Mu();Tu();Cu();Ou();Mi();Ii();ca()});var zu=$e((A1,Nu)=>{"use strict";var M1=H(V()),El=(pa(),$a(da)).v4,_l=function(r,t,e,n){if(typeof r!="string")throw new TypeError(r+" must be a string");n=n||{};let o=typeof n.version=="number"?n.version:2;if(o!==1&&o!==2)throw new TypeError(o+" must be 1 or 2");let f={method:r};if(o===2&&(f.jsonrpc="2.0"),t){if(typeof t!="object"&&!Array.isArray(t))throw new TypeError(t+" must be an object, array or omitted");f.params=t}if(typeof e>"u"){let h=typeof n.generator=="function"?n.generator:function(){return El()};f.id=h(f,n)}else o===2&&e===null?n.notificationIdNull&&(f.id=null):f.id=e;return f};Nu.exports=_l});var qu=$e((I1,Ku)=>{"use strict";var L1=H(V()),Al=(pa(),$a(da)).v4,Ml=zu(),Li=function(r,t){if(!(this instanceof Li))return new Li(r,t);t||(t={}),this.options={reviver:typeof t.reviver<"u"?t.reviver:null,replacer:typeof t.replacer<"u"?t.replacer:null,generator:typeof t.generator<"u"?t.generator:function(){return Al()},version:typeof t.version<"u"?t.version:2,notificationIdNull:typeof t.notificationIdNull=="boolean"?t.notificationIdNull:!1},this.callServer=r};Ku.exports=Li;Li.prototype.request=function(r,t,e,n){let o=this,f=null,h=Array.isArray(r)&&typeof t=="function";if(this.options.version===1&&h)throw new TypeError("JSON-RPC 1.0 does not support batching");if(h||!h&&r&&typeof r=="object"&&typeof t=="function")n=t,f=r;else{typeof e=="function"&&(n=e,e=void 0);let _=typeof n=="function";try{f=Ml(r,t,e,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(E){if(_)return n(E);throw E}if(!_)return f}let b;try{b=JSON.stringify(f,this.options.replacer)}catch(_){return n(_)}return this.callServer(b,function(_,E){o._parseResponse(_,E,n)}),f};Li.prototype._parseResponse=function(r,t,e){if(r){e(r);return}if(!t)return e();let n;try{n=JSON.parse(t,this.options.reviver)}catch(o){return e(o)}if(e.length===3)if(Array.isArray(n)){let o=function(h){return typeof h.error<"u"},f=function(h){return!o(h)};return e(null,n.filter(o),n.filter(f))}else return e(null,n.error,n.result);e(null,n)}});var Du=$e((R1,ya)=>{"use strict";var T1=H(V()),Il=Object.prototype.hasOwnProperty,dr="~";function Ri(){}Object.create&&(Ri.prototype=Object.create(null),new Ri().__proto__||(dr=!1));function Ll(r,t,e){this.fn=r,this.context=t,this.once=e||!1}function Fu(r,t,e,n,o){if(typeof e!="function")throw new TypeError("The listener must be a function");var f=new Ll(e,n||r,o),h=dr?dr+t:t;return r._events[h]?r._events[h].fn?r._events[h]=[r._events[h],f]:r._events[h].push(f):(r._events[h]=f,r._eventsCount++),r}function $o(r,t){--r._eventsCount===0?r._events=new Ri:delete r._events[t]}function cr(){this._events=new Ri,this._eventsCount=0}cr.prototype.eventNames=function(){var t=[],e,n;if(this._eventsCount===0)return t;for(n in e=this._events)Il.call(e,n)&&t.push(dr?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(e)):t};cr.prototype.listeners=function(t){var e=dr?dr+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,f=n.length,h=new Array(f);o{C1=H(V(),1),Wu=H(Du(),1)});var N1,Rl,$u=ae(()=>{N1=H(V(),1),Rl=H(An(),1);Hu()});function Kl(r,t=24){let e=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let h=0;h<10;h++)e[h]=r[h]^r[h+10]^r[h+20]^r[h+30]^r[h+40];for(let h=0;h<10;h+=2){let x=(h+8)%10,b=(h+2)%10,_=e[b],E=e[b+1],L=Vu(_,E,1)^e[x],O=Gu(_,E,1)^e[x+1];for(let P=0;P<50;P+=10)r[h+P]^=L,r[h+P+1]^=O}let o=r[2],f=r[3];for(let h=0;h<24;h++){let x=Yu[h],b=Vu(o,f,x),_=Gu(o,f,x),E=ju[h];o=r[E],f=r[E+1],r[E]=b,r[E+1]=_}for(let h=0;h<50;h+=10){for(let x=0;x<10;x++)e[x]=r[h+x];for(let x=0;x<10;x++)r[h+x]^=~e[(x+2)%10]&e[(x+4)%10]}r[0]^=Nl[n],r[1]^=zl[n]}e.fill(0)}var X1,ju,Yu,Zu,Tl,Ti,Pl,Cl,Ul,Ol,Nl,zl,Vu,Gu,si,kn,F1,D1,W1,H1,$1,ga,V1,G1,Xu,j1,Y1,Ju=ae(()=>{X1=H(V(),1);yi();Bs();fn();ju=[],Yu=[],Zu=[],Tl=BigInt(0),Ti=BigInt(1),Pl=BigInt(2),Cl=BigInt(7),Ul=BigInt(256),Ol=BigInt(113);for(let r=0,t=Ti,e=1,n=0;r<24;r++){[e,n]=[n,(2*e+3*n)%5],ju.push(2*(5*n+e)),Yu.push((r+1)*(r+2)/2%64);let o=Tl;for(let f=0;f<7;f++)t=(t<>Cl)*Ol)%Ul,t&Pl&&(o^=Ti<<(Ti<e>32?ks(r,t,e):xs(r,t,e),Gu=(r,t,e)=>e>32?Ss(r,t,e):vs(r,t,e);si=class extends sn{constructor(t,e,n,o=!1,f=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=o,this.rounds=f,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,pi(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=_f(this.state)}keccak(){ps||ys(this.state32),Kl(this.state32,this.rounds),ps||ys(this.state32),this.posOut=0,this.pos=0}update(t){Vr(this);let{blockLen:e,state:n}=this;t=an(t);let o=t.length;for(let f=0;f=n&&this.keccak();let h=Math.min(n-this.posOut,f-o);t.set(e.subarray(this.posOut,this.posOut+h),o),this.posOut+=h,o+=h}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return pi(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Zi(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:e,suffix:n,outputLen:o,rounds:f,enableXOF:h}=this;return t||(t=new si(e,n,o,h,f)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=f,t.suffix=n,t.outputLen=o,t.enableXOF=h,t.destroyed=this.destroyed,t}},kn=(r,t,e)=>Yn(()=>new si(t,r,e)),F1=kn(6,144,224/8),D1=kn(6,136,256/8),W1=kn(6,104,384/8),H1=kn(6,72,512/8),$1=kn(1,144,224/8),ga=kn(1,136,256/8),V1=kn(1,104,384/8),G1=kn(1,72,512/8),Xu=(r,t,e)=>Mf((n={})=>new si(t,r,n.dkLen===void 0?e:n.dkLen,!0)),j1=Xu(31,168,128/8),Y1=Xu(31,136,256/8)});var eg,Vo,ma,Qu=ae(()=>{eg=H(V(),1);yi();fn();Vo=class extends sn{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,Bf(t);let n=an(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,f=new Uint8Array(o);f.set(n.length>o?t.create().update(n).digest():n);for(let h=0;hnew Vo(r,t).update(e).digest();ma.create=(r,t)=>new Vo(r,t)});function tc(r){r.lowS!==void 0&&Rr("lowS",r.lowS),r.prehash!==void 0&&Rr("prehash",r.prehash)}function ql(r){let t=wi(r);qr(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:e,Fp:n,a:o}=t;if(e){if(!n.eql(o,n.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof e!="object"||typeof e.beta!="bigint"||typeof e.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...t})}function Wl(r){let t=ql(r),{Fp:e}=t,n=pn(t.n,t.nBitLength),o=t.toBytes||((D,C,X)=>{let ot=C.toAffine();return Zr(Uint8Array.from([4]),e.toBytes(ot.x),e.toBytes(ot.y))}),f=t.fromBytes||(D=>{let C=D.subarray(1),X=e.fromBytes(C.subarray(0,e.BYTES)),ot=e.fromBytes(C.subarray(e.BYTES,2*e.BYTES));return{x:X,y:ot}});function h(D){let{a:C,b:X}=t,ot=e.sqr(D),j=e.mul(ot,D);return e.add(e.add(j,e.mul(D,C)),X)}if(!e.eql(e.sqr(t.Gy),h(t.Gx)))throw new Error("bad generator point: equation left != right");function x(D){return gi(D,Xe,t.n)}function b(D){let{allowedPrivateKeyLengths:C,nByteLength:X,wrapPrivateKey:ot,n:j}=t;if(C&&typeof D!="bigint"){if(hn(D)&&(D=jr(D)),typeof D!="string"||!C.includes(D.length))throw new Error("invalid private key");D=D.padStart(X*2,"0")}let it;try{it=typeof D=="bigint"?D:Yr(Ke("private key",D,X))}catch{throw new Error("invalid private key, expected hex or "+X+" bytes, got "+typeof D)}return ot&&(it=Re(it,j)),yr("private key",it,Xe,j),it}function _(D){if(!(D instanceof O))throw new Error("ProjectivePoint expected")}let E=Tn((D,C)=>{let{px:X,py:ot,pz:j}=D;if(e.eql(j,e.ONE))return{x:X,y:ot};let it=D.is0();C==null&&(C=it?e.ONE:e.inv(j));let kt=e.mul(X,C),st=e.mul(ot,C),yt=e.mul(j,C);if(it)return{x:e.ZERO,y:e.ZERO};if(!e.eql(yt,e.ONE))throw new Error("invZ was invalid");return{x:kt,y:st}}),L=Tn(D=>{if(D.is0()){if(t.allowInfinityPoint&&!e.is0(D.py))return;throw new Error("bad point: ZERO")}let{x:C,y:X}=D.toAffine();if(!e.isValid(C)||!e.isValid(X))throw new Error("bad point: x or y not FE");let ot=e.sqr(X),j=h(C);if(!e.eql(ot,j))throw new Error("bad point: equation left != right");if(!D.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class O{constructor(C,X,ot){if(this.px=C,this.py=X,this.pz=ot,C==null||!e.isValid(C))throw new Error("x required");if(X==null||!e.isValid(X))throw new Error("y required");if(ot==null||!e.isValid(ot))throw new Error("z required");Object.freeze(this)}static fromAffine(C){let{x:X,y:ot}=C||{};if(!C||!e.isValid(X)||!e.isValid(ot))throw new Error("invalid affine point");if(C instanceof O)throw new Error("projective point not allowed");let j=it=>e.eql(it,e.ZERO);return j(X)&&j(ot)?O.ZERO:new O(X,ot,e.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(C){let X=e.invertBatch(C.map(ot=>ot.pz));return C.map((ot,j)=>ot.toAffine(X[j])).map(O.fromAffine)}static fromHex(C){let X=O.fromAffine(f(Ke("pointHex",C)));return X.assertValidity(),X}static fromPrivateKey(C){return O.BASE.multiply(b(C))}static msm(C,X){return so(O,n,C,X)}_setWindowSize(C){rt.setWindowSize(this,C)}assertValidity(){L(this)}hasEvenY(){let{y:C}=this.toAffine();if(e.isOdd)return!e.isOdd(C);throw new Error("Field doesn\'t support isOdd")}equals(C){_(C);let{px:X,py:ot,pz:j}=this,{px:it,py:kt,pz:st}=C,yt=e.eql(e.mul(X,st),e.mul(it,j)),At=e.eql(e.mul(ot,st),e.mul(kt,j));return yt&&At}negate(){return new O(this.px,e.neg(this.py),this.pz)}double(){let{a:C,b:X}=t,ot=e.mul(X,ec),{px:j,py:it,pz:kt}=this,st=e.ZERO,yt=e.ZERO,At=e.ZERO,Et=e.mul(j,j),be=e.mul(it,it),ct=e.mul(kt,kt),Lt=e.mul(j,it);return Lt=e.add(Lt,Lt),At=e.mul(j,kt),At=e.add(At,At),st=e.mul(C,At),yt=e.mul(ot,ct),yt=e.add(st,yt),st=e.sub(be,yt),yt=e.add(be,yt),yt=e.mul(st,yt),st=e.mul(Lt,st),At=e.mul(ot,At),ct=e.mul(C,ct),Lt=e.sub(Et,ct),Lt=e.mul(C,Lt),Lt=e.add(Lt,At),At=e.add(Et,Et),Et=e.add(At,Et),Et=e.add(Et,ct),Et=e.mul(Et,Lt),yt=e.add(yt,Et),ct=e.mul(it,kt),ct=e.add(ct,ct),Et=e.mul(ct,Lt),st=e.sub(st,Et),At=e.mul(ct,be),At=e.add(At,At),At=e.add(At,At),new O(st,yt,At)}add(C){_(C);let{px:X,py:ot,pz:j}=this,{px:it,py:kt,pz:st}=C,yt=e.ZERO,At=e.ZERO,Et=e.ZERO,be=t.a,ct=e.mul(t.b,ec),Lt=e.mul(X,it),g=e.mul(ot,kt),i=e.mul(j,st),a=e.add(X,ot),u=e.add(it,kt);a=e.mul(a,u),u=e.add(Lt,g),a=e.sub(a,u),u=e.add(X,j);let c=e.add(it,st);return u=e.mul(u,c),c=e.add(Lt,i),u=e.sub(u,c),c=e.add(ot,j),yt=e.add(kt,st),c=e.mul(c,yt),yt=e.add(g,i),c=e.sub(c,yt),Et=e.mul(be,u),yt=e.mul(ct,i),Et=e.add(yt,Et),yt=e.sub(g,Et),Et=e.add(g,Et),At=e.mul(yt,Et),g=e.add(Lt,Lt),g=e.add(g,Lt),i=e.mul(be,i),u=e.mul(ct,u),g=e.add(g,i),i=e.sub(Lt,i),i=e.mul(be,i),u=e.add(u,i),Lt=e.mul(g,u),At=e.add(At,Lt),Lt=e.mul(c,u),yt=e.mul(a,yt),yt=e.sub(yt,Lt),Lt=e.mul(a,g),Et=e.mul(c,Et),Et=e.add(Et,Lt),new O(yt,At,Et)}subtract(C){return this.add(C.negate())}is0(){return this.equals(O.ZERO)}wNAF(C){return rt.wNAFCached(this,C,O.normalizeZ)}multiplyUnsafe(C){let{endo:X,n:ot}=t;yr("scalar",C,tn,ot);let j=O.ZERO;if(C===tn)return j;if(this.is0()||C===Xe)return this;if(!X||rt.hasPrecomputes(this))return rt.wNAFCachedUnsafe(this,C,O.normalizeZ);let{k1neg:it,k1:kt,k2neg:st,k2:yt}=X.splitScalar(C),At=j,Et=j,be=this;for(;kt>tn||yt>tn;)kt&Xe&&(At=At.add(be)),yt&Xe&&(Et=Et.add(be)),be=be.double(),kt>>=Xe,yt>>=Xe;return it&&(At=At.negate()),st&&(Et=Et.negate()),Et=new O(e.mul(Et.px,X.beta),Et.py,Et.pz),At.add(Et)}multiply(C){let{endo:X,n:ot}=t;yr("scalar",C,Xe,ot);let j,it;if(X){let{k1neg:kt,k1:st,k2neg:yt,k2:At}=X.splitScalar(C),{p:Et,f:be}=this.wNAF(st),{p:ct,f:Lt}=this.wNAF(At);Et=rt.constTimeNegate(kt,Et),ct=rt.constTimeNegate(yt,ct),ct=new O(e.mul(ct.px,X.beta),ct.py,ct.pz),j=Et.add(ct),it=be.add(Lt)}else{let{p:kt,f:st}=this.wNAF(C);j=kt,it=st}return O.normalizeZ([j,it])[0]}multiplyAndAddUnsafe(C,X,ot){let j=O.BASE,it=(st,yt)=>yt===tn||yt===Xe||!st.equals(j)?st.multiplyUnsafe(yt):st.multiply(yt),kt=it(this,X).add(it(C,ot));return kt.is0()?void 0:kt}toAffine(C){return E(this,C)}isTorsionFree(){let{h:C,isTorsionFree:X}=t;if(C===Xe)return!0;if(X)return X(O,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:C,clearCofactor:X}=t;return C===Xe?this:X?X(O,this):this.multiplyUnsafe(t.h)}toRawBytes(C=!0){return Rr("isCompressed",C),this.assertValidity(),o(O,this,C)}toHex(C=!0){return Rr("isCompressed",C),jr(this.toRawBytes(C))}}O.BASE=new O(t.Gx,t.Gy,e.ONE),O.ZERO=new O(e.ZERO,e.ONE,e.ZERO);let P=t.nBitLength,rt=oo(O,t.endo?Math.ceil(P/2):P);return{CURVE:t,ProjectivePoint:O,normPrivateKeyToScalar:b,weierstrassEquation:h,isWithinCurveOrder:x}}function Hl(r){let t=wi(r);return qr(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function rc(r){let t=Hl(r),{Fp:e,n}=t,o=e.BYTES+1,f=2*e.BYTES+1;function h(i){return Re(i,n)}function x(i){return no(i,n)}let{ProjectivePoint:b,normPrivateKeyToScalar:_,weierstrassEquation:E,isWithinCurveOrder:L}=Wl({...t,toBytes(i,a,u){let c=a.toAffine(),d=e.toBytes(c.x),m=Zr;return Rr("isCompressed",u),u?m(Uint8Array.from([a.hasEvenY()?2:3]),d):m(Uint8Array.from([4]),d,e.toBytes(c.y))},fromBytes(i){let a=i.length,u=i[0],c=i.subarray(1);if(a===o&&(u===2||u===3)){let d=Yr(c);if(!gi(d,Xe,e.ORDER))throw new Error("Point is not on curve");let m=E(d),v;try{v=e.sqrt(m)}catch(y){let R=y instanceof Error?": "+y.message:"";throw new Error("Point is not on curve"+R)}let p=(v&Xe)===Xe;return(u&1)===1!==p&&(v=e.neg(v)),{x:d,y:v}}else if(a===f&&u===4){let d=e.fromBytes(c.subarray(0,e.BYTES)),m=e.fromBytes(c.subarray(e.BYTES,2*e.BYTES));return{x:d,y:m}}else{let d=o,m=f;throw new Error("invalid Point, expected length of "+d+", or uncompressed "+m+", got "+a)}}}),O=i=>jr(dn(i,t.nByteLength));function P(i){let a=n>>Xe;return i>a}function rt(i){return P(i)?h(-i):i}let D=(i,a,u)=>Yr(i.slice(a,u));class C{constructor(a,u,c){this.r=a,this.s=u,this.recovery=c,this.assertValidity()}static fromCompact(a){let u=t.nByteLength;return a=Ke("compactSignature",a,u*2),new C(D(a,0,u),D(a,u,2*u))}static fromDER(a){let{r:u,s:c}=Qr.toSig(Ke("DER",a));return new C(u,c)}assertValidity(){yr("r",this.r,Xe,n),yr("s",this.s,Xe,n)}addRecoveryBit(a){return new C(this.r,this.s,a)}recoverPublicKey(a){let{r:u,s:c,recovery:d}=this,m=st(Ke("msgHash",a));if(d==null||![0,1,2,3].includes(d))throw new Error("recovery id invalid");let v=d===2||d===3?u+t.n:u;if(v>=e.ORDER)throw new Error("recovery id 2 or 3 invalid");let p=d&1?"03":"02",s=b.fromHex(p+O(v)),y=x(v),R=h(-m*y),U=h(c*y),W=b.BASE.multiplyAndAddUnsafe(s,R,U);if(!W)throw new Error("point at infinify");return W.assertValidity(),W}hasHighS(){return P(this.s)}normalizeS(){return this.hasHighS()?new C(this.r,h(-this.s),this.recovery):this}toDERRawBytes(){return Ln(this.toDERHex())}toDERHex(){return Qr.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Ln(this.toCompactHex())}toCompactHex(){return O(this.r)+O(this.s)}}let X={isValidPrivateKey(i){try{return _(i),!0}catch{return!1}},normPrivateKeyToScalar:_,randomPrivateKey:()=>{let i=Cs(t.n);return qf(t.randomBytes(i),t.n)},precompute(i=8,a=b.BASE){return a._setWindowSize(i),a.multiply(BigInt(3)),a}};function ot(i,a=!0){return b.fromPrivateKey(i).toRawBytes(a)}function j(i){let a=hn(i),u=typeof i=="string",c=(a||u)&&i.length;return a?c===o||c===f:u?c===2*o||c===2*f:i instanceof b}function it(i,a,u=!0){if(j(i))throw new Error("first arg must be private key");if(!j(a))throw new Error("second arg must be public key");return b.fromHex(a).multiply(_(i)).toRawBytes(u)}let kt=t.bits2int||function(i){if(i.length>8192)throw new Error("input is too large");let a=Yr(i),u=i.length*8-t.nBitLength;return u>0?a>>BigInt(u):a},st=t.bits2int_modN||function(i){return h(kt(i))},yt=mi(t.nBitLength);function At(i){return yr("num < 2^"+t.nBitLength,i,tn,yt),dn(i,t.nByteLength)}function Et(i,a,u=be){if(["recovered","canonical"].some(at=>at in u))throw new Error("sign() legacy options not supported");let{hash:c,randomBytes:d}=t,{lowS:m,prehash:v,extraEntropy:p}=u;m==null&&(m=!0),i=Ke("msgHash",i),tc(u),v&&(i=Ke("prehashed msgHash",c(i)));let s=st(i),y=_(a),R=[At(y),At(s)];if(p!=null&&p!==!1){let at=p===!0?d(e.BYTES):p;R.push(Ke("extraEntropy",at))}let U=Zr(...R),W=s;function tt(at){let lt=kt(at);if(!L(lt))return;let xe=x(lt),gt=b.BASE.multiply(lt).toAffine(),St=h(gt.x);if(St===tn)return;let Ye=h(xe*h(W+St*y));if(Ye===tn)return;let Ct=(gt.x===St?0:2)|Number(gt.y&Xe),Ft=Ye;return m&&P(Ye)&&(Ft=rt(Ye),Ct^=1),new C(St,Ft,Ct)}return{seed:U,k2sig:tt}}let be={lowS:t.lowS,prehash:!1},ct={lowS:t.lowS,prehash:!1};function Lt(i,a,u=be){let{seed:c,k2sig:d}=Et(i,a,u),m=t;return Ls(m.hash.outputLen,m.nByteLength,m.hmac)(c,d)}b.BASE._setWindowSize(8);function g(i,a,u,c=ct){let d=i;a=Ke("msgHash",a),u=Ke("publicKey",u);let{lowS:m,prehash:v,format:p}=c;if(tc(c),"strict"in c)throw new Error("options.strict was renamed to lowS");if(p!==void 0&&p!=="compact"&&p!=="der")throw new Error("format must be compact or der");let s=typeof d=="string"||hn(d),y=!s&&!p&&typeof d=="object"&&d!==null&&typeof d.r=="bigint"&&typeof d.s=="bigint";if(!s&&!y)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let R,U;try{if(y&&(R=new C(d.r,d.s)),s){try{p!=="compact"&&(R=C.fromDER(d))}catch(Ct){if(!(Ct instanceof Qr.Err))throw Ct}!R&&p!=="der"&&(R=C.fromCompact(d))}U=b.fromHex(u)}catch{return!1}if(!R||m&&R.hasHighS())return!1;v&&(a=t.hash(a));let{r:W,s:tt}=R,at=st(a),lt=x(tt),xe=h(at*lt),gt=h(W*lt),St=b.BASE.multiplyAndAddUnsafe(U,xe,gt)?.toAffine();return St?h(St.x)===W:!1}return{CURVE:t,getPublicKey:ot,getSharedSecret:it,sign:Lt,verify:g,ProjectivePoint:b,Signature:C,utils:X}}var fg,Fl,Dl,wa,Qr,tn,Xe,og,ec,sg,nc=ae(()=>{fg=H(V(),1);Ks();Jn();Pn();Pn();({bytesToNumberBE:Fl,hexToBytes:Dl}=ro),wa=class extends Error{constructor(t=""){super(t)}},Qr={Err:wa,_tlv:{encode:(r,t)=>{let{Err:e}=Qr;if(r<0||r>256)throw new e("tlv.encode: wrong tag");if(t.length&1)throw new e("tlv.encode: unpadded data");let n=t.length/2,o=In(n);if(o.length/2&128)throw new e("tlv.encode: long form length too big");let f=n>127?In(o.length/2|128):"";return In(r)+f+o+t},decode(r,t){let{Err:e}=Qr,n=0;if(r<0||r>256)throw new e("tlv.encode: wrong tag");if(t.length<2||t[n++]!==r)throw new e("tlv.decode: wrong tlv");let o=t[n++],f=!!(o&128),h=0;if(!f)h=o;else{let b=o&127;if(!b)throw new e("tlv.decode(long): indefinite length not supported");if(b>4)throw new e("tlv.decode(long): byte length is too big");let _=t.subarray(n,n+b);if(_.length!==b)throw new e("tlv.decode: length bytes not complete");if(_[0]===0)throw new e("tlv.decode(long): zero leftmost byte");for(let E of _)h=h<<8|E;if(n+=b,h<128)throw new e("tlv.decode(long): not minimal encoding")}let x=t.subarray(n,n+h);if(x.length!==h)throw new e("tlv.decode: wrong value length");return{v:x,l:t.subarray(n+h)}}},_int:{encode(r){let{Err:t}=Qr;if(rma(r,t,gs(...e)),randomBytes:Ji}}function ic(r,t){let e=n=>rc({...r,...$l(n)});return{...e(t),create:e}}var dg,oc=ae(()=>{dg=H(V(),1);Qu();fn();nc();});function Gl(r){let t=fc,e=BigInt(3),n=BigInt(6),o=BigInt(11),f=BigInt(22),h=BigInt(23),x=BigInt(44),b=BigInt(88),_=r*r*r%t,E=_*_*r%t,L=Ne(E,e,t)*E%t,O=Ne(L,e,t)*E%t,P=Ne(O,ba,t)*_%t,rt=Ne(P,o,t)*P%t,D=Ne(rt,f,t)*rt%t,C=Ne(D,x,t)*D%t,X=Ne(C,b,t)*C%t,ot=Ne(X,x,t)*D%t,j=Ne(ot,e,t)*E%t,it=Ne(j,h,t)*rt%t,kt=Ne(it,n,t)*_%t,st=Ne(kt,ba,t);if(!xa.eql(xa.sqr(st),r))throw new Error("Cannot find square root");return st}var xg,fc,sc,Vl,ba,ac,xa,Pi,mg,wg,uc=ae(()=>{xg=H(V(),1);Vs();oc();Jn();fc=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),sc=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Vl=BigInt(1),ba=BigInt(2),ac=(r,t)=>(r+t/ba)/t;xa=pn(fc,void 0,void 0,{sqrt:Gl}),Pi=ic({a:BigInt(0),b:BigInt(7),Fp:xa,n:sc,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let t=sc,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Vl*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),f=e,h=BigInt("0x100000000000000000000000000000000"),x=ac(f*r,t),b=ac(-n*r,t),_=Re(r-x*e-b*o,t),E=Re(-x*n-b*f,t),L=_>h,O=E>h;if(L&&(_=t-_),O&&(E=t-E),_>h||E>h)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:L,k1:_,k2neg:O,k2:E}}}},bi),mg=BigInt(0),wg=Pi.ProjectivePoint});function hc(r){try{return Un.ExtendedPoint.fromHex(r),!0}catch{return!1}}function Xl(r){return r._bn!==void 0}function _c(r,t){let e=o=>{if(o.span>=0)return o.span;if(typeof o.alloc=="function")return o.alloc(t[o.property]);if("count"in o&&"elementLayout"in o){let f=t[o.property];if(Array.isArray(f))return f.length*e(o.elementLayout)}else if("fields"in o)return _c({layout:o},t[o.property]);return 0},n=0;return r.layout.fields.forEach(o=>{n+=e(o)}),n}function Oi(r){let t=0,e=0;for(;;){let n=r.shift();if(t|=(n&127)<>=7,e==0){r.push(n);break}else n|=128,r.push(n)}}function je(r,t){if(!r)throw new Error(t||"Assertion failed")}function Go(r){if(r.length===0)throw new Error(Ac);return r.shift()}function zi(r,...t){let[e]=t;if(t.length===2?e+(t[1]??0)>r.length:e>=r.length)throw new Error(Ac);return r.splice(...t)}async function dc(r,t,e,n){let o=n&&{skipPreflight:n.skipPreflight,preflightCommitment:n.preflightCommitment||n.commitment,maxRetries:n.maxRetries,minContextSlot:n.minContextSlot},f=await r.sendTransaction(t,e,o),h;if(t.recentBlockhash!=null&&t.lastValidBlockHeight!=null)h=(await r.confirmTransaction({abortSignal:n?.abortSignal,signature:f,blockhash:t.recentBlockhash,lastValidBlockHeight:t.lastValidBlockHeight},n&&n.commitment)).value;else if(t.minNonceContextSlot!=null&&t.nonceInfo!=null){let{nonceInstruction:x}=t.nonceInfo,b=x.keys[0].pubkey;h=(await r.confirmTransaction({abortSignal:n?.abortSignal,minContextSlot:t.minNonceContextSlot,nonceAccountPubkey:b,nonceValue:t.nonceInfo.nonce,signature:f},n&&n.commitment)).value}else n?.abortSignal!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),h=(await r.confirmTransaction(f,n&&n.commitment)).value;if(h.err)throw f!=null?new Ra({action:"send",signature:f,transactionMessage:`Status: (${JSON.stringify(h)})`}):new Error(`Transaction ${f} failed (${JSON.stringify(h)})`);return f}function fd(r){return new Promise(t=>setTimeout(t,r))}function Se(r,t){let e=r.layout.span>=0?r.layout.span:_c(r,t),n=Yt.Buffer.alloc(e),o=Object.assign({instruction:r.index},t);return r.layout.encode(o,n),n}function Ic(r){return or([et({jsonrpc:ze("2.0"),id:ft(),result:r}),et({jsonrpc:ze("2.0"),id:ft(),error:et({code:qn(),message:ft(),data:Nt(yu())})})])}function Ue(r){return oi(Ic(r),pd,t=>"error"in t?t:{...t,result:ii(t.result,r)})}function Ar(r){return Ue(et({context:et({slot:z()}),value:r}))}function ts(r){return et({context:et({slot:z()}),value:r})}var Dm,Yt,Ea,wr,hi,I,kc,Hi,jl,Ig,cc,_a,Sc,Yl,Me,Aa,Yo,Bc,Zl,Ki,lc,fe,Lg,Zo,Jl,Ec,Ma,Ia,La,Xo,_e,ai,Ql,td,ed,rd,qi,Ac,Dn,nd,Ce,Pe,id,od,sd,ad,en,Rg,Tg,va,Fi,Pg,Cg,Ug,ka,Ra,ud,cd,pc,hd,ld,fi,_r,Je,dd,ui,Og,Ng,zg,We,Mc,Ua,Kg,pd,yd,qg,gd,md,wd,bd,xd,Wn,vd,kd,Fg,Sd,Bd,Dg,Wg,Hg,$g,Vg,Gg,jg,Yg,Zg,Xg,Ed,Jg,Qg,Ta,tm,em,Oa,rm,_d,Ad,nm,im,om,sm,am,Md,fm,Id,um,Ld,cm,hm,lm,dm,yc,pm,Rd,Td,ym,gm,Lc,Na,Rc,Tc,Pc,Cc,Pd,Cd,Uc,Oc,Jo,Nc,es,za,li,Hn,mm,wm,bm,xm,vm,km,Sm,Bm,Em,_m,Am,Mm,Im,Ud,Lm,Rm,Tm,Pm,Od,Cm,Ur,Ci,Pa,jo,Ca,gc,mc,wc,bc,Di,Nd,zd,xc,Sa,vc,Kd,Ba,Fn,zc,qd,Wi,Sn,Um,Qo,Ui,Om,ci,Nm,zm,Km,qm,Ka=ae(()=>{Dm=H(V()),Yt=H(An());jf();Ea=H(Zf()),wr=H(Hs());Vs();hi=H(cu()),I=H(ra()),kc=H(ra()),Hi=H(hu());gu();jl=H(qu());$u();Ju();uc();Ig=Un.utils.randomPrivateKey,cc=()=>{let r=Un.utils.randomPrivateKey(),t=_a(r),e=new Uint8Array(64);return e.set(r),e.set(t,32),{publicKey:t,secretKey:e}},_a=Un.getPublicKey;Sc=(r,t)=>Un.sign(r,t.slice(0,32)),Yl=Un.verify,Me=r=>Yt.Buffer.isBuffer(r)?r:r instanceof Uint8Array?Yt.Buffer.from(r.buffer,r.byteOffset,r.byteLength):Yt.Buffer.from(r),Aa=class{constructor(t){Object.assign(this,t)}encode(){return Yt.Buffer.from((0,hi.serialize)(Yo,this))}static decode(t){return(0,hi.deserialize)(Yo,this,t)}static decodeUnchecked(t){return(0,hi.deserializeUnchecked)(Yo,this,t)}},Yo=new Map,Zl=32,Ki=32;lc=1,fe=class extends Aa{constructor(t){if(super({}),this._bn=void 0,Xl(t))this._bn=t._bn;else{if(typeof t=="string"){let e=wr.default.decode(t);if(e.length!=Ki)throw new Error("Invalid public key input");this._bn=new Ea.default(e)}else this._bn=new Ea.default(t);if(this._bn.byteLength()>Ki)throw new Error("Invalid public key input")}}static unique(){let t=new fe(lc);return lc+=1,new fe(t.toBuffer())}equals(t){return this._bn.eq(t._bn)}toBase58(){return wr.default.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){let t=this.toBuffer();return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}toBuffer(){let t=this._bn.toArrayLike(Yt.Buffer);if(t.length===Ki)return t;let e=Yt.Buffer.alloc(32);return t.copy(e,32-t.length),e}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(t,e,n){let o=Yt.Buffer.concat([t.toBuffer(),Yt.Buffer.from(e),n.toBuffer()]),f=bi(o);return new fe(f)}static createProgramAddressSync(t,e){let n=Yt.Buffer.alloc(0);t.forEach(function(f){if(f.length>Zl)throw new TypeError("Max seed length exceeded");n=Yt.Buffer.concat([n,Me(f)])}),n=Yt.Buffer.concat([n,e.toBuffer(),Yt.Buffer.from("ProgramDerivedAddress")]);let o=bi(n);if(hc(o))throw new Error("Invalid seeds, address must fall off the curve");return new fe(o)}static async createProgramAddress(t,e){return this.createProgramAddressSync(t,e)}static findProgramAddressSync(t,e){let n=255,o;for(;n!=0;){try{let f=t.concat(Yt.Buffer.from([n]));o=this.createProgramAddressSync(f,e)}catch(f){if(f instanceof TypeError)throw f;n--;continue}return[o,n]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(t,e){return this.findProgramAddressSync(t,e)}static isOnCurve(t){let e=new fe(t);return hc(e.toBytes())}};Bc=fe;fe.default=new Bc("11111111111111111111111111111111");Yo.set(fe,{kind:"struct",fields:[["_bn","u256"]]});Lg=new fe("BPFLoader1111111111111111111111111111111111"),Zo=1280-40-8,Jl=127,Ec=64,Ma=class extends Error{constructor(t){super(`Signature ${t} has expired: block height exceeded.`),this.signature=void 0,this.signature=t}};Object.defineProperty(Ma.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});Ia=class extends Error{constructor(t,e){super(`Transaction was not confirmed in ${e.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${t} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=t}};Object.defineProperty(Ia.prototype,"name",{value:"TransactionExpiredTimeoutError"});La=class extends Error{constructor(t){super(`Signature ${t} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=t}};Object.defineProperty(La.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});Xo=class{constructor(t,e){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=e}keySegments(){let t=[this.staticAccountKeys];return this.accountKeysFromLookups&&(t.push(this.accountKeysFromLookups.writable),t.push(this.accountKeysFromLookups.readonly)),t}get(t){for(let e of this.keySegments()){if(t255+1)throw new Error("Account index overflow encountered during compilation");let n=new Map;this.keySegments().flat().forEach((f,h)=>{n.set(f.toBase58(),h)});let o=f=>{let h=n.get(f.toBase58());if(h===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return h};return t.map(f=>({programIdIndex:o(f.programId),accountKeyIndexes:f.keys.map(h=>o(h.pubkey)),data:f.data}))}},_e=(r="publicKey")=>I.blob(32,r),ai=(r="string")=>{let t=I.struct([I.u32("length"),I.u32("lengthPadding"),I.blob(I.offset(I.u32(),-8),"chars")],r),e=t.decode.bind(t),n=t.encode.bind(t),o=t;return o.decode=(f,h)=>e(f,h).chars.toString(),o.encode=(f,h,x)=>{let b={chars:Yt.Buffer.from(f,"utf8")};return n(b,h,x)},o.alloc=f=>I.u32().span+I.u32().span+Yt.Buffer.from(f,"utf8").length,o},Ql=(r="authorized")=>I.struct([_e("staker"),_e("withdrawer")],r),td=(r="lockup")=>I.struct([I.ns64("unixTimestamp"),I.ns64("epoch"),_e("custodian")],r),ed=(r="voteInit")=>I.struct([_e("nodePubkey"),_e("authorizedVoter"),_e("authorizedWithdrawer"),I.u8("commission")],r),rd=(r="voteAuthorizeWithSeedArgs")=>I.struct([I.u32("voteAuthorizationType"),_e("currentAuthorityDerivedKeyOwnerPubkey"),ai("currentAuthorityDerivedKeySeed"),_e("newAuthorized")],r);qi=class{constructor(t,e){this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=e}static compile(t,e){let n=new Map,o=h=>{let x=h.toBase58(),b=n.get(x);return b===void 0&&(b={isSigner:!1,isWritable:!1,isInvoked:!1},n.set(x,b)),b},f=o(e);f.isSigner=!0,f.isWritable=!0;for(let h of t){o(h.programId).isInvoked=!0;for(let x of h.keys){let b=o(x.pubkey);b.isSigner||=x.isSigner,b.isWritable||=x.isWritable}}return new qi(e,n)}getMessageComponents(){let t=[...this.keyMetaMap.entries()];je(t.length<=256,"Max static account keys length exceeded");let e=t.filter(([,b])=>b.isSigner&&b.isWritable),n=t.filter(([,b])=>b.isSigner&&!b.isWritable),o=t.filter(([,b])=>!b.isSigner&&b.isWritable),f=t.filter(([,b])=>!b.isSigner&&!b.isWritable),h={numRequiredSignatures:e.length+n.length,numReadonlySignedAccounts:n.length,numReadonlyUnsignedAccounts:f.length};{je(e.length>0,"Expected at least one writable signer key");let[b]=e[0];je(b===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}let x=[...e.map(([b])=>new fe(b)),...n.map(([b])=>new fe(b)),...o.map(([b])=>new fe(b)),...f.map(([b])=>new fe(b))];return[h,x]}extractTableLookup(t){let[e,n]=this.drainKeysFoundInLookupTable(t.state.addresses,h=>!h.isSigner&&!h.isInvoked&&h.isWritable),[o,f]=this.drainKeysFoundInLookupTable(t.state.addresses,h=>!h.isSigner&&!h.isInvoked&&!h.isWritable);if(!(e.length===0&&o.length===0))return[{accountKey:t.key,writableIndexes:e,readonlyIndexes:o},{writable:n,readonly:f}]}drainKeysFoundInLookupTable(t,e){let n=new Array,o=new Array;for(let[f,h]of this.keyMetaMap.entries())if(e(h)){let x=new fe(f),b=t.findIndex(_=>_.equals(x));b>=0&&(je(b<256,"Max lookup table index exceeded"),n.push(b),o.push(x),this.keyMetaMap.delete(f))}return[n,o]}},Ac="Reached end of buffer unexpectedly";Dn=class{constructor(t){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map(e=>new fe(e)),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach(e=>this.indexToProgramIds.set(e.programIdIndex,this.accountKeys[e.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:wr.default.decode(t.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new Xo(this.staticAccountKeys)}static compile(t){let e=qi.compile(t.instructions,t.payerKey),[n,o]=e.getMessageComponents(),h=new Xo(o).compileInstructions(t.instructions).map(x=>({programIdIndex:x.programIdIndex,accounts:x.accountKeyIndexes,data:wr.default.encode(x.data)}));return new Dn({header:n,accountKeys:o,recentBlockhash:t.recentBlockhash,instructions:h})}isAccountSigner(t){return t=this.header.numRequiredSignatures){let n=t-e,f=this.accountKeys.length-e-this.header.numReadonlyUnsignedAccounts;return n!this.isProgramId(e))}serialize(){let t=this.accountKeys.length,e=[];Ni(e,t);let n=this.instructions.map(L=>{let{accounts:O,programIdIndex:P}=L,rt=Array.from(wr.default.decode(L.data)),D=[];Ni(D,O.length);let C=[];return Ni(C,rt.length),{programIdIndex:P,keyIndicesCount:Yt.Buffer.from(D),keyIndices:O,dataLength:Yt.Buffer.from(C),data:rt}}),o=[];Ni(o,n.length);let f=Yt.Buffer.alloc(Zo);Yt.Buffer.from(o).copy(f);let h=o.length;n.forEach(L=>{let P=I.struct([I.u8("programIdIndex"),I.blob(L.keyIndicesCount.length,"keyIndicesCount"),I.seq(I.u8("keyIndex"),L.keyIndices.length,"keyIndices"),I.blob(L.dataLength.length,"dataLength"),I.seq(I.u8("userdatum"),L.data.length,"data")]).encode(L,f,h);h+=P}),f=f.slice(0,h);let x=I.struct([I.blob(1,"numRequiredSignatures"),I.blob(1,"numReadonlySignedAccounts"),I.blob(1,"numReadonlyUnsignedAccounts"),I.blob(e.length,"keyCount"),I.seq(_e("key"),t,"keys"),_e("recentBlockhash")]),b={numRequiredSignatures:Yt.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:Yt.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:Yt.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:Yt.Buffer.from(e),keys:this.accountKeys.map(L=>Me(L.toBytes())),recentBlockhash:wr.default.decode(this.recentBlockhash)},_=Yt.Buffer.alloc(2048),E=x.encode(b,_);return f.copy(_,E),_.slice(0,E+f.length)}static from(t){let e=[...t],n=Go(e);if(n!==(n&Jl))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");let o=Go(e),f=Go(e),h=Oi(e),x=[];for(let O=0;O({pubkey:t.toJSON(),isSigner:e,isWritable:n})),programId:this.programId.toJSON(),data:[...this.data]}}},Pe=class{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(t){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!!t)if(t.feePayer&&(this.feePayer=t.feePayer),t.signatures&&(this.signatures=t.signatures),Object.prototype.hasOwnProperty.call(t,"nonceInfo")){let{minContextSlot:e,nonceInfo:n}=t;this.minNonceContextSlot=e,this.nonceInfo=n}else if(Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")){let{blockhash:e,lastValidBlockHeight:n}=t;this.recentBlockhash=e,this.lastValidBlockHeight=n}else{let{recentBlockhash:e,nonceInfo:n}=t;n&&(this.nonceInfo=n),this.recentBlockhash=e}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(t=>t.toJSON()),signers:this.signatures.map(({publicKey:t})=>t.toJSON())}}add(...t){if(t.length===0)throw new Error("No instructions");return t.forEach(e=>{"instructions"in e?this.instructions=this.instructions.concat(e.instructions):"data"in e&&"programId"in e&&"keys"in e?this.instructions.push(e):this.instructions.push(new Ce(e))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let t,e;if(this.nonceInfo?(t=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?e=[this.nonceInfo.nonceInstruction,...this.instructions]:e=this.instructions):(t=this.recentBlockhash,e=this.instructions),!t)throw new Error("Transaction recentBlockhash required");e.length<1&&console.warn("No instructions provided");let n;if(this.feePayer)n=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)n=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let D=0;D{D.keys.forEach(X=>{f.push({...X})});let C=D.programId.toString();o.includes(C)||o.push(C)}),o.forEach(D=>{f.push({pubkey:new fe(D),isSigner:!1,isWritable:!1})});let h=[];f.forEach(D=>{let C=D.pubkey.toString(),X=h.findIndex(ot=>ot.pubkey.toString()===C);X>-1?(h[X].isWritable=h[X].isWritable||D.isWritable,h[X].isSigner=h[X].isSigner||D.isSigner):h.push(D)}),h.sort(function(D,C){if(D.isSigner!==C.isSigner)return D.isSigner?-1:1;if(D.isWritable!==C.isWritable)return D.isWritable?-1:1;let X={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return D.pubkey.toBase58().localeCompare(C.pubkey.toBase58(),"en",X)});let x=h.findIndex(D=>D.pubkey.equals(n));if(x>-1){let[D]=h.splice(x,1);D.isSigner=!0,D.isWritable=!0,h.unshift(D)}else h.unshift({pubkey:n,isSigner:!0,isWritable:!0});for(let D of this.signatures){let C=h.findIndex(X=>X.pubkey.equals(D.publicKey));if(C>-1)h[C].isSigner||(h[C].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw new Error(`unknown signer: ${D.publicKey.toString()}`)}let b=0,_=0,E=0,L=[],O=[];h.forEach(({pubkey:D,isSigner:C,isWritable:X})=>{C?(L.push(D.toString()),b+=1,X||(_+=1)):(O.push(D.toString()),X||(E+=1))});let P=L.concat(O),rt=e.map(D=>{let{data:C,programId:X}=D;return{programIdIndex:P.indexOf(X.toString()),accounts:D.keys.map(ot=>P.indexOf(ot.pubkey.toString())),data:wr.default.encode(C)}});return rt.forEach(D=>{je(D.programIdIndex>=0),D.accounts.forEach(C=>je(C>=0))}),new Dn({header:{numRequiredSignatures:b,numReadonlySignedAccounts:_,numReadonlyUnsignedAccounts:E},accountKeys:P,recentBlockhash:t,instructions:rt})}_compile(){let t=this.compileMessage(),e=t.accountKeys.slice(0,t.header.numRequiredSignatures);return this.signatures.length===e.length&&this.signatures.every((o,f)=>e[f].equals(o.publicKey))||(this.signatures=e.map(n=>({signature:null,publicKey:n}))),t}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(t){return(await t.getFeeForMessage(this.compileMessage())).value}setSigners(...t){if(t.length===0)throw new Error("No signers");let e=new Set;this.signatures=t.filter(n=>{let o=n.toString();return e.has(o)?!1:(e.add(o),!0)}).map(n=>({signature:null,publicKey:n}))}sign(...t){if(t.length===0)throw new Error("No signers");let e=new Set,n=[];for(let f of t){let h=f.publicKey.toString();e.has(h)||(e.add(h),n.push(f))}this.signatures=n.map(f=>({signature:null,publicKey:f.publicKey}));let o=this._compile();this._partialSign(o,...n)}partialSign(...t){if(t.length===0)throw new Error("No signers");let e=new Set,n=[];for(let f of t){let h=f.publicKey.toString();e.has(h)||(e.add(h),n.push(f))}let o=this._compile();this._partialSign(o,...n)}_partialSign(t,...e){let n=t.serialize();e.forEach(o=>{let f=Sc(n,o.secretKey);this._addSignature(o.publicKey,Me(f))})}addSignature(t,e){this._compile(),this._addSignature(t,e)}_addSignature(t,e){je(e.length===64);let n=this.signatures.findIndex(o=>t.equals(o.publicKey));if(n<0)throw new Error(`unknown signer: ${t.toString()}`);this.signatures[n].signature=Yt.Buffer.from(e)}verifySignatures(t=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),t)}_getMessageSignednessErrors(t,e){let n={};for(let{signature:o,publicKey:f}of this.signatures)o===null?e&&(n.missing||=[]).push(f):Yl(o,t,f.toBytes())||(n.invalid||=[]).push(f);return n.invalid||n.missing?n:void 0}serialize(t){let{requireAllSignatures:e,verifySignatures:n}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},t),o=this.serializeMessage();if(n){let f=this._getMessageSignednessErrors(o,e);if(f){let h="Signature verification failed.";throw f.invalid&&(h+=`\nInvalid signature for public key${f.invalid.length===1?"":"(s)"} [\\`${f.invalid.map(x=>x.toBase58()).join("`, `")}\\`].`),f.missing&&(h+=`\nMissing signature for public key${f.missing.length===1?"":"(s)"} [\\`${f.missing.map(x=>x.toBase58()).join("`, `")}\\`].`),new Error(h)}}return this._serialize(o)}_serialize(t){let{signatures:e}=this,n=[];Ni(n,e.length);let o=n.length+e.length*64+t.length,f=Yt.Buffer.alloc(o);return je(e.length<256),Yt.Buffer.from(n).copy(f,0),e.forEach(({signature:h},x)=>{h!==null&&(je(h.length===64,"signature has invalid length"),Yt.Buffer.from(h).copy(f,n.length+x*64))}),t.copy(f,n.length+e.length*64),je(f.length<=Zo,`Transaction too large: ${f.length} > ${Zo}`),f}get keys(){return je(this.instructions.length===1),this.instructions[0].keys.map(t=>t.pubkey)}get programId(){return je(this.instructions.length===1),this.instructions[0].programId}get data(){return je(this.instructions.length===1),this.instructions[0].data}static from(t){let e=[...t],n=Oi(e),o=[];for(let f=0;f0&&(n.feePayer=t.accountKeys[0]),e.forEach((o,f)=>{let h={signature:o==wr.default.encode(nd)?null:wr.default.decode(o),publicKey:t.accountKeys[f]};n.signatures.push(h)}),t.instructions.forEach(o=>{let f=o.accounts.map(h=>{let x=t.accountKeys[h];return{pubkey:x,isSigner:n.signatures.some(b=>b.publicKey.toString()===x.toString())||t.isAccountSigner(h),isWritable:t.isAccountWritable(h)}});n.instructions.push(new Ce({keys:f,programId:t.accountKeys[o.programIdIndex],data:wr.default.decode(o.data)}))}),n._message=t,n._json=n.toJSON(),n}},id=160,od=64,sd=id/od,ad=1e3/sd,en=new fe("SysvarC1ock11111111111111111111111111111111"),Rg=new fe("SysvarEpochSchedu1e111111111111111111111111"),Tg=new fe("Sysvar1nstructions1111111111111111111111111"),va=new fe("SysvarRecentB1ockHashes11111111111111111111"),Fi=new fe("SysvarRent111111111111111111111111111111111"),Pg=new fe("SysvarRewards111111111111111111111111111111"),Cg=new fe("SysvarS1otHashes111111111111111111111111111"),Ug=new fe("SysvarS1otHistory11111111111111111111111111"),ka=new fe("SysvarStakeHistory1111111111111111111111111"),Ra=class extends Error{constructor({action:t,signature:e,transactionMessage:n,logs:o}){let f=o?`Logs: \n${JSON.stringify(o.slice(-10),null,2)}. `:"",h="\\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.",x;switch(t){case"send":x=`Transaction ${e} resulted in an error. \n${n}. `+f+h;break;case"simulate":x=`Simulation failed. \nMessage: ${n}. \n`+f+h;break;default:x=`Unknown action \'${(b=>b)(t)}\'`}super(x),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=e,this.transactionMessage=n,this.transactionLogs=o||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){let t=this.transactionLogs;if(!(t!=null&&typeof t=="object"&&"then"in t))return t}async getLogs(t){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((e,n)=>{t.getTransaction(this.signature).then(o=>{if(o&&o.meta&&o.meta.logMessages){let f=o.meta.logMessages;this.transactionLogs=f,e(f)}else n(new Error("Log messages not found"))}).catch(n)})),await this.transactionLogs}};ud=I.nu64("lamportsPerSignature"),cd=I.struct([I.u32("version"),I.u32("state"),_e("authorizedPubkey"),_e("nonce"),I.struct([ud],"feeCalculator")]),pc=cd.span,hd=r=>{let t=r.decode.bind(r),e=r.encode.bind(r);return{decode:t,encode:e}},ld=r=>t=>{let e=(0,kc.blob)(r,t),{encode:n,decode:o}=hd(e),f=e;return f.decode=(h,x)=>{let b=o(h,x);return(0,Hi.toBigIntLE)(Yt.Buffer.from(b))},f.encode=(h,x,b)=>{let _=(0,Hi.toBufferLE)(h,r);return n(_,x,b)},f},fi=ld(8),_r=Object.freeze({Create:{index:0,layout:I.struct([I.u32("instruction"),I.ns64("lamports"),I.ns64("space"),_e("programId")])},Assign:{index:1,layout:I.struct([I.u32("instruction"),_e("programId")])},Transfer:{index:2,layout:I.struct([I.u32("instruction"),fi("lamports")])},CreateWithSeed:{index:3,layout:I.struct([I.u32("instruction"),_e("base"),ai("seed"),I.ns64("lamports"),I.ns64("space"),_e("programId")])},AdvanceNonceAccount:{index:4,layout:I.struct([I.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:I.struct([I.u32("instruction"),I.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:I.struct([I.u32("instruction"),_e("authorized")])},AuthorizeNonceAccount:{index:7,layout:I.struct([I.u32("instruction"),_e("authorized")])},Allocate:{index:8,layout:I.struct([I.u32("instruction"),I.ns64("space")])},AllocateWithSeed:{index:9,layout:I.struct([I.u32("instruction"),_e("base"),ai("seed"),I.ns64("space"),_e("programId")])},AssignWithSeed:{index:10,layout:I.struct([I.u32("instruction"),_e("base"),ai("seed"),_e("programId")])},TransferWithSeed:{index:11,layout:I.struct([I.u32("instruction"),fi("lamports"),ai("seed"),_e("programId")])},UpgradeNonceAccount:{index:12,layout:I.struct([I.u32("instruction")])}}),Je=class{constructor(){}static createAccount(t){let e=_r.Create,n=Se(e,{lamports:t.lamports,space:t.space,programId:Me(t.programId.toBuffer())});return new Ce({keys:[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:n})}static transfer(t){let e,n;if("basePubkey"in t){let o=_r.TransferWithSeed;e=Se(o,{lamports:BigInt(t.lamports),seed:t.seed,programId:Me(t.programId.toBuffer())}),n=[{pubkey:t.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]}else{let o=_r.Transfer;e=Se(o,{lamports:BigInt(t.lamports)}),n=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]}return new Ce({keys:n,programId:this.programId,data:e})}static assign(t){let e,n;if("basePubkey"in t){let o=_r.AssignWithSeed;e=Se(o,{base:Me(t.basePubkey.toBuffer()),seed:t.seed,programId:Me(t.programId.toBuffer())}),n=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]}else{let o=_r.Assign;e=Se(o,{programId:Me(t.programId.toBuffer())}),n=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]}return new Ce({keys:n,programId:this.programId,data:e})}static createAccountWithSeed(t){let e=_r.CreateWithSeed,n=Se(e,{base:Me(t.basePubkey.toBuffer()),seed:t.seed,lamports:t.lamports,space:t.space,programId:Me(t.programId.toBuffer())}),o=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!1,isWritable:!0}];return t.basePubkey.equals(t.fromPubkey)||o.push({pubkey:t.basePubkey,isSigner:!0,isWritable:!1}),new Ce({keys:o,programId:this.programId,data:n})}static createNonceAccount(t){let e=new Pe;"basePubkey"in t&&"seed"in t?e.add(Je.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:pc,programId:this.programId})):e.add(Je.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:pc,programId:this.programId}));let n={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return e.add(this.nonceInitialize(n)),e}static nonceInitialize(t){let e=_r.InitializeNonceAccount,n=Se(e,{authorized:Me(t.authorizedPubkey.toBuffer())}),o={keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:va,isSigner:!1,isWritable:!1},{pubkey:Fi,isSigner:!1,isWritable:!1}],programId:this.programId,data:n};return new Ce(o)}static nonceAdvance(t){let e=_r.AdvanceNonceAccount,n=Se(e),o={keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:va,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:n};return new Ce(o)}static nonceWithdraw(t){let e=_r.WithdrawNonceAccount,n=Se(e,{lamports:t.lamports});return new Ce({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0},{pubkey:va,isSigner:!1,isWritable:!1},{pubkey:Fi,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}static nonceAuthorize(t){let e=_r.AuthorizeNonceAccount,n=Se(e,{authorized:Me(t.newAuthorizedPubkey.toBuffer())});return new Ce({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}static allocate(t){let e,n;if("basePubkey"in t){let o=_r.AllocateWithSeed;e=Se(o,{base:Me(t.basePubkey.toBuffer()),seed:t.seed,space:t.space,programId:Me(t.programId.toBuffer())}),n=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]}else{let o=_r.Allocate;e=Se(o,{space:t.space}),n=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]}return new Ce({keys:n,programId:this.programId,data:e})}};Je.programId=new fe("11111111111111111111111111111111");dd=Zo-300,ui=class{constructor(){}static getMinNumSignatures(t){return 2*(Math.ceil(t/ui.chunkSize)+1+1)}static async load(t,e,n,o,f){{let L=await t.getMinimumBalanceForRentExemption(f.length),O=await t.getAccountInfo(n.publicKey,"confirmed"),P=null;if(O!==null){if(O.executable)return console.error("Program load failed, account is already executable"),!1;O.data.length!==f.length&&(P=P||new Pe,P.add(Je.allocate({accountPubkey:n.publicKey,space:f.length}))),O.owner.equals(o)||(P=P||new Pe,P.add(Je.assign({accountPubkey:n.publicKey,programId:o}))),O.lamports0?L:1,space:f.length,programId:o}));P!==null&&await dc(t,P,[e,n],{commitment:"confirmed"})}let h=I.struct([I.u32("instruction"),I.u32("offset"),I.u32("bytesLength"),I.u32("bytesLengthPadding"),I.seq(I.u8("byte"),I.offset(I.u32(),-8),"bytes")]),x=ui.chunkSize,b=0,_=f,E=[];for(;_.length>0;){let L=_.slice(0,x),O=Yt.Buffer.alloc(x+16);h.encode({instruction:0,offset:b,bytes:L,bytesLength:0,bytesLengthPadding:0},O);let P=new Pe().add({keys:[{pubkey:n.publicKey,isSigner:!0,isWritable:!0}],programId:o,data:O});E.push(dc(t,P,[e,n],{commitment:"confirmed"})),t._rpcEndpoint.includes("solana.com")&&await fd(1e3/4),b+=x,_=_.slice(x)}await Promise.all(E);{let L=I.struct([I.u32("instruction")]),O=Yt.Buffer.alloc(L.span);L.encode({instruction:1},O);let P=new Pe().add({keys:[{pubkey:n.publicKey,isSigner:!0,isWritable:!0},{pubkey:Fi,isSigner:!1,isWritable:!1}],programId:o,data:O}),rt="processed",D=await t.sendTransaction(P,[e,n],{preflightCommitment:rt}),{context:C,value:X}=await t.confirmTransaction({signature:D,lastValidBlockHeight:P.lastValidBlockHeight,blockhash:P.recentBlockhash},rt);if(X.err)throw new Error(`Transaction ${D} failed (${JSON.stringify(X)})`);for(;;){try{if(await t.getSlot({commitment:rt})>C.slot)break}catch{}await new Promise(ot=>setTimeout(ot,Math.round(ad/2)))}}return!0}};ui.chunkSize=dd;Og=new fe("BPFLoader2111111111111111111111111111111111"),Ng=globalThis.fetch,zg={index:1,layout:I.struct([I.u32("typeIndex"),fi("deactivationSlot"),I.nu64("lastExtendedSlot"),I.u8("lastExtendedStartIndex"),I.u8(),I.seq(_e(),I.offset(I.u8(),-1),"authority")])},We=oi(zo(fe),ft(),r=>new fe(r)),Mc=Ko([ft(),ze("base64")]),Ua=oi(zo(Yt.Buffer),Mc,r=>Yt.Buffer.from(r[0],"base64")),Kg=30*1e3;pd=Ic(qn());yd=et({foundation:z(),foundationTerm:z(),initial:z(),taper:z(),terminal:z()}),qg=Ue(xt(vt(et({epoch:z(),effectiveSlot:z(),amount:z(),postBalance:z(),commission:Nt(vt(z()))})))),gd=xt(et({slot:z(),prioritizationFee:z()})),md=et({total:z(),validator:z(),foundation:z(),epoch:z()}),wd=et({epoch:z(),slotIndex:z(),slotsInEpoch:z(),absoluteSlot:z(),blockHeight:Nt(z()),transactionCount:Nt(z())}),bd=et({slotsPerEpoch:z(),leaderScheduleSlotOffset:z(),warmup:Cr(),firstNormalEpoch:z(),firstNormalSlot:z()}),xd=oa(ft(),xt(z())),Wn=vt(or([et({}),ft()])),vd=et({err:Wn}),kd=ze("receivedSignature"),Fg=et({"solana-core":ft(),"feature-set":Nt(z())}),Sd=et({program:ft(),programId:We,parsed:qn()}),Bd=et({programId:We,accounts:xt(We),data:ft()}),Dg=Ar(et({err:vt(or([et({}),ft()])),logs:vt(xt(ft())),accounts:Nt(vt(xt(vt(et({executable:Cr(),owner:ft(),lamports:z(),data:xt(ft()),rentEpoch:Nt(z())}))))),unitsConsumed:Nt(z()),returnData:Nt(vt(et({programId:ft(),data:Ko([ft(),ze("base64")])}))),innerInstructions:Nt(vt(xt(et({index:z(),instructions:xt(or([Sd,Bd]))}))))})),Wg=Ar(et({byIdentity:oa(ft(),xt(z())),range:et({firstSlot:z(),lastSlot:z()})})),Hg=Ue(yd),$g=Ue(md),Vg=Ue(gd),Gg=Ue(wd),jg=Ue(bd),Yg=Ue(xd),Zg=Ue(z()),Xg=Ar(et({total:z(),circulating:z(),nonCirculating:z(),nonCirculatingAccounts:xt(We)})),Ed=et({amount:ft(),uiAmount:vt(z()),decimals:z(),uiAmountString:Nt(ft())}),Jg=Ar(xt(et({address:We,amount:ft(),uiAmount:vt(z()),decimals:z(),uiAmountString:Nt(ft())}))),Qg=Ar(xt(et({pubkey:We,account:et({executable:Cr(),owner:We,lamports:z(),data:Ua,rentEpoch:z()})}))),Ta=et({program:ft(),parsed:qn(),space:z()}),tm=Ar(xt(et({pubkey:We,account:et({executable:Cr(),owner:We,lamports:z(),data:Ta,rentEpoch:z()})}))),em=Ar(xt(et({lamports:z(),address:We}))),Oa=et({executable:Cr(),owner:We,lamports:z(),data:Ua,rentEpoch:z()}),rm=et({pubkey:We,account:Oa}),_d=oi(or([zo(Yt.Buffer),Ta]),or([Mc,Ta]),r=>Array.isArray(r)?ii(r,Ua):r),Ad=et({executable:Cr(),owner:We,lamports:z(),data:_d,rentEpoch:z()}),nm=et({pubkey:We,account:Ad}),im=et({state:or([ze("active"),ze("inactive"),ze("activating"),ze("deactivating")]),active:z(),inactive:z()}),om=Ue(xt(et({signature:ft(),slot:z(),err:Wn,memo:vt(ft()),blockTime:Nt(vt(z()))}))),sm=Ue(xt(et({signature:ft(),slot:z(),err:Wn,memo:vt(ft()),blockTime:Nt(vt(z()))}))),am=et({subscription:z(),result:ts(Oa)}),Md=et({pubkey:We,account:Oa}),fm=et({subscription:z(),result:ts(Md)}),Id=et({parent:z(),slot:z(),root:z()}),um=et({subscription:z(),result:Id}),Ld=or([et({type:or([ze("firstShredReceived"),ze("completed"),ze("optimisticConfirmation"),ze("root")]),slot:z(),timestamp:z()}),et({type:ze("createdBank"),parent:z(),slot:z(),timestamp:z()}),et({type:ze("frozen"),slot:z(),timestamp:z(),stats:et({numTransactionEntries:z(),numSuccessfulTransactions:z(),numFailedTransactions:z(),maxTransactionsPerEntry:z()})}),et({type:ze("dead"),slot:z(),timestamp:z(),err:ft()})]),cm=et({subscription:z(),result:Ld}),hm=et({subscription:z(),result:ts(or([vd,kd]))}),lm=et({subscription:z(),result:z()}),dm=et({pubkey:ft(),gossip:vt(ft()),tpu:vt(ft()),rpc:vt(ft()),version:vt(ft())}),yc=et({votePubkey:ft(),nodePubkey:ft(),activatedStake:z(),epochVoteAccount:Cr(),epochCredits:xt(Ko([z(),z(),z()])),commission:z(),lastVote:z(),rootSlot:vt(z())}),pm=Ue(et({current:xt(yc),delinquent:xt(yc)})),Rd=or([ze("processed"),ze("confirmed"),ze("finalized")]),Td=et({slot:z(),confirmations:vt(z()),err:Wn,confirmationStatus:Nt(Rd)}),ym=Ar(xt(vt(Td))),gm=Ue(z()),Lc=et({accountKey:We,writableIndexes:xt(z()),readonlyIndexes:xt(z())}),Na=et({signatures:xt(ft()),message:et({accountKeys:xt(ft()),header:et({numRequiredSignatures:z(),numReadonlySignedAccounts:z(),numReadonlyUnsignedAccounts:z()}),instructions:xt(et({accounts:xt(z()),data:ft(),programIdIndex:z()})),recentBlockhash:ft(),addressTableLookups:Nt(xt(Lc))})}),Rc=et({pubkey:We,signer:Cr(),writable:Cr(),source:Nt(or([ze("transaction"),ze("lookupTable")]))}),Tc=et({accountKeys:xt(Rc),signatures:xt(ft())}),Pc=et({parsed:qn(),program:ft(),programId:We}),Cc=et({accounts:xt(We),data:ft(),programId:We}),Pd=or([Cc,Pc]),Cd=or([et({parsed:qn(),program:ft(),programId:ft()}),et({accounts:xt(ft()),data:ft(),programId:ft()})]),Uc=oi(Pd,Cd,r=>"accounts"in r?ii(r,Cc):ii(r,Pc)),Oc=et({signatures:xt(ft()),message:et({accountKeys:xt(Rc),instructions:xt(Uc),recentBlockhash:ft(),addressTableLookups:Nt(vt(xt(Lc)))})}),Jo=et({accountIndex:z(),mint:ft(),owner:Nt(ft()),uiTokenAmount:Ed}),Nc=et({writable:xt(We),readonly:xt(We)}),es=et({err:Wn,fee:z(),innerInstructions:Nt(vt(xt(et({index:z(),instructions:xt(et({accounts:xt(z()),data:ft(),programIdIndex:z()}))})))),preBalances:xt(z()),postBalances:xt(z()),logMessages:Nt(vt(xt(ft()))),preTokenBalances:Nt(vt(xt(Jo))),postTokenBalances:Nt(vt(xt(Jo))),loadedAddresses:Nt(Nc),computeUnitsConsumed:Nt(z())}),za=et({err:Wn,fee:z(),innerInstructions:Nt(vt(xt(et({index:z(),instructions:xt(Uc)})))),preBalances:xt(z()),postBalances:xt(z()),logMessages:Nt(vt(xt(ft()))),preTokenBalances:Nt(vt(xt(Jo))),postTokenBalances:Nt(vt(xt(Jo))),loadedAddresses:Nt(Nc),computeUnitsConsumed:Nt(z())}),li=or([ze(0),ze("legacy")]),Hn=et({pubkey:ft(),lamports:z(),postBalance:vt(z()),rewardType:vt(ft()),commission:Nt(vt(z()))}),mm=Ue(vt(et({blockhash:ft(),previousBlockhash:ft(),parentSlot:z(),transactions:xt(et({transaction:Na,meta:vt(es),version:Nt(li)})),rewards:Nt(xt(Hn)),blockTime:vt(z()),blockHeight:vt(z())}))),wm=Ue(vt(et({blockhash:ft(),previousBlockhash:ft(),parentSlot:z(),rewards:Nt(xt(Hn)),blockTime:vt(z()),blockHeight:vt(z())}))),bm=Ue(vt(et({blockhash:ft(),previousBlockhash:ft(),parentSlot:z(),transactions:xt(et({transaction:Tc,meta:vt(es),version:Nt(li)})),rewards:Nt(xt(Hn)),blockTime:vt(z()),blockHeight:vt(z())}))),xm=Ue(vt(et({blockhash:ft(),previousBlockhash:ft(),parentSlot:z(),transactions:xt(et({transaction:Oc,meta:vt(za),version:Nt(li)})),rewards:Nt(xt(Hn)),blockTime:vt(z()),blockHeight:vt(z())}))),vm=Ue(vt(et({blockhash:ft(),previousBlockhash:ft(),parentSlot:z(),transactions:xt(et({transaction:Tc,meta:vt(za),version:Nt(li)})),rewards:Nt(xt(Hn)),blockTime:vt(z()),blockHeight:vt(z())}))),km=Ue(vt(et({blockhash:ft(),previousBlockhash:ft(),parentSlot:z(),rewards:Nt(xt(Hn)),blockTime:vt(z()),blockHeight:vt(z())}))),Sm=Ue(vt(et({blockhash:ft(),previousBlockhash:ft(),parentSlot:z(),transactions:xt(et({transaction:Na,meta:vt(es)})),rewards:Nt(xt(Hn)),blockTime:vt(z())}))),Bm=Ue(vt(et({blockhash:ft(),previousBlockhash:ft(),parentSlot:z(),signatures:xt(ft()),blockTime:vt(z())}))),Em=Ue(vt(et({slot:z(),meta:vt(es),blockTime:Nt(vt(z())),transaction:Na,version:Nt(li)}))),_m=Ue(vt(et({slot:z(),transaction:Oc,meta:vt(za),blockTime:Nt(vt(z())),version:Nt(li)}))),Am=Ar(et({blockhash:ft(),feeCalculator:et({lamportsPerSignature:z()})})),Mm=Ar(et({blockhash:ft(),lastValidBlockHeight:z()})),Im=Ar(Cr()),Ud=et({slot:z(),numTransactions:z(),numSlots:z(),samplePeriodSecs:z()}),Lm=Ue(xt(Ud)),Rm=Ar(vt(et({feeCalculator:et({lamportsPerSignature:z()})}))),Tm=Ue(ft()),Pm=Ue(ft()),Od=et({err:Wn,logs:xt(ft()),signature:ft()}),Cm=et({result:ts(Od),subscription:z()}),Ur=class{constructor(t){this._keypair=void 0,this._keypair=t??cc()}static generate(){return new Ur(cc())}static fromSecretKey(t,e){if(t.byteLength!==64)throw new Error("bad secret key size");let n=t.slice(32,64);if(!e||!e.skipValidation){let o=t.slice(0,32),f=_a(o);for(let h=0;h<32;h++)if(n[h]!==f[h])throw new Error("provided secretKey is invalid")}return new Ur({publicKey:n,secretKey:t})}static fromSeed(t){let e=_a(t),n=new Uint8Array(64);return n.set(t),n.set(e,32),new Ur({publicKey:e,secretKey:n})}get publicKey(){return new fe(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}},Ci=Object.freeze({CreateLookupTable:{index:0,layout:I.struct([I.u32("instruction"),fi("recentSlot"),I.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:I.struct([I.u32("instruction")])},ExtendLookupTable:{index:2,layout:I.struct([I.u32("instruction"),fi(),I.seq(_e(),I.offset(I.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:I.struct([I.u32("instruction")])},CloseLookupTable:{index:4,layout:I.struct([I.u32("instruction")])}}),Pa=class{constructor(){}static createLookupTable(t){let[e,n]=fe.findProgramAddressSync([t.authority.toBuffer(),(0,Hi.toBufferLE)(BigInt(t.recentSlot),8)],this.programId),o=Ci.CreateLookupTable,f=Se(o,{recentSlot:BigInt(t.recentSlot),bumpSeed:n}),h=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1},{pubkey:t.payer,isSigner:!0,isWritable:!0},{pubkey:Je.programId,isSigner:!1,isWritable:!1}];return[new Ce({programId:this.programId,keys:h,data:f}),e]}static freezeLookupTable(t){let e=Ci.FreezeLookupTable,n=Se(e),o=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return new Ce({programId:this.programId,keys:o,data:n})}static extendLookupTable(t){let e=Ci.ExtendLookupTable,n=Se(e,{addresses:t.addresses.map(f=>f.toBytes())}),o=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return t.payer&&o.push({pubkey:t.payer,isSigner:!0,isWritable:!0},{pubkey:Je.programId,isSigner:!1,isWritable:!1}),new Ce({programId:this.programId,keys:o,data:n})}static deactivateLookupTable(t){let e=Ci.DeactivateLookupTable,n=Se(e),o=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return new Ce({programId:this.programId,keys:o,data:n})}static closeLookupTable(t){let e=Ci.CloseLookupTable,n=Se(e),o=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1},{pubkey:t.recipient,isSigner:!1,isWritable:!0}];return new Ce({programId:this.programId,keys:o,data:n})}};Pa.programId=new fe("AddressLookupTab1e1111111111111111111111111");jo=Object.freeze({RequestUnits:{index:0,layout:I.struct([I.u8("instruction"),I.u32("units"),I.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:I.struct([I.u8("instruction"),I.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:I.struct([I.u8("instruction"),I.u32("units")])},SetComputeUnitPrice:{index:3,layout:I.struct([I.u8("instruction"),fi("microLamports")])}}),Ca=class{constructor(){}static requestUnits(t){let e=jo.RequestUnits,n=Se(e,t);return new Ce({keys:[],programId:this.programId,data:n})}static requestHeapFrame(t){let e=jo.RequestHeapFrame,n=Se(e,t);return new Ce({keys:[],programId:this.programId,data:n})}static setComputeUnitLimit(t){let e=jo.SetComputeUnitLimit,n=Se(e,t);return new Ce({keys:[],programId:this.programId,data:n})}static setComputeUnitPrice(t){let e=jo.SetComputeUnitPrice,n=Se(e,{microLamports:BigInt(t.microLamports)});return new Ce({keys:[],programId:this.programId,data:n})}};Ca.programId=new fe("ComputeBudget111111111111111111111111111111");gc=64,mc=32,wc=64,bc=I.struct([I.u8("numSignatures"),I.u8("padding"),I.u16("signatureOffset"),I.u16("signatureInstructionIndex"),I.u16("publicKeyOffset"),I.u16("publicKeyInstructionIndex"),I.u16("messageDataOffset"),I.u16("messageDataSize"),I.u16("messageInstructionIndex")]),Di=class{constructor(){}static createInstructionWithPublicKey(t){let{publicKey:e,message:n,signature:o,instructionIndex:f}=t;je(e.length===mc,`Public Key must be ${mc} bytes but received ${e.length} bytes`),je(o.length===wc,`Signature must be ${wc} bytes but received ${o.length} bytes`);let h=bc.span,x=h+e.length,b=x+o.length,_=1,E=Yt.Buffer.alloc(b+n.length),L=f??65535;return bc.encode({numSignatures:_,padding:0,signatureOffset:x,signatureInstructionIndex:L,publicKeyOffset:h,publicKeyInstructionIndex:L,messageDataOffset:b,messageDataSize:n.length,messageInstructionIndex:L},E),E.fill(e,h),E.fill(o,x),E.fill(n,b),new Ce({keys:[],programId:Di.programId,data:E})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:n,instructionIndex:o}=t;je(e.length===gc,`Private key must be ${gc} bytes but received ${e.length} bytes`);try{let f=Ur.fromSecretKey(e),h=f.publicKey.toBytes(),x=Sc(n,f.secretKey);return this.createInstructionWithPublicKey({publicKey:h,message:n,signature:x,instructionIndex:o})}catch(f){throw new Error(`Error creating instruction; ${f}`)}}};Di.programId=new fe("Ed25519SigVerify111111111111111111111111111");Nd=(r,t)=>{let e=Pi.sign(r,t);return[e.toCompactRawBytes(),e.recovery]};Pi.utils.isValidPrivateKey;zd=Pi.getPublicKey,xc=32,Sa=20,vc=64,Kd=11,Ba=I.struct([I.u8("numSignatures"),I.u16("signatureOffset"),I.u8("signatureInstructionIndex"),I.u16("ethAddressOffset"),I.u8("ethAddressInstructionIndex"),I.u16("messageDataOffset"),I.u16("messageDataSize"),I.u8("messageInstructionIndex"),I.blob(20,"ethAddress"),I.blob(64,"signature"),I.u8("recoveryId")]),Fn=class{constructor(){}static publicKeyToEthAddress(t){je(t.length===vc,`Public key must be ${vc} bytes but received ${t.length} bytes`);try{return Yt.Buffer.from(ga(Me(t))).slice(-Sa)}catch(e){throw new Error(`Error constructing Ethereum address: ${e}`)}}static createInstructionWithPublicKey(t){let{publicKey:e,message:n,signature:o,recoveryId:f,instructionIndex:h}=t;return Fn.createInstructionWithEthAddress({ethAddress:Fn.publicKeyToEthAddress(e),message:n,signature:o,recoveryId:f,instructionIndex:h})}static createInstructionWithEthAddress(t){let{ethAddress:e,message:n,signature:o,recoveryId:f,instructionIndex:h=0}=t,x;typeof e=="string"?e.startsWith("0x")?x=Yt.Buffer.from(e.substr(2),"hex"):x=Yt.Buffer.from(e,"hex"):x=e,je(x.length===Sa,`Address must be ${Sa} bytes but received ${x.length} bytes`);let b=1+Kd,_=b,E=b+x.length,L=E+o.length+1,O=1,P=Yt.Buffer.alloc(Ba.span+n.length);return Ba.encode({numSignatures:O,signatureOffset:E,signatureInstructionIndex:h,ethAddressOffset:_,ethAddressInstructionIndex:h,messageDataOffset:L,messageDataSize:n.length,messageInstructionIndex:h,signature:Me(o),ethAddress:Me(x),recoveryId:f},P),P.fill(Me(n),Ba.span),new Ce({keys:[],programId:Fn.programId,data:P})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:n,instructionIndex:o}=t;je(e.length===xc,`Private key must be ${xc} bytes but received ${e.length} bytes`);try{let f=Me(e),h=zd(f,!1).slice(1),x=Yt.Buffer.from(ga(Me(n))),[b,_]=Nd(x,f);return this.createInstructionWithPublicKey({publicKey:h,message:n,signature:b,recoveryId:_,instructionIndex:o})}catch(f){throw new Error(`Error creating instruction; ${f}`)}}};Fn.programId=new fe("KeccakSecp256k11111111111111111111111111111");qd=new fe("StakeConfig11111111111111111111111111111111"),Wi=class{constructor(t,e,n){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=e,this.custodian=n}};zc=Wi;Wi.default=new zc(0,0,fe.default);Sn=Object.freeze({Initialize:{index:0,layout:I.struct([I.u32("instruction"),Ql(),td()])},Authorize:{index:1,layout:I.struct([I.u32("instruction"),_e("newAuthorized"),I.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:I.struct([I.u32("instruction")])},Split:{index:3,layout:I.struct([I.u32("instruction"),I.ns64("lamports")])},Withdraw:{index:4,layout:I.struct([I.u32("instruction"),I.ns64("lamports")])},Deactivate:{index:5,layout:I.struct([I.u32("instruction")])},Merge:{index:7,layout:I.struct([I.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:I.struct([I.u32("instruction"),_e("newAuthorized"),I.u32("stakeAuthorizationType"),ai("authoritySeed"),_e("authorityOwner")])}}),Um=Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),Qo=class{constructor(){}static initialize(t){let{stakePubkey:e,authorized:n,lockup:o}=t,f=o||Wi.default,h=Sn.Initialize,x=Se(h,{authorized:{staker:Me(n.staker.toBuffer()),withdrawer:Me(n.withdrawer.toBuffer())},lockup:{unixTimestamp:f.unixTimestamp,epoch:f.epoch,custodian:Me(f.custodian.toBuffer())}}),b={keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:Fi,isSigner:!1,isWritable:!1}],programId:this.programId,data:x};return new Ce(b)}static createAccountWithSeed(t){let e=new Pe;e.add(Je.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:n,authorized:o,lockup:f}=t;return e.add(this.initialize({stakePubkey:n,authorized:o,lockup:f}))}static createAccount(t){let e=new Pe;e.add(Je.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:n,authorized:o,lockup:f}=t;return e.add(this.initialize({stakePubkey:n,authorized:o,lockup:f}))}static delegate(t){let{stakePubkey:e,authorizedPubkey:n,votePubkey:o}=t,f=Sn.Delegate,h=Se(f);return new Pe().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:o,isSigner:!1,isWritable:!1},{pubkey:en,isSigner:!1,isWritable:!1},{pubkey:ka,isSigner:!1,isWritable:!1},{pubkey:qd,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:h})}static authorize(t){let{stakePubkey:e,authorizedPubkey:n,newAuthorizedPubkey:o,stakeAuthorizationType:f,custodianPubkey:h}=t,x=Sn.Authorize,b=Se(x,{newAuthorized:Me(o.toBuffer()),stakeAuthorizationType:f.index}),_=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:en,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return h&&_.push({pubkey:h,isSigner:!0,isWritable:!1}),new Pe().add({keys:_,programId:this.programId,data:b})}static authorizeWithSeed(t){let{stakePubkey:e,authorityBase:n,authoritySeed:o,authorityOwner:f,newAuthorizedPubkey:h,stakeAuthorizationType:x,custodianPubkey:b}=t,_=Sn.AuthorizeWithSeed,E=Se(_,{newAuthorized:Me(h.toBuffer()),stakeAuthorizationType:x.index,authoritySeed:o,authorityOwner:Me(f.toBuffer())}),L=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:en,isSigner:!1,isWritable:!1}];return b&&L.push({pubkey:b,isSigner:!0,isWritable:!1}),new Pe().add({keys:L,programId:this.programId,data:E})}static splitInstruction(t){let{stakePubkey:e,authorizedPubkey:n,splitStakePubkey:o,lamports:f}=t,h=Sn.Split,x=Se(h,{lamports:f});return new Ce({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:o,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:x})}static split(t,e){let n=new Pe;return n.add(Je.createAccount({fromPubkey:t.authorizedPubkey,newAccountPubkey:t.splitStakePubkey,lamports:e,space:this.space,programId:this.programId})),n.add(this.splitInstruction(t))}static splitWithSeed(t,e){let{stakePubkey:n,authorizedPubkey:o,splitStakePubkey:f,basePubkey:h,seed:x,lamports:b}=t,_=new Pe;return _.add(Je.allocate({accountPubkey:f,basePubkey:h,seed:x,space:this.space,programId:this.programId})),e&&e>0&&_.add(Je.transfer({fromPubkey:t.authorizedPubkey,toPubkey:f,lamports:e})),_.add(this.splitInstruction({stakePubkey:n,authorizedPubkey:o,splitStakePubkey:f,lamports:b}))}static merge(t){let{stakePubkey:e,sourceStakePubKey:n,authorizedPubkey:o}=t,f=Sn.Merge,h=Se(f);return new Pe().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:en,isSigner:!1,isWritable:!1},{pubkey:ka,isSigner:!1,isWritable:!1},{pubkey:o,isSigner:!0,isWritable:!1}],programId:this.programId,data:h})}static withdraw(t){let{stakePubkey:e,authorizedPubkey:n,toPubkey:o,lamports:f,custodianPubkey:h}=t,x=Sn.Withdraw,b=Se(x,{lamports:f}),_=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:o,isSigner:!1,isWritable:!0},{pubkey:en,isSigner:!1,isWritable:!1},{pubkey:ka,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return h&&_.push({pubkey:h,isSigner:!0,isWritable:!1}),new Pe().add({keys:_,programId:this.programId,data:b})}static deactivate(t){let{stakePubkey:e,authorizedPubkey:n}=t,o=Sn.Deactivate,f=Se(o);return new Pe().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:en,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:f})}};Qo.programId=new fe("Stake11111111111111111111111111111111111111");Qo.space=200;Ui=Object.freeze({InitializeAccount:{index:0,layout:I.struct([I.u32("instruction"),ed()])},Authorize:{index:1,layout:I.struct([I.u32("instruction"),_e("newAuthorized"),I.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:I.struct([I.u32("instruction"),I.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:I.struct([I.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:I.struct([I.u32("instruction"),rd()])}}),Om=Object.freeze({Voter:{index:0},Withdrawer:{index:1}}),ci=class{constructor(){}static initializeAccount(t){let{votePubkey:e,nodePubkey:n,voteInit:o}=t,f=Ui.InitializeAccount,h=Se(f,{voteInit:{nodePubkey:Me(o.nodePubkey.toBuffer()),authorizedVoter:Me(o.authorizedVoter.toBuffer()),authorizedWithdrawer:Me(o.authorizedWithdrawer.toBuffer()),commission:o.commission}}),x={keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:Fi,isSigner:!1,isWritable:!1},{pubkey:en,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:h};return new Ce(x)}static createAccount(t){let e=new Pe;return e.add(Je.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.votePubkey,lamports:t.lamports,space:this.space,programId:this.programId})),e.add(this.initializeAccount({votePubkey:t.votePubkey,nodePubkey:t.voteInit.nodePubkey,voteInit:t.voteInit}))}static authorize(t){let{votePubkey:e,authorizedPubkey:n,newAuthorizedPubkey:o,voteAuthorizationType:f}=t,h=Ui.Authorize,x=Se(h,{newAuthorized:Me(o.toBuffer()),voteAuthorizationType:f.index}),b=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:en,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return new Pe().add({keys:b,programId:this.programId,data:x})}static authorizeWithSeed(t){let{currentAuthorityDerivedKeyBasePubkey:e,currentAuthorityDerivedKeyOwnerPubkey:n,currentAuthorityDerivedKeySeed:o,newAuthorizedPubkey:f,voteAuthorizationType:h,votePubkey:x}=t,b=Ui.AuthorizeWithSeed,_=Se(b,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:Me(n.toBuffer()),currentAuthorityDerivedKeySeed:o,newAuthorized:Me(f.toBuffer()),voteAuthorizationType:h.index}}),E=[{pubkey:x,isSigner:!1,isWritable:!0},{pubkey:en,isSigner:!1,isWritable:!1},{pubkey:e,isSigner:!0,isWritable:!1}];return new Pe().add({keys:E,programId:this.programId,data:_})}static withdraw(t){let{votePubkey:e,authorizedWithdrawerPubkey:n,lamports:o,toPubkey:f}=t,h=Ui.Withdraw,x=Se(h,{lamports:o}),b=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:f,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return new Pe().add({keys:b,programId:this.programId,data:x})}static safeWithdraw(t,e,n){if(t.lamports>e-n)throw new Error("Withdraw will leave vote account with insufficient funds.");return ci.withdraw(t)}static updateValidatorIdentity(t){let{votePubkey:e,authorizedWithdrawerPubkey:n,nodePubkey:o}=t,f=Ui.UpdateValidatorIdentity,h=Se(f),x=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:o,isSigner:!0,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return new Pe().add({keys:x,programId:this.programId,data:h})}};ci.programId=new fe("Vote111111111111111111111111111111111111111");ci.space=3762;Nm=new fe("Va1idator1nfo111111111111111111111111111111"),zm=et({name:ft(),website:Nt(ft()),details:Nt(ft()),iconUrl:Nt(ft()),keybaseUsername:Nt(ft())}),Km=new fe("Vote111111111111111111111111111111111111111"),qm=I.struct([_e("nodePubkey"),_e("authorizedWithdrawer"),I.u8("commission"),I.nu64(),I.seq(I.struct([I.nu64("slot"),I.u32("confirmationCount")]),I.offset(I.u32(),-8),"votes"),I.u8("rootSlotValid"),I.nu64("rootSlot"),I.nu64(),I.seq(I.struct([I.nu64("epoch"),_e("authorizedVoter")]),I.offset(I.u32(),-8),"authorizedVoters"),I.struct([I.seq(I.struct([_e("authorizedPubkey"),I.nu64("epochOfLastAuthorizedSwitch"),I.nu64("targetEpoch")]),32,"buf"),I.nu64("idx"),I.u8("isEmpty")],"priorVoters"),I.nu64(),I.seq(I.struct([I.nu64("epoch"),I.nu64("credits"),I.nu64("prevCredits")]),I.offset(I.u32(),-8),"epochCredits"),I.struct([I.nu64("slot"),I.nu64("timestamp")],"lastTimestamp")])});function Kc(){let r=Ur.generate();return{privateKey:Buffer.from(r.secretKey).toString("hex"),publicKey:r.publicKey.toString()}}var $m,qc=ae(()=>{"use strict";$m=H(V());Ka()});var Fc=$e(()=>{var jm=H(V())});var Dc=$e((Ym,rs)=>{var Zm=H(V());(function(r){"use strict";var t=function(w){var S,k=new Float64Array(16);if(w)for(S=0;S>24&255,w[S+1]=k>>16&255,w[S+2]=k>>8&255,w[S+3]=k&255,w[S+4]=l>>24&255,w[S+5]=l>>16&255,w[S+6]=l>>8&255,w[S+7]=l&255}function rt(w,S,k,l,B){var M,T=0;for(M=0;M>>8)-1}function D(w,S,k,l){return rt(w,S,k,l,16)}function C(w,S,k,l){return rt(w,S,k,l,32)}function X(w,S,k,l){for(var B=l[0]&255|(l[1]&255)<<8|(l[2]&255)<<16|(l[3]&255)<<24,M=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,T=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,N=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,$=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,Bt=l[4]&255|(l[5]&255)<<8|(l[6]&255)<<16|(l[7]&255)<<24,J=S[0]&255|(S[1]&255)<<8|(S[2]&255)<<16|(S[3]&255)<<24,dt=S[4]&255|(S[5]&255)<<8|(S[6]&255)<<16|(S[7]&255)<<24,pt=S[8]&255|(S[9]&255)<<8|(S[10]&255)<<16|(S[11]&255)<<24,It=S[12]&255|(S[13]&255)<<8|(S[14]&255)<<16|(S[15]&255)<<24,Rt=l[8]&255|(l[9]&255)<<8|(l[10]&255)<<16|(l[11]&255)<<24,qt=k[16]&255|(k[17]&255)<<8|(k[18]&255)<<16|(k[19]&255)<<24,Kt=k[20]&255|(k[21]&255)<<8|(k[22]&255)<<16|(k[23]&255)<<24,Tt=k[24]&255|(k[25]&255)<<8|(k[26]&255)<<16|(k[27]&255)<<24,Ut=k[28]&255|(k[29]&255)<<8|(k[30]&255)<<16|(k[31]&255)<<24,Pt=l[12]&255|(l[13]&255)<<8|(l[14]&255)<<16|(l[15]&255)<<24,mt=B,_t=M,ht=T,wt=N,bt=$,ut=Bt,q=J,F=dt,Q=pt,Y=It,Z=Rt,nt=qt,Ot=Kt,de=Tt,ye=Ut,pe=Pt,A,we=0;we<20;we+=2)A=mt+Ot|0,bt^=A<<7|A>>>32-7,A=bt+mt|0,Q^=A<<9|A>>>32-9,A=Q+bt|0,Ot^=A<<13|A>>>32-13,A=Ot+Q|0,mt^=A<<18|A>>>32-18,A=ut+_t|0,Y^=A<<7|A>>>32-7,A=Y+ut|0,de^=A<<9|A>>>32-9,A=de+Y|0,_t^=A<<13|A>>>32-13,A=_t+de|0,ut^=A<<18|A>>>32-18,A=Z+q|0,ye^=A<<7|A>>>32-7,A=ye+Z|0,ht^=A<<9|A>>>32-9,A=ht+ye|0,q^=A<<13|A>>>32-13,A=q+ht|0,Z^=A<<18|A>>>32-18,A=pe+nt|0,wt^=A<<7|A>>>32-7,A=wt+pe|0,F^=A<<9|A>>>32-9,A=F+wt|0,nt^=A<<13|A>>>32-13,A=nt+F|0,pe^=A<<18|A>>>32-18,A=mt+wt|0,_t^=A<<7|A>>>32-7,A=_t+mt|0,ht^=A<<9|A>>>32-9,A=ht+_t|0,wt^=A<<13|A>>>32-13,A=wt+ht|0,mt^=A<<18|A>>>32-18,A=ut+bt|0,q^=A<<7|A>>>32-7,A=q+ut|0,F^=A<<9|A>>>32-9,A=F+q|0,bt^=A<<13|A>>>32-13,A=bt+F|0,ut^=A<<18|A>>>32-18,A=Z+Y|0,nt^=A<<7|A>>>32-7,A=nt+Z|0,Q^=A<<9|A>>>32-9,A=Q+nt|0,Y^=A<<13|A>>>32-13,A=Y+Q|0,Z^=A<<18|A>>>32-18,A=pe+ye|0,Ot^=A<<7|A>>>32-7,A=Ot+pe|0,de^=A<<9|A>>>32-9,A=de+Ot|0,ye^=A<<13|A>>>32-13,A=ye+de|0,pe^=A<<18|A>>>32-18;mt=mt+B|0,_t=_t+M|0,ht=ht+T|0,wt=wt+N|0,bt=bt+$|0,ut=ut+Bt|0,q=q+J|0,F=F+dt|0,Q=Q+pt|0,Y=Y+It|0,Z=Z+Rt|0,nt=nt+qt|0,Ot=Ot+Kt|0,de=de+Tt|0,ye=ye+Ut|0,pe=pe+Pt|0,w[0]=mt>>>0&255,w[1]=mt>>>8&255,w[2]=mt>>>16&255,w[3]=mt>>>24&255,w[4]=_t>>>0&255,w[5]=_t>>>8&255,w[6]=_t>>>16&255,w[7]=_t>>>24&255,w[8]=ht>>>0&255,w[9]=ht>>>8&255,w[10]=ht>>>16&255,w[11]=ht>>>24&255,w[12]=wt>>>0&255,w[13]=wt>>>8&255,w[14]=wt>>>16&255,w[15]=wt>>>24&255,w[16]=bt>>>0&255,w[17]=bt>>>8&255,w[18]=bt>>>16&255,w[19]=bt>>>24&255,w[20]=ut>>>0&255,w[21]=ut>>>8&255,w[22]=ut>>>16&255,w[23]=ut>>>24&255,w[24]=q>>>0&255,w[25]=q>>>8&255,w[26]=q>>>16&255,w[27]=q>>>24&255,w[28]=F>>>0&255,w[29]=F>>>8&255,w[30]=F>>>16&255,w[31]=F>>>24&255,w[32]=Q>>>0&255,w[33]=Q>>>8&255,w[34]=Q>>>16&255,w[35]=Q>>>24&255,w[36]=Y>>>0&255,w[37]=Y>>>8&255,w[38]=Y>>>16&255,w[39]=Y>>>24&255,w[40]=Z>>>0&255,w[41]=Z>>>8&255,w[42]=Z>>>16&255,w[43]=Z>>>24&255,w[44]=nt>>>0&255,w[45]=nt>>>8&255,w[46]=nt>>>16&255,w[47]=nt>>>24&255,w[48]=Ot>>>0&255,w[49]=Ot>>>8&255,w[50]=Ot>>>16&255,w[51]=Ot>>>24&255,w[52]=de>>>0&255,w[53]=de>>>8&255,w[54]=de>>>16&255,w[55]=de>>>24&255,w[56]=ye>>>0&255,w[57]=ye>>>8&255,w[58]=ye>>>16&255,w[59]=ye>>>24&255,w[60]=pe>>>0&255,w[61]=pe>>>8&255,w[62]=pe>>>16&255,w[63]=pe>>>24&255}function ot(w,S,k,l){for(var B=l[0]&255|(l[1]&255)<<8|(l[2]&255)<<16|(l[3]&255)<<24,M=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,T=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,N=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,$=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,Bt=l[4]&255|(l[5]&255)<<8|(l[6]&255)<<16|(l[7]&255)<<24,J=S[0]&255|(S[1]&255)<<8|(S[2]&255)<<16|(S[3]&255)<<24,dt=S[4]&255|(S[5]&255)<<8|(S[6]&255)<<16|(S[7]&255)<<24,pt=S[8]&255|(S[9]&255)<<8|(S[10]&255)<<16|(S[11]&255)<<24,It=S[12]&255|(S[13]&255)<<8|(S[14]&255)<<16|(S[15]&255)<<24,Rt=l[8]&255|(l[9]&255)<<8|(l[10]&255)<<16|(l[11]&255)<<24,qt=k[16]&255|(k[17]&255)<<8|(k[18]&255)<<16|(k[19]&255)<<24,Kt=k[20]&255|(k[21]&255)<<8|(k[22]&255)<<16|(k[23]&255)<<24,Tt=k[24]&255|(k[25]&255)<<8|(k[26]&255)<<16|(k[27]&255)<<24,Ut=k[28]&255|(k[29]&255)<<8|(k[30]&255)<<16|(k[31]&255)<<24,Pt=l[12]&255|(l[13]&255)<<8|(l[14]&255)<<16|(l[15]&255)<<24,mt=B,_t=M,ht=T,wt=N,bt=$,ut=Bt,q=J,F=dt,Q=pt,Y=It,Z=Rt,nt=qt,Ot=Kt,de=Tt,ye=Ut,pe=Pt,A,we=0;we<20;we+=2)A=mt+Ot|0,bt^=A<<7|A>>>32-7,A=bt+mt|0,Q^=A<<9|A>>>32-9,A=Q+bt|0,Ot^=A<<13|A>>>32-13,A=Ot+Q|0,mt^=A<<18|A>>>32-18,A=ut+_t|0,Y^=A<<7|A>>>32-7,A=Y+ut|0,de^=A<<9|A>>>32-9,A=de+Y|0,_t^=A<<13|A>>>32-13,A=_t+de|0,ut^=A<<18|A>>>32-18,A=Z+q|0,ye^=A<<7|A>>>32-7,A=ye+Z|0,ht^=A<<9|A>>>32-9,A=ht+ye|0,q^=A<<13|A>>>32-13,A=q+ht|0,Z^=A<<18|A>>>32-18,A=pe+nt|0,wt^=A<<7|A>>>32-7,A=wt+pe|0,F^=A<<9|A>>>32-9,A=F+wt|0,nt^=A<<13|A>>>32-13,A=nt+F|0,pe^=A<<18|A>>>32-18,A=mt+wt|0,_t^=A<<7|A>>>32-7,A=_t+mt|0,ht^=A<<9|A>>>32-9,A=ht+_t|0,wt^=A<<13|A>>>32-13,A=wt+ht|0,mt^=A<<18|A>>>32-18,A=ut+bt|0,q^=A<<7|A>>>32-7,A=q+ut|0,F^=A<<9|A>>>32-9,A=F+q|0,bt^=A<<13|A>>>32-13,A=bt+F|0,ut^=A<<18|A>>>32-18,A=Z+Y|0,nt^=A<<7|A>>>32-7,A=nt+Z|0,Q^=A<<9|A>>>32-9,A=Q+nt|0,Y^=A<<13|A>>>32-13,A=Y+Q|0,Z^=A<<18|A>>>32-18,A=pe+ye|0,Ot^=A<<7|A>>>32-7,A=Ot+pe|0,de^=A<<9|A>>>32-9,A=de+Ot|0,ye^=A<<13|A>>>32-13,A=ye+de|0,pe^=A<<18|A>>>32-18;w[0]=mt>>>0&255,w[1]=mt>>>8&255,w[2]=mt>>>16&255,w[3]=mt>>>24&255,w[4]=ut>>>0&255,w[5]=ut>>>8&255,w[6]=ut>>>16&255,w[7]=ut>>>24&255,w[8]=Z>>>0&255,w[9]=Z>>>8&255,w[10]=Z>>>16&255,w[11]=Z>>>24&255,w[12]=pe>>>0&255,w[13]=pe>>>8&255,w[14]=pe>>>16&255,w[15]=pe>>>24&255,w[16]=q>>>0&255,w[17]=q>>>8&255,w[18]=q>>>16&255,w[19]=q>>>24&255,w[20]=F>>>0&255,w[21]=F>>>8&255,w[22]=F>>>16&255,w[23]=F>>>24&255,w[24]=Q>>>0&255,w[25]=Q>>>8&255,w[26]=Q>>>16&255,w[27]=Q>>>24&255,w[28]=Y>>>0&255,w[29]=Y>>>8&255,w[30]=Y>>>16&255,w[31]=Y>>>24&255}function j(w,S,k,l){X(w,S,k,l)}function it(w,S,k,l){ot(w,S,k,l)}var kt=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function st(w,S,k,l,B,M,T){var N=new Uint8Array(16),$=new Uint8Array(64),Bt,J;for(J=0;J<16;J++)N[J]=0;for(J=0;J<8;J++)N[J]=M[J];for(;B>=64;){for(j($,N,T,kt),J=0;J<64;J++)w[S+J]=k[l+J]^$[J];for(Bt=1,J=8;J<16;J++)Bt=Bt+(N[J]&255)|0,N[J]=Bt&255,Bt>>>=8;B-=64,S+=64,l+=64}if(B>0)for(j($,N,T,kt),J=0;J=64;){for(j(T,M,B,kt),$=0;$<64;$++)w[S+$]=T[$];for(N=1,$=8;$<16;$++)N=N+(M[$]&255)|0,M[$]=N&255,N>>>=8;k-=64,S+=64}if(k>0)for(j(T,M,B,kt),$=0;$>>13|k<<3)&8191,l=w[4]&255|(w[5]&255)<<8,this.r[2]=(k>>>10|l<<6)&7939,B=w[6]&255|(w[7]&255)<<8,this.r[3]=(l>>>7|B<<9)&8191,M=w[8]&255|(w[9]&255)<<8,this.r[4]=(B>>>4|M<<12)&255,this.r[5]=M>>>1&8190,T=w[10]&255|(w[11]&255)<<8,this.r[6]=(M>>>14|T<<2)&8191,N=w[12]&255|(w[13]&255)<<8,this.r[7]=(T>>>11|N<<5)&8065,$=w[14]&255|(w[15]&255)<<8,this.r[8]=(N>>>8|$<<8)&8191,this.r[9]=$>>>5&127,this.pad[0]=w[16]&255|(w[17]&255)<<8,this.pad[1]=w[18]&255|(w[19]&255)<<8,this.pad[2]=w[20]&255|(w[21]&255)<<8,this.pad[3]=w[22]&255|(w[23]&255)<<8,this.pad[4]=w[24]&255|(w[25]&255)<<8,this.pad[5]=w[26]&255|(w[27]&255)<<8,this.pad[6]=w[28]&255|(w[29]&255)<<8,this.pad[7]=w[30]&255|(w[31]&255)<<8};be.prototype.blocks=function(w,S,k){for(var l=this.fin?0:2048,B,M,T,N,$,Bt,J,dt,pt,It,Rt,qt,Kt,Tt,Ut,Pt,mt,_t,ht,wt=this.h[0],bt=this.h[1],ut=this.h[2],q=this.h[3],F=this.h[4],Q=this.h[5],Y=this.h[6],Z=this.h[7],nt=this.h[8],Ot=this.h[9],de=this.r[0],ye=this.r[1],pe=this.r[2],A=this.r[3],we=this.r[4],Be=this.r[5],Ee=this.r[6],me=this.r[7],ve=this.r[8],ke=this.r[9];k>=16;)B=w[S+0]&255|(w[S+1]&255)<<8,wt+=B&8191,M=w[S+2]&255|(w[S+3]&255)<<8,bt+=(B>>>13|M<<3)&8191,T=w[S+4]&255|(w[S+5]&255)<<8,ut+=(M>>>10|T<<6)&8191,N=w[S+6]&255|(w[S+7]&255)<<8,q+=(T>>>7|N<<9)&8191,$=w[S+8]&255|(w[S+9]&255)<<8,F+=(N>>>4|$<<12)&8191,Q+=$>>>1&8191,Bt=w[S+10]&255|(w[S+11]&255)<<8,Y+=($>>>14|Bt<<2)&8191,J=w[S+12]&255|(w[S+13]&255)<<8,Z+=(Bt>>>11|J<<5)&8191,dt=w[S+14]&255|(w[S+15]&255)<<8,nt+=(J>>>8|dt<<8)&8191,Ot+=dt>>>5|l,pt=0,It=pt,It+=wt*de,It+=bt*(5*ke),It+=ut*(5*ve),It+=q*(5*me),It+=F*(5*Ee),pt=It>>>13,It&=8191,It+=Q*(5*Be),It+=Y*(5*we),It+=Z*(5*A),It+=nt*(5*pe),It+=Ot*(5*ye),pt+=It>>>13,It&=8191,Rt=pt,Rt+=wt*ye,Rt+=bt*de,Rt+=ut*(5*ke),Rt+=q*(5*ve),Rt+=F*(5*me),pt=Rt>>>13,Rt&=8191,Rt+=Q*(5*Ee),Rt+=Y*(5*Be),Rt+=Z*(5*we),Rt+=nt*(5*A),Rt+=Ot*(5*pe),pt+=Rt>>>13,Rt&=8191,qt=pt,qt+=wt*pe,qt+=bt*ye,qt+=ut*de,qt+=q*(5*ke),qt+=F*(5*ve),pt=qt>>>13,qt&=8191,qt+=Q*(5*me),qt+=Y*(5*Ee),qt+=Z*(5*Be),qt+=nt*(5*we),qt+=Ot*(5*A),pt+=qt>>>13,qt&=8191,Kt=pt,Kt+=wt*A,Kt+=bt*pe,Kt+=ut*ye,Kt+=q*de,Kt+=F*(5*ke),pt=Kt>>>13,Kt&=8191,Kt+=Q*(5*ve),Kt+=Y*(5*me),Kt+=Z*(5*Ee),Kt+=nt*(5*Be),Kt+=Ot*(5*we),pt+=Kt>>>13,Kt&=8191,Tt=pt,Tt+=wt*we,Tt+=bt*A,Tt+=ut*pe,Tt+=q*ye,Tt+=F*de,pt=Tt>>>13,Tt&=8191,Tt+=Q*(5*ke),Tt+=Y*(5*ve),Tt+=Z*(5*me),Tt+=nt*(5*Ee),Tt+=Ot*(5*Be),pt+=Tt>>>13,Tt&=8191,Ut=pt,Ut+=wt*Be,Ut+=bt*we,Ut+=ut*A,Ut+=q*pe,Ut+=F*ye,pt=Ut>>>13,Ut&=8191,Ut+=Q*de,Ut+=Y*(5*ke),Ut+=Z*(5*ve),Ut+=nt*(5*me),Ut+=Ot*(5*Ee),pt+=Ut>>>13,Ut&=8191,Pt=pt,Pt+=wt*Ee,Pt+=bt*Be,Pt+=ut*we,Pt+=q*A,Pt+=F*pe,pt=Pt>>>13,Pt&=8191,Pt+=Q*ye,Pt+=Y*de,Pt+=Z*(5*ke),Pt+=nt*(5*ve),Pt+=Ot*(5*me),pt+=Pt>>>13,Pt&=8191,mt=pt,mt+=wt*me,mt+=bt*Ee,mt+=ut*Be,mt+=q*we,mt+=F*A,pt=mt>>>13,mt&=8191,mt+=Q*pe,mt+=Y*ye,mt+=Z*de,mt+=nt*(5*ke),mt+=Ot*(5*ve),pt+=mt>>>13,mt&=8191,_t=pt,_t+=wt*ve,_t+=bt*me,_t+=ut*Ee,_t+=q*Be,_t+=F*we,pt=_t>>>13,_t&=8191,_t+=Q*A,_t+=Y*pe,_t+=Z*ye,_t+=nt*de,_t+=Ot*(5*ke),pt+=_t>>>13,_t&=8191,ht=pt,ht+=wt*ke,ht+=bt*ve,ht+=ut*me,ht+=q*Ee,ht+=F*Be,pt=ht>>>13,ht&=8191,ht+=Q*we,ht+=Y*A,ht+=Z*pe,ht+=nt*ye,ht+=Ot*de,pt+=ht>>>13,ht&=8191,pt=(pt<<2)+pt|0,pt=pt+It|0,It=pt&8191,pt=pt>>>13,Rt+=pt,wt=It,bt=Rt,ut=qt,q=Kt,F=Tt,Q=Ut,Y=Pt,Z=mt,nt=_t,Ot=ht,S+=16,k-=16;this.h[0]=wt,this.h[1]=bt,this.h[2]=ut,this.h[3]=q,this.h[4]=F,this.h[5]=Q,this.h[6]=Y,this.h[7]=Z,this.h[8]=nt,this.h[9]=Ot},be.prototype.finish=function(w,S){var k=new Uint16Array(10),l,B,M,T;if(this.leftover){for(T=this.leftover,this.buffer[T++]=1;T<16;T++)this.buffer[T]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(l=this.h[1]>>>13,this.h[1]&=8191,T=2;T<10;T++)this.h[T]+=l,l=this.h[T]>>>13,this.h[T]&=8191;for(this.h[0]+=l*5,l=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=l,l=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=l,k[0]=this.h[0]+5,l=k[0]>>>13,k[0]&=8191,T=1;T<10;T++)k[T]=this.h[T]+l,l=k[T]>>>13,k[T]&=8191;for(k[9]-=8192,B=(l^1)-1,T=0;T<10;T++)k[T]&=B;for(B=~B,T=0;T<10;T++)this.h[T]=this.h[T]&B|k[T];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,M=this.h[0]+this.pad[0],this.h[0]=M&65535,T=1;T<8;T++)M=(this.h[T]+this.pad[T]|0)+(M>>>16)|0,this.h[T]=M&65535;w[S+0]=this.h[0]>>>0&255,w[S+1]=this.h[0]>>>8&255,w[S+2]=this.h[1]>>>0&255,w[S+3]=this.h[1]>>>8&255,w[S+4]=this.h[2]>>>0&255,w[S+5]=this.h[2]>>>8&255,w[S+6]=this.h[3]>>>0&255,w[S+7]=this.h[3]>>>8&255,w[S+8]=this.h[4]>>>0&255,w[S+9]=this.h[4]>>>8&255,w[S+10]=this.h[5]>>>0&255,w[S+11]=this.h[5]>>>8&255,w[S+12]=this.h[6]>>>0&255,w[S+13]=this.h[6]>>>8&255,w[S+14]=this.h[7]>>>0&255,w[S+15]=this.h[7]>>>8&255},be.prototype.update=function(w,S,k){var l,B;if(this.leftover){for(B=16-this.leftover,B>k&&(B=k),l=0;l=16&&(B=k-k%16,this.blocks(w,S,B),S+=B,k-=B),k){for(l=0;l>16&1),M[k-1]&=65535;M[15]=T[15]-32767-(M[14]>>16&1),B=M[15]>>16&1,M[14]&=65535,c(T,M,1-B)}for(k=0;k<16;k++)w[2*k]=T[k]&255,w[2*k+1]=T[k]>>8}function m(w,S){var k=new Uint8Array(32),l=new Uint8Array(32);return d(k,w),d(l,S),C(k,0,l,0)}function v(w){var S=new Uint8Array(32);return d(S,w),S[0]&1}function p(w,S){var k;for(k=0;k<16;k++)w[k]=S[2*k]+(S[2*k+1]<<8);w[15]&=32767}function s(w,S,k){for(var l=0;l<16;l++)w[l]=S[l]+k[l]}function y(w,S,k){for(var l=0;l<16;l++)w[l]=S[l]-k[l]}function R(w,S,k){var l,B,M=0,T=0,N=0,$=0,Bt=0,J=0,dt=0,pt=0,It=0,Rt=0,qt=0,Kt=0,Tt=0,Ut=0,Pt=0,mt=0,_t=0,ht=0,wt=0,bt=0,ut=0,q=0,F=0,Q=0,Y=0,Z=0,nt=0,Ot=0,de=0,ye=0,pe=0,A=k[0],we=k[1],Be=k[2],Ee=k[3],me=k[4],ve=k[5],ke=k[6],He=k[7],Le=k[8],qe=k[9],Fe=k[10],De=k[11],Ve=k[12],er=k[13],rr=k[14],nr=k[15];l=S[0],M+=l*A,T+=l*we,N+=l*Be,$+=l*Ee,Bt+=l*me,J+=l*ve,dt+=l*ke,pt+=l*He,It+=l*Le,Rt+=l*qe,qt+=l*Fe,Kt+=l*De,Tt+=l*Ve,Ut+=l*er,Pt+=l*rr,mt+=l*nr,l=S[1],T+=l*A,N+=l*we,$+=l*Be,Bt+=l*Ee,J+=l*me,dt+=l*ve,pt+=l*ke,It+=l*He,Rt+=l*Le,qt+=l*qe,Kt+=l*Fe,Tt+=l*De,Ut+=l*Ve,Pt+=l*er,mt+=l*rr,_t+=l*nr,l=S[2],N+=l*A,$+=l*we,Bt+=l*Be,J+=l*Ee,dt+=l*me,pt+=l*ve,It+=l*ke,Rt+=l*He,qt+=l*Le,Kt+=l*qe,Tt+=l*Fe,Ut+=l*De,Pt+=l*Ve,mt+=l*er,_t+=l*rr,ht+=l*nr,l=S[3],$+=l*A,Bt+=l*we,J+=l*Be,dt+=l*Ee,pt+=l*me,It+=l*ve,Rt+=l*ke,qt+=l*He,Kt+=l*Le,Tt+=l*qe,Ut+=l*Fe,Pt+=l*De,mt+=l*Ve,_t+=l*er,ht+=l*rr,wt+=l*nr,l=S[4],Bt+=l*A,J+=l*we,dt+=l*Be,pt+=l*Ee,It+=l*me,Rt+=l*ve,qt+=l*ke,Kt+=l*He,Tt+=l*Le,Ut+=l*qe,Pt+=l*Fe,mt+=l*De,_t+=l*Ve,ht+=l*er,wt+=l*rr,bt+=l*nr,l=S[5],J+=l*A,dt+=l*we,pt+=l*Be,It+=l*Ee,Rt+=l*me,qt+=l*ve,Kt+=l*ke,Tt+=l*He,Ut+=l*Le,Pt+=l*qe,mt+=l*Fe,_t+=l*De,ht+=l*Ve,wt+=l*er,bt+=l*rr,ut+=l*nr,l=S[6],dt+=l*A,pt+=l*we,It+=l*Be,Rt+=l*Ee,qt+=l*me,Kt+=l*ve,Tt+=l*ke,Ut+=l*He,Pt+=l*Le,mt+=l*qe,_t+=l*Fe,ht+=l*De,wt+=l*Ve,bt+=l*er,ut+=l*rr,q+=l*nr,l=S[7],pt+=l*A,It+=l*we,Rt+=l*Be,qt+=l*Ee,Kt+=l*me,Tt+=l*ve,Ut+=l*ke,Pt+=l*He,mt+=l*Le,_t+=l*qe,ht+=l*Fe,wt+=l*De,bt+=l*Ve,ut+=l*er,q+=l*rr,F+=l*nr,l=S[8],It+=l*A,Rt+=l*we,qt+=l*Be,Kt+=l*Ee,Tt+=l*me,Ut+=l*ve,Pt+=l*ke,mt+=l*He,_t+=l*Le,ht+=l*qe,wt+=l*Fe,bt+=l*De,ut+=l*Ve,q+=l*er,F+=l*rr,Q+=l*nr,l=S[9],Rt+=l*A,qt+=l*we,Kt+=l*Be,Tt+=l*Ee,Ut+=l*me,Pt+=l*ve,mt+=l*ke,_t+=l*He,ht+=l*Le,wt+=l*qe,bt+=l*Fe,ut+=l*De,q+=l*Ve,F+=l*er,Q+=l*rr,Y+=l*nr,l=S[10],qt+=l*A,Kt+=l*we,Tt+=l*Be,Ut+=l*Ee,Pt+=l*me,mt+=l*ve,_t+=l*ke,ht+=l*He,wt+=l*Le,bt+=l*qe,ut+=l*Fe,q+=l*De,F+=l*Ve,Q+=l*er,Y+=l*rr,Z+=l*nr,l=S[11],Kt+=l*A,Tt+=l*we,Ut+=l*Be,Pt+=l*Ee,mt+=l*me,_t+=l*ve,ht+=l*ke,wt+=l*He,bt+=l*Le,ut+=l*qe,q+=l*Fe,F+=l*De,Q+=l*Ve,Y+=l*er,Z+=l*rr,nt+=l*nr,l=S[12],Tt+=l*A,Ut+=l*we,Pt+=l*Be,mt+=l*Ee,_t+=l*me,ht+=l*ve,wt+=l*ke,bt+=l*He,ut+=l*Le,q+=l*qe,F+=l*Fe,Q+=l*De,Y+=l*Ve,Z+=l*er,nt+=l*rr,Ot+=l*nr,l=S[13],Ut+=l*A,Pt+=l*we,mt+=l*Be,_t+=l*Ee,ht+=l*me,wt+=l*ve,bt+=l*ke,ut+=l*He,q+=l*Le,F+=l*qe,Q+=l*Fe,Y+=l*De,Z+=l*Ve,nt+=l*er,Ot+=l*rr,de+=l*nr,l=S[14],Pt+=l*A,mt+=l*we,_t+=l*Be,ht+=l*Ee,wt+=l*me,bt+=l*ve,ut+=l*ke,q+=l*He,F+=l*Le,Q+=l*qe,Y+=l*Fe,Z+=l*De,nt+=l*Ve,Ot+=l*er,de+=l*rr,ye+=l*nr,l=S[15],mt+=l*A,_t+=l*we,ht+=l*Be,wt+=l*Ee,bt+=l*me,ut+=l*ve,q+=l*ke,F+=l*He,Q+=l*Le,Y+=l*qe,Z+=l*Fe,nt+=l*De,Ot+=l*Ve,de+=l*er,ye+=l*rr,pe+=l*nr,M+=38*_t,T+=38*ht,N+=38*wt,$+=38*bt,Bt+=38*ut,J+=38*q,dt+=38*F,pt+=38*Q,It+=38*Y,Rt+=38*Z,qt+=38*nt,Kt+=38*Ot,Tt+=38*de,Ut+=38*ye,Pt+=38*pe,B=1,l=M+B+65535,B=Math.floor(l/65536),M=l-B*65536,l=T+B+65535,B=Math.floor(l/65536),T=l-B*65536,l=N+B+65535,B=Math.floor(l/65536),N=l-B*65536,l=$+B+65535,B=Math.floor(l/65536),$=l-B*65536,l=Bt+B+65535,B=Math.floor(l/65536),Bt=l-B*65536,l=J+B+65535,B=Math.floor(l/65536),J=l-B*65536,l=dt+B+65535,B=Math.floor(l/65536),dt=l-B*65536,l=pt+B+65535,B=Math.floor(l/65536),pt=l-B*65536,l=It+B+65535,B=Math.floor(l/65536),It=l-B*65536,l=Rt+B+65535,B=Math.floor(l/65536),Rt=l-B*65536,l=qt+B+65535,B=Math.floor(l/65536),qt=l-B*65536,l=Kt+B+65535,B=Math.floor(l/65536),Kt=l-B*65536,l=Tt+B+65535,B=Math.floor(l/65536),Tt=l-B*65536,l=Ut+B+65535,B=Math.floor(l/65536),Ut=l-B*65536,l=Pt+B+65535,B=Math.floor(l/65536),Pt=l-B*65536,l=mt+B+65535,B=Math.floor(l/65536),mt=l-B*65536,M+=B-1+37*(B-1),B=1,l=M+B+65535,B=Math.floor(l/65536),M=l-B*65536,l=T+B+65535,B=Math.floor(l/65536),T=l-B*65536,l=N+B+65535,B=Math.floor(l/65536),N=l-B*65536,l=$+B+65535,B=Math.floor(l/65536),$=l-B*65536,l=Bt+B+65535,B=Math.floor(l/65536),Bt=l-B*65536,l=J+B+65535,B=Math.floor(l/65536),J=l-B*65536,l=dt+B+65535,B=Math.floor(l/65536),dt=l-B*65536,l=pt+B+65535,B=Math.floor(l/65536),pt=l-B*65536,l=It+B+65535,B=Math.floor(l/65536),It=l-B*65536,l=Rt+B+65535,B=Math.floor(l/65536),Rt=l-B*65536,l=qt+B+65535,B=Math.floor(l/65536),qt=l-B*65536,l=Kt+B+65535,B=Math.floor(l/65536),Kt=l-B*65536,l=Tt+B+65535,B=Math.floor(l/65536),Tt=l-B*65536,l=Ut+B+65535,B=Math.floor(l/65536),Ut=l-B*65536,l=Pt+B+65535,B=Math.floor(l/65536),Pt=l-B*65536,l=mt+B+65535,B=Math.floor(l/65536),mt=l-B*65536,M+=B-1+37*(B-1),w[0]=M,w[1]=T,w[2]=N,w[3]=$,w[4]=Bt,w[5]=J,w[6]=dt,w[7]=pt,w[8]=It,w[9]=Rt,w[10]=qt,w[11]=Kt,w[12]=Tt,w[13]=Ut,w[14]=Pt,w[15]=mt}function U(w,S){R(w,S,S)}function W(w,S){var k=t(),l;for(l=0;l<16;l++)k[l]=S[l];for(l=253;l>=0;l--)U(k,k),l!==2&&l!==4&&R(k,k,S);for(l=0;l<16;l++)w[l]=k[l]}function tt(w,S){var k=t(),l;for(l=0;l<16;l++)k[l]=S[l];for(l=250;l>=0;l--)U(k,k),l!==1&&R(k,k,S);for(l=0;l<16;l++)w[l]=k[l]}function at(w,S,k){var l=new Uint8Array(32),B=new Float64Array(80),M,T,N=t(),$=t(),Bt=t(),J=t(),dt=t(),pt=t();for(T=0;T<31;T++)l[T]=S[T];for(l[31]=S[31]&127|64,l[0]&=248,p(B,k),T=0;T<16;T++)$[T]=B[T],J[T]=N[T]=Bt[T]=0;for(N[0]=J[0]=1,T=254;T>=0;--T)M=l[T>>>3]>>>(T&7)&1,c(N,$,M),c(Bt,J,M),s(dt,N,Bt),y(N,N,Bt),s(Bt,$,J),y($,$,J),U(J,dt),U(pt,N),R(N,Bt,N),R(Bt,$,dt),s(dt,N,Bt),y(N,N,Bt),U($,N),y(Bt,J,pt),R(N,Bt,x),s(N,N,J),R(Bt,Bt,N),R(N,J,pt),R(J,$,B),U($,dt),c(N,$,M),c(Bt,J,M);for(T=0;T<16;T++)B[T+16]=N[T],B[T+32]=Bt[T],B[T+48]=$[T],B[T+64]=J[T];var It=B.subarray(32),Rt=B.subarray(16);return W(It,It),R(Rt,Rt,It),d(w,Rt),0}function lt(w,S){return at(w,S,o)}function xe(w,S){return e(S,32),lt(w,S)}function gt(w,S,k){var l=new Uint8Array(32);return at(l,k,S),it(w,n,l,kt)}var St=g,Ye=i;function Ct(w,S,k,l,B,M){var T=new Uint8Array(32);return gt(T,B,M),St(w,S,k,l,T)}function Ft(w,S,k,l,B,M){var T=new Uint8Array(32);return gt(T,B,M),Ye(w,S,k,l,T)}var Or=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function ee(w,S,k,l){for(var B=new Int32Array(16),M=new Int32Array(16),T,N,$,Bt,J,dt,pt,It,Rt,qt,Kt,Tt,Ut,Pt,mt,_t,ht,wt,bt,ut,q,F,Q,Y,Z,nt,Ot=w[0],de=w[1],ye=w[2],pe=w[3],A=w[4],we=w[5],Be=w[6],Ee=w[7],me=S[0],ve=S[1],ke=S[2],He=S[3],Le=S[4],qe=S[5],Fe=S[6],De=S[7],Ve=0;l>=128;){for(bt=0;bt<16;bt++)ut=8*bt+Ve,B[bt]=k[ut+0]<<24|k[ut+1]<<16|k[ut+2]<<8|k[ut+3],M[bt]=k[ut+4]<<24|k[ut+5]<<16|k[ut+6]<<8|k[ut+7];for(bt=0;bt<80;bt++)if(T=Ot,N=de,$=ye,Bt=pe,J=A,dt=we,pt=Be,It=Ee,Rt=me,qt=ve,Kt=ke,Tt=He,Ut=Le,Pt=qe,mt=Fe,_t=De,q=Ee,F=De,Q=F&65535,Y=F>>>16,Z=q&65535,nt=q>>>16,q=(A>>>14|Le<<32-14)^(A>>>18|Le<<32-18)^(Le>>>41-32|A<<32-(41-32)),F=(Le>>>14|A<<32-14)^(Le>>>18|A<<32-18)^(A>>>41-32|Le<<32-(41-32)),Q+=F&65535,Y+=F>>>16,Z+=q&65535,nt+=q>>>16,q=A&we^~A&Be,F=Le&qe^~Le&Fe,Q+=F&65535,Y+=F>>>16,Z+=q&65535,nt+=q>>>16,q=Or[bt*2],F=Or[bt*2+1],Q+=F&65535,Y+=F>>>16,Z+=q&65535,nt+=q>>>16,q=B[bt%16],F=M[bt%16],Q+=F&65535,Y+=F>>>16,Z+=q&65535,nt+=q>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,ht=Z&65535|nt<<16,wt=Q&65535|Y<<16,q=ht,F=wt,Q=F&65535,Y=F>>>16,Z=q&65535,nt=q>>>16,q=(Ot>>>28|me<<32-28)^(me>>>34-32|Ot<<32-(34-32))^(me>>>39-32|Ot<<32-(39-32)),F=(me>>>28|Ot<<32-28)^(Ot>>>34-32|me<<32-(34-32))^(Ot>>>39-32|me<<32-(39-32)),Q+=F&65535,Y+=F>>>16,Z+=q&65535,nt+=q>>>16,q=Ot&de^Ot&ye^de&ye,F=me&ve^me&ke^ve&ke,Q+=F&65535,Y+=F>>>16,Z+=q&65535,nt+=q>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,It=Z&65535|nt<<16,_t=Q&65535|Y<<16,q=Bt,F=Tt,Q=F&65535,Y=F>>>16,Z=q&65535,nt=q>>>16,q=ht,F=wt,Q+=F&65535,Y+=F>>>16,Z+=q&65535,nt+=q>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,Bt=Z&65535|nt<<16,Tt=Q&65535|Y<<16,de=T,ye=N,pe=$,A=Bt,we=J,Be=dt,Ee=pt,Ot=It,ve=Rt,ke=qt,He=Kt,Le=Tt,qe=Ut,Fe=Pt,De=mt,me=_t,bt%16===15)for(ut=0;ut<16;ut++)q=B[ut],F=M[ut],Q=F&65535,Y=F>>>16,Z=q&65535,nt=q>>>16,q=B[(ut+9)%16],F=M[(ut+9)%16],Q+=F&65535,Y+=F>>>16,Z+=q&65535,nt+=q>>>16,ht=B[(ut+1)%16],wt=M[(ut+1)%16],q=(ht>>>1|wt<<32-1)^(ht>>>8|wt<<32-8)^ht>>>7,F=(wt>>>1|ht<<32-1)^(wt>>>8|ht<<32-8)^(wt>>>7|ht<<32-7),Q+=F&65535,Y+=F>>>16,Z+=q&65535,nt+=q>>>16,ht=B[(ut+14)%16],wt=M[(ut+14)%16],q=(ht>>>19|wt<<32-19)^(wt>>>61-32|ht<<32-(61-32))^ht>>>6,F=(wt>>>19|ht<<32-19)^(ht>>>61-32|wt<<32-(61-32))^(wt>>>6|ht<<32-6),Q+=F&65535,Y+=F>>>16,Z+=q&65535,nt+=q>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,B[ut]=Z&65535|nt<<16,M[ut]=Q&65535|Y<<16;q=Ot,F=me,Q=F&65535,Y=F>>>16,Z=q&65535,nt=q>>>16,q=w[0],F=S[0],Q+=F&65535,Y+=F>>>16,Z+=q&65535,nt+=q>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,w[0]=Ot=Z&65535|nt<<16,S[0]=me=Q&65535|Y<<16,q=de,F=ve,Q=F&65535,Y=F>>>16,Z=q&65535,nt=q>>>16,q=w[1],F=S[1],Q+=F&65535,Y+=F>>>16,Z+=q&65535,nt+=q>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,w[1]=de=Z&65535|nt<<16,S[1]=ve=Q&65535|Y<<16,q=ye,F=ke,Q=F&65535,Y=F>>>16,Z=q&65535,nt=q>>>16,q=w[2],F=S[2],Q+=F&65535,Y+=F>>>16,Z+=q&65535,nt+=q>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,w[2]=ye=Z&65535|nt<<16,S[2]=ke=Q&65535|Y<<16,q=pe,F=He,Q=F&65535,Y=F>>>16,Z=q&65535,nt=q>>>16,q=w[3],F=S[3],Q+=F&65535,Y+=F>>>16,Z+=q&65535,nt+=q>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,w[3]=pe=Z&65535|nt<<16,S[3]=He=Q&65535|Y<<16,q=A,F=Le,Q=F&65535,Y=F>>>16,Z=q&65535,nt=q>>>16,q=w[4],F=S[4],Q+=F&65535,Y+=F>>>16,Z+=q&65535,nt+=q>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,w[4]=A=Z&65535|nt<<16,S[4]=Le=Q&65535|Y<<16,q=we,F=qe,Q=F&65535,Y=F>>>16,Z=q&65535,nt=q>>>16,q=w[5],F=S[5],Q+=F&65535,Y+=F>>>16,Z+=q&65535,nt+=q>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,w[5]=we=Z&65535|nt<<16,S[5]=qe=Q&65535|Y<<16,q=Be,F=Fe,Q=F&65535,Y=F>>>16,Z=q&65535,nt=q>>>16,q=w[6],F=S[6],Q+=F&65535,Y+=F>>>16,Z+=q&65535,nt+=q>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,w[6]=Be=Z&65535|nt<<16,S[6]=Fe=Q&65535|Y<<16,q=Ee,F=De,Q=F&65535,Y=F>>>16,Z=q&65535,nt=q>>>16,q=w[7],F=S[7],Q+=F&65535,Y+=F>>>16,Z+=q&65535,nt+=q>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,w[7]=Ee=Z&65535|nt<<16,S[7]=De=Q&65535|Y<<16,Ve+=128,l-=128}return l}function zt(w,S,k){var l=new Int32Array(8),B=new Int32Array(8),M=new Uint8Array(256),T,N=k;for(l[0]=1779033703,l[1]=3144134277,l[2]=1013904242,l[3]=2773480762,l[4]=1359893119,l[5]=2600822924,l[6]=528734635,l[7]=1541459225,B[0]=4089235720,B[1]=2227873595,B[2]=4271175723,B[3]=1595750129,B[4]=2917565137,B[5]=725511199,B[6]=4215389547,B[7]=327033209,ee(l,B,S,k),k%=128,T=0;T=0;--B)l=k[B/8|0]>>(B&7)&1,Zt(w,S,l),kr(S,w),kr(w,w),Zt(w,S,l)}function Dt(w,S){var k=[t(),t(),t(),t()];a(k[0],E),a(k[1],L),a(k[2],h),R(k[3],E,L),br(w,k,S)}function $t(w,S,k){var l=new Uint8Array(64),B=[t(),t(),t(),t()],M;for(k||e(S,32),zt(l,S,32),l[0]&=248,l[31]&=127,l[31]|=64,Dt(B,l),Ht(w,B),M=0;M<32;M++)S[M+32]=w[M];return 0}var xr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Vt(w,S){var k,l,B,M;for(l=63;l>=32;--l){for(k=0,B=l-32,M=l-12;B>4)*xr[B],k=S[B]>>8,S[B]&=255;for(B=0;B<32;B++)S[B]-=k*xr[B];for(l=0;l<32;l++)S[l+1]+=S[l]>>8,w[l]=S[l]&255}function Gt(w){var S=new Float64Array(64),k;for(k=0;k<64;k++)S[k]=w[k];for(k=0;k<64;k++)w[k]=0;Vt(w,S)}function Nr(w,S,k,l){var B=new Uint8Array(64),M=new Uint8Array(64),T=new Uint8Array(64),N,$,Bt=new Float64Array(64),J=[t(),t(),t(),t()];zt(B,l,32),B[0]&=248,B[31]&=127,B[31]|=64;var dt=k+64;for(N=0;N>7&&y(w[0],f,w[0]),R(w[3],w[0],w[1]),0)}function Xt(w,S,k,l){var B,M=new Uint8Array(32),T=new Uint8Array(64),N=[t(),t(),t(),t()],$=[t(),t(),t(),t()];if(k<64||ie($,l))return-1;for(B=0;B=0},r.sign.keyPair=function(){var w=new Uint8Array(Wt),S=new Uint8Array(jt);return $t(w,S),{publicKey:w,secretKey:S}},r.sign.keyPair.fromSecretKey=function(w){if(Mt(w),w.length!==jt)throw new Error("bad secret key size");for(var S=new Uint8Array(Wt),k=0;k{"use strict";tw=H(V()),qa=H(An());Ka();Fa=H(Dc())});async function Wd({action:r,accessControlConditions:t}){let{network:e,generateKeyParams:n}=r,o=r.signMessageParams?.messageToSign,f=xf(),[h,x]=await Promise.all([ds({accessControlConditions:t,publicKey:f.publicKey,privateKey:f.privateKey}),o?kf({messageToSign:o,privateKey:f.privateKey}):Promise.resolve()]);return{network:e,generateEncryptedPrivateKey:{...h,memo:n.memo},...x?{signMessage:{signature:x}}:{}}}async function Hd({action:r,accessControlConditions:t}){let{network:e,generateKeyParams:n}=r,o=r.signMessageParams?.messageToSign,f=Kc(),[h,x]=await Promise.all([ds({accessControlConditions:t,publicKey:f.publicKey,privateKey:f.privateKey}),o?Wc({messageToSign:o,privateKey:f.privateKey}):Promise.resolve()]);return{network:e,generateEncryptedPrivateKey:{...h,memo:n.memo},...x?{signMessage:{signature:x}}:{}}}async function $d({actions:r,accessControlConditions:t}){return Promise.all(r.map(async(e,n)=>{let{network:o}=e;if(o==="evm")return await Wd({action:e,accessControlConditions:t});if(o==="solana")return await Hd({action:e,accessControlConditions:t});throw new Error(`Invalid network for action[${n}]: ${o}`)}))}function Vd(r){if(!r)throw new Error("Missing required field: actions");if(!r.length)throw new Error("No actions provided (empty array?)");r.forEach((t,e)=>{if(!["evm","solana"].includes(t.network))throw new Error(`Invalid field: actions[${e}].network: ${t.network}`);if(!t.generateKeyParams)throw new Error(`Missing required field: actions[${e}].generateKeyParams`);if(!t.generateKeyParams?.memo)throw new Error(`Missing required field: actions[${e}].generateKeyParams.memo`);if(t.signMessageParams&&!t.signMessageParams?.messageToSign)throw new Error(`Missing required field: actions[${e}].signMessageParams.messageToSign`)})}async function $c({actions:r,accessControlConditions:t}){return Vd(r),$d({actions:r,accessControlConditions:t})}var aw,Vc=ae(()=>{"use strict";aw=H(V());bf();vf();Sf();qc();Hc()});var Gd=$e(()=>{var lw=H(V());gf();Vc();(async()=>yf(async()=>$c({actions,accessControlConditions})))()});Gd();})();\n/*! Bundled license information:\n\nieee754/index.js:\n (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *)\n\nbuffer/index.js:\n (*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n *)\n\n@noble/hashes/esm/utils.js:\n (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/abstract/utils.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/abstract/modular.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/abstract/curve.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/abstract/edwards.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/ed25519.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\nsafe-buffer/index.js:\n (*! safe-buffer. MIT License. Feross Aboukhadijeh *)\n\n@solana/buffer-layout/lib/Layout.js:\n (**\n * Support for translating between Uint8Array instances and JavaScript\n * native types.\n *\n * {@link module:Layout~Layout|Layout} is the basis of a class\n * hierarchy that associates property names with sequences of encoded\n * bytes.\n *\n * Layouts are supported for these scalar (numeric) types:\n * * {@link module:Layout~UInt|Unsigned integers in little-endian\n * format} with {@link module:Layout.u8|8-bit}, {@link\n * module:Layout.u16|16-bit}, {@link module:Layout.u24|24-bit},\n * {@link module:Layout.u32|32-bit}, {@link\n * module:Layout.u40|40-bit}, and {@link module:Layout.u48|48-bit}\n * representation ranges;\n * * {@link module:Layout~UIntBE|Unsigned integers in big-endian\n * format} with {@link module:Layout.u16be|16-bit}, {@link\n * module:Layout.u24be|24-bit}, {@link module:Layout.u32be|32-bit},\n * {@link module:Layout.u40be|40-bit}, and {@link\n * module:Layout.u48be|48-bit} representation ranges;\n * * {@link module:Layout~Int|Signed integers in little-endian\n * format} with {@link module:Layout.s8|8-bit}, {@link\n * module:Layout.s16|16-bit}, {@link module:Layout.s24|24-bit},\n * {@link module:Layout.s32|32-bit}, {@link\n * module:Layout.s40|40-bit}, and {@link module:Layout.s48|48-bit}\n * representation ranges;\n * * {@link module:Layout~IntBE|Signed integers in big-endian format}\n * with {@link module:Layout.s16be|16-bit}, {@link\n * module:Layout.s24be|24-bit}, {@link module:Layout.s32be|32-bit},\n * {@link module:Layout.s40be|40-bit}, and {@link\n * module:Layout.s48be|48-bit} representation ranges;\n * * 64-bit integral values that decode to an exact (if magnitude is\n * less than 2^53) or nearby integral Number in {@link\n * module:Layout.nu64|unsigned little-endian}, {@link\n * module:Layout.nu64be|unsigned big-endian}, {@link\n * module:Layout.ns64|signed little-endian}, and {@link\n * module:Layout.ns64be|unsigned big-endian} encodings;\n * * 32-bit floating point values with {@link\n * module:Layout.f32|little-endian} and {@link\n * module:Layout.f32be|big-endian} representations;\n * * 64-bit floating point values with {@link\n * module:Layout.f64|little-endian} and {@link\n * module:Layout.f64be|big-endian} representations;\n * * {@link module:Layout.const|Constants} that take no space in the\n * encoded expression.\n *\n * and for these aggregate types:\n * * {@link module:Layout.seq|Sequence}s of instances of a {@link\n * module:Layout~Layout|Layout}, with JavaScript representation as\n * an Array and constant or data-dependent {@link\n * module:Layout~Sequence#count|length};\n * * {@link module:Layout.struct|Structure}s that aggregate a\n * heterogeneous sequence of {@link module:Layout~Layout|Layout}\n * instances, with JavaScript representation as an Object;\n * * {@link module:Layout.union|Union}s that support multiple {@link\n * module:Layout~VariantLayout|variant layouts} over a fixed\n * (padded) or variable (not padded) span of bytes, using an\n * unsigned integer at the start of the data or a separate {@link\n * module:Layout.unionLayoutDiscriminator|layout element} to\n * determine which layout to use when interpreting the buffer\n * contents;\n * * {@link module:Layout.bits|BitStructure}s that contain a sequence\n * of individual {@link\n * module:Layout~BitStructure#addField|BitField}s packed into an 8,\n * 16, 24, or 32-bit unsigned integer starting at the least- or\n * most-significant bit;\n * * {@link module:Layout.cstr|C strings} of varying length;\n * * {@link module:Layout.blob|Blobs} of fixed- or variable-{@link\n * module:Layout~Blob#length|length} raw data.\n *\n * All {@link module:Layout~Layout|Layout} instances are immutable\n * after construction, to prevent internal state from becoming\n * inconsistent.\n *\n * @local Layout\n * @local ExternalLayout\n * @local GreedyCount\n * @local OffsetLayout\n * @local UInt\n * @local UIntBE\n * @local Int\n * @local IntBE\n * @local NearUInt64\n * @local NearUInt64BE\n * @local NearInt64\n * @local NearInt64BE\n * @local Float\n * @local FloatBE\n * @local Double\n * @local DoubleBE\n * @local Sequence\n * @local Structure\n * @local UnionDiscriminator\n * @local UnionLayoutDiscriminator\n * @local Union\n * @local VariantLayout\n * @local BitStructure\n * @local BitField\n * @local Boolean\n * @local Blob\n * @local CString\n * @local Constant\n * @local bindConstructorLayout\n * @module Layout\n * @license MIT\n * @author Peter A. Bigot\n * @see {@link https://github.com/pabigot/buffer-layout|buffer-layout on GitHub}\n *)\n\n@noble/curves/esm/abstract/weierstrass.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/_shortw_utils.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/secp256k1.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n*/\n'; + module2.exports = { + code: code9, + }; + }, +}); + +// packages/wrapped-keys-lit-actions/src/generated/common/exportPrivateKey.js +var require_exportPrivateKey = __commonJS({ + 'packages/wrapped-keys-lit-actions/src/generated/common/exportPrivateKey.js'( + exports, + module2 + ) { + 'use strict'; + init_shim(); + var code9 = + '"use strict";(()=>{var Sr=Object.create;var z=Object.defineProperty;var Pr=Object.getOwnPropertyDescriptor;var _r=Object.getOwnPropertyNames;var Nr=Object.getPrototypeOf,Lr=Object.prototype.hasOwnProperty;var T=(e,r)=>()=>(e&&(r=e(e=0)),r);var N=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var Dr=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of _r(r))!Lr.call(e,n)&&n!==t&&z(e,n,{get:()=>r[n],enumerable:!(i=Pr(r,n))||i.enumerable});return e};var l=(e,r,t)=>(t=e!=null?Sr(Nr(e)):{},Dr(r||!e||!e.__esModule?z(t,"default",{value:e,enumerable:!0}):t,e));var v=N(D=>{"use strict";var Et=l(y());D.byteLength=Mr;D.toByteArray=$r;D.fromByteArray=Hr;var d=[],E=[],kr=typeof Uint8Array<"u"?Uint8Array:Array,O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(F=0,Z=O.length;F0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=r);var i=t===r?0:4-t%4;return[t,i]}function Mr(e){var r=Q(e),t=r[0],i=r[1];return(t+i)*3/4-i}function br(e,r,t){return(r+t)*3/4-t}function $r(e){var r,t=Q(e),i=t[0],n=t[1],o=new kr(br(e,i,n)),u=0,h=n>0?i-4:i,f;for(f=0;f>16&255,o[u++]=r>>8&255,o[u++]=r&255;return n===2&&(r=E[e.charCodeAt(f)]<<2|E[e.charCodeAt(f+1)]>>4,o[u++]=r&255),n===1&&(r=E[e.charCodeAt(f)]<<10|E[e.charCodeAt(f+1)]<<4|E[e.charCodeAt(f+2)]>>2,o[u++]=r>>8&255,o[u++]=r&255),o}function Or(e){return d[e>>18&63]+d[e>>12&63]+d[e>>6&63]+d[e&63]}function Kr(e,r,t){for(var i,n=[],o=r;oh?h:u+o));return i===1?(r=e[t-1],n.push(d[r>>2]+d[r<<4&63]+"==")):i===2&&(r=(e[t-2]<<8)+e[t-1],n.push(d[r>>10]+d[r>>4&63]+d[r<<2&63]+"=")),n.join("")}});var rr=N(K=>{var dt=l(y());K.read=function(e,r,t,i,n){var o,u,h=n*8-i-1,f=(1<>1,s=-7,p=t?n-1:0,U=t?-1:1,B=e[r+p];for(p+=U,o=B&(1<<-s)-1,B>>=-s,s+=h;s>0;o=o*256+e[r+p],p+=U,s-=8);for(u=o&(1<<-s)-1,o>>=-s,s+=i;s>0;u=u*256+e[r+p],p+=U,s-=8);if(o===0)o=1-a;else{if(o===f)return u?NaN:(B?-1:1)*(1/0);u=u+Math.pow(2,i),o=o-a}return(B?-1:1)*u*Math.pow(2,o-i)};K.write=function(e,r,t,i,n,o){var u,h,f,a=o*8-n-1,s=(1<>1,U=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=i?0:o-1,$=i?1:-1,Rr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,u=s):(u=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-u))<1&&(u--,f*=2),u+p>=1?r+=U/f:r+=U*Math.pow(2,1-p),r*f>=2&&(u++,f/=2),u+p>=s?(h=0,u=s):u+p>=1?(h=(r*f-1)*Math.pow(2,n),u=u+p):(h=r*Math.pow(2,p-1)*Math.pow(2,n),u=0));n>=8;e[t+B]=h&255,B+=$,h/=256,n-=8);for(u=u<0;e[t+B]=u&255,B+=$,u/=256,a-=8);e[t+B-$]|=Rr*128}});var Er=N(P=>{"use strict";var It=l(y());var H=v(),R=rr(),tr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;P.Buffer=c;P.SlowBuffer=jr;P.INSPECT_MAX_BYTES=50;var k=2147483647;P.kMaxLength=k;c.TYPED_ARRAY_SUPPORT=Gr();!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Gr(){try{let e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}});Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function g(e){if(e>k)throw new RangeError(\'The value "\'+e+\'" is invalid for option "size"\');let r=new Uint8Array(e);return Object.setPrototypeOf(r,c.prototype),r}function c(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError(\'The "string" argument must be of type string. Received type number\');return q(e)}return or(e,r,t)}c.poolSize=8192;function or(e,r,t){if(typeof e=="string")return Yr(e,r);if(ArrayBuffer.isView(e))return qr(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(m(e,ArrayBuffer)||e&&m(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(m(e,SharedArrayBuffer)||e&&m(e.buffer,SharedArrayBuffer)))return W(e,r,t);if(typeof e=="number")throw new TypeError(\'The "value" argument must not be of type number. Received type number\');let i=e.valueOf&&e.valueOf();if(i!=null&&i!==e)return c.from(i,r,t);let n=Xr(e);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return c.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}c.from=function(e,r,t){return or(e,r,t)};Object.setPrototypeOf(c.prototype,Uint8Array.prototype);Object.setPrototypeOf(c,Uint8Array);function ur(e){if(typeof e!="number")throw new TypeError(\'"size" argument must be of type number\');if(e<0)throw new RangeError(\'The value "\'+e+\'" is invalid for option "size"\')}function Wr(e,r,t){return ur(e),e<=0?g(e):r!==void 0?typeof t=="string"?g(e).fill(r,t):g(e).fill(r):g(e)}c.alloc=function(e,r,t){return Wr(e,r,t)};function q(e){return ur(e),g(e<0?0:X(e)|0)}c.allocUnsafe=function(e){return q(e)};c.allocUnsafeSlow=function(e){return q(e)};function Yr(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r);let t=cr(e,r)|0,i=g(t),n=i.write(e,r);return n!==t&&(i=i.slice(0,n)),i}function G(e){let r=e.length<0?0:X(e.length)|0,t=g(r);for(let i=0;i=k)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+k.toString(16)+" bytes");return e|0}function jr(e){return+e!=e&&(e=0),c.alloc(+e)}c.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==c.prototype};c.compare=function(r,t){if(m(r,Uint8Array)&&(r=c.from(r,r.offset,r.byteLength)),m(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(r)||!c.isBuffer(t))throw new TypeError(\'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array\');if(r===t)return 0;let i=r.length,n=t.length;for(let o=0,u=Math.min(i,n);on.length?(c.isBuffer(u)||(u=c.from(u)),u.copy(n,o)):Uint8Array.prototype.set.call(n,u,o);else if(c.isBuffer(u))u.copy(n,o);else throw new TypeError(\'"list" argument must be an Array of Buffers\');o+=u.length}return n};function cr(e,r){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||m(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError(\'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type \'+typeof e);let t=e.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;let n=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return xr(e).length;default:if(n)return i?-1:Y(e).length;r=(""+r).toLowerCase(),n=!0}}c.byteLength=cr;function Vr(e,r,t){let i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return nt(this,r,t);case"utf8":case"utf-8":return fr(this,r,t);case"ascii":return et(this,r,t);case"latin1":case"binary":return it(this,r,t);case"base64":return rt(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ot(this,r,t);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}c.prototype._isBuffer=!0;function A(e,r,t){let i=e[r];e[r]=e[t],e[t]=i}c.prototype.swap16=function(){let r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(r+=" ... "),""};tr&&(c.prototype[tr]=c.prototype.inspect);c.prototype.compare=function(r,t,i,n,o){if(m(r,Uint8Array)&&(r=c.from(r,r.offset,r.byteLength)),!c.isBuffer(r))throw new TypeError(\'The "target" argument must be one of type Buffer or Uint8Array. Received type \'+typeof r);if(t===void 0&&(t=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||i>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,o>>>=0,this===r)return 0;let u=o-n,h=i-t,f=Math.min(u,h),a=this.slice(n,o),s=r.slice(t,i);for(let p=0;p2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,V(t)&&(t=n?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(n)return-1;t=e.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof r=="string"&&(r=c.from(r,i)),c.isBuffer(r))return r.length===0?-1:er(e,r,t,i,n);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):er(e,[r],t,i,n);throw new TypeError("val must be string, number or Buffer")}function er(e,r,t,i,n){let o=1,u=e.length,h=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,u/=2,h/=2,t/=2}function f(s,p){return o===1?s[p]:s.readUInt16BE(p*o)}let a;if(n){let s=-1;for(a=t;au&&(t=u-h),a=t;a>=0;a--){let s=!0;for(let p=0;pn&&(i=n)):i=n;let o=r.length;i>o/2&&(i=o/2);let u;for(u=0;u>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-t;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let u=!1;for(;;)switch(n){case"hex":return Jr(this,r,t,i);case"utf8":case"utf-8":return zr(this,r,t,i);case"ascii":case"latin1":case"binary":return Zr(this,r,t,i);case"base64":return Qr(this,r,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vr(this,r,t,i);default:if(u)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),u=!0}};c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function rt(e,r,t){return r===0&&t===e.length?H.fromByteArray(e):H.fromByteArray(e.slice(r,t))}function fr(e,r,t){t=Math.min(e.length,t);let i=[],n=r;for(;n239?4:o>223?3:o>191?2:1;if(n+h<=t){let f,a,s,p;switch(h){case 1:o<128&&(u=o);break;case 2:f=e[n+1],(f&192)===128&&(p=(o&31)<<6|f&63,p>127&&(u=p));break;case 3:f=e[n+1],a=e[n+2],(f&192)===128&&(a&192)===128&&(p=(o&15)<<12|(f&63)<<6|a&63,p>2047&&(p<55296||p>57343)&&(u=p));break;case 4:f=e[n+1],a=e[n+2],s=e[n+3],(f&192)===128&&(a&192)===128&&(s&192)===128&&(p=(o&15)<<18|(f&63)<<12|(a&63)<<6|s&63,p>65535&&p<1114112&&(u=p))}}u===null?(u=65533,h=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|u&1023),i.push(u),n+=h}return tt(i)}var ir=4096;function tt(e){let r=e.length;if(r<=ir)return String.fromCharCode.apply(String,e);let t="",i=0;for(;ii)&&(t=i);let n="";for(let o=r;oi&&(r=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),tt)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);let n=this[r],o=1,u=0;for(;++u>>0,t=t>>>0,i||w(r,t,this.length);let n=this[r+--t],o=1;for(;t>0&&(o*=256);)n+=this[r+--t]*o;return n};c.prototype.readUint8=c.prototype.readUInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]};c.prototype.readUint16LE=c.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]|this[r+1]<<8};c.prototype.readUint16BE=c.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]<<8|this[r+1]};c.prototype.readUint32LE=c.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};c.prototype.readUint32BE=c.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};c.prototype.readBigUInt64LE=I(function(r){r=r>>>0,S(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&L(r,this.length-8);let n=t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,o=this[++r]+this[++r]*2**8+this[++r]*2**16+i*2**24;return BigInt(n)+(BigInt(o)<>>0,S(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&L(r,this.length-8);let n=t*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],o=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+i;return(BigInt(n)<>>0,t=t>>>0,i||w(r,t,this.length);let n=this[r],o=1,u=0;for(;++u=o&&(n-=Math.pow(2,8*t)),n};c.prototype.readIntBE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);let n=t,o=1,u=this[r+--n];for(;n>0&&(o*=256);)u+=this[r+--n]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*t)),u};c.prototype.readInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};c.prototype.readInt16LE=function(r,t){r=r>>>0,t||w(r,2,this.length);let i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};c.prototype.readInt16BE=function(r,t){r=r>>>0,t||w(r,2,this.length);let i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};c.prototype.readInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};c.prototype.readInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};c.prototype.readBigInt64LE=I(function(r){r=r>>>0,S(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&L(r,this.length-8);let n=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(i<<24);return(BigInt(n)<>>0,S(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&L(r,this.length-8);let n=(t<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(n)<>>0,t||w(r,4,this.length),R.read(this,r,!0,23,4)};c.prototype.readFloatBE=function(r,t){return r=r>>>0,t||w(r,4,this.length),R.read(this,r,!1,23,4)};c.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||w(r,8,this.length),R.read(this,r,!0,52,8)};c.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||w(r,8,this.length),R.read(this,r,!1,52,8)};function x(e,r,t,i,n,o){if(!c.isBuffer(e))throw new TypeError(\'"buffer" argument must be a Buffer instance\');if(r>n||re.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(r,t,i,n){if(r=+r,t=t>>>0,i=i>>>0,!n){let h=Math.pow(2,8*i)-1;x(this,r,t,i,h,0)}let o=1,u=0;for(this[t]=r&255;++u>>0,i=i>>>0,!n){let h=Math.pow(2,8*i)-1;x(this,r,t,i,h,0)}let o=i-1,u=1;for(this[t+o]=r&255;--o>=0&&(u*=256);)this[t+o]=r/u&255;return t+i};c.prototype.writeUint8=c.prototype.writeUInt8=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,1,255,0),this[t]=r&255,t+1};c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function pr(e,r,t,i,n){wr(r,i,n,e,t,7);let o=Number(r&BigInt(4294967295));e[t++]=o,o=o>>8,e[t++]=o,o=o>>8,e[t++]=o,o=o>>8,e[t++]=o;let u=Number(r>>BigInt(32)&BigInt(4294967295));return e[t++]=u,u=u>>8,e[t++]=u,u=u>>8,e[t++]=u,u=u>>8,e[t++]=u,t}function sr(e,r,t,i,n){wr(r,i,n,e,t,7);let o=Number(r&BigInt(4294967295));e[t+7]=o,o=o>>8,e[t+6]=o,o=o>>8,e[t+5]=o,o=o>>8,e[t+4]=o;let u=Number(r>>BigInt(32)&BigInt(4294967295));return e[t+3]=u,u=u>>8,e[t+2]=u,u=u>>8,e[t+1]=u,u=u>>8,e[t]=u,t+8}c.prototype.writeBigUInt64LE=I(function(r,t=0){return pr(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});c.prototype.writeBigUInt64BE=I(function(r,t=0){return sr(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});c.prototype.writeIntLE=function(r,t,i,n){if(r=+r,t=t>>>0,!n){let f=Math.pow(2,8*i-1);x(this,r,t,i,f-1,-f)}let o=0,u=1,h=0;for(this[t]=r&255;++o>0)-h&255;return t+i};c.prototype.writeIntBE=function(r,t,i,n){if(r=+r,t=t>>>0,!n){let f=Math.pow(2,8*i-1);x(this,r,t,i,f-1,-f)}let o=i-1,u=1,h=0;for(this[t+o]=r&255;--o>=0&&(u*=256);)r<0&&h===0&&this[t+o+1]!==0&&(h=1),this[t+o]=(r/u>>0)-h&255;return t+i};c.prototype.writeInt8=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};c.prototype.writeInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};c.prototype.writeInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};c.prototype.writeInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};c.prototype.writeInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};c.prototype.writeBigInt64LE=I(function(r,t=0){return pr(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});c.prototype.writeBigInt64BE=I(function(r,t=0){return sr(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ar(e,r,t,i,n,o){if(t+i>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function lr(e,r,t,i,n){return r=+r,t=t>>>0,n||ar(e,r,t,4,34028234663852886e22,-34028234663852886e22),R.write(e,r,t,i,23,4),t+4}c.prototype.writeFloatLE=function(r,t,i){return lr(this,r,t,!0,i)};c.prototype.writeFloatBE=function(r,t,i){return lr(this,r,t,!1,i)};function yr(e,r,t,i,n){return r=+r,t=t>>>0,n||ar(e,r,t,8,17976931348623157e292,-17976931348623157e292),R.write(e,r,t,i,52,8),t+8}c.prototype.writeDoubleLE=function(r,t,i){return yr(this,r,t,!0,i)};c.prototype.writeDoubleBE=function(r,t,i){return yr(this,r,t,!1,i)};c.prototype.copy=function(r,t,i,n){if(!c.isBuffer(r))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),t>=r.length&&(t=r.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-t>>0,i=i===void 0?this.length:i>>>0,r||(r=0);let o;if(typeof r=="number")for(o=t;o2**32?n=nr(String(t)):typeof t=="bigint"&&(n=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(n=nr(n)),n+="n"),i+=` It must be ${r}. Received ${n}`,i},RangeError);function nr(e){let r="",t=e.length,i=e[0]==="-"?1:0;for(;t>=i+4;t-=3)r=`_${e.slice(t-3,t)}${r}`;return`${e.slice(0,t)}${r}`}function ut(e,r,t){S(r,"offset"),(e[r]===void 0||e[r+t]===void 0)&&L(r,e.length-(t+1))}function wr(e,r,t,i,n,o){if(e>t||e3?r===0||r===BigInt(0)?h=`>= 0${u} and < 2${u} ** ${(o+1)*8}${u}`:h=`>= -(2${u} ** ${(o+1)*8-1}${u}) and < 2 ** ${(o+1)*8-1}${u}`:h=`>= ${r}${u} and <= ${t}${u}`,new C.ERR_OUT_OF_RANGE("value",h,e)}ut(i,n,o)}function S(e,r){if(typeof e!="number")throw new C.ERR_INVALID_ARG_TYPE(r,"number",e)}function L(e,r,t){throw Math.floor(e)!==e?(S(e,t),new C.ERR_OUT_OF_RANGE(t||"offset","an integer",e)):r<0?new C.ERR_BUFFER_OUT_OF_BOUNDS:new C.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${r}`,e)}var ct=/[^+/0-9A-Za-z-_]/g;function ht(e){if(e=e.split("=")[0],e=e.trim().replace(ct,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Y(e,r){r=r||1/0;let t,i=e.length,n=null,o=[];for(let u=0;u55295&&t<57344){if(!n){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===i){(r-=3)>-1&&o.push(239,191,189);continue}n=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(r-=3)>-1&&o.push(239,191,189);if(n=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function ft(e){let r=[];for(let t=0;t>8,n=t%256,o.push(n),o.push(i);return o}function xr(e){return H.toByteArray(ht(e))}function M(e,r,t,i){let n;for(n=0;n=r.length||n>=e.length);++n)r[n+t]=e[n];return n}function m(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function V(e){return e!==e}var st=function(){let e="0123456789abcdef",r=new Array(256);for(let t=0;t<16;++t){let i=t*16;for(let n=0;n<16;++n)r[i+n]=e[t]+e[n]}return r}();function I(e){return typeof BigInt>"u"?at:e}function at(){throw new Error("BigInt not supported")}});var y=N(()=>{"use strict";var Br=l(Er());globalThis.Buffer=Br.Buffer});var Tt,_,J=T(()=>{"use strict";Tt=l(y()),_=class extends Error{constructor(){super(...arguments);this.name="AbortError"}}});async function dr(e){try{let r=await e(),t=typeof r=="string"?r:JSON.stringify(r);Lit.Actions.setResponse({response:t})}catch(r){if(r instanceof _)return;Lit.Actions.setResponse({response:`Error: ${r.message}`})}}var St,mr=T(()=>{"use strict";St=l(y());J()});var _t,b,gr=T(()=>{"use strict";_t=l(y()),b="lit_"});function Ir(e){if(!e.startsWith(b))throw new Error(`PKey was not encrypted with salt; all wrapped keys must be prefixed with \'${b}\'`);return e.slice(b.length)}var Dt,Fr=T(()=>{"use strict";Dt=l(y());gr()});async function lt({accessControlConditions:e,ciphertext:r,dataToEncryptHash:t}){try{return await Lit.Actions.decryptToSingleNode({accessControlConditions:e,ciphertext:r,dataToEncryptHash:t,chain:"ethereum",authSig:null})}catch(i){throw new Error(`When decrypting key to a single node - ${i.message}`)}}async function Ar({accessControlConditions:e,ciphertext:r,dataToEncryptHash:t}){let i=await lt({accessControlConditions:e,ciphertext:r,dataToEncryptHash:t});if(!i)throw new _;return Ir(i)}var $t,Ur=T(()=>{"use strict";$t=l(y());J();Fr()});async function Tr({accessControlConditions:e,ciphertext:r,dataToEncryptHash:t}){return Ar({accessControlConditions:e,ciphertext:r,dataToEncryptHash:t})}var Ht,Cr=T(()=>{"use strict";Ht=l(y());Ur()});var yt=N(()=>{var Xt=l(y());mr();Cr();(async()=>dr(async()=>Tr({accessControlConditions,ciphertext,dataToEncryptHash})))()});yt();})();\n/*! Bundled license information:\n\nieee754/index.js:\n (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *)\n\nbuffer/index.js:\n (*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n *)\n*/\n'; + module2.exports = { + code: code9, + }; + }, +}); + +// packages/wrapped-keys-lit-actions/src/generated/ethereum/generateEncryptedEthereumPrivateKey.js +var require_generateEncryptedEthereumPrivateKey = __commonJS({ + 'packages/wrapped-keys-lit-actions/src/generated/ethereum/generateEncryptedEthereumPrivateKey.js'( + exports, + module2 + ) { + 'use strict'; + init_shim(); + var code9 = + '"use strict";(()=>{var _r=Object.create;var V=Object.defineProperty;var Sr=Object.getOwnPropertyDescriptor;var Pr=Object.getOwnPropertyNames;var Lr=Object.getPrototypeOf,br=Object.prototype.hasOwnProperty;var R=(e,r)=>()=>(e&&(r=e(e=0)),r);var P=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var Nr=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Pr(r))!br.call(e,n)&&n!==t&&V(e,n,{get:()=>r[n],enumerable:!(i=Sr(r,n))||i.enumerable});return e};var l=(e,r,t)=>(t=e!=null?_r(Lr(e)):{},Nr(r||!e||!e.__esModule?V(t,"default",{value:e,enumerable:!0}):t,e));var Z=P(b=>{"use strict";var xt=l(y());b.byteLength=Mr;b.toByteArray=$r;b.fromByteArray=Gr;var d=[],E=[],kr=typeof Uint8Array<"u"?Uint8Array:Array,$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(F=0,J=$.length;F0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=r);var i=t===r?0:4-t%4;return[t,i]}function Mr(e){var r=z(e),t=r[0],i=r[1];return(t+i)*3/4-i}function Dr(e,r,t){return(r+t)*3/4-t}function $r(e){var r,t=z(e),i=t[0],n=t[1],o=new kr(Dr(e,i,n)),u=0,h=n>0?i-4:i,f;for(f=0;f>16&255,o[u++]=r>>8&255,o[u++]=r&255;return n===2&&(r=E[e.charCodeAt(f)]<<2|E[e.charCodeAt(f+1)]>>4,o[u++]=r&255),n===1&&(r=E[e.charCodeAt(f)]<<10|E[e.charCodeAt(f+1)]<<4|E[e.charCodeAt(f+2)]>>2,o[u++]=r>>8&255,o[u++]=r&255),o}function Kr(e){return d[e>>18&63]+d[e>>12&63]+d[e>>6&63]+d[e&63]}function Or(e,r,t){for(var i,n=[],o=r;oh?h:u+o));return i===1?(r=e[t-1],n.push(d[r>>2]+d[r<<4&63]+"==")):i===2&&(r=(e[t-2]<<8)+e[t-1],n.push(d[r>>10]+d[r>>4&63]+d[r<<2&63]+"=")),n.join("")}});var Q=P(K=>{var Bt=l(y());K.read=function(e,r,t,i,n){var o,u,h=n*8-i-1,f=(1<>1,s=-7,p=t?n-1:0,U=t?-1:1,B=e[r+p];for(p+=U,o=B&(1<<-s)-1,B>>=-s,s+=h;s>0;o=o*256+e[r+p],p+=U,s-=8);for(u=o&(1<<-s)-1,o>>=-s,s+=i;s>0;u=u*256+e[r+p],p+=U,s-=8);if(o===0)o=1-a;else{if(o===f)return u?NaN:(B?-1:1)*(1/0);u=u+Math.pow(2,i),o=o-a}return(B?-1:1)*u*Math.pow(2,o-i)};K.write=function(e,r,t,i,n,o){var u,h,f,a=o*8-n-1,s=(1<>1,U=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=i?0:o-1,D=i?1:-1,Cr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,u=s):(u=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-u))<1&&(u--,f*=2),u+p>=1?r+=U/f:r+=U*Math.pow(2,1-p),r*f>=2&&(u++,f/=2),u+p>=s?(h=0,u=s):u+p>=1?(h=(r*f-1)*Math.pow(2,n),u=u+p):(h=r*Math.pow(2,p-1)*Math.pow(2,n),u=0));n>=8;e[t+B]=h&255,B+=D,h/=256,n-=8);for(u=u<0;e[t+B]=u&255,B+=D,u/=256,a-=8);e[t+B-D]|=Cr*128}});var wr=P(S=>{"use strict";var gt=l(y());var O=Z(),C=Q(),v=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;S.Buffer=c;S.SlowBuffer=jr;S.INSPECT_MAX_BYTES=50;var N=2147483647;S.kMaxLength=N;c.TYPED_ARRAY_SUPPORT=Hr();!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Hr(){try{let e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}});Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function g(e){if(e>N)throw new RangeError(\'The value "\'+e+\'" is invalid for option "size"\');let r=new Uint8Array(e);return Object.setPrototypeOf(r,c.prototype),r}function c(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError(\'The "string" argument must be of type string. Received type number\');return Y(e)}return ir(e,r,t)}c.poolSize=8192;function ir(e,r,t){if(typeof e=="string")return Yr(e,r);if(ArrayBuffer.isView(e))return qr(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(m(e,ArrayBuffer)||e&&m(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(m(e,SharedArrayBuffer)||e&&m(e.buffer,SharedArrayBuffer)))return H(e,r,t);if(typeof e=="number")throw new TypeError(\'The "value" argument must not be of type number. Received type number\');let i=e.valueOf&&e.valueOf();if(i!=null&&i!==e)return c.from(i,r,t);let n=Xr(e);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return c.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}c.from=function(e,r,t){return ir(e,r,t)};Object.setPrototypeOf(c.prototype,Uint8Array.prototype);Object.setPrototypeOf(c,Uint8Array);function nr(e){if(typeof e!="number")throw new TypeError(\'"size" argument must be of type number\');if(e<0)throw new RangeError(\'The value "\'+e+\'" is invalid for option "size"\')}function Wr(e,r,t){return nr(e),e<=0?g(e):r!==void 0?typeof t=="string"?g(e).fill(r,t):g(e).fill(r):g(e)}c.alloc=function(e,r,t){return Wr(e,r,t)};function Y(e){return nr(e),g(e<0?0:q(e)|0)}c.allocUnsafe=function(e){return Y(e)};c.allocUnsafeSlow=function(e){return Y(e)};function Yr(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r);let t=or(e,r)|0,i=g(t),n=i.write(e,r);return n!==t&&(i=i.slice(0,n)),i}function G(e){let r=e.length<0?0:q(e.length)|0,t=g(r);for(let i=0;i=N)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+N.toString(16)+" bytes");return e|0}function jr(e){return+e!=e&&(e=0),c.alloc(+e)}c.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==c.prototype};c.compare=function(r,t){if(m(r,Uint8Array)&&(r=c.from(r,r.offset,r.byteLength)),m(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(r)||!c.isBuffer(t))throw new TypeError(\'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array\');if(r===t)return 0;let i=r.length,n=t.length;for(let o=0,u=Math.min(i,n);on.length?(c.isBuffer(u)||(u=c.from(u)),u.copy(n,o)):Uint8Array.prototype.set.call(n,u,o);else if(c.isBuffer(u))u.copy(n,o);else throw new TypeError(\'"list" argument must be an Array of Buffers\');o+=u.length}return n};function or(e,r){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||m(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError(\'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type \'+typeof e);let t=e.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;let n=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return yr(e).length;default:if(n)return i?-1:W(e).length;r=(""+r).toLowerCase(),n=!0}}c.byteLength=or;function Vr(e,r,t){let i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return nt(this,r,t);case"utf8":case"utf-8":return cr(this,r,t);case"ascii":return et(this,r,t);case"latin1":case"binary":return it(this,r,t);case"base64":return rt(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ot(this,r,t);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}c.prototype._isBuffer=!0;function A(e,r,t){let i=e[r];e[r]=e[t],e[t]=i}c.prototype.swap16=function(){let r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(r+=" ... "),""};v&&(c.prototype[v]=c.prototype.inspect);c.prototype.compare=function(r,t,i,n,o){if(m(r,Uint8Array)&&(r=c.from(r,r.offset,r.byteLength)),!c.isBuffer(r))throw new TypeError(\'The "target" argument must be one of type Buffer or Uint8Array. Received type \'+typeof r);if(t===void 0&&(t=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||i>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,o>>>=0,this===r)return 0;let u=o-n,h=i-t,f=Math.min(u,h),a=this.slice(n,o),s=r.slice(t,i);for(let p=0;p2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,j(t)&&(t=n?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(n)return-1;t=e.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof r=="string"&&(r=c.from(r,i)),c.isBuffer(r))return r.length===0?-1:rr(e,r,t,i,n);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):rr(e,[r],t,i,n);throw new TypeError("val must be string, number or Buffer")}function rr(e,r,t,i,n){let o=1,u=e.length,h=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,u/=2,h/=2,t/=2}function f(s,p){return o===1?s[p]:s.readUInt16BE(p*o)}let a;if(n){let s=-1;for(a=t;au&&(t=u-h),a=t;a>=0;a--){let s=!0;for(let p=0;pn&&(i=n)):i=n;let o=r.length;i>o/2&&(i=o/2);let u;for(u=0;u>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-t;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let u=!1;for(;;)switch(n){case"hex":return Jr(this,r,t,i);case"utf8":case"utf-8":return zr(this,r,t,i);case"ascii":case"latin1":case"binary":return Zr(this,r,t,i);case"base64":return Qr(this,r,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vr(this,r,t,i);default:if(u)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),u=!0}};c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function rt(e,r,t){return r===0&&t===e.length?O.fromByteArray(e):O.fromByteArray(e.slice(r,t))}function cr(e,r,t){t=Math.min(e.length,t);let i=[],n=r;for(;n239?4:o>223?3:o>191?2:1;if(n+h<=t){let f,a,s,p;switch(h){case 1:o<128&&(u=o);break;case 2:f=e[n+1],(f&192)===128&&(p=(o&31)<<6|f&63,p>127&&(u=p));break;case 3:f=e[n+1],a=e[n+2],(f&192)===128&&(a&192)===128&&(p=(o&15)<<12|(f&63)<<6|a&63,p>2047&&(p<55296||p>57343)&&(u=p));break;case 4:f=e[n+1],a=e[n+2],s=e[n+3],(f&192)===128&&(a&192)===128&&(s&192)===128&&(p=(o&15)<<18|(f&63)<<12|(a&63)<<6|s&63,p>65535&&p<1114112&&(u=p))}}u===null?(u=65533,h=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|u&1023),i.push(u),n+=h}return tt(i)}var tr=4096;function tt(e){let r=e.length;if(r<=tr)return String.fromCharCode.apply(String,e);let t="",i=0;for(;ii)&&(t=i);let n="";for(let o=r;oi&&(r=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),tt)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);let n=this[r],o=1,u=0;for(;++u>>0,t=t>>>0,i||w(r,t,this.length);let n=this[r+--t],o=1;for(;t>0&&(o*=256);)n+=this[r+--t]*o;return n};c.prototype.readUint8=c.prototype.readUInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]};c.prototype.readUint16LE=c.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]|this[r+1]<<8};c.prototype.readUint16BE=c.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]<<8|this[r+1]};c.prototype.readUint32LE=c.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};c.prototype.readUint32BE=c.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};c.prototype.readBigUInt64LE=I(function(r){r=r>>>0,_(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&L(r,this.length-8);let n=t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,o=this[++r]+this[++r]*2**8+this[++r]*2**16+i*2**24;return BigInt(n)+(BigInt(o)<>>0,_(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&L(r,this.length-8);let n=t*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],o=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+i;return(BigInt(n)<>>0,t=t>>>0,i||w(r,t,this.length);let n=this[r],o=1,u=0;for(;++u=o&&(n-=Math.pow(2,8*t)),n};c.prototype.readIntBE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);let n=t,o=1,u=this[r+--n];for(;n>0&&(o*=256);)u+=this[r+--n]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*t)),u};c.prototype.readInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};c.prototype.readInt16LE=function(r,t){r=r>>>0,t||w(r,2,this.length);let i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};c.prototype.readInt16BE=function(r,t){r=r>>>0,t||w(r,2,this.length);let i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};c.prototype.readInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};c.prototype.readInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};c.prototype.readBigInt64LE=I(function(r){r=r>>>0,_(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&L(r,this.length-8);let n=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(i<<24);return(BigInt(n)<>>0,_(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&L(r,this.length-8);let n=(t<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(n)<>>0,t||w(r,4,this.length),C.read(this,r,!0,23,4)};c.prototype.readFloatBE=function(r,t){return r=r>>>0,t||w(r,4,this.length),C.read(this,r,!1,23,4)};c.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||w(r,8,this.length),C.read(this,r,!0,52,8)};c.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||w(r,8,this.length),C.read(this,r,!1,52,8)};function x(e,r,t,i,n,o){if(!c.isBuffer(e))throw new TypeError(\'"buffer" argument must be a Buffer instance\');if(r>n||re.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(r,t,i,n){if(r=+r,t=t>>>0,i=i>>>0,!n){let h=Math.pow(2,8*i)-1;x(this,r,t,i,h,0)}let o=1,u=0;for(this[t]=r&255;++u>>0,i=i>>>0,!n){let h=Math.pow(2,8*i)-1;x(this,r,t,i,h,0)}let o=i-1,u=1;for(this[t+o]=r&255;--o>=0&&(u*=256);)this[t+o]=r/u&255;return t+i};c.prototype.writeUint8=c.prototype.writeUInt8=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,1,255,0),this[t]=r&255,t+1};c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function hr(e,r,t,i,n){lr(r,i,n,e,t,7);let o=Number(r&BigInt(4294967295));e[t++]=o,o=o>>8,e[t++]=o,o=o>>8,e[t++]=o,o=o>>8,e[t++]=o;let u=Number(r>>BigInt(32)&BigInt(4294967295));return e[t++]=u,u=u>>8,e[t++]=u,u=u>>8,e[t++]=u,u=u>>8,e[t++]=u,t}function fr(e,r,t,i,n){lr(r,i,n,e,t,7);let o=Number(r&BigInt(4294967295));e[t+7]=o,o=o>>8,e[t+6]=o,o=o>>8,e[t+5]=o,o=o>>8,e[t+4]=o;let u=Number(r>>BigInt(32)&BigInt(4294967295));return e[t+3]=u,u=u>>8,e[t+2]=u,u=u>>8,e[t+1]=u,u=u>>8,e[t]=u,t+8}c.prototype.writeBigUInt64LE=I(function(r,t=0){return hr(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});c.prototype.writeBigUInt64BE=I(function(r,t=0){return fr(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});c.prototype.writeIntLE=function(r,t,i,n){if(r=+r,t=t>>>0,!n){let f=Math.pow(2,8*i-1);x(this,r,t,i,f-1,-f)}let o=0,u=1,h=0;for(this[t]=r&255;++o>0)-h&255;return t+i};c.prototype.writeIntBE=function(r,t,i,n){if(r=+r,t=t>>>0,!n){let f=Math.pow(2,8*i-1);x(this,r,t,i,f-1,-f)}let o=i-1,u=1,h=0;for(this[t+o]=r&255;--o>=0&&(u*=256);)r<0&&h===0&&this[t+o+1]!==0&&(h=1),this[t+o]=(r/u>>0)-h&255;return t+i};c.prototype.writeInt8=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};c.prototype.writeInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};c.prototype.writeInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};c.prototype.writeInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};c.prototype.writeInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};c.prototype.writeBigInt64LE=I(function(r,t=0){return hr(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});c.prototype.writeBigInt64BE=I(function(r,t=0){return fr(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function pr(e,r,t,i,n,o){if(t+i>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function sr(e,r,t,i,n){return r=+r,t=t>>>0,n||pr(e,r,t,4,34028234663852886e22,-34028234663852886e22),C.write(e,r,t,i,23,4),t+4}c.prototype.writeFloatLE=function(r,t,i){return sr(this,r,t,!0,i)};c.prototype.writeFloatBE=function(r,t,i){return sr(this,r,t,!1,i)};function ar(e,r,t,i,n){return r=+r,t=t>>>0,n||pr(e,r,t,8,17976931348623157e292,-17976931348623157e292),C.write(e,r,t,i,52,8),t+8}c.prototype.writeDoubleLE=function(r,t,i){return ar(this,r,t,!0,i)};c.prototype.writeDoubleBE=function(r,t,i){return ar(this,r,t,!1,i)};c.prototype.copy=function(r,t,i,n){if(!c.isBuffer(r))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),t>=r.length&&(t=r.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-t>>0,i=i===void 0?this.length:i>>>0,r||(r=0);let o;if(typeof r=="number")for(o=t;o2**32?n=er(String(t)):typeof t=="bigint"&&(n=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(n=er(n)),n+="n"),i+=` It must be ${r}. Received ${n}`,i},RangeError);function er(e){let r="",t=e.length,i=e[0]==="-"?1:0;for(;t>=i+4;t-=3)r=`_${e.slice(t-3,t)}${r}`;return`${e.slice(0,t)}${r}`}function ut(e,r,t){_(r,"offset"),(e[r]===void 0||e[r+t]===void 0)&&L(r,e.length-(t+1))}function lr(e,r,t,i,n,o){if(e>t||e3?r===0||r===BigInt(0)?h=`>= 0${u} and < 2${u} ** ${(o+1)*8}${u}`:h=`>= -(2${u} ** ${(o+1)*8-1}${u}) and < 2 ** ${(o+1)*8-1}${u}`:h=`>= ${r}${u} and <= ${t}${u}`,new T.ERR_OUT_OF_RANGE("value",h,e)}ut(i,n,o)}function _(e,r){if(typeof e!="number")throw new T.ERR_INVALID_ARG_TYPE(r,"number",e)}function L(e,r,t){throw Math.floor(e)!==e?(_(e,t),new T.ERR_OUT_OF_RANGE(t||"offset","an integer",e)):r<0?new T.ERR_BUFFER_OUT_OF_BOUNDS:new T.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${r}`,e)}var ct=/[^+/0-9A-Za-z-_]/g;function ht(e){if(e=e.split("=")[0],e=e.trim().replace(ct,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function W(e,r){r=r||1/0;let t,i=e.length,n=null,o=[];for(let u=0;u55295&&t<57344){if(!n){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===i){(r-=3)>-1&&o.push(239,191,189);continue}n=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(r-=3)>-1&&o.push(239,191,189);if(n=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function ft(e){let r=[];for(let t=0;t>8,n=t%256,o.push(n),o.push(i);return o}function yr(e){return O.toByteArray(ht(e))}function k(e,r,t,i){let n;for(n=0;n=r.length||n>=e.length);++n)r[n+t]=e[n];return n}function m(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function j(e){return e!==e}var st=function(){let e="0123456789abcdef",r=new Array(256);for(let t=0;t<16;++t){let i=t*16;for(let n=0;n<16;++n)r[i+n]=e[t]+e[n]}return r}();function I(e){return typeof BigInt>"u"?at:e}function at(){throw new Error("BigInt not supported")}});var y=P(()=>{"use strict";var xr=l(wr());globalThis.Buffer=xr.Buffer});var Ut,M,Er=R(()=>{"use strict";Ut=l(y()),M=class extends Error{constructor(){super(...arguments);this.name="AbortError"}}});async function Br(e){try{let r=await e(),t=typeof r=="string"?r:JSON.stringify(r);Lit.Actions.setResponse({response:t})}catch(r){if(r instanceof M)return;Lit.Actions.setResponse({response:`Error: ${r.message}`})}}var Ct,dr=R(()=>{"use strict";Ct=l(y());Er()});var St,mr,gr=R(()=>{"use strict";St=l(y()),mr="lit_"});async function Ir({accessControlConditions:e,privateKey:r,publicKey:t}){let{ciphertext:i,dataToEncryptHash:n}=await Lit.Actions.encrypt({accessControlConditions:e,to_encrypt:new TextEncoder().encode(mr+r)});return{ciphertext:i,dataToEncryptHash:n,publicKey:t}}var bt,Fr=R(()=>{"use strict";bt=l(y());gr()});function Ar(){let e=ethers.Wallet.createRandom();return{privateKey:e.privateKey.toString(),publicKey:e.publicKey}}var kt,Ur=R(()=>{"use strict";kt=l(y())});async function Rr({accessControlConditions:e}){let{privateKey:r,publicKey:t}=Ar();return Ir({accessControlConditions:e,privateKey:r,publicKey:t})}var Kt,Tr=R(()=>{"use strict";Kt=l(y());Fr();Ur()});var lt=P(()=>{var Yt=l(y());dr();Tr();(async()=>Br(async()=>Rr({accessControlConditions})))()});lt();})();\n/*! Bundled license information:\n\nieee754/index.js:\n (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *)\n\nbuffer/index.js:\n (*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n *)\n*/\n'; + module2.exports = { + code: code9, + }; + }, +}); + +// packages/wrapped-keys-lit-actions/src/generated/ethereum/signMessageWithEncryptedEthereumKey.js +var require_signMessageWithEncryptedEthereumKey = __commonJS({ + 'packages/wrapped-keys-lit-actions/src/generated/ethereum/signMessageWithEncryptedEthereumKey.js'( + exports, + module2 + ) { + 'use strict'; + init_shim(); + var code9 = + '"use strict";(()=>{var Pr=Object.create;var z=Object.defineProperty;var _r=Object.getOwnPropertyDescriptor;var Nr=Object.getOwnPropertyNames;var Lr=Object.getPrototypeOf,kr=Object.prototype.hasOwnProperty;var F=(e,r)=>()=>(e&&(r=e(e=0)),r);var _=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var Dr=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Nr(r))!kr.call(e,i)&&i!==t&&z(e,i,{get:()=>r[i],enumerable:!(n=_r(r,i))||n.enumerable});return e};var l=(e,r,t)=>(t=e!=null?Pr(Lr(e)):{},Dr(r||!e||!e.__esModule?z(t,"default",{value:e,enumerable:!0}):t,e));var v=_(L=>{"use strict";var Bt=l(y());L.byteLength=br;L.toByteArray=Wr;L.fromByteArray=Gr;var E=[],x=[],$r=typeof Uint8Array<"u"?Uint8Array:Array,K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(A=0,Z=K.length;A0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=r);var n=t===r?0:4-t%4;return[t,n]}function br(e){var r=Q(e),t=r[0],n=r[1];return(t+n)*3/4-n}function Kr(e,r,t){return(r+t)*3/4-t}function Wr(e){var r,t=Q(e),n=t[0],i=t[1],o=new $r(Kr(e,n,i)),u=0,c=i>0?n-4:n,h;for(h=0;h>16&255,o[u++]=r>>8&255,o[u++]=r&255;return i===2&&(r=x[e.charCodeAt(h)]<<2|x[e.charCodeAt(h+1)]>>4,o[u++]=r&255),i===1&&(r=x[e.charCodeAt(h)]<<10|x[e.charCodeAt(h+1)]<<4|x[e.charCodeAt(h+2)]>>2,o[u++]=r>>8&255,o[u++]=r&255),o}function Or(e){return E[e>>18&63]+E[e>>12&63]+E[e>>6&63]+E[e&63]}function Hr(e,r,t){for(var n,i=[],o=r;oc?c:u+o));return n===1?(r=e[t-1],i.push(E[r>>2]+E[r<<4&63]+"==")):n===2&&(r=(e[t-2]<<8)+e[t-1],i.push(E[r>>10]+E[r>>4&63]+E[r<<2&63]+"=")),i.join("")}});var rr=_(W=>{var Ft=l(y());W.read=function(e,r,t,n,i){var o,u,c=i*8-n-1,h=(1<>1,a=-7,f=t?i-1:0,T=t?-1:1,d=e[r+f];for(f+=T,o=d&(1<<-a)-1,d>>=-a,a+=c;a>0;o=o*256+e[r+f],f+=T,a-=8);for(u=o&(1<<-a)-1,o>>=-a,a+=n;a>0;u=u*256+e[r+f],f+=T,a-=8);if(o===0)o=1-p;else{if(o===h)return u?NaN:(d?-1:1)*(1/0);u=u+Math.pow(2,n),o=o-p}return(d?-1:1)*u*Math.pow(2,o-n)};W.write=function(e,r,t,n,i,o){var u,c,h,p=o*8-i-1,a=(1<>1,T=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,b=n?1:-1,Mr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,u=a):(u=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-u))<1&&(u--,h*=2),u+f>=1?r+=T/h:r+=T*Math.pow(2,1-f),r*h>=2&&(u++,h/=2),u+f>=a?(c=0,u=a):u+f>=1?(c=(r*h-1)*Math.pow(2,i),u=u+f):(c=r*Math.pow(2,f-1)*Math.pow(2,i),u=0));i>=8;e[t+d]=c&255,d+=b,c/=256,i-=8);for(u=u<0;e[t+d]=u&255,d+=b,u/=256,p-=8);e[t+d-b]|=Mr*128}});var xr=_(M=>{"use strict";var Tt=l(y());var O=v(),C=rr(),tr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;M.Buffer=s;M.SlowBuffer=Jr;M.INSPECT_MAX_BYTES=50;var k=2147483647;M.kMaxLength=k;s.TYPED_ARRAY_SUPPORT=Yr();!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Yr(){try{let e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}});Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function B(e){if(e>k)throw new RangeError(\'The value "\'+e+\'" is invalid for option "size"\');let r=new Uint8Array(e);return Object.setPrototypeOf(r,s.prototype),r}function s(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError(\'The "string" argument must be of type string. Received type number\');return q(e)}return or(e,r,t)}s.poolSize=8192;function or(e,r,t){if(typeof e=="string")return Vr(e,r);if(ArrayBuffer.isView(e))return Xr(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(m(e,ArrayBuffer)||e&&m(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(m(e,SharedArrayBuffer)||e&&m(e.buffer,SharedArrayBuffer)))return G(e,r,t);if(typeof e=="number")throw new TypeError(\'The "value" argument must not be of type number. Received type number\');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return s.from(n,r,t);let i=jr(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return s.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}s.from=function(e,r,t){return or(e,r,t)};Object.setPrototypeOf(s.prototype,Uint8Array.prototype);Object.setPrototypeOf(s,Uint8Array);function ur(e){if(typeof e!="number")throw new TypeError(\'"size" argument must be of type number\');if(e<0)throw new RangeError(\'The value "\'+e+\'" is invalid for option "size"\')}function qr(e,r,t){return ur(e),e<=0?B(e):r!==void 0?typeof t=="string"?B(e).fill(r,t):B(e).fill(r):B(e)}s.alloc=function(e,r,t){return qr(e,r,t)};function q(e){return ur(e),B(e<0?0:V(e)|0)}s.allocUnsafe=function(e){return q(e)};s.allocUnsafeSlow=function(e){return q(e)};function Vr(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r);let t=sr(e,r)|0,n=B(t),i=n.write(e,r);return i!==t&&(n=n.slice(0,i)),n}function H(e){let r=e.length<0?0:V(e.length)|0,t=B(r);for(let n=0;n=k)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+k.toString(16)+" bytes");return e|0}function Jr(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==s.prototype};s.compare=function(r,t){if(m(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),m(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(r)||!s.isBuffer(t))throw new TypeError(\'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array\');if(r===t)return 0;let n=r.length,i=t.length;for(let o=0,u=Math.min(n,i);oi.length?(s.isBuffer(u)||(u=s.from(u)),u.copy(i,o)):Uint8Array.prototype.set.call(i,u,o);else if(s.isBuffer(u))u.copy(i,o);else throw new TypeError(\'"list" argument must be an Array of Buffers\');o+=u.length}return i};function sr(e,r){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||m(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError(\'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type \'+typeof e);let t=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;let i=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return gr(e).length;default:if(i)return n?-1:Y(e).length;r=(""+r).toLowerCase(),i=!0}}s.byteLength=sr;function zr(e,r,t){let n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return ut(this,r,t);case"utf8":case"utf-8":return hr(this,r,t);case"ascii":return it(this,r,t);case"latin1":case"binary":return ot(this,r,t);case"base64":return et(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return st(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function U(e,r,t){let n=e[r];e[r]=e[t],e[t]=n}s.prototype.swap16=function(){let r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(r+=" ... "),""};tr&&(s.prototype[tr]=s.prototype.inspect);s.prototype.compare=function(r,t,n,i,o){if(m(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),!s.isBuffer(r))throw new TypeError(\'The "target" argument must be one of type Buffer or Uint8Array. Received type \'+typeof r);if(t===void 0&&(t=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),t<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=n)return 0;if(i>=o)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;let u=o-i,c=n-t,h=Math.min(u,c),p=this.slice(i,o),a=r.slice(t,n);for(let f=0;f2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,j(t)&&(t=i?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(i)return-1;t=e.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),s.isBuffer(r))return r.length===0?-1:er(e,r,t,n,i);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):er(e,[r],t,n,i);throw new TypeError("val must be string, number or Buffer")}function er(e,r,t,n,i){let o=1,u=e.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,u/=2,c/=2,t/=2}function h(a,f){return o===1?a[f]:a.readUInt16BE(f*o)}let p;if(i){let a=-1;for(p=t;pu&&(t=u-c),p=t;p>=0;p--){let a=!0;for(let f=0;fi&&(n=i)):n=i;let o=r.length;n>o/2&&(n=o/2);let u;for(u=0;u>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-t;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let u=!1;for(;;)switch(i){case"hex":return Zr(this,r,t,n);case"utf8":case"utf-8":return Qr(this,r,t,n);case"ascii":case"latin1":case"binary":return vr(this,r,t,n);case"base64":return rt(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tt(this,r,t,n);default:if(u)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),u=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function et(e,r,t){return r===0&&t===e.length?O.fromByteArray(e):O.fromByteArray(e.slice(r,t))}function hr(e,r,t){t=Math.min(e.length,t);let n=[],i=r;for(;i239?4:o>223?3:o>191?2:1;if(i+c<=t){let h,p,a,f;switch(c){case 1:o<128&&(u=o);break;case 2:h=e[i+1],(h&192)===128&&(f=(o&31)<<6|h&63,f>127&&(u=f));break;case 3:h=e[i+1],p=e[i+2],(h&192)===128&&(p&192)===128&&(f=(o&15)<<12|(h&63)<<6|p&63,f>2047&&(f<55296||f>57343)&&(u=f));break;case 4:h=e[i+1],p=e[i+2],a=e[i+3],(h&192)===128&&(p&192)===128&&(a&192)===128&&(f=(o&15)<<18|(h&63)<<12|(p&63)<<6|a&63,f>65535&&f<1114112&&(u=f))}}u===null?(u=65533,c=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u),i+=c}return nt(n)}var nr=4096;function nt(e){let r=e.length;if(r<=nr)return String.fromCharCode.apply(String,e);let t="",n=0;for(;nn)&&(t=n);let i="";for(let o=r;on&&(r=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),tt)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||w(r,t,this.length);let i=this[r],o=1,u=0;for(;++u>>0,t=t>>>0,n||w(r,t,this.length);let i=this[r+--t],o=1;for(;t>0&&(o*=256);)i+=this[r+--t]*o;return i};s.prototype.readUint8=s.prototype.readUInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]};s.prototype.readUint16LE=s.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUint16BE=s.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUint32LE=s.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUint32BE=s.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readBigUInt64LE=I(function(r){r=r>>>0,R(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&N(r,this.length-8);let i=t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,o=this[++r]+this[++r]*2**8+this[++r]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<>>0,R(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&N(r,this.length-8);let i=t*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],o=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+n;return(BigInt(i)<>>0,t=t>>>0,n||w(r,t,this.length);let i=this[r],o=1,u=0;for(;++u=o&&(i-=Math.pow(2,8*t)),i};s.prototype.readIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||w(r,t,this.length);let i=t,o=1,u=this[r+--i];for(;i>0&&(o*=256);)u+=this[r+--i]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*t)),u};s.prototype.readInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,t){r=r>>>0,t||w(r,2,this.length);let n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,t){r=r>>>0,t||w(r,2,this.length);let n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readBigInt64LE=I(function(r){r=r>>>0,R(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&N(r,this.length-8);let i=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(n<<24);return(BigInt(i)<>>0,R(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&N(r,this.length-8);let i=(t<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(i)<>>0,t||w(r,4,this.length),C.read(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,t){return r=r>>>0,t||w(r,4,this.length),C.read(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||w(r,8,this.length),C.read(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||w(r,8,this.length),C.read(this,r,!1,52,8)};function g(e,r,t,n,i,o){if(!s.isBuffer(e))throw new TypeError(\'"buffer" argument must be a Buffer instance\');if(r>i||re.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){let c=Math.pow(2,8*n)-1;g(this,r,t,n,c,0)}let o=1,u=0;for(this[t]=r&255;++u>>0,n=n>>>0,!i){let c=Math.pow(2,8*n)-1;g(this,r,t,n,c,0)}let o=n-1,u=1;for(this[t+o]=r&255;--o>=0&&(u*=256);)this[t+o]=r/u&255;return t+n};s.prototype.writeUint8=s.prototype.writeUInt8=function(r,t,n){return r=+r,t=t>>>0,n||g(this,r,t,1,255,0),this[t]=r&255,t+1};s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||g(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||g(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||g(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||g(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function fr(e,r,t,n,i){wr(r,n,i,e,t,7);let o=Number(r&BigInt(4294967295));e[t++]=o,o=o>>8,e[t++]=o,o=o>>8,e[t++]=o,o=o>>8,e[t++]=o;let u=Number(r>>BigInt(32)&BigInt(4294967295));return e[t++]=u,u=u>>8,e[t++]=u,u=u>>8,e[t++]=u,u=u>>8,e[t++]=u,t}function ar(e,r,t,n,i){wr(r,n,i,e,t,7);let o=Number(r&BigInt(4294967295));e[t+7]=o,o=o>>8,e[t+6]=o,o=o>>8,e[t+5]=o,o=o>>8,e[t+4]=o;let u=Number(r>>BigInt(32)&BigInt(4294967295));return e[t+3]=u,u=u>>8,e[t+2]=u,u=u>>8,e[t+1]=u,u=u>>8,e[t]=u,t+8}s.prototype.writeBigUInt64LE=I(function(r,t=0){return fr(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});s.prototype.writeBigUInt64BE=I(function(r,t=0){return ar(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});s.prototype.writeIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){let h=Math.pow(2,8*n-1);g(this,r,t,n,h-1,-h)}let o=0,u=1,c=0;for(this[t]=r&255;++o>0)-c&255;return t+n};s.prototype.writeIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){let h=Math.pow(2,8*n-1);g(this,r,t,n,h-1,-h)}let o=n-1,u=1,c=0;for(this[t+o]=r&255;--o>=0&&(u*=256);)r<0&&c===0&&this[t+o+1]!==0&&(c=1),this[t+o]=(r/u>>0)-c&255;return t+n};s.prototype.writeInt8=function(r,t,n){return r=+r,t=t>>>0,n||g(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};s.prototype.writeInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||g(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};s.prototype.writeInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||g(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};s.prototype.writeInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||g(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};s.prototype.writeInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||g(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};s.prototype.writeBigInt64LE=I(function(r,t=0){return fr(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});s.prototype.writeBigInt64BE=I(function(r,t=0){return ar(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function pr(e,r,t,n,i,o){if(t+n>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function lr(e,r,t,n,i){return r=+r,t=t>>>0,i||pr(e,r,t,4,34028234663852886e22,-34028234663852886e22),C.write(e,r,t,n,23,4),t+4}s.prototype.writeFloatLE=function(r,t,n){return lr(this,r,t,!0,n)};s.prototype.writeFloatBE=function(r,t,n){return lr(this,r,t,!1,n)};function yr(e,r,t,n,i){return r=+r,t=t>>>0,i||pr(e,r,t,8,17976931348623157e292,-17976931348623157e292),C.write(e,r,t,n,52,8),t+8}s.prototype.writeDoubleLE=function(r,t,n){return yr(this,r,t,!0,n)};s.prototype.writeDoubleBE=function(r,t,n){return yr(this,r,t,!1,n)};s.prototype.copy=function(r,t,n,i){if(!s.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=r.length&&(t=r.length),t||(t=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-t>>0,n=n===void 0?this.length:n>>>0,r||(r=0);let o;if(typeof r=="number")for(o=t;o2**32?i=ir(String(t)):typeof t=="bigint"&&(i=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=ir(i)),i+="n"),n+=` It must be ${r}. Received ${i}`,n},RangeError);function ir(e){let r="",t=e.length,n=e[0]==="-"?1:0;for(;t>=n+4;t-=3)r=`_${e.slice(t-3,t)}${r}`;return`${e.slice(0,t)}${r}`}function ct(e,r,t){R(r,"offset"),(e[r]===void 0||e[r+t]===void 0)&&N(r,e.length-(t+1))}function wr(e,r,t,n,i,o){if(e>t||e3?r===0||r===BigInt(0)?c=`>= 0${u} and < 2${u} ** ${(o+1)*8}${u}`:c=`>= -(2${u} ** ${(o+1)*8-1}${u}) and < 2 ** ${(o+1)*8-1}${u}`:c=`>= ${r}${u} and <= ${t}${u}`,new S.ERR_OUT_OF_RANGE("value",c,e)}ct(n,i,o)}function R(e,r){if(typeof e!="number")throw new S.ERR_INVALID_ARG_TYPE(r,"number",e)}function N(e,r,t){throw Math.floor(e)!==e?(R(e,t),new S.ERR_OUT_OF_RANGE(t||"offset","an integer",e)):r<0?new S.ERR_BUFFER_OUT_OF_BOUNDS:new S.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${r}`,e)}var ht=/[^+/0-9A-Za-z-_]/g;function ft(e){if(e=e.split("=")[0],e=e.trim().replace(ht,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Y(e,r){r=r||1/0;let t,n=e.length,i=null,o=[];for(let u=0;u55295&&t<57344){if(!i){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function at(e){let r=[];for(let t=0;t>8,i=t%256,o.push(i),o.push(n);return o}function gr(e){return O.toByteArray(ft(e))}function D(e,r,t,n){let i;for(i=0;i=r.length||i>=e.length);++i)r[i+t]=e[i];return i}function m(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function j(e){return e!==e}var lt=function(){let e="0123456789abcdef",r=new Array(256);for(let t=0;t<16;++t){let n=t*16;for(let i=0;i<16;++i)r[n+i]=e[t]+e[i]}return r}();function I(e){return typeof BigInt>"u"?yt:e}function yt(){throw new Error("BigInt not supported")}});var y=_(()=>{"use strict";var dr=l(xr());globalThis.Buffer=dr.Buffer});var Mt,P,J=F(()=>{"use strict";Mt=l(y()),P=class extends Error{constructor(){super(...arguments);this.name="AbortError"}}});async function Er(e){try{let r=await e(),t=typeof r=="string"?r:JSON.stringify(r);Lit.Actions.setResponse({response:t})}catch(r){if(r instanceof P)return;Lit.Actions.setResponse({response:`Error: ${r.message}`})}}var Nt,mr=F(()=>{"use strict";Nt=l(y());J()});var kt,$,Br=F(()=>{"use strict";kt=l(y()),$="lit_"});function Ir(e){if(!e.startsWith($))throw new Error(`PKey was not encrypted with salt; all wrapped keys must be prefixed with \'${$}\'`);return e.slice($.length)}var bt,Fr=F(()=>{"use strict";bt=l(y());Br()});async function wt({accessControlConditions:e,ciphertext:r,dataToEncryptHash:t}){try{return await Lit.Actions.decryptToSingleNode({accessControlConditions:e,ciphertext:r,dataToEncryptHash:t,chain:"ethereum",authSig:null})}catch(n){throw new Error(`When decrypting key to a single node - ${n.message}`)}}async function Ar({accessControlConditions:e,ciphertext:r,dataToEncryptHash:t}){let n=await wt({accessControlConditions:e,ciphertext:r,dataToEncryptHash:t});if(!n)throw new P;return Ir(n)}var Ht,Ur=F(()=>{"use strict";Ht=l(y());J();Fr()});async function gt({privateKey:e,messageToSign:r}){try{let t=new ethers.Wallet(e);return{signature:await t.signMessage(r),walletAddress:t.address}}catch(t){throw t instanceof Error?new Error(`When signing message - ${t.message}`):new Error(`An unexpected error occurred: ${t}`)}}function xt({messageToSign:e,signature:r}){try{return ethers.utils.verifyMessage(e,r)}catch(t){throw new Error(`When validating signed Ethereum message is valid: ${t.message}`)}}async function Tr({privateKey:e,messageToSign:r}){let{signature:t,walletAddress:n}=await gt({privateKey:e,messageToSign:r});if(xt({messageToSign:r,signature:t})!==n)throw new Error("Recovered address from verifyMessage doesn\'t match the wallet address");return t}var Yt,Sr=F(()=>{"use strict";Yt=l(y())});async function Cr({accessControlConditions:e,ciphertext:r,dataToEncryptHash:t,messageToSign:n}){let i=await Ar({accessControlConditions:e,ciphertext:r,dataToEncryptHash:t});return Tr({privateKey:i,messageToSign:n})}var jt,Rr=F(()=>{"use strict";jt=l(y());Ur();Sr()});var dt=_(()=>{var vt=l(y());mr();Rr();(async()=>Er(async()=>Cr({accessControlConditions,ciphertext,dataToEncryptHash,messageToSign})))()});dt();})();\n/*! Bundled license information:\n\nieee754/index.js:\n (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *)\n\nbuffer/index.js:\n (*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n *)\n*/\n'; + module2.exports = { + code: code9, + }; + }, +}); + +// packages/wrapped-keys-lit-actions/src/generated/ethereum/signTransactionWithEncryptedEthereumKey.js +var require_signTransactionWithEncryptedEthereumKey = __commonJS({ + 'packages/wrapped-keys-lit-actions/src/generated/ethereum/signTransactionWithEncryptedEthereumKey.js'( + exports, + module2 + ) { + 'use strict'; + init_shim(); + var code9 = + '"use strict";(()=>{var _r=Object.create;var z=Object.defineProperty;var br=Object.getOwnPropertyDescriptor;var Nr=Object.getOwnPropertyNames;var kr=Object.getPrototypeOf,Dr=Object.prototype.hasOwnProperty;var F=(e,r)=>()=>(e&&(r=e(e=0)),r);var _=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var $r=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Nr(r))!Dr.call(e,i)&&i!==t&&z(e,i,{get:()=>r[i],enumerable:!(n=br(r,i))||n.enumerable});return e};var l=(e,r,t)=>(t=e!=null?_r(kr(e)):{},$r(r||!e||!e.__esModule?z(t,"default",{value:e,enumerable:!0}):t,e));var v=_(N=>{"use strict";var Tt=l(y());N.byteLength=Wr;N.toByteArray=Gr;N.fromByteArray=qr;var E=[],g=[],Mr=typeof Uint8Array<"u"?Uint8Array:Array,W="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(A=0,Z=W.length;A0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=r);var n=t===r?0:4-t%4;return[t,n]}function Wr(e){var r=Q(e),t=r[0],n=r[1];return(t+n)*3/4-n}function Kr(e,r,t){return(r+t)*3/4-t}function Gr(e){var r,t=Q(e),n=t[0],i=t[1],o=new Mr(Kr(e,n,i)),c=0,u=i>0?n-4:n,a;for(a=0;a>16&255,o[c++]=r>>8&255,o[c++]=r&255;return i===2&&(r=g[e.charCodeAt(a)]<<2|g[e.charCodeAt(a+1)]>>4,o[c++]=r&255),i===1&&(r=g[e.charCodeAt(a)]<<10|g[e.charCodeAt(a+1)]<<4|g[e.charCodeAt(a+2)]>>2,o[c++]=r>>8&255,o[c++]=r&255),o}function Or(e){return E[e>>18&63]+E[e>>12&63]+E[e>>6&63]+E[e&63]}function Hr(e,r,t){for(var n,i=[],o=r;ou?u:c+o));return n===1?(r=e[t-1],i.push(E[r>>2]+E[r<<4&63]+"==")):n===2&&(r=(e[t-2]<<8)+e[t-1],i.push(E[r>>10]+E[r>>4&63]+E[r<<2&63]+"=")),i.join("")}});var rr=_(K=>{var Ct=l(y());K.read=function(e,r,t,n,i){var o,c,u=i*8-n-1,a=(1<>1,f=-7,h=t?i-1:0,T=t?-1:1,x=e[r+h];for(h+=T,o=x&(1<<-f)-1,x>>=-f,f+=u;f>0;o=o*256+e[r+h],h+=T,f-=8);for(c=o&(1<<-f)-1,o>>=-f,f+=n;f>0;c=c*256+e[r+h],h+=T,f-=8);if(o===0)o=1-p;else{if(o===a)return c?NaN:(x?-1:1)*(1/0);c=c+Math.pow(2,n),o=o-p}return(x?-1:1)*c*Math.pow(2,o-n)};K.write=function(e,r,t,n,i,o){var c,u,a,p=o*8-i-1,f=(1<>1,T=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=n?0:o-1,M=n?1:-1,Lr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,c=f):(c=Math.floor(Math.log(r)/Math.LN2),r*(a=Math.pow(2,-c))<1&&(c--,a*=2),c+h>=1?r+=T/a:r+=T*Math.pow(2,1-h),r*a>=2&&(c++,a/=2),c+h>=f?(u=0,c=f):c+h>=1?(u=(r*a-1)*Math.pow(2,i),c=c+h):(u=r*Math.pow(2,h-1)*Math.pow(2,i),c=0));i>=8;e[t+x]=u&255,x+=M,u/=256,i-=8);for(c=c<0;e[t+x]=c&255,x+=M,c/=256,p-=8);e[t+x-M]|=Lr*128}});var gr=_(P=>{"use strict";var Lt=l(y());var G=v(),C=rr(),tr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;P.Buffer=s;P.SlowBuffer=zr;P.INSPECT_MAX_BYTES=50;var k=2147483647;P.kMaxLength=k;s.TYPED_ARRAY_SUPPORT=Vr();!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Vr(){try{let e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}});Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function B(e){if(e>k)throw new RangeError(\'The value "\'+e+\'" is invalid for option "size"\');let r=new Uint8Array(e);return Object.setPrototypeOf(r,s.prototype),r}function s(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError(\'The "string" argument must be of type string. Received type number\');return V(e)}return or(e,r,t)}s.poolSize=8192;function or(e,r,t){if(typeof e=="string")return Jr(e,r);if(ArrayBuffer.isView(e))return Xr(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(m(e,ArrayBuffer)||e&&m(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(m(e,SharedArrayBuffer)||e&&m(e.buffer,SharedArrayBuffer)))return H(e,r,t);if(typeof e=="number")throw new TypeError(\'The "value" argument must not be of type number. Received type number\');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return s.from(n,r,t);let i=jr(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return s.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}s.from=function(e,r,t){return or(e,r,t)};Object.setPrototypeOf(s.prototype,Uint8Array.prototype);Object.setPrototypeOf(s,Uint8Array);function cr(e){if(typeof e!="number")throw new TypeError(\'"size" argument must be of type number\');if(e<0)throw new RangeError(\'The value "\'+e+\'" is invalid for option "size"\')}function Yr(e,r,t){return cr(e),e<=0?B(e):r!==void 0?typeof t=="string"?B(e).fill(r,t):B(e).fill(r):B(e)}s.alloc=function(e,r,t){return Yr(e,r,t)};function V(e){return cr(e),B(e<0?0:Y(e)|0)}s.allocUnsafe=function(e){return V(e)};s.allocUnsafeSlow=function(e){return V(e)};function Jr(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r);let t=sr(e,r)|0,n=B(t),i=n.write(e,r);return i!==t&&(n=n.slice(0,i)),n}function O(e){let r=e.length<0?0:Y(e.length)|0,t=B(r);for(let n=0;n=k)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+k.toString(16)+" bytes");return e|0}function zr(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==s.prototype};s.compare=function(r,t){if(m(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),m(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(r)||!s.isBuffer(t))throw new TypeError(\'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array\');if(r===t)return 0;let n=r.length,i=t.length;for(let o=0,c=Math.min(n,i);oi.length?(s.isBuffer(c)||(c=s.from(c)),c.copy(i,o)):Uint8Array.prototype.set.call(i,c,o);else if(s.isBuffer(c))c.copy(i,o);else throw new TypeError(\'"list" argument must be an Array of Buffers\');o+=c.length}return i};function sr(e,r){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||m(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError(\'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type \'+typeof e);let t=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;let i=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return dr(e).length;default:if(i)return n?-1:q(e).length;r=(""+r).toLowerCase(),i=!0}}s.byteLength=sr;function Zr(e,r,t){let n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return st(this,r,t);case"utf8":case"utf-8":return ar(this,r,t);case"ascii":return ot(this,r,t);case"latin1":case"binary":return ct(this,r,t);case"base64":return nt(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ut(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function U(e,r,t){let n=e[r];e[r]=e[t],e[t]=n}s.prototype.swap16=function(){let r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(r+=" ... "),""};tr&&(s.prototype[tr]=s.prototype.inspect);s.prototype.compare=function(r,t,n,i,o){if(m(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),!s.isBuffer(r))throw new TypeError(\'The "target" argument must be one of type Buffer or Uint8Array. Received type \'+typeof r);if(t===void 0&&(t=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),t<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=n)return 0;if(i>=o)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;let c=o-i,u=n-t,a=Math.min(c,u),p=this.slice(i,o),f=r.slice(t,n);for(let h=0;h2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,X(t)&&(t=i?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(i)return-1;t=e.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),s.isBuffer(r))return r.length===0?-1:er(e,r,t,n,i);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):er(e,[r],t,n,i);throw new TypeError("val must be string, number or Buffer")}function er(e,r,t,n,i){let o=1,c=e.length,u=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,c/=2,u/=2,t/=2}function a(f,h){return o===1?f[h]:f.readUInt16BE(h*o)}let p;if(i){let f=-1;for(p=t;pc&&(t=c-u),p=t;p>=0;p--){let f=!0;for(let h=0;hi&&(n=i)):n=i;let o=r.length;n>o/2&&(n=o/2);let c;for(c=0;c>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-t;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let c=!1;for(;;)switch(i){case"hex":return Qr(this,r,t,n);case"utf8":case"utf-8":return vr(this,r,t,n);case"ascii":case"latin1":case"binary":return rt(this,r,t,n);case"base64":return tt(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return et(this,r,t,n);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nt(e,r,t){return r===0&&t===e.length?G.fromByteArray(e):G.fromByteArray(e.slice(r,t))}function ar(e,r,t){t=Math.min(e.length,t);let n=[],i=r;for(;i239?4:o>223?3:o>191?2:1;if(i+u<=t){let a,p,f,h;switch(u){case 1:o<128&&(c=o);break;case 2:a=e[i+1],(a&192)===128&&(h=(o&31)<<6|a&63,h>127&&(c=h));break;case 3:a=e[i+1],p=e[i+2],(a&192)===128&&(p&192)===128&&(h=(o&15)<<12|(a&63)<<6|p&63,h>2047&&(h<55296||h>57343)&&(c=h));break;case 4:a=e[i+1],p=e[i+2],f=e[i+3],(a&192)===128&&(p&192)===128&&(f&192)===128&&(h=(o&15)<<18|(a&63)<<12|(p&63)<<6|f&63,h>65535&&h<1114112&&(c=h))}}c===null?(c=65533,u=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|c&1023),n.push(c),i+=u}return it(n)}var nr=4096;function it(e){let r=e.length;if(r<=nr)return String.fromCharCode.apply(String,e);let t="",n=0;for(;nn)&&(t=n);let i="";for(let o=r;on&&(r=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),tt)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||w(r,t,this.length);let i=this[r],o=1,c=0;for(;++c>>0,t=t>>>0,n||w(r,t,this.length);let i=this[r+--t],o=1;for(;t>0&&(o*=256);)i+=this[r+--t]*o;return i};s.prototype.readUint8=s.prototype.readUInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]};s.prototype.readUint16LE=s.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUint16BE=s.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUint32LE=s.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUint32BE=s.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readBigUInt64LE=I(function(r){r=r>>>0,S(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&b(r,this.length-8);let i=t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,o=this[++r]+this[++r]*2**8+this[++r]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<>>0,S(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&b(r,this.length-8);let i=t*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],o=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+n;return(BigInt(i)<>>0,t=t>>>0,n||w(r,t,this.length);let i=this[r],o=1,c=0;for(;++c=o&&(i-=Math.pow(2,8*t)),i};s.prototype.readIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||w(r,t,this.length);let i=t,o=1,c=this[r+--i];for(;i>0&&(o*=256);)c+=this[r+--i]*o;return o*=128,c>=o&&(c-=Math.pow(2,8*t)),c};s.prototype.readInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,t){r=r>>>0,t||w(r,2,this.length);let n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,t){r=r>>>0,t||w(r,2,this.length);let n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readBigInt64LE=I(function(r){r=r>>>0,S(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&b(r,this.length-8);let i=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(n<<24);return(BigInt(i)<>>0,S(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&b(r,this.length-8);let i=(t<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(i)<>>0,t||w(r,4,this.length),C.read(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,t){return r=r>>>0,t||w(r,4,this.length),C.read(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||w(r,8,this.length),C.read(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||w(r,8,this.length),C.read(this,r,!1,52,8)};function d(e,r,t,n,i,o){if(!s.isBuffer(e))throw new TypeError(\'"buffer" argument must be a Buffer instance\');if(r>i||re.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;d(this,r,t,n,u,0)}let o=1,c=0;for(this[t]=r&255;++c>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;d(this,r,t,n,u,0)}let o=n-1,c=1;for(this[t+o]=r&255;--o>=0&&(c*=256);)this[t+o]=r/c&255;return t+n};s.prototype.writeUint8=s.prototype.writeUInt8=function(r,t,n){return r=+r,t=t>>>0,n||d(this,r,t,1,255,0),this[t]=r&255,t+1};s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||d(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||d(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||d(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||d(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function hr(e,r,t,n,i){wr(r,n,i,e,t,7);let o=Number(r&BigInt(4294967295));e[t++]=o,o=o>>8,e[t++]=o,o=o>>8,e[t++]=o,o=o>>8,e[t++]=o;let c=Number(r>>BigInt(32)&BigInt(4294967295));return e[t++]=c,c=c>>8,e[t++]=c,c=c>>8,e[t++]=c,c=c>>8,e[t++]=c,t}function fr(e,r,t,n,i){wr(r,n,i,e,t,7);let o=Number(r&BigInt(4294967295));e[t+7]=o,o=o>>8,e[t+6]=o,o=o>>8,e[t+5]=o,o=o>>8,e[t+4]=o;let c=Number(r>>BigInt(32)&BigInt(4294967295));return e[t+3]=c,c=c>>8,e[t+2]=c,c=c>>8,e[t+1]=c,c=c>>8,e[t]=c,t+8}s.prototype.writeBigUInt64LE=I(function(r,t=0){return hr(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});s.prototype.writeBigUInt64BE=I(function(r,t=0){return fr(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});s.prototype.writeIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){let a=Math.pow(2,8*n-1);d(this,r,t,n,a-1,-a)}let o=0,c=1,u=0;for(this[t]=r&255;++o>0)-u&255;return t+n};s.prototype.writeIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){let a=Math.pow(2,8*n-1);d(this,r,t,n,a-1,-a)}let o=n-1,c=1,u=0;for(this[t+o]=r&255;--o>=0&&(c*=256);)r<0&&u===0&&this[t+o+1]!==0&&(u=1),this[t+o]=(r/c>>0)-u&255;return t+n};s.prototype.writeInt8=function(r,t,n){return r=+r,t=t>>>0,n||d(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};s.prototype.writeInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||d(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};s.prototype.writeInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||d(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};s.prototype.writeInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||d(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};s.prototype.writeInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||d(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};s.prototype.writeBigInt64LE=I(function(r,t=0){return hr(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});s.prototype.writeBigInt64BE=I(function(r,t=0){return fr(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function pr(e,r,t,n,i,o){if(t+n>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function lr(e,r,t,n,i){return r=+r,t=t>>>0,i||pr(e,r,t,4,34028234663852886e22,-34028234663852886e22),C.write(e,r,t,n,23,4),t+4}s.prototype.writeFloatLE=function(r,t,n){return lr(this,r,t,!0,n)};s.prototype.writeFloatBE=function(r,t,n){return lr(this,r,t,!1,n)};function yr(e,r,t,n,i){return r=+r,t=t>>>0,i||pr(e,r,t,8,17976931348623157e292,-17976931348623157e292),C.write(e,r,t,n,52,8),t+8}s.prototype.writeDoubleLE=function(r,t,n){return yr(this,r,t,!0,n)};s.prototype.writeDoubleBE=function(r,t,n){return yr(this,r,t,!1,n)};s.prototype.copy=function(r,t,n,i){if(!s.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=r.length&&(t=r.length),t||(t=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-t>>0,n=n===void 0?this.length:n>>>0,r||(r=0);let o;if(typeof r=="number")for(o=t;o2**32?i=ir(String(t)):typeof t=="bigint"&&(i=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=ir(i)),i+="n"),n+=` It must be ${r}. Received ${i}`,n},RangeError);function ir(e){let r="",t=e.length,n=e[0]==="-"?1:0;for(;t>=n+4;t-=3)r=`_${e.slice(t-3,t)}${r}`;return`${e.slice(0,t)}${r}`}function at(e,r,t){S(r,"offset"),(e[r]===void 0||e[r+t]===void 0)&&b(r,e.length-(t+1))}function wr(e,r,t,n,i,o){if(e>t||e3?r===0||r===BigInt(0)?u=`>= 0${c} and < 2${c} ** ${(o+1)*8}${c}`:u=`>= -(2${c} ** ${(o+1)*8-1}${c}) and < 2 ** ${(o+1)*8-1}${c}`:u=`>= ${r}${c} and <= ${t}${c}`,new R.ERR_OUT_OF_RANGE("value",u,e)}at(n,i,o)}function S(e,r){if(typeof e!="number")throw new R.ERR_INVALID_ARG_TYPE(r,"number",e)}function b(e,r,t){throw Math.floor(e)!==e?(S(e,t),new R.ERR_OUT_OF_RANGE(t||"offset","an integer",e)):r<0?new R.ERR_BUFFER_OUT_OF_BOUNDS:new R.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${r}`,e)}var ht=/[^+/0-9A-Za-z-_]/g;function ft(e){if(e=e.split("=")[0],e=e.trim().replace(ht,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function q(e,r){r=r||1/0;let t,n=e.length,i=null,o=[];for(let c=0;c55295&&t<57344){if(!i){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(c+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function pt(e){let r=[];for(let t=0;t>8,i=t%256,o.push(i),o.push(n);return o}function dr(e){return G.toByteArray(ft(e))}function D(e,r,t,n){let i;for(i=0;i=r.length||i>=e.length);++i)r[i+t]=e[i];return i}function m(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function X(e){return e!==e}var yt=function(){let e="0123456789abcdef",r=new Array(256);for(let t=0;t<16;++t){let n=t*16;for(let i=0;i<16;++i)r[n+i]=e[t]+e[i]}return r}();function I(e){return typeof BigInt>"u"?wt:e}function wt(){throw new Error("BigInt not supported")}});var y=_(()=>{"use strict";var xr=l(gr());globalThis.Buffer=xr.Buffer});var kt,L,j=F(()=>{"use strict";kt=l(y()),L=class extends Error{constructor(){super(...arguments);this.name="AbortError"}}});async function Er(e){try{let r=await e(),t=typeof r=="string"?r:JSON.stringify(r);Lit.Actions.setResponse({response:t})}catch(r){if(r instanceof L)return;Lit.Actions.setResponse({response:`Error: ${r.message}`})}}var Mt,mr=F(()=>{"use strict";Mt=l(y());j()});var Kt,$,Br=F(()=>{"use strict";Kt=l(y()),$="lit_"});function Ir(e){if(!e.startsWith($))throw new Error(`PKey was not encrypted with salt; all wrapped keys must be prefixed with \'${$}\'`);return e.slice($.length)}var Ht,Fr=F(()=>{"use strict";Ht=l(y());Br()});async function dt({accessControlConditions:e,ciphertext:r,dataToEncryptHash:t}){try{return await Lit.Actions.decryptToSingleNode({accessControlConditions:e,ciphertext:r,dataToEncryptHash:t,chain:"ethereum",authSig:null})}catch(n){throw new Error(`When decrypting key to a single node - ${n.message}`)}}async function Ar({accessControlConditions:e,ciphertext:r,dataToEncryptHash:t}){let n=await dt({accessControlConditions:e,ciphertext:r,dataToEncryptHash:t});if(!n)throw new L;return Ir(n)}var Jt,Ur=F(()=>{"use strict";Jt=l(y());j();Fr()});function Tr(e){try{if(!e.toAddress)throw new Error("Missing required field: toAddress");if(!e.chain)throw new Error("Missing required field: chain");if(!e.value)throw new Error("Missing required field: value");if(!e.chainId)throw new Error("Missing required field: chainId");return{to:e.toAddress,value:ethers.utils.hexlify(ethers.utils.parseEther(e.value)),chainId:e.chainId,data:e.dataHex}}catch(r){throw new Error(`Invalid unsignedTransaction - ${r.message}`)}}async function gt({walletAddress:e,chain:r}){try{return await Lit.Actions.getLatestNonce({address:e,chain:r})}catch(t){throw new Error(`Unable to get latest nonce - ${t.message}`)}}async function xt({chain:e}){try{let r=await Lit.Actions.getRpcUrl({chain:e});return new ethers.providers.JsonRpcProvider(r)}catch(r){throw new Error(`Getting the rpc for the chain: ${e} - ${r.message}`)}}async function Et({userProvidedGasPrice:e,provider:r}){try{return e?ethers.utils.parseUnits(e,"gwei"):await r.getGasPrice()}catch(t){throw new Error(`When getting gas price - ${t.message}`)}}async function mt({provider:e,userProvidedGasLimit:r,validatedTx:t}){if(r)return r;try{return await e.estimateGas(t)}catch(n){throw new Error(`When estimating gas - ${n.message}`)}}async function Bt({validatedTx:e,wallet:r}){try{return await r.signTransaction(e)}catch(t){throw new Error(`When signing transaction - ${t.message}`)}}async function It({provider:e,signedTx:r}){try{return await e.sendTransaction(r)}catch(t){throw new Error(`When sending transaction - ${t.message}`)}}async function Rr({broadcast:e,privateKey:r,validatedTx:t,unsignedTransaction:n}){let i=new ethers.Wallet(r);t.from=i.address;let[o,c]=await Promise.all([gt({walletAddress:i.address,chain:n.chain}),xt({chain:n.chain})]);t.nonce=o,t.gasPrice=await Et({provider:c,userProvidedGasPrice:n.gasPrice}),t.gasLimit=await mt({provider:c,validatedTx:t,userProvidedGasLimit:n.gasLimit});let u=await Bt({validatedTx:t,wallet:i});return e?(await It({provider:c,signedTx:u})).hash:u}var jt,Cr=F(()=>{"use strict";jt=l(y())});async function Sr({accessControlConditions:e,ciphertext:r,dataToEncryptHash:t,unsignedTransaction:n,broadcast:i}){let o=Tr(n),c=await Ar({accessControlConditions:e,ciphertext:r,dataToEncryptHash:t});return Rr({broadcast:i,privateKey:c,unsignedTransaction:n,validatedTx:o})}var re,Pr=F(()=>{"use strict";re=l(y());Ur();Cr()});var Ft=_(()=>{var oe=l(y());mr();Pr();(async()=>Er(async()=>Sr({accessControlConditions,ciphertext,dataToEncryptHash,unsignedTransaction,broadcast})))()});Ft();})();\n/*! Bundled license information:\n\nieee754/index.js:\n (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *)\n\nbuffer/index.js:\n (*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n *)\n*/\n'; + module2.exports = { + code: code9, + }; + }, +}); + +// packages/wrapped-keys-lit-actions/src/generated/solana/generateEncryptedSolanaPrivateKey.js +var require_generateEncryptedSolanaPrivateKey = __commonJS({ + 'packages/wrapped-keys-lit-actions/src/generated/solana/generateEncryptedSolanaPrivateKey.js'( + exports, + module2 + ) { + 'use strict'; + init_shim(); + var code9 = + '"use strict";(()=>{var pf=Object.create;var Si=Object.defineProperty;var yf=Object.getOwnPropertyDescriptor;var gf=Object.getOwnPropertyNames;var mf=Object.getPrototypeOf,wf=Object.prototype.hasOwnProperty;var wt=(r,t)=>()=>(r&&(t=r(r=0)),t);var ae=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),ga=(r,t)=>{for(var e in t)Si(r,e,{get:t[e],enumerable:!0})},ma=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of gf(t))!wf.call(r,o)&&o!==e&&Si(r,o,{get:()=>t[o],enumerable:!(n=yf(t,o))||n.enumerable});return r};var P=(r,t,e)=>(e=r!=null?pf(mf(r)):{},ma(t||!r||!r.__esModule?Si(e,"default",{value:r,enumerable:!0}):e,r)),wa=r=>ma(Si({},"__esModule",{value:!0}),r);var xa=ae(Ei=>{"use strict";var cd=P(O());Ei.byteLength=vf;Ei.toByteArray=kf;Ei.fromByteArray=Ef;var ze=[],Me=[],bf=typeof Uint8Array<"u"?Uint8Array:Array,Oo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Gr=0,ba=Oo.length;Gr0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");e===-1&&(e=t);var n=e===t?0:4-e%4;return[e,n]}function vf(r){var t=va(r),e=t[0],n=t[1];return(e+n)*3/4-n}function xf(r,t,e){return(t+e)*3/4-e}function kf(r){var t,e=va(r),n=e[0],o=e[1],u=new bf(xf(r,n,o)),h=0,w=o>0?n-4:n,m;for(m=0;m>16&255,u[h++]=t>>8&255,u[h++]=t&255;return o===2&&(t=Me[r.charCodeAt(m)]<<2|Me[r.charCodeAt(m+1)]>>4,u[h++]=t&255),o===1&&(t=Me[r.charCodeAt(m)]<<10|Me[r.charCodeAt(m+1)]<<4|Me[r.charCodeAt(m+2)]>>2,u[h++]=t>>8&255,u[h++]=t&255),u}function Bf(r){return ze[r>>18&63]+ze[r>>12&63]+ze[r>>6&63]+ze[r&63]}function Sf(r,t,e){for(var n,o=[],u=t;uw?w:h+u));return n===1?(t=r[e-1],o.push(ze[t>>2]+ze[t<<4&63]+"==")):n===2&&(t=(r[e-2]<<8)+r[e-1],o.push(ze[t>>10]+ze[t>>4&63]+ze[t<<2&63]+"=")),o.join("")}});var ka=ae(Uo=>{var hd=P(O());Uo.read=function(r,t,e,n,o){var u,h,w=o*8-n-1,m=(1<>1,v=-7,B=e?o-1:0,_=e?-1:1,E=r[t+B];for(B+=_,u=E&(1<<-v)-1,E>>=-v,v+=w;v>0;u=u*256+r[t+B],B+=_,v-=8);for(h=u&(1<<-v)-1,u>>=-v,v+=n;v>0;h=h*256+r[t+B],B+=_,v-=8);if(u===0)u=1-x;else{if(u===m)return h?NaN:(E?-1:1)*(1/0);h=h+Math.pow(2,n),u=u-x}return(E?-1:1)*h*Math.pow(2,u-n)};Uo.write=function(r,t,e,n,o,u){var h,w,m,x=u*8-o-1,v=(1<>1,_=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:u-1,F=n?1:-1,R=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(w=isNaN(t)?1:0,h=v):(h=Math.floor(Math.log(t)/Math.LN2),t*(m=Math.pow(2,-h))<1&&(h--,m*=2),h+B>=1?t+=_/m:t+=_*Math.pow(2,1-B),t*m>=2&&(h++,m/=2),h+B>=v?(w=0,h=v):h+B>=1?(w=(t*m-1)*Math.pow(2,o),h=h+B):(w=t*Math.pow(2,B-1)*Math.pow(2,o),h=0));o>=8;r[e+E]=w&255,E+=F,w/=256,o-=8);for(h=h<0;r[e+E]=h&255,E+=F,h/=256,x-=8);r[e+E-F]|=R*128}});var mn=ae(gn=>{"use strict";var pd=P(O());var No=xa(),pn=ka(),Ba=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;gn.Buffer=C;gn.SlowBuffer=Rf;gn.INSPECT_MAX_BYTES=50;var Ii=2147483647;gn.kMaxLength=Ii;C.TYPED_ARRAY_SUPPORT=If();!C.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function If(){try{let r=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(r,t),r.foo()===42}catch{return!1}}Object.defineProperty(C.prototype,"parent",{enumerable:!0,get:function(){if(C.isBuffer(this))return this.buffer}});Object.defineProperty(C.prototype,"offset",{enumerable:!0,get:function(){if(C.isBuffer(this))return this.byteOffset}});function $e(r){if(r>Ii)throw new RangeError(\'The value "\'+r+\'" is invalid for option "size"\');let t=new Uint8Array(r);return Object.setPrototypeOf(t,C.prototype),t}function C(r,t,e){if(typeof r=="number"){if(typeof t=="string")throw new TypeError(\'The "string" argument must be of type string. Received type number\');return Ko(r)}return _a(r,t,e)}C.poolSize=8192;function _a(r,t,e){if(typeof r=="string")return Af(r,t);if(ArrayBuffer.isView(r))return Mf(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(qe(r,ArrayBuffer)||r&&qe(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(qe(r,SharedArrayBuffer)||r&&qe(r.buffer,SharedArrayBuffer)))return qo(r,t,e);if(typeof r=="number")throw new TypeError(\'The "value" argument must not be of type number. Received type number\');let n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return C.from(n,t,e);let o=Lf(r);if(o)return o;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return C.from(r[Symbol.toPrimitive]("string"),t,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}C.from=function(r,t,e){return _a(r,t,e)};Object.setPrototypeOf(C.prototype,Uint8Array.prototype);Object.setPrototypeOf(C,Uint8Array);function Aa(r){if(typeof r!="number")throw new TypeError(\'"size" argument must be of type number\');if(r<0)throw new RangeError(\'The value "\'+r+\'" is invalid for option "size"\')}function _f(r,t,e){return Aa(r),r<=0?$e(r):t!==void 0?typeof e=="string"?$e(r).fill(t,e):$e(r).fill(t):$e(r)}C.alloc=function(r,t,e){return _f(r,t,e)};function Ko(r){return Aa(r),$e(r<0?0:Do(r)|0)}C.allocUnsafe=function(r){return Ko(r)};C.allocUnsafeSlow=function(r){return Ko(r)};function Af(r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!C.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let e=Ma(r,t)|0,n=$e(e),o=n.write(r,t);return o!==e&&(n=n.slice(0,o)),n}function zo(r){let t=r.length<0?0:Do(r.length)|0,e=$e(t);for(let n=0;n=Ii)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ii.toString(16)+" bytes");return r|0}function Rf(r){return+r!=r&&(r=0),C.alloc(+r)}C.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==C.prototype};C.compare=function(t,e){if(qe(t,Uint8Array)&&(t=C.from(t,t.offset,t.byteLength)),qe(e,Uint8Array)&&(e=C.from(e,e.offset,e.byteLength)),!C.isBuffer(t)||!C.isBuffer(e))throw new TypeError(\'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array\');if(t===e)return 0;let n=t.length,o=e.length;for(let u=0,h=Math.min(n,o);uo.length?(C.isBuffer(h)||(h=C.from(h)),h.copy(o,u)):Uint8Array.prototype.set.call(o,h,u);else if(C.isBuffer(h))h.copy(o,u);else throw new TypeError(\'"list" argument must be an Array of Buffers\');u+=h.length}return o};function Ma(r,t){if(C.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||qe(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError(\'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type \'+typeof r);let e=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&e===0)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return Fo(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return za(r).length;default:if(o)return n?-1:Fo(r).length;t=(""+t).toLowerCase(),o=!0}}C.byteLength=Ma;function Tf(r,t,e){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return Df(this,t,e);case"utf8":case"utf-8":return Ra(this,t,e);case"ascii":return Ff(this,t,e);case"latin1":case"binary":return Kf(this,t,e);case"base64":return zf(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wf(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}C.prototype._isBuffer=!0;function Zr(r,t,e){let n=r[t];r[t]=r[e],r[e]=n}C.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;ee&&(t+=" ... "),""};Ba&&(C.prototype[Ba]=C.prototype.inspect);C.prototype.compare=function(t,e,n,o,u){if(qe(t,Uint8Array)&&(t=C.from(t,t.offset,t.byteLength)),!C.isBuffer(t))throw new TypeError(\'The "target" argument must be one of type Buffer or Uint8Array. Received type \'+typeof t);if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),o===void 0&&(o=0),u===void 0&&(u=this.length),e<0||n>t.length||o<0||u>this.length)throw new RangeError("out of range index");if(o>=u&&e>=n)return 0;if(o>=u)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,u>>>=0,this===t)return 0;let h=u-o,w=n-e,m=Math.min(h,w),x=this.slice(o,u),v=t.slice(e,n);for(let B=0;B2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,Ho(e)&&(e=o?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(o)return-1;e=r.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof t=="string"&&(t=C.from(t,n)),C.isBuffer(t))return t.length===0?-1:Sa(r,t,e,n,o);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):Sa(r,[t],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Sa(r,t,e,n,o){let u=1,h=r.length,w=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||t.length<2)return-1;u=2,h/=2,w/=2,e/=2}function m(v,B){return u===1?v[B]:v.readUInt16BE(B*u)}let x;if(o){let v=-1;for(x=e;xh&&(e=h-w),x=e;x>=0;x--){let v=!0;for(let B=0;Bo&&(n=o)):n=o;let u=t.length;n>u/2&&(n=u/2);let h;for(h=0;h>>0,isFinite(n)?(n=n>>>0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let u=this.length-e;if((n===void 0||n>u)&&(n=u),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");let h=!1;for(;;)switch(o){case"hex":return Pf(this,t,e,n);case"utf8":case"utf-8":return Cf(this,t,e,n);case"ascii":case"latin1":case"binary":return Of(this,t,e,n);case"base64":return Uf(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nf(this,t,e,n);default:if(h)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),h=!0}};C.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function zf(r,t,e){return t===0&&e===r.length?No.fromByteArray(r):No.fromByteArray(r.slice(t,e))}function Ra(r,t,e){e=Math.min(r.length,e);let n=[],o=t;for(;o239?4:u>223?3:u>191?2:1;if(o+w<=e){let m,x,v,B;switch(w){case 1:u<128&&(h=u);break;case 2:m=r[o+1],(m&192)===128&&(B=(u&31)<<6|m&63,B>127&&(h=B));break;case 3:m=r[o+1],x=r[o+2],(m&192)===128&&(x&192)===128&&(B=(u&15)<<12|(m&63)<<6|x&63,B>2047&&(B<55296||B>57343)&&(h=B));break;case 4:m=r[o+1],x=r[o+2],v=r[o+3],(m&192)===128&&(x&192)===128&&(v&192)===128&&(B=(u&15)<<18|(m&63)<<12|(x&63)<<6|v&63,B>65535&&B<1114112&&(h=B))}}h===null?(h=65533,w=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|h&1023),n.push(h),o+=w}return qf(n)}var Ea=4096;function qf(r){let t=r.length;if(t<=Ea)return String.fromCharCode.apply(String,r);let e="",n=0;for(;nn)&&(e=n);let o="";for(let u=t;un&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),ee)throw new RangeError("Trying to access beyond buffer length")}C.prototype.readUintLE=C.prototype.readUIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||ue(t,e,this.length);let o=this[t],u=1,h=0;for(;++h>>0,e=e>>>0,n||ue(t,e,this.length);let o=this[t+--e],u=1;for(;e>0&&(u*=256);)o+=this[t+--e]*u;return o};C.prototype.readUint8=C.prototype.readUInt8=function(t,e){return t=t>>>0,e||ue(t,1,this.length),this[t]};C.prototype.readUint16LE=C.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||ue(t,2,this.length),this[t]|this[t+1]<<8};C.prototype.readUint16BE=C.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||ue(t,2,this.length),this[t]<<8|this[t+1]};C.prototype.readUint32LE=C.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||ue(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};C.prototype.readUint32BE=C.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||ue(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};C.prototype.readBigUInt64LE=ir(function(t){t=t>>>0,yn(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&Vn(t,this.length-8);let o=e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,u=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(o)+(BigInt(u)<>>0,yn(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&Vn(t,this.length-8);let o=e*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],u=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(o)<>>0,e=e>>>0,n||ue(t,e,this.length);let o=this[t],u=1,h=0;for(;++h=u&&(o-=Math.pow(2,8*e)),o};C.prototype.readIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||ue(t,e,this.length);let o=e,u=1,h=this[t+--o];for(;o>0&&(u*=256);)h+=this[t+--o]*u;return u*=128,h>=u&&(h-=Math.pow(2,8*e)),h};C.prototype.readInt8=function(t,e){return t=t>>>0,e||ue(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};C.prototype.readInt16LE=function(t,e){t=t>>>0,e||ue(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};C.prototype.readInt16BE=function(t,e){t=t>>>0,e||ue(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};C.prototype.readInt32LE=function(t,e){return t=t>>>0,e||ue(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};C.prototype.readInt32BE=function(t,e){return t=t>>>0,e||ue(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};C.prototype.readBigInt64LE=ir(function(t){t=t>>>0,yn(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&Vn(t,this.length-8);let o=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(o)<>>0,yn(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&Vn(t,this.length-8);let o=(e<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(o)<>>0,e||ue(t,4,this.length),pn.read(this,t,!0,23,4)};C.prototype.readFloatBE=function(t,e){return t=t>>>0,e||ue(t,4,this.length),pn.read(this,t,!1,23,4)};C.prototype.readDoubleLE=function(t,e){return t=t>>>0,e||ue(t,8,this.length),pn.read(this,t,!0,52,8)};C.prototype.readDoubleBE=function(t,e){return t=t>>>0,e||ue(t,8,this.length),pn.read(this,t,!1,52,8)};function Be(r,t,e,n,o,u){if(!C.isBuffer(r))throw new TypeError(\'"buffer" argument must be a Buffer instance\');if(t>o||tr.length)throw new RangeError("Index out of range")}C.prototype.writeUintLE=C.prototype.writeUIntLE=function(t,e,n,o){if(t=+t,e=e>>>0,n=n>>>0,!o){let w=Math.pow(2,8*n)-1;Be(this,t,e,n,w,0)}let u=1,h=0;for(this[e]=t&255;++h>>0,n=n>>>0,!o){let w=Math.pow(2,8*n)-1;Be(this,t,e,n,w,0)}let u=n-1,h=1;for(this[e+u]=t&255;--u>=0&&(h*=256);)this[e+u]=t/h&255;return e+n};C.prototype.writeUint8=C.prototype.writeUInt8=function(t,e,n){return t=+t,e=e>>>0,n||Be(this,t,e,1,255,0),this[e]=t&255,e+1};C.prototype.writeUint16LE=C.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||Be(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2};C.prototype.writeUint16BE=C.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||Be(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2};C.prototype.writeUint32LE=C.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||Be(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4};C.prototype.writeUint32BE=C.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||Be(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function Ta(r,t,e,n,o){Na(t,n,o,r,e,7);let u=Number(t&BigInt(4294967295));r[e++]=u,u=u>>8,r[e++]=u,u=u>>8,r[e++]=u,u=u>>8,r[e++]=u;let h=Number(t>>BigInt(32)&BigInt(4294967295));return r[e++]=h,h=h>>8,r[e++]=h,h=h>>8,r[e++]=h,h=h>>8,r[e++]=h,e}function Pa(r,t,e,n,o){Na(t,n,o,r,e,7);let u=Number(t&BigInt(4294967295));r[e+7]=u,u=u>>8,r[e+6]=u,u=u>>8,r[e+5]=u,u=u>>8,r[e+4]=u;let h=Number(t>>BigInt(32)&BigInt(4294967295));return r[e+3]=h,h=h>>8,r[e+2]=h,h=h>>8,r[e+1]=h,h=h>>8,r[e]=h,e+8}C.prototype.writeBigUInt64LE=ir(function(t,e=0){return Ta(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});C.prototype.writeBigUInt64BE=ir(function(t,e=0){return Pa(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});C.prototype.writeIntLE=function(t,e,n,o){if(t=+t,e=e>>>0,!o){let m=Math.pow(2,8*n-1);Be(this,t,e,n,m-1,-m)}let u=0,h=1,w=0;for(this[e]=t&255;++u>0)-w&255;return e+n};C.prototype.writeIntBE=function(t,e,n,o){if(t=+t,e=e>>>0,!o){let m=Math.pow(2,8*n-1);Be(this,t,e,n,m-1,-m)}let u=n-1,h=1,w=0;for(this[e+u]=t&255;--u>=0&&(h*=256);)t<0&&w===0&&this[e+u+1]!==0&&(w=1),this[e+u]=(t/h>>0)-w&255;return e+n};C.prototype.writeInt8=function(t,e,n){return t=+t,e=e>>>0,n||Be(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1};C.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||Be(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2};C.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||Be(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2};C.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||Be(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4};C.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||Be(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};C.prototype.writeBigInt64LE=ir(function(t,e=0){return Ta(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});C.prototype.writeBigInt64BE=ir(function(t,e=0){return Pa(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ca(r,t,e,n,o,u){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Oa(r,t,e,n,o){return t=+t,e=e>>>0,o||Ca(r,t,e,4,34028234663852886e22,-34028234663852886e22),pn.write(r,t,e,n,23,4),e+4}C.prototype.writeFloatLE=function(t,e,n){return Oa(this,t,e,!0,n)};C.prototype.writeFloatBE=function(t,e,n){return Oa(this,t,e,!1,n)};function Ua(r,t,e,n,o){return t=+t,e=e>>>0,o||Ca(r,t,e,8,17976931348623157e292,-17976931348623157e292),pn.write(r,t,e,n,52,8),e+8}C.prototype.writeDoubleLE=function(t,e,n){return Ua(this,t,e,!0,n)};C.prototype.writeDoubleBE=function(t,e,n){return Ua(this,t,e,!1,n)};C.prototype.copy=function(t,e,n,o){if(!C.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!o&&o!==0&&(o=this.length),e>=t.length&&(e=t.length),e||(e=0),o>0&&o=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-e>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let u;if(typeof t=="number")for(u=e;u2**32?o=Ia(String(e)):typeof e=="bigint"&&(o=String(e),(e>BigInt(2)**BigInt(32)||e<-(BigInt(2)**BigInt(32)))&&(o=Ia(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);function Ia(r){let t="",e=r.length,n=r[0]==="-"?1:0;for(;e>=n+4;e-=3)t=`_${r.slice(e-3,e)}${t}`;return`${r.slice(0,e)}${t}`}function Hf(r,t,e){yn(t,"offset"),(r[t]===void 0||r[t+e]===void 0)&&Vn(t,r.length-(e+1))}function Na(r,t,e,n,o,u){if(r>e||r3?t===0||t===BigInt(0)?w=`>= 0${h} and < 2${h} ** ${(u+1)*8}${h}`:w=`>= -(2${h} ** ${(u+1)*8-1}${h}) and < 2 ** ${(u+1)*8-1}${h}`:w=`>= ${t}${h} and <= ${e}${h}`,new dn.ERR_OUT_OF_RANGE("value",w,r)}Hf(n,o,u)}function yn(r,t){if(typeof r!="number")throw new dn.ERR_INVALID_ARG_TYPE(t,"number",r)}function Vn(r,t,e){throw Math.floor(r)!==r?(yn(r,e),new dn.ERR_OUT_OF_RANGE(e||"offset","an integer",r)):t<0?new dn.ERR_BUFFER_OUT_OF_BOUNDS:new dn.ERR_OUT_OF_RANGE(e||"offset",`>= ${e?1:0} and <= ${t}`,r)}var $f=/[^+/0-9A-Za-z-_]/g;function Vf(r){if(r=r.split("=")[0],r=r.trim().replace($f,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function Fo(r,t){t=t||1/0;let e,n=r.length,o=null,u=[];for(let h=0;h55295&&e<57344){if(!o){if(e>56319){(t-=3)>-1&&u.push(239,191,189);continue}else if(h+1===n){(t-=3)>-1&&u.push(239,191,189);continue}o=e;continue}if(e<56320){(t-=3)>-1&&u.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(t-=3)>-1&&u.push(239,191,189);if(o=null,e<128){if((t-=1)<0)break;u.push(e)}else if(e<2048){if((t-=2)<0)break;u.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;u.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;u.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return u}function Gf(r){let t=[];for(let e=0;e>8,o=e%256,u.push(o),u.push(n);return u}function za(r){return No.toByteArray(Vf(r))}function _i(r,t,e,n){let o;for(o=0;o=t.length||o>=r.length);++o)t[o+e]=r[o];return o}function qe(r,t){return r instanceof t||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===t.name}function Ho(r){return r!==r}var jf=function(){let r="0123456789abcdef",t=new Array(256);for(let e=0;e<16;++e){let n=e*16;for(let o=0;o<16;++o)t[n+o]=r[e]+r[o]}return t}();function ir(r){return typeof BigInt>"u"?Yf:r}function Yf(){throw new Error("BigInt not supported")}});var O=ae(()=>{"use strict";var qa=P(mn());globalThis.Buffer=qa.Buffer});var wd,Ai,Fa=wt(()=>{"use strict";wd=P(O()),Ai=class extends Error{constructor(){super(...arguments);this.name="AbortError"}}});async function Ka(r){try{let t=await r(),e=typeof t=="string"?t:JSON.stringify(t);Lit.Actions.setResponse({response:e})}catch(t){if(t instanceof Ai)return;Lit.Actions.setResponse({response:`Error: ${t.message}`})}}var xd,Da=wt(()=>{"use strict";xd=P(O());Fa()});var Bd,Wa,Ha=wt(()=>{"use strict";Bd=P(O()),Wa="lit_"});async function $a({accessControlConditions:r,privateKey:t,publicKey:e}){let{ciphertext:n,dataToEncryptHash:o}=await Lit.Actions.encrypt({accessControlConditions:r,to_encrypt:new TextEncoder().encode(Wa+t)});return{ciphertext:n,dataToEncryptHash:o,publicKey:e}}var Id,Va=wt(()=>{"use strict";Id=P(O());Ha()});function Gn(r){if(!Number.isSafeInteger(r)||r<0)throw new Error("positive integer expected, got "+r)}function Jf(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function or(r,...t){if(!Jf(r))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(r.length))throw new Error("Uint8Array expected of length "+t+", got length="+r.length)}function Ga(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Gn(r.outputLen),Gn(r.blockLen)}function Ve(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}function Mi(r,t){or(r);let e=t.outputLen;if(r.length{Ad=P(O(),1)});var Ld,jr,Za=wt(()=>{Ld=P(O(),1),jr=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});function ja(r){return new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4))}function Li(r){return new DataView(r.buffer,r.byteOffset,r.byteLength)}function Pe(r,t){return r<<32-t|r>>>t}function Xf(r){return r<<24&4278190080|r<<8&16711680|r>>>8&65280|r>>>24&255}function Vo(r){for(let t=0;tr().update(ar(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}function Ja(r){let t=(n,o)=>r(o).update(ar(n)).digest(),e=r({});return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=n=>r(n),t}function Ri(r=32){if(jr&&typeof jr.getRandomValues=="function")return jr.getRandomValues(new Uint8Array(r));if(jr&&typeof jr.randomBytes=="function")return jr.randomBytes(r);throw new Error("crypto.getRandomValues must be defined")}var Cd,$o,sr,ur=wt(()=>{Cd=P(O(),1);Za();Zn();$o=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();sr=class{clone(){return this._cloneInto()}}});function Qf(r,t,e,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(t,e,n);let o=BigInt(32),u=BigInt(4294967295),h=Number(e>>o&u),w=Number(e&u),m=n?4:0,x=n?0:4;r.setUint32(t+m,h,n),r.setUint32(t+x,w,n)}function Xa(r,t,e){return r&t^~r&e}function Qa(r,t,e){return r&t^r&e^t&e}var zd,bn,Zo=wt(()=>{zd=P(O(),1);Zn();ur();bn=class extends sr{constructor(t,e,n,o){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Li(this.buffer)}update(t){Ve(this);let{view:e,buffer:n,blockLen:o}=this;t=ar(t);let u=t.length;for(let h=0;ho-h&&(this.process(n,0),h=0);for(let B=h;Bv.length)throw new Error("_sha2: outputLen bigger than state");for(let B=0;B>jo&Ti)}:{h:Number(r>>jo&Ti)|0,l:Number(r&Ti)|0}}function Yo(r,t=!1){let e=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let o=0;o>>0)+(n>>>0);return{h:r+e+(o/2**32|0)|0,l:o|0}}var Fd,Ti,jo,th,eh,rh,nh,ih,oh,sh,ah,uh,Jo,Xo,Qo,ts,fh,hh,lh,dh,ph,yh,gh,Kt,es=wt(()=>{Fd=P(O(),1),Ti=BigInt(4294967295),jo=BigInt(32);th=(r,t)=>BigInt(r>>>0)<>>0),eh=(r,t,e)=>r>>>e,rh=(r,t,e)=>r<<32-e|t>>>e,nh=(r,t,e)=>r>>>e|t<<32-e,ih=(r,t,e)=>r<<32-e|t>>>e,oh=(r,t,e)=>r<<64-e|t>>>e-32,sh=(r,t,e)=>r>>>e-32|t<<64-e,ah=(r,t)=>t,uh=(r,t)=>r,Jo=(r,t,e)=>r<>>32-e,Xo=(r,t,e)=>t<>>32-e,Qo=(r,t,e)=>t<>>64-e,ts=(r,t,e)=>r<>>64-e;fh=(r,t,e)=>(r>>>0)+(t>>>0)+(e>>>0),hh=(r,t,e,n)=>t+e+n+(r/2**32|0)|0,lh=(r,t,e,n)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0),dh=(r,t,e,n,o)=>t+e+n+o+(r/2**32|0)|0,ph=(r,t,e,n,o)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0)+(o>>>0),yh=(r,t,e,n,o,u)=>t+e+n+o+u+(r/2**32|0)|0,gh={fromBig:tu,split:Yo,toBig:th,shrSH:eh,shrSL:rh,rotrSH:nh,rotrSL:ih,rotrBH:oh,rotrBL:sh,rotr32H:ah,rotr32L:uh,rotlSH:Jo,rotlSL:Xo,rotlBH:Qo,rotlBL:ts,add:ch,add3L:fh,add3H:hh,add4L:lh,add4H:dh,add5H:yh,add5L:ph},Kt=gh});var $d,mh,wh,cr,fr,rs,eu,ru=wt(()=>{$d=P(O(),1);Zo();es();ur();[mh,wh]=(()=>Kt.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))))(),cr=new Uint32Array(80),fr=new Uint32Array(80),rs=class extends bn{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:n,Bl:o,Ch:u,Cl:h,Dh:w,Dl:m,Eh:x,El:v,Fh:B,Fl:_,Gh:E,Gl:F,Hh:R,Hl:I}=this;return[t,e,n,o,u,h,w,m,x,v,B,_,E,F,R,I]}set(t,e,n,o,u,h,w,m,x,v,B,_,E,F,R,I){this.Ah=t|0,this.Al=e|0,this.Bh=n|0,this.Bl=o|0,this.Ch=u|0,this.Cl=h|0,this.Dh=w|0,this.Dl=m|0,this.Eh=x|0,this.El=v|0,this.Fh=B|0,this.Fl=_|0,this.Gh=E|0,this.Gl=F|0,this.Hh=R|0,this.Hl=I|0}process(t,e){for(let U=0;U<16;U++,e+=4)cr[U]=t.getUint32(e),fr[U]=t.getUint32(e+=4);for(let U=16;U<80;U++){let K=cr[U-15]|0,tt=fr[U-15]|0,W=Kt.rotrSH(K,tt,1)^Kt.rotrSH(K,tt,8)^Kt.shrSH(K,tt,7),Z=Kt.rotrSL(K,tt,1)^Kt.rotrSL(K,tt,8)^Kt.shrSL(K,tt,7),et=cr[U-2]|0,Q=fr[U-2]|0,$t=Kt.rotrSH(et,Q,19)^Kt.rotrBH(et,Q,61)^Kt.shrSH(et,Q,6),V=Kt.rotrSL(et,Q,19)^Kt.rotrBL(et,Q,61)^Kt.shrSL(et,Q,6),nt=Kt.add4L(Z,V,fr[U-7],fr[U-16]),y=Kt.add4H(nt,W,$t,cr[U-7],cr[U-16]);cr[U]=y|0,fr[U]=nt|0}let{Ah:n,Al:o,Bh:u,Bl:h,Ch:w,Cl:m,Dh:x,Dl:v,Eh:B,El:_,Fh:E,Fl:F,Gh:R,Gl:I,Hh:N,Hl:D}=this;for(let U=0;U<80;U++){let K=Kt.rotrSH(B,_,14)^Kt.rotrSH(B,_,18)^Kt.rotrBH(B,_,41),tt=Kt.rotrSL(B,_,14)^Kt.rotrSL(B,_,18)^Kt.rotrBL(B,_,41),W=B&E^~B&R,Z=_&F^~_&I,et=Kt.add5L(D,tt,Z,wh[U],fr[U]),Q=Kt.add5H(et,N,K,W,mh[U],cr[U]),$t=et|0,V=Kt.rotrSH(n,o,28)^Kt.rotrBH(n,o,34)^Kt.rotrBH(n,o,39),nt=Kt.rotrSL(n,o,28)^Kt.rotrBL(n,o,34)^Kt.rotrBL(n,o,39),y=n&u^n&w^u&w,i=o&h^o&m^h&m;N=R|0,D=I|0,R=E|0,I=F|0,E=B|0,F=_|0,{h:B,l:_}=Kt.add(x|0,v|0,Q|0,$t|0),x=w|0,v=m|0,w=u|0,m=h|0,u=n|0,h=o|0;let a=Kt.add3L($t,nt,i);n=Kt.add3H(a,Q,V,y),o=a|0}({h:n,l:o}=Kt.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:u,l:h}=Kt.add(this.Bh|0,this.Bl|0,u|0,h|0),{h:w,l:m}=Kt.add(this.Ch|0,this.Cl|0,w|0,m|0),{h:x,l:v}=Kt.add(this.Dh|0,this.Dl|0,x|0,v|0),{h:B,l:_}=Kt.add(this.Eh|0,this.El|0,B|0,_|0),{h:E,l:F}=Kt.add(this.Fh|0,this.Fl|0,E|0,F|0),{h:R,l:I}=Kt.add(this.Gh|0,this.Gl|0,R|0,I|0),{h:N,l:D}=Kt.add(this.Hh|0,this.Hl|0,N|0,D|0),this.set(n,o,u,h,w,m,x,v,B,_,E,F,R,I,N,D)}roundClean(){cr.fill(0),fr.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},eu=wn(()=>new rs)});var Oi={};ga(Oi,{aInRange:()=>Se,abool:()=>Ce,abytes:()=>vn,bitGet:()=>Sh,bitLen:()=>ss,bitMask:()=>Yn,bitSet:()=>Eh,bytesToHex:()=>Ze,bytesToNumberBE:()=>je,bytesToNumberLE:()=>lr,concatBytes:()=>Ye,createHmacDrbg:()=>as,ensureBytes:()=>ne,equalBytes:()=>kh,hexToBytes:()=>Jr,hexToNumber:()=>os,inRange:()=>jn,isBytes:()=>hr,memoized:()=>Qr,notImplemented:()=>_h,numberToBytesBE:()=>dr,numberToBytesLE:()=>Xr,numberToHexUnpadded:()=>Yr,numberToVarBytesBE:()=>xh,utf8ToBytes:()=>Bh,validateObject:()=>Fe});function hr(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function vn(r){if(!hr(r))throw new Error("Uint8Array expected")}function Ce(r,t){if(typeof t!="boolean")throw new Error(r+" boolean expected, got "+t)}function Ze(r){vn(r);let t="";for(let e=0;e=Ge._0&&r<=Ge._9)return r-Ge._0;if(r>=Ge.A&&r<=Ge.F)return r-(Ge.A-10);if(r>=Ge.a&&r<=Ge.f)return r-(Ge.a-10)}function Jr(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let t=r.length,e=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(e);for(let o=0,u=0;oPi;r>>=Ci,t+=1);return t}function Sh(r,t){return r>>BigInt(t)&Ci}function Eh(r,t,e){return r|(e?Ci:Pi)<{n.fill(1),o.fill(0),u=0},w=(...B)=>e(o,n,...B),m=(B=is())=>{o=w(iu([0]),B),n=w(),B.length!==0&&(o=w(iu([1]),B),n=w())},x=()=>{if(u++>=1e3)throw new Error("drbg: tried 1000 values");let B=0,_=[];for(;B{h(),m(B);let E;for(;!(E=_(x()));)m();return h(),E}}function Fe(r,t,e={}){let n=(o,u,h)=>{let w=Ih[u];if(typeof w!="function")throw new Error("invalid validator function");let m=r[o];if(!(h&&m===void 0)&&!w(m,r))throw new Error("param "+String(o)+" is invalid. Expected "+u+", got "+m)};for(let[o,u]of Object.entries(t))n(o,u,!1);for(let[o,u]of Object.entries(e))n(o,u,!0);return r}function Qr(r){let t=new WeakMap;return(e,...n)=>{let o=t.get(e);if(o!==void 0)return o;let u=r(e,...n);return t.set(e,u),u}}var Vd,Pi,Ci,bh,vh,Ge,ns,Yn,is,iu,Ih,_h,tn=wt(()=>{Vd=P(O(),1);Pi=BigInt(0),Ci=BigInt(1),bh=BigInt(2);vh=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));Ge={_0:48,_9:57,A:65,F:70,a:97,f:102};ns=r=>typeof r=="bigint"&&Pi<=r;Yn=r=>(bh<new Uint8Array(r),iu=r=>Uint8Array.from(r);Ih={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||hr(r),isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,t)=>t.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};_h=()=>{throw new Error("not implemented")}});function jt(r,t){let e=r%t;return e>=oe?e:t+e}function Rh(r,t,e){if(toe;)t&te&&(n=n*r%e),r=r*r%e,t>>=te;return n}function ee(r,t,e){let n=r;for(;t-- >oe;)n*=n,n%=e;return n}function Ui(r,t){if(r===oe)throw new Error("invert: expected non-zero number");if(t<=oe)throw new Error("invert: expected positive modulus, got "+t);let e=jt(r,t),n=t,o=oe,u=te,h=te,w=oe;for(;e!==oe;){let x=n/e,v=n%e,B=o-h*x,_=u-w*x;n=e,e=v,o=h,u=w,h=B,w=_}if(n!==te)throw new Error("invert: does not exist");return jt(o,t)}function Th(r){let t=(r-te)/en,e,n,o;for(e=r-te,n=0;e%en===oe;e/=en,n++);for(o=en;o1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){let h=(r+te)/us;return function(m,x){let v=m.pow(x,h);if(!m.eql(m.sqr(v),x))throw new Error("Cannot find square root");return v}}let u=(e+te)/en;return function(w,m){if(w.pow(m,t)===w.neg(w.ONE))throw new Error("Cannot find square root");let x=n,v=w.pow(w.mul(w.ONE,o),e),B=w.pow(m,u),_=w.pow(m,e);for(;!w.eql(_,w.ONE);){if(w.eql(_,w.ZERO))return w.ZERO;let E=1;for(let R=w.sqr(_);E(n[o]="function",n),t);return Fe(r,e)}function Oh(r,t,e){if(eoe;)e&te&&(n=r.mul(n,o)),o=r.sqr(o),e>>=te;return n}function Uh(r,t){let e=new Array(t.length),n=t.reduce((u,h,w)=>r.is0(h)?u:(e[w]=u,r.mul(u,h)),r.ONE),o=r.inv(n);return t.reduceRight((u,h,w)=>r.is0(h)?u:(e[w]=r.mul(u,e[w]),r.mul(u,h)),o),e}function fs(r,t){let e=t!==void 0?t:r.toString(2).length,n=Math.ceil(e/8);return{nBitLength:e,nByteLength:n}}function pr(r,t,e=!1,n={}){if(r<=oe)throw new Error("invalid field: expected ORDER > 0, got "+r);let{nBitLength:o,nByteLength:u}=fs(r,t);if(u>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let h,w=Object.freeze({ORDER:r,isLE:e,BITS:o,BYTES:u,MASK:Yn(o),ZERO:oe,ONE:te,create:m=>jt(m,r),isValid:m=>{if(typeof m!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof m);return oe<=m&&mm===oe,isOdd:m=>(m&te)===te,neg:m=>jt(-m,r),eql:(m,x)=>m===x,sqr:m=>jt(m*m,r),add:(m,x)=>jt(m+x,r),sub:(m,x)=>jt(m-x,r),mul:(m,x)=>jt(m*x,r),pow:(m,x)=>Oh(w,m,x),div:(m,x)=>jt(m*Ui(x,r),r),sqrN:m=>m*m,addN:(m,x)=>m+x,subN:(m,x)=>m-x,mulN:(m,x)=>m*x,inv:m=>Ui(m,r),sqrt:n.sqrt||(m=>(h||(h=Ph(r)),h(w,m))),invertBatch:m=>Uh(w,m),cmov:(m,x,v)=>v?x:m,toBytes:m=>e?Xr(m,u):dr(m,u),fromBytes:m=>{if(m.length!==u)throw new Error("Field.fromBytes: expected "+u+" bytes, got "+m.length);return e?lr(m):je(m)}});return Object.freeze(w)}function uu(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let t=r.toString(2).length;return Math.ceil(t/8)}function hs(r){let t=uu(r);return t+Math.ceil(t/2)}function cu(r,t,e=!1){let n=r.length,o=uu(t),u=hs(t);if(n<16||n1024)throw new Error("expected "+u+"-1024 bytes of input, got "+n);let h=e?lr(r):je(r),w=jt(h,t-te)+te;return e?Xr(w,o):dr(w,o)}var jd,oe,te,en,Ah,us,ou,su,Mh,Lh,au,Ch,xn=wt(()=>{jd=P(O(),1);tn();oe=BigInt(0),te=BigInt(1),en=BigInt(2),Ah=BigInt(3),us=BigInt(4),ou=BigInt(5),su=BigInt(8),Mh=BigInt(9),Lh=BigInt(16);au=(r,t)=>(jt(r,t)&te)===te,Ch=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function ls(r,t){let e=t.negate();return r?e:t}function hu(r,t){if(!Number.isSafeInteger(r)||r<=0||r>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+r)}function ds(r,t){hu(r,t);let e=Math.ceil(t/r)+1,n=2**(r-1);return{windows:e,windowSize:n}}function Nh(r,t){if(!Array.isArray(r))throw new Error("array expected");r.forEach((e,n)=>{if(!(e instanceof t))throw new Error("invalid point at index "+n)})}function zh(r,t){if(!Array.isArray(r))throw new Error("array of scalars expected");r.forEach((e,n)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+n)})}function ys(r){return lu.get(r)||1}function zi(r,t){return{constTimeNegate:ls,hasPrecomputes(e){return ys(e)!==1},unsafeLadder(e,n,o=r.ZERO){let u=e;for(;n>fu;)n&Ni&&(o=o.add(u)),u=u.double(),n>>=Ni;return o},precomputeWindow(e,n){let{windows:o,windowSize:u}=ds(n,t),h=[],w=e,m=w;for(let x=0;x>=B,F>h&&(F-=v,o+=Ni);let R=E,I=E+Math.abs(F)-1,N=_%2!==0,D=F<0;F===0?m=m.add(ls(N,n[R])):w=w.add(ls(D,n[I]))}return{p:w,f:m}},wNAFUnsafe(e,n,o,u=r.ZERO){let{windows:h,windowSize:w}=ds(e,t),m=BigInt(2**e-1),x=2**e,v=BigInt(e);for(let B=0;B>=v,E>w&&(E-=x,o+=Ni),E===0)continue;let F=n[_+Math.abs(E)-1];E<0&&(F=F.negate()),u=u.add(F)}return u},getPrecomputes(e,n,o){let u=ps.get(n);return u||(u=this.precomputeWindow(n,e),e!==1&&ps.set(n,o(u))),u},wNAFCached(e,n,o){let u=ys(e);return this.wNAF(u,this.getPrecomputes(u,e,o),n)},wNAFCachedUnsafe(e,n,o,u){let h=ys(e);return h===1?this.unsafeLadder(e,n,u):this.wNAFUnsafe(h,this.getPrecomputes(h,e,o),n,u)},setWindowSize(e,n){hu(n,t),lu.set(e,n),ps.delete(e)}}}function qi(r,t,e,n){if(Nh(e,r),zh(n,t),e.length!==n.length)throw new Error("arrays of points and scalars must have equal length");let o=r.ZERO,u=ss(BigInt(e.length)),h=u>12?u-3:u>4?u-2:u?2:1,w=(1<=0;B-=h){m.fill(o);for(let E=0;E>BigInt(B)&BigInt(w));m[R]=m[R].add(e[E])}let _=o;for(let E=m.length-1,F=o;E>0;E--)F=F.add(m[E]),_=_.add(F);if(v=v.add(_),B!==0)for(let E=0;E{Qd=P(O(),1);xn();tn();fu=BigInt(0),Ni=BigInt(1);ps=new WeakMap,lu=new WeakMap});function Kh(r){let t=Jn(r);return Fe(r,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function du(r){let t=Kh(r),{Fp:e,n,prehash:o,hash:u,randomBytes:h,nByteLength:w,h:m}=t,x=Fi<{try{return{isValid:!0,value:e.sqrt(c*e.inv(f))}}catch{return{isValid:!1,value:Oe}}}),E=t.adjustScalarBytes||(c=>c),F=t.domain||((c,f,l)=>{if(Ce("phflag",l),f.length||l)throw new Error("Contexts/pre-hash are not supported");return c});function R(c,f){Se("coordinate "+c,f,Oe,x)}function I(c){if(!(c instanceof U))throw new Error("ExtendedPoint expected")}let N=Qr((c,f)=>{let{ex:l,ey:g,ez:b}=c,d=c.is0();f==null&&(f=d?qh:e.inv(b));let s=v(l*f),p=v(g*f),S=v(b*f);if(d)return{x:Oe,y:Ee};if(S!==Ee)throw new Error("invZ was invalid");return{x:s,y:p}}),D=Qr(c=>{let{a:f,d:l}=t;if(c.is0())throw new Error("bad point: ZERO");let{ex:g,ey:b,ez:d,et:s}=c,p=v(g*g),S=v(b*b),L=v(d*d),T=v(L*L),q=v(p*f),$=v(L*v(q+S)),G=v(T+v(l*v(p*S)));if($!==G)throw new Error("bad point: equation left != right (1)");let Dt=v(g*b),J=v(d*s);if(Dt!==J)throw new Error("bad point: equation left != right (2)");return!0});class U{constructor(f,l,g,b){this.ex=f,this.ey=l,this.ez=g,this.et=b,R("x",f),R("y",l),R("z",g),R("t",b),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(f){if(f instanceof U)throw new Error("extended point not allowed");let{x:l,y:g}=f||{};return R("x",l),R("y",g),new U(l,g,Ee,v(l*g))}static normalizeZ(f){let l=e.invertBatch(f.map(g=>g.ez));return f.map((g,b)=>g.toAffine(l[b])).map(U.fromAffine)}static msm(f,l){return qi(U,B,f,l)}_setWindowSize(f){W.setWindowSize(this,f)}assertValidity(){D(this)}equals(f){I(f);let{ex:l,ey:g,ez:b}=this,{ex:d,ey:s,ez:p}=f,S=v(l*p),L=v(d*b),T=v(g*p),q=v(s*b);return S===L&&T===q}is0(){return this.equals(U.ZERO)}negate(){return new U(v(-this.ex),this.ey,this.ez,v(-this.et))}double(){let{a:f}=t,{ex:l,ey:g,ez:b}=this,d=v(l*l),s=v(g*g),p=v(Fi*v(b*b)),S=v(f*d),L=l+g,T=v(v(L*L)-d-s),q=S+s,$=q-p,G=S-s,Dt=v(T*$),J=v(q*G),X=v(T*G),de=v($*q);return new U(Dt,J,de,X)}add(f){I(f);let{a:l,d:g}=t,{ex:b,ey:d,ez:s,et:p}=this,{ex:S,ey:L,ez:T,et:q}=f;if(l===BigInt(-1)){let ut=v((d-b)*(L+S)),ct=v((d+b)*(L-S)),He=v(ct-ut);if(He===Oe)return this.double();let ft=v(s*Fi*q),ht=v(p*Fi*T),nr=ht+ft,lt=ct+ut,dt=ht-ft,Ir=v(nr*He),gt=v(lt*dt),mt=v(nr*dt),_r=v(He*lt);return new U(Ir,gt,_r,mt)}let $=v(b*S),G=v(d*L),Dt=v(p*g*q),J=v(s*T),X=v((b+d)*(S+L)-$-G),de=J-Dt,it=J+Dt,st=v(G-l*$),Sr=v(X*de),pt=v(it*st),yt=v(X*st),Er=v(de*it);return new U(Sr,pt,Er,yt)}subtract(f){return this.add(f.negate())}wNAF(f){return W.wNAFCached(this,f,U.normalizeZ)}multiply(f){let l=f;Se("scalar",l,Ee,n);let{p:g,f:b}=this.wNAF(l);return U.normalizeZ([g,b])[0]}multiplyUnsafe(f,l=U.ZERO){let g=f;return Se("scalar",g,Oe,n),g===Oe?tt:this.is0()||g===Ee?this:W.wNAFCachedUnsafe(this,g,U.normalizeZ,l)}isSmallOrder(){return this.multiplyUnsafe(m).is0()}isTorsionFree(){return W.unsafeLadder(this,n).is0()}toAffine(f){return N(this,f)}clearCofactor(){let{h:f}=t;return f===Ee?this:this.multiplyUnsafe(f)}static fromHex(f,l=!1){let{d:g,a:b}=t,d=e.BYTES;f=ne("pointHex",f,d),Ce("zip215",l);let s=f.slice(),p=f[d-1];s[d-1]=p&-129;let S=lr(s),L=l?x:e.ORDER;Se("pointHex.y",S,Oe,L);let T=v(S*S),q=v(T-Ee),$=v(g*T-b),{isValid:G,value:Dt}=_(q,$);if(!G)throw new Error("Point.fromHex: invalid y coordinate");let J=(Dt&Ee)===Ee,X=(p&128)!==0;if(!l&&Dt===Oe&&X)throw new Error("Point.fromHex: x=0 and x_0=1");return X!==J&&(Dt=v(-Dt)),U.fromAffine({x:Dt,y:S})}static fromPrivateKey(f){return Q(f).point}toRawBytes(){let{x:f,y:l}=this.toAffine(),g=Xr(l,e.BYTES);return g[g.length-1]|=f&Ee?128:0,g}toHex(){return Ze(this.toRawBytes())}}U.BASE=new U(t.Gx,t.Gy,Ee,v(t.Gx*t.Gy)),U.ZERO=new U(Oe,Ee,Ee,Oe);let{BASE:K,ZERO:tt}=U,W=zi(U,w*8);function Z(c){return jt(c,n)}function et(c){return Z(lr(c))}function Q(c){let f=e.BYTES;c=ne("private key",c,f);let l=ne("hashed private key",u(c),2*f),g=E(l.slice(0,f)),b=l.slice(f,2*f),d=et(g),s=K.multiply(d),p=s.toRawBytes();return{head:g,prefix:b,scalar:d,point:s,pointBytes:p}}function $t(c){return Q(c).pointBytes}function V(c=new Uint8Array,...f){let l=Ye(...f);return et(u(F(l,ne("context",c),!!o)))}function nt(c,f,l={}){c=ne("message",c),o&&(c=o(c));let{prefix:g,scalar:b,pointBytes:d}=Q(f),s=V(l.context,g,c),p=K.multiply(s).toRawBytes(),S=V(l.context,p,d,c),L=Z(s+S*b);Se("signature.s",L,Oe,n);let T=Ye(p,Xr(L,e.BYTES));return ne("result",T,e.BYTES*2)}let y=Fh;function i(c,f,l,g=y){let{context:b,zip215:d}=g,s=e.BYTES;c=ne("signature",c,2*s),f=ne("message",f),l=ne("publicKey",l,s),d!==void 0&&Ce("zip215",d),o&&(f=o(f));let p=lr(c.slice(s,2*s)),S,L,T;try{S=U.fromHex(l,d),L=U.fromHex(c.slice(0,s),d),T=K.multiplyUnsafe(p)}catch{return!1}if(!d&&S.isSmallOrder())return!1;let q=V(b,L.toRawBytes(),S.toRawBytes(),f);return L.add(S.multiplyUnsafe(q)).subtract(T).clearCofactor().equals(U.ZERO)}return K._setWindowSize(8),{CURVE:t,getPublicKey:$t,sign:nt,verify:i,ExtendedPoint:U,utils:{getExtendedPublicKey:Q,randomPrivateKey:()=>h(e.BYTES),precompute(c=8,f=U.BASE){return f._setWindowSize(c),f.multiply(BigInt(3)),f}}}}var ip,Oe,Ee,Fi,qh,Fh,pu=wt(()=>{ip=P(O(),1);gs();xn();tn();tn();Oe=BigInt(0),Ee=BigInt(1),Fi=BigInt(2),qh=BigInt(8),Fh={zip215:!0}});function $h(r){let t=BigInt(10),e=BigInt(20),n=BigInt(40),o=BigInt(80),u=ms,w=r*r%u*r%u,m=ee(w,gu,u)*w%u,x=ee(m,Dh,u)*r%u,v=ee(x,Wh,u)*x%u,B=ee(v,t,u)*v%u,_=ee(B,e,u)*B%u,E=ee(_,n,u)*_%u,F=ee(E,o,u)*E%u,R=ee(F,o,u)*E%u,I=ee(R,t,u)*v%u;return{pow_p_5_8:ee(I,gu,u)*r%u,b2:w}}function Vh(r){return r[0]&=248,r[31]&=127,r[31]|=64,r}function Gh(r,t){let e=ms,n=jt(t*t*t,e),o=jt(n*n*t,e),u=$h(r*o).pow_p_5_8,h=jt(r*n*u,e),w=jt(t*h*h,e),m=h,x=jt(h*yu,e),v=w===r,B=w===jt(-r,e),_=w===jt(-r*yu,e);return v&&(h=m),(B||_)&&(h=x),au(h,e)&&(h=jt(-h,e)),{isValid:v||B,value:h}}var dp,ms,yu,fp,Dh,gu,hp,Wh,Hh,Zh,jh,rn,mu=wt(()=>{dp=P(O(),1);ru();ur();pu();xn();ms=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),yu=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),fp=BigInt(0),Dh=BigInt(1),gu=BigInt(2),hp=BigInt(3),Wh=BigInt(5),Hh=BigInt(8);Zh=(()=>pr(ms,void 0,!0))(),jh=(()=>({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Zh,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:Hh,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:eu,randomBytes:Ri,adjustScalarBytes:Vh,uvRatio:Gh}))(),rn=(()=>du(jh))()});var ws=ae(()=>{var gp=P(O())});var bu=ae((wu,bs)=>{var mp=P(O());(function(r,t){"use strict";function e(y,i){if(!y)throw new Error(i||"Assertion failed")}function n(y,i){y.super_=i;var a=function(){};a.prototype=i.prototype,y.prototype=new a,y.prototype.constructor=y}function o(y,i,a){if(o.isBN(y))return y;this.negative=0,this.words=null,this.length=0,this.red=null,y!==null&&((i==="le"||i==="be")&&(a=i,i=10),this._init(y||0,i||10,a||"be"))}typeof r=="object"?r.exports=o:t.BN=o,o.BN=o,o.wordSize=26;var u;try{typeof window<"u"&&typeof window.Buffer<"u"?u=window.Buffer:u=ws().Buffer}catch{}o.isBN=function(i){return i instanceof o?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===o.wordSize&&Array.isArray(i.words)},o.max=function(i,a){return i.cmp(a)>0?i:a},o.min=function(i,a){return i.cmp(a)<0?i:a},o.prototype._init=function(i,a,c){if(typeof i=="number")return this._initNumber(i,a,c);if(typeof i=="object")return this._initArray(i,a,c);a==="hex"&&(a=16),e(a===(a|0)&&a>=2&&a<=36),i=i.toString().replace(/\\s+/g,"");var f=0;i[0]==="-"&&(f++,this.negative=1),f=0;f-=3)g=i[f]|i[f-1]<<8|i[f-2]<<16,this.words[l]|=g<>>26-b&67108863,b+=24,b>=26&&(b-=26,l++);else if(c==="le")for(f=0,l=0;f>>26-b&67108863,b+=24,b>=26&&(b-=26,l++);return this._strip()};function h(y,i){var a=y.charCodeAt(i);if(a>=48&&a<=57)return a-48;if(a>=65&&a<=70)return a-55;if(a>=97&&a<=102)return a-87;e(!1,"Invalid character in "+y)}function w(y,i,a){var c=h(y,a);return a-1>=i&&(c|=h(y,a-1)<<4),c}o.prototype._parseHex=function(i,a,c){this.length=Math.ceil((i.length-a)/6),this.words=new Array(this.length);for(var f=0;f=a;f-=2)b=w(i,a,f)<=18?(l-=18,g+=1,this.words[g]|=b>>>26):l+=8;else{var d=i.length-a;for(f=d%2===0?a+1:a;f=18?(l-=18,g+=1,this.words[g]|=b>>>26):l+=8}this._strip()};function m(y,i,a,c){for(var f=0,l=0,g=Math.min(y.length,a),b=i;b=49?l=d-49+10:d>=17?l=d-17+10:l=d,e(d>=0&&l1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=v}catch{o.prototype.inspect=v}else o.prototype.inspect=v;function v(){return(this.red?""}var B=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],_=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(i,a){i=i||10,a=a|0||1;var c;if(i===16||i==="hex"){c="";for(var f=0,l=0,g=0;g>>24-f&16777215,f+=2,f>=26&&(f-=26,g--),l!==0||g!==this.length-1?c=B[6-d.length]+d+c:c=d+c}for(l!==0&&(c=l.toString(16)+c);c.length%a!==0;)c="0"+c;return this.negative!==0&&(c="-"+c),c}if(i===(i|0)&&i>=2&&i<=36){var s=_[i],p=E[i];c="";var S=this.clone();for(S.negative=0;!S.isZero();){var L=S.modrn(p).toString(i);S=S.idivn(p),S.isZero()?c=L+c:c=B[s-L.length]+L+c}for(this.isZero()&&(c="0"+c);c.length%a!==0;)c="0"+c;return this.negative!==0&&(c="-"+c),c}e(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&e(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},o.prototype.toJSON=function(){return this.toString(16,2)},u&&(o.prototype.toBuffer=function(i,a){return this.toArrayLike(u,i,a)}),o.prototype.toArray=function(i,a){return this.toArrayLike(Array,i,a)};var F=function(i,a){return i.allocUnsafe?i.allocUnsafe(a):new i(a)};o.prototype.toArrayLike=function(i,a,c){this._strip();var f=this.byteLength(),l=c||Math.max(1,f);e(f<=l,"byte array longer than desired length"),e(l>0,"Requested array length <= 0");var g=F(i,l),b=a==="le"?"LE":"BE";return this["_toArrayLike"+b](g,f),g},o.prototype._toArrayLikeLE=function(i,a){for(var c=0,f=0,l=0,g=0;l>8&255),c>16&255),g===6?(c>24&255),f=0,g=0):(f=b>>>24,g+=2)}if(c=0&&(i[c--]=b>>8&255),c>=0&&(i[c--]=b>>16&255),g===6?(c>=0&&(i[c--]=b>>24&255),f=0,g=0):(f=b>>>24,g+=2)}if(c>=0)for(i[c--]=f;c>=0;)i[c--]=0},Math.clz32?o.prototype._countBits=function(i){return 32-Math.clz32(i)}:o.prototype._countBits=function(i){var a=i,c=0;return a>=4096&&(c+=13,a>>>=13),a>=64&&(c+=7,a>>>=7),a>=8&&(c+=4,a>>>=4),a>=2&&(c+=2,a>>>=2),c+a},o.prototype._zeroBits=function(i){if(i===0)return 26;var a=i,c=0;return a&8191||(c+=13,a>>>=13),a&127||(c+=7,a>>>=7),a&15||(c+=4,a>>>=4),a&3||(c+=2,a>>>=2),a&1||c++,c},o.prototype.bitLength=function(){var i=this.words[this.length-1],a=this._countBits(i);return(this.length-1)*26+a};function R(y){for(var i=new Array(y.bitLength()),a=0;a>>f&1}return i}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,a=0;ai.length?this.clone().ior(i):i.clone().ior(this)},o.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},o.prototype.iuand=function(i){var a;this.length>i.length?a=i:a=this;for(var c=0;ci.length?this.clone().iand(i):i.clone().iand(this)},o.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},o.prototype.iuxor=function(i){var a,c;this.length>i.length?(a=this,c=i):(a=i,c=this);for(var f=0;fi.length?this.clone().ixor(i):i.clone().ixor(this)},o.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},o.prototype.inotn=function(i){e(typeof i=="number"&&i>=0);var a=Math.ceil(i/26)|0,c=i%26;this._expand(a),c>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-c),this._strip()},o.prototype.notn=function(i){return this.clone().inotn(i)},o.prototype.setn=function(i,a){e(typeof i=="number"&&i>=0);var c=i/26|0,f=i%26;return this._expand(c+1),a?this.words[c]=this.words[c]|1<i.length?(c=this,f=i):(c=i,f=this);for(var l=0,g=0;g>>26;for(;l!==0&&g>>26;if(this.length=c.length,l!==0)this.words[this.length]=l,this.length++;else if(c!==this)for(;gi.length?this.clone().iadd(i):i.clone().iadd(this)},o.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var a=this.iadd(i);return i.negative=1,a._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var c=this.cmp(i);if(c===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,l;c>0?(f=this,l=i):(f=i,l=this);for(var g=0,b=0;b>26,this.words[b]=a&67108863;for(;g!==0&&b>26,this.words[b]=a&67108863;if(g===0&&b>>26,S=d&67108863,L=Math.min(s,i.length-1),T=Math.max(0,s-y.length+1);T<=L;T++){var q=s-T|0;f=y.words[q]|0,l=i.words[T]|0,g=f*l+S,p+=g/67108864|0,S=g&67108863}a.words[s]=S|0,d=p|0}return d!==0?a.words[s]=d|0:a.length--,a._strip()}var N=function(i,a,c){var f=i.words,l=a.words,g=c.words,b=0,d,s,p,S=f[0]|0,L=S&8191,T=S>>>13,q=f[1]|0,$=q&8191,G=q>>>13,Dt=f[2]|0,J=Dt&8191,X=Dt>>>13,de=f[3]|0,it=de&8191,st=de>>>13,Sr=f[4]|0,pt=Sr&8191,yt=Sr>>>13,Er=f[5]|0,ut=Er&8191,ct=Er>>>13,He=f[6]|0,ft=He&8191,ht=He>>>13,nr=f[7]|0,lt=nr&8191,dt=nr>>>13,Ir=f[8]|0,gt=Ir&8191,mt=Ir>>>13,_r=f[9]|0,bt=_r&8191,vt=_r>>>13,Un=l[0]|0,xt=Un&8191,kt=Un>>>13,Nn=l[1]|0,Bt=Nn&8191,St=Nn>>>13,zn=l[2]|0,Et=zn&8191,It=zn>>>13,qn=l[3]|0,_t=qn&8191,At=qn>>>13,Fn=l[4]|0,Mt=Fn&8191,Lt=Fn>>>13,Kn=l[5]|0,Rt=Kn&8191,Tt=Kn>>>13,Dn=l[6]|0,Pt=Dn&8191,Ct=Dn>>>13,Wn=l[7]|0,Ot=Wn&8191,Ut=Wn>>>13,Hn=l[8]|0,Nt=Hn&8191,zt=Hn>>>13,$n=l[9]|0,qt=$n&8191,Ft=$n>>>13;c.negative=i.negative^a.negative,c.length=19,d=Math.imul(L,xt),s=Math.imul(L,kt),s=s+Math.imul(T,xt)|0,p=Math.imul(T,kt);var Ar=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,d=Math.imul($,xt),s=Math.imul($,kt),s=s+Math.imul(G,xt)|0,p=Math.imul(G,kt),d=d+Math.imul(L,Bt)|0,s=s+Math.imul(L,St)|0,s=s+Math.imul(T,Bt)|0,p=p+Math.imul(T,St)|0;var Mr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,d=Math.imul(J,xt),s=Math.imul(J,kt),s=s+Math.imul(X,xt)|0,p=Math.imul(X,kt),d=d+Math.imul($,Bt)|0,s=s+Math.imul($,St)|0,s=s+Math.imul(G,Bt)|0,p=p+Math.imul(G,St)|0,d=d+Math.imul(L,Et)|0,s=s+Math.imul(L,It)|0,s=s+Math.imul(T,Et)|0,p=p+Math.imul(T,It)|0;var Lr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Lr>>>26)|0,Lr&=67108863,d=Math.imul(it,xt),s=Math.imul(it,kt),s=s+Math.imul(st,xt)|0,p=Math.imul(st,kt),d=d+Math.imul(J,Bt)|0,s=s+Math.imul(J,St)|0,s=s+Math.imul(X,Bt)|0,p=p+Math.imul(X,St)|0,d=d+Math.imul($,Et)|0,s=s+Math.imul($,It)|0,s=s+Math.imul(G,Et)|0,p=p+Math.imul(G,It)|0,d=d+Math.imul(L,_t)|0,s=s+Math.imul(L,At)|0,s=s+Math.imul(T,_t)|0,p=p+Math.imul(T,At)|0;var Rr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,d=Math.imul(pt,xt),s=Math.imul(pt,kt),s=s+Math.imul(yt,xt)|0,p=Math.imul(yt,kt),d=d+Math.imul(it,Bt)|0,s=s+Math.imul(it,St)|0,s=s+Math.imul(st,Bt)|0,p=p+Math.imul(st,St)|0,d=d+Math.imul(J,Et)|0,s=s+Math.imul(J,It)|0,s=s+Math.imul(X,Et)|0,p=p+Math.imul(X,It)|0,d=d+Math.imul($,_t)|0,s=s+Math.imul($,At)|0,s=s+Math.imul(G,_t)|0,p=p+Math.imul(G,At)|0,d=d+Math.imul(L,Mt)|0,s=s+Math.imul(L,Lt)|0,s=s+Math.imul(T,Mt)|0,p=p+Math.imul(T,Lt)|0;var Tr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Tr>>>26)|0,Tr&=67108863,d=Math.imul(ut,xt),s=Math.imul(ut,kt),s=s+Math.imul(ct,xt)|0,p=Math.imul(ct,kt),d=d+Math.imul(pt,Bt)|0,s=s+Math.imul(pt,St)|0,s=s+Math.imul(yt,Bt)|0,p=p+Math.imul(yt,St)|0,d=d+Math.imul(it,Et)|0,s=s+Math.imul(it,It)|0,s=s+Math.imul(st,Et)|0,p=p+Math.imul(st,It)|0,d=d+Math.imul(J,_t)|0,s=s+Math.imul(J,At)|0,s=s+Math.imul(X,_t)|0,p=p+Math.imul(X,At)|0,d=d+Math.imul($,Mt)|0,s=s+Math.imul($,Lt)|0,s=s+Math.imul(G,Mt)|0,p=p+Math.imul(G,Lt)|0,d=d+Math.imul(L,Rt)|0,s=s+Math.imul(L,Tt)|0,s=s+Math.imul(T,Rt)|0,p=p+Math.imul(T,Tt)|0;var Pr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,d=Math.imul(ft,xt),s=Math.imul(ft,kt),s=s+Math.imul(ht,xt)|0,p=Math.imul(ht,kt),d=d+Math.imul(ut,Bt)|0,s=s+Math.imul(ut,St)|0,s=s+Math.imul(ct,Bt)|0,p=p+Math.imul(ct,St)|0,d=d+Math.imul(pt,Et)|0,s=s+Math.imul(pt,It)|0,s=s+Math.imul(yt,Et)|0,p=p+Math.imul(yt,It)|0,d=d+Math.imul(it,_t)|0,s=s+Math.imul(it,At)|0,s=s+Math.imul(st,_t)|0,p=p+Math.imul(st,At)|0,d=d+Math.imul(J,Mt)|0,s=s+Math.imul(J,Lt)|0,s=s+Math.imul(X,Mt)|0,p=p+Math.imul(X,Lt)|0,d=d+Math.imul($,Rt)|0,s=s+Math.imul($,Tt)|0,s=s+Math.imul(G,Rt)|0,p=p+Math.imul(G,Tt)|0,d=d+Math.imul(L,Pt)|0,s=s+Math.imul(L,Ct)|0,s=s+Math.imul(T,Pt)|0,p=p+Math.imul(T,Ct)|0;var Cr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,d=Math.imul(lt,xt),s=Math.imul(lt,kt),s=s+Math.imul(dt,xt)|0,p=Math.imul(dt,kt),d=d+Math.imul(ft,Bt)|0,s=s+Math.imul(ft,St)|0,s=s+Math.imul(ht,Bt)|0,p=p+Math.imul(ht,St)|0,d=d+Math.imul(ut,Et)|0,s=s+Math.imul(ut,It)|0,s=s+Math.imul(ct,Et)|0,p=p+Math.imul(ct,It)|0,d=d+Math.imul(pt,_t)|0,s=s+Math.imul(pt,At)|0,s=s+Math.imul(yt,_t)|0,p=p+Math.imul(yt,At)|0,d=d+Math.imul(it,Mt)|0,s=s+Math.imul(it,Lt)|0,s=s+Math.imul(st,Mt)|0,p=p+Math.imul(st,Lt)|0,d=d+Math.imul(J,Rt)|0,s=s+Math.imul(J,Tt)|0,s=s+Math.imul(X,Rt)|0,p=p+Math.imul(X,Tt)|0,d=d+Math.imul($,Pt)|0,s=s+Math.imul($,Ct)|0,s=s+Math.imul(G,Pt)|0,p=p+Math.imul(G,Ct)|0,d=d+Math.imul(L,Ot)|0,s=s+Math.imul(L,Ut)|0,s=s+Math.imul(T,Ot)|0,p=p+Math.imul(T,Ut)|0;var Or=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Or>>>26)|0,Or&=67108863,d=Math.imul(gt,xt),s=Math.imul(gt,kt),s=s+Math.imul(mt,xt)|0,p=Math.imul(mt,kt),d=d+Math.imul(lt,Bt)|0,s=s+Math.imul(lt,St)|0,s=s+Math.imul(dt,Bt)|0,p=p+Math.imul(dt,St)|0,d=d+Math.imul(ft,Et)|0,s=s+Math.imul(ft,It)|0,s=s+Math.imul(ht,Et)|0,p=p+Math.imul(ht,It)|0,d=d+Math.imul(ut,_t)|0,s=s+Math.imul(ut,At)|0,s=s+Math.imul(ct,_t)|0,p=p+Math.imul(ct,At)|0,d=d+Math.imul(pt,Mt)|0,s=s+Math.imul(pt,Lt)|0,s=s+Math.imul(yt,Mt)|0,p=p+Math.imul(yt,Lt)|0,d=d+Math.imul(it,Rt)|0,s=s+Math.imul(it,Tt)|0,s=s+Math.imul(st,Rt)|0,p=p+Math.imul(st,Tt)|0,d=d+Math.imul(J,Pt)|0,s=s+Math.imul(J,Ct)|0,s=s+Math.imul(X,Pt)|0,p=p+Math.imul(X,Ct)|0,d=d+Math.imul($,Ot)|0,s=s+Math.imul($,Ut)|0,s=s+Math.imul(G,Ot)|0,p=p+Math.imul(G,Ut)|0,d=d+Math.imul(L,Nt)|0,s=s+Math.imul(L,zt)|0,s=s+Math.imul(T,Nt)|0,p=p+Math.imul(T,zt)|0;var Ur=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,d=Math.imul(bt,xt),s=Math.imul(bt,kt),s=s+Math.imul(vt,xt)|0,p=Math.imul(vt,kt),d=d+Math.imul(gt,Bt)|0,s=s+Math.imul(gt,St)|0,s=s+Math.imul(mt,Bt)|0,p=p+Math.imul(mt,St)|0,d=d+Math.imul(lt,Et)|0,s=s+Math.imul(lt,It)|0,s=s+Math.imul(dt,Et)|0,p=p+Math.imul(dt,It)|0,d=d+Math.imul(ft,_t)|0,s=s+Math.imul(ft,At)|0,s=s+Math.imul(ht,_t)|0,p=p+Math.imul(ht,At)|0,d=d+Math.imul(ut,Mt)|0,s=s+Math.imul(ut,Lt)|0,s=s+Math.imul(ct,Mt)|0,p=p+Math.imul(ct,Lt)|0,d=d+Math.imul(pt,Rt)|0,s=s+Math.imul(pt,Tt)|0,s=s+Math.imul(yt,Rt)|0,p=p+Math.imul(yt,Tt)|0,d=d+Math.imul(it,Pt)|0,s=s+Math.imul(it,Ct)|0,s=s+Math.imul(st,Pt)|0,p=p+Math.imul(st,Ct)|0,d=d+Math.imul(J,Ot)|0,s=s+Math.imul(J,Ut)|0,s=s+Math.imul(X,Ot)|0,p=p+Math.imul(X,Ut)|0,d=d+Math.imul($,Nt)|0,s=s+Math.imul($,zt)|0,s=s+Math.imul(G,Nt)|0,p=p+Math.imul(G,zt)|0,d=d+Math.imul(L,qt)|0,s=s+Math.imul(L,Ft)|0,s=s+Math.imul(T,qt)|0,p=p+Math.imul(T,Ft)|0;var Nr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,d=Math.imul(bt,Bt),s=Math.imul(bt,St),s=s+Math.imul(vt,Bt)|0,p=Math.imul(vt,St),d=d+Math.imul(gt,Et)|0,s=s+Math.imul(gt,It)|0,s=s+Math.imul(mt,Et)|0,p=p+Math.imul(mt,It)|0,d=d+Math.imul(lt,_t)|0,s=s+Math.imul(lt,At)|0,s=s+Math.imul(dt,_t)|0,p=p+Math.imul(dt,At)|0,d=d+Math.imul(ft,Mt)|0,s=s+Math.imul(ft,Lt)|0,s=s+Math.imul(ht,Mt)|0,p=p+Math.imul(ht,Lt)|0,d=d+Math.imul(ut,Rt)|0,s=s+Math.imul(ut,Tt)|0,s=s+Math.imul(ct,Rt)|0,p=p+Math.imul(ct,Tt)|0,d=d+Math.imul(pt,Pt)|0,s=s+Math.imul(pt,Ct)|0,s=s+Math.imul(yt,Pt)|0,p=p+Math.imul(yt,Ct)|0,d=d+Math.imul(it,Ot)|0,s=s+Math.imul(it,Ut)|0,s=s+Math.imul(st,Ot)|0,p=p+Math.imul(st,Ut)|0,d=d+Math.imul(J,Nt)|0,s=s+Math.imul(J,zt)|0,s=s+Math.imul(X,Nt)|0,p=p+Math.imul(X,zt)|0,d=d+Math.imul($,qt)|0,s=s+Math.imul($,Ft)|0,s=s+Math.imul(G,qt)|0,p=p+Math.imul(G,Ft)|0;var zr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(zr>>>26)|0,zr&=67108863,d=Math.imul(bt,Et),s=Math.imul(bt,It),s=s+Math.imul(vt,Et)|0,p=Math.imul(vt,It),d=d+Math.imul(gt,_t)|0,s=s+Math.imul(gt,At)|0,s=s+Math.imul(mt,_t)|0,p=p+Math.imul(mt,At)|0,d=d+Math.imul(lt,Mt)|0,s=s+Math.imul(lt,Lt)|0,s=s+Math.imul(dt,Mt)|0,p=p+Math.imul(dt,Lt)|0,d=d+Math.imul(ft,Rt)|0,s=s+Math.imul(ft,Tt)|0,s=s+Math.imul(ht,Rt)|0,p=p+Math.imul(ht,Tt)|0,d=d+Math.imul(ut,Pt)|0,s=s+Math.imul(ut,Ct)|0,s=s+Math.imul(ct,Pt)|0,p=p+Math.imul(ct,Ct)|0,d=d+Math.imul(pt,Ot)|0,s=s+Math.imul(pt,Ut)|0,s=s+Math.imul(yt,Ot)|0,p=p+Math.imul(yt,Ut)|0,d=d+Math.imul(it,Nt)|0,s=s+Math.imul(it,zt)|0,s=s+Math.imul(st,Nt)|0,p=p+Math.imul(st,zt)|0,d=d+Math.imul(J,qt)|0,s=s+Math.imul(J,Ft)|0,s=s+Math.imul(X,qt)|0,p=p+Math.imul(X,Ft)|0;var qr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(qr>>>26)|0,qr&=67108863,d=Math.imul(bt,_t),s=Math.imul(bt,At),s=s+Math.imul(vt,_t)|0,p=Math.imul(vt,At),d=d+Math.imul(gt,Mt)|0,s=s+Math.imul(gt,Lt)|0,s=s+Math.imul(mt,Mt)|0,p=p+Math.imul(mt,Lt)|0,d=d+Math.imul(lt,Rt)|0,s=s+Math.imul(lt,Tt)|0,s=s+Math.imul(dt,Rt)|0,p=p+Math.imul(dt,Tt)|0,d=d+Math.imul(ft,Pt)|0,s=s+Math.imul(ft,Ct)|0,s=s+Math.imul(ht,Pt)|0,p=p+Math.imul(ht,Ct)|0,d=d+Math.imul(ut,Ot)|0,s=s+Math.imul(ut,Ut)|0,s=s+Math.imul(ct,Ot)|0,p=p+Math.imul(ct,Ut)|0,d=d+Math.imul(pt,Nt)|0,s=s+Math.imul(pt,zt)|0,s=s+Math.imul(yt,Nt)|0,p=p+Math.imul(yt,zt)|0,d=d+Math.imul(it,qt)|0,s=s+Math.imul(it,Ft)|0,s=s+Math.imul(st,qt)|0,p=p+Math.imul(st,Ft)|0;var Fr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,d=Math.imul(bt,Mt),s=Math.imul(bt,Lt),s=s+Math.imul(vt,Mt)|0,p=Math.imul(vt,Lt),d=d+Math.imul(gt,Rt)|0,s=s+Math.imul(gt,Tt)|0,s=s+Math.imul(mt,Rt)|0,p=p+Math.imul(mt,Tt)|0,d=d+Math.imul(lt,Pt)|0,s=s+Math.imul(lt,Ct)|0,s=s+Math.imul(dt,Pt)|0,p=p+Math.imul(dt,Ct)|0,d=d+Math.imul(ft,Ot)|0,s=s+Math.imul(ft,Ut)|0,s=s+Math.imul(ht,Ot)|0,p=p+Math.imul(ht,Ut)|0,d=d+Math.imul(ut,Nt)|0,s=s+Math.imul(ut,zt)|0,s=s+Math.imul(ct,Nt)|0,p=p+Math.imul(ct,zt)|0,d=d+Math.imul(pt,qt)|0,s=s+Math.imul(pt,Ft)|0,s=s+Math.imul(yt,qt)|0,p=p+Math.imul(yt,Ft)|0;var Kr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Kr>>>26)|0,Kr&=67108863,d=Math.imul(bt,Rt),s=Math.imul(bt,Tt),s=s+Math.imul(vt,Rt)|0,p=Math.imul(vt,Tt),d=d+Math.imul(gt,Pt)|0,s=s+Math.imul(gt,Ct)|0,s=s+Math.imul(mt,Pt)|0,p=p+Math.imul(mt,Ct)|0,d=d+Math.imul(lt,Ot)|0,s=s+Math.imul(lt,Ut)|0,s=s+Math.imul(dt,Ot)|0,p=p+Math.imul(dt,Ut)|0,d=d+Math.imul(ft,Nt)|0,s=s+Math.imul(ft,zt)|0,s=s+Math.imul(ht,Nt)|0,p=p+Math.imul(ht,zt)|0,d=d+Math.imul(ut,qt)|0,s=s+Math.imul(ut,Ft)|0,s=s+Math.imul(ct,qt)|0,p=p+Math.imul(ct,Ft)|0;var Dr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,d=Math.imul(bt,Pt),s=Math.imul(bt,Ct),s=s+Math.imul(vt,Pt)|0,p=Math.imul(vt,Ct),d=d+Math.imul(gt,Ot)|0,s=s+Math.imul(gt,Ut)|0,s=s+Math.imul(mt,Ot)|0,p=p+Math.imul(mt,Ut)|0,d=d+Math.imul(lt,Nt)|0,s=s+Math.imul(lt,zt)|0,s=s+Math.imul(dt,Nt)|0,p=p+Math.imul(dt,zt)|0,d=d+Math.imul(ft,qt)|0,s=s+Math.imul(ft,Ft)|0,s=s+Math.imul(ht,qt)|0,p=p+Math.imul(ht,Ft)|0;var Wr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Wr>>>26)|0,Wr&=67108863,d=Math.imul(bt,Ot),s=Math.imul(bt,Ut),s=s+Math.imul(vt,Ot)|0,p=Math.imul(vt,Ut),d=d+Math.imul(gt,Nt)|0,s=s+Math.imul(gt,zt)|0,s=s+Math.imul(mt,Nt)|0,p=p+Math.imul(mt,zt)|0,d=d+Math.imul(lt,qt)|0,s=s+Math.imul(lt,Ft)|0,s=s+Math.imul(dt,qt)|0,p=p+Math.imul(dt,Ft)|0;var Hr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,d=Math.imul(bt,Nt),s=Math.imul(bt,zt),s=s+Math.imul(vt,Nt)|0,p=Math.imul(vt,zt),d=d+Math.imul(gt,qt)|0,s=s+Math.imul(gt,Ft)|0,s=s+Math.imul(mt,qt)|0,p=p+Math.imul(mt,Ft)|0;var $r=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+($r>>>26)|0,$r&=67108863,d=Math.imul(bt,qt),s=Math.imul(bt,Ft),s=s+Math.imul(vt,qt)|0,p=Math.imul(vt,Ft);var Vr=(b+d|0)+((s&8191)<<13)|0;return b=(p+(s>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,g[0]=Ar,g[1]=Mr,g[2]=Lr,g[3]=Rr,g[4]=Tr,g[5]=Pr,g[6]=Cr,g[7]=Or,g[8]=Ur,g[9]=Nr,g[10]=zr,g[11]=qr,g[12]=Fr,g[13]=Kr,g[14]=Dr,g[15]=Wr,g[16]=Hr,g[17]=$r,g[18]=Vr,b!==0&&(g[19]=b,c.length++),c};Math.imul||(N=I);function D(y,i,a){a.negative=i.negative^y.negative,a.length=y.length+i.length;for(var c=0,f=0,l=0;l>>26)|0,f+=g>>>26,g&=67108863}a.words[l]=b,c=g,g=f}return c!==0?a.words[l]=c:a.length--,a._strip()}function U(y,i,a){return D(y,i,a)}o.prototype.mulTo=function(i,a){var c,f=this.length+i.length;return this.length===10&&i.length===10?c=N(this,i,a):f<63?c=I(this,i,a):f<1024?c=D(this,i,a):c=U(this,i,a),c};function K(y,i){this.x=y,this.y=i}K.prototype.makeRBT=function(i){for(var a=new Array(i),c=o.prototype._countBits(i)-1,f=0;f>=1;return f},K.prototype.permute=function(i,a,c,f,l,g){for(var b=0;b>>1)l++;return 1<>>13,c[2*g+1]=l&8191,l=l>>>13;for(g=2*a;g>=26,c+=l/67108864|0,c+=g>>>26,this.words[f]=g&67108863}return c!==0&&(this.words[f]=c,this.length++),a?this.ineg():this},o.prototype.muln=function(i){return this.clone().imuln(i)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(i){var a=R(i);if(a.length===0)return new o(1);for(var c=this,f=0;f=0);var a=i%26,c=(i-a)/26,f=67108863>>>26-a<<26-a,l;if(a!==0){var g=0;for(l=0;l>>26-a}g&&(this.words[l]=g,this.length++)}if(c!==0){for(l=this.length-1;l>=0;l--)this.words[l+c]=this.words[l];for(l=0;l=0);var f;a?f=(a-a%26)/26:f=0;var l=i%26,g=Math.min((i-l)/26,this.length),b=67108863^67108863>>>l<g)for(this.length-=g,s=0;s=0&&(p!==0||s>=f);s--){var S=this.words[s]|0;this.words[s]=p<<26-l|S>>>l,p=S&b}return d&&p!==0&&(d.words[d.length++]=p),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(i,a,c){return e(this.negative===0),this.iushrn(i,a,c)},o.prototype.shln=function(i){return this.clone().ishln(i)},o.prototype.ushln=function(i){return this.clone().iushln(i)},o.prototype.shrn=function(i){return this.clone().ishrn(i)},o.prototype.ushrn=function(i){return this.clone().iushrn(i)},o.prototype.testn=function(i){e(typeof i=="number"&&i>=0);var a=i%26,c=(i-a)/26,f=1<=0);var a=i%26,c=(i-a)/26;if(e(this.negative===0,"imaskn works only with positive numbers"),this.length<=c)return this;if(a!==0&&c++,this.length=Math.min(c,this.length),a!==0){var f=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},o.prototype.isubn=function(i){if(e(typeof i=="number"),e(i<67108864),i<0)return this.iaddn(-i);if(this.negative!==0)return this.negative=0,this.iaddn(i),this.negative=1,this;if(this.words[0]-=i,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(d/67108864|0),this.words[l+c]=g&67108863}for(;l>26,this.words[l+c]=g&67108863;if(b===0)return this._strip();for(e(b===-1),b=0,l=0;l>26,this.words[l]=g&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(i,a){var c=this.length-i.length,f=this.clone(),l=i,g=l.words[l.length-1]|0,b=this._countBits(g);c=26-b,c!==0&&(l=l.ushln(c),f.iushln(c),g=l.words[l.length-1]|0);var d=f.length-l.length,s;if(a!=="mod"){s=new o(null),s.length=d+1,s.words=new Array(s.length);for(var p=0;p=0;L--){var T=(f.words[l.length+L]|0)*67108864+(f.words[l.length+L-1]|0);for(T=Math.min(T/g|0,67108863),f._ishlnsubmul(l,T,L);f.negative!==0;)T--,f.negative=0,f._ishlnsubmul(l,1,L),f.isZero()||(f.negative^=1);s&&(s.words[L]=T)}return s&&s._strip(),f._strip(),a!=="div"&&c!==0&&f.iushrn(c),{div:s||null,mod:f}},o.prototype.divmod=function(i,a,c){if(e(!i.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var f,l,g;return this.negative!==0&&i.negative===0?(g=this.neg().divmod(i,a),a!=="mod"&&(f=g.div.neg()),a!=="div"&&(l=g.mod.neg(),c&&l.negative!==0&&l.iadd(i)),{div:f,mod:l}):this.negative===0&&i.negative!==0?(g=this.divmod(i.neg(),a),a!=="mod"&&(f=g.div.neg()),{div:f,mod:g.mod}):this.negative&i.negative?(g=this.neg().divmod(i.neg(),a),a!=="div"&&(l=g.mod.neg(),c&&l.negative!==0&&l.isub(i)),{div:g.div,mod:l}):i.length>this.length||this.cmp(i)<0?{div:new o(0),mod:this}:i.length===1?a==="div"?{div:this.divn(i.words[0]),mod:null}:a==="mod"?{div:null,mod:new o(this.modrn(i.words[0]))}:{div:this.divn(i.words[0]),mod:new o(this.modrn(i.words[0]))}:this._wordDiv(i,a)},o.prototype.div=function(i){return this.divmod(i,"div",!1).div},o.prototype.mod=function(i){return this.divmod(i,"mod",!1).mod},o.prototype.umod=function(i){return this.divmod(i,"mod",!0).mod},o.prototype.divRound=function(i){var a=this.divmod(i);if(a.mod.isZero())return a.div;var c=a.div.negative!==0?a.mod.isub(i):a.mod,f=i.ushrn(1),l=i.andln(1),g=c.cmp(f);return g<0||l===1&&g===0?a.div:a.div.negative!==0?a.div.isubn(1):a.div.iaddn(1)},o.prototype.modrn=function(i){var a=i<0;a&&(i=-i),e(i<=67108863);for(var c=(1<<26)%i,f=0,l=this.length-1;l>=0;l--)f=(c*f+(this.words[l]|0))%i;return a?-f:f},o.prototype.modn=function(i){return this.modrn(i)},o.prototype.idivn=function(i){var a=i<0;a&&(i=-i),e(i<=67108863);for(var c=0,f=this.length-1;f>=0;f--){var l=(this.words[f]|0)+c*67108864;this.words[f]=l/i|0,c=l%i}return this._strip(),a?this.ineg():this},o.prototype.divn=function(i){return this.clone().idivn(i)},o.prototype.egcd=function(i){e(i.negative===0),e(!i.isZero());var a=this,c=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var f=new o(1),l=new o(0),g=new o(0),b=new o(1),d=0;a.isEven()&&c.isEven();)a.iushrn(1),c.iushrn(1),++d;for(var s=c.clone(),p=a.clone();!a.isZero();){for(var S=0,L=1;!(a.words[0]&L)&&S<26;++S,L<<=1);if(S>0)for(a.iushrn(S);S-- >0;)(f.isOdd()||l.isOdd())&&(f.iadd(s),l.isub(p)),f.iushrn(1),l.iushrn(1);for(var T=0,q=1;!(c.words[0]&q)&&T<26;++T,q<<=1);if(T>0)for(c.iushrn(T);T-- >0;)(g.isOdd()||b.isOdd())&&(g.iadd(s),b.isub(p)),g.iushrn(1),b.iushrn(1);a.cmp(c)>=0?(a.isub(c),f.isub(g),l.isub(b)):(c.isub(a),g.isub(f),b.isub(l))}return{a:g,b,gcd:c.iushln(d)}},o.prototype._invmp=function(i){e(i.negative===0),e(!i.isZero());var a=this,c=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var f=new o(1),l=new o(0),g=c.clone();a.cmpn(1)>0&&c.cmpn(1)>0;){for(var b=0,d=1;!(a.words[0]&d)&&b<26;++b,d<<=1);if(b>0)for(a.iushrn(b);b-- >0;)f.isOdd()&&f.iadd(g),f.iushrn(1);for(var s=0,p=1;!(c.words[0]&p)&&s<26;++s,p<<=1);if(s>0)for(c.iushrn(s);s-- >0;)l.isOdd()&&l.iadd(g),l.iushrn(1);a.cmp(c)>=0?(a.isub(c),f.isub(l)):(c.isub(a),l.isub(f))}var S;return a.cmpn(1)===0?S=f:S=l,S.cmpn(0)<0&&S.iadd(i),S},o.prototype.gcd=function(i){if(this.isZero())return i.abs();if(i.isZero())return this.abs();var a=this.clone(),c=i.clone();a.negative=0,c.negative=0;for(var f=0;a.isEven()&&c.isEven();f++)a.iushrn(1),c.iushrn(1);do{for(;a.isEven();)a.iushrn(1);for(;c.isEven();)c.iushrn(1);var l=a.cmp(c);if(l<0){var g=a;a=c,c=g}else if(l===0||c.cmpn(1)===0)break;a.isub(c)}while(!0);return c.iushln(f)},o.prototype.invm=function(i){return this.egcd(i).a.umod(i)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(i){return this.words[0]&i},o.prototype.bincn=function(i){e(typeof i=="number");var a=i%26,c=(i-a)/26,f=1<>>26,b&=67108863,this.words[g]=b}return l!==0&&(this.words[g]=l,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(i){var a=i<0;if(this.negative!==0&&!a)return-1;if(this.negative===0&&a)return 1;this._strip();var c;if(this.length>1)c=1;else{a&&(i=-i),e(i<=67108863,"Number is too big");var f=this.words[0]|0;c=f===i?0:fi.length)return 1;if(this.length=0;c--){var f=this.words[c]|0,l=i.words[c]|0;if(f!==l){fl&&(a=1);break}}return a},o.prototype.gtn=function(i){return this.cmpn(i)===1},o.prototype.gt=function(i){return this.cmp(i)===1},o.prototype.gten=function(i){return this.cmpn(i)>=0},o.prototype.gte=function(i){return this.cmp(i)>=0},o.prototype.ltn=function(i){return this.cmpn(i)===-1},o.prototype.lt=function(i){return this.cmp(i)===-1},o.prototype.lten=function(i){return this.cmpn(i)<=0},o.prototype.lte=function(i){return this.cmp(i)<=0},o.prototype.eqn=function(i){return this.cmpn(i)===0},o.prototype.eq=function(i){return this.cmp(i)===0},o.red=function(i){return new V(i)},o.prototype.toRed=function(i){return e(!this.red,"Already a number in reduction context"),e(this.negative===0,"red works only with positives"),i.convertTo(this)._forceRed(i)},o.prototype.fromRed=function(){return e(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(i){return this.red=i,this},o.prototype.forceRed=function(i){return e(!this.red,"Already a number in reduction context"),this._forceRed(i)},o.prototype.redAdd=function(i){return e(this.red,"redAdd works only with red numbers"),this.red.add(this,i)},o.prototype.redIAdd=function(i){return e(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,i)},o.prototype.redSub=function(i){return e(this.red,"redSub works only with red numbers"),this.red.sub(this,i)},o.prototype.redISub=function(i){return e(this.red,"redISub works only with red numbers"),this.red.isub(this,i)},o.prototype.redShl=function(i){return e(this.red,"redShl works only with red numbers"),this.red.shl(this,i)},o.prototype.redMul=function(i){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.mul(this,i)},o.prototype.redIMul=function(i){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.imul(this,i)},o.prototype.redSqr=function(){return e(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return e(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return e(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return e(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return e(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(i){return e(this.red&&!i.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,i)};var tt={k256:null,p224:null,p192:null,p25519:null};function W(y,i){this.name=y,this.p=new o(i,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}W.prototype._tmp=function(){var i=new o(null);return i.words=new Array(Math.ceil(this.n/13)),i},W.prototype.ireduce=function(i){var a=i,c;do this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),c=a.bitLength();while(c>this.n);var f=c0?a.isub(this.p):a.strip!==void 0?a.strip():a._strip(),a},W.prototype.split=function(i,a){i.iushrn(this.n,0,a)},W.prototype.imulK=function(i){return i.imul(this.k)};function Z(){W.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(Z,W),Z.prototype.split=function(i,a){for(var c=4194303,f=Math.min(i.length,9),l=0;l>>22,g=b}g>>>=22,i.words[l-10]=g,g===0&&i.length>10?i.length-=10:i.length-=9},Z.prototype.imulK=function(i){i.words[i.length]=0,i.words[i.length+1]=0,i.length+=2;for(var a=0,c=0;c>>=26,i.words[c]=l,a=f}return a!==0&&(i.words[i.length++]=a),i},o._prime=function(i){if(tt[i])return tt[i];var a;if(i==="k256")a=new Z;else if(i==="p224")a=new et;else if(i==="p192")a=new Q;else if(i==="p25519")a=new $t;else throw new Error("Unknown prime "+i);return tt[i]=a,a};function V(y){if(typeof y=="string"){var i=o._prime(y);this.m=i.p,this.prime=i}else e(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}V.prototype._verify1=function(i){e(i.negative===0,"red works only with positives"),e(i.red,"red works only with red numbers")},V.prototype._verify2=function(i,a){e((i.negative|a.negative)===0,"red works only with positives"),e(i.red&&i.red===a.red,"red works only with red numbers")},V.prototype.imod=function(i){return this.prime?this.prime.ireduce(i)._forceRed(this):(x(i,i.umod(this.m)._forceRed(this)),i)},V.prototype.neg=function(i){return i.isZero()?i.clone():this.m.sub(i)._forceRed(this)},V.prototype.add=function(i,a){this._verify2(i,a);var c=i.add(a);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},V.prototype.iadd=function(i,a){this._verify2(i,a);var c=i.iadd(a);return c.cmp(this.m)>=0&&c.isub(this.m),c},V.prototype.sub=function(i,a){this._verify2(i,a);var c=i.sub(a);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},V.prototype.isub=function(i,a){this._verify2(i,a);var c=i.isub(a);return c.cmpn(0)<0&&c.iadd(this.m),c},V.prototype.shl=function(i,a){return this._verify1(i),this.imod(i.ushln(a))},V.prototype.imul=function(i,a){return this._verify2(i,a),this.imod(i.imul(a))},V.prototype.mul=function(i,a){return this._verify2(i,a),this.imod(i.mul(a))},V.prototype.isqr=function(i){return this.imul(i,i.clone())},V.prototype.sqr=function(i){return this.mul(i,i)},V.prototype.sqrt=function(i){if(i.isZero())return i.clone();var a=this.m.andln(3);if(e(a%2===1),a===3){var c=this.m.add(new o(1)).iushrn(2);return this.pow(i,c)}for(var f=this.m.subn(1),l=0;!f.isZero()&&f.andln(1)===0;)l++,f.iushrn(1);e(!f.isZero());var g=new o(1).toRed(this),b=g.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new o(2*s*s).toRed(this);this.pow(s,d).cmp(b)!==0;)s.redIAdd(b);for(var p=this.pow(s,f),S=this.pow(i,f.addn(1).iushrn(1)),L=this.pow(i,f),T=l;L.cmp(g)!==0;){for(var q=L,$=0;q.cmp(g)!==0;$++)q=q.redSqr();e($=0;l--){for(var p=a.words[l],S=s-1;S>=0;S--){var L=p>>S&1;if(g!==f[0]&&(g=this.sqr(g)),L===0&&b===0){d=0;continue}b<<=1,b|=L,d++,!(d!==c&&(l!==0||S!==0))&&(g=this.mul(g,f[b]),d=0,b=0)}s=26}return g},V.prototype.convertTo=function(i){var a=i.umod(this.m);return a===i?a.clone():a},V.prototype.convertFrom=function(i){var a=i.clone();return a.red=null,a},o.mont=function(i){return new nt(i)};function nt(y){V.call(this,y),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(nt,V),nt.prototype.convertTo=function(i){return this.imod(i.ushln(this.shift))},nt.prototype.convertFrom=function(i){var a=this.imod(i.mul(this.rinv));return a.red=null,a},nt.prototype.imul=function(i,a){if(i.isZero()||a.isZero())return i.words[0]=0,i.length=1,i;var c=i.imul(a),f=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),l=c.isub(f).iushrn(this.shift),g=l;return l.cmp(this.m)>=0?g=l.isub(this.m):l.cmpn(0)<0&&(g=l.iadd(this.m)),g._forceRed(this)},nt.prototype.mul=function(i,a){if(i.isZero()||a.isZero())return new o(0)._forceRed(this);var c=i.mul(a),f=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),l=c.isub(f).iushrn(this.shift),g=l;return l.cmp(this.m)>=0?g=l.isub(this.m):l.cmpn(0)<0&&(g=l.iadd(this.m)),g._forceRed(this)},nt.prototype.invm=function(i){var a=this.imod(i._invmp(this.m).mul(this.r2));return a._forceRed(this)}})(typeof bs>"u"||bs,wu)});var ku=ae((vs,xu)=>{var wp=P(O());var Ki=mn(),Ke=Ki.Buffer;function vu(r,t){for(var e in r)t[e]=r[e]}Ke.from&&Ke.alloc&&Ke.allocUnsafe&&Ke.allocUnsafeSlow?xu.exports=Ki:(vu(Ki,vs),vs.Buffer=nn);function nn(r,t,e){return Ke(r,t,e)}nn.prototype=Object.create(Ke.prototype);vu(Ke,nn);nn.from=function(r,t,e){if(typeof r=="number")throw new TypeError("Argument must not be a number");return Ke(r,t,e)};nn.alloc=function(r,t,e){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=Ke(r);return t!==void 0?typeof e=="string"?n.fill(t,e):n.fill(t):n.fill(0),n};nn.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Ke(r)};nn.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Ki.SlowBuffer(r)}});var Su=ae((bp,Bu)=>{"use strict";var vp=P(O()),Di=ku().Buffer;function Yh(r){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),e=0;e>>0,U=new Uint8Array(D);I!==N;){for(var K=E[I],tt=0,W=D-1;(K!==0||tt>>0,U[W]=K%h>>>0,K=K/h>>>0;if(K!==0)throw new Error("Non-zero carry");R=tt,I++}for(var Z=D-R;Z!==D&&U[Z]===0;)Z++;for(var et=w.repeat(F);Z>>0,D=new Uint8Array(N);F>>0,D[tt]=U%256>>>0,U=U/256>>>0;if(U!==0)throw new Error("Non-zero carry");I=K,F++}for(var W=N-I;W!==N&&D[W]===0;)W++;var Z=Di.allocUnsafe(R+(N-W));Z.fill(0,0,R);for(var et=R;W!==N;)Z[et++]=D[W++];return Z}function _(E){var F=B(E);if(F)return F;throw new Error("Non-base"+h+" character")}return{encode:v,decodeUnsafe:B,decode:_}}Bu.exports=Yh});var xs=ae((xp,Eu)=>{var kp=P(O()),Jh=Su(),Xh="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";Eu.exports=Jh(Xh)});var Ip,Qh,yr,gr,ks,Xn,Bs=wt(()=>{Ip=P(O(),1);Zo();ur();Qh=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),yr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),gr=new Uint32Array(64),ks=class extends bn{constructor(){super(64,32,8,!1),this.A=yr[0]|0,this.B=yr[1]|0,this.C=yr[2]|0,this.D=yr[3]|0,this.E=yr[4]|0,this.F=yr[5]|0,this.G=yr[6]|0,this.H=yr[7]|0}get(){let{A:t,B:e,C:n,D:o,E:u,F:h,G:w,H:m}=this;return[t,e,n,o,u,h,w,m]}set(t,e,n,o,u,h,w,m){this.A=t|0,this.B=e|0,this.C=n|0,this.D=o|0,this.E=u|0,this.F=h|0,this.G=w|0,this.H=m|0}process(t,e){for(let B=0;B<16;B++,e+=4)gr[B]=t.getUint32(e,!1);for(let B=16;B<64;B++){let _=gr[B-15],E=gr[B-2],F=Pe(_,7)^Pe(_,18)^_>>>3,R=Pe(E,17)^Pe(E,19)^E>>>10;gr[B]=R+gr[B-7]+F+gr[B-16]|0}let{A:n,B:o,C:u,D:h,E:w,F:m,G:x,H:v}=this;for(let B=0;B<64;B++){let _=Pe(w,6)^Pe(w,11)^Pe(w,25),E=v+_+Xa(w,m,x)+Qh[B]+gr[B]|0,R=(Pe(n,2)^Pe(n,13)^Pe(n,22))+Qa(n,o,u)|0;v=x,x=m,m=w,w=h+E|0,h=u,u=o,o=n,n=E+R|0}n=n+this.A|0,o=o+this.B|0,u=u+this.C|0,h=h+this.D|0,w=w+this.E|0,m=m+this.F|0,x=x+this.G|0,v=v+this.H|0,this.set(n,o,u,h,w,m,x,v)}roundClean(){gr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},Xn=wn(()=>new ks)});var _u=ae((Iu,Ss)=>{var _p=P(O());(function(r,t){"use strict";function e(y,i){if(!y)throw new Error(i||"Assertion failed")}function n(y,i){y.super_=i;var a=function(){};a.prototype=i.prototype,y.prototype=new a,y.prototype.constructor=y}function o(y,i,a){if(o.isBN(y))return y;this.negative=0,this.words=null,this.length=0,this.red=null,y!==null&&((i==="le"||i==="be")&&(a=i,i=10),this._init(y||0,i||10,a||"be"))}typeof r=="object"?r.exports=o:t.BN=o,o.BN=o,o.wordSize=26;var u;try{typeof window<"u"&&typeof window.Buffer<"u"?u=window.Buffer:u=ws().Buffer}catch{}o.isBN=function(i){return i instanceof o?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===o.wordSize&&Array.isArray(i.words)},o.max=function(i,a){return i.cmp(a)>0?i:a},o.min=function(i,a){return i.cmp(a)<0?i:a},o.prototype._init=function(i,a,c){if(typeof i=="number")return this._initNumber(i,a,c);if(typeof i=="object")return this._initArray(i,a,c);a==="hex"&&(a=16),e(a===(a|0)&&a>=2&&a<=36),i=i.toString().replace(/\\s+/g,"");var f=0;i[0]==="-"&&(f++,this.negative=1),f=0;f-=3)g=i[f]|i[f-1]<<8|i[f-2]<<16,this.words[l]|=g<>>26-b&67108863,b+=24,b>=26&&(b-=26,l++);else if(c==="le")for(f=0,l=0;f>>26-b&67108863,b+=24,b>=26&&(b-=26,l++);return this._strip()};function h(y,i){var a=y.charCodeAt(i);if(a>=48&&a<=57)return a-48;if(a>=65&&a<=70)return a-55;if(a>=97&&a<=102)return a-87;e(!1,"Invalid character in "+y)}function w(y,i,a){var c=h(y,a);return a-1>=i&&(c|=h(y,a-1)<<4),c}o.prototype._parseHex=function(i,a,c){this.length=Math.ceil((i.length-a)/6),this.words=new Array(this.length);for(var f=0;f=a;f-=2)b=w(i,a,f)<=18?(l-=18,g+=1,this.words[g]|=b>>>26):l+=8;else{var d=i.length-a;for(f=d%2===0?a+1:a;f=18?(l-=18,g+=1,this.words[g]|=b>>>26):l+=8}this._strip()};function m(y,i,a,c){for(var f=0,l=0,g=Math.min(y.length,a),b=i;b=49?l=d-49+10:d>=17?l=d-17+10:l=d,e(d>=0&&l1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=v}catch{o.prototype.inspect=v}else o.prototype.inspect=v;function v(){return(this.red?""}var B=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],_=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(i,a){i=i||10,a=a|0||1;var c;if(i===16||i==="hex"){c="";for(var f=0,l=0,g=0;g>>24-f&16777215,f+=2,f>=26&&(f-=26,g--),l!==0||g!==this.length-1?c=B[6-d.length]+d+c:c=d+c}for(l!==0&&(c=l.toString(16)+c);c.length%a!==0;)c="0"+c;return this.negative!==0&&(c="-"+c),c}if(i===(i|0)&&i>=2&&i<=36){var s=_[i],p=E[i];c="";var S=this.clone();for(S.negative=0;!S.isZero();){var L=S.modrn(p).toString(i);S=S.idivn(p),S.isZero()?c=L+c:c=B[s-L.length]+L+c}for(this.isZero()&&(c="0"+c);c.length%a!==0;)c="0"+c;return this.negative!==0&&(c="-"+c),c}e(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&e(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},o.prototype.toJSON=function(){return this.toString(16,2)},u&&(o.prototype.toBuffer=function(i,a){return this.toArrayLike(u,i,a)}),o.prototype.toArray=function(i,a){return this.toArrayLike(Array,i,a)};var F=function(i,a){return i.allocUnsafe?i.allocUnsafe(a):new i(a)};o.prototype.toArrayLike=function(i,a,c){this._strip();var f=this.byteLength(),l=c||Math.max(1,f);e(f<=l,"byte array longer than desired length"),e(l>0,"Requested array length <= 0");var g=F(i,l),b=a==="le"?"LE":"BE";return this["_toArrayLike"+b](g,f),g},o.prototype._toArrayLikeLE=function(i,a){for(var c=0,f=0,l=0,g=0;l>8&255),c>16&255),g===6?(c>24&255),f=0,g=0):(f=b>>>24,g+=2)}if(c=0&&(i[c--]=b>>8&255),c>=0&&(i[c--]=b>>16&255),g===6?(c>=0&&(i[c--]=b>>24&255),f=0,g=0):(f=b>>>24,g+=2)}if(c>=0)for(i[c--]=f;c>=0;)i[c--]=0},Math.clz32?o.prototype._countBits=function(i){return 32-Math.clz32(i)}:o.prototype._countBits=function(i){var a=i,c=0;return a>=4096&&(c+=13,a>>>=13),a>=64&&(c+=7,a>>>=7),a>=8&&(c+=4,a>>>=4),a>=2&&(c+=2,a>>>=2),c+a},o.prototype._zeroBits=function(i){if(i===0)return 26;var a=i,c=0;return a&8191||(c+=13,a>>>=13),a&127||(c+=7,a>>>=7),a&15||(c+=4,a>>>=4),a&3||(c+=2,a>>>=2),a&1||c++,c},o.prototype.bitLength=function(){var i=this.words[this.length-1],a=this._countBits(i);return(this.length-1)*26+a};function R(y){for(var i=new Array(y.bitLength()),a=0;a>>f&1}return i}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,a=0;ai.length?this.clone().ior(i):i.clone().ior(this)},o.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},o.prototype.iuand=function(i){var a;this.length>i.length?a=i:a=this;for(var c=0;ci.length?this.clone().iand(i):i.clone().iand(this)},o.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},o.prototype.iuxor=function(i){var a,c;this.length>i.length?(a=this,c=i):(a=i,c=this);for(var f=0;fi.length?this.clone().ixor(i):i.clone().ixor(this)},o.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},o.prototype.inotn=function(i){e(typeof i=="number"&&i>=0);var a=Math.ceil(i/26)|0,c=i%26;this._expand(a),c>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-c),this._strip()},o.prototype.notn=function(i){return this.clone().inotn(i)},o.prototype.setn=function(i,a){e(typeof i=="number"&&i>=0);var c=i/26|0,f=i%26;return this._expand(c+1),a?this.words[c]=this.words[c]|1<i.length?(c=this,f=i):(c=i,f=this);for(var l=0,g=0;g>>26;for(;l!==0&&g>>26;if(this.length=c.length,l!==0)this.words[this.length]=l,this.length++;else if(c!==this)for(;gi.length?this.clone().iadd(i):i.clone().iadd(this)},o.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var a=this.iadd(i);return i.negative=1,a._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var c=this.cmp(i);if(c===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,l;c>0?(f=this,l=i):(f=i,l=this);for(var g=0,b=0;b>26,this.words[b]=a&67108863;for(;g!==0&&b>26,this.words[b]=a&67108863;if(g===0&&b>>26,S=d&67108863,L=Math.min(s,i.length-1),T=Math.max(0,s-y.length+1);T<=L;T++){var q=s-T|0;f=y.words[q]|0,l=i.words[T]|0,g=f*l+S,p+=g/67108864|0,S=g&67108863}a.words[s]=S|0,d=p|0}return d!==0?a.words[s]=d|0:a.length--,a._strip()}var N=function(i,a,c){var f=i.words,l=a.words,g=c.words,b=0,d,s,p,S=f[0]|0,L=S&8191,T=S>>>13,q=f[1]|0,$=q&8191,G=q>>>13,Dt=f[2]|0,J=Dt&8191,X=Dt>>>13,de=f[3]|0,it=de&8191,st=de>>>13,Sr=f[4]|0,pt=Sr&8191,yt=Sr>>>13,Er=f[5]|0,ut=Er&8191,ct=Er>>>13,He=f[6]|0,ft=He&8191,ht=He>>>13,nr=f[7]|0,lt=nr&8191,dt=nr>>>13,Ir=f[8]|0,gt=Ir&8191,mt=Ir>>>13,_r=f[9]|0,bt=_r&8191,vt=_r>>>13,Un=l[0]|0,xt=Un&8191,kt=Un>>>13,Nn=l[1]|0,Bt=Nn&8191,St=Nn>>>13,zn=l[2]|0,Et=zn&8191,It=zn>>>13,qn=l[3]|0,_t=qn&8191,At=qn>>>13,Fn=l[4]|0,Mt=Fn&8191,Lt=Fn>>>13,Kn=l[5]|0,Rt=Kn&8191,Tt=Kn>>>13,Dn=l[6]|0,Pt=Dn&8191,Ct=Dn>>>13,Wn=l[7]|0,Ot=Wn&8191,Ut=Wn>>>13,Hn=l[8]|0,Nt=Hn&8191,zt=Hn>>>13,$n=l[9]|0,qt=$n&8191,Ft=$n>>>13;c.negative=i.negative^a.negative,c.length=19,d=Math.imul(L,xt),s=Math.imul(L,kt),s=s+Math.imul(T,xt)|0,p=Math.imul(T,kt);var Ar=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,d=Math.imul($,xt),s=Math.imul($,kt),s=s+Math.imul(G,xt)|0,p=Math.imul(G,kt),d=d+Math.imul(L,Bt)|0,s=s+Math.imul(L,St)|0,s=s+Math.imul(T,Bt)|0,p=p+Math.imul(T,St)|0;var Mr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,d=Math.imul(J,xt),s=Math.imul(J,kt),s=s+Math.imul(X,xt)|0,p=Math.imul(X,kt),d=d+Math.imul($,Bt)|0,s=s+Math.imul($,St)|0,s=s+Math.imul(G,Bt)|0,p=p+Math.imul(G,St)|0,d=d+Math.imul(L,Et)|0,s=s+Math.imul(L,It)|0,s=s+Math.imul(T,Et)|0,p=p+Math.imul(T,It)|0;var Lr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Lr>>>26)|0,Lr&=67108863,d=Math.imul(it,xt),s=Math.imul(it,kt),s=s+Math.imul(st,xt)|0,p=Math.imul(st,kt),d=d+Math.imul(J,Bt)|0,s=s+Math.imul(J,St)|0,s=s+Math.imul(X,Bt)|0,p=p+Math.imul(X,St)|0,d=d+Math.imul($,Et)|0,s=s+Math.imul($,It)|0,s=s+Math.imul(G,Et)|0,p=p+Math.imul(G,It)|0,d=d+Math.imul(L,_t)|0,s=s+Math.imul(L,At)|0,s=s+Math.imul(T,_t)|0,p=p+Math.imul(T,At)|0;var Rr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,d=Math.imul(pt,xt),s=Math.imul(pt,kt),s=s+Math.imul(yt,xt)|0,p=Math.imul(yt,kt),d=d+Math.imul(it,Bt)|0,s=s+Math.imul(it,St)|0,s=s+Math.imul(st,Bt)|0,p=p+Math.imul(st,St)|0,d=d+Math.imul(J,Et)|0,s=s+Math.imul(J,It)|0,s=s+Math.imul(X,Et)|0,p=p+Math.imul(X,It)|0,d=d+Math.imul($,_t)|0,s=s+Math.imul($,At)|0,s=s+Math.imul(G,_t)|0,p=p+Math.imul(G,At)|0,d=d+Math.imul(L,Mt)|0,s=s+Math.imul(L,Lt)|0,s=s+Math.imul(T,Mt)|0,p=p+Math.imul(T,Lt)|0;var Tr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Tr>>>26)|0,Tr&=67108863,d=Math.imul(ut,xt),s=Math.imul(ut,kt),s=s+Math.imul(ct,xt)|0,p=Math.imul(ct,kt),d=d+Math.imul(pt,Bt)|0,s=s+Math.imul(pt,St)|0,s=s+Math.imul(yt,Bt)|0,p=p+Math.imul(yt,St)|0,d=d+Math.imul(it,Et)|0,s=s+Math.imul(it,It)|0,s=s+Math.imul(st,Et)|0,p=p+Math.imul(st,It)|0,d=d+Math.imul(J,_t)|0,s=s+Math.imul(J,At)|0,s=s+Math.imul(X,_t)|0,p=p+Math.imul(X,At)|0,d=d+Math.imul($,Mt)|0,s=s+Math.imul($,Lt)|0,s=s+Math.imul(G,Mt)|0,p=p+Math.imul(G,Lt)|0,d=d+Math.imul(L,Rt)|0,s=s+Math.imul(L,Tt)|0,s=s+Math.imul(T,Rt)|0,p=p+Math.imul(T,Tt)|0;var Pr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,d=Math.imul(ft,xt),s=Math.imul(ft,kt),s=s+Math.imul(ht,xt)|0,p=Math.imul(ht,kt),d=d+Math.imul(ut,Bt)|0,s=s+Math.imul(ut,St)|0,s=s+Math.imul(ct,Bt)|0,p=p+Math.imul(ct,St)|0,d=d+Math.imul(pt,Et)|0,s=s+Math.imul(pt,It)|0,s=s+Math.imul(yt,Et)|0,p=p+Math.imul(yt,It)|0,d=d+Math.imul(it,_t)|0,s=s+Math.imul(it,At)|0,s=s+Math.imul(st,_t)|0,p=p+Math.imul(st,At)|0,d=d+Math.imul(J,Mt)|0,s=s+Math.imul(J,Lt)|0,s=s+Math.imul(X,Mt)|0,p=p+Math.imul(X,Lt)|0,d=d+Math.imul($,Rt)|0,s=s+Math.imul($,Tt)|0,s=s+Math.imul(G,Rt)|0,p=p+Math.imul(G,Tt)|0,d=d+Math.imul(L,Pt)|0,s=s+Math.imul(L,Ct)|0,s=s+Math.imul(T,Pt)|0,p=p+Math.imul(T,Ct)|0;var Cr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,d=Math.imul(lt,xt),s=Math.imul(lt,kt),s=s+Math.imul(dt,xt)|0,p=Math.imul(dt,kt),d=d+Math.imul(ft,Bt)|0,s=s+Math.imul(ft,St)|0,s=s+Math.imul(ht,Bt)|0,p=p+Math.imul(ht,St)|0,d=d+Math.imul(ut,Et)|0,s=s+Math.imul(ut,It)|0,s=s+Math.imul(ct,Et)|0,p=p+Math.imul(ct,It)|0,d=d+Math.imul(pt,_t)|0,s=s+Math.imul(pt,At)|0,s=s+Math.imul(yt,_t)|0,p=p+Math.imul(yt,At)|0,d=d+Math.imul(it,Mt)|0,s=s+Math.imul(it,Lt)|0,s=s+Math.imul(st,Mt)|0,p=p+Math.imul(st,Lt)|0,d=d+Math.imul(J,Rt)|0,s=s+Math.imul(J,Tt)|0,s=s+Math.imul(X,Rt)|0,p=p+Math.imul(X,Tt)|0,d=d+Math.imul($,Pt)|0,s=s+Math.imul($,Ct)|0,s=s+Math.imul(G,Pt)|0,p=p+Math.imul(G,Ct)|0,d=d+Math.imul(L,Ot)|0,s=s+Math.imul(L,Ut)|0,s=s+Math.imul(T,Ot)|0,p=p+Math.imul(T,Ut)|0;var Or=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Or>>>26)|0,Or&=67108863,d=Math.imul(gt,xt),s=Math.imul(gt,kt),s=s+Math.imul(mt,xt)|0,p=Math.imul(mt,kt),d=d+Math.imul(lt,Bt)|0,s=s+Math.imul(lt,St)|0,s=s+Math.imul(dt,Bt)|0,p=p+Math.imul(dt,St)|0,d=d+Math.imul(ft,Et)|0,s=s+Math.imul(ft,It)|0,s=s+Math.imul(ht,Et)|0,p=p+Math.imul(ht,It)|0,d=d+Math.imul(ut,_t)|0,s=s+Math.imul(ut,At)|0,s=s+Math.imul(ct,_t)|0,p=p+Math.imul(ct,At)|0,d=d+Math.imul(pt,Mt)|0,s=s+Math.imul(pt,Lt)|0,s=s+Math.imul(yt,Mt)|0,p=p+Math.imul(yt,Lt)|0,d=d+Math.imul(it,Rt)|0,s=s+Math.imul(it,Tt)|0,s=s+Math.imul(st,Rt)|0,p=p+Math.imul(st,Tt)|0,d=d+Math.imul(J,Pt)|0,s=s+Math.imul(J,Ct)|0,s=s+Math.imul(X,Pt)|0,p=p+Math.imul(X,Ct)|0,d=d+Math.imul($,Ot)|0,s=s+Math.imul($,Ut)|0,s=s+Math.imul(G,Ot)|0,p=p+Math.imul(G,Ut)|0,d=d+Math.imul(L,Nt)|0,s=s+Math.imul(L,zt)|0,s=s+Math.imul(T,Nt)|0,p=p+Math.imul(T,zt)|0;var Ur=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,d=Math.imul(bt,xt),s=Math.imul(bt,kt),s=s+Math.imul(vt,xt)|0,p=Math.imul(vt,kt),d=d+Math.imul(gt,Bt)|0,s=s+Math.imul(gt,St)|0,s=s+Math.imul(mt,Bt)|0,p=p+Math.imul(mt,St)|0,d=d+Math.imul(lt,Et)|0,s=s+Math.imul(lt,It)|0,s=s+Math.imul(dt,Et)|0,p=p+Math.imul(dt,It)|0,d=d+Math.imul(ft,_t)|0,s=s+Math.imul(ft,At)|0,s=s+Math.imul(ht,_t)|0,p=p+Math.imul(ht,At)|0,d=d+Math.imul(ut,Mt)|0,s=s+Math.imul(ut,Lt)|0,s=s+Math.imul(ct,Mt)|0,p=p+Math.imul(ct,Lt)|0,d=d+Math.imul(pt,Rt)|0,s=s+Math.imul(pt,Tt)|0,s=s+Math.imul(yt,Rt)|0,p=p+Math.imul(yt,Tt)|0,d=d+Math.imul(it,Pt)|0,s=s+Math.imul(it,Ct)|0,s=s+Math.imul(st,Pt)|0,p=p+Math.imul(st,Ct)|0,d=d+Math.imul(J,Ot)|0,s=s+Math.imul(J,Ut)|0,s=s+Math.imul(X,Ot)|0,p=p+Math.imul(X,Ut)|0,d=d+Math.imul($,Nt)|0,s=s+Math.imul($,zt)|0,s=s+Math.imul(G,Nt)|0,p=p+Math.imul(G,zt)|0,d=d+Math.imul(L,qt)|0,s=s+Math.imul(L,Ft)|0,s=s+Math.imul(T,qt)|0,p=p+Math.imul(T,Ft)|0;var Nr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,d=Math.imul(bt,Bt),s=Math.imul(bt,St),s=s+Math.imul(vt,Bt)|0,p=Math.imul(vt,St),d=d+Math.imul(gt,Et)|0,s=s+Math.imul(gt,It)|0,s=s+Math.imul(mt,Et)|0,p=p+Math.imul(mt,It)|0,d=d+Math.imul(lt,_t)|0,s=s+Math.imul(lt,At)|0,s=s+Math.imul(dt,_t)|0,p=p+Math.imul(dt,At)|0,d=d+Math.imul(ft,Mt)|0,s=s+Math.imul(ft,Lt)|0,s=s+Math.imul(ht,Mt)|0,p=p+Math.imul(ht,Lt)|0,d=d+Math.imul(ut,Rt)|0,s=s+Math.imul(ut,Tt)|0,s=s+Math.imul(ct,Rt)|0,p=p+Math.imul(ct,Tt)|0,d=d+Math.imul(pt,Pt)|0,s=s+Math.imul(pt,Ct)|0,s=s+Math.imul(yt,Pt)|0,p=p+Math.imul(yt,Ct)|0,d=d+Math.imul(it,Ot)|0,s=s+Math.imul(it,Ut)|0,s=s+Math.imul(st,Ot)|0,p=p+Math.imul(st,Ut)|0,d=d+Math.imul(J,Nt)|0,s=s+Math.imul(J,zt)|0,s=s+Math.imul(X,Nt)|0,p=p+Math.imul(X,zt)|0,d=d+Math.imul($,qt)|0,s=s+Math.imul($,Ft)|0,s=s+Math.imul(G,qt)|0,p=p+Math.imul(G,Ft)|0;var zr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(zr>>>26)|0,zr&=67108863,d=Math.imul(bt,Et),s=Math.imul(bt,It),s=s+Math.imul(vt,Et)|0,p=Math.imul(vt,It),d=d+Math.imul(gt,_t)|0,s=s+Math.imul(gt,At)|0,s=s+Math.imul(mt,_t)|0,p=p+Math.imul(mt,At)|0,d=d+Math.imul(lt,Mt)|0,s=s+Math.imul(lt,Lt)|0,s=s+Math.imul(dt,Mt)|0,p=p+Math.imul(dt,Lt)|0,d=d+Math.imul(ft,Rt)|0,s=s+Math.imul(ft,Tt)|0,s=s+Math.imul(ht,Rt)|0,p=p+Math.imul(ht,Tt)|0,d=d+Math.imul(ut,Pt)|0,s=s+Math.imul(ut,Ct)|0,s=s+Math.imul(ct,Pt)|0,p=p+Math.imul(ct,Ct)|0,d=d+Math.imul(pt,Ot)|0,s=s+Math.imul(pt,Ut)|0,s=s+Math.imul(yt,Ot)|0,p=p+Math.imul(yt,Ut)|0,d=d+Math.imul(it,Nt)|0,s=s+Math.imul(it,zt)|0,s=s+Math.imul(st,Nt)|0,p=p+Math.imul(st,zt)|0,d=d+Math.imul(J,qt)|0,s=s+Math.imul(J,Ft)|0,s=s+Math.imul(X,qt)|0,p=p+Math.imul(X,Ft)|0;var qr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(qr>>>26)|0,qr&=67108863,d=Math.imul(bt,_t),s=Math.imul(bt,At),s=s+Math.imul(vt,_t)|0,p=Math.imul(vt,At),d=d+Math.imul(gt,Mt)|0,s=s+Math.imul(gt,Lt)|0,s=s+Math.imul(mt,Mt)|0,p=p+Math.imul(mt,Lt)|0,d=d+Math.imul(lt,Rt)|0,s=s+Math.imul(lt,Tt)|0,s=s+Math.imul(dt,Rt)|0,p=p+Math.imul(dt,Tt)|0,d=d+Math.imul(ft,Pt)|0,s=s+Math.imul(ft,Ct)|0,s=s+Math.imul(ht,Pt)|0,p=p+Math.imul(ht,Ct)|0,d=d+Math.imul(ut,Ot)|0,s=s+Math.imul(ut,Ut)|0,s=s+Math.imul(ct,Ot)|0,p=p+Math.imul(ct,Ut)|0,d=d+Math.imul(pt,Nt)|0,s=s+Math.imul(pt,zt)|0,s=s+Math.imul(yt,Nt)|0,p=p+Math.imul(yt,zt)|0,d=d+Math.imul(it,qt)|0,s=s+Math.imul(it,Ft)|0,s=s+Math.imul(st,qt)|0,p=p+Math.imul(st,Ft)|0;var Fr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,d=Math.imul(bt,Mt),s=Math.imul(bt,Lt),s=s+Math.imul(vt,Mt)|0,p=Math.imul(vt,Lt),d=d+Math.imul(gt,Rt)|0,s=s+Math.imul(gt,Tt)|0,s=s+Math.imul(mt,Rt)|0,p=p+Math.imul(mt,Tt)|0,d=d+Math.imul(lt,Pt)|0,s=s+Math.imul(lt,Ct)|0,s=s+Math.imul(dt,Pt)|0,p=p+Math.imul(dt,Ct)|0,d=d+Math.imul(ft,Ot)|0,s=s+Math.imul(ft,Ut)|0,s=s+Math.imul(ht,Ot)|0,p=p+Math.imul(ht,Ut)|0,d=d+Math.imul(ut,Nt)|0,s=s+Math.imul(ut,zt)|0,s=s+Math.imul(ct,Nt)|0,p=p+Math.imul(ct,zt)|0,d=d+Math.imul(pt,qt)|0,s=s+Math.imul(pt,Ft)|0,s=s+Math.imul(yt,qt)|0,p=p+Math.imul(yt,Ft)|0;var Kr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Kr>>>26)|0,Kr&=67108863,d=Math.imul(bt,Rt),s=Math.imul(bt,Tt),s=s+Math.imul(vt,Rt)|0,p=Math.imul(vt,Tt),d=d+Math.imul(gt,Pt)|0,s=s+Math.imul(gt,Ct)|0,s=s+Math.imul(mt,Pt)|0,p=p+Math.imul(mt,Ct)|0,d=d+Math.imul(lt,Ot)|0,s=s+Math.imul(lt,Ut)|0,s=s+Math.imul(dt,Ot)|0,p=p+Math.imul(dt,Ut)|0,d=d+Math.imul(ft,Nt)|0,s=s+Math.imul(ft,zt)|0,s=s+Math.imul(ht,Nt)|0,p=p+Math.imul(ht,zt)|0,d=d+Math.imul(ut,qt)|0,s=s+Math.imul(ut,Ft)|0,s=s+Math.imul(ct,qt)|0,p=p+Math.imul(ct,Ft)|0;var Dr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,d=Math.imul(bt,Pt),s=Math.imul(bt,Ct),s=s+Math.imul(vt,Pt)|0,p=Math.imul(vt,Ct),d=d+Math.imul(gt,Ot)|0,s=s+Math.imul(gt,Ut)|0,s=s+Math.imul(mt,Ot)|0,p=p+Math.imul(mt,Ut)|0,d=d+Math.imul(lt,Nt)|0,s=s+Math.imul(lt,zt)|0,s=s+Math.imul(dt,Nt)|0,p=p+Math.imul(dt,zt)|0,d=d+Math.imul(ft,qt)|0,s=s+Math.imul(ft,Ft)|0,s=s+Math.imul(ht,qt)|0,p=p+Math.imul(ht,Ft)|0;var Wr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Wr>>>26)|0,Wr&=67108863,d=Math.imul(bt,Ot),s=Math.imul(bt,Ut),s=s+Math.imul(vt,Ot)|0,p=Math.imul(vt,Ut),d=d+Math.imul(gt,Nt)|0,s=s+Math.imul(gt,zt)|0,s=s+Math.imul(mt,Nt)|0,p=p+Math.imul(mt,zt)|0,d=d+Math.imul(lt,qt)|0,s=s+Math.imul(lt,Ft)|0,s=s+Math.imul(dt,qt)|0,p=p+Math.imul(dt,Ft)|0;var Hr=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,d=Math.imul(bt,Nt),s=Math.imul(bt,zt),s=s+Math.imul(vt,Nt)|0,p=Math.imul(vt,zt),d=d+Math.imul(gt,qt)|0,s=s+Math.imul(gt,Ft)|0,s=s+Math.imul(mt,qt)|0,p=p+Math.imul(mt,Ft)|0;var $r=(b+d|0)+((s&8191)<<13)|0;b=(p+(s>>>13)|0)+($r>>>26)|0,$r&=67108863,d=Math.imul(bt,qt),s=Math.imul(bt,Ft),s=s+Math.imul(vt,qt)|0,p=Math.imul(vt,Ft);var Vr=(b+d|0)+((s&8191)<<13)|0;return b=(p+(s>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,g[0]=Ar,g[1]=Mr,g[2]=Lr,g[3]=Rr,g[4]=Tr,g[5]=Pr,g[6]=Cr,g[7]=Or,g[8]=Ur,g[9]=Nr,g[10]=zr,g[11]=qr,g[12]=Fr,g[13]=Kr,g[14]=Dr,g[15]=Wr,g[16]=Hr,g[17]=$r,g[18]=Vr,b!==0&&(g[19]=b,c.length++),c};Math.imul||(N=I);function D(y,i,a){a.negative=i.negative^y.negative,a.length=y.length+i.length;for(var c=0,f=0,l=0;l>>26)|0,f+=g>>>26,g&=67108863}a.words[l]=b,c=g,g=f}return c!==0?a.words[l]=c:a.length--,a._strip()}function U(y,i,a){return D(y,i,a)}o.prototype.mulTo=function(i,a){var c,f=this.length+i.length;return this.length===10&&i.length===10?c=N(this,i,a):f<63?c=I(this,i,a):f<1024?c=D(this,i,a):c=U(this,i,a),c};function K(y,i){this.x=y,this.y=i}K.prototype.makeRBT=function(i){for(var a=new Array(i),c=o.prototype._countBits(i)-1,f=0;f>=1;return f},K.prototype.permute=function(i,a,c,f,l,g){for(var b=0;b>>1)l++;return 1<>>13,c[2*g+1]=l&8191,l=l>>>13;for(g=2*a;g>=26,c+=l/67108864|0,c+=g>>>26,this.words[f]=g&67108863}return c!==0&&(this.words[f]=c,this.length++),a?this.ineg():this},o.prototype.muln=function(i){return this.clone().imuln(i)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(i){var a=R(i);if(a.length===0)return new o(1);for(var c=this,f=0;f=0);var a=i%26,c=(i-a)/26,f=67108863>>>26-a<<26-a,l;if(a!==0){var g=0;for(l=0;l>>26-a}g&&(this.words[l]=g,this.length++)}if(c!==0){for(l=this.length-1;l>=0;l--)this.words[l+c]=this.words[l];for(l=0;l=0);var f;a?f=(a-a%26)/26:f=0;var l=i%26,g=Math.min((i-l)/26,this.length),b=67108863^67108863>>>l<g)for(this.length-=g,s=0;s=0&&(p!==0||s>=f);s--){var S=this.words[s]|0;this.words[s]=p<<26-l|S>>>l,p=S&b}return d&&p!==0&&(d.words[d.length++]=p),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(i,a,c){return e(this.negative===0),this.iushrn(i,a,c)},o.prototype.shln=function(i){return this.clone().ishln(i)},o.prototype.ushln=function(i){return this.clone().iushln(i)},o.prototype.shrn=function(i){return this.clone().ishrn(i)},o.prototype.ushrn=function(i){return this.clone().iushrn(i)},o.prototype.testn=function(i){e(typeof i=="number"&&i>=0);var a=i%26,c=(i-a)/26,f=1<=0);var a=i%26,c=(i-a)/26;if(e(this.negative===0,"imaskn works only with positive numbers"),this.length<=c)return this;if(a!==0&&c++,this.length=Math.min(c,this.length),a!==0){var f=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},o.prototype.isubn=function(i){if(e(typeof i=="number"),e(i<67108864),i<0)return this.iaddn(-i);if(this.negative!==0)return this.negative=0,this.iaddn(i),this.negative=1,this;if(this.words[0]-=i,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(d/67108864|0),this.words[l+c]=g&67108863}for(;l>26,this.words[l+c]=g&67108863;if(b===0)return this._strip();for(e(b===-1),b=0,l=0;l>26,this.words[l]=g&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(i,a){var c=this.length-i.length,f=this.clone(),l=i,g=l.words[l.length-1]|0,b=this._countBits(g);c=26-b,c!==0&&(l=l.ushln(c),f.iushln(c),g=l.words[l.length-1]|0);var d=f.length-l.length,s;if(a!=="mod"){s=new o(null),s.length=d+1,s.words=new Array(s.length);for(var p=0;p=0;L--){var T=(f.words[l.length+L]|0)*67108864+(f.words[l.length+L-1]|0);for(T=Math.min(T/g|0,67108863),f._ishlnsubmul(l,T,L);f.negative!==0;)T--,f.negative=0,f._ishlnsubmul(l,1,L),f.isZero()||(f.negative^=1);s&&(s.words[L]=T)}return s&&s._strip(),f._strip(),a!=="div"&&c!==0&&f.iushrn(c),{div:s||null,mod:f}},o.prototype.divmod=function(i,a,c){if(e(!i.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var f,l,g;return this.negative!==0&&i.negative===0?(g=this.neg().divmod(i,a),a!=="mod"&&(f=g.div.neg()),a!=="div"&&(l=g.mod.neg(),c&&l.negative!==0&&l.iadd(i)),{div:f,mod:l}):this.negative===0&&i.negative!==0?(g=this.divmod(i.neg(),a),a!=="mod"&&(f=g.div.neg()),{div:f,mod:g.mod}):this.negative&i.negative?(g=this.neg().divmod(i.neg(),a),a!=="div"&&(l=g.mod.neg(),c&&l.negative!==0&&l.isub(i)),{div:g.div,mod:l}):i.length>this.length||this.cmp(i)<0?{div:new o(0),mod:this}:i.length===1?a==="div"?{div:this.divn(i.words[0]),mod:null}:a==="mod"?{div:null,mod:new o(this.modrn(i.words[0]))}:{div:this.divn(i.words[0]),mod:new o(this.modrn(i.words[0]))}:this._wordDiv(i,a)},o.prototype.div=function(i){return this.divmod(i,"div",!1).div},o.prototype.mod=function(i){return this.divmod(i,"mod",!1).mod},o.prototype.umod=function(i){return this.divmod(i,"mod",!0).mod},o.prototype.divRound=function(i){var a=this.divmod(i);if(a.mod.isZero())return a.div;var c=a.div.negative!==0?a.mod.isub(i):a.mod,f=i.ushrn(1),l=i.andln(1),g=c.cmp(f);return g<0||l===1&&g===0?a.div:a.div.negative!==0?a.div.isubn(1):a.div.iaddn(1)},o.prototype.modrn=function(i){var a=i<0;a&&(i=-i),e(i<=67108863);for(var c=(1<<26)%i,f=0,l=this.length-1;l>=0;l--)f=(c*f+(this.words[l]|0))%i;return a?-f:f},o.prototype.modn=function(i){return this.modrn(i)},o.prototype.idivn=function(i){var a=i<0;a&&(i=-i),e(i<=67108863);for(var c=0,f=this.length-1;f>=0;f--){var l=(this.words[f]|0)+c*67108864;this.words[f]=l/i|0,c=l%i}return this._strip(),a?this.ineg():this},o.prototype.divn=function(i){return this.clone().idivn(i)},o.prototype.egcd=function(i){e(i.negative===0),e(!i.isZero());var a=this,c=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var f=new o(1),l=new o(0),g=new o(0),b=new o(1),d=0;a.isEven()&&c.isEven();)a.iushrn(1),c.iushrn(1),++d;for(var s=c.clone(),p=a.clone();!a.isZero();){for(var S=0,L=1;!(a.words[0]&L)&&S<26;++S,L<<=1);if(S>0)for(a.iushrn(S);S-- >0;)(f.isOdd()||l.isOdd())&&(f.iadd(s),l.isub(p)),f.iushrn(1),l.iushrn(1);for(var T=0,q=1;!(c.words[0]&q)&&T<26;++T,q<<=1);if(T>0)for(c.iushrn(T);T-- >0;)(g.isOdd()||b.isOdd())&&(g.iadd(s),b.isub(p)),g.iushrn(1),b.iushrn(1);a.cmp(c)>=0?(a.isub(c),f.isub(g),l.isub(b)):(c.isub(a),g.isub(f),b.isub(l))}return{a:g,b,gcd:c.iushln(d)}},o.prototype._invmp=function(i){e(i.negative===0),e(!i.isZero());var a=this,c=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var f=new o(1),l=new o(0),g=c.clone();a.cmpn(1)>0&&c.cmpn(1)>0;){for(var b=0,d=1;!(a.words[0]&d)&&b<26;++b,d<<=1);if(b>0)for(a.iushrn(b);b-- >0;)f.isOdd()&&f.iadd(g),f.iushrn(1);for(var s=0,p=1;!(c.words[0]&p)&&s<26;++s,p<<=1);if(s>0)for(c.iushrn(s);s-- >0;)l.isOdd()&&l.iadd(g),l.iushrn(1);a.cmp(c)>=0?(a.isub(c),f.isub(l)):(c.isub(a),l.isub(f))}var S;return a.cmpn(1)===0?S=f:S=l,S.cmpn(0)<0&&S.iadd(i),S},o.prototype.gcd=function(i){if(this.isZero())return i.abs();if(i.isZero())return this.abs();var a=this.clone(),c=i.clone();a.negative=0,c.negative=0;for(var f=0;a.isEven()&&c.isEven();f++)a.iushrn(1),c.iushrn(1);do{for(;a.isEven();)a.iushrn(1);for(;c.isEven();)c.iushrn(1);var l=a.cmp(c);if(l<0){var g=a;a=c,c=g}else if(l===0||c.cmpn(1)===0)break;a.isub(c)}while(!0);return c.iushln(f)},o.prototype.invm=function(i){return this.egcd(i).a.umod(i)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(i){return this.words[0]&i},o.prototype.bincn=function(i){e(typeof i=="number");var a=i%26,c=(i-a)/26,f=1<>>26,b&=67108863,this.words[g]=b}return l!==0&&(this.words[g]=l,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(i){var a=i<0;if(this.negative!==0&&!a)return-1;if(this.negative===0&&a)return 1;this._strip();var c;if(this.length>1)c=1;else{a&&(i=-i),e(i<=67108863,"Number is too big");var f=this.words[0]|0;c=f===i?0:fi.length)return 1;if(this.length=0;c--){var f=this.words[c]|0,l=i.words[c]|0;if(f!==l){fl&&(a=1);break}}return a},o.prototype.gtn=function(i){return this.cmpn(i)===1},o.prototype.gt=function(i){return this.cmp(i)===1},o.prototype.gten=function(i){return this.cmpn(i)>=0},o.prototype.gte=function(i){return this.cmp(i)>=0},o.prototype.ltn=function(i){return this.cmpn(i)===-1},o.prototype.lt=function(i){return this.cmp(i)===-1},o.prototype.lten=function(i){return this.cmpn(i)<=0},o.prototype.lte=function(i){return this.cmp(i)<=0},o.prototype.eqn=function(i){return this.cmpn(i)===0},o.prototype.eq=function(i){return this.cmp(i)===0},o.red=function(i){return new V(i)},o.prototype.toRed=function(i){return e(!this.red,"Already a number in reduction context"),e(this.negative===0,"red works only with positives"),i.convertTo(this)._forceRed(i)},o.prototype.fromRed=function(){return e(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(i){return this.red=i,this},o.prototype.forceRed=function(i){return e(!this.red,"Already a number in reduction context"),this._forceRed(i)},o.prototype.redAdd=function(i){return e(this.red,"redAdd works only with red numbers"),this.red.add(this,i)},o.prototype.redIAdd=function(i){return e(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,i)},o.prototype.redSub=function(i){return e(this.red,"redSub works only with red numbers"),this.red.sub(this,i)},o.prototype.redISub=function(i){return e(this.red,"redISub works only with red numbers"),this.red.isub(this,i)},o.prototype.redShl=function(i){return e(this.red,"redShl works only with red numbers"),this.red.shl(this,i)},o.prototype.redMul=function(i){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.mul(this,i)},o.prototype.redIMul=function(i){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.imul(this,i)},o.prototype.redSqr=function(){return e(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return e(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return e(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return e(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return e(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(i){return e(this.red&&!i.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,i)};var tt={k256:null,p224:null,p192:null,p25519:null};function W(y,i){this.name=y,this.p=new o(i,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}W.prototype._tmp=function(){var i=new o(null);return i.words=new Array(Math.ceil(this.n/13)),i},W.prototype.ireduce=function(i){var a=i,c;do this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),c=a.bitLength();while(c>this.n);var f=c0?a.isub(this.p):a.strip!==void 0?a.strip():a._strip(),a},W.prototype.split=function(i,a){i.iushrn(this.n,0,a)},W.prototype.imulK=function(i){return i.imul(this.k)};function Z(){W.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(Z,W),Z.prototype.split=function(i,a){for(var c=4194303,f=Math.min(i.length,9),l=0;l>>22,g=b}g>>>=22,i.words[l-10]=g,g===0&&i.length>10?i.length-=10:i.length-=9},Z.prototype.imulK=function(i){i.words[i.length]=0,i.words[i.length+1]=0,i.length+=2;for(var a=0,c=0;c>>=26,i.words[c]=l,a=f}return a!==0&&(i.words[i.length++]=a),i},o._prime=function(i){if(tt[i])return tt[i];var a;if(i==="k256")a=new Z;else if(i==="p224")a=new et;else if(i==="p192")a=new Q;else if(i==="p25519")a=new $t;else throw new Error("Unknown prime "+i);return tt[i]=a,a};function V(y){if(typeof y=="string"){var i=o._prime(y);this.m=i.p,this.prime=i}else e(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}V.prototype._verify1=function(i){e(i.negative===0,"red works only with positives"),e(i.red,"red works only with red numbers")},V.prototype._verify2=function(i,a){e((i.negative|a.negative)===0,"red works only with positives"),e(i.red&&i.red===a.red,"red works only with red numbers")},V.prototype.imod=function(i){return this.prime?this.prime.ireduce(i)._forceRed(this):(x(i,i.umod(this.m)._forceRed(this)),i)},V.prototype.neg=function(i){return i.isZero()?i.clone():this.m.sub(i)._forceRed(this)},V.prototype.add=function(i,a){this._verify2(i,a);var c=i.add(a);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},V.prototype.iadd=function(i,a){this._verify2(i,a);var c=i.iadd(a);return c.cmp(this.m)>=0&&c.isub(this.m),c},V.prototype.sub=function(i,a){this._verify2(i,a);var c=i.sub(a);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},V.prototype.isub=function(i,a){this._verify2(i,a);var c=i.isub(a);return c.cmpn(0)<0&&c.iadd(this.m),c},V.prototype.shl=function(i,a){return this._verify1(i),this.imod(i.ushln(a))},V.prototype.imul=function(i,a){return this._verify2(i,a),this.imod(i.imul(a))},V.prototype.mul=function(i,a){return this._verify2(i,a),this.imod(i.mul(a))},V.prototype.isqr=function(i){return this.imul(i,i.clone())},V.prototype.sqr=function(i){return this.mul(i,i)},V.prototype.sqrt=function(i){if(i.isZero())return i.clone();var a=this.m.andln(3);if(e(a%2===1),a===3){var c=this.m.add(new o(1)).iushrn(2);return this.pow(i,c)}for(var f=this.m.subn(1),l=0;!f.isZero()&&f.andln(1)===0;)l++,f.iushrn(1);e(!f.isZero());var g=new o(1).toRed(this),b=g.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new o(2*s*s).toRed(this);this.pow(s,d).cmp(b)!==0;)s.redIAdd(b);for(var p=this.pow(s,f),S=this.pow(i,f.addn(1).iushrn(1)),L=this.pow(i,f),T=l;L.cmp(g)!==0;){for(var q=L,$=0;q.cmp(g)!==0;$++)q=q.redSqr();e($=0;l--){for(var p=a.words[l],S=s-1;S>=0;S--){var L=p>>S&1;if(g!==f[0]&&(g=this.sqr(g)),L===0&&b===0){d=0;continue}b<<=1,b|=L,d++,!(d!==c&&(l!==0||S!==0))&&(g=this.mul(g,f[b]),d=0,b=0)}s=26}return g},V.prototype.convertTo=function(i){var a=i.umod(this.m);return a===i?a.clone():a},V.prototype.convertFrom=function(i){var a=i.clone();return a.red=null,a},o.mont=function(i){return new nt(i)};function nt(y){V.call(this,y),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(nt,V),nt.prototype.convertTo=function(i){return this.imod(i.ushln(this.shift))},nt.prototype.convertFrom=function(i){var a=this.imod(i.mul(this.rinv));return a.red=null,a},nt.prototype.imul=function(i,a){if(i.isZero()||a.isZero())return i.words[0]=0,i.length=1,i;var c=i.imul(a),f=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),l=c.isub(f).iushrn(this.shift),g=l;return l.cmp(this.m)>=0?g=l.isub(this.m):l.cmpn(0)<0&&(g=l.iadd(this.m)),g._forceRed(this)},nt.prototype.mul=function(i,a){if(i.isZero()||a.isZero())return new o(0)._forceRed(this);var c=i.mul(a),f=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),l=c.isub(f).iushrn(this.shift),g=l;return l.cmp(this.m)>=0?g=l.isub(this.m):l.cmpn(0)<0&&(g=l.iadd(this.m)),g._forceRed(this)},nt.prototype.invm=function(i){var a=this.imod(i._invmp(this.m).mul(this.r2));return a._forceRed(this)}})(typeof Ss>"u"||Ss,Iu)});var Au=ae(_s=>{"use strict";var Mp=P(O());function Je(r,t,e){return t<=r&&r<=e}function Gi(r){if(r===void 0)return{};if(r===Object(r))return r;throw TypeError("Could not convert argument to dictionary")}function tl(r){for(var t=String(r),e=t.length,n=0,o=[];n57343)o.push(u);else if(56320<=u&&u<=57343)o.push(65533);else if(55296<=u&&u<=56319)if(n===e-1)o.push(65533);else{var h=r.charCodeAt(n+1);if(56320<=h&&h<=57343){var w=u&1023,m=h&1023;o.push(65536+(w<<10)+m),n+=1}else o.push(65533)}n+=1}return o}function el(r){for(var t="",e=0;e>10)+55296,(n&1023)+56320))}return t}var Wi=-1;function Is(r){this.tokens=[].slice.call(r)}Is.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():Wi},prepend:function(r){if(Array.isArray(r))for(var t=r;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(r)},push:function(r){if(Array.isArray(r))for(var t=r;t.length;)this.tokens.push(t.shift());else this.tokens.push(r)}};var kn=-1;function Es(r,t){if(r)throw TypeError("Decoder error");return t||65533}var Hi="utf-8";function $i(r,t){if(!(this instanceof $i))return new $i(r,t);if(r=r!==void 0?String(r).toLowerCase():Hi,r!==Hi)throw new Error("Encoding not supported. Only utf-8 is supported");t=Gi(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!t.fatal,this._ignoreBOM=!!t.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}$i.prototype={decode:function(t,e){var n;typeof t=="object"&&t instanceof ArrayBuffer?n=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):n=new Uint8Array(0),e=Gi(e),this._streaming||(this._decoder=new rl({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!e.stream;for(var o=new Is(n),u=[],h;!o.endOfStream()&&(h=this._decoder.handler(o,o.read()),h!==kn);)h!==null&&(Array.isArray(h)?u.push.apply(u,h):u.push(h));if(!this._streaming){do{if(h=this._decoder.handler(o,o.read()),h===kn)break;h!==null&&(Array.isArray(h)?u.push.apply(u,h):u.push(h))}while(!o.endOfStream());this._decoder=null}return u.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(u[0]===65279?(this._BOMseen=!0,u.shift()):this._BOMseen=!0),el(u)}};function Vi(r,t){if(!(this instanceof Vi))return new Vi(r,t);if(r=r!==void 0?String(r).toLowerCase():Hi,r!==Hi)throw new Error("Encoding not supported. Only utf-8 is supported");t=Gi(t),this._streaming=!1,this._encoder=null,this._options={fatal:!!t.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}Vi.prototype={encode:function(t,e){t=t?String(t):"",e=Gi(e),this._streaming||(this._encoder=new nl(this._options)),this._streaming=!!e.stream;for(var n=[],o=new Is(tl(t)),u;!o.endOfStream()&&(u=this._encoder.handler(o,o.read()),u!==kn);)Array.isArray(u)?n.push.apply(n,u):n.push(u);if(!this._streaming){for(;u=this._encoder.handler(o,o.read()),u!==kn;)Array.isArray(u)?n.push.apply(n,u):n.push(u);this._encoder=null}return new Uint8Array(n)}};function rl(r){var t=r.fatal,e=0,n=0,o=0,u=128,h=191;this.handler=function(w,m){if(m===Wi&&o!==0)return o=0,Es(t);if(m===Wi)return kn;if(o===0){if(Je(m,0,127))return m;if(Je(m,194,223))o=1,e=m-192;else if(Je(m,224,239))m===224&&(u=160),m===237&&(h=159),o=2,e=m-224;else if(Je(m,240,244))m===240&&(u=144),m===244&&(h=143),o=3,e=m-240;else return Es(t);return e=e<<6*o,null}if(!Je(m,u,h))return e=o=n=0,u=128,h=191,w.prepend(m),Es(t);if(u=128,h=191,n+=1,e+=m-128<<6*(o-n),n!==o)return null;var x=e;return e=o=n=0,x}}function nl(r){var t=r.fatal;this.handler=function(e,n){if(n===Wi)return kn;if(Je(n,0,127))return n;var o,u;Je(n,128,2047)?(o=1,u=192):Je(n,2048,65535)?(o=2,u=224):Je(n,65536,1114111)&&(o=3,u=240);for(var h=[(n>>6*o)+u];o>0;){var w=n>>6*(o-1);h.push(128|w&63),o-=1}return h}}_s.TextEncoder=Vi;_s.TextDecoder=$i});var Pu=ae(Yt=>{"use strict";var Rp=P(O()),il=Yt&&Yt.__createBinding||(Object.create?function(r,t,e,n){n===void 0&&(n=e),Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[e]}})}:function(r,t,e,n){n===void 0&&(n=e),r[n]=t[e]}),ol=Yt&&Yt.__setModuleDefault||(Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t}),De=Yt&&Yt.__decorate||function(r,t,e,n){var o=arguments.length,u=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(r,t,e,n);else for(var w=r.length-1;w>=0;w--)(h=r[w])&&(u=(o<3?h(u):o>3?h(t,e,u):h(t,e))||u);return o>3&&u&&Object.defineProperty(t,e,u),u},sl=Yt&&Yt.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var e in r)e!=="default"&&Object.hasOwnProperty.call(r,e)&&il(t,r,e);return ol(t,r),t},Mu=Yt&&Yt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.deserializeUnchecked=Yt.deserialize=Yt.serialize=Yt.BinaryReader=Yt.BinaryWriter=Yt.BorshError=Yt.baseDecode=Yt.baseEncode=void 0;var mr=Mu(_u()),Lu=Mu(xs()),al=sl(Au()),ul=typeof TextDecoder!="function"?al.TextDecoder:TextDecoder,cl=new ul("utf-8",{fatal:!0});function fl(r){return typeof r=="string"&&(r=Buffer.from(r,"utf8")),Lu.default.encode(Buffer.from(r))}Yt.baseEncode=fl;function hl(r){return Buffer.from(Lu.default.decode(r))}Yt.baseDecode=hl;var As=1024,he=class extends Error{constructor(t){super(t),this.fieldPath=[],this.originalMessage=t}addToFieldPath(t){this.fieldPath.splice(0,0,t),this.message=this.originalMessage+": "+this.fieldPath.join(".")}};Yt.BorshError=he;var Zi=class{constructor(){this.buf=Buffer.alloc(As),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(As)]))}writeU8(t){this.maybeResize(),this.buf.writeUInt8(t,this.length),this.length+=1}writeU16(t){this.maybeResize(),this.buf.writeUInt16LE(t,this.length),this.length+=2}writeU32(t){this.maybeResize(),this.buf.writeUInt32LE(t,this.length),this.length+=4}writeU64(t){this.maybeResize(),this.writeBuffer(Buffer.from(new mr.default(t).toArray("le",8)))}writeU128(t){this.maybeResize(),this.writeBuffer(Buffer.from(new mr.default(t).toArray("le",16)))}writeU256(t){this.maybeResize(),this.writeBuffer(Buffer.from(new mr.default(t).toArray("le",32)))}writeU512(t){this.maybeResize(),this.writeBuffer(Buffer.from(new mr.default(t).toArray("le",64)))}writeBuffer(t){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),t,Buffer.alloc(As)]),this.length+=t.length}writeString(t){this.maybeResize();let e=Buffer.from(t,"utf8");this.writeU32(e.length),this.writeBuffer(e)}writeFixedArray(t){this.writeBuffer(Buffer.from(t))}writeArray(t,e){this.maybeResize(),this.writeU32(t.length);for(let n of t)this.maybeResize(),e(n)}toArray(){return this.buf.subarray(0,this.length)}};Yt.BinaryWriter=Zi;function We(r,t,e){let n=e.value;e.value=function(...o){try{return n.apply(this,o)}catch(u){if(u instanceof RangeError){let h=u.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(h)>=0)throw new he("Reached the end of buffer when deserializing")}throw u}}}var xe=class{constructor(t){this.buf=t,this.offset=0}readU8(){let t=this.buf.readUInt8(this.offset);return this.offset+=1,t}readU16(){let t=this.buf.readUInt16LE(this.offset);return this.offset+=2,t}readU32(){let t=this.buf.readUInt32LE(this.offset);return this.offset+=4,t}readU64(){let t=this.readBuffer(8);return new mr.default(t,"le")}readU128(){let t=this.readBuffer(16);return new mr.default(t,"le")}readU256(){let t=this.readBuffer(32);return new mr.default(t,"le")}readU512(){let t=this.readBuffer(64);return new mr.default(t,"le")}readBuffer(t){if(this.offset+t>this.buf.length)throw new he(`Expected buffer length ${t} isn\'t within bounds`);let e=this.buf.slice(this.offset,this.offset+t);return this.offset+=t,e}readString(){let t=this.readU32(),e=this.readBuffer(t);try{return cl.decode(e)}catch(n){throw new he(`Error decoding UTF-8 string: ${n}`)}}readFixedArray(t){return new Uint8Array(this.readBuffer(t))}readArray(t){let e=this.readU32(),n=Array();for(let o=0;o{on(r,t,u,n[0],o)});else if(n.kind!==void 0)switch(n.kind){case"option":{e==null?o.writeU8(0):(o.writeU8(1),on(r,t,e,n.type,o));break}case"map":{o.writeU32(e.size),e.forEach((u,h)=>{on(r,t,h,n.key,o),on(r,t,u,n.value,o)});break}default:throw new he(`FieldType ${n} unrecognized`)}else Tu(r,e,o)}catch(u){throw u instanceof he&&u.addToFieldPath(t),u}}function Tu(r,t,e){if(typeof t.borshSerialize=="function"){t.borshSerialize(e);return}let n=r.get(t.constructor);if(!n)throw new he(`Class ${t.constructor.name} is missing in schema`);if(n.kind==="struct")n.fields.map(([o,u])=>{on(r,o,t[o],u,e)});else if(n.kind==="enum"){let o=t[n.field];for(let u=0;usn(r,t,e[0],n))}if(e.kind==="option")return n.readU8()?sn(r,t,e.type,n):void 0;if(e.kind==="map"){let o=new Map,u=n.readU32();for(let h=0;h=n.values.length)throw new he(`Enum index: ${o} is out of range`);let[u,h]=n.values[o],w=sn(r,u,h,e);return new t({[u]:w})}throw new he(`Unexpected schema kind: ${n.kind} for ${t.constructor.name}`)}function dl(r,t,e,n=xe){let o=new n(e),u=Ms(r,t,o);if(o.offset{"use strict";var Pp=P(O());Object.defineProperty(M,"__esModule",{value:!0});M.s16=M.s8=M.nu64be=M.u48be=M.u40be=M.u32be=M.u24be=M.u16be=M.nu64=M.u48=M.u40=M.u32=M.u24=M.u16=M.u8=M.offset=M.greedy=M.Constant=M.UTF8=M.CString=M.Blob=M.Boolean=M.BitField=M.BitStructure=M.VariantLayout=M.Union=M.UnionLayoutDiscriminator=M.UnionDiscriminator=M.Structure=M.Sequence=M.DoubleBE=M.Double=M.FloatBE=M.Float=M.NearInt64BE=M.NearInt64=M.NearUInt64BE=M.NearUInt64=M.IntBE=M.Int=M.UIntBE=M.UInt=M.OffsetLayout=M.GreedyCount=M.ExternalLayout=M.bindConstructorLayout=M.nameWithProperty=M.Layout=M.uint8ArrayToBuffer=M.checkUint8Array=void 0;M.constant=M.utf8=M.cstr=M.blob=M.unionLayoutDiscriminator=M.union=M.seq=M.bits=M.struct=M.f64be=M.f64=M.f32be=M.f32=M.ns64be=M.s48be=M.s40be=M.s32be=M.s24be=M.s16be=M.ns64=M.s48=M.s40=M.s32=M.s24=void 0;var Rs=mn();function En(r){if(!(r instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}M.checkUint8Array=En;function Vt(r){return En(r),Rs.Buffer.from(r.buffer,r.byteOffset,r.length)}M.uint8ArrayToBuffer=Vt;var Zt=class{constructor(t,e){if(!Number.isInteger(t))throw new TypeError("span must be an integer");this.span=t,this.property=e}makeDestinationObject(){return{}}getSpan(t,e){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(t){let e=Object.create(this.constructor.prototype);return Object.assign(e,this),e.property=t,e}fromArray(t){}};M.Layout=Zt;function Ts(r,t){return t.property?r+"["+t.property+"]":r}M.nameWithProperty=Ts;function yl(r,t){if(typeof r!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(r,"layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof Zt))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(t,"boundConstructor_"))throw new Error("layout is already bound to a constructor");r.layout_=t,t.boundConstructor_=r,t.makeDestinationObject=()=>new r,Object.defineProperty(r.prototype,"encode",{value(e,n){return t.encode(this,e,n)},writable:!0}),Object.defineProperty(r,"decode",{value(e,n){return t.decode(e,n)},writable:!0})}M.bindConstructorLayout=yl;var pe=class extends Zt{isCount(){throw new Error("ExternalLayout is abstract")}};M.ExternalLayout=pe;var ji=class extends pe{constructor(t=1,e){if(!Number.isInteger(t)||0>=t)throw new TypeError("elementSpan must be a (positive) integer");super(-1,e),this.elementSpan=t}isCount(){return!0}decode(t,e=0){En(t);let n=t.length-e;return Math.floor(n/this.elementSpan)}encode(t,e,n){return 0}};M.GreedyCount=ji;var Qn=class extends pe{constructor(t,e=0,n){if(!(t instanceof Zt))throw new TypeError("layout must be a Layout");if(!Number.isInteger(e))throw new TypeError("offset must be integer or undefined");super(t.span,n||t.property),this.layout=t,this.offset=e}isCount(){return this.layout instanceof Ie||this.layout instanceof Ae}decode(t,e=0){return this.layout.decode(t,e+this.offset)}encode(t,e,n=0){return this.layout.encode(t,e,n+this.offset)}};M.OffsetLayout=Qn;var Ie=class extends Zt{constructor(t,e){if(super(t,e),6h+o.encode(w,e,n+h),0);return this.count instanceof pe&&this.count.encode(t.length,e,n),u}};M.Sequence=io;var oo=class extends Zt{constructor(t,e,n){if(!(Array.isArray(t)&&t.reduce((u,h)=>u&&h instanceof Zt,!0)))throw new TypeError("fields must be array of Layout instances");typeof e=="boolean"&&n===void 0&&(n=e,e=void 0);for(let u of t)if(0>u.span&&u.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let o=-1;try{o=t.reduce((u,h)=>u+h.getSpan(),0)}catch{}super(o,e),this.fields=t,this.decodePrefixes=!!n}getSpan(t,e=0){if(0<=this.span)return this.span;let n=0;try{n=this.fields.reduce((o,u)=>{let h=u.getSpan(t,e);return e+=h,o+h},0)}catch{throw new RangeError("indeterminate span")}return n}decode(t,e=0){En(t);let n=this.makeDestinationObject();for(let o of this.fields)if(o.property!==void 0&&(n[o.property]=o.decode(t,e)),e+=o.getSpan(t,e),this.decodePrefixes&&t.length===e)break;return n}encode(t,e,n=0){let o=n,u=0,h=0;for(let w of this.fields){let m=w.span;if(h=0m&&(m=w.getSpan(e,n)))}u=n,n+=m}return u+h-o}fromArray(t){let e=this.makeDestinationObject();for(let n of this.fields)n.property!==void 0&&0n.span?e=-1:0<=e&&(e+=n.span)}}};M.Structure=oo;var ti=class{constructor(t){this.property=t}decode(t,e){throw new Error("UnionDiscriminator is abstract")}encode(t,e,n){throw new Error("UnionDiscriminator is abstract")}};M.UnionDiscriminator=ti;var Sn=class extends ti{constructor(t,e){if(!(t instanceof pe&&t.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(e||t.property||"variant"),this.layout=t}decode(t,e){return this.layout.decode(t,e)}encode(t,e,n){return this.layout.encode(t,e,n)}};M.UnionLayoutDiscriminator=Sn;var ei=class extends Zt{constructor(t,e,n){let o;if(t instanceof Ie||t instanceof Ae)o=new Sn(new Qn(t));else if(t instanceof pe&&t.isCount())o=new Sn(t);else if(t instanceof ti)o=t;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(e===void 0&&(e=null),!(e===null||e instanceof Zt))throw new TypeError("defaultLayout must be null or a Layout");if(e!==null){if(0>e.span)throw new Error("defaultLayout must have constant span");e.property===void 0&&(e=e.replicate("content"))}let u=-1;e&&(u=e.span,0<=u&&(t instanceof Ie||t instanceof Ae)&&(u+=o.layout.span)),super(u,n),this.discriminator=o,this.usesPrefixDiscriminator=t instanceof Ie||t instanceof Ae,this.defaultLayout=e,this.registry={};let h=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(w){return h(w)},this.configGetSourceVariant=function(w){h=w.bind(this)}}getSpan(t,e=0){if(0<=this.span)return this.span;let n=this.getVariant(t,e);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(t,e)}defaultGetSourceVariant(t){if(Object.prototype.hasOwnProperty.call(t,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(t,this.defaultLayout.property))return;let e=this.registry[t[this.discriminator.property]];if(e&&(!e.layout||e.property&&Object.prototype.hasOwnProperty.call(t,e.property)))return e}else for(let e in this.registry){let n=this.registry[e];if(n.property&&Object.prototype.hasOwnProperty.call(t,n.property))return n}throw new Error("unable to infer src variant")}decode(t,e=0){let n,o=this.discriminator,u=o.decode(t,e),h=this.registry[u];if(h===void 0){let w=this.defaultLayout,m=0;this.usesPrefixDiscriminator&&(m=o.layout.span),n=this.makeDestinationObject(),n[o.property]=u,n[w.property]=w.decode(t,e+m)}else n=h.decode(t,e);return n}encode(t,e,n=0){let o=this.getSourceVariant(t);if(o===void 0){let u=this.discriminator,h=this.defaultLayout,w=0;return this.usesPrefixDiscriminator&&(w=u.layout.span),u.encode(t[u.property],e,n),w+h.encode(t[h.property],e,n+w)}return o.encode(t,e,n)}addVariant(t,e,n){let o=new so(this,t,e,n);return this.registry[t]=o,o}getVariant(t,e=0){let n;return t instanceof Uint8Array?n=this.discriminator.decode(t,e):n=t,this.registry[n]}};M.Union=ei;var so=class extends Zt{constructor(t,e,n,o){if(!(t instanceof ei))throw new TypeError("union must be a Union");if(!Number.isInteger(e)||0>e)throw new TypeError("variant must be a (non-negative) integer");if(typeof n=="string"&&o===void 0&&(o=n,n=null),n){if(!(n instanceof Zt))throw new TypeError("layout must be a Layout");if(t.defaultLayout!==null&&0<=n.span&&n.span>t.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof o!="string")throw new TypeError("variant must have a String property")}let u=t.span;0>t.span&&(u=n?n.span:0,0<=u&&t.usesPrefixDiscriminator&&(u+=t.discriminator.layout.span)),super(u,o),this.union=t,this.variant=e,this.layout=n||null}getSpan(t,e=0){if(0<=this.span)return this.span;let n=0;this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span);let o=0;return this.layout&&(o=this.layout.getSpan(t,e+n)),n+o}decode(t,e=0){let n=this.makeDestinationObject();if(this!==this.union.getVariant(t,e))throw new Error("variant mismatch");let o=0;return this.union.usesPrefixDiscriminator&&(o=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(t,e+o):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}encode(t,e,n=0){let o=0;if(this.union.usesPrefixDiscriminator&&(o=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(t,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,e,n);let u=o;if(this.layout&&(this.layout.encode(t[this.property],e,n+o),u+=this.layout.getSpan(e,n+o),0<=this.union.span&&u>this.union.span))throw new Error("encoded variant overruns containing union");return u}fromArray(t){if(this.layout)return this.layout.fromArray(t)}};M.VariantLayout=so;function Bn(r){return 0>r&&(r+=4294967296),r}var ri=class extends Zt{constructor(t,e,n){if(!(t instanceof Ie||t instanceof Ae))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof e=="string"&&n===void 0&&(n=e,e=!1),4=e)throw new TypeError("bits must be positive integer");let o=8*t.span,u=t.fields.reduce((h,w)=>h+w.bits,0);if(e+u>o)throw new Error("bits too long for span remainder ("+(o-u)+" of "+o+" remain)");this.container=t,this.bits=e,this.valueMask=(1<>>this.start}encode(t){if(typeof t!="number"||!Number.isInteger(t)||t!==Bn(t&this.valueMask))throw new TypeError(Ts("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let e=this.container._packedGetValue(),n=Bn(t<n&&(n=this.length.decode(t,e)),n}decode(t,e=0){let n=this.span;return 0>n&&(n=this.length.decode(t,e)),Vt(t).slice(e,e+n)}encode(t,e,n){let o=this.length;if(this.length instanceof pe&&(o=t.length),!(t instanceof Uint8Array&&o===t.length))throw new TypeError(Ts("Blob.encode",this)+" requires (length "+o+") Uint8Array as src");if(n+o>e.length)throw new RangeError("encoding overruns Uint8Array");let u=Vt(t);return Vt(e).write(u.toString("hex"),n,o,"hex"),this.length instanceof pe&&this.length.encode(o,e,n),o}};M.Blob=uo;var co=class extends Zt{constructor(t){super(-1,t)}getSpan(t,e=0){En(t);let n=e;for(;ne.length)throw new RangeError("encoding overruns Buffer");let h=Vt(e);return o.copy(h,n),h[n+u]=0,u+1}};M.CString=co;var fo=class extends Zt{constructor(t,e){if(typeof t=="string"&&e===void 0&&(e=t,t=void 0),t===void 0)t=-1;else if(!Number.isInteger(t))throw new TypeError("maxSpan must be an integer");super(-1,e),this.maxSpan=t}getSpan(t,e=0){return En(t),t.length-e}decode(t,e=0){let n=this.getSpan(t,e);if(0<=this.maxSpan&&this.maxSpane.length)throw new RangeError("encoding overruns Buffer");return o.copy(Vt(e),n),u}};M.UTF8=fo;var ho=class extends Zt{constructor(t,e){super(0,e),this.value=t}decode(t,e){return this.value}encode(t,e,n){return 0}};M.Constant=ho;M.greedy=(r,t)=>new ji(r,t);M.offset=(r,t,e)=>new Qn(r,t,e);M.u8=r=>new Ie(1,r);M.u16=r=>new Ie(2,r);M.u24=r=>new Ie(3,r);M.u32=r=>new Ie(4,r);M.u40=r=>new Ie(5,r);M.u48=r=>new Ie(6,r);M.nu64=r=>new Yi(r);M.u16be=r=>new Ae(2,r);M.u24be=r=>new Ae(3,r);M.u32be=r=>new Ae(4,r);M.u40be=r=>new Ae(5,r);M.u48be=r=>new Ae(6,r);M.nu64be=r=>new Ji(r);M.s8=r=>new Xe(1,r);M.s16=r=>new Xe(2,r);M.s24=r=>new Xe(3,r);M.s32=r=>new Xe(4,r);M.s40=r=>new Xe(5,r);M.s48=r=>new Xe(6,r);M.ns64=r=>new Xi(r);M.s16be=r=>new wr(2,r);M.s24be=r=>new wr(3,r);M.s32be=r=>new wr(4,r);M.s40be=r=>new wr(5,r);M.s48be=r=>new wr(6,r);M.ns64be=r=>new Qi(r);M.f32=r=>new to(r);M.f32be=r=>new eo(r);M.f64=r=>new ro(r);M.f64be=r=>new no(r);M.struct=(r,t,e)=>new oo(r,t,e);M.bits=(r,t,e)=>new ri(r,t,e);M.seq=(r,t,e)=>new io(r,t,e);M.union=(r,t,e)=>new ei(r,t,e);M.unionLayoutDiscriminator=(r,t)=>new Sn(r,t);M.blob=(r,t)=>new uo(r,t);M.cstr=r=>new co(r);M.utf8=(r,t)=>new fo(r,t);M.constant=(r,t)=>new ho(r,t)});var Cu=ae(In=>{"use strict";var Op=P(O());Object.defineProperty(In,"__esModule",{value:!0});var yo;function gl(r){{let t=Buffer.from(r);t.reverse();let e=t.toString("hex");return e.length===0?BigInt(0):BigInt(`0x${e}`)}return yo.toBigInt(r,!1)}In.toBigIntLE=gl;function ml(r){{let t=r.toString("hex");return t.length===0?BigInt(0):BigInt(`0x${t}`)}return yo.toBigInt(r,!0)}In.toBigIntBE=ml;function wl(r,t){{let e=r.toString(16),n=Buffer.from(e.padStart(t*2,"0").slice(0,t*2),"hex");return n.reverse(),n}return yo.fromBigInt(r,Buffer.allocUnsafe(t),!1)}In.toBufferLE=wl;function bl(r,t){{let e=r.toString(16);return Buffer.from(e.padStart(t*2,"0").slice(0,t*2),"hex")}return yo.fromBigInt(r,Buffer.allocUnsafe(t),!0)}In.toBufferBE=bl});function vl(r){return ii(r)&&typeof r[Symbol.iterator]=="function"}function ii(r){return typeof r=="object"&&r!=null}function go(r){return ii(r)&&!Array.isArray(r)}function Ue(r){return typeof r=="symbol"?r.toString():typeof r=="string"?JSON.stringify(r):`${r}`}function xl(r){let{done:t,value:e}=r.next();return t?void 0:e}function kl(r,t,e,n){if(r===!0)return;r===!1?r={}:typeof r=="string"&&(r={message:r});let{path:o,branch:u}=t,{type:h}=e,{refinement:w,message:m=`Expected a value of type \\`${h}\\`${w?` with refinement \\`${w}\\``:""}, but received: \\`${Ue(n)}\\``}=r;return{value:n,type:h,refinement:w,key:o[o.length-1],path:o,branch:u,...r,message:m}}function*Ou(r,t,e,n){vl(r)||(r=[r]);for(let o of r){let u=kl(o,t,e,n);u&&(yield u)}}function*Os(r,t,e={}){let{path:n=[],branch:o=[r],coerce:u=!1,mask:h=!1}=e,w={path:n,branch:o,mask:h};u&&(r=t.coercer(r,w));let m="valid";for(let x of t.validator(r,w))x.explanation=e.message,m="not_valid",yield[x,void 0];for(let[x,v,B]of t.entries(r,w)){let _=Os(v,B,{path:x===void 0?n:[...n,x],branch:x===void 0?o:[...o,v],coerce:u,mask:h,message:e.message});for(let E of _)E[0]?(m=E[0].refinement!=null?"not_refined":"not_valid",yield[E[0],void 0]):u&&(v=E[1],x===void 0?r=v:r instanceof Map?r.set(x,v):r instanceof Set?r.add(v):ii(r)&&(v!==void 0||x in r)&&(r[x]=v))}if(m!=="not_valid")for(let x of t.refiner(r,w))x.explanation=e.message,m="not_refined",yield[x,void 0];m==="valid"&&(yield[void 0,r])}function Uu(r,t,e){let n=oi(r,t,{message:e});if(n[0])throw n[0]}function _n(r,t,e){let n=oi(r,t,{coerce:!0,message:e});if(n[0])throw n[0];return n[1]}function Bl(r,t,e){let n=oi(r,t,{coerce:!0,mask:!0,message:e});if(n[0])throw n[0];return n[1]}function Nu(r,t){return!oi(r,t)[0]}function oi(r,t,e={}){let n=Os(r,t,e),o=xl(n);return o[0]?[new Cs(o[0],function*(){for(let h of n)h[0]&&(yield h[0])}),void 0]:[void 0,o[1]]}function an(r,t){return new Le({type:r,schema:null,validator:t})}function zu(){return an("any",()=>!0)}function j(r){return new Le({type:"array",schema:r,*entries(t){if(r&&Array.isArray(t))for(let[e,n]of t.entries())yield[e,n,r]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${Ue(t)}`}})}function Ne(){return an("boolean",r=>typeof r=="boolean")}function mo(r){return an("instance",t=>t instanceof r||`Expected a \\`${r.name}\\` instance, but received: ${Ue(t)}`)}function re(r){let t=Ue(r),e=typeof r;return new Le({type:"literal",schema:e==="string"||e==="number"||e==="boolean"?r:null,validator(n){return n===r||`Expected the literal \\`${t}\\`, but received: ${Ue(n)}`}})}function Sl(){return an("never",()=>!1)}function Y(r){return new Le({...r,validator:(t,e)=>t===null||r.validator(t,e),refiner:(t,e)=>t===null||r.refiner(t,e)})}function A(){return an("number",r=>typeof r=="number"&&!isNaN(r)||`Expected a number, but received: ${Ue(r)}`)}function rt(r){return new Le({...r,validator:(t,e)=>t===void 0||r.validator(t,e),refiner:(t,e)=>t===void 0||r.refiner(t,e)})}function Us(r,t){return new Le({type:"record",schema:null,*entries(e){if(ii(e))for(let n in e){let o=e[n];yield[n,n,r],yield[n,o,t]}},validator(e){return go(e)||`Expected an object, but received: ${Ue(e)}`},coercer(e){return go(e)?{...e}:e}})}function H(){return an("string",r=>typeof r=="string"||`Expected a string, but received: ${Ue(r)}`)}function wo(r){let t=Sl();return new Le({type:"tuple",schema:null,*entries(e){if(Array.isArray(e)){let n=Math.max(r.length,e.length);for(let o=0;oe.type).join(" | ");return new Le({type:"union",schema:null,coercer(e,n){for(let o of r){let[u,h]=o.validate(e,{coerce:!0,mask:n.mask});if(!u)return h}return e},validator(e,n){let o=[];for(let u of r){let[...h]=Os(e,u,n),[w]=h;if(w[0])for(let[m]of h)m&&o.push(m);else return[]}return[`Expected the value to satisfy a union of \\`${t}\\`, but received: ${Ue(e)}`,...o]}})}function un(){return an("unknown",()=>!0)}function An(r,t,e){return new Le({...r,coercer:(n,o)=>Nu(n,t)?r.coercer(e(n,o),o):r.coercer(n,o)})}var Np,Cs,Le,qu=wt(()=>{Np=P(O(),1),Cs=class extends TypeError{constructor(t,e){let n,{message:o,explanation:u,...h}=t,{path:w}=t,m=w.length===0?o:`At path: ${w.join(".")} -- ${o}`;super(u??m),u!=null&&(this.cause=m),Object.assign(this,h),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...e()])}};Le=class{constructor(t){let{type:e,schema:n,validator:o,refiner:u,coercer:h=m=>m,entries:w=function*(){}}=t;this.type=e,this.schema=n,this.entries=w,this.coercer=h,o?this.validator=(m,x)=>{let v=o(m,x);return Ou(v,x,this,m)}:this.validator=()=>[],u?this.refiner=(m,x)=>{let v=u(m,x);return Ou(v,x,this,m)}:this.refiner=()=>[]}assert(t,e){return Uu(t,this,e)}create(t,e){return _n(t,this,e)}is(t){return Nu(t,this)}mask(t,e){return Bl(t,this,e)}validate(t,e={}){return oi(t,this,e)}}});function si(){if(!bo&&(bo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!bo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return bo(El)}var qp,bo,El,Ns=wt(()=>{qp=P(O()),El=new Uint8Array(16)});var Kp,Fu,Ku=wt(()=>{Kp=P(O()),Fu=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i});function Il(r){return typeof r=="string"&&Fu.test(r)}var Hp,br,ai=wt(()=>{Hp=P(O());Ku();br=Il});function _l(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=(le[r[t+0]]+le[r[t+1]]+le[r[t+2]]+le[r[t+3]]+"-"+le[r[t+4]]+le[r[t+5]]+"-"+le[r[t+6]]+le[r[t+7]]+"-"+le[r[t+8]]+le[r[t+9]]+"-"+le[r[t+10]]+le[r[t+11]]+le[r[t+12]]+le[r[t+13]]+le[r[t+14]]+le[r[t+15]]).toLowerCase();if(!br(e))throw TypeError("Stringified UUID is invalid");return e}var Gp,le,vo,vr,ui=wt(()=>{Gp=P(O());ai();le=[];for(vo=0;vo<256;++vo)le.push((vo+256).toString(16).substr(1));vr=_l});function Al(r,t,e){var n=t&&e||0,o=t||new Array(16);r=r||{};var u=r.node||Du,h=r.clockseq!==void 0?r.clockseq:zs;if(u==null||h==null){var w=r.random||(r.rng||si)();u==null&&(u=Du=[w[0]|1,w[1],w[2],w[3],w[4],w[5]]),h==null&&(h=zs=(w[6]<<8|w[7])&16383)}var m=r.msecs!==void 0?r.msecs:Date.now(),x=r.nsecs!==void 0?r.nsecs:Fs+1,v=m-qs+(x-Fs)/1e4;if(v<0&&r.clockseq===void 0&&(h=h+1&16383),(v<0||m>qs)&&r.nsecs===void 0&&(x=0),x>=1e4)throw new Error("uuid.v1(): Can\'t create more than 10M uuids/sec");qs=m,Fs=x,zs=h,m+=122192928e5;var B=((m&268435455)*1e4+x)%4294967296;o[n++]=B>>>24&255,o[n++]=B>>>16&255,o[n++]=B>>>8&255,o[n++]=B&255;var _=m/4294967296*1e4&268435455;o[n++]=_>>>8&255,o[n++]=_&255,o[n++]=_>>>24&15|16,o[n++]=_>>>16&255,o[n++]=h>>>8|128,o[n++]=h&255;for(var E=0;E<6;++E)o[n+E]=u[E];return t||vr(o)}var Jp,Du,zs,qs,Fs,Wu,Hu=wt(()=>{Jp=P(O());Ns();ui();qs=0,Fs=0;Wu=Al});function Ml(r){if(!br(r))throw TypeError("Invalid UUID");var t,e=new Uint8Array(16);return e[0]=(t=parseInt(r.slice(0,8),16))>>>24,e[1]=t>>>16&255,e[2]=t>>>8&255,e[3]=t&255,e[4]=(t=parseInt(r.slice(9,13),16))>>>8,e[5]=t&255,e[6]=(t=parseInt(r.slice(14,18),16))>>>8,e[7]=t&255,e[8]=(t=parseInt(r.slice(19,23),16))>>>8,e[9]=t&255,e[10]=(t=parseInt(r.slice(24,36),16))/1099511627776&255,e[11]=t/4294967296&255,e[12]=t>>>24&255,e[13]=t>>>16&255,e[14]=t>>>8&255,e[15]=t&255,e}var ty,xo,Ks=wt(()=>{ty=P(O());ai();xo=Ml});function Ll(r){r=unescape(encodeURIComponent(r));for(var t=[],e=0;e{iy=P(O());ui();Ks();Rl="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Tl="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function Pl(r){if(typeof r=="string"){var t=unescape(encodeURIComponent(r));r=new Uint8Array(t.length);for(var e=0;e>5]>>>o%32&255,h=parseInt(n.charAt(u>>>4&15)+n.charAt(u&15),16);t.push(h)}return t}function $u(r){return(r+64>>>9<<4)+14+1}function Ol(r,t){r[t>>5]|=128<>5]|=(r[n/8]&255)<>16)+(t>>16)+(e>>16);return n<<16|e&65535}function Nl(r,t){return r<>>32-t}function Bo(r,t,e,n,o,u){return xr(Nl(xr(xr(t,r),xr(n,u)),o),e)}function ge(r,t,e,n,o,u,h){return Bo(t&e|~t&n,r,t,o,u,h)}function me(r,t,e,n,o,u,h){return Bo(t&n|e&~n,r,t,o,u,h)}function we(r,t,e,n,o,u,h){return Bo(t^e^n,r,t,o,u,h)}function be(r,t,e,n,o,u,h){return Bo(e^(t|~n),r,t,o,u,h)}var sy,Vu,Gu=wt(()=>{sy=P(O());Vu=Pl});var fy,zl,Zu,ju=wt(()=>{fy=P(O());Ds();Gu();zl=ko("v3",48,Vu),Zu=zl});function ql(r,t,e){r=r||{};var n=r.random||(r.rng||si)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){e=e||0;for(var o=0;o<16;++o)t[e+o]=n[o];return t}return vr(n)}var py,Yu,Ju=wt(()=>{py=P(O());Ns();ui();Yu=ql});function Fl(r,t,e,n){switch(r){case 0:return t&e^~t&n;case 1:return t^e^n;case 2:return t&e^t&n^e&n;case 3:return t^e^n}}function Ws(r,t){return r<>>32-t}function Kl(r){var t=[1518500249,1859775393,2400959708,3395469782],e=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof r=="string"){var n=unescape(encodeURIComponent(r));r=[];for(var o=0;o>>0;U=D,D=N,N=Ws(I,30)>>>0,I=R,R=W}e[0]=e[0]+R>>>0,e[1]=e[1]+I>>>0,e[2]=e[2]+N>>>0,e[3]=e[3]+D>>>0,e[4]=e[4]+U>>>0}return[e[0]>>24&255,e[0]>>16&255,e[0]>>8&255,e[0]&255,e[1]>>24&255,e[1]>>16&255,e[1]>>8&255,e[1]&255,e[2]>>24&255,e[2]>>16&255,e[2]>>8&255,e[2]&255,e[3]>>24&255,e[3]>>16&255,e[3]>>8&255,e[3]&255,e[4]>>24&255,e[4]>>16&255,e[4]>>8&255,e[4]&255]}var gy,Xu,Qu=wt(()=>{gy=P(O());Xu=Kl});var vy,Dl,tc,ec=wt(()=>{vy=P(O());Ds();Qu();Dl=ko("v5",80,Xu),tc=Dl});var ky,rc,nc=wt(()=>{ky=P(O()),rc="00000000-0000-0000-0000-000000000000"});function Wl(r){if(!br(r))throw TypeError("Invalid UUID");return parseInt(r.substr(14,1),16)}var Ey,ic,oc=wt(()=>{Ey=P(O());ai();ic=Wl});var Hs={};ga(Hs,{NIL:()=>rc,parse:()=>xo,stringify:()=>vr,v1:()=>Wu,v3:()=>Zu,v4:()=>Yu,v5:()=>tc,validate:()=>br,version:()=>ic});var Iy,$s=wt(()=>{Iy=P(O());Hu();ju();Ju();ec();nc();oc();ai();ui();Ks()});var ac=ae((Uy,sc)=>{"use strict";var Ny=P(O()),Hl=($s(),wa(Hs)).v4,$l=function(r,t,e,n){if(typeof r!="string")throw new TypeError(r+" must be a string");n=n||{};let o=typeof n.version=="number"?n.version:2;if(o!==1&&o!==2)throw new TypeError(o+" must be 1 or 2");let u={method:r};if(o===2&&(u.jsonrpc="2.0"),t){if(typeof t!="object"&&!Array.isArray(t))throw new TypeError(t+" must be an object, array or omitted");u.params=t}if(typeof e>"u"){let h=typeof n.generator=="function"?n.generator:function(){return Hl()};u.id=h(u,n)}else o===2&&e===null?n.notificationIdNull&&(u.id=null):u.id=e;return u};sc.exports=$l});var cc=ae((zy,uc)=>{"use strict";var qy=P(O()),Vl=($s(),wa(Hs)).v4,Gl=ac(),ci=function(r,t){if(!(this instanceof ci))return new ci(r,t);t||(t={}),this.options={reviver:typeof t.reviver<"u"?t.reviver:null,replacer:typeof t.replacer<"u"?t.replacer:null,generator:typeof t.generator<"u"?t.generator:function(){return Vl()},version:typeof t.version<"u"?t.version:2,notificationIdNull:typeof t.notificationIdNull=="boolean"?t.notificationIdNull:!1},this.callServer=r};uc.exports=ci;ci.prototype.request=function(r,t,e,n){let o=this,u=null,h=Array.isArray(r)&&typeof t=="function";if(this.options.version===1&&h)throw new TypeError("JSON-RPC 1.0 does not support batching");if(h||!h&&r&&typeof r=="object"&&typeof t=="function")n=t,u=r;else{typeof e=="function"&&(n=e,e=void 0);let x=typeof n=="function";try{u=Gl(r,t,e,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(v){if(x)return n(v);throw v}if(!x)return u}let m;try{m=JSON.stringify(u,this.options.replacer)}catch(x){return n(x)}return this.callServer(m,function(x,v){o._parseResponse(x,v,n)}),u};ci.prototype._parseResponse=function(r,t,e){if(r){e(r);return}if(!t)return e();let n;try{n=JSON.parse(t,this.options.reviver)}catch(o){return e(o)}if(e.length===3)if(Array.isArray(n)){let o=function(h){return typeof h.error<"u"},u=function(h){return!o(h)};return e(null,n.filter(o),n.filter(u))}else return e(null,n.error,n.result);e(null,n)}});var hc=ae((Fy,Vs)=>{"use strict";var Ky=P(O()),Zl=Object.prototype.hasOwnProperty,ke="~";function fi(){}Object.create&&(fi.prototype=Object.create(null),new fi().__proto__||(ke=!1));function jl(r,t,e){this.fn=r,this.context=t,this.once=e||!1}function fc(r,t,e,n,o){if(typeof e!="function")throw new TypeError("The listener must be a function");var u=new jl(e,n||r,o),h=ke?ke+t:t;return r._events[h]?r._events[h].fn?r._events[h]=[r._events[h],u]:r._events[h].push(u):(r._events[h]=u,r._eventsCount++),r}function So(r,t){--r._eventsCount===0?r._events=new fi:delete r._events[t]}function ve(){this._events=new fi,this._eventsCount=0}ve.prototype.eventNames=function(){var t=[],e,n;if(this._eventsCount===0)return t;for(n in e=this._events)Zl.call(e,n)&&t.push(ke?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(e)):t};ve.prototype.listeners=function(t){var e=ke?ke+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,u=n.length,h=new Array(u);o{Wy=P(O(),1),lc=P(hc(),1)});var Vy,Yl,pc=wt(()=>{Vy=P(O(),1),Yl=P(mn(),1);dc()});function i0(r,t=24){let e=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let h=0;h<10;h++)e[h]=r[h]^r[h+10]^r[h+20]^r[h+30]^r[h+40];for(let h=0;h<10;h+=2){let w=(h+8)%10,m=(h+2)%10,x=e[m],v=e[m+1],B=yc(x,v,1)^e[w],_=gc(x,v,1)^e[w+1];for(let E=0;E<50;E+=10)r[h+E]^=B,r[h+E+1]^=_}let o=r[2],u=r[3];for(let h=0;h<24;h++){let w=wc[h],m=yc(o,u,w),x=gc(o,u,w),v=mc[h];o=r[v],u=r[v+1],r[v]=m,r[v+1]=x}for(let h=0;h<50;h+=10){for(let w=0;w<10;w++)e[w]=r[h+w];for(let w=0;w<10;w++)r[h+w]^=~e[(w+2)%10]&e[(w+4)%10]}r[0]^=r0[n],r[1]^=n0[n]}e.fill(0)}var sg,mc,wc,bc,Jl,hi,Xl,Ql,t0,e0,r0,n0,yc,gc,Mn,kr,Yy,Jy,Xy,Qy,tg,Gs,eg,rg,vc,ng,ig,xc=wt(()=>{sg=P(O(),1);Zn();es();ur();mc=[],wc=[],bc=[],Jl=BigInt(0),hi=BigInt(1),Xl=BigInt(2),Ql=BigInt(7),t0=BigInt(256),e0=BigInt(113);for(let r=0,t=hi,e=1,n=0;r<24;r++){[e,n]=[n,(2*e+3*n)%5],mc.push(2*(5*n+e)),wc.push((r+1)*(r+2)/2%64);let o=Jl;for(let u=0;u<7;u++)t=(t<>Ql)*e0)%t0,t&Xl&&(o^=hi<<(hi<e>32?Qo(r,t,e):Jo(r,t,e),gc=(r,t,e)=>e>32?ts(r,t,e):Xo(r,t,e);Mn=class extends sr{constructor(t,e,n,o=!1,u=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=o,this.rounds=u,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Gn(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=ja(this.state)}keccak(){$o||Vo(this.state32),i0(this.state32,this.rounds),$o||Vo(this.state32),this.posOut=0,this.pos=0}update(t){Ve(this);let{blockLen:e,state:n}=this;t=ar(t);let o=t.length;for(let u=0;u=n&&this.keccak();let h=Math.min(n-this.posOut,u-o);t.set(e.subarray(this.posOut,this.posOut+h),o),this.posOut+=h,o+=h}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Gn(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Mi(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:e,suffix:n,outputLen:o,rounds:u,enableXOF:h}=this;return t||(t=new Mn(e,n,o,h,u)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=u,t.suffix=n,t.outputLen=o,t.enableXOF=h,t.destroyed=this.destroyed,t}},kr=(r,t,e)=>wn(()=>new Mn(t,r,e)),Yy=kr(6,144,224/8),Jy=kr(6,136,256/8),Xy=kr(6,104,384/8),Qy=kr(6,72,512/8),tg=kr(1,144,224/8),Gs=kr(1,136,256/8),eg=kr(1,104,384/8),rg=kr(1,72,512/8),vc=(r,t,e)=>Ja((n={})=>new Mn(t,r,n.dkLen===void 0?e:n.dkLen,!0)),ng=vc(31,168,128/8),ig=vc(31,136,256/8)});var fg,Eo,Zs,kc=wt(()=>{fg=P(O(),1);Zn();ur();Eo=class extends sr{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,Ga(t);let n=ar(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,u=new Uint8Array(o);u.set(n.length>o?t.create().update(n).digest():n);for(let h=0;hnew Eo(r,t).update(e).digest();Zs.create=(r,t)=>new Eo(r,t)});function Bc(r){r.lowS!==void 0&&Ce("lowS",r.lowS),r.prehash!==void 0&&Ce("prehash",r.prehash)}function o0(r){let t=Jn(r);Fe(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:e,Fp:n,a:o}=t;if(e){if(!n.eql(o,n.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof e!="object"||typeof e.beta!="bigint"||typeof e.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...t})}function u0(r){let t=o0(r),{Fp:e}=t,n=pr(t.n,t.nBitLength),o=t.toBytes||((R,I,N)=>{let D=I.toAffine();return Ye(Uint8Array.from([4]),e.toBytes(D.x),e.toBytes(D.y))}),u=t.fromBytes||(R=>{let I=R.subarray(1),N=e.fromBytes(I.subarray(0,e.BYTES)),D=e.fromBytes(I.subarray(e.BYTES,2*e.BYTES));return{x:N,y:D}});function h(R){let{a:I,b:N}=t,D=e.sqr(R),U=e.mul(D,R);return e.add(e.add(U,e.mul(R,I)),N)}if(!e.eql(e.sqr(t.Gy),h(t.Gx)))throw new Error("bad generator point: equation left != right");function w(R){return jn(R,ce,t.n)}function m(R){let{allowedPrivateKeyLengths:I,nByteLength:N,wrapPrivateKey:D,n:U}=t;if(I&&typeof R!="bigint"){if(hr(R)&&(R=Ze(R)),typeof R!="string"||!I.includes(R.length))throw new Error("invalid private key");R=R.padStart(N*2,"0")}let K;try{K=typeof R=="bigint"?R:je(ne("private key",R,N))}catch{throw new Error("invalid private key, expected hex or "+N+" bytes, got "+typeof R)}return D&&(K=jt(K,U)),Se("private key",K,ce,U),K}function x(R){if(!(R instanceof _))throw new Error("ProjectivePoint expected")}let v=Qr((R,I)=>{let{px:N,py:D,pz:U}=R;if(e.eql(U,e.ONE))return{x:N,y:D};let K=R.is0();I==null&&(I=K?e.ONE:e.inv(U));let tt=e.mul(N,I),W=e.mul(D,I),Z=e.mul(U,I);if(K)return{x:e.ZERO,y:e.ZERO};if(!e.eql(Z,e.ONE))throw new Error("invZ was invalid");return{x:tt,y:W}}),B=Qr(R=>{if(R.is0()){if(t.allowInfinityPoint&&!e.is0(R.py))return;throw new Error("bad point: ZERO")}let{x:I,y:N}=R.toAffine();if(!e.isValid(I)||!e.isValid(N))throw new Error("bad point: x or y not FE");let D=e.sqr(N),U=h(I);if(!e.eql(D,U))throw new Error("bad point: equation left != right");if(!R.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class _{constructor(I,N,D){if(this.px=I,this.py=N,this.pz=D,I==null||!e.isValid(I))throw new Error("x required");if(N==null||!e.isValid(N))throw new Error("y required");if(D==null||!e.isValid(D))throw new Error("z required");Object.freeze(this)}static fromAffine(I){let{x:N,y:D}=I||{};if(!I||!e.isValid(N)||!e.isValid(D))throw new Error("invalid affine point");if(I instanceof _)throw new Error("projective point not allowed");let U=K=>e.eql(K,e.ZERO);return U(N)&&U(D)?_.ZERO:new _(N,D,e.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(I){let N=e.invertBatch(I.map(D=>D.pz));return I.map((D,U)=>D.toAffine(N[U])).map(_.fromAffine)}static fromHex(I){let N=_.fromAffine(u(ne("pointHex",I)));return N.assertValidity(),N}static fromPrivateKey(I){return _.BASE.multiply(m(I))}static msm(I,N){return qi(_,n,I,N)}_setWindowSize(I){F.setWindowSize(this,I)}assertValidity(){B(this)}hasEvenY(){let{y:I}=this.toAffine();if(e.isOdd)return!e.isOdd(I);throw new Error("Field doesn\'t support isOdd")}equals(I){x(I);let{px:N,py:D,pz:U}=this,{px:K,py:tt,pz:W}=I,Z=e.eql(e.mul(N,W),e.mul(K,U)),et=e.eql(e.mul(D,W),e.mul(tt,U));return Z&&et}negate(){return new _(this.px,e.neg(this.py),this.pz)}double(){let{a:I,b:N}=t,D=e.mul(N,Sc),{px:U,py:K,pz:tt}=this,W=e.ZERO,Z=e.ZERO,et=e.ZERO,Q=e.mul(U,U),$t=e.mul(K,K),V=e.mul(tt,tt),nt=e.mul(U,K);return nt=e.add(nt,nt),et=e.mul(U,tt),et=e.add(et,et),W=e.mul(I,et),Z=e.mul(D,V),Z=e.add(W,Z),W=e.sub($t,Z),Z=e.add($t,Z),Z=e.mul(W,Z),W=e.mul(nt,W),et=e.mul(D,et),V=e.mul(I,V),nt=e.sub(Q,V),nt=e.mul(I,nt),nt=e.add(nt,et),et=e.add(Q,Q),Q=e.add(et,Q),Q=e.add(Q,V),Q=e.mul(Q,nt),Z=e.add(Z,Q),V=e.mul(K,tt),V=e.add(V,V),Q=e.mul(V,nt),W=e.sub(W,Q),et=e.mul(V,$t),et=e.add(et,et),et=e.add(et,et),new _(W,Z,et)}add(I){x(I);let{px:N,py:D,pz:U}=this,{px:K,py:tt,pz:W}=I,Z=e.ZERO,et=e.ZERO,Q=e.ZERO,$t=t.a,V=e.mul(t.b,Sc),nt=e.mul(N,K),y=e.mul(D,tt),i=e.mul(U,W),a=e.add(N,D),c=e.add(K,tt);a=e.mul(a,c),c=e.add(nt,y),a=e.sub(a,c),c=e.add(N,U);let f=e.add(K,W);return c=e.mul(c,f),f=e.add(nt,i),c=e.sub(c,f),f=e.add(D,U),Z=e.add(tt,W),f=e.mul(f,Z),Z=e.add(y,i),f=e.sub(f,Z),Q=e.mul($t,c),Z=e.mul(V,i),Q=e.add(Z,Q),Z=e.sub(y,Q),Q=e.add(y,Q),et=e.mul(Z,Q),y=e.add(nt,nt),y=e.add(y,nt),i=e.mul($t,i),c=e.mul(V,c),y=e.add(y,i),i=e.sub(nt,i),i=e.mul($t,i),c=e.add(c,i),nt=e.mul(y,c),et=e.add(et,nt),nt=e.mul(f,c),Z=e.mul(a,Z),Z=e.sub(Z,nt),nt=e.mul(a,y),Q=e.mul(f,Q),Q=e.add(Q,nt),new _(Z,et,Q)}subtract(I){return this.add(I.negate())}is0(){return this.equals(_.ZERO)}wNAF(I){return F.wNAFCached(this,I,_.normalizeZ)}multiplyUnsafe(I){let{endo:N,n:D}=t;Se("scalar",I,tr,D);let U=_.ZERO;if(I===tr)return U;if(this.is0()||I===ce)return this;if(!N||F.hasPrecomputes(this))return F.wNAFCachedUnsafe(this,I,_.normalizeZ);let{k1neg:K,k1:tt,k2neg:W,k2:Z}=N.splitScalar(I),et=U,Q=U,$t=this;for(;tt>tr||Z>tr;)tt&ce&&(et=et.add($t)),Z&ce&&(Q=Q.add($t)),$t=$t.double(),tt>>=ce,Z>>=ce;return K&&(et=et.negate()),W&&(Q=Q.negate()),Q=new _(e.mul(Q.px,N.beta),Q.py,Q.pz),et.add(Q)}multiply(I){let{endo:N,n:D}=t;Se("scalar",I,ce,D);let U,K;if(N){let{k1neg:tt,k1:W,k2neg:Z,k2:et}=N.splitScalar(I),{p:Q,f:$t}=this.wNAF(W),{p:V,f:nt}=this.wNAF(et);Q=F.constTimeNegate(tt,Q),V=F.constTimeNegate(Z,V),V=new _(e.mul(V.px,N.beta),V.py,V.pz),U=Q.add(V),K=$t.add(nt)}else{let{p:tt,f:W}=this.wNAF(I);U=tt,K=W}return _.normalizeZ([U,K])[0]}multiplyAndAddUnsafe(I,N,D){let U=_.BASE,K=(W,Z)=>Z===tr||Z===ce||!W.equals(U)?W.multiplyUnsafe(Z):W.multiply(Z),tt=K(this,N).add(K(I,D));return tt.is0()?void 0:tt}toAffine(I){return v(this,I)}isTorsionFree(){let{h:I,isTorsionFree:N}=t;if(I===ce)return!0;if(N)return N(_,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:I,clearCofactor:N}=t;return I===ce?this:N?N(_,this):this.multiplyUnsafe(t.h)}toRawBytes(I=!0){return Ce("isCompressed",I),this.assertValidity(),o(_,this,I)}toHex(I=!0){return Ce("isCompressed",I),Ze(this.toRawBytes(I))}}_.BASE=new _(t.Gx,t.Gy,e.ONE),_.ZERO=new _(e.ZERO,e.ONE,e.ZERO);let E=t.nBitLength,F=zi(_,t.endo?Math.ceil(E/2):E);return{CURVE:t,ProjectivePoint:_,normPrivateKeyToScalar:m,weierstrassEquation:h,isWithinCurveOrder:w}}function c0(r){let t=Jn(r);return Fe(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Ec(r){let t=c0(r),{Fp:e,n}=t,o=e.BYTES+1,u=2*e.BYTES+1;function h(i){return jt(i,n)}function w(i){return Ui(i,n)}let{ProjectivePoint:m,normPrivateKeyToScalar:x,weierstrassEquation:v,isWithinCurveOrder:B}=u0({...t,toBytes(i,a,c){let f=a.toAffine(),l=e.toBytes(f.x),g=Ye;return Ce("isCompressed",c),c?g(Uint8Array.from([a.hasEvenY()?2:3]),l):g(Uint8Array.from([4]),l,e.toBytes(f.y))},fromBytes(i){let a=i.length,c=i[0],f=i.subarray(1);if(a===o&&(c===2||c===3)){let l=je(f);if(!jn(l,ce,e.ORDER))throw new Error("Point is not on curve");let g=v(l),b;try{b=e.sqrt(g)}catch(p){let S=p instanceof Error?": "+p.message:"";throw new Error("Point is not on curve"+S)}let d=(b&ce)===ce;return(c&1)===1!==d&&(b=e.neg(b)),{x:l,y:b}}else if(a===u&&c===4){let l=e.fromBytes(f.subarray(0,e.BYTES)),g=e.fromBytes(f.subarray(e.BYTES,2*e.BYTES));return{x:l,y:g}}else{let l=o,g=u;throw new Error("invalid Point, expected length of "+l+", or uncompressed "+g+", got "+a)}}}),_=i=>Ze(dr(i,t.nByteLength));function E(i){let a=n>>ce;return i>a}function F(i){return E(i)?h(-i):i}let R=(i,a,c)=>je(i.slice(a,c));class I{constructor(a,c,f){this.r=a,this.s=c,this.recovery=f,this.assertValidity()}static fromCompact(a){let c=t.nByteLength;return a=ne("compactSignature",a,c*2),new I(R(a,0,c),R(a,c,2*c))}static fromDER(a){let{r:c,s:f}=Qe.toSig(ne("DER",a));return new I(c,f)}assertValidity(){Se("r",this.r,ce,n),Se("s",this.s,ce,n)}addRecoveryBit(a){return new I(this.r,this.s,a)}recoverPublicKey(a){let{r:c,s:f,recovery:l}=this,g=W(ne("msgHash",a));if(l==null||![0,1,2,3].includes(l))throw new Error("recovery id invalid");let b=l===2||l===3?c+t.n:c;if(b>=e.ORDER)throw new Error("recovery id 2 or 3 invalid");let d=l&1?"03":"02",s=m.fromHex(d+_(b)),p=w(b),S=h(-g*p),L=h(f*p),T=m.BASE.multiplyAndAddUnsafe(s,S,L);if(!T)throw new Error("point at infinify");return T.assertValidity(),T}hasHighS(){return E(this.s)}normalizeS(){return this.hasHighS()?new I(this.r,h(-this.s),this.recovery):this}toDERRawBytes(){return Jr(this.toDERHex())}toDERHex(){return Qe.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Jr(this.toCompactHex())}toCompactHex(){return _(this.r)+_(this.s)}}let N={isValidPrivateKey(i){try{return x(i),!0}catch{return!1}},normPrivateKeyToScalar:x,randomPrivateKey:()=>{let i=hs(t.n);return cu(t.randomBytes(i),t.n)},precompute(i=8,a=m.BASE){return a._setWindowSize(i),a.multiply(BigInt(3)),a}};function D(i,a=!0){return m.fromPrivateKey(i).toRawBytes(a)}function U(i){let a=hr(i),c=typeof i=="string",f=(a||c)&&i.length;return a?f===o||f===u:c?f===2*o||f===2*u:i instanceof m}function K(i,a,c=!0){if(U(i))throw new Error("first arg must be private key");if(!U(a))throw new Error("second arg must be public key");return m.fromHex(a).multiply(x(i)).toRawBytes(c)}let tt=t.bits2int||function(i){if(i.length>8192)throw new Error("input is too large");let a=je(i),c=i.length*8-t.nBitLength;return c>0?a>>BigInt(c):a},W=t.bits2int_modN||function(i){return h(tt(i))},Z=Yn(t.nBitLength);function et(i){return Se("num < 2^"+t.nBitLength,i,tr,Z),dr(i,t.nByteLength)}function Q(i,a,c=$t){if(["recovered","canonical"].some($=>$ in c))throw new Error("sign() legacy options not supported");let{hash:f,randomBytes:l}=t,{lowS:g,prehash:b,extraEntropy:d}=c;g==null&&(g=!0),i=ne("msgHash",i),Bc(c),b&&(i=ne("prehashed msgHash",f(i)));let s=W(i),p=x(a),S=[et(p),et(s)];if(d!=null&&d!==!1){let $=d===!0?l(e.BYTES):d;S.push(ne("extraEntropy",$))}let L=Ye(...S),T=s;function q($){let G=tt($);if(!B(G))return;let Dt=w(G),J=m.BASE.multiply(G).toAffine(),X=h(J.x);if(X===tr)return;let de=h(Dt*h(T+X*p));if(de===tr)return;let it=(J.x===X?0:2)|Number(J.y&ce),st=de;return g&&E(de)&&(st=F(de),it^=1),new I(X,st,it)}return{seed:L,k2sig:q}}let $t={lowS:t.lowS,prehash:!1},V={lowS:t.lowS,prehash:!1};function nt(i,a,c=$t){let{seed:f,k2sig:l}=Q(i,a,c),g=t;return as(g.hash.outputLen,g.nByteLength,g.hmac)(f,l)}m.BASE._setWindowSize(8);function y(i,a,c,f=V){let l=i;a=ne("msgHash",a),c=ne("publicKey",c);let{lowS:g,prehash:b,format:d}=f;if(Bc(f),"strict"in f)throw new Error("options.strict was renamed to lowS");if(d!==void 0&&d!=="compact"&&d!=="der")throw new Error("format must be compact or der");let s=typeof l=="string"||hr(l),p=!s&&!d&&typeof l=="object"&&l!==null&&typeof l.r=="bigint"&&typeof l.s=="bigint";if(!s&&!p)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let S,L;try{if(p&&(S=new I(l.r,l.s)),s){try{d!=="compact"&&(S=I.fromDER(l))}catch(it){if(!(it instanceof Qe.Err))throw it}!S&&d!=="der"&&(S=I.fromCompact(l))}L=m.fromHex(c)}catch{return!1}if(!S||g&&S.hasHighS())return!1;b&&(a=t.hash(a));let{r:T,s:q}=S,$=W(a),G=w(q),Dt=h($*G),J=h(T*G),X=m.BASE.multiplyAndAddUnsafe(L,Dt,J)?.toAffine();return X?h(X.x)===T:!1}return{CURVE:t,getPublicKey:D,getSharedSecret:K,sign:nt,verify:y,ProjectivePoint:m,Signature:I,utils:N}}var mg,s0,a0,js,Qe,tr,ce,pg,Sc,yg,Ic=wt(()=>{mg=P(O(),1);gs();xn();tn();tn();({bytesToNumberBE:s0,hexToBytes:a0}=Oi),js=class extends Error{constructor(t=""){super(t)}},Qe={Err:js,_tlv:{encode:(r,t)=>{let{Err:e}=Qe;if(r<0||r>256)throw new e("tlv.encode: wrong tag");if(t.length&1)throw new e("tlv.encode: unpadded data");let n=t.length/2,o=Yr(n);if(o.length/2&128)throw new e("tlv.encode: long form length too big");let u=n>127?Yr(o.length/2|128):"";return Yr(r)+u+o+t},decode(r,t){let{Err:e}=Qe,n=0;if(r<0||r>256)throw new e("tlv.encode: wrong tag");if(t.length<2||t[n++]!==r)throw new e("tlv.decode: wrong tlv");let o=t[n++],u=!!(o&128),h=0;if(!u)h=o;else{let m=o&127;if(!m)throw new e("tlv.decode(long): indefinite length not supported");if(m>4)throw new e("tlv.decode(long): byte length is too big");let x=t.subarray(n,n+m);if(x.length!==m)throw new e("tlv.decode: length bytes not complete");if(x[0]===0)throw new e("tlv.decode(long): zero leftmost byte");for(let v of x)h=h<<8|v;if(n+=m,h<128)throw new e("tlv.decode(long): not minimal encoding")}let w=t.subarray(n,n+h);if(w.length!==h)throw new e("tlv.decode: wrong value length");return{v:w,l:t.subarray(n+h)}}},_int:{encode(r){let{Err:t}=Qe;if(rZs(r,t,Go(...e)),randomBytes:Ri}}function _c(r,t){let e=n=>Ec({...r,...f0(n)});return{...e(t),create:e}}var kg,Ac=wt(()=>{kg=P(O(),1);kc();ur();Ic();});function l0(r){let t=Rc,e=BigInt(3),n=BigInt(6),o=BigInt(11),u=BigInt(22),h=BigInt(23),w=BigInt(44),m=BigInt(88),x=r*r*r%t,v=x*x*r%t,B=ee(v,e,t)*v%t,_=ee(B,e,t)*v%t,E=ee(_,Ys,t)*x%t,F=ee(E,o,t)*E%t,R=ee(F,u,t)*F%t,I=ee(R,w,t)*R%t,N=ee(I,m,t)*I%t,D=ee(N,w,t)*R%t,U=ee(D,e,t)*v%t,K=ee(U,h,t)*F%t,tt=ee(K,n,t)*x%t,W=ee(tt,Ys,t);if(!Js.eql(Js.sqr(W),r))throw new Error("Cannot find square root");return W}var Mg,Rc,Mc,h0,Ys,Lc,Js,li,Ig,_g,Tc=wt(()=>{Mg=P(O(),1);Bs();Ac();xn();Rc=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Mc=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h0=BigInt(1),Ys=BigInt(2),Lc=(r,t)=>(r+t/Ys)/t;Js=pr(Rc,void 0,void 0,{sqrt:l0}),li=_c({a:BigInt(0),b:BigInt(7),Fp:Js,n:Mc,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let t=Mc,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-h0*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),u=e,h=BigInt("0x100000000000000000000000000000000"),w=Lc(u*r,t),m=Lc(-n*r,t),x=jt(r-w*e-m*o,t),v=jt(-w*n-m*u,t),B=x>h,_=v>h;if(B&&(x=t-x),_&&(v=t-v),x>h||v>h)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:B,k1:x,k2neg:_,k2:v}}}},Xn),Ig=BigInt(0),_g=li.ProjectivePoint});function Cc(r){try{return rn.ExtendedPoint.fromHex(r),!0}catch{return!1}}function g0(r){return r._bn!==void 0}function jc(r,t){let e=o=>{if(o.span>=0)return o.span;if(typeof o.alloc=="function")return o.alloc(t[o.property]);if("count"in o&&"elementLayout"in o){let u=t[o.property];if(Array.isArray(u))return u.length*e(o.elementLayout)}else if("fields"in o)return jc({layout:o},t[o.property]);return 0},n=0;return r.layout.fields.forEach(o=>{n+=e(o)}),n}function yi(r){let t=0,e=0;for(;;){let n=r.shift();if(t|=(n&127)<>=7,e==0){r.push(n);break}else n|=128,r.push(n)}}function se(r,t){if(!r)throw new Error(t||"Assertion failed")}function Io(r){if(r.length===0)throw new Error(Yc);return r.shift()}function mi(r,...t){let[e]=t;if(t.length===2?e+(t[1]??0)>r.length:e>=r.length)throw new Error(Yc);return r.splice(...t)}async function Uc(r,t,e,n){let o=n&&{skipPreflight:n.skipPreflight,preflightCommitment:n.preflightCommitment||n.commitment,maxRetries:n.maxRetries,minContextSlot:n.minContextSlot},u=await r.sendTransaction(t,e,o),h;if(t.recentBlockhash!=null&&t.lastValidBlockHeight!=null)h=(await r.confirmTransaction({abortSignal:n?.abortSignal,signature:u,blockhash:t.recentBlockhash,lastValidBlockHeight:t.lastValidBlockHeight},n&&n.commitment)).value;else if(t.minNonceContextSlot!=null&&t.nonceInfo!=null){let{nonceInstruction:w}=t.nonceInfo,m=w.keys[0].pubkey;h=(await r.confirmTransaction({abortSignal:n?.abortSignal,minContextSlot:t.minNonceContextSlot,nonceAccountPubkey:m,nonceValue:t.nonceInfo.nonce,signature:u},n&&n.commitment)).value}else n?.abortSignal!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),h=(await r.confirmTransaction(u,n&&n.commitment)).value;if(h.err)throw u!=null?new ua({action:"send",signature:u,transactionMessage:`Status: (${JSON.stringify(h)})`}):new Error(`Transaction ${u} failed (${JSON.stringify(h)})`);return u}function _0(r){return new Promise(t=>setTimeout(t,r))}function Wt(r,t){let e=r.layout.span>=0?r.layout.span:jc(r,t),n=ot.Buffer.alloc(e),o=Object.assign({instruction:r.index},t);return r.layout.encode(o,n),n}function Xc(r){return ye([z({jsonrpc:re("2.0"),id:H(),result:r}),z({jsonrpc:re("2.0"),id:H(),error:z({code:un(),message:H(),data:rt(zu())})})])}function Qt(r){return An(Xc(r),P0,t=>"error"in t?t:{...t,result:_n(t.result,r)})}function Te(r){return Qt(z({context:z({slot:A()}),value:r}))}function Po(r){return z({context:z({slot:A()}),value:r})}var Jm,ot,ra,_e,Cn,k,$c,Bi,d0,zg,Pc,na,Vc,p0,Gt,ia,Ao,Gc,y0,wi,Oc,at,qg,Mo,m0,Zc,oa,sa,aa,Lo,Ht,Ln,w0,b0,v0,x0,bi,Yc,fn,k0,Xt,Jt,B0,S0,E0,I0,er,Fg,Kg,Xs,vi,Dg,Wg,Hg,Qs,ua,A0,M0,Nc,L0,R0,Rn,Re,fe,T0,Tn,$g,Vg,Gg,ie,Jc,la,Zg,P0,C0,jg,O0,U0,N0,z0,q0,hn,F0,K0,Yg,D0,W0,Jg,Xg,Qg,tm,em,rm,nm,im,om,sm,H0,am,um,ca,cm,fm,da,hm,$0,V0,lm,dm,pm,ym,gm,G0,mm,Z0,wm,j0,bm,vm,xm,km,zc,Bm,Y0,J0,Sm,Em,Qc,pa,tf,ef,rf,nf,X0,Q0,of,sf,Ro,af,Co,ya,On,ln,Im,_m,Am,Mm,Lm,Rm,Tm,Pm,Cm,Om,Um,Nm,zm,td,qm,Fm,Km,Dm,ed,Wm,rr,di,fa,_o,ha,qc,Fc,Kc,Dc,xi,rd,nd,Wc,ta,Hc,id,ea,cn,uf,od,ki,Br,Hm,To,pi,$m,Pn,Vm,Gm,Zm,jm,cf=wt(()=>{Jm=P(O()),ot=P(mn());mu();ra=P(bu()),_e=P(xs());Bs();Cn=P(Pu()),k=P(Ps()),$c=P(Ps()),Bi=P(Cu());qu();d0=P(cc());pc();xc();Tc();zg=rn.utils.randomPrivateKey,Pc=()=>{let r=rn.utils.randomPrivateKey(),t=na(r),e=new Uint8Array(64);return e.set(r),e.set(t,32),{publicKey:t,secretKey:e}},na=rn.getPublicKey;Vc=(r,t)=>rn.sign(r,t.slice(0,32)),p0=rn.verify,Gt=r=>ot.Buffer.isBuffer(r)?r:r instanceof Uint8Array?ot.Buffer.from(r.buffer,r.byteOffset,r.byteLength):ot.Buffer.from(r),ia=class{constructor(t){Object.assign(this,t)}encode(){return ot.Buffer.from((0,Cn.serialize)(Ao,this))}static decode(t){return(0,Cn.deserialize)(Ao,this,t)}static decodeUnchecked(t){return(0,Cn.deserializeUnchecked)(Ao,this,t)}},Ao=new Map,y0=32,wi=32;Oc=1,at=class extends ia{constructor(t){if(super({}),this._bn=void 0,g0(t))this._bn=t._bn;else{if(typeof t=="string"){let e=_e.default.decode(t);if(e.length!=wi)throw new Error("Invalid public key input");this._bn=new ra.default(e)}else this._bn=new ra.default(t);if(this._bn.byteLength()>wi)throw new Error("Invalid public key input")}}static unique(){let t=new at(Oc);return Oc+=1,new at(t.toBuffer())}equals(t){return this._bn.eq(t._bn)}toBase58(){return _e.default.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){let t=this.toBuffer();return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}toBuffer(){let t=this._bn.toArrayLike(ot.Buffer);if(t.length===wi)return t;let e=ot.Buffer.alloc(32);return t.copy(e,32-t.length),e}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(t,e,n){let o=ot.Buffer.concat([t.toBuffer(),ot.Buffer.from(e),n.toBuffer()]),u=Xn(o);return new at(u)}static createProgramAddressSync(t,e){let n=ot.Buffer.alloc(0);t.forEach(function(u){if(u.length>y0)throw new TypeError("Max seed length exceeded");n=ot.Buffer.concat([n,Gt(u)])}),n=ot.Buffer.concat([n,e.toBuffer(),ot.Buffer.from("ProgramDerivedAddress")]);let o=Xn(n);if(Cc(o))throw new Error("Invalid seeds, address must fall off the curve");return new at(o)}static async createProgramAddress(t,e){return this.createProgramAddressSync(t,e)}static findProgramAddressSync(t,e){let n=255,o;for(;n!=0;){try{let u=t.concat(ot.Buffer.from([n]));o=this.createProgramAddressSync(u,e)}catch(u){if(u instanceof TypeError)throw u;n--;continue}return[o,n]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(t,e){return this.findProgramAddressSync(t,e)}static isOnCurve(t){let e=new at(t);return Cc(e.toBytes())}};Gc=at;at.default=new Gc("11111111111111111111111111111111");Ao.set(at,{kind:"struct",fields:[["_bn","u256"]]});qg=new at("BPFLoader1111111111111111111111111111111111"),Mo=1280-40-8,m0=127,Zc=64,oa=class extends Error{constructor(t){super(`Signature ${t} has expired: block height exceeded.`),this.signature=void 0,this.signature=t}};Object.defineProperty(oa.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});sa=class extends Error{constructor(t,e){super(`Transaction was not confirmed in ${e.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${t} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=t}};Object.defineProperty(sa.prototype,"name",{value:"TransactionExpiredTimeoutError"});aa=class extends Error{constructor(t){super(`Signature ${t} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=t}};Object.defineProperty(aa.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});Lo=class{constructor(t,e){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=e}keySegments(){let t=[this.staticAccountKeys];return this.accountKeysFromLookups&&(t.push(this.accountKeysFromLookups.writable),t.push(this.accountKeysFromLookups.readonly)),t}get(t){for(let e of this.keySegments()){if(t255+1)throw new Error("Account index overflow encountered during compilation");let n=new Map;this.keySegments().flat().forEach((u,h)=>{n.set(u.toBase58(),h)});let o=u=>{let h=n.get(u.toBase58());if(h===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return h};return t.map(u=>({programIdIndex:o(u.programId),accountKeyIndexes:u.keys.map(h=>o(h.pubkey)),data:u.data}))}},Ht=(r="publicKey")=>k.blob(32,r),Ln=(r="string")=>{let t=k.struct([k.u32("length"),k.u32("lengthPadding"),k.blob(k.offset(k.u32(),-8),"chars")],r),e=t.decode.bind(t),n=t.encode.bind(t),o=t;return o.decode=(u,h)=>e(u,h).chars.toString(),o.encode=(u,h,w)=>{let m={chars:ot.Buffer.from(u,"utf8")};return n(m,h,w)},o.alloc=u=>k.u32().span+k.u32().span+ot.Buffer.from(u,"utf8").length,o},w0=(r="authorized")=>k.struct([Ht("staker"),Ht("withdrawer")],r),b0=(r="lockup")=>k.struct([k.ns64("unixTimestamp"),k.ns64("epoch"),Ht("custodian")],r),v0=(r="voteInit")=>k.struct([Ht("nodePubkey"),Ht("authorizedVoter"),Ht("authorizedWithdrawer"),k.u8("commission")],r),x0=(r="voteAuthorizeWithSeedArgs")=>k.struct([k.u32("voteAuthorizationType"),Ht("currentAuthorityDerivedKeyOwnerPubkey"),Ln("currentAuthorityDerivedKeySeed"),Ht("newAuthorized")],r);bi=class{constructor(t,e){this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=e}static compile(t,e){let n=new Map,o=h=>{let w=h.toBase58(),m=n.get(w);return m===void 0&&(m={isSigner:!1,isWritable:!1,isInvoked:!1},n.set(w,m)),m},u=o(e);u.isSigner=!0,u.isWritable=!0;for(let h of t){o(h.programId).isInvoked=!0;for(let w of h.keys){let m=o(w.pubkey);m.isSigner||=w.isSigner,m.isWritable||=w.isWritable}}return new bi(e,n)}getMessageComponents(){let t=[...this.keyMetaMap.entries()];se(t.length<=256,"Max static account keys length exceeded");let e=t.filter(([,m])=>m.isSigner&&m.isWritable),n=t.filter(([,m])=>m.isSigner&&!m.isWritable),o=t.filter(([,m])=>!m.isSigner&&m.isWritable),u=t.filter(([,m])=>!m.isSigner&&!m.isWritable),h={numRequiredSignatures:e.length+n.length,numReadonlySignedAccounts:n.length,numReadonlyUnsignedAccounts:u.length};{se(e.length>0,"Expected at least one writable signer key");let[m]=e[0];se(m===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}let w=[...e.map(([m])=>new at(m)),...n.map(([m])=>new at(m)),...o.map(([m])=>new at(m)),...u.map(([m])=>new at(m))];return[h,w]}extractTableLookup(t){let[e,n]=this.drainKeysFoundInLookupTable(t.state.addresses,h=>!h.isSigner&&!h.isInvoked&&h.isWritable),[o,u]=this.drainKeysFoundInLookupTable(t.state.addresses,h=>!h.isSigner&&!h.isInvoked&&!h.isWritable);if(!(e.length===0&&o.length===0))return[{accountKey:t.key,writableIndexes:e,readonlyIndexes:o},{writable:n,readonly:u}]}drainKeysFoundInLookupTable(t,e){let n=new Array,o=new Array;for(let[u,h]of this.keyMetaMap.entries())if(e(h)){let w=new at(u),m=t.findIndex(x=>x.equals(w));m>=0&&(se(m<256,"Max lookup table index exceeded"),n.push(m),o.push(w),this.keyMetaMap.delete(u))}return[n,o]}},Yc="Reached end of buffer unexpectedly";fn=class{constructor(t){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map(e=>new at(e)),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach(e=>this.indexToProgramIds.set(e.programIdIndex,this.accountKeys[e.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:_e.default.decode(t.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new Lo(this.staticAccountKeys)}static compile(t){let e=bi.compile(t.instructions,t.payerKey),[n,o]=e.getMessageComponents(),h=new Lo(o).compileInstructions(t.instructions).map(w=>({programIdIndex:w.programIdIndex,accounts:w.accountKeyIndexes,data:_e.default.encode(w.data)}));return new fn({header:n,accountKeys:o,recentBlockhash:t.recentBlockhash,instructions:h})}isAccountSigner(t){return t=this.header.numRequiredSignatures){let n=t-e,u=this.accountKeys.length-e-this.header.numReadonlyUnsignedAccounts;return n!this.isProgramId(e))}serialize(){let t=this.accountKeys.length,e=[];gi(e,t);let n=this.instructions.map(B=>{let{accounts:_,programIdIndex:E}=B,F=Array.from(_e.default.decode(B.data)),R=[];gi(R,_.length);let I=[];return gi(I,F.length),{programIdIndex:E,keyIndicesCount:ot.Buffer.from(R),keyIndices:_,dataLength:ot.Buffer.from(I),data:F}}),o=[];gi(o,n.length);let u=ot.Buffer.alloc(Mo);ot.Buffer.from(o).copy(u);let h=o.length;n.forEach(B=>{let E=k.struct([k.u8("programIdIndex"),k.blob(B.keyIndicesCount.length,"keyIndicesCount"),k.seq(k.u8("keyIndex"),B.keyIndices.length,"keyIndices"),k.blob(B.dataLength.length,"dataLength"),k.seq(k.u8("userdatum"),B.data.length,"data")]).encode(B,u,h);h+=E}),u=u.slice(0,h);let w=k.struct([k.blob(1,"numRequiredSignatures"),k.blob(1,"numReadonlySignedAccounts"),k.blob(1,"numReadonlyUnsignedAccounts"),k.blob(e.length,"keyCount"),k.seq(Ht("key"),t,"keys"),Ht("recentBlockhash")]),m={numRequiredSignatures:ot.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:ot.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:ot.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:ot.Buffer.from(e),keys:this.accountKeys.map(B=>Gt(B.toBytes())),recentBlockhash:_e.default.decode(this.recentBlockhash)},x=ot.Buffer.alloc(2048),v=w.encode(m,x);return u.copy(x,v),x.slice(0,v+u.length)}static from(t){let e=[...t],n=Io(e);if(n!==(n&m0))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");let o=Io(e),u=Io(e),h=yi(e),w=[];for(let _=0;_({pubkey:t.toJSON(),isSigner:e,isWritable:n})),programId:this.programId.toJSON(),data:[...this.data]}}},Jt=class{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(t){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!!t)if(t.feePayer&&(this.feePayer=t.feePayer),t.signatures&&(this.signatures=t.signatures),Object.prototype.hasOwnProperty.call(t,"nonceInfo")){let{minContextSlot:e,nonceInfo:n}=t;this.minNonceContextSlot=e,this.nonceInfo=n}else if(Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")){let{blockhash:e,lastValidBlockHeight:n}=t;this.recentBlockhash=e,this.lastValidBlockHeight=n}else{let{recentBlockhash:e,nonceInfo:n}=t;n&&(this.nonceInfo=n),this.recentBlockhash=e}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(t=>t.toJSON()),signers:this.signatures.map(({publicKey:t})=>t.toJSON())}}add(...t){if(t.length===0)throw new Error("No instructions");return t.forEach(e=>{"instructions"in e?this.instructions=this.instructions.concat(e.instructions):"data"in e&&"programId"in e&&"keys"in e?this.instructions.push(e):this.instructions.push(new Xt(e))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let t,e;if(this.nonceInfo?(t=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?e=[this.nonceInfo.nonceInstruction,...this.instructions]:e=this.instructions):(t=this.recentBlockhash,e=this.instructions),!t)throw new Error("Transaction recentBlockhash required");e.length<1&&console.warn("No instructions provided");let n;if(this.feePayer)n=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)n=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let R=0;R{R.keys.forEach(N=>{u.push({...N})});let I=R.programId.toString();o.includes(I)||o.push(I)}),o.forEach(R=>{u.push({pubkey:new at(R),isSigner:!1,isWritable:!1})});let h=[];u.forEach(R=>{let I=R.pubkey.toString(),N=h.findIndex(D=>D.pubkey.toString()===I);N>-1?(h[N].isWritable=h[N].isWritable||R.isWritable,h[N].isSigner=h[N].isSigner||R.isSigner):h.push(R)}),h.sort(function(R,I){if(R.isSigner!==I.isSigner)return R.isSigner?-1:1;if(R.isWritable!==I.isWritable)return R.isWritable?-1:1;let N={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return R.pubkey.toBase58().localeCompare(I.pubkey.toBase58(),"en",N)});let w=h.findIndex(R=>R.pubkey.equals(n));if(w>-1){let[R]=h.splice(w,1);R.isSigner=!0,R.isWritable=!0,h.unshift(R)}else h.unshift({pubkey:n,isSigner:!0,isWritable:!0});for(let R of this.signatures){let I=h.findIndex(N=>N.pubkey.equals(R.publicKey));if(I>-1)h[I].isSigner||(h[I].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw new Error(`unknown signer: ${R.publicKey.toString()}`)}let m=0,x=0,v=0,B=[],_=[];h.forEach(({pubkey:R,isSigner:I,isWritable:N})=>{I?(B.push(R.toString()),m+=1,N||(x+=1)):(_.push(R.toString()),N||(v+=1))});let E=B.concat(_),F=e.map(R=>{let{data:I,programId:N}=R;return{programIdIndex:E.indexOf(N.toString()),accounts:R.keys.map(D=>E.indexOf(D.pubkey.toString())),data:_e.default.encode(I)}});return F.forEach(R=>{se(R.programIdIndex>=0),R.accounts.forEach(I=>se(I>=0))}),new fn({header:{numRequiredSignatures:m,numReadonlySignedAccounts:x,numReadonlyUnsignedAccounts:v},accountKeys:E,recentBlockhash:t,instructions:F})}_compile(){let t=this.compileMessage(),e=t.accountKeys.slice(0,t.header.numRequiredSignatures);return this.signatures.length===e.length&&this.signatures.every((o,u)=>e[u].equals(o.publicKey))||(this.signatures=e.map(n=>({signature:null,publicKey:n}))),t}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(t){return(await t.getFeeForMessage(this.compileMessage())).value}setSigners(...t){if(t.length===0)throw new Error("No signers");let e=new Set;this.signatures=t.filter(n=>{let o=n.toString();return e.has(o)?!1:(e.add(o),!0)}).map(n=>({signature:null,publicKey:n}))}sign(...t){if(t.length===0)throw new Error("No signers");let e=new Set,n=[];for(let u of t){let h=u.publicKey.toString();e.has(h)||(e.add(h),n.push(u))}this.signatures=n.map(u=>({signature:null,publicKey:u.publicKey}));let o=this._compile();this._partialSign(o,...n)}partialSign(...t){if(t.length===0)throw new Error("No signers");let e=new Set,n=[];for(let u of t){let h=u.publicKey.toString();e.has(h)||(e.add(h),n.push(u))}let o=this._compile();this._partialSign(o,...n)}_partialSign(t,...e){let n=t.serialize();e.forEach(o=>{let u=Vc(n,o.secretKey);this._addSignature(o.publicKey,Gt(u))})}addSignature(t,e){this._compile(),this._addSignature(t,e)}_addSignature(t,e){se(e.length===64);let n=this.signatures.findIndex(o=>t.equals(o.publicKey));if(n<0)throw new Error(`unknown signer: ${t.toString()}`);this.signatures[n].signature=ot.Buffer.from(e)}verifySignatures(t=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),t)}_getMessageSignednessErrors(t,e){let n={};for(let{signature:o,publicKey:u}of this.signatures)o===null?e&&(n.missing||=[]).push(u):p0(o,t,u.toBytes())||(n.invalid||=[]).push(u);return n.invalid||n.missing?n:void 0}serialize(t){let{requireAllSignatures:e,verifySignatures:n}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},t),o=this.serializeMessage();if(n){let u=this._getMessageSignednessErrors(o,e);if(u){let h="Signature verification failed.";throw u.invalid&&(h+=`\nInvalid signature for public key${u.invalid.length===1?"":"(s)"} [\\`${u.invalid.map(w=>w.toBase58()).join("`, `")}\\`].`),u.missing&&(h+=`\nMissing signature for public key${u.missing.length===1?"":"(s)"} [\\`${u.missing.map(w=>w.toBase58()).join("`, `")}\\`].`),new Error(h)}}return this._serialize(o)}_serialize(t){let{signatures:e}=this,n=[];gi(n,e.length);let o=n.length+e.length*64+t.length,u=ot.Buffer.alloc(o);return se(e.length<256),ot.Buffer.from(n).copy(u,0),e.forEach(({signature:h},w)=>{h!==null&&(se(h.length===64,"signature has invalid length"),ot.Buffer.from(h).copy(u,n.length+w*64))}),t.copy(u,n.length+e.length*64),se(u.length<=Mo,`Transaction too large: ${u.length} > ${Mo}`),u}get keys(){return se(this.instructions.length===1),this.instructions[0].keys.map(t=>t.pubkey)}get programId(){return se(this.instructions.length===1),this.instructions[0].programId}get data(){return se(this.instructions.length===1),this.instructions[0].data}static from(t){let e=[...t],n=yi(e),o=[];for(let u=0;u0&&(n.feePayer=t.accountKeys[0]),e.forEach((o,u)=>{let h={signature:o==_e.default.encode(k0)?null:_e.default.decode(o),publicKey:t.accountKeys[u]};n.signatures.push(h)}),t.instructions.forEach(o=>{let u=o.accounts.map(h=>{let w=t.accountKeys[h];return{pubkey:w,isSigner:n.signatures.some(m=>m.publicKey.toString()===w.toString())||t.isAccountSigner(h),isWritable:t.isAccountWritable(h)}});n.instructions.push(new Xt({keys:u,programId:t.accountKeys[o.programIdIndex],data:_e.default.decode(o.data)}))}),n._message=t,n._json=n.toJSON(),n}},B0=160,S0=64,E0=B0/S0,I0=1e3/E0,er=new at("SysvarC1ock11111111111111111111111111111111"),Fg=new at("SysvarEpochSchedu1e111111111111111111111111"),Kg=new at("Sysvar1nstructions1111111111111111111111111"),Xs=new at("SysvarRecentB1ockHashes11111111111111111111"),vi=new at("SysvarRent111111111111111111111111111111111"),Dg=new at("SysvarRewards111111111111111111111111111111"),Wg=new at("SysvarS1otHashes111111111111111111111111111"),Hg=new at("SysvarS1otHistory11111111111111111111111111"),Qs=new at("SysvarStakeHistory1111111111111111111111111"),ua=class extends Error{constructor({action:t,signature:e,transactionMessage:n,logs:o}){let u=o?`Logs: \n${JSON.stringify(o.slice(-10),null,2)}. `:"",h="\\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.",w;switch(t){case"send":w=`Transaction ${e} resulted in an error. \n${n}. `+u+h;break;case"simulate":w=`Simulation failed. \nMessage: ${n}. \n`+u+h;break;default:w=`Unknown action \'${(m=>m)(t)}\'`}super(w),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=e,this.transactionMessage=n,this.transactionLogs=o||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){let t=this.transactionLogs;if(!(t!=null&&typeof t=="object"&&"then"in t))return t}async getLogs(t){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((e,n)=>{t.getTransaction(this.signature).then(o=>{if(o&&o.meta&&o.meta.logMessages){let u=o.meta.logMessages;this.transactionLogs=u,e(u)}else n(new Error("Log messages not found"))}).catch(n)})),await this.transactionLogs}};A0=k.nu64("lamportsPerSignature"),M0=k.struct([k.u32("version"),k.u32("state"),Ht("authorizedPubkey"),Ht("nonce"),k.struct([A0],"feeCalculator")]),Nc=M0.span,L0=r=>{let t=r.decode.bind(r),e=r.encode.bind(r);return{decode:t,encode:e}},R0=r=>t=>{let e=(0,$c.blob)(r,t),{encode:n,decode:o}=L0(e),u=e;return u.decode=(h,w)=>{let m=o(h,w);return(0,Bi.toBigIntLE)(ot.Buffer.from(m))},u.encode=(h,w,m)=>{let x=(0,Bi.toBufferLE)(h,r);return n(x,w,m)},u},Rn=R0(8),Re=Object.freeze({Create:{index:0,layout:k.struct([k.u32("instruction"),k.ns64("lamports"),k.ns64("space"),Ht("programId")])},Assign:{index:1,layout:k.struct([k.u32("instruction"),Ht("programId")])},Transfer:{index:2,layout:k.struct([k.u32("instruction"),Rn("lamports")])},CreateWithSeed:{index:3,layout:k.struct([k.u32("instruction"),Ht("base"),Ln("seed"),k.ns64("lamports"),k.ns64("space"),Ht("programId")])},AdvanceNonceAccount:{index:4,layout:k.struct([k.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:k.struct([k.u32("instruction"),k.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:k.struct([k.u32("instruction"),Ht("authorized")])},AuthorizeNonceAccount:{index:7,layout:k.struct([k.u32("instruction"),Ht("authorized")])},Allocate:{index:8,layout:k.struct([k.u32("instruction"),k.ns64("space")])},AllocateWithSeed:{index:9,layout:k.struct([k.u32("instruction"),Ht("base"),Ln("seed"),k.ns64("space"),Ht("programId")])},AssignWithSeed:{index:10,layout:k.struct([k.u32("instruction"),Ht("base"),Ln("seed"),Ht("programId")])},TransferWithSeed:{index:11,layout:k.struct([k.u32("instruction"),Rn("lamports"),Ln("seed"),Ht("programId")])},UpgradeNonceAccount:{index:12,layout:k.struct([k.u32("instruction")])}}),fe=class{constructor(){}static createAccount(t){let e=Re.Create,n=Wt(e,{lamports:t.lamports,space:t.space,programId:Gt(t.programId.toBuffer())});return new Xt({keys:[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:n})}static transfer(t){let e,n;if("basePubkey"in t){let o=Re.TransferWithSeed;e=Wt(o,{lamports:BigInt(t.lamports),seed:t.seed,programId:Gt(t.programId.toBuffer())}),n=[{pubkey:t.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]}else{let o=Re.Transfer;e=Wt(o,{lamports:BigInt(t.lamports)}),n=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]}return new Xt({keys:n,programId:this.programId,data:e})}static assign(t){let e,n;if("basePubkey"in t){let o=Re.AssignWithSeed;e=Wt(o,{base:Gt(t.basePubkey.toBuffer()),seed:t.seed,programId:Gt(t.programId.toBuffer())}),n=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]}else{let o=Re.Assign;e=Wt(o,{programId:Gt(t.programId.toBuffer())}),n=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]}return new Xt({keys:n,programId:this.programId,data:e})}static createAccountWithSeed(t){let e=Re.CreateWithSeed,n=Wt(e,{base:Gt(t.basePubkey.toBuffer()),seed:t.seed,lamports:t.lamports,space:t.space,programId:Gt(t.programId.toBuffer())}),o=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!1,isWritable:!0}];return t.basePubkey.equals(t.fromPubkey)||o.push({pubkey:t.basePubkey,isSigner:!0,isWritable:!1}),new Xt({keys:o,programId:this.programId,data:n})}static createNonceAccount(t){let e=new Jt;"basePubkey"in t&&"seed"in t?e.add(fe.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:Nc,programId:this.programId})):e.add(fe.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:Nc,programId:this.programId}));let n={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return e.add(this.nonceInitialize(n)),e}static nonceInitialize(t){let e=Re.InitializeNonceAccount,n=Wt(e,{authorized:Gt(t.authorizedPubkey.toBuffer())}),o={keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Xs,isSigner:!1,isWritable:!1},{pubkey:vi,isSigner:!1,isWritable:!1}],programId:this.programId,data:n};return new Xt(o)}static nonceAdvance(t){let e=Re.AdvanceNonceAccount,n=Wt(e),o={keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Xs,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:n};return new Xt(o)}static nonceWithdraw(t){let e=Re.WithdrawNonceAccount,n=Wt(e,{lamports:t.lamports});return new Xt({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0},{pubkey:Xs,isSigner:!1,isWritable:!1},{pubkey:vi,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}static nonceAuthorize(t){let e=Re.AuthorizeNonceAccount,n=Wt(e,{authorized:Gt(t.newAuthorizedPubkey.toBuffer())});return new Xt({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}static allocate(t){let e,n;if("basePubkey"in t){let o=Re.AllocateWithSeed;e=Wt(o,{base:Gt(t.basePubkey.toBuffer()),seed:t.seed,space:t.space,programId:Gt(t.programId.toBuffer())}),n=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]}else{let o=Re.Allocate;e=Wt(o,{space:t.space}),n=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]}return new Xt({keys:n,programId:this.programId,data:e})}};fe.programId=new at("11111111111111111111111111111111");T0=Mo-300,Tn=class{constructor(){}static getMinNumSignatures(t){return 2*(Math.ceil(t/Tn.chunkSize)+1+1)}static async load(t,e,n,o,u){{let B=await t.getMinimumBalanceForRentExemption(u.length),_=await t.getAccountInfo(n.publicKey,"confirmed"),E=null;if(_!==null){if(_.executable)return console.error("Program load failed, account is already executable"),!1;_.data.length!==u.length&&(E=E||new Jt,E.add(fe.allocate({accountPubkey:n.publicKey,space:u.length}))),_.owner.equals(o)||(E=E||new Jt,E.add(fe.assign({accountPubkey:n.publicKey,programId:o}))),_.lamports0?B:1,space:u.length,programId:o}));E!==null&&await Uc(t,E,[e,n],{commitment:"confirmed"})}let h=k.struct([k.u32("instruction"),k.u32("offset"),k.u32("bytesLength"),k.u32("bytesLengthPadding"),k.seq(k.u8("byte"),k.offset(k.u32(),-8),"bytes")]),w=Tn.chunkSize,m=0,x=u,v=[];for(;x.length>0;){let B=x.slice(0,w),_=ot.Buffer.alloc(w+16);h.encode({instruction:0,offset:m,bytes:B,bytesLength:0,bytesLengthPadding:0},_);let E=new Jt().add({keys:[{pubkey:n.publicKey,isSigner:!0,isWritable:!0}],programId:o,data:_});v.push(Uc(t,E,[e,n],{commitment:"confirmed"})),t._rpcEndpoint.includes("solana.com")&&await _0(1e3/4),m+=w,x=x.slice(w)}await Promise.all(v);{let B=k.struct([k.u32("instruction")]),_=ot.Buffer.alloc(B.span);B.encode({instruction:1},_);let E=new Jt().add({keys:[{pubkey:n.publicKey,isSigner:!0,isWritable:!0},{pubkey:vi,isSigner:!1,isWritable:!1}],programId:o,data:_}),F="processed",R=await t.sendTransaction(E,[e,n],{preflightCommitment:F}),{context:I,value:N}=await t.confirmTransaction({signature:R,lastValidBlockHeight:E.lastValidBlockHeight,blockhash:E.recentBlockhash},F);if(N.err)throw new Error(`Transaction ${R} failed (${JSON.stringify(N)})`);for(;;){try{if(await t.getSlot({commitment:F})>I.slot)break}catch{}await new Promise(D=>setTimeout(D,Math.round(I0/2)))}}return!0}};Tn.chunkSize=T0;$g=new at("BPFLoader2111111111111111111111111111111111"),Vg=globalThis.fetch,Gg={index:1,layout:k.struct([k.u32("typeIndex"),Rn("deactivationSlot"),k.nu64("lastExtendedSlot"),k.u8("lastExtendedStartIndex"),k.u8(),k.seq(Ht(),k.offset(k.u8(),-1),"authority")])},ie=An(mo(at),H(),r=>new at(r)),Jc=wo([H(),re("base64")]),la=An(mo(ot.Buffer),Jc,r=>ot.Buffer.from(r[0],"base64")),Zg=30*1e3;P0=Xc(un());C0=z({foundation:A(),foundationTerm:A(),initial:A(),taper:A(),terminal:A()}),jg=Qt(j(Y(z({epoch:A(),effectiveSlot:A(),amount:A(),postBalance:A(),commission:rt(Y(A()))})))),O0=j(z({slot:A(),prioritizationFee:A()})),U0=z({total:A(),validator:A(),foundation:A(),epoch:A()}),N0=z({epoch:A(),slotIndex:A(),slotsInEpoch:A(),absoluteSlot:A(),blockHeight:rt(A()),transactionCount:rt(A())}),z0=z({slotsPerEpoch:A(),leaderScheduleSlotOffset:A(),warmup:Ne(),firstNormalEpoch:A(),firstNormalSlot:A()}),q0=Us(H(),j(A())),hn=Y(ye([z({}),H()])),F0=z({err:hn}),K0=re("receivedSignature"),Yg=z({"solana-core":H(),"feature-set":rt(A())}),D0=z({program:H(),programId:ie,parsed:un()}),W0=z({programId:ie,accounts:j(ie),data:H()}),Jg=Te(z({err:Y(ye([z({}),H()])),logs:Y(j(H())),accounts:rt(Y(j(Y(z({executable:Ne(),owner:H(),lamports:A(),data:j(H()),rentEpoch:rt(A())}))))),unitsConsumed:rt(A()),returnData:rt(Y(z({programId:H(),data:wo([H(),re("base64")])}))),innerInstructions:rt(Y(j(z({index:A(),instructions:j(ye([D0,W0]))}))))})),Xg=Te(z({byIdentity:Us(H(),j(A())),range:z({firstSlot:A(),lastSlot:A()})})),Qg=Qt(C0),tm=Qt(U0),em=Qt(O0),rm=Qt(N0),nm=Qt(z0),im=Qt(q0),om=Qt(A()),sm=Te(z({total:A(),circulating:A(),nonCirculating:A(),nonCirculatingAccounts:j(ie)})),H0=z({amount:H(),uiAmount:Y(A()),decimals:A(),uiAmountString:rt(H())}),am=Te(j(z({address:ie,amount:H(),uiAmount:Y(A()),decimals:A(),uiAmountString:rt(H())}))),um=Te(j(z({pubkey:ie,account:z({executable:Ne(),owner:ie,lamports:A(),data:la,rentEpoch:A()})}))),ca=z({program:H(),parsed:un(),space:A()}),cm=Te(j(z({pubkey:ie,account:z({executable:Ne(),owner:ie,lamports:A(),data:ca,rentEpoch:A()})}))),fm=Te(j(z({lamports:A(),address:ie}))),da=z({executable:Ne(),owner:ie,lamports:A(),data:la,rentEpoch:A()}),hm=z({pubkey:ie,account:da}),$0=An(ye([mo(ot.Buffer),ca]),ye([Jc,ca]),r=>Array.isArray(r)?_n(r,la):r),V0=z({executable:Ne(),owner:ie,lamports:A(),data:$0,rentEpoch:A()}),lm=z({pubkey:ie,account:V0}),dm=z({state:ye([re("active"),re("inactive"),re("activating"),re("deactivating")]),active:A(),inactive:A()}),pm=Qt(j(z({signature:H(),slot:A(),err:hn,memo:Y(H()),blockTime:rt(Y(A()))}))),ym=Qt(j(z({signature:H(),slot:A(),err:hn,memo:Y(H()),blockTime:rt(Y(A()))}))),gm=z({subscription:A(),result:Po(da)}),G0=z({pubkey:ie,account:da}),mm=z({subscription:A(),result:Po(G0)}),Z0=z({parent:A(),slot:A(),root:A()}),wm=z({subscription:A(),result:Z0}),j0=ye([z({type:ye([re("firstShredReceived"),re("completed"),re("optimisticConfirmation"),re("root")]),slot:A(),timestamp:A()}),z({type:re("createdBank"),parent:A(),slot:A(),timestamp:A()}),z({type:re("frozen"),slot:A(),timestamp:A(),stats:z({numTransactionEntries:A(),numSuccessfulTransactions:A(),numFailedTransactions:A(),maxTransactionsPerEntry:A()})}),z({type:re("dead"),slot:A(),timestamp:A(),err:H()})]),bm=z({subscription:A(),result:j0}),vm=z({subscription:A(),result:Po(ye([F0,K0]))}),xm=z({subscription:A(),result:A()}),km=z({pubkey:H(),gossip:Y(H()),tpu:Y(H()),rpc:Y(H()),version:Y(H())}),zc=z({votePubkey:H(),nodePubkey:H(),activatedStake:A(),epochVoteAccount:Ne(),epochCredits:j(wo([A(),A(),A()])),commission:A(),lastVote:A(),rootSlot:Y(A())}),Bm=Qt(z({current:j(zc),delinquent:j(zc)})),Y0=ye([re("processed"),re("confirmed"),re("finalized")]),J0=z({slot:A(),confirmations:Y(A()),err:hn,confirmationStatus:rt(Y0)}),Sm=Te(j(Y(J0))),Em=Qt(A()),Qc=z({accountKey:ie,writableIndexes:j(A()),readonlyIndexes:j(A())}),pa=z({signatures:j(H()),message:z({accountKeys:j(H()),header:z({numRequiredSignatures:A(),numReadonlySignedAccounts:A(),numReadonlyUnsignedAccounts:A()}),instructions:j(z({accounts:j(A()),data:H(),programIdIndex:A()})),recentBlockhash:H(),addressTableLookups:rt(j(Qc))})}),tf=z({pubkey:ie,signer:Ne(),writable:Ne(),source:rt(ye([re("transaction"),re("lookupTable")]))}),ef=z({accountKeys:j(tf),signatures:j(H())}),rf=z({parsed:un(),program:H(),programId:ie}),nf=z({accounts:j(ie),data:H(),programId:ie}),X0=ye([nf,rf]),Q0=ye([z({parsed:un(),program:H(),programId:H()}),z({accounts:j(H()),data:H(),programId:H()})]),of=An(X0,Q0,r=>"accounts"in r?_n(r,nf):_n(r,rf)),sf=z({signatures:j(H()),message:z({accountKeys:j(tf),instructions:j(of),recentBlockhash:H(),addressTableLookups:rt(Y(j(Qc)))})}),Ro=z({accountIndex:A(),mint:H(),owner:rt(H()),uiTokenAmount:H0}),af=z({writable:j(ie),readonly:j(ie)}),Co=z({err:hn,fee:A(),innerInstructions:rt(Y(j(z({index:A(),instructions:j(z({accounts:j(A()),data:H(),programIdIndex:A()}))})))),preBalances:j(A()),postBalances:j(A()),logMessages:rt(Y(j(H()))),preTokenBalances:rt(Y(j(Ro))),postTokenBalances:rt(Y(j(Ro))),loadedAddresses:rt(af),computeUnitsConsumed:rt(A())}),ya=z({err:hn,fee:A(),innerInstructions:rt(Y(j(z({index:A(),instructions:j(of)})))),preBalances:j(A()),postBalances:j(A()),logMessages:rt(Y(j(H()))),preTokenBalances:rt(Y(j(Ro))),postTokenBalances:rt(Y(j(Ro))),loadedAddresses:rt(af),computeUnitsConsumed:rt(A())}),On=ye([re(0),re("legacy")]),ln=z({pubkey:H(),lamports:A(),postBalance:Y(A()),rewardType:Y(H()),commission:rt(Y(A()))}),Im=Qt(Y(z({blockhash:H(),previousBlockhash:H(),parentSlot:A(),transactions:j(z({transaction:pa,meta:Y(Co),version:rt(On)})),rewards:rt(j(ln)),blockTime:Y(A()),blockHeight:Y(A())}))),_m=Qt(Y(z({blockhash:H(),previousBlockhash:H(),parentSlot:A(),rewards:rt(j(ln)),blockTime:Y(A()),blockHeight:Y(A())}))),Am=Qt(Y(z({blockhash:H(),previousBlockhash:H(),parentSlot:A(),transactions:j(z({transaction:ef,meta:Y(Co),version:rt(On)})),rewards:rt(j(ln)),blockTime:Y(A()),blockHeight:Y(A())}))),Mm=Qt(Y(z({blockhash:H(),previousBlockhash:H(),parentSlot:A(),transactions:j(z({transaction:sf,meta:Y(ya),version:rt(On)})),rewards:rt(j(ln)),blockTime:Y(A()),blockHeight:Y(A())}))),Lm=Qt(Y(z({blockhash:H(),previousBlockhash:H(),parentSlot:A(),transactions:j(z({transaction:ef,meta:Y(ya),version:rt(On)})),rewards:rt(j(ln)),blockTime:Y(A()),blockHeight:Y(A())}))),Rm=Qt(Y(z({blockhash:H(),previousBlockhash:H(),parentSlot:A(),rewards:rt(j(ln)),blockTime:Y(A()),blockHeight:Y(A())}))),Tm=Qt(Y(z({blockhash:H(),previousBlockhash:H(),parentSlot:A(),transactions:j(z({transaction:pa,meta:Y(Co)})),rewards:rt(j(ln)),blockTime:Y(A())}))),Pm=Qt(Y(z({blockhash:H(),previousBlockhash:H(),parentSlot:A(),signatures:j(H()),blockTime:Y(A())}))),Cm=Qt(Y(z({slot:A(),meta:Y(Co),blockTime:rt(Y(A())),transaction:pa,version:rt(On)}))),Om=Qt(Y(z({slot:A(),transaction:sf,meta:Y(ya),blockTime:rt(Y(A())),version:rt(On)}))),Um=Te(z({blockhash:H(),feeCalculator:z({lamportsPerSignature:A()})})),Nm=Te(z({blockhash:H(),lastValidBlockHeight:A()})),zm=Te(Ne()),td=z({slot:A(),numTransactions:A(),numSlots:A(),samplePeriodSecs:A()}),qm=Qt(j(td)),Fm=Te(Y(z({feeCalculator:z({lamportsPerSignature:A()})}))),Km=Qt(H()),Dm=Qt(H()),ed=z({err:hn,logs:j(H()),signature:H()}),Wm=z({result:Po(ed),subscription:A()}),rr=class{constructor(t){this._keypair=void 0,this._keypair=t??Pc()}static generate(){return new rr(Pc())}static fromSecretKey(t,e){if(t.byteLength!==64)throw new Error("bad secret key size");let n=t.slice(32,64);if(!e||!e.skipValidation){let o=t.slice(0,32),u=na(o);for(let h=0;h<32;h++)if(n[h]!==u[h])throw new Error("provided secretKey is invalid")}return new rr({publicKey:n,secretKey:t})}static fromSeed(t){let e=na(t),n=new Uint8Array(64);return n.set(t),n.set(e,32),new rr({publicKey:e,secretKey:n})}get publicKey(){return new at(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}},di=Object.freeze({CreateLookupTable:{index:0,layout:k.struct([k.u32("instruction"),Rn("recentSlot"),k.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:k.struct([k.u32("instruction")])},ExtendLookupTable:{index:2,layout:k.struct([k.u32("instruction"),Rn(),k.seq(Ht(),k.offset(k.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:k.struct([k.u32("instruction")])},CloseLookupTable:{index:4,layout:k.struct([k.u32("instruction")])}}),fa=class{constructor(){}static createLookupTable(t){let[e,n]=at.findProgramAddressSync([t.authority.toBuffer(),(0,Bi.toBufferLE)(BigInt(t.recentSlot),8)],this.programId),o=di.CreateLookupTable,u=Wt(o,{recentSlot:BigInt(t.recentSlot),bumpSeed:n}),h=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1},{pubkey:t.payer,isSigner:!0,isWritable:!0},{pubkey:fe.programId,isSigner:!1,isWritable:!1}];return[new Xt({programId:this.programId,keys:h,data:u}),e]}static freezeLookupTable(t){let e=di.FreezeLookupTable,n=Wt(e),o=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return new Xt({programId:this.programId,keys:o,data:n})}static extendLookupTable(t){let e=di.ExtendLookupTable,n=Wt(e,{addresses:t.addresses.map(u=>u.toBytes())}),o=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return t.payer&&o.push({pubkey:t.payer,isSigner:!0,isWritable:!0},{pubkey:fe.programId,isSigner:!1,isWritable:!1}),new Xt({programId:this.programId,keys:o,data:n})}static deactivateLookupTable(t){let e=di.DeactivateLookupTable,n=Wt(e),o=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return new Xt({programId:this.programId,keys:o,data:n})}static closeLookupTable(t){let e=di.CloseLookupTable,n=Wt(e),o=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1},{pubkey:t.recipient,isSigner:!1,isWritable:!0}];return new Xt({programId:this.programId,keys:o,data:n})}};fa.programId=new at("AddressLookupTab1e1111111111111111111111111");_o=Object.freeze({RequestUnits:{index:0,layout:k.struct([k.u8("instruction"),k.u32("units"),k.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:k.struct([k.u8("instruction"),k.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:k.struct([k.u8("instruction"),k.u32("units")])},SetComputeUnitPrice:{index:3,layout:k.struct([k.u8("instruction"),Rn("microLamports")])}}),ha=class{constructor(){}static requestUnits(t){let e=_o.RequestUnits,n=Wt(e,t);return new Xt({keys:[],programId:this.programId,data:n})}static requestHeapFrame(t){let e=_o.RequestHeapFrame,n=Wt(e,t);return new Xt({keys:[],programId:this.programId,data:n})}static setComputeUnitLimit(t){let e=_o.SetComputeUnitLimit,n=Wt(e,t);return new Xt({keys:[],programId:this.programId,data:n})}static setComputeUnitPrice(t){let e=_o.SetComputeUnitPrice,n=Wt(e,{microLamports:BigInt(t.microLamports)});return new Xt({keys:[],programId:this.programId,data:n})}};ha.programId=new at("ComputeBudget111111111111111111111111111111");qc=64,Fc=32,Kc=64,Dc=k.struct([k.u8("numSignatures"),k.u8("padding"),k.u16("signatureOffset"),k.u16("signatureInstructionIndex"),k.u16("publicKeyOffset"),k.u16("publicKeyInstructionIndex"),k.u16("messageDataOffset"),k.u16("messageDataSize"),k.u16("messageInstructionIndex")]),xi=class{constructor(){}static createInstructionWithPublicKey(t){let{publicKey:e,message:n,signature:o,instructionIndex:u}=t;se(e.length===Fc,`Public Key must be ${Fc} bytes but received ${e.length} bytes`),se(o.length===Kc,`Signature must be ${Kc} bytes but received ${o.length} bytes`);let h=Dc.span,w=h+e.length,m=w+o.length,x=1,v=ot.Buffer.alloc(m+n.length),B=u??65535;return Dc.encode({numSignatures:x,padding:0,signatureOffset:w,signatureInstructionIndex:B,publicKeyOffset:h,publicKeyInstructionIndex:B,messageDataOffset:m,messageDataSize:n.length,messageInstructionIndex:B},v),v.fill(e,h),v.fill(o,w),v.fill(n,m),new Xt({keys:[],programId:xi.programId,data:v})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:n,instructionIndex:o}=t;se(e.length===qc,`Private key must be ${qc} bytes but received ${e.length} bytes`);try{let u=rr.fromSecretKey(e),h=u.publicKey.toBytes(),w=Vc(n,u.secretKey);return this.createInstructionWithPublicKey({publicKey:h,message:n,signature:w,instructionIndex:o})}catch(u){throw new Error(`Error creating instruction; ${u}`)}}};xi.programId=new at("Ed25519SigVerify111111111111111111111111111");rd=(r,t)=>{let e=li.sign(r,t);return[e.toCompactRawBytes(),e.recovery]};li.utils.isValidPrivateKey;nd=li.getPublicKey,Wc=32,ta=20,Hc=64,id=11,ea=k.struct([k.u8("numSignatures"),k.u16("signatureOffset"),k.u8("signatureInstructionIndex"),k.u16("ethAddressOffset"),k.u8("ethAddressInstructionIndex"),k.u16("messageDataOffset"),k.u16("messageDataSize"),k.u8("messageInstructionIndex"),k.blob(20,"ethAddress"),k.blob(64,"signature"),k.u8("recoveryId")]),cn=class{constructor(){}static publicKeyToEthAddress(t){se(t.length===Hc,`Public key must be ${Hc} bytes but received ${t.length} bytes`);try{return ot.Buffer.from(Gs(Gt(t))).slice(-ta)}catch(e){throw new Error(`Error constructing Ethereum address: ${e}`)}}static createInstructionWithPublicKey(t){let{publicKey:e,message:n,signature:o,recoveryId:u,instructionIndex:h}=t;return cn.createInstructionWithEthAddress({ethAddress:cn.publicKeyToEthAddress(e),message:n,signature:o,recoveryId:u,instructionIndex:h})}static createInstructionWithEthAddress(t){let{ethAddress:e,message:n,signature:o,recoveryId:u,instructionIndex:h=0}=t,w;typeof e=="string"?e.startsWith("0x")?w=ot.Buffer.from(e.substr(2),"hex"):w=ot.Buffer.from(e,"hex"):w=e,se(w.length===ta,`Address must be ${ta} bytes but received ${w.length} bytes`);let m=1+id,x=m,v=m+w.length,B=v+o.length+1,_=1,E=ot.Buffer.alloc(ea.span+n.length);return ea.encode({numSignatures:_,signatureOffset:v,signatureInstructionIndex:h,ethAddressOffset:x,ethAddressInstructionIndex:h,messageDataOffset:B,messageDataSize:n.length,messageInstructionIndex:h,signature:Gt(o),ethAddress:Gt(w),recoveryId:u},E),E.fill(Gt(n),ea.span),new Xt({keys:[],programId:cn.programId,data:E})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:n,instructionIndex:o}=t;se(e.length===Wc,`Private key must be ${Wc} bytes but received ${e.length} bytes`);try{let u=Gt(e),h=nd(u,!1).slice(1),w=ot.Buffer.from(Gs(Gt(n))),[m,x]=rd(w,u);return this.createInstructionWithPublicKey({publicKey:h,message:n,signature:m,recoveryId:x,instructionIndex:o})}catch(u){throw new Error(`Error creating instruction; ${u}`)}}};cn.programId=new at("KeccakSecp256k11111111111111111111111111111");od=new at("StakeConfig11111111111111111111111111111111"),ki=class{constructor(t,e,n){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=e,this.custodian=n}};uf=ki;ki.default=new uf(0,0,at.default);Br=Object.freeze({Initialize:{index:0,layout:k.struct([k.u32("instruction"),w0(),b0()])},Authorize:{index:1,layout:k.struct([k.u32("instruction"),Ht("newAuthorized"),k.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:k.struct([k.u32("instruction")])},Split:{index:3,layout:k.struct([k.u32("instruction"),k.ns64("lamports")])},Withdraw:{index:4,layout:k.struct([k.u32("instruction"),k.ns64("lamports")])},Deactivate:{index:5,layout:k.struct([k.u32("instruction")])},Merge:{index:7,layout:k.struct([k.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:k.struct([k.u32("instruction"),Ht("newAuthorized"),k.u32("stakeAuthorizationType"),Ln("authoritySeed"),Ht("authorityOwner")])}}),Hm=Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),To=class{constructor(){}static initialize(t){let{stakePubkey:e,authorized:n,lockup:o}=t,u=o||ki.default,h=Br.Initialize,w=Wt(h,{authorized:{staker:Gt(n.staker.toBuffer()),withdrawer:Gt(n.withdrawer.toBuffer())},lockup:{unixTimestamp:u.unixTimestamp,epoch:u.epoch,custodian:Gt(u.custodian.toBuffer())}}),m={keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:vi,isSigner:!1,isWritable:!1}],programId:this.programId,data:w};return new Xt(m)}static createAccountWithSeed(t){let e=new Jt;e.add(fe.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:n,authorized:o,lockup:u}=t;return e.add(this.initialize({stakePubkey:n,authorized:o,lockup:u}))}static createAccount(t){let e=new Jt;e.add(fe.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:n,authorized:o,lockup:u}=t;return e.add(this.initialize({stakePubkey:n,authorized:o,lockup:u}))}static delegate(t){let{stakePubkey:e,authorizedPubkey:n,votePubkey:o}=t,u=Br.Delegate,h=Wt(u);return new Jt().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:o,isSigner:!1,isWritable:!1},{pubkey:er,isSigner:!1,isWritable:!1},{pubkey:Qs,isSigner:!1,isWritable:!1},{pubkey:od,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:h})}static authorize(t){let{stakePubkey:e,authorizedPubkey:n,newAuthorizedPubkey:o,stakeAuthorizationType:u,custodianPubkey:h}=t,w=Br.Authorize,m=Wt(w,{newAuthorized:Gt(o.toBuffer()),stakeAuthorizationType:u.index}),x=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:er,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return h&&x.push({pubkey:h,isSigner:!0,isWritable:!1}),new Jt().add({keys:x,programId:this.programId,data:m})}static authorizeWithSeed(t){let{stakePubkey:e,authorityBase:n,authoritySeed:o,authorityOwner:u,newAuthorizedPubkey:h,stakeAuthorizationType:w,custodianPubkey:m}=t,x=Br.AuthorizeWithSeed,v=Wt(x,{newAuthorized:Gt(h.toBuffer()),stakeAuthorizationType:w.index,authoritySeed:o,authorityOwner:Gt(u.toBuffer())}),B=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:er,isSigner:!1,isWritable:!1}];return m&&B.push({pubkey:m,isSigner:!0,isWritable:!1}),new Jt().add({keys:B,programId:this.programId,data:v})}static splitInstruction(t){let{stakePubkey:e,authorizedPubkey:n,splitStakePubkey:o,lamports:u}=t,h=Br.Split,w=Wt(h,{lamports:u});return new Xt({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:o,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:w})}static split(t,e){let n=new Jt;return n.add(fe.createAccount({fromPubkey:t.authorizedPubkey,newAccountPubkey:t.splitStakePubkey,lamports:e,space:this.space,programId:this.programId})),n.add(this.splitInstruction(t))}static splitWithSeed(t,e){let{stakePubkey:n,authorizedPubkey:o,splitStakePubkey:u,basePubkey:h,seed:w,lamports:m}=t,x=new Jt;return x.add(fe.allocate({accountPubkey:u,basePubkey:h,seed:w,space:this.space,programId:this.programId})),e&&e>0&&x.add(fe.transfer({fromPubkey:t.authorizedPubkey,toPubkey:u,lamports:e})),x.add(this.splitInstruction({stakePubkey:n,authorizedPubkey:o,splitStakePubkey:u,lamports:m}))}static merge(t){let{stakePubkey:e,sourceStakePubKey:n,authorizedPubkey:o}=t,u=Br.Merge,h=Wt(u);return new Jt().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:er,isSigner:!1,isWritable:!1},{pubkey:Qs,isSigner:!1,isWritable:!1},{pubkey:o,isSigner:!0,isWritable:!1}],programId:this.programId,data:h})}static withdraw(t){let{stakePubkey:e,authorizedPubkey:n,toPubkey:o,lamports:u,custodianPubkey:h}=t,w=Br.Withdraw,m=Wt(w,{lamports:u}),x=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:o,isSigner:!1,isWritable:!0},{pubkey:er,isSigner:!1,isWritable:!1},{pubkey:Qs,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return h&&x.push({pubkey:h,isSigner:!0,isWritable:!1}),new Jt().add({keys:x,programId:this.programId,data:m})}static deactivate(t){let{stakePubkey:e,authorizedPubkey:n}=t,o=Br.Deactivate,u=Wt(o);return new Jt().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:er,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:u})}};To.programId=new at("Stake11111111111111111111111111111111111111");To.space=200;pi=Object.freeze({InitializeAccount:{index:0,layout:k.struct([k.u32("instruction"),v0()])},Authorize:{index:1,layout:k.struct([k.u32("instruction"),Ht("newAuthorized"),k.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:k.struct([k.u32("instruction"),k.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:k.struct([k.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:k.struct([k.u32("instruction"),x0()])}}),$m=Object.freeze({Voter:{index:0},Withdrawer:{index:1}}),Pn=class{constructor(){}static initializeAccount(t){let{votePubkey:e,nodePubkey:n,voteInit:o}=t,u=pi.InitializeAccount,h=Wt(u,{voteInit:{nodePubkey:Gt(o.nodePubkey.toBuffer()),authorizedVoter:Gt(o.authorizedVoter.toBuffer()),authorizedWithdrawer:Gt(o.authorizedWithdrawer.toBuffer()),commission:o.commission}}),w={keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:vi,isSigner:!1,isWritable:!1},{pubkey:er,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:h};return new Xt(w)}static createAccount(t){let e=new Jt;return e.add(fe.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.votePubkey,lamports:t.lamports,space:this.space,programId:this.programId})),e.add(this.initializeAccount({votePubkey:t.votePubkey,nodePubkey:t.voteInit.nodePubkey,voteInit:t.voteInit}))}static authorize(t){let{votePubkey:e,authorizedPubkey:n,newAuthorizedPubkey:o,voteAuthorizationType:u}=t,h=pi.Authorize,w=Wt(h,{newAuthorized:Gt(o.toBuffer()),voteAuthorizationType:u.index}),m=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:er,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return new Jt().add({keys:m,programId:this.programId,data:w})}static authorizeWithSeed(t){let{currentAuthorityDerivedKeyBasePubkey:e,currentAuthorityDerivedKeyOwnerPubkey:n,currentAuthorityDerivedKeySeed:o,newAuthorizedPubkey:u,voteAuthorizationType:h,votePubkey:w}=t,m=pi.AuthorizeWithSeed,x=Wt(m,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:Gt(n.toBuffer()),currentAuthorityDerivedKeySeed:o,newAuthorized:Gt(u.toBuffer()),voteAuthorizationType:h.index}}),v=[{pubkey:w,isSigner:!1,isWritable:!0},{pubkey:er,isSigner:!1,isWritable:!1},{pubkey:e,isSigner:!0,isWritable:!1}];return new Jt().add({keys:v,programId:this.programId,data:x})}static withdraw(t){let{votePubkey:e,authorizedWithdrawerPubkey:n,lamports:o,toPubkey:u}=t,h=pi.Withdraw,w=Wt(h,{lamports:o}),m=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:u,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return new Jt().add({keys:m,programId:this.programId,data:w})}static safeWithdraw(t,e,n){if(t.lamports>e-n)throw new Error("Withdraw will leave vote account with insufficient funds.");return Pn.withdraw(t)}static updateValidatorIdentity(t){let{votePubkey:e,authorizedWithdrawerPubkey:n,nodePubkey:o}=t,u=pi.UpdateValidatorIdentity,h=Wt(u),w=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:o,isSigner:!0,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return new Jt().add({keys:w,programId:this.programId,data:h})}};Pn.programId=new at("Vote111111111111111111111111111111111111111");Pn.space=3762;Vm=new at("Va1idator1nfo111111111111111111111111111111"),Gm=z({name:H(),website:rt(H()),details:rt(H()),iconUrl:rt(H()),keybaseUsername:rt(H())}),Zm=new at("Vote111111111111111111111111111111111111111"),jm=k.struct([Ht("nodePubkey"),Ht("authorizedWithdrawer"),k.u8("commission"),k.nu64(),k.seq(k.struct([k.nu64("slot"),k.u32("confirmationCount")]),k.offset(k.u32(),-8),"votes"),k.u8("rootSlotValid"),k.nu64("rootSlot"),k.nu64(),k.seq(k.struct([k.nu64("epoch"),Ht("authorizedVoter")]),k.offset(k.u32(),-8),"authorizedVoters"),k.struct([k.seq(k.struct([Ht("authorizedPubkey"),k.nu64("epochOfLastAuthorizedSwitch"),k.nu64("targetEpoch")]),32,"buf"),k.nu64("idx"),k.u8("isEmpty")],"priorVoters"),k.nu64(),k.seq(k.struct([k.nu64("epoch"),k.nu64("credits"),k.nu64("prevCredits")]),k.offset(k.u32(),-8),"epochCredits"),k.struct([k.nu64("slot"),k.nu64("timestamp")],"lastTimestamp")])});function ff(){let r=rr.generate();return{privateKey:Buffer.from(r.secretKey).toString("hex"),publicKey:r.publicKey.toString()}}var t1,hf=wt(()=>{"use strict";t1=P(O());cf()});async function lf({accessControlConditions:r}){let{privateKey:t,publicKey:e}=ff();return $a({accessControlConditions:r,publicKey:e,privateKey:t})}var i1,df=wt(()=>{"use strict";i1=P(O());Va();hf()});var sd=ae(()=>{var c1=P(O());Da();df();(async()=>Ka(async()=>lf({accessControlConditions})))()});sd();})();\n/*! Bundled license information:\n\nieee754/index.js:\n (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *)\n\nbuffer/index.js:\n (*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n *)\n\n@noble/hashes/esm/utils.js:\n (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/abstract/utils.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/abstract/modular.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/abstract/curve.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/abstract/edwards.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/ed25519.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\nsafe-buffer/index.js:\n (*! safe-buffer. MIT License. Feross Aboukhadijeh *)\n\n@solana/buffer-layout/lib/Layout.js:\n (**\n * Support for translating between Uint8Array instances and JavaScript\n * native types.\n *\n * {@link module:Layout~Layout|Layout} is the basis of a class\n * hierarchy that associates property names with sequences of encoded\n * bytes.\n *\n * Layouts are supported for these scalar (numeric) types:\n * * {@link module:Layout~UInt|Unsigned integers in little-endian\n * format} with {@link module:Layout.u8|8-bit}, {@link\n * module:Layout.u16|16-bit}, {@link module:Layout.u24|24-bit},\n * {@link module:Layout.u32|32-bit}, {@link\n * module:Layout.u40|40-bit}, and {@link module:Layout.u48|48-bit}\n * representation ranges;\n * * {@link module:Layout~UIntBE|Unsigned integers in big-endian\n * format} with {@link module:Layout.u16be|16-bit}, {@link\n * module:Layout.u24be|24-bit}, {@link module:Layout.u32be|32-bit},\n * {@link module:Layout.u40be|40-bit}, and {@link\n * module:Layout.u48be|48-bit} representation ranges;\n * * {@link module:Layout~Int|Signed integers in little-endian\n * format} with {@link module:Layout.s8|8-bit}, {@link\n * module:Layout.s16|16-bit}, {@link module:Layout.s24|24-bit},\n * {@link module:Layout.s32|32-bit}, {@link\n * module:Layout.s40|40-bit}, and {@link module:Layout.s48|48-bit}\n * representation ranges;\n * * {@link module:Layout~IntBE|Signed integers in big-endian format}\n * with {@link module:Layout.s16be|16-bit}, {@link\n * module:Layout.s24be|24-bit}, {@link module:Layout.s32be|32-bit},\n * {@link module:Layout.s40be|40-bit}, and {@link\n * module:Layout.s48be|48-bit} representation ranges;\n * * 64-bit integral values that decode to an exact (if magnitude is\n * less than 2^53) or nearby integral Number in {@link\n * module:Layout.nu64|unsigned little-endian}, {@link\n * module:Layout.nu64be|unsigned big-endian}, {@link\n * module:Layout.ns64|signed little-endian}, and {@link\n * module:Layout.ns64be|unsigned big-endian} encodings;\n * * 32-bit floating point values with {@link\n * module:Layout.f32|little-endian} and {@link\n * module:Layout.f32be|big-endian} representations;\n * * 64-bit floating point values with {@link\n * module:Layout.f64|little-endian} and {@link\n * module:Layout.f64be|big-endian} representations;\n * * {@link module:Layout.const|Constants} that take no space in the\n * encoded expression.\n *\n * and for these aggregate types:\n * * {@link module:Layout.seq|Sequence}s of instances of a {@link\n * module:Layout~Layout|Layout}, with JavaScript representation as\n * an Array and constant or data-dependent {@link\n * module:Layout~Sequence#count|length};\n * * {@link module:Layout.struct|Structure}s that aggregate a\n * heterogeneous sequence of {@link module:Layout~Layout|Layout}\n * instances, with JavaScript representation as an Object;\n * * {@link module:Layout.union|Union}s that support multiple {@link\n * module:Layout~VariantLayout|variant layouts} over a fixed\n * (padded) or variable (not padded) span of bytes, using an\n * unsigned integer at the start of the data or a separate {@link\n * module:Layout.unionLayoutDiscriminator|layout element} to\n * determine which layout to use when interpreting the buffer\n * contents;\n * * {@link module:Layout.bits|BitStructure}s that contain a sequence\n * of individual {@link\n * module:Layout~BitStructure#addField|BitField}s packed into an 8,\n * 16, 24, or 32-bit unsigned integer starting at the least- or\n * most-significant bit;\n * * {@link module:Layout.cstr|C strings} of varying length;\n * * {@link module:Layout.blob|Blobs} of fixed- or variable-{@link\n * module:Layout~Blob#length|length} raw data.\n *\n * All {@link module:Layout~Layout|Layout} instances are immutable\n * after construction, to prevent internal state from becoming\n * inconsistent.\n *\n * @local Layout\n * @local ExternalLayout\n * @local GreedyCount\n * @local OffsetLayout\n * @local UInt\n * @local UIntBE\n * @local Int\n * @local IntBE\n * @local NearUInt64\n * @local NearUInt64BE\n * @local NearInt64\n * @local NearInt64BE\n * @local Float\n * @local FloatBE\n * @local Double\n * @local DoubleBE\n * @local Sequence\n * @local Structure\n * @local UnionDiscriminator\n * @local UnionLayoutDiscriminator\n * @local Union\n * @local VariantLayout\n * @local BitStructure\n * @local BitField\n * @local Boolean\n * @local Blob\n * @local CString\n * @local Constant\n * @local bindConstructorLayout\n * @module Layout\n * @license MIT\n * @author Peter A. Bigot\n * @see {@link https://github.com/pabigot/buffer-layout|buffer-layout on GitHub}\n *)\n\n@noble/curves/esm/abstract/weierstrass.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/_shortw_utils.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/secp256k1.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n*/\n'; + module2.exports = { + code: code9, + }; + }, +}); + +// packages/wrapped-keys-lit-actions/src/generated/solana/signMessageWithEncryptedSolanaKey.js +var require_signMessageWithEncryptedSolanaKey = __commonJS({ + 'packages/wrapped-keys-lit-actions/src/generated/solana/signMessageWithEncryptedSolanaKey.js'( + exports, + module2 + ) { + 'use strict'; + init_shim(); + var code9 = + '"use strict";(()=>{var Wc=Object.create;var $i=Object.defineProperty;var Hc=Object.getOwnPropertyDescriptor;var Vc=Object.getOwnPropertyNames;var $c=Object.getPrototypeOf,jc=Object.prototype.hasOwnProperty;var Da=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw new Error(\'Dynamic require of "\'+r+\'" is not supported\')});var le=(r,t)=>()=>(r&&(t=r(r=0)),t);var Ve=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),Wa=(r,t)=>{for(var e in t)$i(r,e,{get:t[e],enumerable:!0})},Ha=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vc(t))!jc.call(r,o)&&o!==e&&$i(r,o,{get:()=>t[o],enumerable:!(n=Hc(t,o))||n.enumerable});return r};var H=(r,t,e)=>(e=r!=null?Wc($c(r)):{},Ha(t||!r||!r.__esModule?$i(e,"default",{value:r,enumerable:!0}):e,r)),Va=r=>Ha($i({},"__esModule",{value:!0}),r);var Ga=Ve(ji=>{"use strict";var Kd=H(j());ji.byteLength=Yc;ji.toByteArray=Xc;ji.fromByteArray=th;var Nr=[],Br=[],Gc=typeof Uint8Array<"u"?Uint8Array:Array,is="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(En=0,$a=is.length;En<$a;++En)Nr[En]=is[En],Br[is.charCodeAt(En)]=En;var En,$a;Br["-".charCodeAt(0)]=62;Br["_".charCodeAt(0)]=63;function ja(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");e===-1&&(e=t);var n=e===t?0:4-e%4;return[e,n]}function Yc(r){var t=ja(r),e=t[0],n=t[1];return(e+n)*3/4-n}function Zc(r,t,e){return(t+e)*3/4-e}function Xc(r){var t,e=ja(r),n=e[0],o=e[1],f=new Gc(Zc(r,n,o)),h=0,x=o>0?n-4:n,b;for(b=0;b>16&255,f[h++]=t>>8&255,f[h++]=t&255;return o===2&&(t=Br[r.charCodeAt(b)]<<2|Br[r.charCodeAt(b+1)]>>4,f[h++]=t&255),o===1&&(t=Br[r.charCodeAt(b)]<<10|Br[r.charCodeAt(b+1)]<<4|Br[r.charCodeAt(b+2)]>>2,f[h++]=t>>8&255,f[h++]=t&255),f}function Jc(r){return Nr[r>>18&63]+Nr[r>>12&63]+Nr[r>>6&63]+Nr[r&63]}function Qc(r,t,e){for(var n,o=[],f=t;fx?x:h+f));return n===1?(t=r[e-1],o.push(Nr[t>>2]+Nr[t<<4&63]+"==")):n===2&&(t=(r[e-2]<<8)+r[e-1],o.push(Nr[t>>10]+Nr[t>>4&63]+Nr[t<<2&63]+"=")),o.join("")}});var Ya=Ve(os=>{var Wd=H(j());os.read=function(r,t,e,n,o){var f,h,x=o*8-n-1,b=(1<>1,E=-7,L=e?o-1:0,O=e?-1:1,P=r[t+L];for(L+=O,f=P&(1<<-E)-1,P>>=-E,E+=x;E>0;f=f*256+r[t+L],L+=O,E-=8);for(h=f&(1<<-E)-1,f>>=-E,E+=n;E>0;h=h*256+r[t+L],L+=O,E-=8);if(f===0)f=1-_;else{if(f===b)return h?NaN:(P?-1:1)*(1/0);h=h+Math.pow(2,n),f=f-_}return(P?-1:1)*h*Math.pow(2,f-n)};os.write=function(r,t,e,n,o,f){var h,x,b,_=f*8-o-1,E=(1<<_)-1,L=E>>1,O=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,P=n?0:f-1,rt=n?1:-1,D=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(x=isNaN(t)?1:0,h=E):(h=Math.floor(Math.log(t)/Math.LN2),t*(b=Math.pow(2,-h))<1&&(h--,b*=2),h+L>=1?t+=O/b:t+=O*Math.pow(2,1-L),t*b>=2&&(h++,b/=2),h+L>=E?(x=0,h=E):h+L>=1?(x=(t*b-1)*Math.pow(2,o),h=h+L):(x=t*Math.pow(2,L-1)*Math.pow(2,o),h=0));o>=8;r[e+P]=x&255,P+=rt,x/=256,o-=8);for(h=h<0;r[e+P]=h&255,P+=rt,h/=256,_-=8);r[e+P-rt]|=D*128}});var An=Ve(Gn=>{"use strict";var $d=H(j());var ss=Ga(),$n=Ya(),Za=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Gn.Buffer=$;Gn.SlowBuffer=sh;Gn.INSPECT_MAX_BYTES=50;var Gi=2147483647;Gn.kMaxLength=Gi;$.TYPED_ARRAY_SUPPORT=eh();!$.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function eh(){try{let r=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(r,t),r.foo()===42}catch{return!1}}Object.defineProperty($.prototype,"parent",{enumerable:!0,get:function(){if($.isBuffer(this))return this.buffer}});Object.defineProperty($.prototype,"offset",{enumerable:!0,get:function(){if($.isBuffer(this))return this.byteOffset}});function Hr(r){if(r>Gi)throw new RangeError(\'The value "\'+r+\'" is invalid for option "size"\');let t=new Uint8Array(r);return Object.setPrototypeOf(t,$.prototype),t}function $(r,t,e){if(typeof r=="number"){if(typeof t=="string")throw new TypeError(\'The "string" argument must be of type string. Received type number\');return cs(r)}return tf(r,t,e)}$.poolSize=8192;function tf(r,t,e){if(typeof r=="string")return nh(r,t);if(ArrayBuffer.isView(r))return ih(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(zr(r,ArrayBuffer)||r&&zr(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(zr(r,SharedArrayBuffer)||r&&zr(r.buffer,SharedArrayBuffer)))return fs(r,t,e);if(typeof r=="number")throw new TypeError(\'The "value" argument must not be of type number. Received type number\');let n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return $.from(n,t,e);let o=oh(r);if(o)return o;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return $.from(r[Symbol.toPrimitive]("string"),t,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}$.from=function(r,t,e){return tf(r,t,e)};Object.setPrototypeOf($.prototype,Uint8Array.prototype);Object.setPrototypeOf($,Uint8Array);function ef(r){if(typeof r!="number")throw new TypeError(\'"size" argument must be of type number\');if(r<0)throw new RangeError(\'The value "\'+r+\'" is invalid for option "size"\')}function rh(r,t,e){return ef(r),r<=0?Hr(r):t!==void 0?typeof e=="string"?Hr(r).fill(t,e):Hr(r).fill(t):Hr(r)}$.alloc=function(r,t,e){return rh(r,t,e)};function cs(r){return ef(r),Hr(r<0?0:hs(r)|0)}$.allocUnsafe=function(r){return cs(r)};$.allocUnsafeSlow=function(r){return cs(r)};function nh(r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!$.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let e=rf(r,t)|0,n=Hr(e),o=n.write(r,t);return o!==e&&(n=n.slice(0,o)),n}function as(r){let t=r.length<0?0:hs(r.length)|0,e=Hr(t);for(let n=0;n=Gi)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Gi.toString(16)+" bytes");return r|0}function sh(r){return+r!=r&&(r=0),$.alloc(+r)}$.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==$.prototype};$.compare=function(t,e){if(zr(t,Uint8Array)&&(t=$.from(t,t.offset,t.byteLength)),zr(e,Uint8Array)&&(e=$.from(e,e.offset,e.byteLength)),!$.isBuffer(t)||!$.isBuffer(e))throw new TypeError(\'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array\');if(t===e)return 0;let n=t.length,o=e.length;for(let f=0,h=Math.min(n,o);fo.length?($.isBuffer(h)||(h=$.from(h)),h.copy(o,f)):Uint8Array.prototype.set.call(o,h,f);else if($.isBuffer(h))h.copy(o,f);else throw new TypeError(\'"list" argument must be an Array of Buffers\');f+=h.length}return o};function rf(r,t){if($.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||zr(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError(\'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type \'+typeof r);let e=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&e===0)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return us(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return lf(r).length;default:if(o)return n?-1:us(r).length;t=(""+t).toLowerCase(),o=!0}}$.byteLength=rf;function ah(r,t,e){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return mh(this,t,e);case"utf8":case"utf-8":return of(this,t,e);case"ascii":return yh(this,t,e);case"latin1":case"binary":return gh(this,t,e);case"base64":return dh(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wh(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}$.prototype._isBuffer=!0;function _n(r,t,e){let n=r[t];r[t]=r[e],r[e]=n}$.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;ee&&(t+=" ... "),""};Za&&($.prototype[Za]=$.prototype.inspect);$.prototype.compare=function(t,e,n,o,f){if(zr(t,Uint8Array)&&(t=$.from(t,t.offset,t.byteLength)),!$.isBuffer(t))throw new TypeError(\'The "target" argument must be one of type Buffer or Uint8Array. Received type \'+typeof t);if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),o===void 0&&(o=0),f===void 0&&(f=this.length),e<0||n>t.length||o<0||f>this.length)throw new RangeError("out of range index");if(o>=f&&e>=n)return 0;if(o>=f)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,f>>>=0,this===t)return 0;let h=f-o,x=n-e,b=Math.min(h,x),_=this.slice(o,f),E=t.slice(e,n);for(let L=0;L2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,ds(e)&&(e=o?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(o)return-1;e=r.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof t=="string"&&(t=$.from(t,n)),$.isBuffer(t))return t.length===0?-1:Xa(r,t,e,n,o);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):Xa(r,[t],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Xa(r,t,e,n,o){let f=1,h=r.length,x=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||t.length<2)return-1;f=2,h/=2,x/=2,e/=2}function b(E,L){return f===1?E[L]:E.readUInt16BE(L*f)}let _;if(o){let E=-1;for(_=e;_h&&(e=h-x),_=e;_>=0;_--){let E=!0;for(let L=0;Lo&&(n=o)):n=o;let f=t.length;n>f/2&&(n=f/2);let h;for(h=0;h>>0,isFinite(n)?(n=n>>>0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let f=this.length-e;if((n===void 0||n>f)&&(n=f),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");let h=!1;for(;;)switch(o){case"hex":return fh(this,t,e,n);case"utf8":case"utf-8":return uh(this,t,e,n);case"ascii":case"latin1":case"binary":return ch(this,t,e,n);case"base64":return hh(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return lh(this,t,e,n);default:if(h)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),h=!0}};$.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function dh(r,t,e){return t===0&&e===r.length?ss.fromByteArray(r):ss.fromByteArray(r.slice(t,e))}function of(r,t,e){e=Math.min(r.length,e);let n=[],o=t;for(;o239?4:f>223?3:f>191?2:1;if(o+x<=e){let b,_,E,L;switch(x){case 1:f<128&&(h=f);break;case 2:b=r[o+1],(b&192)===128&&(L=(f&31)<<6|b&63,L>127&&(h=L));break;case 3:b=r[o+1],_=r[o+2],(b&192)===128&&(_&192)===128&&(L=(f&15)<<12|(b&63)<<6|_&63,L>2047&&(L<55296||L>57343)&&(h=L));break;case 4:b=r[o+1],_=r[o+2],E=r[o+3],(b&192)===128&&(_&192)===128&&(E&192)===128&&(L=(f&15)<<18|(b&63)<<12|(_&63)<<6|E&63,L>65535&&L<1114112&&(h=L))}}h===null?(h=65533,x=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|h&1023),n.push(h),o+=x}return ph(n)}var Ja=4096;function ph(r){let t=r.length;if(t<=Ja)return String.fromCharCode.apply(String,r);let e="",n=0;for(;nn)&&(e=n);let o="";for(let f=t;fn&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),ee)throw new RangeError("Trying to access beyond buffer length")}$.prototype.readUintLE=$.prototype.readUIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||Ze(t,e,this.length);let o=this[t],f=1,h=0;for(;++h>>0,e=e>>>0,n||Ze(t,e,this.length);let o=this[t+--e],f=1;for(;e>0&&(f*=256);)o+=this[t+--e]*f;return o};$.prototype.readUint8=$.prototype.readUInt8=function(t,e){return t=t>>>0,e||Ze(t,1,this.length),this[t]};$.prototype.readUint16LE=$.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||Ze(t,2,this.length),this[t]|this[t+1]<<8};$.prototype.readUint16BE=$.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||Ze(t,2,this.length),this[t]<<8|this[t+1]};$.prototype.readUint32LE=$.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||Ze(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};$.prototype.readUint32BE=$.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||Ze(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};$.prototype.readBigUInt64LE=nn(function(t){t=t>>>0,jn(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&pi(t,this.length-8);let o=e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,f=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(o)+(BigInt(f)<>>0,jn(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&pi(t,this.length-8);let o=e*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],f=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(o)<>>0,e=e>>>0,n||Ze(t,e,this.length);let o=this[t],f=1,h=0;for(;++h=f&&(o-=Math.pow(2,8*e)),o};$.prototype.readIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||Ze(t,e,this.length);let o=e,f=1,h=this[t+--o];for(;o>0&&(f*=256);)h+=this[t+--o]*f;return f*=128,h>=f&&(h-=Math.pow(2,8*e)),h};$.prototype.readInt8=function(t,e){return t=t>>>0,e||Ze(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};$.prototype.readInt16LE=function(t,e){t=t>>>0,e||Ze(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};$.prototype.readInt16BE=function(t,e){t=t>>>0,e||Ze(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};$.prototype.readInt32LE=function(t,e){return t=t>>>0,e||Ze(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};$.prototype.readInt32BE=function(t,e){return t=t>>>0,e||Ze(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};$.prototype.readBigInt64LE=nn(function(t){t=t>>>0,jn(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&pi(t,this.length-8);let o=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(o)<>>0,jn(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&pi(t,this.length-8);let o=(e<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(o)<>>0,e||Ze(t,4,this.length),$n.read(this,t,!0,23,4)};$.prototype.readFloatBE=function(t,e){return t=t>>>0,e||Ze(t,4,this.length),$n.read(this,t,!1,23,4)};$.prototype.readDoubleLE=function(t,e){return t=t>>>0,e||Ze(t,8,this.length),$n.read(this,t,!0,52,8)};$.prototype.readDoubleBE=function(t,e){return t=t>>>0,e||Ze(t,8,this.length),$n.read(this,t,!1,52,8)};function pr(r,t,e,n,o,f){if(!$.isBuffer(r))throw new TypeError(\'"buffer" argument must be a Buffer instance\');if(t>o||tr.length)throw new RangeError("Index out of range")}$.prototype.writeUintLE=$.prototype.writeUIntLE=function(t,e,n,o){if(t=+t,e=e>>>0,n=n>>>0,!o){let x=Math.pow(2,8*n)-1;pr(this,t,e,n,x,0)}let f=1,h=0;for(this[e]=t&255;++h>>0,n=n>>>0,!o){let x=Math.pow(2,8*n)-1;pr(this,t,e,n,x,0)}let f=n-1,h=1;for(this[e+f]=t&255;--f>=0&&(h*=256);)this[e+f]=t/h&255;return e+n};$.prototype.writeUint8=$.prototype.writeUInt8=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,1,255,0),this[e]=t&255,e+1};$.prototype.writeUint16LE=$.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2};$.prototype.writeUint16BE=$.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2};$.prototype.writeUint32LE=$.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4};$.prototype.writeUint32BE=$.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function sf(r,t,e,n,o){hf(t,n,o,r,e,7);let f=Number(t&BigInt(4294967295));r[e++]=f,f=f>>8,r[e++]=f,f=f>>8,r[e++]=f,f=f>>8,r[e++]=f;let h=Number(t>>BigInt(32)&BigInt(4294967295));return r[e++]=h,h=h>>8,r[e++]=h,h=h>>8,r[e++]=h,h=h>>8,r[e++]=h,e}function af(r,t,e,n,o){hf(t,n,o,r,e,7);let f=Number(t&BigInt(4294967295));r[e+7]=f,f=f>>8,r[e+6]=f,f=f>>8,r[e+5]=f,f=f>>8,r[e+4]=f;let h=Number(t>>BigInt(32)&BigInt(4294967295));return r[e+3]=h,h=h>>8,r[e+2]=h,h=h>>8,r[e+1]=h,h=h>>8,r[e]=h,e+8}$.prototype.writeBigUInt64LE=nn(function(t,e=0){return sf(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});$.prototype.writeBigUInt64BE=nn(function(t,e=0){return af(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});$.prototype.writeIntLE=function(t,e,n,o){if(t=+t,e=e>>>0,!o){let b=Math.pow(2,8*n-1);pr(this,t,e,n,b-1,-b)}let f=0,h=1,x=0;for(this[e]=t&255;++f>0)-x&255;return e+n};$.prototype.writeIntBE=function(t,e,n,o){if(t=+t,e=e>>>0,!o){let b=Math.pow(2,8*n-1);pr(this,t,e,n,b-1,-b)}let f=n-1,h=1,x=0;for(this[e+f]=t&255;--f>=0&&(h*=256);)t<0&&x===0&&this[e+f+1]!==0&&(x=1),this[e+f]=(t/h>>0)-x&255;return e+n};$.prototype.writeInt8=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1};$.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2};$.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2};$.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4};$.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||pr(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};$.prototype.writeBigInt64LE=nn(function(t,e=0){return sf(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});$.prototype.writeBigInt64BE=nn(function(t,e=0){return af(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ff(r,t,e,n,o,f){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function uf(r,t,e,n,o){return t=+t,e=e>>>0,o||ff(r,t,e,4,34028234663852886e22,-34028234663852886e22),$n.write(r,t,e,n,23,4),e+4}$.prototype.writeFloatLE=function(t,e,n){return uf(this,t,e,!0,n)};$.prototype.writeFloatBE=function(t,e,n){return uf(this,t,e,!1,n)};function cf(r,t,e,n,o){return t=+t,e=e>>>0,o||ff(r,t,e,8,17976931348623157e292,-17976931348623157e292),$n.write(r,t,e,n,52,8),e+8}$.prototype.writeDoubleLE=function(t,e,n){return cf(this,t,e,!0,n)};$.prototype.writeDoubleBE=function(t,e,n){return cf(this,t,e,!1,n)};$.prototype.copy=function(t,e,n,o){if(!$.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!o&&o!==0&&(o=this.length),e>=t.length&&(e=t.length),e||(e=0),o>0&&o=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-e>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let f;if(typeof t=="number")for(f=e;f2**32?o=Qa(String(e)):typeof e=="bigint"&&(o=String(e),(e>BigInt(2)**BigInt(32)||e<-(BigInt(2)**BigInt(32)))&&(o=Qa(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);function Qa(r){let t="",e=r.length,n=r[0]==="-"?1:0;for(;e>=n+4;e-=3)t=`_${r.slice(e-3,e)}${t}`;return`${r.slice(0,e)}${t}`}function bh(r,t,e){jn(t,"offset"),(r[t]===void 0||r[t+e]===void 0)&&pi(t,r.length-(e+1))}function hf(r,t,e,n,o,f){if(r>e||r3?t===0||t===BigInt(0)?x=`>= 0${h} and < 2${h} ** ${(f+1)*8}${h}`:x=`>= -(2${h} ** ${(f+1)*8-1}${h}) and < 2 ** ${(f+1)*8-1}${h}`:x=`>= ${t}${h} and <= ${e}${h}`,new Vn.ERR_OUT_OF_RANGE("value",x,r)}bh(n,o,f)}function jn(r,t){if(typeof r!="number")throw new Vn.ERR_INVALID_ARG_TYPE(t,"number",r)}function pi(r,t,e){throw Math.floor(r)!==r?(jn(r,e),new Vn.ERR_OUT_OF_RANGE(e||"offset","an integer",r)):t<0?new Vn.ERR_BUFFER_OUT_OF_BOUNDS:new Vn.ERR_OUT_OF_RANGE(e||"offset",`>= ${e?1:0} and <= ${t}`,r)}var xh=/[^+/0-9A-Za-z-_]/g;function vh(r){if(r=r.split("=")[0],r=r.trim().replace(xh,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function us(r,t){t=t||1/0;let e,n=r.length,o=null,f=[];for(let h=0;h55295&&e<57344){if(!o){if(e>56319){(t-=3)>-1&&f.push(239,191,189);continue}else if(h+1===n){(t-=3)>-1&&f.push(239,191,189);continue}o=e;continue}if(e<56320){(t-=3)>-1&&f.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(t-=3)>-1&&f.push(239,191,189);if(o=null,e<128){if((t-=1)<0)break;f.push(e)}else if(e<2048){if((t-=2)<0)break;f.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;f.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;f.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return f}function kh(r){let t=[];for(let e=0;e>8,o=e%256,f.push(o),f.push(n);return f}function lf(r){return ss.toByteArray(vh(r))}function Yi(r,t,e,n){let o;for(o=0;o=t.length||o>=r.length);++o)t[o+e]=r[o];return o}function zr(r,t){return r instanceof t||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===t.name}function ds(r){return r!==r}var Bh=function(){let r="0123456789abcdef",t=new Array(256);for(let e=0;e<16;++e){let n=e*16;for(let o=0;o<16;++o)t[n+o]=r[e]+r[o]}return t}();function nn(r){return typeof BigInt>"u"?Eh:r}function Eh(){throw new Error("BigInt not supported")}});var j=Ve(()=>{"use strict";var df=H(An());globalThis.Buffer=df.Buffer});var Zd,Yn,ps=le(()=>{"use strict";Zd=H(j()),Yn=class extends Error{constructor(){super(...arguments);this.name="AbortError"}}});async function pf(r){try{let t=await r(),e=typeof t=="string"?t:JSON.stringify(t);Lit.Actions.setResponse({response:e})}catch(t){if(t instanceof Yn)return;Lit.Actions.setResponse({response:`Error: ${t.message}`})}}var Qd,yf=le(()=>{"use strict";Qd=H(j());ps()});var ep,Zi,gf=le(()=>{"use strict";ep=H(j()),Zi="lit_"});function mf(r){if(!r.startsWith(Zi))throw new Error(`PKey was not encrypted with salt; all wrapped keys must be prefixed with \'${Zi}\'`);return r.slice(Zi.length)}var ip,wf=le(()=>{"use strict";ip=H(j());gf()});async function _h({accessControlConditions:r,ciphertext:t,dataToEncryptHash:e}){try{return await Lit.Actions.decryptToSingleNode({accessControlConditions:r,ciphertext:t,dataToEncryptHash:e,chain:"ethereum",authSig:null})}catch(n){throw new Error(`When decrypting key to a single node - ${n.message}`)}}async function bf({accessControlConditions:r,ciphertext:t,dataToEncryptHash:e}){let n=await _h({accessControlConditions:r,ciphertext:t,dataToEncryptHash:e});if(!n)throw new Yn;return mf(n)}var fp,xf=le(()=>{"use strict";fp=H(j());ps();wf()});function yi(r){if(!Number.isSafeInteger(r)||r<0)throw new Error("positive integer expected, got "+r)}function Ah(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function on(r,...t){if(!Ah(r))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(r.length))throw new Error("Uint8Array expected of length "+t+", got length="+r.length)}function vf(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");yi(r.outputLen),yi(r.blockLen)}function Vr(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}function Xi(r,t){on(r);let e=t.outputLen;if(r.length{cp=H(j(),1)});var lp,Mn,kf=le(()=>{lp=H(j(),1),Mn=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});function Sf(r){return new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4))}function Ji(r){return new DataView(r.buffer,r.byteOffset,r.byteLength)}function Lr(r,t){return r<<32-t|r>>>t}function Mh(r){return r<<24&4278190080|r<<8&16711680|r>>>8&65280|r>>>24&255}function gs(r){for(let t=0;tr().update(an(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}function Ef(r){let t=(n,o)=>r(o).update(an(n)).digest(),e=r({});return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=n=>r(n),t}function Qi(r=32){if(Mn&&typeof Mn.getRandomValues=="function")return Mn.getRandomValues(new Uint8Array(r));if(Mn&&typeof Mn.randomBytes=="function")return Mn.randomBytes(r);throw new Error("crypto.getRandomValues must be defined")}var gp,ys,sn,fn=le(()=>{gp=H(j(),1);kf();gi();ys=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();sn=class{clone(){return this._cloneInto()}}});function Ih(r,t,e,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(t,e,n);let o=BigInt(32),f=BigInt(4294967295),h=Number(e>>o&f),x=Number(e&f),b=n?4:0,_=n?0:4;r.setUint32(t+b,h,n),r.setUint32(t+_,x,n)}function _f(r,t,e){return r&t^~r&e}function Af(r,t,e){return r&t^r&e^t&e}var xp,Xn,ws=le(()=>{xp=H(j(),1);gi();fn();Xn=class extends sn{constructor(t,e,n,o){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Ji(this.buffer)}update(t){Vr(this);let{view:e,buffer:n,blockLen:o}=this;t=an(t);let f=t.length;for(let h=0;ho-h&&(this.process(n,0),h=0);for(let L=h;LE.length)throw new Error("_sha2: outputLen bigger than state");for(let L=0;L<_;L++)x.setUint32(4*L,E[L],f)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:n,length:o,finished:f,destroyed:h,pos:x}=this;return t.length=o,t.pos=x,t.finished=f,t.destroyed=h,o%e&&t.buffer.set(n),t}}});function Mf(r,t=!1){return t?{h:Number(r&to),l:Number(r>>bs&to)}:{h:Number(r>>bs&to)|0,l:Number(r&to)|0}}function xs(r,t=!1){let e=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let o=0;o>>0)+(n>>>0);return{h:r+e+(o/2**32|0)|0,l:o|0}}var kp,to,bs,Lh,Rh,Th,Ph,Ch,Uh,Oh,Nh,zh,vs,ks,Ss,Bs,Fh,Kh,Dh,Wh,Hh,Vh,$h,ge,Es=le(()=>{kp=H(j(),1),to=BigInt(4294967295),bs=BigInt(32);Lh=(r,t)=>BigInt(r>>>0)<>>0),Rh=(r,t,e)=>r>>>e,Th=(r,t,e)=>r<<32-e|t>>>e,Ph=(r,t,e)=>r>>>e|t<<32-e,Ch=(r,t,e)=>r<<32-e|t>>>e,Uh=(r,t,e)=>r<<64-e|t>>>e-32,Oh=(r,t,e)=>r>>>e-32|t<<64-e,Nh=(r,t)=>t,zh=(r,t)=>r,vs=(r,t,e)=>r<>>32-e,ks=(r,t,e)=>t<>>32-e,Ss=(r,t,e)=>t<>>64-e,Bs=(r,t,e)=>r<>>64-e;Fh=(r,t,e)=>(r>>>0)+(t>>>0)+(e>>>0),Kh=(r,t,e,n)=>t+e+n+(r/2**32|0)|0,Dh=(r,t,e,n)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0),Wh=(r,t,e,n,o)=>t+e+n+o+(r/2**32|0)|0,Hh=(r,t,e,n,o)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0)+(o>>>0),Vh=(r,t,e,n,o,f)=>t+e+n+o+f+(r/2**32|0)|0,$h={fromBig:Mf,split:xs,toBig:Lh,shrSH:Rh,shrSL:Th,rotrSH:Ph,rotrSL:Ch,rotrBH:Uh,rotrBL:Oh,rotr32H:Nh,rotr32L:zh,rotlSH:vs,rotlSL:ks,rotlBH:Ss,rotlBL:Bs,add:qh,add3L:Fh,add3H:Kh,add4L:Dh,add4H:Wh,add5H:Vh,add5L:Hh},ge=$h});var Ap,jh,Gh,un,cn,_s,If,Lf=le(()=>{Ap=H(j(),1);ws();Es();fn();[jh,Gh]=(()=>ge.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))))(),un=new Uint32Array(80),cn=new Uint32Array(80),_s=class extends Xn{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:n,Bl:o,Ch:f,Cl:h,Dh:x,Dl:b,Eh:_,El:E,Fh:L,Fl:O,Gh:P,Gl:rt,Hh:D,Hl:C}=this;return[t,e,n,o,f,h,x,b,_,E,L,O,P,rt,D,C]}set(t,e,n,o,f,h,x,b,_,E,L,O,P,rt,D,C){this.Ah=t|0,this.Al=e|0,this.Bh=n|0,this.Bl=o|0,this.Ch=f|0,this.Cl=h|0,this.Dh=x|0,this.Dl=b|0,this.Eh=_|0,this.El=E|0,this.Fh=L|0,this.Fl=O|0,this.Gh=P|0,this.Gl=rt|0,this.Hh=D|0,this.Hl=C|0}process(t,e){for(let G=0;G<16;G++,e+=4)un[G]=t.getUint32(e),cn[G]=t.getUint32(e+=4);for(let G=16;G<80;G++){let it=un[G-15]|0,kt=cn[G-15]|0,st=ge.rotrSH(it,kt,1)^ge.rotrSH(it,kt,8)^ge.shrSH(it,kt,7),yt=ge.rotrSL(it,kt,1)^ge.rotrSL(it,kt,8)^ge.shrSL(it,kt,7),At=un[G-2]|0,Et=cn[G-2]|0,be=ge.rotrSH(At,Et,19)^ge.rotrBH(At,Et,61)^ge.shrSH(At,Et,6),ct=ge.rotrSL(At,Et,19)^ge.rotrBL(At,Et,61)^ge.shrSL(At,Et,6),Lt=ge.add4L(yt,ct,cn[G-7],cn[G-16]),g=ge.add4H(Lt,st,be,un[G-7],un[G-16]);un[G]=g|0,cn[G]=Lt|0}let{Ah:n,Al:o,Bh:f,Bl:h,Ch:x,Cl:b,Dh:_,Dl:E,Eh:L,El:O,Fh:P,Fl:rt,Gh:D,Gl:C,Hh:X,Hl:ot}=this;for(let G=0;G<80;G++){let it=ge.rotrSH(L,O,14)^ge.rotrSH(L,O,18)^ge.rotrBH(L,O,41),kt=ge.rotrSL(L,O,14)^ge.rotrSL(L,O,18)^ge.rotrBL(L,O,41),st=L&P^~L&D,yt=O&rt^~O&C,At=ge.add5L(ot,kt,yt,Gh[G],cn[G]),Et=ge.add5H(At,X,it,st,jh[G],un[G]),be=At|0,ct=ge.rotrSH(n,o,28)^ge.rotrBH(n,o,34)^ge.rotrBH(n,o,39),Lt=ge.rotrSL(n,o,28)^ge.rotrBL(n,o,34)^ge.rotrBL(n,o,39),g=n&f^n&x^f&x,i=o&h^o&b^h&b;X=D|0,ot=C|0,D=P|0,C=rt|0,P=L|0,rt=O|0,{h:L,l:O}=ge.add(_|0,E|0,Et|0,be|0),_=x|0,E=b|0,x=f|0,b=h|0,f=n|0,h=o|0;let a=ge.add3L(be,Lt,i);n=ge.add3H(a,Et,ct,g),o=a|0}({h:n,l:o}=ge.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:f,l:h}=ge.add(this.Bh|0,this.Bl|0,f|0,h|0),{h:x,l:b}=ge.add(this.Ch|0,this.Cl|0,x|0,b|0),{h:_,l:E}=ge.add(this.Dh|0,this.Dl|0,_|0,E|0),{h:L,l:O}=ge.add(this.Eh|0,this.El|0,L|0,O|0),{h:P,l:rt}=ge.add(this.Fh|0,this.Fl|0,P|0,rt|0),{h:D,l:C}=ge.add(this.Gh|0,this.Gl|0,D|0,C|0),{h:X,l:ot}=ge.add(this.Hh|0,this.Hl|0,X|0,ot|0),this.set(n,o,f,h,x,b,_,E,L,O,P,rt,D,C,X,ot)}roundClean(){un.fill(0),cn.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},If=Zn(()=>new _s)});var no={};Wa(no,{aInRange:()=>yr,abool:()=>Rr,abytes:()=>Jn,bitGet:()=>t0,bitLen:()=>Ls,bitMask:()=>wi,bitSet:()=>e0,bytesToHex:()=>jr,bytesToNumberBE:()=>Gr,bytesToNumberLE:()=>ln,concatBytes:()=>Yr,createHmacDrbg:()=>Rs,ensureBytes:()=>qe,equalBytes:()=>Jh,hexToBytes:()=>Ln,hexToNumber:()=>Is,inRange:()=>mi,isBytes:()=>hn,memoized:()=>Tn,notImplemented:()=>n0,numberToBytesBE:()=>dn,numberToBytesLE:()=>Rn,numberToHexUnpadded:()=>In,numberToVarBytesBE:()=>Xh,utf8ToBytes:()=>Qh,validateObject:()=>qr});function hn(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function Jn(r){if(!hn(r))throw new Error("Uint8Array expected")}function Rr(r,t){if(typeof t!="boolean")throw new Error(r+" boolean expected, got "+t)}function jr(r){Jn(r);let t="";for(let e=0;e=$r._0&&r<=$r._9)return r-$r._0;if(r>=$r.A&&r<=$r.F)return r-($r.A-10);if(r>=$r.a&&r<=$r.f)return r-($r.a-10)}function Ln(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let t=r.length,e=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(e);for(let o=0,f=0;oeo;r>>=ro,t+=1);return t}function t0(r,t){return r>>BigInt(t)&ro}function e0(r,t,e){return r|(e?ro:eo)<{n.fill(1),o.fill(0),f=0},x=(...L)=>e(o,n,...L),b=(L=Ms())=>{o=x(Tf([0]),L),n=x(),L.length!==0&&(o=x(Tf([1]),L),n=x())},_=()=>{if(f++>=1e3)throw new Error("drbg: tried 1000 values");let L=0,O=[];for(;L{h(),b(L);let P;for(;!(P=O(_()));)b();return h(),P}}function qr(r,t,e={}){let n=(o,f,h)=>{let x=r0[f];if(typeof x!="function")throw new Error("invalid validator function");let b=r[o];if(!(h&&b===void 0)&&!x(b,r))throw new Error("param "+String(o)+" is invalid. Expected "+f+", got "+b)};for(let[o,f]of Object.entries(t))n(o,f,!1);for(let[o,f]of Object.entries(e))n(o,f,!0);return r}function Tn(r){let t=new WeakMap;return(e,...n)=>{let o=t.get(e);if(o!==void 0)return o;let f=r(e,...n);return t.set(e,f),f}}var Mp,eo,ro,Yh,Zh,$r,As,wi,Ms,Tf,r0,n0,Pn=le(()=>{Mp=H(j(),1);eo=BigInt(0),ro=BigInt(1),Yh=BigInt(2);Zh=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));$r={_0:48,_9:57,A:65,F:70,a:97,f:102};As=r=>typeof r=="bigint"&&eo<=r;wi=r=>(Yh<new Uint8Array(r),Tf=r=>Uint8Array.from(r);r0={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||hn(r),isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,t)=>t.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};n0=()=>{throw new Error("not implemented")}});function Re(r,t){let e=r%t;return e>=je?e:t+e}function a0(r,t,e){if(tje;)t&Oe&&(n=n*r%e),r=r*r%e,t>>=Oe;return n}function Ne(r,t,e){let n=r;for(;t-- >je;)n*=n,n%=e;return n}function io(r,t){if(r===je)throw new Error("invert: expected non-zero number");if(t<=je)throw new Error("invert: expected positive modulus, got "+t);let e=Re(r,t),n=t,o=je,f=Oe,h=Oe,x=je;for(;e!==je;){let _=n/e,E=n%e,L=o-h*_,O=f-x*_;n=e,e=E,o=h,f=x,h=L,x=O}if(n!==Oe)throw new Error("invert: does not exist");return Re(o,t)}function f0(r){let t=(r-Oe)/Cn,e,n,o;for(e=r-Oe,n=0;e%Cn===je;e/=Cn,n++);for(o=Cn;o1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){let h=(r+Oe)/Ts;return function(b,_){let E=b.pow(_,h);if(!b.eql(b.sqr(E),_))throw new Error("Cannot find square root");return E}}let f=(e+Oe)/Cn;return function(x,b){if(x.pow(b,t)===x.neg(x.ONE))throw new Error("Cannot find square root");let _=n,E=x.pow(x.mul(x.ONE,o),e),L=x.pow(b,f),O=x.pow(b,e);for(;!x.eql(O,x.ONE);){if(x.eql(O,x.ZERO))return x.ZERO;let P=1;for(let D=x.sqr(O);P<_&&!x.eql(D,x.ONE);P++)D=x.sqr(D);let rt=x.pow(E,Oe<(n[o]="function",n),t);return qr(r,e)}function h0(r,t,e){if(eje;)e&Oe&&(n=r.mul(n,o)),o=r.sqr(o),e>>=Oe;return n}function l0(r,t){let e=new Array(t.length),n=t.reduce((f,h,x)=>r.is0(h)?f:(e[x]=f,r.mul(f,h)),r.ONE),o=r.inv(n);return t.reduceRight((f,h,x)=>r.is0(h)?f:(e[x]=r.mul(f,e[x]),r.mul(f,h)),o),e}function Cs(r,t){let e=t!==void 0?t:r.toString(2).length,n=Math.ceil(e/8);return{nBitLength:e,nByteLength:n}}function pn(r,t,e=!1,n={}){if(r<=je)throw new Error("invalid field: expected ORDER > 0, got "+r);let{nBitLength:o,nByteLength:f}=Cs(r,t);if(f>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let h,x=Object.freeze({ORDER:r,isLE:e,BITS:o,BYTES:f,MASK:wi(o),ZERO:je,ONE:Oe,create:b=>Re(b,r),isValid:b=>{if(typeof b!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof b);return je<=b&&bb===je,isOdd:b=>(b&Oe)===Oe,neg:b=>Re(-b,r),eql:(b,_)=>b===_,sqr:b=>Re(b*b,r),add:(b,_)=>Re(b+_,r),sub:(b,_)=>Re(b-_,r),mul:(b,_)=>Re(b*_,r),pow:(b,_)=>h0(x,b,_),div:(b,_)=>Re(b*io(_,r),r),sqrN:b=>b*b,addN:(b,_)=>b+_,subN:(b,_)=>b-_,mulN:(b,_)=>b*_,inv:b=>io(b,r),sqrt:n.sqrt||(b=>(h||(h=u0(r)),h(x,b))),invertBatch:b=>l0(x,b),cmov:(b,_,E)=>E?_:b,toBytes:b=>e?Rn(b,f):dn(b,f),fromBytes:b=>{if(b.length!==f)throw new Error("Field.fromBytes: expected "+f+" bytes, got "+b.length);return e?ln(b):Gr(b)}});return Object.freeze(x)}function Of(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let t=r.toString(2).length;return Math.ceil(t/8)}function Us(r){let t=Of(r);return t+Math.ceil(t/2)}function Nf(r,t,e=!1){let n=r.length,o=Of(t),f=Us(t);if(n<16||n1024)throw new Error("expected "+f+"-1024 bytes of input, got "+n);let h=e?ln(r):Gr(r),x=Re(h,t-Oe)+Oe;return e?Rn(x,o):dn(x,o)}var Rp,je,Oe,Cn,i0,Ts,Pf,Cf,o0,s0,Uf,c0,Qn=le(()=>{Rp=H(j(),1);Pn();je=BigInt(0),Oe=BigInt(1),Cn=BigInt(2),i0=BigInt(3),Ts=BigInt(4),Pf=BigInt(5),Cf=BigInt(8),o0=BigInt(9),s0=BigInt(16);Uf=(r,t)=>(Re(r,t)&Oe)===Oe,c0=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function Os(r,t){let e=t.negate();return r?e:t}function qf(r,t){if(!Number.isSafeInteger(r)||r<=0||r>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+r)}function Ns(r,t){qf(r,t);let e=Math.ceil(t/r)+1,n=2**(r-1);return{windows:e,windowSize:n}}function d0(r,t){if(!Array.isArray(r))throw new Error("array expected");r.forEach((e,n)=>{if(!(e instanceof t))throw new Error("invalid point at index "+n)})}function p0(r,t){if(!Array.isArray(r))throw new Error("array of scalars expected");r.forEach((e,n)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+n)})}function qs(r){return Ff.get(r)||1}function so(r,t){return{constTimeNegate:Os,hasPrecomputes(e){return qs(e)!==1},unsafeLadder(e,n,o=r.ZERO){let f=e;for(;n>zf;)n&oo&&(o=o.add(f)),f=f.double(),n>>=oo;return o},precomputeWindow(e,n){let{windows:o,windowSize:f}=Ns(n,t),h=[],x=e,b=x;for(let _=0;_>=L,rt>h&&(rt-=E,o+=oo);let D=P,C=P+Math.abs(rt)-1,X=O%2!==0,ot=rt<0;rt===0?b=b.add(Os(X,n[D])):x=x.add(Os(ot,n[C]))}return{p:x,f:b}},wNAFUnsafe(e,n,o,f=r.ZERO){let{windows:h,windowSize:x}=Ns(e,t),b=BigInt(2**e-1),_=2**e,E=BigInt(e);for(let L=0;L>=E,P>x&&(P-=_,o+=oo),P===0)continue;let rt=n[O+Math.abs(P)-1];P<0&&(rt=rt.negate()),f=f.add(rt)}return f},getPrecomputes(e,n,o){let f=zs.get(n);return f||(f=this.precomputeWindow(n,e),e!==1&&zs.set(n,o(f))),f},wNAFCached(e,n,o){let f=qs(e);return this.wNAF(f,this.getPrecomputes(f,e,o),n)},wNAFCachedUnsafe(e,n,o,f){let h=qs(e);return h===1?this.unsafeLadder(e,n,f):this.wNAFUnsafe(h,this.getPrecomputes(h,e,o),n,f)},setWindowSize(e,n){qf(n,t),Ff.set(e,n),zs.delete(e)}}}function ao(r,t,e,n){if(d0(e,r),p0(n,t),e.length!==n.length)throw new Error("arrays of points and scalars must have equal length");let o=r.ZERO,f=Ls(BigInt(e.length)),h=f>12?f-3:f>4?f-2:f?2:1,x=(1<=0;L-=h){b.fill(o);for(let P=0;P>BigInt(L)&BigInt(x));b[D]=b[D].add(e[P])}let O=o;for(let P=b.length-1,rt=o;P>0;P--)rt=rt.add(b[P]),O=O.add(rt);if(E=E.add(O),L!==0)for(let P=0;P{Up=H(j(),1);Qn();Pn();zf=BigInt(0),oo=BigInt(1);zs=new WeakMap,Ff=new WeakMap});function m0(r){let t=bi(r);return qr(r,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function Kf(r){let t=m0(r),{Fp:e,n,prehash:o,hash:f,randomBytes:h,nByteLength:x,h:b}=t,_=fo<{try{return{isValid:!0,value:e.sqrt(u*e.inv(c))}}catch{return{isValid:!1,value:Tr}}}),P=t.adjustScalarBytes||(u=>u),rt=t.domain||((u,c,d)=>{if(Rr("phflag",d),c.length||d)throw new Error("Contexts/pre-hash are not supported");return u});function D(u,c){yr("coordinate "+u,c,Tr,_)}function C(u){if(!(u instanceof G))throw new Error("ExtendedPoint expected")}let X=Tn((u,c)=>{let{ex:d,ey:m,ez:v}=u,p=u.is0();c==null&&(c=p?y0:e.inv(v));let s=E(d*c),y=E(m*c),R=E(v*c);if(p)return{x:Tr,y:gr};if(R!==gr)throw new Error("invZ was invalid");return{x:s,y}}),ot=Tn(u=>{let{a:c,d}=t;if(u.is0())throw new Error("bad point: ZERO");let{ex:m,ey:v,ez:p,et:s}=u,y=E(m*m),R=E(v*v),U=E(p*p),W=E(U*U),tt=E(y*c),at=E(U*E(tt+R)),lt=E(W+E(d*E(y*R)));if(at!==lt)throw new Error("bad point: equation left != right (1)");let xe=E(m*v),gt=E(p*s);if(xe!==gt)throw new Error("bad point: equation left != right (2)");return!0});class G{constructor(c,d,m,v){this.ex=c,this.ey=d,this.ez=m,this.et=v,D("x",c),D("y",d),D("z",m),D("t",v),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(c){if(c instanceof G)throw new Error("extended point not allowed");let{x:d,y:m}=c||{};return D("x",d),D("y",m),new G(d,m,gr,E(d*m))}static normalizeZ(c){let d=e.invertBatch(c.map(m=>m.ez));return c.map((m,v)=>m.toAffine(d[v])).map(G.fromAffine)}static msm(c,d){return ao(G,L,c,d)}_setWindowSize(c){st.setWindowSize(this,c)}assertValidity(){ot(this)}equals(c){C(c);let{ex:d,ey:m,ez:v}=this,{ex:p,ey:s,ez:y}=c,R=E(d*y),U=E(p*v),W=E(m*y),tt=E(s*v);return R===U&&W===tt}is0(){return this.equals(G.ZERO)}negate(){return new G(E(-this.ex),this.ey,this.ez,E(-this.et))}double(){let{a:c}=t,{ex:d,ey:m,ez:v}=this,p=E(d*d),s=E(m*m),y=E(fo*E(v*v)),R=E(c*p),U=d+m,W=E(E(U*U)-p-s),tt=R+s,at=tt-y,lt=R-s,xe=E(W*at),gt=E(tt*lt),St=E(W*lt),Ye=E(at*tt);return new G(xe,gt,Ye,St)}add(c){C(c);let{a:d,d:m}=t,{ex:v,ey:p,ez:s,et:y}=this,{ex:R,ey:U,ez:W,et:tt}=c;if(d===BigInt(-1)){let Zt=E((p-v)*(U+R)),Ht=E((p+v)*(U-R)),br=E(Ht-Zt);if(br===Tr)return this.double();let Dt=E(s*fo*tt),Vt=E(y*fo*W),xr=Vt+Dt,$t=Ht+Zt,jt=Vt-Dt,Or=E(xr*br),ie=E($t*jt),Xt=E(xr*jt),Mr=E(br*$t);return new G(Or,ie,Mr,Xt)}let at=E(v*R),lt=E(p*U),xe=E(y*m*tt),gt=E(s*W),St=E((v+p)*(R+U)-at-lt),Ye=gt-xe,Ct=gt+xe,Kt=E(lt-d*at),Ur=E(St*Ye),ee=E(Ct*Kt),zt=E(St*Kt),kr=E(Ye*Ct);return new G(Ur,ee,kr,zt)}subtract(c){return this.add(c.negate())}wNAF(c){return st.wNAFCached(this,c,G.normalizeZ)}multiply(c){let d=c;yr("scalar",d,gr,n);let{p:m,f:v}=this.wNAF(d);return G.normalizeZ([m,v])[0]}multiplyUnsafe(c,d=G.ZERO){let m=c;return yr("scalar",m,Tr,n),m===Tr?kt:this.is0()||m===gr?this:st.wNAFCachedUnsafe(this,m,G.normalizeZ,d)}isSmallOrder(){return this.multiplyUnsafe(b).is0()}isTorsionFree(){return st.unsafeLadder(this,n).is0()}toAffine(c){return X(this,c)}clearCofactor(){let{h:c}=t;return c===gr?this:this.multiplyUnsafe(c)}static fromHex(c,d=!1){let{d:m,a:v}=t,p=e.BYTES;c=qe("pointHex",c,p),Rr("zip215",d);let s=c.slice(),y=c[p-1];s[p-1]=y&-129;let R=ln(s),U=d?_:e.ORDER;yr("pointHex.y",R,Tr,U);let W=E(R*R),tt=E(W-gr),at=E(m*W-v),{isValid:lt,value:xe}=O(tt,at);if(!lt)throw new Error("Point.fromHex: invalid y coordinate");let gt=(xe&gr)===gr,St=(y&128)!==0;if(!d&&xe===Tr&&St)throw new Error("Point.fromHex: x=0 and x_0=1");return St!==gt&&(xe=E(-xe)),G.fromAffine({x:xe,y:R})}static fromPrivateKey(c){return Et(c).point}toRawBytes(){let{x:c,y:d}=this.toAffine(),m=Rn(d,e.BYTES);return m[m.length-1]|=c&gr?128:0,m}toHex(){return jr(this.toRawBytes())}}G.BASE=new G(t.Gx,t.Gy,gr,E(t.Gx*t.Gy)),G.ZERO=new G(Tr,gr,gr,Tr);let{BASE:it,ZERO:kt}=G,st=so(G,x*8);function yt(u){return Re(u,n)}function At(u){return yt(ln(u))}function Et(u){let c=e.BYTES;u=qe("private key",u,c);let d=qe("hashed private key",f(u),2*c),m=P(d.slice(0,c)),v=d.slice(c,2*c),p=At(m),s=it.multiply(p),y=s.toRawBytes();return{head:m,prefix:v,scalar:p,point:s,pointBytes:y}}function be(u){return Et(u).pointBytes}function ct(u=new Uint8Array,...c){let d=Yr(...c);return At(f(rt(d,qe("context",u),!!o)))}function Lt(u,c,d={}){u=qe("message",u),o&&(u=o(u));let{prefix:m,scalar:v,pointBytes:p}=Et(c),s=ct(d.context,m,u),y=it.multiply(s).toRawBytes(),R=ct(d.context,y,p,u),U=yt(s+R*v);yr("signature.s",U,Tr,n);let W=Yr(y,Rn(U,e.BYTES));return qe("result",W,e.BYTES*2)}let g=g0;function i(u,c,d,m=g){let{context:v,zip215:p}=m,s=e.BYTES;u=qe("signature",u,2*s),c=qe("message",c),d=qe("publicKey",d,s),p!==void 0&&Rr("zip215",p),o&&(c=o(c));let y=ln(u.slice(s,2*s)),R,U,W;try{R=G.fromHex(d,p),U=G.fromHex(u.slice(0,s),p),W=it.multiplyUnsafe(y)}catch{return!1}if(!p&&R.isSmallOrder())return!1;let tt=ct(v,U.toRawBytes(),R.toRawBytes(),c);return U.add(R.multiplyUnsafe(tt)).subtract(W).clearCofactor().equals(G.ZERO)}return it._setWindowSize(8),{CURVE:t,getPublicKey:be,sign:Lt,verify:i,ExtendedPoint:G,utils:{getExtendedPublicKey:Et,randomPrivateKey:()=>h(e.BYTES),precompute(u=8,c=G.BASE){return c._setWindowSize(u),c.multiply(BigInt(3)),c}}}}var Fp,Tr,gr,fo,y0,g0,Df=le(()=>{Fp=H(j(),1);Fs();Qn();Pn();Pn();Tr=BigInt(0),gr=BigInt(1),fo=BigInt(2),y0=BigInt(8),g0={zip215:!0}});function v0(r){let t=BigInt(10),e=BigInt(20),n=BigInt(40),o=BigInt(80),f=Ks,x=r*r%f*r%f,b=Ne(x,Hf,f)*x%f,_=Ne(b,w0,f)*r%f,E=Ne(_,b0,f)*_%f,L=Ne(E,t,f)*E%f,O=Ne(L,e,f)*L%f,P=Ne(O,n,f)*O%f,rt=Ne(P,o,f)*P%f,D=Ne(rt,o,f)*P%f,C=Ne(D,t,f)*E%f;return{pow_p_5_8:Ne(C,Hf,f)*r%f,b2:x}}function k0(r){return r[0]&=248,r[31]&=127,r[31]|=64,r}function S0(r,t){let e=Ks,n=Re(t*t*t,e),o=Re(n*n*t,e),f=v0(r*o).pow_p_5_8,h=Re(r*n*f,e),x=Re(t*h*h,e),b=h,_=Re(h*Wf,e),E=x===r,L=x===Re(-r,e),O=x===Re(-r*Wf,e);return E&&(h=b),(L||O)&&(h=_),Uf(h,e)&&(h=Re(-h,e)),{isValid:E||L,value:h}}var Yp,Ks,Wf,$p,w0,Hf,jp,b0,x0,B0,E0,Un,Vf=le(()=>{Yp=H(j(),1);Lf();fn();Df();Qn();Ks=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Wf=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),$p=BigInt(0),w0=BigInt(1),Hf=BigInt(2),jp=BigInt(3),b0=BigInt(5),x0=BigInt(8);B0=(()=>pn(Ks,void 0,!0))(),E0=(()=>({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:B0,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:x0,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:If,randomBytes:Qi,adjustScalarBytes:k0,uvRatio:S0}))(),Un=(()=>Kf(E0))()});var Ds=Ve(()=>{var Jp=H(j())});var jf=Ve(($f,Ws)=>{var Qp=H(j());(function(r,t){"use strict";function e(g,i){if(!g)throw new Error(i||"Assertion failed")}function n(g,i){g.super_=i;var a=function(){};a.prototype=i.prototype,g.prototype=new a,g.prototype.constructor=g}function o(g,i,a){if(o.isBN(g))return g;this.negative=0,this.words=null,this.length=0,this.red=null,g!==null&&((i==="le"||i==="be")&&(a=i,i=10),this._init(g||0,i||10,a||"be"))}typeof r=="object"?r.exports=o:t.BN=o,o.BN=o,o.wordSize=26;var f;try{typeof window<"u"&&typeof window.Buffer<"u"?f=window.Buffer:f=Ds().Buffer}catch{}o.isBN=function(i){return i instanceof o?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===o.wordSize&&Array.isArray(i.words)},o.max=function(i,a){return i.cmp(a)>0?i:a},o.min=function(i,a){return i.cmp(a)<0?i:a},o.prototype._init=function(i,a,u){if(typeof i=="number")return this._initNumber(i,a,u);if(typeof i=="object")return this._initArray(i,a,u);a==="hex"&&(a=16),e(a===(a|0)&&a>=2&&a<=36),i=i.toString().replace(/\\s+/g,"");var c=0;i[0]==="-"&&(c++,this.negative=1),c=0;c-=3)m=i[c]|i[c-1]<<8|i[c-2]<<16,this.words[d]|=m<>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(u==="le")for(c=0,d=0;c>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this._strip()};function h(g,i){var a=g.charCodeAt(i);if(a>=48&&a<=57)return a-48;if(a>=65&&a<=70)return a-55;if(a>=97&&a<=102)return a-87;e(!1,"Invalid character in "+g)}function x(g,i,a){var u=h(g,a);return a-1>=i&&(u|=h(g,a-1)<<4),u}o.prototype._parseHex=function(i,a,u){this.length=Math.ceil((i.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)v=x(i,a,c)<=18?(d-=18,m+=1,this.words[m]|=v>>>26):d+=8;else{var p=i.length-a;for(c=p%2===0?a+1:a;c=18?(d-=18,m+=1,this.words[m]|=v>>>26):d+=8}this._strip()};function b(g,i,a,u){for(var c=0,d=0,m=Math.min(g.length,a),v=i;v=49?d=p-49+10:p>=17?d=p-17+10:d=p,e(p>=0&&d1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=E}catch{o.prototype.inspect=E}else o.prototype.inspect=E;function E(){return(this.red?""}var L=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],O=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(i,a){i=i||10,a=a|0||1;var u;if(i===16||i==="hex"){u="";for(var c=0,d=0,m=0;m>>24-c&16777215,c+=2,c>=26&&(c-=26,m--),d!==0||m!==this.length-1?u=L[6-p.length]+p+u:u=p+u}for(d!==0&&(u=d.toString(16)+u);u.length%a!==0;)u="0"+u;return this.negative!==0&&(u="-"+u),u}if(i===(i|0)&&i>=2&&i<=36){var s=O[i],y=P[i];u="";var R=this.clone();for(R.negative=0;!R.isZero();){var U=R.modrn(y).toString(i);R=R.idivn(y),R.isZero()?u=U+u:u=L[s-U.length]+U+u}for(this.isZero()&&(u="0"+u);u.length%a!==0;)u="0"+u;return this.negative!==0&&(u="-"+u),u}e(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&e(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},o.prototype.toJSON=function(){return this.toString(16,2)},f&&(o.prototype.toBuffer=function(i,a){return this.toArrayLike(f,i,a)}),o.prototype.toArray=function(i,a){return this.toArrayLike(Array,i,a)};var rt=function(i,a){return i.allocUnsafe?i.allocUnsafe(a):new i(a)};o.prototype.toArrayLike=function(i,a,u){this._strip();var c=this.byteLength(),d=u||Math.max(1,c);e(c<=d,"byte array longer than desired length"),e(d>0,"Requested array length <= 0");var m=rt(i,d),v=a==="le"?"LE":"BE";return this["_toArrayLike"+v](m,c),m},o.prototype._toArrayLikeLE=function(i,a){for(var u=0,c=0,d=0,m=0;d>8&255),u>16&255),m===6?(u>24&255),c=0,m=0):(c=v>>>24,m+=2)}if(u=0&&(i[u--]=v>>8&255),u>=0&&(i[u--]=v>>16&255),m===6?(u>=0&&(i[u--]=v>>24&255),c=0,m=0):(c=v>>>24,m+=2)}if(u>=0)for(i[u--]=c;u>=0;)i[u--]=0},Math.clz32?o.prototype._countBits=function(i){return 32-Math.clz32(i)}:o.prototype._countBits=function(i){var a=i,u=0;return a>=4096&&(u+=13,a>>>=13),a>=64&&(u+=7,a>>>=7),a>=8&&(u+=4,a>>>=4),a>=2&&(u+=2,a>>>=2),u+a},o.prototype._zeroBits=function(i){if(i===0)return 26;var a=i,u=0;return a&8191||(u+=13,a>>>=13),a&127||(u+=7,a>>>=7),a&15||(u+=4,a>>>=4),a&3||(u+=2,a>>>=2),a&1||u++,u},o.prototype.bitLength=function(){var i=this.words[this.length-1],a=this._countBits(i);return(this.length-1)*26+a};function D(g){for(var i=new Array(g.bitLength()),a=0;a>>c&1}return i}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,a=0;ai.length?this.clone().ior(i):i.clone().ior(this)},o.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},o.prototype.iuand=function(i){var a;this.length>i.length?a=i:a=this;for(var u=0;ui.length?this.clone().iand(i):i.clone().iand(this)},o.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},o.prototype.iuxor=function(i){var a,u;this.length>i.length?(a=this,u=i):(a=i,u=this);for(var c=0;ci.length?this.clone().ixor(i):i.clone().ixor(this)},o.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},o.prototype.inotn=function(i){e(typeof i=="number"&&i>=0);var a=Math.ceil(i/26)|0,u=i%26;this._expand(a),u>0&&a--;for(var c=0;c0&&(this.words[c]=~this.words[c]&67108863>>26-u),this._strip()},o.prototype.notn=function(i){return this.clone().inotn(i)},o.prototype.setn=function(i,a){e(typeof i=="number"&&i>=0);var u=i/26|0,c=i%26;return this._expand(u+1),a?this.words[u]=this.words[u]|1<i.length?(u=this,c=i):(u=i,c=this);for(var d=0,m=0;m>>26;for(;d!==0&&m>>26;if(this.length=u.length,d!==0)this.words[this.length]=d,this.length++;else if(u!==this)for(;mi.length?this.clone().iadd(i):i.clone().iadd(this)},o.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var a=this.iadd(i);return i.negative=1,a._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var u=this.cmp(i);if(u===0)return this.negative=0,this.length=1,this.words[0]=0,this;var c,d;u>0?(c=this,d=i):(c=i,d=this);for(var m=0,v=0;v>26,this.words[v]=a&67108863;for(;m!==0&&v>26,this.words[v]=a&67108863;if(m===0&&v>>26,R=p&67108863,U=Math.min(s,i.length-1),W=Math.max(0,s-g.length+1);W<=U;W++){var tt=s-W|0;c=g.words[tt]|0,d=i.words[W]|0,m=c*d+R,y+=m/67108864|0,R=m&67108863}a.words[s]=R|0,p=y|0}return p!==0?a.words[s]=p|0:a.length--,a._strip()}var X=function(i,a,u){var c=i.words,d=a.words,m=u.words,v=0,p,s,y,R=c[0]|0,U=R&8191,W=R>>>13,tt=c[1]|0,at=tt&8191,lt=tt>>>13,xe=c[2]|0,gt=xe&8191,St=xe>>>13,Ye=c[3]|0,Ct=Ye&8191,Kt=Ye>>>13,Ur=c[4]|0,ee=Ur&8191,zt=Ur>>>13,kr=c[5]|0,Zt=kr&8191,Ht=kr>>>13,br=c[6]|0,Dt=br&8191,Vt=br>>>13,xr=c[7]|0,$t=xr&8191,jt=xr>>>13,Or=c[8]|0,ie=Or&8191,Xt=Or>>>13,Mr=c[9]|0,re=Mr&8191,Jt=Mr>>>13,Sr=d[0]|0,Qt=Sr&8191,ne=Sr>>>13,Ir=d[1]|0,te=Ir&8191,oe=Ir>>>13,rn=d[2]|0,ce=rn&8191,he=rn>>>13,hr=d[3]|0,Wt=hr&8191,Gt=hr>>>13,Wr=d[4]|0,se=Wr&8191,fe=Wr>>>13,Bn=d[5]|0,Mt=Bn&8191,ue=Bn>>>13,w=d[6]|0,S=w&8191,k=w>>>13,l=d[7]|0,B=l&8191,M=l>>>13,T=d[8]|0,N=T&8191,V=T>>>13,Bt=d[9]|0,J=Bt&8191,dt=Bt>>>13;u.negative=i.negative^a.negative,u.length=19,p=Math.imul(U,Qt),s=Math.imul(U,ne),s=s+Math.imul(W,Qt)|0,y=Math.imul(W,ne);var pt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(pt>>>26)|0,pt&=67108863,p=Math.imul(at,Qt),s=Math.imul(at,ne),s=s+Math.imul(lt,Qt)|0,y=Math.imul(lt,ne),p=p+Math.imul(U,te)|0,s=s+Math.imul(U,oe)|0,s=s+Math.imul(W,te)|0,y=y+Math.imul(W,oe)|0;var It=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(It>>>26)|0,It&=67108863,p=Math.imul(gt,Qt),s=Math.imul(gt,ne),s=s+Math.imul(St,Qt)|0,y=Math.imul(St,ne),p=p+Math.imul(at,te)|0,s=s+Math.imul(at,oe)|0,s=s+Math.imul(lt,te)|0,y=y+Math.imul(lt,oe)|0,p=p+Math.imul(U,ce)|0,s=s+Math.imul(U,he)|0,s=s+Math.imul(W,ce)|0,y=y+Math.imul(W,he)|0;var Rt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,p=Math.imul(Ct,Qt),s=Math.imul(Ct,ne),s=s+Math.imul(Kt,Qt)|0,y=Math.imul(Kt,ne),p=p+Math.imul(gt,te)|0,s=s+Math.imul(gt,oe)|0,s=s+Math.imul(St,te)|0,y=y+Math.imul(St,oe)|0,p=p+Math.imul(at,ce)|0,s=s+Math.imul(at,he)|0,s=s+Math.imul(lt,ce)|0,y=y+Math.imul(lt,he)|0,p=p+Math.imul(U,Wt)|0,s=s+Math.imul(U,Gt)|0,s=s+Math.imul(W,Wt)|0,y=y+Math.imul(W,Gt)|0;var Ft=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,p=Math.imul(ee,Qt),s=Math.imul(ee,ne),s=s+Math.imul(zt,Qt)|0,y=Math.imul(zt,ne),p=p+Math.imul(Ct,te)|0,s=s+Math.imul(Ct,oe)|0,s=s+Math.imul(Kt,te)|0,y=y+Math.imul(Kt,oe)|0,p=p+Math.imul(gt,ce)|0,s=s+Math.imul(gt,he)|0,s=s+Math.imul(St,ce)|0,y=y+Math.imul(St,he)|0,p=p+Math.imul(at,Wt)|0,s=s+Math.imul(at,Gt)|0,s=s+Math.imul(lt,Wt)|0,y=y+Math.imul(lt,Gt)|0,p=p+Math.imul(U,se)|0,s=s+Math.imul(U,fe)|0,s=s+Math.imul(W,se)|0,y=y+Math.imul(W,fe)|0;var qt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(qt>>>26)|0,qt&=67108863,p=Math.imul(Zt,Qt),s=Math.imul(Zt,ne),s=s+Math.imul(Ht,Qt)|0,y=Math.imul(Ht,ne),p=p+Math.imul(ee,te)|0,s=s+Math.imul(ee,oe)|0,s=s+Math.imul(zt,te)|0,y=y+Math.imul(zt,oe)|0,p=p+Math.imul(Ct,ce)|0,s=s+Math.imul(Ct,he)|0,s=s+Math.imul(Kt,ce)|0,y=y+Math.imul(Kt,he)|0,p=p+Math.imul(gt,Wt)|0,s=s+Math.imul(gt,Gt)|0,s=s+Math.imul(St,Wt)|0,y=y+Math.imul(St,Gt)|0,p=p+Math.imul(at,se)|0,s=s+Math.imul(at,fe)|0,s=s+Math.imul(lt,se)|0,y=y+Math.imul(lt,fe)|0,p=p+Math.imul(U,Mt)|0,s=s+Math.imul(U,ue)|0,s=s+Math.imul(W,Mt)|0,y=y+Math.imul(W,ue)|0;var Tt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,p=Math.imul(Dt,Qt),s=Math.imul(Dt,ne),s=s+Math.imul(Vt,Qt)|0,y=Math.imul(Vt,ne),p=p+Math.imul(Zt,te)|0,s=s+Math.imul(Zt,oe)|0,s=s+Math.imul(Ht,te)|0,y=y+Math.imul(Ht,oe)|0,p=p+Math.imul(ee,ce)|0,s=s+Math.imul(ee,he)|0,s=s+Math.imul(zt,ce)|0,y=y+Math.imul(zt,he)|0,p=p+Math.imul(Ct,Wt)|0,s=s+Math.imul(Ct,Gt)|0,s=s+Math.imul(Kt,Wt)|0,y=y+Math.imul(Kt,Gt)|0,p=p+Math.imul(gt,se)|0,s=s+Math.imul(gt,fe)|0,s=s+Math.imul(St,se)|0,y=y+Math.imul(St,fe)|0,p=p+Math.imul(at,Mt)|0,s=s+Math.imul(at,ue)|0,s=s+Math.imul(lt,Mt)|0,y=y+Math.imul(lt,ue)|0,p=p+Math.imul(U,S)|0,s=s+Math.imul(U,k)|0,s=s+Math.imul(W,S)|0,y=y+Math.imul(W,k)|0;var Ut=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,p=Math.imul($t,Qt),s=Math.imul($t,ne),s=s+Math.imul(jt,Qt)|0,y=Math.imul(jt,ne),p=p+Math.imul(Dt,te)|0,s=s+Math.imul(Dt,oe)|0,s=s+Math.imul(Vt,te)|0,y=y+Math.imul(Vt,oe)|0,p=p+Math.imul(Zt,ce)|0,s=s+Math.imul(Zt,he)|0,s=s+Math.imul(Ht,ce)|0,y=y+Math.imul(Ht,he)|0,p=p+Math.imul(ee,Wt)|0,s=s+Math.imul(ee,Gt)|0,s=s+Math.imul(zt,Wt)|0,y=y+Math.imul(zt,Gt)|0,p=p+Math.imul(Ct,se)|0,s=s+Math.imul(Ct,fe)|0,s=s+Math.imul(Kt,se)|0,y=y+Math.imul(Kt,fe)|0,p=p+Math.imul(gt,Mt)|0,s=s+Math.imul(gt,ue)|0,s=s+Math.imul(St,Mt)|0,y=y+Math.imul(St,ue)|0,p=p+Math.imul(at,S)|0,s=s+Math.imul(at,k)|0,s=s+Math.imul(lt,S)|0,y=y+Math.imul(lt,k)|0,p=p+Math.imul(U,B)|0,s=s+Math.imul(U,M)|0,s=s+Math.imul(W,B)|0,y=y+Math.imul(W,M)|0;var Pt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,p=Math.imul(ie,Qt),s=Math.imul(ie,ne),s=s+Math.imul(Xt,Qt)|0,y=Math.imul(Xt,ne),p=p+Math.imul($t,te)|0,s=s+Math.imul($t,oe)|0,s=s+Math.imul(jt,te)|0,y=y+Math.imul(jt,oe)|0,p=p+Math.imul(Dt,ce)|0,s=s+Math.imul(Dt,he)|0,s=s+Math.imul(Vt,ce)|0,y=y+Math.imul(Vt,he)|0,p=p+Math.imul(Zt,Wt)|0,s=s+Math.imul(Zt,Gt)|0,s=s+Math.imul(Ht,Wt)|0,y=y+Math.imul(Ht,Gt)|0,p=p+Math.imul(ee,se)|0,s=s+Math.imul(ee,fe)|0,s=s+Math.imul(zt,se)|0,y=y+Math.imul(zt,fe)|0,p=p+Math.imul(Ct,Mt)|0,s=s+Math.imul(Ct,ue)|0,s=s+Math.imul(Kt,Mt)|0,y=y+Math.imul(Kt,ue)|0,p=p+Math.imul(gt,S)|0,s=s+Math.imul(gt,k)|0,s=s+Math.imul(St,S)|0,y=y+Math.imul(St,k)|0,p=p+Math.imul(at,B)|0,s=s+Math.imul(at,M)|0,s=s+Math.imul(lt,B)|0,y=y+Math.imul(lt,M)|0,p=p+Math.imul(U,N)|0,s=s+Math.imul(U,V)|0,s=s+Math.imul(W,N)|0,y=y+Math.imul(W,V)|0;var mt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(mt>>>26)|0,mt&=67108863,p=Math.imul(re,Qt),s=Math.imul(re,ne),s=s+Math.imul(Jt,Qt)|0,y=Math.imul(Jt,ne),p=p+Math.imul(ie,te)|0,s=s+Math.imul(ie,oe)|0,s=s+Math.imul(Xt,te)|0,y=y+Math.imul(Xt,oe)|0,p=p+Math.imul($t,ce)|0,s=s+Math.imul($t,he)|0,s=s+Math.imul(jt,ce)|0,y=y+Math.imul(jt,he)|0,p=p+Math.imul(Dt,Wt)|0,s=s+Math.imul(Dt,Gt)|0,s=s+Math.imul(Vt,Wt)|0,y=y+Math.imul(Vt,Gt)|0,p=p+Math.imul(Zt,se)|0,s=s+Math.imul(Zt,fe)|0,s=s+Math.imul(Ht,se)|0,y=y+Math.imul(Ht,fe)|0,p=p+Math.imul(ee,Mt)|0,s=s+Math.imul(ee,ue)|0,s=s+Math.imul(zt,Mt)|0,y=y+Math.imul(zt,ue)|0,p=p+Math.imul(Ct,S)|0,s=s+Math.imul(Ct,k)|0,s=s+Math.imul(Kt,S)|0,y=y+Math.imul(Kt,k)|0,p=p+Math.imul(gt,B)|0,s=s+Math.imul(gt,M)|0,s=s+Math.imul(St,B)|0,y=y+Math.imul(St,M)|0,p=p+Math.imul(at,N)|0,s=s+Math.imul(at,V)|0,s=s+Math.imul(lt,N)|0,y=y+Math.imul(lt,V)|0,p=p+Math.imul(U,J)|0,s=s+Math.imul(U,dt)|0,s=s+Math.imul(W,J)|0,y=y+Math.imul(W,dt)|0;var _t=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(_t>>>26)|0,_t&=67108863,p=Math.imul(re,te),s=Math.imul(re,oe),s=s+Math.imul(Jt,te)|0,y=Math.imul(Jt,oe),p=p+Math.imul(ie,ce)|0,s=s+Math.imul(ie,he)|0,s=s+Math.imul(Xt,ce)|0,y=y+Math.imul(Xt,he)|0,p=p+Math.imul($t,Wt)|0,s=s+Math.imul($t,Gt)|0,s=s+Math.imul(jt,Wt)|0,y=y+Math.imul(jt,Gt)|0,p=p+Math.imul(Dt,se)|0,s=s+Math.imul(Dt,fe)|0,s=s+Math.imul(Vt,se)|0,y=y+Math.imul(Vt,fe)|0,p=p+Math.imul(Zt,Mt)|0,s=s+Math.imul(Zt,ue)|0,s=s+Math.imul(Ht,Mt)|0,y=y+Math.imul(Ht,ue)|0,p=p+Math.imul(ee,S)|0,s=s+Math.imul(ee,k)|0,s=s+Math.imul(zt,S)|0,y=y+Math.imul(zt,k)|0,p=p+Math.imul(Ct,B)|0,s=s+Math.imul(Ct,M)|0,s=s+Math.imul(Kt,B)|0,y=y+Math.imul(Kt,M)|0,p=p+Math.imul(gt,N)|0,s=s+Math.imul(gt,V)|0,s=s+Math.imul(St,N)|0,y=y+Math.imul(St,V)|0,p=p+Math.imul(at,J)|0,s=s+Math.imul(at,dt)|0,s=s+Math.imul(lt,J)|0,y=y+Math.imul(lt,dt)|0;var ht=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(ht>>>26)|0,ht&=67108863,p=Math.imul(re,ce),s=Math.imul(re,he),s=s+Math.imul(Jt,ce)|0,y=Math.imul(Jt,he),p=p+Math.imul(ie,Wt)|0,s=s+Math.imul(ie,Gt)|0,s=s+Math.imul(Xt,Wt)|0,y=y+Math.imul(Xt,Gt)|0,p=p+Math.imul($t,se)|0,s=s+Math.imul($t,fe)|0,s=s+Math.imul(jt,se)|0,y=y+Math.imul(jt,fe)|0,p=p+Math.imul(Dt,Mt)|0,s=s+Math.imul(Dt,ue)|0,s=s+Math.imul(Vt,Mt)|0,y=y+Math.imul(Vt,ue)|0,p=p+Math.imul(Zt,S)|0,s=s+Math.imul(Zt,k)|0,s=s+Math.imul(Ht,S)|0,y=y+Math.imul(Ht,k)|0,p=p+Math.imul(ee,B)|0,s=s+Math.imul(ee,M)|0,s=s+Math.imul(zt,B)|0,y=y+Math.imul(zt,M)|0,p=p+Math.imul(Ct,N)|0,s=s+Math.imul(Ct,V)|0,s=s+Math.imul(Kt,N)|0,y=y+Math.imul(Kt,V)|0,p=p+Math.imul(gt,J)|0,s=s+Math.imul(gt,dt)|0,s=s+Math.imul(St,J)|0,y=y+Math.imul(St,dt)|0;var wt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(wt>>>26)|0,wt&=67108863,p=Math.imul(re,Wt),s=Math.imul(re,Gt),s=s+Math.imul(Jt,Wt)|0,y=Math.imul(Jt,Gt),p=p+Math.imul(ie,se)|0,s=s+Math.imul(ie,fe)|0,s=s+Math.imul(Xt,se)|0,y=y+Math.imul(Xt,fe)|0,p=p+Math.imul($t,Mt)|0,s=s+Math.imul($t,ue)|0,s=s+Math.imul(jt,Mt)|0,y=y+Math.imul(jt,ue)|0,p=p+Math.imul(Dt,S)|0,s=s+Math.imul(Dt,k)|0,s=s+Math.imul(Vt,S)|0,y=y+Math.imul(Vt,k)|0,p=p+Math.imul(Zt,B)|0,s=s+Math.imul(Zt,M)|0,s=s+Math.imul(Ht,B)|0,y=y+Math.imul(Ht,M)|0,p=p+Math.imul(ee,N)|0,s=s+Math.imul(ee,V)|0,s=s+Math.imul(zt,N)|0,y=y+Math.imul(zt,V)|0,p=p+Math.imul(Ct,J)|0,s=s+Math.imul(Ct,dt)|0,s=s+Math.imul(Kt,J)|0,y=y+Math.imul(Kt,dt)|0;var bt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(bt>>>26)|0,bt&=67108863,p=Math.imul(re,se),s=Math.imul(re,fe),s=s+Math.imul(Jt,se)|0,y=Math.imul(Jt,fe),p=p+Math.imul(ie,Mt)|0,s=s+Math.imul(ie,ue)|0,s=s+Math.imul(Xt,Mt)|0,y=y+Math.imul(Xt,ue)|0,p=p+Math.imul($t,S)|0,s=s+Math.imul($t,k)|0,s=s+Math.imul(jt,S)|0,y=y+Math.imul(jt,k)|0,p=p+Math.imul(Dt,B)|0,s=s+Math.imul(Dt,M)|0,s=s+Math.imul(Vt,B)|0,y=y+Math.imul(Vt,M)|0,p=p+Math.imul(Zt,N)|0,s=s+Math.imul(Zt,V)|0,s=s+Math.imul(Ht,N)|0,y=y+Math.imul(Ht,V)|0,p=p+Math.imul(ee,J)|0,s=s+Math.imul(ee,dt)|0,s=s+Math.imul(zt,J)|0,y=y+Math.imul(zt,dt)|0;var ut=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(ut>>>26)|0,ut&=67108863,p=Math.imul(re,Mt),s=Math.imul(re,ue),s=s+Math.imul(Jt,Mt)|0,y=Math.imul(Jt,ue),p=p+Math.imul(ie,S)|0,s=s+Math.imul(ie,k)|0,s=s+Math.imul(Xt,S)|0,y=y+Math.imul(Xt,k)|0,p=p+Math.imul($t,B)|0,s=s+Math.imul($t,M)|0,s=s+Math.imul(jt,B)|0,y=y+Math.imul(jt,M)|0,p=p+Math.imul(Dt,N)|0,s=s+Math.imul(Dt,V)|0,s=s+Math.imul(Vt,N)|0,y=y+Math.imul(Vt,V)|0,p=p+Math.imul(Zt,J)|0,s=s+Math.imul(Zt,dt)|0,s=s+Math.imul(Ht,J)|0,y=y+Math.imul(Ht,dt)|0;var F=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(F>>>26)|0,F&=67108863,p=Math.imul(re,S),s=Math.imul(re,k),s=s+Math.imul(Jt,S)|0,y=Math.imul(Jt,k),p=p+Math.imul(ie,B)|0,s=s+Math.imul(ie,M)|0,s=s+Math.imul(Xt,B)|0,y=y+Math.imul(Xt,M)|0,p=p+Math.imul($t,N)|0,s=s+Math.imul($t,V)|0,s=s+Math.imul(jt,N)|0,y=y+Math.imul(jt,V)|0,p=p+Math.imul(Dt,J)|0,s=s+Math.imul(Dt,dt)|0,s=s+Math.imul(Vt,J)|0,y=y+Math.imul(Vt,dt)|0;var K=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(K>>>26)|0,K&=67108863,p=Math.imul(re,B),s=Math.imul(re,M),s=s+Math.imul(Jt,B)|0,y=Math.imul(Jt,M),p=p+Math.imul(ie,N)|0,s=s+Math.imul(ie,V)|0,s=s+Math.imul(Xt,N)|0,y=y+Math.imul(Xt,V)|0,p=p+Math.imul($t,J)|0,s=s+Math.imul($t,dt)|0,s=s+Math.imul(jt,J)|0,y=y+Math.imul(jt,dt)|0;var Q=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Q>>>26)|0,Q&=67108863,p=Math.imul(re,N),s=Math.imul(re,V),s=s+Math.imul(Jt,N)|0,y=Math.imul(Jt,V),p=p+Math.imul(ie,J)|0,s=s+Math.imul(ie,dt)|0,s=s+Math.imul(Xt,J)|0,y=y+Math.imul(Xt,dt)|0;var Y=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Y>>>26)|0,Y&=67108863,p=Math.imul(re,J),s=Math.imul(re,dt),s=s+Math.imul(Jt,J)|0,y=Math.imul(Jt,dt);var Z=(v+p|0)+((s&8191)<<13)|0;return v=(y+(s>>>13)|0)+(Z>>>26)|0,Z&=67108863,m[0]=pt,m[1]=It,m[2]=Rt,m[3]=Ft,m[4]=qt,m[5]=Tt,m[6]=Ut,m[7]=Pt,m[8]=mt,m[9]=_t,m[10]=ht,m[11]=wt,m[12]=bt,m[13]=ut,m[14]=F,m[15]=K,m[16]=Q,m[17]=Y,m[18]=Z,v!==0&&(m[19]=v,u.length++),u};Math.imul||(X=C);function ot(g,i,a){a.negative=i.negative^g.negative,a.length=g.length+i.length;for(var u=0,c=0,d=0;d>>26)|0,c+=m>>>26,m&=67108863}a.words[d]=v,u=m,m=c}return u!==0?a.words[d]=u:a.length--,a._strip()}function G(g,i,a){return ot(g,i,a)}o.prototype.mulTo=function(i,a){var u,c=this.length+i.length;return this.length===10&&i.length===10?u=X(this,i,a):c<63?u=C(this,i,a):c<1024?u=ot(this,i,a):u=G(this,i,a),u};function it(g,i){this.x=g,this.y=i}it.prototype.makeRBT=function(i){for(var a=new Array(i),u=o.prototype._countBits(i)-1,c=0;c>=1;return c},it.prototype.permute=function(i,a,u,c,d,m){for(var v=0;v>>1)d++;return 1<>>13,u[2*m+1]=d&8191,d=d>>>13;for(m=2*a;m>=26,u+=d/67108864|0,u+=m>>>26,this.words[c]=m&67108863}return u!==0&&(this.words[c]=u,this.length++),a?this.ineg():this},o.prototype.muln=function(i){return this.clone().imuln(i)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(i){var a=D(i);if(a.length===0)return new o(1);for(var u=this,c=0;c=0);var a=i%26,u=(i-a)/26,c=67108863>>>26-a<<26-a,d;if(a!==0){var m=0;for(d=0;d>>26-a}m&&(this.words[d]=m,this.length++)}if(u!==0){for(d=this.length-1;d>=0;d--)this.words[d+u]=this.words[d];for(d=0;d=0);var c;a?c=(a-a%26)/26:c=0;var d=i%26,m=Math.min((i-d)/26,this.length),v=67108863^67108863>>>d<m)for(this.length-=m,s=0;s=0&&(y!==0||s>=c);s--){var R=this.words[s]|0;this.words[s]=y<<26-d|R>>>d,y=R&v}return p&&y!==0&&(p.words[p.length++]=y),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(i,a,u){return e(this.negative===0),this.iushrn(i,a,u)},o.prototype.shln=function(i){return this.clone().ishln(i)},o.prototype.ushln=function(i){return this.clone().iushln(i)},o.prototype.shrn=function(i){return this.clone().ishrn(i)},o.prototype.ushrn=function(i){return this.clone().iushrn(i)},o.prototype.testn=function(i){e(typeof i=="number"&&i>=0);var a=i%26,u=(i-a)/26,c=1<=0);var a=i%26,u=(i-a)/26;if(e(this.negative===0,"imaskn works only with positive numbers"),this.length<=u)return this;if(a!==0&&u++,this.length=Math.min(u,this.length),a!==0){var c=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},o.prototype.isubn=function(i){if(e(typeof i=="number"),e(i<67108864),i<0)return this.iaddn(-i);if(this.negative!==0)return this.negative=0,this.iaddn(i),this.negative=1,this;if(this.words[0]-=i,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(p/67108864|0),this.words[d+u]=m&67108863}for(;d>26,this.words[d+u]=m&67108863;if(v===0)return this._strip();for(e(v===-1),v=0,d=0;d>26,this.words[d]=m&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(i,a){var u=this.length-i.length,c=this.clone(),d=i,m=d.words[d.length-1]|0,v=this._countBits(m);u=26-v,u!==0&&(d=d.ushln(u),c.iushln(u),m=d.words[d.length-1]|0);var p=c.length-d.length,s;if(a!=="mod"){s=new o(null),s.length=p+1,s.words=new Array(s.length);for(var y=0;y=0;U--){var W=(c.words[d.length+U]|0)*67108864+(c.words[d.length+U-1]|0);for(W=Math.min(W/m|0,67108863),c._ishlnsubmul(d,W,U);c.negative!==0;)W--,c.negative=0,c._ishlnsubmul(d,1,U),c.isZero()||(c.negative^=1);s&&(s.words[U]=W)}return s&&s._strip(),c._strip(),a!=="div"&&u!==0&&c.iushrn(u),{div:s||null,mod:c}},o.prototype.divmod=function(i,a,u){if(e(!i.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var c,d,m;return this.negative!==0&&i.negative===0?(m=this.neg().divmod(i,a),a!=="mod"&&(c=m.div.neg()),a!=="div"&&(d=m.mod.neg(),u&&d.negative!==0&&d.iadd(i)),{div:c,mod:d}):this.negative===0&&i.negative!==0?(m=this.divmod(i.neg(),a),a!=="mod"&&(c=m.div.neg()),{div:c,mod:m.mod}):this.negative&i.negative?(m=this.neg().divmod(i.neg(),a),a!=="div"&&(d=m.mod.neg(),u&&d.negative!==0&&d.isub(i)),{div:m.div,mod:d}):i.length>this.length||this.cmp(i)<0?{div:new o(0),mod:this}:i.length===1?a==="div"?{div:this.divn(i.words[0]),mod:null}:a==="mod"?{div:null,mod:new o(this.modrn(i.words[0]))}:{div:this.divn(i.words[0]),mod:new o(this.modrn(i.words[0]))}:this._wordDiv(i,a)},o.prototype.div=function(i){return this.divmod(i,"div",!1).div},o.prototype.mod=function(i){return this.divmod(i,"mod",!1).mod},o.prototype.umod=function(i){return this.divmod(i,"mod",!0).mod},o.prototype.divRound=function(i){var a=this.divmod(i);if(a.mod.isZero())return a.div;var u=a.div.negative!==0?a.mod.isub(i):a.mod,c=i.ushrn(1),d=i.andln(1),m=u.cmp(c);return m<0||d===1&&m===0?a.div:a.div.negative!==0?a.div.isubn(1):a.div.iaddn(1)},o.prototype.modrn=function(i){var a=i<0;a&&(i=-i),e(i<=67108863);for(var u=(1<<26)%i,c=0,d=this.length-1;d>=0;d--)c=(u*c+(this.words[d]|0))%i;return a?-c:c},o.prototype.modn=function(i){return this.modrn(i)},o.prototype.idivn=function(i){var a=i<0;a&&(i=-i),e(i<=67108863);for(var u=0,c=this.length-1;c>=0;c--){var d=(this.words[c]|0)+u*67108864;this.words[c]=d/i|0,u=d%i}return this._strip(),a?this.ineg():this},o.prototype.divn=function(i){return this.clone().idivn(i)},o.prototype.egcd=function(i){e(i.negative===0),e(!i.isZero());var a=this,u=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var c=new o(1),d=new o(0),m=new o(0),v=new o(1),p=0;a.isEven()&&u.isEven();)a.iushrn(1),u.iushrn(1),++p;for(var s=u.clone(),y=a.clone();!a.isZero();){for(var R=0,U=1;!(a.words[0]&U)&&R<26;++R,U<<=1);if(R>0)for(a.iushrn(R);R-- >0;)(c.isOdd()||d.isOdd())&&(c.iadd(s),d.isub(y)),c.iushrn(1),d.iushrn(1);for(var W=0,tt=1;!(u.words[0]&tt)&&W<26;++W,tt<<=1);if(W>0)for(u.iushrn(W);W-- >0;)(m.isOdd()||v.isOdd())&&(m.iadd(s),v.isub(y)),m.iushrn(1),v.iushrn(1);a.cmp(u)>=0?(a.isub(u),c.isub(m),d.isub(v)):(u.isub(a),m.isub(c),v.isub(d))}return{a:m,b:v,gcd:u.iushln(p)}},o.prototype._invmp=function(i){e(i.negative===0),e(!i.isZero());var a=this,u=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var c=new o(1),d=new o(0),m=u.clone();a.cmpn(1)>0&&u.cmpn(1)>0;){for(var v=0,p=1;!(a.words[0]&p)&&v<26;++v,p<<=1);if(v>0)for(a.iushrn(v);v-- >0;)c.isOdd()&&c.iadd(m),c.iushrn(1);for(var s=0,y=1;!(u.words[0]&y)&&s<26;++s,y<<=1);if(s>0)for(u.iushrn(s);s-- >0;)d.isOdd()&&d.iadd(m),d.iushrn(1);a.cmp(u)>=0?(a.isub(u),c.isub(d)):(u.isub(a),d.isub(c))}var R;return a.cmpn(1)===0?R=c:R=d,R.cmpn(0)<0&&R.iadd(i),R},o.prototype.gcd=function(i){if(this.isZero())return i.abs();if(i.isZero())return this.abs();var a=this.clone(),u=i.clone();a.negative=0,u.negative=0;for(var c=0;a.isEven()&&u.isEven();c++)a.iushrn(1),u.iushrn(1);do{for(;a.isEven();)a.iushrn(1);for(;u.isEven();)u.iushrn(1);var d=a.cmp(u);if(d<0){var m=a;a=u,u=m}else if(d===0||u.cmpn(1)===0)break;a.isub(u)}while(!0);return u.iushln(c)},o.prototype.invm=function(i){return this.egcd(i).a.umod(i)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(i){return this.words[0]&i},o.prototype.bincn=function(i){e(typeof i=="number");var a=i%26,u=(i-a)/26,c=1<>>26,v&=67108863,this.words[m]=v}return d!==0&&(this.words[m]=d,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(i){var a=i<0;if(this.negative!==0&&!a)return-1;if(this.negative===0&&a)return 1;this._strip();var u;if(this.length>1)u=1;else{a&&(i=-i),e(i<=67108863,"Number is too big");var c=this.words[0]|0;u=c===i?0:ci.length)return 1;if(this.length=0;u--){var c=this.words[u]|0,d=i.words[u]|0;if(c!==d){cd&&(a=1);break}}return a},o.prototype.gtn=function(i){return this.cmpn(i)===1},o.prototype.gt=function(i){return this.cmp(i)===1},o.prototype.gten=function(i){return this.cmpn(i)>=0},o.prototype.gte=function(i){return this.cmp(i)>=0},o.prototype.ltn=function(i){return this.cmpn(i)===-1},o.prototype.lt=function(i){return this.cmp(i)===-1},o.prototype.lten=function(i){return this.cmpn(i)<=0},o.prototype.lte=function(i){return this.cmp(i)<=0},o.prototype.eqn=function(i){return this.cmpn(i)===0},o.prototype.eq=function(i){return this.cmp(i)===0},o.red=function(i){return new ct(i)},o.prototype.toRed=function(i){return e(!this.red,"Already a number in reduction context"),e(this.negative===0,"red works only with positives"),i.convertTo(this)._forceRed(i)},o.prototype.fromRed=function(){return e(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(i){return this.red=i,this},o.prototype.forceRed=function(i){return e(!this.red,"Already a number in reduction context"),this._forceRed(i)},o.prototype.redAdd=function(i){return e(this.red,"redAdd works only with red numbers"),this.red.add(this,i)},o.prototype.redIAdd=function(i){return e(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,i)},o.prototype.redSub=function(i){return e(this.red,"redSub works only with red numbers"),this.red.sub(this,i)},o.prototype.redISub=function(i){return e(this.red,"redISub works only with red numbers"),this.red.isub(this,i)},o.prototype.redShl=function(i){return e(this.red,"redShl works only with red numbers"),this.red.shl(this,i)},o.prototype.redMul=function(i){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.mul(this,i)},o.prototype.redIMul=function(i){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.imul(this,i)},o.prototype.redSqr=function(){return e(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return e(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return e(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return e(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return e(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(i){return e(this.red&&!i.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,i)};var kt={k256:null,p224:null,p192:null,p25519:null};function st(g,i){this.name=g,this.p=new o(i,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}st.prototype._tmp=function(){var i=new o(null);return i.words=new Array(Math.ceil(this.n/13)),i},st.prototype.ireduce=function(i){var a=i,u;do this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),u=a.bitLength();while(u>this.n);var c=u0?a.isub(this.p):a.strip!==void 0?a.strip():a._strip(),a},st.prototype.split=function(i,a){i.iushrn(this.n,0,a)},st.prototype.imulK=function(i){return i.imul(this.k)};function yt(){st.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(yt,st),yt.prototype.split=function(i,a){for(var u=4194303,c=Math.min(i.length,9),d=0;d>>22,m=v}m>>>=22,i.words[d-10]=m,m===0&&i.length>10?i.length-=10:i.length-=9},yt.prototype.imulK=function(i){i.words[i.length]=0,i.words[i.length+1]=0,i.length+=2;for(var a=0,u=0;u>>=26,i.words[u]=d,a=c}return a!==0&&(i.words[i.length++]=a),i},o._prime=function(i){if(kt[i])return kt[i];var a;if(i==="k256")a=new yt;else if(i==="p224")a=new At;else if(i==="p192")a=new Et;else if(i==="p25519")a=new be;else throw new Error("Unknown prime "+i);return kt[i]=a,a};function ct(g){if(typeof g=="string"){var i=o._prime(g);this.m=i.p,this.prime=i}else e(g.gtn(1),"modulus must be greater than 1"),this.m=g,this.prime=null}ct.prototype._verify1=function(i){e(i.negative===0,"red works only with positives"),e(i.red,"red works only with red numbers")},ct.prototype._verify2=function(i,a){e((i.negative|a.negative)===0,"red works only with positives"),e(i.red&&i.red===a.red,"red works only with red numbers")},ct.prototype.imod=function(i){return this.prime?this.prime.ireduce(i)._forceRed(this):(_(i,i.umod(this.m)._forceRed(this)),i)},ct.prototype.neg=function(i){return i.isZero()?i.clone():this.m.sub(i)._forceRed(this)},ct.prototype.add=function(i,a){this._verify2(i,a);var u=i.add(a);return u.cmp(this.m)>=0&&u.isub(this.m),u._forceRed(this)},ct.prototype.iadd=function(i,a){this._verify2(i,a);var u=i.iadd(a);return u.cmp(this.m)>=0&&u.isub(this.m),u},ct.prototype.sub=function(i,a){this._verify2(i,a);var u=i.sub(a);return u.cmpn(0)<0&&u.iadd(this.m),u._forceRed(this)},ct.prototype.isub=function(i,a){this._verify2(i,a);var u=i.isub(a);return u.cmpn(0)<0&&u.iadd(this.m),u},ct.prototype.shl=function(i,a){return this._verify1(i),this.imod(i.ushln(a))},ct.prototype.imul=function(i,a){return this._verify2(i,a),this.imod(i.imul(a))},ct.prototype.mul=function(i,a){return this._verify2(i,a),this.imod(i.mul(a))},ct.prototype.isqr=function(i){return this.imul(i,i.clone())},ct.prototype.sqr=function(i){return this.mul(i,i)},ct.prototype.sqrt=function(i){if(i.isZero())return i.clone();var a=this.m.andln(3);if(e(a%2===1),a===3){var u=this.m.add(new o(1)).iushrn(2);return this.pow(i,u)}for(var c=this.m.subn(1),d=0;!c.isZero()&&c.andln(1)===0;)d++,c.iushrn(1);e(!c.isZero());var m=new o(1).toRed(this),v=m.redNeg(),p=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new o(2*s*s).toRed(this);this.pow(s,p).cmp(v)!==0;)s.redIAdd(v);for(var y=this.pow(s,c),R=this.pow(i,c.addn(1).iushrn(1)),U=this.pow(i,c),W=d;U.cmp(m)!==0;){for(var tt=U,at=0;tt.cmp(m)!==0;at++)tt=tt.redSqr();e(at=0;d--){for(var y=a.words[d],R=s-1;R>=0;R--){var U=y>>R&1;if(m!==c[0]&&(m=this.sqr(m)),U===0&&v===0){p=0;continue}v<<=1,v|=U,p++,!(p!==u&&(d!==0||R!==0))&&(m=this.mul(m,c[v]),p=0,v=0)}s=26}return m},ct.prototype.convertTo=function(i){var a=i.umod(this.m);return a===i?a.clone():a},ct.prototype.convertFrom=function(i){var a=i.clone();return a.red=null,a},o.mont=function(i){return new Lt(i)};function Lt(g){ct.call(this,g),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(Lt,ct),Lt.prototype.convertTo=function(i){return this.imod(i.ushln(this.shift))},Lt.prototype.convertFrom=function(i){var a=this.imod(i.mul(this.rinv));return a.red=null,a},Lt.prototype.imul=function(i,a){if(i.isZero()||a.isZero())return i.words[0]=0,i.length=1,i;var u=i.imul(a),c=u.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=u.isub(c).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},Lt.prototype.mul=function(i,a){if(i.isZero()||a.isZero())return new o(0)._forceRed(this);var u=i.mul(a),c=u.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=u.isub(c).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},Lt.prototype.invm=function(i){var a=this.imod(i._invmp(this.m).mul(this.r2));return a._forceRed(this)}})(typeof Ws>"u"||Ws,$f)});var Zf=Ve((Hs,Yf)=>{var t1=H(j());var uo=An(),Fr=uo.Buffer;function Gf(r,t){for(var e in r)t[e]=r[e]}Fr.from&&Fr.alloc&&Fr.allocUnsafe&&Fr.allocUnsafeSlow?Yf.exports=uo:(Gf(uo,Hs),Hs.Buffer=On);function On(r,t,e){return Fr(r,t,e)}On.prototype=Object.create(Fr.prototype);Gf(Fr,On);On.from=function(r,t,e){if(typeof r=="number")throw new TypeError("Argument must not be a number");return Fr(r,t,e)};On.alloc=function(r,t,e){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=Fr(r);return t!==void 0?typeof e=="string"?n.fill(t,e):n.fill(t):n.fill(0),n};On.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Fr(r)};On.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return uo.SlowBuffer(r)}});var Jf=Ve((e1,Xf)=>{"use strict";var r1=H(j()),co=Zf().Buffer;function _0(r){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),e=0;e>>0,G=new Uint8Array(ot);C!==X;){for(var it=P[C],kt=0,st=ot-1;(it!==0||kt>>0,G[st]=it%h>>>0,it=it/h>>>0;if(it!==0)throw new Error("Non-zero carry");D=kt,C++}for(var yt=ot-D;yt!==ot&&G[yt]===0;)yt++;for(var At=x.repeat(rt);yt>>0,ot=new Uint8Array(X);rt>>0,ot[kt]=G%256>>>0,G=G/256>>>0;if(G!==0)throw new Error("Non-zero carry");C=it,rt++}for(var st=X-C;st!==X&&ot[st]===0;)st++;var yt=co.allocUnsafe(D+(X-st));yt.fill(0,0,D);for(var At=D;st!==X;)yt[At++]=ot[st++];return yt}function O(P){var rt=L(P);if(rt)return rt;throw new Error("Non-base"+h+" character")}return{encode:E,decodeUnsafe:L,decode:O}}Xf.exports=_0});var Vs=Ve((n1,Qf)=>{var i1=H(j()),A0=Jf(),M0="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";Qf.exports=A0(M0)});var f1,I0,yn,gn,$s,xi,js=le(()=>{f1=H(j(),1);ws();fn();I0=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),yn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),gn=new Uint32Array(64),$s=class extends Xn{constructor(){super(64,32,8,!1),this.A=yn[0]|0,this.B=yn[1]|0,this.C=yn[2]|0,this.D=yn[3]|0,this.E=yn[4]|0,this.F=yn[5]|0,this.G=yn[6]|0,this.H=yn[7]|0}get(){let{A:t,B:e,C:n,D:o,E:f,F:h,G:x,H:b}=this;return[t,e,n,o,f,h,x,b]}set(t,e,n,o,f,h,x,b){this.A=t|0,this.B=e|0,this.C=n|0,this.D=o|0,this.E=f|0,this.F=h|0,this.G=x|0,this.H=b|0}process(t,e){for(let L=0;L<16;L++,e+=4)gn[L]=t.getUint32(e,!1);for(let L=16;L<64;L++){let O=gn[L-15],P=gn[L-2],rt=Lr(O,7)^Lr(O,18)^O>>>3,D=Lr(P,17)^Lr(P,19)^P>>>10;gn[L]=D+gn[L-7]+rt+gn[L-16]|0}let{A:n,B:o,C:f,D:h,E:x,F:b,G:_,H:E}=this;for(let L=0;L<64;L++){let O=Lr(x,6)^Lr(x,11)^Lr(x,25),P=E+O+_f(x,b,_)+I0[L]+gn[L]|0,D=(Lr(n,2)^Lr(n,13)^Lr(n,22))+Af(n,o,f)|0;E=_,_=b,b=x,x=h+P|0,h=f,f=o,o=n,n=P+D|0}n=n+this.A|0,o=o+this.B|0,f=f+this.C|0,h=h+this.D|0,x=x+this.E|0,b=b+this.F|0,_=_+this.G|0,E=E+this.H|0,this.set(n,o,f,h,x,b,_,E)}roundClean(){gn.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},xi=Zn(()=>new $s)});var eu=Ve((tu,Gs)=>{var u1=H(j());(function(r,t){"use strict";function e(g,i){if(!g)throw new Error(i||"Assertion failed")}function n(g,i){g.super_=i;var a=function(){};a.prototype=i.prototype,g.prototype=new a,g.prototype.constructor=g}function o(g,i,a){if(o.isBN(g))return g;this.negative=0,this.words=null,this.length=0,this.red=null,g!==null&&((i==="le"||i==="be")&&(a=i,i=10),this._init(g||0,i||10,a||"be"))}typeof r=="object"?r.exports=o:t.BN=o,o.BN=o,o.wordSize=26;var f;try{typeof window<"u"&&typeof window.Buffer<"u"?f=window.Buffer:f=Ds().Buffer}catch{}o.isBN=function(i){return i instanceof o?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===o.wordSize&&Array.isArray(i.words)},o.max=function(i,a){return i.cmp(a)>0?i:a},o.min=function(i,a){return i.cmp(a)<0?i:a},o.prototype._init=function(i,a,u){if(typeof i=="number")return this._initNumber(i,a,u);if(typeof i=="object")return this._initArray(i,a,u);a==="hex"&&(a=16),e(a===(a|0)&&a>=2&&a<=36),i=i.toString().replace(/\\s+/g,"");var c=0;i[0]==="-"&&(c++,this.negative=1),c=0;c-=3)m=i[c]|i[c-1]<<8|i[c-2]<<16,this.words[d]|=m<>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(u==="le")for(c=0,d=0;c>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this._strip()};function h(g,i){var a=g.charCodeAt(i);if(a>=48&&a<=57)return a-48;if(a>=65&&a<=70)return a-55;if(a>=97&&a<=102)return a-87;e(!1,"Invalid character in "+g)}function x(g,i,a){var u=h(g,a);return a-1>=i&&(u|=h(g,a-1)<<4),u}o.prototype._parseHex=function(i,a,u){this.length=Math.ceil((i.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)v=x(i,a,c)<=18?(d-=18,m+=1,this.words[m]|=v>>>26):d+=8;else{var p=i.length-a;for(c=p%2===0?a+1:a;c=18?(d-=18,m+=1,this.words[m]|=v>>>26):d+=8}this._strip()};function b(g,i,a,u){for(var c=0,d=0,m=Math.min(g.length,a),v=i;v=49?d=p-49+10:p>=17?d=p-17+10:d=p,e(p>=0&&d1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=E}catch{o.prototype.inspect=E}else o.prototype.inspect=E;function E(){return(this.red?""}var L=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],O=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(i,a){i=i||10,a=a|0||1;var u;if(i===16||i==="hex"){u="";for(var c=0,d=0,m=0;m>>24-c&16777215,c+=2,c>=26&&(c-=26,m--),d!==0||m!==this.length-1?u=L[6-p.length]+p+u:u=p+u}for(d!==0&&(u=d.toString(16)+u);u.length%a!==0;)u="0"+u;return this.negative!==0&&(u="-"+u),u}if(i===(i|0)&&i>=2&&i<=36){var s=O[i],y=P[i];u="";var R=this.clone();for(R.negative=0;!R.isZero();){var U=R.modrn(y).toString(i);R=R.idivn(y),R.isZero()?u=U+u:u=L[s-U.length]+U+u}for(this.isZero()&&(u="0"+u);u.length%a!==0;)u="0"+u;return this.negative!==0&&(u="-"+u),u}e(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&e(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},o.prototype.toJSON=function(){return this.toString(16,2)},f&&(o.prototype.toBuffer=function(i,a){return this.toArrayLike(f,i,a)}),o.prototype.toArray=function(i,a){return this.toArrayLike(Array,i,a)};var rt=function(i,a){return i.allocUnsafe?i.allocUnsafe(a):new i(a)};o.prototype.toArrayLike=function(i,a,u){this._strip();var c=this.byteLength(),d=u||Math.max(1,c);e(c<=d,"byte array longer than desired length"),e(d>0,"Requested array length <= 0");var m=rt(i,d),v=a==="le"?"LE":"BE";return this["_toArrayLike"+v](m,c),m},o.prototype._toArrayLikeLE=function(i,a){for(var u=0,c=0,d=0,m=0;d>8&255),u>16&255),m===6?(u>24&255),c=0,m=0):(c=v>>>24,m+=2)}if(u=0&&(i[u--]=v>>8&255),u>=0&&(i[u--]=v>>16&255),m===6?(u>=0&&(i[u--]=v>>24&255),c=0,m=0):(c=v>>>24,m+=2)}if(u>=0)for(i[u--]=c;u>=0;)i[u--]=0},Math.clz32?o.prototype._countBits=function(i){return 32-Math.clz32(i)}:o.prototype._countBits=function(i){var a=i,u=0;return a>=4096&&(u+=13,a>>>=13),a>=64&&(u+=7,a>>>=7),a>=8&&(u+=4,a>>>=4),a>=2&&(u+=2,a>>>=2),u+a},o.prototype._zeroBits=function(i){if(i===0)return 26;var a=i,u=0;return a&8191||(u+=13,a>>>=13),a&127||(u+=7,a>>>=7),a&15||(u+=4,a>>>=4),a&3||(u+=2,a>>>=2),a&1||u++,u},o.prototype.bitLength=function(){var i=this.words[this.length-1],a=this._countBits(i);return(this.length-1)*26+a};function D(g){for(var i=new Array(g.bitLength()),a=0;a>>c&1}return i}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,a=0;ai.length?this.clone().ior(i):i.clone().ior(this)},o.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},o.prototype.iuand=function(i){var a;this.length>i.length?a=i:a=this;for(var u=0;ui.length?this.clone().iand(i):i.clone().iand(this)},o.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},o.prototype.iuxor=function(i){var a,u;this.length>i.length?(a=this,u=i):(a=i,u=this);for(var c=0;ci.length?this.clone().ixor(i):i.clone().ixor(this)},o.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},o.prototype.inotn=function(i){e(typeof i=="number"&&i>=0);var a=Math.ceil(i/26)|0,u=i%26;this._expand(a),u>0&&a--;for(var c=0;c0&&(this.words[c]=~this.words[c]&67108863>>26-u),this._strip()},o.prototype.notn=function(i){return this.clone().inotn(i)},o.prototype.setn=function(i,a){e(typeof i=="number"&&i>=0);var u=i/26|0,c=i%26;return this._expand(u+1),a?this.words[u]=this.words[u]|1<i.length?(u=this,c=i):(u=i,c=this);for(var d=0,m=0;m>>26;for(;d!==0&&m>>26;if(this.length=u.length,d!==0)this.words[this.length]=d,this.length++;else if(u!==this)for(;mi.length?this.clone().iadd(i):i.clone().iadd(this)},o.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var a=this.iadd(i);return i.negative=1,a._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var u=this.cmp(i);if(u===0)return this.negative=0,this.length=1,this.words[0]=0,this;var c,d;u>0?(c=this,d=i):(c=i,d=this);for(var m=0,v=0;v>26,this.words[v]=a&67108863;for(;m!==0&&v>26,this.words[v]=a&67108863;if(m===0&&v>>26,R=p&67108863,U=Math.min(s,i.length-1),W=Math.max(0,s-g.length+1);W<=U;W++){var tt=s-W|0;c=g.words[tt]|0,d=i.words[W]|0,m=c*d+R,y+=m/67108864|0,R=m&67108863}a.words[s]=R|0,p=y|0}return p!==0?a.words[s]=p|0:a.length--,a._strip()}var X=function(i,a,u){var c=i.words,d=a.words,m=u.words,v=0,p,s,y,R=c[0]|0,U=R&8191,W=R>>>13,tt=c[1]|0,at=tt&8191,lt=tt>>>13,xe=c[2]|0,gt=xe&8191,St=xe>>>13,Ye=c[3]|0,Ct=Ye&8191,Kt=Ye>>>13,Ur=c[4]|0,ee=Ur&8191,zt=Ur>>>13,kr=c[5]|0,Zt=kr&8191,Ht=kr>>>13,br=c[6]|0,Dt=br&8191,Vt=br>>>13,xr=c[7]|0,$t=xr&8191,jt=xr>>>13,Or=c[8]|0,ie=Or&8191,Xt=Or>>>13,Mr=c[9]|0,re=Mr&8191,Jt=Mr>>>13,Sr=d[0]|0,Qt=Sr&8191,ne=Sr>>>13,Ir=d[1]|0,te=Ir&8191,oe=Ir>>>13,rn=d[2]|0,ce=rn&8191,he=rn>>>13,hr=d[3]|0,Wt=hr&8191,Gt=hr>>>13,Wr=d[4]|0,se=Wr&8191,fe=Wr>>>13,Bn=d[5]|0,Mt=Bn&8191,ue=Bn>>>13,w=d[6]|0,S=w&8191,k=w>>>13,l=d[7]|0,B=l&8191,M=l>>>13,T=d[8]|0,N=T&8191,V=T>>>13,Bt=d[9]|0,J=Bt&8191,dt=Bt>>>13;u.negative=i.negative^a.negative,u.length=19,p=Math.imul(U,Qt),s=Math.imul(U,ne),s=s+Math.imul(W,Qt)|0,y=Math.imul(W,ne);var pt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(pt>>>26)|0,pt&=67108863,p=Math.imul(at,Qt),s=Math.imul(at,ne),s=s+Math.imul(lt,Qt)|0,y=Math.imul(lt,ne),p=p+Math.imul(U,te)|0,s=s+Math.imul(U,oe)|0,s=s+Math.imul(W,te)|0,y=y+Math.imul(W,oe)|0;var It=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(It>>>26)|0,It&=67108863,p=Math.imul(gt,Qt),s=Math.imul(gt,ne),s=s+Math.imul(St,Qt)|0,y=Math.imul(St,ne),p=p+Math.imul(at,te)|0,s=s+Math.imul(at,oe)|0,s=s+Math.imul(lt,te)|0,y=y+Math.imul(lt,oe)|0,p=p+Math.imul(U,ce)|0,s=s+Math.imul(U,he)|0,s=s+Math.imul(W,ce)|0,y=y+Math.imul(W,he)|0;var Rt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,p=Math.imul(Ct,Qt),s=Math.imul(Ct,ne),s=s+Math.imul(Kt,Qt)|0,y=Math.imul(Kt,ne),p=p+Math.imul(gt,te)|0,s=s+Math.imul(gt,oe)|0,s=s+Math.imul(St,te)|0,y=y+Math.imul(St,oe)|0,p=p+Math.imul(at,ce)|0,s=s+Math.imul(at,he)|0,s=s+Math.imul(lt,ce)|0,y=y+Math.imul(lt,he)|0,p=p+Math.imul(U,Wt)|0,s=s+Math.imul(U,Gt)|0,s=s+Math.imul(W,Wt)|0,y=y+Math.imul(W,Gt)|0;var Ft=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,p=Math.imul(ee,Qt),s=Math.imul(ee,ne),s=s+Math.imul(zt,Qt)|0,y=Math.imul(zt,ne),p=p+Math.imul(Ct,te)|0,s=s+Math.imul(Ct,oe)|0,s=s+Math.imul(Kt,te)|0,y=y+Math.imul(Kt,oe)|0,p=p+Math.imul(gt,ce)|0,s=s+Math.imul(gt,he)|0,s=s+Math.imul(St,ce)|0,y=y+Math.imul(St,he)|0,p=p+Math.imul(at,Wt)|0,s=s+Math.imul(at,Gt)|0,s=s+Math.imul(lt,Wt)|0,y=y+Math.imul(lt,Gt)|0,p=p+Math.imul(U,se)|0,s=s+Math.imul(U,fe)|0,s=s+Math.imul(W,se)|0,y=y+Math.imul(W,fe)|0;var qt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(qt>>>26)|0,qt&=67108863,p=Math.imul(Zt,Qt),s=Math.imul(Zt,ne),s=s+Math.imul(Ht,Qt)|0,y=Math.imul(Ht,ne),p=p+Math.imul(ee,te)|0,s=s+Math.imul(ee,oe)|0,s=s+Math.imul(zt,te)|0,y=y+Math.imul(zt,oe)|0,p=p+Math.imul(Ct,ce)|0,s=s+Math.imul(Ct,he)|0,s=s+Math.imul(Kt,ce)|0,y=y+Math.imul(Kt,he)|0,p=p+Math.imul(gt,Wt)|0,s=s+Math.imul(gt,Gt)|0,s=s+Math.imul(St,Wt)|0,y=y+Math.imul(St,Gt)|0,p=p+Math.imul(at,se)|0,s=s+Math.imul(at,fe)|0,s=s+Math.imul(lt,se)|0,y=y+Math.imul(lt,fe)|0,p=p+Math.imul(U,Mt)|0,s=s+Math.imul(U,ue)|0,s=s+Math.imul(W,Mt)|0,y=y+Math.imul(W,ue)|0;var Tt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,p=Math.imul(Dt,Qt),s=Math.imul(Dt,ne),s=s+Math.imul(Vt,Qt)|0,y=Math.imul(Vt,ne),p=p+Math.imul(Zt,te)|0,s=s+Math.imul(Zt,oe)|0,s=s+Math.imul(Ht,te)|0,y=y+Math.imul(Ht,oe)|0,p=p+Math.imul(ee,ce)|0,s=s+Math.imul(ee,he)|0,s=s+Math.imul(zt,ce)|0,y=y+Math.imul(zt,he)|0,p=p+Math.imul(Ct,Wt)|0,s=s+Math.imul(Ct,Gt)|0,s=s+Math.imul(Kt,Wt)|0,y=y+Math.imul(Kt,Gt)|0,p=p+Math.imul(gt,se)|0,s=s+Math.imul(gt,fe)|0,s=s+Math.imul(St,se)|0,y=y+Math.imul(St,fe)|0,p=p+Math.imul(at,Mt)|0,s=s+Math.imul(at,ue)|0,s=s+Math.imul(lt,Mt)|0,y=y+Math.imul(lt,ue)|0,p=p+Math.imul(U,S)|0,s=s+Math.imul(U,k)|0,s=s+Math.imul(W,S)|0,y=y+Math.imul(W,k)|0;var Ut=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,p=Math.imul($t,Qt),s=Math.imul($t,ne),s=s+Math.imul(jt,Qt)|0,y=Math.imul(jt,ne),p=p+Math.imul(Dt,te)|0,s=s+Math.imul(Dt,oe)|0,s=s+Math.imul(Vt,te)|0,y=y+Math.imul(Vt,oe)|0,p=p+Math.imul(Zt,ce)|0,s=s+Math.imul(Zt,he)|0,s=s+Math.imul(Ht,ce)|0,y=y+Math.imul(Ht,he)|0,p=p+Math.imul(ee,Wt)|0,s=s+Math.imul(ee,Gt)|0,s=s+Math.imul(zt,Wt)|0,y=y+Math.imul(zt,Gt)|0,p=p+Math.imul(Ct,se)|0,s=s+Math.imul(Ct,fe)|0,s=s+Math.imul(Kt,se)|0,y=y+Math.imul(Kt,fe)|0,p=p+Math.imul(gt,Mt)|0,s=s+Math.imul(gt,ue)|0,s=s+Math.imul(St,Mt)|0,y=y+Math.imul(St,ue)|0,p=p+Math.imul(at,S)|0,s=s+Math.imul(at,k)|0,s=s+Math.imul(lt,S)|0,y=y+Math.imul(lt,k)|0,p=p+Math.imul(U,B)|0,s=s+Math.imul(U,M)|0,s=s+Math.imul(W,B)|0,y=y+Math.imul(W,M)|0;var Pt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,p=Math.imul(ie,Qt),s=Math.imul(ie,ne),s=s+Math.imul(Xt,Qt)|0,y=Math.imul(Xt,ne),p=p+Math.imul($t,te)|0,s=s+Math.imul($t,oe)|0,s=s+Math.imul(jt,te)|0,y=y+Math.imul(jt,oe)|0,p=p+Math.imul(Dt,ce)|0,s=s+Math.imul(Dt,he)|0,s=s+Math.imul(Vt,ce)|0,y=y+Math.imul(Vt,he)|0,p=p+Math.imul(Zt,Wt)|0,s=s+Math.imul(Zt,Gt)|0,s=s+Math.imul(Ht,Wt)|0,y=y+Math.imul(Ht,Gt)|0,p=p+Math.imul(ee,se)|0,s=s+Math.imul(ee,fe)|0,s=s+Math.imul(zt,se)|0,y=y+Math.imul(zt,fe)|0,p=p+Math.imul(Ct,Mt)|0,s=s+Math.imul(Ct,ue)|0,s=s+Math.imul(Kt,Mt)|0,y=y+Math.imul(Kt,ue)|0,p=p+Math.imul(gt,S)|0,s=s+Math.imul(gt,k)|0,s=s+Math.imul(St,S)|0,y=y+Math.imul(St,k)|0,p=p+Math.imul(at,B)|0,s=s+Math.imul(at,M)|0,s=s+Math.imul(lt,B)|0,y=y+Math.imul(lt,M)|0,p=p+Math.imul(U,N)|0,s=s+Math.imul(U,V)|0,s=s+Math.imul(W,N)|0,y=y+Math.imul(W,V)|0;var mt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(mt>>>26)|0,mt&=67108863,p=Math.imul(re,Qt),s=Math.imul(re,ne),s=s+Math.imul(Jt,Qt)|0,y=Math.imul(Jt,ne),p=p+Math.imul(ie,te)|0,s=s+Math.imul(ie,oe)|0,s=s+Math.imul(Xt,te)|0,y=y+Math.imul(Xt,oe)|0,p=p+Math.imul($t,ce)|0,s=s+Math.imul($t,he)|0,s=s+Math.imul(jt,ce)|0,y=y+Math.imul(jt,he)|0,p=p+Math.imul(Dt,Wt)|0,s=s+Math.imul(Dt,Gt)|0,s=s+Math.imul(Vt,Wt)|0,y=y+Math.imul(Vt,Gt)|0,p=p+Math.imul(Zt,se)|0,s=s+Math.imul(Zt,fe)|0,s=s+Math.imul(Ht,se)|0,y=y+Math.imul(Ht,fe)|0,p=p+Math.imul(ee,Mt)|0,s=s+Math.imul(ee,ue)|0,s=s+Math.imul(zt,Mt)|0,y=y+Math.imul(zt,ue)|0,p=p+Math.imul(Ct,S)|0,s=s+Math.imul(Ct,k)|0,s=s+Math.imul(Kt,S)|0,y=y+Math.imul(Kt,k)|0,p=p+Math.imul(gt,B)|0,s=s+Math.imul(gt,M)|0,s=s+Math.imul(St,B)|0,y=y+Math.imul(St,M)|0,p=p+Math.imul(at,N)|0,s=s+Math.imul(at,V)|0,s=s+Math.imul(lt,N)|0,y=y+Math.imul(lt,V)|0,p=p+Math.imul(U,J)|0,s=s+Math.imul(U,dt)|0,s=s+Math.imul(W,J)|0,y=y+Math.imul(W,dt)|0;var _t=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(_t>>>26)|0,_t&=67108863,p=Math.imul(re,te),s=Math.imul(re,oe),s=s+Math.imul(Jt,te)|0,y=Math.imul(Jt,oe),p=p+Math.imul(ie,ce)|0,s=s+Math.imul(ie,he)|0,s=s+Math.imul(Xt,ce)|0,y=y+Math.imul(Xt,he)|0,p=p+Math.imul($t,Wt)|0,s=s+Math.imul($t,Gt)|0,s=s+Math.imul(jt,Wt)|0,y=y+Math.imul(jt,Gt)|0,p=p+Math.imul(Dt,se)|0,s=s+Math.imul(Dt,fe)|0,s=s+Math.imul(Vt,se)|0,y=y+Math.imul(Vt,fe)|0,p=p+Math.imul(Zt,Mt)|0,s=s+Math.imul(Zt,ue)|0,s=s+Math.imul(Ht,Mt)|0,y=y+Math.imul(Ht,ue)|0,p=p+Math.imul(ee,S)|0,s=s+Math.imul(ee,k)|0,s=s+Math.imul(zt,S)|0,y=y+Math.imul(zt,k)|0,p=p+Math.imul(Ct,B)|0,s=s+Math.imul(Ct,M)|0,s=s+Math.imul(Kt,B)|0,y=y+Math.imul(Kt,M)|0,p=p+Math.imul(gt,N)|0,s=s+Math.imul(gt,V)|0,s=s+Math.imul(St,N)|0,y=y+Math.imul(St,V)|0,p=p+Math.imul(at,J)|0,s=s+Math.imul(at,dt)|0,s=s+Math.imul(lt,J)|0,y=y+Math.imul(lt,dt)|0;var ht=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(ht>>>26)|0,ht&=67108863,p=Math.imul(re,ce),s=Math.imul(re,he),s=s+Math.imul(Jt,ce)|0,y=Math.imul(Jt,he),p=p+Math.imul(ie,Wt)|0,s=s+Math.imul(ie,Gt)|0,s=s+Math.imul(Xt,Wt)|0,y=y+Math.imul(Xt,Gt)|0,p=p+Math.imul($t,se)|0,s=s+Math.imul($t,fe)|0,s=s+Math.imul(jt,se)|0,y=y+Math.imul(jt,fe)|0,p=p+Math.imul(Dt,Mt)|0,s=s+Math.imul(Dt,ue)|0,s=s+Math.imul(Vt,Mt)|0,y=y+Math.imul(Vt,ue)|0,p=p+Math.imul(Zt,S)|0,s=s+Math.imul(Zt,k)|0,s=s+Math.imul(Ht,S)|0,y=y+Math.imul(Ht,k)|0,p=p+Math.imul(ee,B)|0,s=s+Math.imul(ee,M)|0,s=s+Math.imul(zt,B)|0,y=y+Math.imul(zt,M)|0,p=p+Math.imul(Ct,N)|0,s=s+Math.imul(Ct,V)|0,s=s+Math.imul(Kt,N)|0,y=y+Math.imul(Kt,V)|0,p=p+Math.imul(gt,J)|0,s=s+Math.imul(gt,dt)|0,s=s+Math.imul(St,J)|0,y=y+Math.imul(St,dt)|0;var wt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(wt>>>26)|0,wt&=67108863,p=Math.imul(re,Wt),s=Math.imul(re,Gt),s=s+Math.imul(Jt,Wt)|0,y=Math.imul(Jt,Gt),p=p+Math.imul(ie,se)|0,s=s+Math.imul(ie,fe)|0,s=s+Math.imul(Xt,se)|0,y=y+Math.imul(Xt,fe)|0,p=p+Math.imul($t,Mt)|0,s=s+Math.imul($t,ue)|0,s=s+Math.imul(jt,Mt)|0,y=y+Math.imul(jt,ue)|0,p=p+Math.imul(Dt,S)|0,s=s+Math.imul(Dt,k)|0,s=s+Math.imul(Vt,S)|0,y=y+Math.imul(Vt,k)|0,p=p+Math.imul(Zt,B)|0,s=s+Math.imul(Zt,M)|0,s=s+Math.imul(Ht,B)|0,y=y+Math.imul(Ht,M)|0,p=p+Math.imul(ee,N)|0,s=s+Math.imul(ee,V)|0,s=s+Math.imul(zt,N)|0,y=y+Math.imul(zt,V)|0,p=p+Math.imul(Ct,J)|0,s=s+Math.imul(Ct,dt)|0,s=s+Math.imul(Kt,J)|0,y=y+Math.imul(Kt,dt)|0;var bt=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(bt>>>26)|0,bt&=67108863,p=Math.imul(re,se),s=Math.imul(re,fe),s=s+Math.imul(Jt,se)|0,y=Math.imul(Jt,fe),p=p+Math.imul(ie,Mt)|0,s=s+Math.imul(ie,ue)|0,s=s+Math.imul(Xt,Mt)|0,y=y+Math.imul(Xt,ue)|0,p=p+Math.imul($t,S)|0,s=s+Math.imul($t,k)|0,s=s+Math.imul(jt,S)|0,y=y+Math.imul(jt,k)|0,p=p+Math.imul(Dt,B)|0,s=s+Math.imul(Dt,M)|0,s=s+Math.imul(Vt,B)|0,y=y+Math.imul(Vt,M)|0,p=p+Math.imul(Zt,N)|0,s=s+Math.imul(Zt,V)|0,s=s+Math.imul(Ht,N)|0,y=y+Math.imul(Ht,V)|0,p=p+Math.imul(ee,J)|0,s=s+Math.imul(ee,dt)|0,s=s+Math.imul(zt,J)|0,y=y+Math.imul(zt,dt)|0;var ut=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(ut>>>26)|0,ut&=67108863,p=Math.imul(re,Mt),s=Math.imul(re,ue),s=s+Math.imul(Jt,Mt)|0,y=Math.imul(Jt,ue),p=p+Math.imul(ie,S)|0,s=s+Math.imul(ie,k)|0,s=s+Math.imul(Xt,S)|0,y=y+Math.imul(Xt,k)|0,p=p+Math.imul($t,B)|0,s=s+Math.imul($t,M)|0,s=s+Math.imul(jt,B)|0,y=y+Math.imul(jt,M)|0,p=p+Math.imul(Dt,N)|0,s=s+Math.imul(Dt,V)|0,s=s+Math.imul(Vt,N)|0,y=y+Math.imul(Vt,V)|0,p=p+Math.imul(Zt,J)|0,s=s+Math.imul(Zt,dt)|0,s=s+Math.imul(Ht,J)|0,y=y+Math.imul(Ht,dt)|0;var F=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(F>>>26)|0,F&=67108863,p=Math.imul(re,S),s=Math.imul(re,k),s=s+Math.imul(Jt,S)|0,y=Math.imul(Jt,k),p=p+Math.imul(ie,B)|0,s=s+Math.imul(ie,M)|0,s=s+Math.imul(Xt,B)|0,y=y+Math.imul(Xt,M)|0,p=p+Math.imul($t,N)|0,s=s+Math.imul($t,V)|0,s=s+Math.imul(jt,N)|0,y=y+Math.imul(jt,V)|0,p=p+Math.imul(Dt,J)|0,s=s+Math.imul(Dt,dt)|0,s=s+Math.imul(Vt,J)|0,y=y+Math.imul(Vt,dt)|0;var K=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(K>>>26)|0,K&=67108863,p=Math.imul(re,B),s=Math.imul(re,M),s=s+Math.imul(Jt,B)|0,y=Math.imul(Jt,M),p=p+Math.imul(ie,N)|0,s=s+Math.imul(ie,V)|0,s=s+Math.imul(Xt,N)|0,y=y+Math.imul(Xt,V)|0,p=p+Math.imul($t,J)|0,s=s+Math.imul($t,dt)|0,s=s+Math.imul(jt,J)|0,y=y+Math.imul(jt,dt)|0;var Q=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Q>>>26)|0,Q&=67108863,p=Math.imul(re,N),s=Math.imul(re,V),s=s+Math.imul(Jt,N)|0,y=Math.imul(Jt,V),p=p+Math.imul(ie,J)|0,s=s+Math.imul(ie,dt)|0,s=s+Math.imul(Xt,J)|0,y=y+Math.imul(Xt,dt)|0;var Y=(v+p|0)+((s&8191)<<13)|0;v=(y+(s>>>13)|0)+(Y>>>26)|0,Y&=67108863,p=Math.imul(re,J),s=Math.imul(re,dt),s=s+Math.imul(Jt,J)|0,y=Math.imul(Jt,dt);var Z=(v+p|0)+((s&8191)<<13)|0;return v=(y+(s>>>13)|0)+(Z>>>26)|0,Z&=67108863,m[0]=pt,m[1]=It,m[2]=Rt,m[3]=Ft,m[4]=qt,m[5]=Tt,m[6]=Ut,m[7]=Pt,m[8]=mt,m[9]=_t,m[10]=ht,m[11]=wt,m[12]=bt,m[13]=ut,m[14]=F,m[15]=K,m[16]=Q,m[17]=Y,m[18]=Z,v!==0&&(m[19]=v,u.length++),u};Math.imul||(X=C);function ot(g,i,a){a.negative=i.negative^g.negative,a.length=g.length+i.length;for(var u=0,c=0,d=0;d>>26)|0,c+=m>>>26,m&=67108863}a.words[d]=v,u=m,m=c}return u!==0?a.words[d]=u:a.length--,a._strip()}function G(g,i,a){return ot(g,i,a)}o.prototype.mulTo=function(i,a){var u,c=this.length+i.length;return this.length===10&&i.length===10?u=X(this,i,a):c<63?u=C(this,i,a):c<1024?u=ot(this,i,a):u=G(this,i,a),u};function it(g,i){this.x=g,this.y=i}it.prototype.makeRBT=function(i){for(var a=new Array(i),u=o.prototype._countBits(i)-1,c=0;c>=1;return c},it.prototype.permute=function(i,a,u,c,d,m){for(var v=0;v>>1)d++;return 1<>>13,u[2*m+1]=d&8191,d=d>>>13;for(m=2*a;m>=26,u+=d/67108864|0,u+=m>>>26,this.words[c]=m&67108863}return u!==0&&(this.words[c]=u,this.length++),a?this.ineg():this},o.prototype.muln=function(i){return this.clone().imuln(i)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(i){var a=D(i);if(a.length===0)return new o(1);for(var u=this,c=0;c=0);var a=i%26,u=(i-a)/26,c=67108863>>>26-a<<26-a,d;if(a!==0){var m=0;for(d=0;d>>26-a}m&&(this.words[d]=m,this.length++)}if(u!==0){for(d=this.length-1;d>=0;d--)this.words[d+u]=this.words[d];for(d=0;d=0);var c;a?c=(a-a%26)/26:c=0;var d=i%26,m=Math.min((i-d)/26,this.length),v=67108863^67108863>>>d<m)for(this.length-=m,s=0;s=0&&(y!==0||s>=c);s--){var R=this.words[s]|0;this.words[s]=y<<26-d|R>>>d,y=R&v}return p&&y!==0&&(p.words[p.length++]=y),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(i,a,u){return e(this.negative===0),this.iushrn(i,a,u)},o.prototype.shln=function(i){return this.clone().ishln(i)},o.prototype.ushln=function(i){return this.clone().iushln(i)},o.prototype.shrn=function(i){return this.clone().ishrn(i)},o.prototype.ushrn=function(i){return this.clone().iushrn(i)},o.prototype.testn=function(i){e(typeof i=="number"&&i>=0);var a=i%26,u=(i-a)/26,c=1<=0);var a=i%26,u=(i-a)/26;if(e(this.negative===0,"imaskn works only with positive numbers"),this.length<=u)return this;if(a!==0&&u++,this.length=Math.min(u,this.length),a!==0){var c=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},o.prototype.isubn=function(i){if(e(typeof i=="number"),e(i<67108864),i<0)return this.iaddn(-i);if(this.negative!==0)return this.negative=0,this.iaddn(i),this.negative=1,this;if(this.words[0]-=i,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(p/67108864|0),this.words[d+u]=m&67108863}for(;d>26,this.words[d+u]=m&67108863;if(v===0)return this._strip();for(e(v===-1),v=0,d=0;d>26,this.words[d]=m&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(i,a){var u=this.length-i.length,c=this.clone(),d=i,m=d.words[d.length-1]|0,v=this._countBits(m);u=26-v,u!==0&&(d=d.ushln(u),c.iushln(u),m=d.words[d.length-1]|0);var p=c.length-d.length,s;if(a!=="mod"){s=new o(null),s.length=p+1,s.words=new Array(s.length);for(var y=0;y=0;U--){var W=(c.words[d.length+U]|0)*67108864+(c.words[d.length+U-1]|0);for(W=Math.min(W/m|0,67108863),c._ishlnsubmul(d,W,U);c.negative!==0;)W--,c.negative=0,c._ishlnsubmul(d,1,U),c.isZero()||(c.negative^=1);s&&(s.words[U]=W)}return s&&s._strip(),c._strip(),a!=="div"&&u!==0&&c.iushrn(u),{div:s||null,mod:c}},o.prototype.divmod=function(i,a,u){if(e(!i.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var c,d,m;return this.negative!==0&&i.negative===0?(m=this.neg().divmod(i,a),a!=="mod"&&(c=m.div.neg()),a!=="div"&&(d=m.mod.neg(),u&&d.negative!==0&&d.iadd(i)),{div:c,mod:d}):this.negative===0&&i.negative!==0?(m=this.divmod(i.neg(),a),a!=="mod"&&(c=m.div.neg()),{div:c,mod:m.mod}):this.negative&i.negative?(m=this.neg().divmod(i.neg(),a),a!=="div"&&(d=m.mod.neg(),u&&d.negative!==0&&d.isub(i)),{div:m.div,mod:d}):i.length>this.length||this.cmp(i)<0?{div:new o(0),mod:this}:i.length===1?a==="div"?{div:this.divn(i.words[0]),mod:null}:a==="mod"?{div:null,mod:new o(this.modrn(i.words[0]))}:{div:this.divn(i.words[0]),mod:new o(this.modrn(i.words[0]))}:this._wordDiv(i,a)},o.prototype.div=function(i){return this.divmod(i,"div",!1).div},o.prototype.mod=function(i){return this.divmod(i,"mod",!1).mod},o.prototype.umod=function(i){return this.divmod(i,"mod",!0).mod},o.prototype.divRound=function(i){var a=this.divmod(i);if(a.mod.isZero())return a.div;var u=a.div.negative!==0?a.mod.isub(i):a.mod,c=i.ushrn(1),d=i.andln(1),m=u.cmp(c);return m<0||d===1&&m===0?a.div:a.div.negative!==0?a.div.isubn(1):a.div.iaddn(1)},o.prototype.modrn=function(i){var a=i<0;a&&(i=-i),e(i<=67108863);for(var u=(1<<26)%i,c=0,d=this.length-1;d>=0;d--)c=(u*c+(this.words[d]|0))%i;return a?-c:c},o.prototype.modn=function(i){return this.modrn(i)},o.prototype.idivn=function(i){var a=i<0;a&&(i=-i),e(i<=67108863);for(var u=0,c=this.length-1;c>=0;c--){var d=(this.words[c]|0)+u*67108864;this.words[c]=d/i|0,u=d%i}return this._strip(),a?this.ineg():this},o.prototype.divn=function(i){return this.clone().idivn(i)},o.prototype.egcd=function(i){e(i.negative===0),e(!i.isZero());var a=this,u=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var c=new o(1),d=new o(0),m=new o(0),v=new o(1),p=0;a.isEven()&&u.isEven();)a.iushrn(1),u.iushrn(1),++p;for(var s=u.clone(),y=a.clone();!a.isZero();){for(var R=0,U=1;!(a.words[0]&U)&&R<26;++R,U<<=1);if(R>0)for(a.iushrn(R);R-- >0;)(c.isOdd()||d.isOdd())&&(c.iadd(s),d.isub(y)),c.iushrn(1),d.iushrn(1);for(var W=0,tt=1;!(u.words[0]&tt)&&W<26;++W,tt<<=1);if(W>0)for(u.iushrn(W);W-- >0;)(m.isOdd()||v.isOdd())&&(m.iadd(s),v.isub(y)),m.iushrn(1),v.iushrn(1);a.cmp(u)>=0?(a.isub(u),c.isub(m),d.isub(v)):(u.isub(a),m.isub(c),v.isub(d))}return{a:m,b:v,gcd:u.iushln(p)}},o.prototype._invmp=function(i){e(i.negative===0),e(!i.isZero());var a=this,u=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var c=new o(1),d=new o(0),m=u.clone();a.cmpn(1)>0&&u.cmpn(1)>0;){for(var v=0,p=1;!(a.words[0]&p)&&v<26;++v,p<<=1);if(v>0)for(a.iushrn(v);v-- >0;)c.isOdd()&&c.iadd(m),c.iushrn(1);for(var s=0,y=1;!(u.words[0]&y)&&s<26;++s,y<<=1);if(s>0)for(u.iushrn(s);s-- >0;)d.isOdd()&&d.iadd(m),d.iushrn(1);a.cmp(u)>=0?(a.isub(u),c.isub(d)):(u.isub(a),d.isub(c))}var R;return a.cmpn(1)===0?R=c:R=d,R.cmpn(0)<0&&R.iadd(i),R},o.prototype.gcd=function(i){if(this.isZero())return i.abs();if(i.isZero())return this.abs();var a=this.clone(),u=i.clone();a.negative=0,u.negative=0;for(var c=0;a.isEven()&&u.isEven();c++)a.iushrn(1),u.iushrn(1);do{for(;a.isEven();)a.iushrn(1);for(;u.isEven();)u.iushrn(1);var d=a.cmp(u);if(d<0){var m=a;a=u,u=m}else if(d===0||u.cmpn(1)===0)break;a.isub(u)}while(!0);return u.iushln(c)},o.prototype.invm=function(i){return this.egcd(i).a.umod(i)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(i){return this.words[0]&i},o.prototype.bincn=function(i){e(typeof i=="number");var a=i%26,u=(i-a)/26,c=1<>>26,v&=67108863,this.words[m]=v}return d!==0&&(this.words[m]=d,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(i){var a=i<0;if(this.negative!==0&&!a)return-1;if(this.negative===0&&a)return 1;this._strip();var u;if(this.length>1)u=1;else{a&&(i=-i),e(i<=67108863,"Number is too big");var c=this.words[0]|0;u=c===i?0:ci.length)return 1;if(this.length=0;u--){var c=this.words[u]|0,d=i.words[u]|0;if(c!==d){cd&&(a=1);break}}return a},o.prototype.gtn=function(i){return this.cmpn(i)===1},o.prototype.gt=function(i){return this.cmp(i)===1},o.prototype.gten=function(i){return this.cmpn(i)>=0},o.prototype.gte=function(i){return this.cmp(i)>=0},o.prototype.ltn=function(i){return this.cmpn(i)===-1},o.prototype.lt=function(i){return this.cmp(i)===-1},o.prototype.lten=function(i){return this.cmpn(i)<=0},o.prototype.lte=function(i){return this.cmp(i)<=0},o.prototype.eqn=function(i){return this.cmpn(i)===0},o.prototype.eq=function(i){return this.cmp(i)===0},o.red=function(i){return new ct(i)},o.prototype.toRed=function(i){return e(!this.red,"Already a number in reduction context"),e(this.negative===0,"red works only with positives"),i.convertTo(this)._forceRed(i)},o.prototype.fromRed=function(){return e(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(i){return this.red=i,this},o.prototype.forceRed=function(i){return e(!this.red,"Already a number in reduction context"),this._forceRed(i)},o.prototype.redAdd=function(i){return e(this.red,"redAdd works only with red numbers"),this.red.add(this,i)},o.prototype.redIAdd=function(i){return e(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,i)},o.prototype.redSub=function(i){return e(this.red,"redSub works only with red numbers"),this.red.sub(this,i)},o.prototype.redISub=function(i){return e(this.red,"redISub works only with red numbers"),this.red.isub(this,i)},o.prototype.redShl=function(i){return e(this.red,"redShl works only with red numbers"),this.red.shl(this,i)},o.prototype.redMul=function(i){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.mul(this,i)},o.prototype.redIMul=function(i){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.imul(this,i)},o.prototype.redSqr=function(){return e(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return e(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return e(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return e(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return e(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(i){return e(this.red&&!i.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,i)};var kt={k256:null,p224:null,p192:null,p25519:null};function st(g,i){this.name=g,this.p=new o(i,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}st.prototype._tmp=function(){var i=new o(null);return i.words=new Array(Math.ceil(this.n/13)),i},st.prototype.ireduce=function(i){var a=i,u;do this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),u=a.bitLength();while(u>this.n);var c=u0?a.isub(this.p):a.strip!==void 0?a.strip():a._strip(),a},st.prototype.split=function(i,a){i.iushrn(this.n,0,a)},st.prototype.imulK=function(i){return i.imul(this.k)};function yt(){st.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(yt,st),yt.prototype.split=function(i,a){for(var u=4194303,c=Math.min(i.length,9),d=0;d>>22,m=v}m>>>=22,i.words[d-10]=m,m===0&&i.length>10?i.length-=10:i.length-=9},yt.prototype.imulK=function(i){i.words[i.length]=0,i.words[i.length+1]=0,i.length+=2;for(var a=0,u=0;u>>=26,i.words[u]=d,a=c}return a!==0&&(i.words[i.length++]=a),i},o._prime=function(i){if(kt[i])return kt[i];var a;if(i==="k256")a=new yt;else if(i==="p224")a=new At;else if(i==="p192")a=new Et;else if(i==="p25519")a=new be;else throw new Error("Unknown prime "+i);return kt[i]=a,a};function ct(g){if(typeof g=="string"){var i=o._prime(g);this.m=i.p,this.prime=i}else e(g.gtn(1),"modulus must be greater than 1"),this.m=g,this.prime=null}ct.prototype._verify1=function(i){e(i.negative===0,"red works only with positives"),e(i.red,"red works only with red numbers")},ct.prototype._verify2=function(i,a){e((i.negative|a.negative)===0,"red works only with positives"),e(i.red&&i.red===a.red,"red works only with red numbers")},ct.prototype.imod=function(i){return this.prime?this.prime.ireduce(i)._forceRed(this):(_(i,i.umod(this.m)._forceRed(this)),i)},ct.prototype.neg=function(i){return i.isZero()?i.clone():this.m.sub(i)._forceRed(this)},ct.prototype.add=function(i,a){this._verify2(i,a);var u=i.add(a);return u.cmp(this.m)>=0&&u.isub(this.m),u._forceRed(this)},ct.prototype.iadd=function(i,a){this._verify2(i,a);var u=i.iadd(a);return u.cmp(this.m)>=0&&u.isub(this.m),u},ct.prototype.sub=function(i,a){this._verify2(i,a);var u=i.sub(a);return u.cmpn(0)<0&&u.iadd(this.m),u._forceRed(this)},ct.prototype.isub=function(i,a){this._verify2(i,a);var u=i.isub(a);return u.cmpn(0)<0&&u.iadd(this.m),u},ct.prototype.shl=function(i,a){return this._verify1(i),this.imod(i.ushln(a))},ct.prototype.imul=function(i,a){return this._verify2(i,a),this.imod(i.imul(a))},ct.prototype.mul=function(i,a){return this._verify2(i,a),this.imod(i.mul(a))},ct.prototype.isqr=function(i){return this.imul(i,i.clone())},ct.prototype.sqr=function(i){return this.mul(i,i)},ct.prototype.sqrt=function(i){if(i.isZero())return i.clone();var a=this.m.andln(3);if(e(a%2===1),a===3){var u=this.m.add(new o(1)).iushrn(2);return this.pow(i,u)}for(var c=this.m.subn(1),d=0;!c.isZero()&&c.andln(1)===0;)d++,c.iushrn(1);e(!c.isZero());var m=new o(1).toRed(this),v=m.redNeg(),p=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new o(2*s*s).toRed(this);this.pow(s,p).cmp(v)!==0;)s.redIAdd(v);for(var y=this.pow(s,c),R=this.pow(i,c.addn(1).iushrn(1)),U=this.pow(i,c),W=d;U.cmp(m)!==0;){for(var tt=U,at=0;tt.cmp(m)!==0;at++)tt=tt.redSqr();e(at=0;d--){for(var y=a.words[d],R=s-1;R>=0;R--){var U=y>>R&1;if(m!==c[0]&&(m=this.sqr(m)),U===0&&v===0){p=0;continue}v<<=1,v|=U,p++,!(p!==u&&(d!==0||R!==0))&&(m=this.mul(m,c[v]),p=0,v=0)}s=26}return m},ct.prototype.convertTo=function(i){var a=i.umod(this.m);return a===i?a.clone():a},ct.prototype.convertFrom=function(i){var a=i.clone();return a.red=null,a},o.mont=function(i){return new Lt(i)};function Lt(g){ct.call(this,g),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(Lt,ct),Lt.prototype.convertTo=function(i){return this.imod(i.ushln(this.shift))},Lt.prototype.convertFrom=function(i){var a=this.imod(i.mul(this.rinv));return a.red=null,a},Lt.prototype.imul=function(i,a){if(i.isZero()||a.isZero())return i.words[0]=0,i.length=1,i;var u=i.imul(a),c=u.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=u.isub(c).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},Lt.prototype.mul=function(i,a){if(i.isZero()||a.isZero())return new o(0)._forceRed(this);var u=i.mul(a),c=u.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=u.isub(c).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},Lt.prototype.invm=function(i){var a=this.imod(i._invmp(this.m).mul(this.r2));return a._forceRed(this)}})(typeof Gs>"u"||Gs,tu)});var ru=Ve(Xs=>{"use strict";var h1=H(j());function Zr(r,t,e){return t<=r&&r<=e}function go(r){if(r===void 0)return{};if(r===Object(r))return r;throw TypeError("Could not convert argument to dictionary")}function L0(r){for(var t=String(r),e=t.length,n=0,o=[];n57343)o.push(f);else if(56320<=f&&f<=57343)o.push(65533);else if(55296<=f&&f<=56319)if(n===e-1)o.push(65533);else{var h=r.charCodeAt(n+1);if(56320<=h&&h<=57343){var x=f&1023,b=h&1023;o.push(65536+(x<<10)+b),n+=1}else o.push(65533)}n+=1}return o}function R0(r){for(var t="",e=0;e>10)+55296,(n&1023)+56320))}return t}var ho=-1;function Zs(r){this.tokens=[].slice.call(r)}Zs.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():ho},prepend:function(r){if(Array.isArray(r))for(var t=r;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(r)},push:function(r){if(Array.isArray(r))for(var t=r;t.length;)this.tokens.push(t.shift());else this.tokens.push(r)}};var ti=-1;function Ys(r,t){if(r)throw TypeError("Decoder error");return t||65533}var lo="utf-8";function po(r,t){if(!(this instanceof po))return new po(r,t);if(r=r!==void 0?String(r).toLowerCase():lo,r!==lo)throw new Error("Encoding not supported. Only utf-8 is supported");t=go(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!t.fatal,this._ignoreBOM=!!t.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}po.prototype={decode:function(t,e){var n;typeof t=="object"&&t instanceof ArrayBuffer?n=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):n=new Uint8Array(0),e=go(e),this._streaming||(this._decoder=new T0({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!e.stream;for(var o=new Zs(n),f=[],h;!o.endOfStream()&&(h=this._decoder.handler(o,o.read()),h!==ti);)h!==null&&(Array.isArray(h)?f.push.apply(f,h):f.push(h));if(!this._streaming){do{if(h=this._decoder.handler(o,o.read()),h===ti)break;h!==null&&(Array.isArray(h)?f.push.apply(f,h):f.push(h))}while(!o.endOfStream());this._decoder=null}return f.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(f[0]===65279?(this._BOMseen=!0,f.shift()):this._BOMseen=!0),R0(f)}};function yo(r,t){if(!(this instanceof yo))return new yo(r,t);if(r=r!==void 0?String(r).toLowerCase():lo,r!==lo)throw new Error("Encoding not supported. Only utf-8 is supported");t=go(t),this._streaming=!1,this._encoder=null,this._options={fatal:!!t.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}yo.prototype={encode:function(t,e){t=t?String(t):"",e=go(e),this._streaming||(this._encoder=new P0(this._options)),this._streaming=!!e.stream;for(var n=[],o=new Zs(L0(t)),f;!o.endOfStream()&&(f=this._encoder.handler(o,o.read()),f!==ti);)Array.isArray(f)?n.push.apply(n,f):n.push(f);if(!this._streaming){for(;f=this._encoder.handler(o,o.read()),f!==ti;)Array.isArray(f)?n.push.apply(n,f):n.push(f);this._encoder=null}return new Uint8Array(n)}};function T0(r){var t=r.fatal,e=0,n=0,o=0,f=128,h=191;this.handler=function(x,b){if(b===ho&&o!==0)return o=0,Ys(t);if(b===ho)return ti;if(o===0){if(Zr(b,0,127))return b;if(Zr(b,194,223))o=1,e=b-192;else if(Zr(b,224,239))b===224&&(f=160),b===237&&(h=159),o=2,e=b-224;else if(Zr(b,240,244))b===240&&(f=144),b===244&&(h=143),o=3,e=b-240;else return Ys(t);return e=e<<6*o,null}if(!Zr(b,f,h))return e=o=n=0,f=128,h=191,x.prepend(b),Ys(t);if(f=128,h=191,n+=1,e+=b-128<<6*(o-n),n!==o)return null;var _=e;return e=o=n=0,_}}function P0(r){var t=r.fatal;this.handler=function(e,n){if(n===ho)return ti;if(Zr(n,0,127))return n;var o,f;Zr(n,128,2047)?(o=1,f=192):Zr(n,2048,65535)?(o=2,f=224):Zr(n,65536,1114111)&&(o=3,f=240);for(var h=[(n>>6*o)+f];o>0;){var x=n>>6*(o-1);h.push(128|x&63),o-=1}return h}}Xs.TextEncoder=yo;Xs.TextDecoder=po});var au=Ve(Te=>{"use strict";var d1=H(j()),C0=Te&&Te.__createBinding||(Object.create?function(r,t,e,n){n===void 0&&(n=e),Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[e]}})}:function(r,t,e,n){n===void 0&&(n=e),r[n]=t[e]}),U0=Te&&Te.__setModuleDefault||(Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t}),Kr=Te&&Te.__decorate||function(r,t,e,n){var o=arguments.length,f=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(r,t,e,n);else for(var x=r.length-1;x>=0;x--)(h=r[x])&&(f=(o<3?h(f):o>3?h(t,e,f):h(t,e))||f);return o>3&&f&&Object.defineProperty(t,e,f),f},O0=Te&&Te.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var e in r)e!=="default"&&Object.hasOwnProperty.call(r,e)&&C0(t,r,e);return U0(t,r),t},nu=Te&&Te.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Te,"__esModule",{value:!0});Te.deserializeUnchecked=Te.deserialize=Te.serialize=Te.BinaryReader=Te.BinaryWriter=Te.BorshError=Te.baseDecode=Te.baseEncode=void 0;var mn=nu(eu()),iu=nu(Vs()),N0=O0(ru()),z0=typeof TextDecoder!="function"?N0.TextDecoder:TextDecoder,q0=new z0("utf-8",{fatal:!0});function F0(r){return typeof r=="string"&&(r=Buffer.from(r,"utf8")),iu.default.encode(Buffer.from(r))}Te.baseEncode=F0;function K0(r){return Buffer.from(iu.default.decode(r))}Te.baseDecode=K0;var Js=1024,Qe=class extends Error{constructor(t){super(t),this.fieldPath=[],this.originalMessage=t}addToFieldPath(t){this.fieldPath.splice(0,0,t),this.message=this.originalMessage+": "+this.fieldPath.join(".")}};Te.BorshError=Qe;var mo=class{constructor(){this.buf=Buffer.alloc(Js),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(Js)]))}writeU8(t){this.maybeResize(),this.buf.writeUInt8(t,this.length),this.length+=1}writeU16(t){this.maybeResize(),this.buf.writeUInt16LE(t,this.length),this.length+=2}writeU32(t){this.maybeResize(),this.buf.writeUInt32LE(t,this.length),this.length+=4}writeU64(t){this.maybeResize(),this.writeBuffer(Buffer.from(new mn.default(t).toArray("le",8)))}writeU128(t){this.maybeResize(),this.writeBuffer(Buffer.from(new mn.default(t).toArray("le",16)))}writeU256(t){this.maybeResize(),this.writeBuffer(Buffer.from(new mn.default(t).toArray("le",32)))}writeU512(t){this.maybeResize(),this.writeBuffer(Buffer.from(new mn.default(t).toArray("le",64)))}writeBuffer(t){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),t,Buffer.alloc(Js)]),this.length+=t.length}writeString(t){this.maybeResize();let e=Buffer.from(t,"utf8");this.writeU32(e.length),this.writeBuffer(e)}writeFixedArray(t){this.writeBuffer(Buffer.from(t))}writeArray(t,e){this.maybeResize(),this.writeU32(t.length);for(let n of t)this.maybeResize(),e(n)}toArray(){return this.buf.subarray(0,this.length)}};Te.BinaryWriter=mo;function Dr(r,t,e){let n=e.value;e.value=function(...o){try{return n.apply(this,o)}catch(f){if(f instanceof RangeError){let h=f.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(h)>=0)throw new Qe("Reached the end of buffer when deserializing")}throw f}}}var lr=class{constructor(t){this.buf=t,this.offset=0}readU8(){let t=this.buf.readUInt8(this.offset);return this.offset+=1,t}readU16(){let t=this.buf.readUInt16LE(this.offset);return this.offset+=2,t}readU32(){let t=this.buf.readUInt32LE(this.offset);return this.offset+=4,t}readU64(){let t=this.readBuffer(8);return new mn.default(t,"le")}readU128(){let t=this.readBuffer(16);return new mn.default(t,"le")}readU256(){let t=this.readBuffer(32);return new mn.default(t,"le")}readU512(){let t=this.readBuffer(64);return new mn.default(t,"le")}readBuffer(t){if(this.offset+t>this.buf.length)throw new Qe(`Expected buffer length ${t} isn\'t within bounds`);let e=this.buf.slice(this.offset,this.offset+t);return this.offset+=t,e}readString(){let t=this.readU32(),e=this.readBuffer(t);try{return q0.decode(e)}catch(n){throw new Qe(`Error decoding UTF-8 string: ${n}`)}}readFixedArray(t){return new Uint8Array(this.readBuffer(t))}readArray(t){let e=this.readU32(),n=Array();for(let o=0;o{Nn(r,t,f,n[0],o)});else if(n.kind!==void 0)switch(n.kind){case"option":{e==null?o.writeU8(0):(o.writeU8(1),Nn(r,t,e,n.type,o));break}case"map":{o.writeU32(e.size),e.forEach((f,h)=>{Nn(r,t,h,n.key,o),Nn(r,t,f,n.value,o)});break}default:throw new Qe(`FieldType ${n} unrecognized`)}else su(r,e,o)}catch(f){throw f instanceof Qe&&f.addToFieldPath(t),f}}function su(r,t,e){if(typeof t.borshSerialize=="function"){t.borshSerialize(e);return}let n=r.get(t.constructor);if(!n)throw new Qe(`Class ${t.constructor.name} is missing in schema`);if(n.kind==="struct")n.fields.map(([o,f])=>{Nn(r,o,t[o],f,e)});else if(n.kind==="enum"){let o=t[n.field];for(let f=0;fzn(r,t,e[0],n))}if(e.kind==="option")return n.readU8()?zn(r,t,e.type,n):void 0;if(e.kind==="map"){let o=new Map,f=n.readU32();for(let h=0;h=n.values.length)throw new Qe(`Enum index: ${o} is out of range`);let[f,h]=n.values[o],x=zn(r,f,h,e);return new t({[f]:x})}throw new Qe(`Unexpected schema kind: ${n.kind} for ${t.constructor.name}`)}function W0(r,t,e,n=lr){let o=new n(e),f=Qs(r,t,o);if(o.offset{"use strict";var y1=H(j());Object.defineProperty(q,"__esModule",{value:!0});q.s16=q.s8=q.nu64be=q.u48be=q.u40be=q.u32be=q.u24be=q.u16be=q.nu64=q.u48=q.u40=q.u32=q.u24=q.u16=q.u8=q.offset=q.greedy=q.Constant=q.UTF8=q.CString=q.Blob=q.Boolean=q.BitField=q.BitStructure=q.VariantLayout=q.Union=q.UnionLayoutDiscriminator=q.UnionDiscriminator=q.Structure=q.Sequence=q.DoubleBE=q.Double=q.FloatBE=q.Float=q.NearInt64BE=q.NearInt64=q.NearUInt64BE=q.NearUInt64=q.IntBE=q.Int=q.UIntBE=q.UInt=q.OffsetLayout=q.GreedyCount=q.ExternalLayout=q.bindConstructorLayout=q.nameWithProperty=q.Layout=q.uint8ArrayToBuffer=q.checkUint8Array=void 0;q.constant=q.utf8=q.cstr=q.blob=q.unionLayoutDiscriminator=q.union=q.seq=q.bits=q.struct=q.f64be=q.f64=q.f32be=q.f32=q.ns64be=q.s48be=q.s40be=q.s32be=q.s24be=q.s16be=q.ns64=q.s48=q.s40=q.s32=q.s24=void 0;var ea=An();function ni(r){if(!(r instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}q.checkUint8Array=ni;function Ae(r){return ni(r),ea.Buffer.from(r.buffer,r.byteOffset,r.length)}q.uint8ArrayToBuffer=Ae;var Ie=class{constructor(t,e){if(!Number.isInteger(t))throw new TypeError("span must be an integer");this.span=t,this.property=e}makeDestinationObject(){return{}}getSpan(t,e){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(t){let e=Object.create(this.constructor.prototype);return Object.assign(e,this),e.property=t,e}fromArray(t){}};q.Layout=Ie;function ra(r,t){return t.property?r+"["+t.property+"]":r}q.nameWithProperty=ra;function V0(r,t){if(typeof r!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(r,"layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof Ie))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(t,"boundConstructor_"))throw new Error("layout is already bound to a constructor");r.layout_=t,t.boundConstructor_=r,t.makeDestinationObject=()=>new r,Object.defineProperty(r.prototype,"encode",{value(e,n){return t.encode(this,e,n)},writable:!0}),Object.defineProperty(r,"decode",{value(e,n){return t.decode(e,n)},writable:!0})}q.bindConstructorLayout=V0;var ir=class extends Ie{isCount(){throw new Error("ExternalLayout is abstract")}};q.ExternalLayout=ir;var wo=class extends ir{constructor(t=1,e){if(!Number.isInteger(t)||0>=t)throw new TypeError("elementSpan must be a (positive) integer");super(-1,e),this.elementSpan=t}isCount(){return!0}decode(t,e=0){ni(t);let n=t.length-e;return Math.floor(n/this.elementSpan)}encode(t,e,n){return 0}};q.GreedyCount=wo;var vi=class extends ir{constructor(t,e=0,n){if(!(t instanceof Ie))throw new TypeError("layout must be a Layout");if(!Number.isInteger(e))throw new TypeError("offset must be integer or undefined");super(t.span,n||t.property),this.layout=t,this.offset=e}isCount(){return this.layout instanceof mr||this.layout instanceof vr}decode(t,e=0){return this.layout.decode(t,e+this.offset)}encode(t,e,n=0){return this.layout.encode(t,e,n+this.offset)}};q.OffsetLayout=vi;var mr=class extends Ie{constructor(t,e){if(super(t,e),6h+o.encode(x,e,n+h),0);return this.count instanceof ir&&this.count.encode(t.length,e,n),f}};q.Sequence=Ao;var Mo=class extends Ie{constructor(t,e,n){if(!(Array.isArray(t)&&t.reduce((f,h)=>f&&h instanceof Ie,!0)))throw new TypeError("fields must be array of Layout instances");typeof e=="boolean"&&n===void 0&&(n=e,e=void 0);for(let f of t)if(0>f.span&&f.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let o=-1;try{o=t.reduce((f,h)=>f+h.getSpan(),0)}catch{}super(o,e),this.fields=t,this.decodePrefixes=!!n}getSpan(t,e=0){if(0<=this.span)return this.span;let n=0;try{n=this.fields.reduce((o,f)=>{let h=f.getSpan(t,e);return e+=h,o+h},0)}catch{throw new RangeError("indeterminate span")}return n}decode(t,e=0){ni(t);let n=this.makeDestinationObject();for(let o of this.fields)if(o.property!==void 0&&(n[o.property]=o.decode(t,e)),e+=o.getSpan(t,e),this.decodePrefixes&&t.length===e)break;return n}encode(t,e,n=0){let o=n,f=0,h=0;for(let x of this.fields){let b=x.span;if(h=0b&&(b=x.getSpan(e,n)))}f=n,n+=b}return f+h-o}fromArray(t){let e=this.makeDestinationObject();for(let n of this.fields)n.property!==void 0&&0n.span?e=-1:0<=e&&(e+=n.span)}}};q.Structure=Mo;var ki=class{constructor(t){this.property=t}decode(t,e){throw new Error("UnionDiscriminator is abstract")}encode(t,e,n){throw new Error("UnionDiscriminator is abstract")}};q.UnionDiscriminator=ki;var ri=class extends ki{constructor(t,e){if(!(t instanceof ir&&t.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(e||t.property||"variant"),this.layout=t}decode(t,e){return this.layout.decode(t,e)}encode(t,e,n){return this.layout.encode(t,e,n)}};q.UnionLayoutDiscriminator=ri;var Si=class extends Ie{constructor(t,e,n){let o;if(t instanceof mr||t instanceof vr)o=new ri(new vi(t));else if(t instanceof ir&&t.isCount())o=new ri(t);else if(t instanceof ki)o=t;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(e===void 0&&(e=null),!(e===null||e instanceof Ie))throw new TypeError("defaultLayout must be null or a Layout");if(e!==null){if(0>e.span)throw new Error("defaultLayout must have constant span");e.property===void 0&&(e=e.replicate("content"))}let f=-1;e&&(f=e.span,0<=f&&(t instanceof mr||t instanceof vr)&&(f+=o.layout.span)),super(f,n),this.discriminator=o,this.usesPrefixDiscriminator=t instanceof mr||t instanceof vr,this.defaultLayout=e,this.registry={};let h=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(x){return h(x)},this.configGetSourceVariant=function(x){h=x.bind(this)}}getSpan(t,e=0){if(0<=this.span)return this.span;let n=this.getVariant(t,e);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(t,e)}defaultGetSourceVariant(t){if(Object.prototype.hasOwnProperty.call(t,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(t,this.defaultLayout.property))return;let e=this.registry[t[this.discriminator.property]];if(e&&(!e.layout||e.property&&Object.prototype.hasOwnProperty.call(t,e.property)))return e}else for(let e in this.registry){let n=this.registry[e];if(n.property&&Object.prototype.hasOwnProperty.call(t,n.property))return n}throw new Error("unable to infer src variant")}decode(t,e=0){let n,o=this.discriminator,f=o.decode(t,e),h=this.registry[f];if(h===void 0){let x=this.defaultLayout,b=0;this.usesPrefixDiscriminator&&(b=o.layout.span),n=this.makeDestinationObject(),n[o.property]=f,n[x.property]=x.decode(t,e+b)}else n=h.decode(t,e);return n}encode(t,e,n=0){let o=this.getSourceVariant(t);if(o===void 0){let f=this.discriminator,h=this.defaultLayout,x=0;return this.usesPrefixDiscriminator&&(x=f.layout.span),f.encode(t[f.property],e,n),x+h.encode(t[h.property],e,n+x)}return o.encode(t,e,n)}addVariant(t,e,n){let o=new Io(this,t,e,n);return this.registry[t]=o,o}getVariant(t,e=0){let n;return t instanceof Uint8Array?n=this.discriminator.decode(t,e):n=t,this.registry[n]}};q.Union=Si;var Io=class extends Ie{constructor(t,e,n,o){if(!(t instanceof Si))throw new TypeError("union must be a Union");if(!Number.isInteger(e)||0>e)throw new TypeError("variant must be a (non-negative) integer");if(typeof n=="string"&&o===void 0&&(o=n,n=null),n){if(!(n instanceof Ie))throw new TypeError("layout must be a Layout");if(t.defaultLayout!==null&&0<=n.span&&n.span>t.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof o!="string")throw new TypeError("variant must have a String property")}let f=t.span;0>t.span&&(f=n?n.span:0,0<=f&&t.usesPrefixDiscriminator&&(f+=t.discriminator.layout.span)),super(f,o),this.union=t,this.variant=e,this.layout=n||null}getSpan(t,e=0){if(0<=this.span)return this.span;let n=0;this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span);let o=0;return this.layout&&(o=this.layout.getSpan(t,e+n)),n+o}decode(t,e=0){let n=this.makeDestinationObject();if(this!==this.union.getVariant(t,e))throw new Error("variant mismatch");let o=0;return this.union.usesPrefixDiscriminator&&(o=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(t,e+o):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}encode(t,e,n=0){let o=0;if(this.union.usesPrefixDiscriminator&&(o=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(t,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,e,n);let f=o;if(this.layout&&(this.layout.encode(t[this.property],e,n+o),f+=this.layout.getSpan(e,n+o),0<=this.union.span&&f>this.union.span))throw new Error("encoded variant overruns containing union");return f}fromArray(t){if(this.layout)return this.layout.fromArray(t)}};q.VariantLayout=Io;function ei(r){return 0>r&&(r+=4294967296),r}var Bi=class extends Ie{constructor(t,e,n){if(!(t instanceof mr||t instanceof vr))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof e=="string"&&n===void 0&&(n=e,e=!1),4=e)throw new TypeError("bits must be positive integer");let o=8*t.span,f=t.fields.reduce((h,x)=>h+x.bits,0);if(e+f>o)throw new Error("bits too long for span remainder ("+(o-f)+" of "+o+" remain)");this.container=t,this.bits=e,this.valueMask=(1<>>this.start}encode(t){if(typeof t!="number"||!Number.isInteger(t)||t!==ei(t&this.valueMask))throw new TypeError(ra("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let e=this.container._packedGetValue(),n=ei(t<n&&(n=this.length.decode(t,e)),n}decode(t,e=0){let n=this.span;return 0>n&&(n=this.length.decode(t,e)),Ae(t).slice(e,e+n)}encode(t,e,n){let o=this.length;if(this.length instanceof ir&&(o=t.length),!(t instanceof Uint8Array&&o===t.length))throw new TypeError(ra("Blob.encode",this)+" requires (length "+o+") Uint8Array as src");if(n+o>e.length)throw new RangeError("encoding overruns Uint8Array");let f=Ae(t);return Ae(e).write(f.toString("hex"),n,o,"hex"),this.length instanceof ir&&this.length.encode(o,e,n),o}};q.Blob=Ro;var To=class extends Ie{constructor(t){super(-1,t)}getSpan(t,e=0){ni(t);let n=e;for(;ne.length)throw new RangeError("encoding overruns Buffer");let h=Ae(e);return o.copy(h,n),h[n+f]=0,f+1}};q.CString=To;var Po=class extends Ie{constructor(t,e){if(typeof t=="string"&&e===void 0&&(e=t,t=void 0),t===void 0)t=-1;else if(!Number.isInteger(t))throw new TypeError("maxSpan must be an integer");super(-1,e),this.maxSpan=t}getSpan(t,e=0){return ni(t),t.length-e}decode(t,e=0){let n=this.getSpan(t,e);if(0<=this.maxSpan&&this.maxSpane.length)throw new RangeError("encoding overruns Buffer");return o.copy(Ae(e),n),f}};q.UTF8=Po;var Co=class extends Ie{constructor(t,e){super(0,e),this.value=t}decode(t,e){return this.value}encode(t,e,n){return 0}};q.Constant=Co;q.greedy=(r,t)=>new wo(r,t);q.offset=(r,t,e)=>new vi(r,t,e);q.u8=r=>new mr(1,r);q.u16=r=>new mr(2,r);q.u24=r=>new mr(3,r);q.u32=r=>new mr(4,r);q.u40=r=>new mr(5,r);q.u48=r=>new mr(6,r);q.nu64=r=>new bo(r);q.u16be=r=>new vr(2,r);q.u24be=r=>new vr(3,r);q.u32be=r=>new vr(4,r);q.u40be=r=>new vr(5,r);q.u48be=r=>new vr(6,r);q.nu64be=r=>new xo(r);q.s8=r=>new Xr(1,r);q.s16=r=>new Xr(2,r);q.s24=r=>new Xr(3,r);q.s32=r=>new Xr(4,r);q.s40=r=>new Xr(5,r);q.s48=r=>new Xr(6,r);q.ns64=r=>new vo(r);q.s16be=r=>new wn(2,r);q.s24be=r=>new wn(3,r);q.s32be=r=>new wn(4,r);q.s40be=r=>new wn(5,r);q.s48be=r=>new wn(6,r);q.ns64be=r=>new ko(r);q.f32=r=>new So(r);q.f32be=r=>new Bo(r);q.f64=r=>new Eo(r);q.f64be=r=>new _o(r);q.struct=(r,t,e)=>new Mo(r,t,e);q.bits=(r,t,e)=>new Bi(r,t,e);q.seq=(r,t,e)=>new Ao(r,t,e);q.union=(r,t,e)=>new Si(r,t,e);q.unionLayoutDiscriminator=(r,t)=>new ri(r,t);q.blob=(r,t)=>new Ro(r,t);q.cstr=r=>new To(r);q.utf8=(r,t)=>new Po(r,t);q.constant=(r,t)=>new Co(r,t)});var fu=Ve(ii=>{"use strict";var m1=H(j());Object.defineProperty(ii,"__esModule",{value:!0});var No;function $0(r){{let t=Buffer.from(r);t.reverse();let e=t.toString("hex");return e.length===0?BigInt(0):BigInt(`0x${e}`)}return No.toBigInt(r,!1)}ii.toBigIntLE=$0;function j0(r){{let t=r.toString("hex");return t.length===0?BigInt(0):BigInt(`0x${t}`)}return No.toBigInt(r,!0)}ii.toBigIntBE=j0;function G0(r,t){{let e=r.toString(16),n=Buffer.from(e.padStart(t*2,"0").slice(0,t*2),"hex");return n.reverse(),n}return No.fromBigInt(r,Buffer.allocUnsafe(t),!1)}ii.toBufferLE=G0;function Y0(r,t){{let e=r.toString(16);return Buffer.from(e.padStart(t*2,"0").slice(0,t*2),"hex")}return No.fromBigInt(r,Buffer.allocUnsafe(t),!0)}ii.toBufferBE=Y0});function Z0(r){return _i(r)&&typeof r[Symbol.iterator]=="function"}function _i(r){return typeof r=="object"&&r!=null}function zo(r){return _i(r)&&!Array.isArray(r)}function Pr(r){return typeof r=="symbol"?r.toString():typeof r=="string"?JSON.stringify(r):`${r}`}function X0(r){let{done:t,value:e}=r.next();return t?void 0:e}function J0(r,t,e,n){if(r===!0)return;r===!1?r={}:typeof r=="string"&&(r={message:r});let{path:o,branch:f}=t,{type:h}=e,{refinement:x,message:b=`Expected a value of type \\`${h}\\`${x?` with refinement \\`${x}\\``:""}, but received: \\`${Pr(n)}\\``}=r;return{value:n,type:h,refinement:x,key:o[o.length-1],path:o,branch:f,...r,message:b}}function*uu(r,t,e,n){Z0(r)||(r=[r]);for(let o of r){let f=J0(o,t,e,n);f&&(yield f)}}function*oa(r,t,e={}){let{path:n=[],branch:o=[r],coerce:f=!1,mask:h=!1}=e,x={path:n,branch:o,mask:h};f&&(r=t.coercer(r,x));let b="valid";for(let _ of t.validator(r,x))_.explanation=e.message,b="not_valid",yield[_,void 0];for(let[_,E,L]of t.entries(r,x)){let O=oa(E,L,{path:_===void 0?n:[...n,_],branch:_===void 0?o:[...o,E],coerce:f,mask:h,message:e.message});for(let P of O)P[0]?(b=P[0].refinement!=null?"not_refined":"not_valid",yield[P[0],void 0]):f&&(E=P[1],_===void 0?r=E:r instanceof Map?r.set(_,E):r instanceof Set?r.add(E):_i(r)&&(E!==void 0||_ in r)&&(r[_]=E))}if(b!=="not_valid")for(let _ of t.refiner(r,x))_.explanation=e.message,b="not_refined",yield[_,void 0];b==="valid"&&(yield[void 0,r])}function cu(r,t,e){let n=Ai(r,t,{message:e});if(n[0])throw n[0]}function oi(r,t,e){let n=Ai(r,t,{coerce:!0,message:e});if(n[0])throw n[0];return n[1]}function Q0(r,t,e){let n=Ai(r,t,{coerce:!0,mask:!0,message:e});if(n[0])throw n[0];return n[1]}function hu(r,t){return!Ai(r,t)[0]}function Ai(r,t,e={}){let n=oa(r,t,e),o=X0(n);return o[0]?[new ia(o[0],function*(){for(let h of n)h[0]&&(yield h[0])}),void 0]:[void 0,o[1]]}function qn(r,t){return new Er({type:r,schema:null,validator:t})}function lu(){return qn("any",()=>!0)}function xt(r){return new Er({type:"array",schema:r,*entries(t){if(r&&Array.isArray(t))for(let[e,n]of t.entries())yield[e,n,r]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${Pr(t)}`}})}function Cr(){return qn("boolean",r=>typeof r=="boolean")}function qo(r){return qn("instance",t=>t instanceof r||`Expected a \\`${r.name}\\` instance, but received: ${Pr(t)}`)}function ze(r){let t=Pr(r),e=typeof r;return new Er({type:"literal",schema:e==="string"||e==="number"||e==="boolean"?r:null,validator(n){return n===r||`Expected the literal \\`${t}\\`, but received: ${Pr(n)}`}})}function tl(){return qn("never",()=>!1)}function vt(r){return new Er({...r,validator:(t,e)=>t===null||r.validator(t,e),refiner:(t,e)=>t===null||r.refiner(t,e)})}function z(){return qn("number",r=>typeof r=="number"&&!isNaN(r)||`Expected a number, but received: ${Pr(r)}`)}function Nt(r){return new Er({...r,validator:(t,e)=>t===void 0||r.validator(t,e),refiner:(t,e)=>t===void 0||r.refiner(t,e)})}function sa(r,t){return new Er({type:"record",schema:null,*entries(e){if(_i(e))for(let n in e){let o=e[n];yield[n,n,r],yield[n,o,t]}},validator(e){return zo(e)||`Expected an object, but received: ${Pr(e)}`},coercer(e){return zo(e)?{...e}:e}})}function ft(){return qn("string",r=>typeof r=="string"||`Expected a string, but received: ${Pr(r)}`)}function Fo(r){let t=tl();return new Er({type:"tuple",schema:null,*entries(e){if(Array.isArray(e)){let n=Math.max(r.length,e.length);for(let o=0;oe.type).join(" | ");return new Er({type:"union",schema:null,coercer(e,n){for(let o of r){let[f,h]=o.validate(e,{coerce:!0,mask:n.mask});if(!f)return h}return e},validator(e,n){let o=[];for(let f of r){let[...h]=oa(e,f,n),[x]=h;if(x[0])for(let[b]of h)b&&o.push(b);else return[]}return[`Expected the value to satisfy a union of \\`${t}\\`, but received: ${Pr(e)}`,...o]}})}function Fn(){return qn("unknown",()=>!0)}function si(r,t,e){return new Er({...r,coercer:(n,o)=>hu(n,t)?r.coercer(e(n,o),o):r.coercer(n,o)})}var b1,ia,Er,du=le(()=>{b1=H(j(),1),ia=class extends TypeError{constructor(t,e){let n,{message:o,explanation:f,...h}=t,{path:x}=t,b=x.length===0?o:`At path: ${x.join(".")} -- ${o}`;super(f??b),f!=null&&(this.cause=b),Object.assign(this,h),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...e()])}};Er=class{constructor(t){let{type:e,schema:n,validator:o,refiner:f,coercer:h=b=>b,entries:x=function*(){}}=t;this.type=e,this.schema=n,this.entries=x,this.coercer=h,o?this.validator=(b,_)=>{let E=o(b,_);return uu(E,_,this,b)}:this.validator=()=>[],f?this.refiner=(b,_)=>{let E=f(b,_);return uu(E,_,this,b)}:this.refiner=()=>[]}assert(t,e){return cu(t,this,e)}create(t,e){return oi(t,this,e)}is(t){return hu(t,this)}mask(t,e){return Q0(t,this,e)}validate(t,e={}){return Ai(t,this,e)}}});function Mi(){if(!Ko&&(Ko=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Ko))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ko(el)}var v1,Ko,el,aa=le(()=>{v1=H(j()),el=new Uint8Array(16)});var S1,pu,yu=le(()=>{S1=H(j()),pu=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i});function rl(r){return typeof r=="string"&&pu.test(r)}var _1,bn,Ii=le(()=>{_1=H(j());yu();bn=rl});function nl(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=(tr[r[t+0]]+tr[r[t+1]]+tr[r[t+2]]+tr[r[t+3]]+"-"+tr[r[t+4]]+tr[r[t+5]]+"-"+tr[r[t+6]]+tr[r[t+7]]+"-"+tr[r[t+8]]+tr[r[t+9]]+"-"+tr[r[t+10]]+tr[r[t+11]]+tr[r[t+12]]+tr[r[t+13]]+tr[r[t+14]]+tr[r[t+15]]).toLowerCase();if(!bn(e))throw TypeError("Stringified UUID is invalid");return e}var I1,tr,Do,xn,Li=le(()=>{I1=H(j());Ii();tr=[];for(Do=0;Do<256;++Do)tr.push((Do+256).toString(16).substr(1));xn=nl});function il(r,t,e){var n=t&&e||0,o=t||new Array(16);r=r||{};var f=r.node||gu,h=r.clockseq!==void 0?r.clockseq:fa;if(f==null||h==null){var x=r.random||(r.rng||Mi)();f==null&&(f=gu=[x[0]|1,x[1],x[2],x[3],x[4],x[5]]),h==null&&(h=fa=(x[6]<<8|x[7])&16383)}var b=r.msecs!==void 0?r.msecs:Date.now(),_=r.nsecs!==void 0?r.nsecs:ca+1,E=b-ua+(_-ca)/1e4;if(E<0&&r.clockseq===void 0&&(h=h+1&16383),(E<0||b>ua)&&r.nsecs===void 0&&(_=0),_>=1e4)throw new Error("uuid.v1(): Can\'t create more than 10M uuids/sec");ua=b,ca=_,fa=h,b+=122192928e5;var L=((b&268435455)*1e4+_)%4294967296;o[n++]=L>>>24&255,o[n++]=L>>>16&255,o[n++]=L>>>8&255,o[n++]=L&255;var O=b/4294967296*1e4&268435455;o[n++]=O>>>8&255,o[n++]=O&255,o[n++]=O>>>24&15|16,o[n++]=O>>>16&255,o[n++]=h>>>8|128,o[n++]=h&255;for(var P=0;P<6;++P)o[n+P]=f[P];return t||xn(o)}var P1,gu,fa,ua,ca,mu,wu=le(()=>{P1=H(j());aa();Li();ua=0,ca=0;mu=il});function ol(r){if(!bn(r))throw TypeError("Invalid UUID");var t,e=new Uint8Array(16);return e[0]=(t=parseInt(r.slice(0,8),16))>>>24,e[1]=t>>>16&255,e[2]=t>>>8&255,e[3]=t&255,e[4]=(t=parseInt(r.slice(9,13),16))>>>8,e[5]=t&255,e[6]=(t=parseInt(r.slice(14,18),16))>>>8,e[7]=t&255,e[8]=(t=parseInt(r.slice(19,23),16))>>>8,e[9]=t&255,e[10]=(t=parseInt(r.slice(24,36),16))/1099511627776&255,e[11]=t/4294967296&255,e[12]=t>>>24&255,e[13]=t>>>16&255,e[14]=t>>>8&255,e[15]=t&255,e}var O1,Wo,ha=le(()=>{O1=H(j());Ii();Wo=ol});function sl(r){r=unescape(encodeURIComponent(r));for(var t=[],e=0;e{F1=H(j());Li();ha();al="6ba7b810-9dad-11d1-80b4-00c04fd430c8",fl="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function ul(r){if(typeof r=="string"){var t=unescape(encodeURIComponent(r));r=new Uint8Array(t.length);for(var e=0;e>5]>>>o%32&255,h=parseInt(n.charAt(f>>>4&15)+n.charAt(f&15),16);t.push(h)}return t}function bu(r){return(r+64>>>9<<4)+14+1}function hl(r,t){r[t>>5]|=128<>5]|=(r[n/8]&255)<>16)+(t>>16)+(e>>16);return n<<16|e&65535}function dl(r,t){return r<>>32-t}function Vo(r,t,e,n,o,f){return vn(dl(vn(vn(t,r),vn(n,f)),o),e)}function sr(r,t,e,n,o,f,h){return Vo(t&e|~t&n,r,t,o,f,h)}function ar(r,t,e,n,o,f,h){return Vo(t&n|e&~n,r,t,o,f,h)}function fr(r,t,e,n,o,f,h){return Vo(t^e^n,r,t,o,f,h)}function ur(r,t,e,n,o,f,h){return Vo(e^(t|~n),r,t,o,f,h)}var D1,xu,vu=le(()=>{D1=H(j());xu=ul});var $1,pl,ku,Su=le(()=>{$1=H(j());la();vu();pl=Ho("v3",48,xu),ku=pl});function yl(r,t,e){r=r||{};var n=r.random||(r.rng||Mi)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){e=e||0;for(var o=0;o<16;++o)t[e+o]=n[o];return t}return xn(n)}var Z1,Bu,Eu=le(()=>{Z1=H(j());aa();Li();Bu=yl});function gl(r,t,e,n){switch(r){case 0:return t&e^~t&n;case 1:return t^e^n;case 2:return t&e^t&n^e&n;case 3:return t^e^n}}function da(r,t){return r<>>32-t}function ml(r){var t=[1518500249,1859775393,2400959708,3395469782],e=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof r=="string"){var n=unescape(encodeURIComponent(r));r=[];for(var o=0;o>>0;G=ot,ot=X,X=da(C,30)>>>0,C=D,D=st}e[0]=e[0]+D>>>0,e[1]=e[1]+C>>>0,e[2]=e[2]+X>>>0,e[3]=e[3]+ot>>>0,e[4]=e[4]+G>>>0}return[e[0]>>24&255,e[0]>>16&255,e[0]>>8&255,e[0]&255,e[1]>>24&255,e[1]>>16&255,e[1]>>8&255,e[1]&255,e[2]>>24&255,e[2]>>16&255,e[2]>>8&255,e[2]&255,e[3]>>24&255,e[3]>>16&255,e[3]>>8&255,e[3]&255,e[4]>>24&255,e[4]>>16&255,e[4]>>8&255,e[4]&255]}var J1,_u,Au=le(()=>{J1=H(j());_u=ml});var ry,wl,Mu,Iu=le(()=>{ry=H(j());la();Au();wl=Ho("v5",80,_u),Mu=wl});var iy,Lu,Ru=le(()=>{iy=H(j()),Lu="00000000-0000-0000-0000-000000000000"});function bl(r){if(!bn(r))throw TypeError("Invalid UUID");return parseInt(r.substr(14,1),16)}var ay,Tu,Pu=le(()=>{ay=H(j());Ii();Tu=bl});var pa={};Wa(pa,{NIL:()=>Lu,parse:()=>Wo,stringify:()=>xn,v1:()=>mu,v3:()=>ku,v4:()=>Bu,v5:()=>Mu,validate:()=>bn,version:()=>Tu});var fy,ya=le(()=>{fy=H(j());wu();Su();Eu();Iu();Ru();Pu();Ii();Li();ha()});var Uu=Ve((wy,Cu)=>{"use strict";var by=H(j()),xl=(ya(),Va(pa)).v4,vl=function(r,t,e,n){if(typeof r!="string")throw new TypeError(r+" must be a string");n=n||{};let o=typeof n.version=="number"?n.version:2;if(o!==1&&o!==2)throw new TypeError(o+" must be 1 or 2");let f={method:r};if(o===2&&(f.jsonrpc="2.0"),t){if(typeof t!="object"&&!Array.isArray(t))throw new TypeError(t+" must be an object, array or omitted");f.params=t}if(typeof e>"u"){let h=typeof n.generator=="function"?n.generator:function(){return xl()};f.id=h(f,n)}else o===2&&e===null?n.notificationIdNull&&(f.id=null):f.id=e;return f};Cu.exports=vl});var Nu=Ve((xy,Ou)=>{"use strict";var vy=H(j()),kl=(ya(),Va(pa)).v4,Sl=Uu(),Ri=function(r,t){if(!(this instanceof Ri))return new Ri(r,t);t||(t={}),this.options={reviver:typeof t.reviver<"u"?t.reviver:null,replacer:typeof t.replacer<"u"?t.replacer:null,generator:typeof t.generator<"u"?t.generator:function(){return kl()},version:typeof t.version<"u"?t.version:2,notificationIdNull:typeof t.notificationIdNull=="boolean"?t.notificationIdNull:!1},this.callServer=r};Ou.exports=Ri;Ri.prototype.request=function(r,t,e,n){let o=this,f=null,h=Array.isArray(r)&&typeof t=="function";if(this.options.version===1&&h)throw new TypeError("JSON-RPC 1.0 does not support batching");if(h||!h&&r&&typeof r=="object"&&typeof t=="function")n=t,f=r;else{typeof e=="function"&&(n=e,e=void 0);let _=typeof n=="function";try{f=Sl(r,t,e,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(E){if(_)return n(E);throw E}if(!_)return f}let b;try{b=JSON.stringify(f,this.options.replacer)}catch(_){return n(_)}return this.callServer(b,function(_,E){o._parseResponse(_,E,n)}),f};Ri.prototype._parseResponse=function(r,t,e){if(r){e(r);return}if(!t)return e();let n;try{n=JSON.parse(t,this.options.reviver)}catch(o){return e(o)}if(e.length===3)if(Array.isArray(n)){let o=function(h){return typeof h.error<"u"},f=function(h){return!o(h)};return e(null,n.filter(o),n.filter(f))}else return e(null,n.error,n.result);e(null,n)}});var qu=Ve((ky,ga)=>{"use strict";var Sy=H(j()),Bl=Object.prototype.hasOwnProperty,dr="~";function Ti(){}Object.create&&(Ti.prototype=Object.create(null),new Ti().__proto__||(dr=!1));function El(r,t,e){this.fn=r,this.context=t,this.once=e||!1}function zu(r,t,e,n,o){if(typeof e!="function")throw new TypeError("The listener must be a function");var f=new El(e,n||r,o),h=dr?dr+t:t;return r._events[h]?r._events[h].fn?r._events[h]=[r._events[h],f]:r._events[h].push(f):(r._events[h]=f,r._eventsCount++),r}function $o(r,t){--r._eventsCount===0?r._events=new Ti:delete r._events[t]}function cr(){this._events=new Ti,this._eventsCount=0}cr.prototype.eventNames=function(){var t=[],e,n;if(this._eventsCount===0)return t;for(n in e=this._events)Bl.call(e,n)&&t.push(dr?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(e)):t};cr.prototype.listeners=function(t){var e=dr?dr+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,f=n.length,h=new Array(f);o{Ey=H(j(),1),Fu=H(qu(),1)});var My,_l,Du=le(()=>{My=H(j(),1),_l=H(An(),1);Ku()});function Cl(r,t=24){let e=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let h=0;h<10;h++)e[h]=r[h]^r[h+10]^r[h+20]^r[h+30]^r[h+40];for(let h=0;h<10;h+=2){let x=(h+8)%10,b=(h+2)%10,_=e[b],E=e[b+1],L=Wu(_,E,1)^e[x],O=Hu(_,E,1)^e[x+1];for(let P=0;P<50;P+=10)r[h+P]^=L,r[h+P+1]^=O}let o=r[2],f=r[3];for(let h=0;h<24;h++){let x=$u[h],b=Wu(o,f,x),_=Hu(o,f,x),E=Vu[h];o=r[E],f=r[E+1],r[E]=b,r[E+1]=_}for(let h=0;h<50;h+=10){for(let x=0;x<10;x++)e[x]=r[h+x];for(let x=0;x<10;x++)r[h+x]^=~e[(x+2)%10]&e[(x+4)%10]}r[0]^=Tl[n],r[1]^=Pl[n]}e.fill(0)}var Dy,Vu,$u,ju,Al,Pi,Ml,Il,Ll,Rl,Tl,Pl,Wu,Hu,ai,kn,Ty,Py,Cy,Uy,Oy,ma,Ny,zy,Gu,qy,Fy,Yu=le(()=>{Dy=H(j(),1);gi();Es();fn();Vu=[],$u=[],ju=[],Al=BigInt(0),Pi=BigInt(1),Ml=BigInt(2),Il=BigInt(7),Ll=BigInt(256),Rl=BigInt(113);for(let r=0,t=Pi,e=1,n=0;r<24;r++){[e,n]=[n,(2*e+3*n)%5],Vu.push(2*(5*n+e)),$u.push((r+1)*(r+2)/2%64);let o=Al;for(let f=0;f<7;f++)t=(t<>Il)*Rl)%Ll,t&Ml&&(o^=Pi<<(Pi<e>32?Ss(r,t,e):vs(r,t,e),Hu=(r,t,e)=>e>32?Bs(r,t,e):ks(r,t,e);ai=class extends sn{constructor(t,e,n,o=!1,f=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=o,this.rounds=f,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,yi(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Sf(this.state)}keccak(){ys||gs(this.state32),Cl(this.state32,this.rounds),ys||gs(this.state32),this.posOut=0,this.pos=0}update(t){Vr(this);let{blockLen:e,state:n}=this;t=an(t);let o=t.length;for(let f=0;f=n&&this.keccak();let h=Math.min(n-this.posOut,f-o);t.set(e.subarray(this.posOut,this.posOut+h),o),this.posOut+=h,o+=h}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return yi(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Xi(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:e,suffix:n,outputLen:o,rounds:f,enableXOF:h}=this;return t||(t=new ai(e,n,o,h,f)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=f,t.suffix=n,t.outputLen=o,t.enableXOF=h,t.destroyed=this.destroyed,t}},kn=(r,t,e)=>Zn(()=>new ai(t,r,e)),Ty=kn(6,144,224/8),Py=kn(6,136,256/8),Cy=kn(6,104,384/8),Uy=kn(6,72,512/8),Oy=kn(1,144,224/8),ma=kn(1,136,256/8),Ny=kn(1,104,384/8),zy=kn(1,72,512/8),Gu=(r,t,e)=>Ef((n={})=>new ai(t,r,n.dkLen===void 0?e:n.dkLen,!0)),qy=Gu(31,168,128/8),Fy=Gu(31,136,256/8)});var $y,jo,wa,Zu=le(()=>{$y=H(j(),1);gi();fn();jo=class extends sn{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,vf(t);let n=an(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,f=new Uint8Array(o);f.set(n.length>o?t.create().update(n).digest():n);for(let h=0;hnew jo(r,t).update(e).digest();wa.create=(r,t)=>new jo(r,t)});function Xu(r){r.lowS!==void 0&&Rr("lowS",r.lowS),r.prehash!==void 0&&Rr("prehash",r.prehash)}function Ul(r){let t=bi(r);qr(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:e,Fp:n,a:o}=t;if(e){if(!n.eql(o,n.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof e!="object"||typeof e.beta!="bigint"||typeof e.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...t})}function zl(r){let t=Ul(r),{Fp:e}=t,n=pn(t.n,t.nBitLength),o=t.toBytes||((D,C,X)=>{let ot=C.toAffine();return Yr(Uint8Array.from([4]),e.toBytes(ot.x),e.toBytes(ot.y))}),f=t.fromBytes||(D=>{let C=D.subarray(1),X=e.fromBytes(C.subarray(0,e.BYTES)),ot=e.fromBytes(C.subarray(e.BYTES,2*e.BYTES));return{x:X,y:ot}});function h(D){let{a:C,b:X}=t,ot=e.sqr(D),G=e.mul(ot,D);return e.add(e.add(G,e.mul(D,C)),X)}if(!e.eql(e.sqr(t.Gy),h(t.Gx)))throw new Error("bad generator point: equation left != right");function x(D){return mi(D,Xe,t.n)}function b(D){let{allowedPrivateKeyLengths:C,nByteLength:X,wrapPrivateKey:ot,n:G}=t;if(C&&typeof D!="bigint"){if(hn(D)&&(D=jr(D)),typeof D!="string"||!C.includes(D.length))throw new Error("invalid private key");D=D.padStart(X*2,"0")}let it;try{it=typeof D=="bigint"?D:Gr(qe("private key",D,X))}catch{throw new Error("invalid private key, expected hex or "+X+" bytes, got "+typeof D)}return ot&&(it=Re(it,G)),yr("private key",it,Xe,G),it}function _(D){if(!(D instanceof O))throw new Error("ProjectivePoint expected")}let E=Tn((D,C)=>{let{px:X,py:ot,pz:G}=D;if(e.eql(G,e.ONE))return{x:X,y:ot};let it=D.is0();C==null&&(C=it?e.ONE:e.inv(G));let kt=e.mul(X,C),st=e.mul(ot,C),yt=e.mul(G,C);if(it)return{x:e.ZERO,y:e.ZERO};if(!e.eql(yt,e.ONE))throw new Error("invZ was invalid");return{x:kt,y:st}}),L=Tn(D=>{if(D.is0()){if(t.allowInfinityPoint&&!e.is0(D.py))return;throw new Error("bad point: ZERO")}let{x:C,y:X}=D.toAffine();if(!e.isValid(C)||!e.isValid(X))throw new Error("bad point: x or y not FE");let ot=e.sqr(X),G=h(C);if(!e.eql(ot,G))throw new Error("bad point: equation left != right");if(!D.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class O{constructor(C,X,ot){if(this.px=C,this.py=X,this.pz=ot,C==null||!e.isValid(C))throw new Error("x required");if(X==null||!e.isValid(X))throw new Error("y required");if(ot==null||!e.isValid(ot))throw new Error("z required");Object.freeze(this)}static fromAffine(C){let{x:X,y:ot}=C||{};if(!C||!e.isValid(X)||!e.isValid(ot))throw new Error("invalid affine point");if(C instanceof O)throw new Error("projective point not allowed");let G=it=>e.eql(it,e.ZERO);return G(X)&&G(ot)?O.ZERO:new O(X,ot,e.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(C){let X=e.invertBatch(C.map(ot=>ot.pz));return C.map((ot,G)=>ot.toAffine(X[G])).map(O.fromAffine)}static fromHex(C){let X=O.fromAffine(f(qe("pointHex",C)));return X.assertValidity(),X}static fromPrivateKey(C){return O.BASE.multiply(b(C))}static msm(C,X){return ao(O,n,C,X)}_setWindowSize(C){rt.setWindowSize(this,C)}assertValidity(){L(this)}hasEvenY(){let{y:C}=this.toAffine();if(e.isOdd)return!e.isOdd(C);throw new Error("Field doesn\'t support isOdd")}equals(C){_(C);let{px:X,py:ot,pz:G}=this,{px:it,py:kt,pz:st}=C,yt=e.eql(e.mul(X,st),e.mul(it,G)),At=e.eql(e.mul(ot,st),e.mul(kt,G));return yt&&At}negate(){return new O(this.px,e.neg(this.py),this.pz)}double(){let{a:C,b:X}=t,ot=e.mul(X,Ju),{px:G,py:it,pz:kt}=this,st=e.ZERO,yt=e.ZERO,At=e.ZERO,Et=e.mul(G,G),be=e.mul(it,it),ct=e.mul(kt,kt),Lt=e.mul(G,it);return Lt=e.add(Lt,Lt),At=e.mul(G,kt),At=e.add(At,At),st=e.mul(C,At),yt=e.mul(ot,ct),yt=e.add(st,yt),st=e.sub(be,yt),yt=e.add(be,yt),yt=e.mul(st,yt),st=e.mul(Lt,st),At=e.mul(ot,At),ct=e.mul(C,ct),Lt=e.sub(Et,ct),Lt=e.mul(C,Lt),Lt=e.add(Lt,At),At=e.add(Et,Et),Et=e.add(At,Et),Et=e.add(Et,ct),Et=e.mul(Et,Lt),yt=e.add(yt,Et),ct=e.mul(it,kt),ct=e.add(ct,ct),Et=e.mul(ct,Lt),st=e.sub(st,Et),At=e.mul(ct,be),At=e.add(At,At),At=e.add(At,At),new O(st,yt,At)}add(C){_(C);let{px:X,py:ot,pz:G}=this,{px:it,py:kt,pz:st}=C,yt=e.ZERO,At=e.ZERO,Et=e.ZERO,be=t.a,ct=e.mul(t.b,Ju),Lt=e.mul(X,it),g=e.mul(ot,kt),i=e.mul(G,st),a=e.add(X,ot),u=e.add(it,kt);a=e.mul(a,u),u=e.add(Lt,g),a=e.sub(a,u),u=e.add(X,G);let c=e.add(it,st);return u=e.mul(u,c),c=e.add(Lt,i),u=e.sub(u,c),c=e.add(ot,G),yt=e.add(kt,st),c=e.mul(c,yt),yt=e.add(g,i),c=e.sub(c,yt),Et=e.mul(be,u),yt=e.mul(ct,i),Et=e.add(yt,Et),yt=e.sub(g,Et),Et=e.add(g,Et),At=e.mul(yt,Et),g=e.add(Lt,Lt),g=e.add(g,Lt),i=e.mul(be,i),u=e.mul(ct,u),g=e.add(g,i),i=e.sub(Lt,i),i=e.mul(be,i),u=e.add(u,i),Lt=e.mul(g,u),At=e.add(At,Lt),Lt=e.mul(c,u),yt=e.mul(a,yt),yt=e.sub(yt,Lt),Lt=e.mul(a,g),Et=e.mul(c,Et),Et=e.add(Et,Lt),new O(yt,At,Et)}subtract(C){return this.add(C.negate())}is0(){return this.equals(O.ZERO)}wNAF(C){return rt.wNAFCached(this,C,O.normalizeZ)}multiplyUnsafe(C){let{endo:X,n:ot}=t;yr("scalar",C,Qr,ot);let G=O.ZERO;if(C===Qr)return G;if(this.is0()||C===Xe)return this;if(!X||rt.hasPrecomputes(this))return rt.wNAFCachedUnsafe(this,C,O.normalizeZ);let{k1neg:it,k1:kt,k2neg:st,k2:yt}=X.splitScalar(C),At=G,Et=G,be=this;for(;kt>Qr||yt>Qr;)kt&Xe&&(At=At.add(be)),yt&Xe&&(Et=Et.add(be)),be=be.double(),kt>>=Xe,yt>>=Xe;return it&&(At=At.negate()),st&&(Et=Et.negate()),Et=new O(e.mul(Et.px,X.beta),Et.py,Et.pz),At.add(Et)}multiply(C){let{endo:X,n:ot}=t;yr("scalar",C,Xe,ot);let G,it;if(X){let{k1neg:kt,k1:st,k2neg:yt,k2:At}=X.splitScalar(C),{p:Et,f:be}=this.wNAF(st),{p:ct,f:Lt}=this.wNAF(At);Et=rt.constTimeNegate(kt,Et),ct=rt.constTimeNegate(yt,ct),ct=new O(e.mul(ct.px,X.beta),ct.py,ct.pz),G=Et.add(ct),it=be.add(Lt)}else{let{p:kt,f:st}=this.wNAF(C);G=kt,it=st}return O.normalizeZ([G,it])[0]}multiplyAndAddUnsafe(C,X,ot){let G=O.BASE,it=(st,yt)=>yt===Qr||yt===Xe||!st.equals(G)?st.multiplyUnsafe(yt):st.multiply(yt),kt=it(this,X).add(it(C,ot));return kt.is0()?void 0:kt}toAffine(C){return E(this,C)}isTorsionFree(){let{h:C,isTorsionFree:X}=t;if(C===Xe)return!0;if(X)return X(O,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:C,clearCofactor:X}=t;return C===Xe?this:X?X(O,this):this.multiplyUnsafe(t.h)}toRawBytes(C=!0){return Rr("isCompressed",C),this.assertValidity(),o(O,this,C)}toHex(C=!0){return Rr("isCompressed",C),jr(this.toRawBytes(C))}}O.BASE=new O(t.Gx,t.Gy,e.ONE),O.ZERO=new O(e.ZERO,e.ONE,e.ZERO);let P=t.nBitLength,rt=so(O,t.endo?Math.ceil(P/2):P);return{CURVE:t,ProjectivePoint:O,normPrivateKeyToScalar:b,weierstrassEquation:h,isWithinCurveOrder:x}}function ql(r){let t=bi(r);return qr(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Qu(r){let t=ql(r),{Fp:e,n}=t,o=e.BYTES+1,f=2*e.BYTES+1;function h(i){return Re(i,n)}function x(i){return io(i,n)}let{ProjectivePoint:b,normPrivateKeyToScalar:_,weierstrassEquation:E,isWithinCurveOrder:L}=zl({...t,toBytes(i,a,u){let c=a.toAffine(),d=e.toBytes(c.x),m=Yr;return Rr("isCompressed",u),u?m(Uint8Array.from([a.hasEvenY()?2:3]),d):m(Uint8Array.from([4]),d,e.toBytes(c.y))},fromBytes(i){let a=i.length,u=i[0],c=i.subarray(1);if(a===o&&(u===2||u===3)){let d=Gr(c);if(!mi(d,Xe,e.ORDER))throw new Error("Point is not on curve");let m=E(d),v;try{v=e.sqrt(m)}catch(y){let R=y instanceof Error?": "+y.message:"";throw new Error("Point is not on curve"+R)}let p=(v&Xe)===Xe;return(u&1)===1!==p&&(v=e.neg(v)),{x:d,y:v}}else if(a===f&&u===4){let d=e.fromBytes(c.subarray(0,e.BYTES)),m=e.fromBytes(c.subarray(e.BYTES,2*e.BYTES));return{x:d,y:m}}else{let d=o,m=f;throw new Error("invalid Point, expected length of "+d+", or uncompressed "+m+", got "+a)}}}),O=i=>jr(dn(i,t.nByteLength));function P(i){let a=n>>Xe;return i>a}function rt(i){return P(i)?h(-i):i}let D=(i,a,u)=>Gr(i.slice(a,u));class C{constructor(a,u,c){this.r=a,this.s=u,this.recovery=c,this.assertValidity()}static fromCompact(a){let u=t.nByteLength;return a=qe("compactSignature",a,u*2),new C(D(a,0,u),D(a,u,2*u))}static fromDER(a){let{r:u,s:c}=Jr.toSig(qe("DER",a));return new C(u,c)}assertValidity(){yr("r",this.r,Xe,n),yr("s",this.s,Xe,n)}addRecoveryBit(a){return new C(this.r,this.s,a)}recoverPublicKey(a){let{r:u,s:c,recovery:d}=this,m=st(qe("msgHash",a));if(d==null||![0,1,2,3].includes(d))throw new Error("recovery id invalid");let v=d===2||d===3?u+t.n:u;if(v>=e.ORDER)throw new Error("recovery id 2 or 3 invalid");let p=d&1?"03":"02",s=b.fromHex(p+O(v)),y=x(v),R=h(-m*y),U=h(c*y),W=b.BASE.multiplyAndAddUnsafe(s,R,U);if(!W)throw new Error("point at infinify");return W.assertValidity(),W}hasHighS(){return P(this.s)}normalizeS(){return this.hasHighS()?new C(this.r,h(-this.s),this.recovery):this}toDERRawBytes(){return Ln(this.toDERHex())}toDERHex(){return Jr.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Ln(this.toCompactHex())}toCompactHex(){return O(this.r)+O(this.s)}}let X={isValidPrivateKey(i){try{return _(i),!0}catch{return!1}},normPrivateKeyToScalar:_,randomPrivateKey:()=>{let i=Us(t.n);return Nf(t.randomBytes(i),t.n)},precompute(i=8,a=b.BASE){return a._setWindowSize(i),a.multiply(BigInt(3)),a}};function ot(i,a=!0){return b.fromPrivateKey(i).toRawBytes(a)}function G(i){let a=hn(i),u=typeof i=="string",c=(a||u)&&i.length;return a?c===o||c===f:u?c===2*o||c===2*f:i instanceof b}function it(i,a,u=!0){if(G(i))throw new Error("first arg must be private key");if(!G(a))throw new Error("second arg must be public key");return b.fromHex(a).multiply(_(i)).toRawBytes(u)}let kt=t.bits2int||function(i){if(i.length>8192)throw new Error("input is too large");let a=Gr(i),u=i.length*8-t.nBitLength;return u>0?a>>BigInt(u):a},st=t.bits2int_modN||function(i){return h(kt(i))},yt=wi(t.nBitLength);function At(i){return yr("num < 2^"+t.nBitLength,i,Qr,yt),dn(i,t.nByteLength)}function Et(i,a,u=be){if(["recovered","canonical"].some(at=>at in u))throw new Error("sign() legacy options not supported");let{hash:c,randomBytes:d}=t,{lowS:m,prehash:v,extraEntropy:p}=u;m==null&&(m=!0),i=qe("msgHash",i),Xu(u),v&&(i=qe("prehashed msgHash",c(i)));let s=st(i),y=_(a),R=[At(y),At(s)];if(p!=null&&p!==!1){let at=p===!0?d(e.BYTES):p;R.push(qe("extraEntropy",at))}let U=Yr(...R),W=s;function tt(at){let lt=kt(at);if(!L(lt))return;let xe=x(lt),gt=b.BASE.multiply(lt).toAffine(),St=h(gt.x);if(St===Qr)return;let Ye=h(xe*h(W+St*y));if(Ye===Qr)return;let Ct=(gt.x===St?0:2)|Number(gt.y&Xe),Kt=Ye;return m&&P(Ye)&&(Kt=rt(Ye),Ct^=1),new C(St,Kt,Ct)}return{seed:U,k2sig:tt}}let be={lowS:t.lowS,prehash:!1},ct={lowS:t.lowS,prehash:!1};function Lt(i,a,u=be){let{seed:c,k2sig:d}=Et(i,a,u),m=t;return Rs(m.hash.outputLen,m.nByteLength,m.hmac)(c,d)}b.BASE._setWindowSize(8);function g(i,a,u,c=ct){let d=i;a=qe("msgHash",a),u=qe("publicKey",u);let{lowS:m,prehash:v,format:p}=c;if(Xu(c),"strict"in c)throw new Error("options.strict was renamed to lowS");if(p!==void 0&&p!=="compact"&&p!=="der")throw new Error("format must be compact or der");let s=typeof d=="string"||hn(d),y=!s&&!p&&typeof d=="object"&&d!==null&&typeof d.r=="bigint"&&typeof d.s=="bigint";if(!s&&!y)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let R,U;try{if(y&&(R=new C(d.r,d.s)),s){try{p!=="compact"&&(R=C.fromDER(d))}catch(Ct){if(!(Ct instanceof Jr.Err))throw Ct}!R&&p!=="der"&&(R=C.fromCompact(d))}U=b.fromHex(u)}catch{return!1}if(!R||m&&R.hasHighS())return!1;v&&(a=t.hash(a));let{r:W,s:tt}=R,at=st(a),lt=x(tt),xe=h(at*lt),gt=h(W*lt),St=b.BASE.multiplyAndAddUnsafe(U,xe,gt)?.toAffine();return St?h(St.x)===W:!1}return{CURVE:t,getPublicKey:ot,getSharedSecret:it,sign:Lt,verify:g,ProjectivePoint:b,Signature:C,utils:X}}var Qy,Ol,Nl,ba,Jr,Qr,Xe,Zy,Ju,Xy,tc=le(()=>{Qy=H(j(),1);Fs();Qn();Pn();Pn();({bytesToNumberBE:Ol,hexToBytes:Nl}=no),ba=class extends Error{constructor(t=""){super(t)}},Jr={Err:ba,_tlv:{encode:(r,t)=>{let{Err:e}=Jr;if(r<0||r>256)throw new e("tlv.encode: wrong tag");if(t.length&1)throw new e("tlv.encode: unpadded data");let n=t.length/2,o=In(n);if(o.length/2&128)throw new e("tlv.encode: long form length too big");let f=n>127?In(o.length/2|128):"";return In(r)+f+o+t},decode(r,t){let{Err:e}=Jr,n=0;if(r<0||r>256)throw new e("tlv.encode: wrong tag");if(t.length<2||t[n++]!==r)throw new e("tlv.decode: wrong tlv");let o=t[n++],f=!!(o&128),h=0;if(!f)h=o;else{let b=o&127;if(!b)throw new e("tlv.decode(long): indefinite length not supported");if(b>4)throw new e("tlv.decode(long): byte length is too big");let _=t.subarray(n,n+b);if(_.length!==b)throw new e("tlv.decode: length bytes not complete");if(_[0]===0)throw new e("tlv.decode(long): zero leftmost byte");for(let E of _)h=h<<8|E;if(n+=b,h<128)throw new e("tlv.decode(long): not minimal encoding")}let x=t.subarray(n,n+h);if(x.length!==h)throw new e("tlv.decode: wrong value length");return{v:x,l:t.subarray(n+h)}}},_int:{encode(r){let{Err:t}=Jr;if(rwa(r,t,ms(...e)),randomBytes:Qi}}function ec(r,t){let e=n=>Qu({...r,...Fl(n)});return{...e(t),create:e}}var ig,rc=le(()=>{ig=H(j(),1);Zu();fn();tc();});function Dl(r){let t=oc,e=BigInt(3),n=BigInt(6),o=BigInt(11),f=BigInt(22),h=BigInt(23),x=BigInt(44),b=BigInt(88),_=r*r*r%t,E=_*_*r%t,L=Ne(E,e,t)*E%t,O=Ne(L,e,t)*E%t,P=Ne(O,xa,t)*_%t,rt=Ne(P,o,t)*P%t,D=Ne(rt,f,t)*rt%t,C=Ne(D,x,t)*D%t,X=Ne(C,b,t)*C%t,ot=Ne(X,x,t)*D%t,G=Ne(ot,e,t)*E%t,it=Ne(G,h,t)*rt%t,kt=Ne(it,n,t)*_%t,st=Ne(kt,xa,t);if(!va.eql(va.sqr(st),r))throw new Error("Cannot find square root");return st}var hg,oc,nc,Kl,xa,ic,va,Ci,fg,ug,sc=le(()=>{hg=H(j(),1);js();rc();Qn();oc=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),nc=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Kl=BigInt(1),xa=BigInt(2),ic=(r,t)=>(r+t/xa)/t;va=pn(oc,void 0,void 0,{sqrt:Dl}),Ci=ec({a:BigInt(0),b:BigInt(7),Fp:va,n:nc,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let t=nc,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Kl*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),f=e,h=BigInt("0x100000000000000000000000000000000"),x=ic(f*r,t),b=ic(-n*r,t),_=Re(r-x*e-b*o,t),E=Re(-x*n-b*f,t),L=_>h,O=E>h;if(L&&(_=t-_),O&&(E=t-E),_>h||E>h)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:L,k1:_,k2neg:O,k2:E}}}},xi),fg=BigInt(0),ug=Ci.ProjectivePoint});function fc(r){try{return Un.ExtendedPoint.fromHex(r),!0}catch{return!1}}function $l(r){return r._bn!==void 0}function Sc(r,t){let e=o=>{if(o.span>=0)return o.span;if(typeof o.alloc=="function")return o.alloc(t[o.property]);if("count"in o&&"elementLayout"in o){let f=t[o.property];if(Array.isArray(f))return f.length*e(o.elementLayout)}else if("fields"in o)return Sc({layout:o},t[o.property]);return 0},n=0;return r.layout.fields.forEach(o=>{n+=e(o)}),n}function Ni(r){let t=0,e=0;for(;;){let n=r.shift();if(t|=(n&127)<>=7,e==0){r.push(n);break}else n|=128,r.push(n)}}function Ge(r,t){if(!r)throw new Error(t||"Assertion failed")}function Go(r){if(r.length===0)throw new Error(Bc);return r.shift()}function qi(r,...t){let[e]=t;if(t.length===2?e+(t[1]??0)>r.length:e>=r.length)throw new Error(Bc);return r.splice(...t)}async function cc(r,t,e,n){let o=n&&{skipPreflight:n.skipPreflight,preflightCommitment:n.preflightCommitment||n.commitment,maxRetries:n.maxRetries,minContextSlot:n.minContextSlot},f=await r.sendTransaction(t,e,o),h;if(t.recentBlockhash!=null&&t.lastValidBlockHeight!=null)h=(await r.confirmTransaction({abortSignal:n?.abortSignal,signature:f,blockhash:t.recentBlockhash,lastValidBlockHeight:t.lastValidBlockHeight},n&&n.commitment)).value;else if(t.minNonceContextSlot!=null&&t.nonceInfo!=null){let{nonceInstruction:x}=t.nonceInfo,b=x.keys[0].pubkey;h=(await r.confirmTransaction({abortSignal:n?.abortSignal,minContextSlot:t.minNonceContextSlot,nonceAccountPubkey:b,nonceValue:t.nonceInfo.nonce,signature:f},n&&n.commitment)).value}else n?.abortSignal!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),h=(await r.confirmTransaction(f,n&&n.commitment)).value;if(h.err)throw f!=null?new Ta({action:"send",signature:f,transactionMessage:`Status: (${JSON.stringify(h)})`}):new Error(`Transaction ${f} failed (${JSON.stringify(h)})`);return f}function nd(r){return new Promise(t=>setTimeout(t,r))}function Se(r,t){let e=r.layout.span>=0?r.layout.span:Sc(r,t),n=Yt.Buffer.alloc(e),o=Object.assign({instruction:r.index},t);return r.layout.encode(o,n),n}function _c(r){return or([et({jsonrpc:ze("2.0"),id:ft(),result:r}),et({jsonrpc:ze("2.0"),id:ft(),error:et({code:Fn(),message:ft(),data:Nt(lu())})})])}function Ue(r){return si(_c(r),ud,t=>"error"in t?t:{...t,result:oi(t.result,r)})}function Ar(r){return Ue(et({context:et({slot:z()}),value:r}))}function es(r){return et({context:et({slot:z()}),value:r})}var Pm,Yt,_a,wr,li,I,bc,Vi,Wl,xg,ac,Aa,xc,Hl,Me,Ma,Zo,vc,Vl,Fi,uc,ae,vg,Xo,jl,kc,Ia,La,Ra,Jo,_e,fi,Gl,Yl,Zl,Xl,Ki,Bc,Dn,Jl,Ce,Pe,Ql,td,ed,rd,tn,kg,Sg,ka,Di,Bg,Eg,_g,Sa,Ta,id,od,hc,sd,ad,ui,_r,Je,fd,ci,Ag,Mg,Ig,We,Ec,Oa,Lg,ud,cd,Rg,hd,ld,dd,pd,yd,Wn,gd,md,Tg,wd,bd,Pg,Cg,Ug,Og,Ng,zg,qg,Fg,Kg,Dg,xd,Wg,Hg,Pa,Vg,$g,Na,jg,vd,kd,Gg,Yg,Zg,Xg,Jg,Sd,Qg,Bd,tm,Ed,em,rm,nm,im,lc,om,_d,Ad,sm,am,Ac,za,Mc,Ic,Lc,Rc,Md,Id,Tc,Pc,Qo,Cc,rs,qa,di,Hn,fm,um,cm,hm,lm,dm,pm,ym,gm,mm,wm,bm,xm,Ld,vm,km,Sm,Bm,Rd,Em,en,Ui,Ca,Yo,Ua,dc,pc,yc,gc,Wi,Td,Pd,mc,Ba,wc,Cd,Ea,Kn,Uc,Ud,Hi,Sn,_m,ts,Oi,Am,hi,Mm,Im,Lm,Rm,Oc=le(()=>{Pm=H(j()),Yt=H(An());Vf();_a=H(jf()),wr=H(Vs());js();li=H(au()),I=H(na()),bc=H(na()),Vi=H(fu());du();Wl=H(Nu());Du();Yu();sc();xg=Un.utils.randomPrivateKey,ac=()=>{let r=Un.utils.randomPrivateKey(),t=Aa(r),e=new Uint8Array(64);return e.set(r),e.set(t,32),{publicKey:t,secretKey:e}},Aa=Un.getPublicKey;xc=(r,t)=>Un.sign(r,t.slice(0,32)),Hl=Un.verify,Me=r=>Yt.Buffer.isBuffer(r)?r:r instanceof Uint8Array?Yt.Buffer.from(r.buffer,r.byteOffset,r.byteLength):Yt.Buffer.from(r),Ma=class{constructor(t){Object.assign(this,t)}encode(){return Yt.Buffer.from((0,li.serialize)(Zo,this))}static decode(t){return(0,li.deserialize)(Zo,this,t)}static decodeUnchecked(t){return(0,li.deserializeUnchecked)(Zo,this,t)}},Zo=new Map,Vl=32,Fi=32;uc=1,ae=class extends Ma{constructor(t){if(super({}),this._bn=void 0,$l(t))this._bn=t._bn;else{if(typeof t=="string"){let e=wr.default.decode(t);if(e.length!=Fi)throw new Error("Invalid public key input");this._bn=new _a.default(e)}else this._bn=new _a.default(t);if(this._bn.byteLength()>Fi)throw new Error("Invalid public key input")}}static unique(){let t=new ae(uc);return uc+=1,new ae(t.toBuffer())}equals(t){return this._bn.eq(t._bn)}toBase58(){return wr.default.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){let t=this.toBuffer();return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}toBuffer(){let t=this._bn.toArrayLike(Yt.Buffer);if(t.length===Fi)return t;let e=Yt.Buffer.alloc(32);return t.copy(e,32-t.length),e}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(t,e,n){let o=Yt.Buffer.concat([t.toBuffer(),Yt.Buffer.from(e),n.toBuffer()]),f=xi(o);return new ae(f)}static createProgramAddressSync(t,e){let n=Yt.Buffer.alloc(0);t.forEach(function(f){if(f.length>Vl)throw new TypeError("Max seed length exceeded");n=Yt.Buffer.concat([n,Me(f)])}),n=Yt.Buffer.concat([n,e.toBuffer(),Yt.Buffer.from("ProgramDerivedAddress")]);let o=xi(n);if(fc(o))throw new Error("Invalid seeds, address must fall off the curve");return new ae(o)}static async createProgramAddress(t,e){return this.createProgramAddressSync(t,e)}static findProgramAddressSync(t,e){let n=255,o;for(;n!=0;){try{let f=t.concat(Yt.Buffer.from([n]));o=this.createProgramAddressSync(f,e)}catch(f){if(f instanceof TypeError)throw f;n--;continue}return[o,n]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(t,e){return this.findProgramAddressSync(t,e)}static isOnCurve(t){let e=new ae(t);return fc(e.toBytes())}};vc=ae;ae.default=new vc("11111111111111111111111111111111");Zo.set(ae,{kind:"struct",fields:[["_bn","u256"]]});vg=new ae("BPFLoader1111111111111111111111111111111111"),Xo=1280-40-8,jl=127,kc=64,Ia=class extends Error{constructor(t){super(`Signature ${t} has expired: block height exceeded.`),this.signature=void 0,this.signature=t}};Object.defineProperty(Ia.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});La=class extends Error{constructor(t,e){super(`Transaction was not confirmed in ${e.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${t} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=t}};Object.defineProperty(La.prototype,"name",{value:"TransactionExpiredTimeoutError"});Ra=class extends Error{constructor(t){super(`Signature ${t} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=t}};Object.defineProperty(Ra.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});Jo=class{constructor(t,e){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=e}keySegments(){let t=[this.staticAccountKeys];return this.accountKeysFromLookups&&(t.push(this.accountKeysFromLookups.writable),t.push(this.accountKeysFromLookups.readonly)),t}get(t){for(let e of this.keySegments()){if(t255+1)throw new Error("Account index overflow encountered during compilation");let n=new Map;this.keySegments().flat().forEach((f,h)=>{n.set(f.toBase58(),h)});let o=f=>{let h=n.get(f.toBase58());if(h===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return h};return t.map(f=>({programIdIndex:o(f.programId),accountKeyIndexes:f.keys.map(h=>o(h.pubkey)),data:f.data}))}},_e=(r="publicKey")=>I.blob(32,r),fi=(r="string")=>{let t=I.struct([I.u32("length"),I.u32("lengthPadding"),I.blob(I.offset(I.u32(),-8),"chars")],r),e=t.decode.bind(t),n=t.encode.bind(t),o=t;return o.decode=(f,h)=>e(f,h).chars.toString(),o.encode=(f,h,x)=>{let b={chars:Yt.Buffer.from(f,"utf8")};return n(b,h,x)},o.alloc=f=>I.u32().span+I.u32().span+Yt.Buffer.from(f,"utf8").length,o},Gl=(r="authorized")=>I.struct([_e("staker"),_e("withdrawer")],r),Yl=(r="lockup")=>I.struct([I.ns64("unixTimestamp"),I.ns64("epoch"),_e("custodian")],r),Zl=(r="voteInit")=>I.struct([_e("nodePubkey"),_e("authorizedVoter"),_e("authorizedWithdrawer"),I.u8("commission")],r),Xl=(r="voteAuthorizeWithSeedArgs")=>I.struct([I.u32("voteAuthorizationType"),_e("currentAuthorityDerivedKeyOwnerPubkey"),fi("currentAuthorityDerivedKeySeed"),_e("newAuthorized")],r);Ki=class{constructor(t,e){this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=e}static compile(t,e){let n=new Map,o=h=>{let x=h.toBase58(),b=n.get(x);return b===void 0&&(b={isSigner:!1,isWritable:!1,isInvoked:!1},n.set(x,b)),b},f=o(e);f.isSigner=!0,f.isWritable=!0;for(let h of t){o(h.programId).isInvoked=!0;for(let x of h.keys){let b=o(x.pubkey);b.isSigner||=x.isSigner,b.isWritable||=x.isWritable}}return new Ki(e,n)}getMessageComponents(){let t=[...this.keyMetaMap.entries()];Ge(t.length<=256,"Max static account keys length exceeded");let e=t.filter(([,b])=>b.isSigner&&b.isWritable),n=t.filter(([,b])=>b.isSigner&&!b.isWritable),o=t.filter(([,b])=>!b.isSigner&&b.isWritable),f=t.filter(([,b])=>!b.isSigner&&!b.isWritable),h={numRequiredSignatures:e.length+n.length,numReadonlySignedAccounts:n.length,numReadonlyUnsignedAccounts:f.length};{Ge(e.length>0,"Expected at least one writable signer key");let[b]=e[0];Ge(b===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}let x=[...e.map(([b])=>new ae(b)),...n.map(([b])=>new ae(b)),...o.map(([b])=>new ae(b)),...f.map(([b])=>new ae(b))];return[h,x]}extractTableLookup(t){let[e,n]=this.drainKeysFoundInLookupTable(t.state.addresses,h=>!h.isSigner&&!h.isInvoked&&h.isWritable),[o,f]=this.drainKeysFoundInLookupTable(t.state.addresses,h=>!h.isSigner&&!h.isInvoked&&!h.isWritable);if(!(e.length===0&&o.length===0))return[{accountKey:t.key,writableIndexes:e,readonlyIndexes:o},{writable:n,readonly:f}]}drainKeysFoundInLookupTable(t,e){let n=new Array,o=new Array;for(let[f,h]of this.keyMetaMap.entries())if(e(h)){let x=new ae(f),b=t.findIndex(_=>_.equals(x));b>=0&&(Ge(b<256,"Max lookup table index exceeded"),n.push(b),o.push(x),this.keyMetaMap.delete(f))}return[n,o]}},Bc="Reached end of buffer unexpectedly";Dn=class{constructor(t){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map(e=>new ae(e)),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach(e=>this.indexToProgramIds.set(e.programIdIndex,this.accountKeys[e.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:wr.default.decode(t.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new Jo(this.staticAccountKeys)}static compile(t){let e=Ki.compile(t.instructions,t.payerKey),[n,o]=e.getMessageComponents(),h=new Jo(o).compileInstructions(t.instructions).map(x=>({programIdIndex:x.programIdIndex,accounts:x.accountKeyIndexes,data:wr.default.encode(x.data)}));return new Dn({header:n,accountKeys:o,recentBlockhash:t.recentBlockhash,instructions:h})}isAccountSigner(t){return t=this.header.numRequiredSignatures){let n=t-e,f=this.accountKeys.length-e-this.header.numReadonlyUnsignedAccounts;return n!this.isProgramId(e))}serialize(){let t=this.accountKeys.length,e=[];zi(e,t);let n=this.instructions.map(L=>{let{accounts:O,programIdIndex:P}=L,rt=Array.from(wr.default.decode(L.data)),D=[];zi(D,O.length);let C=[];return zi(C,rt.length),{programIdIndex:P,keyIndicesCount:Yt.Buffer.from(D),keyIndices:O,dataLength:Yt.Buffer.from(C),data:rt}}),o=[];zi(o,n.length);let f=Yt.Buffer.alloc(Xo);Yt.Buffer.from(o).copy(f);let h=o.length;n.forEach(L=>{let P=I.struct([I.u8("programIdIndex"),I.blob(L.keyIndicesCount.length,"keyIndicesCount"),I.seq(I.u8("keyIndex"),L.keyIndices.length,"keyIndices"),I.blob(L.dataLength.length,"dataLength"),I.seq(I.u8("userdatum"),L.data.length,"data")]).encode(L,f,h);h+=P}),f=f.slice(0,h);let x=I.struct([I.blob(1,"numRequiredSignatures"),I.blob(1,"numReadonlySignedAccounts"),I.blob(1,"numReadonlyUnsignedAccounts"),I.blob(e.length,"keyCount"),I.seq(_e("key"),t,"keys"),_e("recentBlockhash")]),b={numRequiredSignatures:Yt.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:Yt.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:Yt.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:Yt.Buffer.from(e),keys:this.accountKeys.map(L=>Me(L.toBytes())),recentBlockhash:wr.default.decode(this.recentBlockhash)},_=Yt.Buffer.alloc(2048),E=x.encode(b,_);return f.copy(_,E),_.slice(0,E+f.length)}static from(t){let e=[...t],n=Go(e);if(n!==(n&jl))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");let o=Go(e),f=Go(e),h=Ni(e),x=[];for(let O=0;O({pubkey:t.toJSON(),isSigner:e,isWritable:n})),programId:this.programId.toJSON(),data:[...this.data]}}},Pe=class{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(t){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!!t)if(t.feePayer&&(this.feePayer=t.feePayer),t.signatures&&(this.signatures=t.signatures),Object.prototype.hasOwnProperty.call(t,"nonceInfo")){let{minContextSlot:e,nonceInfo:n}=t;this.minNonceContextSlot=e,this.nonceInfo=n}else if(Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")){let{blockhash:e,lastValidBlockHeight:n}=t;this.recentBlockhash=e,this.lastValidBlockHeight=n}else{let{recentBlockhash:e,nonceInfo:n}=t;n&&(this.nonceInfo=n),this.recentBlockhash=e}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(t=>t.toJSON()),signers:this.signatures.map(({publicKey:t})=>t.toJSON())}}add(...t){if(t.length===0)throw new Error("No instructions");return t.forEach(e=>{"instructions"in e?this.instructions=this.instructions.concat(e.instructions):"data"in e&&"programId"in e&&"keys"in e?this.instructions.push(e):this.instructions.push(new Ce(e))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let t,e;if(this.nonceInfo?(t=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?e=[this.nonceInfo.nonceInstruction,...this.instructions]:e=this.instructions):(t=this.recentBlockhash,e=this.instructions),!t)throw new Error("Transaction recentBlockhash required");e.length<1&&console.warn("No instructions provided");let n;if(this.feePayer)n=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)n=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let D=0;D{D.keys.forEach(X=>{f.push({...X})});let C=D.programId.toString();o.includes(C)||o.push(C)}),o.forEach(D=>{f.push({pubkey:new ae(D),isSigner:!1,isWritable:!1})});let h=[];f.forEach(D=>{let C=D.pubkey.toString(),X=h.findIndex(ot=>ot.pubkey.toString()===C);X>-1?(h[X].isWritable=h[X].isWritable||D.isWritable,h[X].isSigner=h[X].isSigner||D.isSigner):h.push(D)}),h.sort(function(D,C){if(D.isSigner!==C.isSigner)return D.isSigner?-1:1;if(D.isWritable!==C.isWritable)return D.isWritable?-1:1;let X={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return D.pubkey.toBase58().localeCompare(C.pubkey.toBase58(),"en",X)});let x=h.findIndex(D=>D.pubkey.equals(n));if(x>-1){let[D]=h.splice(x,1);D.isSigner=!0,D.isWritable=!0,h.unshift(D)}else h.unshift({pubkey:n,isSigner:!0,isWritable:!0});for(let D of this.signatures){let C=h.findIndex(X=>X.pubkey.equals(D.publicKey));if(C>-1)h[C].isSigner||(h[C].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw new Error(`unknown signer: ${D.publicKey.toString()}`)}let b=0,_=0,E=0,L=[],O=[];h.forEach(({pubkey:D,isSigner:C,isWritable:X})=>{C?(L.push(D.toString()),b+=1,X||(_+=1)):(O.push(D.toString()),X||(E+=1))});let P=L.concat(O),rt=e.map(D=>{let{data:C,programId:X}=D;return{programIdIndex:P.indexOf(X.toString()),accounts:D.keys.map(ot=>P.indexOf(ot.pubkey.toString())),data:wr.default.encode(C)}});return rt.forEach(D=>{Ge(D.programIdIndex>=0),D.accounts.forEach(C=>Ge(C>=0))}),new Dn({header:{numRequiredSignatures:b,numReadonlySignedAccounts:_,numReadonlyUnsignedAccounts:E},accountKeys:P,recentBlockhash:t,instructions:rt})}_compile(){let t=this.compileMessage(),e=t.accountKeys.slice(0,t.header.numRequiredSignatures);return this.signatures.length===e.length&&this.signatures.every((o,f)=>e[f].equals(o.publicKey))||(this.signatures=e.map(n=>({signature:null,publicKey:n}))),t}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(t){return(await t.getFeeForMessage(this.compileMessage())).value}setSigners(...t){if(t.length===0)throw new Error("No signers");let e=new Set;this.signatures=t.filter(n=>{let o=n.toString();return e.has(o)?!1:(e.add(o),!0)}).map(n=>({signature:null,publicKey:n}))}sign(...t){if(t.length===0)throw new Error("No signers");let e=new Set,n=[];for(let f of t){let h=f.publicKey.toString();e.has(h)||(e.add(h),n.push(f))}this.signatures=n.map(f=>({signature:null,publicKey:f.publicKey}));let o=this._compile();this._partialSign(o,...n)}partialSign(...t){if(t.length===0)throw new Error("No signers");let e=new Set,n=[];for(let f of t){let h=f.publicKey.toString();e.has(h)||(e.add(h),n.push(f))}let o=this._compile();this._partialSign(o,...n)}_partialSign(t,...e){let n=t.serialize();e.forEach(o=>{let f=xc(n,o.secretKey);this._addSignature(o.publicKey,Me(f))})}addSignature(t,e){this._compile(),this._addSignature(t,e)}_addSignature(t,e){Ge(e.length===64);let n=this.signatures.findIndex(o=>t.equals(o.publicKey));if(n<0)throw new Error(`unknown signer: ${t.toString()}`);this.signatures[n].signature=Yt.Buffer.from(e)}verifySignatures(t=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),t)}_getMessageSignednessErrors(t,e){let n={};for(let{signature:o,publicKey:f}of this.signatures)o===null?e&&(n.missing||=[]).push(f):Hl(o,t,f.toBytes())||(n.invalid||=[]).push(f);return n.invalid||n.missing?n:void 0}serialize(t){let{requireAllSignatures:e,verifySignatures:n}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},t),o=this.serializeMessage();if(n){let f=this._getMessageSignednessErrors(o,e);if(f){let h="Signature verification failed.";throw f.invalid&&(h+=`\nInvalid signature for public key${f.invalid.length===1?"":"(s)"} [\\`${f.invalid.map(x=>x.toBase58()).join("`, `")}\\`].`),f.missing&&(h+=`\nMissing signature for public key${f.missing.length===1?"":"(s)"} [\\`${f.missing.map(x=>x.toBase58()).join("`, `")}\\`].`),new Error(h)}}return this._serialize(o)}_serialize(t){let{signatures:e}=this,n=[];zi(n,e.length);let o=n.length+e.length*64+t.length,f=Yt.Buffer.alloc(o);return Ge(e.length<256),Yt.Buffer.from(n).copy(f,0),e.forEach(({signature:h},x)=>{h!==null&&(Ge(h.length===64,"signature has invalid length"),Yt.Buffer.from(h).copy(f,n.length+x*64))}),t.copy(f,n.length+e.length*64),Ge(f.length<=Xo,`Transaction too large: ${f.length} > ${Xo}`),f}get keys(){return Ge(this.instructions.length===1),this.instructions[0].keys.map(t=>t.pubkey)}get programId(){return Ge(this.instructions.length===1),this.instructions[0].programId}get data(){return Ge(this.instructions.length===1),this.instructions[0].data}static from(t){let e=[...t],n=Ni(e),o=[];for(let f=0;f0&&(n.feePayer=t.accountKeys[0]),e.forEach((o,f)=>{let h={signature:o==wr.default.encode(Jl)?null:wr.default.decode(o),publicKey:t.accountKeys[f]};n.signatures.push(h)}),t.instructions.forEach(o=>{let f=o.accounts.map(h=>{let x=t.accountKeys[h];return{pubkey:x,isSigner:n.signatures.some(b=>b.publicKey.toString()===x.toString())||t.isAccountSigner(h),isWritable:t.isAccountWritable(h)}});n.instructions.push(new Ce({keys:f,programId:t.accountKeys[o.programIdIndex],data:wr.default.decode(o.data)}))}),n._message=t,n._json=n.toJSON(),n}},Ql=160,td=64,ed=Ql/td,rd=1e3/ed,tn=new ae("SysvarC1ock11111111111111111111111111111111"),kg=new ae("SysvarEpochSchedu1e111111111111111111111111"),Sg=new ae("Sysvar1nstructions1111111111111111111111111"),ka=new ae("SysvarRecentB1ockHashes11111111111111111111"),Di=new ae("SysvarRent111111111111111111111111111111111"),Bg=new ae("SysvarRewards111111111111111111111111111111"),Eg=new ae("SysvarS1otHashes111111111111111111111111111"),_g=new ae("SysvarS1otHistory11111111111111111111111111"),Sa=new ae("SysvarStakeHistory1111111111111111111111111"),Ta=class extends Error{constructor({action:t,signature:e,transactionMessage:n,logs:o}){let f=o?`Logs: \n${JSON.stringify(o.slice(-10),null,2)}. `:"",h="\\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.",x;switch(t){case"send":x=`Transaction ${e} resulted in an error. \n${n}. `+f+h;break;case"simulate":x=`Simulation failed. \nMessage: ${n}. \n`+f+h;break;default:x=`Unknown action \'${(b=>b)(t)}\'`}super(x),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=e,this.transactionMessage=n,this.transactionLogs=o||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){let t=this.transactionLogs;if(!(t!=null&&typeof t=="object"&&"then"in t))return t}async getLogs(t){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((e,n)=>{t.getTransaction(this.signature).then(o=>{if(o&&o.meta&&o.meta.logMessages){let f=o.meta.logMessages;this.transactionLogs=f,e(f)}else n(new Error("Log messages not found"))}).catch(n)})),await this.transactionLogs}};id=I.nu64("lamportsPerSignature"),od=I.struct([I.u32("version"),I.u32("state"),_e("authorizedPubkey"),_e("nonce"),I.struct([id],"feeCalculator")]),hc=od.span,sd=r=>{let t=r.decode.bind(r),e=r.encode.bind(r);return{decode:t,encode:e}},ad=r=>t=>{let e=(0,bc.blob)(r,t),{encode:n,decode:o}=sd(e),f=e;return f.decode=(h,x)=>{let b=o(h,x);return(0,Vi.toBigIntLE)(Yt.Buffer.from(b))},f.encode=(h,x,b)=>{let _=(0,Vi.toBufferLE)(h,r);return n(_,x,b)},f},ui=ad(8),_r=Object.freeze({Create:{index:0,layout:I.struct([I.u32("instruction"),I.ns64("lamports"),I.ns64("space"),_e("programId")])},Assign:{index:1,layout:I.struct([I.u32("instruction"),_e("programId")])},Transfer:{index:2,layout:I.struct([I.u32("instruction"),ui("lamports")])},CreateWithSeed:{index:3,layout:I.struct([I.u32("instruction"),_e("base"),fi("seed"),I.ns64("lamports"),I.ns64("space"),_e("programId")])},AdvanceNonceAccount:{index:4,layout:I.struct([I.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:I.struct([I.u32("instruction"),I.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:I.struct([I.u32("instruction"),_e("authorized")])},AuthorizeNonceAccount:{index:7,layout:I.struct([I.u32("instruction"),_e("authorized")])},Allocate:{index:8,layout:I.struct([I.u32("instruction"),I.ns64("space")])},AllocateWithSeed:{index:9,layout:I.struct([I.u32("instruction"),_e("base"),fi("seed"),I.ns64("space"),_e("programId")])},AssignWithSeed:{index:10,layout:I.struct([I.u32("instruction"),_e("base"),fi("seed"),_e("programId")])},TransferWithSeed:{index:11,layout:I.struct([I.u32("instruction"),ui("lamports"),fi("seed"),_e("programId")])},UpgradeNonceAccount:{index:12,layout:I.struct([I.u32("instruction")])}}),Je=class{constructor(){}static createAccount(t){let e=_r.Create,n=Se(e,{lamports:t.lamports,space:t.space,programId:Me(t.programId.toBuffer())});return new Ce({keys:[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:n})}static transfer(t){let e,n;if("basePubkey"in t){let o=_r.TransferWithSeed;e=Se(o,{lamports:BigInt(t.lamports),seed:t.seed,programId:Me(t.programId.toBuffer())}),n=[{pubkey:t.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]}else{let o=_r.Transfer;e=Se(o,{lamports:BigInt(t.lamports)}),n=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]}return new Ce({keys:n,programId:this.programId,data:e})}static assign(t){let e,n;if("basePubkey"in t){let o=_r.AssignWithSeed;e=Se(o,{base:Me(t.basePubkey.toBuffer()),seed:t.seed,programId:Me(t.programId.toBuffer())}),n=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]}else{let o=_r.Assign;e=Se(o,{programId:Me(t.programId.toBuffer())}),n=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]}return new Ce({keys:n,programId:this.programId,data:e})}static createAccountWithSeed(t){let e=_r.CreateWithSeed,n=Se(e,{base:Me(t.basePubkey.toBuffer()),seed:t.seed,lamports:t.lamports,space:t.space,programId:Me(t.programId.toBuffer())}),o=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!1,isWritable:!0}];return t.basePubkey.equals(t.fromPubkey)||o.push({pubkey:t.basePubkey,isSigner:!0,isWritable:!1}),new Ce({keys:o,programId:this.programId,data:n})}static createNonceAccount(t){let e=new Pe;"basePubkey"in t&&"seed"in t?e.add(Je.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:hc,programId:this.programId})):e.add(Je.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:hc,programId:this.programId}));let n={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return e.add(this.nonceInitialize(n)),e}static nonceInitialize(t){let e=_r.InitializeNonceAccount,n=Se(e,{authorized:Me(t.authorizedPubkey.toBuffer())}),o={keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:ka,isSigner:!1,isWritable:!1},{pubkey:Di,isSigner:!1,isWritable:!1}],programId:this.programId,data:n};return new Ce(o)}static nonceAdvance(t){let e=_r.AdvanceNonceAccount,n=Se(e),o={keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:ka,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:n};return new Ce(o)}static nonceWithdraw(t){let e=_r.WithdrawNonceAccount,n=Se(e,{lamports:t.lamports});return new Ce({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0},{pubkey:ka,isSigner:!1,isWritable:!1},{pubkey:Di,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}static nonceAuthorize(t){let e=_r.AuthorizeNonceAccount,n=Se(e,{authorized:Me(t.newAuthorizedPubkey.toBuffer())});return new Ce({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}static allocate(t){let e,n;if("basePubkey"in t){let o=_r.AllocateWithSeed;e=Se(o,{base:Me(t.basePubkey.toBuffer()),seed:t.seed,space:t.space,programId:Me(t.programId.toBuffer())}),n=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]}else{let o=_r.Allocate;e=Se(o,{space:t.space}),n=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]}return new Ce({keys:n,programId:this.programId,data:e})}};Je.programId=new ae("11111111111111111111111111111111");fd=Xo-300,ci=class{constructor(){}static getMinNumSignatures(t){return 2*(Math.ceil(t/ci.chunkSize)+1+1)}static async load(t,e,n,o,f){{let L=await t.getMinimumBalanceForRentExemption(f.length),O=await t.getAccountInfo(n.publicKey,"confirmed"),P=null;if(O!==null){if(O.executable)return console.error("Program load failed, account is already executable"),!1;O.data.length!==f.length&&(P=P||new Pe,P.add(Je.allocate({accountPubkey:n.publicKey,space:f.length}))),O.owner.equals(o)||(P=P||new Pe,P.add(Je.assign({accountPubkey:n.publicKey,programId:o}))),O.lamports0?L:1,space:f.length,programId:o}));P!==null&&await cc(t,P,[e,n],{commitment:"confirmed"})}let h=I.struct([I.u32("instruction"),I.u32("offset"),I.u32("bytesLength"),I.u32("bytesLengthPadding"),I.seq(I.u8("byte"),I.offset(I.u32(),-8),"bytes")]),x=ci.chunkSize,b=0,_=f,E=[];for(;_.length>0;){let L=_.slice(0,x),O=Yt.Buffer.alloc(x+16);h.encode({instruction:0,offset:b,bytes:L,bytesLength:0,bytesLengthPadding:0},O);let P=new Pe().add({keys:[{pubkey:n.publicKey,isSigner:!0,isWritable:!0}],programId:o,data:O});E.push(cc(t,P,[e,n],{commitment:"confirmed"})),t._rpcEndpoint.includes("solana.com")&&await nd(1e3/4),b+=x,_=_.slice(x)}await Promise.all(E);{let L=I.struct([I.u32("instruction")]),O=Yt.Buffer.alloc(L.span);L.encode({instruction:1},O);let P=new Pe().add({keys:[{pubkey:n.publicKey,isSigner:!0,isWritable:!0},{pubkey:Di,isSigner:!1,isWritable:!1}],programId:o,data:O}),rt="processed",D=await t.sendTransaction(P,[e,n],{preflightCommitment:rt}),{context:C,value:X}=await t.confirmTransaction({signature:D,lastValidBlockHeight:P.lastValidBlockHeight,blockhash:P.recentBlockhash},rt);if(X.err)throw new Error(`Transaction ${D} failed (${JSON.stringify(X)})`);for(;;){try{if(await t.getSlot({commitment:rt})>C.slot)break}catch{}await new Promise(ot=>setTimeout(ot,Math.round(rd/2)))}}return!0}};ci.chunkSize=fd;Ag=new ae("BPFLoader2111111111111111111111111111111111"),Mg=globalThis.fetch,Ig={index:1,layout:I.struct([I.u32("typeIndex"),ui("deactivationSlot"),I.nu64("lastExtendedSlot"),I.u8("lastExtendedStartIndex"),I.u8(),I.seq(_e(),I.offset(I.u8(),-1),"authority")])},We=si(qo(ae),ft(),r=>new ae(r)),Ec=Fo([ft(),ze("base64")]),Oa=si(qo(Yt.Buffer),Ec,r=>Yt.Buffer.from(r[0],"base64")),Lg=30*1e3;ud=_c(Fn());cd=et({foundation:z(),foundationTerm:z(),initial:z(),taper:z(),terminal:z()}),Rg=Ue(xt(vt(et({epoch:z(),effectiveSlot:z(),amount:z(),postBalance:z(),commission:Nt(vt(z()))})))),hd=xt(et({slot:z(),prioritizationFee:z()})),ld=et({total:z(),validator:z(),foundation:z(),epoch:z()}),dd=et({epoch:z(),slotIndex:z(),slotsInEpoch:z(),absoluteSlot:z(),blockHeight:Nt(z()),transactionCount:Nt(z())}),pd=et({slotsPerEpoch:z(),leaderScheduleSlotOffset:z(),warmup:Cr(),firstNormalEpoch:z(),firstNormalSlot:z()}),yd=sa(ft(),xt(z())),Wn=vt(or([et({}),ft()])),gd=et({err:Wn}),md=ze("receivedSignature"),Tg=et({"solana-core":ft(),"feature-set":Nt(z())}),wd=et({program:ft(),programId:We,parsed:Fn()}),bd=et({programId:We,accounts:xt(We),data:ft()}),Pg=Ar(et({err:vt(or([et({}),ft()])),logs:vt(xt(ft())),accounts:Nt(vt(xt(vt(et({executable:Cr(),owner:ft(),lamports:z(),data:xt(ft()),rentEpoch:Nt(z())}))))),unitsConsumed:Nt(z()),returnData:Nt(vt(et({programId:ft(),data:Fo([ft(),ze("base64")])}))),innerInstructions:Nt(vt(xt(et({index:z(),instructions:xt(or([wd,bd]))}))))})),Cg=Ar(et({byIdentity:sa(ft(),xt(z())),range:et({firstSlot:z(),lastSlot:z()})})),Ug=Ue(cd),Og=Ue(ld),Ng=Ue(hd),zg=Ue(dd),qg=Ue(pd),Fg=Ue(yd),Kg=Ue(z()),Dg=Ar(et({total:z(),circulating:z(),nonCirculating:z(),nonCirculatingAccounts:xt(We)})),xd=et({amount:ft(),uiAmount:vt(z()),decimals:z(),uiAmountString:Nt(ft())}),Wg=Ar(xt(et({address:We,amount:ft(),uiAmount:vt(z()),decimals:z(),uiAmountString:Nt(ft())}))),Hg=Ar(xt(et({pubkey:We,account:et({executable:Cr(),owner:We,lamports:z(),data:Oa,rentEpoch:z()})}))),Pa=et({program:ft(),parsed:Fn(),space:z()}),Vg=Ar(xt(et({pubkey:We,account:et({executable:Cr(),owner:We,lamports:z(),data:Pa,rentEpoch:z()})}))),$g=Ar(xt(et({lamports:z(),address:We}))),Na=et({executable:Cr(),owner:We,lamports:z(),data:Oa,rentEpoch:z()}),jg=et({pubkey:We,account:Na}),vd=si(or([qo(Yt.Buffer),Pa]),or([Ec,Pa]),r=>Array.isArray(r)?oi(r,Oa):r),kd=et({executable:Cr(),owner:We,lamports:z(),data:vd,rentEpoch:z()}),Gg=et({pubkey:We,account:kd}),Yg=et({state:or([ze("active"),ze("inactive"),ze("activating"),ze("deactivating")]),active:z(),inactive:z()}),Zg=Ue(xt(et({signature:ft(),slot:z(),err:Wn,memo:vt(ft()),blockTime:Nt(vt(z()))}))),Xg=Ue(xt(et({signature:ft(),slot:z(),err:Wn,memo:vt(ft()),blockTime:Nt(vt(z()))}))),Jg=et({subscription:z(),result:es(Na)}),Sd=et({pubkey:We,account:Na}),Qg=et({subscription:z(),result:es(Sd)}),Bd=et({parent:z(),slot:z(),root:z()}),tm=et({subscription:z(),result:Bd}),Ed=or([et({type:or([ze("firstShredReceived"),ze("completed"),ze("optimisticConfirmation"),ze("root")]),slot:z(),timestamp:z()}),et({type:ze("createdBank"),parent:z(),slot:z(),timestamp:z()}),et({type:ze("frozen"),slot:z(),timestamp:z(),stats:et({numTransactionEntries:z(),numSuccessfulTransactions:z(),numFailedTransactions:z(),maxTransactionsPerEntry:z()})}),et({type:ze("dead"),slot:z(),timestamp:z(),err:ft()})]),em=et({subscription:z(),result:Ed}),rm=et({subscription:z(),result:es(or([gd,md]))}),nm=et({subscription:z(),result:z()}),im=et({pubkey:ft(),gossip:vt(ft()),tpu:vt(ft()),rpc:vt(ft()),version:vt(ft())}),lc=et({votePubkey:ft(),nodePubkey:ft(),activatedStake:z(),epochVoteAccount:Cr(),epochCredits:xt(Fo([z(),z(),z()])),commission:z(),lastVote:z(),rootSlot:vt(z())}),om=Ue(et({current:xt(lc),delinquent:xt(lc)})),_d=or([ze("processed"),ze("confirmed"),ze("finalized")]),Ad=et({slot:z(),confirmations:vt(z()),err:Wn,confirmationStatus:Nt(_d)}),sm=Ar(xt(vt(Ad))),am=Ue(z()),Ac=et({accountKey:We,writableIndexes:xt(z()),readonlyIndexes:xt(z())}),za=et({signatures:xt(ft()),message:et({accountKeys:xt(ft()),header:et({numRequiredSignatures:z(),numReadonlySignedAccounts:z(),numReadonlyUnsignedAccounts:z()}),instructions:xt(et({accounts:xt(z()),data:ft(),programIdIndex:z()})),recentBlockhash:ft(),addressTableLookups:Nt(xt(Ac))})}),Mc=et({pubkey:We,signer:Cr(),writable:Cr(),source:Nt(or([ze("transaction"),ze("lookupTable")]))}),Ic=et({accountKeys:xt(Mc),signatures:xt(ft())}),Lc=et({parsed:Fn(),program:ft(),programId:We}),Rc=et({accounts:xt(We),data:ft(),programId:We}),Md=or([Rc,Lc]),Id=or([et({parsed:Fn(),program:ft(),programId:ft()}),et({accounts:xt(ft()),data:ft(),programId:ft()})]),Tc=si(Md,Id,r=>"accounts"in r?oi(r,Rc):oi(r,Lc)),Pc=et({signatures:xt(ft()),message:et({accountKeys:xt(Mc),instructions:xt(Tc),recentBlockhash:ft(),addressTableLookups:Nt(vt(xt(Ac)))})}),Qo=et({accountIndex:z(),mint:ft(),owner:Nt(ft()),uiTokenAmount:xd}),Cc=et({writable:xt(We),readonly:xt(We)}),rs=et({err:Wn,fee:z(),innerInstructions:Nt(vt(xt(et({index:z(),instructions:xt(et({accounts:xt(z()),data:ft(),programIdIndex:z()}))})))),preBalances:xt(z()),postBalances:xt(z()),logMessages:Nt(vt(xt(ft()))),preTokenBalances:Nt(vt(xt(Qo))),postTokenBalances:Nt(vt(xt(Qo))),loadedAddresses:Nt(Cc),computeUnitsConsumed:Nt(z())}),qa=et({err:Wn,fee:z(),innerInstructions:Nt(vt(xt(et({index:z(),instructions:xt(Tc)})))),preBalances:xt(z()),postBalances:xt(z()),logMessages:Nt(vt(xt(ft()))),preTokenBalances:Nt(vt(xt(Qo))),postTokenBalances:Nt(vt(xt(Qo))),loadedAddresses:Nt(Cc),computeUnitsConsumed:Nt(z())}),di=or([ze(0),ze("legacy")]),Hn=et({pubkey:ft(),lamports:z(),postBalance:vt(z()),rewardType:vt(ft()),commission:Nt(vt(z()))}),fm=Ue(vt(et({blockhash:ft(),previousBlockhash:ft(),parentSlot:z(),transactions:xt(et({transaction:za,meta:vt(rs),version:Nt(di)})),rewards:Nt(xt(Hn)),blockTime:vt(z()),blockHeight:vt(z())}))),um=Ue(vt(et({blockhash:ft(),previousBlockhash:ft(),parentSlot:z(),rewards:Nt(xt(Hn)),blockTime:vt(z()),blockHeight:vt(z())}))),cm=Ue(vt(et({blockhash:ft(),previousBlockhash:ft(),parentSlot:z(),transactions:xt(et({transaction:Ic,meta:vt(rs),version:Nt(di)})),rewards:Nt(xt(Hn)),blockTime:vt(z()),blockHeight:vt(z())}))),hm=Ue(vt(et({blockhash:ft(),previousBlockhash:ft(),parentSlot:z(),transactions:xt(et({transaction:Pc,meta:vt(qa),version:Nt(di)})),rewards:Nt(xt(Hn)),blockTime:vt(z()),blockHeight:vt(z())}))),lm=Ue(vt(et({blockhash:ft(),previousBlockhash:ft(),parentSlot:z(),transactions:xt(et({transaction:Ic,meta:vt(qa),version:Nt(di)})),rewards:Nt(xt(Hn)),blockTime:vt(z()),blockHeight:vt(z())}))),dm=Ue(vt(et({blockhash:ft(),previousBlockhash:ft(),parentSlot:z(),rewards:Nt(xt(Hn)),blockTime:vt(z()),blockHeight:vt(z())}))),pm=Ue(vt(et({blockhash:ft(),previousBlockhash:ft(),parentSlot:z(),transactions:xt(et({transaction:za,meta:vt(rs)})),rewards:Nt(xt(Hn)),blockTime:vt(z())}))),ym=Ue(vt(et({blockhash:ft(),previousBlockhash:ft(),parentSlot:z(),signatures:xt(ft()),blockTime:vt(z())}))),gm=Ue(vt(et({slot:z(),meta:vt(rs),blockTime:Nt(vt(z())),transaction:za,version:Nt(di)}))),mm=Ue(vt(et({slot:z(),transaction:Pc,meta:vt(qa),blockTime:Nt(vt(z())),version:Nt(di)}))),wm=Ar(et({blockhash:ft(),feeCalculator:et({lamportsPerSignature:z()})})),bm=Ar(et({blockhash:ft(),lastValidBlockHeight:z()})),xm=Ar(Cr()),Ld=et({slot:z(),numTransactions:z(),numSlots:z(),samplePeriodSecs:z()}),vm=Ue(xt(Ld)),km=Ar(vt(et({feeCalculator:et({lamportsPerSignature:z()})}))),Sm=Ue(ft()),Bm=Ue(ft()),Rd=et({err:Wn,logs:xt(ft()),signature:ft()}),Em=et({result:es(Rd),subscription:z()}),en=class{constructor(t){this._keypair=void 0,this._keypair=t??ac()}static generate(){return new en(ac())}static fromSecretKey(t,e){if(t.byteLength!==64)throw new Error("bad secret key size");let n=t.slice(32,64);if(!e||!e.skipValidation){let o=t.slice(0,32),f=Aa(o);for(let h=0;h<32;h++)if(n[h]!==f[h])throw new Error("provided secretKey is invalid")}return new en({publicKey:n,secretKey:t})}static fromSeed(t){let e=Aa(t),n=new Uint8Array(64);return n.set(t),n.set(e,32),new en({publicKey:e,secretKey:n})}get publicKey(){return new ae(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}},Ui=Object.freeze({CreateLookupTable:{index:0,layout:I.struct([I.u32("instruction"),ui("recentSlot"),I.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:I.struct([I.u32("instruction")])},ExtendLookupTable:{index:2,layout:I.struct([I.u32("instruction"),ui(),I.seq(_e(),I.offset(I.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:I.struct([I.u32("instruction")])},CloseLookupTable:{index:4,layout:I.struct([I.u32("instruction")])}}),Ca=class{constructor(){}static createLookupTable(t){let[e,n]=ae.findProgramAddressSync([t.authority.toBuffer(),(0,Vi.toBufferLE)(BigInt(t.recentSlot),8)],this.programId),o=Ui.CreateLookupTable,f=Se(o,{recentSlot:BigInt(t.recentSlot),bumpSeed:n}),h=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1},{pubkey:t.payer,isSigner:!0,isWritable:!0},{pubkey:Je.programId,isSigner:!1,isWritable:!1}];return[new Ce({programId:this.programId,keys:h,data:f}),e]}static freezeLookupTable(t){let e=Ui.FreezeLookupTable,n=Se(e),o=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return new Ce({programId:this.programId,keys:o,data:n})}static extendLookupTable(t){let e=Ui.ExtendLookupTable,n=Se(e,{addresses:t.addresses.map(f=>f.toBytes())}),o=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return t.payer&&o.push({pubkey:t.payer,isSigner:!0,isWritable:!0},{pubkey:Je.programId,isSigner:!1,isWritable:!1}),new Ce({programId:this.programId,keys:o,data:n})}static deactivateLookupTable(t){let e=Ui.DeactivateLookupTable,n=Se(e),o=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return new Ce({programId:this.programId,keys:o,data:n})}static closeLookupTable(t){let e=Ui.CloseLookupTable,n=Se(e),o=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1},{pubkey:t.recipient,isSigner:!1,isWritable:!0}];return new Ce({programId:this.programId,keys:o,data:n})}};Ca.programId=new ae("AddressLookupTab1e1111111111111111111111111");Yo=Object.freeze({RequestUnits:{index:0,layout:I.struct([I.u8("instruction"),I.u32("units"),I.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:I.struct([I.u8("instruction"),I.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:I.struct([I.u8("instruction"),I.u32("units")])},SetComputeUnitPrice:{index:3,layout:I.struct([I.u8("instruction"),ui("microLamports")])}}),Ua=class{constructor(){}static requestUnits(t){let e=Yo.RequestUnits,n=Se(e,t);return new Ce({keys:[],programId:this.programId,data:n})}static requestHeapFrame(t){let e=Yo.RequestHeapFrame,n=Se(e,t);return new Ce({keys:[],programId:this.programId,data:n})}static setComputeUnitLimit(t){let e=Yo.SetComputeUnitLimit,n=Se(e,t);return new Ce({keys:[],programId:this.programId,data:n})}static setComputeUnitPrice(t){let e=Yo.SetComputeUnitPrice,n=Se(e,{microLamports:BigInt(t.microLamports)});return new Ce({keys:[],programId:this.programId,data:n})}};Ua.programId=new ae("ComputeBudget111111111111111111111111111111");dc=64,pc=32,yc=64,gc=I.struct([I.u8("numSignatures"),I.u8("padding"),I.u16("signatureOffset"),I.u16("signatureInstructionIndex"),I.u16("publicKeyOffset"),I.u16("publicKeyInstructionIndex"),I.u16("messageDataOffset"),I.u16("messageDataSize"),I.u16("messageInstructionIndex")]),Wi=class{constructor(){}static createInstructionWithPublicKey(t){let{publicKey:e,message:n,signature:o,instructionIndex:f}=t;Ge(e.length===pc,`Public Key must be ${pc} bytes but received ${e.length} bytes`),Ge(o.length===yc,`Signature must be ${yc} bytes but received ${o.length} bytes`);let h=gc.span,x=h+e.length,b=x+o.length,_=1,E=Yt.Buffer.alloc(b+n.length),L=f??65535;return gc.encode({numSignatures:_,padding:0,signatureOffset:x,signatureInstructionIndex:L,publicKeyOffset:h,publicKeyInstructionIndex:L,messageDataOffset:b,messageDataSize:n.length,messageInstructionIndex:L},E),E.fill(e,h),E.fill(o,x),E.fill(n,b),new Ce({keys:[],programId:Wi.programId,data:E})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:n,instructionIndex:o}=t;Ge(e.length===dc,`Private key must be ${dc} bytes but received ${e.length} bytes`);try{let f=en.fromSecretKey(e),h=f.publicKey.toBytes(),x=xc(n,f.secretKey);return this.createInstructionWithPublicKey({publicKey:h,message:n,signature:x,instructionIndex:o})}catch(f){throw new Error(`Error creating instruction; ${f}`)}}};Wi.programId=new ae("Ed25519SigVerify111111111111111111111111111");Td=(r,t)=>{let e=Ci.sign(r,t);return[e.toCompactRawBytes(),e.recovery]};Ci.utils.isValidPrivateKey;Pd=Ci.getPublicKey,mc=32,Ba=20,wc=64,Cd=11,Ea=I.struct([I.u8("numSignatures"),I.u16("signatureOffset"),I.u8("signatureInstructionIndex"),I.u16("ethAddressOffset"),I.u8("ethAddressInstructionIndex"),I.u16("messageDataOffset"),I.u16("messageDataSize"),I.u8("messageInstructionIndex"),I.blob(20,"ethAddress"),I.blob(64,"signature"),I.u8("recoveryId")]),Kn=class{constructor(){}static publicKeyToEthAddress(t){Ge(t.length===wc,`Public key must be ${wc} bytes but received ${t.length} bytes`);try{return Yt.Buffer.from(ma(Me(t))).slice(-Ba)}catch(e){throw new Error(`Error constructing Ethereum address: ${e}`)}}static createInstructionWithPublicKey(t){let{publicKey:e,message:n,signature:o,recoveryId:f,instructionIndex:h}=t;return Kn.createInstructionWithEthAddress({ethAddress:Kn.publicKeyToEthAddress(e),message:n,signature:o,recoveryId:f,instructionIndex:h})}static createInstructionWithEthAddress(t){let{ethAddress:e,message:n,signature:o,recoveryId:f,instructionIndex:h=0}=t,x;typeof e=="string"?e.startsWith("0x")?x=Yt.Buffer.from(e.substr(2),"hex"):x=Yt.Buffer.from(e,"hex"):x=e,Ge(x.length===Ba,`Address must be ${Ba} bytes but received ${x.length} bytes`);let b=1+Cd,_=b,E=b+x.length,L=E+o.length+1,O=1,P=Yt.Buffer.alloc(Ea.span+n.length);return Ea.encode({numSignatures:O,signatureOffset:E,signatureInstructionIndex:h,ethAddressOffset:_,ethAddressInstructionIndex:h,messageDataOffset:L,messageDataSize:n.length,messageInstructionIndex:h,signature:Me(o),ethAddress:Me(x),recoveryId:f},P),P.fill(Me(n),Ea.span),new Ce({keys:[],programId:Kn.programId,data:P})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:n,instructionIndex:o}=t;Ge(e.length===mc,`Private key must be ${mc} bytes but received ${e.length} bytes`);try{let f=Me(e),h=Pd(f,!1).slice(1),x=Yt.Buffer.from(ma(Me(n))),[b,_]=Td(x,f);return this.createInstructionWithPublicKey({publicKey:h,message:n,signature:b,recoveryId:_,instructionIndex:o})}catch(f){throw new Error(`Error creating instruction; ${f}`)}}};Kn.programId=new ae("KeccakSecp256k11111111111111111111111111111");Ud=new ae("StakeConfig11111111111111111111111111111111"),Hi=class{constructor(t,e,n){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=e,this.custodian=n}};Uc=Hi;Hi.default=new Uc(0,0,ae.default);Sn=Object.freeze({Initialize:{index:0,layout:I.struct([I.u32("instruction"),Gl(),Yl()])},Authorize:{index:1,layout:I.struct([I.u32("instruction"),_e("newAuthorized"),I.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:I.struct([I.u32("instruction")])},Split:{index:3,layout:I.struct([I.u32("instruction"),I.ns64("lamports")])},Withdraw:{index:4,layout:I.struct([I.u32("instruction"),I.ns64("lamports")])},Deactivate:{index:5,layout:I.struct([I.u32("instruction")])},Merge:{index:7,layout:I.struct([I.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:I.struct([I.u32("instruction"),_e("newAuthorized"),I.u32("stakeAuthorizationType"),fi("authoritySeed"),_e("authorityOwner")])}}),_m=Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),ts=class{constructor(){}static initialize(t){let{stakePubkey:e,authorized:n,lockup:o}=t,f=o||Hi.default,h=Sn.Initialize,x=Se(h,{authorized:{staker:Me(n.staker.toBuffer()),withdrawer:Me(n.withdrawer.toBuffer())},lockup:{unixTimestamp:f.unixTimestamp,epoch:f.epoch,custodian:Me(f.custodian.toBuffer())}}),b={keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:Di,isSigner:!1,isWritable:!1}],programId:this.programId,data:x};return new Ce(b)}static createAccountWithSeed(t){let e=new Pe;e.add(Je.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:n,authorized:o,lockup:f}=t;return e.add(this.initialize({stakePubkey:n,authorized:o,lockup:f}))}static createAccount(t){let e=new Pe;e.add(Je.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:n,authorized:o,lockup:f}=t;return e.add(this.initialize({stakePubkey:n,authorized:o,lockup:f}))}static delegate(t){let{stakePubkey:e,authorizedPubkey:n,votePubkey:o}=t,f=Sn.Delegate,h=Se(f);return new Pe().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:o,isSigner:!1,isWritable:!1},{pubkey:tn,isSigner:!1,isWritable:!1},{pubkey:Sa,isSigner:!1,isWritable:!1},{pubkey:Ud,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:h})}static authorize(t){let{stakePubkey:e,authorizedPubkey:n,newAuthorizedPubkey:o,stakeAuthorizationType:f,custodianPubkey:h}=t,x=Sn.Authorize,b=Se(x,{newAuthorized:Me(o.toBuffer()),stakeAuthorizationType:f.index}),_=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:tn,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return h&&_.push({pubkey:h,isSigner:!0,isWritable:!1}),new Pe().add({keys:_,programId:this.programId,data:b})}static authorizeWithSeed(t){let{stakePubkey:e,authorityBase:n,authoritySeed:o,authorityOwner:f,newAuthorizedPubkey:h,stakeAuthorizationType:x,custodianPubkey:b}=t,_=Sn.AuthorizeWithSeed,E=Se(_,{newAuthorized:Me(h.toBuffer()),stakeAuthorizationType:x.index,authoritySeed:o,authorityOwner:Me(f.toBuffer())}),L=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:tn,isSigner:!1,isWritable:!1}];return b&&L.push({pubkey:b,isSigner:!0,isWritable:!1}),new Pe().add({keys:L,programId:this.programId,data:E})}static splitInstruction(t){let{stakePubkey:e,authorizedPubkey:n,splitStakePubkey:o,lamports:f}=t,h=Sn.Split,x=Se(h,{lamports:f});return new Ce({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:o,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:x})}static split(t,e){let n=new Pe;return n.add(Je.createAccount({fromPubkey:t.authorizedPubkey,newAccountPubkey:t.splitStakePubkey,lamports:e,space:this.space,programId:this.programId})),n.add(this.splitInstruction(t))}static splitWithSeed(t,e){let{stakePubkey:n,authorizedPubkey:o,splitStakePubkey:f,basePubkey:h,seed:x,lamports:b}=t,_=new Pe;return _.add(Je.allocate({accountPubkey:f,basePubkey:h,seed:x,space:this.space,programId:this.programId})),e&&e>0&&_.add(Je.transfer({fromPubkey:t.authorizedPubkey,toPubkey:f,lamports:e})),_.add(this.splitInstruction({stakePubkey:n,authorizedPubkey:o,splitStakePubkey:f,lamports:b}))}static merge(t){let{stakePubkey:e,sourceStakePubKey:n,authorizedPubkey:o}=t,f=Sn.Merge,h=Se(f);return new Pe().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:tn,isSigner:!1,isWritable:!1},{pubkey:Sa,isSigner:!1,isWritable:!1},{pubkey:o,isSigner:!0,isWritable:!1}],programId:this.programId,data:h})}static withdraw(t){let{stakePubkey:e,authorizedPubkey:n,toPubkey:o,lamports:f,custodianPubkey:h}=t,x=Sn.Withdraw,b=Se(x,{lamports:f}),_=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:o,isSigner:!1,isWritable:!0},{pubkey:tn,isSigner:!1,isWritable:!1},{pubkey:Sa,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return h&&_.push({pubkey:h,isSigner:!0,isWritable:!1}),new Pe().add({keys:_,programId:this.programId,data:b})}static deactivate(t){let{stakePubkey:e,authorizedPubkey:n}=t,o=Sn.Deactivate,f=Se(o);return new Pe().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:tn,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:f})}};ts.programId=new ae("Stake11111111111111111111111111111111111111");ts.space=200;Oi=Object.freeze({InitializeAccount:{index:0,layout:I.struct([I.u32("instruction"),Zl()])},Authorize:{index:1,layout:I.struct([I.u32("instruction"),_e("newAuthorized"),I.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:I.struct([I.u32("instruction"),I.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:I.struct([I.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:I.struct([I.u32("instruction"),Xl()])}}),Am=Object.freeze({Voter:{index:0},Withdrawer:{index:1}}),hi=class{constructor(){}static initializeAccount(t){let{votePubkey:e,nodePubkey:n,voteInit:o}=t,f=Oi.InitializeAccount,h=Se(f,{voteInit:{nodePubkey:Me(o.nodePubkey.toBuffer()),authorizedVoter:Me(o.authorizedVoter.toBuffer()),authorizedWithdrawer:Me(o.authorizedWithdrawer.toBuffer()),commission:o.commission}}),x={keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:Di,isSigner:!1,isWritable:!1},{pubkey:tn,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:h};return new Ce(x)}static createAccount(t){let e=new Pe;return e.add(Je.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.votePubkey,lamports:t.lamports,space:this.space,programId:this.programId})),e.add(this.initializeAccount({votePubkey:t.votePubkey,nodePubkey:t.voteInit.nodePubkey,voteInit:t.voteInit}))}static authorize(t){let{votePubkey:e,authorizedPubkey:n,newAuthorizedPubkey:o,voteAuthorizationType:f}=t,h=Oi.Authorize,x=Se(h,{newAuthorized:Me(o.toBuffer()),voteAuthorizationType:f.index}),b=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:tn,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return new Pe().add({keys:b,programId:this.programId,data:x})}static authorizeWithSeed(t){let{currentAuthorityDerivedKeyBasePubkey:e,currentAuthorityDerivedKeyOwnerPubkey:n,currentAuthorityDerivedKeySeed:o,newAuthorizedPubkey:f,voteAuthorizationType:h,votePubkey:x}=t,b=Oi.AuthorizeWithSeed,_=Se(b,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:Me(n.toBuffer()),currentAuthorityDerivedKeySeed:o,newAuthorized:Me(f.toBuffer()),voteAuthorizationType:h.index}}),E=[{pubkey:x,isSigner:!1,isWritable:!0},{pubkey:tn,isSigner:!1,isWritable:!1},{pubkey:e,isSigner:!0,isWritable:!1}];return new Pe().add({keys:E,programId:this.programId,data:_})}static withdraw(t){let{votePubkey:e,authorizedWithdrawerPubkey:n,lamports:o,toPubkey:f}=t,h=Oi.Withdraw,x=Se(h,{lamports:o}),b=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:f,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return new Pe().add({keys:b,programId:this.programId,data:x})}static safeWithdraw(t,e,n){if(t.lamports>e-n)throw new Error("Withdraw will leave vote account with insufficient funds.");return hi.withdraw(t)}static updateValidatorIdentity(t){let{votePubkey:e,authorizedWithdrawerPubkey:n,nodePubkey:o}=t,f=Oi.UpdateValidatorIdentity,h=Se(f),x=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:o,isSigner:!0,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return new Pe().add({keys:x,programId:this.programId,data:h})}};hi.programId=new ae("Vote111111111111111111111111111111111111111");hi.space=3762;Mm=new ae("Va1idator1nfo111111111111111111111111111111"),Im=et({name:ft(),website:Nt(ft()),details:Nt(ft()),iconUrl:Nt(ft()),keybaseUsername:Nt(ft())}),Lm=new ae("Vote111111111111111111111111111111111111111"),Rm=I.struct([_e("nodePubkey"),_e("authorizedWithdrawer"),I.u8("commission"),I.nu64(),I.seq(I.struct([I.nu64("slot"),I.u32("confirmationCount")]),I.offset(I.u32(),-8),"votes"),I.u8("rootSlotValid"),I.nu64("rootSlot"),I.nu64(),I.seq(I.struct([I.nu64("epoch"),_e("authorizedVoter")]),I.offset(I.u32(),-8),"authorizedVoters"),I.struct([I.seq(I.struct([_e("authorizedPubkey"),I.nu64("epochOfLastAuthorizedSwitch"),I.nu64("targetEpoch")]),32,"buf"),I.nu64("idx"),I.u8("isEmpty")],"priorVoters"),I.nu64(),I.seq(I.struct([I.nu64("epoch"),I.nu64("credits"),I.nu64("prevCredits")]),I.offset(I.u32(),-8),"epochCredits"),I.struct([I.nu64("slot"),I.nu64("timestamp")],"lastTimestamp")])});var Nc=Ve(()=>{var Om=H(j())});var zc=Ve((Nm,ns)=>{var zm=H(j());(function(r){"use strict";var t=function(w){var S,k=new Float64Array(16);if(w)for(S=0;S>24&255,w[S+1]=k>>16&255,w[S+2]=k>>8&255,w[S+3]=k&255,w[S+4]=l>>24&255,w[S+5]=l>>16&255,w[S+6]=l>>8&255,w[S+7]=l&255}function rt(w,S,k,l,B){var M,T=0;for(M=0;M>>8)-1}function D(w,S,k,l){return rt(w,S,k,l,16)}function C(w,S,k,l){return rt(w,S,k,l,32)}function X(w,S,k,l){for(var B=l[0]&255|(l[1]&255)<<8|(l[2]&255)<<16|(l[3]&255)<<24,M=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,T=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,N=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,V=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,Bt=l[4]&255|(l[5]&255)<<8|(l[6]&255)<<16|(l[7]&255)<<24,J=S[0]&255|(S[1]&255)<<8|(S[2]&255)<<16|(S[3]&255)<<24,dt=S[4]&255|(S[5]&255)<<8|(S[6]&255)<<16|(S[7]&255)<<24,pt=S[8]&255|(S[9]&255)<<8|(S[10]&255)<<16|(S[11]&255)<<24,It=S[12]&255|(S[13]&255)<<8|(S[14]&255)<<16|(S[15]&255)<<24,Rt=l[8]&255|(l[9]&255)<<8|(l[10]&255)<<16|(l[11]&255)<<24,Ft=k[16]&255|(k[17]&255)<<8|(k[18]&255)<<16|(k[19]&255)<<24,qt=k[20]&255|(k[21]&255)<<8|(k[22]&255)<<16|(k[23]&255)<<24,Tt=k[24]&255|(k[25]&255)<<8|(k[26]&255)<<16|(k[27]&255)<<24,Ut=k[28]&255|(k[29]&255)<<8|(k[30]&255)<<16|(k[31]&255)<<24,Pt=l[12]&255|(l[13]&255)<<8|(l[14]&255)<<16|(l[15]&255)<<24,mt=B,_t=M,ht=T,wt=N,bt=V,ut=Bt,F=J,K=dt,Q=pt,Y=It,Z=Rt,nt=Ft,Ot=qt,de=Tt,ye=Ut,pe=Pt,A,we=0;we<20;we+=2)A=mt+Ot|0,bt^=A<<7|A>>>32-7,A=bt+mt|0,Q^=A<<9|A>>>32-9,A=Q+bt|0,Ot^=A<<13|A>>>32-13,A=Ot+Q|0,mt^=A<<18|A>>>32-18,A=ut+_t|0,Y^=A<<7|A>>>32-7,A=Y+ut|0,de^=A<<9|A>>>32-9,A=de+Y|0,_t^=A<<13|A>>>32-13,A=_t+de|0,ut^=A<<18|A>>>32-18,A=Z+F|0,ye^=A<<7|A>>>32-7,A=ye+Z|0,ht^=A<<9|A>>>32-9,A=ht+ye|0,F^=A<<13|A>>>32-13,A=F+ht|0,Z^=A<<18|A>>>32-18,A=pe+nt|0,wt^=A<<7|A>>>32-7,A=wt+pe|0,K^=A<<9|A>>>32-9,A=K+wt|0,nt^=A<<13|A>>>32-13,A=nt+K|0,pe^=A<<18|A>>>32-18,A=mt+wt|0,_t^=A<<7|A>>>32-7,A=_t+mt|0,ht^=A<<9|A>>>32-9,A=ht+_t|0,wt^=A<<13|A>>>32-13,A=wt+ht|0,mt^=A<<18|A>>>32-18,A=ut+bt|0,F^=A<<7|A>>>32-7,A=F+ut|0,K^=A<<9|A>>>32-9,A=K+F|0,bt^=A<<13|A>>>32-13,A=bt+K|0,ut^=A<<18|A>>>32-18,A=Z+Y|0,nt^=A<<7|A>>>32-7,A=nt+Z|0,Q^=A<<9|A>>>32-9,A=Q+nt|0,Y^=A<<13|A>>>32-13,A=Y+Q|0,Z^=A<<18|A>>>32-18,A=pe+ye|0,Ot^=A<<7|A>>>32-7,A=Ot+pe|0,de^=A<<9|A>>>32-9,A=de+Ot|0,ye^=A<<13|A>>>32-13,A=ye+de|0,pe^=A<<18|A>>>32-18;mt=mt+B|0,_t=_t+M|0,ht=ht+T|0,wt=wt+N|0,bt=bt+V|0,ut=ut+Bt|0,F=F+J|0,K=K+dt|0,Q=Q+pt|0,Y=Y+It|0,Z=Z+Rt|0,nt=nt+Ft|0,Ot=Ot+qt|0,de=de+Tt|0,ye=ye+Ut|0,pe=pe+Pt|0,w[0]=mt>>>0&255,w[1]=mt>>>8&255,w[2]=mt>>>16&255,w[3]=mt>>>24&255,w[4]=_t>>>0&255,w[5]=_t>>>8&255,w[6]=_t>>>16&255,w[7]=_t>>>24&255,w[8]=ht>>>0&255,w[9]=ht>>>8&255,w[10]=ht>>>16&255,w[11]=ht>>>24&255,w[12]=wt>>>0&255,w[13]=wt>>>8&255,w[14]=wt>>>16&255,w[15]=wt>>>24&255,w[16]=bt>>>0&255,w[17]=bt>>>8&255,w[18]=bt>>>16&255,w[19]=bt>>>24&255,w[20]=ut>>>0&255,w[21]=ut>>>8&255,w[22]=ut>>>16&255,w[23]=ut>>>24&255,w[24]=F>>>0&255,w[25]=F>>>8&255,w[26]=F>>>16&255,w[27]=F>>>24&255,w[28]=K>>>0&255,w[29]=K>>>8&255,w[30]=K>>>16&255,w[31]=K>>>24&255,w[32]=Q>>>0&255,w[33]=Q>>>8&255,w[34]=Q>>>16&255,w[35]=Q>>>24&255,w[36]=Y>>>0&255,w[37]=Y>>>8&255,w[38]=Y>>>16&255,w[39]=Y>>>24&255,w[40]=Z>>>0&255,w[41]=Z>>>8&255,w[42]=Z>>>16&255,w[43]=Z>>>24&255,w[44]=nt>>>0&255,w[45]=nt>>>8&255,w[46]=nt>>>16&255,w[47]=nt>>>24&255,w[48]=Ot>>>0&255,w[49]=Ot>>>8&255,w[50]=Ot>>>16&255,w[51]=Ot>>>24&255,w[52]=de>>>0&255,w[53]=de>>>8&255,w[54]=de>>>16&255,w[55]=de>>>24&255,w[56]=ye>>>0&255,w[57]=ye>>>8&255,w[58]=ye>>>16&255,w[59]=ye>>>24&255,w[60]=pe>>>0&255,w[61]=pe>>>8&255,w[62]=pe>>>16&255,w[63]=pe>>>24&255}function ot(w,S,k,l){for(var B=l[0]&255|(l[1]&255)<<8|(l[2]&255)<<16|(l[3]&255)<<24,M=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,T=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,N=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,V=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,Bt=l[4]&255|(l[5]&255)<<8|(l[6]&255)<<16|(l[7]&255)<<24,J=S[0]&255|(S[1]&255)<<8|(S[2]&255)<<16|(S[3]&255)<<24,dt=S[4]&255|(S[5]&255)<<8|(S[6]&255)<<16|(S[7]&255)<<24,pt=S[8]&255|(S[9]&255)<<8|(S[10]&255)<<16|(S[11]&255)<<24,It=S[12]&255|(S[13]&255)<<8|(S[14]&255)<<16|(S[15]&255)<<24,Rt=l[8]&255|(l[9]&255)<<8|(l[10]&255)<<16|(l[11]&255)<<24,Ft=k[16]&255|(k[17]&255)<<8|(k[18]&255)<<16|(k[19]&255)<<24,qt=k[20]&255|(k[21]&255)<<8|(k[22]&255)<<16|(k[23]&255)<<24,Tt=k[24]&255|(k[25]&255)<<8|(k[26]&255)<<16|(k[27]&255)<<24,Ut=k[28]&255|(k[29]&255)<<8|(k[30]&255)<<16|(k[31]&255)<<24,Pt=l[12]&255|(l[13]&255)<<8|(l[14]&255)<<16|(l[15]&255)<<24,mt=B,_t=M,ht=T,wt=N,bt=V,ut=Bt,F=J,K=dt,Q=pt,Y=It,Z=Rt,nt=Ft,Ot=qt,de=Tt,ye=Ut,pe=Pt,A,we=0;we<20;we+=2)A=mt+Ot|0,bt^=A<<7|A>>>32-7,A=bt+mt|0,Q^=A<<9|A>>>32-9,A=Q+bt|0,Ot^=A<<13|A>>>32-13,A=Ot+Q|0,mt^=A<<18|A>>>32-18,A=ut+_t|0,Y^=A<<7|A>>>32-7,A=Y+ut|0,de^=A<<9|A>>>32-9,A=de+Y|0,_t^=A<<13|A>>>32-13,A=_t+de|0,ut^=A<<18|A>>>32-18,A=Z+F|0,ye^=A<<7|A>>>32-7,A=ye+Z|0,ht^=A<<9|A>>>32-9,A=ht+ye|0,F^=A<<13|A>>>32-13,A=F+ht|0,Z^=A<<18|A>>>32-18,A=pe+nt|0,wt^=A<<7|A>>>32-7,A=wt+pe|0,K^=A<<9|A>>>32-9,A=K+wt|0,nt^=A<<13|A>>>32-13,A=nt+K|0,pe^=A<<18|A>>>32-18,A=mt+wt|0,_t^=A<<7|A>>>32-7,A=_t+mt|0,ht^=A<<9|A>>>32-9,A=ht+_t|0,wt^=A<<13|A>>>32-13,A=wt+ht|0,mt^=A<<18|A>>>32-18,A=ut+bt|0,F^=A<<7|A>>>32-7,A=F+ut|0,K^=A<<9|A>>>32-9,A=K+F|0,bt^=A<<13|A>>>32-13,A=bt+K|0,ut^=A<<18|A>>>32-18,A=Z+Y|0,nt^=A<<7|A>>>32-7,A=nt+Z|0,Q^=A<<9|A>>>32-9,A=Q+nt|0,Y^=A<<13|A>>>32-13,A=Y+Q|0,Z^=A<<18|A>>>32-18,A=pe+ye|0,Ot^=A<<7|A>>>32-7,A=Ot+pe|0,de^=A<<9|A>>>32-9,A=de+Ot|0,ye^=A<<13|A>>>32-13,A=ye+de|0,pe^=A<<18|A>>>32-18;w[0]=mt>>>0&255,w[1]=mt>>>8&255,w[2]=mt>>>16&255,w[3]=mt>>>24&255,w[4]=ut>>>0&255,w[5]=ut>>>8&255,w[6]=ut>>>16&255,w[7]=ut>>>24&255,w[8]=Z>>>0&255,w[9]=Z>>>8&255,w[10]=Z>>>16&255,w[11]=Z>>>24&255,w[12]=pe>>>0&255,w[13]=pe>>>8&255,w[14]=pe>>>16&255,w[15]=pe>>>24&255,w[16]=F>>>0&255,w[17]=F>>>8&255,w[18]=F>>>16&255,w[19]=F>>>24&255,w[20]=K>>>0&255,w[21]=K>>>8&255,w[22]=K>>>16&255,w[23]=K>>>24&255,w[24]=Q>>>0&255,w[25]=Q>>>8&255,w[26]=Q>>>16&255,w[27]=Q>>>24&255,w[28]=Y>>>0&255,w[29]=Y>>>8&255,w[30]=Y>>>16&255,w[31]=Y>>>24&255}function G(w,S,k,l){X(w,S,k,l)}function it(w,S,k,l){ot(w,S,k,l)}var kt=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function st(w,S,k,l,B,M,T){var N=new Uint8Array(16),V=new Uint8Array(64),Bt,J;for(J=0;J<16;J++)N[J]=0;for(J=0;J<8;J++)N[J]=M[J];for(;B>=64;){for(G(V,N,T,kt),J=0;J<64;J++)w[S+J]=k[l+J]^V[J];for(Bt=1,J=8;J<16;J++)Bt=Bt+(N[J]&255)|0,N[J]=Bt&255,Bt>>>=8;B-=64,S+=64,l+=64}if(B>0)for(G(V,N,T,kt),J=0;J=64;){for(G(T,M,B,kt),V=0;V<64;V++)w[S+V]=T[V];for(N=1,V=8;V<16;V++)N=N+(M[V]&255)|0,M[V]=N&255,N>>>=8;k-=64,S+=64}if(k>0)for(G(T,M,B,kt),V=0;V>>13|k<<3)&8191,l=w[4]&255|(w[5]&255)<<8,this.r[2]=(k>>>10|l<<6)&7939,B=w[6]&255|(w[7]&255)<<8,this.r[3]=(l>>>7|B<<9)&8191,M=w[8]&255|(w[9]&255)<<8,this.r[4]=(B>>>4|M<<12)&255,this.r[5]=M>>>1&8190,T=w[10]&255|(w[11]&255)<<8,this.r[6]=(M>>>14|T<<2)&8191,N=w[12]&255|(w[13]&255)<<8,this.r[7]=(T>>>11|N<<5)&8065,V=w[14]&255|(w[15]&255)<<8,this.r[8]=(N>>>8|V<<8)&8191,this.r[9]=V>>>5&127,this.pad[0]=w[16]&255|(w[17]&255)<<8,this.pad[1]=w[18]&255|(w[19]&255)<<8,this.pad[2]=w[20]&255|(w[21]&255)<<8,this.pad[3]=w[22]&255|(w[23]&255)<<8,this.pad[4]=w[24]&255|(w[25]&255)<<8,this.pad[5]=w[26]&255|(w[27]&255)<<8,this.pad[6]=w[28]&255|(w[29]&255)<<8,this.pad[7]=w[30]&255|(w[31]&255)<<8};be.prototype.blocks=function(w,S,k){for(var l=this.fin?0:2048,B,M,T,N,V,Bt,J,dt,pt,It,Rt,Ft,qt,Tt,Ut,Pt,mt,_t,ht,wt=this.h[0],bt=this.h[1],ut=this.h[2],F=this.h[3],K=this.h[4],Q=this.h[5],Y=this.h[6],Z=this.h[7],nt=this.h[8],Ot=this.h[9],de=this.r[0],ye=this.r[1],pe=this.r[2],A=this.r[3],we=this.r[4],Be=this.r[5],Ee=this.r[6],me=this.r[7],ve=this.r[8],ke=this.r[9];k>=16;)B=w[S+0]&255|(w[S+1]&255)<<8,wt+=B&8191,M=w[S+2]&255|(w[S+3]&255)<<8,bt+=(B>>>13|M<<3)&8191,T=w[S+4]&255|(w[S+5]&255)<<8,ut+=(M>>>10|T<<6)&8191,N=w[S+6]&255|(w[S+7]&255)<<8,F+=(T>>>7|N<<9)&8191,V=w[S+8]&255|(w[S+9]&255)<<8,K+=(N>>>4|V<<12)&8191,Q+=V>>>1&8191,Bt=w[S+10]&255|(w[S+11]&255)<<8,Y+=(V>>>14|Bt<<2)&8191,J=w[S+12]&255|(w[S+13]&255)<<8,Z+=(Bt>>>11|J<<5)&8191,dt=w[S+14]&255|(w[S+15]&255)<<8,nt+=(J>>>8|dt<<8)&8191,Ot+=dt>>>5|l,pt=0,It=pt,It+=wt*de,It+=bt*(5*ke),It+=ut*(5*ve),It+=F*(5*me),It+=K*(5*Ee),pt=It>>>13,It&=8191,It+=Q*(5*Be),It+=Y*(5*we),It+=Z*(5*A),It+=nt*(5*pe),It+=Ot*(5*ye),pt+=It>>>13,It&=8191,Rt=pt,Rt+=wt*ye,Rt+=bt*de,Rt+=ut*(5*ke),Rt+=F*(5*ve),Rt+=K*(5*me),pt=Rt>>>13,Rt&=8191,Rt+=Q*(5*Ee),Rt+=Y*(5*Be),Rt+=Z*(5*we),Rt+=nt*(5*A),Rt+=Ot*(5*pe),pt+=Rt>>>13,Rt&=8191,Ft=pt,Ft+=wt*pe,Ft+=bt*ye,Ft+=ut*de,Ft+=F*(5*ke),Ft+=K*(5*ve),pt=Ft>>>13,Ft&=8191,Ft+=Q*(5*me),Ft+=Y*(5*Ee),Ft+=Z*(5*Be),Ft+=nt*(5*we),Ft+=Ot*(5*A),pt+=Ft>>>13,Ft&=8191,qt=pt,qt+=wt*A,qt+=bt*pe,qt+=ut*ye,qt+=F*de,qt+=K*(5*ke),pt=qt>>>13,qt&=8191,qt+=Q*(5*ve),qt+=Y*(5*me),qt+=Z*(5*Ee),qt+=nt*(5*Be),qt+=Ot*(5*we),pt+=qt>>>13,qt&=8191,Tt=pt,Tt+=wt*we,Tt+=bt*A,Tt+=ut*pe,Tt+=F*ye,Tt+=K*de,pt=Tt>>>13,Tt&=8191,Tt+=Q*(5*ke),Tt+=Y*(5*ve),Tt+=Z*(5*me),Tt+=nt*(5*Ee),Tt+=Ot*(5*Be),pt+=Tt>>>13,Tt&=8191,Ut=pt,Ut+=wt*Be,Ut+=bt*we,Ut+=ut*A,Ut+=F*pe,Ut+=K*ye,pt=Ut>>>13,Ut&=8191,Ut+=Q*de,Ut+=Y*(5*ke),Ut+=Z*(5*ve),Ut+=nt*(5*me),Ut+=Ot*(5*Ee),pt+=Ut>>>13,Ut&=8191,Pt=pt,Pt+=wt*Ee,Pt+=bt*Be,Pt+=ut*we,Pt+=F*A,Pt+=K*pe,pt=Pt>>>13,Pt&=8191,Pt+=Q*ye,Pt+=Y*de,Pt+=Z*(5*ke),Pt+=nt*(5*ve),Pt+=Ot*(5*me),pt+=Pt>>>13,Pt&=8191,mt=pt,mt+=wt*me,mt+=bt*Ee,mt+=ut*Be,mt+=F*we,mt+=K*A,pt=mt>>>13,mt&=8191,mt+=Q*pe,mt+=Y*ye,mt+=Z*de,mt+=nt*(5*ke),mt+=Ot*(5*ve),pt+=mt>>>13,mt&=8191,_t=pt,_t+=wt*ve,_t+=bt*me,_t+=ut*Ee,_t+=F*Be,_t+=K*we,pt=_t>>>13,_t&=8191,_t+=Q*A,_t+=Y*pe,_t+=Z*ye,_t+=nt*de,_t+=Ot*(5*ke),pt+=_t>>>13,_t&=8191,ht=pt,ht+=wt*ke,ht+=bt*ve,ht+=ut*me,ht+=F*Ee,ht+=K*Be,pt=ht>>>13,ht&=8191,ht+=Q*we,ht+=Y*A,ht+=Z*pe,ht+=nt*ye,ht+=Ot*de,pt+=ht>>>13,ht&=8191,pt=(pt<<2)+pt|0,pt=pt+It|0,It=pt&8191,pt=pt>>>13,Rt+=pt,wt=It,bt=Rt,ut=Ft,F=qt,K=Tt,Q=Ut,Y=Pt,Z=mt,nt=_t,Ot=ht,S+=16,k-=16;this.h[0]=wt,this.h[1]=bt,this.h[2]=ut,this.h[3]=F,this.h[4]=K,this.h[5]=Q,this.h[6]=Y,this.h[7]=Z,this.h[8]=nt,this.h[9]=Ot},be.prototype.finish=function(w,S){var k=new Uint16Array(10),l,B,M,T;if(this.leftover){for(T=this.leftover,this.buffer[T++]=1;T<16;T++)this.buffer[T]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(l=this.h[1]>>>13,this.h[1]&=8191,T=2;T<10;T++)this.h[T]+=l,l=this.h[T]>>>13,this.h[T]&=8191;for(this.h[0]+=l*5,l=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=l,l=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=l,k[0]=this.h[0]+5,l=k[0]>>>13,k[0]&=8191,T=1;T<10;T++)k[T]=this.h[T]+l,l=k[T]>>>13,k[T]&=8191;for(k[9]-=8192,B=(l^1)-1,T=0;T<10;T++)k[T]&=B;for(B=~B,T=0;T<10;T++)this.h[T]=this.h[T]&B|k[T];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,M=this.h[0]+this.pad[0],this.h[0]=M&65535,T=1;T<8;T++)M=(this.h[T]+this.pad[T]|0)+(M>>>16)|0,this.h[T]=M&65535;w[S+0]=this.h[0]>>>0&255,w[S+1]=this.h[0]>>>8&255,w[S+2]=this.h[1]>>>0&255,w[S+3]=this.h[1]>>>8&255,w[S+4]=this.h[2]>>>0&255,w[S+5]=this.h[2]>>>8&255,w[S+6]=this.h[3]>>>0&255,w[S+7]=this.h[3]>>>8&255,w[S+8]=this.h[4]>>>0&255,w[S+9]=this.h[4]>>>8&255,w[S+10]=this.h[5]>>>0&255,w[S+11]=this.h[5]>>>8&255,w[S+12]=this.h[6]>>>0&255,w[S+13]=this.h[6]>>>8&255,w[S+14]=this.h[7]>>>0&255,w[S+15]=this.h[7]>>>8&255},be.prototype.update=function(w,S,k){var l,B;if(this.leftover){for(B=16-this.leftover,B>k&&(B=k),l=0;l=16&&(B=k-k%16,this.blocks(w,S,B),S+=B,k-=B),k){for(l=0;l>16&1),M[k-1]&=65535;M[15]=T[15]-32767-(M[14]>>16&1),B=M[15]>>16&1,M[14]&=65535,c(T,M,1-B)}for(k=0;k<16;k++)w[2*k]=T[k]&255,w[2*k+1]=T[k]>>8}function m(w,S){var k=new Uint8Array(32),l=new Uint8Array(32);return d(k,w),d(l,S),C(k,0,l,0)}function v(w){var S=new Uint8Array(32);return d(S,w),S[0]&1}function p(w,S){var k;for(k=0;k<16;k++)w[k]=S[2*k]+(S[2*k+1]<<8);w[15]&=32767}function s(w,S,k){for(var l=0;l<16;l++)w[l]=S[l]+k[l]}function y(w,S,k){for(var l=0;l<16;l++)w[l]=S[l]-k[l]}function R(w,S,k){var l,B,M=0,T=0,N=0,V=0,Bt=0,J=0,dt=0,pt=0,It=0,Rt=0,Ft=0,qt=0,Tt=0,Ut=0,Pt=0,mt=0,_t=0,ht=0,wt=0,bt=0,ut=0,F=0,K=0,Q=0,Y=0,Z=0,nt=0,Ot=0,de=0,ye=0,pe=0,A=k[0],we=k[1],Be=k[2],Ee=k[3],me=k[4],ve=k[5],ke=k[6],He=k[7],Le=k[8],Fe=k[9],Ke=k[10],De=k[11],$e=k[12],er=k[13],rr=k[14],nr=k[15];l=S[0],M+=l*A,T+=l*we,N+=l*Be,V+=l*Ee,Bt+=l*me,J+=l*ve,dt+=l*ke,pt+=l*He,It+=l*Le,Rt+=l*Fe,Ft+=l*Ke,qt+=l*De,Tt+=l*$e,Ut+=l*er,Pt+=l*rr,mt+=l*nr,l=S[1],T+=l*A,N+=l*we,V+=l*Be,Bt+=l*Ee,J+=l*me,dt+=l*ve,pt+=l*ke,It+=l*He,Rt+=l*Le,Ft+=l*Fe,qt+=l*Ke,Tt+=l*De,Ut+=l*$e,Pt+=l*er,mt+=l*rr,_t+=l*nr,l=S[2],N+=l*A,V+=l*we,Bt+=l*Be,J+=l*Ee,dt+=l*me,pt+=l*ve,It+=l*ke,Rt+=l*He,Ft+=l*Le,qt+=l*Fe,Tt+=l*Ke,Ut+=l*De,Pt+=l*$e,mt+=l*er,_t+=l*rr,ht+=l*nr,l=S[3],V+=l*A,Bt+=l*we,J+=l*Be,dt+=l*Ee,pt+=l*me,It+=l*ve,Rt+=l*ke,Ft+=l*He,qt+=l*Le,Tt+=l*Fe,Ut+=l*Ke,Pt+=l*De,mt+=l*$e,_t+=l*er,ht+=l*rr,wt+=l*nr,l=S[4],Bt+=l*A,J+=l*we,dt+=l*Be,pt+=l*Ee,It+=l*me,Rt+=l*ve,Ft+=l*ke,qt+=l*He,Tt+=l*Le,Ut+=l*Fe,Pt+=l*Ke,mt+=l*De,_t+=l*$e,ht+=l*er,wt+=l*rr,bt+=l*nr,l=S[5],J+=l*A,dt+=l*we,pt+=l*Be,It+=l*Ee,Rt+=l*me,Ft+=l*ve,qt+=l*ke,Tt+=l*He,Ut+=l*Le,Pt+=l*Fe,mt+=l*Ke,_t+=l*De,ht+=l*$e,wt+=l*er,bt+=l*rr,ut+=l*nr,l=S[6],dt+=l*A,pt+=l*we,It+=l*Be,Rt+=l*Ee,Ft+=l*me,qt+=l*ve,Tt+=l*ke,Ut+=l*He,Pt+=l*Le,mt+=l*Fe,_t+=l*Ke,ht+=l*De,wt+=l*$e,bt+=l*er,ut+=l*rr,F+=l*nr,l=S[7],pt+=l*A,It+=l*we,Rt+=l*Be,Ft+=l*Ee,qt+=l*me,Tt+=l*ve,Ut+=l*ke,Pt+=l*He,mt+=l*Le,_t+=l*Fe,ht+=l*Ke,wt+=l*De,bt+=l*$e,ut+=l*er,F+=l*rr,K+=l*nr,l=S[8],It+=l*A,Rt+=l*we,Ft+=l*Be,qt+=l*Ee,Tt+=l*me,Ut+=l*ve,Pt+=l*ke,mt+=l*He,_t+=l*Le,ht+=l*Fe,wt+=l*Ke,bt+=l*De,ut+=l*$e,F+=l*er,K+=l*rr,Q+=l*nr,l=S[9],Rt+=l*A,Ft+=l*we,qt+=l*Be,Tt+=l*Ee,Ut+=l*me,Pt+=l*ve,mt+=l*ke,_t+=l*He,ht+=l*Le,wt+=l*Fe,bt+=l*Ke,ut+=l*De,F+=l*$e,K+=l*er,Q+=l*rr,Y+=l*nr,l=S[10],Ft+=l*A,qt+=l*we,Tt+=l*Be,Ut+=l*Ee,Pt+=l*me,mt+=l*ve,_t+=l*ke,ht+=l*He,wt+=l*Le,bt+=l*Fe,ut+=l*Ke,F+=l*De,K+=l*$e,Q+=l*er,Y+=l*rr,Z+=l*nr,l=S[11],qt+=l*A,Tt+=l*we,Ut+=l*Be,Pt+=l*Ee,mt+=l*me,_t+=l*ve,ht+=l*ke,wt+=l*He,bt+=l*Le,ut+=l*Fe,F+=l*Ke,K+=l*De,Q+=l*$e,Y+=l*er,Z+=l*rr,nt+=l*nr,l=S[12],Tt+=l*A,Ut+=l*we,Pt+=l*Be,mt+=l*Ee,_t+=l*me,ht+=l*ve,wt+=l*ke,bt+=l*He,ut+=l*Le,F+=l*Fe,K+=l*Ke,Q+=l*De,Y+=l*$e,Z+=l*er,nt+=l*rr,Ot+=l*nr,l=S[13],Ut+=l*A,Pt+=l*we,mt+=l*Be,_t+=l*Ee,ht+=l*me,wt+=l*ve,bt+=l*ke,ut+=l*He,F+=l*Le,K+=l*Fe,Q+=l*Ke,Y+=l*De,Z+=l*$e,nt+=l*er,Ot+=l*rr,de+=l*nr,l=S[14],Pt+=l*A,mt+=l*we,_t+=l*Be,ht+=l*Ee,wt+=l*me,bt+=l*ve,ut+=l*ke,F+=l*He,K+=l*Le,Q+=l*Fe,Y+=l*Ke,Z+=l*De,nt+=l*$e,Ot+=l*er,de+=l*rr,ye+=l*nr,l=S[15],mt+=l*A,_t+=l*we,ht+=l*Be,wt+=l*Ee,bt+=l*me,ut+=l*ve,F+=l*ke,K+=l*He,Q+=l*Le,Y+=l*Fe,Z+=l*Ke,nt+=l*De,Ot+=l*$e,de+=l*er,ye+=l*rr,pe+=l*nr,M+=38*_t,T+=38*ht,N+=38*wt,V+=38*bt,Bt+=38*ut,J+=38*F,dt+=38*K,pt+=38*Q,It+=38*Y,Rt+=38*Z,Ft+=38*nt,qt+=38*Ot,Tt+=38*de,Ut+=38*ye,Pt+=38*pe,B=1,l=M+B+65535,B=Math.floor(l/65536),M=l-B*65536,l=T+B+65535,B=Math.floor(l/65536),T=l-B*65536,l=N+B+65535,B=Math.floor(l/65536),N=l-B*65536,l=V+B+65535,B=Math.floor(l/65536),V=l-B*65536,l=Bt+B+65535,B=Math.floor(l/65536),Bt=l-B*65536,l=J+B+65535,B=Math.floor(l/65536),J=l-B*65536,l=dt+B+65535,B=Math.floor(l/65536),dt=l-B*65536,l=pt+B+65535,B=Math.floor(l/65536),pt=l-B*65536,l=It+B+65535,B=Math.floor(l/65536),It=l-B*65536,l=Rt+B+65535,B=Math.floor(l/65536),Rt=l-B*65536,l=Ft+B+65535,B=Math.floor(l/65536),Ft=l-B*65536,l=qt+B+65535,B=Math.floor(l/65536),qt=l-B*65536,l=Tt+B+65535,B=Math.floor(l/65536),Tt=l-B*65536,l=Ut+B+65535,B=Math.floor(l/65536),Ut=l-B*65536,l=Pt+B+65535,B=Math.floor(l/65536),Pt=l-B*65536,l=mt+B+65535,B=Math.floor(l/65536),mt=l-B*65536,M+=B-1+37*(B-1),B=1,l=M+B+65535,B=Math.floor(l/65536),M=l-B*65536,l=T+B+65535,B=Math.floor(l/65536),T=l-B*65536,l=N+B+65535,B=Math.floor(l/65536),N=l-B*65536,l=V+B+65535,B=Math.floor(l/65536),V=l-B*65536,l=Bt+B+65535,B=Math.floor(l/65536),Bt=l-B*65536,l=J+B+65535,B=Math.floor(l/65536),J=l-B*65536,l=dt+B+65535,B=Math.floor(l/65536),dt=l-B*65536,l=pt+B+65535,B=Math.floor(l/65536),pt=l-B*65536,l=It+B+65535,B=Math.floor(l/65536),It=l-B*65536,l=Rt+B+65535,B=Math.floor(l/65536),Rt=l-B*65536,l=Ft+B+65535,B=Math.floor(l/65536),Ft=l-B*65536,l=qt+B+65535,B=Math.floor(l/65536),qt=l-B*65536,l=Tt+B+65535,B=Math.floor(l/65536),Tt=l-B*65536,l=Ut+B+65535,B=Math.floor(l/65536),Ut=l-B*65536,l=Pt+B+65535,B=Math.floor(l/65536),Pt=l-B*65536,l=mt+B+65535,B=Math.floor(l/65536),mt=l-B*65536,M+=B-1+37*(B-1),w[0]=M,w[1]=T,w[2]=N,w[3]=V,w[4]=Bt,w[5]=J,w[6]=dt,w[7]=pt,w[8]=It,w[9]=Rt,w[10]=Ft,w[11]=qt,w[12]=Tt,w[13]=Ut,w[14]=Pt,w[15]=mt}function U(w,S){R(w,S,S)}function W(w,S){var k=t(),l;for(l=0;l<16;l++)k[l]=S[l];for(l=253;l>=0;l--)U(k,k),l!==2&&l!==4&&R(k,k,S);for(l=0;l<16;l++)w[l]=k[l]}function tt(w,S){var k=t(),l;for(l=0;l<16;l++)k[l]=S[l];for(l=250;l>=0;l--)U(k,k),l!==1&&R(k,k,S);for(l=0;l<16;l++)w[l]=k[l]}function at(w,S,k){var l=new Uint8Array(32),B=new Float64Array(80),M,T,N=t(),V=t(),Bt=t(),J=t(),dt=t(),pt=t();for(T=0;T<31;T++)l[T]=S[T];for(l[31]=S[31]&127|64,l[0]&=248,p(B,k),T=0;T<16;T++)V[T]=B[T],J[T]=N[T]=Bt[T]=0;for(N[0]=J[0]=1,T=254;T>=0;--T)M=l[T>>>3]>>>(T&7)&1,c(N,V,M),c(Bt,J,M),s(dt,N,Bt),y(N,N,Bt),s(Bt,V,J),y(V,V,J),U(J,dt),U(pt,N),R(N,Bt,N),R(Bt,V,dt),s(dt,N,Bt),y(N,N,Bt),U(V,N),y(Bt,J,pt),R(N,Bt,x),s(N,N,J),R(Bt,Bt,N),R(N,J,pt),R(J,V,B),U(V,dt),c(N,V,M),c(Bt,J,M);for(T=0;T<16;T++)B[T+16]=N[T],B[T+32]=Bt[T],B[T+48]=V[T],B[T+64]=J[T];var It=B.subarray(32),Rt=B.subarray(16);return W(It,It),R(Rt,Rt,It),d(w,Rt),0}function lt(w,S){return at(w,S,o)}function xe(w,S){return e(S,32),lt(w,S)}function gt(w,S,k){var l=new Uint8Array(32);return at(l,k,S),it(w,n,l,kt)}var St=g,Ye=i;function Ct(w,S,k,l,B,M){var T=new Uint8Array(32);return gt(T,B,M),St(w,S,k,l,T)}function Kt(w,S,k,l,B,M){var T=new Uint8Array(32);return gt(T,B,M),Ye(w,S,k,l,T)}var Ur=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function ee(w,S,k,l){for(var B=new Int32Array(16),M=new Int32Array(16),T,N,V,Bt,J,dt,pt,It,Rt,Ft,qt,Tt,Ut,Pt,mt,_t,ht,wt,bt,ut,F,K,Q,Y,Z,nt,Ot=w[0],de=w[1],ye=w[2],pe=w[3],A=w[4],we=w[5],Be=w[6],Ee=w[7],me=S[0],ve=S[1],ke=S[2],He=S[3],Le=S[4],Fe=S[5],Ke=S[6],De=S[7],$e=0;l>=128;){for(bt=0;bt<16;bt++)ut=8*bt+$e,B[bt]=k[ut+0]<<24|k[ut+1]<<16|k[ut+2]<<8|k[ut+3],M[bt]=k[ut+4]<<24|k[ut+5]<<16|k[ut+6]<<8|k[ut+7];for(bt=0;bt<80;bt++)if(T=Ot,N=de,V=ye,Bt=pe,J=A,dt=we,pt=Be,It=Ee,Rt=me,Ft=ve,qt=ke,Tt=He,Ut=Le,Pt=Fe,mt=Ke,_t=De,F=Ee,K=De,Q=K&65535,Y=K>>>16,Z=F&65535,nt=F>>>16,F=(A>>>14|Le<<32-14)^(A>>>18|Le<<32-18)^(Le>>>41-32|A<<32-(41-32)),K=(Le>>>14|A<<32-14)^(Le>>>18|A<<32-18)^(A>>>41-32|Le<<32-(41-32)),Q+=K&65535,Y+=K>>>16,Z+=F&65535,nt+=F>>>16,F=A&we^~A&Be,K=Le&Fe^~Le&Ke,Q+=K&65535,Y+=K>>>16,Z+=F&65535,nt+=F>>>16,F=Ur[bt*2],K=Ur[bt*2+1],Q+=K&65535,Y+=K>>>16,Z+=F&65535,nt+=F>>>16,F=B[bt%16],K=M[bt%16],Q+=K&65535,Y+=K>>>16,Z+=F&65535,nt+=F>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,ht=Z&65535|nt<<16,wt=Q&65535|Y<<16,F=ht,K=wt,Q=K&65535,Y=K>>>16,Z=F&65535,nt=F>>>16,F=(Ot>>>28|me<<32-28)^(me>>>34-32|Ot<<32-(34-32))^(me>>>39-32|Ot<<32-(39-32)),K=(me>>>28|Ot<<32-28)^(Ot>>>34-32|me<<32-(34-32))^(Ot>>>39-32|me<<32-(39-32)),Q+=K&65535,Y+=K>>>16,Z+=F&65535,nt+=F>>>16,F=Ot&de^Ot&ye^de&ye,K=me&ve^me&ke^ve&ke,Q+=K&65535,Y+=K>>>16,Z+=F&65535,nt+=F>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,It=Z&65535|nt<<16,_t=Q&65535|Y<<16,F=Bt,K=Tt,Q=K&65535,Y=K>>>16,Z=F&65535,nt=F>>>16,F=ht,K=wt,Q+=K&65535,Y+=K>>>16,Z+=F&65535,nt+=F>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,Bt=Z&65535|nt<<16,Tt=Q&65535|Y<<16,de=T,ye=N,pe=V,A=Bt,we=J,Be=dt,Ee=pt,Ot=It,ve=Rt,ke=Ft,He=qt,Le=Tt,Fe=Ut,Ke=Pt,De=mt,me=_t,bt%16===15)for(ut=0;ut<16;ut++)F=B[ut],K=M[ut],Q=K&65535,Y=K>>>16,Z=F&65535,nt=F>>>16,F=B[(ut+9)%16],K=M[(ut+9)%16],Q+=K&65535,Y+=K>>>16,Z+=F&65535,nt+=F>>>16,ht=B[(ut+1)%16],wt=M[(ut+1)%16],F=(ht>>>1|wt<<32-1)^(ht>>>8|wt<<32-8)^ht>>>7,K=(wt>>>1|ht<<32-1)^(wt>>>8|ht<<32-8)^(wt>>>7|ht<<32-7),Q+=K&65535,Y+=K>>>16,Z+=F&65535,nt+=F>>>16,ht=B[(ut+14)%16],wt=M[(ut+14)%16],F=(ht>>>19|wt<<32-19)^(wt>>>61-32|ht<<32-(61-32))^ht>>>6,K=(wt>>>19|ht<<32-19)^(ht>>>61-32|wt<<32-(61-32))^(wt>>>6|ht<<32-6),Q+=K&65535,Y+=K>>>16,Z+=F&65535,nt+=F>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,B[ut]=Z&65535|nt<<16,M[ut]=Q&65535|Y<<16;F=Ot,K=me,Q=K&65535,Y=K>>>16,Z=F&65535,nt=F>>>16,F=w[0],K=S[0],Q+=K&65535,Y+=K>>>16,Z+=F&65535,nt+=F>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,w[0]=Ot=Z&65535|nt<<16,S[0]=me=Q&65535|Y<<16,F=de,K=ve,Q=K&65535,Y=K>>>16,Z=F&65535,nt=F>>>16,F=w[1],K=S[1],Q+=K&65535,Y+=K>>>16,Z+=F&65535,nt+=F>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,w[1]=de=Z&65535|nt<<16,S[1]=ve=Q&65535|Y<<16,F=ye,K=ke,Q=K&65535,Y=K>>>16,Z=F&65535,nt=F>>>16,F=w[2],K=S[2],Q+=K&65535,Y+=K>>>16,Z+=F&65535,nt+=F>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,w[2]=ye=Z&65535|nt<<16,S[2]=ke=Q&65535|Y<<16,F=pe,K=He,Q=K&65535,Y=K>>>16,Z=F&65535,nt=F>>>16,F=w[3],K=S[3],Q+=K&65535,Y+=K>>>16,Z+=F&65535,nt+=F>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,w[3]=pe=Z&65535|nt<<16,S[3]=He=Q&65535|Y<<16,F=A,K=Le,Q=K&65535,Y=K>>>16,Z=F&65535,nt=F>>>16,F=w[4],K=S[4],Q+=K&65535,Y+=K>>>16,Z+=F&65535,nt+=F>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,w[4]=A=Z&65535|nt<<16,S[4]=Le=Q&65535|Y<<16,F=we,K=Fe,Q=K&65535,Y=K>>>16,Z=F&65535,nt=F>>>16,F=w[5],K=S[5],Q+=K&65535,Y+=K>>>16,Z+=F&65535,nt+=F>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,w[5]=we=Z&65535|nt<<16,S[5]=Fe=Q&65535|Y<<16,F=Be,K=Ke,Q=K&65535,Y=K>>>16,Z=F&65535,nt=F>>>16,F=w[6],K=S[6],Q+=K&65535,Y+=K>>>16,Z+=F&65535,nt+=F>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,w[6]=Be=Z&65535|nt<<16,S[6]=Ke=Q&65535|Y<<16,F=Ee,K=De,Q=K&65535,Y=K>>>16,Z=F&65535,nt=F>>>16,F=w[7],K=S[7],Q+=K&65535,Y+=K>>>16,Z+=F&65535,nt+=F>>>16,Y+=Q>>>16,Z+=Y>>>16,nt+=Z>>>16,w[7]=Ee=Z&65535|nt<<16,S[7]=De=Q&65535|Y<<16,$e+=128,l-=128}return l}function zt(w,S,k){var l=new Int32Array(8),B=new Int32Array(8),M=new Uint8Array(256),T,N=k;for(l[0]=1779033703,l[1]=3144134277,l[2]=1013904242,l[3]=2773480762,l[4]=1359893119,l[5]=2600822924,l[6]=528734635,l[7]=1541459225,B[0]=4089235720,B[1]=2227873595,B[2]=4271175723,B[3]=1595750129,B[4]=2917565137,B[5]=725511199,B[6]=4215389547,B[7]=327033209,ee(l,B,S,k),k%=128,T=0;T=0;--B)l=k[B/8|0]>>(B&7)&1,Zt(w,S,l),kr(S,w),kr(w,w),Zt(w,S,l)}function Dt(w,S){var k=[t(),t(),t(),t()];a(k[0],E),a(k[1],L),a(k[2],h),R(k[3],E,L),br(w,k,S)}function Vt(w,S,k){var l=new Uint8Array(64),B=[t(),t(),t(),t()],M;for(k||e(S,32),zt(l,S,32),l[0]&=248,l[31]&=127,l[31]|=64,Dt(B,l),Ht(w,B),M=0;M<32;M++)S[M+32]=w[M];return 0}var xr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function $t(w,S){var k,l,B,M;for(l=63;l>=32;--l){for(k=0,B=l-32,M=l-12;B>4)*xr[B],k=S[B]>>8,S[B]&=255;for(B=0;B<32;B++)S[B]-=k*xr[B];for(l=0;l<32;l++)S[l+1]+=S[l]>>8,w[l]=S[l]&255}function jt(w){var S=new Float64Array(64),k;for(k=0;k<64;k++)S[k]=w[k];for(k=0;k<64;k++)w[k]=0;$t(w,S)}function Or(w,S,k,l){var B=new Uint8Array(64),M=new Uint8Array(64),T=new Uint8Array(64),N,V,Bt=new Float64Array(64),J=[t(),t(),t(),t()];zt(B,l,32),B[0]&=248,B[31]&=127,B[31]|=64;var dt=k+64;for(N=0;N>7&&y(w[0],f,w[0]),R(w[3],w[0],w[1]),0)}function Xt(w,S,k,l){var B,M=new Uint8Array(32),T=new Uint8Array(64),N=[t(),t(),t(),t()],V=[t(),t(),t(),t()];if(k<64||ie(V,l))return-1;for(B=0;B=0},r.sign.keyPair=function(){var w=new Uint8Array(Wt),S=new Uint8Array(Gt);return Vt(w,S),{publicKey:w,secretKey:S}},r.sign.keyPair.fromSecretKey=function(w){if(Mt(w),w.length!==Gt)throw new Error("bad secret key size");for(var S=new Uint8Array(Wt),k=0;k{"use strict";Dm=H(j()),Fa=H(An());Oc();Ka=H(zc())});async function Kc({accessControlConditions:r,ciphertext:t,dataToEncryptHash:e,messageToSign:n}){let o=await bf({accessControlConditions:r,ciphertext:t,dataToEncryptHash:e});return qc({messageToSign:n,privateKey:o})}var $m,Dc=le(()=>{"use strict";$m=H(j());xf();Fc()});var zd=Ve(()=>{var Xm=H(j());yf();Dc();(async()=>pf(async()=>Kc({accessControlConditions,ciphertext,dataToEncryptHash,messageToSign})))()});zd();})();\n/*! Bundled license information:\n\nieee754/index.js:\n (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *)\n\nbuffer/index.js:\n (*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n *)\n\n@noble/hashes/esm/utils.js:\n (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/abstract/utils.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/abstract/modular.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/abstract/curve.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/abstract/edwards.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/ed25519.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\nsafe-buffer/index.js:\n (*! safe-buffer. MIT License. Feross Aboukhadijeh *)\n\n@solana/buffer-layout/lib/Layout.js:\n (**\n * Support for translating between Uint8Array instances and JavaScript\n * native types.\n *\n * {@link module:Layout~Layout|Layout} is the basis of a class\n * hierarchy that associates property names with sequences of encoded\n * bytes.\n *\n * Layouts are supported for these scalar (numeric) types:\n * * {@link module:Layout~UInt|Unsigned integers in little-endian\n * format} with {@link module:Layout.u8|8-bit}, {@link\n * module:Layout.u16|16-bit}, {@link module:Layout.u24|24-bit},\n * {@link module:Layout.u32|32-bit}, {@link\n * module:Layout.u40|40-bit}, and {@link module:Layout.u48|48-bit}\n * representation ranges;\n * * {@link module:Layout~UIntBE|Unsigned integers in big-endian\n * format} with {@link module:Layout.u16be|16-bit}, {@link\n * module:Layout.u24be|24-bit}, {@link module:Layout.u32be|32-bit},\n * {@link module:Layout.u40be|40-bit}, and {@link\n * module:Layout.u48be|48-bit} representation ranges;\n * * {@link module:Layout~Int|Signed integers in little-endian\n * format} with {@link module:Layout.s8|8-bit}, {@link\n * module:Layout.s16|16-bit}, {@link module:Layout.s24|24-bit},\n * {@link module:Layout.s32|32-bit}, {@link\n * module:Layout.s40|40-bit}, and {@link module:Layout.s48|48-bit}\n * representation ranges;\n * * {@link module:Layout~IntBE|Signed integers in big-endian format}\n * with {@link module:Layout.s16be|16-bit}, {@link\n * module:Layout.s24be|24-bit}, {@link module:Layout.s32be|32-bit},\n * {@link module:Layout.s40be|40-bit}, and {@link\n * module:Layout.s48be|48-bit} representation ranges;\n * * 64-bit integral values that decode to an exact (if magnitude is\n * less than 2^53) or nearby integral Number in {@link\n * module:Layout.nu64|unsigned little-endian}, {@link\n * module:Layout.nu64be|unsigned big-endian}, {@link\n * module:Layout.ns64|signed little-endian}, and {@link\n * module:Layout.ns64be|unsigned big-endian} encodings;\n * * 32-bit floating point values with {@link\n * module:Layout.f32|little-endian} and {@link\n * module:Layout.f32be|big-endian} representations;\n * * 64-bit floating point values with {@link\n * module:Layout.f64|little-endian} and {@link\n * module:Layout.f64be|big-endian} representations;\n * * {@link module:Layout.const|Constants} that take no space in the\n * encoded expression.\n *\n * and for these aggregate types:\n * * {@link module:Layout.seq|Sequence}s of instances of a {@link\n * module:Layout~Layout|Layout}, with JavaScript representation as\n * an Array and constant or data-dependent {@link\n * module:Layout~Sequence#count|length};\n * * {@link module:Layout.struct|Structure}s that aggregate a\n * heterogeneous sequence of {@link module:Layout~Layout|Layout}\n * instances, with JavaScript representation as an Object;\n * * {@link module:Layout.union|Union}s that support multiple {@link\n * module:Layout~VariantLayout|variant layouts} over a fixed\n * (padded) or variable (not padded) span of bytes, using an\n * unsigned integer at the start of the data or a separate {@link\n * module:Layout.unionLayoutDiscriminator|layout element} to\n * determine which layout to use when interpreting the buffer\n * contents;\n * * {@link module:Layout.bits|BitStructure}s that contain a sequence\n * of individual {@link\n * module:Layout~BitStructure#addField|BitField}s packed into an 8,\n * 16, 24, or 32-bit unsigned integer starting at the least- or\n * most-significant bit;\n * * {@link module:Layout.cstr|C strings} of varying length;\n * * {@link module:Layout.blob|Blobs} of fixed- or variable-{@link\n * module:Layout~Blob#length|length} raw data.\n *\n * All {@link module:Layout~Layout|Layout} instances are immutable\n * after construction, to prevent internal state from becoming\n * inconsistent.\n *\n * @local Layout\n * @local ExternalLayout\n * @local GreedyCount\n * @local OffsetLayout\n * @local UInt\n * @local UIntBE\n * @local Int\n * @local IntBE\n * @local NearUInt64\n * @local NearUInt64BE\n * @local NearInt64\n * @local NearInt64BE\n * @local Float\n * @local FloatBE\n * @local Double\n * @local DoubleBE\n * @local Sequence\n * @local Structure\n * @local UnionDiscriminator\n * @local UnionLayoutDiscriminator\n * @local Union\n * @local VariantLayout\n * @local BitStructure\n * @local BitField\n * @local Boolean\n * @local Blob\n * @local CString\n * @local Constant\n * @local bindConstructorLayout\n * @module Layout\n * @license MIT\n * @author Peter A. Bigot\n * @see {@link https://github.com/pabigot/buffer-layout|buffer-layout on GitHub}\n *)\n\n@noble/curves/esm/abstract/weierstrass.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/_shortw_utils.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/secp256k1.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n*/\n'; + module2.exports = { + code: code9, + }; + }, +}); + +// packages/wrapped-keys-lit-actions/src/generated/solana/signTransactionWithEncryptedSolanaKey.js +var require_signTransactionWithEncryptedSolanaKey = __commonJS({ + 'packages/wrapped-keys-lit-actions/src/generated/solana/signTransactionWithEncryptedSolanaKey.js'( + exports, + module2 + ) { + 'use strict'; + init_shim(); + var code9 = + '"use strict";(()=>{var Jf=Object.create;var Fi=Object.defineProperty;var Xf=Object.getOwnPropertyDescriptor;var Qf=Object.getOwnPropertyNames;var th=Object.getPrototypeOf,eh=Object.prototype.hasOwnProperty;var vt=(n,t)=>()=>(n&&(t=n(n=0)),t);var he=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),Ka=(n,t)=>{for(var e in t)Fi(n,e,{get:t[e],enumerable:!0})},Da=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Qf(t))!eh.call(n,i)&&i!==e&&Fi(n,i,{get:()=>t[i],enumerable:!(r=Xf(t,i))||r.enumerable});return n};var C=(n,t,e)=>(e=n!=null?Jf(th(n)):{},Da(t||!n||!n.__esModule?Fi(e,"default",{value:n,enumerable:!0}):e,n)),Wa=n=>Da(Fi({},"__esModule",{value:!0}),n);var Va=he(Ki=>{"use strict";var Xp=C(z());Ki.byteLength=nh;Ki.toByteArray=oh;Ki.fromByteArray=uh;var $e=[],Ue=[],rh=typeof Uint8Array<"u"?Uint8Array:Array,es="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(nn=0,Ha=es.length;nn0)throw new Error("Invalid string. Length must be a multiple of 4");var e=n.indexOf("=");e===-1&&(e=t);var r=e===t?0:4-e%4;return[e,r]}function nh(n){var t=$a(n),e=t[0],r=t[1];return(e+r)*3/4-r}function ih(n,t,e){return(t+e)*3/4-e}function oh(n){var t,e=$a(n),r=e[0],i=e[1],s=new rh(ih(n,r,i)),c=0,p=i>0?r-4:r,y;for(y=0;y>16&255,s[c++]=t>>8&255,s[c++]=t&255;return i===2&&(t=Ue[n.charCodeAt(y)]<<2|Ue[n.charCodeAt(y+1)]>>4,s[c++]=t&255),i===1&&(t=Ue[n.charCodeAt(y)]<<10|Ue[n.charCodeAt(y+1)]<<4|Ue[n.charCodeAt(y+2)]>>2,s[c++]=t>>8&255,s[c++]=t&255),s}function sh(n){return $e[n>>18&63]+$e[n>>12&63]+$e[n>>6&63]+$e[n&63]}function ah(n,t,e){for(var r,i=[],s=t;sp?p:c+s));return r===1?(t=n[e-1],i.push($e[t>>2]+$e[t<<4&63]+"==")):r===2&&(t=(n[e-2]<<8)+n[e-1],i.push($e[t>>10]+$e[t>>4&63]+$e[t<<2&63]+"=")),i.join("")}});var Ga=he(rs=>{var ty=C(z());rs.read=function(n,t,e,r,i){var s,c,p=i*8-r-1,y=(1<>1,x=-7,S=e?i-1:0,I=e?-1:1,B=n[t+S];for(S+=I,s=B&(1<<-x)-1,B>>=-x,x+=p;x>0;s=s*256+n[t+S],S+=I,x-=8);for(c=s&(1<<-x)-1,s>>=-x,x+=r;x>0;c=c*256+n[t+S],S+=I,x-=8);if(s===0)s=1-v;else{if(s===y)return c?NaN:(B?-1:1)*(1/0);c=c+Math.pow(2,r),s=s-v}return(B?-1:1)*c*Math.pow(2,s-r)};rs.write=function(n,t,e,r,i,s){var c,p,y,v=s*8-i-1,x=(1<>1,I=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=r?0:s-1,R=r?1:-1,_=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(p=isNaN(t)?1:0,c=x):(c=Math.floor(Math.log(t)/Math.LN2),t*(y=Math.pow(2,-c))<1&&(c--,y*=2),c+S>=1?t+=I/y:t+=I*Math.pow(2,1-S),t*y>=2&&(c++,y/=2),c+S>=x?(p=0,c=x):c+S>=1?(p=(t*y-1)*Math.pow(2,i),c=c+S):(p=t*Math.pow(2,S-1)*Math.pow(2,i),c=0));i>=8;n[e+B]=p&255,B+=R,p/=256,i-=8);for(c=c<0;n[e+B]=c&255,B+=R,c/=256,v-=8);n[e+B-R]|=_*128}});var Ln=he(Mn=>{"use strict";var ny=C(z());var ns=Va(),_n=Ga(),Za=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Mn.Buffer=O;Mn.SlowBuffer=ph;Mn.INSPECT_MAX_BYTES=50;var Di=2147483647;Mn.kMaxLength=Di;O.TYPED_ARRAY_SUPPORT=ch();!O.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ch(){try{let n=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(n,t),n.foo()===42}catch{return!1}}Object.defineProperty(O.prototype,"parent",{enumerable:!0,get:function(){if(O.isBuffer(this))return this.buffer}});Object.defineProperty(O.prototype,"offset",{enumerable:!0,get:function(){if(O.isBuffer(this))return this.byteOffset}});function Xe(n){if(n>Di)throw new RangeError(\'The value "\'+n+\'" is invalid for option "size"\');let t=new Uint8Array(n);return Object.setPrototypeOf(t,O.prototype),t}function O(n,t,e){if(typeof n=="number"){if(typeof t=="string")throw new TypeError(\'The "string" argument must be of type string. Received type number\');return as(n)}return Xa(n,t,e)}O.poolSize=8192;function Xa(n,t,e){if(typeof n=="string")return hh(n,t);if(ArrayBuffer.isView(n))return lh(n);if(n==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n);if(Ve(n,ArrayBuffer)||n&&Ve(n.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ve(n,SharedArrayBuffer)||n&&Ve(n.buffer,SharedArrayBuffer)))return os(n,t,e);if(typeof n=="number")throw new TypeError(\'The "value" argument must not be of type number. Received type number\');let r=n.valueOf&&n.valueOf();if(r!=null&&r!==n)return O.from(r,t,e);let i=dh(n);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof n[Symbol.toPrimitive]=="function")return O.from(n[Symbol.toPrimitive]("string"),t,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n)}O.from=function(n,t,e){return Xa(n,t,e)};Object.setPrototypeOf(O.prototype,Uint8Array.prototype);Object.setPrototypeOf(O,Uint8Array);function Qa(n){if(typeof n!="number")throw new TypeError(\'"size" argument must be of type number\');if(n<0)throw new RangeError(\'The value "\'+n+\'" is invalid for option "size"\')}function fh(n,t,e){return Qa(n),n<=0?Xe(n):t!==void 0?typeof e=="string"?Xe(n).fill(t,e):Xe(n).fill(t):Xe(n)}O.alloc=function(n,t,e){return fh(n,t,e)};function as(n){return Qa(n),Xe(n<0?0:us(n)|0)}O.allocUnsafe=function(n){return as(n)};O.allocUnsafeSlow=function(n){return as(n)};function hh(n,t){if((typeof t!="string"||t==="")&&(t="utf8"),!O.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let e=tu(n,t)|0,r=Xe(e),i=r.write(n,t);return i!==e&&(r=r.slice(0,i)),r}function is(n){let t=n.length<0?0:us(n.length)|0,e=Xe(t);for(let r=0;r=Di)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Di.toString(16)+" bytes");return n|0}function ph(n){return+n!=n&&(n=0),O.alloc(+n)}O.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==O.prototype};O.compare=function(t,e){if(Ve(t,Uint8Array)&&(t=O.from(t,t.offset,t.byteLength)),Ve(e,Uint8Array)&&(e=O.from(e,e.offset,e.byteLength)),!O.isBuffer(t)||!O.isBuffer(e))throw new TypeError(\'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array\');if(t===e)return 0;let r=t.length,i=e.length;for(let s=0,c=Math.min(r,i);si.length?(O.isBuffer(c)||(c=O.from(c)),c.copy(i,s)):Uint8Array.prototype.set.call(i,c,s);else if(O.isBuffer(c))c.copy(i,s);else throw new TypeError(\'"list" argument must be an Array of Buffers\');s+=c.length}return i};function tu(n,t){if(O.isBuffer(n))return n.length;if(ArrayBuffer.isView(n)||Ve(n,ArrayBuffer))return n.byteLength;if(typeof n!="string")throw new TypeError(\'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type \'+typeof n);let e=n.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&e===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return ss(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return cu(n).length;default:if(i)return r?-1:ss(n).length;t=(""+t).toLowerCase(),i=!0}}O.byteLength=tu;function yh(n,t,e){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(n||(n="utf8");;)switch(n){case"hex":return Eh(this,t,e);case"utf8":case"utf-8":return ru(this,t,e);case"ascii":return Sh(this,t,e);case"latin1":case"binary":return Bh(this,t,e);case"base64":return xh(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ih(this,t,e);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}O.prototype._isBuffer=!0;function on(n,t,e){let r=n[t];n[t]=n[e],n[e]=r}O.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;ee&&(t+=" ... "),""};Za&&(O.prototype[Za]=O.prototype.inspect);O.prototype.compare=function(t,e,r,i,s){if(Ve(t,Uint8Array)&&(t=O.from(t,t.offset,t.byteLength)),!O.isBuffer(t))throw new TypeError(\'The "target" argument must be one of type Buffer or Uint8Array. Received type \'+typeof t);if(e===void 0&&(e=0),r===void 0&&(r=t?t.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),e<0||r>t.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&e>=r)return 0;if(i>=s)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,i>>>=0,s>>>=0,this===t)return 0;let c=s-i,p=r-e,y=Math.min(c,p),v=this.slice(i,s),x=t.slice(e,r);for(let S=0;S2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,fs(e)&&(e=i?0:n.length-1),e<0&&(e=n.length+e),e>=n.length){if(i)return-1;e=n.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=O.from(t,r)),O.isBuffer(t))return t.length===0?-1:ja(n,t,e,r,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(n,t,e):Uint8Array.prototype.lastIndexOf.call(n,t,e):ja(n,[t],e,r,i);throw new TypeError("val must be string, number or Buffer")}function ja(n,t,e,r,i){let s=1,c=n.length,p=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(n.length<2||t.length<2)return-1;s=2,c/=2,p/=2,e/=2}function y(x,S){return s===1?x[S]:x.readUInt16BE(S*s)}let v;if(i){let x=-1;for(v=e;vc&&(e=c-p),v=e;v>=0;v--){let x=!0;for(let S=0;Si&&(r=i)):r=i;let s=t.length;r>s/2&&(r=s/2);let c;for(c=0;c>>0,isFinite(r)?(r=r>>>0,i===void 0&&(i="utf8")):(i=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let s=this.length-e;if((r===void 0||r>s)&&(r=s),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let c=!1;for(;;)switch(i){case"hex":return gh(this,t,e,r);case"utf8":case"utf-8":return mh(this,t,e,r);case"ascii":case"latin1":case"binary":return wh(this,t,e,r);case"base64":return bh(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vh(this,t,e,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}};O.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function xh(n,t,e){return t===0&&e===n.length?ns.fromByteArray(n):ns.fromByteArray(n.slice(t,e))}function ru(n,t,e){e=Math.min(n.length,e);let r=[],i=t;for(;i239?4:s>223?3:s>191?2:1;if(i+p<=e){let y,v,x,S;switch(p){case 1:s<128&&(c=s);break;case 2:y=n[i+1],(y&192)===128&&(S=(s&31)<<6|y&63,S>127&&(c=S));break;case 3:y=n[i+1],v=n[i+2],(y&192)===128&&(v&192)===128&&(S=(s&15)<<12|(y&63)<<6|v&63,S>2047&&(S<55296||S>57343)&&(c=S));break;case 4:y=n[i+1],v=n[i+2],x=n[i+3],(y&192)===128&&(v&192)===128&&(x&192)===128&&(S=(s&15)<<18|(y&63)<<12|(v&63)<<6|x&63,S>65535&&S<1114112&&(c=S))}}c===null?(c=65533,p=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|c&1023),r.push(c),i+=p}return kh(r)}var Ya=4096;function kh(n){let t=n.length;if(t<=Ya)return String.fromCharCode.apply(String,n);let e="",r=0;for(;rr)&&(e=r);let i="";for(let s=t;sr&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),ee)throw new RangeError("Trying to access beyond buffer length")}O.prototype.readUintLE=O.prototype.readUIntLE=function(t,e,r){t=t>>>0,e=e>>>0,r||le(t,e,this.length);let i=this[t],s=1,c=0;for(;++c>>0,e=e>>>0,r||le(t,e,this.length);let i=this[t+--e],s=1;for(;e>0&&(s*=256);)i+=this[t+--e]*s;return i};O.prototype.readUint8=O.prototype.readUInt8=function(t,e){return t=t>>>0,e||le(t,1,this.length),this[t]};O.prototype.readUint16LE=O.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||le(t,2,this.length),this[t]|this[t+1]<<8};O.prototype.readUint16BE=O.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||le(t,2,this.length),this[t]<<8|this[t+1]};O.prototype.readUint32LE=O.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||le(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};O.prototype.readUint32BE=O.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||le(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};O.prototype.readBigUInt64LE=lr(function(t){t=t>>>0,An(t,"offset");let e=this[t],r=this[t+7];(e===void 0||r===void 0)&&ui(t,this.length-8);let i=e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,s=this[++t]+this[++t]*2**8+this[++t]*2**16+r*2**24;return BigInt(i)+(BigInt(s)<>>0,An(t,"offset");let e=this[t],r=this[t+7];(e===void 0||r===void 0)&&ui(t,this.length-8);let i=e*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],s=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+r;return(BigInt(i)<>>0,e=e>>>0,r||le(t,e,this.length);let i=this[t],s=1,c=0;for(;++c=s&&(i-=Math.pow(2,8*e)),i};O.prototype.readIntBE=function(t,e,r){t=t>>>0,e=e>>>0,r||le(t,e,this.length);let i=e,s=1,c=this[t+--i];for(;i>0&&(s*=256);)c+=this[t+--i]*s;return s*=128,c>=s&&(c-=Math.pow(2,8*e)),c};O.prototype.readInt8=function(t,e){return t=t>>>0,e||le(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};O.prototype.readInt16LE=function(t,e){t=t>>>0,e||le(t,2,this.length);let r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r};O.prototype.readInt16BE=function(t,e){t=t>>>0,e||le(t,2,this.length);let r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r};O.prototype.readInt32LE=function(t,e){return t=t>>>0,e||le(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};O.prototype.readInt32BE=function(t,e){return t=t>>>0,e||le(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};O.prototype.readBigInt64LE=lr(function(t){t=t>>>0,An(t,"offset");let e=this[t],r=this[t+7];(e===void 0||r===void 0)&&ui(t,this.length-8);let i=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(r<<24);return(BigInt(i)<>>0,An(t,"offset");let e=this[t],r=this[t+7];(e===void 0||r===void 0)&&ui(t,this.length-8);let i=(e<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(i)<>>0,e||le(t,4,this.length),_n.read(this,t,!0,23,4)};O.prototype.readFloatBE=function(t,e){return t=t>>>0,e||le(t,4,this.length),_n.read(this,t,!1,23,4)};O.prototype.readDoubleLE=function(t,e){return t=t>>>0,e||le(t,8,this.length),_n.read(this,t,!0,52,8)};O.prototype.readDoubleBE=function(t,e){return t=t>>>0,e||le(t,8,this.length),_n.read(this,t,!1,52,8)};function Ae(n,t,e,r,i,s){if(!O.isBuffer(n))throw new TypeError(\'"buffer" argument must be a Buffer instance\');if(t>i||tn.length)throw new RangeError("Index out of range")}O.prototype.writeUintLE=O.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e=e>>>0,r=r>>>0,!i){let p=Math.pow(2,8*r)-1;Ae(this,t,e,r,p,0)}let s=1,c=0;for(this[e]=t&255;++c>>0,r=r>>>0,!i){let p=Math.pow(2,8*r)-1;Ae(this,t,e,r,p,0)}let s=r-1,c=1;for(this[e+s]=t&255;--s>=0&&(c*=256);)this[e+s]=t/c&255;return e+r};O.prototype.writeUint8=O.prototype.writeUInt8=function(t,e,r){return t=+t,e=e>>>0,r||Ae(this,t,e,1,255,0),this[e]=t&255,e+1};O.prototype.writeUint16LE=O.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=e>>>0,r||Ae(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2};O.prototype.writeUint16BE=O.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=e>>>0,r||Ae(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2};O.prototype.writeUint32LE=O.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=e>>>0,r||Ae(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4};O.prototype.writeUint32BE=O.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=e>>>0,r||Ae(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function nu(n,t,e,r,i){uu(t,r,i,n,e,7);let s=Number(t&BigInt(4294967295));n[e++]=s,s=s>>8,n[e++]=s,s=s>>8,n[e++]=s,s=s>>8,n[e++]=s;let c=Number(t>>BigInt(32)&BigInt(4294967295));return n[e++]=c,c=c>>8,n[e++]=c,c=c>>8,n[e++]=c,c=c>>8,n[e++]=c,e}function iu(n,t,e,r,i){uu(t,r,i,n,e,7);let s=Number(t&BigInt(4294967295));n[e+7]=s,s=s>>8,n[e+6]=s,s=s>>8,n[e+5]=s,s=s>>8,n[e+4]=s;let c=Number(t>>BigInt(32)&BigInt(4294967295));return n[e+3]=c,c=c>>8,n[e+2]=c,c=c>>8,n[e+1]=c,c=c>>8,n[e]=c,e+8}O.prototype.writeBigUInt64LE=lr(function(t,e=0){return nu(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});O.prototype.writeBigUInt64BE=lr(function(t,e=0){return iu(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});O.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e=e>>>0,!i){let y=Math.pow(2,8*r-1);Ae(this,t,e,r,y-1,-y)}let s=0,c=1,p=0;for(this[e]=t&255;++s>0)-p&255;return e+r};O.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e=e>>>0,!i){let y=Math.pow(2,8*r-1);Ae(this,t,e,r,y-1,-y)}let s=r-1,c=1,p=0;for(this[e+s]=t&255;--s>=0&&(c*=256);)t<0&&p===0&&this[e+s+1]!==0&&(p=1),this[e+s]=(t/c>>0)-p&255;return e+r};O.prototype.writeInt8=function(t,e,r){return t=+t,e=e>>>0,r||Ae(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1};O.prototype.writeInt16LE=function(t,e,r){return t=+t,e=e>>>0,r||Ae(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2};O.prototype.writeInt16BE=function(t,e,r){return t=+t,e=e>>>0,r||Ae(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2};O.prototype.writeInt32LE=function(t,e,r){return t=+t,e=e>>>0,r||Ae(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4};O.prototype.writeInt32BE=function(t,e,r){return t=+t,e=e>>>0,r||Ae(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};O.prototype.writeBigInt64LE=lr(function(t,e=0){return nu(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});O.prototype.writeBigInt64BE=lr(function(t,e=0){return iu(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ou(n,t,e,r,i,s){if(e+r>n.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function su(n,t,e,r,i){return t=+t,e=e>>>0,i||ou(n,t,e,4,34028234663852886e22,-34028234663852886e22),_n.write(n,t,e,r,23,4),e+4}O.prototype.writeFloatLE=function(t,e,r){return su(this,t,e,!0,r)};O.prototype.writeFloatBE=function(t,e,r){return su(this,t,e,!1,r)};function au(n,t,e,r,i){return t=+t,e=e>>>0,i||ou(n,t,e,8,17976931348623157e292,-17976931348623157e292),_n.write(n,t,e,r,52,8),e+8}O.prototype.writeDoubleLE=function(t,e,r){return au(this,t,e,!0,r)};O.prototype.writeDoubleBE=function(t,e,r){return au(this,t,e,!1,r)};O.prototype.copy=function(t,e,r,i){if(!O.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e>>0,r=r===void 0?this.length:r>>>0,t||(t=0);let s;if(typeof t=="number")for(s=e;s2**32?i=Ja(String(e)):typeof e=="bigint"&&(i=String(e),(e>BigInt(2)**BigInt(32)||e<-(BigInt(2)**BigInt(32)))&&(i=Ja(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r},RangeError);function Ja(n){let t="",e=n.length,r=n[0]==="-"?1:0;for(;e>=r+4;e-=3)t=`_${n.slice(e-3,e)}${t}`;return`${n.slice(0,e)}${t}`}function _h(n,t,e){An(t,"offset"),(n[t]===void 0||n[t+e]===void 0)&&ui(t,n.length-(e+1))}function uu(n,t,e,r,i,s){if(n>e||n3?t===0||t===BigInt(0)?p=`>= 0${c} and < 2${c} ** ${(s+1)*8}${c}`:p=`>= -(2${c} ** ${(s+1)*8-1}${c}) and < 2 ** ${(s+1)*8-1}${c}`:p=`>= ${t}${c} and <= ${e}${c}`,new In.ERR_OUT_OF_RANGE("value",p,n)}_h(r,i,s)}function An(n,t){if(typeof n!="number")throw new In.ERR_INVALID_ARG_TYPE(t,"number",n)}function ui(n,t,e){throw Math.floor(n)!==n?(An(n,e),new In.ERR_OUT_OF_RANGE(e||"offset","an integer",n)):t<0?new In.ERR_BUFFER_OUT_OF_BOUNDS:new In.ERR_OUT_OF_RANGE(e||"offset",`>= ${e?1:0} and <= ${t}`,n)}var Ah=/[^+/0-9A-Za-z-_]/g;function Mh(n){if(n=n.split("=")[0],n=n.trim().replace(Ah,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function ss(n,t){t=t||1/0;let e,r=n.length,i=null,s=[];for(let c=0;c55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&s.push(239,191,189);continue}else if(c+1===r){(t-=3)>-1&&s.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&s.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;s.push(e)}else if(e<2048){if((t-=2)<0)break;s.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;s.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;s.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return s}function Lh(n){let t=[];for(let e=0;e>8,i=e%256,s.push(i),s.push(r);return s}function cu(n){return ns.toByteArray(Mh(n))}function Wi(n,t,e,r){let i;for(i=0;i=t.length||i>=n.length);++i)t[i+e]=n[i];return i}function Ve(n,t){return n instanceof t||n!=null&&n.constructor!=null&&n.constructor.name!=null&&n.constructor.name===t.name}function fs(n){return n!==n}var Th=function(){let n="0123456789abcdef",t=new Array(256);for(let e=0;e<16;++e){let r=e*16;for(let i=0;i<16;++i)t[r+i]=n[e]+n[i]}return t}();function lr(n){return typeof BigInt>"u"?Ph:n}function Ph(){throw new Error("BigInt not supported")}});var z=he(()=>{"use strict";var fu=C(Ln());globalThis.Buffer=fu.Buffer});var ay,Rn,hs=vt(()=>{"use strict";ay=C(z()),Rn=class extends Error{constructor(){super(...arguments);this.name="AbortError"}}});async function hu(n){try{let t=await n(),e=typeof t=="string"?t:JSON.stringify(t);Lit.Actions.setResponse({response:e})}catch(t){if(t instanceof Rn)return;Lit.Actions.setResponse({response:`Error: ${t.message}`})}}var fy,lu=vt(()=>{"use strict";fy=C(z());hs()});var ly,Hi,du=vt(()=>{"use strict";ly=C(z()),Hi="lit_"});function pu(n){if(!n.startsWith(Hi))throw new Error(`PKey was not encrypted with salt; all wrapped keys must be prefixed with \'${Hi}\'`);return n.slice(Hi.length)}var yy,yu=vt(()=>{"use strict";yy=C(z());du()});async function Ch({accessControlConditions:n,ciphertext:t,dataToEncryptHash:e}){try{return await Lit.Actions.decryptToSingleNode({accessControlConditions:n,ciphertext:t,dataToEncryptHash:e,chain:"ethereum",authSig:null})}catch(r){throw new Error(`When decrypting key to a single node - ${r.message}`)}}async function gu({accessControlConditions:n,ciphertext:t,dataToEncryptHash:e}){let r=await Ch({accessControlConditions:n,ciphertext:t,dataToEncryptHash:e});if(!r)throw new Rn;return pu(r)}var by,mu=vt(()=>{"use strict";by=C(z());hs();yu()});function ci(n){if(!Number.isSafeInteger(n)||n<0)throw new Error("positive integer expected, got "+n)}function Oh(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function dr(n,...t){if(!Oh(n))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(n.length))throw new Error("Uint8Array expected of length "+t+", got length="+n.length)}function wu(n){if(typeof n!="function"||typeof n.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");ci(n.outputLen),ci(n.blockLen)}function Qe(n,t=!0){if(n.destroyed)throw new Error("Hash instance has been destroyed");if(t&&n.finished)throw new Error("Hash#digest() has already been called")}function $i(n,t){dr(n);let e=t.outputLen;if(n.length{xy=C(z(),1)});var Sy,sn,bu=vt(()=>{Sy=C(z(),1),sn=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});function vu(n){return new Uint32Array(n.buffer,n.byteOffset,Math.floor(n.byteLength/4))}function Vi(n){return new DataView(n.buffer,n.byteOffset,n.byteLength)}function qe(n,t){return n<<32-t|n>>>t}function Uh(n){return n<<24&4278190080|n<<8&16711680|n>>>8&65280|n>>>24&255}function ds(n){for(let t=0;tn().update(yr(r)).digest(),e=n();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>n(),t}function ku(n){let t=(r,i)=>n(i).update(yr(r)).digest(),e=n({});return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=r=>n(r),t}function Gi(n=32){if(sn&&typeof sn.getRandomValues=="function")return sn.getRandomValues(new Uint8Array(n));if(sn&&typeof sn.randomBytes=="function")return sn.randomBytes(n);throw new Error("crypto.getRandomValues must be defined")}var _y,ls,pr,gr=vt(()=>{_y=C(z(),1);bu();fi();ls=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();pr=class{clone(){return this._cloneInto()}}});function Nh(n,t,e,r){if(typeof n.setBigUint64=="function")return n.setBigUint64(t,e,r);let i=BigInt(32),s=BigInt(4294967295),c=Number(e>>i&s),p=Number(e&s),y=r?4:0,v=r?0:4;n.setUint32(t+y,c,r),n.setUint32(t+v,p,r)}function Su(n,t,e){return n&t^~n&e}function Bu(n,t,e){return n&t^n&e^t&e}var Ry,Pn,ys=vt(()=>{Ry=C(z(),1);fi();gr();Pn=class extends pr{constructor(t,e,r,i){super(),this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Vi(this.buffer)}update(t){Qe(this);let{view:e,buffer:r,blockLen:i}=this;t=yr(t);let s=t.length;for(let c=0;ci-c&&(this.process(r,0),c=0);for(let S=c;Sx.length)throw new Error("_sha2: outputLen bigger than state");for(let S=0;S>gs&Zi)}:{h:Number(n>>gs&Zi)|0,l:Number(n&Zi)|0}}function ms(n,t=!1){let e=new Uint32Array(n.length),r=new Uint32Array(n.length);for(let i=0;i>>0)+(r>>>0);return{h:n+e+(i/2**32|0)|0,l:i|0}}var Py,Zi,gs,zh,qh,Fh,Kh,Dh,Wh,Hh,$h,Vh,ws,bs,vs,xs,Zh,jh,Yh,Jh,Xh,Qh,tl,Wt,ks=vt(()=>{Py=C(z(),1),Zi=BigInt(4294967295),gs=BigInt(32);zh=(n,t)=>BigInt(n>>>0)<>>0),qh=(n,t,e)=>n>>>e,Fh=(n,t,e)=>n<<32-e|t>>>e,Kh=(n,t,e)=>n>>>e|t<<32-e,Dh=(n,t,e)=>n<<32-e|t>>>e,Wh=(n,t,e)=>n<<64-e|t>>>e-32,Hh=(n,t,e)=>n>>>e-32|t<<64-e,$h=(n,t)=>t,Vh=(n,t)=>n,ws=(n,t,e)=>n<>>32-e,bs=(n,t,e)=>t<>>32-e,vs=(n,t,e)=>t<>>64-e,xs=(n,t,e)=>n<>>64-e;Zh=(n,t,e)=>(n>>>0)+(t>>>0)+(e>>>0),jh=(n,t,e,r)=>t+e+r+(n/2**32|0)|0,Yh=(n,t,e,r)=>(n>>>0)+(t>>>0)+(e>>>0)+(r>>>0),Jh=(n,t,e,r,i)=>t+e+r+i+(n/2**32|0)|0,Xh=(n,t,e,r,i)=>(n>>>0)+(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0),Qh=(n,t,e,r,i,s)=>t+e+r+i+s+(n/2**32|0)|0,tl={fromBig:Eu,split:ms,toBig:zh,shrSH:qh,shrSL:Fh,rotrSH:Kh,rotrSL:Dh,rotrBH:Wh,rotrBL:Hh,rotr32H:$h,rotr32L:Vh,rotlSH:ws,rotlSL:bs,rotlBH:vs,rotlBL:xs,add:Gh,add3L:Zh,add3H:jh,add4L:Yh,add4H:Jh,add5H:Qh,add5L:Xh},Wt=tl});var zy,el,rl,mr,wr,Ss,Iu,_u=vt(()=>{zy=C(z(),1);ys();ks();gr();[el,rl]=(()=>Wt.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(n=>BigInt(n))))(),mr=new Uint32Array(80),wr=new Uint32Array(80),Ss=class extends Pn{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:r,Bl:i,Ch:s,Cl:c,Dh:p,Dl:y,Eh:v,El:x,Fh:S,Fl:I,Gh:B,Gl:R,Hh:_,Hl:E}=this;return[t,e,r,i,s,c,p,y,v,x,S,I,B,R,_,E]}set(t,e,r,i,s,c,p,y,v,x,S,I,B,R,_,E){this.Ah=t|0,this.Al=e|0,this.Bh=r|0,this.Bl=i|0,this.Ch=s|0,this.Cl=c|0,this.Dh=p|0,this.Dl=y|0,this.Eh=v|0,this.El=x|0,this.Fh=S|0,this.Fl=I|0,this.Gh=B|0,this.Gl=R|0,this.Hh=_|0,this.Hl=E|0}process(t,e){for(let N=0;N<16;N++,e+=4)mr[N]=t.getUint32(e),wr[N]=t.getUint32(e+=4);for(let N=16;N<80;N++){let D=mr[N-15]|0,rt=wr[N-15]|0,H=Wt.rotrSH(D,rt,1)^Wt.rotrSH(D,rt,8)^Wt.shrSH(D,rt,7),J=Wt.rotrSL(D,rt,1)^Wt.rotrSL(D,rt,8)^Wt.shrSL(D,rt,7),nt=mr[N-2]|0,tt=wr[N-2]|0,Yt=Wt.rotrSH(nt,tt,19)^Wt.rotrBH(nt,tt,61)^Wt.shrSH(nt,tt,6),G=Wt.rotrSL(nt,tt,19)^Wt.rotrBL(nt,tt,61)^Wt.shrSL(nt,tt,6),st=Wt.add4L(J,G,wr[N-7],wr[N-16]),m=Wt.add4H(st,H,Yt,mr[N-7],mr[N-16]);mr[N]=m|0,wr[N]=st|0}let{Ah:r,Al:i,Bh:s,Bl:c,Ch:p,Cl:y,Dh:v,Dl:x,Eh:S,El:I,Fh:B,Fl:R,Gh:_,Gl:E,Hh:U,Hl:K}=this;for(let N=0;N<80;N++){let D=Wt.rotrSH(S,I,14)^Wt.rotrSH(S,I,18)^Wt.rotrBH(S,I,41),rt=Wt.rotrSL(S,I,14)^Wt.rotrSL(S,I,18)^Wt.rotrBL(S,I,41),H=S&B^~S&_,J=I&R^~I&E,nt=Wt.add5L(K,rt,J,rl[N],wr[N]),tt=Wt.add5H(nt,U,D,H,el[N],mr[N]),Yt=nt|0,G=Wt.rotrSH(r,i,28)^Wt.rotrBH(r,i,34)^Wt.rotrBH(r,i,39),st=Wt.rotrSL(r,i,28)^Wt.rotrBL(r,i,34)^Wt.rotrBL(r,i,39),m=r&s^r&p^s&p,o=i&c^i&y^c&y;U=_|0,K=E|0,_=B|0,E=R|0,B=S|0,R=I|0,{h:S,l:I}=Wt.add(v|0,x|0,tt|0,Yt|0),v=p|0,x=y|0,p=s|0,y=c|0,s=r|0,c=i|0;let u=Wt.add3L(Yt,st,o);r=Wt.add3H(u,tt,G,m),i=u|0}({h:r,l:i}=Wt.add(this.Ah|0,this.Al|0,r|0,i|0)),{h:s,l:c}=Wt.add(this.Bh|0,this.Bl|0,s|0,c|0),{h:p,l:y}=Wt.add(this.Ch|0,this.Cl|0,p|0,y|0),{h:v,l:x}=Wt.add(this.Dh|0,this.Dl|0,v|0,x|0),{h:S,l:I}=Wt.add(this.Eh|0,this.El|0,S|0,I|0),{h:B,l:R}=Wt.add(this.Fh|0,this.Fl|0,B|0,R|0),{h:_,l:E}=Wt.add(this.Gh|0,this.Gl|0,_|0,E|0),{h:U,l:K}=Wt.add(this.Hh|0,this.Hl|0,U|0,K|0),this.set(r,i,s,c,p,y,v,x,S,I,B,R,_,E,U,K)}roundClean(){mr.fill(0),wr.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Iu=Tn(()=>new Ss)});var Ji={};Ka(Ji,{aInRange:()=>Me,abool:()=>Fe,abytes:()=>Cn,bitGet:()=>ul,bitLen:()=>_s,bitMask:()=>li,bitSet:()=>cl,bytesToHex:()=>er,bytesToNumberBE:()=>rr,bytesToNumberLE:()=>vr,concatBytes:()=>nr,createHmacDrbg:()=>As,ensureBytes:()=>ae,equalBytes:()=>sl,hexToBytes:()=>un,hexToNumber:()=>Is,inRange:()=>hi,isBytes:()=>br,memoized:()=>fn,notImplemented:()=>hl,numberToBytesBE:()=>xr,numberToBytesLE:()=>cn,numberToHexUnpadded:()=>an,numberToVarBytesBE:()=>ol,utf8ToBytes:()=>al,validateObject:()=>Ge});function br(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function Cn(n){if(!br(n))throw new Error("Uint8Array expected")}function Fe(n,t){if(typeof t!="boolean")throw new Error(n+" boolean expected, got "+t)}function er(n){Cn(n);let t="";for(let e=0;e=tr._0&&n<=tr._9)return n-tr._0;if(n>=tr.A&&n<=tr.F)return n-(tr.A-10);if(n>=tr.a&&n<=tr.f)return n-(tr.a-10)}function un(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);let t=n.length,e=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let r=new Uint8Array(e);for(let i=0,s=0;iji;n>>=Yi,t+=1);return t}function ul(n,t){return n>>BigInt(t)&Yi}function cl(n,t,e){return n|(e?Yi:ji)<{r.fill(1),i.fill(0),s=0},p=(...S)=>e(i,r,...S),y=(S=Es())=>{i=p(Mu([0]),S),r=p(),S.length!==0&&(i=p(Mu([1]),S),r=p())},v=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let S=0,I=[];for(;S{c(),y(S);let B;for(;!(B=I(v()));)y();return c(),B}}function Ge(n,t,e={}){let r=(i,s,c)=>{let p=fl[s];if(typeof p!="function")throw new Error("invalid validator function");let y=n[i];if(!(c&&y===void 0)&&!p(y,n))throw new Error("param "+String(i)+" is invalid. Expected "+s+", got "+y)};for(let[i,s]of Object.entries(t))r(i,s,!1);for(let[i,s]of Object.entries(e))r(i,s,!0);return n}function fn(n){let t=new WeakMap;return(e,...r)=>{let i=t.get(e);if(i!==void 0)return i;let s=n(e,...r);return t.set(e,s),s}}var qy,ji,Yi,nl,il,tr,Bs,li,Es,Mu,fl,hl,hn=vt(()=>{qy=C(z(),1);ji=BigInt(0),Yi=BigInt(1),nl=BigInt(2);il=Array.from({length:256},(n,t)=>t.toString(16).padStart(2,"0"));tr={_0:48,_9:57,A:65,F:70,a:97,f:102};Bs=n=>typeof n=="bigint"&&ji<=n;li=n=>(nl<new Uint8Array(n),Mu=n=>Uint8Array.from(n);fl={bigint:n=>typeof n=="bigint",function:n=>typeof n=="function",boolean:n=>typeof n=="boolean",string:n=>typeof n=="string",stringOrUint8Array:n=>typeof n=="string"||br(n),isSafeInteger:n=>Number.isSafeInteger(n),array:n=>Array.isArray(n),field:(n,t)=>t.Fp.isValid(n),hash:n=>typeof n=="function"&&Number.isSafeInteger(n.outputLen)};hl=()=>{throw new Error("not implemented")}});function te(n,t){let e=n%t;return e>=fe?e:t+e}function yl(n,t,e){if(tfe;)t&ie&&(r=r*n%e),n=n*n%e,t>>=ie;return r}function oe(n,t,e){let r=n;for(;t-- >fe;)r*=r,r%=e;return r}function Xi(n,t){if(n===fe)throw new Error("invert: expected non-zero number");if(t<=fe)throw new Error("invert: expected positive modulus, got "+t);let e=te(n,t),r=t,i=fe,s=ie,c=ie,p=fe;for(;e!==fe;){let v=r/e,x=r%e,S=i-c*v,I=s-p*v;r=e,e=x,i=c,s=p,c=S,p=I}if(r!==ie)throw new Error("invert: does not exist");return te(i,t)}function gl(n){let t=(n-ie)/ln,e,r,i;for(e=n-ie,r=0;e%ln===fe;e/=ln,r++);for(i=ln;i1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){let c=(n+ie)/Ms;return function(y,v){let x=y.pow(v,c);if(!y.eql(y.sqr(x),v))throw new Error("Cannot find square root");return x}}let s=(e+ie)/ln;return function(p,y){if(p.pow(y,t)===p.neg(p.ONE))throw new Error("Cannot find square root");let v=r,x=p.pow(p.mul(p.ONE,i),e),S=p.pow(y,s),I=p.pow(y,e);for(;!p.eql(I,p.ONE);){if(p.eql(I,p.ZERO))return p.ZERO;let B=1;for(let _=p.sqr(I);B(r[i]="function",r),t);return Ge(n,e)}function bl(n,t,e){if(efe;)e&ie&&(r=n.mul(r,i)),i=n.sqr(i),e>>=ie;return r}function vl(n,t){let e=new Array(t.length),r=t.reduce((s,c,p)=>n.is0(c)?s:(e[p]=s,n.mul(s,c)),n.ONE),i=n.inv(r);return t.reduceRight((s,c,p)=>n.is0(c)?s:(e[p]=n.mul(s,e[p]),n.mul(s,c)),i),e}function Rs(n,t){let e=t!==void 0?t:n.toString(2).length,r=Math.ceil(e/8);return{nBitLength:e,nByteLength:r}}function kr(n,t,e=!1,r={}){if(n<=fe)throw new Error("invalid field: expected ORDER > 0, got "+n);let{nBitLength:i,nByteLength:s}=Rs(n,t);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let c,p=Object.freeze({ORDER:n,isLE:e,BITS:i,BYTES:s,MASK:li(i),ZERO:fe,ONE:ie,create:y=>te(y,n),isValid:y=>{if(typeof y!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof y);return fe<=y&&yy===fe,isOdd:y=>(y&ie)===ie,neg:y=>te(-y,n),eql:(y,v)=>y===v,sqr:y=>te(y*y,n),add:(y,v)=>te(y+v,n),sub:(y,v)=>te(y-v,n),mul:(y,v)=>te(y*v,n),pow:(y,v)=>bl(p,y,v),div:(y,v)=>te(y*Xi(v,n),n),sqrN:y=>y*y,addN:(y,v)=>y+v,subN:(y,v)=>y-v,mulN:(y,v)=>y*v,inv:y=>Xi(y,n),sqrt:r.sqrt||(y=>(c||(c=ml(n)),c(p,y))),invertBatch:y=>vl(p,y),cmov:(y,v,x)=>x?v:y,toBytes:y=>e?cn(y,s):xr(y,s),fromBytes:y=>{if(y.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+y.length);return e?vr(y):rr(y)}});return Object.freeze(p)}function Pu(n){if(typeof n!="bigint")throw new Error("field order must be bigint");let t=n.toString(2).length;return Math.ceil(t/8)}function Ts(n){let t=Pu(n);return t+Math.ceil(t/2)}function Cu(n,t,e=!1){let r=n.length,i=Pu(t),s=Ts(t);if(r<16||r1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);let c=e?vr(n):rr(n),p=te(c,t-ie)+ie;return e?cn(p,i):xr(p,i)}var Dy,fe,ie,ln,ll,Ms,Lu,Ru,dl,pl,Tu,wl,On=vt(()=>{Dy=C(z(),1);hn();fe=BigInt(0),ie=BigInt(1),ln=BigInt(2),ll=BigInt(3),Ms=BigInt(4),Lu=BigInt(5),Ru=BigInt(8),dl=BigInt(9),pl=BigInt(16);Tu=(n,t)=>(te(n,t)&ie)===ie,wl=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function Ps(n,t){let e=t.negate();return n?e:t}function Uu(n,t){if(!Number.isSafeInteger(n)||n<=0||n>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+n)}function Cs(n,t){Uu(n,t);let e=Math.ceil(t/n)+1,r=2**(n-1);return{windows:e,windowSize:r}}function xl(n,t){if(!Array.isArray(n))throw new Error("array expected");n.forEach((e,r)=>{if(!(e instanceof t))throw new Error("invalid point at index "+r)})}function kl(n,t){if(!Array.isArray(n))throw new Error("array of scalars expected");n.forEach((e,r)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+r)})}function Us(n){return Nu.get(n)||1}function to(n,t){return{constTimeNegate:Ps,hasPrecomputes(e){return Us(e)!==1},unsafeLadder(e,r,i=n.ZERO){let s=e;for(;r>Ou;)r&Qi&&(i=i.add(s)),s=s.double(),r>>=Qi;return i},precomputeWindow(e,r){let{windows:i,windowSize:s}=Cs(r,t),c=[],p=e,y=p;for(let v=0;v>=S,R>c&&(R-=x,i+=Qi);let _=B,E=B+Math.abs(R)-1,U=I%2!==0,K=R<0;R===0?y=y.add(Ps(U,r[_])):p=p.add(Ps(K,r[E]))}return{p,f:y}},wNAFUnsafe(e,r,i,s=n.ZERO){let{windows:c,windowSize:p}=Cs(e,t),y=BigInt(2**e-1),v=2**e,x=BigInt(e);for(let S=0;S>=x,B>p&&(B-=v,i+=Qi),B===0)continue;let R=r[I+Math.abs(B)-1];B<0&&(R=R.negate()),s=s.add(R)}return s},getPrecomputes(e,r,i){let s=Os.get(r);return s||(s=this.precomputeWindow(r,e),e!==1&&Os.set(r,i(s))),s},wNAFCached(e,r,i){let s=Us(e);return this.wNAF(s,this.getPrecomputes(s,e,i),r)},wNAFCachedUnsafe(e,r,i,s){let c=Us(e);return c===1?this.unsafeLadder(e,r,s):this.wNAFUnsafe(c,this.getPrecomputes(c,e,i),r,s)},setWindowSize(e,r){Uu(r,t),Nu.set(e,r),Os.delete(e)}}}function eo(n,t,e,r){if(xl(e,n),kl(r,t),e.length!==r.length)throw new Error("arrays of points and scalars must have equal length");let i=n.ZERO,s=_s(BigInt(e.length)),c=s>12?s-3:s>4?s-2:s?2:1,p=(1<=0;S-=c){y.fill(i);for(let B=0;B>BigInt(S)&BigInt(p));y[_]=y[_].add(e[B])}let I=i;for(let B=y.length-1,R=i;B>0;B--)R=R.add(y[B]),I=I.add(R);if(x=x.add(I),S!==0)for(let B=0;B{Vy=C(z(),1);On();hn();Ou=BigInt(0),Qi=BigInt(1);Os=new WeakMap,Nu=new WeakMap});function El(n){let t=di(n);return Ge(n,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function zu(n){let t=El(n),{Fp:e,n:r,prehash:i,hash:s,randomBytes:c,nByteLength:p,h:y}=t,v=ro<{try{return{isValid:!0,value:e.sqrt(f*e.inv(h))}}catch{return{isValid:!1,value:Ke}}}),B=t.adjustScalarBytes||(f=>f),R=t.domain||((f,h,l)=>{if(Fe("phflag",l),h.length||l)throw new Error("Contexts/pre-hash are not supported");return f});function _(f,h){Me("coordinate "+f,h,Ke,v)}function E(f){if(!(f instanceof N))throw new Error("ExtendedPoint expected")}let U=fn((f,h)=>{let{ex:l,ey:w,ez:b}=f,d=f.is0();h==null&&(h=d?Sl:e.inv(b));let a=x(l*h),g=x(w*h),A=x(b*h);if(d)return{x:Ke,y:Le};if(A!==Le)throw new Error("invZ was invalid");return{x:a,y:g}}),K=fn(f=>{let{a:h,d:l}=t;if(f.is0())throw new Error("bad point: ZERO");let{ex:w,ey:b,ez:d,et:a}=f,g=x(w*w),A=x(b*b),T=x(d*d),P=x(T*T),F=x(g*h),V=x(T*x(F+A)),Y=x(P+x(l*x(g*A)));if(V!==Y)throw new Error("bad point: equation left != right (1)");let Gt=x(w*b),X=x(d*a);if(Gt!==X)throw new Error("bad point: equation left != right (2)");return!0});class N{constructor(h,l,w,b){this.ex=h,this.ey=l,this.ez=w,this.et=b,_("x",h),_("y",l),_("z",w),_("t",b),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(h){if(h instanceof N)throw new Error("extended point not allowed");let{x:l,y:w}=h||{};return _("x",l),_("y",w),new N(l,w,Le,x(l*w))}static normalizeZ(h){let l=e.invertBatch(h.map(w=>w.ez));return h.map((w,b)=>w.toAffine(l[b])).map(N.fromAffine)}static msm(h,l){return eo(N,S,h,l)}_setWindowSize(h){H.setWindowSize(this,h)}assertValidity(){K(this)}equals(h){E(h);let{ex:l,ey:w,ez:b}=this,{ex:d,ey:a,ez:g}=h,A=x(l*g),T=x(d*b),P=x(w*g),F=x(a*b);return A===T&&P===F}is0(){return this.equals(N.ZERO)}negate(){return new N(x(-this.ex),this.ey,this.ez,x(-this.et))}double(){let{a:h}=t,{ex:l,ey:w,ez:b}=this,d=x(l*l),a=x(w*w),g=x(ro*x(b*b)),A=x(h*d),T=l+w,P=x(x(T*T)-d-a),F=A+a,V=F-g,Y=A-a,Gt=x(P*V),X=x(F*Y),Q=x(P*Y),we=x(V*F);return new N(Gt,X,we,Q)}add(h){E(h);let{a:l,d:w}=t,{ex:b,ey:d,ez:a,et:g}=this,{ex:A,ey:T,ez:P,et:F}=h;if(l===BigInt(-1)){let ft=x((d-b)*(T+A)),ht=x((d+b)*(T-A)),Je=x(ht-ft);if(Je===Ke)return this.double();let lt=x(a*ro*F),dt=x(g*ro*P),hr=dt+lt,pt=ht+ft,yt=dt-lt,Ur=x(hr*Je),wt=x(pt*yt),bt=x(hr*yt),Nr=x(Je*pt);return new N(Ur,wt,Nr,bt)}let V=x(b*A),Y=x(d*T),Gt=x(g*w*F),X=x(a*P),Q=x((b+d)*(A+T)-V-Y),we=X-Gt,at=X+Gt,ct=x(Y-l*V),Cr=x(Q*we),gt=x(at*ct),mt=x(Q*ct),Or=x(we*at);return new N(Cr,gt,Or,mt)}subtract(h){return this.add(h.negate())}wNAF(h){return H.wNAFCached(this,h,N.normalizeZ)}multiply(h){let l=h;Me("scalar",l,Le,r);let{p:w,f:b}=this.wNAF(l);return N.normalizeZ([w,b])[0]}multiplyUnsafe(h,l=N.ZERO){let w=h;return Me("scalar",w,Ke,r),w===Ke?rt:this.is0()||w===Le?this:H.wNAFCachedUnsafe(this,w,N.normalizeZ,l)}isSmallOrder(){return this.multiplyUnsafe(y).is0()}isTorsionFree(){return H.unsafeLadder(this,r).is0()}toAffine(h){return U(this,h)}clearCofactor(){let{h}=t;return h===Le?this:this.multiplyUnsafe(h)}static fromHex(h,l=!1){let{d:w,a:b}=t,d=e.BYTES;h=ae("pointHex",h,d),Fe("zip215",l);let a=h.slice(),g=h[d-1];a[d-1]=g&-129;let A=vr(a),T=l?v:e.ORDER;Me("pointHex.y",A,Ke,T);let P=x(A*A),F=x(P-Le),V=x(w*P-b),{isValid:Y,value:Gt}=I(F,V);if(!Y)throw new Error("Point.fromHex: invalid y coordinate");let X=(Gt&Le)===Le,Q=(g&128)!==0;if(!l&&Gt===Ke&&Q)throw new Error("Point.fromHex: x=0 and x_0=1");return Q!==X&&(Gt=x(-Gt)),N.fromAffine({x:Gt,y:A})}static fromPrivateKey(h){return tt(h).point}toRawBytes(){let{x:h,y:l}=this.toAffine(),w=cn(l,e.BYTES);return w[w.length-1]|=h&Le?128:0,w}toHex(){return er(this.toRawBytes())}}N.BASE=new N(t.Gx,t.Gy,Le,x(t.Gx*t.Gy)),N.ZERO=new N(Ke,Le,Le,Ke);let{BASE:D,ZERO:rt}=N,H=to(N,p*8);function J(f){return te(f,r)}function nt(f){return J(vr(f))}function tt(f){let h=e.BYTES;f=ae("private key",f,h);let l=ae("hashed private key",s(f),2*h),w=B(l.slice(0,h)),b=l.slice(h,2*h),d=nt(w),a=D.multiply(d),g=a.toRawBytes();return{head:w,prefix:b,scalar:d,point:a,pointBytes:g}}function Yt(f){return tt(f).pointBytes}function G(f=new Uint8Array,...h){let l=nr(...h);return nt(s(R(l,ae("context",f),!!i)))}function st(f,h,l={}){f=ae("message",f),i&&(f=i(f));let{prefix:w,scalar:b,pointBytes:d}=tt(h),a=G(l.context,w,f),g=D.multiply(a).toRawBytes(),A=G(l.context,g,d,f),T=J(a+A*b);Me("signature.s",T,Ke,r);let P=nr(g,cn(T,e.BYTES));return ae("result",P,e.BYTES*2)}let m=Bl;function o(f,h,l,w=m){let{context:b,zip215:d}=w,a=e.BYTES;f=ae("signature",f,2*a),h=ae("message",h),l=ae("publicKey",l,a),d!==void 0&&Fe("zip215",d),i&&(h=i(h));let g=vr(f.slice(a,2*a)),A,T,P;try{A=N.fromHex(l,d),T=N.fromHex(f.slice(0,a),d),P=D.multiplyUnsafe(g)}catch{return!1}if(!d&&A.isSmallOrder())return!1;let F=G(b,T.toRawBytes(),A.toRawBytes(),h);return T.add(A.multiplyUnsafe(F)).subtract(P).clearCofactor().equals(N.ZERO)}return D._setWindowSize(8),{CURVE:t,getPublicKey:Yt,sign:st,verify:o,ExtendedPoint:N,utils:{getExtendedPublicKey:tt,randomPrivateKey:()=>c(e.BYTES),precompute(f=8,h=N.BASE){return h._setWindowSize(f),h.multiply(BigInt(3)),h}}}}var Jy,Ke,Le,ro,Sl,Bl,qu=vt(()=>{Jy=C(z(),1);Ns();On();hn();hn();Ke=BigInt(0),Le=BigInt(1),ro=BigInt(2),Sl=BigInt(8),Bl={zip215:!0}});function Ml(n){let t=BigInt(10),e=BigInt(20),r=BigInt(40),i=BigInt(80),s=zs,p=n*n%s*n%s,y=oe(p,Ku,s)*p%s,v=oe(y,Il,s)*n%s,x=oe(v,_l,s)*v%s,S=oe(x,t,s)*x%s,I=oe(S,e,s)*S%s,B=oe(I,r,s)*I%s,R=oe(B,i,s)*B%s,_=oe(R,i,s)*B%s,E=oe(_,t,s)*x%s;return{pow_p_5_8:oe(E,Ku,s)*n%s,b2:p}}function Ll(n){return n[0]&=248,n[31]&=127,n[31]|=64,n}function Rl(n,t){let e=zs,r=te(t*t*t,e),i=te(r*r*t,e),s=Ml(n*i).pow_p_5_8,c=te(n*r*s,e),p=te(t*c*c,e),y=c,v=te(c*Fu,e),x=p===n,S=p===te(-n,e),I=p===te(-n*Fu,e);return x&&(c=y),(S||I)&&(c=v),Tu(c,e)&&(c=te(-c,e)),{isValid:x||S,value:c}}var sg,zs,Fu,ng,Il,Ku,ig,_l,Al,Tl,Pl,dn,Du=vt(()=>{sg=C(z(),1);_u();gr();qu();On();zs=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Fu=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),ng=BigInt(0),Il=BigInt(1),Ku=BigInt(2),ig=BigInt(3),_l=BigInt(5),Al=BigInt(8);Tl=(()=>kr(zs,void 0,!0))(),Pl=(()=>({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Tl,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:Al,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:Iu,randomBytes:Gi,adjustScalarBytes:Ll,uvRatio:Rl}))(),dn=(()=>zu(Pl))()});var qs=he(()=>{var cg=C(z())});var Hu=he((Wu,Fs)=>{var fg=C(z());(function(n,t){"use strict";function e(m,o){if(!m)throw new Error(o||"Assertion failed")}function r(m,o){m.super_=o;var u=function(){};u.prototype=o.prototype,m.prototype=new u,m.prototype.constructor=m}function i(m,o,u){if(i.isBN(m))return m;this.negative=0,this.words=null,this.length=0,this.red=null,m!==null&&((o==="le"||o==="be")&&(u=o,o=10),this._init(m||0,o||10,u||"be"))}typeof n=="object"?n.exports=i:t.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=qs().Buffer}catch{}i.isBN=function(o){return o instanceof i?!0:o!==null&&typeof o=="object"&&o.constructor.wordSize===i.wordSize&&Array.isArray(o.words)},i.max=function(o,u){return o.cmp(u)>0?o:u},i.min=function(o,u){return o.cmp(u)<0?o:u},i.prototype._init=function(o,u,f){if(typeof o=="number")return this._initNumber(o,u,f);if(typeof o=="object")return this._initArray(o,u,f);u==="hex"&&(u=16),e(u===(u|0)&&u>=2&&u<=36),o=o.toString().replace(/\\s+/g,"");var h=0;o[0]==="-"&&(h++,this.negative=1),h=0;h-=3)w=o[h]|o[h-1]<<8|o[h-2]<<16,this.words[l]|=w<>>26-b&67108863,b+=24,b>=26&&(b-=26,l++);else if(f==="le")for(h=0,l=0;h>>26-b&67108863,b+=24,b>=26&&(b-=26,l++);return this._strip()};function c(m,o){var u=m.charCodeAt(o);if(u>=48&&u<=57)return u-48;if(u>=65&&u<=70)return u-55;if(u>=97&&u<=102)return u-87;e(!1,"Invalid character in "+m)}function p(m,o,u){var f=c(m,u);return u-1>=o&&(f|=c(m,u-1)<<4),f}i.prototype._parseHex=function(o,u,f){this.length=Math.ceil((o.length-u)/6),this.words=new Array(this.length);for(var h=0;h=u;h-=2)b=p(o,u,h)<=18?(l-=18,w+=1,this.words[w]|=b>>>26):l+=8;else{var d=o.length-u;for(h=d%2===0?u+1:u;h=18?(l-=18,w+=1,this.words[w]|=b>>>26):l+=8}this._strip()};function y(m,o,u,f){for(var h=0,l=0,w=Math.min(m.length,u),b=o;b=49?l=d-49+10:d>=17?l=d-17+10:l=d,e(d>=0&&l1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=x}catch{i.prototype.inspect=x}else i.prototype.inspect=x;function x(){return(this.red?""}var S=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],I=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],B=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(o,u){o=o||10,u=u|0||1;var f;if(o===16||o==="hex"){f="";for(var h=0,l=0,w=0;w>>24-h&16777215,h+=2,h>=26&&(h-=26,w--),l!==0||w!==this.length-1?f=S[6-d.length]+d+f:f=d+f}for(l!==0&&(f=l.toString(16)+f);f.length%u!==0;)f="0"+f;return this.negative!==0&&(f="-"+f),f}if(o===(o|0)&&o>=2&&o<=36){var a=I[o],g=B[o];f="";var A=this.clone();for(A.negative=0;!A.isZero();){var T=A.modrn(g).toString(o);A=A.idivn(g),A.isZero()?f=T+f:f=S[a-T.length]+T+f}for(this.isZero()&&(f="0"+f);f.length%u!==0;)f="0"+f;return this.negative!==0&&(f="-"+f),f}e(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var o=this.words[0];return this.length===2?o+=this.words[1]*67108864:this.length===3&&this.words[2]===1?o+=4503599627370496+this.words[1]*67108864:this.length>2&&e(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-o:o},i.prototype.toJSON=function(){return this.toString(16,2)},s&&(i.prototype.toBuffer=function(o,u){return this.toArrayLike(s,o,u)}),i.prototype.toArray=function(o,u){return this.toArrayLike(Array,o,u)};var R=function(o,u){return o.allocUnsafe?o.allocUnsafe(u):new o(u)};i.prototype.toArrayLike=function(o,u,f){this._strip();var h=this.byteLength(),l=f||Math.max(1,h);e(h<=l,"byte array longer than desired length"),e(l>0,"Requested array length <= 0");var w=R(o,l),b=u==="le"?"LE":"BE";return this["_toArrayLike"+b](w,h),w},i.prototype._toArrayLikeLE=function(o,u){for(var f=0,h=0,l=0,w=0;l>8&255),f>16&255),w===6?(f>24&255),h=0,w=0):(h=b>>>24,w+=2)}if(f=0&&(o[f--]=b>>8&255),f>=0&&(o[f--]=b>>16&255),w===6?(f>=0&&(o[f--]=b>>24&255),h=0,w=0):(h=b>>>24,w+=2)}if(f>=0)for(o[f--]=h;f>=0;)o[f--]=0},Math.clz32?i.prototype._countBits=function(o){return 32-Math.clz32(o)}:i.prototype._countBits=function(o){var u=o,f=0;return u>=4096&&(f+=13,u>>>=13),u>=64&&(f+=7,u>>>=7),u>=8&&(f+=4,u>>>=4),u>=2&&(f+=2,u>>>=2),f+u},i.prototype._zeroBits=function(o){if(o===0)return 26;var u=o,f=0;return u&8191||(f+=13,u>>>=13),u&127||(f+=7,u>>>=7),u&15||(f+=4,u>>>=4),u&3||(f+=2,u>>>=2),u&1||f++,f},i.prototype.bitLength=function(){var o=this.words[this.length-1],u=this._countBits(o);return(this.length-1)*26+u};function _(m){for(var o=new Array(m.bitLength()),u=0;u>>h&1}return o}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,u=0;uo.length?this.clone().ior(o):o.clone().ior(this)},i.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},i.prototype.iuand=function(o){var u;this.length>o.length?u=o:u=this;for(var f=0;fo.length?this.clone().iand(o):o.clone().iand(this)},i.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},i.prototype.iuxor=function(o){var u,f;this.length>o.length?(u=this,f=o):(u=o,f=this);for(var h=0;ho.length?this.clone().ixor(o):o.clone().ixor(this)},i.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},i.prototype.inotn=function(o){e(typeof o=="number"&&o>=0);var u=Math.ceil(o/26)|0,f=o%26;this._expand(u),f>0&&u--;for(var h=0;h0&&(this.words[h]=~this.words[h]&67108863>>26-f),this._strip()},i.prototype.notn=function(o){return this.clone().inotn(o)},i.prototype.setn=function(o,u){e(typeof o=="number"&&o>=0);var f=o/26|0,h=o%26;return this._expand(f+1),u?this.words[f]=this.words[f]|1<o.length?(f=this,h=o):(f=o,h=this);for(var l=0,w=0;w>>26;for(;l!==0&&w>>26;if(this.length=f.length,l!==0)this.words[this.length]=l,this.length++;else if(f!==this)for(;wo.length?this.clone().iadd(o):o.clone().iadd(this)},i.prototype.isub=function(o){if(o.negative!==0){o.negative=0;var u=this.iadd(o);return o.negative=1,u._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var f=this.cmp(o);if(f===0)return this.negative=0,this.length=1,this.words[0]=0,this;var h,l;f>0?(h=this,l=o):(h=o,l=this);for(var w=0,b=0;b>26,this.words[b]=u&67108863;for(;w!==0&&b>26,this.words[b]=u&67108863;if(w===0&&b>>26,A=d&67108863,T=Math.min(a,o.length-1),P=Math.max(0,a-m.length+1);P<=T;P++){var F=a-P|0;h=m.words[F]|0,l=o.words[P]|0,w=h*l+A,g+=w/67108864|0,A=w&67108863}u.words[a]=A|0,d=g|0}return d!==0?u.words[a]=d|0:u.length--,u._strip()}var U=function(o,u,f){var h=o.words,l=u.words,w=f.words,b=0,d,a,g,A=h[0]|0,T=A&8191,P=A>>>13,F=h[1]|0,V=F&8191,Y=F>>>13,Gt=h[2]|0,X=Gt&8191,Q=Gt>>>13,we=h[3]|0,at=we&8191,ct=we>>>13,Cr=h[4]|0,gt=Cr&8191,mt=Cr>>>13,Or=h[5]|0,ft=Or&8191,ht=Or>>>13,Je=h[6]|0,lt=Je&8191,dt=Je>>>13,hr=h[7]|0,pt=hr&8191,yt=hr>>>13,Ur=h[8]|0,wt=Ur&8191,bt=Ur>>>13,Nr=h[9]|0,xt=Nr&8191,kt=Nr>>>13,Xn=l[0]|0,St=Xn&8191,Bt=Xn>>>13,Qn=l[1]|0,Et=Qn&8191,It=Qn>>>13,ti=l[2]|0,_t=ti&8191,At=ti>>>13,ei=l[3]|0,Mt=ei&8191,Lt=ei>>>13,ri=l[4]|0,Rt=ri&8191,Tt=ri>>>13,ni=l[5]|0,Pt=ni&8191,Ct=ni>>>13,ii=l[6]|0,Ot=ii&8191,Ut=ii>>>13,oi=l[7]|0,Nt=oi&8191,zt=oi>>>13,si=l[8]|0,qt=si&8191,Ft=si>>>13,ai=l[9]|0,Kt=ai&8191,Dt=ai>>>13;f.negative=o.negative^u.negative,f.length=19,d=Math.imul(T,St),a=Math.imul(T,Bt),a=a+Math.imul(P,St)|0,g=Math.imul(P,Bt);var zr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(zr>>>26)|0,zr&=67108863,d=Math.imul(V,St),a=Math.imul(V,Bt),a=a+Math.imul(Y,St)|0,g=Math.imul(Y,Bt),d=d+Math.imul(T,Et)|0,a=a+Math.imul(T,It)|0,a=a+Math.imul(P,Et)|0,g=g+Math.imul(P,It)|0;var qr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(qr>>>26)|0,qr&=67108863,d=Math.imul(X,St),a=Math.imul(X,Bt),a=a+Math.imul(Q,St)|0,g=Math.imul(Q,Bt),d=d+Math.imul(V,Et)|0,a=a+Math.imul(V,It)|0,a=a+Math.imul(Y,Et)|0,g=g+Math.imul(Y,It)|0,d=d+Math.imul(T,_t)|0,a=a+Math.imul(T,At)|0,a=a+Math.imul(P,_t)|0,g=g+Math.imul(P,At)|0;var Fr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,d=Math.imul(at,St),a=Math.imul(at,Bt),a=a+Math.imul(ct,St)|0,g=Math.imul(ct,Bt),d=d+Math.imul(X,Et)|0,a=a+Math.imul(X,It)|0,a=a+Math.imul(Q,Et)|0,g=g+Math.imul(Q,It)|0,d=d+Math.imul(V,_t)|0,a=a+Math.imul(V,At)|0,a=a+Math.imul(Y,_t)|0,g=g+Math.imul(Y,At)|0,d=d+Math.imul(T,Mt)|0,a=a+Math.imul(T,Lt)|0,a=a+Math.imul(P,Mt)|0,g=g+Math.imul(P,Lt)|0;var Kr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Kr>>>26)|0,Kr&=67108863,d=Math.imul(gt,St),a=Math.imul(gt,Bt),a=a+Math.imul(mt,St)|0,g=Math.imul(mt,Bt),d=d+Math.imul(at,Et)|0,a=a+Math.imul(at,It)|0,a=a+Math.imul(ct,Et)|0,g=g+Math.imul(ct,It)|0,d=d+Math.imul(X,_t)|0,a=a+Math.imul(X,At)|0,a=a+Math.imul(Q,_t)|0,g=g+Math.imul(Q,At)|0,d=d+Math.imul(V,Mt)|0,a=a+Math.imul(V,Lt)|0,a=a+Math.imul(Y,Mt)|0,g=g+Math.imul(Y,Lt)|0,d=d+Math.imul(T,Rt)|0,a=a+Math.imul(T,Tt)|0,a=a+Math.imul(P,Rt)|0,g=g+Math.imul(P,Tt)|0;var Dr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,d=Math.imul(ft,St),a=Math.imul(ft,Bt),a=a+Math.imul(ht,St)|0,g=Math.imul(ht,Bt),d=d+Math.imul(gt,Et)|0,a=a+Math.imul(gt,It)|0,a=a+Math.imul(mt,Et)|0,g=g+Math.imul(mt,It)|0,d=d+Math.imul(at,_t)|0,a=a+Math.imul(at,At)|0,a=a+Math.imul(ct,_t)|0,g=g+Math.imul(ct,At)|0,d=d+Math.imul(X,Mt)|0,a=a+Math.imul(X,Lt)|0,a=a+Math.imul(Q,Mt)|0,g=g+Math.imul(Q,Lt)|0,d=d+Math.imul(V,Rt)|0,a=a+Math.imul(V,Tt)|0,a=a+Math.imul(Y,Rt)|0,g=g+Math.imul(Y,Tt)|0,d=d+Math.imul(T,Pt)|0,a=a+Math.imul(T,Ct)|0,a=a+Math.imul(P,Pt)|0,g=g+Math.imul(P,Ct)|0;var Wr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Wr>>>26)|0,Wr&=67108863,d=Math.imul(lt,St),a=Math.imul(lt,Bt),a=a+Math.imul(dt,St)|0,g=Math.imul(dt,Bt),d=d+Math.imul(ft,Et)|0,a=a+Math.imul(ft,It)|0,a=a+Math.imul(ht,Et)|0,g=g+Math.imul(ht,It)|0,d=d+Math.imul(gt,_t)|0,a=a+Math.imul(gt,At)|0,a=a+Math.imul(mt,_t)|0,g=g+Math.imul(mt,At)|0,d=d+Math.imul(at,Mt)|0,a=a+Math.imul(at,Lt)|0,a=a+Math.imul(ct,Mt)|0,g=g+Math.imul(ct,Lt)|0,d=d+Math.imul(X,Rt)|0,a=a+Math.imul(X,Tt)|0,a=a+Math.imul(Q,Rt)|0,g=g+Math.imul(Q,Tt)|0,d=d+Math.imul(V,Pt)|0,a=a+Math.imul(V,Ct)|0,a=a+Math.imul(Y,Pt)|0,g=g+Math.imul(Y,Ct)|0,d=d+Math.imul(T,Ot)|0,a=a+Math.imul(T,Ut)|0,a=a+Math.imul(P,Ot)|0,g=g+Math.imul(P,Ut)|0;var Hr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,d=Math.imul(pt,St),a=Math.imul(pt,Bt),a=a+Math.imul(yt,St)|0,g=Math.imul(yt,Bt),d=d+Math.imul(lt,Et)|0,a=a+Math.imul(lt,It)|0,a=a+Math.imul(dt,Et)|0,g=g+Math.imul(dt,It)|0,d=d+Math.imul(ft,_t)|0,a=a+Math.imul(ft,At)|0,a=a+Math.imul(ht,_t)|0,g=g+Math.imul(ht,At)|0,d=d+Math.imul(gt,Mt)|0,a=a+Math.imul(gt,Lt)|0,a=a+Math.imul(mt,Mt)|0,g=g+Math.imul(mt,Lt)|0,d=d+Math.imul(at,Rt)|0,a=a+Math.imul(at,Tt)|0,a=a+Math.imul(ct,Rt)|0,g=g+Math.imul(ct,Tt)|0,d=d+Math.imul(X,Pt)|0,a=a+Math.imul(X,Ct)|0,a=a+Math.imul(Q,Pt)|0,g=g+Math.imul(Q,Ct)|0,d=d+Math.imul(V,Ot)|0,a=a+Math.imul(V,Ut)|0,a=a+Math.imul(Y,Ot)|0,g=g+Math.imul(Y,Ut)|0,d=d+Math.imul(T,Nt)|0,a=a+Math.imul(T,zt)|0,a=a+Math.imul(P,Nt)|0,g=g+Math.imul(P,zt)|0;var $r=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+($r>>>26)|0,$r&=67108863,d=Math.imul(wt,St),a=Math.imul(wt,Bt),a=a+Math.imul(bt,St)|0,g=Math.imul(bt,Bt),d=d+Math.imul(pt,Et)|0,a=a+Math.imul(pt,It)|0,a=a+Math.imul(yt,Et)|0,g=g+Math.imul(yt,It)|0,d=d+Math.imul(lt,_t)|0,a=a+Math.imul(lt,At)|0,a=a+Math.imul(dt,_t)|0,g=g+Math.imul(dt,At)|0,d=d+Math.imul(ft,Mt)|0,a=a+Math.imul(ft,Lt)|0,a=a+Math.imul(ht,Mt)|0,g=g+Math.imul(ht,Lt)|0,d=d+Math.imul(gt,Rt)|0,a=a+Math.imul(gt,Tt)|0,a=a+Math.imul(mt,Rt)|0,g=g+Math.imul(mt,Tt)|0,d=d+Math.imul(at,Pt)|0,a=a+Math.imul(at,Ct)|0,a=a+Math.imul(ct,Pt)|0,g=g+Math.imul(ct,Ct)|0,d=d+Math.imul(X,Ot)|0,a=a+Math.imul(X,Ut)|0,a=a+Math.imul(Q,Ot)|0,g=g+Math.imul(Q,Ut)|0,d=d+Math.imul(V,Nt)|0,a=a+Math.imul(V,zt)|0,a=a+Math.imul(Y,Nt)|0,g=g+Math.imul(Y,zt)|0,d=d+Math.imul(T,qt)|0,a=a+Math.imul(T,Ft)|0,a=a+Math.imul(P,qt)|0,g=g+Math.imul(P,Ft)|0;var Vr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,d=Math.imul(xt,St),a=Math.imul(xt,Bt),a=a+Math.imul(kt,St)|0,g=Math.imul(kt,Bt),d=d+Math.imul(wt,Et)|0,a=a+Math.imul(wt,It)|0,a=a+Math.imul(bt,Et)|0,g=g+Math.imul(bt,It)|0,d=d+Math.imul(pt,_t)|0,a=a+Math.imul(pt,At)|0,a=a+Math.imul(yt,_t)|0,g=g+Math.imul(yt,At)|0,d=d+Math.imul(lt,Mt)|0,a=a+Math.imul(lt,Lt)|0,a=a+Math.imul(dt,Mt)|0,g=g+Math.imul(dt,Lt)|0,d=d+Math.imul(ft,Rt)|0,a=a+Math.imul(ft,Tt)|0,a=a+Math.imul(ht,Rt)|0,g=g+Math.imul(ht,Tt)|0,d=d+Math.imul(gt,Pt)|0,a=a+Math.imul(gt,Ct)|0,a=a+Math.imul(mt,Pt)|0,g=g+Math.imul(mt,Ct)|0,d=d+Math.imul(at,Ot)|0,a=a+Math.imul(at,Ut)|0,a=a+Math.imul(ct,Ot)|0,g=g+Math.imul(ct,Ut)|0,d=d+Math.imul(X,Nt)|0,a=a+Math.imul(X,zt)|0,a=a+Math.imul(Q,Nt)|0,g=g+Math.imul(Q,zt)|0,d=d+Math.imul(V,qt)|0,a=a+Math.imul(V,Ft)|0,a=a+Math.imul(Y,qt)|0,g=g+Math.imul(Y,Ft)|0,d=d+Math.imul(T,Kt)|0,a=a+Math.imul(T,Dt)|0,a=a+Math.imul(P,Kt)|0,g=g+Math.imul(P,Dt)|0;var Gr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Gr>>>26)|0,Gr&=67108863,d=Math.imul(xt,Et),a=Math.imul(xt,It),a=a+Math.imul(kt,Et)|0,g=Math.imul(kt,It),d=d+Math.imul(wt,_t)|0,a=a+Math.imul(wt,At)|0,a=a+Math.imul(bt,_t)|0,g=g+Math.imul(bt,At)|0,d=d+Math.imul(pt,Mt)|0,a=a+Math.imul(pt,Lt)|0,a=a+Math.imul(yt,Mt)|0,g=g+Math.imul(yt,Lt)|0,d=d+Math.imul(lt,Rt)|0,a=a+Math.imul(lt,Tt)|0,a=a+Math.imul(dt,Rt)|0,g=g+Math.imul(dt,Tt)|0,d=d+Math.imul(ft,Pt)|0,a=a+Math.imul(ft,Ct)|0,a=a+Math.imul(ht,Pt)|0,g=g+Math.imul(ht,Ct)|0,d=d+Math.imul(gt,Ot)|0,a=a+Math.imul(gt,Ut)|0,a=a+Math.imul(mt,Ot)|0,g=g+Math.imul(mt,Ut)|0,d=d+Math.imul(at,Nt)|0,a=a+Math.imul(at,zt)|0,a=a+Math.imul(ct,Nt)|0,g=g+Math.imul(ct,zt)|0,d=d+Math.imul(X,qt)|0,a=a+Math.imul(X,Ft)|0,a=a+Math.imul(Q,qt)|0,g=g+Math.imul(Q,Ft)|0,d=d+Math.imul(V,Kt)|0,a=a+Math.imul(V,Dt)|0,a=a+Math.imul(Y,Kt)|0,g=g+Math.imul(Y,Dt)|0;var Zr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,d=Math.imul(xt,_t),a=Math.imul(xt,At),a=a+Math.imul(kt,_t)|0,g=Math.imul(kt,At),d=d+Math.imul(wt,Mt)|0,a=a+Math.imul(wt,Lt)|0,a=a+Math.imul(bt,Mt)|0,g=g+Math.imul(bt,Lt)|0,d=d+Math.imul(pt,Rt)|0,a=a+Math.imul(pt,Tt)|0,a=a+Math.imul(yt,Rt)|0,g=g+Math.imul(yt,Tt)|0,d=d+Math.imul(lt,Pt)|0,a=a+Math.imul(lt,Ct)|0,a=a+Math.imul(dt,Pt)|0,g=g+Math.imul(dt,Ct)|0,d=d+Math.imul(ft,Ot)|0,a=a+Math.imul(ft,Ut)|0,a=a+Math.imul(ht,Ot)|0,g=g+Math.imul(ht,Ut)|0,d=d+Math.imul(gt,Nt)|0,a=a+Math.imul(gt,zt)|0,a=a+Math.imul(mt,Nt)|0,g=g+Math.imul(mt,zt)|0,d=d+Math.imul(at,qt)|0,a=a+Math.imul(at,Ft)|0,a=a+Math.imul(ct,qt)|0,g=g+Math.imul(ct,Ft)|0,d=d+Math.imul(X,Kt)|0,a=a+Math.imul(X,Dt)|0,a=a+Math.imul(Q,Kt)|0,g=g+Math.imul(Q,Dt)|0;var jr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(jr>>>26)|0,jr&=67108863,d=Math.imul(xt,Mt),a=Math.imul(xt,Lt),a=a+Math.imul(kt,Mt)|0,g=Math.imul(kt,Lt),d=d+Math.imul(wt,Rt)|0,a=a+Math.imul(wt,Tt)|0,a=a+Math.imul(bt,Rt)|0,g=g+Math.imul(bt,Tt)|0,d=d+Math.imul(pt,Pt)|0,a=a+Math.imul(pt,Ct)|0,a=a+Math.imul(yt,Pt)|0,g=g+Math.imul(yt,Ct)|0,d=d+Math.imul(lt,Ot)|0,a=a+Math.imul(lt,Ut)|0,a=a+Math.imul(dt,Ot)|0,g=g+Math.imul(dt,Ut)|0,d=d+Math.imul(ft,Nt)|0,a=a+Math.imul(ft,zt)|0,a=a+Math.imul(ht,Nt)|0,g=g+Math.imul(ht,zt)|0,d=d+Math.imul(gt,qt)|0,a=a+Math.imul(gt,Ft)|0,a=a+Math.imul(mt,qt)|0,g=g+Math.imul(mt,Ft)|0,d=d+Math.imul(at,Kt)|0,a=a+Math.imul(at,Dt)|0,a=a+Math.imul(ct,Kt)|0,g=g+Math.imul(ct,Dt)|0;var Yr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Yr>>>26)|0,Yr&=67108863,d=Math.imul(xt,Rt),a=Math.imul(xt,Tt),a=a+Math.imul(kt,Rt)|0,g=Math.imul(kt,Tt),d=d+Math.imul(wt,Pt)|0,a=a+Math.imul(wt,Ct)|0,a=a+Math.imul(bt,Pt)|0,g=g+Math.imul(bt,Ct)|0,d=d+Math.imul(pt,Ot)|0,a=a+Math.imul(pt,Ut)|0,a=a+Math.imul(yt,Ot)|0,g=g+Math.imul(yt,Ut)|0,d=d+Math.imul(lt,Nt)|0,a=a+Math.imul(lt,zt)|0,a=a+Math.imul(dt,Nt)|0,g=g+Math.imul(dt,zt)|0,d=d+Math.imul(ft,qt)|0,a=a+Math.imul(ft,Ft)|0,a=a+Math.imul(ht,qt)|0,g=g+Math.imul(ht,Ft)|0,d=d+Math.imul(gt,Kt)|0,a=a+Math.imul(gt,Dt)|0,a=a+Math.imul(mt,Kt)|0,g=g+Math.imul(mt,Dt)|0;var Jr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,d=Math.imul(xt,Pt),a=Math.imul(xt,Ct),a=a+Math.imul(kt,Pt)|0,g=Math.imul(kt,Ct),d=d+Math.imul(wt,Ot)|0,a=a+Math.imul(wt,Ut)|0,a=a+Math.imul(bt,Ot)|0,g=g+Math.imul(bt,Ut)|0,d=d+Math.imul(pt,Nt)|0,a=a+Math.imul(pt,zt)|0,a=a+Math.imul(yt,Nt)|0,g=g+Math.imul(yt,zt)|0,d=d+Math.imul(lt,qt)|0,a=a+Math.imul(lt,Ft)|0,a=a+Math.imul(dt,qt)|0,g=g+Math.imul(dt,Ft)|0,d=d+Math.imul(ft,Kt)|0,a=a+Math.imul(ft,Dt)|0,a=a+Math.imul(ht,Kt)|0,g=g+Math.imul(ht,Dt)|0;var Xr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,d=Math.imul(xt,Ot),a=Math.imul(xt,Ut),a=a+Math.imul(kt,Ot)|0,g=Math.imul(kt,Ut),d=d+Math.imul(wt,Nt)|0,a=a+Math.imul(wt,zt)|0,a=a+Math.imul(bt,Nt)|0,g=g+Math.imul(bt,zt)|0,d=d+Math.imul(pt,qt)|0,a=a+Math.imul(pt,Ft)|0,a=a+Math.imul(yt,qt)|0,g=g+Math.imul(yt,Ft)|0,d=d+Math.imul(lt,Kt)|0,a=a+Math.imul(lt,Dt)|0,a=a+Math.imul(dt,Kt)|0,g=g+Math.imul(dt,Dt)|0;var Qr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,d=Math.imul(xt,Nt),a=Math.imul(xt,zt),a=a+Math.imul(kt,Nt)|0,g=Math.imul(kt,zt),d=d+Math.imul(wt,qt)|0,a=a+Math.imul(wt,Ft)|0,a=a+Math.imul(bt,qt)|0,g=g+Math.imul(bt,Ft)|0,d=d+Math.imul(pt,Kt)|0,a=a+Math.imul(pt,Dt)|0,a=a+Math.imul(yt,Kt)|0,g=g+Math.imul(yt,Dt)|0;var tn=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(tn>>>26)|0,tn&=67108863,d=Math.imul(xt,qt),a=Math.imul(xt,Ft),a=a+Math.imul(kt,qt)|0,g=Math.imul(kt,Ft),d=d+Math.imul(wt,Kt)|0,a=a+Math.imul(wt,Dt)|0,a=a+Math.imul(bt,Kt)|0,g=g+Math.imul(bt,Dt)|0;var en=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(en>>>26)|0,en&=67108863,d=Math.imul(xt,Kt),a=Math.imul(xt,Dt),a=a+Math.imul(kt,Kt)|0,g=Math.imul(kt,Dt);var rn=(b+d|0)+((a&8191)<<13)|0;return b=(g+(a>>>13)|0)+(rn>>>26)|0,rn&=67108863,w[0]=zr,w[1]=qr,w[2]=Fr,w[3]=Kr,w[4]=Dr,w[5]=Wr,w[6]=Hr,w[7]=$r,w[8]=Vr,w[9]=Gr,w[10]=Zr,w[11]=jr,w[12]=Yr,w[13]=Jr,w[14]=Xr,w[15]=Qr,w[16]=tn,w[17]=en,w[18]=rn,b!==0&&(w[19]=b,f.length++),f};Math.imul||(U=E);function K(m,o,u){u.negative=o.negative^m.negative,u.length=m.length+o.length;for(var f=0,h=0,l=0;l>>26)|0,h+=w>>>26,w&=67108863}u.words[l]=b,f=w,w=h}return f!==0?u.words[l]=f:u.length--,u._strip()}function N(m,o,u){return K(m,o,u)}i.prototype.mulTo=function(o,u){var f,h=this.length+o.length;return this.length===10&&o.length===10?f=U(this,o,u):h<63?f=E(this,o,u):h<1024?f=K(this,o,u):f=N(this,o,u),f};function D(m,o){this.x=m,this.y=o}D.prototype.makeRBT=function(o){for(var u=new Array(o),f=i.prototype._countBits(o)-1,h=0;h>=1;return h},D.prototype.permute=function(o,u,f,h,l,w){for(var b=0;b>>1)l++;return 1<>>13,f[2*w+1]=l&8191,l=l>>>13;for(w=2*u;w>=26,f+=l/67108864|0,f+=w>>>26,this.words[h]=w&67108863}return f!==0&&(this.words[h]=f,this.length++),u?this.ineg():this},i.prototype.muln=function(o){return this.clone().imuln(o)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(o){var u=_(o);if(u.length===0)return new i(1);for(var f=this,h=0;h=0);var u=o%26,f=(o-u)/26,h=67108863>>>26-u<<26-u,l;if(u!==0){var w=0;for(l=0;l>>26-u}w&&(this.words[l]=w,this.length++)}if(f!==0){for(l=this.length-1;l>=0;l--)this.words[l+f]=this.words[l];for(l=0;l=0);var h;u?h=(u-u%26)/26:h=0;var l=o%26,w=Math.min((o-l)/26,this.length),b=67108863^67108863>>>l<w)for(this.length-=w,a=0;a=0&&(g!==0||a>=h);a--){var A=this.words[a]|0;this.words[a]=g<<26-l|A>>>l,g=A&b}return d&&g!==0&&(d.words[d.length++]=g),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(o,u,f){return e(this.negative===0),this.iushrn(o,u,f)},i.prototype.shln=function(o){return this.clone().ishln(o)},i.prototype.ushln=function(o){return this.clone().iushln(o)},i.prototype.shrn=function(o){return this.clone().ishrn(o)},i.prototype.ushrn=function(o){return this.clone().iushrn(o)},i.prototype.testn=function(o){e(typeof o=="number"&&o>=0);var u=o%26,f=(o-u)/26,h=1<=0);var u=o%26,f=(o-u)/26;if(e(this.negative===0,"imaskn works only with positive numbers"),this.length<=f)return this;if(u!==0&&f++,this.length=Math.min(f,this.length),u!==0){var h=67108863^67108863>>>u<=67108864;u++)this.words[u]-=67108864,u===this.length-1?this.words[u+1]=1:this.words[u+1]++;return this.length=Math.max(this.length,u+1),this},i.prototype.isubn=function(o){if(e(typeof o=="number"),e(o<67108864),o<0)return this.iaddn(-o);if(this.negative!==0)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var u=0;u>26)-(d/67108864|0),this.words[l+f]=w&67108863}for(;l>26,this.words[l+f]=w&67108863;if(b===0)return this._strip();for(e(b===-1),b=0,l=0;l>26,this.words[l]=w&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(o,u){var f=this.length-o.length,h=this.clone(),l=o,w=l.words[l.length-1]|0,b=this._countBits(w);f=26-b,f!==0&&(l=l.ushln(f),h.iushln(f),w=l.words[l.length-1]|0);var d=h.length-l.length,a;if(u!=="mod"){a=new i(null),a.length=d+1,a.words=new Array(a.length);for(var g=0;g=0;T--){var P=(h.words[l.length+T]|0)*67108864+(h.words[l.length+T-1]|0);for(P=Math.min(P/w|0,67108863),h._ishlnsubmul(l,P,T);h.negative!==0;)P--,h.negative=0,h._ishlnsubmul(l,1,T),h.isZero()||(h.negative^=1);a&&(a.words[T]=P)}return a&&a._strip(),h._strip(),u!=="div"&&f!==0&&h.iushrn(f),{div:a||null,mod:h}},i.prototype.divmod=function(o,u,f){if(e(!o.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var h,l,w;return this.negative!==0&&o.negative===0?(w=this.neg().divmod(o,u),u!=="mod"&&(h=w.div.neg()),u!=="div"&&(l=w.mod.neg(),f&&l.negative!==0&&l.iadd(o)),{div:h,mod:l}):this.negative===0&&o.negative!==0?(w=this.divmod(o.neg(),u),u!=="mod"&&(h=w.div.neg()),{div:h,mod:w.mod}):this.negative&o.negative?(w=this.neg().divmod(o.neg(),u),u!=="div"&&(l=w.mod.neg(),f&&l.negative!==0&&l.isub(o)),{div:w.div,mod:l}):o.length>this.length||this.cmp(o)<0?{div:new i(0),mod:this}:o.length===1?u==="div"?{div:this.divn(o.words[0]),mod:null}:u==="mod"?{div:null,mod:new i(this.modrn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new i(this.modrn(o.words[0]))}:this._wordDiv(o,u)},i.prototype.div=function(o){return this.divmod(o,"div",!1).div},i.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},i.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},i.prototype.divRound=function(o){var u=this.divmod(o);if(u.mod.isZero())return u.div;var f=u.div.negative!==0?u.mod.isub(o):u.mod,h=o.ushrn(1),l=o.andln(1),w=f.cmp(h);return w<0||l===1&&w===0?u.div:u.div.negative!==0?u.div.isubn(1):u.div.iaddn(1)},i.prototype.modrn=function(o){var u=o<0;u&&(o=-o),e(o<=67108863);for(var f=(1<<26)%o,h=0,l=this.length-1;l>=0;l--)h=(f*h+(this.words[l]|0))%o;return u?-h:h},i.prototype.modn=function(o){return this.modrn(o)},i.prototype.idivn=function(o){var u=o<0;u&&(o=-o),e(o<=67108863);for(var f=0,h=this.length-1;h>=0;h--){var l=(this.words[h]|0)+f*67108864;this.words[h]=l/o|0,f=l%o}return this._strip(),u?this.ineg():this},i.prototype.divn=function(o){return this.clone().idivn(o)},i.prototype.egcd=function(o){e(o.negative===0),e(!o.isZero());var u=this,f=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var h=new i(1),l=new i(0),w=new i(0),b=new i(1),d=0;u.isEven()&&f.isEven();)u.iushrn(1),f.iushrn(1),++d;for(var a=f.clone(),g=u.clone();!u.isZero();){for(var A=0,T=1;!(u.words[0]&T)&&A<26;++A,T<<=1);if(A>0)for(u.iushrn(A);A-- >0;)(h.isOdd()||l.isOdd())&&(h.iadd(a),l.isub(g)),h.iushrn(1),l.iushrn(1);for(var P=0,F=1;!(f.words[0]&F)&&P<26;++P,F<<=1);if(P>0)for(f.iushrn(P);P-- >0;)(w.isOdd()||b.isOdd())&&(w.iadd(a),b.isub(g)),w.iushrn(1),b.iushrn(1);u.cmp(f)>=0?(u.isub(f),h.isub(w),l.isub(b)):(f.isub(u),w.isub(h),b.isub(l))}return{a:w,b,gcd:f.iushln(d)}},i.prototype._invmp=function(o){e(o.negative===0),e(!o.isZero());var u=this,f=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var h=new i(1),l=new i(0),w=f.clone();u.cmpn(1)>0&&f.cmpn(1)>0;){for(var b=0,d=1;!(u.words[0]&d)&&b<26;++b,d<<=1);if(b>0)for(u.iushrn(b);b-- >0;)h.isOdd()&&h.iadd(w),h.iushrn(1);for(var a=0,g=1;!(f.words[0]&g)&&a<26;++a,g<<=1);if(a>0)for(f.iushrn(a);a-- >0;)l.isOdd()&&l.iadd(w),l.iushrn(1);u.cmp(f)>=0?(u.isub(f),h.isub(l)):(f.isub(u),l.isub(h))}var A;return u.cmpn(1)===0?A=h:A=l,A.cmpn(0)<0&&A.iadd(o),A},i.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var u=this.clone(),f=o.clone();u.negative=0,f.negative=0;for(var h=0;u.isEven()&&f.isEven();h++)u.iushrn(1),f.iushrn(1);do{for(;u.isEven();)u.iushrn(1);for(;f.isEven();)f.iushrn(1);var l=u.cmp(f);if(l<0){var w=u;u=f,f=w}else if(l===0||f.cmpn(1)===0)break;u.isub(f)}while(!0);return f.iushln(h)},i.prototype.invm=function(o){return this.egcd(o).a.umod(o)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(o){return this.words[0]&o},i.prototype.bincn=function(o){e(typeof o=="number");var u=o%26,f=(o-u)/26,h=1<>>26,b&=67108863,this.words[w]=b}return l!==0&&(this.words[w]=l,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(o){var u=o<0;if(this.negative!==0&&!u)return-1;if(this.negative===0&&u)return 1;this._strip();var f;if(this.length>1)f=1;else{u&&(o=-o),e(o<=67108863,"Number is too big");var h=this.words[0]|0;f=h===o?0:ho.length)return 1;if(this.length=0;f--){var h=this.words[f]|0,l=o.words[f]|0;if(h!==l){hl&&(u=1);break}}return u},i.prototype.gtn=function(o){return this.cmpn(o)===1},i.prototype.gt=function(o){return this.cmp(o)===1},i.prototype.gten=function(o){return this.cmpn(o)>=0},i.prototype.gte=function(o){return this.cmp(o)>=0},i.prototype.ltn=function(o){return this.cmpn(o)===-1},i.prototype.lt=function(o){return this.cmp(o)===-1},i.prototype.lten=function(o){return this.cmpn(o)<=0},i.prototype.lte=function(o){return this.cmp(o)<=0},i.prototype.eqn=function(o){return this.cmpn(o)===0},i.prototype.eq=function(o){return this.cmp(o)===0},i.red=function(o){return new G(o)},i.prototype.toRed=function(o){return e(!this.red,"Already a number in reduction context"),e(this.negative===0,"red works only with positives"),o.convertTo(this)._forceRed(o)},i.prototype.fromRed=function(){return e(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(o){return this.red=o,this},i.prototype.forceRed=function(o){return e(!this.red,"Already a number in reduction context"),this._forceRed(o)},i.prototype.redAdd=function(o){return e(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},i.prototype.redIAdd=function(o){return e(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},i.prototype.redSub=function(o){return e(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},i.prototype.redISub=function(o){return e(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},i.prototype.redShl=function(o){return e(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},i.prototype.redMul=function(o){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},i.prototype.redIMul=function(o){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},i.prototype.redSqr=function(){return e(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return e(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return e(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return e(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return e(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(o){return e(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var rt={k256:null,p224:null,p192:null,p25519:null};function H(m,o){this.name=m,this.p=new i(o,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var o=new i(null);return o.words=new Array(Math.ceil(this.n/13)),o},H.prototype.ireduce=function(o){var u=o,f;do this.split(u,this.tmp),u=this.imulK(u),u=u.iadd(this.tmp),f=u.bitLength();while(f>this.n);var h=f0?u.isub(this.p):u.strip!==void 0?u.strip():u._strip(),u},H.prototype.split=function(o,u){o.iushrn(this.n,0,u)},H.prototype.imulK=function(o){return o.imul(this.k)};function J(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}r(J,H),J.prototype.split=function(o,u){for(var f=4194303,h=Math.min(o.length,9),l=0;l>>22,w=b}w>>>=22,o.words[l-10]=w,w===0&&o.length>10?o.length-=10:o.length-=9},J.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var u=0,f=0;f>>=26,o.words[f]=l,u=h}return u!==0&&(o.words[o.length++]=u),o},i._prime=function(o){if(rt[o])return rt[o];var u;if(o==="k256")u=new J;else if(o==="p224")u=new nt;else if(o==="p192")u=new tt;else if(o==="p25519")u=new Yt;else throw new Error("Unknown prime "+o);return rt[o]=u,u};function G(m){if(typeof m=="string"){var o=i._prime(m);this.m=o.p,this.prime=o}else e(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}G.prototype._verify1=function(o){e(o.negative===0,"red works only with positives"),e(o.red,"red works only with red numbers")},G.prototype._verify2=function(o,u){e((o.negative|u.negative)===0,"red works only with positives"),e(o.red&&o.red===u.red,"red works only with red numbers")},G.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(v(o,o.umod(this.m)._forceRed(this)),o)},G.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},G.prototype.add=function(o,u){this._verify2(o,u);var f=o.add(u);return f.cmp(this.m)>=0&&f.isub(this.m),f._forceRed(this)},G.prototype.iadd=function(o,u){this._verify2(o,u);var f=o.iadd(u);return f.cmp(this.m)>=0&&f.isub(this.m),f},G.prototype.sub=function(o,u){this._verify2(o,u);var f=o.sub(u);return f.cmpn(0)<0&&f.iadd(this.m),f._forceRed(this)},G.prototype.isub=function(o,u){this._verify2(o,u);var f=o.isub(u);return f.cmpn(0)<0&&f.iadd(this.m),f},G.prototype.shl=function(o,u){return this._verify1(o),this.imod(o.ushln(u))},G.prototype.imul=function(o,u){return this._verify2(o,u),this.imod(o.imul(u))},G.prototype.mul=function(o,u){return this._verify2(o,u),this.imod(o.mul(u))},G.prototype.isqr=function(o){return this.imul(o,o.clone())},G.prototype.sqr=function(o){return this.mul(o,o)},G.prototype.sqrt=function(o){if(o.isZero())return o.clone();var u=this.m.andln(3);if(e(u%2===1),u===3){var f=this.m.add(new i(1)).iushrn(2);return this.pow(o,f)}for(var h=this.m.subn(1),l=0;!h.isZero()&&h.andln(1)===0;)l++,h.iushrn(1);e(!h.isZero());var w=new i(1).toRed(this),b=w.redNeg(),d=this.m.subn(1).iushrn(1),a=this.m.bitLength();for(a=new i(2*a*a).toRed(this);this.pow(a,d).cmp(b)!==0;)a.redIAdd(b);for(var g=this.pow(a,h),A=this.pow(o,h.addn(1).iushrn(1)),T=this.pow(o,h),P=l;T.cmp(w)!==0;){for(var F=T,V=0;F.cmp(w)!==0;V++)F=F.redSqr();e(V=0;l--){for(var g=u.words[l],A=a-1;A>=0;A--){var T=g>>A&1;if(w!==h[0]&&(w=this.sqr(w)),T===0&&b===0){d=0;continue}b<<=1,b|=T,d++,!(d!==f&&(l!==0||A!==0))&&(w=this.mul(w,h[b]),d=0,b=0)}a=26}return w},G.prototype.convertTo=function(o){var u=o.umod(this.m);return u===o?u.clone():u},G.prototype.convertFrom=function(o){var u=o.clone();return u.red=null,u},i.mont=function(o){return new st(o)};function st(m){G.call(this,m),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}r(st,G),st.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},st.prototype.convertFrom=function(o){var u=this.imod(o.mul(this.rinv));return u.red=null,u},st.prototype.imul=function(o,u){if(o.isZero()||u.isZero())return o.words[0]=0,o.length=1,o;var f=o.imul(u),h=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),l=f.isub(h).iushrn(this.shift),w=l;return l.cmp(this.m)>=0?w=l.isub(this.m):l.cmpn(0)<0&&(w=l.iadd(this.m)),w._forceRed(this)},st.prototype.mul=function(o,u){if(o.isZero()||u.isZero())return new i(0)._forceRed(this);var f=o.mul(u),h=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),l=f.isub(h).iushrn(this.shift),w=l;return l.cmp(this.m)>=0?w=l.isub(this.m):l.cmpn(0)<0&&(w=l.iadd(this.m)),w._forceRed(this)},st.prototype.invm=function(o){var u=this.imod(o._invmp(this.m).mul(this.r2));return u._forceRed(this)}})(typeof Fs>"u"||Fs,Wu)});var Gu=he((Ks,Vu)=>{var hg=C(z());var no=Ln(),Ze=no.Buffer;function $u(n,t){for(var e in n)t[e]=n[e]}Ze.from&&Ze.alloc&&Ze.allocUnsafe&&Ze.allocUnsafeSlow?Vu.exports=no:($u(no,Ks),Ks.Buffer=pn);function pn(n,t,e){return Ze(n,t,e)}pn.prototype=Object.create(Ze.prototype);$u(Ze,pn);pn.from=function(n,t,e){if(typeof n=="number")throw new TypeError("Argument must not be a number");return Ze(n,t,e)};pn.alloc=function(n,t,e){if(typeof n!="number")throw new TypeError("Argument must be a number");var r=Ze(n);return t!==void 0?typeof e=="string"?r.fill(t,e):r.fill(t):r.fill(0),r};pn.allocUnsafe=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return Ze(n)};pn.allocUnsafeSlow=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return no.SlowBuffer(n)}});var ju=he((lg,Zu)=>{"use strict";var dg=C(z()),io=Gu().Buffer;function Cl(n){if(n.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),e=0;e>>0,N=new Uint8Array(K);E!==U;){for(var D=B[E],rt=0,H=K-1;(D!==0||rt<_)&&H!==-1;H--,rt++)D+=256*N[H]>>>0,N[H]=D%c>>>0,D=D/c>>>0;if(D!==0)throw new Error("Non-zero carry");_=rt,E++}for(var J=K-_;J!==K&&N[J]===0;)J++;for(var nt=p.repeat(R);J>>0,K=new Uint8Array(U);R>>0,K[rt]=N%256>>>0,N=N/256>>>0;if(N!==0)throw new Error("Non-zero carry");E=D,R++}for(var H=U-E;H!==U&&K[H]===0;)H++;var J=io.allocUnsafe(_+(U-H));J.fill(0,0,_);for(var nt=_;H!==U;)J[nt++]=K[H++];return J}function I(B){var R=S(B);if(R)return R;throw new Error("Non-base"+c+" character")}return{encode:x,decodeUnsafe:S,decode:I}}Zu.exports=Cl});var Ds=he((pg,Yu)=>{var yg=C(z()),Ol=ju(),Ul="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";Yu.exports=Ol(Ul)});var bg,Nl,Sr,Br,Ws,pi,Hs=vt(()=>{bg=C(z(),1);ys();gr();Nl=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Sr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Br=new Uint32Array(64),Ws=class extends Pn{constructor(){super(64,32,8,!1),this.A=Sr[0]|0,this.B=Sr[1]|0,this.C=Sr[2]|0,this.D=Sr[3]|0,this.E=Sr[4]|0,this.F=Sr[5]|0,this.G=Sr[6]|0,this.H=Sr[7]|0}get(){let{A:t,B:e,C:r,D:i,E:s,F:c,G:p,H:y}=this;return[t,e,r,i,s,c,p,y]}set(t,e,r,i,s,c,p,y){this.A=t|0,this.B=e|0,this.C=r|0,this.D=i|0,this.E=s|0,this.F=c|0,this.G=p|0,this.H=y|0}process(t,e){for(let S=0;S<16;S++,e+=4)Br[S]=t.getUint32(e,!1);for(let S=16;S<64;S++){let I=Br[S-15],B=Br[S-2],R=qe(I,7)^qe(I,18)^I>>>3,_=qe(B,17)^qe(B,19)^B>>>10;Br[S]=_+Br[S-7]+R+Br[S-16]|0}let{A:r,B:i,C:s,D:c,E:p,F:y,G:v,H:x}=this;for(let S=0;S<64;S++){let I=qe(p,6)^qe(p,11)^qe(p,25),B=x+I+Su(p,y,v)+Nl[S]+Br[S]|0,_=(qe(r,2)^qe(r,13)^qe(r,22))+Bu(r,i,s)|0;x=v,v=y,y=p,p=c+B|0,c=s,s=i,i=r,r=B+_|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,c=c+this.D|0,p=p+this.E|0,y=y+this.F|0,v=v+this.G|0,x=x+this.H|0,this.set(r,i,s,c,p,y,v,x)}roundClean(){Br.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},pi=Tn(()=>new Ws)});var Xu=he((Ju,$s)=>{var vg=C(z());(function(n,t){"use strict";function e(m,o){if(!m)throw new Error(o||"Assertion failed")}function r(m,o){m.super_=o;var u=function(){};u.prototype=o.prototype,m.prototype=new u,m.prototype.constructor=m}function i(m,o,u){if(i.isBN(m))return m;this.negative=0,this.words=null,this.length=0,this.red=null,m!==null&&((o==="le"||o==="be")&&(u=o,o=10),this._init(m||0,o||10,u||"be"))}typeof n=="object"?n.exports=i:t.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=qs().Buffer}catch{}i.isBN=function(o){return o instanceof i?!0:o!==null&&typeof o=="object"&&o.constructor.wordSize===i.wordSize&&Array.isArray(o.words)},i.max=function(o,u){return o.cmp(u)>0?o:u},i.min=function(o,u){return o.cmp(u)<0?o:u},i.prototype._init=function(o,u,f){if(typeof o=="number")return this._initNumber(o,u,f);if(typeof o=="object")return this._initArray(o,u,f);u==="hex"&&(u=16),e(u===(u|0)&&u>=2&&u<=36),o=o.toString().replace(/\\s+/g,"");var h=0;o[0]==="-"&&(h++,this.negative=1),h=0;h-=3)w=o[h]|o[h-1]<<8|o[h-2]<<16,this.words[l]|=w<>>26-b&67108863,b+=24,b>=26&&(b-=26,l++);else if(f==="le")for(h=0,l=0;h>>26-b&67108863,b+=24,b>=26&&(b-=26,l++);return this._strip()};function c(m,o){var u=m.charCodeAt(o);if(u>=48&&u<=57)return u-48;if(u>=65&&u<=70)return u-55;if(u>=97&&u<=102)return u-87;e(!1,"Invalid character in "+m)}function p(m,o,u){var f=c(m,u);return u-1>=o&&(f|=c(m,u-1)<<4),f}i.prototype._parseHex=function(o,u,f){this.length=Math.ceil((o.length-u)/6),this.words=new Array(this.length);for(var h=0;h=u;h-=2)b=p(o,u,h)<=18?(l-=18,w+=1,this.words[w]|=b>>>26):l+=8;else{var d=o.length-u;for(h=d%2===0?u+1:u;h=18?(l-=18,w+=1,this.words[w]|=b>>>26):l+=8}this._strip()};function y(m,o,u,f){for(var h=0,l=0,w=Math.min(m.length,u),b=o;b=49?l=d-49+10:d>=17?l=d-17+10:l=d,e(d>=0&&l1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=x}catch{i.prototype.inspect=x}else i.prototype.inspect=x;function x(){return(this.red?""}var S=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],I=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],B=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(o,u){o=o||10,u=u|0||1;var f;if(o===16||o==="hex"){f="";for(var h=0,l=0,w=0;w>>24-h&16777215,h+=2,h>=26&&(h-=26,w--),l!==0||w!==this.length-1?f=S[6-d.length]+d+f:f=d+f}for(l!==0&&(f=l.toString(16)+f);f.length%u!==0;)f="0"+f;return this.negative!==0&&(f="-"+f),f}if(o===(o|0)&&o>=2&&o<=36){var a=I[o],g=B[o];f="";var A=this.clone();for(A.negative=0;!A.isZero();){var T=A.modrn(g).toString(o);A=A.idivn(g),A.isZero()?f=T+f:f=S[a-T.length]+T+f}for(this.isZero()&&(f="0"+f);f.length%u!==0;)f="0"+f;return this.negative!==0&&(f="-"+f),f}e(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var o=this.words[0];return this.length===2?o+=this.words[1]*67108864:this.length===3&&this.words[2]===1?o+=4503599627370496+this.words[1]*67108864:this.length>2&&e(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-o:o},i.prototype.toJSON=function(){return this.toString(16,2)},s&&(i.prototype.toBuffer=function(o,u){return this.toArrayLike(s,o,u)}),i.prototype.toArray=function(o,u){return this.toArrayLike(Array,o,u)};var R=function(o,u){return o.allocUnsafe?o.allocUnsafe(u):new o(u)};i.prototype.toArrayLike=function(o,u,f){this._strip();var h=this.byteLength(),l=f||Math.max(1,h);e(h<=l,"byte array longer than desired length"),e(l>0,"Requested array length <= 0");var w=R(o,l),b=u==="le"?"LE":"BE";return this["_toArrayLike"+b](w,h),w},i.prototype._toArrayLikeLE=function(o,u){for(var f=0,h=0,l=0,w=0;l>8&255),f>16&255),w===6?(f>24&255),h=0,w=0):(h=b>>>24,w+=2)}if(f=0&&(o[f--]=b>>8&255),f>=0&&(o[f--]=b>>16&255),w===6?(f>=0&&(o[f--]=b>>24&255),h=0,w=0):(h=b>>>24,w+=2)}if(f>=0)for(o[f--]=h;f>=0;)o[f--]=0},Math.clz32?i.prototype._countBits=function(o){return 32-Math.clz32(o)}:i.prototype._countBits=function(o){var u=o,f=0;return u>=4096&&(f+=13,u>>>=13),u>=64&&(f+=7,u>>>=7),u>=8&&(f+=4,u>>>=4),u>=2&&(f+=2,u>>>=2),f+u},i.prototype._zeroBits=function(o){if(o===0)return 26;var u=o,f=0;return u&8191||(f+=13,u>>>=13),u&127||(f+=7,u>>>=7),u&15||(f+=4,u>>>=4),u&3||(f+=2,u>>>=2),u&1||f++,f},i.prototype.bitLength=function(){var o=this.words[this.length-1],u=this._countBits(o);return(this.length-1)*26+u};function _(m){for(var o=new Array(m.bitLength()),u=0;u>>h&1}return o}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,u=0;uo.length?this.clone().ior(o):o.clone().ior(this)},i.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},i.prototype.iuand=function(o){var u;this.length>o.length?u=o:u=this;for(var f=0;fo.length?this.clone().iand(o):o.clone().iand(this)},i.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},i.prototype.iuxor=function(o){var u,f;this.length>o.length?(u=this,f=o):(u=o,f=this);for(var h=0;ho.length?this.clone().ixor(o):o.clone().ixor(this)},i.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},i.prototype.inotn=function(o){e(typeof o=="number"&&o>=0);var u=Math.ceil(o/26)|0,f=o%26;this._expand(u),f>0&&u--;for(var h=0;h0&&(this.words[h]=~this.words[h]&67108863>>26-f),this._strip()},i.prototype.notn=function(o){return this.clone().inotn(o)},i.prototype.setn=function(o,u){e(typeof o=="number"&&o>=0);var f=o/26|0,h=o%26;return this._expand(f+1),u?this.words[f]=this.words[f]|1<o.length?(f=this,h=o):(f=o,h=this);for(var l=0,w=0;w>>26;for(;l!==0&&w>>26;if(this.length=f.length,l!==0)this.words[this.length]=l,this.length++;else if(f!==this)for(;wo.length?this.clone().iadd(o):o.clone().iadd(this)},i.prototype.isub=function(o){if(o.negative!==0){o.negative=0;var u=this.iadd(o);return o.negative=1,u._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var f=this.cmp(o);if(f===0)return this.negative=0,this.length=1,this.words[0]=0,this;var h,l;f>0?(h=this,l=o):(h=o,l=this);for(var w=0,b=0;b>26,this.words[b]=u&67108863;for(;w!==0&&b>26,this.words[b]=u&67108863;if(w===0&&b>>26,A=d&67108863,T=Math.min(a,o.length-1),P=Math.max(0,a-m.length+1);P<=T;P++){var F=a-P|0;h=m.words[F]|0,l=o.words[P]|0,w=h*l+A,g+=w/67108864|0,A=w&67108863}u.words[a]=A|0,d=g|0}return d!==0?u.words[a]=d|0:u.length--,u._strip()}var U=function(o,u,f){var h=o.words,l=u.words,w=f.words,b=0,d,a,g,A=h[0]|0,T=A&8191,P=A>>>13,F=h[1]|0,V=F&8191,Y=F>>>13,Gt=h[2]|0,X=Gt&8191,Q=Gt>>>13,we=h[3]|0,at=we&8191,ct=we>>>13,Cr=h[4]|0,gt=Cr&8191,mt=Cr>>>13,Or=h[5]|0,ft=Or&8191,ht=Or>>>13,Je=h[6]|0,lt=Je&8191,dt=Je>>>13,hr=h[7]|0,pt=hr&8191,yt=hr>>>13,Ur=h[8]|0,wt=Ur&8191,bt=Ur>>>13,Nr=h[9]|0,xt=Nr&8191,kt=Nr>>>13,Xn=l[0]|0,St=Xn&8191,Bt=Xn>>>13,Qn=l[1]|0,Et=Qn&8191,It=Qn>>>13,ti=l[2]|0,_t=ti&8191,At=ti>>>13,ei=l[3]|0,Mt=ei&8191,Lt=ei>>>13,ri=l[4]|0,Rt=ri&8191,Tt=ri>>>13,ni=l[5]|0,Pt=ni&8191,Ct=ni>>>13,ii=l[6]|0,Ot=ii&8191,Ut=ii>>>13,oi=l[7]|0,Nt=oi&8191,zt=oi>>>13,si=l[8]|0,qt=si&8191,Ft=si>>>13,ai=l[9]|0,Kt=ai&8191,Dt=ai>>>13;f.negative=o.negative^u.negative,f.length=19,d=Math.imul(T,St),a=Math.imul(T,Bt),a=a+Math.imul(P,St)|0,g=Math.imul(P,Bt);var zr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(zr>>>26)|0,zr&=67108863,d=Math.imul(V,St),a=Math.imul(V,Bt),a=a+Math.imul(Y,St)|0,g=Math.imul(Y,Bt),d=d+Math.imul(T,Et)|0,a=a+Math.imul(T,It)|0,a=a+Math.imul(P,Et)|0,g=g+Math.imul(P,It)|0;var qr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(qr>>>26)|0,qr&=67108863,d=Math.imul(X,St),a=Math.imul(X,Bt),a=a+Math.imul(Q,St)|0,g=Math.imul(Q,Bt),d=d+Math.imul(V,Et)|0,a=a+Math.imul(V,It)|0,a=a+Math.imul(Y,Et)|0,g=g+Math.imul(Y,It)|0,d=d+Math.imul(T,_t)|0,a=a+Math.imul(T,At)|0,a=a+Math.imul(P,_t)|0,g=g+Math.imul(P,At)|0;var Fr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,d=Math.imul(at,St),a=Math.imul(at,Bt),a=a+Math.imul(ct,St)|0,g=Math.imul(ct,Bt),d=d+Math.imul(X,Et)|0,a=a+Math.imul(X,It)|0,a=a+Math.imul(Q,Et)|0,g=g+Math.imul(Q,It)|0,d=d+Math.imul(V,_t)|0,a=a+Math.imul(V,At)|0,a=a+Math.imul(Y,_t)|0,g=g+Math.imul(Y,At)|0,d=d+Math.imul(T,Mt)|0,a=a+Math.imul(T,Lt)|0,a=a+Math.imul(P,Mt)|0,g=g+Math.imul(P,Lt)|0;var Kr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Kr>>>26)|0,Kr&=67108863,d=Math.imul(gt,St),a=Math.imul(gt,Bt),a=a+Math.imul(mt,St)|0,g=Math.imul(mt,Bt),d=d+Math.imul(at,Et)|0,a=a+Math.imul(at,It)|0,a=a+Math.imul(ct,Et)|0,g=g+Math.imul(ct,It)|0,d=d+Math.imul(X,_t)|0,a=a+Math.imul(X,At)|0,a=a+Math.imul(Q,_t)|0,g=g+Math.imul(Q,At)|0,d=d+Math.imul(V,Mt)|0,a=a+Math.imul(V,Lt)|0,a=a+Math.imul(Y,Mt)|0,g=g+Math.imul(Y,Lt)|0,d=d+Math.imul(T,Rt)|0,a=a+Math.imul(T,Tt)|0,a=a+Math.imul(P,Rt)|0,g=g+Math.imul(P,Tt)|0;var Dr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,d=Math.imul(ft,St),a=Math.imul(ft,Bt),a=a+Math.imul(ht,St)|0,g=Math.imul(ht,Bt),d=d+Math.imul(gt,Et)|0,a=a+Math.imul(gt,It)|0,a=a+Math.imul(mt,Et)|0,g=g+Math.imul(mt,It)|0,d=d+Math.imul(at,_t)|0,a=a+Math.imul(at,At)|0,a=a+Math.imul(ct,_t)|0,g=g+Math.imul(ct,At)|0,d=d+Math.imul(X,Mt)|0,a=a+Math.imul(X,Lt)|0,a=a+Math.imul(Q,Mt)|0,g=g+Math.imul(Q,Lt)|0,d=d+Math.imul(V,Rt)|0,a=a+Math.imul(V,Tt)|0,a=a+Math.imul(Y,Rt)|0,g=g+Math.imul(Y,Tt)|0,d=d+Math.imul(T,Pt)|0,a=a+Math.imul(T,Ct)|0,a=a+Math.imul(P,Pt)|0,g=g+Math.imul(P,Ct)|0;var Wr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Wr>>>26)|0,Wr&=67108863,d=Math.imul(lt,St),a=Math.imul(lt,Bt),a=a+Math.imul(dt,St)|0,g=Math.imul(dt,Bt),d=d+Math.imul(ft,Et)|0,a=a+Math.imul(ft,It)|0,a=a+Math.imul(ht,Et)|0,g=g+Math.imul(ht,It)|0,d=d+Math.imul(gt,_t)|0,a=a+Math.imul(gt,At)|0,a=a+Math.imul(mt,_t)|0,g=g+Math.imul(mt,At)|0,d=d+Math.imul(at,Mt)|0,a=a+Math.imul(at,Lt)|0,a=a+Math.imul(ct,Mt)|0,g=g+Math.imul(ct,Lt)|0,d=d+Math.imul(X,Rt)|0,a=a+Math.imul(X,Tt)|0,a=a+Math.imul(Q,Rt)|0,g=g+Math.imul(Q,Tt)|0,d=d+Math.imul(V,Pt)|0,a=a+Math.imul(V,Ct)|0,a=a+Math.imul(Y,Pt)|0,g=g+Math.imul(Y,Ct)|0,d=d+Math.imul(T,Ot)|0,a=a+Math.imul(T,Ut)|0,a=a+Math.imul(P,Ot)|0,g=g+Math.imul(P,Ut)|0;var Hr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,d=Math.imul(pt,St),a=Math.imul(pt,Bt),a=a+Math.imul(yt,St)|0,g=Math.imul(yt,Bt),d=d+Math.imul(lt,Et)|0,a=a+Math.imul(lt,It)|0,a=a+Math.imul(dt,Et)|0,g=g+Math.imul(dt,It)|0,d=d+Math.imul(ft,_t)|0,a=a+Math.imul(ft,At)|0,a=a+Math.imul(ht,_t)|0,g=g+Math.imul(ht,At)|0,d=d+Math.imul(gt,Mt)|0,a=a+Math.imul(gt,Lt)|0,a=a+Math.imul(mt,Mt)|0,g=g+Math.imul(mt,Lt)|0,d=d+Math.imul(at,Rt)|0,a=a+Math.imul(at,Tt)|0,a=a+Math.imul(ct,Rt)|0,g=g+Math.imul(ct,Tt)|0,d=d+Math.imul(X,Pt)|0,a=a+Math.imul(X,Ct)|0,a=a+Math.imul(Q,Pt)|0,g=g+Math.imul(Q,Ct)|0,d=d+Math.imul(V,Ot)|0,a=a+Math.imul(V,Ut)|0,a=a+Math.imul(Y,Ot)|0,g=g+Math.imul(Y,Ut)|0,d=d+Math.imul(T,Nt)|0,a=a+Math.imul(T,zt)|0,a=a+Math.imul(P,Nt)|0,g=g+Math.imul(P,zt)|0;var $r=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+($r>>>26)|0,$r&=67108863,d=Math.imul(wt,St),a=Math.imul(wt,Bt),a=a+Math.imul(bt,St)|0,g=Math.imul(bt,Bt),d=d+Math.imul(pt,Et)|0,a=a+Math.imul(pt,It)|0,a=a+Math.imul(yt,Et)|0,g=g+Math.imul(yt,It)|0,d=d+Math.imul(lt,_t)|0,a=a+Math.imul(lt,At)|0,a=a+Math.imul(dt,_t)|0,g=g+Math.imul(dt,At)|0,d=d+Math.imul(ft,Mt)|0,a=a+Math.imul(ft,Lt)|0,a=a+Math.imul(ht,Mt)|0,g=g+Math.imul(ht,Lt)|0,d=d+Math.imul(gt,Rt)|0,a=a+Math.imul(gt,Tt)|0,a=a+Math.imul(mt,Rt)|0,g=g+Math.imul(mt,Tt)|0,d=d+Math.imul(at,Pt)|0,a=a+Math.imul(at,Ct)|0,a=a+Math.imul(ct,Pt)|0,g=g+Math.imul(ct,Ct)|0,d=d+Math.imul(X,Ot)|0,a=a+Math.imul(X,Ut)|0,a=a+Math.imul(Q,Ot)|0,g=g+Math.imul(Q,Ut)|0,d=d+Math.imul(V,Nt)|0,a=a+Math.imul(V,zt)|0,a=a+Math.imul(Y,Nt)|0,g=g+Math.imul(Y,zt)|0,d=d+Math.imul(T,qt)|0,a=a+Math.imul(T,Ft)|0,a=a+Math.imul(P,qt)|0,g=g+Math.imul(P,Ft)|0;var Vr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,d=Math.imul(xt,St),a=Math.imul(xt,Bt),a=a+Math.imul(kt,St)|0,g=Math.imul(kt,Bt),d=d+Math.imul(wt,Et)|0,a=a+Math.imul(wt,It)|0,a=a+Math.imul(bt,Et)|0,g=g+Math.imul(bt,It)|0,d=d+Math.imul(pt,_t)|0,a=a+Math.imul(pt,At)|0,a=a+Math.imul(yt,_t)|0,g=g+Math.imul(yt,At)|0,d=d+Math.imul(lt,Mt)|0,a=a+Math.imul(lt,Lt)|0,a=a+Math.imul(dt,Mt)|0,g=g+Math.imul(dt,Lt)|0,d=d+Math.imul(ft,Rt)|0,a=a+Math.imul(ft,Tt)|0,a=a+Math.imul(ht,Rt)|0,g=g+Math.imul(ht,Tt)|0,d=d+Math.imul(gt,Pt)|0,a=a+Math.imul(gt,Ct)|0,a=a+Math.imul(mt,Pt)|0,g=g+Math.imul(mt,Ct)|0,d=d+Math.imul(at,Ot)|0,a=a+Math.imul(at,Ut)|0,a=a+Math.imul(ct,Ot)|0,g=g+Math.imul(ct,Ut)|0,d=d+Math.imul(X,Nt)|0,a=a+Math.imul(X,zt)|0,a=a+Math.imul(Q,Nt)|0,g=g+Math.imul(Q,zt)|0,d=d+Math.imul(V,qt)|0,a=a+Math.imul(V,Ft)|0,a=a+Math.imul(Y,qt)|0,g=g+Math.imul(Y,Ft)|0,d=d+Math.imul(T,Kt)|0,a=a+Math.imul(T,Dt)|0,a=a+Math.imul(P,Kt)|0,g=g+Math.imul(P,Dt)|0;var Gr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Gr>>>26)|0,Gr&=67108863,d=Math.imul(xt,Et),a=Math.imul(xt,It),a=a+Math.imul(kt,Et)|0,g=Math.imul(kt,It),d=d+Math.imul(wt,_t)|0,a=a+Math.imul(wt,At)|0,a=a+Math.imul(bt,_t)|0,g=g+Math.imul(bt,At)|0,d=d+Math.imul(pt,Mt)|0,a=a+Math.imul(pt,Lt)|0,a=a+Math.imul(yt,Mt)|0,g=g+Math.imul(yt,Lt)|0,d=d+Math.imul(lt,Rt)|0,a=a+Math.imul(lt,Tt)|0,a=a+Math.imul(dt,Rt)|0,g=g+Math.imul(dt,Tt)|0,d=d+Math.imul(ft,Pt)|0,a=a+Math.imul(ft,Ct)|0,a=a+Math.imul(ht,Pt)|0,g=g+Math.imul(ht,Ct)|0,d=d+Math.imul(gt,Ot)|0,a=a+Math.imul(gt,Ut)|0,a=a+Math.imul(mt,Ot)|0,g=g+Math.imul(mt,Ut)|0,d=d+Math.imul(at,Nt)|0,a=a+Math.imul(at,zt)|0,a=a+Math.imul(ct,Nt)|0,g=g+Math.imul(ct,zt)|0,d=d+Math.imul(X,qt)|0,a=a+Math.imul(X,Ft)|0,a=a+Math.imul(Q,qt)|0,g=g+Math.imul(Q,Ft)|0,d=d+Math.imul(V,Kt)|0,a=a+Math.imul(V,Dt)|0,a=a+Math.imul(Y,Kt)|0,g=g+Math.imul(Y,Dt)|0;var Zr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,d=Math.imul(xt,_t),a=Math.imul(xt,At),a=a+Math.imul(kt,_t)|0,g=Math.imul(kt,At),d=d+Math.imul(wt,Mt)|0,a=a+Math.imul(wt,Lt)|0,a=a+Math.imul(bt,Mt)|0,g=g+Math.imul(bt,Lt)|0,d=d+Math.imul(pt,Rt)|0,a=a+Math.imul(pt,Tt)|0,a=a+Math.imul(yt,Rt)|0,g=g+Math.imul(yt,Tt)|0,d=d+Math.imul(lt,Pt)|0,a=a+Math.imul(lt,Ct)|0,a=a+Math.imul(dt,Pt)|0,g=g+Math.imul(dt,Ct)|0,d=d+Math.imul(ft,Ot)|0,a=a+Math.imul(ft,Ut)|0,a=a+Math.imul(ht,Ot)|0,g=g+Math.imul(ht,Ut)|0,d=d+Math.imul(gt,Nt)|0,a=a+Math.imul(gt,zt)|0,a=a+Math.imul(mt,Nt)|0,g=g+Math.imul(mt,zt)|0,d=d+Math.imul(at,qt)|0,a=a+Math.imul(at,Ft)|0,a=a+Math.imul(ct,qt)|0,g=g+Math.imul(ct,Ft)|0,d=d+Math.imul(X,Kt)|0,a=a+Math.imul(X,Dt)|0,a=a+Math.imul(Q,Kt)|0,g=g+Math.imul(Q,Dt)|0;var jr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(jr>>>26)|0,jr&=67108863,d=Math.imul(xt,Mt),a=Math.imul(xt,Lt),a=a+Math.imul(kt,Mt)|0,g=Math.imul(kt,Lt),d=d+Math.imul(wt,Rt)|0,a=a+Math.imul(wt,Tt)|0,a=a+Math.imul(bt,Rt)|0,g=g+Math.imul(bt,Tt)|0,d=d+Math.imul(pt,Pt)|0,a=a+Math.imul(pt,Ct)|0,a=a+Math.imul(yt,Pt)|0,g=g+Math.imul(yt,Ct)|0,d=d+Math.imul(lt,Ot)|0,a=a+Math.imul(lt,Ut)|0,a=a+Math.imul(dt,Ot)|0,g=g+Math.imul(dt,Ut)|0,d=d+Math.imul(ft,Nt)|0,a=a+Math.imul(ft,zt)|0,a=a+Math.imul(ht,Nt)|0,g=g+Math.imul(ht,zt)|0,d=d+Math.imul(gt,qt)|0,a=a+Math.imul(gt,Ft)|0,a=a+Math.imul(mt,qt)|0,g=g+Math.imul(mt,Ft)|0,d=d+Math.imul(at,Kt)|0,a=a+Math.imul(at,Dt)|0,a=a+Math.imul(ct,Kt)|0,g=g+Math.imul(ct,Dt)|0;var Yr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Yr>>>26)|0,Yr&=67108863,d=Math.imul(xt,Rt),a=Math.imul(xt,Tt),a=a+Math.imul(kt,Rt)|0,g=Math.imul(kt,Tt),d=d+Math.imul(wt,Pt)|0,a=a+Math.imul(wt,Ct)|0,a=a+Math.imul(bt,Pt)|0,g=g+Math.imul(bt,Ct)|0,d=d+Math.imul(pt,Ot)|0,a=a+Math.imul(pt,Ut)|0,a=a+Math.imul(yt,Ot)|0,g=g+Math.imul(yt,Ut)|0,d=d+Math.imul(lt,Nt)|0,a=a+Math.imul(lt,zt)|0,a=a+Math.imul(dt,Nt)|0,g=g+Math.imul(dt,zt)|0,d=d+Math.imul(ft,qt)|0,a=a+Math.imul(ft,Ft)|0,a=a+Math.imul(ht,qt)|0,g=g+Math.imul(ht,Ft)|0,d=d+Math.imul(gt,Kt)|0,a=a+Math.imul(gt,Dt)|0,a=a+Math.imul(mt,Kt)|0,g=g+Math.imul(mt,Dt)|0;var Jr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,d=Math.imul(xt,Pt),a=Math.imul(xt,Ct),a=a+Math.imul(kt,Pt)|0,g=Math.imul(kt,Ct),d=d+Math.imul(wt,Ot)|0,a=a+Math.imul(wt,Ut)|0,a=a+Math.imul(bt,Ot)|0,g=g+Math.imul(bt,Ut)|0,d=d+Math.imul(pt,Nt)|0,a=a+Math.imul(pt,zt)|0,a=a+Math.imul(yt,Nt)|0,g=g+Math.imul(yt,zt)|0,d=d+Math.imul(lt,qt)|0,a=a+Math.imul(lt,Ft)|0,a=a+Math.imul(dt,qt)|0,g=g+Math.imul(dt,Ft)|0,d=d+Math.imul(ft,Kt)|0,a=a+Math.imul(ft,Dt)|0,a=a+Math.imul(ht,Kt)|0,g=g+Math.imul(ht,Dt)|0;var Xr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,d=Math.imul(xt,Ot),a=Math.imul(xt,Ut),a=a+Math.imul(kt,Ot)|0,g=Math.imul(kt,Ut),d=d+Math.imul(wt,Nt)|0,a=a+Math.imul(wt,zt)|0,a=a+Math.imul(bt,Nt)|0,g=g+Math.imul(bt,zt)|0,d=d+Math.imul(pt,qt)|0,a=a+Math.imul(pt,Ft)|0,a=a+Math.imul(yt,qt)|0,g=g+Math.imul(yt,Ft)|0,d=d+Math.imul(lt,Kt)|0,a=a+Math.imul(lt,Dt)|0,a=a+Math.imul(dt,Kt)|0,g=g+Math.imul(dt,Dt)|0;var Qr=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,d=Math.imul(xt,Nt),a=Math.imul(xt,zt),a=a+Math.imul(kt,Nt)|0,g=Math.imul(kt,zt),d=d+Math.imul(wt,qt)|0,a=a+Math.imul(wt,Ft)|0,a=a+Math.imul(bt,qt)|0,g=g+Math.imul(bt,Ft)|0,d=d+Math.imul(pt,Kt)|0,a=a+Math.imul(pt,Dt)|0,a=a+Math.imul(yt,Kt)|0,g=g+Math.imul(yt,Dt)|0;var tn=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(tn>>>26)|0,tn&=67108863,d=Math.imul(xt,qt),a=Math.imul(xt,Ft),a=a+Math.imul(kt,qt)|0,g=Math.imul(kt,Ft),d=d+Math.imul(wt,Kt)|0,a=a+Math.imul(wt,Dt)|0,a=a+Math.imul(bt,Kt)|0,g=g+Math.imul(bt,Dt)|0;var en=(b+d|0)+((a&8191)<<13)|0;b=(g+(a>>>13)|0)+(en>>>26)|0,en&=67108863,d=Math.imul(xt,Kt),a=Math.imul(xt,Dt),a=a+Math.imul(kt,Kt)|0,g=Math.imul(kt,Dt);var rn=(b+d|0)+((a&8191)<<13)|0;return b=(g+(a>>>13)|0)+(rn>>>26)|0,rn&=67108863,w[0]=zr,w[1]=qr,w[2]=Fr,w[3]=Kr,w[4]=Dr,w[5]=Wr,w[6]=Hr,w[7]=$r,w[8]=Vr,w[9]=Gr,w[10]=Zr,w[11]=jr,w[12]=Yr,w[13]=Jr,w[14]=Xr,w[15]=Qr,w[16]=tn,w[17]=en,w[18]=rn,b!==0&&(w[19]=b,f.length++),f};Math.imul||(U=E);function K(m,o,u){u.negative=o.negative^m.negative,u.length=m.length+o.length;for(var f=0,h=0,l=0;l>>26)|0,h+=w>>>26,w&=67108863}u.words[l]=b,f=w,w=h}return f!==0?u.words[l]=f:u.length--,u._strip()}function N(m,o,u){return K(m,o,u)}i.prototype.mulTo=function(o,u){var f,h=this.length+o.length;return this.length===10&&o.length===10?f=U(this,o,u):h<63?f=E(this,o,u):h<1024?f=K(this,o,u):f=N(this,o,u),f};function D(m,o){this.x=m,this.y=o}D.prototype.makeRBT=function(o){for(var u=new Array(o),f=i.prototype._countBits(o)-1,h=0;h>=1;return h},D.prototype.permute=function(o,u,f,h,l,w){for(var b=0;b>>1)l++;return 1<>>13,f[2*w+1]=l&8191,l=l>>>13;for(w=2*u;w>=26,f+=l/67108864|0,f+=w>>>26,this.words[h]=w&67108863}return f!==0&&(this.words[h]=f,this.length++),u?this.ineg():this},i.prototype.muln=function(o){return this.clone().imuln(o)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(o){var u=_(o);if(u.length===0)return new i(1);for(var f=this,h=0;h=0);var u=o%26,f=(o-u)/26,h=67108863>>>26-u<<26-u,l;if(u!==0){var w=0;for(l=0;l>>26-u}w&&(this.words[l]=w,this.length++)}if(f!==0){for(l=this.length-1;l>=0;l--)this.words[l+f]=this.words[l];for(l=0;l=0);var h;u?h=(u-u%26)/26:h=0;var l=o%26,w=Math.min((o-l)/26,this.length),b=67108863^67108863>>>l<w)for(this.length-=w,a=0;a=0&&(g!==0||a>=h);a--){var A=this.words[a]|0;this.words[a]=g<<26-l|A>>>l,g=A&b}return d&&g!==0&&(d.words[d.length++]=g),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(o,u,f){return e(this.negative===0),this.iushrn(o,u,f)},i.prototype.shln=function(o){return this.clone().ishln(o)},i.prototype.ushln=function(o){return this.clone().iushln(o)},i.prototype.shrn=function(o){return this.clone().ishrn(o)},i.prototype.ushrn=function(o){return this.clone().iushrn(o)},i.prototype.testn=function(o){e(typeof o=="number"&&o>=0);var u=o%26,f=(o-u)/26,h=1<=0);var u=o%26,f=(o-u)/26;if(e(this.negative===0,"imaskn works only with positive numbers"),this.length<=f)return this;if(u!==0&&f++,this.length=Math.min(f,this.length),u!==0){var h=67108863^67108863>>>u<=67108864;u++)this.words[u]-=67108864,u===this.length-1?this.words[u+1]=1:this.words[u+1]++;return this.length=Math.max(this.length,u+1),this},i.prototype.isubn=function(o){if(e(typeof o=="number"),e(o<67108864),o<0)return this.iaddn(-o);if(this.negative!==0)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var u=0;u>26)-(d/67108864|0),this.words[l+f]=w&67108863}for(;l>26,this.words[l+f]=w&67108863;if(b===0)return this._strip();for(e(b===-1),b=0,l=0;l>26,this.words[l]=w&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(o,u){var f=this.length-o.length,h=this.clone(),l=o,w=l.words[l.length-1]|0,b=this._countBits(w);f=26-b,f!==0&&(l=l.ushln(f),h.iushln(f),w=l.words[l.length-1]|0);var d=h.length-l.length,a;if(u!=="mod"){a=new i(null),a.length=d+1,a.words=new Array(a.length);for(var g=0;g=0;T--){var P=(h.words[l.length+T]|0)*67108864+(h.words[l.length+T-1]|0);for(P=Math.min(P/w|0,67108863),h._ishlnsubmul(l,P,T);h.negative!==0;)P--,h.negative=0,h._ishlnsubmul(l,1,T),h.isZero()||(h.negative^=1);a&&(a.words[T]=P)}return a&&a._strip(),h._strip(),u!=="div"&&f!==0&&h.iushrn(f),{div:a||null,mod:h}},i.prototype.divmod=function(o,u,f){if(e(!o.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var h,l,w;return this.negative!==0&&o.negative===0?(w=this.neg().divmod(o,u),u!=="mod"&&(h=w.div.neg()),u!=="div"&&(l=w.mod.neg(),f&&l.negative!==0&&l.iadd(o)),{div:h,mod:l}):this.negative===0&&o.negative!==0?(w=this.divmod(o.neg(),u),u!=="mod"&&(h=w.div.neg()),{div:h,mod:w.mod}):this.negative&o.negative?(w=this.neg().divmod(o.neg(),u),u!=="div"&&(l=w.mod.neg(),f&&l.negative!==0&&l.isub(o)),{div:w.div,mod:l}):o.length>this.length||this.cmp(o)<0?{div:new i(0),mod:this}:o.length===1?u==="div"?{div:this.divn(o.words[0]),mod:null}:u==="mod"?{div:null,mod:new i(this.modrn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new i(this.modrn(o.words[0]))}:this._wordDiv(o,u)},i.prototype.div=function(o){return this.divmod(o,"div",!1).div},i.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},i.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},i.prototype.divRound=function(o){var u=this.divmod(o);if(u.mod.isZero())return u.div;var f=u.div.negative!==0?u.mod.isub(o):u.mod,h=o.ushrn(1),l=o.andln(1),w=f.cmp(h);return w<0||l===1&&w===0?u.div:u.div.negative!==0?u.div.isubn(1):u.div.iaddn(1)},i.prototype.modrn=function(o){var u=o<0;u&&(o=-o),e(o<=67108863);for(var f=(1<<26)%o,h=0,l=this.length-1;l>=0;l--)h=(f*h+(this.words[l]|0))%o;return u?-h:h},i.prototype.modn=function(o){return this.modrn(o)},i.prototype.idivn=function(o){var u=o<0;u&&(o=-o),e(o<=67108863);for(var f=0,h=this.length-1;h>=0;h--){var l=(this.words[h]|0)+f*67108864;this.words[h]=l/o|0,f=l%o}return this._strip(),u?this.ineg():this},i.prototype.divn=function(o){return this.clone().idivn(o)},i.prototype.egcd=function(o){e(o.negative===0),e(!o.isZero());var u=this,f=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var h=new i(1),l=new i(0),w=new i(0),b=new i(1),d=0;u.isEven()&&f.isEven();)u.iushrn(1),f.iushrn(1),++d;for(var a=f.clone(),g=u.clone();!u.isZero();){for(var A=0,T=1;!(u.words[0]&T)&&A<26;++A,T<<=1);if(A>0)for(u.iushrn(A);A-- >0;)(h.isOdd()||l.isOdd())&&(h.iadd(a),l.isub(g)),h.iushrn(1),l.iushrn(1);for(var P=0,F=1;!(f.words[0]&F)&&P<26;++P,F<<=1);if(P>0)for(f.iushrn(P);P-- >0;)(w.isOdd()||b.isOdd())&&(w.iadd(a),b.isub(g)),w.iushrn(1),b.iushrn(1);u.cmp(f)>=0?(u.isub(f),h.isub(w),l.isub(b)):(f.isub(u),w.isub(h),b.isub(l))}return{a:w,b,gcd:f.iushln(d)}},i.prototype._invmp=function(o){e(o.negative===0),e(!o.isZero());var u=this,f=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var h=new i(1),l=new i(0),w=f.clone();u.cmpn(1)>0&&f.cmpn(1)>0;){for(var b=0,d=1;!(u.words[0]&d)&&b<26;++b,d<<=1);if(b>0)for(u.iushrn(b);b-- >0;)h.isOdd()&&h.iadd(w),h.iushrn(1);for(var a=0,g=1;!(f.words[0]&g)&&a<26;++a,g<<=1);if(a>0)for(f.iushrn(a);a-- >0;)l.isOdd()&&l.iadd(w),l.iushrn(1);u.cmp(f)>=0?(u.isub(f),h.isub(l)):(f.isub(u),l.isub(h))}var A;return u.cmpn(1)===0?A=h:A=l,A.cmpn(0)<0&&A.iadd(o),A},i.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var u=this.clone(),f=o.clone();u.negative=0,f.negative=0;for(var h=0;u.isEven()&&f.isEven();h++)u.iushrn(1),f.iushrn(1);do{for(;u.isEven();)u.iushrn(1);for(;f.isEven();)f.iushrn(1);var l=u.cmp(f);if(l<0){var w=u;u=f,f=w}else if(l===0||f.cmpn(1)===0)break;u.isub(f)}while(!0);return f.iushln(h)},i.prototype.invm=function(o){return this.egcd(o).a.umod(o)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(o){return this.words[0]&o},i.prototype.bincn=function(o){e(typeof o=="number");var u=o%26,f=(o-u)/26,h=1<>>26,b&=67108863,this.words[w]=b}return l!==0&&(this.words[w]=l,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(o){var u=o<0;if(this.negative!==0&&!u)return-1;if(this.negative===0&&u)return 1;this._strip();var f;if(this.length>1)f=1;else{u&&(o=-o),e(o<=67108863,"Number is too big");var h=this.words[0]|0;f=h===o?0:ho.length)return 1;if(this.length=0;f--){var h=this.words[f]|0,l=o.words[f]|0;if(h!==l){hl&&(u=1);break}}return u},i.prototype.gtn=function(o){return this.cmpn(o)===1},i.prototype.gt=function(o){return this.cmp(o)===1},i.prototype.gten=function(o){return this.cmpn(o)>=0},i.prototype.gte=function(o){return this.cmp(o)>=0},i.prototype.ltn=function(o){return this.cmpn(o)===-1},i.prototype.lt=function(o){return this.cmp(o)===-1},i.prototype.lten=function(o){return this.cmpn(o)<=0},i.prototype.lte=function(o){return this.cmp(o)<=0},i.prototype.eqn=function(o){return this.cmpn(o)===0},i.prototype.eq=function(o){return this.cmp(o)===0},i.red=function(o){return new G(o)},i.prototype.toRed=function(o){return e(!this.red,"Already a number in reduction context"),e(this.negative===0,"red works only with positives"),o.convertTo(this)._forceRed(o)},i.prototype.fromRed=function(){return e(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(o){return this.red=o,this},i.prototype.forceRed=function(o){return e(!this.red,"Already a number in reduction context"),this._forceRed(o)},i.prototype.redAdd=function(o){return e(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},i.prototype.redIAdd=function(o){return e(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},i.prototype.redSub=function(o){return e(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},i.prototype.redISub=function(o){return e(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},i.prototype.redShl=function(o){return e(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},i.prototype.redMul=function(o){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},i.prototype.redIMul=function(o){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},i.prototype.redSqr=function(){return e(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return e(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return e(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return e(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return e(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(o){return e(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var rt={k256:null,p224:null,p192:null,p25519:null};function H(m,o){this.name=m,this.p=new i(o,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var o=new i(null);return o.words=new Array(Math.ceil(this.n/13)),o},H.prototype.ireduce=function(o){var u=o,f;do this.split(u,this.tmp),u=this.imulK(u),u=u.iadd(this.tmp),f=u.bitLength();while(f>this.n);var h=f0?u.isub(this.p):u.strip!==void 0?u.strip():u._strip(),u},H.prototype.split=function(o,u){o.iushrn(this.n,0,u)},H.prototype.imulK=function(o){return o.imul(this.k)};function J(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}r(J,H),J.prototype.split=function(o,u){for(var f=4194303,h=Math.min(o.length,9),l=0;l>>22,w=b}w>>>=22,o.words[l-10]=w,w===0&&o.length>10?o.length-=10:o.length-=9},J.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var u=0,f=0;f>>=26,o.words[f]=l,u=h}return u!==0&&(o.words[o.length++]=u),o},i._prime=function(o){if(rt[o])return rt[o];var u;if(o==="k256")u=new J;else if(o==="p224")u=new nt;else if(o==="p192")u=new tt;else if(o==="p25519")u=new Yt;else throw new Error("Unknown prime "+o);return rt[o]=u,u};function G(m){if(typeof m=="string"){var o=i._prime(m);this.m=o.p,this.prime=o}else e(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}G.prototype._verify1=function(o){e(o.negative===0,"red works only with positives"),e(o.red,"red works only with red numbers")},G.prototype._verify2=function(o,u){e((o.negative|u.negative)===0,"red works only with positives"),e(o.red&&o.red===u.red,"red works only with red numbers")},G.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(v(o,o.umod(this.m)._forceRed(this)),o)},G.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},G.prototype.add=function(o,u){this._verify2(o,u);var f=o.add(u);return f.cmp(this.m)>=0&&f.isub(this.m),f._forceRed(this)},G.prototype.iadd=function(o,u){this._verify2(o,u);var f=o.iadd(u);return f.cmp(this.m)>=0&&f.isub(this.m),f},G.prototype.sub=function(o,u){this._verify2(o,u);var f=o.sub(u);return f.cmpn(0)<0&&f.iadd(this.m),f._forceRed(this)},G.prototype.isub=function(o,u){this._verify2(o,u);var f=o.isub(u);return f.cmpn(0)<0&&f.iadd(this.m),f},G.prototype.shl=function(o,u){return this._verify1(o),this.imod(o.ushln(u))},G.prototype.imul=function(o,u){return this._verify2(o,u),this.imod(o.imul(u))},G.prototype.mul=function(o,u){return this._verify2(o,u),this.imod(o.mul(u))},G.prototype.isqr=function(o){return this.imul(o,o.clone())},G.prototype.sqr=function(o){return this.mul(o,o)},G.prototype.sqrt=function(o){if(o.isZero())return o.clone();var u=this.m.andln(3);if(e(u%2===1),u===3){var f=this.m.add(new i(1)).iushrn(2);return this.pow(o,f)}for(var h=this.m.subn(1),l=0;!h.isZero()&&h.andln(1)===0;)l++,h.iushrn(1);e(!h.isZero());var w=new i(1).toRed(this),b=w.redNeg(),d=this.m.subn(1).iushrn(1),a=this.m.bitLength();for(a=new i(2*a*a).toRed(this);this.pow(a,d).cmp(b)!==0;)a.redIAdd(b);for(var g=this.pow(a,h),A=this.pow(o,h.addn(1).iushrn(1)),T=this.pow(o,h),P=l;T.cmp(w)!==0;){for(var F=T,V=0;F.cmp(w)!==0;V++)F=F.redSqr();e(V=0;l--){for(var g=u.words[l],A=a-1;A>=0;A--){var T=g>>A&1;if(w!==h[0]&&(w=this.sqr(w)),T===0&&b===0){d=0;continue}b<<=1,b|=T,d++,!(d!==f&&(l!==0||A!==0))&&(w=this.mul(w,h[b]),d=0,b=0)}a=26}return w},G.prototype.convertTo=function(o){var u=o.umod(this.m);return u===o?u.clone():u},G.prototype.convertFrom=function(o){var u=o.clone();return u.red=null,u},i.mont=function(o){return new st(o)};function st(m){G.call(this,m),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}r(st,G),st.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},st.prototype.convertFrom=function(o){var u=this.imod(o.mul(this.rinv));return u.red=null,u},st.prototype.imul=function(o,u){if(o.isZero()||u.isZero())return o.words[0]=0,o.length=1,o;var f=o.imul(u),h=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),l=f.isub(h).iushrn(this.shift),w=l;return l.cmp(this.m)>=0?w=l.isub(this.m):l.cmpn(0)<0&&(w=l.iadd(this.m)),w._forceRed(this)},st.prototype.mul=function(o,u){if(o.isZero()||u.isZero())return new i(0)._forceRed(this);var f=o.mul(u),h=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),l=f.isub(h).iushrn(this.shift),w=l;return l.cmp(this.m)>=0?w=l.isub(this.m):l.cmpn(0)<0&&(w=l.iadd(this.m)),w._forceRed(this)},st.prototype.invm=function(o){var u=this.imod(o._invmp(this.m).mul(this.r2));return u._forceRed(this)}})(typeof $s>"u"||$s,Ju)});var Qu=he(Zs=>{"use strict";var kg=C(z());function ir(n,t,e){return t<=n&&n<=e}function co(n){if(n===void 0)return{};if(n===Object(n))return n;throw TypeError("Could not convert argument to dictionary")}function zl(n){for(var t=String(n),e=t.length,r=0,i=[];r57343)i.push(s);else if(56320<=s&&s<=57343)i.push(65533);else if(55296<=s&&s<=56319)if(r===e-1)i.push(65533);else{var c=n.charCodeAt(r+1);if(56320<=c&&c<=57343){var p=s&1023,y=c&1023;i.push(65536+(p<<10)+y),r+=1}else i.push(65533)}r+=1}return i}function ql(n){for(var t="",e=0;e>10)+55296,(r&1023)+56320))}return t}var oo=-1;function Gs(n){this.tokens=[].slice.call(n)}Gs.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():oo},prepend:function(n){if(Array.isArray(n))for(var t=n;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(n)},push:function(n){if(Array.isArray(n))for(var t=n;t.length;)this.tokens.push(t.shift());else this.tokens.push(n)}};var Un=-1;function Vs(n,t){if(n)throw TypeError("Decoder error");return t||65533}var so="utf-8";function ao(n,t){if(!(this instanceof ao))return new ao(n,t);if(n=n!==void 0?String(n).toLowerCase():so,n!==so)throw new Error("Encoding not supported. Only utf-8 is supported");t=co(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!t.fatal,this._ignoreBOM=!!t.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}ao.prototype={decode:function(t,e){var r;typeof t=="object"&&t instanceof ArrayBuffer?r=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):r=new Uint8Array(0),e=co(e),this._streaming||(this._decoder=new Fl({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!e.stream;for(var i=new Gs(r),s=[],c;!i.endOfStream()&&(c=this._decoder.handler(i,i.read()),c!==Un);)c!==null&&(Array.isArray(c)?s.push.apply(s,c):s.push(c));if(!this._streaming){do{if(c=this._decoder.handler(i,i.read()),c===Un)break;c!==null&&(Array.isArray(c)?s.push.apply(s,c):s.push(c))}while(!i.endOfStream());this._decoder=null}return s.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(s[0]===65279?(this._BOMseen=!0,s.shift()):this._BOMseen=!0),ql(s)}};function uo(n,t){if(!(this instanceof uo))return new uo(n,t);if(n=n!==void 0?String(n).toLowerCase():so,n!==so)throw new Error("Encoding not supported. Only utf-8 is supported");t=co(t),this._streaming=!1,this._encoder=null,this._options={fatal:!!t.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}uo.prototype={encode:function(t,e){t=t?String(t):"",e=co(e),this._streaming||(this._encoder=new Kl(this._options)),this._streaming=!!e.stream;for(var r=[],i=new Gs(zl(t)),s;!i.endOfStream()&&(s=this._encoder.handler(i,i.read()),s!==Un);)Array.isArray(s)?r.push.apply(r,s):r.push(s);if(!this._streaming){for(;s=this._encoder.handler(i,i.read()),s!==Un;)Array.isArray(s)?r.push.apply(r,s):r.push(s);this._encoder=null}return new Uint8Array(r)}};function Fl(n){var t=n.fatal,e=0,r=0,i=0,s=128,c=191;this.handler=function(p,y){if(y===oo&&i!==0)return i=0,Vs(t);if(y===oo)return Un;if(i===0){if(ir(y,0,127))return y;if(ir(y,194,223))i=1,e=y-192;else if(ir(y,224,239))y===224&&(s=160),y===237&&(c=159),i=2,e=y-224;else if(ir(y,240,244))y===240&&(s=144),y===244&&(c=143),i=3,e=y-240;else return Vs(t);return e=e<<6*i,null}if(!ir(y,s,c))return e=i=r=0,s=128,c=191,p.prepend(y),Vs(t);if(s=128,c=191,r+=1,e+=y-128<<6*(i-r),r!==i)return null;var v=e;return e=i=r=0,v}}function Kl(n){var t=n.fatal;this.handler=function(e,r){if(r===oo)return Un;if(ir(r,0,127))return r;var i,s;ir(r,128,2047)?(i=1,s=192):ir(r,2048,65535)?(i=2,s=224):ir(r,65536,1114111)&&(i=3,s=240);for(var c=[(r>>6*i)+s];i>0;){var p=r>>6*(i-1);c.push(128|p&63),i-=1}return c}}Zs.TextEncoder=uo;Zs.TextDecoder=ao});var ic=he(ee=>{"use strict";var Bg=C(z()),Dl=ee&&ee.__createBinding||(Object.create?function(n,t,e,r){r===void 0&&(r=e),Object.defineProperty(n,r,{enumerable:!0,get:function(){return t[e]}})}:function(n,t,e,r){r===void 0&&(r=e),n[r]=t[e]}),Wl=ee&&ee.__setModuleDefault||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),je=ee&&ee.__decorate||function(n,t,e,r){var i=arguments.length,s=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,r);else for(var p=n.length-1;p>=0;p--)(c=n[p])&&(s=(i<3?c(s):i>3?c(t,e,s):c(t,e))||s);return i>3&&s&&Object.defineProperty(t,e,s),s},Hl=ee&&ee.__importStar||function(n){if(n&&n.__esModule)return n;var t={};if(n!=null)for(var e in n)e!=="default"&&Object.hasOwnProperty.call(n,e)&&Dl(t,n,e);return Wl(t,n),t},tc=ee&&ee.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ee,"__esModule",{value:!0});ee.deserializeUnchecked=ee.deserialize=ee.serialize=ee.BinaryReader=ee.BinaryWriter=ee.BorshError=ee.baseDecode=ee.baseEncode=void 0;var Er=tc(Xu()),ec=tc(Ds()),$l=Hl(Qu()),Vl=typeof TextDecoder!="function"?$l.TextDecoder:TextDecoder,Gl=new Vl("utf-8",{fatal:!0});function Zl(n){return typeof n=="string"&&(n=Buffer.from(n,"utf8")),ec.default.encode(Buffer.from(n))}ee.baseEncode=Zl;function jl(n){return Buffer.from(ec.default.decode(n))}ee.baseDecode=jl;var js=1024,ge=class extends Error{constructor(t){super(t),this.fieldPath=[],this.originalMessage=t}addToFieldPath(t){this.fieldPath.splice(0,0,t),this.message=this.originalMessage+": "+this.fieldPath.join(".")}};ee.BorshError=ge;var fo=class{constructor(){this.buf=Buffer.alloc(js),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(js)]))}writeU8(t){this.maybeResize(),this.buf.writeUInt8(t,this.length),this.length+=1}writeU16(t){this.maybeResize(),this.buf.writeUInt16LE(t,this.length),this.length+=2}writeU32(t){this.maybeResize(),this.buf.writeUInt32LE(t,this.length),this.length+=4}writeU64(t){this.maybeResize(),this.writeBuffer(Buffer.from(new Er.default(t).toArray("le",8)))}writeU128(t){this.maybeResize(),this.writeBuffer(Buffer.from(new Er.default(t).toArray("le",16)))}writeU256(t){this.maybeResize(),this.writeBuffer(Buffer.from(new Er.default(t).toArray("le",32)))}writeU512(t){this.maybeResize(),this.writeBuffer(Buffer.from(new Er.default(t).toArray("le",64)))}writeBuffer(t){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),t,Buffer.alloc(js)]),this.length+=t.length}writeString(t){this.maybeResize();let e=Buffer.from(t,"utf8");this.writeU32(e.length),this.writeBuffer(e)}writeFixedArray(t){this.writeBuffer(Buffer.from(t))}writeArray(t,e){this.maybeResize(),this.writeU32(t.length);for(let r of t)this.maybeResize(),e(r)}toArray(){return this.buf.subarray(0,this.length)}};ee.BinaryWriter=fo;function Ye(n,t,e){let r=e.value;e.value=function(...i){try{return r.apply(this,i)}catch(s){if(s instanceof RangeError){let c=s.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(c)>=0)throw new ge("Reached the end of buffer when deserializing")}throw s}}}var Ie=class{constructor(t){this.buf=t,this.offset=0}readU8(){let t=this.buf.readUInt8(this.offset);return this.offset+=1,t}readU16(){let t=this.buf.readUInt16LE(this.offset);return this.offset+=2,t}readU32(){let t=this.buf.readUInt32LE(this.offset);return this.offset+=4,t}readU64(){let t=this.readBuffer(8);return new Er.default(t,"le")}readU128(){let t=this.readBuffer(16);return new Er.default(t,"le")}readU256(){let t=this.readBuffer(32);return new Er.default(t,"le")}readU512(){let t=this.readBuffer(64);return new Er.default(t,"le")}readBuffer(t){if(this.offset+t>this.buf.length)throw new ge(`Expected buffer length ${t} isn\'t within bounds`);let e=this.buf.slice(this.offset,this.offset+t);return this.offset+=t,e}readString(){let t=this.readU32(),e=this.readBuffer(t);try{return Gl.decode(e)}catch(r){throw new ge(`Error decoding UTF-8 string: ${r}`)}}readFixedArray(t){return new Uint8Array(this.readBuffer(t))}readArray(t){let e=this.readU32(),r=Array();for(let i=0;i{yn(n,t,s,r[0],i)});else if(r.kind!==void 0)switch(r.kind){case"option":{e==null?i.writeU8(0):(i.writeU8(1),yn(n,t,e,r.type,i));break}case"map":{i.writeU32(e.size),e.forEach((s,c)=>{yn(n,t,c,r.key,i),yn(n,t,s,r.value,i)});break}default:throw new ge(`FieldType ${r} unrecognized`)}else nc(n,e,i)}catch(s){throw s instanceof ge&&s.addToFieldPath(t),s}}function nc(n,t,e){if(typeof t.borshSerialize=="function"){t.borshSerialize(e);return}let r=n.get(t.constructor);if(!r)throw new ge(`Class ${t.constructor.name} is missing in schema`);if(r.kind==="struct")r.fields.map(([i,s])=>{yn(n,i,t[i],s,e)});else if(r.kind==="enum"){let i=t[r.field];for(let s=0;sgn(n,t,e[0],r))}if(e.kind==="option")return r.readU8()?gn(n,t,e.type,r):void 0;if(e.kind==="map"){let i=new Map,s=r.readU32();for(let c=0;c=r.values.length)throw new ge(`Enum index: ${i} is out of range`);let[s,c]=r.values[i],p=gn(n,s,c,e);return new t({[s]:p})}throw new ge(`Unexpected schema kind: ${r.kind} for ${t.constructor.name}`)}function Jl(n,t,e,r=Ie){let i=new r(e),s=Ys(n,t,i);if(i.offset{"use strict";var Ig=C(z());Object.defineProperty(L,"__esModule",{value:!0});L.s16=L.s8=L.nu64be=L.u48be=L.u40be=L.u32be=L.u24be=L.u16be=L.nu64=L.u48=L.u40=L.u32=L.u24=L.u16=L.u8=L.offset=L.greedy=L.Constant=L.UTF8=L.CString=L.Blob=L.Boolean=L.BitField=L.BitStructure=L.VariantLayout=L.Union=L.UnionLayoutDiscriminator=L.UnionDiscriminator=L.Structure=L.Sequence=L.DoubleBE=L.Double=L.FloatBE=L.Float=L.NearInt64BE=L.NearInt64=L.NearUInt64BE=L.NearUInt64=L.IntBE=L.Int=L.UIntBE=L.UInt=L.OffsetLayout=L.GreedyCount=L.ExternalLayout=L.bindConstructorLayout=L.nameWithProperty=L.Layout=L.uint8ArrayToBuffer=L.checkUint8Array=void 0;L.constant=L.utf8=L.cstr=L.blob=L.unionLayoutDiscriminator=L.union=L.seq=L.bits=L.struct=L.f64be=L.f64=L.f32be=L.f32=L.ns64be=L.s48be=L.s40be=L.s32be=L.s24be=L.s16be=L.ns64=L.s48=L.s40=L.s32=L.s24=void 0;var Xs=Ln();function qn(n){if(!(n instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}L.checkUint8Array=qn;function Jt(n){return qn(n),Xs.Buffer.from(n.buffer,n.byteOffset,n.length)}L.uint8ArrayToBuffer=Jt;var Xt=class{constructor(t,e){if(!Number.isInteger(t))throw new TypeError("span must be an integer");this.span=t,this.property=e}makeDestinationObject(){return{}}getSpan(t,e){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(t){let e=Object.create(this.constructor.prototype);return Object.assign(e,this),e.property=t,e}fromArray(t){}};L.Layout=Xt;function Qs(n,t){return t.property?n+"["+t.property+"]":n}L.nameWithProperty=Qs;function Ql(n,t){if(typeof n!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(n,"layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof Xt))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(t,"boundConstructor_"))throw new Error("layout is already bound to a constructor");n.layout_=t,t.boundConstructor_=n,t.makeDestinationObject=()=>new n,Object.defineProperty(n.prototype,"encode",{value(e,r){return t.encode(this,e,r)},writable:!0}),Object.defineProperty(n,"decode",{value(e,r){return t.decode(e,r)},writable:!0})}L.bindConstructorLayout=Ql;var be=class extends Xt{isCount(){throw new Error("ExternalLayout is abstract")}};L.ExternalLayout=be;var ho=class extends be{constructor(t=1,e){if(!Number.isInteger(t)||0>=t)throw new TypeError("elementSpan must be a (positive) integer");super(-1,e),this.elementSpan=t}isCount(){return!0}decode(t,e=0){qn(t);let r=t.length-e;return Math.floor(r/this.elementSpan)}encode(t,e,r){return 0}};L.GreedyCount=ho;var yi=class extends be{constructor(t,e=0,r){if(!(t instanceof Xt))throw new TypeError("layout must be a Layout");if(!Number.isInteger(e))throw new TypeError("offset must be integer or undefined");super(t.span,r||t.property),this.layout=t,this.offset=e}isCount(){return this.layout instanceof Re||this.layout instanceof Te}decode(t,e=0){return this.layout.decode(t,e+this.offset)}encode(t,e,r=0){return this.layout.encode(t,e,r+this.offset)}};L.OffsetLayout=yi;var Re=class extends Xt{constructor(t,e){if(super(t,e),6c+i.encode(p,e,r+c),0);return this.count instanceof be&&this.count.encode(t.length,e,r),s}};L.Sequence=xo;var ko=class extends Xt{constructor(t,e,r){if(!(Array.isArray(t)&&t.reduce((s,c)=>s&&c instanceof Xt,!0)))throw new TypeError("fields must be array of Layout instances");typeof e=="boolean"&&r===void 0&&(r=e,e=void 0);for(let s of t)if(0>s.span&&s.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let i=-1;try{i=t.reduce((s,c)=>s+c.getSpan(),0)}catch{}super(i,e),this.fields=t,this.decodePrefixes=!!r}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce((i,s)=>{let c=s.getSpan(t,e);return e+=c,i+c},0)}catch{throw new RangeError("indeterminate span")}return r}decode(t,e=0){qn(t);let r=this.makeDestinationObject();for(let i of this.fields)if(i.property!==void 0&&(r[i.property]=i.decode(t,e)),e+=i.getSpan(t,e),this.decodePrefixes&&t.length===e)break;return r}encode(t,e,r=0){let i=r,s=0,c=0;for(let p of this.fields){let y=p.span;if(c=0y&&(y=p.getSpan(e,r)))}s=r,r+=y}return s+c-i}fromArray(t){let e=this.makeDestinationObject();for(let r of this.fields)r.property!==void 0&&0r.span?e=-1:0<=e&&(e+=r.span)}}};L.Structure=ko;var gi=class{constructor(t){this.property=t}decode(t,e){throw new Error("UnionDiscriminator is abstract")}encode(t,e,r){throw new Error("UnionDiscriminator is abstract")}};L.UnionDiscriminator=gi;var zn=class extends gi{constructor(t,e){if(!(t instanceof be&&t.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(e||t.property||"variant"),this.layout=t}decode(t,e){return this.layout.decode(t,e)}encode(t,e,r){return this.layout.encode(t,e,r)}};L.UnionLayoutDiscriminator=zn;var mi=class extends Xt{constructor(t,e,r){let i;if(t instanceof Re||t instanceof Te)i=new zn(new yi(t));else if(t instanceof be&&t.isCount())i=new zn(t);else if(t instanceof gi)i=t;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(e===void 0&&(e=null),!(e===null||e instanceof Xt))throw new TypeError("defaultLayout must be null or a Layout");if(e!==null){if(0>e.span)throw new Error("defaultLayout must have constant span");e.property===void 0&&(e=e.replicate("content"))}let s=-1;e&&(s=e.span,0<=s&&(t instanceof Re||t instanceof Te)&&(s+=i.layout.span)),super(s,r),this.discriminator=i,this.usesPrefixDiscriminator=t instanceof Re||t instanceof Te,this.defaultLayout=e,this.registry={};let c=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(p){return c(p)},this.configGetSourceVariant=function(p){c=p.bind(this)}}getSpan(t,e=0){if(0<=this.span)return this.span;let r=this.getVariant(t,e);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(t,e)}defaultGetSourceVariant(t){if(Object.prototype.hasOwnProperty.call(t,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(t,this.defaultLayout.property))return;let e=this.registry[t[this.discriminator.property]];if(e&&(!e.layout||e.property&&Object.prototype.hasOwnProperty.call(t,e.property)))return e}else for(let e in this.registry){let r=this.registry[e];if(r.property&&Object.prototype.hasOwnProperty.call(t,r.property))return r}throw new Error("unable to infer src variant")}decode(t,e=0){let r,i=this.discriminator,s=i.decode(t,e),c=this.registry[s];if(c===void 0){let p=this.defaultLayout,y=0;this.usesPrefixDiscriminator&&(y=i.layout.span),r=this.makeDestinationObject(),r[i.property]=s,r[p.property]=p.decode(t,e+y)}else r=c.decode(t,e);return r}encode(t,e,r=0){let i=this.getSourceVariant(t);if(i===void 0){let s=this.discriminator,c=this.defaultLayout,p=0;return this.usesPrefixDiscriminator&&(p=s.layout.span),s.encode(t[s.property],e,r),p+c.encode(t[c.property],e,r+p)}return i.encode(t,e,r)}addVariant(t,e,r){let i=new So(this,t,e,r);return this.registry[t]=i,i}getVariant(t,e=0){let r;return t instanceof Uint8Array?r=this.discriminator.decode(t,e):r=t,this.registry[r]}};L.Union=mi;var So=class extends Xt{constructor(t,e,r,i){if(!(t instanceof mi))throw new TypeError("union must be a Union");if(!Number.isInteger(e)||0>e)throw new TypeError("variant must be a (non-negative) integer");if(typeof r=="string"&&i===void 0&&(i=r,r=null),r){if(!(r instanceof Xt))throw new TypeError("layout must be a Layout");if(t.defaultLayout!==null&&0<=r.span&&r.span>t.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof i!="string")throw new TypeError("variant must have a String property")}let s=t.span;0>t.span&&(s=r?r.span:0,0<=s&&t.usesPrefixDiscriminator&&(s+=t.discriminator.layout.span)),super(s,i),this.union=t,this.variant=e,this.layout=r||null}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let i=0;return this.layout&&(i=this.layout.getSpan(t,e+r)),r+i}decode(t,e=0){let r=this.makeDestinationObject();if(this!==this.union.getVariant(t,e))throw new Error("variant mismatch");let i=0;return this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(t,e+i):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(t,e,r=0){let i=0;if(this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(t,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,e,r);let s=i;if(this.layout&&(this.layout.encode(t[this.property],e,r+i),s+=this.layout.getSpan(e,r+i),0<=this.union.span&&s>this.union.span))throw new Error("encoded variant overruns containing union");return s}fromArray(t){if(this.layout)return this.layout.fromArray(t)}};L.VariantLayout=So;function Nn(n){return 0>n&&(n+=4294967296),n}var wi=class extends Xt{constructor(t,e,r){if(!(t instanceof Re||t instanceof Te))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof e=="string"&&r===void 0&&(r=e,e=!1),4=e)throw new TypeError("bits must be positive integer");let i=8*t.span,s=t.fields.reduce((c,p)=>c+p.bits,0);if(e+s>i)throw new Error("bits too long for span remainder ("+(i-s)+" of "+i+" remain)");this.container=t,this.bits=e,this.valueMask=(1<>>this.start}encode(t){if(typeof t!="number"||!Number.isInteger(t)||t!==Nn(t&this.valueMask))throw new TypeError(Qs("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let e=this.container._packedGetValue(),r=Nn(t<r&&(r=this.length.decode(t,e)),r}decode(t,e=0){let r=this.span;return 0>r&&(r=this.length.decode(t,e)),Jt(t).slice(e,e+r)}encode(t,e,r){let i=this.length;if(this.length instanceof be&&(i=t.length),!(t instanceof Uint8Array&&i===t.length))throw new TypeError(Qs("Blob.encode",this)+" requires (length "+i+") Uint8Array as src");if(r+i>e.length)throw new RangeError("encoding overruns Uint8Array");let s=Jt(t);return Jt(e).write(s.toString("hex"),r,i,"hex"),this.length instanceof be&&this.length.encode(i,e,r),i}};L.Blob=Eo;var Io=class extends Xt{constructor(t){super(-1,t)}getSpan(t,e=0){qn(t);let r=e;for(;re.length)throw new RangeError("encoding overruns Buffer");let c=Jt(e);return i.copy(c,r),c[r+s]=0,s+1}};L.CString=Io;var _o=class extends Xt{constructor(t,e){if(typeof t=="string"&&e===void 0&&(e=t,t=void 0),t===void 0)t=-1;else if(!Number.isInteger(t))throw new TypeError("maxSpan must be an integer");super(-1,e),this.maxSpan=t}getSpan(t,e=0){return qn(t),t.length-e}decode(t,e=0){let r=this.getSpan(t,e);if(0<=this.maxSpan&&this.maxSpane.length)throw new RangeError("encoding overruns Buffer");return i.copy(Jt(e),r),s}};L.UTF8=_o;var Ao=class extends Xt{constructor(t,e){super(0,e),this.value=t}decode(t,e){return this.value}encode(t,e,r){return 0}};L.Constant=Ao;L.greedy=(n,t)=>new ho(n,t);L.offset=(n,t,e)=>new yi(n,t,e);L.u8=n=>new Re(1,n);L.u16=n=>new Re(2,n);L.u24=n=>new Re(3,n);L.u32=n=>new Re(4,n);L.u40=n=>new Re(5,n);L.u48=n=>new Re(6,n);L.nu64=n=>new lo(n);L.u16be=n=>new Te(2,n);L.u24be=n=>new Te(3,n);L.u32be=n=>new Te(4,n);L.u40be=n=>new Te(5,n);L.u48be=n=>new Te(6,n);L.nu64be=n=>new po(n);L.s8=n=>new or(1,n);L.s16=n=>new or(2,n);L.s24=n=>new or(3,n);L.s32=n=>new or(4,n);L.s40=n=>new or(5,n);L.s48=n=>new or(6,n);L.ns64=n=>new yo(n);L.s16be=n=>new Ir(2,n);L.s24be=n=>new Ir(3,n);L.s32be=n=>new Ir(4,n);L.s40be=n=>new Ir(5,n);L.s48be=n=>new Ir(6,n);L.ns64be=n=>new go(n);L.f32=n=>new mo(n);L.f32be=n=>new wo(n);L.f64=n=>new bo(n);L.f64be=n=>new vo(n);L.struct=(n,t,e)=>new ko(n,t,e);L.bits=(n,t,e)=>new wi(n,t,e);L.seq=(n,t,e)=>new xo(n,t,e);L.union=(n,t,e)=>new mi(n,t,e);L.unionLayoutDiscriminator=(n,t)=>new zn(n,t);L.blob=(n,t)=>new Eo(n,t);L.cstr=n=>new Io(n);L.utf8=(n,t)=>new _o(n,t);L.constant=(n,t)=>new Ao(n,t)});var oc=he(Fn=>{"use strict";var Ag=C(z());Object.defineProperty(Fn,"__esModule",{value:!0});var Ro;function t0(n){{let t=Buffer.from(n);t.reverse();let e=t.toString("hex");return e.length===0?BigInt(0):BigInt(`0x${e}`)}return Ro.toBigInt(n,!1)}Fn.toBigIntLE=t0;function e0(n){{let t=n.toString("hex");return t.length===0?BigInt(0):BigInt(`0x${t}`)}return Ro.toBigInt(n,!0)}Fn.toBigIntBE=e0;function r0(n,t){{let e=n.toString(16),r=Buffer.from(e.padStart(t*2,"0").slice(0,t*2),"hex");return r.reverse(),r}return Ro.fromBigInt(n,Buffer.allocUnsafe(t),!1)}Fn.toBufferLE=r0;function n0(n,t){{let e=n.toString(16);return Buffer.from(e.padStart(t*2,"0").slice(0,t*2),"hex")}return Ro.fromBigInt(n,Buffer.allocUnsafe(t),!0)}Fn.toBufferBE=n0});function i0(n){return vi(n)&&typeof n[Symbol.iterator]=="function"}function vi(n){return typeof n=="object"&&n!=null}function To(n){return vi(n)&&!Array.isArray(n)}function De(n){return typeof n=="symbol"?n.toString():typeof n=="string"?JSON.stringify(n):`${n}`}function o0(n){let{done:t,value:e}=n.next();return t?void 0:e}function s0(n,t,e,r){if(n===!0)return;n===!1?n={}:typeof n=="string"&&(n={message:n});let{path:i,branch:s}=t,{type:c}=e,{refinement:p,message:y=`Expected a value of type \\`${c}\\`${p?` with refinement \\`${p}\\``:""}, but received: \\`${De(r)}\\``}=n;return{value:r,type:c,refinement:p,key:i[i.length-1],path:i,branch:s,...n,message:y}}function*sc(n,t,e,r){i0(n)||(n=[n]);for(let i of n){let s=s0(i,t,e,r);s&&(yield s)}}function*ra(n,t,e={}){let{path:r=[],branch:i=[n],coerce:s=!1,mask:c=!1}=e,p={path:r,branch:i,mask:c};s&&(n=t.coercer(n,p));let y="valid";for(let v of t.validator(n,p))v.explanation=e.message,y="not_valid",yield[v,void 0];for(let[v,x,S]of t.entries(n,p)){let I=ra(x,S,{path:v===void 0?r:[...r,v],branch:v===void 0?i:[...i,x],coerce:s,mask:c,message:e.message});for(let B of I)B[0]?(y=B[0].refinement!=null?"not_refined":"not_valid",yield[B[0],void 0]):s&&(x=B[1],v===void 0?n=x:n instanceof Map?n.set(v,x):n instanceof Set?n.add(x):vi(n)&&(x!==void 0||v in n)&&(n[v]=x))}if(y!=="not_valid")for(let v of t.refiner(n,p))v.explanation=e.message,y="not_refined",yield[v,void 0];y==="valid"&&(yield[void 0,n])}function ac(n,t,e){let r=xi(n,t,{message:e});if(r[0])throw r[0]}function $(n,t,e){let r=xi(n,t,{coerce:!0,message:e});if(r[0])throw r[0];return r[1]}function a0(n,t,e){let r=xi(n,t,{coerce:!0,mask:!0,message:e});if(r[0])throw r[0];return r[1]}function uc(n,t){return!xi(n,t)[0]}function xi(n,t,e={}){let r=ra(n,t,e),i=o0(r);return i[0]?[new ea(i[0],function*(){for(let c of r)c[0]&&(yield c[0])}),void 0]:[void 0,i[1]]}function mn(n,t){return new Ne({type:n,schema:null,validator:t})}function cc(){return mn("any",()=>!0)}function Z(n){return new Ne({type:"array",schema:n,*entries(t){if(n&&Array.isArray(t))for(let[e,r]of t.entries())yield[e,r,n]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${De(t)}`}})}function We(){return mn("boolean",n=>typeof n=="boolean")}function Po(n){return mn("instance",t=>t instanceof n||`Expected a \\`${n.name}\\` instance, but received: ${De(t)}`)}function se(n){let t=De(n),e=typeof n;return new Ne({type:"literal",schema:e==="string"||e==="number"||e==="boolean"?n:null,validator(r){return r===n||`Expected the literal \\`${t}\\`, but received: ${De(r)}`}})}function u0(){return mn("never",()=>!1)}function j(n){return new Ne({...n,validator:(t,e)=>t===null||n.validator(t,e),refiner:(t,e)=>t===null||n.refiner(t,e)})}function M(){return mn("number",n=>typeof n=="number"&&!isNaN(n)||`Expected a number, but received: ${De(n)}`)}function it(n){return new Ne({...n,validator:(t,e)=>t===void 0||n.validator(t,e),refiner:(t,e)=>t===void 0||n.refiner(t,e)})}function na(n,t){return new Ne({type:"record",schema:null,*entries(e){if(vi(e))for(let r in e){let i=e[r];yield[r,r,n],yield[r,i,t]}},validator(e){return To(e)||`Expected an object, but received: ${De(e)}`},coercer(e){return To(e)?{...e}:e}})}function W(){return mn("string",n=>typeof n=="string"||`Expected a string, but received: ${De(n)}`)}function Co(n){let t=u0();return new Ne({type:"tuple",schema:null,*entries(e){if(Array.isArray(e)){let r=Math.max(n.length,e.length);for(let i=0;ie.type).join(" | ");return new Ne({type:"union",schema:null,coercer(e,r){for(let i of n){let[s,c]=i.validate(e,{coerce:!0,mask:r.mask});if(!s)return c}return e},validator(e,r){let i=[];for(let s of n){let[...c]=ra(e,s,r),[p]=c;if(p[0])for(let[y]of c)y&&i.push(y);else return[]}return[`Expected the value to satisfy a union of \\`${t}\\`, but received: ${De(e)}`,...i]}})}function wn(){return mn("unknown",()=>!0)}function Kn(n,t,e){return new Ne({...n,coercer:(r,i)=>uc(r,t)?n.coercer(e(r,i),i):n.coercer(r,i)})}var Lg,ea,Ne,fc=vt(()=>{Lg=C(z(),1),ea=class extends TypeError{constructor(t,e){let r,{message:i,explanation:s,...c}=t,{path:p}=t,y=p.length===0?i:`At path: ${p.join(".")} -- ${i}`;super(s??y),s!=null&&(this.cause=y),Object.assign(this,c),this.name=this.constructor.name,this.failures=()=>r??(r=[t,...e()])}};Ne=class{constructor(t){let{type:e,schema:r,validator:i,refiner:s,coercer:c=y=>y,entries:p=function*(){}}=t;this.type=e,this.schema=r,this.entries=p,this.coercer=c,i?this.validator=(y,v)=>{let x=i(y,v);return sc(x,v,this,y)}:this.validator=()=>[],s?this.refiner=(y,v)=>{let x=s(y,v);return sc(x,v,this,y)}:this.refiner=()=>[]}assert(t,e){return ac(t,this,e)}create(t,e){return $(t,this,e)}is(t){return uc(t,this)}mask(t,e){return a0(t,this,e)}validate(t,e={}){return xi(t,this,e)}}});function ki(){if(!Oo&&(Oo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Oo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Oo(c0)}var Tg,Oo,c0,ia=vt(()=>{Tg=C(z()),c0=new Uint8Array(16)});var Cg,hc,lc=vt(()=>{Cg=C(z()),hc=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i});function f0(n){return typeof n=="string"&&hc.test(n)}var Ng,_r,Si=vt(()=>{Ng=C(z());lc();_r=f0});function h0(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=(me[n[t+0]]+me[n[t+1]]+me[n[t+2]]+me[n[t+3]]+"-"+me[n[t+4]]+me[n[t+5]]+"-"+me[n[t+6]]+me[n[t+7]]+"-"+me[n[t+8]]+me[n[t+9]]+"-"+me[n[t+10]]+me[n[t+11]]+me[n[t+12]]+me[n[t+13]]+me[n[t+14]]+me[n[t+15]]).toLowerCase();if(!_r(e))throw TypeError("Stringified UUID is invalid");return e}var Fg,me,Uo,Ar,Bi=vt(()=>{Fg=C(z());Si();me=[];for(Uo=0;Uo<256;++Uo)me.push((Uo+256).toString(16).substr(1));Ar=h0});function l0(n,t,e){var r=t&&e||0,i=t||new Array(16);n=n||{};var s=n.node||dc,c=n.clockseq!==void 0?n.clockseq:oa;if(s==null||c==null){var p=n.random||(n.rng||ki)();s==null&&(s=dc=[p[0]|1,p[1],p[2],p[3],p[4],p[5]]),c==null&&(c=oa=(p[6]<<8|p[7])&16383)}var y=n.msecs!==void 0?n.msecs:Date.now(),v=n.nsecs!==void 0?n.nsecs:aa+1,x=y-sa+(v-aa)/1e4;if(x<0&&n.clockseq===void 0&&(c=c+1&16383),(x<0||y>sa)&&n.nsecs===void 0&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can\'t create more than 10M uuids/sec");sa=y,aa=v,oa=c,y+=122192928e5;var S=((y&268435455)*1e4+v)%4294967296;i[r++]=S>>>24&255,i[r++]=S>>>16&255,i[r++]=S>>>8&255,i[r++]=S&255;var I=y/4294967296*1e4&268435455;i[r++]=I>>>8&255,i[r++]=I&255,i[r++]=I>>>24&15|16,i[r++]=I>>>16&255,i[r++]=c>>>8|128,i[r++]=c&255;for(var B=0;B<6;++B)i[r+B]=s[B];return t||Ar(i)}var Hg,dc,oa,sa,aa,pc,yc=vt(()=>{Hg=C(z());ia();Bi();sa=0,aa=0;pc=l0});function d0(n){if(!_r(n))throw TypeError("Invalid UUID");var t,e=new Uint8Array(16);return e[0]=(t=parseInt(n.slice(0,8),16))>>>24,e[1]=t>>>16&255,e[2]=t>>>8&255,e[3]=t&255,e[4]=(t=parseInt(n.slice(9,13),16))>>>8,e[5]=t&255,e[6]=(t=parseInt(n.slice(14,18),16))>>>8,e[7]=t&255,e[8]=(t=parseInt(n.slice(19,23),16))>>>8,e[9]=t&255,e[10]=(t=parseInt(n.slice(24,36),16))/1099511627776&255,e[11]=t/4294967296&255,e[12]=t>>>24&255,e[13]=t>>>16&255,e[14]=t>>>8&255,e[15]=t&255,e}var Gg,No,ua=vt(()=>{Gg=C(z());Si();No=d0});function p0(n){n=unescape(encodeURIComponent(n));for(var t=[],e=0;e{Jg=C(z());Bi();ua();y0="6ba7b810-9dad-11d1-80b4-00c04fd430c8",g0="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function m0(n){if(typeof n=="string"){var t=unescape(encodeURIComponent(n));n=new Uint8Array(t.length);for(var e=0;e>5]>>>i%32&255,c=parseInt(r.charAt(s>>>4&15)+r.charAt(s&15),16);t.push(c)}return t}function gc(n){return(n+64>>>9<<4)+14+1}function b0(n,t){n[t>>5]|=128<>5]|=(n[r/8]&255)<>16)+(t>>16)+(e>>16);return r<<16|e&65535}function x0(n,t){return n<>>32-t}function qo(n,t,e,r,i,s){return Mr(x0(Mr(Mr(t,n),Mr(r,s)),i),e)}function xe(n,t,e,r,i,s,c){return qo(t&e|~t&r,n,t,i,s,c)}function ke(n,t,e,r,i,s,c){return qo(t&r|e&~r,n,t,i,s,c)}function Se(n,t,e,r,i,s,c){return qo(t^e^r,n,t,i,s,c)}function Be(n,t,e,r,i,s,c){return qo(e^(t|~r),n,t,i,s,c)}var Qg,mc,wc=vt(()=>{Qg=C(z());mc=m0});var nm,k0,bc,vc=vt(()=>{nm=C(z());ca();wc();k0=zo("v3",48,mc),bc=k0});function S0(n,t,e){n=n||{};var r=n.random||(n.rng||ki)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){e=e||0;for(var i=0;i<16;++i)t[e+i]=r[i];return t}return Ar(r)}var am,xc,kc=vt(()=>{am=C(z());ia();Bi();xc=S0});function B0(n,t,e,r){switch(n){case 0:return t&e^~t&r;case 1:return t^e^r;case 2:return t&e^t&r^e&r;case 3:return t^e^r}}function fa(n,t){return n<>>32-t}function E0(n){var t=[1518500249,1859775393,2400959708,3395469782],e=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof n=="string"){var r=unescape(encodeURIComponent(n));n=[];for(var i=0;i>>0;N=K,K=U,U=fa(E,30)>>>0,E=_,_=H}e[0]=e[0]+_>>>0,e[1]=e[1]+E>>>0,e[2]=e[2]+U>>>0,e[3]=e[3]+K>>>0,e[4]=e[4]+N>>>0}return[e[0]>>24&255,e[0]>>16&255,e[0]>>8&255,e[0]&255,e[1]>>24&255,e[1]>>16&255,e[1]>>8&255,e[1]&255,e[2]>>24&255,e[2]>>16&255,e[2]>>8&255,e[2]&255,e[3]>>24&255,e[3]>>16&255,e[3]>>8&255,e[3]&255,e[4]>>24&255,e[4]>>16&255,e[4]>>8&255,e[4]&255]}var cm,Sc,Bc=vt(()=>{cm=C(z());Sc=E0});var dm,I0,Ec,Ic=vt(()=>{dm=C(z());ca();Bc();I0=zo("v5",80,Sc),Ec=I0});var ym,_c,Ac=vt(()=>{ym=C(z()),_c="00000000-0000-0000-0000-000000000000"});function _0(n){if(!_r(n))throw TypeError("Invalid UUID");return parseInt(n.substr(14,1),16)}var wm,Mc,Lc=vt(()=>{wm=C(z());Si();Mc=_0});var ha={};Ka(ha,{NIL:()=>_c,parse:()=>No,stringify:()=>Ar,v1:()=>pc,v3:()=>bc,v4:()=>xc,v5:()=>Ec,validate:()=>_r,version:()=>Mc});var bm,la=vt(()=>{bm=C(z());yc();vc();kc();Ic();Ac();Lc();Si();Bi();ua()});var Tc=he((Mm,Rc)=>{"use strict";var Lm=C(z()),A0=(la(),Wa(ha)).v4,M0=function(n,t,e,r){if(typeof n!="string")throw new TypeError(n+" must be a string");r=r||{};let i=typeof r.version=="number"?r.version:2;if(i!==1&&i!==2)throw new TypeError(i+" must be 1 or 2");let s={method:n};if(i===2&&(s.jsonrpc="2.0"),t){if(typeof t!="object"&&!Array.isArray(t))throw new TypeError(t+" must be an object, array or omitted");s.params=t}if(typeof e>"u"){let c=typeof r.generator=="function"?r.generator:function(){return A0()};s.id=c(s,r)}else i===2&&e===null?r.notificationIdNull&&(s.id=null):s.id=e;return s};Rc.exports=M0});var Cc=he((Rm,Pc)=>{"use strict";var Tm=C(z()),L0=(la(),Wa(ha)).v4,R0=Tc(),Ei=function(n,t){if(!(this instanceof Ei))return new Ei(n,t);t||(t={}),this.options={reviver:typeof t.reviver<"u"?t.reviver:null,replacer:typeof t.replacer<"u"?t.replacer:null,generator:typeof t.generator<"u"?t.generator:function(){return L0()},version:typeof t.version<"u"?t.version:2,notificationIdNull:typeof t.notificationIdNull=="boolean"?t.notificationIdNull:!1},this.callServer=n};Pc.exports=Ei;Ei.prototype.request=function(n,t,e,r){let i=this,s=null,c=Array.isArray(n)&&typeof t=="function";if(this.options.version===1&&c)throw new TypeError("JSON-RPC 1.0 does not support batching");if(c||!c&&n&&typeof n=="object"&&typeof t=="function")r=t,s=n;else{typeof e=="function"&&(r=e,e=void 0);let v=typeof r=="function";try{s=R0(n,t,e,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(x){if(v)return r(x);throw x}if(!v)return s}let y;try{y=JSON.stringify(s,this.options.replacer)}catch(v){return r(v)}return this.callServer(y,function(v,x){i._parseResponse(v,x,r)}),s};Ei.prototype._parseResponse=function(n,t,e){if(n){e(n);return}if(!t)return e();let r;try{r=JSON.parse(t,this.options.reviver)}catch(i){return e(i)}if(e.length===3)if(Array.isArray(r)){let i=function(c){return typeof c.error<"u"},s=function(c){return!i(c)};return e(null,r.filter(i),r.filter(s))}else return e(null,r.error,r.result);e(null,r)}});var Uc=he((Pm,da)=>{"use strict";var Cm=C(z()),T0=Object.prototype.hasOwnProperty,_e="~";function Ii(){}Object.create&&(Ii.prototype=Object.create(null),new Ii().__proto__||(_e=!1));function P0(n,t,e){this.fn=n,this.context=t,this.once=e||!1}function Oc(n,t,e,r,i){if(typeof e!="function")throw new TypeError("The listener must be a function");var s=new P0(e,r||n,i),c=_e?_e+t:t;return n._events[c]?n._events[c].fn?n._events[c]=[n._events[c],s]:n._events[c].push(s):(n._events[c]=s,n._eventsCount++),n}function Fo(n,t){--n._eventsCount===0?n._events=new Ii:delete n._events[t]}function Ee(){this._events=new Ii,this._eventsCount=0}Ee.prototype.eventNames=function(){var t=[],e,r;if(this._eventsCount===0)return t;for(r in e=this._events)T0.call(e,r)&&t.push(_e?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(e)):t};Ee.prototype.listeners=function(t){var e=_e?_e+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,c=new Array(s);i{Um=C(z(),1),Ko=C(Uc(),1)});function qc(n,t){return new C0(n,t)}var qm,zc,C0,O0,Fc,Kc=vt(()=>{qm=C(z(),1),zc=C(Ln(),1);Nc();C0=class extends Ko.default{socket;constructor(n,t,e){super(),this.socket=new window.WebSocket(n,e),this.socket.onopen=()=>this.emit("open"),this.socket.onmessage=r=>this.emit("message",r.data),this.socket.onerror=r=>this.emit("error",r),this.socket.onclose=r=>{this.emit("close",r.code,r.reason)}}send(n,t,e){let r=e||t;try{this.socket.send(n),r()}catch(i){r(i)}}close(n,t){this.socket.close(n,t)}addEventListener(n,t,e){this.socket.addEventListener(n,t,e)}};O0=class{encode(n){return JSON.stringify(n)}decode(n){return JSON.parse(n)}},Fc=class extends Ko.default{address;rpc_id;queue;options;autoconnect;ready;reconnect;reconnect_timer_id;reconnect_interval;max_reconnects;rest_options;current_reconnects;generate_request_id;socket;webSocketFactory;dataPack;constructor(n,t="ws://localhost:8080",{autoconnect:e=!0,reconnect:r=!0,reconnect_interval:i=1e3,max_reconnects:s=5,...c}={},p,y){super(),this.webSocketFactory=n,this.queue={},this.rpc_id=0,this.address=t,this.autoconnect=e,this.ready=!1,this.reconnect=r,this.reconnect_timer_id=void 0,this.reconnect_interval=i,this.max_reconnects=s,this.rest_options=c,this.current_reconnects=0,this.generate_request_id=p||(()=>++this.rpc_id),y?this.dataPack=y:this.dataPack=new O0,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(n,t,e,r){return!r&&typeof e=="object"&&(r=e,e=null),new Promise((i,s)=>{if(!this.ready)return s(new Error("socket not ready"));let c=this.generate_request_id(n,t),p={jsonrpc:"2.0",method:n,params:t||void 0,id:c};this.socket.send(this.dataPack.encode(p),r,y=>{if(y)return s(y);this.queue[c]={promise:[i,s]},e&&(this.queue[c].timeout=setTimeout(()=>{delete this.queue[c],s(new Error("reply timeout"))},e))})})}async login(n){let t=await this.call("rpc.login",n);if(!t)throw new Error("authentication failed");return t}async listMethods(){return await this.call("__listMethods")}notify(n,t){return new Promise((e,r)=>{if(!this.ready)return r(new Error("socket not ready"));let i={jsonrpc:"2.0",method:n,params:t};this.socket.send(this.dataPack.encode(i),s=>{if(s)return r(s);e()})})}async subscribe(n){typeof n=="string"&&(n=[n]);let t=await this.call("rpc.on",n);if(typeof n=="string"&&t[n]!=="ok")throw new Error("Failed subscribing to an event \'"+n+"\' with: "+t[n]);return t}async unsubscribe(n){typeof n=="string"&&(n=[n]);let t=await this.call("rpc.off",n);if(typeof n=="string"&&t[n]!=="ok")throw new Error("Failed unsubscribing from an event with: "+t);return t}close(n,t){this.socket.close(n||1e3,t)}setAutoReconnect(n){this.reconnect=n}setReconnectInterval(n){this.reconnect_interval=n}setMaxReconnects(n){this.max_reconnects=n}_connect(n,t){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(n,t),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:e})=>{e instanceof ArrayBuffer&&(e=zc.Buffer.from(e).toString());try{e=this.dataPack.decode(e)}catch{return}if(e.notification&&this.listeners(e.notification).length){if(!Object.keys(e.params).length)return this.emit(e.notification);let r=[e.notification];if(e.params.constructor===Object)r.push(e.params);else for(let i=0;i{this.emit.apply(this,r)})}if(!this.queue[e.id])return e.method?Promise.resolve().then(()=>{this.emit(e.method,e?.params)}):void 0;"error"in e=="result"in e&&this.queue[e.id].promise[1](new Error(\'Server response malformed. Response must include either "result" or "error", but not both.\')),this.queue[e.id].timeout&&clearTimeout(this.queue[e.id].timeout),e.error?this.queue[e.id].promise[1](e.error):this.queue[e.id].promise[0](e.result),delete this.queue[e.id]}),this.socket.addEventListener("error",e=>this.emit("error",e)),this.socket.addEventListener("close",({code:e,reason:r})=>{this.ready&&setTimeout(()=>this.emit("close",e,r),0),this.ready=!1,this.socket=void 0,e!==1e3&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||this.max_reconnects===0)&&(this.reconnect_timer_id=setTimeout(()=>this._connect(n,t),this.reconnect_interval)))})}}});function W0(n,t=24){let e=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let c=0;c<10;c++)e[c]=n[c]^n[c+10]^n[c+20]^n[c+30]^n[c+40];for(let c=0;c<10;c+=2){let p=(c+8)%10,y=(c+2)%10,v=e[y],x=e[y+1],S=Dc(v,x,1)^e[p],I=Wc(v,x,1)^e[p+1];for(let B=0;B<50;B+=10)n[c+B]^=S,n[c+B+1]^=I}let i=n[2],s=n[3];for(let c=0;c<24;c++){let p=$c[c],y=Dc(i,s,p),v=Wc(i,s,p),x=Hc[c];i=n[x],s=n[x+1],n[x]=y,n[x+1]=v}for(let c=0;c<50;c+=10){for(let p=0;p<10;p++)e[p]=n[c+p];for(let p=0;p<10;p++)n[c+p]^=~e[(p+2)%10]&e[(p+4)%10]}n[0]^=K0[r],n[1]^=D0[r]}e.fill(0)}var r1,Hc,$c,Vc,U0,_i,N0,z0,q0,F0,K0,D0,Dc,Wc,Dn,Lr,Vm,Gm,Zm,jm,Ym,pa,Jm,Xm,Gc,Qm,t1,Zc=vt(()=>{r1=C(z(),1);fi();ks();gr();Hc=[],$c=[],Vc=[],U0=BigInt(0),_i=BigInt(1),N0=BigInt(2),z0=BigInt(7),q0=BigInt(256),F0=BigInt(113);for(let n=0,t=_i,e=1,r=0;n<24;n++){[e,r]=[r,(2*e+3*r)%5],Hc.push(2*(5*r+e)),$c.push((n+1)*(n+2)/2%64);let i=U0;for(let s=0;s<7;s++)t=(t<<_i^(t>>z0)*F0)%q0,t&N0&&(i^=_i<<(_i<e>32?vs(n,t,e):ws(n,t,e),Wc=(n,t,e)=>e>32?xs(n,t,e):bs(n,t,e);Dn=class extends pr{constructor(t,e,r,i=!1,s=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,ci(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=vu(this.state)}keccak(){ls||ds(this.state32),W0(this.state32,this.rounds),ls||ds(this.state32),this.posOut=0,this.pos=0}update(t){Qe(this);let{blockLen:e,state:r}=this;t=yr(t);let i=t.length;for(let s=0;s=r&&this.keccak();let c=Math.min(r-this.posOut,s-i);t.set(e.subarray(this.posOut,this.posOut+c),i),this.posOut+=c,i+=c}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return ci(t),this.xofInto(new Uint8Array(t))}digestInto(t){if($i(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:e,suffix:r,outputLen:i,rounds:s,enableXOF:c}=this;return t||(t=new Dn(e,r,i,c,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=r,t.outputLen=i,t.enableXOF=c,t.destroyed=this.destroyed,t}},Lr=(n,t,e)=>Tn(()=>new Dn(t,n,e)),Vm=Lr(6,144,224/8),Gm=Lr(6,136,256/8),Zm=Lr(6,104,384/8),jm=Lr(6,72,512/8),Ym=Lr(1,144,224/8),pa=Lr(1,136,256/8),Jm=Lr(1,104,384/8),Xm=Lr(1,72,512/8),Gc=(n,t,e)=>ku((r={})=>new Dn(t,n,r.dkLen===void 0?e:r.dkLen,!0)),Qm=Gc(31,168,128/8),t1=Gc(31,136,256/8)});var s1,Do,ya,jc=vt(()=>{s1=C(z(),1);fi();gr();Do=class extends pr{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,wu(t);let r=yr(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,s=new Uint8Array(i);s.set(r.length>i?t.create().update(r).digest():r);for(let c=0;cnew Do(n,t).update(e).digest();ya.create=(n,t)=>new Do(n,t)});function Yc(n){n.lowS!==void 0&&Fe("lowS",n.lowS),n.prehash!==void 0&&Fe("prehash",n.prehash)}function H0(n){let t=di(n);Ge(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:e,Fp:r,a:i}=t;if(e){if(!r.eql(i,r.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof e!="object"||typeof e.beta!="bigint"||typeof e.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...t})}function G0(n){let t=H0(n),{Fp:e}=t,r=kr(t.n,t.nBitLength),i=t.toBytes||((_,E,U)=>{let K=E.toAffine();return nr(Uint8Array.from([4]),e.toBytes(K.x),e.toBytes(K.y))}),s=t.fromBytes||(_=>{let E=_.subarray(1),U=e.fromBytes(E.subarray(0,e.BYTES)),K=e.fromBytes(E.subarray(e.BYTES,2*e.BYTES));return{x:U,y:K}});function c(_){let{a:E,b:U}=t,K=e.sqr(_),N=e.mul(K,_);return e.add(e.add(N,e.mul(_,E)),U)}if(!e.eql(e.sqr(t.Gy),c(t.Gx)))throw new Error("bad generator point: equation left != right");function p(_){return hi(_,de,t.n)}function y(_){let{allowedPrivateKeyLengths:E,nByteLength:U,wrapPrivateKey:K,n:N}=t;if(E&&typeof _!="bigint"){if(br(_)&&(_=er(_)),typeof _!="string"||!E.includes(_.length))throw new Error("invalid private key");_=_.padStart(U*2,"0")}let D;try{D=typeof _=="bigint"?_:rr(ae("private key",_,U))}catch{throw new Error("invalid private key, expected hex or "+U+" bytes, got "+typeof _)}return K&&(D=te(D,N)),Me("private key",D,de,N),D}function v(_){if(!(_ instanceof I))throw new Error("ProjectivePoint expected")}let x=fn((_,E)=>{let{px:U,py:K,pz:N}=_;if(e.eql(N,e.ONE))return{x:U,y:K};let D=_.is0();E==null&&(E=D?e.ONE:e.inv(N));let rt=e.mul(U,E),H=e.mul(K,E),J=e.mul(N,E);if(D)return{x:e.ZERO,y:e.ZERO};if(!e.eql(J,e.ONE))throw new Error("invZ was invalid");return{x:rt,y:H}}),S=fn(_=>{if(_.is0()){if(t.allowInfinityPoint&&!e.is0(_.py))return;throw new Error("bad point: ZERO")}let{x:E,y:U}=_.toAffine();if(!e.isValid(E)||!e.isValid(U))throw new Error("bad point: x or y not FE");let K=e.sqr(U),N=c(E);if(!e.eql(K,N))throw new Error("bad point: equation left != right");if(!_.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class I{constructor(E,U,K){if(this.px=E,this.py=U,this.pz=K,E==null||!e.isValid(E))throw new Error("x required");if(U==null||!e.isValid(U))throw new Error("y required");if(K==null||!e.isValid(K))throw new Error("z required");Object.freeze(this)}static fromAffine(E){let{x:U,y:K}=E||{};if(!E||!e.isValid(U)||!e.isValid(K))throw new Error("invalid affine point");if(E instanceof I)throw new Error("projective point not allowed");let N=D=>e.eql(D,e.ZERO);return N(U)&&N(K)?I.ZERO:new I(U,K,e.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(E){let U=e.invertBatch(E.map(K=>K.pz));return E.map((K,N)=>K.toAffine(U[N])).map(I.fromAffine)}static fromHex(E){let U=I.fromAffine(s(ae("pointHex",E)));return U.assertValidity(),U}static fromPrivateKey(E){return I.BASE.multiply(y(E))}static msm(E,U){return eo(I,r,E,U)}_setWindowSize(E){R.setWindowSize(this,E)}assertValidity(){S(this)}hasEvenY(){let{y:E}=this.toAffine();if(e.isOdd)return!e.isOdd(E);throw new Error("Field doesn\'t support isOdd")}equals(E){v(E);let{px:U,py:K,pz:N}=this,{px:D,py:rt,pz:H}=E,J=e.eql(e.mul(U,H),e.mul(D,N)),nt=e.eql(e.mul(K,H),e.mul(rt,N));return J&&nt}negate(){return new I(this.px,e.neg(this.py),this.pz)}double(){let{a:E,b:U}=t,K=e.mul(U,Jc),{px:N,py:D,pz:rt}=this,H=e.ZERO,J=e.ZERO,nt=e.ZERO,tt=e.mul(N,N),Yt=e.mul(D,D),G=e.mul(rt,rt),st=e.mul(N,D);return st=e.add(st,st),nt=e.mul(N,rt),nt=e.add(nt,nt),H=e.mul(E,nt),J=e.mul(K,G),J=e.add(H,J),H=e.sub(Yt,J),J=e.add(Yt,J),J=e.mul(H,J),H=e.mul(st,H),nt=e.mul(K,nt),G=e.mul(E,G),st=e.sub(tt,G),st=e.mul(E,st),st=e.add(st,nt),nt=e.add(tt,tt),tt=e.add(nt,tt),tt=e.add(tt,G),tt=e.mul(tt,st),J=e.add(J,tt),G=e.mul(D,rt),G=e.add(G,G),tt=e.mul(G,st),H=e.sub(H,tt),nt=e.mul(G,Yt),nt=e.add(nt,nt),nt=e.add(nt,nt),new I(H,J,nt)}add(E){v(E);let{px:U,py:K,pz:N}=this,{px:D,py:rt,pz:H}=E,J=e.ZERO,nt=e.ZERO,tt=e.ZERO,Yt=t.a,G=e.mul(t.b,Jc),st=e.mul(U,D),m=e.mul(K,rt),o=e.mul(N,H),u=e.add(U,K),f=e.add(D,rt);u=e.mul(u,f),f=e.add(st,m),u=e.sub(u,f),f=e.add(U,N);let h=e.add(D,H);return f=e.mul(f,h),h=e.add(st,o),f=e.sub(f,h),h=e.add(K,N),J=e.add(rt,H),h=e.mul(h,J),J=e.add(m,o),h=e.sub(h,J),tt=e.mul(Yt,f),J=e.mul(G,o),tt=e.add(J,tt),J=e.sub(m,tt),tt=e.add(m,tt),nt=e.mul(J,tt),m=e.add(st,st),m=e.add(m,st),o=e.mul(Yt,o),f=e.mul(G,f),m=e.add(m,o),o=e.sub(st,o),o=e.mul(Yt,o),f=e.add(f,o),st=e.mul(m,f),nt=e.add(nt,st),st=e.mul(h,f),J=e.mul(u,J),J=e.sub(J,st),st=e.mul(u,m),tt=e.mul(h,tt),tt=e.add(tt,st),new I(J,nt,tt)}subtract(E){return this.add(E.negate())}is0(){return this.equals(I.ZERO)}wNAF(E){return R.wNAFCached(this,E,I.normalizeZ)}multiplyUnsafe(E){let{endo:U,n:K}=t;Me("scalar",E,ar,K);let N=I.ZERO;if(E===ar)return N;if(this.is0()||E===de)return this;if(!U||R.hasPrecomputes(this))return R.wNAFCachedUnsafe(this,E,I.normalizeZ);let{k1neg:D,k1:rt,k2neg:H,k2:J}=U.splitScalar(E),nt=N,tt=N,Yt=this;for(;rt>ar||J>ar;)rt&de&&(nt=nt.add(Yt)),J&de&&(tt=tt.add(Yt)),Yt=Yt.double(),rt>>=de,J>>=de;return D&&(nt=nt.negate()),H&&(tt=tt.negate()),tt=new I(e.mul(tt.px,U.beta),tt.py,tt.pz),nt.add(tt)}multiply(E){let{endo:U,n:K}=t;Me("scalar",E,de,K);let N,D;if(U){let{k1neg:rt,k1:H,k2neg:J,k2:nt}=U.splitScalar(E),{p:tt,f:Yt}=this.wNAF(H),{p:G,f:st}=this.wNAF(nt);tt=R.constTimeNegate(rt,tt),G=R.constTimeNegate(J,G),G=new I(e.mul(G.px,U.beta),G.py,G.pz),N=tt.add(G),D=Yt.add(st)}else{let{p:rt,f:H}=this.wNAF(E);N=rt,D=H}return I.normalizeZ([N,D])[0]}multiplyAndAddUnsafe(E,U,K){let N=I.BASE,D=(H,J)=>J===ar||J===de||!H.equals(N)?H.multiplyUnsafe(J):H.multiply(J),rt=D(this,U).add(D(E,K));return rt.is0()?void 0:rt}toAffine(E){return x(this,E)}isTorsionFree(){let{h:E,isTorsionFree:U}=t;if(E===de)return!0;if(U)return U(I,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:E,clearCofactor:U}=t;return E===de?this:U?U(I,this):this.multiplyUnsafe(t.h)}toRawBytes(E=!0){return Fe("isCompressed",E),this.assertValidity(),i(I,this,E)}toHex(E=!0){return Fe("isCompressed",E),er(this.toRawBytes(E))}}I.BASE=new I(t.Gx,t.Gy,e.ONE),I.ZERO=new I(e.ZERO,e.ONE,e.ZERO);let B=t.nBitLength,R=to(I,t.endo?Math.ceil(B/2):B);return{CURVE:t,ProjectivePoint:I,normPrivateKeyToScalar:y,weierstrassEquation:c,isWithinCurveOrder:p}}function Z0(n){let t=di(n);return Ge(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Xc(n){let t=Z0(n),{Fp:e,n:r}=t,i=e.BYTES+1,s=2*e.BYTES+1;function c(o){return te(o,r)}function p(o){return Xi(o,r)}let{ProjectivePoint:y,normPrivateKeyToScalar:v,weierstrassEquation:x,isWithinCurveOrder:S}=G0({...t,toBytes(o,u,f){let h=u.toAffine(),l=e.toBytes(h.x),w=nr;return Fe("isCompressed",f),f?w(Uint8Array.from([u.hasEvenY()?2:3]),l):w(Uint8Array.from([4]),l,e.toBytes(h.y))},fromBytes(o){let u=o.length,f=o[0],h=o.subarray(1);if(u===i&&(f===2||f===3)){let l=rr(h);if(!hi(l,de,e.ORDER))throw new Error("Point is not on curve");let w=x(l),b;try{b=e.sqrt(w)}catch(g){let A=g instanceof Error?": "+g.message:"";throw new Error("Point is not on curve"+A)}let d=(b&de)===de;return(f&1)===1!==d&&(b=e.neg(b)),{x:l,y:b}}else if(u===s&&f===4){let l=e.fromBytes(h.subarray(0,e.BYTES)),w=e.fromBytes(h.subarray(e.BYTES,2*e.BYTES));return{x:l,y:w}}else{let l=i,w=s;throw new Error("invalid Point, expected length of "+l+", or uncompressed "+w+", got "+u)}}}),I=o=>er(xr(o,t.nByteLength));function B(o){let u=r>>de;return o>u}function R(o){return B(o)?c(-o):o}let _=(o,u,f)=>rr(o.slice(u,f));class E{constructor(u,f,h){this.r=u,this.s=f,this.recovery=h,this.assertValidity()}static fromCompact(u){let f=t.nByteLength;return u=ae("compactSignature",u,f*2),new E(_(u,0,f),_(u,f,2*f))}static fromDER(u){let{r:f,s:h}=sr.toSig(ae("DER",u));return new E(f,h)}assertValidity(){Me("r",this.r,de,r),Me("s",this.s,de,r)}addRecoveryBit(u){return new E(this.r,this.s,u)}recoverPublicKey(u){let{r:f,s:h,recovery:l}=this,w=H(ae("msgHash",u));if(l==null||![0,1,2,3].includes(l))throw new Error("recovery id invalid");let b=l===2||l===3?f+t.n:f;if(b>=e.ORDER)throw new Error("recovery id 2 or 3 invalid");let d=l&1?"03":"02",a=y.fromHex(d+I(b)),g=p(b),A=c(-w*g),T=c(h*g),P=y.BASE.multiplyAndAddUnsafe(a,A,T);if(!P)throw new Error("point at infinify");return P.assertValidity(),P}hasHighS(){return B(this.s)}normalizeS(){return this.hasHighS()?new E(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return un(this.toDERHex())}toDERHex(){return sr.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return un(this.toCompactHex())}toCompactHex(){return I(this.r)+I(this.s)}}let U={isValidPrivateKey(o){try{return v(o),!0}catch{return!1}},normPrivateKeyToScalar:v,randomPrivateKey:()=>{let o=Ts(t.n);return Cu(t.randomBytes(o),t.n)},precompute(o=8,u=y.BASE){return u._setWindowSize(o),u.multiply(BigInt(3)),u}};function K(o,u=!0){return y.fromPrivateKey(o).toRawBytes(u)}function N(o){let u=br(o),f=typeof o=="string",h=(u||f)&&o.length;return u?h===i||h===s:f?h===2*i||h===2*s:o instanceof y}function D(o,u,f=!0){if(N(o))throw new Error("first arg must be private key");if(!N(u))throw new Error("second arg must be public key");return y.fromHex(u).multiply(v(o)).toRawBytes(f)}let rt=t.bits2int||function(o){if(o.length>8192)throw new Error("input is too large");let u=rr(o),f=o.length*8-t.nBitLength;return f>0?u>>BigInt(f):u},H=t.bits2int_modN||function(o){return c(rt(o))},J=li(t.nBitLength);function nt(o){return Me("num < 2^"+t.nBitLength,o,ar,J),xr(o,t.nByteLength)}function tt(o,u,f=Yt){if(["recovered","canonical"].some(V=>V in f))throw new Error("sign() legacy options not supported");let{hash:h,randomBytes:l}=t,{lowS:w,prehash:b,extraEntropy:d}=f;w==null&&(w=!0),o=ae("msgHash",o),Yc(f),b&&(o=ae("prehashed msgHash",h(o)));let a=H(o),g=v(u),A=[nt(g),nt(a)];if(d!=null&&d!==!1){let V=d===!0?l(e.BYTES):d;A.push(ae("extraEntropy",V))}let T=nr(...A),P=a;function F(V){let Y=rt(V);if(!S(Y))return;let Gt=p(Y),X=y.BASE.multiply(Y).toAffine(),Q=c(X.x);if(Q===ar)return;let we=c(Gt*c(P+Q*g));if(we===ar)return;let at=(X.x===Q?0:2)|Number(X.y&de),ct=we;return w&&B(we)&&(ct=R(we),at^=1),new E(Q,ct,at)}return{seed:T,k2sig:F}}let Yt={lowS:t.lowS,prehash:!1},G={lowS:t.lowS,prehash:!1};function st(o,u,f=Yt){let{seed:h,k2sig:l}=tt(o,u,f),w=t;return As(w.hash.outputLen,w.nByteLength,w.hmac)(h,l)}y.BASE._setWindowSize(8);function m(o,u,f,h=G){let l=o;u=ae("msgHash",u),f=ae("publicKey",f);let{lowS:w,prehash:b,format:d}=h;if(Yc(h),"strict"in h)throw new Error("options.strict was renamed to lowS");if(d!==void 0&&d!=="compact"&&d!=="der")throw new Error("format must be compact or der");let a=typeof l=="string"||br(l),g=!a&&!d&&typeof l=="object"&&l!==null&&typeof l.r=="bigint"&&typeof l.s=="bigint";if(!a&&!g)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let A,T;try{if(g&&(A=new E(l.r,l.s)),a){try{d!=="compact"&&(A=E.fromDER(l))}catch(at){if(!(at instanceof sr.Err))throw at}!A&&d!=="der"&&(A=E.fromCompact(l))}T=y.fromHex(f)}catch{return!1}if(!A||w&&A.hasHighS())return!1;b&&(u=t.hash(u));let{r:P,s:F}=A,V=H(u),Y=p(F),Gt=c(V*Y),X=c(P*Y),Q=y.BASE.multiplyAndAddUnsafe(T,Gt,X)?.toAffine();return Q?c(Q.x)===P:!1}return{CURVE:t,getPublicKey:K,getSharedSecret:D,sign:st,verify:m,ProjectivePoint:y,Signature:E,utils:U}}var d1,$0,V0,ga,sr,ar,de,f1,Jc,h1,Qc=vt(()=>{d1=C(z(),1);Ns();On();hn();hn();({bytesToNumberBE:$0,hexToBytes:V0}=Ji),ga=class extends Error{constructor(t=""){super(t)}},sr={Err:ga,_tlv:{encode:(n,t)=>{let{Err:e}=sr;if(n<0||n>256)throw new e("tlv.encode: wrong tag");if(t.length&1)throw new e("tlv.encode: unpadded data");let r=t.length/2,i=an(r);if(i.length/2&128)throw new e("tlv.encode: long form length too big");let s=r>127?an(i.length/2|128):"";return an(n)+s+i+t},decode(n,t){let{Err:e}=sr,r=0;if(n<0||n>256)throw new e("tlv.encode: wrong tag");if(t.length<2||t[r++]!==n)throw new e("tlv.decode: wrong tlv");let i=t[r++],s=!!(i&128),c=0;if(!s)c=i;else{let y=i&127;if(!y)throw new e("tlv.decode(long): indefinite length not supported");if(y>4)throw new e("tlv.decode(long): byte length is too big");let v=t.subarray(r,r+y);if(v.length!==y)throw new e("tlv.decode: length bytes not complete");if(v[0]===0)throw new e("tlv.decode(long): zero leftmost byte");for(let x of v)c=c<<8|x;if(r+=y,c<128)throw new e("tlv.decode(long): not minimal encoding")}let p=t.subarray(r,r+c);if(p.length!==c)throw new e("tlv.decode: wrong value length");return{v:p,l:t.subarray(r+c)}}},_int:{encode(n){let{Err:t}=sr;if(nya(n,t,ps(...e)),randomBytes:Gi}}function tf(n,t){let e=r=>Xc({...n,...j0(r)});return{...e(t),create:e}}var w1,ef=vt(()=>{w1=C(z(),1);jc();gr();Qc();});function J0(n){let t=of,e=BigInt(3),r=BigInt(6),i=BigInt(11),s=BigInt(22),c=BigInt(23),p=BigInt(44),y=BigInt(88),v=n*n*n%t,x=v*v*n%t,S=oe(x,e,t)*x%t,I=oe(S,e,t)*x%t,B=oe(I,ma,t)*v%t,R=oe(B,i,t)*B%t,_=oe(R,s,t)*R%t,E=oe(_,p,t)*_%t,U=oe(E,y,t)*E%t,K=oe(U,p,t)*_%t,N=oe(K,e,t)*x%t,D=oe(N,c,t)*R%t,rt=oe(D,r,t)*v%t,H=oe(rt,ma,t);if(!wa.eql(wa.sqr(H),n))throw new Error("Cannot find square root");return H}var E1,of,rf,Y0,ma,nf,wa,Ai,k1,S1,sf=vt(()=>{E1=C(z(),1);Hs();ef();On();of=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),rf=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Y0=BigInt(1),ma=BigInt(2),nf=(n,t)=>(n+t/ma)/t;wa=kr(of,void 0,void 0,{sqrt:J0}),Ai=tf({a:BigInt(0),b:BigInt(7),Fp:wa,n:rf,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:n=>{let t=rf,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Y0*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=e,c=BigInt("0x100000000000000000000000000000000"),p=nf(s*n,t),y=nf(-r*n,t),v=te(n-p*e-y*i,t),x=te(-p*r-y*s,t),S=v>c,I=x>c;if(S&&(v=t-v),I&&(x=t-x),v>c||x>c)throw new Error("splitScalar: Endomorphism failed, k="+n);return{k1neg:S,k1:v,k2neg:I,k2:x}}}},pi),k1=BigInt(0),S1=Ai.ProjectivePoint});function uf(n){try{return dn.ExtendedPoint.fromHex(n),!0}catch{return!1}}function td(n){return n._bn!==void 0}function Af(n,t){let e=i=>{if(i.span>=0)return i.span;if(typeof i.alloc=="function")return i.alloc(t[i.property]);if("count"in i&&"elementLayout"in i){let s=t[i.property];if(Array.isArray(s))return s.length*e(i.elementLayout)}else if("fields"in i)return Af({layout:i},t[i.property]);return 0},r=0;return n.layout.fields.forEach(i=>{r+=e(i)}),r}function Pe(n){let t=0,e=0;for(;;){let r=n.shift();if(t|=(r&127)<>=7,e==0){n.push(r);break}else r|=128,n.push(r)}}function Qt(n,t){if(!n)throw new Error(t||"Assertion failed")}function cr(n){if(n.length===0)throw new Error(Mf);return n.shift()}function Oe(n,...t){let[e]=t;if(t.length===2?e+(t[1]??0)>n.length:e>=n.length)throw new Error(Mf);return n.splice(...t)}async function ff(n,t,e,r){let i=r&&{skipPreflight:r.skipPreflight,preflightCommitment:r.preflightCommitment||r.commitment,maxRetries:r.maxRetries,minContextSlot:r.minContextSlot},s=await n.sendTransaction(t,e,i),c;if(t.recentBlockhash!=null&&t.lastValidBlockHeight!=null)c=(await n.confirmTransaction({abortSignal:r?.abortSignal,signature:s,blockhash:t.recentBlockhash,lastValidBlockHeight:t.lastValidBlockHeight},r&&r.commitment)).value;else if(t.minNonceContextSlot!=null&&t.nonceInfo!=null){let{nonceInstruction:p}=t.nonceInfo,y=p.keys[0].pubkey;c=(await n.confirmTransaction({abortSignal:r?.abortSignal,minContextSlot:t.minNonceContextSlot,nonceAccountPubkey:y,nonceValue:t.nonceInfo.nonce,signature:s},r&&r.commitment)).value}else r?.abortSignal!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),c=(await n.confirmTransaction(s,r&&r.commitment)).value;if(c.err)throw s!=null?new Ci({action:"send",signature:s,transactionMessage:`Status: (${JSON.stringify(c)})`}):new Error(`Transaction ${s} failed (${JSON.stringify(c)})`);return s}function bn(n){return new Promise(t=>setTimeout(t,n))}function Zt(n,t){let e=n.layout.span>=0?n.layout.span:Af(n,t),r=ut.Buffer.alloc(e),i=Object.assign({instruction:n.index},t);return n.layout.encode(i,r),r}function pd(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Ti(n,t){var e,r,i,s,c,p,y;if(n===!0)return"true";if(n===!1)return"false";switch(typeof n){case"object":if(n===null)return null;if(n.toJSON&&typeof n.toJSON=="function")return Ti(n.toJSON(),t);if(y=yd.call(n),y==="[object Array]"){for(i="[",r=n.length-1,e=0;e-1&&(i+=Ti(n[e],!0)),i+"]"}else if(y==="[object Object]"){for(s=gd(n).sort(),r=s.length,i="",e=0;e1;)n/=2,t++;return t}function wd(n){return n===0?1:(n--,n|=n>>1,n|=n>>2,n|=n>>4,n|=n>>8,n|=n>>16,n|=n>>32,n+1)}function vd(n,t){let e;try{e=n.layout.decode(t)}catch(r){throw new Error("invalid instruction; "+r)}if(e.typeIndex!==n.index)throw new Error(`invalid account data; account type mismatch ${e.typeIndex} != ${n.index}`);return e}function Sd(n){let t=n.match(kd);if(t==null)throw TypeError(`Failed to validate endpoint URL \\`${n}\\``);let[e,r,i,s]=t,c=n.startsWith("https:")?"wss:":"ws:",p=i==null?null:parseInt(i.slice(1),10),y=p==null?"":`:${p+1}`;return`${c}//${r}${y}${s}`}function Ed(n){if(/^https?:/.test(n)===!1)throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return n}function ne(n){let t,e;if(typeof n=="string")t=n;else if(n){let{commitment:r,...i}=n;t=r,e=i}return{commitment:t,config:e}}function pf(n){return n.map(t=>"memcmp"in t?{...t,memcmp:{...t.memcmp,encoding:t.memcmp.encoding??"base58"}}:t)}function Cf(n){return ve([q({jsonrpc:se("2.0"),id:W(),result:n}),q({jsonrpc:se("2.0"),id:W(),error:q({code:wn(),message:W(),data:it(cc())})})])}function Ht(n){return Kn(Cf(n),Id,t=>"error"in t?t:{...t,result:$(t.result,n)})}function ce(n){return Ht(q({context:q({slot:M()}),value:n}))}function Qo(n){return q({context:q({slot:M()}),value:n})}function ka(n,t){return n===0?new Sn({header:t.header,staticAccountKeys:t.accountKeys.map(e=>new ot(e)),recentBlockhash:t.recentBlockhash,compiledInstructions:t.instructions.map(e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:pe.default.decode(e.data)})),addressTableLookups:t.addressTableLookups}):new He(t)}function Fd(n,t,e,r,i,s){let c=e||bd,p;s!=null&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments.");let y;return r&&(y=async(x,S)=>{let I=await new Promise((B,R)=>{try{r(x,S,(_,E)=>B([_,E]))}catch(_){R(_)}});return await c(...I)}),new If.default(async(x,S)=>{let I={method:"POST",body:x,agent:p,headers:Object.assign({"Content-Type":"application/json"},t||{},Kp)};try{let B=5,R,_=500;for(;y?R=await y(n,I):R=await c(n,I),!(R.status!==429||i===!0||(B-=1,B===0));)console.error(`Server responded with ${R.status} ${R.statusText}. Retrying after ${_}ms delay...`),await bn(_),_*=2;let E=await R.text();R.ok?S(null,E):S(new Error(`${R.status} ${R.statusText}: ${E}`))}catch(B){B instanceof Error&&S(B)}},{})}function Kd(n){return(t,e)=>new Promise((r,i)=>{n.request(t,e,(s,c)=>{if(s){i(s);return}r(c)})})}function Dd(n){return t=>new Promise((e,r)=>{t.length===0&&e([]);let i=t.map(s=>n.request(s.methodName,s.args));n.request(i,(s,c)=>{if(s){r(s);return}e(c)})})}function Hf(n,t){let e=t===!1?"http":"https";if(!n)return Bf[e].devnet;let r=Bf[e][n];if(!r)throw new Error(`Unknown ${e} cluster: ${n}`);return r}var G1,ut,Ia,pe,Yn,k,Ef,qi,If,T1,af,_a,Ua,X0,Vt,Aa,$o,_f,Q0,Pr,cf,ot,P1,xn,Na,Vo,Go,Zo,vn,Hn,$t,ed,Wn,rd,nd,id,od,$n,Mf,He,Sn,Lf,Rr,sd,re,jt,Vn,ad,ud,cd,Rf,ur,C1,O1,ba,Pi,U1,N1,z1,va,Ci,et,fd,Tf,hf,Oi,hd,ld,Gn,ze,ye,dd,Zn,q1,yd,gd,md,lf,Mi,Ma,bd,La,df,jo,xd,kd,ue,Pf,za,Bd,Id,_d,Ad,Md,Ld,Rd,Td,Pd,Bn,Cd,Od,Ud,Nd,zd,yf,qd,Wd,Hd,$d,Vd,Gd,Zd,jd,Yd,Ra,Jd,Xd,Ta,Qd,tp,Ui,ep,rp,Pa,np,ip,op,sp,ap,up,cp,fp,hp,lp,dp,pp,yp,gp,gf,mp,wp,bp,vp,xp,Of,qa,Uf,Nf,zf,qf,kp,Sp,Ff,Kf,Yo,Df,ts,Fa,Jn,En,Bp,Ep,Ip,_p,Ap,Mp,Lp,mf,Sa,Wo,Rp,Tp,Pp,Cp,Op,Up,Np,zp,qp,Fp,Kp,Jo,fr,Li,Ca,Ho,Oa,wf,bf,vf,xf,Ni,Dp,Wp,kf,Ba,Sf,Hp,Ea,kn,Wf,$p,zi,Tr,F1,Xo,Ri,K1,jn,D1,W1,H1,$1,Bf,$f=vt(()=>{G1=C(z()),ut=C(Ln());Du();Ia=C(Hu()),pe=C(Ds());Hs();Yn=C(ic()),k=C(ta()),Ef=C(ta()),qi=C(oc());fc();If=C(Cc());Kc();Zc();sf();T1=dn.utils.randomPrivateKey,af=()=>{let n=dn.utils.randomPrivateKey(),t=_a(n),e=new Uint8Array(64);return e.set(n),e.set(t,32),{publicKey:t,secretKey:e}},_a=dn.getPublicKey;Ua=(n,t)=>dn.sign(n,t.slice(0,32)),X0=dn.verify,Vt=n=>ut.Buffer.isBuffer(n)?n:n instanceof Uint8Array?ut.Buffer.from(n.buffer,n.byteOffset,n.byteLength):ut.Buffer.from(n),Aa=class{constructor(t){Object.assign(this,t)}encode(){return ut.Buffer.from((0,Yn.serialize)($o,this))}static decode(t){return(0,Yn.deserialize)($o,this,t)}static decodeUnchecked(t){return(0,Yn.deserializeUnchecked)($o,this,t)}},$o=new Map,Q0=32,Pr=32;cf=1,ot=class extends Aa{constructor(t){if(super({}),this._bn=void 0,td(t))this._bn=t._bn;else{if(typeof t=="string"){let e=pe.default.decode(t);if(e.length!=Pr)throw new Error("Invalid public key input");this._bn=new Ia.default(e)}else this._bn=new Ia.default(t);if(this._bn.byteLength()>Pr)throw new Error("Invalid public key input")}}static unique(){let t=new ot(cf);return cf+=1,new ot(t.toBuffer())}equals(t){return this._bn.eq(t._bn)}toBase58(){return pe.default.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){let t=this.toBuffer();return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}toBuffer(){let t=this._bn.toArrayLike(ut.Buffer);if(t.length===Pr)return t;let e=ut.Buffer.alloc(32);return t.copy(e,32-t.length),e}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(t,e,r){let i=ut.Buffer.concat([t.toBuffer(),ut.Buffer.from(e),r.toBuffer()]),s=pi(i);return new ot(s)}static createProgramAddressSync(t,e){let r=ut.Buffer.alloc(0);t.forEach(function(s){if(s.length>Q0)throw new TypeError("Max seed length exceeded");r=ut.Buffer.concat([r,Vt(s)])}),r=ut.Buffer.concat([r,e.toBuffer(),ut.Buffer.from("ProgramDerivedAddress")]);let i=pi(r);if(uf(i))throw new Error("Invalid seeds, address must fall off the curve");return new ot(i)}static async createProgramAddress(t,e){return this.createProgramAddressSync(t,e)}static findProgramAddressSync(t,e){let r=255,i;for(;r!=0;){try{let s=t.concat(ut.Buffer.from([r]));i=this.createProgramAddressSync(s,e)}catch(s){if(s instanceof TypeError)throw s;r--;continue}return[i,r]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(t,e){return this.findProgramAddressSync(t,e)}static isOnCurve(t){let e=new ot(t);return uf(e.toBytes())}};_f=ot;ot.default=new _f("11111111111111111111111111111111");$o.set(ot,{kind:"struct",fields:[["_bn","u256"]]});P1=new ot("BPFLoader1111111111111111111111111111111111"),xn=1280-40-8,Na=127,Vo=64,Go=class extends Error{constructor(t){super(`Signature ${t} has expired: block height exceeded.`),this.signature=void 0,this.signature=t}};Object.defineProperty(Go.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});Zo=class extends Error{constructor(t,e){super(`Transaction was not confirmed in ${e.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${t} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=t}};Object.defineProperty(Zo.prototype,"name",{value:"TransactionExpiredTimeoutError"});vn=class extends Error{constructor(t){super(`Signature ${t} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=t}};Object.defineProperty(vn.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});Hn=class{constructor(t,e){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=e}keySegments(){let t=[this.staticAccountKeys];return this.accountKeysFromLookups&&(t.push(this.accountKeysFromLookups.writable),t.push(this.accountKeysFromLookups.readonly)),t}get(t){for(let e of this.keySegments()){if(t255+1)throw new Error("Account index overflow encountered during compilation");let r=new Map;this.keySegments().flat().forEach((s,c)=>{r.set(s.toBase58(),c)});let i=s=>{let c=r.get(s.toBase58());if(c===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return c};return t.map(s=>({programIdIndex:i(s.programId),accountKeyIndexes:s.keys.map(c=>i(c.pubkey)),data:s.data}))}},$t=(n="publicKey")=>k.blob(32,n),ed=(n="signature")=>k.blob(64,n),Wn=(n="string")=>{let t=k.struct([k.u32("length"),k.u32("lengthPadding"),k.blob(k.offset(k.u32(),-8),"chars")],n),e=t.decode.bind(t),r=t.encode.bind(t),i=t;return i.decode=(s,c)=>e(s,c).chars.toString(),i.encode=(s,c,p)=>{let y={chars:ut.Buffer.from(s,"utf8")};return r(y,c,p)},i.alloc=s=>k.u32().span+k.u32().span+ut.Buffer.from(s,"utf8").length,i},rd=(n="authorized")=>k.struct([$t("staker"),$t("withdrawer")],n),nd=(n="lockup")=>k.struct([k.ns64("unixTimestamp"),k.ns64("epoch"),$t("custodian")],n),id=(n="voteInit")=>k.struct([$t("nodePubkey"),$t("authorizedVoter"),$t("authorizedWithdrawer"),k.u8("commission")],n),od=(n="voteAuthorizeWithSeedArgs")=>k.struct([k.u32("voteAuthorizationType"),$t("currentAuthorityDerivedKeyOwnerPubkey"),Wn("currentAuthorityDerivedKeySeed"),$t("newAuthorized")],n);$n=class{constructor(t,e){this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=e}static compile(t,e){let r=new Map,i=c=>{let p=c.toBase58(),y=r.get(p);return y===void 0&&(y={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(p,y)),y},s=i(e);s.isSigner=!0,s.isWritable=!0;for(let c of t){i(c.programId).isInvoked=!0;for(let p of c.keys){let y=i(p.pubkey);y.isSigner||=p.isSigner,y.isWritable||=p.isWritable}}return new $n(e,r)}getMessageComponents(){let t=[...this.keyMetaMap.entries()];Qt(t.length<=256,"Max static account keys length exceeded");let e=t.filter(([,y])=>y.isSigner&&y.isWritable),r=t.filter(([,y])=>y.isSigner&&!y.isWritable),i=t.filter(([,y])=>!y.isSigner&&y.isWritable),s=t.filter(([,y])=>!y.isSigner&&!y.isWritable),c={numRequiredSignatures:e.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:s.length};{Qt(e.length>0,"Expected at least one writable signer key");let[y]=e[0];Qt(y===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}let p=[...e.map(([y])=>new ot(y)),...r.map(([y])=>new ot(y)),...i.map(([y])=>new ot(y)),...s.map(([y])=>new ot(y))];return[c,p]}extractTableLookup(t){let[e,r]=this.drainKeysFoundInLookupTable(t.state.addresses,c=>!c.isSigner&&!c.isInvoked&&c.isWritable),[i,s]=this.drainKeysFoundInLookupTable(t.state.addresses,c=>!c.isSigner&&!c.isInvoked&&!c.isWritable);if(!(e.length===0&&i.length===0))return[{accountKey:t.key,writableIndexes:e,readonlyIndexes:i},{writable:r,readonly:s}]}drainKeysFoundInLookupTable(t,e){let r=new Array,i=new Array;for(let[s,c]of this.keyMetaMap.entries())if(e(c)){let p=new ot(s),y=t.findIndex(v=>v.equals(p));y>=0&&(Qt(y<256,"Max lookup table index exceeded"),r.push(y),i.push(p),this.keyMetaMap.delete(s))}return[r,i]}},Mf="Reached end of buffer unexpectedly";He=class{constructor(t){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map(e=>new ot(e)),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach(e=>this.indexToProgramIds.set(e.programIdIndex,this.accountKeys[e.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:pe.default.decode(t.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new Hn(this.staticAccountKeys)}static compile(t){let e=$n.compile(t.instructions,t.payerKey),[r,i]=e.getMessageComponents(),c=new Hn(i).compileInstructions(t.instructions).map(p=>({programIdIndex:p.programIdIndex,accounts:p.accountKeyIndexes,data:pe.default.encode(p.data)}));return new He({header:r,accountKeys:i,recentBlockhash:t.recentBlockhash,instructions:c})}isAccountSigner(t){return t=this.header.numRequiredSignatures){let r=t-e,s=this.accountKeys.length-e-this.header.numReadonlyUnsignedAccounts;return r!this.isProgramId(e))}serialize(){let t=this.accountKeys.length,e=[];Ce(e,t);let r=this.instructions.map(S=>{let{accounts:I,programIdIndex:B}=S,R=Array.from(pe.default.decode(S.data)),_=[];Ce(_,I.length);let E=[];return Ce(E,R.length),{programIdIndex:B,keyIndicesCount:ut.Buffer.from(_),keyIndices:I,dataLength:ut.Buffer.from(E),data:R}}),i=[];Ce(i,r.length);let s=ut.Buffer.alloc(xn);ut.Buffer.from(i).copy(s);let c=i.length;r.forEach(S=>{let B=k.struct([k.u8("programIdIndex"),k.blob(S.keyIndicesCount.length,"keyIndicesCount"),k.seq(k.u8("keyIndex"),S.keyIndices.length,"keyIndices"),k.blob(S.dataLength.length,"dataLength"),k.seq(k.u8("userdatum"),S.data.length,"data")]).encode(S,s,c);c+=B}),s=s.slice(0,c);let p=k.struct([k.blob(1,"numRequiredSignatures"),k.blob(1,"numReadonlySignedAccounts"),k.blob(1,"numReadonlyUnsignedAccounts"),k.blob(e.length,"keyCount"),k.seq($t("key"),t,"keys"),$t("recentBlockhash")]),y={numRequiredSignatures:ut.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:ut.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:ut.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:ut.Buffer.from(e),keys:this.accountKeys.map(S=>Vt(S.toBytes())),recentBlockhash:pe.default.decode(this.recentBlockhash)},v=ut.Buffer.alloc(2048),x=p.encode(y,v);return s.copy(v,x),v.slice(0,x+s.length)}static from(t){let e=[...t],r=cr(e);if(r!==(r&Na))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");let i=cr(e),s=cr(e),c=Pe(e),p=[];for(let I=0;I0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new Hn(this.staticAccountKeys,e)}isAccountSigner(t){return t=r){let i=t-r,s=this.addressTableLookups.reduce((c,p)=>c+p.writableIndexes.length,0);return i=this.header.numRequiredSignatures){let i=t-e,c=r-e-this.header.numReadonlyUnsignedAccounts;return is.key.equals(r.accountKey));if(!i)throw new Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(let s of r.writableIndexes)if(sx.toBytes()),recentBlockhash:pe.default.decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:e,addressTableLookupsLength:new Uint8Array(s),serializedAddressTableLookups:i},p);return p.slice(0,v)}serializeInstructions(){let t=0,e=new Uint8Array(xn);for(let r of this.compiledInstructions){let i=Array();Ce(i,r.accountKeyIndexes.length);let s=Array();Ce(s,r.data.length);let c=k.struct([k.u8("programIdIndex"),k.blob(i.length,"encodedAccountKeyIndexesLength"),k.seq(k.u8(),r.accountKeyIndexes.length,"accountKeyIndexes"),k.blob(s.length,"encodedDataLength"),k.blob(r.data.length,"data")]);t+=c.encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(i),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(s),data:r.data},e,t)}return e.slice(0,t)}serializeAddressTableLookups(){let t=0,e=new Uint8Array(xn);for(let r of this.addressTableLookups){let i=Array();Ce(i,r.writableIndexes.length);let s=Array();Ce(s,r.readonlyIndexes.length);let c=k.struct([$t("accountKey"),k.blob(i.length,"encodedWritableIndexesLength"),k.seq(k.u8(),r.writableIndexes.length,"writableIndexes"),k.blob(s.length,"encodedReadonlyIndexesLength"),k.seq(k.u8(),r.readonlyIndexes.length,"readonlyIndexes")]);t+=c.encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(i),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(s),readonlyIndexes:r.readonlyIndexes},e,t)}return e.slice(0,t)}static deserialize(t){let e=[...t],r=cr(e),i=r&Na;Qt(r!==i,"Expected versioned message but received legacy message");let s=i;Qt(s===0,`Expected versioned message with version 0 but found version ${s}`);let c={numRequiredSignatures:cr(e),numReadonlySignedAccounts:cr(e),numReadonlyUnsignedAccounts:cr(e)},p=[],y=Pe(e);for(let R=0;R{let t=Lf.deserializeMessageVersion(n);if(t==="legacy")return He.from(n);if(t===0)return Sn.deserialize(n);throw new Error(`Transaction message version ${t} deserialization is not supported`)}},Rr=function(n){return n[n.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",n[n.PROCESSED=1]="PROCESSED",n[n.TIMED_OUT=2]="TIMED_OUT",n[n.NONCE_INVALID=3]="NONCE_INVALID",n}({}),sd=ut.Buffer.alloc(Vo).fill(0),re=class{constructor(t){this.keys=void 0,this.programId=void 0,this.data=ut.Buffer.alloc(0),this.programId=t.programId,this.keys=t.keys,t.data&&(this.data=t.data)}toJSON(){return{keys:this.keys.map(({pubkey:t,isSigner:e,isWritable:r})=>({pubkey:t.toJSON(),isSigner:e,isWritable:r})),programId:this.programId.toJSON(),data:[...this.data]}}},jt=class{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(t){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!!t)if(t.feePayer&&(this.feePayer=t.feePayer),t.signatures&&(this.signatures=t.signatures),Object.prototype.hasOwnProperty.call(t,"nonceInfo")){let{minContextSlot:e,nonceInfo:r}=t;this.minNonceContextSlot=e,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")){let{blockhash:e,lastValidBlockHeight:r}=t;this.recentBlockhash=e,this.lastValidBlockHeight=r}else{let{recentBlockhash:e,nonceInfo:r}=t;r&&(this.nonceInfo=r),this.recentBlockhash=e}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(t=>t.toJSON()),signers:this.signatures.map(({publicKey:t})=>t.toJSON())}}add(...t){if(t.length===0)throw new Error("No instructions");return t.forEach(e=>{"instructions"in e?this.instructions=this.instructions.concat(e.instructions):"data"in e&&"programId"in e&&"keys"in e?this.instructions.push(e):this.instructions.push(new re(e))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let t,e;if(this.nonceInfo?(t=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?e=[this.nonceInfo.nonceInstruction,...this.instructions]:e=this.instructions):(t=this.recentBlockhash,e=this.instructions),!t)throw new Error("Transaction recentBlockhash required");e.length<1&&console.warn("No instructions provided");let r;if(this.feePayer)r=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)r=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let _=0;_{_.keys.forEach(U=>{s.push({...U})});let E=_.programId.toString();i.includes(E)||i.push(E)}),i.forEach(_=>{s.push({pubkey:new ot(_),isSigner:!1,isWritable:!1})});let c=[];s.forEach(_=>{let E=_.pubkey.toString(),U=c.findIndex(K=>K.pubkey.toString()===E);U>-1?(c[U].isWritable=c[U].isWritable||_.isWritable,c[U].isSigner=c[U].isSigner||_.isSigner):c.push(_)}),c.sort(function(_,E){if(_.isSigner!==E.isSigner)return _.isSigner?-1:1;if(_.isWritable!==E.isWritable)return _.isWritable?-1:1;let U={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return _.pubkey.toBase58().localeCompare(E.pubkey.toBase58(),"en",U)});let p=c.findIndex(_=>_.pubkey.equals(r));if(p>-1){let[_]=c.splice(p,1);_.isSigner=!0,_.isWritable=!0,c.unshift(_)}else c.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(let _ of this.signatures){let E=c.findIndex(U=>U.pubkey.equals(_.publicKey));if(E>-1)c[E].isSigner||(c[E].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw new Error(`unknown signer: ${_.publicKey.toString()}`)}let y=0,v=0,x=0,S=[],I=[];c.forEach(({pubkey:_,isSigner:E,isWritable:U})=>{E?(S.push(_.toString()),y+=1,U||(v+=1)):(I.push(_.toString()),U||(x+=1))});let B=S.concat(I),R=e.map(_=>{let{data:E,programId:U}=_;return{programIdIndex:B.indexOf(U.toString()),accounts:_.keys.map(K=>B.indexOf(K.pubkey.toString())),data:pe.default.encode(E)}});return R.forEach(_=>{Qt(_.programIdIndex>=0),_.accounts.forEach(E=>Qt(E>=0))}),new He({header:{numRequiredSignatures:y,numReadonlySignedAccounts:v,numReadonlyUnsignedAccounts:x},accountKeys:B,recentBlockhash:t,instructions:R})}_compile(){let t=this.compileMessage(),e=t.accountKeys.slice(0,t.header.numRequiredSignatures);return this.signatures.length===e.length&&this.signatures.every((i,s)=>e[s].equals(i.publicKey))||(this.signatures=e.map(r=>({signature:null,publicKey:r}))),t}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(t){return(await t.getFeeForMessage(this.compileMessage())).value}setSigners(...t){if(t.length===0)throw new Error("No signers");let e=new Set;this.signatures=t.filter(r=>{let i=r.toString();return e.has(i)?!1:(e.add(i),!0)}).map(r=>({signature:null,publicKey:r}))}sign(...t){if(t.length===0)throw new Error("No signers");let e=new Set,r=[];for(let s of t){let c=s.publicKey.toString();e.has(c)||(e.add(c),r.push(s))}this.signatures=r.map(s=>({signature:null,publicKey:s.publicKey}));let i=this._compile();this._partialSign(i,...r)}partialSign(...t){if(t.length===0)throw new Error("No signers");let e=new Set,r=[];for(let s of t){let c=s.publicKey.toString();e.has(c)||(e.add(c),r.push(s))}let i=this._compile();this._partialSign(i,...r)}_partialSign(t,...e){let r=t.serialize();e.forEach(i=>{let s=Ua(r,i.secretKey);this._addSignature(i.publicKey,Vt(s))})}addSignature(t,e){this._compile(),this._addSignature(t,e)}_addSignature(t,e){Qt(e.length===64);let r=this.signatures.findIndex(i=>t.equals(i.publicKey));if(r<0)throw new Error(`unknown signer: ${t.toString()}`);this.signatures[r].signature=ut.Buffer.from(e)}verifySignatures(t=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),t)}_getMessageSignednessErrors(t,e){let r={};for(let{signature:i,publicKey:s}of this.signatures)i===null?e&&(r.missing||=[]).push(s):X0(i,t,s.toBytes())||(r.invalid||=[]).push(s);return r.invalid||r.missing?r:void 0}serialize(t){let{requireAllSignatures:e,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},t),i=this.serializeMessage();if(r){let s=this._getMessageSignednessErrors(i,e);if(s){let c="Signature verification failed.";throw s.invalid&&(c+=`\nInvalid signature for public key${s.invalid.length===1?"":"(s)"} [\\`${s.invalid.map(p=>p.toBase58()).join("`, `")}\\`].`),s.missing&&(c+=`\nMissing signature for public key${s.missing.length===1?"":"(s)"} [\\`${s.missing.map(p=>p.toBase58()).join("`, `")}\\`].`),new Error(c)}}return this._serialize(i)}_serialize(t){let{signatures:e}=this,r=[];Ce(r,e.length);let i=r.length+e.length*64+t.length,s=ut.Buffer.alloc(i);return Qt(e.length<256),ut.Buffer.from(r).copy(s,0),e.forEach(({signature:c},p)=>{c!==null&&(Qt(c.length===64,"signature has invalid length"),ut.Buffer.from(c).copy(s,r.length+p*64))}),t.copy(s,r.length+e.length*64),Qt(s.length<=xn,`Transaction too large: ${s.length} > ${xn}`),s}get keys(){return Qt(this.instructions.length===1),this.instructions[0].keys.map(t=>t.pubkey)}get programId(){return Qt(this.instructions.length===1),this.instructions[0].programId}get data(){return Qt(this.instructions.length===1),this.instructions[0].data}static from(t){let e=[...t],r=Pe(e),i=[];for(let s=0;s0&&(r.feePayer=t.accountKeys[0]),e.forEach((i,s)=>{let c={signature:i==pe.default.encode(sd)?null:pe.default.decode(i),publicKey:t.accountKeys[s]};r.signatures.push(c)}),t.instructions.forEach(i=>{let s=i.accounts.map(c=>{let p=t.accountKeys[c];return{pubkey:p,isSigner:r.signatures.some(y=>y.publicKey.toString()===p.toString())||t.isAccountSigner(c),isWritable:t.isAccountWritable(c)}});r.instructions.push(new re({keys:s,programId:t.accountKeys[i.programIdIndex],data:pe.default.decode(i.data)}))}),r._message=t,r._json=r.toJSON(),r}},Vn=class{get version(){return this.message.version}constructor(t,e){if(this.signatures=void 0,this.message=void 0,e!==void 0)Qt(e.length===t.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=e;else{let r=[];for(let i=0;ic.equals(i.publicKey));Qt(s>=0,`Cannot sign with non signer key ${i.publicKey.toBase58()}`),this.signatures[s]=Ua(e,i.secretKey)}}addSignature(t,e){Qt(e.byteLength===64,"Signature must be 64 bytes long");let i=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(s=>s.equals(t));Qt(i>=0,`Can not add signature; \\`${t.toBase58()}\\` is not required to sign this transaction`),this.signatures[i]=e}},ad=160,ud=64,cd=ad/ud,Rf=1e3/cd,ur=new ot("SysvarC1ock11111111111111111111111111111111"),C1=new ot("SysvarEpochSchedu1e111111111111111111111111"),O1=new ot("Sysvar1nstructions1111111111111111111111111"),ba=new ot("SysvarRecentB1ockHashes11111111111111111111"),Pi=new ot("SysvarRent111111111111111111111111111111111"),U1=new ot("SysvarRewards111111111111111111111111111111"),N1=new ot("SysvarS1otHashes111111111111111111111111111"),z1=new ot("SysvarS1otHistory11111111111111111111111111"),va=new ot("SysvarStakeHistory1111111111111111111111111"),Ci=class extends Error{constructor({action:t,signature:e,transactionMessage:r,logs:i}){let s=i?`Logs: \n${JSON.stringify(i.slice(-10),null,2)}. `:"",c="\\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.",p;switch(t){case"send":p=`Transaction ${e} resulted in an error. \n${r}. `+s+c;break;case"simulate":p=`Simulation failed. \nMessage: ${r}. \n`+s+c;break;default:p=`Unknown action \'${(y=>y)(t)}\'`}super(p),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=e,this.transactionMessage=r,this.transactionLogs=i||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){let t=this.transactionLogs;if(!(t!=null&&typeof t=="object"&&"then"in t))return t}async getLogs(t){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((e,r)=>{t.getTransaction(this.signature).then(i=>{if(i&&i.meta&&i.meta.logMessages){let s=i.meta.logMessages;this.transactionLogs=s,e(s)}else r(new Error("Log messages not found"))}).catch(r)})),await this.transactionLogs}},et=class extends Error{constructor({code:t,message:e,data:r},i){super(i!=null?`${i}: ${e}`:e),this.code=void 0,this.data=void 0,this.code=t,this.data=r,this.name="SolanaJSONRPCError"}};fd=k.nu64("lamportsPerSignature"),Tf=k.struct([k.u32("version"),k.u32("state"),$t("authorizedPubkey"),$t("nonce"),k.struct([fd],"feeCalculator")]),hf=Tf.span,Oi=class{constructor(t){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=t.authorizedPubkey,this.nonce=t.nonce,this.feeCalculator=t.feeCalculator}static fromAccountData(t){let e=Tf.decode(Vt(t),0);return new Oi({authorizedPubkey:new ot(e.authorizedPubkey),nonce:new ot(e.nonce).toString(),feeCalculator:e.feeCalculator})}},hd=n=>{let t=n.decode.bind(n),e=n.encode.bind(n);return{decode:t,encode:e}},ld=n=>t=>{let e=(0,Ef.blob)(n,t),{encode:r,decode:i}=hd(e),s=e;return s.decode=(c,p)=>{let y=i(c,p);return(0,qi.toBigIntLE)(ut.Buffer.from(y))},s.encode=(c,p,y)=>{let v=(0,qi.toBufferLE)(c,n);return r(v,p,y)},s},Gn=ld(8),ze=Object.freeze({Create:{index:0,layout:k.struct([k.u32("instruction"),k.ns64("lamports"),k.ns64("space"),$t("programId")])},Assign:{index:1,layout:k.struct([k.u32("instruction"),$t("programId")])},Transfer:{index:2,layout:k.struct([k.u32("instruction"),Gn("lamports")])},CreateWithSeed:{index:3,layout:k.struct([k.u32("instruction"),$t("base"),Wn("seed"),k.ns64("lamports"),k.ns64("space"),$t("programId")])},AdvanceNonceAccount:{index:4,layout:k.struct([k.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:k.struct([k.u32("instruction"),k.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:k.struct([k.u32("instruction"),$t("authorized")])},AuthorizeNonceAccount:{index:7,layout:k.struct([k.u32("instruction"),$t("authorized")])},Allocate:{index:8,layout:k.struct([k.u32("instruction"),k.ns64("space")])},AllocateWithSeed:{index:9,layout:k.struct([k.u32("instruction"),$t("base"),Wn("seed"),k.ns64("space"),$t("programId")])},AssignWithSeed:{index:10,layout:k.struct([k.u32("instruction"),$t("base"),Wn("seed"),$t("programId")])},TransferWithSeed:{index:11,layout:k.struct([k.u32("instruction"),Gn("lamports"),Wn("seed"),$t("programId")])},UpgradeNonceAccount:{index:12,layout:k.struct([k.u32("instruction")])}}),ye=class{constructor(){}static createAccount(t){let e=ze.Create,r=Zt(e,{lamports:t.lamports,space:t.space,programId:Vt(t.programId.toBuffer())});return new re({keys:[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:r})}static transfer(t){let e,r;if("basePubkey"in t){let i=ze.TransferWithSeed;e=Zt(i,{lamports:BigInt(t.lamports),seed:t.seed,programId:Vt(t.programId.toBuffer())}),r=[{pubkey:t.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]}else{let i=ze.Transfer;e=Zt(i,{lamports:BigInt(t.lamports)}),r=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]}return new re({keys:r,programId:this.programId,data:e})}static assign(t){let e,r;if("basePubkey"in t){let i=ze.AssignWithSeed;e=Zt(i,{base:Vt(t.basePubkey.toBuffer()),seed:t.seed,programId:Vt(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]}else{let i=ze.Assign;e=Zt(i,{programId:Vt(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]}return new re({keys:r,programId:this.programId,data:e})}static createAccountWithSeed(t){let e=ze.CreateWithSeed,r=Zt(e,{base:Vt(t.basePubkey.toBuffer()),seed:t.seed,lamports:t.lamports,space:t.space,programId:Vt(t.programId.toBuffer())}),i=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!1,isWritable:!0}];return t.basePubkey.equals(t.fromPubkey)||i.push({pubkey:t.basePubkey,isSigner:!0,isWritable:!1}),new re({keys:i,programId:this.programId,data:r})}static createNonceAccount(t){let e=new jt;"basePubkey"in t&&"seed"in t?e.add(ye.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:hf,programId:this.programId})):e.add(ye.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:hf,programId:this.programId}));let r={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return e.add(this.nonceInitialize(r)),e}static nonceInitialize(t){let e=ze.InitializeNonceAccount,r=Zt(e,{authorized:Vt(t.authorizedPubkey.toBuffer())}),i={keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:ba,isSigner:!1,isWritable:!1},{pubkey:Pi,isSigner:!1,isWritable:!1}],programId:this.programId,data:r};return new re(i)}static nonceAdvance(t){let e=ze.AdvanceNonceAccount,r=Zt(e),i={keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:ba,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r};return new re(i)}static nonceWithdraw(t){let e=ze.WithdrawNonceAccount,r=Zt(e,{lamports:t.lamports});return new re({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0},{pubkey:ba,isSigner:!1,isWritable:!1},{pubkey:Pi,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}static nonceAuthorize(t){let e=ze.AuthorizeNonceAccount,r=Zt(e,{authorized:Vt(t.newAuthorizedPubkey.toBuffer())});return new re({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}static allocate(t){let e,r;if("basePubkey"in t){let i=ze.AllocateWithSeed;e=Zt(i,{base:Vt(t.basePubkey.toBuffer()),seed:t.seed,space:t.space,programId:Vt(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]}else{let i=ze.Allocate;e=Zt(i,{space:t.space}),r=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]}return new re({keys:r,programId:this.programId,data:e})}};ye.programId=new ot("11111111111111111111111111111111");dd=xn-300,Zn=class{constructor(){}static getMinNumSignatures(t){return 2*(Math.ceil(t/Zn.chunkSize)+1+1)}static async load(t,e,r,i,s){{let S=await t.getMinimumBalanceForRentExemption(s.length),I=await t.getAccountInfo(r.publicKey,"confirmed"),B=null;if(I!==null){if(I.executable)return console.error("Program load failed, account is already executable"),!1;I.data.length!==s.length&&(B=B||new jt,B.add(ye.allocate({accountPubkey:r.publicKey,space:s.length}))),I.owner.equals(i)||(B=B||new jt,B.add(ye.assign({accountPubkey:r.publicKey,programId:i}))),I.lamports0?S:1,space:s.length,programId:i}));B!==null&&await ff(t,B,[e,r],{commitment:"confirmed"})}let c=k.struct([k.u32("instruction"),k.u32("offset"),k.u32("bytesLength"),k.u32("bytesLengthPadding"),k.seq(k.u8("byte"),k.offset(k.u32(),-8),"bytes")]),p=Zn.chunkSize,y=0,v=s,x=[];for(;v.length>0;){let S=v.slice(0,p),I=ut.Buffer.alloc(p+16);c.encode({instruction:0,offset:y,bytes:S,bytesLength:0,bytesLengthPadding:0},I);let B=new jt().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:i,data:I});x.push(ff(t,B,[e,r],{commitment:"confirmed"})),t._rpcEndpoint.includes("solana.com")&&await bn(1e3/4),y+=p,v=v.slice(p)}await Promise.all(x);{let S=k.struct([k.u32("instruction")]),I=ut.Buffer.alloc(S.span);S.encode({instruction:1},I);let B=new jt().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:Pi,isSigner:!1,isWritable:!1}],programId:i,data:I}),R="processed",_=await t.sendTransaction(B,[e,r],{preflightCommitment:R}),{context:E,value:U}=await t.confirmTransaction({signature:_,lastValidBlockHeight:B.lastValidBlockHeight,blockhash:B.recentBlockhash},R);if(U.err)throw new Error(`Transaction ${_} failed (${JSON.stringify(U)})`);for(;;){try{if(await t.getSlot({commitment:R})>E.slot)break}catch{}await new Promise(K=>setTimeout(K,Math.round(Rf/2)))}}return!0}};Zn.chunkSize=dd;q1=new ot("BPFLoader2111111111111111111111111111111111");yd=Object.prototype.toString,gd=Object.keys||function(n){var t=[];for(var e in n)t.push(e);return t};md=function(n){var t=Ti(n,!1);if(t!==void 0)return""+t},lf=pd(md),Mi=32;Ma=class{constructor(t,e,r,i,s){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=t,this.leaderScheduleSlotOffset=e,this.warmup=r,this.firstNormalEpoch=i,this.firstNormalSlot=s}getEpoch(t){return this.getEpochAndSlotIndex(t)[0]}getEpochAndSlotIndex(t){if(t{let c=qc(s,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...e});return"socket"in c?this.underlyingSocket=c.socket:this.underlyingSocket=c,c};super(i,t,e,r),this.underlyingSocket=void 0}call(...t){let e=this.underlyingSocket?.readyState;return e===1?super.call(...t):Promise.reject(new Error("Tried to call a JSON-RPC method `"+t[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+e+")"))}notify(...t){let e=this.underlyingSocket?.readyState;return e===1?super.notify(...t):Promise.reject(new Error("Tried to send a JSON-RPC notification `"+t[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+e+")"))}};df=56,jo=class{constructor(t){this.key=void 0,this.state=void 0,this.key=t.key,this.state=t.state}isActive(){let t=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===t}static deserialize(t){let e=vd(xd,t),r=t.length-df;Qt(r>=0,"lookup table is invalid"),Qt(r%32===0,"lookup table is invalid");let i=r/32,{addresses:s}=k.struct([k.seq($t(),i,"addresses")]).decode(t.slice(df));return{deactivationSlot:e.deactivationSlot,lastExtendedSlot:e.lastExtendedSlot,lastExtendedSlotStartIndex:e.lastExtendedStartIndex,authority:e.authority.length!==0?new ot(e.authority[0]):void 0,addresses:s.map(c=>new ot(c))}}},xd={index:1,layout:k.struct([k.u32("typeIndex"),Gn("deactivationSlot"),k.nu64("lastExtendedSlot"),k.u8("lastExtendedStartIndex"),k.u8(),k.seq($t(),k.offset(k.u8(),-1),"authority")])},kd=/^[^:]+:\\/\\/([^:[]+|\\[[^\\]]+\\])(:\\d+)?(.*)/i;ue=Kn(Po(ot),W(),n=>new ot(n)),Pf=Co([W(),se("base64")]),za=Kn(Po(ut.Buffer),Pf,n=>ut.Buffer.from(n[0],"base64")),Bd=30*1e3;Id=Cf(wn());_d=q({foundation:M(),foundationTerm:M(),initial:M(),taper:M(),terminal:M()}),Ad=Ht(Z(j(q({epoch:M(),effectiveSlot:M(),amount:M(),postBalance:M(),commission:it(j(M()))})))),Md=Z(q({slot:M(),prioritizationFee:M()})),Ld=q({total:M(),validator:M(),foundation:M(),epoch:M()}),Rd=q({epoch:M(),slotIndex:M(),slotsInEpoch:M(),absoluteSlot:M(),blockHeight:it(M()),transactionCount:it(M())}),Td=q({slotsPerEpoch:M(),leaderScheduleSlotOffset:M(),warmup:We(),firstNormalEpoch:M(),firstNormalSlot:M()}),Pd=na(W(),Z(M())),Bn=j(ve([q({}),W()])),Cd=q({err:Bn}),Od=se("receivedSignature"),Ud=q({"solana-core":W(),"feature-set":it(M())}),Nd=q({program:W(),programId:ue,parsed:wn()}),zd=q({programId:ue,accounts:Z(ue),data:W()}),yf=ce(q({err:j(ve([q({}),W()])),logs:j(Z(W())),accounts:it(j(Z(j(q({executable:We(),owner:W(),lamports:M(),data:Z(W()),rentEpoch:it(M())}))))),unitsConsumed:it(M()),returnData:it(j(q({programId:W(),data:Co([W(),se("base64")])}))),innerInstructions:it(j(Z(q({index:M(),instructions:Z(ve([Nd,zd]))}))))})),qd=ce(q({byIdentity:na(W(),Z(M())),range:q({firstSlot:M(),lastSlot:M()})}));Wd=Ht(_d),Hd=Ht(Ld),$d=Ht(Md),Vd=Ht(Rd),Gd=Ht(Td),Zd=Ht(Pd),jd=Ht(M()),Yd=ce(q({total:M(),circulating:M(),nonCirculating:M(),nonCirculatingAccounts:Z(ue)})),Ra=q({amount:W(),uiAmount:j(M()),decimals:M(),uiAmountString:it(W())}),Jd=ce(Z(q({address:ue,amount:W(),uiAmount:j(M()),decimals:M(),uiAmountString:it(W())}))),Xd=ce(Z(q({pubkey:ue,account:q({executable:We(),owner:ue,lamports:M(),data:za,rentEpoch:M()})}))),Ta=q({program:W(),parsed:wn(),space:M()}),Qd=ce(Z(q({pubkey:ue,account:q({executable:We(),owner:ue,lamports:M(),data:Ta,rentEpoch:M()})}))),tp=ce(Z(q({lamports:M(),address:ue}))),Ui=q({executable:We(),owner:ue,lamports:M(),data:za,rentEpoch:M()}),ep=q({pubkey:ue,account:Ui}),rp=Kn(ve([Po(ut.Buffer),Ta]),ve([Pf,Ta]),n=>Array.isArray(n)?$(n,za):n),Pa=q({executable:We(),owner:ue,lamports:M(),data:rp,rentEpoch:M()}),np=q({pubkey:ue,account:Pa}),ip=q({state:ve([se("active"),se("inactive"),se("activating"),se("deactivating")]),active:M(),inactive:M()}),op=Ht(Z(q({signature:W(),slot:M(),err:Bn,memo:j(W()),blockTime:it(j(M()))}))),sp=Ht(Z(q({signature:W(),slot:M(),err:Bn,memo:j(W()),blockTime:it(j(M()))}))),ap=q({subscription:M(),result:Qo(Ui)}),up=q({pubkey:ue,account:Ui}),cp=q({subscription:M(),result:Qo(up)}),fp=q({parent:M(),slot:M(),root:M()}),hp=q({subscription:M(),result:fp}),lp=ve([q({type:ve([se("firstShredReceived"),se("completed"),se("optimisticConfirmation"),se("root")]),slot:M(),timestamp:M()}),q({type:se("createdBank"),parent:M(),slot:M(),timestamp:M()}),q({type:se("frozen"),slot:M(),timestamp:M(),stats:q({numTransactionEntries:M(),numSuccessfulTransactions:M(),numFailedTransactions:M(),maxTransactionsPerEntry:M()})}),q({type:se("dead"),slot:M(),timestamp:M(),err:W()})]),dp=q({subscription:M(),result:lp}),pp=q({subscription:M(),result:Qo(ve([Cd,Od]))}),yp=q({subscription:M(),result:M()}),gp=q({pubkey:W(),gossip:j(W()),tpu:j(W()),rpc:j(W()),version:j(W())}),gf=q({votePubkey:W(),nodePubkey:W(),activatedStake:M(),epochVoteAccount:We(),epochCredits:Z(Co([M(),M(),M()])),commission:M(),lastVote:M(),rootSlot:j(M())}),mp=Ht(q({current:Z(gf),delinquent:Z(gf)})),wp=ve([se("processed"),se("confirmed"),se("finalized")]),bp=q({slot:M(),confirmations:j(M()),err:Bn,confirmationStatus:it(wp)}),vp=ce(Z(j(bp))),xp=Ht(M()),Of=q({accountKey:ue,writableIndexes:Z(M()),readonlyIndexes:Z(M())}),qa=q({signatures:Z(W()),message:q({accountKeys:Z(W()),header:q({numRequiredSignatures:M(),numReadonlySignedAccounts:M(),numReadonlyUnsignedAccounts:M()}),instructions:Z(q({accounts:Z(M()),data:W(),programIdIndex:M()})),recentBlockhash:W(),addressTableLookups:it(Z(Of))})}),Uf=q({pubkey:ue,signer:We(),writable:We(),source:it(ve([se("transaction"),se("lookupTable")]))}),Nf=q({accountKeys:Z(Uf),signatures:Z(W())}),zf=q({parsed:wn(),program:W(),programId:ue}),qf=q({accounts:Z(ue),data:W(),programId:ue}),kp=ve([qf,zf]),Sp=ve([q({parsed:wn(),program:W(),programId:W()}),q({accounts:Z(W()),data:W(),programId:W()})]),Ff=Kn(kp,Sp,n=>"accounts"in n?$(n,qf):$(n,zf)),Kf=q({signatures:Z(W()),message:q({accountKeys:Z(Uf),instructions:Z(Ff),recentBlockhash:W(),addressTableLookups:it(j(Z(Of)))})}),Yo=q({accountIndex:M(),mint:W(),owner:it(W()),uiTokenAmount:Ra}),Df=q({writable:Z(ue),readonly:Z(ue)}),ts=q({err:Bn,fee:M(),innerInstructions:it(j(Z(q({index:M(),instructions:Z(q({accounts:Z(M()),data:W(),programIdIndex:M()}))})))),preBalances:Z(M()),postBalances:Z(M()),logMessages:it(j(Z(W()))),preTokenBalances:it(j(Z(Yo))),postTokenBalances:it(j(Z(Yo))),loadedAddresses:it(Df),computeUnitsConsumed:it(M())}),Fa=q({err:Bn,fee:M(),innerInstructions:it(j(Z(q({index:M(),instructions:Z(Ff)})))),preBalances:Z(M()),postBalances:Z(M()),logMessages:it(j(Z(W()))),preTokenBalances:it(j(Z(Yo))),postTokenBalances:it(j(Z(Yo))),loadedAddresses:it(Df),computeUnitsConsumed:it(M())}),Jn=ve([se(0),se("legacy")]),En=q({pubkey:W(),lamports:M(),postBalance:j(M()),rewardType:j(W()),commission:it(j(M()))}),Bp=Ht(j(q({blockhash:W(),previousBlockhash:W(),parentSlot:M(),transactions:Z(q({transaction:qa,meta:j(ts),version:it(Jn)})),rewards:it(Z(En)),blockTime:j(M()),blockHeight:j(M())}))),Ep=Ht(j(q({blockhash:W(),previousBlockhash:W(),parentSlot:M(),rewards:it(Z(En)),blockTime:j(M()),blockHeight:j(M())}))),Ip=Ht(j(q({blockhash:W(),previousBlockhash:W(),parentSlot:M(),transactions:Z(q({transaction:Nf,meta:j(ts),version:it(Jn)})),rewards:it(Z(En)),blockTime:j(M()),blockHeight:j(M())}))),_p=Ht(j(q({blockhash:W(),previousBlockhash:W(),parentSlot:M(),transactions:Z(q({transaction:Kf,meta:j(Fa),version:it(Jn)})),rewards:it(Z(En)),blockTime:j(M()),blockHeight:j(M())}))),Ap=Ht(j(q({blockhash:W(),previousBlockhash:W(),parentSlot:M(),transactions:Z(q({transaction:Nf,meta:j(Fa),version:it(Jn)})),rewards:it(Z(En)),blockTime:j(M()),blockHeight:j(M())}))),Mp=Ht(j(q({blockhash:W(),previousBlockhash:W(),parentSlot:M(),rewards:it(Z(En)),blockTime:j(M()),blockHeight:j(M())}))),Lp=Ht(j(q({blockhash:W(),previousBlockhash:W(),parentSlot:M(),transactions:Z(q({transaction:qa,meta:j(ts)})),rewards:it(Z(En)),blockTime:j(M())}))),mf=Ht(j(q({blockhash:W(),previousBlockhash:W(),parentSlot:M(),signatures:Z(W()),blockTime:j(M())}))),Sa=Ht(j(q({slot:M(),meta:j(ts),blockTime:it(j(M())),transaction:qa,version:it(Jn)}))),Wo=Ht(j(q({slot:M(),transaction:Kf,meta:j(Fa),blockTime:it(j(M())),version:it(Jn)}))),Rp=ce(q({blockhash:W(),feeCalculator:q({lamportsPerSignature:M()})})),Tp=ce(q({blockhash:W(),lastValidBlockHeight:M()})),Pp=ce(We()),Cp=q({slot:M(),numTransactions:M(),numSlots:M(),samplePeriodSecs:M()}),Op=Ht(Z(Cp)),Up=ce(j(q({feeCalculator:q({lamportsPerSignature:M()})}))),Np=Ht(W()),zp=Ht(W()),qp=q({err:Bn,logs:Z(W()),signature:W()}),Fp=q({result:Qo(qp),subscription:M()}),Kp={"solana-client":"js/1.0.0-maintenance"},Jo=class{constructor(t,e){this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{let v={};return async x=>{let{commitment:S,config:I}=ne(x),B=this._buildArgs([],S,void 0,I),R=lf(B);return v[R]=v[R]??(async()=>{try{let _=await this._rpcRequest("getBlockHeight",B),E=$(_,Ht(M()));if("error"in E)throw new et(E.error,"failed to get block height information");return E.result}finally{delete v[R]}})(),await v[R]}})();let r,i,s,c,p,y;e&&typeof e=="string"?this._commitment=e:e&&(this._commitment=e.commitment,this._confirmTransactionInitialTimeout=e.confirmTransactionInitialTimeout,r=e.wsEndpoint,i=e.httpHeaders,s=e.fetch,c=e.fetchMiddleware,p=e.disableRetryOnRateLimit,y=e.httpAgent),this._rpcEndpoint=Ed(t),this._rpcWsEndpoint=r||Sd(t),this._rpcClient=Fd(t,i,s,c,p,y),this._rpcRequest=Kd(this._rpcClient),this._rpcBatchRequest=Dd(this._rpcClient),this._rpcWebSocket=new La(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(t,e){let{commitment:r,config:i}=ne(e),s=this._buildArgs([t.toBase58()],r,void 0,i),c=await this._rpcRequest("getBalance",s),p=$(c,ce(M()));if("error"in p)throw new et(p.error,`failed to get balance for ${t.toBase58()}`);return p.result}async getBalance(t,e){return await this.getBalanceAndContext(t,e).then(r=>r.value).catch(r=>{throw new Error("failed to get balance of account "+t.toBase58()+": "+r)})}async getBlockTime(t){let e=await this._rpcRequest("getBlockTime",[t]),r=$(e,Ht(j(M())));if("error"in r)throw new et(r.error,`failed to get block time for slot ${t}`);return r.result}async getMinimumLedgerSlot(){let t=await this._rpcRequest("minimumLedgerSlot",[]),e=$(t,Ht(M()));if("error"in e)throw new et(e.error,"failed to get minimum ledger slot");return e.result}async getFirstAvailableBlock(){let t=await this._rpcRequest("getFirstAvailableBlock",[]),e=$(t,jd);if("error"in e)throw new et(e.error,"failed to get first available block");return e.result}async getSupply(t){let e={};typeof t=="string"?e={commitment:t}:t?e={...t,commitment:t&&t.commitment||this.commitment}:e={commitment:this.commitment};let r=await this._rpcRequest("getSupply",[e]),i=$(r,Yd);if("error"in i)throw new et(i.error,"failed to get supply");return i.result}async getTokenSupply(t,e){let r=this._buildArgs([t.toBase58()],e),i=await this._rpcRequest("getTokenSupply",r),s=$(i,ce(Ra));if("error"in s)throw new et(s.error,"failed to get token supply");return s.result}async getTokenAccountBalance(t,e){let r=this._buildArgs([t.toBase58()],e),i=await this._rpcRequest("getTokenAccountBalance",r),s=$(i,ce(Ra));if("error"in s)throw new et(s.error,"failed to get token account balance");return s.result}async getTokenAccountsByOwner(t,e,r){let{commitment:i,config:s}=ne(r),c=[t.toBase58()];"mint"in e?c.push({mint:e.mint.toBase58()}):c.push({programId:e.programId.toBase58()});let p=this._buildArgs(c,i,"base64",s),y=await this._rpcRequest("getTokenAccountsByOwner",p),v=$(y,Xd);if("error"in v)throw new et(v.error,`failed to get token accounts owned by account ${t.toBase58()}`);return v.result}async getParsedTokenAccountsByOwner(t,e,r){let i=[t.toBase58()];"mint"in e?i.push({mint:e.mint.toBase58()}):i.push({programId:e.programId.toBase58()});let s=this._buildArgs(i,r,"jsonParsed"),c=await this._rpcRequest("getTokenAccountsByOwner",s),p=$(c,Qd);if("error"in p)throw new et(p.error,`failed to get token accounts owned by account ${t.toBase58()}`);return p.result}async getLargestAccounts(t){let e={...t,commitment:t&&t.commitment||this.commitment},r=e.filter||e.commitment?[e]:[],i=await this._rpcRequest("getLargestAccounts",r),s=$(i,tp);if("error"in s)throw new et(s.error,"failed to get largest accounts");return s.result}async getTokenLargestAccounts(t,e){let r=this._buildArgs([t.toBase58()],e),i=await this._rpcRequest("getTokenLargestAccounts",r),s=$(i,Jd);if("error"in s)throw new et(s.error,"failed to get token largest accounts");return s.result}async getAccountInfoAndContext(t,e){let{commitment:r,config:i}=ne(e),s=this._buildArgs([t.toBase58()],r,"base64",i),c=await this._rpcRequest("getAccountInfo",s),p=$(c,ce(j(Ui)));if("error"in p)throw new et(p.error,`failed to get info about account ${t.toBase58()}`);return p.result}async getParsedAccountInfo(t,e){let{commitment:r,config:i}=ne(e),s=this._buildArgs([t.toBase58()],r,"jsonParsed",i),c=await this._rpcRequest("getAccountInfo",s),p=$(c,ce(j(Pa)));if("error"in p)throw new et(p.error,`failed to get info about account ${t.toBase58()}`);return p.result}async getAccountInfo(t,e){try{return(await this.getAccountInfoAndContext(t,e)).value}catch(r){throw new Error("failed to get info about account "+t.toBase58()+": "+r)}}async getMultipleParsedAccounts(t,e){let{commitment:r,config:i}=ne(e),s=t.map(v=>v.toBase58()),c=this._buildArgs([s],r,"jsonParsed",i),p=await this._rpcRequest("getMultipleAccounts",c),y=$(p,ce(Z(j(Pa))));if("error"in y)throw new et(y.error,`failed to get info for accounts ${s}`);return y.result}async getMultipleAccountsInfoAndContext(t,e){let{commitment:r,config:i}=ne(e),s=t.map(v=>v.toBase58()),c=this._buildArgs([s],r,"base64",i),p=await this._rpcRequest("getMultipleAccounts",c),y=$(p,ce(Z(j(Ui))));if("error"in y)throw new et(y.error,`failed to get info for accounts ${s}`);return y.result}async getMultipleAccountsInfo(t,e){return(await this.getMultipleAccountsInfoAndContext(t,e)).value}async getStakeActivation(t,e,r){let{commitment:i,config:s}=ne(e),c=this._buildArgs([t.toBase58()],i,void 0,{...s,epoch:r??s?.epoch}),p=await this._rpcRequest("getStakeActivation",c),y=$(p,Ht(ip));if("error"in y)throw new et(y.error,`failed to get Stake Activation ${t.toBase58()}`);return y.result}async getProgramAccounts(t,e){let{commitment:r,config:i}=ne(e),{encoding:s,...c}=i||{},p=this._buildArgs([t.toBase58()],r,s||"base64",{...c,...c.filters?{filters:pf(c.filters)}:null}),y=await this._rpcRequest("getProgramAccounts",p),v=Z(ep),x=c.withContext===!0?$(y,ce(v)):$(y,Ht(v));if("error"in x)throw new et(x.error,`failed to get accounts owned by program ${t.toBase58()}`);return x.result}async getParsedProgramAccounts(t,e){let{commitment:r,config:i}=ne(e),s=this._buildArgs([t.toBase58()],r,"jsonParsed",i),c=await this._rpcRequest("getProgramAccounts",s),p=$(c,Ht(Z(np)));if("error"in p)throw new et(p.error,`failed to get accounts owned by program ${t.toBase58()}`);return p.result}async confirmTransaction(t,e){let r;if(typeof t=="string")r=t;else{let s=t;if(s.abortSignal?.aborted)return Promise.reject(s.abortSignal.reason);r=s.signature}let i;try{i=pe.default.decode(r)}catch{throw new Error("signature must be base58 encoded: "+r)}return Qt(i.length===64,"signature has invalid length"),typeof t=="string"?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:e||this.commitment,signature:r}):"lastValidBlockHeight"in t?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e||this.commitment,strategy:t}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:e||this.commitment,strategy:t})}getCancellationPromise(t){return new Promise((e,r)=>{t!=null&&(t.aborted?r(t.reason):t.addEventListener("abort",()=>{r(t.reason)}))})}getTransactionConfirmationPromise({commitment:t,signature:e}){let r,i,s=!1,c=new Promise((y,v)=>{try{r=this.onSignature(e,(S,I)=>{r=void 0;let B={context:I,value:S};y({__type:Rr.PROCESSED,response:B})},t);let x=new Promise(S=>{r==null?S():i=this._onSubscriptionStateChange(r,I=>{I==="subscribed"&&S()})});(async()=>{if(await x,s)return;let S=await this.getSignatureStatus(e);if(s||S==null)return;let{context:I,value:B}=S;if(B!=null)if(B?.err)v(B.err);else{switch(t){case"confirmed":case"single":case"singleGossip":{if(B.confirmationStatus==="processed")return;break}case"finalized":case"max":case"root":{if(B.confirmationStatus==="processed"||B.confirmationStatus==="confirmed")return;break}case"processed":case"recent":}s=!0,y({__type:Rr.PROCESSED,response:{context:I,value:B}})}})()}catch(x){v(x)}});return{abortConfirmation:()=>{i&&(i(),i=void 0),r!=null&&(this.removeSignatureListener(r),r=void 0)},confirmationPromise:c}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:t,strategy:{abortSignal:e,lastValidBlockHeight:r,signature:i}}){let s=!1,c=new Promise(S=>{let I=async()=>{try{return await this.getBlockHeight(t)}catch{return-1}};(async()=>{let B=await I();if(!s){for(;B<=r;)if(await bn(1e3),s||(B=await I(),s))return;S({__type:Rr.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:p,confirmationPromise:y}=this.getTransactionConfirmationPromise({commitment:t,signature:i}),v=this.getCancellationPromise(e),x;try{let S=await Promise.race([v,y,c]);if(S.__type===Rr.PROCESSED)x=S.response;else throw new Go(i)}finally{s=!0,p()}return x}async confirmTransactionUsingDurableNonceStrategy({commitment:t,strategy:{abortSignal:e,minContextSlot:r,nonceAccountPubkey:i,nonceValue:s,signature:c}}){let p=!1,y=new Promise(B=>{let R=s,_=null,E=async()=>{try{let{context:U,value:K}=await this.getNonceAndContext(i,{commitment:t,minContextSlot:r});return _=U.slot,K?.nonce}catch{return R}};(async()=>{if(R=await E(),!p)for(;;){if(s!==R){B({__type:Rr.NONCE_INVALID,slotInWhichNonceDidAdvance:_});return}if(await bn(2e3),p||(R=await E(),p))return}})()}),{abortConfirmation:v,confirmationPromise:x}=this.getTransactionConfirmationPromise({commitment:t,signature:c}),S=this.getCancellationPromise(e),I;try{let B=await Promise.race([S,x,y]);if(B.__type===Rr.PROCESSED)I=B.response;else{let R;for(;;){let _=await this.getSignatureStatus(c);if(_==null)break;if(_.context.slot<(B.slotInWhichNonceDidAdvance??r)){await bn(400);continue}R=_;break}if(R?.value){let _=t||"finalized",{confirmationStatus:E}=R.value;switch(_){case"processed":case"recent":if(E!=="processed"&&E!=="confirmed"&&E!=="finalized")throw new vn(c);break;case"confirmed":case"single":case"singleGossip":if(E!=="confirmed"&&E!=="finalized")throw new vn(c);break;case"finalized":case"max":case"root":if(E!=="finalized")throw new vn(c);break;default:(U=>{})(_)}I={context:R.context,value:{err:R.value.err}}}else throw new vn(c)}}finally{p=!0,v()}return I}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:t,signature:e}){let r,i=new Promise(y=>{let v=this._confirmTransactionInitialTimeout||6e4;switch(t){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":{v=this._confirmTransactionInitialTimeout||3e4;break}}r=setTimeout(()=>y({__type:Rr.TIMED_OUT,timeoutMs:v}),v)}),{abortConfirmation:s,confirmationPromise:c}=this.getTransactionConfirmationPromise({commitment:t,signature:e}),p;try{let y=await Promise.race([c,i]);if(y.__type===Rr.PROCESSED)p=y.response;else throw new Zo(e,y.timeoutMs/1e3)}finally{clearTimeout(r),s()}return p}async getClusterNodes(){let t=await this._rpcRequest("getClusterNodes",[]),e=$(t,Ht(Z(gp)));if("error"in e)throw new et(e.error,"failed to get cluster nodes");return e.result}async getVoteAccounts(t){let e=this._buildArgs([],t),r=await this._rpcRequest("getVoteAccounts",e),i=$(r,mp);if("error"in i)throw new et(i.error,"failed to get vote accounts");return i.result}async getSlot(t){let{commitment:e,config:r}=ne(t),i=this._buildArgs([],e,void 0,r),s=await this._rpcRequest("getSlot",i),c=$(s,Ht(M()));if("error"in c)throw new et(c.error,"failed to get slot");return c.result}async getSlotLeader(t){let{commitment:e,config:r}=ne(t),i=this._buildArgs([],e,void 0,r),s=await this._rpcRequest("getSlotLeader",i),c=$(s,Ht(W()));if("error"in c)throw new et(c.error,"failed to get slot leader");return c.result}async getSlotLeaders(t,e){let r=[t,e],i=await this._rpcRequest("getSlotLeaders",r),s=$(i,Ht(Z(ue)));if("error"in s)throw new et(s.error,"failed to get slot leaders");return s.result}async getSignatureStatus(t,e){let{context:r,value:i}=await this.getSignatureStatuses([t],e);Qt(i.length===1);let s=i[0];return{context:r,value:s}}async getSignatureStatuses(t,e){let r=[t];e&&r.push(e);let i=await this._rpcRequest("getSignatureStatuses",r),s=$(i,vp);if("error"in s)throw new et(s.error,"failed to get signature status");return s.result}async getTransactionCount(t){let{commitment:e,config:r}=ne(t),i=this._buildArgs([],e,void 0,r),s=await this._rpcRequest("getTransactionCount",i),c=$(s,Ht(M()));if("error"in c)throw new et(c.error,"failed to get transaction count");return c.result}async getTotalSupply(t){return(await this.getSupply({commitment:t,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(t){let e=this._buildArgs([],t),r=await this._rpcRequest("getInflationGovernor",e),i=$(r,Wd);if("error"in i)throw new et(i.error,"failed to get inflation");return i.result}async getInflationReward(t,e,r){let{commitment:i,config:s}=ne(r),c=this._buildArgs([t.map(v=>v.toBase58())],i,void 0,{...s,epoch:e??s?.epoch}),p=await this._rpcRequest("getInflationReward",c),y=$(p,Ad);if("error"in y)throw new et(y.error,"failed to get inflation reward");return y.result}async getInflationRate(){let t=await this._rpcRequest("getInflationRate",[]),e=$(t,Hd);if("error"in e)throw new et(e.error,"failed to get inflation rate");return e.result}async getEpochInfo(t){let{commitment:e,config:r}=ne(t),i=this._buildArgs([],e,void 0,r),s=await this._rpcRequest("getEpochInfo",i),c=$(s,Vd);if("error"in c)throw new et(c.error,"failed to get epoch info");return c.result}async getEpochSchedule(){let t=await this._rpcRequest("getEpochSchedule",[]),e=$(t,Gd);if("error"in e)throw new et(e.error,"failed to get epoch schedule");let r=e.result;return new Ma(r.slotsPerEpoch,r.leaderScheduleSlotOffset,r.warmup,r.firstNormalEpoch,r.firstNormalSlot)}async getLeaderSchedule(){let t=await this._rpcRequest("getLeaderSchedule",[]),e=$(t,Zd);if("error"in e)throw new et(e.error,"failed to get leader schedule");return e.result}async getMinimumBalanceForRentExemption(t,e){let r=this._buildArgs([t],e),i=await this._rpcRequest("getMinimumBalanceForRentExemption",r),s=$(i,xp);return"error"in s?(console.warn("Unable to fetch minimum balance for rent exemption"),0):s.result}async getRecentBlockhashAndContext(t){let e=this._buildArgs([],t),r=await this._rpcRequest("getRecentBlockhash",e),i=$(r,Rp);if("error"in i)throw new et(i.error,"failed to get recent blockhash");return i.result}async getRecentPerformanceSamples(t){let e=await this._rpcRequest("getRecentPerformanceSamples",t?[t]:[]),r=$(e,Op);if("error"in r)throw new et(r.error,"failed to get recent performance samples");return r.result}async getFeeCalculatorForBlockhash(t,e){let r=this._buildArgs([t],e),i=await this._rpcRequest("getFeeCalculatorForBlockhash",r),s=$(i,Up);if("error"in s)throw new et(s.error,"failed to get fee calculator");let{context:c,value:p}=s.result;return{context:c,value:p!==null?p.feeCalculator:null}}async getFeeForMessage(t,e){let r=Vt(t.serialize()).toString("base64"),i=this._buildArgs([r],e),s=await this._rpcRequest("getFeeForMessage",i),c=$(s,ce(j(M())));if("error"in c)throw new et(c.error,"failed to get fee for message");if(c.result===null)throw new Error("invalid blockhash");return c.result}async getRecentPrioritizationFees(t){let e=t?.lockedWritableAccounts?.map(c=>c.toBase58()),r=e?.length?[e]:[],i=await this._rpcRequest("getRecentPrioritizationFees",r),s=$(i,$d);if("error"in s)throw new et(s.error,"failed to get recent prioritization fees");return s.result}async getRecentBlockhash(t){try{return(await this.getRecentBlockhashAndContext(t)).value}catch(e){throw new Error("failed to get recent blockhash: "+e)}}async getLatestBlockhash(t){try{return(await this.getLatestBlockhashAndContext(t)).value}catch(e){throw new Error("failed to get recent blockhash: "+e)}}async getLatestBlockhashAndContext(t){let{commitment:e,config:r}=ne(t),i=this._buildArgs([],e,void 0,r),s=await this._rpcRequest("getLatestBlockhash",i),c=$(s,Tp);if("error"in c)throw new et(c.error,"failed to get latest blockhash");return c.result}async isBlockhashValid(t,e){let{commitment:r,config:i}=ne(e),s=this._buildArgs([t],r,void 0,i),c=await this._rpcRequest("isBlockhashValid",s),p=$(c,Pp);if("error"in p)throw new et(p.error,"failed to determine if the blockhash `"+t+"`is valid");return p.result}async getVersion(){let t=await this._rpcRequest("getVersion",[]),e=$(t,Ht(Ud));if("error"in e)throw new et(e.error,"failed to get version");return e.result}async getGenesisHash(){let t=await this._rpcRequest("getGenesisHash",[]),e=$(t,Ht(W()));if("error"in e)throw new et(e.error,"failed to get genesis hash");return e.result}async getBlock(t,e){let{commitment:r,config:i}=ne(e),s=this._buildArgsAtLeastConfirmed([t],r,void 0,i),c=await this._rpcRequest("getBlock",s);try{switch(i?.transactionDetails){case"accounts":{let p=$(c,Ip);if("error"in p)throw p.error;return p.result}case"none":{let p=$(c,Ep);if("error"in p)throw p.error;return p.result}default:{let p=$(c,Bp);if("error"in p)throw p.error;let{result:y}=p;return y?{...y,transactions:y.transactions.map(({transaction:v,meta:x,version:S})=>({meta:x,transaction:{...v,message:ka(S,v.message)},version:S}))}:null}}}catch(p){throw new et(p,"failed to get confirmed block")}}async getParsedBlock(t,e){let{commitment:r,config:i}=ne(e),s=this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",i),c=await this._rpcRequest("getBlock",s);try{switch(i?.transactionDetails){case"accounts":{let p=$(c,Ap);if("error"in p)throw p.error;return p.result}case"none":{let p=$(c,Mp);if("error"in p)throw p.error;return p.result}default:{let p=$(c,_p);if("error"in p)throw p.error;return p.result}}}catch(p){throw new et(p,"failed to get block")}}async getBlockProduction(t){let e,r;if(typeof t=="string")r=t;else if(t){let{commitment:p,...y}=t;r=p,e=y}let i=this._buildArgs([],r,"base64",e),s=await this._rpcRequest("getBlockProduction",i),c=$(s,qd);if("error"in c)throw new et(c.error,"failed to get block production information");return c.result}async getTransaction(t,e){let{commitment:r,config:i}=ne(e),s=this._buildArgsAtLeastConfirmed([t],r,void 0,i),c=await this._rpcRequest("getTransaction",s),p=$(c,Sa);if("error"in p)throw new et(p.error,"failed to get transaction");let y=p.result;return y&&{...y,transaction:{...y.transaction,message:ka(y.version,y.transaction.message)}}}async getParsedTransaction(t,e){let{commitment:r,config:i}=ne(e),s=this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",i),c=await this._rpcRequest("getTransaction",s),p=$(c,Wo);if("error"in p)throw new et(p.error,"failed to get transaction");return p.result}async getParsedTransactions(t,e){let{commitment:r,config:i}=ne(e),s=t.map(y=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([y],r,"jsonParsed",i)}));return(await this._rpcBatchRequest(s)).map(y=>{let v=$(y,Wo);if("error"in v)throw new et(v.error,"failed to get transactions");return v.result})}async getTransactions(t,e){let{commitment:r,config:i}=ne(e),s=t.map(y=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([y],r,void 0,i)}));return(await this._rpcBatchRequest(s)).map(y=>{let v=$(y,Sa);if("error"in v)throw new et(v.error,"failed to get transactions");let x=v.result;return x&&{...x,transaction:{...x.transaction,message:ka(x.version,x.transaction.message)}}})}async getConfirmedBlock(t,e){let r=this._buildArgsAtLeastConfirmed([t],e),i=await this._rpcRequest("getConfirmedBlock",r),s=$(i,Lp);if("error"in s)throw new et(s.error,"failed to get confirmed block");let c=s.result;if(!c)throw new Error("Confirmed block "+t+" not found");let p={...c,transactions:c.transactions.map(({transaction:y,meta:v})=>{let x=new He(y.message);return{meta:v,transaction:{...y,message:x}}})};return{...p,transactions:p.transactions.map(({transaction:y,meta:v})=>({meta:v,transaction:jt.populate(y.message,y.signatures)}))}}async getBlocks(t,e,r){let i=this._buildArgsAtLeastConfirmed(e!==void 0?[t,e]:[t],r),s=await this._rpcRequest("getBlocks",i),c=$(s,Ht(Z(M())));if("error"in c)throw new et(c.error,"failed to get blocks");return c.result}async getBlockSignatures(t,e){let r=this._buildArgsAtLeastConfirmed([t],e,void 0,{transactionDetails:"signatures",rewards:!1}),i=await this._rpcRequest("getBlock",r),s=$(i,mf);if("error"in s)throw new et(s.error,"failed to get block");let c=s.result;if(!c)throw new Error("Block "+t+" not found");return c}async getConfirmedBlockSignatures(t,e){let r=this._buildArgsAtLeastConfirmed([t],e,void 0,{transactionDetails:"signatures",rewards:!1}),i=await this._rpcRequest("getConfirmedBlock",r),s=$(i,mf);if("error"in s)throw new et(s.error,"failed to get confirmed block");let c=s.result;if(!c)throw new Error("Confirmed block "+t+" not found");return c}async getConfirmedTransaction(t,e){let r=this._buildArgsAtLeastConfirmed([t],e),i=await this._rpcRequest("getConfirmedTransaction",r),s=$(i,Sa);if("error"in s)throw new et(s.error,"failed to get transaction");let c=s.result;if(!c)return c;let p=new He(c.transaction.message),y=c.transaction.signatures;return{...c,transaction:jt.populate(p,y)}}async getParsedConfirmedTransaction(t,e){let r=this._buildArgsAtLeastConfirmed([t],e,"jsonParsed"),i=await this._rpcRequest("getConfirmedTransaction",r),s=$(i,Wo);if("error"in s)throw new et(s.error,"failed to get confirmed transaction");return s.result}async getParsedConfirmedTransactions(t,e){let r=t.map(c=>({methodName:"getConfirmedTransaction",args:this._buildArgsAtLeastConfirmed([c],e,"jsonParsed")}));return(await this._rpcBatchRequest(r)).map(c=>{let p=$(c,Wo);if("error"in p)throw new et(p.error,"failed to get confirmed transactions");return p.result})}async getConfirmedSignaturesForAddress(t,e,r){let i={},s=await this.getFirstAvailableBlock();for(;!("until"in i)&&(e--,!(e<=0||e0&&(i.until=y.signatures[y.signatures.length-1].toString())}catch(y){if(y instanceof Error&&y.message.includes("skipped"))continue;throw y}let c=await this.getSlot("finalized");for(;!("before"in i)&&(r++,!(r>c));)try{let y=await this.getConfirmedBlockSignatures(r);y.signatures.length>0&&(i.before=y.signatures[y.signatures.length-1].toString())}catch(y){if(y instanceof Error&&y.message.includes("skipped"))continue;throw y}return(await this.getConfirmedSignaturesForAddress2(t,i)).map(y=>y.signature)}async getConfirmedSignaturesForAddress2(t,e,r){let i=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,e),s=await this._rpcRequest("getConfirmedSignaturesForAddress2",i),c=$(s,op);if("error"in c)throw new et(c.error,"failed to get confirmed signatures for address");return c.result}async getSignaturesForAddress(t,e,r){let i=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,e),s=await this._rpcRequest("getSignaturesForAddress",i),c=$(s,sp);if("error"in c)throw new et(c.error,"failed to get signatures for address");return c.result}async getAddressLookupTable(t,e){let{context:r,value:i}=await this.getAccountInfoAndContext(t,e),s=null;return i!==null&&(s=new jo({key:t,state:jo.deserialize(i.data)})),{context:r,value:s}}async getNonceAndContext(t,e){let{context:r,value:i}=await this.getAccountInfoAndContext(t,e),s=null;return i!==null&&(s=Oi.fromAccountData(i.data)),{context:r,value:s}}async getNonce(t,e){return await this.getNonceAndContext(t,e).then(r=>r.value).catch(r=>{throw new Error("failed to get nonce for account "+t.toBase58()+": "+r)})}async requestAirdrop(t,e){let r=await this._rpcRequest("requestAirdrop",[t.toBase58(),e]),i=$(r,Np);if("error"in i)throw new et(i.error,`airdrop to ${t.toBase58()} failed`);return i.result}async _blockhashWithExpiryBlockHeight(t){if(!t){for(;this._pollingBlockhash;)await bn(100);let r=Date.now()-this._blockhashInfo.lastFetch>=Bd;if(this._blockhashInfo.latestBlockhash!==null&&!r)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{let t=Date.now(),e=this._blockhashInfo.latestBlockhash,r=e?e.blockhash:null;for(let i=0;i<50;i++){let s=await this.getLatestBlockhash("finalized");if(r!==s.blockhash)return this._blockhashInfo={latestBlockhash:s,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},s;await bn(Rf/2)}throw new Error(`Unable to obtain a new blockhash after ${Date.now()-t}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(t){let{commitment:e,config:r}=ne(t),i=this._buildArgs([],e,"base64",r),s=await this._rpcRequest("getStakeMinimumDelegation",i),c=$(s,ce(M()));if("error"in c)throw new et(c.error,"failed to get stake minimum delegation");return c.result}async simulateTransaction(t,e,r){if("message"in t){let _=t.serialize(),E=ut.Buffer.from(_).toString("base64");if(Array.isArray(e)||r!==void 0)throw new Error("Invalid arguments");let U=e||{};U.encoding="base64","commitment"in U||(U.commitment=this.commitment),e&&typeof e=="object"&&"innerInstructions"in e&&(U.innerInstructions=e.innerInstructions);let K=[E,U],N=await this._rpcRequest("simulateTransaction",K),D=$(N,yf);if("error"in D)throw new Error("failed to simulate transaction: "+D.error.message);return D.result}let i;if(t instanceof jt){let R=t;i=new jt,i.feePayer=R.feePayer,i.instructions=t.instructions,i.nonceInfo=R.nonceInfo,i.signatures=R.signatures}else i=jt.populate(t),i._message=i._json=void 0;if(e!==void 0&&!Array.isArray(e))throw new Error("Invalid arguments");let s=e;if(i.nonceInfo&&s)i.sign(...s);else{let R=this._disableBlockhashCaching;for(;;){let _=await this._blockhashWithExpiryBlockHeight(R);if(i.lastValidBlockHeight=_.lastValidBlockHeight,i.recentBlockhash=_.blockhash,!s)break;if(i.sign(...s),!i.signature)throw new Error("!signature");let E=i.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(E)&&!this._blockhashInfo.transactionSignatures.includes(E)){this._blockhashInfo.simulatedSignatures.push(E);break}else R=!0}}let c=i._compile(),p=c.serialize(),v=i._serialize(p).toString("base64"),x={encoding:"base64",commitment:this.commitment};if(r){let R=(Array.isArray(r)?r:c.nonProgramIds()).map(_=>_.toBase58());x.accounts={encoding:"base64",addresses:R}}s&&(x.sigVerify=!0),e&&typeof e=="object"&&"innerInstructions"in e&&(x.innerInstructions=e.innerInstructions);let S=[v,x],I=await this._rpcRequest("simulateTransaction",S),B=$(I,yf);if("error"in B){let R;if("data"in B.error&&(R=B.error.data.logs,R&&Array.isArray(R))){let _=`\n `,E=_+R.join(_);console.error(B.error.message,E)}throw new Ci({action:"simulate",signature:"",transactionMessage:B.error.message,logs:R})}return B.result}async sendTransaction(t,e,r){if("version"in t){if(e&&Array.isArray(e))throw new Error("Invalid arguments");let c=t.serialize();return await this.sendRawTransaction(c,e)}if(e===void 0||!Array.isArray(e))throw new Error("Invalid arguments");let i=e;if(t.nonceInfo)t.sign(...i);else{let c=this._disableBlockhashCaching;for(;;){let p=await this._blockhashWithExpiryBlockHeight(c);if(t.lastValidBlockHeight=p.lastValidBlockHeight,t.recentBlockhash=p.blockhash,t.sign(...i),!t.signature)throw new Error("!signature");let y=t.signature.toString("base64");if(this._blockhashInfo.transactionSignatures.includes(y))c=!0;else{this._blockhashInfo.transactionSignatures.push(y);break}}}let s=t.serialize();return await this.sendRawTransaction(s,r)}async sendRawTransaction(t,e){let r=Vt(t).toString("base64");return await this.sendEncodedTransaction(r,e)}async sendEncodedTransaction(t,e){let r={encoding:"base64"},i=e&&e.skipPreflight,s=i===!0?"processed":e&&e.preflightCommitment||this.commitment;e&&e.maxRetries!=null&&(r.maxRetries=e.maxRetries),e&&e.minContextSlot!=null&&(r.minContextSlot=e.minContextSlot),i&&(r.skipPreflight=i),s&&(r.preflightCommitment=s);let c=[t,r],p=await this._rpcRequest("sendTransaction",c),y=$(p,zp);if("error"in y){let v;throw"data"in y.error&&(v=y.error.data.logs),new Ci({action:i?"send":"simulate",signature:"",transactionMessage:y.error.message,logs:v})}return y.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval(()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()},5e3),this._updateSubscriptions()}_wsOnError(t){this._rpcWebSocketConnected=!1,console.error("ws error:",t.message)}_wsOnClose(t){if(this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),t===1e3){this._updateSubscriptions();return}this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach(([e,r])=>{this._setSubscription(e,{...r,state:"pending"})})}_setSubscription(t,e){let r=this._subscriptionsByHash[t]?.state;if(this._subscriptionsByHash[t]=e,r!==e.state){let i=this._subscriptionStateChangeCallbacksByHash[t];i&&i.forEach(s=>{try{s(e.state)}catch{}})}}_onSubscriptionStateChange(t,e){let r=this._subscriptionHashByClientSubscriptionId[t];if(r==null)return()=>{};let i=this._subscriptionStateChangeCallbacksByHash[r]||=new Set;return i.add(e),()=>{i.delete(e),i.size===0&&delete this._subscriptionStateChangeCallbacksByHash[r]}}async _updateSubscriptions(){if(Object.keys(this._subscriptionsByHash).length===0){this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout(()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(r){r instanceof Error&&console.log(`Error when closing socket connection: ${r.message}`)}},500));return}if(this._rpcWebSocketIdleTimeout!==null&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected){this._rpcWebSocket.connect();return}let t=this._rpcWebSocketGeneration,e=()=>t===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map(async r=>{let i=this._subscriptionsByHash[r];if(i!==void 0)switch(i.state){case"pending":case"unsubscribed":if(i.callbacks.size===0){delete this._subscriptionsByHash[r],i.state==="unsubscribed"&&delete this._subscriptionCallbacksByServerSubscriptionId[i.serverSubscriptionId],await this._updateSubscriptions();return}await(async()=>{let{args:s,method:c}=i;try{this._setSubscription(r,{...i,state:"subscribing"});let p=await this._rpcWebSocket.call(c,s);this._setSubscription(r,{...i,serverSubscriptionId:p,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[p]=i.callbacks,await this._updateSubscriptions()}catch(p){if(p instanceof Error&&console.error(`${c} error for argument`,s,p.message),!e())return;this._setSubscription(r,{...i,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":i.callbacks.size===0&&await(async()=>{let{serverSubscriptionId:s,unsubscribeMethod:c}=i;if(this._subscriptionsAutoDisposedByRpc.has(s))this._subscriptionsAutoDisposedByRpc.delete(s);else{this._setSubscription(r,{...i,state:"unsubscribing"}),this._setSubscription(r,{...i,state:"unsubscribing"});try{await this._rpcWebSocket.call(c,[s])}catch(p){if(p instanceof Error&&console.error(`${c} error:`,p.message),!e())return;this._setSubscription(r,{...i,state:"subscribed"}),await this._updateSubscriptions();return}}this._setSubscription(r,{...i,state:"unsubscribed"}),await this._updateSubscriptions()})();break}}))}_handleServerNotification(t,e){let r=this._subscriptionCallbacksByServerSubscriptionId[t];r!==void 0&&r.forEach(i=>{try{i(...e)}catch(s){console.error(s)}})}_wsOnAccountNotification(t){let{result:e,subscription:r}=$(t,ap);this._handleServerNotification(r,[e.value,e.context])}_makeSubscription(t,e){let r=this._nextClientSubscriptionId++,i=lf([t.method,e]),s=this._subscriptionsByHash[i];return s===void 0?this._subscriptionsByHash[i]={...t,args:e,callbacks:new Set([t.callback]),state:"pending"}:s.callbacks.add(t.callback),this._subscriptionHashByClientSubscriptionId[r]=i,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete this._subscriptionHashByClientSubscriptionId[r];let c=this._subscriptionsByHash[i];Qt(c!==void 0,`Could not find a \\`Subscription\\` when tearing down client subscription #${r}`),c.callbacks.delete(t.callback),await this._updateSubscriptions()},this._updateSubscriptions(),r}onAccountChange(t,e,r){let{commitment:i,config:s}=ne(r),c=this._buildArgs([t.toBase58()],i||this._commitment||"finalized","base64",s);return this._makeSubscription({callback:e,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},c)}async removeAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"account change")}_wsOnProgramAccountNotification(t){let{result:e,subscription:r}=$(t,cp);this._handleServerNotification(r,[{accountId:e.value.pubkey,accountInfo:e.value.account},e.context])}onProgramAccountChange(t,e,r,i){let{commitment:s,config:c}=ne(r),p=this._buildArgs([t.toBase58()],s||this._commitment||"finalized","base64",c||(i?{filters:pf(i)}:void 0));return this._makeSubscription({callback:e,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},p)}async removeProgramAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"program account change")}onLogs(t,e,r){let i=this._buildArgs([typeof t=="object"?{mentions:[t.toString()]}:t],r||this._commitment||"finalized");return this._makeSubscription({callback:e,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},i)}async removeOnLogsListener(t){await this._unsubscribeClientSubscription(t,"logs")}_wsOnLogsNotification(t){let{result:e,subscription:r}=$(t,Fp);this._handleServerNotification(r,[e.value,e.context])}_wsOnSlotNotification(t){let{result:e,subscription:r}=$(t,hp);this._handleServerNotification(r,[e])}onSlotChange(t){return this._makeSubscription({callback:t,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(t){await this._unsubscribeClientSubscription(t,"slot change")}_wsOnSlotUpdatesNotification(t){let{result:e,subscription:r}=$(t,dp);this._handleServerNotification(r,[e])}onSlotUpdate(t){return this._makeSubscription({callback:t,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(t){await this._unsubscribeClientSubscription(t,"slot update")}async _unsubscribeClientSubscription(t,e){let r=this._subscriptionDisposeFunctionsByClientSubscriptionId[t];r?await r():console.warn(`Ignored unsubscribe request because an active subscription with id \\`${t}\\` for \'${e}\' events could not be found.`)}_buildArgs(t,e,r,i){let s=e||this._commitment;if(s||r||i){let c={};r&&(c.encoding=r),s&&(c.commitment=s),i&&(c=Object.assign(c,i)),t.push(c)}return t}_buildArgsAtLeastConfirmed(t,e,r,i){let s=e||this._commitment;if(s&&!["confirmed","finalized"].includes(s))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(t,e,r,i)}_wsOnSignatureNotification(t){let{result:e,subscription:r}=$(t,pp);e.value!=="receivedSignature"&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,e.value==="receivedSignature"?[{type:"received"},e.context]:[{type:"status",result:e.value},e.context])}onSignature(t,e,r){let i=this._buildArgs([t],r||this._commitment||"finalized"),s=this._makeSubscription({callback:(c,p)=>{if(c.type==="status"){e(c.result,p);try{this.removeSignatureListener(s)}catch{}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},i);return s}onSignatureWithOptions(t,e,r){let{commitment:i,...s}={...r,commitment:r&&r.commitment||this._commitment||"finalized"},c=this._buildArgs([t],i,void 0,s),p=this._makeSubscription({callback:(y,v)=>{e(y,v);try{this.removeSignatureListener(p)}catch{}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},c);return p}async removeSignatureListener(t){await this._unsubscribeClientSubscription(t,"signature result")}_wsOnRootNotification(t){let{result:e,subscription:r}=$(t,yp);this._handleServerNotification(r,[e])}onRootChange(t){return this._makeSubscription({callback:t,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(t){await this._unsubscribeClientSubscription(t,"root change")}},fr=class{constructor(t){this._keypair=void 0,this._keypair=t??af()}static generate(){return new fr(af())}static fromSecretKey(t,e){if(t.byteLength!==64)throw new Error("bad secret key size");let r=t.slice(32,64);if(!e||!e.skipValidation){let i=t.slice(0,32),s=_a(i);for(let c=0;c<32;c++)if(r[c]!==s[c])throw new Error("provided secretKey is invalid")}return new fr({publicKey:r,secretKey:t})}static fromSeed(t){let e=_a(t),r=new Uint8Array(64);return r.set(t),r.set(e,32),new fr({publicKey:e,secretKey:r})}get publicKey(){return new ot(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}},Li=Object.freeze({CreateLookupTable:{index:0,layout:k.struct([k.u32("instruction"),Gn("recentSlot"),k.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:k.struct([k.u32("instruction")])},ExtendLookupTable:{index:2,layout:k.struct([k.u32("instruction"),Gn(),k.seq($t(),k.offset(k.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:k.struct([k.u32("instruction")])},CloseLookupTable:{index:4,layout:k.struct([k.u32("instruction")])}}),Ca=class{constructor(){}static createLookupTable(t){let[e,r]=ot.findProgramAddressSync([t.authority.toBuffer(),(0,qi.toBufferLE)(BigInt(t.recentSlot),8)],this.programId),i=Li.CreateLookupTable,s=Zt(i,{recentSlot:BigInt(t.recentSlot),bumpSeed:r}),c=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1},{pubkey:t.payer,isSigner:!0,isWritable:!0},{pubkey:ye.programId,isSigner:!1,isWritable:!1}];return[new re({programId:this.programId,keys:c,data:s}),e]}static freezeLookupTable(t){let e=Li.FreezeLookupTable,r=Zt(e),i=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return new re({programId:this.programId,keys:i,data:r})}static extendLookupTable(t){let e=Li.ExtendLookupTable,r=Zt(e,{addresses:t.addresses.map(s=>s.toBytes())}),i=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return t.payer&&i.push({pubkey:t.payer,isSigner:!0,isWritable:!0},{pubkey:ye.programId,isSigner:!1,isWritable:!1}),new re({programId:this.programId,keys:i,data:r})}static deactivateLookupTable(t){let e=Li.DeactivateLookupTable,r=Zt(e),i=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return new re({programId:this.programId,keys:i,data:r})}static closeLookupTable(t){let e=Li.CloseLookupTable,r=Zt(e),i=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1},{pubkey:t.recipient,isSigner:!1,isWritable:!0}];return new re({programId:this.programId,keys:i,data:r})}};Ca.programId=new ot("AddressLookupTab1e1111111111111111111111111");Ho=Object.freeze({RequestUnits:{index:0,layout:k.struct([k.u8("instruction"),k.u32("units"),k.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:k.struct([k.u8("instruction"),k.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:k.struct([k.u8("instruction"),k.u32("units")])},SetComputeUnitPrice:{index:3,layout:k.struct([k.u8("instruction"),Gn("microLamports")])}}),Oa=class{constructor(){}static requestUnits(t){let e=Ho.RequestUnits,r=Zt(e,t);return new re({keys:[],programId:this.programId,data:r})}static requestHeapFrame(t){let e=Ho.RequestHeapFrame,r=Zt(e,t);return new re({keys:[],programId:this.programId,data:r})}static setComputeUnitLimit(t){let e=Ho.SetComputeUnitLimit,r=Zt(e,t);return new re({keys:[],programId:this.programId,data:r})}static setComputeUnitPrice(t){let e=Ho.SetComputeUnitPrice,r=Zt(e,{microLamports:BigInt(t.microLamports)});return new re({keys:[],programId:this.programId,data:r})}};Oa.programId=new ot("ComputeBudget111111111111111111111111111111");wf=64,bf=32,vf=64,xf=k.struct([k.u8("numSignatures"),k.u8("padding"),k.u16("signatureOffset"),k.u16("signatureInstructionIndex"),k.u16("publicKeyOffset"),k.u16("publicKeyInstructionIndex"),k.u16("messageDataOffset"),k.u16("messageDataSize"),k.u16("messageInstructionIndex")]),Ni=class{constructor(){}static createInstructionWithPublicKey(t){let{publicKey:e,message:r,signature:i,instructionIndex:s}=t;Qt(e.length===bf,`Public Key must be ${bf} bytes but received ${e.length} bytes`),Qt(i.length===vf,`Signature must be ${vf} bytes but received ${i.length} bytes`);let c=xf.span,p=c+e.length,y=p+i.length,v=1,x=ut.Buffer.alloc(y+r.length),S=s??65535;return xf.encode({numSignatures:v,padding:0,signatureOffset:p,signatureInstructionIndex:S,publicKeyOffset:c,publicKeyInstructionIndex:S,messageDataOffset:y,messageDataSize:r.length,messageInstructionIndex:S},x),x.fill(e,c),x.fill(i,p),x.fill(r,y),new re({keys:[],programId:Ni.programId,data:x})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:r,instructionIndex:i}=t;Qt(e.length===wf,`Private key must be ${wf} bytes but received ${e.length} bytes`);try{let s=fr.fromSecretKey(e),c=s.publicKey.toBytes(),p=Ua(r,s.secretKey);return this.createInstructionWithPublicKey({publicKey:c,message:r,signature:p,instructionIndex:i})}catch(s){throw new Error(`Error creating instruction; ${s}`)}}};Ni.programId=new ot("Ed25519SigVerify111111111111111111111111111");Dp=(n,t)=>{let e=Ai.sign(n,t);return[e.toCompactRawBytes(),e.recovery]};Ai.utils.isValidPrivateKey;Wp=Ai.getPublicKey,kf=32,Ba=20,Sf=64,Hp=11,Ea=k.struct([k.u8("numSignatures"),k.u16("signatureOffset"),k.u8("signatureInstructionIndex"),k.u16("ethAddressOffset"),k.u8("ethAddressInstructionIndex"),k.u16("messageDataOffset"),k.u16("messageDataSize"),k.u8("messageInstructionIndex"),k.blob(20,"ethAddress"),k.blob(64,"signature"),k.u8("recoveryId")]),kn=class{constructor(){}static publicKeyToEthAddress(t){Qt(t.length===Sf,`Public key must be ${Sf} bytes but received ${t.length} bytes`);try{return ut.Buffer.from(pa(Vt(t))).slice(-Ba)}catch(e){throw new Error(`Error constructing Ethereum address: ${e}`)}}static createInstructionWithPublicKey(t){let{publicKey:e,message:r,signature:i,recoveryId:s,instructionIndex:c}=t;return kn.createInstructionWithEthAddress({ethAddress:kn.publicKeyToEthAddress(e),message:r,signature:i,recoveryId:s,instructionIndex:c})}static createInstructionWithEthAddress(t){let{ethAddress:e,message:r,signature:i,recoveryId:s,instructionIndex:c=0}=t,p;typeof e=="string"?e.startsWith("0x")?p=ut.Buffer.from(e.substr(2),"hex"):p=ut.Buffer.from(e,"hex"):p=e,Qt(p.length===Ba,`Address must be ${Ba} bytes but received ${p.length} bytes`);let y=1+Hp,v=y,x=y+p.length,S=x+i.length+1,I=1,B=ut.Buffer.alloc(Ea.span+r.length);return Ea.encode({numSignatures:I,signatureOffset:x,signatureInstructionIndex:c,ethAddressOffset:v,ethAddressInstructionIndex:c,messageDataOffset:S,messageDataSize:r.length,messageInstructionIndex:c,signature:Vt(i),ethAddress:Vt(p),recoveryId:s},B),B.fill(Vt(r),Ea.span),new re({keys:[],programId:kn.programId,data:B})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:r,instructionIndex:i}=t;Qt(e.length===kf,`Private key must be ${kf} bytes but received ${e.length} bytes`);try{let s=Vt(e),c=Wp(s,!1).slice(1),p=ut.Buffer.from(pa(Vt(r))),[y,v]=Dp(p,s);return this.createInstructionWithPublicKey({publicKey:c,message:r,signature:y,recoveryId:v,instructionIndex:i})}catch(s){throw new Error(`Error creating instruction; ${s}`)}}};kn.programId=new ot("KeccakSecp256k11111111111111111111111111111");$p=new ot("StakeConfig11111111111111111111111111111111"),zi=class{constructor(t,e,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=e,this.custodian=r}};Wf=zi;zi.default=new Wf(0,0,ot.default);Tr=Object.freeze({Initialize:{index:0,layout:k.struct([k.u32("instruction"),rd(),nd()])},Authorize:{index:1,layout:k.struct([k.u32("instruction"),$t("newAuthorized"),k.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:k.struct([k.u32("instruction")])},Split:{index:3,layout:k.struct([k.u32("instruction"),k.ns64("lamports")])},Withdraw:{index:4,layout:k.struct([k.u32("instruction"),k.ns64("lamports")])},Deactivate:{index:5,layout:k.struct([k.u32("instruction")])},Merge:{index:7,layout:k.struct([k.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:k.struct([k.u32("instruction"),$t("newAuthorized"),k.u32("stakeAuthorizationType"),Wn("authoritySeed"),$t("authorityOwner")])}}),F1=Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),Xo=class{constructor(){}static initialize(t){let{stakePubkey:e,authorized:r,lockup:i}=t,s=i||zi.default,c=Tr.Initialize,p=Zt(c,{authorized:{staker:Vt(r.staker.toBuffer()),withdrawer:Vt(r.withdrawer.toBuffer())},lockup:{unixTimestamp:s.unixTimestamp,epoch:s.epoch,custodian:Vt(s.custodian.toBuffer())}}),y={keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:Pi,isSigner:!1,isWritable:!1}],programId:this.programId,data:p};return new re(y)}static createAccountWithSeed(t){let e=new jt;e.add(ye.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:r,authorized:i,lockup:s}=t;return e.add(this.initialize({stakePubkey:r,authorized:i,lockup:s}))}static createAccount(t){let e=new jt;e.add(ye.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:r,authorized:i,lockup:s}=t;return e.add(this.initialize({stakePubkey:r,authorized:i,lockup:s}))}static delegate(t){let{stakePubkey:e,authorizedPubkey:r,votePubkey:i}=t,s=Tr.Delegate,c=Zt(s);return new jt().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!1},{pubkey:ur,isSigner:!1,isWritable:!1},{pubkey:va,isSigner:!1,isWritable:!1},{pubkey:$p,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:c})}static authorize(t){let{stakePubkey:e,authorizedPubkey:r,newAuthorizedPubkey:i,stakeAuthorizationType:s,custodianPubkey:c}=t,p=Tr.Authorize,y=Zt(p,{newAuthorized:Vt(i.toBuffer()),stakeAuthorizationType:s.index}),v=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:ur,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return c&&v.push({pubkey:c,isSigner:!0,isWritable:!1}),new jt().add({keys:v,programId:this.programId,data:y})}static authorizeWithSeed(t){let{stakePubkey:e,authorityBase:r,authoritySeed:i,authorityOwner:s,newAuthorizedPubkey:c,stakeAuthorizationType:p,custodianPubkey:y}=t,v=Tr.AuthorizeWithSeed,x=Zt(v,{newAuthorized:Vt(c.toBuffer()),stakeAuthorizationType:p.index,authoritySeed:i,authorityOwner:Vt(s.toBuffer())}),S=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:ur,isSigner:!1,isWritable:!1}];return y&&S.push({pubkey:y,isSigner:!0,isWritable:!1}),new jt().add({keys:S,programId:this.programId,data:x})}static splitInstruction(t){let{stakePubkey:e,authorizedPubkey:r,splitStakePubkey:i,lamports:s}=t,c=Tr.Split,p=Zt(c,{lamports:s});return new re({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:p})}static split(t,e){let r=new jt;return r.add(ye.createAccount({fromPubkey:t.authorizedPubkey,newAccountPubkey:t.splitStakePubkey,lamports:e,space:this.space,programId:this.programId})),r.add(this.splitInstruction(t))}static splitWithSeed(t,e){let{stakePubkey:r,authorizedPubkey:i,splitStakePubkey:s,basePubkey:c,seed:p,lamports:y}=t,v=new jt;return v.add(ye.allocate({accountPubkey:s,basePubkey:c,seed:p,space:this.space,programId:this.programId})),e&&e>0&&v.add(ye.transfer({fromPubkey:t.authorizedPubkey,toPubkey:s,lamports:e})),v.add(this.splitInstruction({stakePubkey:r,authorizedPubkey:i,splitStakePubkey:s,lamports:y}))}static merge(t){let{stakePubkey:e,sourceStakePubKey:r,authorizedPubkey:i}=t,s=Tr.Merge,c=Zt(s);return new jt().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:ur,isSigner:!1,isWritable:!1},{pubkey:va,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:c})}static withdraw(t){let{stakePubkey:e,authorizedPubkey:r,toPubkey:i,lamports:s,custodianPubkey:c}=t,p=Tr.Withdraw,y=Zt(p,{lamports:s}),v=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:ur,isSigner:!1,isWritable:!1},{pubkey:va,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return c&&v.push({pubkey:c,isSigner:!0,isWritable:!1}),new jt().add({keys:v,programId:this.programId,data:y})}static deactivate(t){let{stakePubkey:e,authorizedPubkey:r}=t,i=Tr.Deactivate,s=Zt(i);return new jt().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:ur,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:s})}};Xo.programId=new ot("Stake11111111111111111111111111111111111111");Xo.space=200;Ri=Object.freeze({InitializeAccount:{index:0,layout:k.struct([k.u32("instruction"),id()])},Authorize:{index:1,layout:k.struct([k.u32("instruction"),$t("newAuthorized"),k.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:k.struct([k.u32("instruction"),k.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:k.struct([k.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:k.struct([k.u32("instruction"),od()])}}),K1=Object.freeze({Voter:{index:0},Withdrawer:{index:1}}),jn=class{constructor(){}static initializeAccount(t){let{votePubkey:e,nodePubkey:r,voteInit:i}=t,s=Ri.InitializeAccount,c=Zt(s,{voteInit:{nodePubkey:Vt(i.nodePubkey.toBuffer()),authorizedVoter:Vt(i.authorizedVoter.toBuffer()),authorizedWithdrawer:Vt(i.authorizedWithdrawer.toBuffer()),commission:i.commission}}),p={keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:Pi,isSigner:!1,isWritable:!1},{pubkey:ur,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:c};return new re(p)}static createAccount(t){let e=new jt;return e.add(ye.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.votePubkey,lamports:t.lamports,space:this.space,programId:this.programId})),e.add(this.initializeAccount({votePubkey:t.votePubkey,nodePubkey:t.voteInit.nodePubkey,voteInit:t.voteInit}))}static authorize(t){let{votePubkey:e,authorizedPubkey:r,newAuthorizedPubkey:i,voteAuthorizationType:s}=t,c=Ri.Authorize,p=Zt(c,{newAuthorized:Vt(i.toBuffer()),voteAuthorizationType:s.index}),y=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:ur,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return new jt().add({keys:y,programId:this.programId,data:p})}static authorizeWithSeed(t){let{currentAuthorityDerivedKeyBasePubkey:e,currentAuthorityDerivedKeyOwnerPubkey:r,currentAuthorityDerivedKeySeed:i,newAuthorizedPubkey:s,voteAuthorizationType:c,votePubkey:p}=t,y=Ri.AuthorizeWithSeed,v=Zt(y,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:Vt(r.toBuffer()),currentAuthorityDerivedKeySeed:i,newAuthorized:Vt(s.toBuffer()),voteAuthorizationType:c.index}}),x=[{pubkey:p,isSigner:!1,isWritable:!0},{pubkey:ur,isSigner:!1,isWritable:!1},{pubkey:e,isSigner:!0,isWritable:!1}];return new jt().add({keys:x,programId:this.programId,data:v})}static withdraw(t){let{votePubkey:e,authorizedWithdrawerPubkey:r,lamports:i,toPubkey:s}=t,c=Ri.Withdraw,p=Zt(c,{lamports:i}),y=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return new jt().add({keys:y,programId:this.programId,data:p})}static safeWithdraw(t,e,r){if(t.lamports>e-r)throw new Error("Withdraw will leave vote account with insufficient funds.");return jn.withdraw(t)}static updateValidatorIdentity(t){let{votePubkey:e,authorizedWithdrawerPubkey:r,nodePubkey:i}=t,s=Ri.UpdateValidatorIdentity,c=Zt(s),p=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return new jt().add({keys:p,programId:this.programId,data:c})}};jn.programId=new ot("Vote111111111111111111111111111111111111111");jn.space=3762;D1=new ot("Va1idator1nfo111111111111111111111111111111"),W1=q({name:W(),website:it(W()),details:it(W()),iconUrl:it(W()),keybaseUsername:it(W())}),H1=new ot("Vote111111111111111111111111111111111111111"),$1=k.struct([$t("nodePubkey"),$t("authorizedWithdrawer"),k.u8("commission"),k.nu64(),k.seq(k.struct([k.nu64("slot"),k.u32("confirmationCount")]),k.offset(k.u32(),-8),"votes"),k.u8("rootSlotValid"),k.nu64("rootSlot"),k.nu64(),k.seq(k.struct([k.nu64("epoch"),$t("authorizedVoter")]),k.offset(k.u32(),-8),"authorizedVoters"),k.struct([k.seq(k.struct([$t("authorizedPubkey"),k.nu64("epochOfLastAuthorizedSwitch"),k.nu64("targetEpoch")]),32,"buf"),k.nu64("idx"),k.u8("isEmpty")],"priorVoters"),k.nu64(),k.seq(k.struct([k.nu64("epoch"),k.nu64("credits"),k.nu64("prevCredits")]),k.offset(k.u32(),-8),"epochCredits"),k.struct([k.nu64("slot"),k.nu64("timestamp")],"lastTimestamp")]),Bf={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}}});function Vf(n){if(!["devnet","testnet","mainnet-beta"].includes(n.chain))throw new Error(`Invalid Solana network: ${n.chain}`);if(!n.serializedTransaction||n.serializedTransaction.length===0)throw new Error(`Invalid serializedTransaction: ${n.serializedTransaction}`)}function Vp({solanaKeyPair:n,transaction:t}){try{if(t.sign(n),!t.signature)throw new Error("Transaction signature is null");return ethers.utils.base58.encode(t.signature)}catch(e){throw new Error(`When signing transaction - ${e.message}`)}}function Gp({solanaKeyPair:n,transaction:t}){try{if(t.sign([n]),!t.signatures.length)throw new Error("Transaction signature is null");return ethers.utils.base58.encode(t.signatures[0])}catch(e){throw new Error(`When signing transaction - ${e.message}`)}}async function Zp({chain:n,transaction:t}){try{return await new Jo(Hf(n),"confirmed").sendRawTransaction(t.serialize())}catch(e){throw new Error(`When sending transaction - ${e.message}`)}}async function Gf({broadcast:n,privateKey:t,unsignedTransaction:e,versionedTransaction:r}){let i=fr.fromSecretKey(Buffer.from(t,"hex")),s,c;if(r){let y=Buffer.from(e.serializedTransaction,"base64");s=Vn.deserialize(y),c=Gp({transaction:s,solanaKeyPair:i})}else s=jt.from(Buffer.from(e.serializedTransaction,"base64")),c=Vp({transaction:s,solanaKeyPair:i});if(!n)return c;let p=e.chain;return await Zp({chain:p,transaction:s})}var J1,Zf=vt(()=>{"use strict";J1=C(z());$f()});async function jf({accessControlConditions:n,ciphertext:t,dataToEncryptHash:e,unsignedTransaction:r,broadcast:i,versionedTransaction:s}){Vf(r);let c=await gu({accessControlConditions:n,ciphertext:t,dataToEncryptHash:e});return Gf({broadcast:i,privateKey:c,unsignedTransaction:r,versionedTransaction:s})}var ew,Yf=vt(()=>{"use strict";ew=C(z());mu();Zf()});var jp=he(()=>{var sw=C(z());lu();Yf();(async()=>hu(async()=>jf({accessControlConditions,ciphertext,dataToEncryptHash,unsignedTransaction,broadcast,versionedTransaction})))()});jp();})();\n/*! Bundled license information:\n\nieee754/index.js:\n (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *)\n\nbuffer/index.js:\n (*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n *)\n\n@noble/hashes/esm/utils.js:\n (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/abstract/utils.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/abstract/modular.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/abstract/curve.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/abstract/edwards.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/ed25519.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\nsafe-buffer/index.js:\n (*! safe-buffer. MIT License. Feross Aboukhadijeh *)\n\n@solana/buffer-layout/lib/Layout.js:\n (**\n * Support for translating between Uint8Array instances and JavaScript\n * native types.\n *\n * {@link module:Layout~Layout|Layout} is the basis of a class\n * hierarchy that associates property names with sequences of encoded\n * bytes.\n *\n * Layouts are supported for these scalar (numeric) types:\n * * {@link module:Layout~UInt|Unsigned integers in little-endian\n * format} with {@link module:Layout.u8|8-bit}, {@link\n * module:Layout.u16|16-bit}, {@link module:Layout.u24|24-bit},\n * {@link module:Layout.u32|32-bit}, {@link\n * module:Layout.u40|40-bit}, and {@link module:Layout.u48|48-bit}\n * representation ranges;\n * * {@link module:Layout~UIntBE|Unsigned integers in big-endian\n * format} with {@link module:Layout.u16be|16-bit}, {@link\n * module:Layout.u24be|24-bit}, {@link module:Layout.u32be|32-bit},\n * {@link module:Layout.u40be|40-bit}, and {@link\n * module:Layout.u48be|48-bit} representation ranges;\n * * {@link module:Layout~Int|Signed integers in little-endian\n * format} with {@link module:Layout.s8|8-bit}, {@link\n * module:Layout.s16|16-bit}, {@link module:Layout.s24|24-bit},\n * {@link module:Layout.s32|32-bit}, {@link\n * module:Layout.s40|40-bit}, and {@link module:Layout.s48|48-bit}\n * representation ranges;\n * * {@link module:Layout~IntBE|Signed integers in big-endian format}\n * with {@link module:Layout.s16be|16-bit}, {@link\n * module:Layout.s24be|24-bit}, {@link module:Layout.s32be|32-bit},\n * {@link module:Layout.s40be|40-bit}, and {@link\n * module:Layout.s48be|48-bit} representation ranges;\n * * 64-bit integral values that decode to an exact (if magnitude is\n * less than 2^53) or nearby integral Number in {@link\n * module:Layout.nu64|unsigned little-endian}, {@link\n * module:Layout.nu64be|unsigned big-endian}, {@link\n * module:Layout.ns64|signed little-endian}, and {@link\n * module:Layout.ns64be|unsigned big-endian} encodings;\n * * 32-bit floating point values with {@link\n * module:Layout.f32|little-endian} and {@link\n * module:Layout.f32be|big-endian} representations;\n * * 64-bit floating point values with {@link\n * module:Layout.f64|little-endian} and {@link\n * module:Layout.f64be|big-endian} representations;\n * * {@link module:Layout.const|Constants} that take no space in the\n * encoded expression.\n *\n * and for these aggregate types:\n * * {@link module:Layout.seq|Sequence}s of instances of a {@link\n * module:Layout~Layout|Layout}, with JavaScript representation as\n * an Array and constant or data-dependent {@link\n * module:Layout~Sequence#count|length};\n * * {@link module:Layout.struct|Structure}s that aggregate a\n * heterogeneous sequence of {@link module:Layout~Layout|Layout}\n * instances, with JavaScript representation as an Object;\n * * {@link module:Layout.union|Union}s that support multiple {@link\n * module:Layout~VariantLayout|variant layouts} over a fixed\n * (padded) or variable (not padded) span of bytes, using an\n * unsigned integer at the start of the data or a separate {@link\n * module:Layout.unionLayoutDiscriminator|layout element} to\n * determine which layout to use when interpreting the buffer\n * contents;\n * * {@link module:Layout.bits|BitStructure}s that contain a sequence\n * of individual {@link\n * module:Layout~BitStructure#addField|BitField}s packed into an 8,\n * 16, 24, or 32-bit unsigned integer starting at the least- or\n * most-significant bit;\n * * {@link module:Layout.cstr|C strings} of varying length;\n * * {@link module:Layout.blob|Blobs} of fixed- or variable-{@link\n * module:Layout~Blob#length|length} raw data.\n *\n * All {@link module:Layout~Layout|Layout} instances are immutable\n * after construction, to prevent internal state from becoming\n * inconsistent.\n *\n * @local Layout\n * @local ExternalLayout\n * @local GreedyCount\n * @local OffsetLayout\n * @local UInt\n * @local UIntBE\n * @local Int\n * @local IntBE\n * @local NearUInt64\n * @local NearUInt64BE\n * @local NearInt64\n * @local NearInt64BE\n * @local Float\n * @local FloatBE\n * @local Double\n * @local DoubleBE\n * @local Sequence\n * @local Structure\n * @local UnionDiscriminator\n * @local UnionLayoutDiscriminator\n * @local Union\n * @local VariantLayout\n * @local BitStructure\n * @local BitField\n * @local Boolean\n * @local Blob\n * @local CString\n * @local Constant\n * @local bindConstructorLayout\n * @module Layout\n * @license MIT\n * @author Peter A. Bigot\n * @see {@link https://github.com/pabigot/buffer-layout|buffer-layout on GitHub}\n *)\n\n@noble/curves/esm/abstract/weierstrass.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/_shortw_utils.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n\n@noble/curves/esm/secp256k1.js:\n (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)\n*/\n'; + module2.exports = { + code: code9, + }; + }, +}); + +// node_modules/safe-buffer/index.js +var require_safe_buffer = __commonJS({ + 'node_modules/safe-buffer/index.js'(exports, module2) { + init_shim(); + var buffer = __require('buffer'); + var Buffer4 = buffer.Buffer; + function copyProps(src, dst) { + for (var key2 in src) { + dst[key2] = src[key2]; + } + } + if ( + Buffer4.from && + Buffer4.alloc && + Buffer4.allocUnsafe && + Buffer4.allocUnsafeSlow + ) { + module2.exports = buffer; + } else { + copyProps(buffer, exports); + exports.Buffer = SafeBuffer; + } + function SafeBuffer(arg, encodingOrOffset, length) { + return Buffer4(arg, encodingOrOffset, length); + } + SafeBuffer.prototype = Object.create(Buffer4.prototype); + copyProps(Buffer4, SafeBuffer); + SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number'); + } + return Buffer4(arg, encodingOrOffset, length); + }; + SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number'); + } + var buf = Buffer4(size); + if (fill !== void 0) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding); + } else { + buf.fill(fill); + } + } else { + buf.fill(0); + } + return buf; + }; + SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number'); + } + return Buffer4(size); + }; + SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number'); + } + return buffer.SlowBuffer(size); + }; + }, +}); + +// node_modules/base-x/src/index.js +var require_src = __commonJS({ + 'node_modules/base-x/src/index.js'(exports, module2) { + 'use strict'; + init_shim(); + var _Buffer = require_safe_buffer().Buffer; + function base2(ALPHABET) { + if (ALPHABET.length >= 255) { + throw new TypeError('Alphabet too long'); + } + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; + } + for (var i2 = 0; i2 < ALPHABET.length; i2++) { + var x = ALPHABET.charAt(i2); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { + throw new TypeError(x + ' is ambiguous'); + } + BASE_MAP[xc] = i2; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); + var iFACTOR = Math.log(256) / Math.log(BASE); + function encode6(source) { + if (Array.isArray(source) || source instanceof Uint8Array) { + source = _Buffer.from(source); + } + if (!_Buffer.isBuffer(source)) { + throw new TypeError('Expected Buffer'); + } + if (source.length === 0) { + return ''; + } + var zeroes = 0; + var length = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } + var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; + var b58 = new Uint8Array(size); + while (pbegin !== pend) { + var carry = source[pbegin]; + var i3 = 0; + for ( + var it1 = size - 1; + (carry !== 0 || i3 < length) && it1 !== -1; + it1--, i3++ + ) { + carry += (256 * b58[it1]) >>> 0; + b58[it1] = carry % BASE >>> 0; + carry = (carry / BASE) >>> 0; + } + if (carry !== 0) { + throw new Error('Non-zero carry'); + } + length = i3; + pbegin++; + } + var it2 = size - length; + while (it2 !== size && b58[it2] === 0) { + it2++; + } + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { + str += ALPHABET.charAt(b58[it2]); + } + return str; + } + function decodeUnsafe(source) { + if (typeof source !== 'string') { + throw new TypeError('Expected String'); + } + if (source.length === 0) { + return _Buffer.alloc(0); + } + var psz = 0; + var zeroes = 0; + var length = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; + } + var size = ((source.length - psz) * FACTOR + 1) >>> 0; + var b256 = new Uint8Array(size); + while (psz < source.length) { + var carry = BASE_MAP[source.charCodeAt(psz)]; + if (carry === 255) { + return; + } + var i3 = 0; + for ( + var it3 = size - 1; + (carry !== 0 || i3 < length) && it3 !== -1; + it3--, i3++ + ) { + carry += (BASE * b256[it3]) >>> 0; + b256[it3] = carry % 256 >>> 0; + carry = (carry / 256) >>> 0; + } + if (carry !== 0) { + throw new Error('Non-zero carry'); + } + length = i3; + psz++; + } + var it4 = size - length; + while (it4 !== size && b256[it4] === 0) { + it4++; + } + var vch = _Buffer.allocUnsafe(zeroes + (size - it4)); + vch.fill(0, 0, zeroes); + var j2 = zeroes; + while (it4 !== size) { + vch[j2++] = b256[it4++]; + } + return vch; + } + function decode6(string) { + var buffer = decodeUnsafe(string); + if (buffer) { + return buffer; + } + throw new Error('Non-base' + BASE + ' character'); + } + return { + encode: encode6, + decodeUnsafe, + decode: decode6, + }; + } + module2.exports = base2; + }, +}); + +// node_modules/bs58/index.js +var require_bs58 = __commonJS({ + 'node_modules/bs58/index.js'(exports, module2) { + init_shim(); + var basex = require_src(); + var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; + module2.exports = basex(ALPHABET); + }, +}); + +// local-tests/index.ts +init_shim(); + +// local-tests/setup/tinny-environment.ts +init_shim(); + +// packages/lit-node-client/src/index.ts +init_shim(); + +// packages/lit-node-client/src/lib/lit-node-client.ts +init_shim(); + +// packages/auth-browser/src/index.ts +init_shim(); + +// packages/auth-browser/src/lib/auth-browser.ts +init_shim(); + +// packages/constants/src/index.ts +init_shim(); + +// packages/constants/src/lib/version.ts +init_shim(); +var version = '8.0.0-alpha.0'; + +// packages/constants/src/lib/constants/constants.ts +init_shim(); +import depd from 'depd'; +var deprecated = depd('lit-js-sdk:constants:constants'); +var LIT_AUTH_SIG_CHAIN_KEYS = ['ethereum', 'solana', 'cosmos', 'kyve']; +var AUTH_SIGNATURE_BODY = + 'I am creating an account to use Lit Protocol at {{timestamp}}'; +var yellowstoneChain = { + contractAddress: null, + chainId: 175188, + name: 'Chronicle Yellowstone - Lit Protocol Testnet', + symbol: 'tstLPX', + decimals: 18, + rpcUrls: ['https://yellowstone-rpc.litprotocol.com/'], + blockExplorerUrls: ['https://yellowstone-explorer.litprotocol.com/'], + type: null, + vmType: 'EVM', +}; +var LIT_CHAINS = { + ethereum: { + contractAddress: '0xA54F7579fFb3F98bd8649fF02813F575f9b3d353', + chainId: 1, + name: 'Ethereum', + symbol: 'ETH', + decimals: 18, + type: 'ERC1155', + rpcUrls: [ + 'https://eth-mainnet.alchemyapi.io/v2/EuGnkVlzVoEkzdg0lpCarhm8YHOxWVxE', + ], + blockExplorerUrls: ['https://etherscan.io'], + vmType: 'EVM', + }, + polygon: { + contractAddress: '0x7C7757a9675f06F3BE4618bB68732c4aB25D2e88', + chainId: 137, + name: 'Polygon', + symbol: 'MATIC', + decimals: 18, + rpcUrls: ['https://polygon-rpc.com'], + blockExplorerUrls: ['https://explorer.matic.network'], + type: 'ERC1155', + vmType: 'EVM', + }, + fantom: { + contractAddress: '0x5bD3Fe8Ab542f0AaBF7552FAAf376Fd8Aa9b3869', + chainId: 250, + name: 'Fantom', + symbol: 'FTM', + decimals: 18, + rpcUrls: ['https://rpcapi.fantom.network'], + blockExplorerUrls: ['https://ftmscan.com'], + type: 'ERC1155', + vmType: 'EVM', + }, + xdai: { + contractAddress: '0xDFc2Fd83dFfD0Dafb216F412aB3B18f2777406aF', + chainId: 100, + name: 'xDai', + symbol: 'xDai', + decimals: 18, + rpcUrls: ['https://rpc.gnosischain.com'], + blockExplorerUrls: [' https://blockscout.com/xdai/mainnet'], + type: 'ERC1155', + vmType: 'EVM', + }, + bsc: { + contractAddress: '0xc716950e5DEae248160109F562e1C9bF8E0CA25B', + chainId: 56, + name: 'Binance Smart Chain', + symbol: 'BNB', + decimals: 18, + rpcUrls: ['https://bsc-dataseed.binance.org/'], + blockExplorerUrls: [' https://bscscan.com/'], + type: 'ERC1155', + vmType: 'EVM', + }, + arbitrum: { + contractAddress: '0xc716950e5DEae248160109F562e1C9bF8E0CA25B', + chainId: 42161, + name: 'Arbitrum', + symbol: 'AETH', + decimals: 18, + type: 'ERC1155', + rpcUrls: ['https://arb1.arbitrum.io/rpc'], + blockExplorerUrls: ['https://arbiscan.io/'], + vmType: 'EVM', + }, + arbitrumSepolia: { + contractAddress: null, + chainId: 421614, + name: 'Arbitrum Sepolia', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://sepolia-rollup.arbitrum.io/rpc'], + blockExplorerUrls: ['https://sepolia.arbiscan.io/'], + type: null, + vmType: 'EVM', + }, + avalanche: { + contractAddress: '0xBB118507E802D17ECDD4343797066dDc13Cde7C6', + chainId: 43114, + name: 'Avalanche', + symbol: 'AVAX', + decimals: 18, + type: 'ERC1155', + rpcUrls: ['https://api.avax.network/ext/bc/C/rpc'], + blockExplorerUrls: ['https://snowtrace.io/'], + vmType: 'EVM', + }, + fuji: { + contractAddress: '0xc716950e5DEae248160109F562e1C9bF8E0CA25B', + chainId: 43113, + name: 'Avalanche FUJI Testnet', + symbol: 'AVAX', + decimals: 18, + type: 'ERC1155', + rpcUrls: ['https://api.avax-test.network/ext/bc/C/rpc'], + blockExplorerUrls: ['https://testnet.snowtrace.io/'], + vmType: 'EVM', + }, + harmony: { + contractAddress: '0xBB118507E802D17ECDD4343797066dDc13Cde7C6', + chainId: 16666e5, + name: 'Harmony', + symbol: 'ONE', + decimals: 18, + type: 'ERC1155', + rpcUrls: ['https://api.harmony.one'], + blockExplorerUrls: ['https://explorer.harmony.one/'], + vmType: 'EVM', + }, + mumbai: { + contractAddress: '0xc716950e5DEae248160109F562e1C9bF8E0CA25B', + chainId: 80001, + name: 'Mumbai', + symbol: 'MATIC', + decimals: 18, + rpcUrls: [ + 'https://rpc-mumbai.maticvigil.com/v1/96bf5fa6e03d272fbd09de48d03927b95633726c', + ], + blockExplorerUrls: ['https://mumbai.polygonscan.com'], + type: 'ERC1155', + vmType: 'EVM', + }, + goerli: { + contractAddress: '0xc716950e5DEae248160109F562e1C9bF8E0CA25B', + chainId: 5, + name: 'Goerli', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://goerli.infura.io/v3/96dffb3d8c084dec952c61bd6230af34'], + blockExplorerUrls: ['https://goerli.etherscan.io'], + type: 'ERC1155', + vmType: 'EVM', + }, + cronos: { + contractAddress: '0xc716950e5DEae248160109F562e1C9bF8E0CA25B', + chainId: 25, + name: 'Cronos', + symbol: 'CRO', + decimals: 18, + rpcUrls: ['https://evm-cronos.org'], + blockExplorerUrls: ['https://cronos.org/explorer/'], + type: 'ERC1155', + vmType: 'EVM', + }, + optimism: { + contractAddress: '0xbF68B4c9aCbed79278465007f20a08Fa045281E0', + chainId: 10, + name: 'Optimism', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://mainnet.optimism.io'], + blockExplorerUrls: ['https://optimistic.etherscan.io'], + type: 'ERC1155', + vmType: 'EVM', + }, + celo: { + contractAddress: '0xBB118507E802D17ECDD4343797066dDc13Cde7C6', + chainId: 42220, + name: 'Celo', + symbol: 'CELO', + decimals: 18, + rpcUrls: ['https://forno.celo.org'], + blockExplorerUrls: ['https://explorer.celo.org'], + type: 'ERC1155', + vmType: 'EVM', + }, + aurora: { + contractAddress: null, + chainId: 1313161554, + name: 'Aurora', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://mainnet.aurora.dev'], + blockExplorerUrls: ['https://aurorascan.dev'], + type: null, + vmType: 'EVM', + }, + eluvio: { + contractAddress: null, + chainId: 955305, + name: 'Eluvio', + symbol: 'ELV', + decimals: 18, + rpcUrls: ['https://host-76-74-28-226.contentfabric.io/eth'], + blockExplorerUrls: ['https://explorer.eluv.io'], + type: null, + vmType: 'EVM', + }, + alfajores: { + contractAddress: null, + chainId: 44787, + name: 'Alfajores', + symbol: 'CELO', + decimals: 18, + rpcUrls: ['https://alfajores-forno.celo-testnet.org'], + blockExplorerUrls: ['https://alfajores-blockscout.celo-testnet.org'], + type: null, + vmType: 'EVM', + }, + xdc: { + contractAddress: null, + chainId: 50, + name: 'XDC Blockchain', + symbol: 'XDC', + decimals: 18, + rpcUrls: ['https://rpc.xinfin.network'], + blockExplorerUrls: ['https://explorer.xinfin.network'], + type: null, + vmType: 'EVM', + }, + evmos: { + contractAddress: null, + chainId: 9001, + name: 'EVMOS', + symbol: 'EVMOS', + decimals: 18, + rpcUrls: ['https://eth.bd.evmos.org:8545'], + blockExplorerUrls: ['https://evm.evmos.org'], + type: null, + vmType: 'EVM', + }, + evmosTestnet: { + contractAddress: null, + chainId: 9e3, + name: 'EVMOS Testnet', + symbol: 'EVMOS', + decimals: 18, + rpcUrls: ['https://eth.bd.evmos.dev:8545'], + blockExplorerUrls: ['https://evm.evmos.dev'], + type: null, + vmType: 'EVM', + }, + bscTestnet: { + contractAddress: null, + chainId: 97, + name: 'BSC Testnet', + symbol: 'BNB', + decimals: 18, + rpcUrls: ['https://data-seed-prebsc-1-s1.binance.org:8545'], + blockExplorerUrls: ['https://testnet.bscscan.com/'], + type: null, + vmType: 'EVM', + }, + baseGoerli: { + contractAddress: null, + chainId: 84531, + name: 'Base Goerli', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://goerli.base.org'], + blockExplorerUrls: ['https://goerli.basescan.org'], + type: null, + vmType: 'EVM', + }, + baseSepolia: { + contractAddress: null, + chainId: 84532, + name: 'Base Sepolia', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://sepolia.base.org'], + blockExplorerUrls: ['https://sepolia.basescan.org'], + type: null, + vmType: 'EVM', + }, + moonbeam: { + contractAddress: null, + chainId: 1284, + name: 'Moonbeam', + symbol: 'GLMR', + decimals: 18, + rpcUrls: ['https://rpc.api.moonbeam.network'], + blockExplorerUrls: ['https://moonscan.io'], + type: null, + vmType: 'EVM', + }, + moonriver: { + contractAddress: null, + chainId: 1285, + name: 'Moonriver', + symbol: 'MOVR', + decimals: 18, + rpcUrls: ['https://rpc.api.moonriver.moonbeam.network'], + blockExplorerUrls: ['https://moonriver.moonscan.io'], + type: null, + vmType: 'EVM', + }, + moonbaseAlpha: { + contractAddress: null, + chainId: 1287, + name: 'Moonbase Alpha', + symbol: 'DEV', + decimals: 18, + rpcUrls: ['https://rpc.api.moonbase.moonbeam.network'], + blockExplorerUrls: ['https://moonbase.moonscan.io/'], + type: null, + vmType: 'EVM', + }, + filecoin: { + contractAddress: null, + chainId: 314, + name: 'Filecoin', + symbol: 'FIL', + decimals: 18, + rpcUrls: ['https://api.node.glif.io/rpc/v1'], + blockExplorerUrls: ['https://filfox.info/'], + type: null, + vmType: 'EVM', + }, + filecoinCalibrationTestnet: { + contractAddress: null, + chainId: 314159, + name: 'Filecoin Calibration Testnet', + symbol: 'tFIL', + decimals: 18, + rpcUrls: ['https://api.calibration.node.glif.io/rpc/v1'], + blockExplorerUrls: ['https://calibration.filscan.io/'], + type: null, + vmType: 'EVM', + }, + hyperspace: { + contractAddress: null, + chainId: 3141, + name: 'Filecoin Hyperspace testnet', + symbol: 'tFIL', + decimals: 18, + rpcUrls: ['https://api.hyperspace.node.glif.io/rpc/v1'], + blockExplorerUrls: ['https://hyperspace.filscan.io/'], + type: null, + vmType: 'EVM', + }, + sepolia: { + contractAddress: null, + chainId: 11155111, + name: 'Sepolia Testnet', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://ethereum-sepolia-rpc.publicnode.com'], + blockExplorerUrls: ['https://sepolia.etherscan.io/'], + type: null, + vmType: 'EVM', + }, + scrollSepolia: { + contractAddress: null, + chainId: 534351, + name: 'Scroll Sepolia Testnet', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://sepolia-rpc.scroll.io'], + blockExplorerUrls: ['https://sepolia.scrollscan.com'], + type: null, + vmType: 'EVM', + }, + scroll: { + contractAddress: null, + chainId: 534352, + name: 'Scroll', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://rpc.scroll.io'], + blockExplorerUrls: ['https://scrollscan.com/'], + type: null, + vmType: 'EVM', + }, + zksync: { + contractAddress: null, + chainId: 324, + name: 'zkSync Era Mainnet', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://mainnet.era.zksync.io'], + blockExplorerUrls: ['https://explorer.zksync.io/'], + type: null, + vmType: 'EVM', + }, + base: { + contractAddress: null, + chainId: 8453, + name: 'Base Mainnet', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://mainnet.base.org'], + blockExplorerUrls: ['https://basescan.org'], + type: null, + vmType: 'EVM', + }, + lukso: { + contractAddress: null, + chainId: 42, + name: 'Lukso', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://rpc.lukso.gateway.fm'], + blockExplorerUrls: ['https://explorer.execution.mainnet.lukso.network/'], + type: null, + vmType: 'EVM', + }, + luksoTestnet: { + contractAddress: null, + chainId: 4201, + name: 'Lukso Testnet', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://rpc.testnet.lukso.network'], + blockExplorerUrls: ['https://explorer.execution.testnet.lukso.network'], + type: null, + vmType: 'EVM', + }, + zora: { + contractAddress: null, + chainId: 7777777, + name: ' Zora', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://rpc.zora.energy/'], + blockExplorerUrls: ['https://explorer.zora.energy'], + type: null, + vmType: 'EVM', + }, + zoraGoerli: { + contractAddress: null, + chainId: 999, + name: 'Zora Goerli', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://testnet.rpc.zora.energy'], + blockExplorerUrls: ['https://testnet.explorer.zora.energy'], + type: null, + vmType: 'EVM', + }, + zksyncTestnet: { + contractAddress: null, + chainId: 280, + name: 'zkSync Era Testnet', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://testnet.era.zksync.dev'], + blockExplorerUrls: ['https://goerli.explorer.zksync.io/'], + type: null, + vmType: 'EVM', + }, + lineaGoerli: { + contractAddress: null, + chainId: 59140, + name: 'Linea Testnet', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://rpc.goerli.linea.build'], + blockExplorerUrls: ['https://explorer.goerli.linea.build'], + type: null, + vmType: 'EVM', + }, + lineaSepolia: { + contractAddress: null, + chainId: 59141, + name: 'Linea Sepolia Testnet', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://rpc.sepolia.linea.build'], + blockExplorerUrls: ['https://explorer.sepolia.linea.build'], + type: null, + vmType: 'EVM', + }, + /** + * Use this for `>= Datil` network. + * Chainlist entry for the Chronicle Yellowstone Testnet. + * https://chainlist.org/chain/175188 + */ + yellowstone: yellowstoneChain, + chiado: { + contractAddress: null, + chainId: 10200, + name: 'Chiado', + symbol: 'XDAI', + decimals: 18, + rpcUrls: ['https://rpc.chiadochain.net'], + blockExplorerUrls: ['https://blockscout.chiadochain.net'], + type: null, + vmType: 'EVM', + }, + zkEvm: { + contractAddress: null, + chainId: 1101, + name: 'zkEvm', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://zkevm-rpc.com'], + blockExplorerUrls: ['https://zkevm.polygonscan.com/'], + type: null, + vmType: 'EVM', + }, + mantleTestnet: { + contractAddress: null, + chainId: 5001, + name: 'Mantle Testnet', + symbol: 'MNT', + decimals: 18, + rpcUrls: ['https://rpc.testnet.mantle.xyz'], + blockExplorerUrls: ['https://explorer.testnet.mantle.xyz/'], + type: null, + vmType: 'EVM', + }, + mantle: { + contractAddress: null, + chainId: 5e3, + name: 'Mantle', + symbol: 'MNT', + decimals: 18, + rpcUrls: ['https://rpc.mantle.xyz'], + blockExplorerUrls: ['http://explorer.mantle.xyz/'], + type: null, + vmType: 'EVM', + }, + klaytn: { + contractAddress: null, + chainId: 8217, + name: 'Klaytn', + symbol: 'KLAY', + decimals: 18, + rpcUrls: ['https://klaytn.blockpi.network/v1/rpc/public'], + blockExplorerUrls: ['https://www.klaytnfinder.io/'], + type: null, + vmType: 'EVM', + }, + publicGoodsNetwork: { + contractAddress: null, + chainId: 424, + name: 'Public Goods Network', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://rpc.publicgoods.network'], + blockExplorerUrls: ['https://explorer.publicgoods.network/'], + type: null, + vmType: 'EVM', + }, + optimismGoerli: { + contractAddress: null, + chainId: 420, + name: 'Optimism Goerli', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://optimism-goerli.publicnode.com'], + blockExplorerUrls: ['https://goerli-optimism.etherscan.io/'], + type: null, + vmType: 'EVM', + }, + waevEclipseTestnet: { + contractAddress: null, + chainId: 91006, + name: 'Waev Eclipse Testnet', + symbol: 'ecWAEV', + decimals: 18, + rpcUrls: ['https://api.evm.waev.eclipsenetwork.xyz'], + blockExplorerUrls: ['http://waev.explorer.modular.cloud/'], + type: null, + vmType: 'EVM', + }, + waevEclipseDevnet: { + contractAddress: null, + chainId: 91006, + name: 'Waev Eclipse Devnet', + symbol: 'ecWAEV', + decimals: 18, + rpcUrls: ['https://api.evm.waev.dev.eclipsenetwork.xyz'], + blockExplorerUrls: ['http://waev.explorer.modular.cloud/'], + type: null, + vmType: 'EVM', + }, + verifyTestnet: { + contractAddress: null, + chainId: 1833, + name: 'Verify Testnet', + symbol: 'MATIC', + decimals: 18, + rpcUrls: ['https://rpc.verify-testnet.gelato.digital'], + blockExplorerUrls: ['https://verify-testnet.blockscout.com/'], + type: null, + vmType: 'EVM', + }, + fuse: { + contractAddress: null, + chainId: 122, + name: 'Fuse', + symbol: 'FUSE', + decimals: 18, + rpcUrls: ['https://rpc.fuse.io/'], + blockExplorerUrls: ['https://explorer.fuse.io/'], + type: null, + vmType: 'EVM', + }, + campNetwork: { + contractAddress: null, + chainId: 325e3, + name: 'Camp Network', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://rpc.camp-network-testnet.gelato.digital'], + blockExplorerUrls: [ + 'https://explorer.camp-network-testnet.gelato.digital/', + ], + type: null, + vmType: 'EVM', + }, + vanar: { + contractAddress: null, + chainId: 78600, + name: 'Vanar Vanguard', + symbol: 'VANRY', + decimals: 18, + rpcUrls: ['https://rpc-vanguard.vanarchain.com'], + blockExplorerUrls: ['https://explorer-vanguard.vanarchain.com'], + type: null, + vmType: 'EVM', + }, + lisk: { + contractAddress: null, + chainId: 1135, + name: 'Lisk', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://lisk.drpc.org'], + blockExplorerUrls: ['https://blockscout.lisk.com/'], + type: null, + vmType: 'EVM', + }, + chilizMainnet: { + contractAddress: null, + chainId: 88888, + name: 'Chiliz Mainnet', + symbol: 'CHZ', + decimals: 18, + rpcUrls: ['https://rpc.ankr.com/chiliz'], + blockExplorerUrls: ['https://chiliscan.com/'], + type: null, + vmType: 'EVM', + }, + chilizTestnet: { + contractAddress: null, + chainId: 88882, + name: 'Chiliz Spicy Testnet', + symbol: 'CHZ', + decimals: 18, + rpcUrls: ['https://spicy-rpc.chiliz.com/'], + blockExplorerUrls: ['https://testnet.chiliscan.com/'], + type: null, + vmType: 'EVM', + }, + skaleTestnet: { + contractAddress: null, + chainId: 37084624, + name: 'SKALE Nebula Hub Testnet', + symbol: 'sFUEL', + decimals: 18, + rpcUrls: ['https://testnet.skalenodes.com/v1/lanky-ill-funny-testnet'], + blockExplorerUrls: [ + 'https://lanky-ill-funny-testnet.explorer.testnet.skalenodes.com', + ], + type: null, + vmType: 'EVM', + }, + skale: { + contractAddress: null, + chainId: 1482601649, + name: 'SKALE Nebula Hub Mainnet', + symbol: 'sFUEL', + decimals: 18, + rpcUrls: ['https://mainnet.skalenodes.com/v1/green-giddy-denebola'], + blockExplorerUrls: [ + 'https://green-giddy-denebola.explorer.mainnet.skalenodes.com', + ], + type: null, + vmType: 'EVM', + }, + skaleCalypso: { + contractAddress: null, + chainId: 1564830818, + name: 'SKALE Calypso Hub Mainnet', + symbol: 'sFUEL', + decimals: 18, + rpcUrls: ['https://mainnet.skalenodes.com/v1/honorable-steel-rasalhague'], + blockExplorerUrls: [ + 'https://giant-half-dual-testnet.explorer.testnet.skalenodes.com/', + ], + type: null, + vmType: 'EVM', + }, + skaleCalypsoTestnet: { + contractAddress: null, + chainId: 974399131, + name: 'SKALE Calypso Hub Testnet', + symbol: 'sFUEL', + decimals: 18, + rpcUrls: ['https://testnet.skalenodes.com/v1/giant-half-dual-testnet'], + blockExplorerUrls: [ + 'https://giant-half-dual-testnet.explorer.testnet.skalenodes.com/', + ], + type: null, + vmType: 'EVM', + }, + skaleEuropa: { + contractAddress: null, + chainId: 2046399126, + name: 'SKALE Europa DeFI Hub', + symbol: 'sFUEL', + decimals: 18, + rpcUrls: ['https://mainnet.skalenodes.com/v1/elated-tan-skat'], + blockExplorerUrls: [ + 'https://elated-tan-skat.explorer.mainnet.skalenodes.com/', + ], + type: null, + vmType: 'EVM', + }, + skaleEuropaTestnet: { + contractAddress: null, + chainId: 1444673419, + name: 'SKALE Europa DeFi Hub Testnet', + symbol: 'sFUEL', + decimals: 18, + rpcUrls: ['https://testnet.skalenodes.com/v1/juicy-low-small-testnet'], + blockExplorerUrls: [ + 'https://juicy-low-small-testnet.explorer.testnet.skalenodes.com/', + ], + type: null, + vmType: 'EVM', + }, + skaleTitan: { + contractAddress: null, + chainId: 1350216234, + name: 'SKALE Titan AI Hub', + symbol: 'sFUEL', + decimals: 18, + rpcUrls: ['https://mainnet.skalenodes.com/v1/parallel-stormy-spica'], + blockExplorerUrls: [ + 'https://parallel-stormy-spica.explorer.mainnet.skalenodes.com/', + ], + type: null, + vmType: 'EVM', + }, + skaleTitanTestnet: { + contractAddress: null, + chainId: 1020352220, + name: 'SKALE Titan AI Hub Testnet', + symbol: 'sFUEL', + decimals: 18, + rpcUrls: ['https://testnet.skalenodes.com/v1/aware-fake-trim-testnet'], + blockExplorerUrls: [ + 'https://aware-fake-trim-testnet.explorer.testnet.skalenodes.com/', + ], + type: null, + vmType: 'EVM', + }, + fhenixHelium: { + contractAddress: null, + chainId: 8008135, + name: 'Fhenix Helium', + symbol: 'tFHE', + decimals: 18, + rpcUrls: ['https://api.helium.fhenix.zone'], + blockExplorerUrls: ['https://explorer.helium.fhenix.zone'], + type: null, + vmType: 'EVM', + }, + hederaTestnet: { + contractAddress: null, + chainId: 296, + name: 'Hedera Testnet', + symbol: 'HBAR', + decimals: 8, + rpcUrls: ['https://testnet.hashio.io/api'], + blockExplorerUrls: ['https://hashscan.io/testnet/dashboard'], + type: null, + vmType: 'EVM', + }, + bitTorrentTestnet: { + contractAddress: null, + chainId: 1028, + name: 'BitTorrent Testnet', + symbol: 'BTT', + decimals: 18, + rpcUrls: ['https://test-rpc.bittorrentchain.io'], + blockExplorerUrls: ['https://testnet.bttcscan.com'], + type: null, + vmType: 'EVM', + }, + storyOdyssey: { + contractAddress: null, + chainId: 1516, + name: 'Story Odyssey', + symbol: 'IP', + decimals: 18, + rpcUrls: ['https://rpc.odyssey.storyrpc.io'], + blockExplorerUrls: ['https://odyssey.storyscan.xyz'], + type: null, + vmType: 'EVM', + }, + campTestnet: { + contractAddress: null, + chainId: 325e3, + name: 'Camp Testnet', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://rpc.camp-network-testnet.gelato.digital'], + blockExplorerUrls: ['https://camp-network-testnet.blockscout.com'], + type: null, + vmType: 'EVM', + }, + hushedNorthstar: { + contractAddress: null, + chainId: 42161, + name: 'Hushed Northstar Devnet', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://rpc.buildbear.io/yielddev'], + blockExplorerUrls: ['https://explorer.buildbear.io/yielddev/transactions'], + type: null, + vmType: 'EVM', + }, + amoy: { + contractAddress: null, + chainId: 80002, + name: 'Amoy', + symbol: 'POL', + decimals: 18, + rpcUrls: ['https://rpc-amoy.polygon.technology'], + blockExplorerUrls: ['https://amoy.polygonscan.com'], + type: null, + vmType: 'EVM', + }, + matchain: { + contractAddress: null, + chainId: 698, + name: 'Matchain', + symbol: 'BNB', + decimals: 18, + rpcUrls: ['https://rpc.matchain.io'], + blockExplorerUrls: ['https://matchscan.io'], + type: null, + vmType: 'EVM', + }, + coreDao: { + contractAddress: null, + chainId: 1116, + name: 'Core DAO', + symbol: 'CORE', + decimals: 18, + rpcUrls: ['https://rpc.coredao.org'], + blockExplorerUrls: ['https://scan.coredao.org/'], + type: null, + vmType: 'EVM', + }, + zkCandySepoliaTestnet: { + contractAddress: null, + chainId: 302, + name: 'ZKcandy Sepolia Testnet', + symbol: 'ETH', + decimals: 18, + rpcUrls: ['https://sepolia.rpc.zkcandy.io'], + blockExplorerUrls: ['https://sepolia.explorer.zkcandy.io'], + type: null, + vmType: 'EVM', + }, + vana: { + contractAddress: null, + chainId: 1480, + name: 'Vana', + symbol: 'VANA', + decimals: 18, + rpcUrls: ['https://rpc.vana.org'], + blockExplorerUrls: ['https://vanascan.io'], + type: null, + vmType: 'EVM', + }, +}; +var METAMASK_CHAIN_INFO = { + /** + * Information about the "chronicleYellowstone" chain. + */ + yellowstone: { + chainId: LIT_CHAINS['yellowstone'].chainId, + chainName: LIT_CHAINS['yellowstone'].name, + nativeCurrency: { + name: LIT_CHAINS['yellowstone'].symbol, + symbol: LIT_CHAINS['yellowstone'].symbol, + decimals: LIT_CHAINS['yellowstone'].decimals, + }, + rpcUrls: LIT_CHAINS['yellowstone'].rpcUrls, + blockExplorerUrls: LIT_CHAINS['yellowstone'].blockExplorerUrls, + iconUrls: ['future'], + }, +}; +var metamaskChainInfo = new Proxy(METAMASK_CHAIN_INFO, { + get(target, prop, receiver) { + deprecated( + 'metamaskChainInfo is deprecated and will be removed in a future version. Use METAMASK_CHAIN_INFO instead.' + ); + return Reflect.get(target, prop, receiver); + }, +}); +var LIT_RPC = { + /** + * Local Anvil RPC endpoint. + */ + LOCAL_ANVIL: 'http://127.0.0.1:8545', + /** + * Chronicle Yellowstone RPC endpoint - used for >= Datil-test + * More info: https://app.conduit.xyz/published/view/chronicle-yellowstone-testnet-9qgmzfcohk + */ + CHRONICLE_YELLOWSTONE: 'https://yellowstone-rpc.litprotocol.com', +}; +var LIT_NETWORK = { + DatilDev: 'datil-dev', + DatilTest: 'datil-test', + Datil: 'datil', + NagaDev: 'naga-dev', + Custom: 'custom', +}; +var LitNetwork = new Proxy(LIT_NETWORK, { + get(target, prop, receiver) { + deprecated( + 'LitNetwork is deprecated and will be removed in a future version. Use LIT_NETWORK instead.' + ); + return Reflect.get(target, prop, receiver); + }, +}); +var RPC_URL_BY_NETWORK = { + 'datil-dev': LIT_RPC.CHRONICLE_YELLOWSTONE, + 'datil-test': LIT_RPC.CHRONICLE_YELLOWSTONE, + 'naga-dev': LIT_RPC.CHRONICLE_YELLOWSTONE, + datil: LIT_RPC.CHRONICLE_YELLOWSTONE, + custom: LIT_RPC.LOCAL_ANVIL, +}; +var RELAYER_URL_BY_NETWORK = { + 'datil-dev': 'https://datil-dev-relayer.getlit.dev', + 'datil-test': 'https://datil-test-relayer.getlit.dev', + 'naga-dev': 'https://naga-dev-relayer.getlit.dev', + datil: 'https://datil-relayer.getlit.dev', + custom: 'http://localhost:3000', +}; +var METAMASK_CHAIN_INFO_BY_NETWORK = { + 'datil-dev': METAMASK_CHAIN_INFO.yellowstone, + 'datil-test': METAMASK_CHAIN_INFO.yellowstone, + 'naga-dev': METAMASK_CHAIN_INFO.yellowstone, + datil: METAMASK_CHAIN_INFO.yellowstone, + custom: METAMASK_CHAIN_INFO.yellowstone, +}; +var HTTP = 'http://'; +var HTTPS = 'https://'; +var HTTP_BY_NETWORK = { + 'datil-dev': HTTPS, + 'datil-test': HTTPS, + 'naga-dev': HTTPS, + datil: HTTPS, + custom: HTTP, + // default, can be changed by config +}; +var CENTRALISATION_BY_NETWORK = { + 'datil-dev': 'centralised', + 'datil-test': 'decentralised', + 'naga-dev': 'centralised', + datil: 'decentralised', + custom: 'unknown', +}; +var LIT_SVM_CHAINS = { + solana: { + name: 'Solana', + symbol: 'SOL', + decimals: 9, + rpcUrls: ['https://api.mainnet-beta.solana.com'], + blockExplorerUrls: ['https://explorer.solana.com/'], + vmType: 'SVM', + }, + solanaDevnet: { + name: 'Solana Devnet', + symbol: 'SOL', + decimals: 9, + rpcUrls: ['https://api.devnet.solana.com'], + blockExplorerUrls: ['https://explorer.solana.com/'], + vmType: 'SVM', + }, + solanaTestnet: { + name: 'Solana Testnet', + symbol: 'SOL', + decimals: 9, + rpcUrls: ['https://api.testnet.solana.com'], + blockExplorerUrls: ['https://explorer.solana.com/'], + vmType: 'SVM', + }, +}; +var LIT_COSMOS_CHAINS = { + cosmos: { + name: 'Cosmos', + symbol: 'ATOM', + decimals: 6, + chainId: 'cosmoshub-4', + rpcUrls: ['https://lcd-cosmoshub.keplr.app'], + blockExplorerUrls: ['https://atomscan.com/'], + vmType: 'CVM', + }, + kyve: { + name: 'Kyve', + symbol: 'KYVE', + decimals: 6, + chainId: 'korellia', + rpcUrls: ['https://api.korellia.kyve.network'], + blockExplorerUrls: ['https://explorer.kyve.network/'], + vmType: 'CVM', + }, + evmosCosmos: { + name: 'EVMOS Cosmos', + symbol: 'EVMOS', + decimals: 18, + chainId: 'evmos_9001-2', + rpcUrls: ['https://rest.bd.evmos.org:1317'], + blockExplorerUrls: ['https://evmos.bigdipper.live'], + vmType: 'CVM', + }, + evmosCosmosTestnet: { + name: 'Evmos Cosmos Testnet', + symbol: 'EVMOS', + decimals: 18, + chainId: 'evmos_9000-4', + rpcUrls: ['https://rest.bd.evmos.dev:1317'], + blockExplorerUrls: ['https://testnet.bigdipper.live'], + vmType: 'CVM', + }, + cheqdMainnet: { + name: 'Cheqd Mainnet', + symbol: 'CHEQ', + decimals: 9, + chainId: 'cheqd-mainnet-1', + rpcUrls: ['https://api.cheqd.net'], + blockExplorerUrls: ['https://explorer.cheqd.io'], + vmType: 'CVM', + }, + cheqdTestnet: { + name: 'Cheqd Testnet', + symbol: 'CHEQ', + decimals: 9, + chainId: 'cheqd-testnet-6', + rpcUrls: ['https://api.cheqd.network'], + blockExplorerUrls: ['https://testnet-explorer.cheqd.io'], + vmType: 'CVM', + }, + juno: { + name: 'Juno', + symbol: 'JUNO', + decimals: 6, + chainId: 'juno-1', + rpcUrls: ['https://rest.cosmos.directory/juno'], + blockExplorerUrls: ['https://www.mintscan.io/juno'], + vmType: 'CVM', + }, +}; +var ALL_LIT_CHAINS = { + ...LIT_CHAINS, + ...LIT_SVM_CHAINS, + ...LIT_COSMOS_CHAINS, +}; +var LOCAL_STORAGE_KEYS = { + AUTH_COSMOS_SIGNATURE: 'lit-auth-cosmos-signature', + AUTH_SIGNATURE: 'lit-auth-signature', + AUTH_SOL_SIGNATURE: 'lit-auth-sol-signature', + WEB3_PROVIDER: 'lit-web3-provider', + KEY_PAIR: 'lit-comms-keypair', + SESSION_KEY: 'lit-session-key', + WALLET_SIGNATURE: 'lit-wallet-sig', +}; +var LIT_NETWORKS = { + 'datil-dev': [], + 'datil-test': [], + datil: [], + 'naga-dev': [], + custom: [], +}; +var LIT_SESSION_KEY_URI = 'lit:session:'; +var LIT_ACTION_IPFS_HASH = 'QmUjX8MW6StQ7NKNdaS6g4RMkvN5hcgtKmEi8Mca6oX4t3'; +var VMTYPE = { + EVM: 'EVM', + SVM: 'SVM', + CVM: 'CVM', +}; +var EITHER_TYPE = { + ERROR: 'ERROR', + SUCCESS: 'SUCCESS', +}; +var AUTH_METHOD_TYPE = { + EthWallet: 1, + LitAction: 2, + WebAuthn: 3, + Discord: 4, + Google: 5, + GoogleJwt: 6, + AppleJwt: 8, + StytchOtp: 9, + StytchEmailFactorOtp: 10, + StytchSmsFactorOtp: 11, + StytchWhatsAppFactorOtp: 12, + StytchTotpFactorOtp: 13, +}; +var AuthMethodType = new Proxy(AUTH_METHOD_TYPE, { + get(target, prop, receiver) { + deprecated( + 'AuthMethodType is deprecated and will be removed in a future version. Use AUTH_METHOD_TYPE instead.' + ); + return Reflect.get(target, prop, receiver); + }, +}); +var AUTH_METHOD_SCOPE = { + NoPermissions: 0, + SignAnything: 1, + PersonalSign: 2, +}; +var AuthMethodScope = new Proxy(AUTH_METHOD_SCOPE, { + get(target, prop, receiver) { + deprecated( + 'AuthMethodScope is deprecated and will be removed in a future version. Use AUTH_METHOD_SCOPE instead.' + ); + return Reflect.get(target, prop, receiver); + }, +}); +var PROVIDER_TYPE = { + Discord: 'discord', + Google: 'google', + EthWallet: 'ethwallet', + WebAuthn: 'webauthn', + Apple: 'apple', + StytchOtp: 'stytchOtp', + StytchEmailFactorOtp: 'stytchEmailFactorOtp', + StytchSmsFactorOtp: 'stytchSmsFactorOtp', + StytchWhatsAppFactorOtp: 'stytchWhatsAppFactorOtp', + StytchTotpFactor: 'stytchTotpFactor', +}; +var ProviderType = new Proxy(PROVIDER_TYPE, { + get(target, prop, receiver) { + deprecated( + 'ProviderType is deprecated and will be removed in a future version. Use PROVIDER_TYPE instead.' + ); + return Reflect.get(target, prop, receiver); + }, +}); +var STAKING_STATES = { + Active: 0, + NextValidatorSetLocked: 1, + ReadyForNextEpoch: 2, + Unlocked: 3, + Paused: 4, + Restore: 5, +}; +var StakingStates = new Proxy(STAKING_STATES, { + get(target, prop, receiver) { + deprecated( + 'StakingStates is deprecated and will be removed in a future version. Use STAKING_STATES instead.' + ); + return Reflect.get(target, prop, receiver); + }, +}); +var RELAY_AUTH_STATUS = { + InProgress: 'InProgress', + Succeeded: 'Succeeded', + Failed: 'Failed', +}; +var RelayAuthStatus = new Proxy(RELAY_AUTH_STATUS, { + get(target, prop, receiver) { + deprecated( + 'RelayAuthStatus is deprecated and will be removed in a future version. Use RELAY_AUTH_STATUS instead.' + ); + return Reflect.get(target, prop, receiver); + }, +}); +var LIT_RESOURCE_PREFIX = { + AccessControlCondition: 'lit-accesscontrolcondition', + PKP: 'lit-pkp', + RLI: 'lit-ratelimitincrease', + PaymentDelegation: 'lit-paymentdelegation', + LitAction: 'lit-litaction', +}; +var LitResourcePrefix = new Proxy(LIT_RESOURCE_PREFIX, { + get(target, prop, receiver) { + deprecated( + 'LitResourcePrefix is deprecated and will be removed in a future version. Use LIT_RESOURCE_PREFIX instead.' + ); + return Reflect.get(target, prop, receiver); + }, +}); +var LIT_ABILITY = { + /** + * This is the ability to process an encryption access control condition. + * The resource will specify the corresponding hashed key value of the + * access control condition. + */ + AccessControlConditionDecryption: 'access-control-condition-decryption', + /** + * This is the ability to process a signing access control condition. + * The resource will specify the corresponding hashed key value of the + * access control condition. + */ + AccessControlConditionSigning: 'access-control-condition-signing', + /** + * This is the ability to use a PKP for signing purposes. The resource will specify + * the corresponding PKP token ID. + */ + PKPSigning: 'pkp-signing', + /** + * This is the ability to use Payment Delegation + */ + PaymentDelegation: 'lit-payment-delegation', + /** + * This is the ability to execute a Lit Action. The resource will specify the + * corresponding Lit Action IPFS CID. + */ + LitActionExecution: 'lit-action-execution', +}; +var LitAbility = new Proxy(LIT_ABILITY, { + get(target, prop, receiver) { + deprecated( + 'LitAbility is deprecated and will be removed in a future version. Use LIT_ABILITY instead.' + ); + return Reflect.get(target, prop, receiver); + }, +}); +var LIT_RECAP_ABILITY = { + Decryption: 'Decryption', + Signing: 'Signing', + Auth: 'Auth', + Execution: 'Execution', +}; +var LitRecapAbility = new Proxy(LIT_RECAP_ABILITY, { + get(target, prop, receiver) { + deprecated( + 'LitRecapAbility is deprecated and will be removed in a future version. Use LIT_RECAP_ABILITY instead.' + ); + return Reflect.get(target, prop, receiver); + }, +}); +var LIT_NAMESPACE = { + Auth: 'Auth', + Threshold: 'Threshold', +}; +var LitNamespace = new Proxy(LIT_NAMESPACE, { + get(target, prop, receiver) { + deprecated( + 'LitNamespace is deprecated and will be removed in a future version. Use LIT_NAMESPACE instead.' + ); + return Reflect.get(target, prop, receiver); + }, +}); +var LOG_LEVEL = { + INFO: 0, + DEBUG: 1, + WARN: 2, + ERROR: 3, + FATAL: 4, + TIMING_START: 5, + TIMING_END: 6, + OFF: -1, +}; +var LogLevel = new Proxy(LOG_LEVEL, { + get(target, prop, receiver) { + deprecated( + 'LogLevel is deprecated and will be removed in a future version. Use LOG_LEVEL instead.' + ); + return Reflect.get(target, prop, receiver); + }, +}); +var FALLBACK_IPFS_GATEWAYS = [ + 'https://flk-ipfs.io/ipfs/', + 'https://litprotocol.mypinata.cloud/ipfs/', +]; + +// packages/constants/src/lib/constants/mappers.ts +init_shim(); + +// node_modules/@lit-protocol/contracts/dist/index.js +init_shim(); + +// node_modules/@lit-protocol/contracts/dist/dev/datil.js +init_shim(); + +// node_modules/@lit-protocol/contracts/dist/dev/datil-dev.js +init_shim(); + +// node_modules/@lit-protocol/contracts/dist/dev/datil-test.js +init_shim(); + +// node_modules/@lit-protocol/contracts/dist/dev/cayenne.js +init_shim(); + +// node_modules/@lit-protocol/contracts/dist/dev/habanero.js +init_shim(); + +// node_modules/@lit-protocol/contracts/dist/dev/internalDev.js +init_shim(); + +// node_modules/@lit-protocol/contracts/dist/dev/manzano.js +init_shim(); + +// node_modules/@lit-protocol/contracts/dist/dev/naga-dev.js +init_shim(); +var nagaDev = { + config: { + chainId: '175188', + rpcUrl: 'https://yellowstone-rpc.litprotocol.com', + chainName: 'yellowstone', + litNodeDomainName: '127.0.0.1', + litNodePort: 7470, + rocketPort: 7470, + }, + data: [ + { + name: 'StakingBalances', + contracts: [ + { + network: 'naga-dev', + address_hash: '0x23b1C54cd840E714d57406568D6A982c88Bc5eaA', + inserted_at: '2025-01-15T21:52:30Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'ActiveValidatorsCannotLeave', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'AliasNotOwnedBySender', + type: 'error', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'CannotRemoveAliasOfActiveValidator', + type: 'error', + }, + { + inputs: [], + name: 'CannotStakeZero', + type: 'error', + }, + { + inputs: [], + name: 'CannotWithdrawZero', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'aliasCount', + type: 'uint256', + }, + ], + name: 'MaxAliasCountReached', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'OnlyStakingContract', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountStaked', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minimumStake', + type: 'uint256', + }, + ], + name: 'StakeMustBeGreaterThanMinimumStake', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountStaked', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maximumStake', + type: 'uint256', + }, + ], + name: 'StakeMustBeLessThanMaximumStake', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'StakerNotPermitted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'yourBalance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'requestedWithdrawlAmount', + type: 'uint256', + }, + ], + name: 'TryingToWithdrawMoreThanStaked', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'AliasAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'AliasRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newMaxAliasCount', + type: 'uint256', + }, + ], + name: 'MaxAliasCountSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newMaximumStake', + type: 'uint256', + }, + ], + name: 'MaximumStakeSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newMinimumStake', + type: 'uint256', + }, + ], + name: 'MinimumStakeSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'PermittedStakerAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'PermittedStakerRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'bool', + name: 'permittedStakersOn', + type: 'bool', + }, + ], + name: 'PermittedStakersOnChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ResolverContractAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + ], + name: 'RewardPaid', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Staked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newTokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + ], + name: 'TokenRewardPerTokenPerEpochSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'ValidatorNotRewardedBecauseAlias', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'ValidatorRewarded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'ValidatorTokensPenalized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Withdrawn', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'addAlias', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'addPermittedStaker', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'stakers', + type: 'address[]', + }, + ], + name: 'addPermittedStakers', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'checkStakingAmounts', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'contractResolver', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'getReward', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getStakingAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getTokenAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'isPermittedStaker', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maximumStake', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'minimumStake', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'penalizeTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'permittedStakersOn', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'removeAlias', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'removePermittedStaker', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + internalType: 'uint256', + name: 'balance', + type: 'uint256', + }, + ], + name: 'restakePenaltyTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'rewardOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'rewardValidator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMaxAliasCount', + type: 'uint256', + }, + ], + name: 'setMaxAliasCount', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMaximumStake', + type: 'uint256', + }, + ], + name: 'setMaximumStake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMinimumStake', + type: 'uint256', + }, + ], + name: 'setMinimumStake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bool', + name: 'permitted', + type: 'bool', + }, + ], + name: 'setPermittedStakersOn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'stake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'stakeForValidator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'totalStaked', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'balance', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'transferPenaltyTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'balance', + type: 'uint256', + }, + ], + name: 'withdrawPenaltyTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'Staking', + contracts: [ + { + network: 'naga-dev', + address_hash: '0x4E70449215B0A8D947750777022c3Ba0dEDDE34A', + inserted_at: '2025-01-15T21:52:30Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + inputs: [], + name: 'getAllUnkickedValidators', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'getRealmIdForCurrentEpoch', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'getRealmIdForNextEpoch', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'getRealmIdForStakerAddress', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getStakingBalancesAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + ], + name: 'isRecentValidator', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'isValidatorInCurrentEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'isValidatorInCurrentOrNextEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'isValidatorInNextEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + ], + name: 'nodeAddressToStakerAddressAcrossRealms', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'validator_by_staker_address', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastActiveEpoch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwnerOrDevopsAdmin', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInActiveOrUnlockedOrPausedState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInNextValidatorSetLockedOrReadyForNextEpochState', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'tolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'intervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyPercent', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyDemerits', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct LibStakingStorage.ComplaintConfig', + name: 'config', + type: 'tuple', + }, + ], + name: 'ComplaintConfigSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newTokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'newKeyTypes', + type: 'uint256[]', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMinimumValidatorCount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMaxConcurrentRequests', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMaxTripleCount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMinTripleCount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newPeerCheckingIntervalSecs', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMaxTripleConcurrency', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bool', + name: 'newRpcHealthcheckEnabled', + type: 'bool', + }, + ], + name: 'ConfigSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newDevopsAdmin', + type: 'address', + }, + ], + name: 'DevopsAdminSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newEpochEndTime', + type: 'uint256', + }, + ], + name: 'EpochEndTimeSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newEpochLength', + type: 'uint256', + }, + ], + name: 'EpochLengthSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newEpochTimeout', + type: 'uint256', + }, + ], + name: 'EpochTimeoutSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newKickPenaltyPercent', + type: 'uint256', + }, + ], + name: 'KickPenaltyPercentSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverContractAddress', + type: 'address', + }, + ], + name: 'ResolverContractAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newStakingTokenAddress', + type: 'address', + }, + ], + name: 'StakingTokenSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'enum LibStakingStorage.States', + name: 'newState', + type: 'uint8', + }, + ], + name: 'StateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'ValidatorRejoinedNextEpoch', + type: 'event', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + ], + name: 'adminKickValidatorInNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'adminRejoinValidator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'adminResetEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address[]', + name: 'validators', + type: 'address[]', + }, + ], + name: 'adminSetValidatorsInCurrentEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amountToPenalize', + type: 'uint256', + }, + ], + name: 'adminSlashValidator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'adminStakeForValidator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'tolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'intervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyPercent', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyDemerits', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.ComplaintConfig', + name: 'config', + type: 'tuple', + }, + ], + name: 'setComplaintConfig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'tokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'DEPRECATED_complaintTolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'DEPRECATED_complaintIntervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'keyTypes', + type: 'uint256[]', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxConcurrentRequests', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'peerCheckingIntervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleConcurrency', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'rpcHealthcheckEnabled', + type: 'bool', + }, + ], + internalType: 'struct LibStakingStorage.Config', + name: 'newConfig', + type: 'tuple', + }, + ], + name: 'setConfig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'newThreshold', + type: 'uint256', + }, + ], + name: 'setDemeritRejoinThreshold', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'newDevopsAdmin', + type: 'address', + }, + ], + name: 'setDevopsAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'newEpochEndTime', + type: 'uint256', + }, + ], + name: 'setEpochEndTime', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'newEpochLength', + type: 'uint256', + }, + ], + name: 'setEpochLength', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'enum LibStakingStorage.States', + name: 'newState', + type: 'uint8', + }, + ], + name: 'setEpochState', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'newEpochTimeout', + type: 'uint256', + }, + ], + name: 'setEpochTimeout', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'newKickPenaltyPercent', + type: 'uint256', + }, + ], + name: 'setKickPenaltyPercent', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'ActiveValidatorsCannotLeave', + type: 'error', + }, + { + inputs: [], + name: 'CannotKickBelowCurrentValidatorThreshold', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingAddress', + type: 'address', + }, + ], + name: 'CannotRejoinBecauseBanned', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingAddress', + type: 'address', + }, + ], + name: 'CannotRejoinUntilNextEpochBecauseKicked', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'CannotReuseCommsKeys', + type: 'error', + }, + { + inputs: [], + name: 'CannotStakeZero', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'CannotVoteTwice', + type: 'error', + }, + { + inputs: [], + name: 'CannotWithdrawZero', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + ], + name: 'CouldNotMapNodeAddressToStakerAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInActiveOrUnlockedState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInNextValidatorSetLockedOrReadyForNextEpochOrRestoreState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInNextValidatorSetLockedState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInReadyForNextEpochState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'MustBeValidatorInNextEpochToKick', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentTimestamp', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'epochEndTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeout', + type: 'uint256', + }, + ], + name: 'NotEnoughTimeElapsedForTimeoutSinceLastEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentTimestamp', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'epochEndTime', + type: 'uint256', + }, + ], + name: 'NotEnoughTimeElapsedSinceLastEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'validatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCount', + type: 'uint256', + }, + ], + name: 'NotEnoughValidatorsInNextEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentReadyValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'nextReadyValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCountToBeReady', + type: 'uint256', + }, + ], + name: 'NotEnoughValidatorsReadyForNextEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentEpochNumber', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receivedEpochNumber', + type: 'uint256', + }, + ], + name: 'SignaledReadyForWrongEpochNumber', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'StakerNotPermitted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'yourBalance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'requestedWithdrawlAmount', + type: 'uint256', + }, + ], + name: 'TryingToWithdrawMoreThanStaked', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'validator', + type: 'address', + }, + { + internalType: 'address[]', + name: 'validatorsInNextEpoch', + type: 'address[]', + }, + ], + name: 'ValidatorIsNotInNextEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'string', + name: 'valueName', + type: 'string', + }, + ], + name: 'ValueMustBeNonzero', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'attestedAddress', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'attestedPubKey', + type: 'uint256', + }, + ], + name: 'AttestedWalletRegistered', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'DebugUint256', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'epochNumber', + type: 'uint256', + }, + ], + name: 'ReadyForNextEpoch', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'token', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Recovered', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'RequestToJoin', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'RequestToLeave', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newDuration', + type: 'uint256', + }, + ], + name: 'RewardsDurationUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountBurned', + type: 'uint256', + }, + ], + name: 'ValidatorKickedFromNextEpoch', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'reporter', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'VotedToKickValidatorInNextEpoch', + type: 'event', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'advanceEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'executeRequestToJoin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'exit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getReward', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'kickValidatorInNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'lockValidatorsForNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + internalType: 'address', + name: 'attestedAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'attestedPubKey', + type: 'uint256', + }, + ], + name: 'registerAttestedWallet', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'requestToJoin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'requestToJoinAsNode', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'requestToLeave', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'requestToLeaveAsNode', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'setIpPortNodeAddressAndCommunicationPubKeys', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'epochNumber', + type: 'uint256', + }, + ], + name: 'signalReadyForNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'stake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'stakeAndJoin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'VersionRequirementsUpdated', + type: 'event', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'checkVersion', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getMaxVersion', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getMaxVersionString', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getMinVersion', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getMinVersionString', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'setMaxVersion', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'setMinVersion', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + ], + name: 'complaintConfig', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'tolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'intervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyPercent', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyDemerits', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.ComplaintConfig', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'config', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'tokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'DEPRECATED_complaintTolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'DEPRECATED_complaintIntervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'keyTypes', + type: 'uint256[]', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxConcurrentRequests', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'peerCheckingIntervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleConcurrency', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'rpcHealthcheckEnabled', + type: 'bool', + }, + ], + internalType: 'struct LibStakingStorage.Config', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'contractResolver', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'countOfCurrentValidatorsReadyForNextEpoch', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'countOfNextValidatorsReadyForNextEpoch', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'currentValidatorCountForConsensus', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'epoch', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'epochLength', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'number', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'endTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'retries', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'startTime', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Epoch', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getActiveUnkickedValidatorCount', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getActiveUnkickedValidatorStructs', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastActiveEpoch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getActiveUnkickedValidatorStructsAndCounts', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'epochLength', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'number', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'endTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'retries', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'startTime', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Epoch', + name: '', + type: 'tuple', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastActiveEpoch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getActiveUnkickedValidators', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getKeyTypes', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getKickedValidators', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address[]', + name: 'addresses', + type: 'address[]', + }, + ], + name: 'getNodeAttestedPubKeyMappings', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'pubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.PubKeyMapping[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'getNodeDemerits', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address[]', + name: 'addresses', + type: 'address[]', + }, + ], + name: 'getNodeStakerAddressMappings', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + internalType: 'struct LibStakingStorage.AddressMapping[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getStakingBalancesAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getTokenAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getValidatorsInCurrentEpoch', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getValidatorsInCurrentEpochLength', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getValidatorsInNextEpoch', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address[]', + name: 'stakerAddresses', + type: 'address[]', + }, + ], + name: 'getValidatorsStructs', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastActiveEpoch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getValidatorsStructsInCurrentEpoch', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastActiveEpoch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'getValidatorsStructsInNextEpoch', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastActiveEpoch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'epochNumber', + type: 'uint256', + }, + { + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + { + internalType: 'address', + name: 'voterStakerAddress', + type: 'address', + }, + ], + name: 'getVotingStatusToKickValidator', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'isActiveValidator', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'isActiveValidatorByNodeAddress', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + ], + name: 'isActiveValidatorByNodeAddressForNextEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'isActiveValidatorForNextEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'isReadyForNextEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'stakerAddresses', + type: 'address', + }, + ], + name: 'isRecentValidator', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + ], + name: 'kickPenaltyPercentByReason', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'nextValidatorCountForConsensus', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + ], + name: 'nodeAddressToStakerAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'readyForNextEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'shouldKickValidator', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + ], + name: 'state', + outputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'validators', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastActiveEpoch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'Multisender', + contracts: [ + { + network: 'naga-dev', + address_hash: '0xaEFf2767d7E97E73C75F98b6FEC34b68cfD74797', + inserted_at: '2025-01-15T21:52:30Z', + ABI: [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: '_recipients', + type: 'address[]', + }, + ], + name: 'sendEth', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: '_recipients', + type: 'address[]', + }, + { + internalType: 'address', + name: 'tokenContract', + type: 'address', + }, + ], + name: 'sendTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'tokenContract', + type: 'address', + }, + ], + name: 'withdrawTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'LITToken', + contracts: [ + { + network: 'naga-dev', + address_hash: '0xd78089bAAe410f5d0eae31D0D56157c73a3Ff98B', + inserted_at: '2025-01-15T21:52:30Z', + ABI: [ + { + inputs: [ + { + internalType: 'uint256', + name: 'cap', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [], + name: 'InvalidShortString', + type: 'error', + }, + { + inputs: [ + { + internalType: 'string', + name: 'str', + type: 'string', + }, + ], + name: 'StringTooLong', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'delegator', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'fromDelegate', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'toDelegate', + type: 'address', + }, + ], + name: 'DelegateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'delegate', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'previousBalance', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newBalance', + type: 'uint256', + }, + ], + name: 'DelegateVotesChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [], + name: 'EIP712DomainChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'Paused', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'previousAdminRole', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'newAdminRole', + type: 'bytes32', + }, + ], + name: 'RoleAdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleGranted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleRevoked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'Unpaused', + type: 'event', + }, + { + inputs: [], + name: 'ADMIN_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'CLOCK_MODE', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DEFAULT_ADMIN_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DOMAIN_SEPARATOR', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'MINTER_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PAUSER_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'burnFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'cap', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint32', + name: 'pos', + type: 'uint32', + }, + ], + name: 'checkpoints', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'fromBlock', + type: 'uint32', + }, + { + internalType: 'uint224', + name: 'votes', + type: 'uint224', + }, + ], + internalType: 'struct ERC20Votes.Checkpoint', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'clock', + outputs: [ + { + internalType: 'uint48', + name: '', + type: 'uint48', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'subtractedValue', + type: 'uint256', + }, + ], + name: 'decreaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + ], + name: 'delegate', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + { + internalType: 'uint256', + name: 'nonce', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiry', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'delegateBySig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'delegates', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'eip712Domain', + outputs: [ + { + internalType: 'bytes1', + name: 'fields', + type: 'bytes1', + }, + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'version', + type: 'string', + }, + { + internalType: 'uint256', + name: 'chainId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'verifyingContract', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'salt', + type: 'bytes32', + }, + { + internalType: 'uint256[]', + name: 'extensions', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'timepoint', + type: 'uint256', + }, + ], + name: 'getPastTotalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'timepoint', + type: 'uint256', + }, + ], + name: 'getPastVotes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + ], + name: 'getRoleAdmin', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'getVotes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'grantRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'hasRole', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'addedValue', + type: 'uint256', + }, + ], + name: 'increaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + ], + name: 'mint', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'nonces', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'numCheckpoints', + outputs: [ + { + internalType: 'uint32', + name: '', + type: 'uint32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'pause', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'paused', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'permit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'renounceRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'revokeRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'unpause', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PubkeyRouter', + contracts: [ + { + network: 'naga-dev', + address_hash: '0x03974A7245C1371Ae59eE5052e57b1772BB7F579', + inserted_at: '2025-01-15T21:52:30Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + indexed: false, + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'PubkeyRoutingDataSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct IPubkeyRouter.RootKey', + name: 'rootKey', + type: 'tuple', + }, + ], + name: 'RootKeySet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + { + indexed: false, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'ToggleEvent', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + ], + name: 'adminResetRootKeys', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + internalType: 'struct IPubkeyRouter.RootKey[]', + name: 'rootKeys', + type: 'tuple[]', + }, + ], + name: 'adminSetRootKeys', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + { + internalType: 'bytes', + name: 'signedMessage', + type: 'bytes', + }, + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + ], + name: 'checkNodeSignatures', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + ], + name: 'deriveEthAddressFromPubkey', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'ethAddress', + type: 'address', + }, + ], + name: 'ethAddressToPkpId', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'getDerivedPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getEthAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + ], + name: 'getRootKeys', + outputs: [ + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + internalType: 'struct IPubkeyRouter.RootKey[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getRoutingData', + outputs: [ + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + internalType: + 'struct LibPubkeyRouterStorage.PubkeyRoutingData', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'isRouted', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'pubkeys', + outputs: [ + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + internalType: + 'struct LibPubkeyRouterStorage.PubkeyRoutingData', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'setRoutingData', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'setRoutingDataAsAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + internalType: 'struct IPubkeyRouter.RootKey[]', + name: 'newRootKeys', + type: 'tuple[]', + }, + ], + name: 'voteForRootKeys', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PKPNFT', + contracts: [ + { + network: 'naga-dev', + address_hash: '0x3C155B546d9F09204Ee4C79B4985C10149Bf1D70', + inserted_at: '2025-01-15T21:52:30Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'approved', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'ApprovalForAll', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newFreeMintSigner', + type: 'address', + }, + ], + name: 'FreeMintSignerSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint8', + name: 'version', + type: 'uint8', + }, + ], + name: 'Initialized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newMintCost', + type: 'uint256', + }, + ], + name: 'MintCostSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + ], + name: 'PKPMinted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Withdrew', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + ], + name: 'claimAndMint', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'exists', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'freeMintSigner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getApproved', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getEthAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getNextDerivedKeyId', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftMetadataAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpPermissionsAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getRouterAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getStakingAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + ], + name: 'isApprovedForAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'mintCost', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + ], + name: 'mintGrantAndBurnNext', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + name: 'mintNext', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'ownerOf', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'hash', + type: 'bytes32', + }, + ], + name: 'prefixed', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'redeemedFreeMintIds', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'setApprovalForAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newFreeMintSigner', + type: 'address', + }, + ], + name: 'setFreeMintSigner', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMintCost', + type: 'uint256', + }, + ], + name: 'setMintCost', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenOfOwnerByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'tokenURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'RateLimitNFT', + contracts: [ + { + network: 'naga-dev', + address_hash: '0xa1ab369611cBF3E72BBF46B09B27d4cB59FB44cb', + inserted_at: '2025-01-15T21:52:30Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newAdditionalRequestsPerKilosecondCost', + type: 'uint256', + }, + ], + name: 'AdditionalRequestsPerKilosecondCostSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'approved', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'ApprovalForAll', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newFreeMintSigner', + type: 'address', + }, + ], + name: 'FreeMintSignerSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newFreeRequestsPerRateLimitWindow', + type: 'uint256', + }, + ], + name: 'FreeRequestsPerRateLimitWindowSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint8', + name: 'version', + type: 'uint8', + }, + ], + name: 'Initialized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newRLIHolderRateLimitWindowSeconds', + type: 'uint256', + }, + ], + name: 'RLIHolderRateLimitWindowSecondsSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newRateLimitWindowSeconds', + type: 'uint256', + }, + ], + name: 'RateLimitWindowSecondsSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Withdrew', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'requestsPerKilosecond', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'msgHash', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'sVal', + type: 'bytes32', + }, + ], + name: 'freeMint', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getApproved', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + ], + name: 'isApprovedForAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + name: 'mint', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'ownerOf', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newAdditionalRequestsPerKilosecondCost', + type: 'uint256', + }, + ], + name: 'setAdditionalRequestsPerKilosecondCost', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'setApprovalForAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newFreeMintSigner', + type: 'address', + }, + ], + name: 'setFreeMintSigner', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newFreeRequestsPerRateLimitWindow', + type: 'uint256', + }, + ], + name: 'setFreeRequestsPerRateLimitWindow', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMaxExpirationSeconds', + type: 'uint256', + }, + ], + name: 'setMaxExpirationSeconds', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMaxRequestsPerKilosecond', + type: 'uint256', + }, + ], + name: 'setMaxRequestsPerKilosecond', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newRLIHolderRateLimitWindowSeconds', + type: 'uint256', + }, + ], + name: 'setRLIHolderRateLimitWindowSeconds', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newRateLimitWindowSeconds', + type: 'uint256', + }, + ], + name: 'setRateLimitWindowSeconds', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenOfOwnerByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'tokenURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'RLIHolderRateLimitWindowSeconds', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'additionalRequestsPerKilosecondCost', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'requestsPerKilosecond', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + name: 'calculateCost', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'payingAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + name: 'calculateRequestsPerKilosecond', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'capacity', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'requestsPerKilosecond', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + internalType: 'struct LibRateLimitNFTStorage.RateLimit', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'requestedRequestsPerKilosecond', + type: 'uint256', + }, + ], + name: 'checkBelowMaxRequestsPerKilosecond', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'currentSoldRequestsPerKilosecond', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'defaultRateLimitWindowSeconds', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'requestsPerKilosecond', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'msgHash', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'sVal', + type: 'bytes32', + }, + ], + name: 'freeMintSigTest', + outputs: [], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'freeMintSigner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'freeRequestsPerRateLimitWindow', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'isExpired', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxExpirationSeconds', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxRequestsPerKilosecond', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'hash', + type: 'bytes32', + }, + ], + name: 'prefixed', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'msgHash', + type: 'bytes32', + }, + ], + name: 'redeemedFreeMints', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'tokenIdCounter', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'tokenSVG', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + name: 'totalSoldRequestsPerKilosecondByExpirationTime', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PKPHelper', + contracts: [ + { + network: 'naga-dev', + address_hash: '0x5B6cBbe135F29f9b609DC7EC31A04a63efb51944', + inserted_at: '2025-01-15T21:52:30Z', + ABI: [ + { + inputs: [ + { + internalType: 'address', + name: '_resolver', + type: 'address', + }, + { + internalType: 'enum ContractResolver.Env', + name: '_env', + type: 'uint8', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'previousAdminRole', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'newAdminRole', + type: 'bytes32', + }, + ], + name: 'RoleAdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleGranted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleRevoked', + type: 'event', + }, + { + inputs: [], + name: 'DEFAULT_ADMIN_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + ], + internalType: 'struct LibPKPNFTStorage.ClaimMaterial', + name: 'claimMaterial', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes[]', + name: 'permittedIpfsCIDs', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedIpfsCIDScopes', + type: 'uint256[][]', + }, + { + internalType: 'address[]', + name: 'permittedAddresses', + type: 'address[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAddressScopes', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + internalType: 'struct PKPHelper.AuthMethodData', + name: 'authMethodData', + type: 'tuple', + }, + ], + name: 'claimAndMintNextAndAddAuthMethods', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + ], + internalType: 'struct LibPKPNFTStorage.ClaimMaterial', + name: 'claimMaterial', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes[]', + name: 'permittedIpfsCIDs', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedIpfsCIDScopes', + type: 'uint256[][]', + }, + { + internalType: 'address[]', + name: 'permittedAddresses', + type: 'address[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAddressScopes', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + internalType: 'struct PKPHelper.AuthMethodData', + name: 'authMethodData', + type: 'tuple', + }, + ], + name: 'claimAndMintNextAndAddAuthMethodsWithTypes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + ], + internalType: 'struct LibPKPNFTStorage.ClaimMaterialV2', + name: 'claimMaterial', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes[]', + name: 'permittedIpfsCIDs', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedIpfsCIDScopes', + type: 'uint256[][]', + }, + { + internalType: 'address[]', + name: 'permittedAddresses', + type: 'address[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAddressScopes', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + internalType: 'struct PKPHelper.AuthMethodData', + name: 'authMethodData', + type: 'tuple', + }, + ], + name: 'claimAndMintNextAndAddAuthMethodsWithTypesV2', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'contractResolver', + outputs: [ + { + internalType: 'contract ContractResolver', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'env', + outputs: [ + { + internalType: 'enum ContractResolver.Env', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getDomainWalletRegistry', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPKPNftMetdataAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpPermissionsAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + ], + name: 'getRoleAdmin', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getStakingAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'grantRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'hasRole', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + name: 'mintNextAndAddAuthMethods', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes[]', + name: 'permittedIpfsCIDs', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedIpfsCIDScopes', + type: 'uint256[][]', + }, + { + internalType: 'address[]', + name: 'permittedAddresses', + type: 'address[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAddressScopes', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + name: 'mintNextAndAddAuthMethodsWithTypes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'string[]', + name: 'nftMetadata', + type: 'string[]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + name: 'mintNextAndAddDomainWalletMetadata', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + name: 'onERC721Received', + outputs: [ + { + internalType: 'bytes4', + name: '', + type: 'bytes4', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'removePkpMetadata', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'renounceRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'revokeRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'string[]', + name: 'nftMetadata', + type: 'string[]', + }, + ], + name: 'setPkpMetadata', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PKPPermissions', + contracts: [ + { + network: 'naga-dev', + address_hash: '0x5a78cBdbF3fb927d516986C343EfcBe59b5A8e32', + inserted_at: '2025-01-15T21:52:30Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + indexed: false, + internalType: 'bytes', + name: 'userPubkey', + type: 'bytes', + }, + ], + name: 'PermittedAuthMethodAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'PermittedAuthMethodRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + indexed: false, + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'PermittedAuthMethodScopeAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + indexed: false, + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'PermittedAuthMethodScopeRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: true, + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'root', + type: 'bytes32', + }, + ], + name: 'RootHashUpdated', + type: 'event', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + { + internalType: 'uint256[]', + name: 'scopes', + type: 'uint256[]', + }, + ], + name: 'addPermittedAction', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'user', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'scopes', + type: 'uint256[]', + }, + ], + name: 'addPermittedAddress', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'userPubkey', + type: 'bytes', + }, + ], + internalType: 'struct LibPKPPermissionsStorage.AuthMethod', + name: 'authMethod', + type: 'tuple', + }, + { + internalType: 'uint256[]', + name: 'scopes', + type: 'uint256[]', + }, + ], + name: 'addPermittedAuthMethod', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'addPermittedAuthMethodScope', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypesToAdd', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIdsToAdd', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeysToAdd', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopesToAdd', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypesToRemove', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIdsToRemove', + type: 'bytes[]', + }, + ], + name: 'batchAddRemoveAuthMethods', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'getAuthMethodId', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getEthAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'getPKPPubKeysByAuthMethod', + outputs: [ + { + internalType: 'bytes[]', + name: '', + type: 'bytes[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPermittedActions', + outputs: [ + { + internalType: 'bytes[]', + name: '', + type: 'bytes[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPermittedAddresses', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'maxScopeId', + type: 'uint256', + }, + ], + name: 'getPermittedAuthMethodScopes', + outputs: [ + { + internalType: 'bool[]', + name: '', + type: 'bool[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPermittedAuthMethods', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'userPubkey', + type: 'bytes', + }, + ], + internalType: 'struct LibPKPPermissionsStorage.AuthMethod[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getRouterAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'getTokenIdsForAuthMethod', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'getUserPubkeyForAuthMethod', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + ], + name: 'isPermittedAction', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'isPermittedAddress', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'isPermittedAuthMethod', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'isPermittedAuthMethodScopePresent', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + ], + name: 'removePermittedAction', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'removePermittedAddress', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'removePermittedAuthMethod', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'removePermittedAuthMethodScope', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'root', + type: 'bytes32', + }, + ], + name: 'setRootHash', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + internalType: 'bytes32[]', + name: 'proof', + type: 'bytes32[]', + }, + { + internalType: 'bytes32', + name: 'leaf', + type: 'bytes32', + }, + ], + name: 'verifyState', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + internalType: 'bytes32[]', + name: 'proof', + type: 'bytes32[]', + }, + { + internalType: 'bool[]', + name: 'proofFlags', + type: 'bool[]', + }, + { + internalType: 'bytes32[]', + name: 'leaves', + type: 'bytes32[]', + }, + ], + name: 'verifyStates', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PKPNFTMetadata', + contracts: [ + { + network: 'naga-dev', + address_hash: '0x06d6aEd8aebFD1a62D56fC02D732C21f68ce4Aad', + inserted_at: '2025-01-15T21:52:30Z', + ABI: [ + { + inputs: [ + { + internalType: 'address', + name: '_resolver', + type: 'address', + }, + { + internalType: 'enum ContractResolver.Env', + name: '_env', + type: 'uint8', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'buffer', + type: 'bytes', + }, + ], + name: 'bytesToHex', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [], + name: 'contractResolver', + outputs: [ + { + internalType: 'contract ContractResolver', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'env', + outputs: [ + { + internalType: 'enum ContractResolver.Env', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'removeProfileForPkp', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'removeUrlForPKP', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'string', + name: 'imgUrl', + type: 'string', + }, + ], + name: 'setProfileForPKP', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'string', + name: 'url', + type: 'string', + }, + ], + name: 'setUrlForPKP', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'pubKey', + type: 'bytes', + }, + { + internalType: 'address', + name: 'ethAddress', + type: 'address', + }, + ], + name: 'tokenURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'Allowlist', + contracts: [ + { + network: 'naga-dev', + address_hash: '0x4B426b0C023b7914a83d7f2749311DD0ed178aA1', + inserted_at: '2025-01-15T21:52:30Z', + ABI: [ + { + inputs: [], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'ItemAllowed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'ItemNotAllowed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'addAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'allowAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + name: 'allowedItems', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'isAllowed', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'removeAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bool', + name: '_allowAll', + type: 'bool', + }, + ], + name: 'setAllowAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'setAllowed', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'setNotAllowed', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PaymentDelegation', + contracts: [ + { + network: 'naga-dev', + address_hash: '0xb3d2F6BCA22f12C017379a2d378B687BB9049cb7', + inserted_at: '2025-01-15T21:52:30Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'payer', + type: 'address', + }, + { + components: [ + { + internalType: 'uint128', + name: 'totalMaxPrice', + type: 'uint128', + }, + { + internalType: 'uint256', + name: 'requestsPerPeriod', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'periodSeconds', + type: 'uint256', + }, + ], + indexed: false, + internalType: + 'struct LibPaymentDelegationStorage.Restriction', + name: 'restriction', + type: 'tuple', + }, + ], + name: 'RestrictionSet', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'delegatePayments', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'users', + type: 'address[]', + }, + ], + name: 'delegatePaymentsBatch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'getPayers', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'users', + type: 'address[]', + }, + ], + name: 'getPayersAndRestrictions', + outputs: [ + { + internalType: 'address[][]', + name: '', + type: 'address[][]', + }, + { + components: [ + { + internalType: 'uint128', + name: 'totalMaxPrice', + type: 'uint128', + }, + { + internalType: 'uint256', + name: 'requestsPerPeriod', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'periodSeconds', + type: 'uint256', + }, + ], + internalType: + 'struct LibPaymentDelegationStorage.Restriction[][]', + name: '', + type: 'tuple[][]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'payer', + type: 'address', + }, + ], + name: 'getRestriction', + outputs: [ + { + components: [ + { + internalType: 'uint128', + name: 'totalMaxPrice', + type: 'uint128', + }, + { + internalType: 'uint256', + name: 'requestsPerPeriod', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'periodSeconds', + type: 'uint256', + }, + ], + internalType: + 'struct LibPaymentDelegationStorage.Restriction', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'payer', + type: 'address', + }, + ], + name: 'getUsers', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint128', + name: 'totalMaxPrice', + type: 'uint128', + }, + { + internalType: 'uint256', + name: 'requestsPerPeriod', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'periodSeconds', + type: 'uint256', + }, + ], + internalType: + 'struct LibPaymentDelegationStorage.Restriction', + name: 'r', + type: 'tuple', + }, + ], + name: 'setRestriction', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'undelegatePayments', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'users', + type: 'address[]', + }, + ], + name: 'undelegatePaymentsBatch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PriceFeed', + contracts: [ + { + network: 'naga-dev', + address_hash: '0x7Db649A3089E17A8241Cf1e286E209e374EE48Ba', + inserted_at: '2025-01-15T21:52:30Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + inputs: [], + name: 'MustBeLessThan100', + type: 'error', + }, + { + inputs: [], + name: 'MustBeNonzero', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newPrice', + type: 'uint256', + }, + ], + name: 'BaseNetworkPriceSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newPrice', + type: 'uint256', + }, + ], + name: 'MaxNetworkPriceSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'stakingAddress', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'usagePercent', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'newPrices', + type: 'uint256[]', + }, + ], + name: 'UsageSet', + type: 'event', + }, + { + inputs: [ + { + internalType: 'uint256[]', + name: 'productIds', + type: 'uint256[]', + }, + ], + name: 'baseNetworkPrices', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'realmId', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'productIds', + type: 'uint256[]', + }, + ], + name: 'getNodesForRequest', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + components: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastActiveEpoch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator', + name: 'validator', + type: 'tuple', + }, + { + internalType: 'uint256[]', + name: 'prices', + type: 'uint256[]', + }, + ], + internalType: + 'struct LibPriceFeedStorage.NodeInfoAndPrices[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getStakingAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256[]', + name: 'productIds', + type: 'uint256[]', + }, + ], + name: 'maxNetworkPrices', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'node', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'productIds', + type: 'uint256[]', + }, + ], + name: 'price', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'price', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'productId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', + }, + ], + internalType: 'struct LibPriceFeedStorage.NodePriceData[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'productId', + type: 'uint256', + }, + ], + name: 'prices', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'price', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'productId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', + }, + ], + internalType: 'struct LibPriceFeedStorage.NodePriceData[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newPrice', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'productIds', + type: 'uint256[]', + }, + ], + name: 'setBaseNetworkPrices', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newPrice', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'productIds', + type: 'uint256[]', + }, + ], + name: 'setMaxNetworkPrices', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'usagePercent', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'productIds', + type: 'uint256[]', + }, + ], + name: 'setUsage', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'usagePercent', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'productId', + type: 'uint256', + }, + ], + name: 'usagePercentToPrice', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'usagePercent', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'productIds', + type: 'uint256[]', + }, + ], + name: 'usagePercentToPrices', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + }, + ], + }, + ], +}; + +// node_modules/@lit-protocol/contracts/dist/prod/datil.js +init_shim(); +var datil = { + config: { + chainId: '175188', + rpcUrl: 'https://yellowstone-rpc.litprotocol.com', + chainName: 'yellowstone', + litNodeDomainName: '127.0.0.1', + litNodePort: 7470, + rocketPort: 7470, + }, + data: [ + { + name: 'StakingBalances', + contracts: [ + { + network: 'datil', + address_hash: '0x9c9D147dad75D8B9Bd327405098D65C727296B54', + inserted_at: '2024-10-24T23:27:16Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'ActiveValidatorsCannotLeave', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'AliasNotOwnedBySender', + type: 'error', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'CannotRemoveAliasOfActiveValidator', + type: 'error', + }, + { + inputs: [], + name: 'CannotStakeZero', + type: 'error', + }, + { + inputs: [], + name: 'CannotWithdrawZero', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'aliasCount', + type: 'uint256', + }, + ], + name: 'MaxAliasCountReached', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'OnlyStakingContract', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountStaked', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minimumStake', + type: 'uint256', + }, + ], + name: 'StakeMustBeGreaterThanMinimumStake', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountStaked', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maximumStake', + type: 'uint256', + }, + ], + name: 'StakeMustBeLessThanMaximumStake', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'StakerNotPermitted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'yourBalance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'requestedWithdrawlAmount', + type: 'uint256', + }, + ], + name: 'TryingToWithdrawMoreThanStaked', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'AliasAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'AliasRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newMaxAliasCount', + type: 'uint256', + }, + ], + name: 'MaxAliasCountSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newMaximumStake', + type: 'uint256', + }, + ], + name: 'MaximumStakeSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newMinimumStake', + type: 'uint256', + }, + ], + name: 'MinimumStakeSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'PermittedStakerAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'PermittedStakerRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'bool', + name: 'permittedStakersOn', + type: 'bool', + }, + ], + name: 'PermittedStakersOnChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ResolverContractAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + ], + name: 'RewardPaid', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Staked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newTokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + ], + name: 'TokenRewardPerTokenPerEpochSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'ValidatorNotRewardedBecauseAlias', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'ValidatorRewarded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'ValidatorTokensPenalized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Withdrawn', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'addAlias', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'addPermittedStaker', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'stakers', + type: 'address[]', + }, + ], + name: 'addPermittedStakers', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'checkStakingAmounts', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'contractResolver', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'getReward', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getStakingAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getTokenAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'isPermittedStaker', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maximumStake', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'minimumStake', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'penalizeTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'permittedStakersOn', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'removeAlias', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'removePermittedStaker', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + internalType: 'uint256', + name: 'balance', + type: 'uint256', + }, + ], + name: 'restakePenaltyTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'rewardOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'rewardValidator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMaxAliasCount', + type: 'uint256', + }, + ], + name: 'setMaxAliasCount', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMaximumStake', + type: 'uint256', + }, + ], + name: 'setMaximumStake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMinimumStake', + type: 'uint256', + }, + ], + name: 'setMinimumStake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bool', + name: 'permitted', + type: 'bool', + }, + ], + name: 'setPermittedStakersOn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'stake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'totalStaked', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'balance', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'transferPenaltyTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'balance', + type: 'uint256', + }, + ], + name: 'withdrawPenaltyTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'Staking', + contracts: [ + { + network: 'datil', + address_hash: '0x21d636d95eE71150c0c3Ffa79268c989a329d1CE', + inserted_at: '2024-10-24T23:27:16Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'ActiveValidatorsCannotLeave', + type: 'error', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + inputs: [], + name: 'CannotKickBelowCurrentValidatorThreshold', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingAddress', + type: 'address', + }, + ], + name: 'CannotRejoinUntilNextEpochBecauseKicked', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'CannotReuseCommsKeys', + type: 'error', + }, + { + inputs: [], + name: 'CannotStakeZero', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'CannotVoteTwice', + type: 'error', + }, + { + inputs: [], + name: 'CannotWithdrawZero', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + ], + name: 'CouldNotMapNodeAddressToStakerAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInActiveOrUnlockedOrPausedState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInActiveOrUnlockedState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInNextValidatorSetLockedOrReadyForNextEpochOrRestoreState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInNextValidatorSetLockedOrReadyForNextEpochState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInNextValidatorSetLockedState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInReadyForNextEpochState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'MustBeValidatorInNextEpochToKick', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentTimestamp', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'epochEndTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeout', + type: 'uint256', + }, + ], + name: 'NotEnoughTimeElapsedForTimeoutSinceLastEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentTimestamp', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'epochEndTime', + type: 'uint256', + }, + ], + name: 'NotEnoughTimeElapsedSinceLastEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'validatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCount', + type: 'uint256', + }, + ], + name: 'NotEnoughValidatorsInNextEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentReadyValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'nextReadyValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCountToBeReady', + type: 'uint256', + }, + ], + name: 'NotEnoughValidatorsReadyForNextEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentEpochNumber', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receivedEpochNumber', + type: 'uint256', + }, + ], + name: 'SignaledReadyForWrongEpochNumber', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'StakerNotPermitted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'yourBalance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'requestedWithdrawlAmount', + type: 'uint256', + }, + ], + name: 'TryingToWithdrawMoreThanStaked', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'validator', + type: 'address', + }, + { + internalType: 'address[]', + name: 'validatorsInNextEpoch', + type: 'address[]', + }, + ], + name: 'ValidatorIsNotInNextEpoch', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'tolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'intervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyPercent', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct LibStakingStorage.ComplaintConfig', + name: 'config', + type: 'tuple', + }, + ], + name: 'ComplaintConfigSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newTokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'newKeyTypes', + type: 'uint256[]', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMinimumValidatorCount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMaxConcurrentRequests', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMaxTripleCount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMinTripleCount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newPeerCheckingIntervalSecs', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMaxTripleConcurrency', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bool', + name: 'newRpcHealthcheckEnabled', + type: 'bool', + }, + ], + name: 'ConfigSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newEpochEndTime', + type: 'uint256', + }, + ], + name: 'EpochEndTimeSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newEpochLength', + type: 'uint256', + }, + ], + name: 'EpochLengthSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newEpochTimeout', + type: 'uint256', + }, + ], + name: 'EpochTimeoutSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newKickPenaltyPercent', + type: 'uint256', + }, + ], + name: 'KickPenaltyPercentSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'epochNumber', + type: 'uint256', + }, + ], + name: 'ReadyForNextEpoch', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'token', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Recovered', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'RequestToJoin', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'RequestToLeave', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverContractAddress', + type: 'address', + }, + ], + name: 'ResolverContractAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newDuration', + type: 'uint256', + }, + ], + name: 'RewardsDurationUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newStakingTokenAddress', + type: 'address', + }, + ], + name: 'StakingTokenSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'enum LibStakingStorage.States', + name: 'newState', + type: 'uint8', + }, + ], + name: 'StateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountBurned', + type: 'uint256', + }, + ], + name: 'ValidatorKickedFromNextEpoch', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'ValidatorRejoinedNextEpoch', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'reporter', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'VotedToKickValidatorInNextEpoch', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + ], + name: 'adminKickValidatorInNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'adminRejoinValidator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'adminResetEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amountToPenalize', + type: 'uint256', + }, + ], + name: 'adminSlashValidator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'advanceEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'exit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getReward', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'kickValidatorInNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'lockValidatorsForNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'requestToJoin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'requestToLeave', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'requestToLeaveAsNode', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'tolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'intervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyPercent', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.ComplaintConfig', + name: 'config', + type: 'tuple', + }, + ], + name: 'setComplaintConfig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'tokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'DEPRECATED_complaintTolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'DEPRECATED_complaintIntervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'keyTypes', + type: 'uint256[]', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxConcurrentRequests', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'peerCheckingIntervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleConcurrency', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'rpcHealthcheckEnabled', + type: 'bool', + }, + ], + internalType: 'struct LibStakingStorage.Config', + name: 'newConfig', + type: 'tuple', + }, + ], + name: 'setConfig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newEpochEndTime', + type: 'uint256', + }, + ], + name: 'setEpochEndTime', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newEpochLength', + type: 'uint256', + }, + ], + name: 'setEpochLength', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'newState', + type: 'uint8', + }, + ], + name: 'setEpochState', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newEpochTimeout', + type: 'uint256', + }, + ], + name: 'setEpochTimeout', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'setIpPortNodeAddressAndCommunicationPubKeys', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'newKickPenaltyPercent', + type: 'uint256', + }, + ], + name: 'setKickPenaltyPercent', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'epochNumber', + type: 'uint256', + }, + ], + name: 'signalReadyForNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'stake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'stakeAndJoin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'VersionRequirementsUpdated', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'checkVersion', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getMaxVersion', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getMaxVersionString', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getMinVersion', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getMinVersionString', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'setMaxVersion', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'setMinVersion', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + ], + name: 'complaintConfig', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'tolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'intervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyPercent', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.ComplaintConfig', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'config', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'tokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'DEPRECATED_complaintTolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'DEPRECATED_complaintIntervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'keyTypes', + type: 'uint256[]', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxConcurrentRequests', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'peerCheckingIntervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleConcurrency', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'rpcHealthcheckEnabled', + type: 'bool', + }, + ], + internalType: 'struct LibStakingStorage.Config', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'contractResolver', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'countOfCurrentValidatorsReadyForNextEpoch', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'countOfNextValidatorsReadyForNextEpoch', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'currentValidatorCountForConsensus', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'epoch', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'epochLength', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'number', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'endTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'retries', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeout', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Epoch', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getActiveUnkickedValidatorStructs', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getActiveUnkickedValidatorStructsAndCounts', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'epochLength', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'number', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'endTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'retries', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeout', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Epoch', + name: '', + type: 'tuple', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getActiveUnkickedValidators', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getKeyTypes', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getKickedValidators', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'addresses', + type: 'address[]', + }, + ], + name: 'getNodeStakerAddressMappings', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + internalType: 'struct LibStakingStorage.AddressMapping[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getStakingBalancesAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getTokenAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getValidatorsInCurrentEpoch', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getValidatorsInCurrentEpochLength', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getValidatorsInNextEpoch', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'addresses', + type: 'address[]', + }, + ], + name: 'getValidatorsStructs', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getValidatorsStructsInCurrentEpoch', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getValidatorsStructsInNextEpoch', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'epochNumber', + type: 'uint256', + }, + { + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + { + internalType: 'address', + name: 'voterStakerAddress', + type: 'address', + }, + ], + name: 'getVotingStatusToKickValidator', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'isActiveValidator', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'isActiveValidatorByNodeAddress', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'isReadyForNextEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + ], + name: 'kickPenaltyPercentByReason', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'nextValidatorCountForConsensus', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + ], + name: 'nodeAddressToStakerAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'readyForNextEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'shouldKickValidator', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'state', + outputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'validators', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'Multisender', + contracts: [ + { + network: 'datil', + address_hash: '0xB87CcFf487B84b60c09DBE15337a46bf5a9e0680', + inserted_at: '2024-10-24T23:27:16Z', + ABI: [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: '_recipients', + type: 'address[]', + }, + ], + name: 'sendEth', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: '_recipients', + type: 'address[]', + }, + { + internalType: 'address', + name: 'tokenContract', + type: 'address', + }, + ], + name: 'sendTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'tokenContract', + type: 'address', + }, + ], + name: 'withdrawTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'LITToken', + contracts: [ + { + network: 'datil', + address_hash: '0xd78089bAAe410f5d0eae31D0D56157c73a3Ff98B', + inserted_at: '2024-10-24T23:27:16Z', + ABI: [ + { + inputs: [ + { + internalType: 'uint256', + name: 'cap', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [], + name: 'InvalidShortString', + type: 'error', + }, + { + inputs: [ + { + internalType: 'string', + name: 'str', + type: 'string', + }, + ], + name: 'StringTooLong', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'delegator', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'fromDelegate', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'toDelegate', + type: 'address', + }, + ], + name: 'DelegateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'delegate', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'previousBalance', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newBalance', + type: 'uint256', + }, + ], + name: 'DelegateVotesChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [], + name: 'EIP712DomainChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'Paused', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'previousAdminRole', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'newAdminRole', + type: 'bytes32', + }, + ], + name: 'RoleAdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleGranted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleRevoked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'Unpaused', + type: 'event', + }, + { + inputs: [], + name: 'ADMIN_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'CLOCK_MODE', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DEFAULT_ADMIN_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DOMAIN_SEPARATOR', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'MINTER_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PAUSER_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'burnFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'cap', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint32', + name: 'pos', + type: 'uint32', + }, + ], + name: 'checkpoints', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'fromBlock', + type: 'uint32', + }, + { + internalType: 'uint224', + name: 'votes', + type: 'uint224', + }, + ], + internalType: 'struct ERC20Votes.Checkpoint', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'clock', + outputs: [ + { + internalType: 'uint48', + name: '', + type: 'uint48', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'subtractedValue', + type: 'uint256', + }, + ], + name: 'decreaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + ], + name: 'delegate', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + { + internalType: 'uint256', + name: 'nonce', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiry', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'delegateBySig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'delegates', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'eip712Domain', + outputs: [ + { + internalType: 'bytes1', + name: 'fields', + type: 'bytes1', + }, + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'version', + type: 'string', + }, + { + internalType: 'uint256', + name: 'chainId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'verifyingContract', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'salt', + type: 'bytes32', + }, + { + internalType: 'uint256[]', + name: 'extensions', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'timepoint', + type: 'uint256', + }, + ], + name: 'getPastTotalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'timepoint', + type: 'uint256', + }, + ], + name: 'getPastVotes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + ], + name: 'getRoleAdmin', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'getVotes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'grantRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'hasRole', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'addedValue', + type: 'uint256', + }, + ], + name: 'increaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + ], + name: 'mint', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'nonces', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'numCheckpoints', + outputs: [ + { + internalType: 'uint32', + name: '', + type: 'uint32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'pause', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'paused', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'permit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'renounceRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'revokeRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'unpause', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PubkeyRouter', + contracts: [ + { + network: 'datil', + address_hash: '0xF182d6bEf16Ba77e69372dD096D8B70Bc3d5B475', + inserted_at: '2024-10-24T23:27:16Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + indexed: false, + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'PubkeyRoutingDataSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct IPubkeyRouter.RootKey', + name: 'rootKey', + type: 'tuple', + }, + ], + name: 'RootKeySet', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + ], + name: 'adminResetRootKeys', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + { + internalType: 'bytes', + name: 'signedMessage', + type: 'bytes', + }, + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + ], + name: 'checkNodeSignatures', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + ], + name: 'deriveEthAddressFromPubkey', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'ethAddress', + type: 'address', + }, + ], + name: 'ethAddressToPkpId', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'getDerivedPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getEthAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + ], + name: 'getRootKeys', + outputs: [ + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + internalType: 'struct IPubkeyRouter.RootKey[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getRoutingData', + outputs: [ + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + internalType: + 'struct LibPubkeyRouterStorage.PubkeyRoutingData', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'isRouted', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'pubkeys', + outputs: [ + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + internalType: + 'struct LibPubkeyRouterStorage.PubkeyRoutingData', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'setRoutingData', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'setRoutingDataAsAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + internalType: 'struct IPubkeyRouter.RootKey[]', + name: 'newRootKeys', + type: 'tuple[]', + }, + ], + name: 'voteForRootKeys', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PKPNFT', + contracts: [ + { + network: 'datil', + address_hash: '0x487A9D096BB4B7Ac1520Cb12370e31e677B175EA', + inserted_at: '2024-10-24T23:27:16Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'approved', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'ApprovalForAll', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newFreeMintSigner', + type: 'address', + }, + ], + name: 'FreeMintSignerSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint8', + name: 'version', + type: 'uint8', + }, + ], + name: 'Initialized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newMintCost', + type: 'uint256', + }, + ], + name: 'MintCostSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + ], + name: 'PKPMinted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Withdrew', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + ], + name: 'claimAndMint', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'exists', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'freeMintSigner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getApproved', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getEthAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getNextDerivedKeyId', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftMetadataAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpPermissionsAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getRouterAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getStakingAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + ], + name: 'isApprovedForAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'mintCost', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + ], + name: 'mintGrantAndBurnNext', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + name: 'mintNext', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'ownerOf', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'hash', + type: 'bytes32', + }, + ], + name: 'prefixed', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'redeemedFreeMintIds', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'setApprovalForAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newFreeMintSigner', + type: 'address', + }, + ], + name: 'setFreeMintSigner', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMintCost', + type: 'uint256', + }, + ], + name: 'setMintCost', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenOfOwnerByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'tokenURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'RateLimitNFT', + contracts: [ + { + network: 'datil', + address_hash: '0x01205d94Fee4d9F59A4aB24bf80D11d4DdAf6Eed', + inserted_at: '2024-10-24T23:27:16Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newAdditionalRequestsPerKilosecondCost', + type: 'uint256', + }, + ], + name: 'AdditionalRequestsPerKilosecondCostSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'approved', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'ApprovalForAll', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newFreeMintSigner', + type: 'address', + }, + ], + name: 'FreeMintSignerSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newFreeRequestsPerRateLimitWindow', + type: 'uint256', + }, + ], + name: 'FreeRequestsPerRateLimitWindowSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint8', + name: 'version', + type: 'uint8', + }, + ], + name: 'Initialized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newRLIHolderRateLimitWindowSeconds', + type: 'uint256', + }, + ], + name: 'RLIHolderRateLimitWindowSecondsSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newRateLimitWindowSeconds', + type: 'uint256', + }, + ], + name: 'RateLimitWindowSecondsSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Withdrew', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'requestsPerKilosecond', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'msgHash', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'sVal', + type: 'bytes32', + }, + ], + name: 'freeMint', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getApproved', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + ], + name: 'isApprovedForAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + name: 'mint', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'ownerOf', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newAdditionalRequestsPerKilosecondCost', + type: 'uint256', + }, + ], + name: 'setAdditionalRequestsPerKilosecondCost', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'setApprovalForAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newFreeMintSigner', + type: 'address', + }, + ], + name: 'setFreeMintSigner', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newFreeRequestsPerRateLimitWindow', + type: 'uint256', + }, + ], + name: 'setFreeRequestsPerRateLimitWindow', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMaxExpirationSeconds', + type: 'uint256', + }, + ], + name: 'setMaxExpirationSeconds', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMaxRequestsPerKilosecond', + type: 'uint256', + }, + ], + name: 'setMaxRequestsPerKilosecond', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newRLIHolderRateLimitWindowSeconds', + type: 'uint256', + }, + ], + name: 'setRLIHolderRateLimitWindowSeconds', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newRateLimitWindowSeconds', + type: 'uint256', + }, + ], + name: 'setRateLimitWindowSeconds', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenOfOwnerByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'tokenURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'RLIHolderRateLimitWindowSeconds', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'additionalRequestsPerKilosecondCost', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'requestsPerKilosecond', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + name: 'calculateCost', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'payingAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + name: 'calculateRequestsPerKilosecond', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'capacity', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'requestsPerKilosecond', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + internalType: 'struct LibRateLimitNFTStorage.RateLimit', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'requestedRequestsPerKilosecond', + type: 'uint256', + }, + ], + name: 'checkBelowMaxRequestsPerKilosecond', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'currentSoldRequestsPerKilosecond', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'defaultRateLimitWindowSeconds', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'requestsPerKilosecond', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'msgHash', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'sVal', + type: 'bytes32', + }, + ], + name: 'freeMintSigTest', + outputs: [], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'freeMintSigner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'freeRequestsPerRateLimitWindow', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'isExpired', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxExpirationSeconds', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxRequestsPerKilosecond', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'hash', + type: 'bytes32', + }, + ], + name: 'prefixed', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'msgHash', + type: 'bytes32', + }, + ], + name: 'redeemedFreeMints', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'tokenIdCounter', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'tokenSVG', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + name: 'totalSoldRequestsPerKilosecondByExpirationTime', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PKPHelper', + contracts: [ + { + network: 'datil', + address_hash: '0x5B55ee57C459a31072145F2Fc00b35de20520adD', + inserted_at: '2024-10-24T23:27:16Z', + ABI: [ + { + inputs: [ + { + internalType: 'address', + name: '_resolver', + type: 'address', + }, + { + internalType: 'enum ContractResolver.Env', + name: '_env', + type: 'uint8', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'previousAdminRole', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'newAdminRole', + type: 'bytes32', + }, + ], + name: 'RoleAdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleGranted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleRevoked', + type: 'event', + }, + { + inputs: [], + name: 'DEFAULT_ADMIN_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + ], + internalType: 'struct LibPKPNFTStorage.ClaimMaterial', + name: 'claimMaterial', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes[]', + name: 'permittedIpfsCIDs', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedIpfsCIDScopes', + type: 'uint256[][]', + }, + { + internalType: 'address[]', + name: 'permittedAddresses', + type: 'address[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAddressScopes', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + internalType: 'struct PKPHelper.AuthMethodData', + name: 'authMethodData', + type: 'tuple', + }, + ], + name: 'claimAndMintNextAndAddAuthMethods', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + ], + internalType: 'struct LibPKPNFTStorage.ClaimMaterial', + name: 'claimMaterial', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes[]', + name: 'permittedIpfsCIDs', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedIpfsCIDScopes', + type: 'uint256[][]', + }, + { + internalType: 'address[]', + name: 'permittedAddresses', + type: 'address[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAddressScopes', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + internalType: 'struct PKPHelper.AuthMethodData', + name: 'authMethodData', + type: 'tuple', + }, + ], + name: 'claimAndMintNextAndAddAuthMethodsWithTypes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'contractResolver', + outputs: [ + { + internalType: 'contract ContractResolver', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'env', + outputs: [ + { + internalType: 'enum ContractResolver.Env', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getDomainWalletRegistry', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPKPNftMetdataAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpPermissionsAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + ], + name: 'getRoleAdmin', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'grantRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'hasRole', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + name: 'mintNextAndAddAuthMethods', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes[]', + name: 'permittedIpfsCIDs', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedIpfsCIDScopes', + type: 'uint256[][]', + }, + { + internalType: 'address[]', + name: 'permittedAddresses', + type: 'address[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAddressScopes', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + name: 'mintNextAndAddAuthMethodsWithTypes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'string[]', + name: 'nftMetadata', + type: 'string[]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + name: 'mintNextAndAddDomainWalletMetadata', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + name: 'onERC721Received', + outputs: [ + { + internalType: 'bytes4', + name: '', + type: 'bytes4', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'removePkpMetadata', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'renounceRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'revokeRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'string[]', + name: 'nftMetadata', + type: 'string[]', + }, + ], + name: 'setPkpMetadata', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PKPPermissions', + contracts: [ + { + network: 'datil', + address_hash: '0x213Db6E1446928E19588269bEF7dFc9187c4829A', + inserted_at: '2024-10-24T23:27:16Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + indexed: false, + internalType: 'bytes', + name: 'userPubkey', + type: 'bytes', + }, + ], + name: 'PermittedAuthMethodAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'PermittedAuthMethodRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + indexed: false, + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'PermittedAuthMethodScopeAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + indexed: false, + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'PermittedAuthMethodScopeRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: true, + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'root', + type: 'bytes32', + }, + ], + name: 'RootHashUpdated', + type: 'event', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + { + internalType: 'uint256[]', + name: 'scopes', + type: 'uint256[]', + }, + ], + name: 'addPermittedAction', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'user', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'scopes', + type: 'uint256[]', + }, + ], + name: 'addPermittedAddress', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'userPubkey', + type: 'bytes', + }, + ], + internalType: 'struct LibPKPPermissionsStorage.AuthMethod', + name: 'authMethod', + type: 'tuple', + }, + { + internalType: 'uint256[]', + name: 'scopes', + type: 'uint256[]', + }, + ], + name: 'addPermittedAuthMethod', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'addPermittedAuthMethodScope', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypesToAdd', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIdsToAdd', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeysToAdd', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopesToAdd', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypesToRemove', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIdsToRemove', + type: 'bytes[]', + }, + ], + name: 'batchAddRemoveAuthMethods', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'getAuthMethodId', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getEthAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPermittedActions', + outputs: [ + { + internalType: 'bytes[]', + name: '', + type: 'bytes[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPermittedAddresses', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'maxScopeId', + type: 'uint256', + }, + ], + name: 'getPermittedAuthMethodScopes', + outputs: [ + { + internalType: 'bool[]', + name: '', + type: 'bool[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPermittedAuthMethods', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'userPubkey', + type: 'bytes', + }, + ], + internalType: 'struct LibPKPPermissionsStorage.AuthMethod[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getRouterAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'getTokenIdsForAuthMethod', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'getUserPubkeyForAuthMethod', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + ], + name: 'isPermittedAction', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'isPermittedAddress', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'isPermittedAuthMethod', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'isPermittedAuthMethodScopePresent', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + ], + name: 'removePermittedAction', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'removePermittedAddress', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'removePermittedAuthMethod', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'removePermittedAuthMethodScope', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'root', + type: 'bytes32', + }, + ], + name: 'setRootHash', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + internalType: 'bytes32[]', + name: 'proof', + type: 'bytes32[]', + }, + { + internalType: 'bytes32', + name: 'leaf', + type: 'bytes32', + }, + ], + name: 'verifyState', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + internalType: 'bytes32[]', + name: 'proof', + type: 'bytes32[]', + }, + { + internalType: 'bool[]', + name: 'proofFlags', + type: 'bool[]', + }, + { + internalType: 'bytes32[]', + name: 'leaves', + type: 'bytes32[]', + }, + ], + name: 'verifyStates', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PKPNFTMetadata', + contracts: [ + { + network: 'datil', + address_hash: '0x4BB8681d3a24F130cC746C7DC31167C93D72d32b', + inserted_at: '2024-10-24T23:27:16Z', + ABI: [ + { + inputs: [ + { + internalType: 'address', + name: '_resolver', + type: 'address', + }, + { + internalType: 'enum ContractResolver.Env', + name: '_env', + type: 'uint8', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'buffer', + type: 'bytes', + }, + ], + name: 'bytesToHex', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [], + name: 'contractResolver', + outputs: [ + { + internalType: 'contract ContractResolver', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'env', + outputs: [ + { + internalType: 'enum ContractResolver.Env', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'removeProfileForPkp', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'removeUrlForPKP', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'string', + name: 'imgUrl', + type: 'string', + }, + ], + name: 'setProfileForPKP', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'string', + name: 'url', + type: 'string', + }, + ], + name: 'setUrlForPKP', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'pubKey', + type: 'bytes', + }, + { + internalType: 'address', + name: 'ethAddress', + type: 'address', + }, + ], + name: 'tokenURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'Allowlist', + contracts: [ + { + network: 'datil', + address_hash: '0xE393BCD2a9099C903D28949Bac2C4cEd21E55415', + inserted_at: '2024-10-24T23:27:16Z', + ABI: [ + { + inputs: [], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'ItemAllowed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'ItemNotAllowed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'addAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'allowAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + name: 'allowedItems', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'isAllowed', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'removeAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bool', + name: '_allowAll', + type: 'bool', + }, + ], + name: 'setAllowAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'setAllowed', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'setNotAllowed', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PaymentDelegation', + contracts: [ + { + network: 'datil', + address_hash: '0xF19ea8634969730cB51BFEe2E2A5353062053C14', + inserted_at: '2024-10-24T23:27:16Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'payer', + type: 'address', + }, + { + components: [ + { + internalType: 'uint256', + name: 'requestsPerPeriod', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'periodSeconds', + type: 'uint256', + }, + ], + indexed: false, + internalType: + 'struct LibPaymentDelegationStorage.Restriction', + name: 'restriction', + type: 'tuple', + }, + ], + name: 'RestrictionSet', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'delegatePayments', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'users', + type: 'address[]', + }, + ], + name: 'delegatePaymentsBatch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'getPayers', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'users', + type: 'address[]', + }, + ], + name: 'getPayersAndRestrictions', + outputs: [ + { + internalType: 'address[][]', + name: '', + type: 'address[][]', + }, + { + components: [ + { + internalType: 'uint256', + name: 'requestsPerPeriod', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'periodSeconds', + type: 'uint256', + }, + ], + internalType: + 'struct LibPaymentDelegationStorage.Restriction[][]', + name: '', + type: 'tuple[][]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'payer', + type: 'address', + }, + ], + name: 'getRestriction', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'requestsPerPeriod', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'periodSeconds', + type: 'uint256', + }, + ], + internalType: + 'struct LibPaymentDelegationStorage.Restriction', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'payer', + type: 'address', + }, + ], + name: 'getUsers', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'setDefaultRestriction', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'requestsPerPeriod', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'periodSeconds', + type: 'uint256', + }, + ], + internalType: + 'struct LibPaymentDelegationStorage.Restriction', + name: 'r', + type: 'tuple', + }, + ], + name: 'setRestriction', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'undelegatePayments', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'users', + type: 'address[]', + }, + ], + name: 'undelegatePaymentsBatch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + ], +}; + +// node_modules/@lit-protocol/contracts/dist/prod/cayenne.js +init_shim(); + +// node_modules/@lit-protocol/contracts/dist/prod/datil-dev.js +init_shim(); +var datilDev = { + config: { + chainId: '175188', + rpcUrl: 'https://yellowstone-rpc.litprotocol.com', + chainName: 'yellowstone', + litNodeDomainName: '127.0.0.1', + litNodePort: 7470, + rocketPort: 7470, + }, + data: [ + { + name: 'StakingBalances', + contracts: [ + { + network: 'datil-dev', + address_hash: '0x77F277D4858Ae589b2263FEfd50CaD7838fE4741', + inserted_at: '2024-11-27T01:57:28Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'ActiveValidatorsCannotLeave', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'AliasNotOwnedBySender', + type: 'error', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'CannotRemoveAliasOfActiveValidator', + type: 'error', + }, + { + inputs: [], + name: 'CannotStakeZero', + type: 'error', + }, + { + inputs: [], + name: 'CannotWithdrawZero', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'aliasCount', + type: 'uint256', + }, + ], + name: 'MaxAliasCountReached', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'OnlyStakingContract', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountStaked', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minimumStake', + type: 'uint256', + }, + ], + name: 'StakeMustBeGreaterThanMinimumStake', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountStaked', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maximumStake', + type: 'uint256', + }, + ], + name: 'StakeMustBeLessThanMaximumStake', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'StakerNotPermitted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'yourBalance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'requestedWithdrawlAmount', + type: 'uint256', + }, + ], + name: 'TryingToWithdrawMoreThanStaked', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'AliasAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'AliasRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newMaxAliasCount', + type: 'uint256', + }, + ], + name: 'MaxAliasCountSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newMaximumStake', + type: 'uint256', + }, + ], + name: 'MaximumStakeSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newMinimumStake', + type: 'uint256', + }, + ], + name: 'MinimumStakeSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'PermittedStakerAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'PermittedStakerRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'bool', + name: 'permittedStakersOn', + type: 'bool', + }, + ], + name: 'PermittedStakersOnChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ResolverContractAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + ], + name: 'RewardPaid', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Staked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newTokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + ], + name: 'TokenRewardPerTokenPerEpochSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'ValidatorNotRewardedBecauseAlias', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'ValidatorRewarded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'ValidatorTokensPenalized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Withdrawn', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'addAlias', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'addPermittedStaker', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'stakers', + type: 'address[]', + }, + ], + name: 'addPermittedStakers', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'checkStakingAmounts', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'contractResolver', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'getReward', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getStakingAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getTokenAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'isPermittedStaker', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maximumStake', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'minimumStake', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'penalizeTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'permittedStakersOn', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'removeAlias', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'removePermittedStaker', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + internalType: 'uint256', + name: 'balance', + type: 'uint256', + }, + ], + name: 'restakePenaltyTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'rewardOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'rewardValidator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMaxAliasCount', + type: 'uint256', + }, + ], + name: 'setMaxAliasCount', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMaximumStake', + type: 'uint256', + }, + ], + name: 'setMaximumStake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMinimumStake', + type: 'uint256', + }, + ], + name: 'setMinimumStake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bool', + name: 'permitted', + type: 'bool', + }, + ], + name: 'setPermittedStakersOn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'stake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'totalStaked', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'balance', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'transferPenaltyTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'balance', + type: 'uint256', + }, + ], + name: 'withdrawPenaltyTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'Staking', + contracts: [ + { + network: 'datil-dev', + address_hash: '0xD4507CD392Af2c80919219d7896508728f6A623F', + inserted_at: '2024-11-27T01:57:28Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'ActiveValidatorsCannotLeave', + type: 'error', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + inputs: [], + name: 'CannotKickBelowCurrentValidatorThreshold', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingAddress', + type: 'address', + }, + ], + name: 'CannotRejoinUntilNextEpochBecauseKicked', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'CannotReuseCommsKeys', + type: 'error', + }, + { + inputs: [], + name: 'CannotStakeZero', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'CannotVoteTwice', + type: 'error', + }, + { + inputs: [], + name: 'CannotWithdrawZero', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + ], + name: 'CouldNotMapNodeAddressToStakerAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInActiveOrUnlockedOrPausedState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInActiveOrUnlockedState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInNextValidatorSetLockedOrReadyForNextEpochOrRestoreState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInNextValidatorSetLockedOrReadyForNextEpochState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInNextValidatorSetLockedState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInReadyForNextEpochState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'MustBeValidatorInNextEpochToKick', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentTimestamp', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'epochEndTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeout', + type: 'uint256', + }, + ], + name: 'NotEnoughTimeElapsedForTimeoutSinceLastEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentTimestamp', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'epochEndTime', + type: 'uint256', + }, + ], + name: 'NotEnoughTimeElapsedSinceLastEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'validatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCount', + type: 'uint256', + }, + ], + name: 'NotEnoughValidatorsInNextEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentReadyValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'nextReadyValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCountToBeReady', + type: 'uint256', + }, + ], + name: 'NotEnoughValidatorsReadyForNextEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentEpochNumber', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receivedEpochNumber', + type: 'uint256', + }, + ], + name: 'SignaledReadyForWrongEpochNumber', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'StakerNotPermitted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'yourBalance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'requestedWithdrawlAmount', + type: 'uint256', + }, + ], + name: 'TryingToWithdrawMoreThanStaked', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'validator', + type: 'address', + }, + { + internalType: 'address[]', + name: 'validatorsInNextEpoch', + type: 'address[]', + }, + ], + name: 'ValidatorIsNotInNextEpoch', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'tolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'intervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyPercent', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct LibStakingStorage.ComplaintConfig', + name: 'config', + type: 'tuple', + }, + ], + name: 'ComplaintConfigSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newTokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'newKeyTypes', + type: 'uint256[]', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMinimumValidatorCount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMaxConcurrentRequests', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMaxTripleCount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMinTripleCount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newPeerCheckingIntervalSecs', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMaxTripleConcurrency', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bool', + name: 'newRpcHealthcheckEnabled', + type: 'bool', + }, + ], + name: 'ConfigSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newEpochEndTime', + type: 'uint256', + }, + ], + name: 'EpochEndTimeSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newEpochLength', + type: 'uint256', + }, + ], + name: 'EpochLengthSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newEpochTimeout', + type: 'uint256', + }, + ], + name: 'EpochTimeoutSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newKickPenaltyPercent', + type: 'uint256', + }, + ], + name: 'KickPenaltyPercentSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'epochNumber', + type: 'uint256', + }, + ], + name: 'ReadyForNextEpoch', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'token', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Recovered', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'RequestToJoin', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'RequestToLeave', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverContractAddress', + type: 'address', + }, + ], + name: 'ResolverContractAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newDuration', + type: 'uint256', + }, + ], + name: 'RewardsDurationUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newStakingTokenAddress', + type: 'address', + }, + ], + name: 'StakingTokenSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'enum LibStakingStorage.States', + name: 'newState', + type: 'uint8', + }, + ], + name: 'StateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountBurned', + type: 'uint256', + }, + ], + name: 'ValidatorKickedFromNextEpoch', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'ValidatorRejoinedNextEpoch', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'reporter', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'VotedToKickValidatorInNextEpoch', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + ], + name: 'adminKickValidatorInNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'adminRejoinValidator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'adminResetEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amountToPenalize', + type: 'uint256', + }, + ], + name: 'adminSlashValidator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'advanceEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'exit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getReward', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'kickValidatorInNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'lockValidatorsForNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'requestToJoin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'requestToLeave', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'requestToLeaveAsNode', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'tolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'intervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyPercent', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.ComplaintConfig', + name: 'config', + type: 'tuple', + }, + ], + name: 'setComplaintConfig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'tokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'DEPRECATED_complaintTolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'DEPRECATED_complaintIntervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'keyTypes', + type: 'uint256[]', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxConcurrentRequests', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'peerCheckingIntervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleConcurrency', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'rpcHealthcheckEnabled', + type: 'bool', + }, + ], + internalType: 'struct LibStakingStorage.Config', + name: 'newConfig', + type: 'tuple', + }, + ], + name: 'setConfig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newEpochEndTime', + type: 'uint256', + }, + ], + name: 'setEpochEndTime', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newEpochLength', + type: 'uint256', + }, + ], + name: 'setEpochLength', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'newState', + type: 'uint8', + }, + ], + name: 'setEpochState', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newEpochTimeout', + type: 'uint256', + }, + ], + name: 'setEpochTimeout', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'setIpPortNodeAddressAndCommunicationPubKeys', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'newKickPenaltyPercent', + type: 'uint256', + }, + ], + name: 'setKickPenaltyPercent', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'epochNumber', + type: 'uint256', + }, + ], + name: 'signalReadyForNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'stake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'stakeAndJoin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'VersionRequirementsUpdated', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'checkVersion', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getMaxVersion', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getMaxVersionString', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getMinVersion', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getMinVersionString', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'setMaxVersion', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'setMinVersion', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + ], + name: 'complaintConfig', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'tolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'intervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyPercent', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.ComplaintConfig', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'config', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'tokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'DEPRECATED_complaintTolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'DEPRECATED_complaintIntervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'keyTypes', + type: 'uint256[]', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxConcurrentRequests', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'peerCheckingIntervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleConcurrency', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'rpcHealthcheckEnabled', + type: 'bool', + }, + ], + internalType: 'struct LibStakingStorage.Config', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'contractResolver', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'countOfCurrentValidatorsReadyForNextEpoch', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'countOfNextValidatorsReadyForNextEpoch', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'currentValidatorCountForConsensus', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'epoch', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'epochLength', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'number', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'endTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'retries', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeout', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Epoch', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getActiveUnkickedValidatorStructs', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getActiveUnkickedValidatorStructsAndCounts', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'epochLength', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'number', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'endTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'retries', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeout', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Epoch', + name: '', + type: 'tuple', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getActiveUnkickedValidators', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getKeyTypes', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getKickedValidators', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'addresses', + type: 'address[]', + }, + ], + name: 'getNodeStakerAddressMappings', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + internalType: 'struct LibStakingStorage.AddressMapping[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getStakingBalancesAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getTokenAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getValidatorsInCurrentEpoch', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getValidatorsInCurrentEpochLength', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getValidatorsInNextEpoch', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'addresses', + type: 'address[]', + }, + ], + name: 'getValidatorsStructs', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getValidatorsStructsInCurrentEpoch', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getValidatorsStructsInNextEpoch', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'epochNumber', + type: 'uint256', + }, + { + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + { + internalType: 'address', + name: 'voterStakerAddress', + type: 'address', + }, + ], + name: 'getVotingStatusToKickValidator', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'isActiveValidator', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'isActiveValidatorByNodeAddress', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'isReadyForNextEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + ], + name: 'kickPenaltyPercentByReason', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'nextValidatorCountForConsensus', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + ], + name: 'nodeAddressToStakerAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'readyForNextEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'shouldKickValidator', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'state', + outputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'validators', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'Multisender', + contracts: [ + { + network: 'datil-dev', + address_hash: '0x116eBFb474C6aa13e1B8b19253fd0E3f226A982f', + inserted_at: '2024-11-27T01:57:28Z', + ABI: [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: '_recipients', + type: 'address[]', + }, + ], + name: 'sendEth', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: '_recipients', + type: 'address[]', + }, + { + internalType: 'address', + name: 'tokenContract', + type: 'address', + }, + ], + name: 'sendTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'tokenContract', + type: 'address', + }, + ], + name: 'withdrawTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'LITToken', + contracts: [ + { + network: 'datil-dev', + address_hash: '0x81d8f0e945E3Bdc735dA3E19C4Df77a8B91046Cd', + inserted_at: '2024-11-27T01:57:28Z', + ABI: [ + { + inputs: [ + { + internalType: 'uint256', + name: 'cap', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [], + name: 'InvalidShortString', + type: 'error', + }, + { + inputs: [ + { + internalType: 'string', + name: 'str', + type: 'string', + }, + ], + name: 'StringTooLong', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'delegator', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'fromDelegate', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'toDelegate', + type: 'address', + }, + ], + name: 'DelegateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'delegate', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'previousBalance', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newBalance', + type: 'uint256', + }, + ], + name: 'DelegateVotesChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [], + name: 'EIP712DomainChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'Paused', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'previousAdminRole', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'newAdminRole', + type: 'bytes32', + }, + ], + name: 'RoleAdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleGranted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleRevoked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'Unpaused', + type: 'event', + }, + { + inputs: [], + name: 'ADMIN_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'CLOCK_MODE', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DEFAULT_ADMIN_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DOMAIN_SEPARATOR', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'MINTER_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PAUSER_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'burnFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'cap', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint32', + name: 'pos', + type: 'uint32', + }, + ], + name: 'checkpoints', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'fromBlock', + type: 'uint32', + }, + { + internalType: 'uint224', + name: 'votes', + type: 'uint224', + }, + ], + internalType: 'struct ERC20Votes.Checkpoint', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'clock', + outputs: [ + { + internalType: 'uint48', + name: '', + type: 'uint48', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'subtractedValue', + type: 'uint256', + }, + ], + name: 'decreaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + ], + name: 'delegate', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + { + internalType: 'uint256', + name: 'nonce', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiry', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'delegateBySig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'delegates', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'eip712Domain', + outputs: [ + { + internalType: 'bytes1', + name: 'fields', + type: 'bytes1', + }, + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'version', + type: 'string', + }, + { + internalType: 'uint256', + name: 'chainId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'verifyingContract', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'salt', + type: 'bytes32', + }, + { + internalType: 'uint256[]', + name: 'extensions', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'timepoint', + type: 'uint256', + }, + ], + name: 'getPastTotalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'timepoint', + type: 'uint256', + }, + ], + name: 'getPastVotes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + ], + name: 'getRoleAdmin', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'getVotes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'grantRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'hasRole', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'addedValue', + type: 'uint256', + }, + ], + name: 'increaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + ], + name: 'mint', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'nonces', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'numCheckpoints', + outputs: [ + { + internalType: 'uint32', + name: '', + type: 'uint32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'pause', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'paused', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'permit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'renounceRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'revokeRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'unpause', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PubkeyRouter', + contracts: [ + { + network: 'datil-dev', + address_hash: '0xbc01f21C58Ca83f25b09338401D53D4c2344D1d9', + inserted_at: '2024-11-27T01:57:28Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + indexed: false, + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'PubkeyRoutingDataSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct IPubkeyRouter.RootKey', + name: 'rootKey', + type: 'tuple', + }, + ], + name: 'RootKeySet', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + ], + name: 'adminResetRootKeys', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + { + internalType: 'bytes', + name: 'signedMessage', + type: 'bytes', + }, + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + ], + name: 'checkNodeSignatures', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + ], + name: 'deriveEthAddressFromPubkey', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'ethAddress', + type: 'address', + }, + ], + name: 'ethAddressToPkpId', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'getDerivedPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getEthAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + ], + name: 'getRootKeys', + outputs: [ + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + internalType: 'struct IPubkeyRouter.RootKey[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getRoutingData', + outputs: [ + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + internalType: + 'struct LibPubkeyRouterStorage.PubkeyRoutingData', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'isRouted', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'pubkeys', + outputs: [ + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + internalType: + 'struct LibPubkeyRouterStorage.PubkeyRoutingData', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'setRoutingData', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'setRoutingDataAsAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + internalType: 'struct IPubkeyRouter.RootKey[]', + name: 'newRootKeys', + type: 'tuple[]', + }, + ], + name: 'voteForRootKeys', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PKPNFT', + contracts: [ + { + network: 'datil-dev', + address_hash: '0x02C4242F72d62c8fEF2b2DB088A35a9F4ec741C7', + inserted_at: '2024-11-27T01:57:28Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'approved', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'ApprovalForAll', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newFreeMintSigner', + type: 'address', + }, + ], + name: 'FreeMintSignerSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint8', + name: 'version', + type: 'uint8', + }, + ], + name: 'Initialized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newMintCost', + type: 'uint256', + }, + ], + name: 'MintCostSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + ], + name: 'PKPMinted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Withdrew', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + ], + name: 'claimAndMint', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'exists', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'freeMintSigner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getApproved', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getEthAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getNextDerivedKeyId', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftMetadataAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpPermissionsAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getRouterAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getStakingAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + ], + name: 'isApprovedForAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'mintCost', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + ], + name: 'mintGrantAndBurnNext', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + name: 'mintNext', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'ownerOf', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'hash', + type: 'bytes32', + }, + ], + name: 'prefixed', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'redeemedFreeMintIds', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'setApprovalForAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newFreeMintSigner', + type: 'address', + }, + ], + name: 'setFreeMintSigner', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMintCost', + type: 'uint256', + }, + ], + name: 'setMintCost', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenOfOwnerByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'tokenURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'RateLimitNFT', + contracts: [ + { + network: 'datil-dev', + address_hash: '0x1A12D5B3D6A52B3bDe0468900795D35ce994ac2b', + inserted_at: '2024-11-27T01:57:28Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newAdditionalRequestsPerKilosecondCost', + type: 'uint256', + }, + ], + name: 'AdditionalRequestsPerKilosecondCostSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'approved', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'ApprovalForAll', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newFreeMintSigner', + type: 'address', + }, + ], + name: 'FreeMintSignerSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newFreeRequestsPerRateLimitWindow', + type: 'uint256', + }, + ], + name: 'FreeRequestsPerRateLimitWindowSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint8', + name: 'version', + type: 'uint8', + }, + ], + name: 'Initialized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newRLIHolderRateLimitWindowSeconds', + type: 'uint256', + }, + ], + name: 'RLIHolderRateLimitWindowSecondsSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newRateLimitWindowSeconds', + type: 'uint256', + }, + ], + name: 'RateLimitWindowSecondsSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Withdrew', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'requestsPerKilosecond', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'msgHash', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'sVal', + type: 'bytes32', + }, + ], + name: 'freeMint', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getApproved', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + ], + name: 'isApprovedForAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + name: 'mint', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'ownerOf', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newAdditionalRequestsPerKilosecondCost', + type: 'uint256', + }, + ], + name: 'setAdditionalRequestsPerKilosecondCost', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'setApprovalForAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newFreeMintSigner', + type: 'address', + }, + ], + name: 'setFreeMintSigner', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newFreeRequestsPerRateLimitWindow', + type: 'uint256', + }, + ], + name: 'setFreeRequestsPerRateLimitWindow', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMaxExpirationSeconds', + type: 'uint256', + }, + ], + name: 'setMaxExpirationSeconds', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMaxRequestsPerKilosecond', + type: 'uint256', + }, + ], + name: 'setMaxRequestsPerKilosecond', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newRLIHolderRateLimitWindowSeconds', + type: 'uint256', + }, + ], + name: 'setRLIHolderRateLimitWindowSeconds', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newRateLimitWindowSeconds', + type: 'uint256', + }, + ], + name: 'setRateLimitWindowSeconds', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenOfOwnerByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'tokenURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'RLIHolderRateLimitWindowSeconds', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'additionalRequestsPerKilosecondCost', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'requestsPerKilosecond', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + name: 'calculateCost', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'payingAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + name: 'calculateRequestsPerKilosecond', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'capacity', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'requestsPerKilosecond', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + internalType: 'struct LibRateLimitNFTStorage.RateLimit', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'requestedRequestsPerKilosecond', + type: 'uint256', + }, + ], + name: 'checkBelowMaxRequestsPerKilosecond', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'currentSoldRequestsPerKilosecond', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'defaultRateLimitWindowSeconds', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'requestsPerKilosecond', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'msgHash', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'sVal', + type: 'bytes32', + }, + ], + name: 'freeMintSigTest', + outputs: [], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'freeMintSigner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'freeRequestsPerRateLimitWindow', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'isExpired', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxExpirationSeconds', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxRequestsPerKilosecond', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'hash', + type: 'bytes32', + }, + ], + name: 'prefixed', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'msgHash', + type: 'bytes32', + }, + ], + name: 'redeemedFreeMints', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'tokenIdCounter', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'tokenSVG', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + name: 'totalSoldRequestsPerKilosecondByExpirationTime', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PKPHelper', + contracts: [ + { + network: 'datil-dev', + address_hash: '0xCa9C62fB4ceA8831eBb6fD9fE747Cc372515CF7f', + inserted_at: '2024-11-27T01:57:28Z', + ABI: [ + { + inputs: [ + { + internalType: 'address', + name: '_resolver', + type: 'address', + }, + { + internalType: 'enum ContractResolver.Env', + name: '_env', + type: 'uint8', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'previousAdminRole', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'newAdminRole', + type: 'bytes32', + }, + ], + name: 'RoleAdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleGranted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleRevoked', + type: 'event', + }, + { + inputs: [], + name: 'DEFAULT_ADMIN_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + ], + internalType: 'struct LibPKPNFTStorage.ClaimMaterial', + name: 'claimMaterial', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes[]', + name: 'permittedIpfsCIDs', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedIpfsCIDScopes', + type: 'uint256[][]', + }, + { + internalType: 'address[]', + name: 'permittedAddresses', + type: 'address[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAddressScopes', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + internalType: 'struct PKPHelper.AuthMethodData', + name: 'authMethodData', + type: 'tuple', + }, + ], + name: 'claimAndMintNextAndAddAuthMethods', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + ], + internalType: 'struct LibPKPNFTStorage.ClaimMaterial', + name: 'claimMaterial', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes[]', + name: 'permittedIpfsCIDs', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedIpfsCIDScopes', + type: 'uint256[][]', + }, + { + internalType: 'address[]', + name: 'permittedAddresses', + type: 'address[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAddressScopes', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + internalType: 'struct PKPHelper.AuthMethodData', + name: 'authMethodData', + type: 'tuple', + }, + ], + name: 'claimAndMintNextAndAddAuthMethodsWithTypes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'contractResolver', + outputs: [ + { + internalType: 'contract ContractResolver', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'env', + outputs: [ + { + internalType: 'enum ContractResolver.Env', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getDomainWalletRegistry', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPKPNftMetdataAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpPermissionsAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + ], + name: 'getRoleAdmin', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'grantRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'hasRole', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + name: 'mintNextAndAddAuthMethods', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes[]', + name: 'permittedIpfsCIDs', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedIpfsCIDScopes', + type: 'uint256[][]', + }, + { + internalType: 'address[]', + name: 'permittedAddresses', + type: 'address[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAddressScopes', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + name: 'mintNextAndAddAuthMethodsWithTypes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'string[]', + name: 'nftMetadata', + type: 'string[]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + name: 'mintNextAndAddDomainWalletMetadata', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + name: 'onERC721Received', + outputs: [ + { + internalType: 'bytes4', + name: '', + type: 'bytes4', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'removePkpMetadata', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'renounceRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'revokeRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'string[]', + name: 'nftMetadata', + type: 'string[]', + }, + ], + name: 'setPkpMetadata', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PKPPermissions', + contracts: [ + { + network: 'datil-dev', + address_hash: '0xf64638F1eb3b064f5443F7c9e2Dc050ed535D891', + inserted_at: '2024-11-27T01:57:28Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + indexed: false, + internalType: 'bytes', + name: 'userPubkey', + type: 'bytes', + }, + ], + name: 'PermittedAuthMethodAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'PermittedAuthMethodRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + indexed: false, + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'PermittedAuthMethodScopeAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + indexed: false, + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'PermittedAuthMethodScopeRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: true, + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'root', + type: 'bytes32', + }, + ], + name: 'RootHashUpdated', + type: 'event', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + { + internalType: 'uint256[]', + name: 'scopes', + type: 'uint256[]', + }, + ], + name: 'addPermittedAction', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'user', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'scopes', + type: 'uint256[]', + }, + ], + name: 'addPermittedAddress', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'userPubkey', + type: 'bytes', + }, + ], + internalType: 'struct LibPKPPermissionsStorage.AuthMethod', + name: 'authMethod', + type: 'tuple', + }, + { + internalType: 'uint256[]', + name: 'scopes', + type: 'uint256[]', + }, + ], + name: 'addPermittedAuthMethod', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'addPermittedAuthMethodScope', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypesToAdd', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIdsToAdd', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeysToAdd', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopesToAdd', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypesToRemove', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIdsToRemove', + type: 'bytes[]', + }, + ], + name: 'batchAddRemoveAuthMethods', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'getAuthMethodId', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getEthAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPermittedActions', + outputs: [ + { + internalType: 'bytes[]', + name: '', + type: 'bytes[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPermittedAddresses', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'maxScopeId', + type: 'uint256', + }, + ], + name: 'getPermittedAuthMethodScopes', + outputs: [ + { + internalType: 'bool[]', + name: '', + type: 'bool[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPermittedAuthMethods', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'userPubkey', + type: 'bytes', + }, + ], + internalType: 'struct LibPKPPermissionsStorage.AuthMethod[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getRouterAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'getTokenIdsForAuthMethod', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'getUserPubkeyForAuthMethod', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + ], + name: 'isPermittedAction', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'isPermittedAddress', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'isPermittedAuthMethod', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'isPermittedAuthMethodScopePresent', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + ], + name: 'removePermittedAction', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'removePermittedAddress', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'removePermittedAuthMethod', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'removePermittedAuthMethodScope', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'root', + type: 'bytes32', + }, + ], + name: 'setRootHash', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + internalType: 'bytes32[]', + name: 'proof', + type: 'bytes32[]', + }, + { + internalType: 'bytes32', + name: 'leaf', + type: 'bytes32', + }, + ], + name: 'verifyState', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + internalType: 'bytes32[]', + name: 'proof', + type: 'bytes32[]', + }, + { + internalType: 'bool[]', + name: 'proofFlags', + type: 'bool[]', + }, + { + internalType: 'bytes32[]', + name: 'leaves', + type: 'bytes32[]', + }, + ], + name: 'verifyStates', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PKPNFTMetadata', + contracts: [ + { + network: 'datil-dev', + address_hash: '0x784A743bBBB5f5225CeC7979A3304179be17D66d', + inserted_at: '2024-11-27T01:57:28Z', + ABI: [ + { + inputs: [ + { + internalType: 'address', + name: '_resolver', + type: 'address', + }, + { + internalType: 'enum ContractResolver.Env', + name: '_env', + type: 'uint8', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'buffer', + type: 'bytes', + }, + ], + name: 'bytesToHex', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [], + name: 'contractResolver', + outputs: [ + { + internalType: 'contract ContractResolver', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'env', + outputs: [ + { + internalType: 'enum ContractResolver.Env', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'removeProfileForPkp', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'removeUrlForPKP', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'string', + name: 'imgUrl', + type: 'string', + }, + ], + name: 'setProfileForPKP', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'string', + name: 'url', + type: 'string', + }, + ], + name: 'setUrlForPKP', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'pubKey', + type: 'bytes', + }, + { + internalType: 'address', + name: 'ethAddress', + type: 'address', + }, + ], + name: 'tokenURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'Allowlist', + contracts: [ + { + network: 'datil-dev', + address_hash: '0xC60051658E346554C1F572ef3Aa4bD8596E026b6', + inserted_at: '2024-11-27T01:57:28Z', + ABI: [ + { + inputs: [], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'ItemAllowed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'ItemNotAllowed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'addAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'allowAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + name: 'allowedItems', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'isAllowed', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'removeAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bool', + name: '_allowAll', + type: 'bool', + }, + ], + name: 'setAllowAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'setAllowed', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'setNotAllowed', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PaymentDelegation', + contracts: [ + { + network: 'datil-dev', + address_hash: '0xbB23168855efe735cE9e6fD6877bAf13E02c410f', + inserted_at: '2024-11-27T01:57:28Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'payer', + type: 'address', + }, + { + components: [ + { + internalType: 'uint256', + name: 'requestsPerPeriod', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'periodSeconds', + type: 'uint256', + }, + ], + indexed: false, + internalType: + 'struct LibPaymentDelegationStorage.Restriction', + name: 'restriction', + type: 'tuple', + }, + ], + name: 'RestrictionSet', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'delegatePayments', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'users', + type: 'address[]', + }, + ], + name: 'delegatePaymentsBatch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'getPayers', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'users', + type: 'address[]', + }, + ], + name: 'getPayersAndRestrictions', + outputs: [ + { + internalType: 'address[][]', + name: '', + type: 'address[][]', + }, + { + components: [ + { + internalType: 'uint256', + name: 'requestsPerPeriod', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'periodSeconds', + type: 'uint256', + }, + ], + internalType: + 'struct LibPaymentDelegationStorage.Restriction[][]', + name: '', + type: 'tuple[][]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'payer', + type: 'address', + }, + ], + name: 'getRestriction', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'requestsPerPeriod', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'periodSeconds', + type: 'uint256', + }, + ], + internalType: + 'struct LibPaymentDelegationStorage.Restriction', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'payer', + type: 'address', + }, + ], + name: 'getUsers', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'setDefaultRestriction', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'requestsPerPeriod', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'periodSeconds', + type: 'uint256', + }, + ], + internalType: + 'struct LibPaymentDelegationStorage.Restriction', + name: 'r', + type: 'tuple', + }, + ], + name: 'setRestriction', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'undelegatePayments', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'users', + type: 'address[]', + }, + ], + name: 'undelegatePaymentsBatch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + ], +}; + +// node_modules/@lit-protocol/contracts/dist/prod/datil-test.js +init_shim(); +var datilTest = { + config: { + chainId: '175188', + rpcUrl: 'https://yellowstone-rpc.litprotocol.com', + chainName: 'yellowstone', + litNodeDomainName: '127.0.0.1', + litNodePort: 7470, + rocketPort: 7470, + }, + data: [ + { + name: 'StakingBalances', + contracts: [ + { + network: 'datil-test', + address_hash: '0xCa3c64e7D8cA743aeD2B2d20DCA3233f400710E2', + inserted_at: '2024-11-02T02:50:47Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'ActiveValidatorsCannotLeave', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'AliasNotOwnedBySender', + type: 'error', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'CannotRemoveAliasOfActiveValidator', + type: 'error', + }, + { + inputs: [], + name: 'CannotStakeZero', + type: 'error', + }, + { + inputs: [], + name: 'CannotWithdrawZero', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'aliasCount', + type: 'uint256', + }, + ], + name: 'MaxAliasCountReached', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'OnlyStakingContract', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountStaked', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minimumStake', + type: 'uint256', + }, + ], + name: 'StakeMustBeGreaterThanMinimumStake', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountStaked', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maximumStake', + type: 'uint256', + }, + ], + name: 'StakeMustBeLessThanMaximumStake', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'StakerNotPermitted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'yourBalance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'requestedWithdrawlAmount', + type: 'uint256', + }, + ], + name: 'TryingToWithdrawMoreThanStaked', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'AliasAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'AliasRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newMaxAliasCount', + type: 'uint256', + }, + ], + name: 'MaxAliasCountSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newMaximumStake', + type: 'uint256', + }, + ], + name: 'MaximumStakeSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newMinimumStake', + type: 'uint256', + }, + ], + name: 'MinimumStakeSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'PermittedStakerAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'PermittedStakerRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'bool', + name: 'permittedStakersOn', + type: 'bool', + }, + ], + name: 'PermittedStakersOnChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ResolverContractAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + ], + name: 'RewardPaid', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Staked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newTokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + ], + name: 'TokenRewardPerTokenPerEpochSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'ValidatorNotRewardedBecauseAlias', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'ValidatorRewarded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'ValidatorTokensPenalized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Withdrawn', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'addAlias', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'addPermittedStaker', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'stakers', + type: 'address[]', + }, + ], + name: 'addPermittedStakers', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'checkStakingAmounts', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'contractResolver', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'getReward', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getStakingAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getTokenAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'isPermittedStaker', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maximumStake', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'minimumStake', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'penalizeTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'permittedStakersOn', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'aliasAccount', + type: 'address', + }, + ], + name: 'removeAlias', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'removePermittedStaker', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + internalType: 'uint256', + name: 'balance', + type: 'uint256', + }, + ], + name: 'restakePenaltyTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'rewardOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'rewardValidator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMaxAliasCount', + type: 'uint256', + }, + ], + name: 'setMaxAliasCount', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMaximumStake', + type: 'uint256', + }, + ], + name: 'setMaximumStake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMinimumStake', + type: 'uint256', + }, + ], + name: 'setMinimumStake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bool', + name: 'permitted', + type: 'bool', + }, + ], + name: 'setPermittedStakersOn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'stake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'totalStaked', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'balance', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'transferPenaltyTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'balance', + type: 'uint256', + }, + ], + name: 'withdrawPenaltyTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'Staking', + contracts: [ + { + network: 'datil-test', + address_hash: '0xdec37933239846834b3BfD408913Ed3dbEf6588F', + inserted_at: '2024-11-02T02:50:47Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'ActiveValidatorsCannotLeave', + type: 'error', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + inputs: [], + name: 'CannotKickBelowCurrentValidatorThreshold', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingAddress', + type: 'address', + }, + ], + name: 'CannotRejoinUntilNextEpochBecauseKicked', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'CannotReuseCommsKeys', + type: 'error', + }, + { + inputs: [], + name: 'CannotStakeZero', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'CannotVoteTwice', + type: 'error', + }, + { + inputs: [], + name: 'CannotWithdrawZero', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + ], + name: 'CouldNotMapNodeAddressToStakerAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInActiveOrUnlockedOrPausedState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInActiveOrUnlockedState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInNextValidatorSetLockedOrReadyForNextEpochOrRestoreState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInNextValidatorSetLockedOrReadyForNextEpochState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInNextValidatorSetLockedState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'state', + type: 'uint8', + }, + ], + name: 'MustBeInReadyForNextEpochState', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'MustBeValidatorInNextEpochToKick', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentTimestamp', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'epochEndTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeout', + type: 'uint256', + }, + ], + name: 'NotEnoughTimeElapsedForTimeoutSinceLastEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentTimestamp', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'epochEndTime', + type: 'uint256', + }, + ], + name: 'NotEnoughTimeElapsedSinceLastEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'validatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCount', + type: 'uint256', + }, + ], + name: 'NotEnoughValidatorsInNextEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentReadyValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'nextReadyValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCountToBeReady', + type: 'uint256', + }, + ], + name: 'NotEnoughValidatorsReadyForNextEpoch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'currentEpochNumber', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receivedEpochNumber', + type: 'uint256', + }, + ], + name: 'SignaledReadyForWrongEpochNumber', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'StakerNotPermitted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'yourBalance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'requestedWithdrawlAmount', + type: 'uint256', + }, + ], + name: 'TryingToWithdrawMoreThanStaked', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'validator', + type: 'address', + }, + { + internalType: 'address[]', + name: 'validatorsInNextEpoch', + type: 'address[]', + }, + ], + name: 'ValidatorIsNotInNextEpoch', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'tolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'intervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyPercent', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct LibStakingStorage.ComplaintConfig', + name: 'config', + type: 'tuple', + }, + ], + name: 'ComplaintConfigSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newTokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'newKeyTypes', + type: 'uint256[]', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMinimumValidatorCount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMaxConcurrentRequests', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMaxTripleCount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMinTripleCount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newPeerCheckingIntervalSecs', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newMaxTripleConcurrency', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bool', + name: 'newRpcHealthcheckEnabled', + type: 'bool', + }, + ], + name: 'ConfigSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newEpochEndTime', + type: 'uint256', + }, + ], + name: 'EpochEndTimeSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newEpochLength', + type: 'uint256', + }, + ], + name: 'EpochLengthSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newEpochTimeout', + type: 'uint256', + }, + ], + name: 'EpochTimeoutSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newKickPenaltyPercent', + type: 'uint256', + }, + ], + name: 'KickPenaltyPercentSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'epochNumber', + type: 'uint256', + }, + ], + name: 'ReadyForNextEpoch', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'token', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Recovered', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'RequestToJoin', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'RequestToLeave', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverContractAddress', + type: 'address', + }, + ], + name: 'ResolverContractAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newDuration', + type: 'uint256', + }, + ], + name: 'RewardsDurationUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newStakingTokenAddress', + type: 'address', + }, + ], + name: 'StakingTokenSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'enum LibStakingStorage.States', + name: 'newState', + type: 'uint8', + }, + ], + name: 'StateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'staker', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountBurned', + type: 'uint256', + }, + ], + name: 'ValidatorKickedFromNextEpoch', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'ValidatorRejoinedNextEpoch', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'reporter', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'VotedToKickValidatorInNextEpoch', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + ], + name: 'adminKickValidatorInNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'staker', + type: 'address', + }, + ], + name: 'adminRejoinValidator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'adminResetEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amountToPenalize', + type: 'uint256', + }, + ], + name: 'adminSlashValidator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'advanceEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'exit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getReward', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'kickValidatorInNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'lockValidatorsForNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'requestToJoin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'requestToLeave', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'requestToLeaveAsNode', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'tolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'intervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyPercent', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.ComplaintConfig', + name: 'config', + type: 'tuple', + }, + ], + name: 'setComplaintConfig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'tokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'DEPRECATED_complaintTolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'DEPRECATED_complaintIntervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'keyTypes', + type: 'uint256[]', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxConcurrentRequests', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'peerCheckingIntervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleConcurrency', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'rpcHealthcheckEnabled', + type: 'bool', + }, + ], + internalType: 'struct LibStakingStorage.Config', + name: 'newConfig', + type: 'tuple', + }, + ], + name: 'setConfig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newEpochEndTime', + type: 'uint256', + }, + ], + name: 'setEpochEndTime', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newEpochLength', + type: 'uint256', + }, + ], + name: 'setEpochLength', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: 'newState', + type: 'uint8', + }, + ], + name: 'setEpochState', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newEpochTimeout', + type: 'uint256', + }, + ], + name: 'setEpochTimeout', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'setIpPortNodeAddressAndCommunicationPubKeys', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'newKickPenaltyPercent', + type: 'uint256', + }, + ], + name: 'setKickPenaltyPercent', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'epochNumber', + type: 'uint256', + }, + ], + name: 'signalReadyForNextEpoch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'stake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + name: 'stakeAndJoin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'VersionRequirementsUpdated', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'checkVersion', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getMaxVersion', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getMaxVersionString', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getMinVersion', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getMinVersionString', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'setMaxVersion', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'major', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minor', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'patch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Version', + name: 'version', + type: 'tuple', + }, + ], + name: 'setMinVersion', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + ], + name: 'complaintConfig', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'tolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'intervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'kickPenaltyPercent', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.ComplaintConfig', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'config', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'tokenRewardPerTokenPerEpoch', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'DEPRECATED_complaintTolerance', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'DEPRECATED_complaintIntervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'keyTypes', + type: 'uint256[]', + }, + { + internalType: 'uint256', + name: 'minimumValidatorCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxConcurrentRequests', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minTripleCount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'peerCheckingIntervalSecs', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTripleConcurrency', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'rpcHealthcheckEnabled', + type: 'bool', + }, + ], + internalType: 'struct LibStakingStorage.Config', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'contractResolver', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'countOfCurrentValidatorsReadyForNextEpoch', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'countOfNextValidatorsReadyForNextEpoch', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'currentValidatorCountForConsensus', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'epoch', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'epochLength', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'number', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'endTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'retries', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeout', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Epoch', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getActiveUnkickedValidatorStructs', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getActiveUnkickedValidatorStructsAndCounts', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'epochLength', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'number', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'endTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'retries', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeout', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Epoch', + name: '', + type: 'tuple', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getActiveUnkickedValidators', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getKeyTypes', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getKickedValidators', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'addresses', + type: 'address[]', + }, + ], + name: 'getNodeStakerAddressMappings', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + internalType: 'struct LibStakingStorage.AddressMapping[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getStakingBalancesAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getTokenAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getValidatorsInCurrentEpoch', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getValidatorsInCurrentEpochLength', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getValidatorsInNextEpoch', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'addresses', + type: 'address[]', + }, + ], + name: 'getValidatorsStructs', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getValidatorsStructsInCurrentEpoch', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getValidatorsStructsInNextEpoch', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'epochNumber', + type: 'uint256', + }, + { + internalType: 'address', + name: 'validatorStakerAddress', + type: 'address', + }, + { + internalType: 'address', + name: 'voterStakerAddress', + type: 'address', + }, + ], + name: 'getVotingStatusToKickValidator', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'isActiveValidator', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'isActiveValidatorByNodeAddress', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'isReadyForNextEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'reason', + type: 'uint256', + }, + ], + name: 'kickPenaltyPercentByReason', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'nextValidatorCountForConsensus', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + ], + name: 'nodeAddressToStakerAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'readyForNextEpoch', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'shouldKickValidator', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'state', + outputs: [ + { + internalType: 'enum LibStakingStorage.States', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakerAddress', + type: 'address', + }, + ], + name: 'validators', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'CloneNet', + contracts: [ + { + network: 'datil-test', + address_hash: '0x1f4233b6C5b84978c458FA66412E4ae6d0561104', + inserted_at: '2024-11-02T02:50:47Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + ], + name: 'adminAddActiveStakingContract', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + ], + name: 'adminRemoveActiveStakingContract', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getActiveStakingContracts', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getAllActiveUnkickedValidatorStructsAndCounts', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + { + components: [ + { + components: [ + { + internalType: 'uint256', + name: 'epochLength', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'number', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'endTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'retries', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timeout', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'startTime', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Epoch', + name: 'epoch', + type: 'tuple', + }, + { + internalType: 'uint256', + name: 'currentValidatorCountForConsensus', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint32', + name: 'ip', + type: 'uint32', + }, + { + internalType: 'uint128', + name: 'ipv6', + type: 'uint128', + }, + { + internalType: 'uint32', + name: 'port', + type: 'uint32', + }, + { + internalType: 'address', + name: 'nodeAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'reward', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'senderPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'receiverPubKey', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastActiveEpoch', + type: 'uint256', + }, + ], + internalType: 'struct LibStakingStorage.Validator[]', + name: 'activeUnkickedValidators', + type: 'tuple[]', + }, + ], + internalType: + 'struct LibStakingStorage.StakingAggregateDetails', + name: 'details', + type: 'tuple', + }, + ], + internalType: + 'struct LibStakingStorage.KeyedStakingAggregateDetails[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'numActiveStakingContracts', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'Multisender', + contracts: [ + { + network: 'datil-test', + address_hash: '0x8281f3A62f7de320B3a634e6814BeC36a1AA92bd', + inserted_at: '2024-11-02T02:50:47Z', + ABI: [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: '_recipients', + type: 'address[]', + }, + ], + name: 'sendEth', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: '_recipients', + type: 'address[]', + }, + { + internalType: 'address', + name: 'tokenContract', + type: 'address', + }, + ], + name: 'sendTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'tokenContract', + type: 'address', + }, + ], + name: 'withdrawTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'LITToken', + contracts: [ + { + network: 'datil-test', + address_hash: '0xFA1208f5275a01Be1b4A6F6764d388FDcF5Bf85e', + inserted_at: '2024-11-02T02:50:47Z', + ABI: [ + { + inputs: [ + { + internalType: 'uint256', + name: 'cap', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [], + name: 'InvalidShortString', + type: 'error', + }, + { + inputs: [ + { + internalType: 'string', + name: 'str', + type: 'string', + }, + ], + name: 'StringTooLong', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'delegator', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'fromDelegate', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'toDelegate', + type: 'address', + }, + ], + name: 'DelegateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'delegate', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'previousBalance', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newBalance', + type: 'uint256', + }, + ], + name: 'DelegateVotesChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [], + name: 'EIP712DomainChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'Paused', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'previousAdminRole', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'newAdminRole', + type: 'bytes32', + }, + ], + name: 'RoleAdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleGranted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleRevoked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'Unpaused', + type: 'event', + }, + { + inputs: [], + name: 'ADMIN_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'CLOCK_MODE', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DEFAULT_ADMIN_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DOMAIN_SEPARATOR', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'MINTER_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PAUSER_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'burnFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'cap', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint32', + name: 'pos', + type: 'uint32', + }, + ], + name: 'checkpoints', + outputs: [ + { + components: [ + { + internalType: 'uint32', + name: 'fromBlock', + type: 'uint32', + }, + { + internalType: 'uint224', + name: 'votes', + type: 'uint224', + }, + ], + internalType: 'struct ERC20Votes.Checkpoint', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'clock', + outputs: [ + { + internalType: 'uint48', + name: '', + type: 'uint48', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'subtractedValue', + type: 'uint256', + }, + ], + name: 'decreaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + ], + name: 'delegate', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + { + internalType: 'uint256', + name: 'nonce', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiry', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'delegateBySig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'delegates', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'eip712Domain', + outputs: [ + { + internalType: 'bytes1', + name: 'fields', + type: 'bytes1', + }, + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'version', + type: 'string', + }, + { + internalType: 'uint256', + name: 'chainId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'verifyingContract', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'salt', + type: 'bytes32', + }, + { + internalType: 'uint256[]', + name: 'extensions', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'timepoint', + type: 'uint256', + }, + ], + name: 'getPastTotalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'timepoint', + type: 'uint256', + }, + ], + name: 'getPastVotes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + ], + name: 'getRoleAdmin', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'getVotes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'grantRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'hasRole', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'addedValue', + type: 'uint256', + }, + ], + name: 'increaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + ], + name: 'mint', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'nonces', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'numCheckpoints', + outputs: [ + { + internalType: 'uint32', + name: '', + type: 'uint32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'pause', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'paused', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'permit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'renounceRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'revokeRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'unpause', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PubkeyRouter', + contracts: [ + { + network: 'datil-test', + address_hash: '0x65C3d057aef28175AfaC61a74cc6b27E88405583', + inserted_at: '2024-11-02T02:50:47Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + indexed: false, + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'PubkeyRoutingDataSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + indexed: false, + internalType: 'struct IPubkeyRouter.RootKey', + name: 'rootKey', + type: 'tuple', + }, + ], + name: 'RootKeySet', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + ], + name: 'adminResetRootKeys', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + { + internalType: 'bytes', + name: 'signedMessage', + type: 'bytes', + }, + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + ], + name: 'checkNodeSignatures', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + ], + name: 'deriveEthAddressFromPubkey', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'ethAddress', + type: 'address', + }, + ], + name: 'ethAddressToPkpId', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'getDerivedPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getEthAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + ], + name: 'getRootKeys', + outputs: [ + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + internalType: 'struct IPubkeyRouter.RootKey[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getRoutingData', + outputs: [ + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + internalType: + 'struct LibPubkeyRouterStorage.PubkeyRoutingData', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'isRouted', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'pubkeys', + outputs: [ + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + internalType: + 'struct LibPubkeyRouterStorage.PubkeyRoutingData', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'setRoutingData', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'address', + name: 'stakingContract', + type: 'address', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + ], + name: 'setRoutingDataAsAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'stakingContractAddress', + type: 'address', + }, + { + components: [ + { + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + internalType: 'struct IPubkeyRouter.RootKey[]', + name: 'newRootKeys', + type: 'tuple[]', + }, + ], + name: 'voteForRootKeys', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PKPNFT', + contracts: [ + { + network: 'datil-test', + address_hash: '0x6a0f439f064B7167A8Ea6B22AcC07ae5360ee0d1', + inserted_at: '2024-11-02T02:50:47Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'approved', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'ApprovalForAll', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newFreeMintSigner', + type: 'address', + }, + ], + name: 'FreeMintSignerSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint8', + name: 'version', + type: 'uint8', + }, + ], + name: 'Initialized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newMintCost', + type: 'uint256', + }, + ], + name: 'MintCostSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'pubkey', + type: 'bytes', + }, + ], + name: 'PKPMinted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Withdrew', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + ], + name: 'claimAndMint', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'exists', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'freeMintSigner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getApproved', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getEthAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getNextDerivedKeyId', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftMetadataAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpPermissionsAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getRouterAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getStakingAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + ], + name: 'isApprovedForAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'mintCost', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + ], + name: 'mintGrantAndBurnNext', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + ], + name: 'mintNext', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'ownerOf', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'hash', + type: 'bytes32', + }, + ], + name: 'prefixed', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'redeemedFreeMintIds', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'setApprovalForAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newFreeMintSigner', + type: 'address', + }, + ], + name: 'setFreeMintSigner', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMintCost', + type: 'uint256', + }, + ], + name: 'setMintCost', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenOfOwnerByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'tokenURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'RateLimitNFT', + contracts: [ + { + network: 'datil-test', + address_hash: '0xa17f11B7f828EEc97926E56D98D5AB63A0231b77', + inserted_at: '2024-11-02T02:50:47Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newAdditionalRequestsPerKilosecondCost', + type: 'uint256', + }, + ], + name: 'AdditionalRequestsPerKilosecondCostSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'approved', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'ApprovalForAll', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newFreeMintSigner', + type: 'address', + }, + ], + name: 'FreeMintSignerSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newFreeRequestsPerRateLimitWindow', + type: 'uint256', + }, + ], + name: 'FreeRequestsPerRateLimitWindowSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint8', + name: 'version', + type: 'uint8', + }, + ], + name: 'Initialized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newRLIHolderRateLimitWindowSeconds', + type: 'uint256', + }, + ], + name: 'RLIHolderRateLimitWindowSecondsSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newRateLimitWindowSeconds', + type: 'uint256', + }, + ], + name: 'RateLimitWindowSecondsSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Withdrew', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'requestsPerKilosecond', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'msgHash', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'sVal', + type: 'bytes32', + }, + ], + name: 'freeMint', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getApproved', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + ], + name: 'isApprovedForAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + name: 'mint', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'ownerOf', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newAdditionalRequestsPerKilosecondCost', + type: 'uint256', + }, + ], + name: 'setAdditionalRequestsPerKilosecondCost', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'setApprovalForAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newFreeMintSigner', + type: 'address', + }, + ], + name: 'setFreeMintSigner', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newFreeRequestsPerRateLimitWindow', + type: 'uint256', + }, + ], + name: 'setFreeRequestsPerRateLimitWindow', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMaxExpirationSeconds', + type: 'uint256', + }, + ], + name: 'setMaxExpirationSeconds', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newMaxRequestsPerKilosecond', + type: 'uint256', + }, + ], + name: 'setMaxRequestsPerKilosecond', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newRLIHolderRateLimitWindowSeconds', + type: 'uint256', + }, + ], + name: 'setRLIHolderRateLimitWindowSeconds', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'newRateLimitWindowSeconds', + type: 'uint256', + }, + ], + name: 'setRateLimitWindowSeconds', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenOfOwnerByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'tokenURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'RLIHolderRateLimitWindowSeconds', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'additionalRequestsPerKilosecondCost', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'requestsPerKilosecond', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + name: 'calculateCost', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'payingAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + name: 'calculateRequestsPerKilosecond', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'capacity', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'requestsPerKilosecond', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + internalType: 'struct LibRateLimitNFTStorage.RateLimit', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'requestedRequestsPerKilosecond', + type: 'uint256', + }, + ], + name: 'checkBelowMaxRequestsPerKilosecond', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'currentSoldRequestsPerKilosecond', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'defaultRateLimitWindowSeconds', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'requestsPerKilosecond', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'msgHash', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'sVal', + type: 'bytes32', + }, + ], + name: 'freeMintSigTest', + outputs: [], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'freeMintSigner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'freeRequestsPerRateLimitWindow', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'isExpired', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxExpirationSeconds', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxRequestsPerKilosecond', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'hash', + type: 'bytes32', + }, + ], + name: 'prefixed', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'msgHash', + type: 'bytes32', + }, + ], + name: 'redeemedFreeMints', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'tokenIdCounter', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'tokenSVG', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256', + }, + ], + name: 'totalSoldRequestsPerKilosecondByExpirationTime', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PKPHelper', + contracts: [ + { + network: 'datil-test', + address_hash: '0x341E5273E2E2ea3c4aDa4101F008b1261E58510D', + inserted_at: '2024-11-02T02:50:47Z', + ABI: [ + { + inputs: [ + { + internalType: 'address', + name: '_resolver', + type: 'address', + }, + { + internalType: 'enum ContractResolver.Env', + name: '_env', + type: 'uint8', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'previousAdminRole', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'newAdminRole', + type: 'bytes32', + }, + ], + name: 'RoleAdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleGranted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleRevoked', + type: 'event', + }, + { + inputs: [], + name: 'DEFAULT_ADMIN_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + ], + internalType: 'struct LibPKPNFTStorage.ClaimMaterial', + name: 'claimMaterial', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes[]', + name: 'permittedIpfsCIDs', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedIpfsCIDScopes', + type: 'uint256[][]', + }, + { + internalType: 'address[]', + name: 'permittedAddresses', + type: 'address[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAddressScopes', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + internalType: 'struct PKPHelper.AuthMethodData', + name: 'authMethodData', + type: 'tuple', + }, + ], + name: 'claimAndMintNextAndAddAuthMethods', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'derivedKeyId', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + ], + internalType: 'struct IPubkeyRouter.Signature[]', + name: 'signatures', + type: 'tuple[]', + }, + ], + internalType: 'struct LibPKPNFTStorage.ClaimMaterial', + name: 'claimMaterial', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes[]', + name: 'permittedIpfsCIDs', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedIpfsCIDScopes', + type: 'uint256[][]', + }, + { + internalType: 'address[]', + name: 'permittedAddresses', + type: 'address[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAddressScopes', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + internalType: 'struct PKPHelper.AuthMethodData', + name: 'authMethodData', + type: 'tuple', + }, + ], + name: 'claimAndMintNextAndAddAuthMethodsWithTypes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'contractResolver', + outputs: [ + { + internalType: 'contract ContractResolver', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'env', + outputs: [ + { + internalType: 'enum ContractResolver.Env', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getDomainWalletRegistry', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPKPNftMetdataAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpPermissionsAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + ], + name: 'getRoleAdmin', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'grantRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'hasRole', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + name: 'mintNextAndAddAuthMethods', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'bytes[]', + name: 'permittedIpfsCIDs', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedIpfsCIDScopes', + type: 'uint256[][]', + }, + { + internalType: 'address[]', + name: 'permittedAddresses', + type: 'address[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAddressScopes', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + name: 'mintNextAndAddAuthMethodsWithTypes', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'keyType', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypes', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIds', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeys', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopes', + type: 'uint256[][]', + }, + { + internalType: 'string[]', + name: 'nftMetadata', + type: 'string[]', + }, + { + internalType: 'bool', + name: 'addPkpEthAddressAsPermittedAddress', + type: 'bool', + }, + { + internalType: 'bool', + name: 'sendPkpToItself', + type: 'bool', + }, + ], + name: 'mintNextAndAddDomainWalletMetadata', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + name: 'onERC721Received', + outputs: [ + { + internalType: 'bytes4', + name: '', + type: 'bytes4', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'removePkpMetadata', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'renounceRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'revokeRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'string[]', + name: 'nftMetadata', + type: 'string[]', + }, + ], + name: 'setPkpMetadata', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PKPPermissions', + contracts: [ + { + network: 'datil-test', + address_hash: '0x60C1ddC8b9e38F730F0e7B70A2F84C1A98A69167', + inserted_at: '2024-11-02T02:50:47Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'CallerNotOwner', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'ContractResolverAddressSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + indexed: false, + internalType: 'bytes', + name: 'userPubkey', + type: 'bytes', + }, + ], + name: 'PermittedAuthMethodAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'PermittedAuthMethodRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + indexed: false, + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'PermittedAuthMethodScopeAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + indexed: false, + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'PermittedAuthMethodScopeRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: true, + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'root', + type: 'bytes32', + }, + ], + name: 'RootHashUpdated', + type: 'event', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + { + internalType: 'uint256[]', + name: 'scopes', + type: 'uint256[]', + }, + ], + name: 'addPermittedAction', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'user', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'scopes', + type: 'uint256[]', + }, + ], + name: 'addPermittedAddress', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + components: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'userPubkey', + type: 'bytes', + }, + ], + internalType: 'struct LibPKPPermissionsStorage.AuthMethod', + name: 'authMethod', + type: 'tuple', + }, + { + internalType: 'uint256[]', + name: 'scopes', + type: 'uint256[]', + }, + ], + name: 'addPermittedAuthMethod', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'addPermittedAuthMethodScope', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypesToAdd', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIdsToAdd', + type: 'bytes[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodPubkeysToAdd', + type: 'bytes[]', + }, + { + internalType: 'uint256[][]', + name: 'permittedAuthMethodScopesToAdd', + type: 'uint256[][]', + }, + { + internalType: 'uint256[]', + name: 'permittedAuthMethodTypesToRemove', + type: 'uint256[]', + }, + { + internalType: 'bytes[]', + name: 'permittedAuthMethodIdsToRemove', + type: 'bytes[]', + }, + ], + name: 'batchAddRemoveAuthMethods', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'getAuthMethodId', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getEthAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPermittedActions', + outputs: [ + { + internalType: 'bytes[]', + name: '', + type: 'bytes[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPermittedAddresses', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'maxScopeId', + type: 'uint256', + }, + ], + name: 'getPermittedAuthMethodScopes', + outputs: [ + { + internalType: 'bool[]', + name: '', + type: 'bool[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPermittedAuthMethods', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'userPubkey', + type: 'bytes', + }, + ], + internalType: 'struct LibPKPPermissionsStorage.AuthMethod[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPkpNftAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getPubkey', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getRouterAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'getTokenIdsForAuthMethod', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'getUserPubkeyForAuthMethod', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + ], + name: 'isPermittedAction', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'isPermittedAddress', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'isPermittedAuthMethod', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'isPermittedAuthMethodScopePresent', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'ipfsCID', + type: 'bytes', + }, + ], + name: 'removePermittedAction', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'removePermittedAddress', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + ], + name: 'removePermittedAuthMethod', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'authMethodType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'id', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'scopeId', + type: 'uint256', + }, + ], + name: 'removePermittedAuthMethodScope', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newResolverAddress', + type: 'address', + }, + ], + name: 'setContractResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'root', + type: 'bytes32', + }, + ], + name: 'setRootHash', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + internalType: 'bytes32[]', + name: 'proof', + type: 'bytes32[]', + }, + { + internalType: 'bytes32', + name: 'leaf', + type: 'bytes32', + }, + ], + name: 'verifyState', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'group', + type: 'uint256', + }, + { + internalType: 'bytes32[]', + name: 'proof', + type: 'bytes32[]', + }, + { + internalType: 'bool[]', + name: 'proofFlags', + type: 'bool[]', + }, + { + internalType: 'bytes32[]', + name: 'leaves', + type: 'bytes32[]', + }, + ], + name: 'verifyStates', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PKPNFTMetadata', + contracts: [ + { + network: 'datil-test', + address_hash: '0xaC1d01692EBA0E457134Eb7EB8bb96ee9D91FcdD', + inserted_at: '2024-11-02T02:50:47Z', + ABI: [ + { + inputs: [ + { + internalType: 'address', + name: '_resolver', + type: 'address', + }, + { + internalType: 'enum ContractResolver.Env', + name: '_env', + type: 'uint8', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'buffer', + type: 'bytes', + }, + ], + name: 'bytesToHex', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [], + name: 'contractResolver', + outputs: [ + { + internalType: 'contract ContractResolver', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'env', + outputs: [ + { + internalType: 'enum ContractResolver.Env', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'removeProfileForPkp', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'removeUrlForPKP', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'string', + name: 'imgUrl', + type: 'string', + }, + ], + name: 'setProfileForPKP', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'string', + name: 'url', + type: 'string', + }, + ], + name: 'setUrlForPKP', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'pubKey', + type: 'bytes', + }, + { + internalType: 'address', + name: 'ethAddress', + type: 'address', + }, + ], + name: 'tokenURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'Allowlist', + contracts: [ + { + network: 'datil-test', + address_hash: '0x5DD7a0FD581aB11a5720bE7E388e63346bC266fe', + inserted_at: '2024-11-02T02:50:47Z', + ABI: [ + { + inputs: [], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'ItemAllowed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'ItemNotAllowed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'addAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'allowAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + name: 'allowedItems', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'isAllowed', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'removeAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bool', + name: '_allowAll', + type: 'bool', + }, + ], + name: 'setAllowAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'setAllowed', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + ], + name: 'setNotAllowed', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + { + name: 'PaymentDelegation', + contracts: [ + { + network: 'datil-test', + address_hash: '0xd7188e0348F1dA8c9b3d6e614844cbA22329B99E', + inserted_at: '2024-11-02T02:50:47Z', + ABI: [ + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotAddFunctionToDiamondThatAlreadyExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotAddSelectorsToZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveFunctionThatDoesNotExist', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotRemoveImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionThatDoesNotExists', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceFunctionWithTheSameFunctionFromTheSameFacet', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4[]', + name: '_selectors', + type: 'bytes4[]', + }, + ], + name: 'CannotReplaceFunctionsFromFacetWithZeroAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_selector', + type: 'bytes4', + }, + ], + name: 'CannotReplaceImmutableFunction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '_action', + type: 'uint8', + }, + ], + name: 'IncorrectFacetCutAction', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_initializationContractAddress', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'InitializationFunctionReverted', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_contractAddress', + type: 'address', + }, + { + internalType: 'string', + name: '_message', + type: 'string', + }, + ], + name: 'NoBytecodeAtAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'NoSelectorsProvidedForFacetForCut', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'address', + name: '_contractOwner', + type: 'address', + }, + ], + name: 'NotContractOwner', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facetAddress', + type: 'address', + }, + ], + name: 'RemoveFacetAddressMustBeZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + indexed: false, + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'address', + name: '_init', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'DiamondCut', + type: 'event', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'enum IDiamond.FacetCutAction', + name: 'action', + type: 'uint8', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamond.FacetCut[]', + name: '_diamondCut', + type: 'tuple[]', + }, + { + internalType: 'address', + name: '_init', + type: 'address', + }, + { + internalType: 'bytes', + name: '_calldata', + type: 'bytes', + }, + ], + name: 'diamondCut', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_functionSelector', + type: 'bytes4', + }, + ], + name: 'facetAddress', + outputs: [ + { + internalType: 'address', + name: 'facetAddress_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facetAddresses', + outputs: [ + { + internalType: 'address[]', + name: 'facetAddresses_', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_facet', + type: 'address', + }, + ], + name: 'facetFunctionSelectors', + outputs: [ + { + internalType: 'bytes4[]', + name: '_facetFunctionSelectors', + type: 'bytes4[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'facets', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'facetAddress', + type: 'address', + }, + { + internalType: 'bytes4[]', + name: 'functionSelectors', + type: 'bytes4[]', + }, + ], + internalType: 'struct IDiamondLoupe.Facet[]', + name: 'facets_', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: 'owner_', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'payer', + type: 'address', + }, + { + components: [ + { + internalType: 'uint256', + name: 'requestsPerPeriod', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'periodSeconds', + type: 'uint256', + }, + ], + indexed: false, + internalType: + 'struct LibPaymentDelegationStorage.Restriction', + name: 'restriction', + type: 'tuple', + }, + ], + name: 'RestrictionSet', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'delegatePayments', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'users', + type: 'address[]', + }, + ], + name: 'delegatePaymentsBatch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'getPayers', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'users', + type: 'address[]', + }, + ], + name: 'getPayersAndRestrictions', + outputs: [ + { + internalType: 'address[][]', + name: '', + type: 'address[][]', + }, + { + components: [ + { + internalType: 'uint256', + name: 'requestsPerPeriod', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'periodSeconds', + type: 'uint256', + }, + ], + internalType: + 'struct LibPaymentDelegationStorage.Restriction[][]', + name: '', + type: 'tuple[][]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'payer', + type: 'address', + }, + ], + name: 'getRestriction', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'requestsPerPeriod', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'periodSeconds', + type: 'uint256', + }, + ], + internalType: + 'struct LibPaymentDelegationStorage.Restriction', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'payer', + type: 'address', + }, + ], + name: 'getUsers', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'setDefaultRestriction', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'requestsPerPeriod', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'periodSeconds', + type: 'uint256', + }, + ], + internalType: + 'struct LibPaymentDelegationStorage.Restriction', + name: 'r', + type: 'tuple', + }, + ], + name: 'setRestriction', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'undelegatePayments', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'users', + type: 'address[]', + }, + ], + name: 'undelegatePaymentsBatch', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, + ], + }, + ], +}; + +// node_modules/@lit-protocol/contracts/dist/prod/habanero.js +init_shim(); + +// node_modules/@lit-protocol/contracts/dist/prod/internalDev.js +init_shim(); + +// node_modules/@lit-protocol/contracts/dist/prod/manzano.js +init_shim(); + +// node_modules/@lit-protocol/contracts/dist/prod/naga-dev.js +init_shim(); + +// packages/constants/src/lib/constants/mappers.ts +var NETWORK_CONTEXT_BY_NETWORK = { + 'datil-dev': datilDev, + 'datil-test': datilTest, + datil, + 'naga-dev': nagaDev, + custom: void 0, +}; +var GLOBAL_OVERWRITE_IPFS_CODE_BY_NETWORK = { + 'datil-dev': false, + 'datil-test': false, + datil: false, + 'naga-dev': false, + custom: false, +}; +var PRODUCT_IDS = { + DECRYPTION: 0, + // For decryption operations + SIGN: 1, + // For signing operations + LA: 2, + // For Lit Actions execution +}; + +// packages/constants/src/lib/constants/endpoints.ts +init_shim(); +var LIT_ENDPOINT_VERSION = { + V0: '/', + V1: '/v1', + V2: '/v2', +}; +var LIT_ENDPOINT = { + HANDSHAKE: { + path: '/web/handshake', + version: LIT_ENDPOINT_VERSION.V0, + }, + SIGN_SESSION_KEY: { + path: '/web/sign_session_key', + version: LIT_ENDPOINT_VERSION.V2, + }, + EXECUTE_JS: { + path: '/web/execute', + version: LIT_ENDPOINT_VERSION.V2, + }, + PKP_SIGN: { + path: '/web/pkp/sign', + version: LIT_ENDPOINT_VERSION.V2, + }, + PKP_CLAIM: { + path: '/web/pkp/claim', + version: LIT_ENDPOINT_VERSION.V0, + }, + SIGN_ACCS: { + path: '/web/signing/access_control_condition', + version: LIT_ENDPOINT_VERSION.V0, + }, + ENCRYPTION_SIGN: { + path: '/web/encryption/sign', + version: LIT_ENDPOINT_VERSION.V2, + }, +}; + +// packages/constants/src/lib/constants/curves.ts +init_shim(); +var LIT_CURVE = { + BLS: 'BLS', + EcdsaK256: 'K256', + EcdsaCaitSith: 'ECDSA_CAIT_SITH', + // Legacy alias of K256 + EcdsaCAITSITHP256: 'EcdsaCaitSithP256', + EcdsaK256Sha256: 'EcdsaK256Sha256', + // same as caitsith +}; +var CURVE_GROUPS = ['ECDSA', 'BLS']; +var CURVE_GROUP_BY_CURVE_TYPE = { + [LIT_CURVE.EcdsaK256]: CURVE_GROUPS[0], + [LIT_CURVE.EcdsaK256Sha256]: CURVE_GROUPS[0], + [LIT_CURVE.EcdsaCAITSITHP256]: CURVE_GROUPS[0], + [LIT_CURVE.EcdsaCaitSith]: CURVE_GROUPS[0], + [LIT_CURVE.BLS]: CURVE_GROUPS[1], +}; + +// packages/constants/src/lib/interfaces/i-errors.ts +init_shim(); + +// packages/constants/src/lib/errors.ts +init_shim(); +import { VError } from '@openagenda/verror'; +import depd2 from 'depd'; +var deprecated2 = depd2('lit-js-sdk:constants:errors'); +var LIT_ERROR_KIND = { + Unknown: 'Unknown', + Unexpected: 'Unexpected', + Generic: 'Generic', + Config: 'Config', + Validation: 'Validation', + Conversion: 'Conversion', + Parser: 'Parser', + Serializer: 'Serializer', + Timeout: 'Timeout', +}; +var LitErrorKind = new Proxy(LIT_ERROR_KIND, { + get(target, prop, receiver) { + deprecated2( + 'LitErrorKind is deprecated and will be removed in a future version. Use LIT_ERROR_KIND instead.' + ); + return Reflect.get(target, prop, receiver); + }, +}); +var LIT_ERROR = { + INVALID_PARAM_TYPE: { + name: 'InvalidParamType', + code: 'invalid_param_type', + kind: LIT_ERROR_KIND.Validation, + }, + INVALID_ACCESS_CONTROL_CONDITIONS: { + name: 'InvalidAccessControlConditions', + code: 'invalid_access_control_conditions', + kind: LIT_ERROR_KIND.Validation, + }, + WRONG_NETWORK_EXCEPTION: { + name: 'WrongNetworkException', + code: 'wrong_network_exception', + kind: LIT_ERROR_KIND.Validation, + }, + MINTING_NOT_SUPPORTED: { + name: 'MintingNotSupported', + code: 'minting_not_supported', + kind: LIT_ERROR_KIND.Validation, + }, + UNSUPPORTED_CHAIN_EXCEPTION: { + name: 'UnsupportedChainException', + code: 'unsupported_chain_exception', + kind: LIT_ERROR_KIND.Validation, + }, + INVALID_UNIFIED_CONDITION_TYPE: { + name: 'InvalidUnifiedConditionType', + code: 'invalid_unified_condition_type', + kind: LIT_ERROR_KIND.Validation, + }, + LIT_NODE_CLIENT_NOT_READY_ERROR: { + name: 'LitNodeClientNotReadyError', + code: 'lit_node_client_not_ready_error', + kind: LIT_ERROR_KIND.Unexpected, + }, + UNAUTHORIZED_EXCEPTION: { + name: 'UnauthorizedException', + code: 'unauthorized_exception', + kind: LIT_ERROR_KIND.Validation, + }, + INVALID_ARGUMENT_EXCEPTION: { + name: 'InvalidArgumentException', + code: 'invalid_argument_exception', + kind: LIT_ERROR_KIND.Validation, + }, + INVALID_BOOLEAN_EXCEPTION: { + name: 'InvalidBooleanException', + code: 'invalid_boolean_exception', + kind: LIT_ERROR_KIND.Validation, + }, + UNKNOWN_ERROR: { + name: 'UnknownError', + code: 'unknown_error', + kind: LIT_ERROR_KIND.Unknown, + }, + NO_WALLET_EXCEPTION: { + name: 'NoWalletException', + code: 'no_wallet_exception', + kind: LIT_ERROR_KIND.Validation, + }, + WRONG_PARAM_FORMAT: { + name: 'WrongParamFormat', + code: 'wrong_param_format', + kind: LIT_ERROR_KIND.Validation, + }, + LOCAL_STORAGE_ITEM_NOT_FOUND_EXCEPTION: { + name: 'LocalStorageItemNotFoundException', + code: 'local_storage_item_not_found_exception', + kind: LIT_ERROR_KIND.Unexpected, + }, + LOCAL_STORAGE_ITEM_NOT_SET_EXCEPTION: { + name: 'LocalStorageItemNotSetException', + code: 'local_storage_item_not_set_exception', + kind: LIT_ERROR_KIND.Unexpected, + }, + LOCAL_STORAGE_ITEM_NOT_REMOVED_EXCEPTION: { + name: 'LocalStorageItemNotRemovedException', + code: 'local_storage_item_not_removed_exception', + kind: LIT_ERROR_KIND.Unexpected, + }, + REMOVED_FUNCTION_ERROR: { + name: 'RemovedFunctionError', + code: 'removed_function_error', + kind: LIT_ERROR_KIND.Validation, + }, + UNSUPPORTED_METHOD_ERROR: { + name: 'UnsupportedMethodError', + code: 'unsupported_method_error', + kind: LIT_ERROR_KIND.Validation, + }, + LIT_NODE_CLIENT_BAD_CONFIG_ERROR: { + name: 'LitNodeClientBadConfigError', + code: 'lit_node_client_bad_config_error', + kind: LIT_ERROR_KIND.Config, + }, + PARAMS_MISSING_ERROR: { + name: 'ParamsMissingError', + code: 'params_missing_error', + kind: LIT_ERROR_KIND.Validation, + }, + UNKNOWN_SIGNATURE_TYPE: { + name: 'UnknownSignatureType', + code: 'unknown_signature_type', + kind: LIT_ERROR_KIND.Validation, + }, + UNKNOWN_SIGNATURE_ERROR: { + name: 'UnknownSignatureError', + code: 'unknown_signature_error', + kind: LIT_ERROR_KIND.Validation, + }, + INVALID_SIGNATURE_ERROR: { + name: 'InvalidSignatureError', + code: 'invalid_signature_error', + kind: LIT_ERROR_KIND.Validation, + }, + PARAM_NULL_ERROR: { + name: 'ParamNullError', + code: 'param_null_error', + kind: LIT_ERROR_KIND.Validation, + }, + CURVE_TYPE_NOT_FOUND_ERROR: { + name: 'CurveTypeNotFoundError', + code: 'curve_type_not_found_error', + kind: LIT_ERROR_KIND.Validation, + }, + UNKNOWN_DECRYPTION_ALGORITHM_TYPE_ERROR: { + name: 'UnknownDecryptionAlgorithmTypeError', + code: 'unknown_decryption_algorithm_type_error', + kind: LIT_ERROR_KIND.Validation, + }, + WASM_INIT_ERROR: { + name: 'WasmInitError', + code: 'wasm_init_error', + kind: LIT_ERROR_KIND.Unexpected, + }, + NODEJS_EXCEPTION: { + name: 'NodejsException', + code: 'nodejs_exception', + kind: LIT_ERROR_KIND.Unexpected, + }, + NODE_ERROR: { + name: 'NodeError', + code: 'node_error', + kind: LitErrorKind.Unknown, + }, + WALLET_SIGNATURE_NOT_FOUND_ERROR: { + name: 'WalletSignatureNotFoundError', + code: 'wallet_signature_not_found_error', + kind: LIT_ERROR_KIND.Validation, + }, + NO_VALID_SHARES: { + name: 'NoValidShares', + code: 'no_valid_shares', + kind: LIT_ERROR_KIND.Unexpected, + }, + INVALID_NODE_ATTESTATION: { + name: 'InvalidNodeAttestation', + code: 'invalid_node_attestation', + kind: LIT_ERROR_KIND.Unexpected, + }, + INVALID_ETH_BLOCKHASH: { + name: 'InvalidEthBlockhash', + code: 'invalid_eth_blockhash', + kind: LIT_ERROR_KIND.Unexpected, + }, + INVALID_SESSION_SIGS: { + name: 'InvalidSessionSigs', + code: 'invalid_session_sigs', + kind: LIT_ERROR_KIND.Validation, + }, + INIT_ERROR: { + name: 'InitError', + code: 'init_error', + kind: LIT_ERROR_KIND.Unexpected, + }, + NETWORK_ERROR: { + name: 'NetworkError', + code: 'network_error', + kind: LitErrorKind.Unexpected, + }, + TRANSACTION_ERROR: { + name: 'TransactionError', + code: 'transaction_error', + kind: LitErrorKind.Unexpected, + }, + AUTOMATION_ERROR: { + name: 'AutomationError', + code: 'automation_error', + kind: LitErrorKind.Unexpected, + }, +}; +var LIT_ERROR_CODE = { + NODE_NOT_AUTHORIZED: 'NodeNotAuthorized', +}; +var LitError = class extends VError { + constructor(options, message, ...params) { + super(options, message, ...params); + } +}; +function createErrorClass({ name, code: code9, kind }) { + return class extends LitError { + // VError has optional options parameter, but we make it required so thrower remembers to pass all the useful info + constructor(options, message, ...params) { + if (options instanceof Error) { + options = { + cause: options, + }; + } + if (!(options.cause instanceof Error)) { + options.cause = new Error(options.cause); + } + super( + { + name, + ...options, + meta: { + code: code9, + kind, + ...options.meta, + }, + }, + message, + ...params + ); + } + }; +} +var errorClasses = {}; +for (const key2 in LIT_ERROR) { + if (key2 in LIT_ERROR) { + const errorDef = LIT_ERROR[key2]; + errorClasses[errorDef.name] = createErrorClass(errorDef); + } +} +var MultiError = VError.MultiError; +var { + AutomationError, + InitError, + InvalidAccessControlConditions, + InvalidArgumentException, + InvalidBooleanException, + InvalidEthBlockhash, + InvalidSessionSigs, + InvalidNodeAttestation, + InvalidParamType, + InvalidSignatureError, + InvalidUnifiedConditionType, + LitNodeClientBadConfigError, + LitNodeClientNotReadyError, + LocalStorageItemNotFoundException, + LocalStorageItemNotRemovedException, + LocalStorageItemNotSetException, + MintingNotSupported, + NetworkError, + NoValidShares, + NoWalletException, + NodeError, + NodejsException, + ParamNullError, + ParamsMissingError, + RemovedFunctionError, + TransactionError, + UnauthorizedException, + UnknownDecryptionAlgorithmTypeError, + UnknownError, + UnknownSignatureError, + UnknownSignatureType, + UnsupportedChainException, + UnsupportedMethodError, + WalletSignatureNotFoundError, + WasmInitError, + WrongNetworkException, + WrongParamFormat, + CurveTypeNotFoundError, +} = errorClasses; + +// packages/constants/src/lib/utils/utils.ts +init_shim(); +function ELeft(error) { + return { + type: EITHER_TYPE.ERROR, + result: error, + }; +} +function ERight(result) { + return { + type: EITHER_TYPE.SUCCESS, + result, + }; +} + +// packages/auth-browser/src/lib/chains/cosmos.ts +init_shim(); + +// packages/misc/src/index.ts +init_shim(); + +// packages/misc/src/lib/addresses.ts +init_shim(); +import { bech32 as bech322 } from 'bech32'; +import { createHash } from 'crypto'; + +// node_modules/ethers/lib.esm/index.js +init_shim(); + +// node_modules/ethers/lib.esm/ethers.js +var ethers_exports = {}; +__export(ethers_exports, { + BaseContract: () => BaseContract, + BigNumber: () => BigNumber, + Contract: () => Contract, + ContractFactory: () => ContractFactory, + FixedNumber: () => FixedNumber, + Signer: () => Signer, + VoidSigner: () => VoidSigner, + Wallet: () => Wallet, + Wordlist: () => Wordlist, + constants: () => lib_exports7, + errors: () => ErrorCode, + getDefaultProvider: () => getDefaultProvider, + logger: () => logger46, + providers: () => lib_exports21, + utils: () => utils_exports, + version: () => version27, + wordlists: () => wordlists, +}); +init_shim(); + +// node_modules/@ethersproject/contracts/lib.esm/index.js +init_shim(); +init_lib13(); +init_lib14(); +init_lib15(); +init_lib7(); +init_lib3(); +init_lib2(); +init_lib4(); +init_lib17(); +init_lib(); + +// node_modules/@ethersproject/contracts/lib.esm/_version.js +init_shim(); +var version15 = 'contracts/5.7.0'; + +// node_modules/@ethersproject/contracts/lib.esm/index.js +var __awaiter5 = 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 (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var logger19 = new Logger(version15); +var allowedTransactionKeys3 = { + chainId: true, + data: true, + from: true, + gasLimit: true, + gasPrice: true, + nonce: true, + to: true, + value: true, + type: true, + accessList: true, + maxFeePerGas: true, + maxPriorityFeePerGas: true, + customData: true, + ccipReadEnabled: true, +}; +function resolveName(resolver, nameOrPromise) { + return __awaiter5(this, void 0, void 0, function* () { + const name = yield nameOrPromise; + if (typeof name !== 'string') { + logger19.throwArgumentError('invalid address or ENS name', 'name', name); + } + try { + return getAddress(name); + } catch (error) {} + if (!resolver) { + logger19.throwError( + 'a provider or signer is needed to resolve ENS names', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'resolveName', + } + ); + } + const address = yield resolver.resolveName(name); + if (address == null) { + logger19.throwArgumentError( + 'resolver or addr is not configured for ENS name', + 'name', + name + ); + } + return address; + }); +} +function resolveAddresses(resolver, value, paramType) { + return __awaiter5(this, void 0, void 0, function* () { + if (Array.isArray(paramType)) { + return yield Promise.all( + paramType.map((paramType2, index) => { + return resolveAddresses( + resolver, + Array.isArray(value) ? value[index] : value[paramType2.name], + paramType2 + ); + }) + ); + } + if (paramType.type === 'address') { + return yield resolveName(resolver, value); + } + if (paramType.type === 'tuple') { + return yield resolveAddresses(resolver, value, paramType.components); + } + if (paramType.baseType === 'array') { + if (!Array.isArray(value)) { + return Promise.reject( + logger19.makeError( + 'invalid value for array', + Logger.errors.INVALID_ARGUMENT, + { + argument: 'value', + value, + } + ) + ); + } + return yield Promise.all( + value.map((v) => resolveAddresses(resolver, v, paramType.arrayChildren)) + ); + } + return value; + }); +} +function populateTransaction(contract, fragment, args) { + return __awaiter5(this, void 0, void 0, function* () { + let overrides = {}; + if ( + args.length === fragment.inputs.length + 1 && + typeof args[args.length - 1] === 'object' + ) { + overrides = shallowCopy(args.pop()); + } + logger19.checkArgumentCount( + args.length, + fragment.inputs.length, + 'passed to contract' + ); + if (contract.signer) { + if (overrides.from) { + overrides.from = resolveProperties({ + override: resolveName(contract.signer, overrides.from), + signer: contract.signer.getAddress(), + }).then((check) => + __awaiter5(this, void 0, void 0, function* () { + if (getAddress(check.signer) !== check.override) { + logger19.throwError( + 'Contract with a Signer cannot override from', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'overrides.from', + } + ); + } + return check.override; + }) + ); + } else { + overrides.from = contract.signer.getAddress(); + } + } else if (overrides.from) { + overrides.from = resolveName(contract.provider, overrides.from); + } + const resolved = yield resolveProperties({ + args: resolveAddresses( + contract.signer || contract.provider, + args, + fragment.inputs + ), + address: contract.resolvedAddress, + overrides: resolveProperties(overrides) || {}, + }); + const data = contract.interface.encodeFunctionData(fragment, resolved.args); + const tx = { + data, + to: resolved.address, + }; + const ro = resolved.overrides; + if (ro.nonce != null) { + tx.nonce = BigNumber.from(ro.nonce).toNumber(); + } + if (ro.gasLimit != null) { + tx.gasLimit = BigNumber.from(ro.gasLimit); + } + if (ro.gasPrice != null) { + tx.gasPrice = BigNumber.from(ro.gasPrice); + } + if (ro.maxFeePerGas != null) { + tx.maxFeePerGas = BigNumber.from(ro.maxFeePerGas); + } + if (ro.maxPriorityFeePerGas != null) { + tx.maxPriorityFeePerGas = BigNumber.from(ro.maxPriorityFeePerGas); + } + if (ro.from != null) { + tx.from = ro.from; + } + if (ro.type != null) { + tx.type = ro.type; + } + if (ro.accessList != null) { + tx.accessList = accessListify(ro.accessList); + } + if (tx.gasLimit == null && fragment.gas != null) { + let intrinsic = 21e3; + const bytes = arrayify(data); + for (let i2 = 0; i2 < bytes.length; i2++) { + intrinsic += 4; + if (bytes[i2]) { + intrinsic += 64; + } + } + tx.gasLimit = BigNumber.from(fragment.gas).add(intrinsic); + } + if (ro.value) { + const roValue = BigNumber.from(ro.value); + if (!roValue.isZero() && !fragment.payable) { + logger19.throwError( + 'non-payable method cannot override value', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'overrides.value', + value: overrides.value, + } + ); + } + tx.value = roValue; + } + if (ro.customData) { + tx.customData = shallowCopy(ro.customData); + } + if (ro.ccipReadEnabled) { + tx.ccipReadEnabled = !!ro.ccipReadEnabled; + } + delete overrides.nonce; + delete overrides.gasLimit; + delete overrides.gasPrice; + delete overrides.from; + delete overrides.value; + delete overrides.type; + delete overrides.accessList; + delete overrides.maxFeePerGas; + delete overrides.maxPriorityFeePerGas; + delete overrides.customData; + delete overrides.ccipReadEnabled; + const leftovers = Object.keys(overrides).filter( + (key2) => overrides[key2] != null + ); + if (leftovers.length) { + logger19.throwError( + `cannot override ${leftovers + .map((l2) => JSON.stringify(l2)) + .join(',')}`, + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'overrides', + overrides: leftovers, + } + ); + } + return tx; + }); +} +function buildPopulate(contract, fragment) { + return function (...args) { + return populateTransaction(contract, fragment, args); + }; +} +function buildEstimate(contract, fragment) { + const signerOrProvider = contract.signer || contract.provider; + return function (...args) { + return __awaiter5(this, void 0, void 0, function* () { + if (!signerOrProvider) { + logger19.throwError( + 'estimate require a provider or signer', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'estimateGas', + } + ); + } + const tx = yield populateTransaction(contract, fragment, args); + return yield signerOrProvider.estimateGas(tx); + }); + }; +} +function addContractWait(contract, tx) { + const wait = tx.wait.bind(tx); + tx.wait = (confirmations) => { + return wait(confirmations).then((receipt) => { + receipt.events = receipt.logs.map((log3) => { + let event = deepCopy(log3); + let parsed = null; + try { + parsed = contract.interface.parseLog(log3); + } catch (e2) {} + if (parsed) { + event.args = parsed.args; + event.decode = (data, topics) => { + return contract.interface.decodeEventLog( + parsed.eventFragment, + data, + topics + ); + }; + event.event = parsed.name; + event.eventSignature = parsed.signature; + } + event.removeListener = () => { + return contract.provider; + }; + event.getBlock = () => { + return contract.provider.getBlock(receipt.blockHash); + }; + event.getTransaction = () => { + return contract.provider.getTransaction(receipt.transactionHash); + }; + event.getTransactionReceipt = () => { + return Promise.resolve(receipt); + }; + return event; + }); + return receipt; + }); + }; +} +function buildCall(contract, fragment, collapseSimple) { + const signerOrProvider = contract.signer || contract.provider; + return function (...args) { + return __awaiter5(this, void 0, void 0, function* () { + let blockTag = void 0; + if ( + args.length === fragment.inputs.length + 1 && + typeof args[args.length - 1] === 'object' + ) { + const overrides = shallowCopy(args.pop()); + if (overrides.blockTag != null) { + blockTag = yield overrides.blockTag; + } + delete overrides.blockTag; + args.push(overrides); + } + if (contract.deployTransaction != null) { + yield contract._deployed(blockTag); + } + const tx = yield populateTransaction(contract, fragment, args); + const result = yield signerOrProvider.call(tx, blockTag); + try { + let value = contract.interface.decodeFunctionResult(fragment, result); + if (collapseSimple && fragment.outputs.length === 1) { + value = value[0]; + } + return value; + } catch (error) { + if (error.code === Logger.errors.CALL_EXCEPTION) { + error.address = contract.address; + error.args = args; + error.transaction = tx; + } + throw error; + } + }); + }; +} +function buildSend(contract, fragment) { + return function (...args) { + return __awaiter5(this, void 0, void 0, function* () { + if (!contract.signer) { + logger19.throwError( + 'sending a transaction requires a signer', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'sendTransaction', + } + ); + } + if (contract.deployTransaction != null) { + yield contract._deployed(); + } + const txRequest = yield populateTransaction(contract, fragment, args); + const tx = yield contract.signer.sendTransaction(txRequest); + addContractWait(contract, tx); + return tx; + }); + }; +} +function buildDefault(contract, fragment, collapseSimple) { + if (fragment.constant) { + return buildCall(contract, fragment, collapseSimple); + } + return buildSend(contract, fragment); +} +function getEventTag(filter) { + if (filter.address && (filter.topics == null || filter.topics.length === 0)) { + return '*'; + } + return ( + (filter.address || '*') + + '@' + + (filter.topics + ? filter.topics + .map((topic) => { + if (Array.isArray(topic)) { + return topic.join('|'); + } + return topic; + }) + .join(':') + : '') + ); +} +var RunningEvent = class { + constructor(tag, filter) { + defineReadOnly(this, 'tag', tag); + defineReadOnly(this, 'filter', filter); + this._listeners = []; + } + addListener(listener, once) { + this._listeners.push({ listener, once }); + } + removeListener(listener) { + let done = false; + this._listeners = this._listeners.filter((item) => { + if (done || item.listener !== listener) { + return true; + } + done = true; + return false; + }); + } + removeAllListeners() { + this._listeners = []; + } + listeners() { + return this._listeners.map((i2) => i2.listener); + } + listenerCount() { + return this._listeners.length; + } + run(args) { + const listenerCount = this.listenerCount(); + this._listeners = this._listeners.filter((item) => { + const argsCopy = args.slice(); + setTimeout(() => { + item.listener.apply(this, argsCopy); + }, 0); + return !item.once; + }); + return listenerCount; + } + prepareEvent(event) {} + // Returns the array that will be applied to an emit + getEmit(event) { + return [event]; + } +}; +var ErrorRunningEvent = class extends RunningEvent { + constructor() { + super('error', null); + } +}; +var FragmentRunningEvent = class extends RunningEvent { + constructor(address, contractInterface, fragment, topics) { + const filter = { + address, + }; + let topic = contractInterface.getEventTopic(fragment); + if (topics) { + if (topic !== topics[0]) { + logger19.throwArgumentError('topic mismatch', 'topics', topics); + } + filter.topics = topics.slice(); + } else { + filter.topics = [topic]; + } + super(getEventTag(filter), filter); + defineReadOnly(this, 'address', address); + defineReadOnly(this, 'interface', contractInterface); + defineReadOnly(this, 'fragment', fragment); + } + prepareEvent(event) { + super.prepareEvent(event); + event.event = this.fragment.name; + event.eventSignature = this.fragment.format(); + event.decode = (data, topics) => { + return this.interface.decodeEventLog(this.fragment, data, topics); + }; + try { + event.args = this.interface.decodeEventLog( + this.fragment, + event.data, + event.topics + ); + } catch (error) { + event.args = null; + event.decodeError = error; + } + } + getEmit(event) { + const errors = checkResultErrors(event.args); + if (errors.length) { + throw errors[0].error; + } + const args = (event.args || []).slice(); + args.push(event); + return args; + } +}; +var WildcardRunningEvent = class extends RunningEvent { + constructor(address, contractInterface) { + super('*', { address }); + defineReadOnly(this, 'address', address); + defineReadOnly(this, 'interface', contractInterface); + } + prepareEvent(event) { + super.prepareEvent(event); + try { + const parsed = this.interface.parseLog(event); + event.event = parsed.name; + event.eventSignature = parsed.signature; + event.decode = (data, topics) => { + return this.interface.decodeEventLog( + parsed.eventFragment, + data, + topics + ); + }; + event.args = parsed.args; + } catch (error) {} + } +}; +var BaseContract = class { + constructor(addressOrName, contractInterface, signerOrProvider) { + defineReadOnly( + this, + 'interface', + getStatic(new.target, 'getInterface')(contractInterface) + ); + if (signerOrProvider == null) { + defineReadOnly(this, 'provider', null); + defineReadOnly(this, 'signer', null); + } else if (Signer.isSigner(signerOrProvider)) { + defineReadOnly(this, 'provider', signerOrProvider.provider || null); + defineReadOnly(this, 'signer', signerOrProvider); + } else if (Provider.isProvider(signerOrProvider)) { + defineReadOnly(this, 'provider', signerOrProvider); + defineReadOnly(this, 'signer', null); + } else { + logger19.throwArgumentError( + 'invalid signer or provider', + 'signerOrProvider', + signerOrProvider + ); + } + defineReadOnly(this, 'callStatic', {}); + defineReadOnly(this, 'estimateGas', {}); + defineReadOnly(this, 'functions', {}); + defineReadOnly(this, 'populateTransaction', {}); + defineReadOnly(this, 'filters', {}); + { + const uniqueFilters = {}; + Object.keys(this.interface.events).forEach((eventSignature) => { + const event = this.interface.events[eventSignature]; + defineReadOnly(this.filters, eventSignature, (...args) => { + return { + address: this.address, + topics: this.interface.encodeFilterTopics(event, args), + }; + }); + if (!uniqueFilters[event.name]) { + uniqueFilters[event.name] = []; + } + uniqueFilters[event.name].push(eventSignature); + }); + Object.keys(uniqueFilters).forEach((name) => { + const filters = uniqueFilters[name]; + if (filters.length === 1) { + defineReadOnly(this.filters, name, this.filters[filters[0]]); + } else { + logger19.warn( + `Duplicate definition of ${name} (${filters.join(', ')})` + ); + } + }); + } + defineReadOnly(this, '_runningEvents', {}); + defineReadOnly(this, '_wrappedEmits', {}); + if (addressOrName == null) { + logger19.throwArgumentError( + 'invalid contract address or ENS name', + 'addressOrName', + addressOrName + ); + } + defineReadOnly(this, 'address', addressOrName); + if (this.provider) { + defineReadOnly( + this, + 'resolvedAddress', + resolveName(this.provider, addressOrName) + ); + } else { + try { + defineReadOnly( + this, + 'resolvedAddress', + Promise.resolve(getAddress(addressOrName)) + ); + } catch (error) { + logger19.throwError( + 'provider is required to use ENS name as contract address', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'new Contract', + } + ); + } + } + this.resolvedAddress.catch((e2) => {}); + const uniqueNames = {}; + const uniqueSignatures = {}; + Object.keys(this.interface.functions).forEach((signature2) => { + const fragment = this.interface.functions[signature2]; + if (uniqueSignatures[signature2]) { + logger19.warn(`Duplicate ABI entry for ${JSON.stringify(signature2)}`); + return; + } + uniqueSignatures[signature2] = true; + { + const name = fragment.name; + if (!uniqueNames[`%${name}`]) { + uniqueNames[`%${name}`] = []; + } + uniqueNames[`%${name}`].push(signature2); + } + if (this[signature2] == null) { + defineReadOnly(this, signature2, buildDefault(this, fragment, true)); + } + if (this.functions[signature2] == null) { + defineReadOnly( + this.functions, + signature2, + buildDefault(this, fragment, false) + ); + } + if (this.callStatic[signature2] == null) { + defineReadOnly( + this.callStatic, + signature2, + buildCall(this, fragment, true) + ); + } + if (this.populateTransaction[signature2] == null) { + defineReadOnly( + this.populateTransaction, + signature2, + buildPopulate(this, fragment) + ); + } + if (this.estimateGas[signature2] == null) { + defineReadOnly( + this.estimateGas, + signature2, + buildEstimate(this, fragment) + ); + } + }); + Object.keys(uniqueNames).forEach((name) => { + const signatures = uniqueNames[name]; + if (signatures.length > 1) { + return; + } + name = name.substring(1); + const signature2 = signatures[0]; + try { + if (this[name] == null) { + defineReadOnly(this, name, this[signature2]); + } + } catch (e2) {} + if (this.functions[name] == null) { + defineReadOnly(this.functions, name, this.functions[signature2]); + } + if (this.callStatic[name] == null) { + defineReadOnly(this.callStatic, name, this.callStatic[signature2]); + } + if (this.populateTransaction[name] == null) { + defineReadOnly( + this.populateTransaction, + name, + this.populateTransaction[signature2] + ); + } + if (this.estimateGas[name] == null) { + defineReadOnly(this.estimateGas, name, this.estimateGas[signature2]); + } + }); + } + static getContractAddress(transaction) { + return getContractAddress(transaction); + } + static getInterface(contractInterface) { + if (Interface.isInterface(contractInterface)) { + return contractInterface; + } + return new Interface(contractInterface); + } + // @TODO: Allow timeout? + deployed() { + return this._deployed(); + } + _deployed(blockTag) { + if (!this._deployedPromise) { + if (this.deployTransaction) { + this._deployedPromise = this.deployTransaction.wait().then(() => { + return this; + }); + } else { + this._deployedPromise = this.provider + .getCode(this.address, blockTag) + .then((code9) => { + if (code9 === '0x') { + logger19.throwError( + 'contract not deployed', + Logger.errors.UNSUPPORTED_OPERATION, + { + contractAddress: this.address, + operation: 'getDeployed', + } + ); + } + return this; + }); + } + } + return this._deployedPromise; + } + // @TODO: + // estimateFallback(overrides?: TransactionRequest): Promise + // @TODO: + // estimateDeploy(bytecode: string, ...args): Promise + fallback(overrides) { + if (!this.signer) { + logger19.throwError( + 'sending a transactions require a signer', + Logger.errors.UNSUPPORTED_OPERATION, + { operation: 'sendTransaction(fallback)' } + ); + } + const tx = shallowCopy(overrides || {}); + ['from', 'to'].forEach(function (key2) { + if (tx[key2] == null) { + return; + } + logger19.throwError( + 'cannot override ' + key2, + Logger.errors.UNSUPPORTED_OPERATION, + { operation: key2 } + ); + }); + tx.to = this.resolvedAddress; + return this.deployed().then(() => { + return this.signer.sendTransaction(tx); + }); + } + // Reconnect to a different signer or provider + connect(signerOrProvider) { + if (typeof signerOrProvider === 'string') { + signerOrProvider = new VoidSigner(signerOrProvider, this.provider); + } + const contract = new this.constructor( + this.address, + this.interface, + signerOrProvider + ); + if (this.deployTransaction) { + defineReadOnly(contract, 'deployTransaction', this.deployTransaction); + } + return contract; + } + // Re-attach to a different on-chain instance of this contract + attach(addressOrName) { + return new this.constructor( + addressOrName, + this.interface, + this.signer || this.provider + ); + } + static isIndexed(value) { + return Indexed.isIndexed(value); + } + _normalizeRunningEvent(runningEvent) { + if (this._runningEvents[runningEvent.tag]) { + return this._runningEvents[runningEvent.tag]; + } + return runningEvent; + } + _getRunningEvent(eventName) { + if (typeof eventName === 'string') { + if (eventName === 'error') { + return this._normalizeRunningEvent(new ErrorRunningEvent()); + } + if (eventName === 'event') { + return this._normalizeRunningEvent(new RunningEvent('event', null)); + } + if (eventName === '*') { + return this._normalizeRunningEvent( + new WildcardRunningEvent(this.address, this.interface) + ); + } + const fragment = this.interface.getEvent(eventName); + return this._normalizeRunningEvent( + new FragmentRunningEvent(this.address, this.interface, fragment) + ); + } + if (eventName.topics && eventName.topics.length > 0) { + try { + const topic = eventName.topics[0]; + if (typeof topic !== 'string') { + throw new Error('invalid topic'); + } + const fragment = this.interface.getEvent(topic); + return this._normalizeRunningEvent( + new FragmentRunningEvent( + this.address, + this.interface, + fragment, + eventName.topics + ) + ); + } catch (error) {} + const filter = { + address: this.address, + topics: eventName.topics, + }; + return this._normalizeRunningEvent( + new RunningEvent(getEventTag(filter), filter) + ); + } + return this._normalizeRunningEvent( + new WildcardRunningEvent(this.address, this.interface) + ); + } + _checkRunningEvents(runningEvent) { + if (runningEvent.listenerCount() === 0) { + delete this._runningEvents[runningEvent.tag]; + const emit = this._wrappedEmits[runningEvent.tag]; + if (emit && runningEvent.filter) { + this.provider.off(runningEvent.filter, emit); + delete this._wrappedEmits[runningEvent.tag]; + } + } + } + // Subclasses can override this to gracefully recover + // from parse errors if they wish + _wrapEvent(runningEvent, log3, listener) { + const event = deepCopy(log3); + event.removeListener = () => { + if (!listener) { + return; + } + runningEvent.removeListener(listener); + this._checkRunningEvents(runningEvent); + }; + event.getBlock = () => { + return this.provider.getBlock(log3.blockHash); + }; + event.getTransaction = () => { + return this.provider.getTransaction(log3.transactionHash); + }; + event.getTransactionReceipt = () => { + return this.provider.getTransactionReceipt(log3.transactionHash); + }; + runningEvent.prepareEvent(event); + return event; + } + _addEventListener(runningEvent, listener, once) { + if (!this.provider) { + logger19.throwError( + 'events require a provider or a signer with a provider', + Logger.errors.UNSUPPORTED_OPERATION, + { operation: 'once' } + ); + } + runningEvent.addListener(listener, once); + this._runningEvents[runningEvent.tag] = runningEvent; + if (!this._wrappedEmits[runningEvent.tag]) { + const wrappedEmit = (log3) => { + let event = this._wrapEvent(runningEvent, log3, listener); + if (event.decodeError == null) { + try { + const args = runningEvent.getEmit(event); + this.emit(runningEvent.filter, ...args); + } catch (error) { + event.decodeError = error.error; + } + } + if (runningEvent.filter != null) { + this.emit('event', event); + } + if (event.decodeError != null) { + this.emit('error', event.decodeError, event); + } + }; + this._wrappedEmits[runningEvent.tag] = wrappedEmit; + if (runningEvent.filter != null) { + this.provider.on(runningEvent.filter, wrappedEmit); + } + } + } + queryFilter(event, fromBlockOrBlockhash, toBlock) { + const runningEvent = this._getRunningEvent(event); + const filter = shallowCopy(runningEvent.filter); + if ( + typeof fromBlockOrBlockhash === 'string' && + isHexString(fromBlockOrBlockhash, 32) + ) { + if (toBlock != null) { + logger19.throwArgumentError( + 'cannot specify toBlock with blockhash', + 'toBlock', + toBlock + ); + } + filter.blockHash = fromBlockOrBlockhash; + } else { + filter.fromBlock = + fromBlockOrBlockhash != null ? fromBlockOrBlockhash : 0; + filter.toBlock = toBlock != null ? toBlock : 'latest'; + } + return this.provider.getLogs(filter).then((logs) => { + return logs.map((log3) => this._wrapEvent(runningEvent, log3, null)); + }); + } + on(event, listener) { + this._addEventListener(this._getRunningEvent(event), listener, false); + return this; + } + once(event, listener) { + this._addEventListener(this._getRunningEvent(event), listener, true); + return this; + } + emit(eventName, ...args) { + if (!this.provider) { + return false; + } + const runningEvent = this._getRunningEvent(eventName); + const result = runningEvent.run(args) > 0; + this._checkRunningEvents(runningEvent); + return result; + } + listenerCount(eventName) { + if (!this.provider) { + return 0; + } + if (eventName == null) { + return Object.keys(this._runningEvents).reduce((accum, key2) => { + return accum + this._runningEvents[key2].listenerCount(); + }, 0); + } + return this._getRunningEvent(eventName).listenerCount(); + } + listeners(eventName) { + if (!this.provider) { + return []; + } + if (eventName == null) { + const result = []; + for (let tag in this._runningEvents) { + this._runningEvents[tag].listeners().forEach((listener) => { + result.push(listener); + }); + } + return result; + } + return this._getRunningEvent(eventName).listeners(); + } + removeAllListeners(eventName) { + if (!this.provider) { + return this; + } + if (eventName == null) { + for (const tag in this._runningEvents) { + const runningEvent2 = this._runningEvents[tag]; + runningEvent2.removeAllListeners(); + this._checkRunningEvents(runningEvent2); + } + return this; + } + const runningEvent = this._getRunningEvent(eventName); + runningEvent.removeAllListeners(); + this._checkRunningEvents(runningEvent); + return this; + } + off(eventName, listener) { + if (!this.provider) { + return this; + } + const runningEvent = this._getRunningEvent(eventName); + runningEvent.removeListener(listener); + this._checkRunningEvents(runningEvent); + return this; + } + removeListener(eventName, listener) { + return this.off(eventName, listener); + } +}; +var Contract = class extends BaseContract {}; +var ContractFactory = class { + constructor(contractInterface, bytecode, signer) { + let bytecodeHex = null; + if (typeof bytecode === 'string') { + bytecodeHex = bytecode; + } else if (isBytes(bytecode)) { + bytecodeHex = hexlify(bytecode); + } else if (bytecode && typeof bytecode.object === 'string') { + bytecodeHex = bytecode.object; + } else { + bytecodeHex = '!'; + } + if (bytecodeHex.substring(0, 2) !== '0x') { + bytecodeHex = '0x' + bytecodeHex; + } + if (!isHexString(bytecodeHex) || bytecodeHex.length % 2) { + logger19.throwArgumentError('invalid bytecode', 'bytecode', bytecode); + } + if (signer && !Signer.isSigner(signer)) { + logger19.throwArgumentError('invalid signer', 'signer', signer); + } + defineReadOnly(this, 'bytecode', bytecodeHex); + defineReadOnly( + this, + 'interface', + getStatic(new.target, 'getInterface')(contractInterface) + ); + defineReadOnly(this, 'signer', signer || null); + } + // @TODO: Future; rename to populateTransaction? + getDeployTransaction(...args) { + let tx = {}; + if ( + args.length === this.interface.deploy.inputs.length + 1 && + typeof args[args.length - 1] === 'object' + ) { + tx = shallowCopy(args.pop()); + for (const key2 in tx) { + if (!allowedTransactionKeys3[key2]) { + throw new Error('unknown transaction override ' + key2); + } + } + } + ['data', 'from', 'to'].forEach((key2) => { + if (tx[key2] == null) { + return; + } + logger19.throwError( + 'cannot override ' + key2, + Logger.errors.UNSUPPORTED_OPERATION, + { operation: key2 } + ); + }); + if (tx.value) { + const value = BigNumber.from(tx.value); + if (!value.isZero() && !this.interface.deploy.payable) { + logger19.throwError( + 'non-payable constructor cannot override value', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'overrides.value', + value: tx.value, + } + ); + } + } + logger19.checkArgumentCount( + args.length, + this.interface.deploy.inputs.length, + ' in Contract constructor' + ); + tx.data = hexlify( + concat([this.bytecode, this.interface.encodeDeploy(args)]) + ); + return tx; + } + deploy(...args) { + return __awaiter5(this, void 0, void 0, function* () { + let overrides = {}; + if (args.length === this.interface.deploy.inputs.length + 1) { + overrides = args.pop(); + } + logger19.checkArgumentCount( + args.length, + this.interface.deploy.inputs.length, + ' in Contract constructor' + ); + const params = yield resolveAddresses( + this.signer, + args, + this.interface.deploy.inputs + ); + params.push(overrides); + const unsignedTx = this.getDeployTransaction(...params); + const tx = yield this.signer.sendTransaction(unsignedTx); + const address = getStatic(this.constructor, 'getContractAddress')(tx); + const contract = getStatic(this.constructor, 'getContract')( + address, + this.interface, + this.signer + ); + addContractWait(contract, tx); + defineReadOnly(contract, 'deployTransaction', tx); + return contract; + }); + } + attach(address) { + return this.constructor.getContract(address, this.interface, this.signer); + } + connect(signer) { + return new this.constructor(this.interface, this.bytecode, signer); + } + static fromSolidity(compilerOutput, signer) { + if (compilerOutput == null) { + logger19.throwError( + 'missing compiler output', + Logger.errors.MISSING_ARGUMENT, + { argument: 'compilerOutput' } + ); + } + if (typeof compilerOutput === 'string') { + compilerOutput = JSON.parse(compilerOutput); + } + const abi = compilerOutput.abi; + let bytecode = null; + if (compilerOutput.bytecode) { + bytecode = compilerOutput.bytecode; + } else if (compilerOutput.evm && compilerOutput.evm.bytecode) { + bytecode = compilerOutput.evm.bytecode; + } + return new this(abi, bytecode, signer); + } + static getInterface(contractInterface) { + return Contract.getInterface(contractInterface); + } + static getContractAddress(tx) { + return getContractAddress(tx); + } + static getContract(address, contractInterface, signer) { + return new Contract(address, contractInterface, signer); + } +}; + +// node_modules/ethers/lib.esm/ethers.js +init_lib3(); +init_lib15(); +init_lib25(); +init_lib8(); + +// node_modules/@ethersproject/providers/lib.esm/index.js +var lib_exports21 = {}; +__export(lib_exports21, { + AlchemyProvider: () => AlchemyProvider, + AlchemyWebSocketProvider: () => AlchemyWebSocketProvider, + AnkrProvider: () => AnkrProvider, + BaseProvider: () => BaseProvider, + CloudflareProvider: () => CloudflareProvider, + EtherscanProvider: () => EtherscanProvider, + FallbackProvider: () => FallbackProvider, + Formatter: () => Formatter, + InfuraProvider: () => InfuraProvider, + InfuraWebSocketProvider: () => InfuraWebSocketProvider, + IpcProvider: () => IpcProvider, + JsonRpcBatchProvider: () => JsonRpcBatchProvider, + JsonRpcProvider: () => JsonRpcProvider, + JsonRpcSigner: () => JsonRpcSigner, + NodesmithProvider: () => NodesmithProvider, + PocketProvider: () => PocketProvider, + Provider: () => Provider, + Resolver: () => Resolver, + StaticJsonRpcProvider: () => StaticJsonRpcProvider, + UrlJsonRpcProvider: () => UrlJsonRpcProvider, + Web3Provider: () => Web3Provider, + WebSocketProvider: () => WebSocketProvider, + getDefaultProvider: () => getDefaultProvider, + getNetwork: () => getNetwork, + isCommunityResourcable: () => isCommunityResourcable, + isCommunityResource: () => isCommunityResource, + showThrottleMessage: () => showThrottleMessage, +}); +init_shim(); +init_lib14(); + +// node_modules/@ethersproject/networks/lib.esm/index.js +init_shim(); +init_lib(); + +// node_modules/@ethersproject/networks/lib.esm/_version.js +init_shim(); +var version22 = 'networks/5.7.1'; + +// node_modules/@ethersproject/networks/lib.esm/index.js +var logger27 = new Logger(version22); +function isRenetworkable(value) { + return value && typeof value.renetwork === 'function'; +} +function ethDefaultProvider(network) { + const func = function (providers, options) { + if (options == null) { + options = {}; + } + const providerList = []; + if (providers.InfuraProvider && options.infura !== '-') { + try { + providerList.push( + new providers.InfuraProvider(network, options.infura) + ); + } catch (error) {} + } + if (providers.EtherscanProvider && options.etherscan !== '-') { + try { + providerList.push( + new providers.EtherscanProvider(network, options.etherscan) + ); + } catch (error) {} + } + if (providers.AlchemyProvider && options.alchemy !== '-') { + try { + providerList.push( + new providers.AlchemyProvider(network, options.alchemy) + ); + } catch (error) {} + } + if (providers.PocketProvider && options.pocket !== '-') { + const skip = ['goerli', 'ropsten', 'rinkeby', 'sepolia']; + try { + const provider = new providers.PocketProvider(network, options.pocket); + if (provider.network && skip.indexOf(provider.network.name) === -1) { + providerList.push(provider); + } + } catch (error) {} + } + if (providers.CloudflareProvider && options.cloudflare !== '-') { + try { + providerList.push(new providers.CloudflareProvider(network)); + } catch (error) {} + } + if (providers.AnkrProvider && options.ankr !== '-') { + try { + const skip = ['ropsten']; + const provider = new providers.AnkrProvider(network, options.ankr); + if (provider.network && skip.indexOf(provider.network.name) === -1) { + providerList.push(provider); + } + } catch (error) {} + } + if (providerList.length === 0) { + return null; + } + if (providers.FallbackProvider) { + let quorum = 1; + if (options.quorum != null) { + quorum = options.quorum; + } else if (network === 'homestead') { + quorum = 2; + } + return new providers.FallbackProvider(providerList, quorum); + } + return providerList[0]; + }; + func.renetwork = function (network2) { + return ethDefaultProvider(network2); + }; + return func; +} +function etcDefaultProvider(url, network) { + const func = function (providers, options) { + if (providers.JsonRpcProvider) { + return new providers.JsonRpcProvider(url, network); + } + return null; + }; + func.renetwork = function (network2) { + return etcDefaultProvider(url, network2); + }; + return func; +} +var homestead = { + chainId: 1, + ensAddress: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', + name: 'homestead', + _defaultProvider: ethDefaultProvider('homestead'), +}; +var ropsten = { + chainId: 3, + ensAddress: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', + name: 'ropsten', + _defaultProvider: ethDefaultProvider('ropsten'), +}; +var classicMordor = { + chainId: 63, + name: 'classicMordor', + _defaultProvider: etcDefaultProvider( + 'https://www.ethercluster.com/mordor', + 'classicMordor' + ), +}; +var networks = { + unspecified: { chainId: 0, name: 'unspecified' }, + homestead, + mainnet: homestead, + morden: { chainId: 2, name: 'morden' }, + ropsten, + testnet: ropsten, + rinkeby: { + chainId: 4, + ensAddress: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', + name: 'rinkeby', + _defaultProvider: ethDefaultProvider('rinkeby'), + }, + kovan: { + chainId: 42, + name: 'kovan', + _defaultProvider: ethDefaultProvider('kovan'), + }, + goerli: { + chainId: 5, + ensAddress: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', + name: 'goerli', + _defaultProvider: ethDefaultProvider('goerli'), + }, + kintsugi: { chainId: 1337702, name: 'kintsugi' }, + sepolia: { + chainId: 11155111, + name: 'sepolia', + _defaultProvider: ethDefaultProvider('sepolia'), + }, + // ETC (See: #351) + classic: { + chainId: 61, + name: 'classic', + _defaultProvider: etcDefaultProvider( + 'https://www.ethercluster.com/etc', + 'classic' + ), + }, + classicMorden: { chainId: 62, name: 'classicMorden' }, + classicMordor, + classicTestnet: classicMordor, + classicKotti: { + chainId: 6, + name: 'classicKotti', + _defaultProvider: etcDefaultProvider( + 'https://www.ethercluster.com/kotti', + 'classicKotti' + ), + }, + xdai: { chainId: 100, name: 'xdai' }, + matic: { + chainId: 137, + name: 'matic', + _defaultProvider: ethDefaultProvider('matic'), + }, + maticmum: { chainId: 80001, name: 'maticmum' }, + optimism: { + chainId: 10, + name: 'optimism', + _defaultProvider: ethDefaultProvider('optimism'), + }, + 'optimism-kovan': { chainId: 69, name: 'optimism-kovan' }, + 'optimism-goerli': { chainId: 420, name: 'optimism-goerli' }, + arbitrum: { chainId: 42161, name: 'arbitrum' }, + 'arbitrum-rinkeby': { chainId: 421611, name: 'arbitrum-rinkeby' }, + 'arbitrum-goerli': { chainId: 421613, name: 'arbitrum-goerli' }, + bnb: { chainId: 56, name: 'bnb' }, + bnbt: { chainId: 97, name: 'bnbt' }, +}; +function getNetwork(network) { + if (network == null) { + return null; + } + if (typeof network === 'number') { + for (const name in networks) { + const standard2 = networks[name]; + if (standard2.chainId === network) { + return { + name: standard2.name, + chainId: standard2.chainId, + ensAddress: standard2.ensAddress || null, + _defaultProvider: standard2._defaultProvider || null, + }; + } + } + return { + chainId: network, + name: 'unknown', + }; + } + if (typeof network === 'string') { + const standard2 = networks[network]; + if (standard2 == null) { + return null; + } + return { + name: standard2.name, + chainId: standard2.chainId, + ensAddress: standard2.ensAddress, + _defaultProvider: standard2._defaultProvider || null, + }; + } + const standard = networks[network.name]; + if (!standard) { + if (typeof network.chainId !== 'number') { + logger27.throwArgumentError( + 'invalid network chainId', + 'network', + network + ); + } + return network; + } + if (network.chainId !== 0 && network.chainId !== standard.chainId) { + logger27.throwArgumentError('network chainId mismatch', 'network', network); + } + let defaultProvider = network._defaultProvider || null; + if (defaultProvider == null && standard._defaultProvider) { + if (isRenetworkable(standard._defaultProvider)) { + defaultProvider = standard._defaultProvider.renetwork(network); + } else { + defaultProvider = standard._defaultProvider; + } + } + return { + name: network.name, + chainId: standard.chainId, + ensAddress: network.ensAddress || standard.ensAddress || null, + _defaultProvider: defaultProvider, + }; +} + +// node_modules/@ethersproject/providers/lib.esm/base-provider.js +init_shim(); +init_lib14(); +init_lib10(); +init_lib18(); +init_lib3(); +init_lib2(); +init_lib8(); +init_lib12(); +init_lib4(); +init_lib19(); +init_lib9(); +init_lib26(); +init_lib(); +import bech32 from 'bech32'; + +// node_modules/@ethersproject/providers/lib.esm/_version.js +init_shim(); +var version24 = 'providers/5.7.2'; + +// node_modules/@ethersproject/providers/lib.esm/formatter.js +init_shim(); +init_lib7(); +init_lib3(); +init_lib2(); +init_lib8(); +init_lib4(); +init_lib17(); +init_lib(); +var logger29 = new Logger(version24); +var Formatter = class { + constructor() { + this.formats = this.getDefaultFormats(); + } + getDefaultFormats() { + const formats = {}; + const address = this.address.bind(this); + const bigNumber = this.bigNumber.bind(this); + const blockTag = this.blockTag.bind(this); + const data = this.data.bind(this); + const hash3 = this.hash.bind(this); + const hex = this.hex.bind(this); + const number = this.number.bind(this); + const type = this.type.bind(this); + const strictData = (v) => { + return this.data(v, true); + }; + formats.transaction = { + hash: hash3, + type, + accessList: Formatter.allowNull(this.accessList.bind(this), null), + blockHash: Formatter.allowNull(hash3, null), + blockNumber: Formatter.allowNull(number, null), + transactionIndex: Formatter.allowNull(number, null), + confirmations: Formatter.allowNull(number, null), + from: address, + // either (gasPrice) or (maxPriorityFeePerGas + maxFeePerGas) + // must be set + gasPrice: Formatter.allowNull(bigNumber), + maxPriorityFeePerGas: Formatter.allowNull(bigNumber), + maxFeePerGas: Formatter.allowNull(bigNumber), + gasLimit: bigNumber, + to: Formatter.allowNull(address, null), + value: bigNumber, + nonce: number, + data, + r: Formatter.allowNull(this.uint256), + s: Formatter.allowNull(this.uint256), + v: Formatter.allowNull(number), + creates: Formatter.allowNull(address, null), + raw: Formatter.allowNull(data), + }; + formats.transactionRequest = { + from: Formatter.allowNull(address), + nonce: Formatter.allowNull(number), + gasLimit: Formatter.allowNull(bigNumber), + gasPrice: Formatter.allowNull(bigNumber), + maxPriorityFeePerGas: Formatter.allowNull(bigNumber), + maxFeePerGas: Formatter.allowNull(bigNumber), + to: Formatter.allowNull(address), + value: Formatter.allowNull(bigNumber), + data: Formatter.allowNull(strictData), + type: Formatter.allowNull(number), + accessList: Formatter.allowNull(this.accessList.bind(this), null), + }; + formats.receiptLog = { + transactionIndex: number, + blockNumber: number, + transactionHash: hash3, + address, + topics: Formatter.arrayOf(hash3), + data, + logIndex: number, + blockHash: hash3, + }; + formats.receipt = { + to: Formatter.allowNull(this.address, null), + from: Formatter.allowNull(this.address, null), + contractAddress: Formatter.allowNull(address, null), + transactionIndex: number, + // should be allowNull(hash), but broken-EIP-658 support is handled in receipt + root: Formatter.allowNull(hex), + gasUsed: bigNumber, + logsBloom: Formatter.allowNull(data), + blockHash: hash3, + transactionHash: hash3, + logs: Formatter.arrayOf(this.receiptLog.bind(this)), + blockNumber: number, + confirmations: Formatter.allowNull(number, null), + cumulativeGasUsed: bigNumber, + effectiveGasPrice: Formatter.allowNull(bigNumber), + status: Formatter.allowNull(number), + type, + }; + formats.block = { + hash: Formatter.allowNull(hash3), + parentHash: hash3, + number, + timestamp: number, + nonce: Formatter.allowNull(hex), + difficulty: this.difficulty.bind(this), + gasLimit: bigNumber, + gasUsed: bigNumber, + miner: Formatter.allowNull(address), + extraData: data, + transactions: Formatter.allowNull(Formatter.arrayOf(hash3)), + baseFeePerGas: Formatter.allowNull(bigNumber), + }; + formats.blockWithTransactions = shallowCopy(formats.block); + formats.blockWithTransactions.transactions = Formatter.allowNull( + Formatter.arrayOf(this.transactionResponse.bind(this)) + ); + formats.filter = { + fromBlock: Formatter.allowNull(blockTag, void 0), + toBlock: Formatter.allowNull(blockTag, void 0), + blockHash: Formatter.allowNull(hash3, void 0), + address: Formatter.allowNull(address, void 0), + topics: Formatter.allowNull(this.topics.bind(this), void 0), + }; + formats.filterLog = { + blockNumber: Formatter.allowNull(number), + blockHash: Formatter.allowNull(hash3), + transactionIndex: number, + removed: Formatter.allowNull(this.boolean.bind(this)), + address, + data: Formatter.allowFalsish(data, '0x'), + topics: Formatter.arrayOf(hash3), + transactionHash: hash3, + logIndex: number, + }; + return formats; + } + accessList(accessList) { + return accessListify(accessList || []); + } + // Requires a BigNumberish that is within the IEEE754 safe integer range; returns a number + // Strict! Used on input. + number(number) { + if (number === '0x') { + return 0; + } + return BigNumber.from(number).toNumber(); + } + type(number) { + if (number === '0x' || number == null) { + return 0; + } + return BigNumber.from(number).toNumber(); + } + // Strict! Used on input. + bigNumber(value) { + return BigNumber.from(value); + } + // Requires a boolean, "true" or "false"; returns a boolean + boolean(value) { + if (typeof value === 'boolean') { + return value; + } + if (typeof value === 'string') { + value = value.toLowerCase(); + if (value === 'true') { + return true; + } + if (value === 'false') { + return false; + } + } + throw new Error('invalid boolean - ' + value); + } + hex(value, strict) { + if (typeof value === 'string') { + if (!strict && value.substring(0, 2) !== '0x') { + value = '0x' + value; + } + if (isHexString(value)) { + return value.toLowerCase(); + } + } + return logger29.throwArgumentError('invalid hash', 'value', value); + } + data(value, strict) { + const result = this.hex(value, strict); + if (result.length % 2 !== 0) { + throw new Error('invalid data; odd-length - ' + value); + } + return result; + } + // Requires an address + // Strict! Used on input. + address(value) { + return getAddress(value); + } + callAddress(value) { + if (!isHexString(value, 32)) { + return null; + } + const address = getAddress(hexDataSlice(value, 12)); + return address === AddressZero ? null : address; + } + contractAddress(value) { + return getContractAddress(value); + } + // Strict! Used on input. + blockTag(blockTag) { + if (blockTag == null) { + return 'latest'; + } + if (blockTag === 'earliest') { + return '0x0'; + } + switch (blockTag) { + case 'earliest': + return '0x0'; + case 'latest': + case 'pending': + case 'safe': + case 'finalized': + return blockTag; + } + if (typeof blockTag === 'number' || isHexString(blockTag)) { + return hexValue(blockTag); + } + throw new Error('invalid blockTag'); + } + // Requires a hash, optionally requires 0x prefix; returns prefixed lowercase hash. + hash(value, strict) { + const result = this.hex(value, strict); + if (hexDataLength(result) !== 32) { + return logger29.throwArgumentError('invalid hash', 'value', value); + } + return result; + } + // Returns the difficulty as a number, or if too large (i.e. PoA network) null + difficulty(value) { + if (value == null) { + return null; + } + const v = BigNumber.from(value); + try { + return v.toNumber(); + } catch (error) {} + return null; + } + uint256(value) { + if (!isHexString(value)) { + throw new Error('invalid uint256'); + } + return hexZeroPad(value, 32); + } + _block(value, format) { + if (value.author != null && value.miner == null) { + value.miner = value.author; + } + const difficulty = + value._difficulty != null ? value._difficulty : value.difficulty; + const result = Formatter.check(format, value); + result._difficulty = difficulty == null ? null : BigNumber.from(difficulty); + return result; + } + block(value) { + return this._block(value, this.formats.block); + } + blockWithTransactions(value) { + return this._block(value, this.formats.blockWithTransactions); + } + // Strict! Used on input. + transactionRequest(value) { + return Formatter.check(this.formats.transactionRequest, value); + } + transactionResponse(transaction) { + if (transaction.gas != null && transaction.gasLimit == null) { + transaction.gasLimit = transaction.gas; + } + if (transaction.to && BigNumber.from(transaction.to).isZero()) { + transaction.to = '0x0000000000000000000000000000000000000000'; + } + if (transaction.input != null && transaction.data == null) { + transaction.data = transaction.input; + } + if (transaction.to == null && transaction.creates == null) { + transaction.creates = this.contractAddress(transaction); + } + if ( + (transaction.type === 1 || transaction.type === 2) && + transaction.accessList == null + ) { + transaction.accessList = []; + } + const result = Formatter.check(this.formats.transaction, transaction); + if (transaction.chainId != null) { + let chainId = transaction.chainId; + if (isHexString(chainId)) { + chainId = BigNumber.from(chainId).toNumber(); + } + result.chainId = chainId; + } else { + let chainId = transaction.networkId; + if (chainId == null && result.v == null) { + chainId = transaction.chainId; + } + if (isHexString(chainId)) { + chainId = BigNumber.from(chainId).toNumber(); + } + if (typeof chainId !== 'number' && result.v != null) { + chainId = (result.v - 35) / 2; + if (chainId < 0) { + chainId = 0; + } + chainId = parseInt(chainId); + } + if (typeof chainId !== 'number') { + chainId = 0; + } + result.chainId = chainId; + } + if (result.blockHash && result.blockHash.replace(/0/g, '') === 'x') { + result.blockHash = null; + } + return result; + } + transaction(value) { + return parse(value); + } + receiptLog(value) { + return Formatter.check(this.formats.receiptLog, value); + } + receipt(value) { + const result = Formatter.check(this.formats.receipt, value); + if (result.root != null) { + if (result.root.length <= 4) { + const value2 = BigNumber.from(result.root).toNumber(); + if (value2 === 0 || value2 === 1) { + if (result.status != null && result.status !== value2) { + logger29.throwArgumentError( + 'alt-root-status/status mismatch', + 'value', + { root: result.root, status: result.status } + ); + } + result.status = value2; + delete result.root; + } else { + logger29.throwArgumentError( + 'invalid alt-root-status', + 'value.root', + result.root + ); + } + } else if (result.root.length !== 66) { + logger29.throwArgumentError( + 'invalid root hash', + 'value.root', + result.root + ); + } + } + if (result.status != null) { + result.byzantium = true; + } + return result; + } + topics(value) { + if (Array.isArray(value)) { + return value.map((v) => this.topics(v)); + } else if (value != null) { + return this.hash(value, true); + } + return null; + } + filter(value) { + return Formatter.check(this.formats.filter, value); + } + filterLog(value) { + return Formatter.check(this.formats.filterLog, value); + } + static check(format, object) { + const result = {}; + for (const key2 in format) { + try { + const value = format[key2](object[key2]); + if (value !== void 0) { + result[key2] = value; + } + } catch (error) { + error.checkKey = key2; + error.checkValue = object[key2]; + throw error; + } + } + return result; + } + // if value is null-ish, nullValue is returned + static allowNull(format, nullValue) { + return function (value) { + if (value == null) { + return nullValue; + } + return format(value); + }; + } + // If value is false-ish, replaceValue is returned + static allowFalsish(format, replaceValue) { + return function (value) { + if (!value) { + return replaceValue; + } + return format(value); + }; + } + // Requires an Array satisfying check + static arrayOf(format) { + return function (array) { + if (!Array.isArray(array)) { + throw new Error('not an array'); + } + const result = []; + array.forEach(function (value) { + result.push(format(value)); + }); + return result; + }; + } +}; +function isCommunityResourcable(value) { + return value && typeof value.isCommunityResource === 'function'; +} +function isCommunityResource(value) { + return isCommunityResourcable(value) && value.isCommunityResource(); +} +var throttleMessage = false; +function showThrottleMessage() { + if (throttleMessage) { + return; + } + throttleMessage = true; + console.log('========= NOTICE ========='); + console.log('Request-Rate Exceeded (this message will not be repeated)'); + console.log(''); + console.log( + 'The default API keys for each service are provided as a highly-throttled,' + ); + console.log( + 'community resource for low-traffic projects and early prototyping.' + ); + console.log(''); + console.log( + 'While your application will continue to function, we highly recommended' + ); + console.log( + 'signing up for your own API keys to improve performance, increase your' + ); + console.log( + 'request rate/limit and enable other perks, such as metrics and advanced APIs.' + ); + console.log(''); + console.log('For more details: https://docs.ethers.io/api-keys/'); + console.log('=========================='); +} + +// node_modules/@ethersproject/providers/lib.esm/base-provider.js +var __awaiter10 = 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 (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var logger30 = new Logger(version24); +var MAX_CCIP_REDIRECTS = 10; +function checkTopic(topic) { + if (topic == null) { + return 'null'; + } + if (hexDataLength(topic) !== 32) { + logger30.throwArgumentError('invalid topic', 'topic', topic); + } + return topic.toLowerCase(); +} +function serializeTopics(topics) { + topics = topics.slice(); + while (topics.length > 0 && topics[topics.length - 1] == null) { + topics.pop(); + } + return topics + .map((topic) => { + if (Array.isArray(topic)) { + const unique = {}; + topic.forEach((topic2) => { + unique[checkTopic(topic2)] = true; + }); + const sorted = Object.keys(unique); + sorted.sort(); + return sorted.join('|'); + } else { + return checkTopic(topic); + } + }) + .join('&'); +} +function deserializeTopics(data) { + if (data === '') { + return []; + } + return data.split(/&/g).map((topic) => { + if (topic === '') { + return []; + } + const comps = topic.split('|').map((topic2) => { + return topic2 === 'null' ? null : topic2; + }); + return comps.length === 1 ? comps[0] : comps; + }); +} +function getEventTag2(eventName) { + if (typeof eventName === 'string') { + eventName = eventName.toLowerCase(); + if (hexDataLength(eventName) === 32) { + return 'tx:' + eventName; + } + if (eventName.indexOf(':') === -1) { + return eventName; + } + } else if (Array.isArray(eventName)) { + return 'filter:*:' + serializeTopics(eventName); + } else if (ForkEvent.isForkEvent(eventName)) { + logger30.warn('not implemented'); + throw new Error('not implemented'); + } else if (eventName && typeof eventName === 'object') { + return ( + 'filter:' + + (eventName.address || '*') + + ':' + + serializeTopics(eventName.topics || []) + ); + } + throw new Error('invalid event - ' + eventName); +} +function getTime() { + return /* @__PURE__ */ new Date().getTime(); +} +function stall(duration) { + return new Promise((resolve) => { + setTimeout(resolve, duration); + }); +} +var PollableEvents = ['block', 'network', 'pending', 'poll']; +var Event2 = class { + constructor(tag, listener, once) { + defineReadOnly(this, 'tag', tag); + defineReadOnly(this, 'listener', listener); + defineReadOnly(this, 'once', once); + this._lastBlockNumber = -2; + this._inflight = false; + } + get event() { + switch (this.type) { + case 'tx': + return this.hash; + case 'filter': + return this.filter; + } + return this.tag; + } + get type() { + return this.tag.split(':')[0]; + } + get hash() { + const comps = this.tag.split(':'); + if (comps[0] !== 'tx') { + return null; + } + return comps[1]; + } + get filter() { + const comps = this.tag.split(':'); + if (comps[0] !== 'filter') { + return null; + } + const address = comps[1]; + const topics = deserializeTopics(comps[2]); + const filter = {}; + if (topics.length > 0) { + filter.topics = topics; + } + if (address && address !== '*') { + filter.address = address; + } + return filter; + } + pollable() { + return this.tag.indexOf(':') >= 0 || PollableEvents.indexOf(this.tag) >= 0; + } +}; +var coinInfos = { + 0: { symbol: 'btc', p2pkh: 0, p2sh: 5, prefix: 'bc' }, + 2: { symbol: 'ltc', p2pkh: 48, p2sh: 50, prefix: 'ltc' }, + 3: { symbol: 'doge', p2pkh: 30, p2sh: 22 }, + 60: { symbol: 'eth', ilk: 'eth' }, + 61: { symbol: 'etc', ilk: 'eth' }, + 700: { symbol: 'xdai', ilk: 'eth' }, +}; +function bytes32ify(value) { + return hexZeroPad(BigNumber.from(value).toHexString(), 32); +} +function base58Encode(data) { + return Base58.encode( + concat([data, hexDataSlice(sha256(sha256(data)), 0, 4)]) + ); +} +var matcherIpfs = new RegExp('^(ipfs)://(.*)$', 'i'); +var matchers = [ + new RegExp('^(https)://(.*)$', 'i'), + new RegExp('^(data):(.*)$', 'i'), + matcherIpfs, + new RegExp('^eip155:[0-9]+/(erc[0-9]+):(.*)$', 'i'), +]; +function _parseString(result, start) { + try { + return toUtf8String(_parseBytes(result, start)); + } catch (error) {} + return null; +} +function _parseBytes(result, start) { + if (result === '0x') { + return null; + } + const offset = BigNumber.from( + hexDataSlice(result, start, start + 32) + ).toNumber(); + const length = BigNumber.from( + hexDataSlice(result, offset, offset + 32) + ).toNumber(); + return hexDataSlice(result, offset + 32, offset + 32 + length); +} +function getIpfsLink(link) { + if (link.match(/^ipfs:\/\/ipfs\//i)) { + link = link.substring(12); + } else if (link.match(/^ipfs:\/\//i)) { + link = link.substring(7); + } else { + logger30.throwArgumentError('unsupported IPFS format', 'link', link); + } + return `https://gateway.ipfs.io/ipfs/${link}`; +} +function numPad(value) { + const result = arrayify(value); + if (result.length > 32) { + throw new Error('internal; should not happen'); + } + const padded = new Uint8Array(32); + padded.set(result, 32 - result.length); + return padded; +} +function bytesPad(value) { + if (value.length % 32 === 0) { + return value; + } + const result = new Uint8Array(Math.ceil(value.length / 32) * 32); + result.set(value); + return result; +} +function encodeBytes(datas) { + const result = []; + let byteCount = 0; + for (let i2 = 0; i2 < datas.length; i2++) { + result.push(null); + byteCount += 32; + } + for (let i2 = 0; i2 < datas.length; i2++) { + const data = arrayify(datas[i2]); + result[i2] = numPad(byteCount); + result.push(numPad(data.length)); + result.push(bytesPad(data)); + byteCount += 32 + Math.ceil(data.length / 32) * 32; + } + return hexConcat(result); +} +var Resolver = class { + // The resolvedAddress is only for creating a ReverseLookup resolver + constructor(provider, address, name, resolvedAddress) { + defineReadOnly(this, 'provider', provider); + defineReadOnly(this, 'name', name); + defineReadOnly(this, 'address', provider.formatter.address(address)); + defineReadOnly(this, '_resolvedAddress', resolvedAddress); + } + supportsWildcard() { + if (!this._supportsEip2544) { + this._supportsEip2544 = this.provider + .call({ + to: this.address, + data: '0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000', + }) + .then((result) => { + return BigNumber.from(result).eq(1); + }) + .catch((error) => { + if (error.code === Logger.errors.CALL_EXCEPTION) { + return false; + } + this._supportsEip2544 = null; + throw error; + }); + } + return this._supportsEip2544; + } + _fetch(selector, parameters) { + return __awaiter10(this, void 0, void 0, function* () { + const tx = { + to: this.address, + ccipReadEnabled: true, + data: hexConcat([selector, namehash(this.name), parameters || '0x']), + }; + let parseBytes = false; + if (yield this.supportsWildcard()) { + parseBytes = true; + tx.data = hexConcat([ + '0x9061b923', + encodeBytes([dnsEncode(this.name), tx.data]), + ]); + } + try { + let result = yield this.provider.call(tx); + if (arrayify(result).length % 32 === 4) { + logger30.throwError( + 'resolver threw error', + Logger.errors.CALL_EXCEPTION, + { + transaction: tx, + data: result, + } + ); + } + if (parseBytes) { + result = _parseBytes(result, 0); + } + return result; + } catch (error) { + if (error.code === Logger.errors.CALL_EXCEPTION) { + return null; + } + throw error; + } + }); + } + _fetchBytes(selector, parameters) { + return __awaiter10(this, void 0, void 0, function* () { + const result = yield this._fetch(selector, parameters); + if (result != null) { + return _parseBytes(result, 0); + } + return null; + }); + } + _getAddress(coinType, hexBytes) { + const coinInfo = coinInfos[String(coinType)]; + if (coinInfo == null) { + logger30.throwError( + `unsupported coin type: ${coinType}`, + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: `getAddress(${coinType})`, + } + ); + } + if (coinInfo.ilk === 'eth') { + return this.provider.formatter.address(hexBytes); + } + const bytes = arrayify(hexBytes); + if (coinInfo.p2pkh != null) { + const p2pkh = hexBytes.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/); + if (p2pkh) { + const length = parseInt(p2pkh[1], 16); + if (p2pkh[2].length === length * 2 && length >= 1 && length <= 75) { + return base58Encode(concat([[coinInfo.p2pkh], '0x' + p2pkh[2]])); + } + } + } + if (coinInfo.p2sh != null) { + const p2sh = hexBytes.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/); + if (p2sh) { + const length = parseInt(p2sh[1], 16); + if (p2sh[2].length === length * 2 && length >= 1 && length <= 75) { + return base58Encode(concat([[coinInfo.p2sh], '0x' + p2sh[2]])); + } + } + } + if (coinInfo.prefix != null) { + const length = bytes[1]; + let version28 = bytes[0]; + if (version28 === 0) { + if (length !== 20 && length !== 32) { + version28 = -1; + } + } else { + version28 = -1; + } + if ( + version28 >= 0 && + bytes.length === 2 + length && + length >= 1 && + length <= 75 + ) { + const words2 = bech32.toWords(bytes.slice(2)); + words2.unshift(version28); + return bech32.encode(coinInfo.prefix, words2); + } + } + return null; + } + getAddress(coinType) { + return __awaiter10(this, void 0, void 0, function* () { + if (coinType == null) { + coinType = 60; + } + if (coinType === 60) { + try { + const result = yield this._fetch('0x3b3b57de'); + if (result === '0x' || result === HashZero) { + return null; + } + return this.provider.formatter.callAddress(result); + } catch (error) { + if (error.code === Logger.errors.CALL_EXCEPTION) { + return null; + } + throw error; + } + } + const hexBytes = yield this._fetchBytes( + '0xf1cb7e06', + bytes32ify(coinType) + ); + if (hexBytes == null || hexBytes === '0x') { + return null; + } + const address = this._getAddress(coinType, hexBytes); + if (address == null) { + logger30.throwError( + `invalid or unsupported coin data`, + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: `getAddress(${coinType})`, + coinType, + data: hexBytes, + } + ); + } + return address; + }); + } + getAvatar() { + return __awaiter10(this, void 0, void 0, function* () { + const linkage = [{ type: 'name', content: this.name }]; + try { + const avatar = yield this.getText('avatar'); + if (avatar == null) { + return null; + } + for (let i2 = 0; i2 < matchers.length; i2++) { + const match = avatar.match(matchers[i2]); + if (match == null) { + continue; + } + const scheme = match[1].toLowerCase(); + switch (scheme) { + case 'https': + linkage.push({ type: 'url', content: avatar }); + return { linkage, url: avatar }; + case 'data': + linkage.push({ type: 'data', content: avatar }); + return { linkage, url: avatar }; + case 'ipfs': + linkage.push({ type: 'ipfs', content: avatar }); + return { linkage, url: getIpfsLink(avatar) }; + case 'erc721': + case 'erc1155': { + const selector = + scheme === 'erc721' ? '0xc87b56dd' : '0x0e89341c'; + linkage.push({ type: scheme, content: avatar }); + const owner = this._resolvedAddress || (yield this.getAddress()); + const comps = (match[2] || '').split('/'); + if (comps.length !== 2) { + return null; + } + const addr = yield this.provider.formatter.address(comps[0]); + const tokenId = hexZeroPad( + BigNumber.from(comps[1]).toHexString(), + 32 + ); + if (scheme === 'erc721') { + const tokenOwner = this.provider.formatter.callAddress( + yield this.provider.call({ + to: addr, + data: hexConcat(['0x6352211e', tokenId]), + }) + ); + if (owner !== tokenOwner) { + return null; + } + linkage.push({ type: 'owner', content: tokenOwner }); + } else if (scheme === 'erc1155') { + const balance = BigNumber.from( + yield this.provider.call({ + to: addr, + data: hexConcat([ + '0x00fdd58e', + hexZeroPad(owner, 32), + tokenId, + ]), + }) + ); + if (balance.isZero()) { + return null; + } + linkage.push({ type: 'balance', content: balance.toString() }); + } + const tx = { + to: this.provider.formatter.address(comps[0]), + data: hexConcat([selector, tokenId]), + }; + let metadataUrl = _parseString(yield this.provider.call(tx), 0); + if (metadataUrl == null) { + return null; + } + linkage.push({ type: 'metadata-url-base', content: metadataUrl }); + if (scheme === 'erc1155') { + metadataUrl = metadataUrl.replace('{id}', tokenId.substring(2)); + linkage.push({ + type: 'metadata-url-expanded', + content: metadataUrl, + }); + } + if (metadataUrl.match(/^ipfs:/i)) { + metadataUrl = getIpfsLink(metadataUrl); + } + linkage.push({ type: 'metadata-url', content: metadataUrl }); + const metadata = yield fetchJson(metadataUrl); + if (!metadata) { + return null; + } + linkage.push({ + type: 'metadata', + content: JSON.stringify(metadata), + }); + let imageUrl = metadata.image; + if (typeof imageUrl !== 'string') { + return null; + } + if (imageUrl.match(/^(https:\/\/|data:)/i)) { + } else { + const ipfs = imageUrl.match(matcherIpfs); + if (ipfs == null) { + return null; + } + linkage.push({ type: 'url-ipfs', content: imageUrl }); + imageUrl = getIpfsLink(imageUrl); + } + linkage.push({ type: 'url', content: imageUrl }); + return { linkage, url: imageUrl }; + } + } + } + } catch (error) {} + return null; + }); + } + getContentHash() { + return __awaiter10(this, void 0, void 0, function* () { + const hexBytes = yield this._fetchBytes('0xbc1c58d1'); + if (hexBytes == null || hexBytes === '0x') { + return null; + } + const ipfs = hexBytes.match( + /^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/ + ); + if (ipfs) { + const length = parseInt(ipfs[3], 16); + if (ipfs[4].length === length * 2) { + return 'ipfs://' + Base58.encode('0x' + ipfs[1]); + } + } + const ipns = hexBytes.match( + /^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/ + ); + if (ipns) { + const length = parseInt(ipns[3], 16); + if (ipns[4].length === length * 2) { + return 'ipns://' + Base58.encode('0x' + ipns[1]); + } + } + const swarm = hexBytes.match(/^0xe40101fa011b20([0-9a-f]*)$/); + if (swarm) { + if (swarm[1].length === 32 * 2) { + return 'bzz://' + swarm[1]; + } + } + const skynet = hexBytes.match(/^0x90b2c605([0-9a-f]*)$/); + if (skynet) { + if (skynet[1].length === 34 * 2) { + const urlSafe = { '=': '', '+': '-', '/': '_' }; + const hash3 = encode2('0x' + skynet[1]).replace( + /[=+\/]/g, + (a2) => urlSafe[a2] + ); + return 'sia://' + hash3; + } + } + return logger30.throwError( + `invalid or unsupported content hash data`, + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'getContentHash()', + data: hexBytes, + } + ); + }); + } + getText(key2) { + return __awaiter10(this, void 0, void 0, function* () { + let keyBytes = toUtf8Bytes(key2); + keyBytes = concat([ + bytes32ify(64), + bytes32ify(keyBytes.length), + keyBytes, + ]); + if (keyBytes.length % 32 !== 0) { + keyBytes = concat([ + keyBytes, + hexZeroPad('0x', 32 - (key2.length % 32)), + ]); + } + const hexBytes = yield this._fetchBytes('0x59d1d43c', hexlify(keyBytes)); + if (hexBytes == null || hexBytes === '0x') { + return null; + } + return toUtf8String(hexBytes); + }); + } +}; +var defaultFormatter = null; +var nextPollId = 1; +var BaseProvider = class extends Provider { + /** + * ready + * + * A Promise that resolves only once the provider is ready. + * + * Sub-classes that call the super with a network without a chainId + * MUST set this. Standard named networks have a known chainId. + * + */ + constructor(network) { + super(); + this._events = []; + this._emitted = { block: -2 }; + this.disableCcipRead = false; + this.formatter = new.target.getFormatter(); + defineReadOnly(this, 'anyNetwork', network === 'any'); + if (this.anyNetwork) { + network = this.detectNetwork(); + } + if (network instanceof Promise) { + this._networkPromise = network; + network.catch((error) => {}); + this._ready().catch((error) => {}); + } else { + const knownNetwork = getStatic(new.target, 'getNetwork')(network); + if (knownNetwork) { + defineReadOnly(this, '_network', knownNetwork); + this.emit('network', knownNetwork, null); + } else { + logger30.throwArgumentError('invalid network', 'network', network); + } + } + this._maxInternalBlockNumber = -1024; + this._lastBlockNumber = -2; + this._maxFilterBlockRange = 10; + this._pollingInterval = 4e3; + this._fastQueryDate = 0; + } + _ready() { + return __awaiter10(this, void 0, void 0, function* () { + if (this._network == null) { + let network = null; + if (this._networkPromise) { + try { + network = yield this._networkPromise; + } catch (error) {} + } + if (network == null) { + network = yield this.detectNetwork(); + } + if (!network) { + logger30.throwError( + 'no network detected', + Logger.errors.UNKNOWN_ERROR, + {} + ); + } + if (this._network == null) { + if (this.anyNetwork) { + this._network = network; + } else { + defineReadOnly(this, '_network', network); + } + this.emit('network', network, null); + } + } + return this._network; + }); + } + // This will always return the most recently established network. + // For "any", this can change (a "network" event is emitted before + // any change is reflected); otherwise this cannot change + get ready() { + return poll(() => { + return this._ready().then( + (network) => { + return network; + }, + (error) => { + if ( + error.code === Logger.errors.NETWORK_ERROR && + error.event === 'noNetwork' + ) { + return void 0; + } + throw error; + } + ); + }); + } + // @TODO: Remove this and just create a singleton formatter + static getFormatter() { + if (defaultFormatter == null) { + defaultFormatter = new Formatter(); + } + return defaultFormatter; + } + // @TODO: Remove this and just use getNetwork + static getNetwork(network) { + return getNetwork(network == null ? 'homestead' : network); + } + ccipReadFetch(tx, calldata, urls) { + return __awaiter10(this, void 0, void 0, function* () { + if (this.disableCcipRead || urls.length === 0) { + return null; + } + const sender = tx.to.toLowerCase(); + const data = calldata.toLowerCase(); + const errorMessages = []; + for (let i2 = 0; i2 < urls.length; i2++) { + const url = urls[i2]; + const href = url.replace('{sender}', sender).replace('{data}', data); + const json = + url.indexOf('{data}') >= 0 ? null : JSON.stringify({ data, sender }); + const result = yield fetchJson( + { url: href, errorPassThrough: true }, + json, + (value, response) => { + value.status = response.statusCode; + return value; + } + ); + if (result.data) { + return result.data; + } + const errorMessage = result.message || 'unknown error'; + if (result.status >= 400 && result.status < 500) { + return logger30.throwError( + `response not found during CCIP fetch: ${errorMessage}`, + Logger.errors.SERVER_ERROR, + { url, errorMessage } + ); + } + errorMessages.push(errorMessage); + } + return logger30.throwError( + `error encountered during CCIP fetch: ${errorMessages + .map((m) => JSON.stringify(m)) + .join(', ')}`, + Logger.errors.SERVER_ERROR, + { + urls, + errorMessages, + } + ); + }); + } + // Fetches the blockNumber, but will reuse any result that is less + // than maxAge old or has been requested since the last request + _getInternalBlockNumber(maxAge) { + return __awaiter10(this, void 0, void 0, function* () { + yield this._ready(); + if (maxAge > 0) { + while (this._internalBlockNumber) { + const internalBlockNumber = this._internalBlockNumber; + try { + const result = yield internalBlockNumber; + if (getTime() - result.respTime <= maxAge) { + return result.blockNumber; + } + break; + } catch (error) { + if (this._internalBlockNumber === internalBlockNumber) { + break; + } + } + } + } + const reqTime = getTime(); + const checkInternalBlockNumber = resolveProperties({ + blockNumber: this.perform('getBlockNumber', {}), + networkError: this.getNetwork().then( + (network) => null, + (error) => error + ), + }).then(({ blockNumber, networkError }) => { + if (networkError) { + if (this._internalBlockNumber === checkInternalBlockNumber) { + this._internalBlockNumber = null; + } + throw networkError; + } + const respTime = getTime(); + blockNumber = BigNumber.from(blockNumber).toNumber(); + if (blockNumber < this._maxInternalBlockNumber) { + blockNumber = this._maxInternalBlockNumber; + } + this._maxInternalBlockNumber = blockNumber; + this._setFastBlockNumber(blockNumber); + return { blockNumber, reqTime, respTime }; + }); + this._internalBlockNumber = checkInternalBlockNumber; + checkInternalBlockNumber.catch((error) => { + if (this._internalBlockNumber === checkInternalBlockNumber) { + this._internalBlockNumber = null; + } + }); + return (yield checkInternalBlockNumber).blockNumber; + }); + } + poll() { + return __awaiter10(this, void 0, void 0, function* () { + const pollId = nextPollId++; + const runners = []; + let blockNumber = null; + try { + blockNumber = yield this._getInternalBlockNumber( + 100 + this.pollingInterval / 2 + ); + } catch (error) { + this.emit('error', error); + return; + } + this._setFastBlockNumber(blockNumber); + this.emit('poll', pollId, blockNumber); + if (blockNumber === this._lastBlockNumber) { + this.emit('didPoll', pollId); + return; + } + if (this._emitted.block === -2) { + this._emitted.block = blockNumber - 1; + } + if (Math.abs(this._emitted.block - blockNumber) > 1e3) { + logger30.warn( + `network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${blockNumber})` + ); + this.emit( + 'error', + logger30.makeError( + 'network block skew detected', + Logger.errors.NETWORK_ERROR, + { + blockNumber, + event: 'blockSkew', + previousBlockNumber: this._emitted.block, + } + ) + ); + this.emit('block', blockNumber); + } else { + for (let i2 = this._emitted.block + 1; i2 <= blockNumber; i2++) { + this.emit('block', i2); + } + } + if (this._emitted.block !== blockNumber) { + this._emitted.block = blockNumber; + Object.keys(this._emitted).forEach((key2) => { + if (key2 === 'block') { + return; + } + const eventBlockNumber = this._emitted[key2]; + if (eventBlockNumber === 'pending') { + return; + } + if (blockNumber - eventBlockNumber > 12) { + delete this._emitted[key2]; + } + }); + } + if (this._lastBlockNumber === -2) { + this._lastBlockNumber = blockNumber - 1; + } + this._events.forEach((event) => { + switch (event.type) { + case 'tx': { + const hash3 = event.hash; + let runner = this.getTransactionReceipt(hash3) + .then((receipt) => { + if (!receipt || receipt.blockNumber == null) { + return null; + } + this._emitted['t:' + hash3] = receipt.blockNumber; + this.emit(hash3, receipt); + return null; + }) + .catch((error) => { + this.emit('error', error); + }); + runners.push(runner); + break; + } + case 'filter': { + if (!event._inflight) { + event._inflight = true; + if (event._lastBlockNumber === -2) { + event._lastBlockNumber = blockNumber - 1; + } + const filter = event.filter; + filter.fromBlock = event._lastBlockNumber + 1; + filter.toBlock = blockNumber; + const minFromBlock = filter.toBlock - this._maxFilterBlockRange; + if (minFromBlock > filter.fromBlock) { + filter.fromBlock = minFromBlock; + } + if (filter.fromBlock < 0) { + filter.fromBlock = 0; + } + const runner = this.getLogs(filter) + .then((logs) => { + event._inflight = false; + if (logs.length === 0) { + return; + } + logs.forEach((log3) => { + if (log3.blockNumber > event._lastBlockNumber) { + event._lastBlockNumber = log3.blockNumber; + } + this._emitted['b:' + log3.blockHash] = log3.blockNumber; + this._emitted['t:' + log3.transactionHash] = + log3.blockNumber; + this.emit(filter, log3); + }); + }) + .catch((error) => { + this.emit('error', error); + event._inflight = false; + }); + runners.push(runner); + } + break; + } + } + }); + this._lastBlockNumber = blockNumber; + Promise.all(runners) + .then(() => { + this.emit('didPoll', pollId); + }) + .catch((error) => { + this.emit('error', error); + }); + return; + }); + } + // Deprecated; do not use this + resetEventsBlock(blockNumber) { + this._lastBlockNumber = blockNumber - 1; + if (this.polling) { + this.poll(); + } + } + get network() { + return this._network; + } + // This method should query the network if the underlying network + // can change, such as when connected to a JSON-RPC backend + detectNetwork() { + return __awaiter10(this, void 0, void 0, function* () { + return logger30.throwError( + 'provider does not support network detection', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'provider.detectNetwork', + } + ); + }); + } + getNetwork() { + return __awaiter10(this, void 0, void 0, function* () { + const network = yield this._ready(); + const currentNetwork = yield this.detectNetwork(); + if (network.chainId !== currentNetwork.chainId) { + if (this.anyNetwork) { + this._network = currentNetwork; + this._lastBlockNumber = -2; + this._fastBlockNumber = null; + this._fastBlockNumberPromise = null; + this._fastQueryDate = 0; + this._emitted.block = -2; + this._maxInternalBlockNumber = -1024; + this._internalBlockNumber = null; + this.emit('network', currentNetwork, network); + yield stall(0); + return this._network; + } + const error = logger30.makeError( + 'underlying network changed', + Logger.errors.NETWORK_ERROR, + { + event: 'changed', + network, + detectedNetwork: currentNetwork, + } + ); + this.emit('error', error); + throw error; + } + return network; + }); + } + get blockNumber() { + this._getInternalBlockNumber(100 + this.pollingInterval / 2).then( + (blockNumber) => { + this._setFastBlockNumber(blockNumber); + }, + (error) => {} + ); + return this._fastBlockNumber != null ? this._fastBlockNumber : -1; + } + get polling() { + return this._poller != null; + } + set polling(value) { + if (value && !this._poller) { + this._poller = setInterval(() => { + this.poll(); + }, this.pollingInterval); + if (!this._bootstrapPoll) { + this._bootstrapPoll = setTimeout(() => { + this.poll(); + this._bootstrapPoll = setTimeout(() => { + if (!this._poller) { + this.poll(); + } + this._bootstrapPoll = null; + }, this.pollingInterval); + }, 0); + } + } else if (!value && this._poller) { + clearInterval(this._poller); + this._poller = null; + } + } + get pollingInterval() { + return this._pollingInterval; + } + set pollingInterval(value) { + if ( + typeof value !== 'number' || + value <= 0 || + parseInt(String(value)) != value + ) { + throw new Error('invalid polling interval'); + } + this._pollingInterval = value; + if (this._poller) { + clearInterval(this._poller); + this._poller = setInterval(() => { + this.poll(); + }, this._pollingInterval); + } + } + _getFastBlockNumber() { + const now2 = getTime(); + if (now2 - this._fastQueryDate > 2 * this._pollingInterval) { + this._fastQueryDate = now2; + this._fastBlockNumberPromise = this.getBlockNumber().then( + (blockNumber) => { + if ( + this._fastBlockNumber == null || + blockNumber > this._fastBlockNumber + ) { + this._fastBlockNumber = blockNumber; + } + return this._fastBlockNumber; + } + ); + } + return this._fastBlockNumberPromise; + } + _setFastBlockNumber(blockNumber) { + if (this._fastBlockNumber != null && blockNumber < this._fastBlockNumber) { + return; + } + this._fastQueryDate = getTime(); + if (this._fastBlockNumber == null || blockNumber > this._fastBlockNumber) { + this._fastBlockNumber = blockNumber; + this._fastBlockNumberPromise = Promise.resolve(blockNumber); + } + } + waitForTransaction(transactionHash, confirmations, timeout) { + return __awaiter10(this, void 0, void 0, function* () { + return this._waitForTransaction( + transactionHash, + confirmations == null ? 1 : confirmations, + timeout || 0, + null + ); + }); + } + _waitForTransaction(transactionHash, confirmations, timeout, replaceable) { + return __awaiter10(this, void 0, void 0, function* () { + const receipt = yield this.getTransactionReceipt(transactionHash); + if ((receipt ? receipt.confirmations : 0) >= confirmations) { + return receipt; + } + return new Promise((resolve, reject) => { + const cancelFuncs = []; + let done = false; + const alreadyDone = function () { + if (done) { + return true; + } + done = true; + cancelFuncs.forEach((func) => { + func(); + }); + return false; + }; + const minedHandler = (receipt2) => { + if (receipt2.confirmations < confirmations) { + return; + } + if (alreadyDone()) { + return; + } + resolve(receipt2); + }; + this.on(transactionHash, minedHandler); + cancelFuncs.push(() => { + this.removeListener(transactionHash, minedHandler); + }); + if (replaceable) { + let lastBlockNumber = replaceable.startBlock; + let scannedBlock = null; + const replaceHandler = (blockNumber) => + __awaiter10(this, void 0, void 0, function* () { + if (done) { + return; + } + yield stall(1e3); + this.getTransactionCount(replaceable.from).then( + (nonce) => + __awaiter10(this, void 0, void 0, function* () { + if (done) { + return; + } + if (nonce <= replaceable.nonce) { + lastBlockNumber = blockNumber; + } else { + { + const mined = yield this.getTransaction( + transactionHash + ); + if (mined && mined.blockNumber != null) { + return; + } + } + if (scannedBlock == null) { + scannedBlock = lastBlockNumber - 3; + if (scannedBlock < replaceable.startBlock) { + scannedBlock = replaceable.startBlock; + } + } + while (scannedBlock <= blockNumber) { + if (done) { + return; + } + const block = yield this.getBlockWithTransactions( + scannedBlock + ); + for (let ti = 0; ti < block.transactions.length; ti++) { + const tx = block.transactions[ti]; + if (tx.hash === transactionHash) { + return; + } + if ( + tx.from === replaceable.from && + tx.nonce === replaceable.nonce + ) { + if (done) { + return; + } + const receipt2 = yield this.waitForTransaction( + tx.hash, + confirmations + ); + if (alreadyDone()) { + return; + } + let reason = 'replaced'; + if ( + tx.data === replaceable.data && + tx.to === replaceable.to && + tx.value.eq(replaceable.value) + ) { + reason = 'repriced'; + } else if ( + tx.data === '0x' && + tx.from === tx.to && + tx.value.isZero() + ) { + reason = 'cancelled'; + } + reject( + logger30.makeError( + 'transaction was replaced', + Logger.errors.TRANSACTION_REPLACED, + { + cancelled: + reason === 'replaced' || + reason === 'cancelled', + reason, + replacement: this._wrapTransaction(tx), + hash: transactionHash, + receipt: receipt2, + } + ) + ); + return; + } + } + scannedBlock++; + } + } + if (done) { + return; + } + this.once('block', replaceHandler); + }), + (error) => { + if (done) { + return; + } + this.once('block', replaceHandler); + } + ); + }); + if (done) { + return; + } + this.once('block', replaceHandler); + cancelFuncs.push(() => { + this.removeListener('block', replaceHandler); + }); + } + if (typeof timeout === 'number' && timeout > 0) { + const timer2 = setTimeout(() => { + if (alreadyDone()) { + return; + } + reject( + logger30.makeError('timeout exceeded', Logger.errors.TIMEOUT, { + timeout, + }) + ); + }, timeout); + if (timer2.unref) { + timer2.unref(); + } + cancelFuncs.push(() => { + clearTimeout(timer2); + }); + } + }); + }); + } + getBlockNumber() { + return __awaiter10(this, void 0, void 0, function* () { + return this._getInternalBlockNumber(0); + }); + } + getGasPrice() { + return __awaiter10(this, void 0, void 0, function* () { + yield this.getNetwork(); + const result = yield this.perform('getGasPrice', {}); + try { + return BigNumber.from(result); + } catch (error) { + return logger30.throwError( + 'bad result from backend', + Logger.errors.SERVER_ERROR, + { + method: 'getGasPrice', + result, + error, + } + ); + } + }); + } + getBalance(addressOrName, blockTag) { + return __awaiter10(this, void 0, void 0, function* () { + yield this.getNetwork(); + const params = yield resolveProperties({ + address: this._getAddress(addressOrName), + blockTag: this._getBlockTag(blockTag), + }); + const result = yield this.perform('getBalance', params); + try { + return BigNumber.from(result); + } catch (error) { + return logger30.throwError( + 'bad result from backend', + Logger.errors.SERVER_ERROR, + { + method: 'getBalance', + params, + result, + error, + } + ); + } + }); + } + getTransactionCount(addressOrName, blockTag) { + return __awaiter10(this, void 0, void 0, function* () { + yield this.getNetwork(); + const params = yield resolveProperties({ + address: this._getAddress(addressOrName), + blockTag: this._getBlockTag(blockTag), + }); + const result = yield this.perform('getTransactionCount', params); + try { + return BigNumber.from(result).toNumber(); + } catch (error) { + return logger30.throwError( + 'bad result from backend', + Logger.errors.SERVER_ERROR, + { + method: 'getTransactionCount', + params, + result, + error, + } + ); + } + }); + } + getCode(addressOrName, blockTag) { + return __awaiter10(this, void 0, void 0, function* () { + yield this.getNetwork(); + const params = yield resolveProperties({ + address: this._getAddress(addressOrName), + blockTag: this._getBlockTag(blockTag), + }); + const result = yield this.perform('getCode', params); + try { + return hexlify(result); + } catch (error) { + return logger30.throwError( + 'bad result from backend', + Logger.errors.SERVER_ERROR, + { + method: 'getCode', + params, + result, + error, + } + ); + } + }); + } + getStorageAt(addressOrName, position, blockTag) { + return __awaiter10(this, void 0, void 0, function* () { + yield this.getNetwork(); + const params = yield resolveProperties({ + address: this._getAddress(addressOrName), + blockTag: this._getBlockTag(blockTag), + position: Promise.resolve(position).then((p) => hexValue(p)), + }); + const result = yield this.perform('getStorageAt', params); + try { + return hexlify(result); + } catch (error) { + return logger30.throwError( + 'bad result from backend', + Logger.errors.SERVER_ERROR, + { + method: 'getStorageAt', + params, + result, + error, + } + ); + } + }); + } + // This should be called by any subclass wrapping a TransactionResponse + _wrapTransaction(tx, hash3, startBlock) { + if (hash3 != null && hexDataLength(hash3) !== 32) { + throw new Error('invalid response - sendTransaction'); + } + const result = tx; + if (hash3 != null && tx.hash !== hash3) { + logger30.throwError( + 'Transaction hash mismatch from Provider.sendTransaction.', + Logger.errors.UNKNOWN_ERROR, + { expectedHash: tx.hash, returnedHash: hash3 } + ); + } + result.wait = (confirms, timeout) => + __awaiter10(this, void 0, void 0, function* () { + if (confirms == null) { + confirms = 1; + } + if (timeout == null) { + timeout = 0; + } + let replacement = void 0; + if (confirms !== 0 && startBlock != null) { + replacement = { + data: tx.data, + from: tx.from, + nonce: tx.nonce, + to: tx.to, + value: tx.value, + startBlock, + }; + } + const receipt = yield this._waitForTransaction( + tx.hash, + confirms, + timeout, + replacement + ); + if (receipt == null && confirms === 0) { + return null; + } + this._emitted['t:' + tx.hash] = receipt.blockNumber; + if (receipt.status === 0) { + logger30.throwError( + 'transaction failed', + Logger.errors.CALL_EXCEPTION, + { + transactionHash: tx.hash, + transaction: tx, + receipt, + } + ); + } + return receipt; + }); + return result; + } + sendTransaction(signedTransaction) { + return __awaiter10(this, void 0, void 0, function* () { + yield this.getNetwork(); + const hexTx = yield Promise.resolve(signedTransaction).then((t2) => + hexlify(t2) + ); + const tx = this.formatter.transaction(signedTransaction); + if (tx.confirmations == null) { + tx.confirmations = 0; + } + const blockNumber = yield this._getInternalBlockNumber( + 100 + 2 * this.pollingInterval + ); + try { + const hash3 = yield this.perform('sendTransaction', { + signedTransaction: hexTx, + }); + return this._wrapTransaction(tx, hash3, blockNumber); + } catch (error) { + error.transaction = tx; + error.transactionHash = tx.hash; + throw error; + } + }); + } + _getTransactionRequest(transaction) { + return __awaiter10(this, void 0, void 0, function* () { + const values = yield transaction; + const tx = {}; + ['from', 'to'].forEach((key2) => { + if (values[key2] == null) { + return; + } + tx[key2] = Promise.resolve(values[key2]).then((v) => + v ? this._getAddress(v) : null + ); + }); + [ + 'gasLimit', + 'gasPrice', + 'maxFeePerGas', + 'maxPriorityFeePerGas', + 'value', + ].forEach((key2) => { + if (values[key2] == null) { + return; + } + tx[key2] = Promise.resolve(values[key2]).then((v) => + v ? BigNumber.from(v) : null + ); + }); + ['type'].forEach((key2) => { + if (values[key2] == null) { + return; + } + tx[key2] = Promise.resolve(values[key2]).then((v) => + v != null ? v : null + ); + }); + if (values.accessList) { + tx.accessList = this.formatter.accessList(values.accessList); + } + ['data'].forEach((key2) => { + if (values[key2] == null) { + return; + } + tx[key2] = Promise.resolve(values[key2]).then((v) => + v ? hexlify(v) : null + ); + }); + return this.formatter.transactionRequest(yield resolveProperties(tx)); + }); + } + _getFilter(filter) { + return __awaiter10(this, void 0, void 0, function* () { + filter = yield filter; + const result = {}; + if (filter.address != null) { + result.address = this._getAddress(filter.address); + } + ['blockHash', 'topics'].forEach((key2) => { + if (filter[key2] == null) { + return; + } + result[key2] = filter[key2]; + }); + ['fromBlock', 'toBlock'].forEach((key2) => { + if (filter[key2] == null) { + return; + } + result[key2] = this._getBlockTag(filter[key2]); + }); + return this.formatter.filter(yield resolveProperties(result)); + }); + } + _call(transaction, blockTag, attempt) { + return __awaiter10(this, void 0, void 0, function* () { + if (attempt >= MAX_CCIP_REDIRECTS) { + logger30.throwError( + 'CCIP read exceeded maximum redirections', + Logger.errors.SERVER_ERROR, + { + redirects: attempt, + transaction, + } + ); + } + const txSender = transaction.to; + const result = yield this.perform('call', { transaction, blockTag }); + if ( + attempt >= 0 && + blockTag === 'latest' && + txSender != null && + result.substring(0, 10) === '0x556f1830' && + hexDataLength(result) % 32 === 4 + ) { + try { + const data = hexDataSlice(result, 4); + const sender = hexDataSlice(data, 0, 32); + if (!BigNumber.from(sender).eq(txSender)) { + logger30.throwError( + 'CCIP Read sender did not match', + Logger.errors.CALL_EXCEPTION, + { + name: 'OffchainLookup', + signature: + 'OffchainLookup(address,string[],bytes,bytes4,bytes)', + transaction, + data: result, + } + ); + } + const urls = []; + const urlsOffset = BigNumber.from( + hexDataSlice(data, 32, 64) + ).toNumber(); + const urlsLength = BigNumber.from( + hexDataSlice(data, urlsOffset, urlsOffset + 32) + ).toNumber(); + const urlsData = hexDataSlice(data, urlsOffset + 32); + for (let u = 0; u < urlsLength; u++) { + const url = _parseString(urlsData, u * 32); + if (url == null) { + logger30.throwError( + 'CCIP Read contained corrupt URL string', + Logger.errors.CALL_EXCEPTION, + { + name: 'OffchainLookup', + signature: + 'OffchainLookup(address,string[],bytes,bytes4,bytes)', + transaction, + data: result, + } + ); + } + urls.push(url); + } + const calldata = _parseBytes(data, 64); + if (!BigNumber.from(hexDataSlice(data, 100, 128)).isZero()) { + logger30.throwError( + 'CCIP Read callback selector included junk', + Logger.errors.CALL_EXCEPTION, + { + name: 'OffchainLookup', + signature: + 'OffchainLookup(address,string[],bytes,bytes4,bytes)', + transaction, + data: result, + } + ); + } + const callbackSelector = hexDataSlice(data, 96, 100); + const extraData = _parseBytes(data, 128); + const ccipResult = yield this.ccipReadFetch( + transaction, + calldata, + urls + ); + if (ccipResult == null) { + logger30.throwError( + 'CCIP Read disabled or provided no URLs', + Logger.errors.CALL_EXCEPTION, + { + name: 'OffchainLookup', + signature: + 'OffchainLookup(address,string[],bytes,bytes4,bytes)', + transaction, + data: result, + } + ); + } + const tx = { + to: txSender, + data: hexConcat([ + callbackSelector, + encodeBytes([ccipResult, extraData]), + ]), + }; + return this._call(tx, blockTag, attempt + 1); + } catch (error) { + if (error.code === Logger.errors.SERVER_ERROR) { + throw error; + } + } + } + try { + return hexlify(result); + } catch (error) { + return logger30.throwError( + 'bad result from backend', + Logger.errors.SERVER_ERROR, + { + method: 'call', + params: { transaction, blockTag }, + result, + error, + } + ); + } + }); + } + call(transaction, blockTag) { + return __awaiter10(this, void 0, void 0, function* () { + yield this.getNetwork(); + const resolved = yield resolveProperties({ + transaction: this._getTransactionRequest(transaction), + blockTag: this._getBlockTag(blockTag), + ccipReadEnabled: Promise.resolve(transaction.ccipReadEnabled), + }); + return this._call( + resolved.transaction, + resolved.blockTag, + resolved.ccipReadEnabled ? 0 : -1 + ); + }); + } + estimateGas(transaction) { + return __awaiter10(this, void 0, void 0, function* () { + yield this.getNetwork(); + const params = yield resolveProperties({ + transaction: this._getTransactionRequest(transaction), + }); + const result = yield this.perform('estimateGas', params); + try { + return BigNumber.from(result); + } catch (error) { + return logger30.throwError( + 'bad result from backend', + Logger.errors.SERVER_ERROR, + { + method: 'estimateGas', + params, + result, + error, + } + ); + } + }); + } + _getAddress(addressOrName) { + return __awaiter10(this, void 0, void 0, function* () { + addressOrName = yield addressOrName; + if (typeof addressOrName !== 'string') { + logger30.throwArgumentError( + 'invalid address or ENS name', + 'name', + addressOrName + ); + } + const address = yield this.resolveName(addressOrName); + if (address == null) { + logger30.throwError( + 'ENS name not configured', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: `resolveName(${JSON.stringify(addressOrName)})`, + } + ); + } + return address; + }); + } + _getBlock(blockHashOrBlockTag, includeTransactions) { + return __awaiter10(this, void 0, void 0, function* () { + yield this.getNetwork(); + blockHashOrBlockTag = yield blockHashOrBlockTag; + let blockNumber = -128; + const params = { + includeTransactions: !!includeTransactions, + }; + if (isHexString(blockHashOrBlockTag, 32)) { + params.blockHash = blockHashOrBlockTag; + } else { + try { + params.blockTag = yield this._getBlockTag(blockHashOrBlockTag); + if (isHexString(params.blockTag)) { + blockNumber = parseInt(params.blockTag.substring(2), 16); + } + } catch (error) { + logger30.throwArgumentError( + 'invalid block hash or block tag', + 'blockHashOrBlockTag', + blockHashOrBlockTag + ); + } + } + return poll( + () => + __awaiter10(this, void 0, void 0, function* () { + const block = yield this.perform('getBlock', params); + if (block == null) { + if (params.blockHash != null) { + if (this._emitted['b:' + params.blockHash] == null) { + return null; + } + } + if (params.blockTag != null) { + if (blockNumber > this._emitted.block) { + return null; + } + } + return void 0; + } + if (includeTransactions) { + let blockNumber2 = null; + for (let i2 = 0; i2 < block.transactions.length; i2++) { + const tx = block.transactions[i2]; + if (tx.blockNumber == null) { + tx.confirmations = 0; + } else if (tx.confirmations == null) { + if (blockNumber2 == null) { + blockNumber2 = yield this._getInternalBlockNumber( + 100 + 2 * this.pollingInterval + ); + } + let confirmations = blockNumber2 - tx.blockNumber + 1; + if (confirmations <= 0) { + confirmations = 1; + } + tx.confirmations = confirmations; + } + } + const blockWithTxs = this.formatter.blockWithTransactions(block); + blockWithTxs.transactions = blockWithTxs.transactions.map((tx) => + this._wrapTransaction(tx) + ); + return blockWithTxs; + } + return this.formatter.block(block); + }), + { oncePoll: this } + ); + }); + } + getBlock(blockHashOrBlockTag) { + return this._getBlock(blockHashOrBlockTag, false); + } + getBlockWithTransactions(blockHashOrBlockTag) { + return this._getBlock(blockHashOrBlockTag, true); + } + getTransaction(transactionHash) { + return __awaiter10(this, void 0, void 0, function* () { + yield this.getNetwork(); + transactionHash = yield transactionHash; + const params = { + transactionHash: this.formatter.hash(transactionHash, true), + }; + return poll( + () => + __awaiter10(this, void 0, void 0, function* () { + const result = yield this.perform('getTransaction', params); + if (result == null) { + if (this._emitted['t:' + transactionHash] == null) { + return null; + } + return void 0; + } + const tx = this.formatter.transactionResponse(result); + if (tx.blockNumber == null) { + tx.confirmations = 0; + } else if (tx.confirmations == null) { + const blockNumber = yield this._getInternalBlockNumber( + 100 + 2 * this.pollingInterval + ); + let confirmations = blockNumber - tx.blockNumber + 1; + if (confirmations <= 0) { + confirmations = 1; + } + tx.confirmations = confirmations; + } + return this._wrapTransaction(tx); + }), + { oncePoll: this } + ); + }); + } + getTransactionReceipt(transactionHash) { + return __awaiter10(this, void 0, void 0, function* () { + yield this.getNetwork(); + transactionHash = yield transactionHash; + const params = { + transactionHash: this.formatter.hash(transactionHash, true), + }; + return poll( + () => + __awaiter10(this, void 0, void 0, function* () { + const result = yield this.perform('getTransactionReceipt', params); + if (result == null) { + if (this._emitted['t:' + transactionHash] == null) { + return null; + } + return void 0; + } + if (result.blockHash == null) { + return void 0; + } + const receipt = this.formatter.receipt(result); + if (receipt.blockNumber == null) { + receipt.confirmations = 0; + } else if (receipt.confirmations == null) { + const blockNumber = yield this._getInternalBlockNumber( + 100 + 2 * this.pollingInterval + ); + let confirmations = blockNumber - receipt.blockNumber + 1; + if (confirmations <= 0) { + confirmations = 1; + } + receipt.confirmations = confirmations; + } + return receipt; + }), + { oncePoll: this } + ); + }); + } + getLogs(filter) { + return __awaiter10(this, void 0, void 0, function* () { + yield this.getNetwork(); + const params = yield resolveProperties({ + filter: this._getFilter(filter), + }); + const logs = yield this.perform('getLogs', params); + logs.forEach((log3) => { + if (log3.removed == null) { + log3.removed = false; + } + }); + return Formatter.arrayOf(this.formatter.filterLog.bind(this.formatter))( + logs + ); + }); + } + getEtherPrice() { + return __awaiter10(this, void 0, void 0, function* () { + yield this.getNetwork(); + return this.perform('getEtherPrice', {}); + }); + } + _getBlockTag(blockTag) { + return __awaiter10(this, void 0, void 0, function* () { + blockTag = yield blockTag; + if (typeof blockTag === 'number' && blockTag < 0) { + if (blockTag % 1) { + logger30.throwArgumentError('invalid BlockTag', 'blockTag', blockTag); + } + let blockNumber = yield this._getInternalBlockNumber( + 100 + 2 * this.pollingInterval + ); + blockNumber += blockTag; + if (blockNumber < 0) { + blockNumber = 0; + } + return this.formatter.blockTag(blockNumber); + } + return this.formatter.blockTag(blockTag); + }); + } + getResolver(name) { + return __awaiter10(this, void 0, void 0, function* () { + let currentName = name; + while (true) { + if (currentName === '' || currentName === '.') { + return null; + } + if (name !== 'eth' && currentName === 'eth') { + return null; + } + const addr = yield this._getResolver(currentName, 'getResolver'); + if (addr != null) { + const resolver = new Resolver(this, addr, name); + if (currentName !== name && !(yield resolver.supportsWildcard())) { + return null; + } + return resolver; + } + currentName = currentName.split('.').slice(1).join('.'); + } + }); + } + _getResolver(name, operation) { + return __awaiter10(this, void 0, void 0, function* () { + if (operation == null) { + operation = 'ENS'; + } + const network = yield this.getNetwork(); + if (!network.ensAddress) { + logger30.throwError( + 'network does not support ENS', + Logger.errors.UNSUPPORTED_OPERATION, + { operation, network: network.name } + ); + } + try { + const addrData = yield this.call({ + to: network.ensAddress, + data: '0x0178b8bf' + namehash(name).substring(2), + }); + return this.formatter.callAddress(addrData); + } catch (error) {} + return null; + }); + } + resolveName(name) { + return __awaiter10(this, void 0, void 0, function* () { + name = yield name; + try { + return Promise.resolve(this.formatter.address(name)); + } catch (error) { + if (isHexString(name)) { + throw error; + } + } + if (typeof name !== 'string') { + logger30.throwArgumentError('invalid ENS name', 'name', name); + } + const resolver = yield this.getResolver(name); + if (!resolver) { + return null; + } + return yield resolver.getAddress(); + }); + } + lookupAddress(address) { + return __awaiter10(this, void 0, void 0, function* () { + address = yield address; + address = this.formatter.address(address); + const node = address.substring(2).toLowerCase() + '.addr.reverse'; + const resolverAddr = yield this._getResolver(node, 'lookupAddress'); + if (resolverAddr == null) { + return null; + } + const name = _parseString( + yield this.call({ + to: resolverAddr, + data: '0x691f3431' + namehash(node).substring(2), + }), + 0 + ); + const addr = yield this.resolveName(name); + if (addr != address) { + return null; + } + return name; + }); + } + getAvatar(nameOrAddress) { + return __awaiter10(this, void 0, void 0, function* () { + let resolver = null; + if (isHexString(nameOrAddress)) { + const address = this.formatter.address(nameOrAddress); + const node = address.substring(2).toLowerCase() + '.addr.reverse'; + const resolverAddress = yield this._getResolver(node, 'getAvatar'); + if (!resolverAddress) { + return null; + } + resolver = new Resolver(this, resolverAddress, node); + try { + const avatar2 = yield resolver.getAvatar(); + if (avatar2) { + return avatar2.url; + } + } catch (error) { + if (error.code !== Logger.errors.CALL_EXCEPTION) { + throw error; + } + } + try { + const name = _parseString( + yield this.call({ + to: resolverAddress, + data: '0x691f3431' + namehash(node).substring(2), + }), + 0 + ); + resolver = yield this.getResolver(name); + } catch (error) { + if (error.code !== Logger.errors.CALL_EXCEPTION) { + throw error; + } + return null; + } + } else { + resolver = yield this.getResolver(nameOrAddress); + if (!resolver) { + return null; + } + } + const avatar = yield resolver.getAvatar(); + if (avatar == null) { + return null; + } + return avatar.url; + }); + } + perform(method, params) { + return logger30.throwError( + method + ' not implemented', + Logger.errors.NOT_IMPLEMENTED, + { operation: method } + ); + } + _startEvent(event) { + this.polling = this._events.filter((e2) => e2.pollable()).length > 0; + } + _stopEvent(event) { + this.polling = this._events.filter((e2) => e2.pollable()).length > 0; + } + _addEventListener(eventName, listener, once) { + const event = new Event2(getEventTag2(eventName), listener, once); + this._events.push(event); + this._startEvent(event); + return this; + } + on(eventName, listener) { + return this._addEventListener(eventName, listener, false); + } + once(eventName, listener) { + return this._addEventListener(eventName, listener, true); + } + emit(eventName, ...args) { + let result = false; + let stopped = []; + let eventTag = getEventTag2(eventName); + this._events = this._events.filter((event) => { + if (event.tag !== eventTag) { + return true; + } + setTimeout(() => { + event.listener.apply(this, args); + }, 0); + result = true; + if (event.once) { + stopped.push(event); + return false; + } + return true; + }); + stopped.forEach((event) => { + this._stopEvent(event); + }); + return result; + } + listenerCount(eventName) { + if (!eventName) { + return this._events.length; + } + let eventTag = getEventTag2(eventName); + return this._events.filter((event) => { + return event.tag === eventTag; + }).length; + } + listeners(eventName) { + if (eventName == null) { + return this._events.map((event) => event.listener); + } + let eventTag = getEventTag2(eventName); + return this._events + .filter((event) => event.tag === eventTag) + .map((event) => event.listener); + } + off(eventName, listener) { + if (listener == null) { + return this.removeAllListeners(eventName); + } + const stopped = []; + let found = false; + let eventTag = getEventTag2(eventName); + this._events = this._events.filter((event) => { + if (event.tag !== eventTag || event.listener != listener) { + return true; + } + if (found) { + return true; + } + found = true; + stopped.push(event); + return false; + }); + stopped.forEach((event) => { + this._stopEvent(event); + }); + return this; + } + removeAllListeners(eventName) { + let stopped = []; + if (eventName == null) { + stopped = this._events; + this._events = []; + } else { + const eventTag = getEventTag2(eventName); + this._events = this._events.filter((event) => { + if (event.tag !== eventTag) { + return true; + } + stopped.push(event); + return false; + }); + } + stopped.forEach((event) => { + this._stopEvent(event); + }); + return this; + } +}; + +// node_modules/@ethersproject/providers/lib.esm/alchemy-provider.js +init_shim(); +init_lib4(); + +// node_modules/@ethersproject/providers/lib.esm/websocket-provider.js +init_shim(); +init_lib3(); +init_lib4(); + +// node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js +init_shim(); +init_lib15(); +init_lib3(); +init_lib2(); +init_lib12(); +init_lib4(); +init_lib9(); +init_lib17(); +init_lib26(); +init_lib(); +var __awaiter11 = 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 (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var logger31 = new Logger(version24); +var errorGas = ['call', 'estimateGas']; +function spelunk(value, requireData) { + if (value == null) { + return null; + } + if (typeof value.message === 'string' && value.message.match('reverted')) { + const data = isHexString(value.data) ? value.data : null; + if (!requireData || data) { + return { message: value.message, data }; + } + } + if (typeof value === 'object') { + for (const key2 in value) { + const result = spelunk(value[key2], requireData); + if (result) { + return result; + } + } + return null; + } + if (typeof value === 'string') { + try { + return spelunk(JSON.parse(value), requireData); + } catch (error) {} + } + return null; +} +function checkError(method, error, params) { + const transaction = params.transaction || params.signedTransaction; + if (method === 'call') { + const result = spelunk(error, true); + if (result) { + return result.data; + } + logger31.throwError( + 'missing revert data in call exception; Transaction reverted without a reason string', + Logger.errors.CALL_EXCEPTION, + { + data: '0x', + transaction, + error, + } + ); + } + if (method === 'estimateGas') { + let result = spelunk(error.body, false); + if (result == null) { + result = spelunk(error, false); + } + if (result) { + logger31.throwError( + 'cannot estimate gas; transaction may fail or may require manual gas limit', + Logger.errors.UNPREDICTABLE_GAS_LIMIT, + { + reason: result.message, + method, + transaction, + error, + } + ); + } + } + let message = error.message; + if ( + error.code === Logger.errors.SERVER_ERROR && + error.error && + typeof error.error.message === 'string' + ) { + message = error.error.message; + } else if (typeof error.body === 'string') { + message = error.body; + } else if (typeof error.responseText === 'string') { + message = error.responseText; + } + message = (message || '').toLowerCase(); + if ( + message.match( + /insufficient funds|base fee exceeds gas limit|InsufficientFunds/i + ) + ) { + logger31.throwError( + 'insufficient funds for intrinsic transaction cost', + Logger.errors.INSUFFICIENT_FUNDS, + { + error, + method, + transaction, + } + ); + } + if (message.match(/nonce (is )?too low/i)) { + logger31.throwError( + 'nonce has already been used', + Logger.errors.NONCE_EXPIRED, + { + error, + method, + transaction, + } + ); + } + if ( + message.match( + /replacement transaction underpriced|transaction gas price.*too low/i + ) + ) { + logger31.throwError( + 'replacement fee too low', + Logger.errors.REPLACEMENT_UNDERPRICED, + { + error, + method, + transaction, + } + ); + } + if (message.match(/only replay-protected/i)) { + logger31.throwError( + 'legacy pre-eip-155 transactions not supported', + Logger.errors.UNSUPPORTED_OPERATION, + { + error, + method, + transaction, + } + ); + } + if ( + errorGas.indexOf(method) >= 0 && + message.match( + /gas required exceeds allowance|always failing transaction|execution reverted|revert/ + ) + ) { + logger31.throwError( + 'cannot estimate gas; transaction may fail or may require manual gas limit', + Logger.errors.UNPREDICTABLE_GAS_LIMIT, + { + error, + method, + transaction, + } + ); + } + throw error; +} +function timer(timeout) { + return new Promise(function (resolve) { + setTimeout(resolve, timeout); + }); +} +function getResult(payload) { + if (payload.error) { + const error = new Error(payload.error.message); + error.code = payload.error.code; + error.data = payload.error.data; + throw error; + } + return payload.result; +} +function getLowerCase(value) { + if (value) { + return value.toLowerCase(); + } + return value; +} +var _constructorGuard5 = {}; +var JsonRpcSigner = class extends Signer { + constructor(constructorGuard, provider, addressOrIndex) { + super(); + if (constructorGuard !== _constructorGuard5) { + throw new Error( + 'do not call the JsonRpcSigner constructor directly; use provider.getSigner' + ); + } + defineReadOnly(this, 'provider', provider); + if (addressOrIndex == null) { + addressOrIndex = 0; + } + if (typeof addressOrIndex === 'string') { + defineReadOnly( + this, + '_address', + this.provider.formatter.address(addressOrIndex) + ); + defineReadOnly(this, '_index', null); + } else if (typeof addressOrIndex === 'number') { + defineReadOnly(this, '_index', addressOrIndex); + defineReadOnly(this, '_address', null); + } else { + logger31.throwArgumentError( + 'invalid address or index', + 'addressOrIndex', + addressOrIndex + ); + } + } + connect(provider) { + return logger31.throwError( + 'cannot alter JSON-RPC Signer connection', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'connect', + } + ); + } + connectUnchecked() { + return new UncheckedJsonRpcSigner( + _constructorGuard5, + this.provider, + this._address || this._index + ); + } + getAddress() { + if (this._address) { + return Promise.resolve(this._address); + } + return this.provider.send('eth_accounts', []).then((accounts) => { + if (accounts.length <= this._index) { + logger31.throwError( + 'unknown account #' + this._index, + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'getAddress', + } + ); + } + return this.provider.formatter.address(accounts[this._index]); + }); + } + sendUncheckedTransaction(transaction) { + transaction = shallowCopy(transaction); + const fromAddress = this.getAddress().then((address) => { + if (address) { + address = address.toLowerCase(); + } + return address; + }); + if (transaction.gasLimit == null) { + const estimate = shallowCopy(transaction); + estimate.from = fromAddress; + transaction.gasLimit = this.provider.estimateGas(estimate); + } + if (transaction.to != null) { + transaction.to = Promise.resolve(transaction.to).then((to) => + __awaiter11(this, void 0, void 0, function* () { + if (to == null) { + return null; + } + const address = yield this.provider.resolveName(to); + if (address == null) { + logger31.throwArgumentError( + 'provided ENS name resolves to null', + 'tx.to', + to + ); + } + return address; + }) + ); + } + return resolveProperties({ + tx: resolveProperties(transaction), + sender: fromAddress, + }).then(({ tx, sender }) => { + if (tx.from != null) { + if (tx.from.toLowerCase() !== sender) { + logger31.throwArgumentError( + 'from address mismatch', + 'transaction', + transaction + ); + } + } else { + tx.from = sender; + } + const hexTx = this.provider.constructor.hexlifyTransaction(tx, { + from: true, + }); + return this.provider.send('eth_sendTransaction', [hexTx]).then( + (hash3) => { + return hash3; + }, + (error) => { + if ( + typeof error.message === 'string' && + error.message.match(/user denied/i) + ) { + logger31.throwError( + 'user rejected transaction', + Logger.errors.ACTION_REJECTED, + { + action: 'sendTransaction', + transaction: tx, + } + ); + } + return checkError('sendTransaction', error, hexTx); + } + ); + }); + } + signTransaction(transaction) { + return logger31.throwError( + 'signing transactions is unsupported', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'signTransaction', + } + ); + } + sendTransaction(transaction) { + return __awaiter11(this, void 0, void 0, function* () { + const blockNumber = yield this.provider._getInternalBlockNumber( + 100 + 2 * this.provider.pollingInterval + ); + const hash3 = yield this.sendUncheckedTransaction(transaction); + try { + return yield poll( + () => + __awaiter11(this, void 0, void 0, function* () { + const tx = yield this.provider.getTransaction(hash3); + if (tx === null) { + return void 0; + } + return this.provider._wrapTransaction(tx, hash3, blockNumber); + }), + { oncePoll: this.provider } + ); + } catch (error) { + error.transactionHash = hash3; + throw error; + } + }); + } + signMessage(message) { + return __awaiter11(this, void 0, void 0, function* () { + const data = typeof message === 'string' ? toUtf8Bytes(message) : message; + const address = yield this.getAddress(); + try { + return yield this.provider.send('personal_sign', [ + hexlify(data), + address.toLowerCase(), + ]); + } catch (error) { + if ( + typeof error.message === 'string' && + error.message.match(/user denied/i) + ) { + logger31.throwError( + 'user rejected signing', + Logger.errors.ACTION_REJECTED, + { + action: 'signMessage', + from: address, + messageData: message, + } + ); + } + throw error; + } + }); + } + _legacySignMessage(message) { + return __awaiter11(this, void 0, void 0, function* () { + const data = typeof message === 'string' ? toUtf8Bytes(message) : message; + const address = yield this.getAddress(); + try { + return yield this.provider.send('eth_sign', [ + address.toLowerCase(), + hexlify(data), + ]); + } catch (error) { + if ( + typeof error.message === 'string' && + error.message.match(/user denied/i) + ) { + logger31.throwError( + 'user rejected signing', + Logger.errors.ACTION_REJECTED, + { + action: '_legacySignMessage', + from: address, + messageData: message, + } + ); + } + throw error; + } + }); + } + _signTypedData(domain, types, value) { + return __awaiter11(this, void 0, void 0, function* () { + const populated = yield TypedDataEncoder.resolveNames( + domain, + types, + value, + (name) => { + return this.provider.resolveName(name); + } + ); + const address = yield this.getAddress(); + try { + return yield this.provider.send('eth_signTypedData_v4', [ + address.toLowerCase(), + JSON.stringify( + TypedDataEncoder.getPayload( + populated.domain, + types, + populated.value + ) + ), + ]); + } catch (error) { + if ( + typeof error.message === 'string' && + error.message.match(/user denied/i) + ) { + logger31.throwError( + 'user rejected signing', + Logger.errors.ACTION_REJECTED, + { + action: '_signTypedData', + from: address, + messageData: { + domain: populated.domain, + types, + value: populated.value, + }, + } + ); + } + throw error; + } + }); + } + unlock(password) { + return __awaiter11(this, void 0, void 0, function* () { + const provider = this.provider; + const address = yield this.getAddress(); + return provider.send('personal_unlockAccount', [ + address.toLowerCase(), + password, + null, + ]); + }); + } +}; +var UncheckedJsonRpcSigner = class extends JsonRpcSigner { + sendTransaction(transaction) { + return this.sendUncheckedTransaction(transaction).then((hash3) => { + return { + hash: hash3, + nonce: null, + gasLimit: null, + gasPrice: null, + data: null, + value: null, + chainId: null, + confirmations: 0, + from: null, + wait: (confirmations) => { + return this.provider.waitForTransaction(hash3, confirmations); + }, + }; + }); + } +}; +var allowedTransactionKeys4 = { + chainId: true, + data: true, + gasLimit: true, + gasPrice: true, + nonce: true, + to: true, + value: true, + type: true, + accessList: true, + maxFeePerGas: true, + maxPriorityFeePerGas: true, +}; +var JsonRpcProvider = class extends BaseProvider { + constructor(url, network) { + let networkOrReady = network; + if (networkOrReady == null) { + networkOrReady = new Promise((resolve, reject) => { + setTimeout(() => { + this.detectNetwork().then( + (network2) => { + resolve(network2); + }, + (error) => { + reject(error); + } + ); + }, 0); + }); + } + super(networkOrReady); + if (!url) { + url = getStatic(this.constructor, 'defaultUrl')(); + } + if (typeof url === 'string') { + defineReadOnly( + this, + 'connection', + Object.freeze({ + url, + }) + ); + } else { + defineReadOnly(this, 'connection', Object.freeze(shallowCopy(url))); + } + this._nextId = 42; + } + get _cache() { + if (this._eventLoopCache == null) { + this._eventLoopCache = {}; + } + return this._eventLoopCache; + } + static defaultUrl() { + return 'http://localhost:8545'; + } + detectNetwork() { + if (!this._cache['detectNetwork']) { + this._cache['detectNetwork'] = this._uncachedDetectNetwork(); + setTimeout(() => { + this._cache['detectNetwork'] = null; + }, 0); + } + return this._cache['detectNetwork']; + } + _uncachedDetectNetwork() { + return __awaiter11(this, void 0, void 0, function* () { + yield timer(0); + let chainId = null; + try { + chainId = yield this.send('eth_chainId', []); + } catch (error) { + try { + chainId = yield this.send('net_version', []); + } catch (error2) {} + } + if (chainId != null) { + const getNetwork2 = getStatic(this.constructor, 'getNetwork'); + try { + return getNetwork2(BigNumber.from(chainId).toNumber()); + } catch (error) { + return logger31.throwError( + 'could not detect network', + Logger.errors.NETWORK_ERROR, + { + chainId, + event: 'invalidNetwork', + serverError: error, + } + ); + } + } + return logger31.throwError( + 'could not detect network', + Logger.errors.NETWORK_ERROR, + { + event: 'noNetwork', + } + ); + }); + } + getSigner(addressOrIndex) { + return new JsonRpcSigner(_constructorGuard5, this, addressOrIndex); + } + getUncheckedSigner(addressOrIndex) { + return this.getSigner(addressOrIndex).connectUnchecked(); + } + listAccounts() { + return this.send('eth_accounts', []).then((accounts) => { + return accounts.map((a2) => this.formatter.address(a2)); + }); + } + send(method, params) { + const request = { + method, + params, + id: this._nextId++, + jsonrpc: '2.0', + }; + this.emit('debug', { + action: 'request', + request: deepCopy(request), + provider: this, + }); + const cache = ['eth_chainId', 'eth_blockNumber'].indexOf(method) >= 0; + if (cache && this._cache[method]) { + return this._cache[method]; + } + const result = fetchJson( + this.connection, + JSON.stringify(request), + getResult + ).then( + (result2) => { + this.emit('debug', { + action: 'response', + request, + response: result2, + provider: this, + }); + return result2; + }, + (error) => { + this.emit('debug', { + action: 'response', + error, + request, + provider: this, + }); + throw error; + } + ); + if (cache) { + this._cache[method] = result; + setTimeout(() => { + this._cache[method] = null; + }, 0); + } + return result; + } + prepareRequest(method, params) { + switch (method) { + case 'getBlockNumber': + return ['eth_blockNumber', []]; + case 'getGasPrice': + return ['eth_gasPrice', []]; + case 'getBalance': + return [ + 'eth_getBalance', + [getLowerCase(params.address), params.blockTag], + ]; + case 'getTransactionCount': + return [ + 'eth_getTransactionCount', + [getLowerCase(params.address), params.blockTag], + ]; + case 'getCode': + return ['eth_getCode', [getLowerCase(params.address), params.blockTag]]; + case 'getStorageAt': + return [ + 'eth_getStorageAt', + [ + getLowerCase(params.address), + hexZeroPad(params.position, 32), + params.blockTag, + ], + ]; + case 'sendTransaction': + return ['eth_sendRawTransaction', [params.signedTransaction]]; + case 'getBlock': + if (params.blockTag) { + return [ + 'eth_getBlockByNumber', + [params.blockTag, !!params.includeTransactions], + ]; + } else if (params.blockHash) { + return [ + 'eth_getBlockByHash', + [params.blockHash, !!params.includeTransactions], + ]; + } + return null; + case 'getTransaction': + return ['eth_getTransactionByHash', [params.transactionHash]]; + case 'getTransactionReceipt': + return ['eth_getTransactionReceipt', [params.transactionHash]]; + case 'call': { + const hexlifyTransaction = getStatic( + this.constructor, + 'hexlifyTransaction' + ); + return [ + 'eth_call', + [ + hexlifyTransaction(params.transaction, { from: true }), + params.blockTag, + ], + ]; + } + case 'estimateGas': { + const hexlifyTransaction = getStatic( + this.constructor, + 'hexlifyTransaction' + ); + return [ + 'eth_estimateGas', + [hexlifyTransaction(params.transaction, { from: true })], + ]; + } + case 'getLogs': + if (params.filter && params.filter.address != null) { + params.filter.address = getLowerCase(params.filter.address); + } + return ['eth_getLogs', [params.filter]]; + default: + break; + } + return null; + } + perform(method, params) { + return __awaiter11(this, void 0, void 0, function* () { + if (method === 'call' || method === 'estimateGas') { + const tx = params.transaction; + if (tx && tx.type != null && BigNumber.from(tx.type).isZero()) { + if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) { + const feeData = yield this.getFeeData(); + if ( + feeData.maxFeePerGas == null && + feeData.maxPriorityFeePerGas == null + ) { + params = shallowCopy(params); + params.transaction = shallowCopy(tx); + delete params.transaction.type; + } + } + } + } + const args = this.prepareRequest(method, params); + if (args == null) { + logger31.throwError( + method + ' not implemented', + Logger.errors.NOT_IMPLEMENTED, + { operation: method } + ); + } + try { + return yield this.send(args[0], args[1]); + } catch (error) { + return checkError(method, error, params); + } + }); + } + _startEvent(event) { + if (event.tag === 'pending') { + this._startPending(); + } + super._startEvent(event); + } + _startPending() { + if (this._pendingFilter != null) { + return; + } + const self2 = this; + const pendingFilter = this.send('eth_newPendingTransactionFilter', []); + this._pendingFilter = pendingFilter; + pendingFilter + .then(function (filterId) { + function poll2() { + self2 + .send('eth_getFilterChanges', [filterId]) + .then(function (hashes) { + if (self2._pendingFilter != pendingFilter) { + return null; + } + let seq = Promise.resolve(); + hashes.forEach(function (hash3) { + self2._emitted['t:' + hash3.toLowerCase()] = 'pending'; + seq = seq.then(function () { + return self2.getTransaction(hash3).then(function (tx) { + self2.emit('pending', tx); + return null; + }); + }); + }); + return seq.then(function () { + return timer(1e3); + }); + }) + .then(function () { + if (self2._pendingFilter != pendingFilter) { + self2.send('eth_uninstallFilter', [filterId]); + return; + } + setTimeout(function () { + poll2(); + }, 0); + return null; + }) + .catch((error) => {}); + } + poll2(); + return filterId; + }) + .catch((error) => {}); + } + _stopEvent(event) { + if (event.tag === 'pending' && this.listenerCount('pending') === 0) { + this._pendingFilter = null; + } + super._stopEvent(event); + } + // Convert an ethers.js transaction into a JSON-RPC transaction + // - gasLimit => gas + // - All values hexlified + // - All numeric values zero-striped + // - All addresses are lowercased + // NOTE: This allows a TransactionRequest, but all values should be resolved + // before this is called + // @TODO: This will likely be removed in future versions and prepareRequest + // will be the preferred method for this. + static hexlifyTransaction(transaction, allowExtra) { + const allowed = shallowCopy(allowedTransactionKeys4); + if (allowExtra) { + for (const key2 in allowExtra) { + if (allowExtra[key2]) { + allowed[key2] = true; + } + } + } + checkProperties(transaction, allowed); + const result = {}; + [ + 'chainId', + 'gasLimit', + 'gasPrice', + 'type', + 'maxFeePerGas', + 'maxPriorityFeePerGas', + 'nonce', + 'value', + ].forEach(function (key2) { + if (transaction[key2] == null) { + return; + } + const value = hexValue(BigNumber.from(transaction[key2])); + if (key2 === 'gasLimit') { + key2 = 'gas'; + } + result[key2] = value; + }); + ['from', 'to', 'data'].forEach(function (key2) { + if (transaction[key2] == null) { + return; + } + result[key2] = hexlify(transaction[key2]); + }); + if (transaction.accessList) { + result['accessList'] = accessListify(transaction.accessList); + } + return result; + } +}; + +// node_modules/@ethersproject/providers/lib.esm/ws.js +init_shim(); +init_lib(); +var WS = null; +try { + WS = WebSocket; + if (WS == null) { + throw new Error('inject please'); + } +} catch (error) { + const logger48 = new Logger(version24); + WS = function () { + logger48.throwError( + 'WebSockets not supported in this environment', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'new WebSocket()', + } + ); + }; +} + +// node_modules/@ethersproject/providers/lib.esm/websocket-provider.js +init_lib(); +var __awaiter12 = 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 (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var logger32 = new Logger(version24); +var NextId = 1; +var WebSocketProvider = class extends JsonRpcProvider { + constructor(url, network) { + if (network === 'any') { + logger32.throwError( + "WebSocketProvider does not support 'any' network yet", + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'network:any', + } + ); + } + if (typeof url === 'string') { + super(url, network); + } else { + super('_websocket', network); + } + this._pollingInterval = -1; + this._wsReady = false; + if (typeof url === 'string') { + defineReadOnly(this, '_websocket', new WS(this.connection.url)); + } else { + defineReadOnly(this, '_websocket', url); + } + defineReadOnly(this, '_requests', {}); + defineReadOnly(this, '_subs', {}); + defineReadOnly(this, '_subIds', {}); + defineReadOnly(this, '_detectNetwork', super.detectNetwork()); + this.websocket.onopen = () => { + this._wsReady = true; + Object.keys(this._requests).forEach((id2) => { + this.websocket.send(this._requests[id2].payload); + }); + }; + this.websocket.onmessage = (messageEvent) => { + const data = messageEvent.data; + const result = JSON.parse(data); + if (result.id != null) { + const id2 = String(result.id); + const request = this._requests[id2]; + delete this._requests[id2]; + if (result.result !== void 0) { + request.callback(null, result.result); + this.emit('debug', { + action: 'response', + request: JSON.parse(request.payload), + response: result.result, + provider: this, + }); + } else { + let error = null; + if (result.error) { + error = new Error(result.error.message || 'unknown error'); + defineReadOnly(error, 'code', result.error.code || null); + defineReadOnly(error, 'response', data); + } else { + error = new Error('unknown error'); + } + request.callback(error, void 0); + this.emit('debug', { + action: 'response', + error, + request: JSON.parse(request.payload), + provider: this, + }); + } + } else if (result.method === 'eth_subscription') { + const sub = this._subs[result.params.subscription]; + if (sub) { + sub.processFunc(result.params.result); + } + } else { + console.warn('this should not happen'); + } + }; + const fauxPoll = setInterval(() => { + this.emit('poll'); + }, 1e3); + if (fauxPoll.unref) { + fauxPoll.unref(); + } + } + // Cannot narrow the type of _websocket, as that is not backwards compatible + // so we add a getter and let the WebSocket be a public API. + get websocket() { + return this._websocket; + } + detectNetwork() { + return this._detectNetwork; + } + get pollingInterval() { + return 0; + } + resetEventsBlock(blockNumber) { + logger32.throwError( + 'cannot reset events block on WebSocketProvider', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'resetEventBlock', + } + ); + } + set pollingInterval(value) { + logger32.throwError( + 'cannot set polling interval on WebSocketProvider', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'setPollingInterval', + } + ); + } + poll() { + return __awaiter12(this, void 0, void 0, function* () { + return null; + }); + } + set polling(value) { + if (!value) { + return; + } + logger32.throwError( + 'cannot set polling on WebSocketProvider', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'setPolling', + } + ); + } + send(method, params) { + const rid = NextId++; + return new Promise((resolve, reject) => { + function callback(error, result) { + if (error) { + return reject(error); + } + return resolve(result); + } + const payload = JSON.stringify({ + method, + params, + id: rid, + jsonrpc: '2.0', + }); + this.emit('debug', { + action: 'request', + request: JSON.parse(payload), + provider: this, + }); + this._requests[String(rid)] = { callback, payload }; + if (this._wsReady) { + this.websocket.send(payload); + } + }); + } + static defaultUrl() { + return 'ws://localhost:8546'; + } + _subscribe(tag, param, processFunc) { + return __awaiter12(this, void 0, void 0, function* () { + let subIdPromise = this._subIds[tag]; + if (subIdPromise == null) { + subIdPromise = Promise.all(param).then((param2) => { + return this.send('eth_subscribe', param2); + }); + this._subIds[tag] = subIdPromise; + } + const subId = yield subIdPromise; + this._subs[subId] = { tag, processFunc }; + }); + } + _startEvent(event) { + switch (event.type) { + case 'block': + this._subscribe('block', ['newHeads'], (result) => { + const blockNumber = BigNumber.from(result.number).toNumber(); + this._emitted.block = blockNumber; + this.emit('block', blockNumber); + }); + break; + case 'pending': + this._subscribe('pending', ['newPendingTransactions'], (result) => { + this.emit('pending', result); + }); + break; + case 'filter': + this._subscribe( + event.tag, + ['logs', this._getFilter(event.filter)], + (result) => { + if (result.removed == null) { + result.removed = false; + } + this.emit(event.filter, this.formatter.filterLog(result)); + } + ); + break; + case 'tx': { + const emitReceipt = (event2) => { + const hash3 = event2.hash; + this.getTransactionReceipt(hash3).then((receipt) => { + if (!receipt) { + return; + } + this.emit(hash3, receipt); + }); + }; + emitReceipt(event); + this._subscribe('tx', ['newHeads'], (result) => { + this._events.filter((e2) => e2.type === 'tx').forEach(emitReceipt); + }); + break; + } + case 'debug': + case 'poll': + case 'willPoll': + case 'didPoll': + case 'error': + break; + default: + console.log('unhandled:', event); + break; + } + } + _stopEvent(event) { + let tag = event.tag; + if (event.type === 'tx') { + if (this._events.filter((e2) => e2.type === 'tx').length) { + return; + } + tag = 'tx'; + } else if (this.listenerCount(event.event)) { + return; + } + const subId = this._subIds[tag]; + if (!subId) { + return; + } + delete this._subIds[tag]; + subId.then((subId2) => { + if (!this._subs[subId2]) { + return; + } + delete this._subs[subId2]; + this.send('eth_unsubscribe', [subId2]); + }); + } + destroy() { + return __awaiter12(this, void 0, void 0, function* () { + if (this.websocket.readyState === WS.CONNECTING) { + yield new Promise((resolve) => { + this.websocket.onopen = function () { + resolve(true); + }; + this.websocket.onerror = function () { + resolve(false); + }; + }); + } + this.websocket.close(1e3); + }); + } +}; + +// node_modules/@ethersproject/providers/lib.esm/alchemy-provider.js +init_lib(); + +// node_modules/@ethersproject/providers/lib.esm/url-json-rpc-provider.js +init_shim(); +init_lib4(); +init_lib(); +var __awaiter13 = 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 (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var logger33 = new Logger(version24); +var StaticJsonRpcProvider = class extends JsonRpcProvider { + detectNetwork() { + const _super = Object.create(null, { + detectNetwork: { get: () => super.detectNetwork }, + }); + return __awaiter13(this, void 0, void 0, function* () { + let network = this.network; + if (network == null) { + network = yield _super.detectNetwork.call(this); + if (!network) { + logger33.throwError( + 'no network detected', + Logger.errors.UNKNOWN_ERROR, + {} + ); + } + if (this._network == null) { + defineReadOnly(this, '_network', network); + this.emit('network', network, null); + } + } + return network; + }); + } +}; +var UrlJsonRpcProvider = class extends StaticJsonRpcProvider { + constructor(network, apiKey) { + logger33.checkAbstract(new.target, UrlJsonRpcProvider); + network = getStatic(new.target, 'getNetwork')(network); + apiKey = getStatic(new.target, 'getApiKey')(apiKey); + const connection = getStatic(new.target, 'getUrl')(network, apiKey); + super(connection, network); + if (typeof apiKey === 'string') { + defineReadOnly(this, 'apiKey', apiKey); + } else if (apiKey != null) { + Object.keys(apiKey).forEach((key2) => { + defineReadOnly(this, key2, apiKey[key2]); + }); + } + } + _startPending() { + logger33.warn('WARNING: API provider does not support pending filters'); + } + isCommunityResource() { + return false; + } + getSigner(address) { + return logger33.throwError( + 'API provider does not support signing', + Logger.errors.UNSUPPORTED_OPERATION, + { operation: 'getSigner' } + ); + } + listAccounts() { + return Promise.resolve([]); + } + // Return a defaultApiKey if null, otherwise validate the API key + static getApiKey(apiKey) { + return apiKey; + } + // Returns the url or connection for the given network and API key. The + // API key will have been sanitized by the getApiKey first, so any validation + // or transformations can be done there. + static getUrl(network, apiKey) { + return logger33.throwError( + 'not implemented; sub-classes must override getUrl', + Logger.errors.NOT_IMPLEMENTED, + { + operation: 'getUrl', + } + ); + } +}; + +// node_modules/@ethersproject/providers/lib.esm/alchemy-provider.js +var logger34 = new Logger(version24); +var defaultApiKey = '_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC'; +var AlchemyWebSocketProvider = class extends WebSocketProvider { + constructor(network, apiKey) { + const provider = new AlchemyProvider(network, apiKey); + const url = provider.connection.url + .replace(/^http/i, 'ws') + .replace('.alchemyapi.', '.ws.alchemyapi.'); + super(url, provider.network); + defineReadOnly(this, 'apiKey', provider.apiKey); + } + isCommunityResource() { + return this.apiKey === defaultApiKey; + } +}; +var AlchemyProvider = class extends UrlJsonRpcProvider { + static getWebSocketProvider(network, apiKey) { + return new AlchemyWebSocketProvider(network, apiKey); + } + static getApiKey(apiKey) { + if (apiKey == null) { + return defaultApiKey; + } + if (apiKey && typeof apiKey !== 'string') { + logger34.throwArgumentError('invalid apiKey', 'apiKey', apiKey); + } + return apiKey; + } + static getUrl(network, apiKey) { + let host = null; + switch (network.name) { + case 'homestead': + host = 'eth-mainnet.alchemyapi.io/v2/'; + break; + case 'goerli': + host = 'eth-goerli.g.alchemy.com/v2/'; + break; + case 'matic': + host = 'polygon-mainnet.g.alchemy.com/v2/'; + break; + case 'maticmum': + host = 'polygon-mumbai.g.alchemy.com/v2/'; + break; + case 'arbitrum': + host = 'arb-mainnet.g.alchemy.com/v2/'; + break; + case 'arbitrum-goerli': + host = 'arb-goerli.g.alchemy.com/v2/'; + break; + case 'optimism': + host = 'opt-mainnet.g.alchemy.com/v2/'; + break; + case 'optimism-goerli': + host = 'opt-goerli.g.alchemy.com/v2/'; + break; + default: + logger34.throwArgumentError( + 'unsupported network', + 'network', + arguments[0] + ); + } + return { + allowGzip: true, + url: 'https://' + host + apiKey, + throttleCallback: (attempt, url) => { + if (apiKey === defaultApiKey) { + showThrottleMessage(); + } + return Promise.resolve(true); + }, + }; + } + isCommunityResource() { + return this.apiKey === defaultApiKey; + } +}; + +// node_modules/@ethersproject/providers/lib.esm/ankr-provider.js +init_shim(); +init_lib(); +var logger35 = new Logger(version24); +var defaultApiKey2 = + '9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972'; +function getHost(name) { + switch (name) { + case 'homestead': + return 'rpc.ankr.com/eth/'; + case 'ropsten': + return 'rpc.ankr.com/eth_ropsten/'; + case 'rinkeby': + return 'rpc.ankr.com/eth_rinkeby/'; + case 'goerli': + return 'rpc.ankr.com/eth_goerli/'; + case 'matic': + return 'rpc.ankr.com/polygon/'; + case 'arbitrum': + return 'rpc.ankr.com/arbitrum/'; + } + return logger35.throwArgumentError('unsupported network', 'name', name); +} +var AnkrProvider = class extends UrlJsonRpcProvider { + isCommunityResource() { + return this.apiKey === defaultApiKey2; + } + static getApiKey(apiKey) { + if (apiKey == null) { + return defaultApiKey2; + } + return apiKey; + } + static getUrl(network, apiKey) { + if (apiKey == null) { + apiKey = defaultApiKey2; + } + const connection = { + allowGzip: true, + url: 'https://' + getHost(network.name) + apiKey, + throttleCallback: (attempt, url) => { + if (apiKey.apiKey === defaultApiKey2) { + showThrottleMessage(); + } + return Promise.resolve(true); + }, + }; + if (apiKey.projectSecret != null) { + connection.user = ''; + connection.password = apiKey.projectSecret; + } + return connection; + } +}; + +// node_modules/@ethersproject/providers/lib.esm/cloudflare-provider.js +init_shim(); +init_lib(); +var __awaiter14 = 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 (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var logger36 = new Logger(version24); +var CloudflareProvider = class extends UrlJsonRpcProvider { + static getApiKey(apiKey) { + if (apiKey != null) { + logger36.throwArgumentError( + 'apiKey not supported for cloudflare', + 'apiKey', + apiKey + ); + } + return null; + } + static getUrl(network, apiKey) { + let host = null; + switch (network.name) { + case 'homestead': + host = 'https://cloudflare-eth.com/'; + break; + default: + logger36.throwArgumentError( + 'unsupported network', + 'network', + arguments[0] + ); + } + return host; + } + perform(method, params) { + const _super = Object.create(null, { + perform: { get: () => super.perform }, + }); + return __awaiter14(this, void 0, void 0, function* () { + if (method === 'getBlockNumber') { + const block = yield _super.perform.call(this, 'getBlock', { + blockTag: 'latest', + }); + return block.number; + } + return _super.perform.call(this, method, params); + }); + } +}; + +// node_modules/@ethersproject/providers/lib.esm/etherscan-provider.js +init_shim(); +init_lib2(); +init_lib4(); +init_lib17(); +init_lib26(); +init_lib(); +var __awaiter15 = 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 (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var logger37 = new Logger(version24); +function getTransactionPostData(transaction) { + const result = {}; + for (let key2 in transaction) { + if (transaction[key2] == null) { + continue; + } + let value = transaction[key2]; + if (key2 === 'type' && value === 0) { + continue; + } + if ( + { + type: true, + gasLimit: true, + gasPrice: true, + maxFeePerGs: true, + maxPriorityFeePerGas: true, + nonce: true, + value: true, + }[key2] + ) { + value = hexValue(hexlify(value)); + } else if (key2 === 'accessList') { + value = + '[' + + accessListify(value) + .map((set) => { + return `{address:"${ + set.address + }",storageKeys:["${set.storageKeys.join('","')}"]}`; + }) + .join(',') + + ']'; + } else { + value = hexlify(value); + } + result[key2] = value; + } + return result; +} +function getResult2(result) { + if ( + result.status == 0 && + (result.message === 'No records found' || + result.message === 'No transactions found') + ) { + return result.result; + } + if ( + result.status != 1 || + typeof result.message !== 'string' || + !result.message.match(/^OK/) + ) { + const error = new Error('invalid response'); + error.result = JSON.stringify(result); + if ((result.result || '').toLowerCase().indexOf('rate limit') >= 0) { + error.throttleRetry = true; + } + throw error; + } + return result.result; +} +function getJsonResult(result) { + if ( + result && + result.status == 0 && + result.message == 'NOTOK' && + (result.result || '').toLowerCase().indexOf('rate limit') >= 0 + ) { + const error = new Error('throttled response'); + error.result = JSON.stringify(result); + error.throttleRetry = true; + throw error; + } + if (result.jsonrpc != '2.0') { + const error = new Error('invalid response'); + error.result = JSON.stringify(result); + throw error; + } + if (result.error) { + const error = new Error(result.error.message || 'unknown error'); + if (result.error.code) { + error.code = result.error.code; + } + if (result.error.data) { + error.data = result.error.data; + } + throw error; + } + return result.result; +} +function checkLogTag(blockTag) { + if (blockTag === 'pending') { + throw new Error('pending not supported'); + } + if (blockTag === 'latest') { + return blockTag; + } + return parseInt(blockTag.substring(2), 16); +} +function checkError2(method, error, transaction) { + if (method === 'call' && error.code === Logger.errors.SERVER_ERROR) { + const e2 = error.error; + if ( + e2 && + (e2.message.match(/reverted/i) || e2.message.match(/VM execution error/i)) + ) { + let data = e2.data; + if (data) { + data = '0x' + data.replace(/^.*0x/i, ''); + } + if (isHexString(data)) { + return data; + } + logger37.throwError( + 'missing revert data in call exception', + Logger.errors.CALL_EXCEPTION, + { + error, + data: '0x', + } + ); + } + } + let message = error.message; + if (error.code === Logger.errors.SERVER_ERROR) { + if (error.error && typeof error.error.message === 'string') { + message = error.error.message; + } else if (typeof error.body === 'string') { + message = error.body; + } else if (typeof error.responseText === 'string') { + message = error.responseText; + } + } + message = (message || '').toLowerCase(); + if (message.match(/insufficient funds/)) { + logger37.throwError( + 'insufficient funds for intrinsic transaction cost', + Logger.errors.INSUFFICIENT_FUNDS, + { + error, + method, + transaction, + } + ); + } + if ( + message.match( + /same hash was already imported|transaction nonce is too low|nonce too low/ + ) + ) { + logger37.throwError( + 'nonce has already been used', + Logger.errors.NONCE_EXPIRED, + { + error, + method, + transaction, + } + ); + } + if (message.match(/another transaction with same nonce/)) { + logger37.throwError( + 'replacement fee too low', + Logger.errors.REPLACEMENT_UNDERPRICED, + { + error, + method, + transaction, + } + ); + } + if ( + message.match(/execution failed due to an exception|execution reverted/) + ) { + logger37.throwError( + 'cannot estimate gas; transaction may fail or may require manual gas limit', + Logger.errors.UNPREDICTABLE_GAS_LIMIT, + { + error, + method, + transaction, + } + ); + } + throw error; +} +var EtherscanProvider = class extends BaseProvider { + constructor(network, apiKey) { + super(network); + defineReadOnly(this, 'baseUrl', this.getBaseUrl()); + defineReadOnly(this, 'apiKey', apiKey || null); + } + getBaseUrl() { + switch (this.network ? this.network.name : 'invalid') { + case 'homestead': + return 'https://api.etherscan.io'; + case 'goerli': + return 'https://api-goerli.etherscan.io'; + case 'sepolia': + return 'https://api-sepolia.etherscan.io'; + case 'matic': + return 'https://api.polygonscan.com'; + case 'maticmum': + return 'https://api-testnet.polygonscan.com'; + case 'arbitrum': + return 'https://api.arbiscan.io'; + case 'arbitrum-goerli': + return 'https://api-goerli.arbiscan.io'; + case 'optimism': + return 'https://api-optimistic.etherscan.io'; + case 'optimism-goerli': + return 'https://api-goerli-optimistic.etherscan.io'; + default: + } + return logger37.throwArgumentError( + 'unsupported network', + 'network', + this.network.name + ); + } + getUrl(module2, params) { + const query = Object.keys(params).reduce((accum, key2) => { + const value = params[key2]; + if (value != null) { + accum += `&${key2}=${value}`; + } + return accum; + }, ''); + const apiKey = this.apiKey ? `&apikey=${this.apiKey}` : ''; + return `${this.baseUrl}/api?module=${module2}${query}${apiKey}`; + } + getPostUrl() { + return `${this.baseUrl}/api`; + } + getPostData(module2, params) { + params.module = module2; + params.apikey = this.apiKey; + return params; + } + fetch(module2, params, post) { + return __awaiter15(this, void 0, void 0, function* () { + const url = post ? this.getPostUrl() : this.getUrl(module2, params); + const payload = post ? this.getPostData(module2, params) : null; + const procFunc = module2 === 'proxy' ? getJsonResult : getResult2; + this.emit('debug', { + action: 'request', + request: url, + provider: this, + }); + const connection = { + url, + throttleSlotInterval: 1e3, + throttleCallback: (attempt, url2) => { + if (this.isCommunityResource()) { + showThrottleMessage(); + } + return Promise.resolve(true); + }, + }; + let payloadStr = null; + if (payload) { + connection.headers = { + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + }; + payloadStr = Object.keys(payload) + .map((key2) => { + return `${key2}=${payload[key2]}`; + }) + .join('&'); + } + const result = yield fetchJson( + connection, + payloadStr, + procFunc || getJsonResult + ); + this.emit('debug', { + action: 'response', + request: url, + response: deepCopy(result), + provider: this, + }); + return result; + }); + } + detectNetwork() { + return __awaiter15(this, void 0, void 0, function* () { + return this.network; + }); + } + perform(method, params) { + const _super = Object.create(null, { + perform: { get: () => super.perform }, + }); + return __awaiter15(this, void 0, void 0, function* () { + switch (method) { + case 'getBlockNumber': + return this.fetch('proxy', { action: 'eth_blockNumber' }); + case 'getGasPrice': + return this.fetch('proxy', { action: 'eth_gasPrice' }); + case 'getBalance': + return this.fetch('account', { + action: 'balance', + address: params.address, + tag: params.blockTag, + }); + case 'getTransactionCount': + return this.fetch('proxy', { + action: 'eth_getTransactionCount', + address: params.address, + tag: params.blockTag, + }); + case 'getCode': + return this.fetch('proxy', { + action: 'eth_getCode', + address: params.address, + tag: params.blockTag, + }); + case 'getStorageAt': + return this.fetch('proxy', { + action: 'eth_getStorageAt', + address: params.address, + position: params.position, + tag: params.blockTag, + }); + case 'sendTransaction': + return this.fetch( + 'proxy', + { + action: 'eth_sendRawTransaction', + hex: params.signedTransaction, + }, + true + ).catch((error) => { + return checkError2( + 'sendTransaction', + error, + params.signedTransaction + ); + }); + case 'getBlock': + if (params.blockTag) { + return this.fetch('proxy', { + action: 'eth_getBlockByNumber', + tag: params.blockTag, + boolean: params.includeTransactions ? 'true' : 'false', + }); + } + throw new Error('getBlock by blockHash not implemented'); + case 'getTransaction': + return this.fetch('proxy', { + action: 'eth_getTransactionByHash', + txhash: params.transactionHash, + }); + case 'getTransactionReceipt': + return this.fetch('proxy', { + action: 'eth_getTransactionReceipt', + txhash: params.transactionHash, + }); + case 'call': { + if (params.blockTag !== 'latest') { + throw new Error( + 'EtherscanProvider does not support blockTag for call' + ); + } + const postData = getTransactionPostData(params.transaction); + postData.module = 'proxy'; + postData.action = 'eth_call'; + try { + return yield this.fetch('proxy', postData, true); + } catch (error) { + return checkError2('call', error, params.transaction); + } + } + case 'estimateGas': { + const postData = getTransactionPostData(params.transaction); + postData.module = 'proxy'; + postData.action = 'eth_estimateGas'; + try { + return yield this.fetch('proxy', postData, true); + } catch (error) { + return checkError2('estimateGas', error, params.transaction); + } + } + case 'getLogs': { + const args = { action: 'getLogs' }; + if (params.filter.fromBlock) { + args.fromBlock = checkLogTag(params.filter.fromBlock); + } + if (params.filter.toBlock) { + args.toBlock = checkLogTag(params.filter.toBlock); + } + if (params.filter.address) { + args.address = params.filter.address; + } + if (params.filter.topics && params.filter.topics.length > 0) { + if (params.filter.topics.length > 1) { + logger37.throwError( + 'unsupported topic count', + Logger.errors.UNSUPPORTED_OPERATION, + { topics: params.filter.topics } + ); + } + if (params.filter.topics.length === 1) { + const topic0 = params.filter.topics[0]; + if (typeof topic0 !== 'string' || topic0.length !== 66) { + logger37.throwError( + 'unsupported topic format', + Logger.errors.UNSUPPORTED_OPERATION, + { topic0 } + ); + } + args.topic0 = topic0; + } + } + const logs = yield this.fetch('logs', args); + let blocks = {}; + for (let i2 = 0; i2 < logs.length; i2++) { + const log3 = logs[i2]; + if (log3.blockHash != null) { + continue; + } + if (blocks[log3.blockNumber] == null) { + const block = yield this.getBlock(log3.blockNumber); + if (block) { + blocks[log3.blockNumber] = block.hash; + } + } + log3.blockHash = blocks[log3.blockNumber]; + } + return logs; + } + case 'getEtherPrice': + if (this.network.name !== 'homestead') { + return 0; + } + return parseFloat( + (yield this.fetch('stats', { action: 'ethprice' })).ethusd + ); + default: + break; + } + return _super.perform.call(this, method, params); + }); + } + // Note: The `page` page parameter only allows pagination within the + // 10,000 window available without a page and offset parameter + // Error: Result window is too large, PageNo x Offset size must + // be less than or equal to 10000 + getHistory(addressOrName, startBlock, endBlock) { + return __awaiter15(this, void 0, void 0, function* () { + const params = { + action: 'txlist', + address: yield this.resolveName(addressOrName), + startblock: startBlock == null ? 0 : startBlock, + endblock: endBlock == null ? 99999999 : endBlock, + sort: 'asc', + }; + const result = yield this.fetch('account', params); + return result.map((tx) => { + ['contractAddress', 'to'].forEach(function (key2) { + if (tx[key2] == '') { + delete tx[key2]; + } + }); + if (tx.creates == null && tx.contractAddress != null) { + tx.creates = tx.contractAddress; + } + const item = this.formatter.transactionResponse(tx); + if (tx.timeStamp) { + item.timestamp = parseInt(tx.timeStamp); + } + return item; + }); + }); + } + isCommunityResource() { + return this.apiKey == null; + } +}; + +// node_modules/@ethersproject/providers/lib.esm/fallback-provider.js +init_shim(); +init_lib14(); +init_lib3(); +init_lib2(); +init_lib4(); +init_lib23(); +init_lib26(); +init_lib(); +var __awaiter16 = 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 (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var logger38 = new Logger(version24); +function now() { + return /* @__PURE__ */ new Date().getTime(); +} +function checkNetworks(networks2) { + let result = null; + for (let i2 = 0; i2 < networks2.length; i2++) { + const network = networks2[i2]; + if (network == null) { + return null; + } + if (result) { + if ( + !( + result.name === network.name && + result.chainId === network.chainId && + (result.ensAddress === network.ensAddress || + (result.ensAddress == null && network.ensAddress == null)) + ) + ) { + logger38.throwArgumentError('provider mismatch', 'networks', networks2); + } + } else { + result = network; + } + } + return result; +} +function median(values, maxDelta) { + values = values.slice().sort(); + const middle = Math.floor(values.length / 2); + if (values.length % 2) { + return values[middle]; + } + const a2 = values[middle - 1], + b = values[middle]; + if (maxDelta != null && Math.abs(a2 - b) > maxDelta) { + return null; + } + return (a2 + b) / 2; +} +function serialize2(value) { + if (value === null) { + return 'null'; + } else if (typeof value === 'number' || typeof value === 'boolean') { + return JSON.stringify(value); + } else if (typeof value === 'string') { + return value; + } else if (BigNumber.isBigNumber(value)) { + return value.toString(); + } else if (Array.isArray(value)) { + return JSON.stringify(value.map((i2) => serialize2(i2))); + } else if (typeof value === 'object') { + const keys = Object.keys(value); + keys.sort(); + return ( + '{' + + keys + .map((key2) => { + let v = value[key2]; + if (typeof v === 'function') { + v = '[function]'; + } else { + v = serialize2(v); + } + return JSON.stringify(key2) + ':' + v; + }) + .join(',') + + '}' + ); + } + throw new Error('unknown value type: ' + typeof value); +} +var nextRid = 1; +function stall2(duration) { + let cancel = null; + let timer2 = null; + let promise = new Promise((resolve) => { + cancel = function () { + if (timer2) { + clearTimeout(timer2); + timer2 = null; + } + resolve(); + }; + timer2 = setTimeout(cancel, duration); + }); + const wait = (func) => { + promise = promise.then(func); + return promise; + }; + function getPromise() { + return promise; + } + return { cancel, getPromise, wait }; +} +var ForwardErrors = [ + Logger.errors.CALL_EXCEPTION, + Logger.errors.INSUFFICIENT_FUNDS, + Logger.errors.NONCE_EXPIRED, + Logger.errors.REPLACEMENT_UNDERPRICED, + Logger.errors.UNPREDICTABLE_GAS_LIMIT, +]; +var ForwardProperties = [ + 'address', + 'args', + 'errorArgs', + 'errorSignature', + 'method', + 'transaction', +]; +function exposeDebugConfig(config2, now2) { + const result = { + weight: config2.weight, + }; + Object.defineProperty(result, 'provider', { get: () => config2.provider }); + if (config2.start) { + result.start = config2.start; + } + if (now2) { + result.duration = now2 - config2.start; + } + if (config2.done) { + if (config2.error) { + result.error = config2.error; + } else { + result.result = config2.result || null; + } + } + return result; +} +function normalizedTally(normalize2, quorum) { + return function (configs) { + const tally = {}; + configs.forEach((c) => { + const value = normalize2(c.result); + if (!tally[value]) { + tally[value] = { count: 0, result: c.result }; + } + tally[value].count++; + }); + const keys = Object.keys(tally); + for (let i2 = 0; i2 < keys.length; i2++) { + const check = tally[keys[i2]]; + if (check.count >= quorum) { + return check.result; + } + } + return void 0; + }; +} +function getProcessFunc(provider, method, params) { + let normalize2 = serialize2; + switch (method) { + case 'getBlockNumber': + return function (configs) { + const values = configs.map((c) => c.result); + let blockNumber = median( + configs.map((c) => c.result), + 2 + ); + if (blockNumber == null) { + return void 0; + } + blockNumber = Math.ceil(blockNumber); + if (values.indexOf(blockNumber + 1) >= 0) { + blockNumber++; + } + if (blockNumber >= provider._highestBlockNumber) { + provider._highestBlockNumber = blockNumber; + } + return provider._highestBlockNumber; + }; + case 'getGasPrice': + return function (configs) { + const values = configs.map((c) => c.result); + values.sort(); + return values[Math.floor(values.length / 2)]; + }; + case 'getEtherPrice': + return function (configs) { + return median(configs.map((c) => c.result)); + }; + case 'getBalance': + case 'getTransactionCount': + case 'getCode': + case 'getStorageAt': + case 'call': + case 'estimateGas': + case 'getLogs': + break; + case 'getTransaction': + case 'getTransactionReceipt': + normalize2 = function (tx) { + if (tx == null) { + return null; + } + tx = shallowCopy(tx); + tx.confirmations = -1; + return serialize2(tx); + }; + break; + case 'getBlock': + if (params.includeTransactions) { + normalize2 = function (block) { + if (block == null) { + return null; + } + block = shallowCopy(block); + block.transactions = block.transactions.map((tx) => { + tx = shallowCopy(tx); + tx.confirmations = -1; + return tx; + }); + return serialize2(block); + }; + } else { + normalize2 = function (block) { + if (block == null) { + return null; + } + return serialize2(block); + }; + } + break; + default: + throw new Error('unknown method: ' + method); + } + return normalizedTally(normalize2, provider.quorum); +} +function waitForSync(config2, blockNumber) { + return __awaiter16(this, void 0, void 0, function* () { + const provider = config2.provider; + if ( + (provider.blockNumber != null && provider.blockNumber >= blockNumber) || + blockNumber === -1 + ) { + return provider; + } + return poll( + () => { + return new Promise((resolve, reject) => { + setTimeout(function () { + if (provider.blockNumber >= blockNumber) { + return resolve(provider); + } + if (config2.cancelled) { + return resolve(null); + } + return resolve(void 0); + }, 0); + }); + }, + { oncePoll: provider } + ); + }); +} +function getRunner(config2, currentBlockNumber, method, params) { + return __awaiter16(this, void 0, void 0, function* () { + let provider = config2.provider; + switch (method) { + case 'getBlockNumber': + case 'getGasPrice': + return provider[method](); + case 'getEtherPrice': + if (provider.getEtherPrice) { + return provider.getEtherPrice(); + } + break; + case 'getBalance': + case 'getTransactionCount': + case 'getCode': + if (params.blockTag && isHexString(params.blockTag)) { + provider = yield waitForSync(config2, currentBlockNumber); + } + return provider[method](params.address, params.blockTag || 'latest'); + case 'getStorageAt': + if (params.blockTag && isHexString(params.blockTag)) { + provider = yield waitForSync(config2, currentBlockNumber); + } + return provider.getStorageAt( + params.address, + params.position, + params.blockTag || 'latest' + ); + case 'getBlock': + if (params.blockTag && isHexString(params.blockTag)) { + provider = yield waitForSync(config2, currentBlockNumber); + } + return provider[ + params.includeTransactions ? 'getBlockWithTransactions' : 'getBlock' + ](params.blockTag || params.blockHash); + case 'call': + case 'estimateGas': + if (params.blockTag && isHexString(params.blockTag)) { + provider = yield waitForSync(config2, currentBlockNumber); + } + if (method === 'call' && params.blockTag) { + return provider[method](params.transaction, params.blockTag); + } + return provider[method](params.transaction); + case 'getTransaction': + case 'getTransactionReceipt': + return provider[method](params.transactionHash); + case 'getLogs': { + let filter = params.filter; + if ( + (filter.fromBlock && isHexString(filter.fromBlock)) || + (filter.toBlock && isHexString(filter.toBlock)) + ) { + provider = yield waitForSync(config2, currentBlockNumber); + } + return provider.getLogs(filter); + } + } + return logger38.throwError( + 'unknown method error', + Logger.errors.UNKNOWN_ERROR, + { + method, + params, + } + ); + }); +} +var FallbackProvider = class extends BaseProvider { + constructor(providers, quorum) { + if (providers.length === 0) { + logger38.throwArgumentError('missing providers', 'providers', providers); + } + const providerConfigs = providers.map((configOrProvider, index) => { + if (Provider.isProvider(configOrProvider)) { + const stallTimeout = isCommunityResource(configOrProvider) ? 2e3 : 750; + const priority = 1; + return Object.freeze({ + provider: configOrProvider, + weight: 1, + stallTimeout, + priority, + }); + } + const config2 = shallowCopy(configOrProvider); + if (config2.priority == null) { + config2.priority = 1; + } + if (config2.stallTimeout == null) { + config2.stallTimeout = isCommunityResource(configOrProvider) + ? 2e3 + : 750; + } + if (config2.weight == null) { + config2.weight = 1; + } + const weight = config2.weight; + if (weight % 1 || weight > 512 || weight < 1) { + logger38.throwArgumentError( + 'invalid weight; must be integer in [1, 512]', + `providers[${index}].weight`, + weight + ); + } + return Object.freeze(config2); + }); + const total = providerConfigs.reduce((accum, c) => accum + c.weight, 0); + if (quorum == null) { + quorum = total / 2; + } else if (quorum > total) { + logger38.throwArgumentError( + 'quorum will always fail; larger than total weight', + 'quorum', + quorum + ); + } + let networkOrReady = checkNetworks( + providerConfigs.map((c) => c.provider.network) + ); + if (networkOrReady == null) { + networkOrReady = new Promise((resolve, reject) => { + setTimeout(() => { + this.detectNetwork().then(resolve, reject); + }, 0); + }); + } + super(networkOrReady); + defineReadOnly(this, 'providerConfigs', Object.freeze(providerConfigs)); + defineReadOnly(this, 'quorum', quorum); + this._highestBlockNumber = -1; + } + detectNetwork() { + return __awaiter16(this, void 0, void 0, function* () { + const networks2 = yield Promise.all( + this.providerConfigs.map((c) => c.provider.getNetwork()) + ); + return checkNetworks(networks2); + }); + } + perform(method, params) { + return __awaiter16(this, void 0, void 0, function* () { + if (method === 'sendTransaction') { + const results = yield Promise.all( + this.providerConfigs.map((c) => { + return c.provider.sendTransaction(params.signedTransaction).then( + (result) => { + return result.hash; + }, + (error) => { + return error; + } + ); + }) + ); + for (let i3 = 0; i3 < results.length; i3++) { + const result = results[i3]; + if (typeof result === 'string') { + return result; + } + } + throw results[0]; + } + if (this._highestBlockNumber === -1 && method !== 'getBlockNumber') { + yield this.getBlockNumber(); + } + const processFunc = getProcessFunc(this, method, params); + const configs = shuffled(this.providerConfigs.map(shallowCopy)); + configs.sort((a2, b) => a2.priority - b.priority); + const currentBlockNumber = this._highestBlockNumber; + let i2 = 0; + let first = true; + while (true) { + const t0 = now(); + let inflightWeight = configs + .filter((c) => c.runner && t0 - c.start < c.stallTimeout) + .reduce((accum, c) => accum + c.weight, 0); + while (inflightWeight < this.quorum && i2 < configs.length) { + const config2 = configs[i2++]; + const rid = nextRid++; + config2.start = now(); + config2.staller = stall2(config2.stallTimeout); + config2.staller.wait(() => { + config2.staller = null; + }); + config2.runner = getRunner( + config2, + currentBlockNumber, + method, + params + ).then( + (result) => { + config2.done = true; + config2.result = result; + if (this.listenerCount('debug')) { + this.emit('debug', { + action: 'request', + rid, + backend: exposeDebugConfig(config2, now()), + request: { method, params: deepCopy(params) }, + provider: this, + }); + } + }, + (error) => { + config2.done = true; + config2.error = error; + if (this.listenerCount('debug')) { + this.emit('debug', { + action: 'request', + rid, + backend: exposeDebugConfig(config2, now()), + request: { method, params: deepCopy(params) }, + provider: this, + }); + } + } + ); + if (this.listenerCount('debug')) { + this.emit('debug', { + action: 'request', + rid, + backend: exposeDebugConfig(config2, null), + request: { method, params: deepCopy(params) }, + provider: this, + }); + } + inflightWeight += config2.weight; + } + const waiting = []; + configs.forEach((c) => { + if (c.done || !c.runner) { + return; + } + waiting.push(c.runner); + if (c.staller) { + waiting.push(c.staller.getPromise()); + } + }); + if (waiting.length) { + yield Promise.race(waiting); + } + const results = configs.filter((c) => c.done && c.error == null); + if (results.length >= this.quorum) { + const result = processFunc(results); + if (result !== void 0) { + configs.forEach((c) => { + if (c.staller) { + c.staller.cancel(); + } + c.cancelled = true; + }); + return result; + } + if (!first) { + yield stall2(100).getPromise(); + } + first = false; + } + const errors = configs.reduce((accum, c) => { + if (!c.done || c.error == null) { + return accum; + } + const code9 = c.error.code; + if (ForwardErrors.indexOf(code9) >= 0) { + if (!accum[code9]) { + accum[code9] = { error: c.error, weight: 0 }; + } + accum[code9].weight += c.weight; + } + return accum; + }, {}); + Object.keys(errors).forEach((errorCode) => { + const tally = errors[errorCode]; + if (tally.weight < this.quorum) { + return; + } + configs.forEach((c) => { + if (c.staller) { + c.staller.cancel(); + } + c.cancelled = true; + }); + const e2 = tally.error; + const props = {}; + ForwardProperties.forEach((name) => { + if (e2[name] == null) { + return; + } + props[name] = e2[name]; + }); + logger38.throwError(e2.reason || e2.message, errorCode, props); + }); + if (configs.filter((c) => !c.done).length === 0) { + break; + } + } + configs.forEach((c) => { + if (c.staller) { + c.staller.cancel(); + } + c.cancelled = true; + }); + return logger38.throwError( + 'failed to meet quorum', + Logger.errors.SERVER_ERROR, + { + method, + params, + //results: configs.map((c) => c.result), + //errors: configs.map((c) => c.error), + results: configs.map((c) => exposeDebugConfig(c)), + provider: this, + } + ); + }); + } +}; + +// node_modules/@ethersproject/providers/lib.esm/ipc-provider.js +init_shim(); +var IpcProvider = null; + +// node_modules/@ethersproject/providers/lib.esm/infura-provider.js +init_shim(); +init_lib4(); +init_lib(); +var logger39 = new Logger(version24); +var defaultProjectId = '84842078b09946638c03157f83405213'; +var InfuraWebSocketProvider = class extends WebSocketProvider { + constructor(network, apiKey) { + const provider = new InfuraProvider(network, apiKey); + const connection = provider.connection; + if (connection.password) { + logger39.throwError( + 'INFURA WebSocket project secrets unsupported', + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: 'InfuraProvider.getWebSocketProvider()', + } + ); + } + const url = connection.url + .replace(/^http/i, 'ws') + .replace('/v3/', '/ws/v3/'); + super(url, network); + defineReadOnly(this, 'apiKey', provider.projectId); + defineReadOnly(this, 'projectId', provider.projectId); + defineReadOnly(this, 'projectSecret', provider.projectSecret); + } + isCommunityResource() { + return this.projectId === defaultProjectId; + } +}; +var InfuraProvider = class extends UrlJsonRpcProvider { + static getWebSocketProvider(network, apiKey) { + return new InfuraWebSocketProvider(network, apiKey); + } + static getApiKey(apiKey) { + const apiKeyObj = { + apiKey: defaultProjectId, + projectId: defaultProjectId, + projectSecret: null, + }; + if (apiKey == null) { + return apiKeyObj; + } + if (typeof apiKey === 'string') { + apiKeyObj.projectId = apiKey; + } else if (apiKey.projectSecret != null) { + logger39.assertArgument( + typeof apiKey.projectId === 'string', + 'projectSecret requires a projectId', + 'projectId', + apiKey.projectId + ); + logger39.assertArgument( + typeof apiKey.projectSecret === 'string', + 'invalid projectSecret', + 'projectSecret', + '[REDACTED]' + ); + apiKeyObj.projectId = apiKey.projectId; + apiKeyObj.projectSecret = apiKey.projectSecret; + } else if (apiKey.projectId) { + apiKeyObj.projectId = apiKey.projectId; + } + apiKeyObj.apiKey = apiKeyObj.projectId; + return apiKeyObj; + } + static getUrl(network, apiKey) { + let host = null; + switch (network ? network.name : 'unknown') { + case 'homestead': + host = 'mainnet.infura.io'; + break; + case 'goerli': + host = 'goerli.infura.io'; + break; + case 'sepolia': + host = 'sepolia.infura.io'; + break; + case 'matic': + host = 'polygon-mainnet.infura.io'; + break; + case 'maticmum': + host = 'polygon-mumbai.infura.io'; + break; + case 'optimism': + host = 'optimism-mainnet.infura.io'; + break; + case 'optimism-goerli': + host = 'optimism-goerli.infura.io'; + break; + case 'arbitrum': + host = 'arbitrum-mainnet.infura.io'; + break; + case 'arbitrum-goerli': + host = 'arbitrum-goerli.infura.io'; + break; + default: + logger39.throwError( + 'unsupported network', + Logger.errors.INVALID_ARGUMENT, + { + argument: 'network', + value: network, + } + ); + } + const connection = { + allowGzip: true, + url: 'https://' + host + '/v3/' + apiKey.projectId, + throttleCallback: (attempt, url) => { + if (apiKey.projectId === defaultProjectId) { + showThrottleMessage(); + } + return Promise.resolve(true); + }, + }; + if (apiKey.projectSecret != null) { + connection.user = ''; + connection.password = apiKey.projectSecret; + } + return connection; + } + isCommunityResource() { + return this.projectId === defaultProjectId; + } +}; + +// node_modules/@ethersproject/providers/lib.esm/json-rpc-batch-provider.js +init_shim(); +init_lib4(); +init_lib26(); +var JsonRpcBatchProvider = class extends JsonRpcProvider { + send(method, params) { + const request = { + method, + params, + id: this._nextId++, + jsonrpc: '2.0', + }; + if (this._pendingBatch == null) { + this._pendingBatch = []; + } + const inflightRequest = { request, resolve: null, reject: null }; + const promise = new Promise((resolve, reject) => { + inflightRequest.resolve = resolve; + inflightRequest.reject = reject; + }); + this._pendingBatch.push(inflightRequest); + if (!this._pendingBatchAggregator) { + this._pendingBatchAggregator = setTimeout(() => { + const batch = this._pendingBatch; + this._pendingBatch = null; + this._pendingBatchAggregator = null; + const request2 = batch.map((inflight) => inflight.request); + this.emit('debug', { + action: 'requestBatch', + request: deepCopy(request2), + provider: this, + }); + return fetchJson(this.connection, JSON.stringify(request2)).then( + (result) => { + this.emit('debug', { + action: 'response', + request: request2, + response: result, + provider: this, + }); + batch.forEach((inflightRequest2, index) => { + const payload = result[index]; + if (payload.error) { + const error = new Error(payload.error.message); + error.code = payload.error.code; + error.data = payload.error.data; + inflightRequest2.reject(error); + } else { + inflightRequest2.resolve(payload.result); + } + }); + }, + (error) => { + this.emit('debug', { + action: 'response', + error, + request: request2, + provider: this, + }); + batch.forEach((inflightRequest2) => { + inflightRequest2.reject(error); + }); + } + ); + }, 10); + } + return promise; + } +}; + +// node_modules/@ethersproject/providers/lib.esm/nodesmith-provider.js +init_shim(); +init_lib(); +var logger40 = new Logger(version24); +var defaultApiKey3 = 'ETHERS_JS_SHARED'; +var NodesmithProvider = class extends UrlJsonRpcProvider { + static getApiKey(apiKey) { + if (apiKey && typeof apiKey !== 'string') { + logger40.throwArgumentError('invalid apiKey', 'apiKey', apiKey); + } + return apiKey || defaultApiKey3; + } + static getUrl(network, apiKey) { + logger40.warn( + 'NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.' + ); + let host = null; + switch (network.name) { + case 'homestead': + host = 'https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc'; + break; + case 'ropsten': + host = 'https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc'; + break; + case 'rinkeby': + host = 'https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc'; + break; + case 'goerli': + host = 'https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc'; + break; + case 'kovan': + host = 'https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc'; + break; + default: + logger40.throwArgumentError( + 'unsupported network', + 'network', + arguments[0] + ); + } + return host + '?apiKey=' + apiKey; + } +}; + +// node_modules/@ethersproject/providers/lib.esm/pocket-provider.js +init_shim(); +init_lib(); +var logger41 = new Logger(version24); +var defaultApplicationId = '62e1ad51b37b8e00394bda3b'; +var PocketProvider = class extends UrlJsonRpcProvider { + static getApiKey(apiKey) { + const apiKeyObj = { + applicationId: null, + loadBalancer: true, + applicationSecretKey: null, + }; + if (apiKey == null) { + apiKeyObj.applicationId = defaultApplicationId; + } else if (typeof apiKey === 'string') { + apiKeyObj.applicationId = apiKey; + } else if (apiKey.applicationSecretKey != null) { + apiKeyObj.applicationId = apiKey.applicationId; + apiKeyObj.applicationSecretKey = apiKey.applicationSecretKey; + } else if (apiKey.applicationId) { + apiKeyObj.applicationId = apiKey.applicationId; + } else { + logger41.throwArgumentError( + 'unsupported PocketProvider apiKey', + 'apiKey', + apiKey + ); + } + return apiKeyObj; + } + static getUrl(network, apiKey) { + let host = null; + switch (network ? network.name : 'unknown') { + case 'goerli': + host = 'eth-goerli.gateway.pokt.network'; + break; + case 'homestead': + host = 'eth-mainnet.gateway.pokt.network'; + break; + case 'kovan': + host = 'poa-kovan.gateway.pokt.network'; + break; + case 'matic': + host = 'poly-mainnet.gateway.pokt.network'; + break; + case 'maticmum': + host = 'polygon-mumbai-rpc.gateway.pokt.network'; + break; + case 'rinkeby': + host = 'eth-rinkeby.gateway.pokt.network'; + break; + case 'ropsten': + host = 'eth-ropsten.gateway.pokt.network'; + break; + default: + logger41.throwError( + 'unsupported network', + Logger.errors.INVALID_ARGUMENT, + { + argument: 'network', + value: network, + } + ); + } + const url = `https://${host}/v1/lb/${apiKey.applicationId}`; + const connection = { headers: {}, url }; + if (apiKey.applicationSecretKey != null) { + connection.user = ''; + connection.password = apiKey.applicationSecretKey; + } + return connection; + } + isCommunityResource() { + return this.applicationId === defaultApplicationId; + } +}; + +// node_modules/@ethersproject/providers/lib.esm/web3-provider.js +init_shim(); +init_lib4(); +init_lib(); +var logger42 = new Logger(version24); +var _nextId = 1; +function buildWeb3LegacyFetcher(provider, sendFunc) { + const fetcher = 'Web3LegacyFetcher'; + return function (method, params) { + const request = { + method, + params, + id: _nextId++, + jsonrpc: '2.0', + }; + return new Promise((resolve, reject) => { + this.emit('debug', { + action: 'request', + fetcher, + request: deepCopy(request), + provider: this, + }); + sendFunc(request, (error, response) => { + if (error) { + this.emit('debug', { + action: 'response', + fetcher, + error, + request, + provider: this, + }); + return reject(error); + } + this.emit('debug', { + action: 'response', + fetcher, + request, + response, + provider: this, + }); + if (response.error) { + const error2 = new Error(response.error.message); + error2.code = response.error.code; + error2.data = response.error.data; + return reject(error2); + } + resolve(response.result); + }); + }); + }; +} +function buildEip1193Fetcher(provider) { + return function (method, params) { + if (params == null) { + params = []; + } + const request = { method, params }; + this.emit('debug', { + action: 'request', + fetcher: 'Eip1193Fetcher', + request: deepCopy(request), + provider: this, + }); + return provider.request(request).then( + (response) => { + this.emit('debug', { + action: 'response', + fetcher: 'Eip1193Fetcher', + request, + response, + provider: this, + }); + return response; + }, + (error) => { + this.emit('debug', { + action: 'response', + fetcher: 'Eip1193Fetcher', + request, + error, + provider: this, + }); + throw error; + } + ); + }; +} +var Web3Provider = class extends JsonRpcProvider { + constructor(provider, network) { + if (provider == null) { + logger42.throwArgumentError('missing provider', 'provider', provider); + } + let path = null; + let jsonRpcFetchFunc = null; + let subprovider = null; + if (typeof provider === 'function') { + path = 'unknown:'; + jsonRpcFetchFunc = provider; + } else { + path = provider.host || provider.path || ''; + if (!path && provider.isMetaMask) { + path = 'metamask'; + } + subprovider = provider; + if (provider.request) { + if (path === '') { + path = 'eip-1193:'; + } + jsonRpcFetchFunc = buildEip1193Fetcher(provider); + } else if (provider.sendAsync) { + jsonRpcFetchFunc = buildWeb3LegacyFetcher( + provider, + provider.sendAsync.bind(provider) + ); + } else if (provider.send) { + jsonRpcFetchFunc = buildWeb3LegacyFetcher( + provider, + provider.send.bind(provider) + ); + } else { + logger42.throwArgumentError( + 'unsupported provider', + 'provider', + provider + ); + } + if (!path) { + path = 'unknown:'; + } + } + super(path, network); + defineReadOnly(this, 'jsonRpcFetchFunc', jsonRpcFetchFunc); + defineReadOnly(this, 'provider', subprovider); + } + send(method, params) { + return this.jsonRpcFetchFunc(method, params); + } +}; + +// node_modules/@ethersproject/providers/lib.esm/index.js +init_lib(); +var logger43 = new Logger(version24); +function getDefaultProvider(network, options) { + if (network == null) { + network = 'homestead'; + } + if (typeof network === 'string') { + const match = network.match(/^(ws|http)s?:/i); + if (match) { + switch (match[1].toLowerCase()) { + case 'http': + case 'https': + return new JsonRpcProvider(network); + case 'ws': + case 'wss': + return new WebSocketProvider(network); + default: + logger43.throwArgumentError( + 'unsupported URL scheme', + 'network', + network + ); + } + } + } + const n2 = getNetwork(network); + if (!n2 || !n2._defaultProvider) { + logger43.throwError( + 'unsupported getDefaultProvider network', + Logger.errors.NETWORK_ERROR, + { + operation: 'getDefaultProvider', + network, + } + ); + } + return n2._defaultProvider( + { + FallbackProvider, + AlchemyProvider, + AnkrProvider, + CloudflareProvider, + EtherscanProvider, + InfuraProvider, + JsonRpcProvider, + NodesmithProvider, + PocketProvider, + Web3Provider, + IpcProvider, + }, + options + ); +} + +// node_modules/ethers/lib.esm/ethers.js +init_lib21(); + +// node_modules/ethers/lib.esm/utils.js +var utils_exports = {}; +__export(utils_exports, { + AbiCoder: () => AbiCoder, + ConstructorFragment: () => ConstructorFragment, + ErrorFragment: () => ErrorFragment, + EventFragment: () => EventFragment, + FormatTypes: () => FormatTypes, + Fragment: () => Fragment, + FunctionFragment: () => FunctionFragment, + HDNode: () => HDNode, + Indexed: () => Indexed, + Interface: () => Interface, + LogDescription: () => LogDescription, + Logger: () => Logger, + ParamType: () => ParamType, + RLP: () => lib_exports5, + SigningKey: () => SigningKey, + SupportedAlgorithm: () => SupportedAlgorithm, + TransactionDescription: () => TransactionDescription, + TransactionTypes: () => TransactionTypes, + UnicodeNormalizationForm: () => UnicodeNormalizationForm, + Utf8ErrorFuncs: () => Utf8ErrorFuncs, + Utf8ErrorReason: () => Utf8ErrorReason, + _TypedDataEncoder: () => TypedDataEncoder, + _fetchData: () => _fetchData, + _toEscapedUtf8String: () => _toEscapedUtf8String, + accessListify: () => accessListify, + arrayify: () => arrayify, + base58: () => Base58, + base64: () => lib_exports9, + checkProperties: () => checkProperties, + checkResultErrors: () => checkResultErrors, + commify: () => commify, + computeAddress: () => computeAddress, + computeHmac: () => computeHmac, + computePublicKey: () => computePublicKey, + concat: () => concat, + deepCopy: () => deepCopy, + defaultAbiCoder: () => defaultAbiCoder, + defaultPath: () => defaultPath, + defineReadOnly: () => defineReadOnly, + dnsEncode: () => dnsEncode, + entropyToMnemonic: () => entropyToMnemonic, + fetchJson: () => fetchJson, + formatBytes32String: () => formatBytes32String, + formatEther: () => formatEther, + formatUnits: () => formatUnits, + getAccountPath: () => getAccountPath, + getAddress: () => getAddress, + getContractAddress: () => getContractAddress, + getCreate2Address: () => getCreate2Address, + getIcapAddress: () => getIcapAddress, + getJsonWalletAddress: () => getJsonWalletAddress, + getStatic: () => getStatic, + hashMessage: () => hashMessage, + hexConcat: () => hexConcat, + hexDataLength: () => hexDataLength, + hexDataSlice: () => hexDataSlice, + hexStripZeros: () => hexStripZeros, + hexValue: () => hexValue, + hexZeroPad: () => hexZeroPad, + hexlify: () => hexlify, + id: () => id, + isAddress: () => isAddress, + isBytes: () => isBytes, + isBytesLike: () => isBytesLike, + isHexString: () => isHexString, + isValidMnemonic: () => isValidMnemonic, + isValidName: () => isValidName, + joinSignature: () => joinSignature, + keccak256: () => keccak256, + mnemonicToEntropy: () => mnemonicToEntropy, + mnemonicToSeed: () => mnemonicToSeed, + namehash: () => namehash, + nameprep: () => nameprep, + parseBytes32String: () => parseBytes32String, + parseEther: () => parseEther, + parseTransaction: () => parse, + parseUnits: () => parseUnits, + poll: () => poll, + randomBytes: () => randomBytes, + recoverAddress: () => recoverAddress, + recoverPublicKey: () => recoverPublicKey, + resolveProperties: () => resolveProperties, + ripemd160: () => ripemd160, + serializeTransaction: () => serialize, + sha256: () => sha256, + sha512: () => sha512, + shallowCopy: () => shallowCopy, + shuffled: () => shuffled, + solidityKeccak256: () => keccak2562, + solidityPack: () => pack2, + soliditySha256: () => sha2562, + splitSignature: () => splitSignature, + stripZeros: () => stripZeros, + toUtf8Bytes: () => toUtf8Bytes, + toUtf8CodePoints: () => toUtf8CodePoints, + toUtf8String: () => toUtf8String, + verifyMessage: () => verifyMessage, + verifyTypedData: () => verifyTypedData, + zeroPad: () => zeroPad, +}); +init_shim(); +init_lib13(); +init_lib7(); +init_lib10(); +init_lib18(); +init_lib2(); +init_lib12(); +init_lib22(); +init_lib24(); +init_lib5(); +init_lib(); +init_lib19(); +init_lib27(); +init_lib23(); +init_lib4(); +init_lib6(); +init_lib16(); +init_lib9(); +init_lib17(); +init_lib28(); +init_lib25(); +init_lib26(); +init_lib19(); +init_lib9(); + +// node_modules/ethers/lib.esm/ethers.js +init_lib(); + +// node_modules/ethers/lib.esm/_version.js +init_shim(); +var version27 = 'ethers/5.7.2'; + +// node_modules/ethers/lib.esm/ethers.js +var logger46 = new Logger(version27); + +// node_modules/ethers/lib.esm/index.js +try { + const anyGlobal2 = window; + if (anyGlobal2._ethers == null) { + anyGlobal2._ethers = ethers_exports; + } +} catch (error) {} + +// packages/misc/src/lib/addresses.ts +var import_utils3 = __toESM(require_utils2()); +function publicKeyConvert(publicKey, compressed = true) { + if (compressed) { + if (publicKey.length === 65 && publicKey[0] === 4) { + const x = publicKey.subarray(1, 33); + const y = publicKey.subarray(33, 65); + const prefix = y[y.length - 1] % 2 === 0 ? 2 : 3; + return Buffer.concat([Buffer.from([prefix]), x]); + } + } else { + if (publicKey.length === 33 && (publicKey[0] === 2 || publicKey[0] === 3)) { + const x = publicKey.subarray(1); + const y = decompressY(publicKey[0], x); + return Buffer.concat([Buffer.from([4]), x, y]); + } + } + return publicKey; +} +function decompressY(prefix, x) { + const p = BigInt( + '0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F' + ); + const a2 = BigInt('0'); + const b = BigInt('7'); + const xBigInt = BigInt('0x' + x.toString('hex')); + const rhs = (xBigInt ** 3n + a2 * xBigInt + b) % p; + const yBigInt = modSqrt(rhs, p); + const isEven = yBigInt % 2n === 0n; + const y = isEven === (prefix === 2) ? yBigInt : p - yBigInt; + return Buffer.from(y.toString(16).padStart(64, '0'), 'hex'); +} +function modSqrt(a2, p) { + return a2 ** ((p + 1n) / 4n) % p; +} +function deriveBitcoinAddress(ethPubKey) { + if (ethPubKey.startsWith('0x')) { + ethPubKey = ethPubKey.slice(2); + } + const pubkeyBuffer = Buffer.from(ethPubKey, 'hex'); + const sha256Hash = createHash('sha256').update(pubkeyBuffer).digest(); + const ripemd160Hash = createHash('ripemd160').update(sha256Hash).digest(); + const versionedPayload = Buffer.concat([Buffer.from([0]), ripemd160Hash]); + const checksum = createHash('sha256') + .update(createHash('sha256').update(versionedPayload).digest()) + .digest() + .subarray(0, 4); + const binaryBitcoinAddress = Buffer.concat([versionedPayload, checksum]); + return ethers_exports.utils.base58.encode(binaryBitcoinAddress); +} +function deriveCosmosAddress(ethPubKey, prefix = 'cosmos') { + let pubKeyBuffer = Buffer.from(ethPubKey, 'hex'); + if (pubKeyBuffer.length === 65 && pubKeyBuffer[0] === 4) { + pubKeyBuffer = Buffer.from(publicKeyConvert(pubKeyBuffer, true)); + } + const sha256Hash = createHash('sha256').update(pubKeyBuffer).digest(); + const ripemd160Hash = createHash('ripemd160').update(sha256Hash).digest(); + return bech322.encode(prefix, bech322.toWords(ripemd160Hash)); +} +var derivedAddresses = async ({ + publicKey, + pkpTokenId, + pkpContractAddress, + defaultRPCUrl, + options = { + cacheContractCall: false, + }, +}) => { + if (!publicKey && !pkpTokenId) { + throw new ParamsMissingError( + { + info: { + publicKey, + pkpTokenId, + }, + }, + 'publicKey or pkpTokenId must be provided' + ); + } + let isNewPKP = false; + if (pkpTokenId) { + const CACHE_KEY = 'lit-cached-pkps'; + let cachedPkpJSON; + try { + const cachedPkp = localStorage.getItem(CACHE_KEY); + if (cachedPkp) { + cachedPkpJSON = JSON.parse(cachedPkp); + publicKey = cachedPkpJSON[pkpTokenId]; + } + } catch (e2) { + console.error(e2); + } + if (!publicKey) { + if (!defaultRPCUrl || !pkpContractAddress) { + throw new NoWalletException( + { + info: { + publicKey, + pkpTokenId, + pkpContractAddress, + defaultRPCUrl, + }, + }, + 'defaultRPCUrl or pkpContractAddress was not provided' + ); + } + const provider = new ethers_exports.providers.StaticJsonRpcProvider( + defaultRPCUrl + ); + const contract = new Contract( + pkpContractAddress, + ['function getPubkey(uint256 tokenId) view returns (bytes memory)'], + provider + ); + publicKey = await contract['getPubkey'](pkpTokenId); + isNewPKP = true; + } + if (options.cacheContractCall) { + try { + const cachedPkp = localStorage.getItem(CACHE_KEY); + if (cachedPkp) { + const cachedPkpJSON2 = JSON.parse(cachedPkp); + cachedPkpJSON2[pkpTokenId] = publicKey; + localStorage.setItem(CACHE_KEY, JSON.stringify(cachedPkpJSON2)); + } else { + const cachedPkpJSON2 = {}; + cachedPkpJSON2[pkpTokenId] = publicKey; + localStorage.setItem(CACHE_KEY, JSON.stringify(cachedPkpJSON2)); + } + } catch (e2) { + console.error(e2); + } + } + } + if (!publicKey) { + throw new NoWalletException( + { + info: { + publicKey, + pkpTokenId, + pkpContractAddress, + defaultRPCUrl, + }, + }, + 'publicKey was not provided or could not be obtained from the pkpTokenId' + ); + } + if (publicKey.startsWith('0x')) { + publicKey = publicKey.slice(2); + } + const pubkeyBuffer = Buffer.from(publicKey, 'hex'); + const ethAddress = (0, import_utils3.computeAddress)(pubkeyBuffer); + const btcAddress = deriveBitcoinAddress(publicKey); + const cosmosAddress = deriveCosmosAddress(publicKey); + if (!btcAddress || !ethAddress || !cosmosAddress) { + const errors = []; + if (!btcAddress) { + errors.push( + new NoWalletException( + { + info: { + publicKey, + }, + }, + 'btcAddress is undefined' + ) + ); + } + if (!ethAddress) { + errors.push( + new NoWalletException( + { + info: { + publicKey, + }, + }, + 'ethAddress is undefined' + ) + ); + } + if (!cosmosAddress) { + errors.push( + new NoWalletException( + { + info: { + publicKey, + }, + }, + 'cosmosAddress is undefined' + ) + ); + } + throw new MultiError(errors); + } + return { + tokenId: pkpTokenId, + publicKey: `0x${publicKey}`, + publicKeyBuffer: pubkeyBuffer, + ethAddress, + btcAddress, + cosmosAddress, + isNewPKP, + }; +}; + +// packages/misc/src/lib/misc.ts +init_shim(); +import Ajv from 'ajv'; + +// packages/logger/src/index.ts +init_shim(); + +// packages/logger/src/lib/logger.ts +init_shim(); +var import_utils4 = __toESM(require_utils2()); +var colours = { + reset: '\x1B[0m', + bright: '\x1B[1m', + dim: '\x1B[2m', + underscore: '\x1B[4m', + blink: '\x1B[5m', + reverse: '\x1B[7m', + hidden: '\x1B[8m', + fg: { + black: '\x1B[30m', + red: '\x1B[31m', + green: '\x1B[32m', + yellow: '\x1B[33m', + blue: '\x1B[34m', + magenta: '\x1B[35m', + cyan: '\x1B[36m', + white: '\x1B[37m', + gray: '\x1B[90m', + crimson: '\x1B[38m', + // Scarlet + }, + bg: { + black: '\x1B[40m', + red: '\x1B[41m', + green: '\x1B[42m', + yellow: '\x1B[43m', + blue: '\x1B[44m', + magenta: '\x1B[45m', + cyan: '\x1B[46m', + white: '\x1B[47m', + gray: '\x1B[100m', + crimson: '\x1B[48m', + }, +}; +function _convertLoggingLevel(level) { + switch (level) { + case LOG_LEVEL.INFO: + return `${colours.fg.green}[INFO]${colours.reset}`; + case LOG_LEVEL.DEBUG: + return `${colours.fg.cyan}[DEBUG]${colours.reset}`; + case LOG_LEVEL.WARN: + return `${colours.fg.yellow}[WARN]${colours.reset}`; + case LOG_LEVEL.ERROR: + return `${colours.fg.red}[ERROR]${colours.reset}`; + case LOG_LEVEL.FATAL: + return `${colours.fg.red}[FATAL]${colours.reset}`; + case LOG_LEVEL.TIMING_START: + return `${colours.fg.green}[TIME_START]${colours.reset}`; + case LOG_LEVEL.TIMING_END: + return `${colours.fg.green}[TIME_END]${colours.reset}`; + } + return '[UNKNOWN]'; +} +function _resolveLoggingHandler(level) { + switch (level) { + case LOG_LEVEL.DEBUG: + return console.debug; + case LOG_LEVEL.INFO: + return console.info; + case LOG_LEVEL.ERROR: + return console.error; + case LOG_LEVEL.WARN: + return console.warn; + case LOG_LEVEL.FATAL: + return console.error; + case LOG_LEVEL.TIMING_END: + return console.timeLog; + case LOG_LEVEL.TIMING_START: + return console.time; + } +} +function _safeStringify(obj, indent = 2) { + let cache = []; + const retVal = JSON.stringify( + obj, + (_key, value) => + typeof value === 'object' && value !== null + ? cache?.includes(value) + ? void 0 + : cache?.push(value) && value + : value, + indent + ); + cache = null; + return retVal; +} +var Log = class { + timestamp; + message; + args; + id; + category; + level; + error; + constructor(timestamp, message, args, id2, category, level) { + this.timestamp = timestamp; + this.message = message; + this.args = args; + this.id = id2; + this.category = category; + this.level = level; + } + toString() { + let fmtStr = `[Lit-JS-SDK v${version}]${_convertLoggingLevel( + this.level + )} [${this.category}] [id: ${this.id}] ${this.message}`; + for (let i2 = 0; i2 < this.args.length; i2++) { + if (typeof this.args[i2] === 'object') { + fmtStr = `${fmtStr} ${_safeStringify(this.args[i2])}`; + } else { + fmtStr = `${fmtStr} ${this.args[i2]}`; + } + } + return fmtStr; + } + toArray() { + const args = []; + args.push(`[Lit-JS-SDK v${version}]`); + args.push(`[${this.timestamp}]`); + args.push(_convertLoggingLevel(this.level)); + args.push(`[${this.category}]`); + this.id && args.push(`${colours.fg.cyan}[id: ${this.id}]${colours.reset}`); + this.message && args.push(this.message); + for (let i2 = 0; i2 < this.args.length; i2++) { + args.push(this.args[i2]); + } + return args; + } + toJSON() { + return { + timestamp: this.timestamp, + message: this.message, + args: this.args, + id: this.id, + category: this.category, + level: this.level, + }; + } +}; +var Logger2 = class { + _category; + _level; + _id; + _handler; + _consoleHandler; + _logs = []; + _logHashes = /* @__PURE__ */ new Map(); + _config; + _isParent; + _children; + _timestamp; + static createLogger(category, level, id2, isParent, config2) { + return new Logger2(category, level, id2, isParent, config2); + } + constructor(category, level, id2, isParent, config2) { + this._category = category; + this._level = level; + this._id = id2; + this._consoleHandler = _resolveLoggingHandler(this._level); + this._config = config2; + this._children = /* @__PURE__ */ new Map(); + this._isParent = isParent; + this._timestamp = Date.now(); + } + get id() { + return this._id; + } + get category() { + return this._category; + } + get timestamp() { + return this._timestamp; + } + get Logs() { + return this._logs; + } + set Config(value) { + this._config = value; + } + get Config() { + return this._config; + } + get Children() { + return this._children; + } + setLevel(level) { + this._level = level; + } + setHandler(handler) { + this._handler = handler; + } + info(message = '', ...args) { + this._log(LOG_LEVEL.INFO, message, ...args); + } + debug(message = '', ...args) { + this._log(LOG_LEVEL.DEBUG, message, ...args); + } + warn(message = '', ...args) { + this._log(LOG_LEVEL.WARN, message, args); + } + error(message = '', ...args) { + this._log(LOG_LEVEL.ERROR, message, ...args); + } + fatal(message = '', ...args) { + this._log(LOG_LEVEL.FATAL, message, ...args); + } + trace(message = '', ...args) { + this._log(LOG_LEVEL.FATAL, message, ...args); + } + timeStart(message = '', ...args) { + this._log(LOG_LEVEL.TIMING_START, message, ...args); + } + timeEnd(message = '', ...args) { + this._level < LOG_LEVEL.OFF && + this._log(LOG_LEVEL.TIMING_END, message, ...args); + } + _log(level, message = '', ...args) { + const log3 = new Log( + /* @__PURE__ */ new Date().toISOString(), + message, + args, + this._id, + this._category, + level + ); + const arrayLog = log3.toArray(); + if (this._config?.['condenseLogs'] && !this._checkHash(log3)) { + (this._level >= level || level === 0) /* ERROR */ && + this._consoleHandler && + this._consoleHandler(...arrayLog); + (this._level >= level || level === LOG_LEVEL.ERROR) && + this._handler && + this._handler(log3); + (this._level >= level || level === 0) /* ERROR */ && this._addLog(log3); + } else if (!this._config?.['condenseLogs']) { + (this._level >= level || level === 0) /* ERROR */ && + this._consoleHandler && + this._consoleHandler(...arrayLog); + (this._level >= level || level === LOG_LEVEL.ERROR) && + this._handler && + this._handler(log3); + (this._level >= level || level === LOG_LEVEL.ERROR) && this._addLog(log3); + } + } + _checkHash(log3) { + const strippedMessage = this._cleanString(log3.message); + const digest = (0, import_utils4.hashMessage)(strippedMessage); + const hash3 = digest.toString(); + const item = this._logHashes.get(hash3); + if (item) { + return true; + } else { + this._logHashes.set(hash3, true); + return false; + } + } + _addLog(log3) { + this._logs.push(log3); + } + _addToLocalStorage(log3) { + if (globalThis.localStorage) { + let bucket = globalThis.localStorage.getItem(log3.category); + if (bucket) { + bucket = JSON.parse(bucket); + if (!bucket[log3.id]) { + bucket[log3.id] = []; + } + bucket[log3.id].push(log3.toString()); + globalThis.localStorage.setItem(log3.category, _safeStringify(bucket)); + } else { + const bucket2 = {}; + bucket2[log3.id] = [log3.toString()]; + globalThis.localStorage.setItem(log3.category, _safeStringify(bucket2)); + } + } + } + /** + * + * @param input string which will be cleaned of non utf-8 characters + * @returns {string} input cleaned of non utf-8 characters + */ + _cleanString(input) { + let output = ''; + for (let i2 = 0; i2 < input.length; i2++) { + if (input.charCodeAt(i2) <= 127) { + output += input.charAt(i2); + } + } + return output; + } +}; +var _LogManager = class { + _loggers; + _level = LOG_LEVEL.DEBUG; + _config; + static get Instance() { + if (!_LogManager._instance) { + _LogManager._instance = new _LogManager(); + } + return _LogManager._instance; + } + static clearInstance() { + _LogManager._instance = void 0; + } + constructor() { + this._loggers = /* @__PURE__ */ new Map(); + } + withConfig(config2) { + this._config = config2; + for (const logger48 of this._loggers) { + logger48[1].Config = config2; + } + } + setLevel(level) { + this._level = level; + for (const logger48 of this._loggers) { + logger48[1].setLevel(level); + } + } + setHandler(handler) { + for (const logger48 of this._loggers) { + logger48[1].setHandler(handler); + } + } + get LoggerIds() { + const keys = []; + for (const category of this._loggers.entries()) { + for (const child of category[1].Children) { + keys.push([child[0], child[1].timestamp]); + } + } + return keys + .sort((a2, b) => { + return a2[1] - b[1]; + }) + .map((value) => { + return value[0]; + }); + } + // if a logger is given an id it will persist logs under its logger instance + get(category, id2) { + let instance = this._loggers.get(category); + if (!instance && !id2) { + this._loggers.set( + category, + Logger2.createLogger(category, this._level ?? LOG_LEVEL.INFO, '', true) + ); + instance = this._loggers.get(category); + instance.Config = this._config; + return instance; + } + if (id2) { + if (!instance) { + this._loggers.set( + category, + Logger2.createLogger( + category, + this._level ?? LOG_LEVEL.INFO, + '', + true + ) + ); + instance = this._loggers.get(category); + instance.Config = this._config; + } + const children = instance?.Children; + let child = children?.get(id2); + if (child) { + return child; + } + children?.set( + id2, + Logger2.createLogger( + category, + this._level ?? LOG_LEVEL.INFO, + id2 ?? '', + true + ) + ); + child = children?.get(id2); + child.Config = this._config; + return children?.get(id2); + } else if (!instance) { + this._loggers.set( + category, + Logger2.createLogger(category, this._level ?? LOG_LEVEL.INFO, '', true) + ); + instance = this._loggers.get(category); + instance.Config = this._config; + } + return instance; + } + getById(id2) { + let logStrs = []; + for (const category of this._loggers.entries()) { + const logger48 = category[1].Children.get(id2); + if (logger48) { + const logStr = []; + for (const log3 of logger48.Logs) { + logStr.push(log3.toString()); + } + logStrs = logStrs.concat(logStr); + } + } + return logStrs; + } + getLogsForId(id2) { + let logsForRequest = this.getById(id2); + if (logsForRequest.length < 1 && globalThis.localStorage) { + for (const category of this._loggers.keys()) { + const bucketStr = globalThis.localStorage.getItem(category); + const bucket = JSON.parse(bucketStr); + if (bucket && bucket[id2]) { + const logsForId = bucket[id2].filter((log3) => log3.includes(id2)); + logsForRequest = logsForId.concat(logsForRequest); + } + } + } + return logsForRequest; + } +}; +var LogManager = _LogManager; +__publicField(LogManager, '_instance'); + +// packages/misc/src/lib/misc.ts +var logBuffer = []; +var ajv = new Ajv(); +var litConfig; +var setMiscLitConfig = (config2) => { + litConfig = config2; +}; +var mostCommonString = (arr) => { + return arr + .sort( + (a2, b) => + arr.filter((v) => v === a2).length - arr.filter((v) => v === b).length + ) + .pop(); +}; +var findMostCommonResponse = (responses) => { + const result = {}; + const keys = new Set(responses.flatMap(Object.keys)); + for (const key2 of keys) { + const values = responses.map((response) => response[key2]); + const filteredValues = values.filter( + (value) => value !== void 0 && value !== '' + ); + if (filteredValues.length === 0) { + result[key2] = void 0; + } else if ( + typeof filteredValues[0] === 'object' && + !Array.isArray(filteredValues[0]) + ) { + result[key2] = findMostCommonResponse(filteredValues); + } else { + result[key2] = mostCommonString(filteredValues); + } + } + return result; +}; +var bootstrapLogManager = (id2, level = LOG_LEVEL.DEBUG) => { + if (!globalThis.logManager) { + globalThis.logManager = LogManager.Instance; + globalThis.logManager.withConfig({ + condenseLogs: true, + }); + globalThis.logManager.setLevel(level); + } + globalThis.logger = globalThis.logManager.get(id2); +}; +var getLoggerbyId = (id2) => { + return globalThis.logManager.get(id2); +}; +var log = (...args) => { + if (!globalThis) { + console.log(...args); + return; + } + if (!litConfig) { + logBuffer.push(args); + return; + } + while (logBuffer.length > 0) { + const log3 = logBuffer.shift() ?? ''; + globalThis?.logger && globalThis?.logger.debug(...log3); + } + globalThis?.logger && globalThis?.logger.debug(...args); +}; +var logWithRequestId = (id2, ...args) => { + if (!globalThis) { + console.log(...args); + return; + } + if (!litConfig) { + logBuffer.push(args); + return; + } + while (logBuffer.length > 0) { + const log3 = logBuffer.shift() ?? ''; + globalThis?.logger && + globalThis.logManager.get(globalThis.logger.category, id2).debug(...log3); + } + globalThis?.logger && + globalThis.logManager.get(globalThis.logger.category, id2).debug(...args); +}; +var logErrorWithRequestId = (id2, ...args) => { + if (!globalThis) { + console.log(...args); + return; + } + if (!litConfig) { + logBuffer.push(args); + return; + } + while (logBuffer.length > 0) { + const log3 = logBuffer.shift() ?? ''; + globalThis?.logger && + globalThis.logManager.get(globalThis.logger.category, id2).error(...log3); + } + globalThis?.logger && + globalThis.logManager.get(globalThis.logger.category, id2).error(...args); +}; +var logError = (...args) => { + if (!globalThis) { + console.log(...args); + return; + } + if (!litConfig) { + logBuffer.push(args); + return; + } + while (logBuffer.length > 0) { + const log3 = logBuffer.shift() ?? ''; + globalThis?.logger && + globalThis.logManager.get(globalThis.logger.category).error(...log3); + } + globalThis?.logger && + globalThis.logManager.get(globalThis.logger.category).error(...args); +}; +var getVarType = (value) => { + return Object.prototype.toString.call(value).slice(8, -1); +}; +var checkType = ({ + value, + allowedTypes, + paramName, + functionName, + throwOnError = true, +}) => { + if (!allowedTypes.includes(getVarType(value))) { + const message = `Expecting ${allowedTypes.join( + ' or ' + )} type for parameter named ${paramName} in Lit-JS-SDK function ${functionName}(), but received "${getVarType( + value + )}" type instead. value: ${ + value instanceof Object ? JSON.stringify(value) : value + }`; + if (throwOnError) { + throw new InvalidParamType( + { + info: { + allowedTypes, + value, + paramName, + functionName, + }, + }, + message + ); + } + return false; + } + return true; +}; +var checkSchema = ( + value, + schema, + paramName, + functionName, + throwOnError = true +) => { + let validate5 = schema.$id ? ajv.getSchema(schema.$id) : void 0; + if (!validate5) { + validate5 = ajv.compile(schema); + } + const validates = validate5(value); + const message = `FAILED schema validation for parameter named ${paramName} in Lit-JS-SDK function ${functionName}(). Value: ${ + value instanceof Object ? JSON.stringify(value) : value + }. Errors: ${JSON.stringify(validate5.errors)}`; + if (!validates) { + if (throwOnError) { + throw new InvalidParamType( + { + info: { + value, + paramName, + functionName, + }, + }, + message + ); + } + return false; + } + return true; +}; +var checkIfAuthSigRequiresChainParam = (authSig, chain, functionName) => { + log('checkIfAuthSigRequiresChainParam'); + for (const key2 of LIT_AUTH_SIG_CHAIN_KEYS) { + if (key2 in authSig) { + return true; + } + } + if ( + !checkType({ + value: chain, + allowedTypes: ['String'], + paramName: 'chain', + functionName, + }) + ) { + return false; + } + return true; +}; +var sortedObject = (obj) => { + if (typeof obj !== 'object' || obj === null) { + return obj; + } + if (Array.isArray(obj)) { + return obj.map(sortedObject); + } + const sortedKeys = Object.keys(obj).sort(); + const result = {}; + sortedKeys.forEach((key2) => { + result[key2] = sortedObject(obj[key2]); + }); + return result; +}; +var numberToHex = (v) => { + return '0x' + v.toString(16); +}; +var is = (value, type, paramName, functionName, throwOnError = true) => { + if (getVarType(value) !== type) { + const message = `Expecting "${type}" type for parameter named ${paramName} in Lit-JS-SDK function ${functionName}(), but received "${getVarType( + value + )}" type instead. value: ${ + value instanceof Object ? JSON.stringify(value) : value + }`; + if (throwOnError) { + throw new InvalidParamType( + { + info: { + value, + paramName, + functionName, + }, + }, + message + ); + } + return false; + } + return true; +}; +var isNode = () => { + let isNode2 = false; + if (typeof process === 'object') { + if (typeof process.versions === 'object') { + if (typeof process.versions.node !== 'undefined') { + isNode2 = true; + } + } + } + return isNode2; +}; +var isBrowser = () => { + return isNode() === false; +}; +function isSupportedLitNetwork(litNetwork) { + const supportedNetworks2 = Object.values(LIT_NETWORK); + if (!supportedNetworks2.includes(litNetwork)) { + throw new WrongNetworkException( + { + info: { + litNetwork, + supportedNetworks: supportedNetworks2, + }, + }, + `Unsupported LitNetwork! (${supportedNetworks2.join('|')}) are supported.` + ); + } +} +var defaultMintClaimCallback = async ( + params, + network = LIT_NETWORK.DatilDev +) => { + isSupportedLitNetwork(network); + const AUTH_CLAIM_PATH = '/auth/claim'; + const relayUrl = params.relayUrl || RELAYER_URL_BY_NETWORK[network]; + if (!relayUrl) { + throw new InvalidArgumentException( + { + info: { + network, + relayUrl, + }, + }, + 'No relayUrl provided and no default relayUrl found for network' + ); + } + const relayUrlWithPath = relayUrl + AUTH_CLAIM_PATH; + const response = await fetch(relayUrlWithPath, { + method: 'POST', + body: JSON.stringify(params), + headers: { + 'api-key': params.relayApiKey + ? params.relayApiKey + : '67e55044-10b1-426f-9247-bb680e5fe0c8_relayer', + 'Content-Type': 'application/json', + }, + }); + if (response.status < 200 || response.status >= 400) { + const errResp = (await response.json()) ?? ''; + const errStmt = `An error occurred requesting "/auth/claim" endpoint ${JSON.stringify( + errResp + )}`; + console.warn(errStmt); + throw new NetworkError( + { + info: { + response, + errResp, + }, + }, + `An error occurred requesting "/auth/claim" endpoint` + ); + } + const body = await response.json(); + return body.requestId; +}; +var hexPrefixed = (str) => { + if (str.startsWith('0x')) { + return str; + } + return '0x' + str; +}; +var removeHexPrefix = (str) => { + if (str.startsWith('0x')) { + return str.slice(2); + } + return str; +}; +function sendRequest(url, req, requestId) { + return fetch(url, req) + .then(async (response) => { + const isJson = response.headers + .get('content-type') + ?.includes('application/json'); + const data = isJson ? await response.json() : null; + if (!response.ok) { + const error = data || response.status; + return Promise.reject(error); + } + return data; + }) + .catch((error) => { + logErrorWithRequestId( + requestId, + `Something went wrong, internal id for request: lit_${requestId}. Please provide this identifier with any support requests. ${ + error?.message || error?.details + ? `Error is ${error.message} - ${error.details}` + : '' + }` + ); + return Promise.reject(error); + }); +} +function normalizeAndStringify(input) { + try { + if (!input.startsWith('{') && !input.startsWith('[')) { + return input; + } + const parsed = JSON.parse(input); + return JSON.stringify(parsed); + } catch (error) { + const unescaped = input.replace(/\\(.)/g, '$1'); + if (input === unescaped) { + return input; + } + return normalizeAndStringify(unescaped); + } +} + +// packages/misc/src/lib/params-validators.ts +init_shim(); +var import_utils5 = __toESM(require_utils2()); + +// packages/misc/src/lib/utils.ts +init_shim(); +function isTokenOperator(token) { + const OPERATORS = ['and', 'or']; + return token.hasOwnProperty('operator') && OPERATORS.includes(token.operator); +} +function isValidBooleanExpression(expression) { + const STATES = { + START: 'start', + CONDITION: 'condition', + OPERATOR: 'operator', + }; + let currentState = STATES.START; + for (const token of expression) { + switch (currentState) { + case STATES.START: + case STATES.OPERATOR: + if (isTokenOperator(token)) { + return false; + } + if (Array.isArray(token) && !isValidBooleanExpression(token)) { + return false; + } + currentState = STATES.CONDITION; + break; + default: + if (!isTokenOperator(token)) { + return false; + } + currentState = STATES.OPERATOR; + } + } + return currentState === STATES.CONDITION; +} + +// packages/misc/src/lib/params-validators.ts +var safeParams = ({ functionName, params }) => { + if (!paramsValidators[functionName]) { + log(`This function ${functionName} is skipping params safe guarding.`); + return ERight(void 0); + } + const paramValidators = paramsValidators[functionName](params); + for (const validator of paramValidators) { + const validationResponse = validator.validate(); + if (validationResponse.type === EITHER_TYPE.ERROR) { + return validationResponse; + } + } + return ERight(void 0); +}; +var paramsValidators = { + // ========== NO AUTH MATERIAL NEEDED FOR CLIENT SIDE ENCRYPTION ========== + encrypt: (params) => [ + new AccessControlConditionsValidator('encrypt', params), + ], + encryptUint8Array: (params) => [ + new AccessControlConditionsValidator('encryptUint8Array', params), + new Uint8ArrayValidator('encryptUint8Array', params.dataToEncrypt), + ], + encryptFile: (params) => [ + new AccessControlConditionsValidator('encryptFile', params), + new FileValidator('encryptFile', params.file), + ], + encryptString: (params) => [ + new AccessControlConditionsValidator('encryptString', params), + new StringValidator('encryptString', params.dataToEncrypt, 'dataToEncrypt'), + ], + encryptToJson: (params) => [ + new AccessControlConditionsValidator('encryptToJson', params), + new EncryptToJsonValidator('encryptToJson', params), + ], + // ========== REQUIRED AUTH MATERIAL VALIDATORS ========== + executeJs: (params) => [ + new AuthMaterialValidator('executeJs', params), + new ExecuteJsValidator('executeJs', params), + ], + decrypt: (params) => [ + new AccessControlConditionsValidator('decrypt', params), + new AuthMaterialValidator('decrypt', params, true), + new StringValidator('decrypt', params.ciphertext, 'ciphertext'), + ], + decryptFromJson: (params) => [ + new AuthMaterialValidator('decryptFromJson', params), + new DecryptFromJsonValidator('decryptFromJson', params.parsedJsonData), + ], +}; +var EncryptToJsonValidator = class { + fnName; + params; + constructor(fnName, params) { + this.fnName = fnName; + this.params = params; + } + validate() { + const { file, string } = this.params; + if (string === void 0 && file === void 0) + return ELeft( + new InvalidParamType( + { + info: { + param: 'string', + value: string, + functionName: this.fnName, + }, + }, + 'Either string or file must be provided' + ) + ); + if (string !== void 0 && file !== void 0) + return ELeft( + new InvalidParamType( + { + info: { + param: 'string', + value: string, + functionName: this.fnName, + }, + }, + 'Provide only a "string" or "file" to encrypt; you cannot provide both' + ) + ); + return ERight(void 0); + } +}; +var DecryptFromJsonValidator = class { + fnName; + params; + constructor(fnName, params) { + this.fnName = fnName; + this.params = params; + } + validate() { + const validators = [new StringValidator(this.fnName, this.params.dataType)]; + for (const validator of validators) { + const validationResponse = validator.validate(); + if (validationResponse.type === EITHER_TYPE.ERROR) { + return validationResponse; + } + } + const { dataType } = this.params; + if (dataType !== 'string' && dataType !== 'file') + return ELeft( + new InvalidArgumentException( + { + info: { + functionName: this.fnName, + dataType, + }, + }, + `dataType of %s is not valid. Must be 'string' or 'file'.`, + dataType + ) + ); + return ERight(void 0); + } +}; +var Uint8ArrayValidator = class { + fnName; + paramName; + uint8array; + constructor(fnName, uint8array, paramName = 'uint8array') { + this.fnName = fnName; + this.paramName = paramName; + this.uint8array = uint8array; + } + validate() { + if (!this.uint8array) { + return ELeft(new InvalidParamType({}, 'uint8array is undefined')); + } + if ( + !checkType({ + value: this.uint8array, + allowedTypes: ['Uint8Array'], + paramName: this.paramName, + functionName: this.fnName, + }) + ) + return ELeft( + new InvalidParamType( + { + info: { + param: this.paramName, + value: this.uint8array, + functionName: this.fnName, + }, + }, + '%s is not a Uint8Array', + this.paramName + ) + ); + return ERight(void 0); + } +}; +var StringValidator = class { + fnName; + paramName; + checkIsHex; + str; + constructor(fnName, str, paramName = 'string', checkIsHex = false) { + this.fnName = fnName; + this.paramName = paramName; + this.checkIsHex = checkIsHex; + this.str = str; + } + validate() { + if (!this.str) { + return ELeft(new InvalidParamType({}, 'str is undefined')); + } + if ( + !checkType({ + value: this.str, + allowedTypes: ['String'], + paramName: this.paramName, + functionName: this.fnName, + }) + ) + return ELeft( + new InvalidParamType( + { + info: { + param: this.paramName, + value: this.str, + functionName: this.fnName, + }, + }, + '%s is not a string', + this.paramName + ) + ); + if (this.checkIsHex && !(0, import_utils5.isHexString)(this.str)) { + return ELeft( + new InvalidParamType( + { + info: { + param: this.paramName, + value: this.str, + functionName: this.fnName, + }, + }, + '%s is not a valid hex string', + this.paramName + ) + ); + } + return ERight(void 0); + } +}; +var ExecuteJsValidator = class { + fnName; + params; + constructor(fnName, params) { + this.fnName = fnName; + this.params = params; + } + validate() { + const { code: code9, ipfsId } = this.params; + if (!code9 && !ipfsId) { + return ELeft( + new ParamsMissingError( + { + info: { + functionName: this.fnName, + params: this.params, + }, + }, + 'You must pass either code or ipfsId' + ) + ); + } + if (code9 && ipfsId) { + return ELeft( + new ParamsMissingError( + { + info: { + functionName: this.fnName, + params: this.params, + }, + }, + "You cannot have both 'code' and 'ipfs' at the same time" + ) + ); + } + return ERight(void 0); + } +}; +var FileValidator = class { + fnName; + file; + constructor(fnName, file) { + this.fnName = fnName; + this.file = file; + } + validate() { + if (!this.file) { + return ELeft( + new InvalidArgumentException( + { + info: { + functionName: this.fnName, + file: this.file, + }, + }, + 'You must pass file param' + ) + ); + } + const allowedTypes = ['Blob', 'File', 'Uint8Array']; + if ( + !checkType({ + value: this.file, + allowedTypes, + paramName: 'file', + functionName: this.fnName, + }) + ) + return ELeft( + new InvalidArgumentException( + { + info: { + functionName: this.fnName, + file: this.file, + allowedTypes, + }, + }, + 'File param is not a valid Blob or File object' + ) + ); + return ERight(void 0); + } +}; +var AuthMaterialValidator = class { + fnName; + authMaterial; + checkIfAuthSigRequiresChainParam; + constructor(fnName, params, checkIfAuthSigRequiresChainParam2 = false) { + this.fnName = fnName; + this.authMaterial = params; + this.checkIfAuthSigRequiresChainParam = checkIfAuthSigRequiresChainParam2; + } + validate() { + const { authSig, sessionSigs } = this.authMaterial; + if (authSig && !is(authSig, 'Object', 'authSig', this.fnName)) + return ELeft( + new InvalidParamType( + { + info: { + param: 'authSig', + value: authSig, + functionName: this.fnName, + }, + }, + 'authSig is not an object' + ) + ); + if (this.checkIfAuthSigRequiresChainParam) { + if (!this.authMaterial.chain) + return ELeft( + new InvalidArgumentException( + { + info: { + functionName: this.fnName, + chain: this.authMaterial.chain, + }, + }, + 'You must pass chain param' + ) + ); + if ( + authSig && + !checkIfAuthSigRequiresChainParam( + authSig, + this.authMaterial.chain, + this.fnName + ) + ) + return ELeft( + new InvalidParamType( + { + info: { + param: 'authSig', + value: authSig, + functionName: this.fnName, + }, + }, + 'authSig is not valid' + ) + ); + } + if (sessionSigs && !is(sessionSigs, 'Object', 'sessionSigs', this.fnName)) + return ELeft( + new InvalidParamType( + { + info: { + param: 'sessionSigs', + value: sessionSigs, + functionName: this.fnName, + }, + }, + 'sessionSigs is not an object' + ) + ); + if (!sessionSigs && !authSig) + return ELeft( + new InvalidArgumentException( + { + info: { + functionName: this.fnName, + sessionSigs, + authSig, + }, + }, + 'You must pass either authSig or sessionSigs' + ) + ); + if (sessionSigs && authSig) + return ELeft( + new InvalidArgumentException( + { + info: { + functionName: this.fnName, + sessionSigs, + authSig, + }, + }, + 'You cannot have both authSig and sessionSigs' + ) + ); + return ERight(void 0); + } +}; +var AccessControlConditionsValidator = class { + fnName; + conditions; + constructor(fnName, params) { + this.fnName = fnName; + this.conditions = params; + } + validate() { + const { + accessControlConditions, + evmContractConditions, + solRpcConditions, + unifiedAccessControlConditions, + } = this.conditions; + if ( + accessControlConditions && + !is( + accessControlConditions, + 'Array', + 'accessControlConditions', + this.fnName + ) + ) + return ELeft( + new InvalidParamType( + { + info: { + param: 'accessControlConditions', + value: accessControlConditions, + functionName: this.fnName, + }, + }, + '%s is not an array', + 'accessControlConditions' + ) + ); + if ( + evmContractConditions && + !is(evmContractConditions, 'Array', 'evmContractConditions', this.fnName) + ) + return ELeft( + new InvalidParamType( + { + info: { + param: 'evmContractConditions', + value: evmContractConditions, + functionName: this.fnName, + }, + }, + '%s is not an array', + 'evmContractConditions' + ) + ); + if ( + solRpcConditions && + !is(solRpcConditions, 'Array', 'solRpcConditions', this.fnName) + ) + return ELeft( + new InvalidParamType( + { + info: { + param: 'solRpcConditions', + value: solRpcConditions, + functionName: this.fnName, + }, + }, + '%s is not an array', + 'solRpcConditions' + ) + ); + if ( + unifiedAccessControlConditions && + !is( + unifiedAccessControlConditions, + 'Array', + 'unifiedAccessControlConditions', + this.fnName + ) + ) + return ELeft( + new InvalidParamType( + { + info: { + param: 'unifiedAccessControlConditions', + value: unifiedAccessControlConditions, + functionName: this.fnName, + }, + }, + '%s is not an array', + 'unifiedAccessControlConditions' + ) + ); + if ( + !accessControlConditions && + !evmContractConditions && + !solRpcConditions && + !unifiedAccessControlConditions + ) + return ELeft( + new InvalidArgumentException( + { + info: { + functionName: this.fnName, + conditions: this.conditions, + }, + }, + 'You must pass either accessControlConditions, evmContractConditions, solRpcConditions or unifiedAccessControlConditions' + ) + ); + if ( + accessControlConditions && + !isValidBooleanExpression(accessControlConditions) + ) + return ELeft( + new InvalidBooleanException( + { + info: { + functionName: this.fnName, + accessControlConditions, + }, + }, + 'Invalid boolean Access Control Conditions' + ) + ); + if ( + evmContractConditions && + !isValidBooleanExpression(evmContractConditions) + ) + return ELeft( + new InvalidBooleanException( + { + info: { + functionName: this.fnName, + evmContractConditions, + }, + }, + 'Invalid boolean EVM Access Control Conditions' + ) + ); + if (solRpcConditions && !isValidBooleanExpression(solRpcConditions)) + return ELeft( + new InvalidBooleanException( + { + info: { + functionName: this.fnName, + solRpcConditions, + }, + }, + 'Invalid boolean Solana Access Control Conditions' + ) + ); + if ( + unifiedAccessControlConditions && + !isValidBooleanExpression(unifiedAccessControlConditions) + ) + return ELeft( + new InvalidBooleanException( + { + info: { + functionName: this.fnName, + unifiedAccessControlConditions, + }, + }, + 'Invalid boolean Unified Access Control Conditions' + ) + ); + return ERight(void 0); + } +}; + +// packages/misc/src/lib/helper/session-sigs-validator.ts +init_shim(); +function parseSignedMessage(signedMessage) { + const lines = signedMessage.split('\n'); + const parsedData = {}; + let currentKey = null; + let currentValue = ''; + lines.forEach((line) => { + const keyValueMatch = line.match(/^([^:]+):\s*(.*)$/); + if (keyValueMatch) { + if (currentKey !== null) { + parsedData[currentKey.trim()] = currentValue.trim(); + } + currentKey = keyValueMatch[1]; + currentValue = keyValueMatch[2]; + } else if (line.startsWith('- ')) { + const item = line.substring(2).trim(); + if (!parsedData[currentKey]) { + parsedData[currentKey] = []; + } + parsedData[currentKey].push(item); + } else if (line.trim() === '') { + } else { + currentValue += '\n' + line; + } + }); + if (currentKey !== null) { + parsedData[currentKey.trim()] = currentValue.trim(); + } + return parsedData; +} +function validateExpiration(expirationTimeStr, context) { + const errors = []; + const expirationTime = new Date(expirationTimeStr); + const currentTime = /* @__PURE__ */ new Date(); + if (isNaN(expirationTime.getTime())) { + errors.push( + `Invalid Expiration Time format in ${context}: ${expirationTimeStr}` + ); + } else if (expirationTime < currentTime) { + errors.push( + `Expired ${context}. Expiration Time: ${expirationTime.toISOString()}` + ); + } + return { + isValid: errors.length === 0, + errors, + }; +} +function parseCapabilities(capabilities) { + const errors = []; + capabilities.forEach((capability, index) => { + const { signedMessage } = capability; + const parsedCapabilityMessage = parseSignedMessage(signedMessage); + capability.parsedSignedMessage = parsedCapabilityMessage; + const expirationTimeStr = parsedCapabilityMessage['Expiration Time']; + if (expirationTimeStr) { + const validationResult = validateExpiration( + expirationTimeStr, + `capability ${index}` + ); + if (!validationResult.isValid) { + errors.push(...validationResult.errors); + } + } else { + errors.push( + `Expiration Time not found in capability ${index}'s signedMessage.` + ); + } + }); + return { + isValid: errors.length === 0, + errors, + }; +} +function validateSessionSig(sessionSig) { + const errors = []; + let parsedSignedMessage; + try { + parsedSignedMessage = JSON.parse(sessionSig.signedMessage); + } catch (error) { + errors.push('Main signedMessage is not valid JSON.'); + return { isValid: false, errors }; + } + const capabilities = parsedSignedMessage.capabilities; + if (!capabilities) { + errors.push('Capabilities not found in main signedMessage.'); + } else if (capabilities.length === 0) { + errors.push('No capabilities found in main signedMessage.'); + } else { + const capabilitiesValidationResult = parseCapabilities(capabilities); + if (!capabilitiesValidationResult.isValid) { + errors.push(...capabilitiesValidationResult.errors); + } + } + const outerExpirationTimeStr = parsedSignedMessage['expiration']; + if (outerExpirationTimeStr) { + const validationResult = validateExpiration( + outerExpirationTimeStr, + 'main signedMessage' + ); + if (!validationResult.isValid) { + errors.push(...validationResult.errors); + } + } else { + errors.push('Expiration Time not found in outer signedMessage.'); + } + return { + isValid: errors.length === 0, + errors, + }; +} +function validateSessionSigs(sessionSigs) { + const errors = []; + Object.entries(sessionSigs).forEach(([key2, sessionSig]) => { + const validationResult = validateSessionSig(sessionSig); + if (!validationResult.isValid) { + errors.push( + `Session Sig '${key2}': ${validationResult.errors.join(', ')}` + ); + } + }); + return { + isValid: errors.length === 0, + errors, + }; +} + +// packages/misc/src/lib/helper/session-sigs-reader.ts +init_shim(); +function formatDuration(start, end) { + const diff = end.getTime() - start.getTime(); + const days = Math.floor(diff / (1e3 * 60 * 60 * 24)); + const hours = Math.floor((diff % (1e3 * 60 * 60 * 24)) / (1e3 * 60 * 60)); + const minutes = Math.floor((diff % (1e3 * 60 * 60)) / (1e3 * 60)); + const seconds = ((diff % (1e3 * 60)) / 1e3).toFixed(3); + let elapsedTime; + if (days > 0) { + elapsedTime = `${days} days`; + } else if (hours > 0) { + elapsedTime = `${hours} hours, ${minutes} minutes, ${seconds} seconds`; + } else { + elapsedTime = `${minutes} minutes, ${seconds} seconds`; + } + return elapsedTime; +} +function formatStatus(expirationDate, currentDate) { + if (expirationDate > currentDate) { + const timeLeft = formatDuration(currentDate, expirationDate); + return `\u2705 Not expired (valid for ${timeLeft})`; + } else { + const timeAgo = formatDuration(expirationDate, currentDate); + return `\u274C Expired (expired ${timeAgo} ago)`; + } +} +function humanReadableAtt(obj, indentLevel = 0) { + const indent = ' '.repeat(indentLevel * 2); + let result = ''; + for (const key2 in obj) { + result += `${indent}* ${key2} +`; + if (typeof obj[key2] === 'object' && !Array.isArray(obj[key2])) { + result += humanReadableAtt(obj[key2], indentLevel + 1); + } else if (Array.isArray(obj[key2])) { + obj[key2].forEach((item) => { + if (typeof item === 'object') { + result += humanReadableAtt(item, indentLevel + 1); + } else { + result += `${indent} * ${item} +`; + } + }); + } else { + result += `${indent} * ${obj[key2]} +`; + } + } + return result; +} +function formatSessionSigs( + sessionSigs, + currentTime = /* @__PURE__ */ new Date() +) { + const parsedSigs = JSON.parse(sessionSigs); + const firstNodeKey = Object.keys(parsedSigs)[0]; + const firstNode = parsedSigs[firstNodeKey]; + let signedMessage; + try { + signedMessage = JSON.parse(firstNode.signedMessage); + } catch (error) { + const errorMessage = + error instanceof Error ? error.message : 'Unknown error'; + throw new Error(`Invalid JSON format for signedMessage: ${errorMessage}`); + } + const currentDate = new Date(currentTime); + let result = `The request time is at: ${currentDate.toISOString()} +`; + let issuedAt, expiration; + try { + issuedAt = new Date(signedMessage.issuedAt); + expiration = new Date(signedMessage.expiration); + } catch (error) { + const errorMessage = + error instanceof Error ? error.message : 'Unknown error'; + throw new Error(`Error parsing issuedAt or expiration: ${errorMessage}`); + } + result += '* Outer expiration:\n'; + result += ` * Issued at: ${issuedAt.toISOString()} +`; + result += ` * Expiration: ${expiration.toISOString()} +`; + result += ` * Duration: ${formatDuration(issuedAt, expiration)} +`; + result += ` * Status: ${formatStatus(expiration, currentDate)} +`; + result += '* Capabilities:\n'; + signedMessage.capabilities.forEach((cap, index) => { + const capType = cap.derivedVia; + const parsedCapMessage = parseSignedMessage(cap.signedMessage); + let attenuation = ''; + try { + const encodedRecap = parsedCapMessage['- urn']?.split(':')[1]; + const decodedRecap = atob(encodedRecap); + const jsonRecap = JSON.parse(decodedRecap); + attenuation = humanReadableAtt(jsonRecap.att, 6); + } catch (e2) { + console.log('Error parsing attenuation::', e2); + } + const capIssuedAt = new Date(parsedCapMessage['Issued At'] || ''); + const capExpiration = new Date(parsedCapMessage['Expiration Time'] || ''); + result += ` * Capability ${index + 1} (${capType}): +`; + result += ` * Issued at: ${capIssuedAt.toISOString()} +`; + result += ` * Expiration: ${capExpiration.toISOString()} +`; + result += ` * Duration: ${formatDuration(capIssuedAt, capExpiration)} +`; + result += ` * Status: ${formatStatus(capExpiration, currentDate)} +`; + result += ` * Attenuation: +`; + result += attenuation; + }); + return result; +} + +// packages/uint8arrays/src/index.ts +init_shim(); + +// packages/uint8arrays/src/lib/uint8arrays.ts +init_shim(); +function utf8Encode(str) { + let utf8Array = []; + for (let i2 = 0; i2 < str.length; i2++) { + let charCode = str.charCodeAt(i2); + if (charCode < 128) { + utf8Array.push(charCode); + } else if (charCode < 2048) { + utf8Array.push(192 | (charCode >> 6), 128 | (charCode & 63)); + } else if ( + // Check if the character is a high surrogate (UTF-16) + (charCode & 64512) === 55296 && + i2 + 1 < str.length && + (str.charCodeAt(i2 + 1) & 64512) === 56320 + ) { + charCode = + 65536 + ((charCode & 1023) << 10) + (str.charCodeAt(++i2) & 1023); + utf8Array.push( + 240 | (charCode >> 18), + 128 | ((charCode >> 12) & 63), + 128 | ((charCode >> 6) & 63), + 128 | (charCode & 63) + ); + } else { + utf8Array.push( + 224 | (charCode >> 12), + 128 | ((charCode >> 6) & 63), + 128 | (charCode & 63) + ); + } + } + return new Uint8Array(utf8Array); +} +function utf8Decode(utf8Array) { + let str = ''; + let i2 = 0; + while (i2 < utf8Array.length) { + let charCode = utf8Array[i2++]; + if (charCode < 128) { + str += String.fromCharCode(charCode); + } else if (charCode > 191 && charCode < 224) { + str += String.fromCharCode( + ((charCode & 31) << 6) | (utf8Array[i2++] & 63) + ); + } else if (charCode > 239 && charCode < 365) { + charCode = + ((charCode & 7) << 18) | + ((utf8Array[i2++] & 63) << 12) | + ((utf8Array[i2++] & 63) << 6) | + (utf8Array[i2++] & 63); + charCode -= 65536; + str += String.fromCharCode( + 55296 + (charCode >> 10), + 56320 + (charCode & 1023) + ); + } else { + str += String.fromCharCode( + ((charCode & 15) << 12) | + ((utf8Array[i2++] & 63) << 6) | + (utf8Array[i2++] & 63) + ); + } + } + return str; +} +function base64ToUint8Array(base64Str) { + const binaryStr = atob(base64Str); + const len = binaryStr.length; + const bytes = new Uint8Array(len); + for (let i2 = 0; i2 < len; i2++) { + bytes[i2] = binaryStr.charCodeAt(i2); + } + return bytes; +} +function uint8ArrayToBase64(uint8Array) { + let binaryStr = ''; + for (let i2 = 0; i2 < uint8Array.length; i2++) { + binaryStr += String.fromCharCode(uint8Array[i2]); + } + return btoa(binaryStr); +} +function base64UrlPadToBase64(base64UrlPadStr) { + return ( + base64UrlPadStr.replace('-', '+').replace('_', '/') + + '='.repeat((4 - (base64UrlPadStr.length % 4)) % 4) + ); +} +function base64ToBase64UrlPad(base64Str) { + return base64Str.replace('+', '-').replace('/', '_').replace(/=+$/, ''); +} +function uint8arrayFromString(str, encoding = 'utf8') { + switch (encoding) { + case 'utf8': + return utf8Encode(str); + case 'base16': + const arr = []; + for (let i2 = 0; i2 < str.length; i2 += 2) { + arr.push(parseInt(str.slice(i2, i2 + 2), 16)); + } + return new Uint8Array(arr); + case 'base64': + return base64ToUint8Array(str); + case 'base64url': + case 'base64urlpad': + return base64ToUint8Array(base64UrlPadToBase64(str)); + default: + throw new InvalidParamType( + { + info: { + encoding, + str, + }, + }, + `Unsupported encoding "${encoding}"` + ); + } +} +function uint8arrayToString(uint8array, encoding = 'utf8') { + let _uint8array = new Uint8Array(uint8array); + switch (encoding) { + case 'utf8': + return utf8Decode(_uint8array); + case 'base16': + return Array.from(_uint8array) + .map((byte) => byte.toString(16).padStart(2, '0')) + .join(''); + case 'base64': + return uint8ArrayToBase64(_uint8array); + case 'base64url': + case 'base64urlpad': + return base64ToBase64UrlPad(uint8ArrayToBase64(_uint8array)); + default: + throw new InvalidParamType( + { + info: { + encoding, + _uint8array, + }, + }, + `Unsupported encoding "${encoding}"` + ); + } +} + +// packages/auth-browser/src/lib/chains/cosmos.ts +var getProvider = (walletType) => { + switch (walletType) { + case 'keplr': + if ('keplr' in window) { + return window?.keplr; + } + break; + case 'leap': + if ('leap' in window) { + return window?.leap; + } + } + throw new NoWalletException( + { + info: { + walletType, + }, + }, + 'No web3 wallet was found that works with Cosmos. Install a Cosmos wallet or choose another chain' + ); +}; +var connectCosmosProvider = async ({ chain, walletType }) => { + const chainId = LIT_COSMOS_CHAINS[chain].chainId; + const wallet = getProvider(walletType); + await wallet.enable(chainId); + const offlineSigner = wallet.getOfflineSigner(chainId); + const accounts = await offlineSigner.getAccounts(); + return { provider: wallet, account: accounts[0].address, chainId }; +}; +var checkAndSignCosmosAuthMessage = async ({ chain, walletType }) => { + const connectedCosmosProvider = await connectCosmosProvider({ + chain, + walletType, + }); + const storageKey = LOCAL_STORAGE_KEYS.AUTH_COSMOS_SIGNATURE; + let authSigString = localStorage.getItem(storageKey); + if (!authSigString) { + log('signing auth message because sig is not in local storage'); + await signAndSaveAuthMessage(connectedCosmosProvider); + authSigString = localStorage.getItem(storageKey); + } + let authSig = JSON.parse(authSigString); + if (connectedCosmosProvider.account != authSig.address) { + log( + 'signing auth message because account is not the same as the address in the auth sig' + ); + await signAndSaveAuthMessage(connectedCosmosProvider); + authSigString = localStorage.getItem(storageKey); + authSig = JSON.parse(authSigString); + } + log('authSig', authSig); + return authSig; +}; +var signAndSaveAuthMessage = async (connectedCosmosProvider) => { + const { provider, account, chainId } = connectedCosmosProvider; + const now2 = /* @__PURE__ */ new Date().toISOString(); + const body = AUTH_SIGNATURE_BODY.replace('{{timestamp}}', now2); + const signed2 = await provider.signArbitrary(chainId, account, body); + const data = uint8arrayToString(uint8arrayFromString(body, 'utf8'), 'base64'); + const signDoc = { + chain_id: '', + account_number: '0', + sequence: '0', + fee: { + gas: '0', + amount: [], + }, + msgs: [ + { + type: 'sign/MsgSignData', + value: { + signer: account, + data, + }, + }, + ], + memo: '', + }; + const encodedSignedMsg = serializeSignDoc(signDoc); + const digest = await crypto.subtle.digest('SHA-256', encodedSignedMsg); + const digest_hex = uint8arrayToString(new Uint8Array(digest), 'base16'); + const authSig = { + sig: signed2.signature, + derivedVia: 'cosmos.signArbitrary', + signedMessage: digest_hex, + address: account, + }; + localStorage.setItem( + LOCAL_STORAGE_KEYS.AUTH_COSMOS_SIGNATURE, + JSON.stringify(authSig) + ); +}; +var serializeSignDoc = (signDoc) => { + const sorted = JSON.stringify(sortedObject(signDoc)); + return uint8arrayFromString(sorted, 'utf8'); +}; + +// packages/auth-browser/src/lib/chains/eth.ts +init_shim(); +init_lib2(); +import { Buffer as BufferPolyfill } from 'buffer'; +import depd3 from 'depd'; +init_lib9(); +init_lib25(); +import { EthereumProvider } from '@walletconnect/ethereum-provider'; +var import_utils7 = __toESM(require_utils2()); +import { SiweMessage } from 'siwe'; +import * as nacl from 'tweetnacl'; +import * as naclUtil from 'tweetnacl-util'; + +// packages/misc-browser/src/index.ts +init_shim(); + +// packages/misc-browser/src/lib/misc-browser.ts +init_shim(); +var getStorageItem = (key2) => { + let item; + try { + item = localStorage.getItem(key2); + } catch (e2) {} + if (!item) { + return ELeft( + new LocalStorageItemNotFoundException( + { + info: { + storageKey: key2, + }, + }, + `Failed to get %s from local storage`, + key2 + ) + ); + } + return ERight(item); +}; +var setStorageItem = (key2, value) => { + try { + localStorage.setItem(key2, value); + return ERight(value); + } catch (e2) { + return ELeft( + new LocalStorageItemNotSetException( + { + info: { + storageKey: key2, + }, + }, + `Failed to set %s in local storage`, + key2 + ) + ); + } +}; +var removeStorageItem = (key2) => { + try { + localStorage.removeItem(key2); + return ERight(key2); + } catch (e2) { + return ELeft( + new LocalStorageItemNotRemovedException( + { + info: { + storageKey: key2, + }, + }, + `Failed to remove %s from local storage`, + key2 + ) + ); + } +}; + +// packages/auth-browser/src/lib/connect-modal/modal.ts +init_shim(); +function e(e2, t2) { + for (var o2 = 0; o2 < t2.length; o2++) { + var n2 = t2[o2]; + (n2.enumerable = n2.enumerable || false), + (n2.configurable = true), + 'value' in n2 && (n2.writable = true), + Object.defineProperty(e2, n2.key, n2); + } +} +function t(e2) { + return ( + (function (e3) { + if (Array.isArray(e3)) return o(e3); + })(e2) || + (function (e3) { + if ('undefined' != typeof Symbol && Symbol.iterator in Object(e3)) + return Array.from(e3); + })(e2) || + (function (e3, t2) { + if (!e3) return; + if ('string' == typeof e3) return o(e3, t2); + var n2 = Object.prototype.toString.call(e3).slice(8, -1); + 'Object' === n2 && e3.constructor && (n2 = e3.constructor.name); + if ('Map' === n2 || 'Set' === n2) return Array.from(e3); + if ( + 'Arguments' === n2 || + /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2) + ) + return o(e3, t2); + })(e2) || + (function () { + throw new TypeError( + 'Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.' + ); + })() + ); +} +function o(e2, t2) { + (null == t2 || t2 > e2.length) && (t2 = e2.length); + for (var o2 = 0, n2 = new Array(t2); o2 < t2; o2++) n2[o2] = e2[o2]; + return n2; +} +var n; +var i; +var a; +var r2; +var s; +var l = + ((n = [ + 'a[href]', + 'area[href]', + 'input:not([disabled]):not([type="hidden"]):not([aria-hidden])', + 'select:not([disabled]):not([aria-hidden])', + 'textarea:not([disabled]):not([aria-hidden])', + 'button:not([disabled]):not([aria-hidden])', + 'iframe', + 'object', + 'embed', + '[contenteditable]', + '[tabindex]:not([tabindex^="-"])', + ]), + (i = (function () { + function o2(e2) { + var n2 = e2.targetModal, + i3 = e2.triggers, + a3 = void 0 === i3 ? [] : i3, + r3 = e2.onShow, + s2 = void 0 === r3 ? function () {} : r3, + l2 = e2.onClose, + c = void 0 === l2 ? function () {} : l2, + d = e2.openTrigger, + u = void 0 === d ? 'data-micromodal-trigger' : d, + f = e2.closeTrigger, + h = void 0 === f ? 'data-micromodal-close' : f, + v = e2.openClass, + g = void 0 === v ? 'is-open' : v, + m = e2.disableScroll, + b = void 0 !== m && m, + y = e2.disableFocus, + p = void 0 !== y && y, + w = e2.awaitCloseAnimation, + E = void 0 !== w && w, + k = e2.awaitOpenAnimation, + M2 = void 0 !== k && k, + A2 = e2.debugMode, + C = void 0 !== A2 && A2; + !(function (e3, t2) { + if (!(e3 instanceof t2)) + throw new TypeError('Cannot call a class as a function'); + })(this, o2), + (this.modal = document.getElementById(n2)), + (this.config = { + debugMode: C, + disableScroll: b, + openTrigger: u, + closeTrigger: h, + openClass: g, + onShow: s2, + onClose: c, + awaitCloseAnimation: E, + awaitOpenAnimation: M2, + disableFocus: p, + }), + a3.length > 0 && this.registerTriggers.apply(this, t(a3)), + (this.onClick = this.onClick.bind(this)), + (this.onKeydown = this.onKeydown.bind(this)); + } + var i2, a2, r22; + return ( + (i2 = o2), + (a2 = [ + { + key: 'registerTriggers', + value: function () { + for ( + var e2 = this, t2 = arguments.length, o3 = new Array(t2), n2 = 0; + n2 < t2; + n2++ + ) + o3[n2] = arguments[n2]; + o3.filter(Boolean).forEach(function (t3) { + t3.addEventListener('click', function (t4) { + return e2.showModal(t4); + }); + }); + }, + }, + { + key: 'showModal', + value: function () { + var e2 = this, + t2 = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : null; + if ( + ((this.activeElement = document.activeElement), + this.modal.setAttribute('aria-hidden', 'false'), + this.modal.classList.add(this.config.openClass), + this.scrollBehaviour('disable'), + this.addEventListeners(), + this.config.awaitOpenAnimation) + ) { + var o3 = function t3() { + e2.modal.removeEventListener('animationend', t3, false), + e2.setFocusToFirstNode(); + }; + this.modal.addEventListener('animationend', o3, false); + } else this.setFocusToFirstNode(); + this.config.onShow(this.modal, this.activeElement, t2); + }, + }, + { + key: 'closeModal', + value: function () { + var e2 = + arguments.length > 0 && void 0 !== arguments[0] + ? arguments[0] + : null, + t2 = this.modal; + if ( + (this.modal.setAttribute('aria-hidden', 'true'), + this.removeEventListeners(), + this.scrollBehaviour('enable'), + this.activeElement && + this.activeElement.focus && + this.activeElement.focus(), + this.config.onClose(this.modal, this.activeElement, e2), + this.config.awaitCloseAnimation) + ) { + var o3 = this.config.openClass; + this.modal.addEventListener( + 'animationend', + function e3() { + t2.classList.remove(o3), + t2.removeEventListener('animationend', e3, false); + }, + false + ); + } else t2.classList.remove(this.config.openClass); + }, + }, + { + key: 'closeModalById', + value: function (e2) { + (this.modal = document.getElementById(e2)), + this.modal && this.closeModal(); + }, + }, + { + key: 'scrollBehaviour', + value: function (e2) { + if (this.config.disableScroll) { + var t2 = document.querySelector('body'); + switch (e2) { + case 'enable': + Object.assign(t2.style, { overflow: '' }); + break; + case 'disable': + Object.assign(t2.style, { overflow: 'hidden' }); + } + } + }, + }, + { + key: 'addEventListeners', + value: function () { + this.modal.addEventListener('touchstart', this.onClick), + this.modal.addEventListener('click', this.onClick), + document.addEventListener('keydown', this.onKeydown); + }, + }, + { + key: 'removeEventListeners', + value: function () { + this.modal.removeEventListener('touchstart', this.onClick), + this.modal.removeEventListener('click', this.onClick), + document.removeEventListener('keydown', this.onKeydown); + }, + }, + { + key: 'onClick', + value: function (e2) { + (e2.target.hasAttribute(this.config.closeTrigger) || + e2.target.parentNode.hasAttribute(this.config.closeTrigger)) && + (e2.preventDefault(), e2.stopPropagation(), this.closeModal(e2)); + }, + }, + { + key: 'onKeydown', + value: function (e2) { + 27 === e2.keyCode && this.closeModal(e2), + 9 === e2.keyCode && this.retainFocus(e2); + }, + }, + { + key: 'getFocusableNodes', + value: function () { + var e2 = this.modal.querySelectorAll(n); + return Array.apply(void 0, t(e2)); + }, + }, + { + key: 'setFocusToFirstNode', + value: function () { + var e2 = this; + if (!this.config.disableFocus) { + var t2 = this.getFocusableNodes(); + if (0 !== t2.length) { + var o3 = t2.filter(function (t3) { + return !t3.hasAttribute(e2.config.closeTrigger); + }); + o3.length > 0 && o3[0].focus(), + 0 === o3.length && t2[0].focus(); + } + } + }, + }, + { + key: 'retainFocus', + value: function (e2) { + var t2 = this.getFocusableNodes(); + if (0 !== t2.length) + if ( + ((t2 = t2.filter(function (e3) { + return null !== e3.offsetParent; + })), + this.modal.contains(document.activeElement)) + ) { + var o3 = t2.indexOf(document.activeElement); + e2.shiftKey && + 0 === o3 && + (t2[t2.length - 1].focus(), e2.preventDefault()), + !e2.shiftKey && + t2.length > 0 && + o3 === t2.length - 1 && + (t2[0].focus(), e2.preventDefault()); + } else t2[0].focus(); + }, + }, + ]) && e(i2.prototype, a2), + r22 && e(i2, r22), + o2 + ); + })()), + (a = null), + (r2 = function (e2) { + if (!document.getElementById(e2)) + return ( + console.warn( + "MicroModal: \u2757Seems like you have missed %c'".concat(e2, "'"), + 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', + 'ID somewhere in your code. Refer example below to resolve it.' + ), + console.warn( + '%cExample:', + 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', + '') + ), + false + ); + }), + (s = function (e2, t2) { + if ( + ((function (e3) { + e3.length <= 0 && + (console.warn( + "MicroModal: \u2757Please specify at least one %c'micromodal-trigger'", + 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', + 'data attribute.' + ), + console.warn( + '%cExample:', + 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', + '' + )); + })(e2), + !t2) + ) + return true; + for (var o2 in t2) r2(o2); + return true; + }), + { + init: function (e2) { + var o2 = Object.assign( + {}, + { openTrigger: 'data-micromodal-trigger' }, + e2 + ), + n2 = t(document.querySelectorAll('['.concat(o2.openTrigger, ']'))), + r22 = (function (e3, t2) { + var o3 = []; + return ( + e3.forEach(function (e4) { + var n3 = e4.attributes[t2].value; + void 0 === o3[n3] && (o3[n3] = []), o3[n3].push(e4); + }), + o3 + ); + })(n2, o2.openTrigger); + if (true !== o2.debugMode || false !== s(n2, r22)) + for (var l2 in r22) { + var c = r22[l2]; + (o2.targetModal = l2), (o2.triggers = t(c)), (a = new i(o2)); + } + }, + show: function (e2, t2) { + var o2 = t2 || {}; + (o2.targetModal = e2), + (true === o2.debugMode && false === r2(e2)) || + (a && a.removeEventListeners(), (a = new i(o2)).showModal()); + }, + close: function (e2) { + e2 ? a.closeModalById(e2) : a.closeModal(); + }, + }); +'undefined' != typeof window && (window.MicroModal = l); +var micromodal_es_default = l; +var modal_default = + '.modal {\n font-family: -apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif;\n}\n\n.lcm-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0,0,0,0.6);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 12;\n}\n\n.lcm-modal-container {\n border: 1px solid rgba(129, 89, 217, 1);\n background-color: #fff;\n padding: 0 1.5rem;\n max-width: 500px;\n max-height: 100vh;\n border-radius: 0.25rem;\n overflow-y: auto;\n box-sizing: border-box;\n}\n\n.lcm-modal-content {\n margin-top: 2rem;\n margin-bottom: 2rem;\n line-height: 1.5;\n color: rgba(0,0,0,.8);\n}\n\n.lcm-wallet-container {\n display: flex;\n align-items: center;\n margin: 2rem 0.5rem;\n transition-duration: 0.2s;\n border-radius: 0.25rem;\n padding: 2rem;\n cursor: pointer;\n}\n\n.lcm-wallet-container:hover {\n background-color: #d4d4d4;\n}\n\n.lcm-wallet-logo {\n height: 2.5rem;\n width: 3.75rem;\n margin-right: 1.5rem;\n}\n\n.lcm-text-column {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n}\n\n.lcm-wallet-name {\n font-weight: bold;\n font-size: 1.2rem;\n margin: 0;\n}\n\n.lcm-wallet-synopsis {\n color: #777;\n font-size: 0.9rem;\n margin: 0;\n}\n\n\n@keyframes mmfadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n@keyframes mmfadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n\n@keyframes mmslideIn {\n from { transform: translateY(15%); }\n to { transform: translateY(0); }\n}\n\n@keyframes mmslideOut {\n from { transform: translateY(0); }\n to { transform: translateY(-10%); }\n}\n\n.micromodal-slide {\n display: none;\n}\n\n.micromodal-slide.is-open {\n display: block;\n}\n\n.micromodal-slide[aria-hidden="false"] .lcm-modal-overlay {\n animation: mmfadeIn .3s cubic-bezier(0.0, 0.0, 0.2, 1);\n}\n\n.micromodal-slide[aria-hidden="false"] .lcm-modal-container {\n animation: mmslideIn .3s cubic-bezier(0, 0, .2, 1);\n}\n\n.micromodal-slide[aria-hidden="true"] .lcm-modal-overlay {\n animation: mmfadeOut .3s cubic-bezier(0.0, 0.0, 0.2, 1);\n}\n\n.micromodal-slide[aria-hidden="true"] .lcm-modal-container {\n animation: mmslideOut .3s cubic-bezier(0, 0, .2, 1);\n}\n\n.micromodal-slide .lcm-modal-container,\n.micromodal-slide .lcm-modal-overlay {\n will-change: transform;\n}\n'; +var metamask_default = + 'data:image/svg+xml,'; +var coinbase_default = + 'data:image/svg+xml,%0A%0A%0A%0A%0A%0A'; +var walletconnect_default = + 'data:image/svg+xml,'; +var metaMaskSingle = { + htmlId: 'lcm-metaMask', + id: 'metamask', + logo: metamask_default, + name: 'MetaMask', + provider: globalThis.ethereum, + synopsis: 'Connect your MetaMask Wallet', + checkIfPresent: () => { + if ( + typeof globalThis.ethereum !== 'undefined' && + globalThis.ethereum.isMetaMask + ) { + return true; + } else { + return false; + } + }, +}; +var coinbaseSingle = { + htmlId: 'lcm-coinbase', + id: 'coinbase', + logo: coinbase_default, + name: 'Coinbase', + provider: globalThis.ethereum, + synopsis: 'Connect your Coinbase Wallet', + checkIfPresent: () => { + if ( + typeof globalThis.ethereum !== 'undefined' && + globalThis.ethereum.isCoinbaseWallet + ) { + return true; + } else { + return false; + } + }, +}; +var rawListOfWalletsArray = [ + { + htmlId: 'lcm-metaMask', + id: 'metamask', + logo: metamask_default, + name: 'MetaMask', + provider: globalThis.ethereum?.providers?.find((p) => p.isMetaMask), + synopsis: 'Connect your MetaMask Wallet', + checkIfPresent: () => { + return !!globalThis.ethereum?.providers?.find((p) => p.isMetaMask); + }, + }, + { + htmlId: 'lcm-coinbase', + id: 'coinbase', + logo: coinbase_default, + name: 'Coinbase', + provider: globalThis.ethereum?.providers?.find((p) => p.isCoinbaseWallet), + synopsis: 'Connect your Coinbase Wallet', + checkIfPresent: () => { + return !!globalThis.ethereum?.providers?.find((p) => p.isCoinbaseWallet); + }, + }, + { + htmlId: 'lcm-walletConnect', + id: 'walletconnect', + logo: walletconnect_default, + name: 'WalletConnect', + provider: null, + synopsis: 'Scan with WalletConnect to connect', + }, +]; +var providerMethods = { + walletconnect: (providerOptions, id2) => { + const walletConnectData = providerOptions.walletconnect; + const walletConnectProvider = walletConnectData.provider; + return walletConnectProvider; + }, +}; +var providerMethods_default = providerMethods; +var LitConnectModal = class { + constructor({ providerOptions }) { + this.dialog = micromodal_es_default; + this.closeAction = void 0; + this.parent = document.body; + this.filteredListOfWalletsArray = []; + this.providerOptions = providerOptions; + this._filterListOfWallets(); + this._instantiateLitConnectModal(); + var style = document.createElement('style'); + style.innerHTML = modal_default; + document.head.appendChild(style); + } + getWalletProvider() { + const currentProvider = localStorage.getItem('lit-web3-provider'); + this.dialog.show('lit-connect-modal'); + return new Promise((resolve, reject) => { + if (!!currentProvider) { + const foundProvider = this.filteredListOfWalletsArray.find( + (w) => w.id === currentProvider + ); + resolve(foundProvider.provider); + this._destroy(); + return; + } + this.filteredListOfWalletsArray.forEach((w) => { + let walletEntry = document.getElementById(w.id); + walletEntry.addEventListener('click', () => { + localStorage.setItem('lit-web3-provider', w.id); + resolve(w.provider); + this._destroy(); + return; + }); + }); + this.closeAction.addEventListener('click', () => { + resolve(false); + this._destroy(); + return; + }); + }); + } + _filterListOfWallets() { + const filteredListOfWalletsArray = []; + rawListOfWalletsArray.forEach((w) => { + if (!!w['checkIfPresent'] && w['checkIfPresent']() === true) { + filteredListOfWalletsArray.push(w); + } + }); + if (filteredListOfWalletsArray.length === 0) { + if (globalThis.ethereum) { + if (globalThis.ethereum.isMetaMask) { + filteredListOfWalletsArray.push(metaMaskSingle); + } + if (globalThis.ethereum.isCoinbaseWallet) { + filteredListOfWalletsArray.push(coinbaseSingle); + } + } + } + if (!!this.providerOptions['walletconnect']) { + const cloneWalletInfo = rawListOfWalletsArray.find( + (w) => w.id === 'walletconnect' + ); + cloneWalletInfo['provider'] = providerMethods_default['walletconnect']( + this.providerOptions, + 'walletconnect' + ); + filteredListOfWalletsArray.push(cloneWalletInfo); + } + if (filteredListOfWalletsArray.length === 0) { + const message = 'No wallets installed or provided.'; + alert(message); + throw new NoWalletException({}, message); + } + this.filteredListOfWalletsArray = filteredListOfWalletsArray; + } + _instantiateLitConnectModal() { + const connectModal = document.createElement('div'); + connectModal.setAttribute('id', 'lit-connect-modal-container'); + connectModal.innerHTML = ` + + `; + this.parent.appendChild(connectModal); + Object.assign(this, { + trueButton: document.getElementById('lcm-continue-button'), + closeAction: document.getElementById('lcm-modal-overlay'), + }); + this._buildListOfWallets(); + this.dialog.init({ + disableScroll: true, + disableFocus: false, + awaitOpenAnimation: false, + awaitCloseAnimation: false, + debugMode: false, + }); + } + _buildListOfWallets() { + const contentContainer = document.getElementById( + 'lit-connect-modal-content' + ); + let walletListHtml = ``; + this.filteredListOfWalletsArray.forEach((w) => { + walletListHtml += ` +
+ +
+

${w.name}

+

${w.synopsis}

+
+
+ `; + }); + contentContainer.innerHTML = walletListHtml; + } + _destroy() { + const dialog = document.getElementById('lit-connect-modal-container'); + if (!!dialog) { + dialog.remove(); + } + } +}; + +// packages/auth-browser/src/lib/chains/eth.ts +var deprecated3 = depd3('lit-js-sdk:auth-browser:index'); +if (globalThis && typeof globalThis.Buffer === 'undefined') { + globalThis.Buffer = BufferPolyfill; +} +var WALLET_ERROR = { + REQUESTED_CHAIN_HAS_NOT_BEEN_ADDED: 4902, + NO_SUCH_METHOD: -32601, +}; +var litWCProvider; +var getChainId = async (chain, web3) => { + let resultOrError; + try { + const resp = await web3.getNetwork(); + resultOrError = ERight(resp.chainId); + } catch (e2) { + log('getNetwork threw an exception', e2); + resultOrError = ELeft( + new WrongNetworkException( + { + info: { + chain, + }, + }, + `Incorrect network selected. Please switch to the %s network in your wallet and try again.`, + chain + ) + ); + } + return resultOrError; +}; +function isSignedMessageExpired(signedMessage) { + const dateStr = signedMessage + .split('\n')[9] + ?.replace('Expiration Time: ', ''); + const expirationTime = new Date(dateStr); + const currentTime = /* @__PURE__ */ new Date(); + return currentTime > expirationTime; +} +var getMustResign = (authSig, resources) => { + let mustResign; + if (!isSignedMessageExpired(authSig.signedMessage)) { + return false; + } + try { + const parsedSiwe = new SiweMessage(authSig.signedMessage); + log('parsedSiwe.resources', parsedSiwe.resources); + if (JSON.stringify(parsedSiwe.resources) !== JSON.stringify(resources)) { + log( + 'signing auth message because resources differ from the resources in the auth sig' + ); + mustResign = true; + } + if ( + parsedSiwe.address !== (0, import_utils7.getAddress)(parsedSiwe.address) + ) { + log( + 'signing auth message because parsedSig.address is not equal to the same address but checksummed. This usually means the user had a non-checksummed address saved and so they need to re-sign.' + ); + mustResign = true; + } + } catch (e2) { + log('error parsing siwe sig. making the user sign again: ', e2); + mustResign = true; + } + return mustResign; +}; +var getRPCUrls = () => { + const rpcUrls = {}; + const keys = Object.keys(LIT_CHAINS); + for (const chainName of keys) { + const chainId = LIT_CHAINS[chainName].chainId; + const rpcUrl = LIT_CHAINS[chainName].rpcUrls[0]; + rpcUrls[chainId.toString()] = rpcUrl; + } + return rpcUrls; +}; +var encodeCallData = deprecated3.function( + ({ abi, functionName, functionParams }) => { + throw new RemovedFunctionError({}, 'encodeCallData has been removed.'); + }, + 'encodeCallData has been removed.' +); +var decodeCallResult = deprecated3.function(({ abi, functionName, data }) => { + const _interface = new ethers_exports.utils.Interface(abi); + const decoded = _interface.decodeFunctionResult(functionName, data); + return decoded; +}, 'decodeCallResult will be removed.'); +var connectWeb3 = async ({ chainId = 1, walletConnectProjectId }) => { + if (isNode()) { + log('connectWeb3 is not supported in nodejs.'); + return { web3: null, account: null }; + } + const rpcUrls = getRPCUrls(); + let providerOptions = {}; + if (walletConnectProjectId) { + const wcProvider = await EthereumProvider.init({ + projectId: walletConnectProjectId, + chains: [chainId], + showQrModal: true, + optionalMethods: ['eth_sign'], + rpcMap: rpcUrls, + }); + providerOptions = { + walletconnect: { + provider: wcProvider, + }, + }; + if (isBrowser()) { + litWCProvider = wcProvider; + } + } + log('getting provider via lit connect modal'); + const dialog = new LitConnectModal({ providerOptions }); + const provider = await dialog.getWalletProvider(); + log('got provider'); + const web3 = new Web3Provider(provider); + try { + deprecated3( + '@deprecated soon to be removed. - trying to enable provider. this will trigger the metamask popup.' + ); + await provider.enable(); + } catch (e2) { + log( + "error enabling provider but swallowed it because it's not important. most wallets use a different function now to enable the wallet so you can ignore this error, because those other methods will be tried.", + e2 + ); + } + log('listing accounts'); + const accounts = await web3.listAccounts(); + log('accounts', accounts); + const account = ethers_exports.utils.getAddress(accounts[0]); + return { web3, account }; +}; +var checkAndSignEVMAuthMessage = async ({ + chain, + resources, + switchChain, + expiration, + uri, + walletConnectProjectId, + nonce, +}) => { + if (isNode()) { + log( + 'checkAndSignEVMAuthMessage is not supported in nodejs. You can create a SIWE on your own using the SIWE package.' + ); + return { + sig: '', + derivedVia: '', + signedMessage: '', + address: '', + }; + } + const _throwIncorrectNetworkError = (error) => { + if (error.code === WALLET_ERROR.NO_SUCH_METHOD) { + throw new WrongNetworkException( + { + info: { + chain, + }, + }, + `Incorrect network selected. Please switch to the ${chain} network in your wallet and try again.` + ); + } else { + throw error; + } + }; + const selectedChain = LIT_CHAINS[chain]; + const expirationString = expiration ?? getDefaultExpiration(); + const { web3, account } = await connectWeb3({ + chainId: selectedChain.chainId, + walletConnectProjectId, + }); + log(`got web3 and account: ${account}`); + const currentChainIdOrError = await getChainId(chain, web3); + const selectedChainId = selectedChain.chainId; + const selectedChainIdHex = numberToHex(selectedChainId); + let authSigOrError = getStorageItem(LOCAL_STORAGE_KEYS.AUTH_SIGNATURE); + log('currentChainIdOrError:', currentChainIdOrError); + log('selectedChainId:', selectedChainId); + log('selectedChainIdHex:', selectedChainIdHex); + log('authSigOrError:', authSigOrError); + if (currentChainIdOrError.type === EITHER_TYPE.ERROR) { + throw new UnknownError( + { + info: { + chainId: chain, + }, + cause: currentChainIdOrError.result, + }, + 'Unknown error when getting chain id' + ); + } + log('chainId from web3', currentChainIdOrError); + log( + `checkAndSignAuthMessage with chainId ${currentChainIdOrError} and chain set to ${chain} and selectedChain is `, + selectedChain + ); + if (currentChainIdOrError.result !== selectedChainId && switchChain) { + const provider = web3.provider; + try { + log('trying to switch to chainId', selectedChainIdHex); + await provider.request({ + method: 'wallet_switchEthereumChain', + params: [{ chainId: selectedChainIdHex }], + }); + } catch (switchError) { + log('error switching to chainId', switchError); + if ( + switchError.code === WALLET_ERROR.REQUESTED_CHAIN_HAS_NOT_BEEN_ADDED + ) { + try { + const data = [ + { + chainId: selectedChainIdHex, + chainName: selectedChain.name, + nativeCurrency: { + name: selectedChain.name, + symbol: selectedChain.symbol, + decimals: selectedChain.decimals, + }, + rpcUrls: selectedChain.rpcUrls, + blockExplorerUrls: selectedChain.blockExplorerUrls, + }, + ]; + await provider.request({ + method: 'wallet_addEthereumChain', + params: data, + }); + } catch (addError) { + _throwIncorrectNetworkError(addError); + } + } else { + _throwIncorrectNetworkError(switchError); + } + } + currentChainIdOrError.result = selectedChain.chainId; + } + log('checking if sig is in local storage'); + if (authSigOrError.type === EITHER_TYPE.ERROR) { + log('signing auth message because sig is not in local storage'); + try { + const authSig2 = await _signAndGetAuth({ + web3, + account, + chainId: selectedChain.chainId, + resources, + expiration: expirationString, + uri, + nonce, + }); + authSigOrError = { + type: EITHER_TYPE.SUCCESS, + result: JSON.stringify(authSig2), + }; + } catch (e2) { + throw new UnknownError( + { + info: { + account, + chainId: selectedChain.chainId, + resources, + expiration: expirationString, + uri, + nonce, + }, + cause: e2, + }, + 'Could not get authenticated message' + ); + } + log('5. authSigOrError:', authSigOrError); + } + const authSigString = authSigOrError.result; + let authSig = JSON.parse(authSigString); + log('6. authSig:', authSig); + if (account.toLowerCase() !== authSig.address.toLowerCase()) { + log( + 'signing auth message because account is not the same as the address in the auth sig' + ); + authSig = await _signAndGetAuth({ + web3, + account, + chainId: selectedChain.chainId, + resources, + expiration: expirationString, + uri, + nonce, + }); + log('7. authSig:', authSig); + } else { + const mustResign = getMustResign(authSig, resources); + if (mustResign) { + authSig = await _signAndGetAuth({ + web3, + account, + chainId: selectedChain.chainId, + resources, + expiration: expirationString, + uri, + nonce, + }); + } + log('8. mustResign:', mustResign); + } + const checkAuthSig = validateSessionSig(authSig); + if (isSignedMessageExpired(authSig.signedMessage) || !checkAuthSig.isValid) { + if (!checkAuthSig.isValid) { + log(`Invalid AuthSig: ${checkAuthSig.errors.join(', ')}`); + } + log('9. authSig expired!, resigning..'); + authSig = await _signAndGetAuth({ + web3, + account, + chainId: selectedChain.chainId, + resources, + expiration: expirationString, + uri, + nonce, + }); + } + return authSig; +}; +var getDefaultExpiration = () => { + return new Date(Date.now() + 1e3 * 60 * 60 * 24).toISOString(); +}; +var _signAndGetAuth = async ({ + web3, + account, + chainId, + resources, + expiration, + uri, + nonce, +}) => { + await signAndSaveAuthMessage2({ + web3, + account, + chainId, + resources, + expiration, + uri, + nonce, + }); + const authSigOrError = getStorageItem(LOCAL_STORAGE_KEYS.AUTH_SIGNATURE); + if (authSigOrError.type === 'ERROR') { + throw new LocalStorageItemNotFoundException( + { + info: { + storageKey: LOCAL_STORAGE_KEYS.AUTH_SIGNATURE, + }, + }, + 'Failed to get authSig from local storage' + ); + } + const authSig = + typeof authSigOrError.result === 'string' + ? JSON.parse(authSigOrError.result) + : authSigOrError.result; + return authSig; +}; +var signAndSaveAuthMessage2 = async ({ + web3, + account, + chainId, + resources, + expiration, + uri, + nonce, +}) => { + if (isNode()) { + log('checkAndSignEVMAuthMessage is not supported in nodejs.'); + return { + sig: '', + derivedVia: '', + signedMessage: '', + address: '', + }; + } + const preparedMessage = { + domain: globalThis.location.host, + address: (0, import_utils7.getAddress)(account), + // convert to EIP-55 format or else SIWE complains + version: '1', + chainId, + expirationTime: expiration, + nonce, + }; + if (resources && resources.length > 0) { + preparedMessage.resources = resources; + } + if (uri) { + preparedMessage.uri = uri; + } else { + preparedMessage.uri = globalThis.location.href; + } + const message = new SiweMessage(preparedMessage); + const body = message.prepareMessage(); + const formattedAccount = (0, import_utils7.getAddress)(account); + const signedResult = await signMessage({ + body, + web3, + account: formattedAccount, + }); + const authSig = { + sig: signedResult.signature, + derivedVia: 'web3.eth.personal.sign', + signedMessage: body, + address: signedResult.address, + }; + if (isBrowser()) { + localStorage.setItem( + LOCAL_STORAGE_KEYS.AUTH_SIGNATURE, + JSON.stringify(authSig) + ); + } + const commsKeyPair = nacl.box.keyPair(); + if (isBrowser()) { + localStorage.setItem( + LOCAL_STORAGE_KEYS.KEY_PAIR, + JSON.stringify({ + publicKey: naclUtil.encodeBase64(commsKeyPair.publicKey), + secretKey: naclUtil.encodeBase64(commsKeyPair.secretKey), + }) + ); + } + log(`generated and saved ${LOCAL_STORAGE_KEYS.KEY_PAIR}`); + return authSig; +}; +var signMessage = async ({ body, web3, account }) => { + if (isNode()) { + log('signMessage is not supported in nodejs.'); + return { + signature: '', + address: '', + }; + } + if (!web3 || !account) { + log(`web3: ${web3} OR ${account} not found. Connecting web3..`); + const res = await connectWeb3({ chainId: 1 }); + web3 = res.web3; + account = res.account; + } + log('pausing...'); + await new Promise((resolve) => setTimeout(resolve, 500)); + log('signing with ', account); + const signature2 = await signMessageAsync(web3.getSigner(), account, body); + const address = verifyMessage(body, signature2).toLowerCase(); + log('Signature: ', signature2); + log('recovered address: ', address); + if (address.toLowerCase() !== account.toLowerCase()) { + const msg = `ruh roh, the user signed with a different address (${address}) then they're using with web3 (${account}). This will lead to confusion.`; + alert( + 'Something seems to be wrong with your wallets message signing. maybe restart your browser or your wallet. Your recovered sig address does not match your web3 account address' + ); + throw new InvalidSignatureError( + { + info: { + address, + account, + }, + }, + msg + ); + } + return { signature: signature2, address }; +}; +var signMessageAsync = async (signer, address, message) => { + if (isNode()) { + log('signMessageAsync is not supported in nodejs.'); + return null; + } + const messageBytes = toUtf8Bytes(message); + if (signer instanceof JsonRpcSigner) { + try { + log('Signing with personal_sign'); + const signature2 = await signer.provider.send('personal_sign', [ + hexlify(messageBytes), + address.toLowerCase(), + ]); + return signature2; + } catch (e2) { + log( + 'Signing with personal_sign failed, trying signMessage as a fallback' + ); + if (e2.message.includes('personal_sign')) { + return await signer.signMessage(messageBytes); + } + throw e2; + } + } else { + log('signing with signMessage'); + return await signer.signMessage(messageBytes); + } +}; + +// packages/auth-browser/src/lib/chains/sol.ts +init_shim(); +var getProvider2 = () => { + let resultOrError; + if ('solana' in window || 'backpack' in window) { + resultOrError = ERight(window?.solana ?? window?.backpack); + } else { + resultOrError = ELeft( + new NoWalletException( + {}, + 'No web3 wallet was found that works with Solana. Install a Solana wallet or choose another chain' + ) + ); + } + return resultOrError; +}; +var connectSolProvider = async () => { + const providerOrError = getProvider2(); + if (providerOrError.type === 'ERROR') { + throw new UnknownError( + { + info: { + provider: providerOrError.result, + }, + }, + 'Failed to get provider' + ); + } + const provider = providerOrError.result; + if (!provider.isConnected) { + await provider.connect(); + } + const account = provider.publicKey.toBase58(); + return { provider, account }; +}; +var checkAndSignSolAuthMessage = async () => { + const res = await connectSolProvider(); + if (!res) { + log('Failed to connect sol provider'); + } + const provider = res?.provider; + const account = res?.account; + const key2 = LOCAL_STORAGE_KEYS.AUTH_SOL_SIGNATURE; + let authSigOrError = getStorageItem(key2); + if (authSigOrError.type === EITHER_TYPE.ERROR) { + log('signing auth message because sig is not in local storage'); + await signAndSaveAuthMessage3({ provider }); + authSigOrError = getStorageItem(key2); + } + window.test = authSigOrError; + let authSig = JSON.parse(authSigOrError.result); + if (account !== authSig.address) { + log( + 'signing auth message because account is not the same as the address in the auth sig' + ); + await signAndSaveAuthMessage3({ provider }); + authSigOrError = getStorageItem(key2); + authSig = JSON.parse(authSigOrError.result); + } + log('authSig', authSig); + return authSig; +}; +var signAndSaveAuthMessage3 = async ({ provider }) => { + const now2 = /* @__PURE__ */ new Date().toISOString(); + const body = AUTH_SIGNATURE_BODY.replace('{{timestamp}}', now2); + const data = uint8arrayFromString(body, 'utf8'); + let payload; + let derivedVia = 'solana.signMessage'; + if (provider?.isBackpack) { + const result = await provider.signMessage(data); + payload = { signature: result }; + derivedVia = 'backpack.signMessage'; + } else { + payload = await provider.signMessage(data, 'utf8'); + } + const hexSig = uint8arrayToString(payload.signature, 'base16'); + const authSig = { + sig: hexSig, + derivedVia, + signedMessage: body, + address: provider.publicKey.toBase58(), + }; + localStorage.setItem( + LOCAL_STORAGE_KEYS.AUTH_SOL_SIGNATURE, + JSON.stringify(authSig) + ); + return authSig; +}; + +// packages/auth-browser/src/lib/auth-browser.ts +var checkAndSignAuthMessage = ({ + chain, + resources, + switchChain, + expiration, + uri, + cosmosWalletType, + walletConnectProjectId, + nonce, +}) => { + const chainInfo = ALL_LIT_CHAINS[chain]; + if (!chainInfo) { + throw new UnsupportedChainException( + { + info: { + chain, + }, + }, + `Unsupported chain selected. Please select one of: %s`, + Object.keys(ALL_LIT_CHAINS) + ); + } + if (!expiration) { + expiration = new Date(Date.now() + 1e3 * 60 * 60 * 24 * 7).toISOString(); + } + if (chainInfo.vmType === VMTYPE.EVM) { + return checkAndSignEVMAuthMessage({ + chain, + resources, + switchChain, + expiration, + uri, + walletConnectProjectId, + nonce, + }); + } else if (chainInfo.vmType === VMTYPE.SVM) { + return checkAndSignSolAuthMessage(); + } else if (chainInfo.vmType === VMTYPE.CVM) { + return checkAndSignCosmosAuthMessage({ + chain, + walletType: cosmosWalletType || 'keplr', + }); + } + throw new UnsupportedChainException( + { + info: { + chain, + }, + }, + `vmType not found for this chain: %s. This should not happen. Unsupported chain selected. Please select one of: %s`, + chain, + Object.keys(ALL_LIT_CHAINS) + ); +}; + +// packages/lit-node-client-nodejs/src/index.ts +init_shim(); + +// node_modules/cross-fetch/dist/node-polyfill.js +init_shim(); +var fetchNode = require_node_ponyfill(); +var fetch2 = fetchNode.fetch.bind({}); +fetch2.polyfill = true; +if (!global.fetch) { + global.fetch = fetch2; + global.Response = fetchNode.Response; + global.Headers = fetchNode.Headers; + global.Request = fetchNode.Request; +} + +// packages/lit-node-client-nodejs/src/lib/lit-node-client-nodejs.ts +init_shim(); +init_lib17(); +var import_utils12 = __toESM(require_utils2()); +import { SiweMessage as SiweMessage4 } from 'siwe'; + +// packages/auth-helpers/src/index.ts +init_shim(); + +// packages/auth-helpers/src/lib/models.ts +init_shim(); + +// packages/auth-helpers/src/lib/session-capability-object.ts +init_shim(); + +// packages/auth-helpers/src/lib/recap/recap-session-capability-object.ts +init_shim(); +import depd4 from 'depd'; +import { Recap } from 'siwe-recap'; + +// packages/auth-helpers/src/lib/siwe/siwe-helper.ts +init_shim(); +function sanitizeSiweMessage(message) { + let sanitizedMessage = message.replace(/\\\\n/g, '\\n'); + sanitizedMessage = sanitizedMessage.replace(/\\"/g, "'"); + return sanitizedMessage; +} +var createCapacityCreditsResourceData = (params) => { + return { + ...(params.delegateeAddresses + ? { + delegate_to: params.delegateeAddresses.map((address) => + address.startsWith('0x') ? address.slice(2) : address + ), + } + : {}), + ...(params.uses !== void 0 ? { uses: params.uses.toString() } : {}), + }; +}; +var addRecapToSiweMessage = async ({ + siweMessage, + resources, + litNodeClient, +}) => { + if (!resources || resources.length < 1) { + throw new Error('resources is required'); + } + if (!litNodeClient) { + throw new Error('litNodeClient is required'); + } + for (const request of resources) { + const recapObject = + await litNodeClient.generateSessionCapabilityObjectWithWildcards([ + request.resource, + ]); + recapObject.addCapabilityForResource( + request.resource, + request.ability, + request.data || null + ); + const verified = recapObject.verifyCapabilitiesForResource( + request.resource, + request.ability + ); + if (!verified) { + throw new Error( + `Failed to verify capabilities for resource: "${request.resource}" and ability: "${request.ability}` + ); + } + siweMessage = recapObject.addToSiweMessage(siweMessage); + } + return siweMessage; +}; + +// packages/auth-helpers/src/lib/recap/utils.ts +init_shim(); +function getRecapNamespaceAndAbility(litAbility) { + switch (litAbility) { + case LIT_ABILITY.AccessControlConditionDecryption: + return { + recapNamespace: LIT_NAMESPACE.Threshold, + recapAbility: LIT_RECAP_ABILITY.Decryption, + }; + case LIT_ABILITY.AccessControlConditionSigning: + return { + recapNamespace: LIT_NAMESPACE.Threshold, + recapAbility: LIT_RECAP_ABILITY.Signing, + }; + case LIT_ABILITY.PKPSigning: + return { + recapNamespace: LIT_NAMESPACE.Threshold, + recapAbility: LIT_RECAP_ABILITY.Signing, + }; + case LIT_ABILITY.PaymentDelegation: + return { + recapNamespace: LIT_NAMESPACE.Auth, + recapAbility: LIT_RECAP_ABILITY.Auth, + }; + case LIT_ABILITY.LitActionExecution: + return { + recapNamespace: LIT_NAMESPACE.Threshold, + recapAbility: LIT_RECAP_ABILITY.Execution, + }; + default: + throw new InvalidArgumentException( + { + info: { + litAbility, + }, + }, + `Unknown LitAbility` + ); + } +} + +// packages/auth-helpers/src/lib/recap/recap-session-capability-object.ts +var deprecated4 = depd4('lit-js-sdk:auth-recap:session-capability-object'); +var RecapSessionCapabilityObject = class { + _inner; + constructor(att = {}, prf = []) { + this._inner = new Recap(att, prf); + } + static decode(encoded) { + const recap = Recap.decode_urn(encoded); + return new this( + recap.attenuations, + recap.proofs.map((cid) => cid.toString()) + ); + } + static extract(siwe) { + const recap = Recap.extract_and_verify(siwe); + return new this( + recap.attenuations, + recap.proofs.map((cid) => cid.toString()) + ); + } + get attenuations() { + return this._inner.attenuations; + } + get proofs() { + return this._inner.proofs.map((cid) => cid.toString()); + } + get statement() { + return sanitizeSiweMessage(this._inner.statement); + } + addProof(proof) { + return this._inner.addProof(proof); + } + addAttenuation(resource, namespace = '*', name = '*', restriction = {}) { + return this._inner.addAttenuation(resource, namespace, name, restriction); + } + addToSiweMessage(siwe) { + return this._inner.add_to_siwe_message(siwe); + } + encodeAsSiweResource() { + return this._inner.encode(); + } + /** LIT specific methods */ + addCapabilityForResource(litResource, ability, data = {}) { + if (!litResource.isValidLitAbility(ability)) { + throw new InvalidArgumentException( + { + info: { + litResource, + ability, + }, + }, + `The specified Lit resource does not support the specified ability.` + ); + } + const { recapNamespace, recapAbility } = + getRecapNamespaceAndAbility(ability); + if (!data) { + return this.addAttenuation( + litResource.getResourceKey(), + recapNamespace, + recapAbility + ); + } + return this.addAttenuation( + litResource.getResourceKey(), + recapNamespace, + recapAbility, + data + ); + } + verifyCapabilitiesForResource(litResource, ability) { + if (!litResource.isValidLitAbility(ability)) { + return false; + } + const attenuations = this.attenuations; + const { recapNamespace, recapAbility } = + getRecapNamespaceAndAbility(ability); + const recapAbilityToCheckFor = `${recapNamespace}/${recapAbility}`; + const attenuatedResourceKey = + this._getResourceKeyToMatchAgainst(litResource); + if (!attenuations[attenuatedResourceKey]) { + return false; + } + const attenuatedRecapAbilities = Object.keys( + attenuations[attenuatedResourceKey] + ); + for (const attenuatedRecapAbility of attenuatedRecapAbilities) { + if (attenuatedRecapAbility === '*/*') { + return true; + } + if (attenuatedRecapAbility === recapAbilityToCheckFor) { + return true; + } + } + return false; + } + /** + * Returns the attenuated resource key to match against. This supports matching + * against a wildcard resource key too. + * + * @example If the attenuations object contains the following: + * + * ``` + * { + * 'lit-acc://*': { + * '*\/*': {} + * } + * } + * ``` + * + * Then, if the provided litResource is 'lit-acc://123', the method will return 'lit-acc://*'. + */ + _getResourceKeyToMatchAgainst(litResource) { + const attenuatedResourceKeysToMatchAgainst = [ + `${litResource.resourcePrefix}://*`, + litResource.getResourceKey(), + ]; + for (const attenuatedResourceKeyToMatchAgainst of attenuatedResourceKeysToMatchAgainst) { + if (this.attenuations[attenuatedResourceKeyToMatchAgainst]) { + return attenuatedResourceKeyToMatchAgainst; + } + } + return ''; + } + addAllCapabilitiesForResource(litResource) { + return this.addAttenuation(litResource.getResourceKey(), '*', '*'); + } +}; + +// packages/auth-helpers/src/lib/session-capability-object.ts +function decode3(encoded) { + return RecapSessionCapabilityObject.decode(encoded); +} + +// packages/auth-helpers/src/lib/resources.ts +init_shim(); + +// packages/access-control-conditions/src/index.ts +init_shim(); + +// packages/access-control-conditions/src/lib/canonicalFormatter.ts +init_shim(); +var getOperatorParam = (cond) => { + const _cond = cond; + return { + operator: _cond.operator, + }; +}; +var canonicalAbiParamss = (params) => { + return params.map((param) => ({ + name: param.name, + type: param.type, + })); +}; +var canonicalUnifiedAccessControlConditionFormatter = (cond) => { + if (Array.isArray(cond)) { + return cond.map((c) => canonicalUnifiedAccessControlConditionFormatter(c)); + } + if ('operator' in cond) { + return getOperatorParam(cond); + } + if ('returnValueTest' in cond) { + const _cond = cond; + const _conditionType = _cond.conditionType; + switch (_conditionType) { + case 'solRpc': + return canonicalSolRpcConditionFormatter(cond, true); + case 'evmBasic': + return canonicalAccessControlConditionFormatter(cond); + case 'evmContract': + return canonicalEVMContractConditionFormatter(cond); + case 'cosmos': + return canonicalCosmosConditionFormatter(cond); + default: + throw new InvalidAccessControlConditions( + { + info: { + cond, + }, + }, + 'You passed an invalid access control condition that is missing or has a wrong "conditionType"' + ); + } + } + throw new InvalidAccessControlConditions( + { + info: { + cond, + }, + }, + 'You passed an invalid access control condition' + ); +}; +var canonicalSolRpcConditionFormatter = (cond, requireV2Conditions = false) => { + if (Array.isArray(cond)) { + return cond.map((c) => + canonicalSolRpcConditionFormatter(c, requireV2Conditions) + ); + } + if ('operator' in cond) { + return getOperatorParam(cond); + } + if ('returnValueTest' in cond) { + const { returnValueTest } = cond; + const canonicalReturnValueTest = { + // @ts-ignore + key: returnValueTest.key, + comparator: returnValueTest.comparator, + value: returnValueTest.value, + }; + if ('pdaParams' in cond || requireV2Conditions) { + const _assumedV2Cond = cond; + if ( + !('pdaInterface' in _assumedV2Cond) || + !('pdaKey' in _assumedV2Cond) || + !('offset' in _assumedV2Cond.pdaInterface) || + !('fields' in _assumedV2Cond.pdaInterface) + ) { + throw new InvalidAccessControlConditions( + { + info: { + cond, + }, + }, + 'Solana RPC Conditions have changed and there are some new fields you must include in your condition. Check the docs here: https://developer.litprotocol.com/AccessControlConditions/solRpcConditions' + ); + } + const canonicalPdaInterface = { + offset: _assumedV2Cond.pdaInterface.offset, + fields: _assumedV2Cond.pdaInterface.fields, + }; + const _solV2Cond = cond; + const _requiredParams = { + method: _solV2Cond.method, + params: _solV2Cond.params, + pdaParams: _solV2Cond.pdaParams, + pdaInterface: canonicalPdaInterface, + pdaKey: _solV2Cond.pdaKey, + chain: _solV2Cond.chain, + returnValueTest: canonicalReturnValueTest, + }; + return _requiredParams; + } else { + const _solV1Cond = cond; + const _requiredParams = { + // @ts-ignore + method: _solV1Cond.method, + // @ts-ignore + params: _solV1Cond.params, + chain: _solV1Cond.chain, + returnValueTest: canonicalReturnValueTest, + }; + return _requiredParams; + } + } + throw new InvalidAccessControlConditions( + { + info: { + cond, + }, + }, + 'You passed an invalid access control condition' + ); +}; +var canonicalAccessControlConditionFormatter = (cond) => { + if (Array.isArray(cond)) { + return cond.map((c) => canonicalAccessControlConditionFormatter(c)); + } + if ('operator' in cond) { + return getOperatorParam(cond); + } + if ('returnValueTest' in cond) { + const _cond = cond; + const _return = { + contractAddress: _cond.contractAddress, + chain: _cond.chain, + standardContractType: _cond.standardContractType, + method: _cond.method, + parameters: _cond.parameters, + returnValueTest: { + comparator: _cond.returnValueTest.comparator, + value: _cond.returnValueTest.value, + }, + }; + return _return; + } + throw new InvalidAccessControlConditions( + { + info: { + cond, + }, + }, + 'You passed an invalid access control condition' + ); +}; +var canonicalEVMContractConditionFormatter = (cond) => { + if (Array.isArray(cond)) { + return cond.map((c) => canonicalEVMContractConditionFormatter(c)); + } + if ('operator' in cond) { + const _cond = cond; + return { + operator: _cond.operator, + }; + } + if ('returnValueTest' in cond) { + const evmCond = cond; + const { functionAbi, returnValueTest } = evmCond; + const canonicalAbi = { + name: functionAbi.name, + inputs: canonicalAbiParamss(functionAbi.inputs), + outputs: canonicalAbiParamss(functionAbi.outputs), + constant: + typeof functionAbi.constant === 'undefined' + ? false + : functionAbi.constant, + stateMutability: functionAbi.stateMutability, + }; + const canonicalReturnValueTest = { + key: returnValueTest.key, + comparator: returnValueTest.comparator, + value: returnValueTest.value, + }; + const _return = { + contractAddress: evmCond.contractAddress, + functionName: evmCond.functionName, + functionParams: evmCond.functionParams, + functionAbi: canonicalAbi, + chain: evmCond.chain, + returnValueTest: canonicalReturnValueTest, + }; + return _return; + } + throw new InvalidAccessControlConditions( + { + info: { + cond, + }, + }, + 'You passed an invalid access control condition' + ); +}; +var canonicalCosmosConditionFormatter = (cond) => { + if (Array.isArray(cond)) { + return cond.map((c) => canonicalCosmosConditionFormatter(c)); + } + if ('operator' in cond) { + const _cond = cond; + return { + operator: _cond.operator, + }; + } + if ('returnValueTest' in cond) { + const _cosmosCond = cond; + const { returnValueTest } = _cosmosCond; + const canonicalReturnValueTest = { + key: returnValueTest.key, + comparator: returnValueTest.comparator, + value: returnValueTest.value, + }; + return { + path: _cosmosCond.path, + chain: _cosmosCond.chain, + method: _cosmosCond?.method, + parameters: _cosmosCond?.parameters, + returnValueTest: canonicalReturnValueTest, + }; + } + throw new InvalidAccessControlConditions( + { + info: { + cond, + }, + }, + 'You passed an invalid access control condition' + ); +}; + +// packages/access-control-conditions/src/lib/hashing.ts +init_shim(); +var hashUnifiedAccessControlConditions = (unifiedAccessControlConditions) => { + log('unifiedAccessControlConditions:', unifiedAccessControlConditions); + const conditions = unifiedAccessControlConditions.map((condition) => { + return canonicalUnifiedAccessControlConditionFormatter(condition); + }); + log('conditions:', conditions); + const hasUndefined = conditions.some((c) => c === void 0); + if (hasUndefined) { + throw new InvalidAccessControlConditions( + { + info: { + conditions, + }, + }, + 'Invalid access control conditions' + ); + } + if (conditions.length === 0) { + throw new InvalidAccessControlConditions( + { + info: { + conditions, + }, + }, + 'No conditions provided' + ); + } + const toHash = JSON.stringify(conditions); + log('Hashing unified access control conditions: ', toHash); + const encoder = new TextEncoder(); + const data = encoder.encode(toHash); + return crypto.subtle.digest('SHA-256', data); +}; +var hashAccessControlConditions = (accessControlConditions) => { + const conds = accessControlConditions.map((c) => + canonicalAccessControlConditionFormatter(c) + ); + const toHash = JSON.stringify(conds); + log('Hashing access control conditions: ', toHash); + const encoder = new TextEncoder(); + const data = encoder.encode(toHash); + return crypto.subtle.digest('SHA-256', data); +}; +var hashEVMContractConditions = (evmContractConditions) => { + const conds = evmContractConditions.map((c) => + canonicalEVMContractConditionFormatter(c) + ); + const toHash = JSON.stringify(conds); + log('Hashing evm contract conditions: ', toHash); + const encoder = new TextEncoder(); + const data = encoder.encode(toHash); + return crypto.subtle.digest('SHA-256', data); +}; +var hashSolRpcConditions = (solRpcConditions) => { + const conds = solRpcConditions.map((c) => + canonicalSolRpcConditionFormatter(c) + ); + const toHash = JSON.stringify(conds); + log('Hashing sol rpc conditions: ', toHash); + const encoder = new TextEncoder(); + const data = encoder.encode(toHash); + return crypto.subtle.digest('SHA-256', data); +}; + +// packages/access-control-conditions/src/lib/humanizer.ts +init_shim(); + +// packages/access-control-conditions/src/lib/validator.ts +init_shim(); + +// node_modules/@lit-protocol/accs-schemas/esm/index.js +init_shim(); + +// node_modules/@lit-protocol/accs-schemas/esm/generated/index.js +init_shim(); + +// node_modules/@lit-protocol/accs-schemas/esm/generated/LPACC_EVM_ATOM.js +init_shim(); + +// node_modules/@lit-protocol/accs-schemas/esm/generated/LPACC_EVM_BASIC.js +init_shim(); + +// node_modules/@lit-protocol/accs-schemas/esm/generated/LPACC_EVM_CONTRACT.js +init_shim(); + +// node_modules/@lit-protocol/accs-schemas/esm/generated/LPACC_SOL.js +init_shim(); + +// node_modules/@lit-protocol/accs-schemas/esm/schemas/index.js +init_shim(); +async function loadSchema(schemaName) { + switch (schemaName) { + case 'LPACC_ATOM': + return Promise.resolve().then(() => __toESM(require_LPACC_ATOM())); + case 'LPACC_EVM_BASIC': + return Promise.resolve().then(() => __toESM(require_LPACC_EVM_BASIC())); + case 'LPACC_EVM_CONTRACT': + return Promise.resolve().then(() => + __toESM(require_LPACC_EVM_CONTRACT()) + ); + case 'LPACC_SOL': + return Promise.resolve().then(() => __toESM(require_LPACC_SOL())); + default: + throw new Error(`Unknown schema: ${schemaName}`); + } +} + +// packages/access-control-conditions/src/lib/validator.ts +var SCHEMA_NAME_MAP = { + cosmos: 'LPACC_ATOM', + evmBasic: 'LPACC_EVM_BASIC', + evmContract: 'LPACC_EVM_CONTRACT', + solRpc: 'LPACC_SOL', +}; +async function getSchema(accType) { + try { + const schemaName = SCHEMA_NAME_MAP[accType]; + return loadSchema(schemaName); + } catch (err) { + throw new InvalidArgumentException( + { + info: { + accType, + }, + }, + `No schema found for condition type %s`, + accType + ); + } +} +var validateAccessControlConditionsSchema = async (accs) => { + for (const acc of accs) { + if (Array.isArray(acc)) { + await validateAccessControlConditionsSchema(acc); + continue; + } + if ('operator' in acc) { + continue; + } + checkSchema( + acc, + await getSchema('evmBasic'), + 'accessControlConditions', + 'validateAccessControlConditionsSchema' + ); + } + return true; +}; +var validateEVMContractConditionsSchema = async (accs) => { + for (const acc of accs) { + if (Array.isArray(acc)) { + await validateEVMContractConditionsSchema(acc); + continue; + } + if ('operator' in acc) { + continue; + } + checkSchema( + acc, + await getSchema('evmContract'), + 'evmContractConditions', + 'validateEVMContractConditionsSchema' + ); + } + return true; +}; +var validateSolRpcConditionsSchema = async (accs) => { + for (const acc of accs) { + if (Array.isArray(acc)) { + await validateSolRpcConditionsSchema(acc); + continue; + } + if ('operator' in acc) { + continue; + } + checkSchema( + acc, + await getSchema('solRpc'), + 'solRpcConditions', + 'validateSolRpcConditionsSchema' + ); + } + return true; +}; +var validateUnifiedAccessControlConditionsSchema = async (accs) => { + for (const acc of accs) { + if (Array.isArray(acc)) { + await validateUnifiedAccessControlConditionsSchema(acc); + continue; + } + if ('operator' in acc) { + continue; + } + let schema; + switch (acc.conditionType) { + case 'evmBasic': + schema = await getSchema('evmBasic'); + break; + case 'evmContract': + schema = await getSchema('evmContract'); + break; + case 'solRpc': + schema = await getSchema('solRpc'); + break; + case 'cosmos': + schema = await getSchema('cosmos'); + break; + } + if (schema) { + checkSchema( + acc, + schema, + 'accessControlConditions', + 'validateUnifiedAccessControlConditionsSchema' + ); + } else { + throw new InvalidArgumentException( + { + info: { + acc, + }, + }, + `Missing schema to validate condition type %s`, + acc.conditionType + ); + } + } + return true; +}; + +// packages/auth-helpers/src/lib/utils.ts +init_shim(); +function formatPKPResource(resource) { + let fixedResource = resource.startsWith('0x') ? resource.slice(2) : resource; + if (fixedResource.length > 64) { + throw new Error('Resource ID exceeds 64 characters (32 bytes) in length.'); + } + const hexRegex = /^[0-9A-Fa-f]+$/; + if (fixedResource !== '*' && hexRegex.test(fixedResource)) { + fixedResource = fixedResource.padStart(64, '0'); + } + return fixedResource; +} + +// packages/auth-helpers/src/lib/resources.ts +var LitResourceBase = class { + resource; + constructor(resource) { + this.resource = resource; + } + getResourceKey() { + return `${this.resourcePrefix}://${this.resource}`; + } + toString() { + return this.getResourceKey(); + } +}; +var LitAccessControlConditionResource = class extends LitResourceBase { + resourcePrefix = LIT_RESOURCE_PREFIX.AccessControlCondition; + /** + * Creates a new LitAccessControlConditionResource. + * @param resource The identifier for the resource. This should be the + * hashed key value of the access control condition. + */ + constructor(resource) { + super(resource); + } + isValidLitAbility(litAbility) { + return ( + litAbility === LIT_ABILITY.AccessControlConditionDecryption || + litAbility === LIT_ABILITY.AccessControlConditionSigning + ); + } + /** + * Composes a resource string by hashing access control conditions and appending a data hash. + * + * @param {AccessControlConditions} accs - The access control conditions to hash. + * @param {string} dataToEncryptHash - The hash of the data to encrypt. + * @returns {Promise} The composed resource string in the format 'hashedAccs/dataToEncryptHash'. + */ + static async generateResourceString(accs, dataToEncryptHash) { + if (!accs || !dataToEncryptHash) { + throw new InvalidArgumentException( + { + info: { + accs, + dataToEncryptHash, + }, + }, + 'Invalid input: Access control conditions and data hash are required.' + ); + } + const hashedAccs = await hashAccessControlConditions(accs); + const hashedAccsStr = uint8arrayToString( + new Uint8Array(hashedAccs), + 'base16' + ); + const resourceString = `${hashedAccsStr}/${dataToEncryptHash}`; + return resourceString; + } +}; +var LitPKPResource = class extends LitResourceBase { + resourcePrefix = LIT_RESOURCE_PREFIX.PKP; + /** + * Creates a new LitPKPResource. + * @param resource The identifier for the resource. This should be the + * PKP token ID. + */ + constructor(resource) { + const fixedResource = formatPKPResource(resource); + super(fixedResource); + } + isValidLitAbility(litAbility) { + return litAbility === LIT_ABILITY.PKPSigning; + } +}; +var LitActionResource = class extends LitResourceBase { + resourcePrefix = LIT_RESOURCE_PREFIX.LitAction; + /** + * Creates a new LitActionResource. + * @param resource The identifier for the resource. This should be the + * Lit Action IPFS CID. + */ + constructor(resource) { + super(resource); + } + isValidLitAbility(litAbility) { + return litAbility === LIT_ABILITY.LitActionExecution; + } +}; + +// packages/auth-helpers/src/lib/recap/resource-builder.ts +init_shim(); + +// packages/auth-helpers/src/lib/siwe/create-siwe-message.ts +init_shim(); +import { SiweMessage as SiweMessage2 } from 'siwe'; +var createSiweMessage = async (params) => { + if (!params.walletAddress) { + throw new Error('walletAddress is required'); + } + const ONE_WEEK_FROM_NOW = new Date( + Date.now() + 1e3 * 60 * 60 * 24 * 7 + ).toISOString(); + const siweParams = { + domain: params?.domain ?? 'localhost', + address: params.walletAddress, + statement: + params?.statement ?? + 'This is a test statement. You can put anything you want here.', + uri: params?.uri ?? 'https://localhost/login', + version: params?.version ?? '1', + chainId: params?.chainId ?? 1, + nonce: params.nonce, + expirationTime: params?.expiration ?? ONE_WEEK_FROM_NOW, + }; + let siweMessage = new SiweMessage2(siweParams); + if ( + 'dAppOwnerWallet' in params || // required param + 'uses' in params || // optional + 'delegateeAddresses' in params + ) { + const ccParams = params; + const capabilities = createCapacityCreditsResourceData(ccParams); + params.resources = [ + { + // TODO: new resource to be used + // resource: new LitRLIResource(ccParams.capacityTokenId ?? '*'), + // ability: LIT_ABILITY.RateLimitIncreaseAuth, + // @ts-ignore - TODO: new resource to be used + resource: null, + // @ts-ignore - TODO: new ability to be used + ability: null, + data: capabilities, + }, + ]; + } + if (params.resources) { + siweMessage = await addRecapToSiweMessage({ + siweMessage, + resources: params.resources, + litNodeClient: params.litNodeClient, + }); + } + return siweMessage.prepareMessage(); +}; +var createSiweMessageWithRecaps = async (params) => { + return createSiweMessage({ + ...params, + }); +}; +var createSiweMessageWithCapacityDelegation = async (params) => { + if (!params.litNodeClient) { + throw new Error('litNodeClient is required'); + } + return createSiweMessage({ + ...params, + }); +}; + +// packages/auth-helpers/src/lib/generate-auth-sig.ts +init_shim(); +var generateAuthSig = async ({ signer, toSign, address, algo }) => { + if (!signer?.signMessage) { + throw new Error('signer does not have a signMessage method'); + } + const signature2 = await signer.signMessage(toSign); + if (!address) { + address = await signer.getAddress(); + } + address = ethers_exports.utils.getAddress(address); + if (!address) { + throw new Error('address is required'); + } + return { + sig: signature2, + derivedVia: 'web3.eth.personal.sign', + signedMessage: toSign, + address, + ...(algo && { algo }), + }; +}; + +// packages/contracts-sdk/src/index.ts +init_shim(); + +// packages/contracts-sdk/src/lib/contracts-sdk.ts +init_shim(); + +// packages/contracts-sdk/src/lib/hex2dec.ts +init_shim(); +function add3(x, y, base2) { + var z = []; + var n2 = Math.max(x.length, y.length); + var carry = 0; + var i2 = 0; + while (i2 < n2 || carry) { + var xi = i2 < x.length ? x[i2] : 0; + var yi = i2 < y.length ? y[i2] : 0; + var zi = carry + xi + yi; + z.push(zi % base2); + carry = Math.floor(zi / base2); + i2++; + } + return z; +} +function multiplyByNumber(num, x, base2) { + if (num < 0) return null; + if (num == 0) return []; + var result = []; + var power = x; + while (true) { + if (num & 1) { + result = add3(result, power, base2); + } + num = num >> 1; + if (num === 0) break; + power = add3(power, power, base2); + } + return result; +} +function parseToDigitsArray(str, base2) { + var digits = str.split(''); + var ary = []; + for (var i2 = digits.length - 1; i2 >= 0; i2--) { + var n2 = parseInt(digits[i2], base2); + if (isNaN(n2)) return null; + ary.push(n2); + } + return ary; +} +function convertBase(str, fromBase, toBase) { + var digits = parseToDigitsArray(str, fromBase); + if (digits === null) return null; + var outArray = []; + var power = [1]; + for (var i2 = 0; i2 < digits.length; i2++) { + if (digits[i2]) { + outArray = add3( + outArray, + multiplyByNumber(digits[i2], power, toBase), + toBase + ); + } + power = multiplyByNumber(fromBase, power, toBase); + } + var out = ''; + for (var i2 = outArray.length - 1; i2 >= 0; i2--) { + out += outArray[i2].toString(toBase); + } + if (out === '') { + out = '0'; + } + return out; +} +function decToHex(decStr, opts) { + var hidePrefix = opts && opts.prefix === false; + var hex = convertBase(decStr, 10, 16); + return hex ? (hidePrefix ? hex : '0x' + hex) : null; +} +function hexToDec(hexStr) { + if (hexStr.substring(0, 2) === '0x') hexStr = hexStr.substring(2); + hexStr = hexStr.toLowerCase(); + return convertBase(hexStr, 16, 10); +} +var intToIP = (ip) => { + const binaryString = ip.toString(2).padStart(32, '0'); + const ipArray = []; + for (let i2 = 0; i2 < 32; i2 += 8) { + ipArray.push(parseInt(binaryString.substring(i2, i2 + 8), 2)); + } + return ipArray.join('.'); +}; + +// packages/contracts-sdk/src/lib/contracts-sdk.ts +var import_utils10 = __toESM(require_utils2()); + +// packages/contracts-sdk/src/lib/auth-utils.ts +init_shim(); +import * as jose from 'jose'; +async function getAuthIdByAuthMethod(authMethod) { + let authMethodId; + switch (authMethod.authMethodType) { + case 1: + authMethodId = getEthAuthMethodId(authMethod); + break; + case 4: + authMethodId = await getDiscordAuthId(authMethod); + break; + case 3: + authMethodId = await getWebauthnAuthId(authMethod); + break; + case 6: + authMethodId = await getGoogleJwtAuthId(authMethod); + break; + case 9: + authMethodId = await getStytchAuthId(authMethod); + break; + case 10: + case 11: + case 12: + case 13: + authMethodId = await getStytchFactorAuthMethodId(authMethod); + break; + default: + throw new InvalidArgumentException( + { + info: { + authMethod, + }, + }, + `Unsupported auth method type: ${authMethod.authMethodType}` + ); + } + return authMethodId; +} +function getEthAuthMethodId(authMethod) { + let accessToken; + try { + accessToken = JSON.parse(authMethod.accessToken); + } catch (err) { + throw new InvalidArgumentException( + { + info: { + authMethod, + }, + cause: err, + }, + 'Unable to parse access token as JSON object' + ); + } + const address = accessToken.address; + if (!address) { + throw new NoWalletException( + { + info: { + authMethod, + }, + }, + 'No address found in access token' + ); + } + return ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes(`${address}:lit`) + ); +} +async function getDiscordAuthId(authMethod) { + const _clientId = '1052874239658692668'; + let userId; + const meResponse = await fetch('https://discord.com/api/users/@me', { + method: 'GET', + headers: { + authorization: `Bearer ${authMethod.accessToken}`, + }, + }); + if (meResponse.ok) { + const user = await meResponse.json(); + userId = user.id; + } else { + throw new NetworkError( + { + info: { + authMethod, + }, + }, + 'Unable to verify Discord account' + ); + } + const authMethodId = ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes(`${userId}:${_clientId}`) + ); + return authMethodId; +} +async function getWebauthnAuthId(authMethod) { + let credentialId; + const rpNameToUse = 'lit'; + try { + credentialId = JSON.parse(authMethod.accessToken).rawId; + } catch (err) { + throw new InvalidArgumentException( + { + info: { + authMethod, + }, + cause: err, + }, + `Error when parsing auth method to generate auth method ID for WebAuthn` + ); + } + const authMethodId = ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes(`${credentialId}:${rpNameToUse}`) + ); + return authMethodId; +} +async function getStytchAuthId(authMethod) { + try { + const tokenBody = _parseJWT(authMethod.accessToken); + const userId = tokenBody['sub']; + const orgId = tokenBody['aud'][0]; + const authMethodId = ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes( + `${userId.toLowerCase()}:${orgId.toLowerCase()}` + ) + ); + return authMethodId; + } catch (err) { + throw new InvalidArgumentException( + { + info: { + authMethod, + }, + cause: err, + }, + `Error while parsing auth method to generate auth method id for Stytch OTP` + ); + } +} +function getStytchFactorAuthMethodId(authMethod) { + return new Promise((resolve, reject) => { + const accessToken = authMethod.accessToken; + const parsedToken = _parseJWT(accessToken); + let factor = 'email'; + switch (authMethod.authMethodType) { + case 10: + factor = 'email'; + break; + case 11: + factor = 'sms'; + break; + case 12: + factor = 'whatsApp'; + break; + case 13: + factor = 'totp'; + break; + default: + throw new InvalidArgumentException( + { + info: { + authMethod, + }, + }, + `Unsupport stytch auth type` + ); + } + const factorParser = _resolveAuthFactor(factor).parser; + try { + resolve(factorParser(parsedToken, 'https://stytch.com/session')); + } catch (e2) { + reject(e2); + } + }); +} +async function getGoogleJwtAuthId(authMethod) { + const tokenPayload = jose.decodeJwt(authMethod.accessToken); + const userId = tokenPayload['sub']; + const audience = tokenPayload['aud']; + const authMethodId = ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes(`${userId}:${audience}`) + ); + return authMethodId; +} +function _parseJWT(jwt) { + const parts = jwt.split('.'); + if (parts.length !== 3) { + throw new WrongParamFormat( + { + info: { + jwt, + }, + }, + 'Invalid token length' + ); + } + const body = Buffer.from(parts[1], 'base64'); + const parsedBody = JSON.parse(body.toString('ascii')); + console.log('JWT body: ', parsedBody); + return parsedBody; +} +var emailOtpAuthFactorParser = (parsedToken, provider) => { + const session = parsedToken[provider]; + const authFactors = session['authentication_factors']; + const authFactor = authFactors.find((value, _index, _obj) => { + if (value.email_factor) return value; + }); + if (!authFactor) { + throw new InvalidArgumentException( + { + info: { + parsedToken, + provider, + }, + }, + 'Could not find email authentication info in session' + ); + } + const audience = parsedToken['aud'][0]; + if (!audience) { + throw new InvalidArgumentException( + { + info: { + parsedToken, + provider, + }, + }, + 'Token does not contain an audience (project identifier), aborting' + ); + } + const userId = authFactor.email_factor.email_address; + const authMethodId = ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes( + `${userId.toLowerCase()}:${audience.toLowerCase()}` + ) + ); + return authMethodId; +}; +var smsOtpAuthFactorParser = (parsedToken, provider) => { + const session = parsedToken[provider]; + const authFactors = session['authentication_factors']; + let authFactor = authFactors.find((value, _index, _obj) => { + if (value.phone_number_factor) return value; + }); + if (!authFactor) { + throw new InvalidArgumentException( + { + info: { + parsedToken, + provider, + }, + }, + 'Could not find email authentication info in session' + ); + } + const audience = parsedToken['aud'][0]; + if (!audience) { + throw new InvalidArgumentException( + { + info: { + parsedToken, + provider, + }, + }, + 'Token does not contain an audience (project identifier), aborting' + ); + } + const userId = authFactor.phone_number_factor.phone_number; + const authMethodId = ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes( + `${userId.toLowerCase()}:${audience.toLowerCase()}` + ) + ); + return authMethodId; +}; +var whatsAppOtpAuthFactorParser = (parsedToken, provider) => { + const session = parsedToken[provider]; + const authFactors = session['authentication_factors']; + let authFactor = authFactors.find((value, _index, _obj) => { + if (value.phone_number_factor) return value; + }); + if (!authFactor) { + throw new InvalidArgumentException( + { + info: { + parsedToken, + provider, + }, + }, + 'Could not find email authentication info in session' + ); + } + const audience = parsedToken['aud'][0]; + if (!audience) { + throw new InvalidArgumentException( + { + info: { + parsedToken, + provider, + }, + }, + 'Token does not contain an audience (project identifier), aborting' + ); + } + const userId = authFactor.phone_number_factor.phone_number; + const authMethodId = ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes( + `${userId.toLowerCase()}:${audience.toLowerCase()}` + ) + ); + return authMethodId; +}; +var totpAuthFactorParser = (parsedToken, provider) => { + const session = parsedToken[provider]; + const authFactors = session['authentication_factors']; + let authFactor = authFactors.find((value, _index, _obj) => { + if (value.phone_number_factor) return value; + }); + if (!authFactor) { + throw new InvalidArgumentException( + { + info: { + parsedToken, + provider, + }, + }, + 'Could not find email authentication info in session' + ); + } + const audience = parsedToken['aud'][0]; + if (!audience) { + throw new InvalidArgumentException( + { + info: { + parsedToken, + provider, + }, + }, + 'Token does not contain an audience (project identifier), aborting' + ); + } + const userId = authFactor.authenticator_app_factor.totp_id; + const authMethodId = ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes( + `${userId.toLowerCase()}:${audience.toLowerCase()}` + ) + ); + return authMethodId; +}; +function _resolveAuthFactor(factor) { + switch (factor) { + case 'email': + return { + parser: emailOtpAuthFactorParser, + authMethodType: 10, + }; + case 'sms': + return { + parser: smsOtpAuthFactorParser, + authMethodType: 11, + }; + case 'whatsApp': + return { + parser: whatsAppOtpAuthFactorParser, + authMethodType: 12, + }; + case 'totp': + return { + parser: totpAuthFactorParser, + authMethodType: 13, + }; + } + throw new InvalidArgumentException( + { + info: { + factor, + }, + }, + `Error could not find auth with factor ${factor}` + ); +} +var stringToArrayify = (str) => { + try { + const encoder = new TextEncoder(); + return encoder.encode(str); + } catch (e2) { + throw new InvalidParamType( + { + info: { + str, + }, + }, + `Error converting string to arrayify` + ); + } +}; + +// packages/contracts-sdk/src/lib/helpers/getBytes32FromMultihash.ts +init_shim(); +var getBytes32FromMultihash = (ipfsId, CID) => { + if (!CID) { + throw new ParamsMissingError( + { + info: { + ipfsId, + CID, + }, + }, + 'CID is required. Please import from "multiformats/cid" package, and pass the CID object to the function.' + ); + } + if (!ipfsId) { + throw new ParamsMissingError( + { + info: { + ipfsId, + }, + }, + 'ipfsId is required' + ); + } + let cid; + try { + cid = CID.parse(ipfsId); + } catch (e2) { + throw new InvalidArgumentException( + { + info: { + ipfsId, + CID, + }, + }, + 'Error parsing CID' + ); + } + const hashFunction = cid.multihash.code; + const size = cid.multihash.size; + const digest = '0x' + Buffer.from(cid.multihash.digest).toString('hex'); + const ipfsHash = { + digest, + hashFunction, + size, + }; + return ipfsHash; +}; + +// packages/contracts-sdk/src/lib/contracts-sdk.ts +var REALM_ID = 1; +function _decimalToHex(decimal) { + return '0x' + decimal.toString(16); +} +var GAS_LIMIT_INCREASE_PERCENTAGE = 10; +var GAS_LIMIT_ADJUSTMENT = ethers_exports.BigNumber.from(100).add( + GAS_LIMIT_INCREASE_PERCENTAGE +); +var _LitContracts = class { + provider; + rpc; + rpcs; + signer; + privateKey; + options; + randomPrivateKey = false; + connected = false; + isPKP = false; + debug = false; + network; + customContext; + // make the constructor args optional + constructor(args) { + this.customContext = args?.customContext; + this.rpc = args?.rpc; + this.rpcs = args?.rpcs; + this.signer = args?.signer; + this.privateKey = args?.privateKey; + this.provider = args?.provider; + this.randomPrivateKey = args?.randomPrivatekey ?? false; + this.options = args?.options; + this.debug = args?.debug ?? false; + this.network = args?.network || LIT_NETWORK.DatilDev; + if (!this.rpc) { + this.rpc = RPC_URL_BY_NETWORK[this.network]; + } + if (!this.rpcs) { + this.rpcs = [this.rpc]; + } + } + /** + * Logs a message to the console. + * + * @param {any} [args] An optional value to log with the message. + */ + log = (...args) => { + if (this.debug) { + _LitContracts.logger.debug(...args); + } + }; + connect = async () => { + let wallet; + let SETUP_DONE = false; + if (this.provider) { + this.log('Using provided provider'); + } else if (isBrowser() && !this.signer) { + this.log("----- We're in the browser! -----"); + const web3Provider = window.ethereum; + if (!web3Provider) { + const msg = + 'No web3 provider found. Please install Brave, MetaMask or another web3 provider.'; + alert(msg); + throw new InitError( + { + info: { + web3Provider, + }, + }, + msg + ); + } + const chainInfo = METAMASK_CHAIN_INFO_BY_NETWORK[this.network]; + const metamaskChainInfo2 = { + ...chainInfo, + chainId: _decimalToHex(chainInfo.chainId), + }; + try { + await web3Provider.send('wallet_switchEthereumChain', [ + { chainId: metamaskChainInfo2.chainId }, + ]); + } catch (e2) { + await web3Provider.request({ + method: 'wallet_addEthereumChain', + params: [metamaskChainInfo2], + }); + } + wallet = new ethers_exports.providers.Web3Provider(web3Provider); + await wallet.send('eth_requestAccounts', []); + this.provider = wallet; + } else if (isNode()) { + this.log("----- We're in node! -----"); + this.provider = new ethers_exports.providers.StaticJsonRpcProvider({ + url: this.rpc, + skipFetchSetup: true, + }); + } + if (this.privateKey) { + this.log('Using your own private key'); + this.signer = new ethers_exports.Wallet(this.privateKey, this.provider); + this.provider = this.signer.provider; + SETUP_DONE = true; + } + if ( + (!this.privateKey && this.randomPrivateKey) || + this.options?.storeOrUseStorageKey + ) { + this.log('THIS.SIGNER:', this.signer); + const STORAGE_KEY = 'lit-contracts-sdk-private-key'; + this.log("Let's see if you have a private key in your local storage!"); + let storagePrivateKey; + try { + storagePrivateKey = localStorage.getItem(STORAGE_KEY); + } catch (e2) {} + if (!storagePrivateKey) { + this.log('Not a problem, we will generate a random private key'); + storagePrivateKey = ethers_exports.utils.hexlify( + ethers_exports.utils.randomBytes(32) + ); + } else { + this.log("Found your private key in local storage. Let's use it!"); + } + this.signer = new ethers_exports.Wallet(storagePrivateKey, this.provider); + this.log('- Your private key:', storagePrivateKey); + this.log('- Your address:', await this.signer.getAddress()); + this.log('- this.signer:', this.signer); + this.log('- this.provider.getSigner():', this.provider.getSigner()); + if (this.options?.storeOrUseStorageKey) { + this.log( + "You've set the option to store your private key in local storage." + ); + localStorage.setItem(STORAGE_KEY, storagePrivateKey); + } + } else { + if (isBrowser() && wallet && !SETUP_DONE) { + this.log('this.signer:', this.signer); + this.signer = wallet.getSigner(); + } + } + if (this.signer !== void 0 && this.signer !== null) { + if ('litNodeClient' in this.signer && 'rpcProvider' in this.signer) { + this.log(` + // *********************************************************************************************** + // THIS IS A PKP WALLET, USING IT AS A SIGNER AND ITS RPC PROVIDER AS PROVIDER + // *********************************************************************************************** + `); + this.provider = this.signer.rpcProvider; + this.isPKP = true; + } + } + this.log('Your Signer:', this.signer); + this.log('Your Provider:', this.provider?.connection); + if (!this.provider) { + this.log('No provider found. Will try to use the one from the signer.'); + this.provider = this.signer.provider; + this.log('Your Provider(from signer):', this.provider?.connection); + } + this.connected = true; + }; + static resolveLitContract(network, contractName, index = 0) { + const networkContext = NETWORK_CONTEXT_BY_NETWORK[network]; + if (!networkContext) { + throw new WrongNetworkException( + { + info: { + network, + contractName, + }, + }, + `Contract "${contractName}" not found on network "${network}". When using a 'custom' network, you must provide a custom context. This function is not intended for use with a 'custom' network.` + ); + } + const networkData = networkContext.data.find((data) => { + return data.name === contractName; + }); + const contractData = networkData?.contracts[index]; + if (!contractData) { + throw new WrongNetworkException( + { + info: { + network, + contractName, + contractData, + index, + }, + }, + 'Network or contract data not found' + ); + } + return contractData; + } + static async callLitContract( + abi, + address, + functionName, + args, + signerOrProvider + ) { + const contract = new ethers_exports.Contract( + address, + abi, + signerOrProvider + ); + return contract[functionName](...args); + } + /** + * Similar to {@link getLitContract} but used for internal purposes, + * such as custom rpc url and context. + */ + async getLitContractWithContext(network, litContractName) { + return _LitContracts.getLitContract( + network, + litContractName, + ...(this.rpc ? [this.rpc] : []), + ...(this.customContext ? [this.customContext] : []), + ...(this.signer ? [this.signer] : []) + ); + } + /** + * Retrieves any Lit contract instance based on the provided network, context, and RPC URL. + * If a context is provided, it determines if a contract resolver is used for bootstrapping contracts. + * If a resolver address is present in the context, it retrieves the Lit contract from the contract resolver instance. + * Otherwise, it retrieves the Lit contract using the contract address and ABI. + * Throws an error if required contract data is missing or if the Lit contract cannot be obtained. + * + * @param network - The network key. + * @param litContractName - The Lit contract name + * @param rpcUrl - The RPC URL. + * @param context - The contract context or contract resolver context. + * @returns The Lit contract instance. + * @throws Error if required contract data is missing or if the Lit contract cannot be obtained. + */ + static async getLitContract( + network, + litContractName, + rpcUrl = RPC_URL_BY_NETWORK[network], + context, + signer + ) { + let provider; + let signerOrProvider; + if (context && 'provider' in context) { + provider = context.provider; + } else { + provider = new ethers_exports.providers.StaticJsonRpcProvider({ + url: rpcUrl, + skipFetchSetup: true, + }); + } + if (signer) { + signerOrProvider = signer.connect(provider); + } else { + signerOrProvider = provider; + } + if (!context) { + const litContract = _LitContracts._getContractData( + network, + litContractName + ); + const { address, abi } = litContract; + if (!address || !abi) { + throw new InitError( + { + info: { + address, + abi, + network, + }, + }, + '\u274C Required contract data is missing for %s', + litContractName + ); + } + return new ethers_exports.Contract(address, abi, signerOrProvider); + } else { + if (!context.resolverAddress) { + const litContract = context[litContractName]; + if (!litContract.address || !litContract.abi) { + throw new InitError( + { + info: { + litContract, + context, + }, + }, + '\u274C Could not get %s contract address or abi from contract context', + litContractName + ); + } + return new ethers_exports.Contract( + litContract.address, + litContract.abi, + signerOrProvider + ); + } else { + const contractContext = await _LitContracts._getContractsFromResolver( + context, + signerOrProvider, + [litContractName] + ); + const contractAddress = contractContext[litContractName].address; + const contractABI = + contractContext[litContractName].abi || + _LitContracts._getContractData(network, litContractName).abi; + if (!contractAddress || !contractABI) { + throw new InitError( + { + info: { + context, + contractABI, + contractAddress, + contractContext, + }, + }, + '\u274C Could not get %s contract from contract resolver instance', + litContractName + ); + } + return new ethers_exports.Contract( + contractAddress, + contractABI, + provider + ); + } + } + } + /** + * Retrieves the PriceFeed contract instance based on the provided network, context, and RPC URL. + * If a context is provided, it determines if a contract resolver is used for bootstrapping contracts. + * If a resolver address is present in the context, it retrieves the PriceFeed contract from the contract resolver instance. + * Otherwise, it retrieves the PriceFeed contract using the contract address and ABI. + * Throws an error if required contract data is missing or if the PriceFeed contract cannot be obtained. + * + * @param network - The network key. + * @param context - The contract context or contract resolver context. + * @param rpcUrl - The RPC URL. + * @returns The PriceFeed contract instance. + * @throws Error if required contract data is missing or if the PriceFeed contract cannot be obtained. + */ + static async getPriceFeedContract(network, context, rpcUrl) { + return this.getLitContract(network, 'PriceFeed', rpcUrl, context); + } + /** + * Retrieves the Staking contract instance based on the provided network, context, and RPC URL. + * If a context is provided, it determines if a contract resolver is used for bootstrapping contracts. + * If a resolver address is present in the context, it retrieves the Staking contract from the contract resolver instance. + * Otherwise, it retrieves the Staking contract using the contract address and ABI from the contract context. + * Throws an error if required contract data is missing or if the Staking contract cannot be obtained. + * + * @param network - The network key. + * @param context - The contract context or contract resolver context. + * @param rpcUrl - The RPC URL. + * @returns The Staking contract instance. + * @throws Error if required contract data is missing or if the Staking contract cannot be obtained. + */ + static async getStakingContract(network, context, rpcUrl) { + return this.getLitContract(network, 'Staking', rpcUrl, context); + } + static async _getContractsFromResolver( + context, + signerOrProvider, + contractNames + ) { + const resolverContract = new ethers_exports.Contract( + context.resolverAddress, + context.abi, + signerOrProvider + ); + const getContract = async function (contract, environment) { + let address = ''; + switch (contract) { + case 'Allowlist': + address = await resolverContract['getContract']( + await resolverContract['ALLOWLIST_CONTRACT'](), + environment + ); + break; + case 'LITToken': + address = await resolverContract['getContract']( + await resolverContract['LIT_TOKEN_CONTRACT'](), + environment + ); + break; + case 'Multisender': + address = await resolverContract['getContract']( + await resolverContract['MULTI_SENDER_CONTRACT'](), + environment + ); + break; + case 'PKPNFT': + address = await resolverContract['getContract']( + await resolverContract['PKP_NFT_CONTRACT'](), + environment + ); + break; + case 'PKPNFTMetadata': + address = await resolverContract['getContract']( + await resolverContract['PKP_NFT_METADATA_CONTRACT'](), + environment + ); + break; + case 'PKPPermissions': + address = await resolverContract['getContract']( + await resolverContract['PKP_PERMISSIONS_CONTRACT'](), + environment + ); + break; + case 'PKPHelper': + address = await resolverContract['getContract']( + await resolverContract['PKP_HELPER_CONTRACT'](), + environment + ); + break; + case 'PubkeyRouter': + address = await resolverContract['getContract']( + await resolverContract['PUB_KEY_ROUTER_CONTRACT'](), + environment + ); + break; + case 'Staking': + address = await resolverContract['getContract']( + await resolverContract['STAKING_CONTRACT'](), + environment + ); + break; + case 'PriceFeed': + address = await resolverContract['getContract']( + await resolverContract['PRICE_FEED_CONTRACT'](), + environment + ); + break; + } + return address; + }; + const names2 = contractNames ?? _LitContracts.contractNames; + const contractContext = {}; + await Promise.all( + names2.map(async (contractName) => { + const contracts = context?.contractContext; + contractContext[contractName] = { + address: await getContract(contractName, context.environment), + abi: contracts?.[contractName]?.abi ?? void 0, + }; + }) + ); + return contractContext; + } + static async getContractAddresses(network, provider, context) { + let contractData; + if (context) { + if (context?.resolverAddress) { + context = await _LitContracts._getContractsFromResolver( + context, + provider + ); + } + const flatten2 = []; + const keys = Object.keys(context); + for (const key2 of keys) { + context[key2].name = key2; + flatten2.push(context[key2]); + } + contractData = flatten2; + } else { + contractData = _LitContracts._resolveContractContext(network); + } + const addresses = {}; + for (const contract of contractData) { + switch (contract.name) { + case 'Allowlist': + addresses.Allowlist = {}; + addresses.Allowlist.address = contract.address; + addresses.Allowlist.abi = contract.abi; + break; + case 'PKPHelper': + addresses.PKPHelper = {}; + addresses.PKPHelper.address = contract.address; + addresses.PKPHelper.abi = contract.abi; + break; + case 'PKPNFT': + addresses.PKPNFT = {}; + addresses.PKPNFT.address = contract.address; + addresses.PKPNFT.abi = contract.abi; + break; + case 'Staking': + addresses.Staking = {}; + addresses.Staking.address = contract.address; + addresses.Staking.abi = contract.abi; + break; + case 'PKPPermissions': + addresses.PKPPermissions = {}; + addresses.PKPPermissions.address = contract.address; + addresses.PKPPermissions.abi = contract.abi; + break; + case 'PKPNFTMetadata': + addresses.PKPNFTMetadata = {}; + addresses.PKPNFTMetadata.address = contract.address; + addresses.PKPNFTMetadata.abi = contract.abi; + break; + case 'PubkeyRouter': + addresses.PubkeyRouter = {}; + addresses.PubkeyRouter.address = contract.address; + addresses.PubkeyRouter.abi = contract?.abi; + break; + case 'LITToken': + addresses.LITToken = {}; + addresses.LITToken.address = contract.address; + addresses.LITToken.abi = contract?.abi; + break; + case 'Multisender': + addresses.Multisender = {}; + addresses.Multisender.address = contract.address; + addresses.Multisender.abi = contract?.abi; + break; + case 'PriceFeed': + addresses.PriceFeed = {}; + addresses.PriceFeed.address = contract.address; + addresses.PriceFeed.abi = contract?.abi; + break; + } + } + if (Object.keys(addresses).length < 5) { + throw new InitError( + { + info: { + network, + addresses, + context, + }, + }, + '\u274C Required contract data is missing' + ); + } + return addresses; + } + /** + * Generates an array of validator URLs based on the given validator structs and network configurations. + * + * @property {ValidatorStruct[]} activeValidatorStructs - Array of validator structures containing IP and port information. + * @property {string | undefined} nodeProtocol - Optional node protocol to override the default protocol selection logic. + * @property {string} litNetwork - The name of the network used to determine HTTP/HTTPS settings. + * @returns {string[]} Array of constructed validator URLs. + * + * @example + * // Example input + * const activeValidatorStructs = [ + * { ip: 3232235777, port: 443 }, // IP: 192.168.1.1 + * { ip: 3232235778, port: 80 }, // IP: 192.168.1.2 + * ]; + * const nodeProtocol = undefined; + * const litNetwork = "mainnet"; + * + * // Example output + * const urls = generateValidatorURLs(activeValidatorStructs, nodeProtocol, litNetwork); + * console.log(urls); + * Output: [ + * "https://192.168.1.1:443", + * "http://192.168.1.2:80" + * ] + */ + static generateValidatorURLs({ + activeValidatorStructs, + nodeProtocol, + litNetwork, + }) { + return activeValidatorStructs.map((item) => { + const ip = intToIP(item.ip); + const port = item.port; + const protocol = + nodeProtocol || // Use nodeProtocol if defined + (port === 443 ? HTTPS : HTTP_BY_NETWORK[litNetwork]) || // HTTPS for port 443 or network-specific HTTP + HTTP; + const url = `${protocol}${ip}:${port}`; + _LitContracts.logger.debug("Validator's URL:", url); + return url; + }); + } + static _resolveContractContext(network) { + const data = NETWORK_CONTEXT_BY_NETWORK[network]; + if (!data) { + throw new WrongNetworkException( + { + info: { + network, + }, + }, + `[_resolveContractContext] Unsupported network: ${network}` + ); + } + return data.data.map((c) => ({ + address: c.contracts[0].address_hash, + abi: c.contracts[0].ABI, + name: c.name, + })); + } + static _getContractData(network, contractName) { + const contractContexts = _LitContracts._resolveContractContext(network); + const litContract = contractContexts.find((data) => { + return data.name === contractName; + }); + if (!litContract) { + throw new WrongNetworkException( + { + info: { + network, + contractName, + }, + }, + 'Cannot find requested contract for network' + ); + } + return litContract; + } + /** + * Mints a new token with authentication. + * + * @param authMethod - The authentication method. + * @param scopes - The permission scopes. + * @param pubkey - The public key. + * @param authMethodId - (optional) The authentication ID. + * @param gasLimit - (optional) The gas limit. + * @returns An object containing the PKP information and the transaction receipt. + * @throws Error if the contracts are not connected, the contract is not available, authMethodType or accessToken is missing, or permission scopes are required. + */ + mintWithAuth = async ({ + authMethod, + scopes, + pubkey, + authMethodId, + gasLimit, + }) => { + if (!this.connected) { + throw new InitError( + { + info: { + connected: this.connected, + }, + }, + 'Contracts are not connected. Please call connect() first' + ); + } + const pkpNftContract = await this.getLitContractWithContext( + this.network, + 'PKPNFT' + ); + if (!pkpNftContract) { + throw new InitError( + { + info: { + network: this.network, + pkpNftContract, + }, + }, + 'Contract is not available' + ); + } + if (authMethod && !authMethod?.authMethodType) { + throw new ParamsMissingError( + { + info: { + authMethod, + }, + }, + 'authMethodType is required' + ); + } + if ( + authMethod && + !authMethod?.accessToken && + authMethod?.accessToken !== 'custom-auth' + ) { + throw new ParamsMissingError( + { + info: { + authMethod, + }, + }, + 'accessToken is required' + ); + } + if (scopes.length <= 0) { + throw new InvalidArgumentException( + { + info: { + scopes, + }, + }, + `\u274C Permission scopes are required! +[0] No Permissions +[1] Sign Anything +[2] Only Sign Messages +Read more here: +https://developer.litprotocol.com/v3/sdk/wallets/auth-methods/#auth-method-scopes + ` + ); + } + const _pubkey = pubkey ?? '0x'; + const _scopes = scopes.map((scope) => { + if (typeof scope === 'string') { + return ethers_exports.BigNumber.from(scope); + } + if (typeof scope === 'number') { + return ethers_exports.BigNumber.from(scope.toString()); + } + return scope; + }); + const _authMethodId = + authMethodId ?? (await getAuthIdByAuthMethod(authMethod)); + const mintCost = await pkpNftContract['mintCost'](); + const pkpHelperContract = await this.getLitContractWithContext( + this.network, + 'PKPHelper' + ); + const tx = await this._callWithAdjustedOverrides( + pkpHelperContract, + 'mintNextAndAddAuthMethods', + [ + 2, + // key type + [authMethod.authMethodType], + [_authMethodId], + [_pubkey], + [[..._scopes]], + true, + true, + ], + { value: mintCost, gasLimit } + ); + const receipt = await tx.wait(); + const events = 'events' in receipt ? receipt.events : receipt.logs; + if (!events || events.length <= 0) { + throw new TransactionError( + { + info: { + events, + receipt, + }, + }, + 'No events found in receipt' + ); + } + if (!events[0].topics || events[0].topics.length < 1) { + throw new TransactionError( + { + info: { + events, + receipt, + }, + }, + `No topics found in events, cannot derive pkp information. Transaction hash: ${receipt.transactionHash} If you are using your own contracts please use ethers directly` + ); + } + const tokenId = events[0].topics[1]; + this.log('tokenId:', tokenId); + let tries = 0; + const maxAttempts = 10; + let publicKey = ''; + while (tries < maxAttempts) { + publicKey = await pkpNftContract['getPubkey'](tokenId); + this.log('pkp pub key: ', publicKey); + if (publicKey !== '0x') { + break; + } + tries++; + await new Promise((resolve) => { + setTimeout(resolve, 1e4); + }); + } + if (publicKey.startsWith('0x')) { + publicKey = publicKey.slice(2); + } + const pubkeyBuffer = Buffer.from(publicKey, 'hex'); + const ethAddress = (0, import_utils10.computeAddress)(pubkeyBuffer); + return { + pkp: { + tokenId, + publicKey, + ethAddress, + }, + tx: receipt, + }; + }; + /** + * Mints a new token with customer authentication. + * + * @param { Object } params - The parameters for minting a new token with customer authentication. + * @param { string } params.authMethodId - The authentication method id. + * @param { string[] | number[] } params.scopes - The permission scopes. + * @param { string } params.authMethodType - The authentication method type. + * @returns { Promise> } - An object containing the PKP information and the transaction receipt. + * @throws { Error } - If the contracts are not connected, the contract is not available, authMethodType, or permission scopes are required. + * + */ + mintWithCustomAuth = async (params) => { + const authMethodId = + typeof params.authMethodId === 'string' + ? stringToArrayify(params.authMethodId) + : params.authMethodId; + return this.mintWithAuth({ + ...params, + authMethodId, + authMethod: { + authMethodType: params.authMethodType, + accessToken: 'custom-auth', + }, + }); + }; + /** + * Adds a permitted authentication method for a given PKP token. + * + * @param {Object} params - The parameters for adding the permitted authentication method. + * @param {string} params.pkpTokenId - The ID of the PKP token. + * @param {AUTH_METHOD_TYPE_VALUES | number} params.authMethodType - The type of the authentication method. + * @param {string | Uint8Array} params.authMethodId - The ID of the authentication method. + * @param {AuthMethodScope[]} params.authMethodScopes - The scopes of the authentication method. + * @param {string} [params.webAuthnPubkey] - The public key for WebAuthn. + * @returns {Promise} - A promise that resolves with the result of adding the permitted authentication method. + * @throws {Error} - If an error occurs while adding the permitted authentication method. + */ + addPermittedAuthMethod = async ({ + pkpTokenId, + authMethodType, + authMethodId, + authMethodScopes, + webAuthnPubkey, + }) => { + const _authMethodId = + typeof authMethodId === 'string' + ? stringToArrayify(authMethodId) + : authMethodId; + const _webAuthnPubkey = webAuthnPubkey ?? '0x'; + try { + const pkpPermissionsContract = await this.getLitContractWithContext( + this.network, + 'PKPPermissions' + ); + const res = await this._callWithAdjustedOverrides( + pkpPermissionsContract, + 'addPermittedAuthMethod', + [ + pkpTokenId, + { + authMethodType, + id: _authMethodId, + userPubkey: _webAuthnPubkey, + }, + authMethodScopes, + ] + ); + const receipt = await res.wait(); + return receipt; + } catch (e2) { + throw new TransactionError( + { + info: { + pkpTokenId, + authMethodType, + authMethodId, + authMethodScopes, + webAuthnPubkey, + }, + cause: e2, + }, + 'Adding permitted action failed' + ); + } + }; + /** + * Adds a permitted action to the PKP permissions contract. + * + * @param ipfsId - The IPFS ID of the action. + * @param pkpTokenId - The PKP token ID. + * @param authMethodScopes - Optional array of authentication method scopes. + * @returns A promise that resolves to the result of the write operation. + * @throws If an error occurs during the write operation. + */ + addPermittedAction = async ({ ipfsId, pkpTokenId, authMethodScopes }) => { + const ipfsIdBytes = this.utils.getBytesFromMultihash(ipfsId); + const scopes = authMethodScopes ?? []; + try { + const pkpPermissionsContract = await this.getLitContractWithContext( + this.network, + 'PKPPermissions' + ); + const res = await this._callWithAdjustedOverrides( + pkpPermissionsContract, + 'addPermittedAction', + [pkpTokenId, ipfsIdBytes, scopes] + ); + const receipt = await res.wait(); + return receipt; + } catch (e2) { + throw new TransactionError( + { + info: { + pkpTokenId, + ipfsIdBytes, + scopes, + }, + cause: e2, + }, + 'Adding permitted action failed' + ); + } + }; + utils = { + hexToDec, + decToHex, + /** + * Partition multihash string into object representing multihash + * + * @param {string} multihash A base58 encoded multihash string + * @returns {string} + */ + getBytesFromMultihash: (multihash) => { + const decoded = ethers_exports.utils.base58.decode(multihash); + return `0x${Buffer.from(decoded).toString('hex')}`; + }, + /** + * + * Convert bytes32 to IPFS ID + * @param { string } byte32 0x1220baa0d1e91f2a22fef53659418ddc3ac92da2a76d994041b86ed62c0c999de477 + * @returns { string } QmZKLGf3vgYsboM7WVUS9X56cJSdLzQVacNp841wmEDRkW + */ + getMultihashFromBytes: (byte32) => { + const text = byte32.replace('0x', ''); + const digestSize = parseInt(text.slice(2, 4), 16); + const digest = text.slice(4, 4 + digestSize * 2); + const multihash = ethers_exports.utils.base58.encode( + Buffer.from(`1220${digest}`, 'hex') + ); + return multihash; + }, + /** + * NOTE: This function requires the "multiformats/cid" package in order to work + * + * Partition multihash string into object representing multihash + * + * @param {string} ipfsId A base58 encoded multihash string + * @param {CIDParser} CID The CID object from the "multiformats/cid" package + * + * @example + * const CID = require('multiformats/cid') + * const ipfsId = 'QmZKLGf3vgYsboM7WVUS9X56cJSdLzQVacNp841wmEDRkW' + * const bytes32 = getBytes32FromMultihash(ipfsId, CID) + * console.log(bytes32) + * + * @returns {IPFSHash} + */ + getBytes32FromMultihash: (ipfsId, CID) => { + return getBytes32FromMultihash(ipfsId, CID); + }, + // convert timestamp to YYYY/MM/DD format + timestamp2Date: (timestamp) => { + const date = __require('date-and-time'); + const format = 'YYYY/MM/DD HH:mm:ss'; + const timestampFormatted = new Date(parseInt(timestamp) * 1e3); + return date.format(timestampFormatted, format); + }, + }; + pkpNftContractUtils = { + read: { + /** + * (IERC721Enumerable) + * + * Get all PKPs by a given address + * + * @param { string } ownerAddress + * @retu + * */ + getTokensByAddress: async (ownerAddress) => { + if (!this.connected) { + throw new InitError( + { + info: { + connected: this.connected, + }, + }, + 'Contracts are not connected. Please call connect() first' + ); + } + const pkpNftContract = await this.getLitContractWithContext( + this.network, + 'PKPNFT' + ); + if (!pkpNftContract) { + throw new InitError( + { + info: { + network: this.network, + pkpNftContract, + }, + }, + 'Contract is not available' + ); + } + if (!ethers_exports.utils.isAddress(ownerAddress)) { + throw new InvalidArgumentException( + { + info: { + ownerAddress, + }, + }, + `Given string is not a valid address "${ownerAddress}"` + ); + } + const tokens = []; + for (let i2 = 0; ; i2++) { + let token; + try { + token = await pkpNftContract['tokenOfOwnerByIndex']( + ownerAddress, + i2 + ); + token = this.utils.hexToDec(token.toHexString()); + tokens.push(token); + } catch (e2) { + this.log(`[getTokensByAddress] Ended search on index: ${i2}`); + break; + } + } + return tokens; + }, + /** + * (IERC721Enumerable) + * + * Get the x latest number of tokens + * + * @param { number } latestNumberOfTokens + * + * @returns { Array } a list of PKP NFTs + * + */ + getTokens: async (latestNumberOfTokens) => { + if (!this.connected) { + throw new InitError( + { + info: { + connected: this.connected, + }, + }, + 'Contracts are not connected. Please call connect() first' + ); + } + const pkpNftContract = await this.getLitContractWithContext( + this.network, + 'PKPNFT' + ); + if (!pkpNftContract) { + throw new InitError( + { + info: { + network: this.network, + pkpNftContract, + }, + }, + 'Contract is not available' + ); + } + const tokens = []; + for (let i2 = 0; ; i2++) { + if (i2 >= latestNumberOfTokens) { + break; + } + let token; + try { + token = await pkpNftContract['tokenByIndex'](i2); + token = this.utils.hexToDec(token.toHexString()); + tokens.push(token); + } catch (e2) { + this.log(`[getTokensByAddress] Ended search on index: ${i2}`); + break; + } + } + return tokens; + }, + /** + * Get info of all PKPs by a given address + */ + getTokensInfoByAddress: async (ownerAddress) => { + const pkpNftContract = await this.getLitContractWithContext( + this.network, + 'PKPNFT' + ); + const tokenIds = await this.pkpNftContractUtils.read.getTokensByAddress( + ownerAddress + ); + const arr = []; + for (let i2 = 0; i2 < tokenIds.length; i2++) { + const tokenId = tokenIds[i2]; + const pubKey = await pkpNftContract['getPubkey'](tokenId); + const addrs = await derivedAddresses({ + publicKey: pubKey, + }); + if (!addrs.tokenId) { + addrs.tokenId = tokenId; + } + arr.push(addrs); + } + return arr; + }, + }, + write: { + mint: async (param) => { + if (!this.connected) { + throw new InitError( + { + info: { + connected: this.connected, + }, + }, + 'Contracts are not connected. Please call connect() first' + ); + } + const pkpNftContract = await this.getLitContractWithContext( + this.network, + 'PKPNFT' + ); + if (!pkpNftContract) { + throw new InitError( + { + info: { + network: this.network, + pkpNftContract, + }, + }, + 'Contract is not available' + ); + } + let mintCost; + try { + mintCost = await pkpNftContract['mintCost'](); + } catch (e2) { + throw new TransactionError( + { + info: { + network: this.network, + mintCost, + }, + cause: e2, + }, + 'Could not get mint cost' + ); + } + if (this.isPKP) { + this.log( + "This is a PKP wallet, so we'll use the PKP wallet to sign the tx" + ); + } + this.log('...signing and sending tx'); + const sentTx = await this._callWithAdjustedOverrides( + pkpNftContract, + 'mintNext', + [2], + { value: mintCost, ...param } + ); + this.log('sentTx:', sentTx); + const res = await sentTx.wait(); + this.log('res:', res); + const events = 'events' in res ? res.events : res.logs; + const tokenIdFromEvent = events[0].topics[1]; + this.log('tokenIdFromEvent:', tokenIdFromEvent); + let tries = 0; + const maxAttempts = 10; + let publicKey = ''; + while (tries < maxAttempts) { + publicKey = await pkpNftContract['getPubkey'](tokenIdFromEvent); + this.log('pkp pub key: ', publicKey); + if (publicKey !== '0x') { + break; + } + tries++; + await new Promise((resolve) => { + setTimeout(resolve, 1e4); + }); + } + this.log('public key from token id', publicKey); + if (publicKey.startsWith('0x')) { + publicKey = publicKey.slice(2); + } + const pubkeyBuffer = Buffer.from(publicKey, 'hex'); + const ethAddress = (0, import_utils10.computeAddress)(pubkeyBuffer); + return { + pkp: { + tokenId: tokenIdFromEvent, + publicKey, + ethAddress, + }, + tx: sentTx, + tokenId: tokenIdFromEvent, + res, + }; + }, + claimAndMint: async (derivedKeyId, signatures, txOpts = {}) => { + try { + const pkpNftContract = await this.getLitContractWithContext( + this.network, + 'PKPNFT' + ); + const tx = await this._callWithAdjustedOverrides( + pkpNftContract, + 'claimAndMint', + [2, derivedKeyId, signatures], + { + ...txOpts, + value: txOpts.value ?? (await pkpNftContract['mintCost']()), + } + ); + const txRec = await tx.wait(); + const events = 'events' in txRec ? txRec.events : txRec.logs; + const tokenId = events[1].topics[1]; + return { tx, res: txRec, tokenId }; + } catch (e2) { + this.log(`[claimAndMint] error: ${e2.message}`); + throw new TransactionError( + { + info: { + derivedKeyId, + signatures, + txOpts, + }, + cause: e2, + }, + 'claimAndMint failed' + ); + } + }, + }, + }; + pkpPermissionsContractUtils = { + read: { + /** + * + * Check if an address is permitted + * + * @param { string } tokenId + * @param { string } address + * + * @returns { Promise } + */ + isPermittedAddress: async (tokenId, address) => { + if (!this.connected) { + throw new InitError( + { + info: { + connected: this.connected, + }, + }, + 'Contracts are not connected. Please call connect() first' + ); + } + const pkpPermissionsContract = await this.getLitContractWithContext( + this.network, + 'PKPPermissions' + ); + if (!pkpPermissionsContract) { + throw new InitError( + { + info: { + network: this.network, + pkpPermissionsContract, + }, + }, + 'Contract is not available' + ); + } + const pkpIdHex = this.utils.decToHex(tokenId, null); + const bool = await pkpPermissionsContract['isPermittedAddress']( + pkpIdHex, + address + ); + return bool; + }, + /** + * Get permitted addresses + * + * @param { string } tokenId + * + * @returns { Promise> } + * + */ + getPermittedAddresses: async (tokenId) => { + if (!this.connected) { + throw new InitError( + { + info: { + connected: this.connected, + }, + }, + 'Contracts are not connected. Please call connect() first' + ); + } + const pkpPermissionsContract = await this.getLitContractWithContext( + this.network, + 'PKPPermissions' + ); + if (!pkpPermissionsContract) { + throw new InitError( + { + info: { + network: this.network, + pkpPermissionsContract, + }, + }, + 'Contract is not available' + ); + } + this.log('[getPermittedAddresses] input:', tokenId); + let addresses = []; + const maxTries = 5; + let tries = 0; + while (tries < maxTries) { + try { + addresses = await pkpPermissionsContract['getPermittedAddresses']( + tokenId + ); + if (addresses.length <= 0) { + await new Promise((resolve) => setTimeout(resolve, 1e3)); + tries++; + continue; + } else { + break; + } + } catch (e2) { + this.log( + `[getPermittedAddresses] error:`, + e2.message + ); + tries++; + } + } + return addresses; + }, + /** + * + * Get permitted action + * + * @param { any } tokenId + * + * @returns { Promise> } + * + */ + getPermittedActions: async (tokenId) => { + if (!this.connected) { + throw new InitError( + { + info: { + connected: this.connected, + }, + }, + 'Contracts are not connected. Please call connect() first' + ); + } + const pkpPermissionsContract = await this.getLitContractWithContext( + this.network, + 'PKPPermissions' + ); + if (!pkpPermissionsContract) { + throw new InitError( + { + info: { + network: this.network, + pkpPermissionsContract, + }, + }, + 'Contract is not available' + ); + } + let actions = []; + const maxTries = 5; + let tries = 0; + while (tries < maxTries) { + try { + actions = await pkpPermissionsContract['getPermittedActions']( + tokenId + ); + if (actions.length <= 0) { + await new Promise((resolve) => setTimeout(resolve, 1e3)); + tries++; + continue; + } else { + break; + } + } catch (e2) { + this.log( + `[getPermittedActions] error:`, + e2.message + ); + tries++; + } + } + return actions; + }, + /** + * + * Check if an action is permitted given the pkpid and ipfsId + * + * @param { string } pkpId 103309008291725705563022469659474510532358692659842796086905702509072063991354 + * @param { string } ipfsId QmZKLGf3vgYsboM7WVUS9X56cJSdLzQVacNp841wmEDRkW + * + * @return { object } transaction + */ + isPermittedAction: async (pkpId, ipfsId) => { + if (!this.connected) { + throw new InitError( + { + info: { + connected: this.connected, + }, + }, + 'Contracts are not connected. Please call connect() first' + ); + } + const pkpPermissionsContract = await this.getLitContractWithContext( + this.network, + 'PKPPermissions' + ); + if (!pkpPermissionsContract) { + throw new InitError( + { + info: { + network: this.network, + pkpPermissionsContract, + }, + }, + 'Contract is not available' + ); + } + this.log('[isPermittedAction] input:', pkpId); + this.log('[isPermittedAction] input:', ipfsId); + const ipfsHash = this.utils.getBytesFromMultihash(ipfsId); + this.log('[isPermittedAction] converted:', ipfsHash); + const bool = await pkpPermissionsContract['isPermittedAction']( + pkpId, + ipfsHash + ); + return bool; + }, + }, + write: { + /** + * + * Add permitted action to a given PKP id & ipfsId + * + * @param { string } pkpId 103309008291725705563022469659474510532358692659842796086905702509072063991354 + * @param { string } ipfsId QmZKLGf3vgYsboM7WVUS9X56cJSdLzQVacNp841wmEDRkW + * + * @return { object } transaction + */ + addPermittedAction: async (pkpId, ipfsId) => { + if (!this.connected) { + throw new InitError( + { + info: { + connected: this.connected, + }, + }, + 'Contracts are not connected. Please call connect() first' + ); + } + const pkpPermissionsContract = await this.getLitContractWithContext( + this.network, + 'PKPPermissions' + ); + const pubkeyRouterContract = await this.getLitContractWithContext( + this.network, + 'PubkeyRouter' + ); + if (!pkpPermissionsContract || !pubkeyRouterContract) { + throw new InitError( + { + info: { + network: this.network, + pkpPermissionsContract, + pubkeyRouterContract, + }, + }, + 'Contract is not available' + ); + } + this.log('[addPermittedAction] input:', pkpId); + const pubKey = await pubkeyRouterContract['getPubkey'](pkpId); + this.log('[addPermittedAction] converted:', pubKey); + const pubKeyHash = ethers_exports.utils.keccak256(pubKey); + this.log('[addPermittedAction] converted:', pubKeyHash); + const tokenId = ethers_exports.BigNumber.from(pubKeyHash); + this.log('[addPermittedAction] converted:', tokenId); + this.log('[addPermittedAction] input:', ipfsId); + const ipfsIdBytes = this.utils.getBytesFromMultihash(ipfsId); + this.log('[addPermittedAction] converted:', ipfsIdBytes); + const tx = await this._callWithAdjustedOverrides( + pkpPermissionsContract, + 'addPermittedAction', + [tokenId, ipfsIdBytes, [1]] + ); + this.log('[addPermittedAction] output:', tx); + return tx; + }, + /** + * TODO: add transaction type + * Add permitted action to a given PKP id & ipfsId + * + * @param { string } pkpId 103309008291725705563022469659474510532358692659842796086905702509072063991354 + * @param { string } ownerAddress 0x3B5dD2605.....22aDC499A1 + * + * @return { object } transaction + */ + addPermittedAddress: async (pkpId, ownerAddress) => { + if (!this.connected) { + throw new InitError( + { + info: { + connected: this.connected, + }, + }, + 'Contracts are not connected. Please call connect() first' + ); + } + const pkpPermissionsContract = await this.getLitContractWithContext( + this.network, + 'PKPPermissions' + ); + if (!pkpPermissionsContract) { + throw new InitError( + { + info: { + network: this.network, + pkpPermissionsContract, + }, + }, + 'Contract is not available' + ); + } + this.log('[addPermittedAddress] input:', pkpId); + this.log('[addPermittedAddress] input:', ownerAddress); + this.log('[addPermittedAddress] input:', pkpId); + const tx = await this._callWithAdjustedOverrides( + pkpPermissionsContract, + 'addPermittedAddress', + [pkpId, ownerAddress, [1]] + ); + this.log('[addPermittedAddress] output:', tx); + return tx; + }, + /** + * Revoke permitted action of a given PKP id & ipfsId + * + * @param { string } pkpId 103309008291725705563022469659474510532358692659842796086905702509072063991354 + * @param { string } ipfsId QmZKLGf3vgYsboM7WVUS9X56cJSdLzQVacNp841wmEDRkW + * + * @return { object } transaction + */ + revokePermittedAction: async (pkpId, ipfsId) => { + if (!this.connected) { + throw new InitError( + { + info: { + connected: this.connected, + }, + }, + 'Contracts are not connected. Please call connect() first' + ); + } + const pkpPermissionsContract = await this.getLitContractWithContext( + this.network, + 'PKPPermissions' + ); + if (!pkpPermissionsContract) { + throw new InitError( + { + info: { + network: this.network, + pkpPermissionsContract, + }, + }, + 'Contract is not available' + ); + } + this.log('[revokePermittedAction] input:', pkpId); + this.log('[revokePermittedAction] input:', ipfsId); + const ipfsHash = this.utils.getBytesFromMultihash(ipfsId); + this.log('[revokePermittedAction] converted:', ipfsHash); + const tx = await this._callWithAdjustedOverrides( + pkpPermissionsContract, + 'removePermittedAction', + [pkpId, ipfsHash] + ); + this.log('[revokePermittedAction] output:', tx); + return tx; + }, + }, + }; + routerContractUtils = { + read: { + /** + * + * Convert IPFS response from Solidity to IPFS ID + * From: "0xb4200a696794b8742fab705a8c065ea6788a76bc6d270c0bc9ad900b6ed74ebc" + * To: "QmUnwHVcaymJWiYGQ6uAHvebGtmZ8S1r9E6BVmJMtuK5WY" + * + * @param { string } solidityIpfsId + * + * @return { Promise } + */ + // getIpfsIds: async (solidityIpfsId: string): Promise => { + // this.log('[getIpfsIds] input:', solidityIpfsId); + // const ipfsId = this.utils.getMultihashFromBytes(solidityIpfsId); + // this.log('[getIpfsIds] output:', ipfsId); + // return ipfsId; + // }, + }, + write: {}, + }; + pkpHelperContractUtil = { + read: {}, + write: { + /** + * + * @param param0 + * @returns + */ + mintNextAndAddAuthMethods: async ({ + keyType, + permittedAuthMethodTypes, + permittedAuthMethodIds, + permittedAuthMethodPubkeys, + permittedAuthMethodScopes, + addPkpEthAddressAsPermittedAddress, + sendPkpToItself, + gasLimit, + }) => { + const [pkpNftContract, pkpHelperContract] = await Promise.all([ + _LitContracts.getLitContract(this.network, 'PKPNFT'), + _LitContracts.getLitContract(this.network, 'PKPHelper'), + ]); + const mintCost = await pkpNftContract['mintCost'](); + const tx = await this._callWithAdjustedOverrides( + pkpHelperContract, + 'mintNextAndAddAuthMethods', + [ + keyType, + permittedAuthMethodTypes, + permittedAuthMethodIds, + permittedAuthMethodPubkeys, + permittedAuthMethodScopes, + addPkpEthAddressAsPermittedAddress, + sendPkpToItself, + ], + { value: mintCost, gasLimit } + ); + return tx; + }, + }, + }; + _getAdjustedGasLimit = async ( + contract, + method, + args, + overrides = {}, + gasLimitAdjustment = GAS_LIMIT_ADJUSTMENT + ) => { + const gasLimit = await contract.estimateGas[method](...args, overrides); + return gasLimit.mul(gasLimitAdjustment).div(100); + }; + async _callWithAdjustedOverrides( + contract, + method, + args, + overrides = {}, + gasLimitAdjustment = GAS_LIMIT_ADJUSTMENT + ) { + if (!(method in contract.functions)) { + throw new Error( + `Method ${String(method)} does not exist on the contract` + ); + } + const gasLimit = + overrides.gasLimit ?? + (await this._getAdjustedGasLimit( + contract, + method, + args, + overrides, + gasLimitAdjustment + )); + return contract.functions[method](...args, { + ...overrides, + gasLimit, + }); + } +}; +var LitContracts = _LitContracts; +__publicField(LitContracts, 'contractNames', [ + 'Allowlist', + 'Staking', + 'PubkeyRouter', + 'PKPHelper', + 'PKPPermissions', + 'PKPNFTMetadata', + 'PKPNFT', + 'Multisender', + 'LITToken', + 'PriceFeed', +]); +__publicField(LitContracts, 'logger', LogManager.Instance.get('contract-sdk')); +/** + * Retrieves the connection information for a given network. + * + * @param params + * @param params.litNetwork - The key representing the network. + * @param [params.networkContext] - Optional network context for the contract. + * @param [params.rpcUrl] - Optional RPC URL for the network. + * @param [params.nodeProtocol] - Optional protocol for the network node. + * + * @returns An object containing the staking contract, epoch number, minimum node count and an array of bootstrap URLs. + * + * @throws Error if the minimum validator count is not set or if the active validator set does not meet the threshold. + */ +__publicField( + LitContracts, + 'getConnectionInfo', + async ({ litNetwork, networkContext, rpcUrl, nodeProtocol, sortByPrice }) => { + const _sortByPrice = sortByPrice ?? true; + if (_sortByPrice) { + log('Sorting networks by price feed from lowest to highest'); + } else { + log('Not sorting networks by price feed'); + } + const stakingContract = await _LitContracts.getStakingContract( + litNetwork, + networkContext, + rpcUrl + ); + const [epochInfo, minNodeCount, activeUnkickedValidatorStructs] = + await stakingContract['getActiveUnkickedValidatorStructsAndCounts']( + REALM_ID + ); + const typedEpochInfo = { + epochLength: ethers_exports.BigNumber.from(epochInfo[0]).toNumber(), + number: ethers_exports.BigNumber.from(epochInfo[1]).toNumber(), + endTime: ethers_exports.BigNumber.from(epochInfo[2]).toNumber(), + retries: ethers_exports.BigNumber.from(epochInfo[3]).toNumber(), + timeout: ethers_exports.BigNumber.from(epochInfo[4]).toNumber(), + }; + const minNodeCountInt = + ethers_exports.BigNumber.from(minNodeCount).toNumber(); + if (!minNodeCountInt) { + throw new Error('\u274C Minimum validator count is not set'); + } + if (activeUnkickedValidatorStructs.length < minNodeCountInt) { + throw new Error( + `\u274C Active validator set does not meet the consensus. Required: ${minNodeCountInt} but got: ${activeUnkickedValidatorStructs.length}` + ); + } + const activeValidatorStructs = activeUnkickedValidatorStructs.map( + (item) => { + return { + ip: item[0], + ipv6: item[1], + port: item[2], + nodeAddress: item[3], + reward: item[4], + seconderPubkey: item[5], + receiverPubkey: item[6], + }; + } + ); + const unsortedNetworks = _LitContracts.generateValidatorURLs({ + activeValidatorStructs, + litNetwork, + }); + const priceFeedInfo = await _LitContracts.getPriceFeedInfo({ + realmId: REALM_ID, + litNetwork, + networkContext, + rpcUrl, + nodeProtocol, + }); + const PRICE_BY_NETWORK = priceFeedInfo.networkPrices.mapByAddress; + const sortedNetworks = unsortedNetworks.sort( + (a2, b) => PRICE_BY_NETWORK[a2] - PRICE_BY_NETWORK[b] + ); + const bootstrapUrls = _sortByPrice ? sortedNetworks : unsortedNetworks; + return { + stakingContract, + epochInfo: typedEpochInfo, + minNodeCount: minNodeCountInt, + bootstrapUrls, + priceByNetwork: PRICE_BY_NETWORK, + }; + } +); +/** + * Gets price feed information for nodes in the network. + * + * @param {Object} params - The parameters object + * @param {LIT_NETWORKS_KEYS} params.litNetwork - The Lit network to get price feed info for + * @param {LitContractContext | LitContractResolverContext} [params.networkContext] - Optional network context + * @param {string} [params.rpcUrl] - Optional RPC URL to use + * @param {number[]} [params.productIds] - Optional array of product IDs to get prices for. Defaults to [DECRYPTION, LA, SIGN] + * @param {typeof HTTP | typeof HTTPS | null} [params.nodeProtocol] - Optional node protocol to use + * + * @returns {Promise<{ + * epochId: number, + * minNodeCount: number, + * networkPrices: { + * arr: Array<{network: string, price: number}>, + * mapByAddress: Record + * } + * }>} + */ +__publicField( + LitContracts, + 'getPriceFeedInfo', + async ({ + realmId, + litNetwork, + networkContext, + rpcUrl, + productIds, + // Array of product IDs + }) => { + if (!productIds || productIds.length === 0) { + log('No product IDs provided. Defaulting to 0'); + productIds = [PRODUCT_IDS.DECRYPTION, PRODUCT_IDS.LA, PRODUCT_IDS.SIGN]; + } + productIds.forEach((productId) => { + if (!Object.values(PRODUCT_IDS).includes(productId)) { + throw new Error( + `\u274C Invalid product ID: ${productId}. We only accept ${Object.values( + PRODUCT_IDS + ).join(', ')}` + ); + } + }); + const priceFeedContract = await _LitContracts.getPriceFeedContract( + litNetwork, + networkContext, + rpcUrl + ); + const nodesForRequest = await priceFeedContract['getNodesForRequest']( + realmId, + productIds + ); + const epochId = nodesForRequest[0].toNumber(); + const minNodeCount = nodesForRequest[1].toNumber(); + const nodesAndPrices = nodesForRequest[2]; + const activeValidatorStructs = nodesAndPrices.map((item) => { + return { + ip: item.validator.ip, + ipv6: item.validator.ipv6, + port: item.validator.port, + nodeAddress: item.validator.nodeAddress, + reward: item.validator.reward, + seconderPubkey: item.validator.seconderPubkey, + receiverPubkey: item.validator.receiverPubkey, + }; + }); + const networks2 = _LitContracts.generateValidatorURLs({ + activeValidatorStructs, + litNetwork, + }); + console.log('networks:', networks2); + const prices = nodesAndPrices.flatMap((item) => { + return item.prices.map((price) => parseFloat(price.toString())); + }); + console.log('Prices as numbers:', prices); + const networkPriceMap = networks2.reduce((acc, network, index) => { + acc[network] = prices[index]; + return acc; + }, {}); + console.log('Network to Price Map:', networkPriceMap); + const networkPriceObjArr = networks2.map((network, index) => { + return { + network, + // The key will be the network URL + price: prices[index], + // The value will be the corresponding price + }; + }); + return { + epochId, + minNodeCount, + networkPrices: { + arr: networkPriceObjArr, + mapByAddress: networkPriceMap, + }, + }; + } +); + +// packages/contracts-sdk/src/lib/utils.ts +init_shim(); + +// packages/core/src/index.ts +init_shim(); + +// packages/core/src/lib/lit-core.ts +init_shim(); + +// packages/crypto/src/index.ts +init_shim(); + +// packages/crypto/src/lib/crypto.ts +init_shim(); +var import_utils11 = __toESM(require_utils2()); + +// packages/nacl/src/index.ts +init_shim(); + +// packages/nacl/src/lib/nacl.ts +init_shim(); +var u64 = function (h, l2) { + this.hi = h | (0 >>> 0); + this.lo = l2 | (0 >>> 0); +}; +var gf = function (init2) { + var i2, + r3 = new Float64Array(16); + if (init2) for (i2 = 0; i2 < init2.length; i2++) r3[i2] = init2[i2]; + return r3; +}; +var randombytes = function () { + throw new Error('no PRNG'); +}; +var _0 = new Uint8Array(16); +var _9 = new Uint8Array(32); +_9[0] = 9; +var gf0 = gf(); +var gf1 = gf([1]); +var _121665 = gf([56129, 1]); +var D = gf([ + 30883, 4953, 19914, 30187, 55467, 16705, 2637, 112, 59544, 30585, 16505, + 36039, 65139, 11119, 27886, 20995, +]); +var D2 = gf([ + 61785, 9906, 39828, 60374, 45398, 33411, 5274, 224, 53552, 61171, 33010, 6542, + 64743, 22239, 55772, 9222, +]); +var X = gf([ + 54554, 36645, 11616, 51542, 42930, 38181, 51040, 26924, 56412, 64982, 57905, + 49316, 21502, 52590, 14035, 8553, +]); +var Y = gf([ + 26200, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, + 26214, 26214, 26214, 26214, 26214, +]); +var I = gf([ + 41136, 18958, 6951, 50414, 58488, 44335, 6150, 12099, 55207, 15867, 153, + 11085, 57099, 20417, 9344, 11139, +]); +function L32(x, c) { + return (x << c) | (x >>> (32 - c)); +} +function ld32(x, i2) { + var u = x[i2 + 3] & 255; + u = (u << 8) | (x[i2 + 2] & 255); + u = (u << 8) | (x[i2 + 1] & 255); + return (u << 8) | (x[i2 + 0] & 255); +} +function dl64(x, i2) { + var h = (x[i2] << 24) | (x[i2 + 1] << 16) | (x[i2 + 2] << 8) | x[i2 + 3]; + var l2 = (x[i2 + 4] << 24) | (x[i2 + 5] << 16) | (x[i2 + 6] << 8) | x[i2 + 7]; + return new u64(h, l2); +} +function st32(x, j, u) { + var i2; + for (i2 = 0; i2 < 4; i2++) { + x[j + i2] = u & 255; + u >>>= 8; + } +} +function ts64(x, i2, u) { + x[i2] = (u.hi >> 24) & 255; + x[i2 + 1] = (u.hi >> 16) & 255; + x[i2 + 2] = (u.hi >> 8) & 255; + x[i2 + 3] = u.hi & 255; + x[i2 + 4] = (u.lo >> 24) & 255; + x[i2 + 5] = (u.lo >> 16) & 255; + x[i2 + 6] = (u.lo >> 8) & 255; + x[i2 + 7] = u.lo & 255; +} +function vn(x, xi, y, yi, n2) { + var i2, + d = 0; + for (i2 = 0; i2 < n2; i2++) d |= x[xi + i2] ^ y[yi + i2]; + return (1 & ((d - 1) >>> 8)) - 1; +} +function crypto_verify_16(x, xi, y, yi) { + return vn(x, xi, y, yi, 16); +} +function crypto_verify_32(x, xi, y, yi) { + return vn(x, xi, y, yi, 32); +} +function core(out, inp, k, c, h) { + var w = new Uint32Array(16), + x = new Uint32Array(16), + y = new Uint32Array(16), + t2 = new Uint32Array(4); + var i2, j, m; + for (i2 = 0; i2 < 4; i2++) { + x[5 * i2] = ld32(c, 4 * i2); + x[1 + i2] = ld32(k, 4 * i2); + x[6 + i2] = ld32(inp, 4 * i2); + x[11 + i2] = ld32(k, 16 + 4 * i2); + } + for (i2 = 0; i2 < 16; i2++) y[i2] = x[i2]; + for (i2 = 0; i2 < 20; i2++) { + for (j = 0; j < 4; j++) { + for (m = 0; m < 4; m++) t2[m] = x[(5 * j + 4 * m) % 16]; + t2[1] ^= L32((t2[0] + t2[3]) | 0, 7); + t2[2] ^= L32((t2[1] + t2[0]) | 0, 9); + t2[3] ^= L32((t2[2] + t2[1]) | 0, 13); + t2[0] ^= L32((t2[3] + t2[2]) | 0, 18); + for (m = 0; m < 4; m++) w[4 * j + ((j + m) % 4)] = t2[m]; + } + for (m = 0; m < 16; m++) x[m] = w[m]; + } + if (h) { + for (i2 = 0; i2 < 16; i2++) x[i2] = (x[i2] + y[i2]) | 0; + for (i2 = 0; i2 < 4; i2++) { + x[5 * i2] = (x[5 * i2] - ld32(c, 4 * i2)) | 0; + x[6 + i2] = (x[6 + i2] - ld32(inp, 4 * i2)) | 0; + } + for (i2 = 0; i2 < 4; i2++) { + st32(out, 4 * i2, x[5 * i2]); + st32(out, 16 + 4 * i2, x[6 + i2]); + } + } else { + for (i2 = 0; i2 < 16; i2++) st32(out, 4 * i2, (x[i2] + y[i2]) | 0); + } +} +function crypto_core_salsa20(out, inp, k, c) { + core(out, inp, k, c, false); + return 0; +} +function crypto_core_hsalsa20(out, inp, k, c) { + core(out, inp, k, c, true); + return 0; +} +var sigma = new Uint8Array([ + 101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107, +]); +function crypto_stream_salsa20_xor(c, cpos, m, mpos, b, n2, k) { + var z = new Uint8Array(16), + x = new Uint8Array(64); + var u, i2; + if (!b) return 0; + for (i2 = 0; i2 < 16; i2++) z[i2] = 0; + for (i2 = 0; i2 < 8; i2++) z[i2] = n2[i2]; + while (b >= 64) { + crypto_core_salsa20(x, z, k, sigma); + for (i2 = 0; i2 < 64; i2++) c[cpos + i2] = (m ? m[mpos + i2] : 0) ^ x[i2]; + u = 1; + for (i2 = 8; i2 < 16; i2++) { + u = (u + (z[i2] & 255)) | 0; + z[i2] = u & 255; + u >>>= 8; + } + b -= 64; + cpos += 64; + if (m) mpos += 64; + } + if (b > 0) { + crypto_core_salsa20(x, z, k, sigma); + for (i2 = 0; i2 < b; i2++) c[cpos + i2] = (m ? m[mpos + i2] : 0) ^ x[i2]; + } + return 0; +} +function crypto_stream_salsa20(c, cpos, d, n2, k) { + return crypto_stream_salsa20_xor(c, cpos, null, 0, d, n2, k); +} +function crypto_stream(c, cpos, d, n2, k) { + var s2 = new Uint8Array(32); + crypto_core_hsalsa20(s2, n2, k, sigma); + return crypto_stream_salsa20(c, cpos, d, n2.subarray(16), s2); +} +function crypto_stream_xor(c, cpos, m, mpos, d, n2, k) { + var s2 = new Uint8Array(32); + crypto_core_hsalsa20(s2, n2, k, sigma); + return crypto_stream_salsa20_xor(c, cpos, m, mpos, d, n2.subarray(16), s2); +} +function add1305(h, c) { + var j, + u = 0; + for (j = 0; j < 17; j++) { + u = (u + ((h[j] + c[j]) | 0)) | 0; + h[j] = u & 255; + u >>>= 8; + } +} +var minusp = new Uint32Array([ + 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 252, +]); +function crypto_onetimeauth(out, outpos, m, mpos, n2, k) { + var s2, i2, j, u; + var x = new Uint32Array(17), + r3 = new Uint32Array(17), + h = new Uint32Array(17), + c = new Uint32Array(17), + g = new Uint32Array(17); + for (j = 0; j < 17; j++) r3[j] = h[j] = 0; + for (j = 0; j < 16; j++) r3[j] = k[j]; + r3[3] &= 15; + r3[4] &= 252; + r3[7] &= 15; + r3[8] &= 252; + r3[11] &= 15; + r3[12] &= 252; + r3[15] &= 15; + while (n2 > 0) { + for (j = 0; j < 17; j++) c[j] = 0; + for (j = 0; j < 16 && j < n2; ++j) c[j] = m[mpos + j]; + c[j] = 1; + mpos += j; + n2 -= j; + add1305(h, c); + for (i2 = 0; i2 < 17; i2++) { + x[i2] = 0; + for (j = 0; j < 17; j++) + x[i2] = + (x[i2] + + h[j] * (j <= i2 ? r3[i2 - j] : (320 * r3[i2 + 17 - j]) | 0)) | + 0 | + 0; + } + for (i2 = 0; i2 < 17; i2++) h[i2] = x[i2]; + u = 0; + for (j = 0; j < 16; j++) { + u = (u + h[j]) | 0; + h[j] = u & 255; + u >>>= 8; + } + u = (u + h[16]) | 0; + h[16] = u & 3; + u = (5 * (u >>> 2)) | 0; + for (j = 0; j < 16; j++) { + u = (u + h[j]) | 0; + h[j] = u & 255; + u >>>= 8; + } + u = (u + h[16]) | 0; + h[16] = u; + } + for (j = 0; j < 17; j++) g[j] = h[j]; + add1305(h, minusp); + s2 = -(h[16] >>> 7) | 0; + for (j = 0; j < 17; j++) h[j] ^= s2 & (g[j] ^ h[j]); + for (j = 0; j < 16; j++) c[j] = k[j + 16]; + c[16] = 0; + add1305(h, c); + for (j = 0; j < 16; j++) out[outpos + j] = h[j]; + return 0; +} +function crypto_onetimeauth_verify(h, hpos, m, mpos, n2, k) { + var x = new Uint8Array(16); + crypto_onetimeauth(x, 0, m, mpos, n2, k); + return crypto_verify_16(h, hpos, x, 0); +} +function crypto_secretbox(c, m, d, n2, k) { + var i2; + if (d < 32) return -1; + crypto_stream_xor(c, 0, m, 0, d, n2, k); + crypto_onetimeauth(c, 16, c, 32, d - 32, c); + for (i2 = 0; i2 < 16; i2++) c[i2] = 0; + return 0; +} +function crypto_secretbox_open(m, c, d, n2, k) { + var i2; + var x = new Uint8Array(32); + if (d < 32) return -1; + crypto_stream(x, 0, 32, n2, k); + if (crypto_onetimeauth_verify(c, 16, c, 32, d - 32, x) !== 0) return -1; + crypto_stream_xor(m, 0, c, 0, d, n2, k); + for (i2 = 0; i2 < 32; i2++) m[i2] = 0; + return 0; +} +function set25519(r3, a2) { + var i2; + for (i2 = 0; i2 < 16; i2++) r3[i2] = a2[i2] | 0; +} +function car25519(o2) { + var c; + var i2; + for (i2 = 0; i2 < 16; i2++) { + o2[i2] += 65536; + c = Math.floor(o2[i2] / 65536); + o2[(i2 + 1) * (i2 < 15 ? 1 : 0)] += + c - 1 + 37 * (c - 1) * (i2 === 15 ? 1 : 0); + o2[i2] -= c * 65536; + } +} +function sel25519(p, q, b) { + var t2, + c = ~(b - 1); + for (var i2 = 0; i2 < 16; i2++) { + t2 = c & (p[i2] ^ q[i2]); + p[i2] ^= t2; + q[i2] ^= t2; + } +} +function pack25519(o2, n2) { + var i2, j, b; + var m = gf(), + t2 = gf(); + for (i2 = 0; i2 < 16; i2++) t2[i2] = n2[i2]; + car25519(t2); + car25519(t2); + car25519(t2); + for (j = 0; j < 2; j++) { + m[0] = t2[0] - 65517; + for (i2 = 1; i2 < 15; i2++) { + m[i2] = t2[i2] - 65535 - ((m[i2 - 1] >> 16) & 1); + m[i2 - 1] &= 65535; + } + m[15] = t2[15] - 32767 - ((m[14] >> 16) & 1); + b = (m[15] >> 16) & 1; + m[14] &= 65535; + sel25519(t2, m, 1 - b); + } + for (i2 = 0; i2 < 16; i2++) { + o2[2 * i2] = t2[i2] & 255; + o2[2 * i2 + 1] = t2[i2] >> 8; + } +} +function neq25519(a2, b) { + var c = new Uint8Array(32), + d = new Uint8Array(32); + pack25519(c, a2); + pack25519(d, b); + return crypto_verify_32(c, 0, d, 0); +} +function par25519(a2) { + var d = new Uint8Array(32); + pack25519(d, a2); + return d[0] & 1; +} +function unpack25519(o2, n2) { + var i2; + for (i2 = 0; i2 < 16; i2++) o2[i2] = n2[2 * i2] + (n2[2 * i2 + 1] << 8); + o2[15] &= 32767; +} +function A(o2, a2, b) { + var i2; + for (i2 = 0; i2 < 16; i2++) o2[i2] = (a2[i2] + b[i2]) | 0; +} +function Z(o2, a2, b) { + var i2; + for (i2 = 0; i2 < 16; i2++) o2[i2] = (a2[i2] - b[i2]) | 0; +} +function M(o2, a2, b) { + var i2, + j, + t2 = new Float64Array(31); + for (i2 = 0; i2 < 31; i2++) t2[i2] = 0; + for (i2 = 0; i2 < 16; i2++) { + for (j = 0; j < 16; j++) { + t2[i2 + j] += a2[i2] * b[j]; + } + } + for (i2 = 0; i2 < 15; i2++) { + t2[i2] += 38 * t2[i2 + 16]; + } + for (i2 = 0; i2 < 16; i2++) o2[i2] = t2[i2]; + car25519(o2); + car25519(o2); +} +function S(o2, a2) { + M(o2, a2, a2); +} +function inv25519(o2, i2) { + var c = gf(); + var a2; + for (a2 = 0; a2 < 16; a2++) c[a2] = i2[a2]; + for (a2 = 253; a2 >= 0; a2--) { + S(c, c); + if (a2 !== 2 && a2 !== 4) M(c, c, i2); + } + for (a2 = 0; a2 < 16; a2++) o2[a2] = c[a2]; +} +function pow2523(o2, i2) { + var c = gf(); + var a2; + for (a2 = 0; a2 < 16; a2++) c[a2] = i2[a2]; + for (a2 = 250; a2 >= 0; a2--) { + S(c, c); + if (a2 !== 1) M(c, c, i2); + } + for (a2 = 0; a2 < 16; a2++) o2[a2] = c[a2]; +} +function crypto_scalarmult(q, n2, p) { + var z = new Uint8Array(32); + var x = new Float64Array(80), + r3, + i2; + var a2 = gf(), + b = gf(), + c = gf(), + d = gf(), + e2 = gf(), + f = gf(); + for (i2 = 0; i2 < 31; i2++) z[i2] = n2[i2]; + z[31] = (n2[31] & 127) | 64; + z[0] &= 248; + unpack25519(x, p); + for (i2 = 0; i2 < 16; i2++) { + b[i2] = x[i2]; + d[i2] = a2[i2] = c[i2] = 0; + } + a2[0] = d[0] = 1; + for (i2 = 254; i2 >= 0; --i2) { + r3 = (z[i2 >>> 3] >>> (i2 & 7)) & 1; + sel25519(a2, b, r3); + sel25519(c, d, r3); + A(e2, a2, c); + Z(a2, a2, c); + A(c, b, d); + Z(b, b, d); + S(d, e2); + S(f, a2); + M(a2, c, a2); + M(c, b, e2); + A(e2, a2, c); + Z(a2, a2, c); + S(b, a2); + Z(c, d, f); + M(a2, c, _121665); + A(a2, a2, d); + M(c, c, a2); + M(a2, d, f); + M(d, b, x); + S(b, e2); + sel25519(a2, b, r3); + sel25519(c, d, r3); + } + for (i2 = 0; i2 < 16; i2++) { + x[i2 + 16] = a2[i2]; + x[i2 + 32] = c[i2]; + x[i2 + 48] = b[i2]; + x[i2 + 64] = d[i2]; + } + var x32 = x.subarray(32); + var x16 = x.subarray(16); + inv25519(x32, x32); + M(x16, x16, x32); + pack25519(q, x16); + return 0; +} +function crypto_scalarmult_base(q, n2) { + return crypto_scalarmult(q, n2, _9); +} +function crypto_box_keypair(y, x) { + randombytes(x, 32); + return crypto_scalarmult_base(y, x); +} +function crypto_box_beforenm(k, y, x) { + var s2 = new Uint8Array(32); + crypto_scalarmult(s2, x, y); + return crypto_core_hsalsa20(k, _0, s2, sigma); +} +var crypto_box_afternm = crypto_secretbox; +var crypto_box_open_afternm = crypto_secretbox_open; +function crypto_box(c, m, d, n2, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_afternm(c, m, d, n2, k); +} +function crypto_box_open(m, c, d, n2, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_open_afternm(m, c, d, n2, k); +} +function add64() { + var a2 = 0, + b = 0, + c = 0, + d = 0, + m16 = 65535, + l2, + h, + i2; + for (i2 = 0; i2 < arguments.length; i2++) { + l2 = arguments[i2].lo; + h = arguments[i2].hi; + a2 += l2 & m16; + b += l2 >>> 16; + c += h & m16; + d += h >>> 16; + } + b += a2 >>> 16; + c += b >>> 16; + d += c >>> 16; + return new u64((c & m16) | (d << 16), (a2 & m16) | (b << 16)); +} +function shr64(x, c) { + return new u64(x.hi >>> c, (x.lo >>> c) | (x.hi << (32 - c))); +} +function xor64() { + var l2 = 0, + h = 0, + i2; + for (i2 = 0; i2 < arguments.length; i2++) { + l2 ^= arguments[i2].lo; + h ^= arguments[i2].hi; + } + return new u64(h, l2); +} +function R(x, c) { + var h, + l2, + c1 = 32 - c; + if (c < 32) { + h = (x.hi >>> c) | (x.lo << c1); + l2 = (x.lo >>> c) | (x.hi << c1); + } else if (c < 64) { + h = (x.lo >>> c) | (x.hi << c1); + l2 = (x.hi >>> c) | (x.lo << c1); + } + return new u64(h, l2); +} +function Ch(x, y, z) { + var h = (x.hi & y.hi) ^ (~x.hi & z.hi), + l2 = (x.lo & y.lo) ^ (~x.lo & z.lo); + return new u64(h, l2); +} +function Maj(x, y, z) { + var h = (x.hi & y.hi) ^ (x.hi & z.hi) ^ (y.hi & z.hi), + l2 = (x.lo & y.lo) ^ (x.lo & z.lo) ^ (y.lo & z.lo); + return new u64(h, l2); +} +function Sigma0(x) { + return xor64(R(x, 28), R(x, 34), R(x, 39)); +} +function Sigma1(x) { + return xor64(R(x, 14), R(x, 18), R(x, 41)); +} +function sigma0(x) { + return xor64(R(x, 1), R(x, 8), shr64(x, 7)); +} +function sigma1(x) { + return xor64(R(x, 19), R(x, 61), shr64(x, 6)); +} +var K = [ + new u64(1116352408, 3609767458), + new u64(1899447441, 602891725), + new u64(3049323471, 3964484399), + new u64(3921009573, 2173295548), + new u64(961987163, 4081628472), + new u64(1508970993, 3053834265), + new u64(2453635748, 2937671579), + new u64(2870763221, 3664609560), + new u64(3624381080, 2734883394), + new u64(310598401, 1164996542), + new u64(607225278, 1323610764), + new u64(1426881987, 3590304994), + new u64(1925078388, 4068182383), + new u64(2162078206, 991336113), + new u64(2614888103, 633803317), + new u64(3248222580, 3479774868), + new u64(3835390401, 2666613458), + new u64(4022224774, 944711139), + new u64(264347078, 2341262773), + new u64(604807628, 2007800933), + new u64(770255983, 1495990901), + new u64(1249150122, 1856431235), + new u64(1555081692, 3175218132), + new u64(1996064986, 2198950837), + new u64(2554220882, 3999719339), + new u64(2821834349, 766784016), + new u64(2952996808, 2566594879), + new u64(3210313671, 3203337956), + new u64(3336571891, 1034457026), + new u64(3584528711, 2466948901), + new u64(113926993, 3758326383), + new u64(338241895, 168717936), + new u64(666307205, 1188179964), + new u64(773529912, 1546045734), + new u64(1294757372, 1522805485), + new u64(1396182291, 2643833823), + new u64(1695183700, 2343527390), + new u64(1986661051, 1014477480), + new u64(2177026350, 1206759142), + new u64(2456956037, 344077627), + new u64(2730485921, 1290863460), + new u64(2820302411, 3158454273), + new u64(3259730800, 3505952657), + new u64(3345764771, 106217008), + new u64(3516065817, 3606008344), + new u64(3600352804, 1432725776), + new u64(4094571909, 1467031594), + new u64(275423344, 851169720), + new u64(430227734, 3100823752), + new u64(506948616, 1363258195), + new u64(659060556, 3750685593), + new u64(883997877, 3785050280), + new u64(958139571, 3318307427), + new u64(1322822218, 3812723403), + new u64(1537002063, 2003034995), + new u64(1747873779, 3602036899), + new u64(1955562222, 1575990012), + new u64(2024104815, 1125592928), + new u64(2227730452, 2716904306), + new u64(2361852424, 442776044), + new u64(2428436474, 593698344), + new u64(2756734187, 3733110249), + new u64(3204031479, 2999351573), + new u64(3329325298, 3815920427), + new u64(3391569614, 3928383900), + new u64(3515267271, 566280711), + new u64(3940187606, 3454069534), + new u64(4118630271, 4000239992), + new u64(116418474, 1914138554), + new u64(174292421, 2731055270), + new u64(289380356, 3203993006), + new u64(460393269, 320620315), + new u64(685471733, 587496836), + new u64(852142971, 1086792851), + new u64(1017036298, 365543100), + new u64(1126000580, 2618297676), + new u64(1288033470, 3409855158), + new u64(1501505948, 4234509866), + new u64(1607167915, 987167468), + new u64(1816402316, 1246189591), +]; +function crypto_hashblocks(x, m, n2) { + var z = [], + b = [], + a2 = [], + w = [], + t2, + i2, + j; + for (i2 = 0; i2 < 8; i2++) z[i2] = a2[i2] = dl64(x, 8 * i2); + var pos = 0; + while (n2 >= 128) { + for (i2 = 0; i2 < 16; i2++) w[i2] = dl64(m, 8 * i2 + pos); + for (i2 = 0; i2 < 80; i2++) { + for (j = 0; j < 8; j++) b[j] = a2[j]; + t2 = add64( + a2[7], + Sigma1(a2[4]), + Ch(a2[4], a2[5], a2[6]), + K[i2], + w[i2 % 16] + ); + b[7] = add64(t2, Sigma0(a2[0]), Maj(a2[0], a2[1], a2[2])); + b[3] = add64(b[3], t2); + for (j = 0; j < 8; j++) a2[(j + 1) % 8] = b[j]; + if (i2 % 16 === 15) { + for (j = 0; j < 16; j++) { + w[j] = add64( + w[j], + w[(j + 9) % 16], + sigma0(w[(j + 1) % 16]), + sigma1(w[(j + 14) % 16]) + ); + } + } + } + for (i2 = 0; i2 < 8; i2++) { + a2[i2] = add64(a2[i2], z[i2]); + z[i2] = a2[i2]; + } + pos += 128; + n2 -= 128; + } + for (i2 = 0; i2 < 8; i2++) ts64(x, 8 * i2, z[i2]); + return n2; +} +var iv = new Uint8Array([ + 106, 9, 230, 103, 243, 188, 201, 8, 187, 103, 174, 133, 132, 202, 167, 59, 60, + 110, 243, 114, 254, 148, 248, 43, 165, 79, 245, 58, 95, 29, 54, 241, 81, 14, + 82, 127, 173, 230, 130, 209, 155, 5, 104, 140, 43, 62, 108, 31, 31, 131, 217, + 171, 251, 65, 189, 107, 91, 224, 205, 25, 19, 126, 33, 121, +]); +function crypto_hash(out, m, n2) { + var h = new Uint8Array(64), + x = new Uint8Array(256); + var i2, + b = n2; + for (i2 = 0; i2 < 64; i2++) h[i2] = iv[i2]; + crypto_hashblocks(h, m, n2); + n2 %= 128; + for (i2 = 0; i2 < 256; i2++) x[i2] = 0; + for (i2 = 0; i2 < n2; i2++) x[i2] = m[b - n2 + i2]; + x[n2] = 128; + n2 = 256 - 128 * (n2 < 112 ? 1 : 0); + x[n2 - 9] = 0; + ts64(x, n2 - 8, new u64((b / 536870912) | 0, b << 3)); + crypto_hashblocks(h, x, n2); + for (i2 = 0; i2 < 64; i2++) out[i2] = h[i2]; + return 0; +} +function add4(p, q) { + var a2 = gf(), + b = gf(), + c = gf(), + d = gf(), + e2 = gf(), + f = gf(), + g = gf(), + h = gf(), + t2 = gf(); + Z(a2, p[1], p[0]); + Z(t2, q[1], q[0]); + M(a2, a2, t2); + A(b, p[0], p[1]); + A(t2, q[0], q[1]); + M(b, b, t2); + M(c, p[3], q[3]); + M(c, c, D2); + M(d, p[2], q[2]); + A(d, d, d); + Z(e2, b, a2); + Z(f, d, c); + A(g, d, c); + A(h, b, a2); + M(p[0], e2, f); + M(p[1], h, g); + M(p[2], g, f); + M(p[3], e2, h); +} +function cswap(p, q, b) { + var i2; + for (i2 = 0; i2 < 4; i2++) { + sel25519(p[i2], q[i2], b); + } +} +function pack3(r3, p) { + var tx = gf(), + ty = gf(), + zi = gf(); + inv25519(zi, p[2]); + M(tx, p[0], zi); + M(ty, p[1], zi); + pack25519(r3, ty); + r3[31] ^= par25519(tx) << 7; +} +function scalarmult(p, q, s2) { + var b, i2; + set25519(p[0], gf0); + set25519(p[1], gf1); + set25519(p[2], gf1); + set25519(p[3], gf0); + for (i2 = 255; i2 >= 0; --i2) { + b = (s2[(i2 / 8) | 0] >> (i2 & 7)) & 1; + cswap(p, q, b); + add4(q, p); + add4(p, p); + cswap(p, q, b); + } +} +function scalarbase(p, s2) { + var q = [gf(), gf(), gf(), gf()]; + set25519(q[0], X); + set25519(q[1], Y); + set25519(q[2], gf1); + M(q[3], X, Y); + scalarmult(p, q, s2); +} +function crypto_sign_keypair(pk, sk, seeded) { + var d = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()]; + var i2; + if (!seeded) randombytes(sk, 32); + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + scalarbase(p, d); + pack3(pk, p); + for (i2 = 0; i2 < 32; i2++) sk[i2 + 32] = pk[i2]; + return 0; +} +var L = new Float64Array([ + 237, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, +]); +function modL(r3, x) { + var carry, i2, j, k; + for (i2 = 63; i2 >= 32; --i2) { + carry = 0; + for (j = i2 - 32, k = i2 - 12; j < k; ++j) { + x[j] += carry - 16 * x[i2] * L[j - (i2 - 32)]; + carry = Math.floor((x[j] + 128) / 256); + x[j] -= carry * 256; + } + x[j] += carry; + x[i2] = 0; + } + carry = 0; + for (j = 0; j < 32; j++) { + x[j] += carry - (x[31] >> 4) * L[j]; + carry = x[j] >> 8; + x[j] &= 255; + } + for (j = 0; j < 32; j++) x[j] -= carry * L[j]; + for (i2 = 0; i2 < 32; i2++) { + x[i2 + 1] += x[i2] >> 8; + r3[i2] = x[i2] & 255; + } +} +function reduce(r3) { + var x = new Float64Array(64), + i2; + for (i2 = 0; i2 < 64; i2++) x[i2] = r3[i2]; + for (i2 = 0; i2 < 64; i2++) r3[i2] = 0; + modL(r3, x); +} +function crypto_sign(sm, m, n2, sk) { + var d = new Uint8Array(64), + h = new Uint8Array(64), + r3 = new Uint8Array(64); + var i2, + j, + x = new Float64Array(64); + var p = [gf(), gf(), gf(), gf()]; + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + var smlen = n2 + 64; + for (i2 = 0; i2 < n2; i2++) sm[64 + i2] = m[i2]; + for (i2 = 0; i2 < 32; i2++) sm[32 + i2] = d[32 + i2]; + crypto_hash(r3, sm.subarray(32), n2 + 32); + reduce(r3); + scalarbase(p, r3); + pack3(sm, p); + for (i2 = 32; i2 < 64; i2++) sm[i2] = sk[i2]; + crypto_hash(h, sm, n2 + 64); + reduce(h); + for (i2 = 0; i2 < 64; i2++) x[i2] = 0; + for (i2 = 0; i2 < 32; i2++) x[i2] = r3[i2]; + for (i2 = 0; i2 < 32; i2++) { + for (j = 0; j < 32; j++) { + x[i2 + j] += h[i2] * d[j]; + } + } + modL(sm.subarray(32), x); + return smlen; +} +function unpackneg(r3, p) { + var t2 = gf(), + chk = gf(), + num = gf(), + den = gf(), + den2 = gf(), + den4 = gf(), + den6 = gf(); + set25519(r3[2], gf1); + unpack25519(r3[1], p); + S(num, r3[1]); + M(den, num, D); + Z(num, num, r3[2]); + A(den, r3[2], den); + S(den2, den); + S(den4, den2); + M(den6, den4, den2); + M(t2, den6, num); + M(t2, t2, den); + pow2523(t2, t2); + M(t2, t2, num); + M(t2, t2, den); + M(t2, t2, den); + M(r3[0], t2, den); + S(chk, r3[0]); + M(chk, chk, den); + if (neq25519(chk, num)) M(r3[0], r3[0], I); + S(chk, r3[0]); + M(chk, chk, den); + if (neq25519(chk, num)) return -1; + if (par25519(r3[0]) === p[31] >> 7) Z(r3[0], gf0, r3[0]); + M(r3[3], r3[0], r3[1]); + return 0; +} +function crypto_sign_open(m, sm, n2, pk) { + var i2; + var t2 = new Uint8Array(32), + h = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()], + q = [gf(), gf(), gf(), gf()]; + if (n2 < 64) return -1; + if (unpackneg(q, pk)) return -1; + for (i2 = 0; i2 < n2; i2++) m[i2] = sm[i2]; + for (i2 = 0; i2 < 32; i2++) m[i2 + 32] = pk[i2]; + crypto_hash(h, m, n2); + reduce(h); + scalarmult(p, q, h); + scalarbase(q, sm.subarray(32)); + add4(p, q); + pack3(t2, p); + n2 -= 64; + if (crypto_verify_32(sm, 0, t2, 0)) { + for (i2 = 0; i2 < n2; i2++) m[i2] = 0; + return -1; + } + for (i2 = 0; i2 < n2; i2++) m[i2] = sm[i2 + 64]; + return n2; +} +var crypto_secretbox_KEYBYTES = 32; +var crypto_secretbox_NONCEBYTES = 24; +var crypto_secretbox_ZEROBYTES = 32; +var crypto_secretbox_BOXZEROBYTES = 16; +var crypto_scalarmult_BYTES = 32; +var crypto_scalarmult_SCALARBYTES = 32; +var crypto_box_PUBLICKEYBYTES = 32; +var crypto_box_SECRETKEYBYTES = 32; +var crypto_box_BEFORENMBYTES = 32; +var crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES; +var crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES; +var crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES; +var crypto_sign_BYTES = 64; +var crypto_sign_PUBLICKEYBYTES = 32; +var crypto_sign_SECRETKEYBYTES = 64; +var crypto_sign_SEEDBYTES = 32; +var crypto_hash_BYTES = 64; +var _nacl = { + lowlevel: {}, +}; +_nacl.lowlevel = { + crypto_core_hsalsa20, + crypto_stream_xor, + crypto_stream, + crypto_stream_salsa20_xor, + crypto_stream_salsa20, + crypto_onetimeauth, + crypto_onetimeauth_verify, + crypto_verify_16, + crypto_verify_32, + crypto_secretbox, + crypto_secretbox_open, + crypto_scalarmult, + crypto_scalarmult_base, + crypto_box_beforenm, + crypto_box_afternm, + crypto_box, + crypto_box_open, + crypto_box_keypair, + crypto_hash, + crypto_sign, + crypto_sign_keypair, + crypto_sign_open, + crypto_secretbox_KEYBYTES, + crypto_secretbox_NONCEBYTES, + crypto_secretbox_ZEROBYTES, + crypto_secretbox_BOXZEROBYTES, + crypto_scalarmult_BYTES, + crypto_scalarmult_SCALARBYTES, + crypto_box_PUBLICKEYBYTES, + crypto_box_SECRETKEYBYTES, + crypto_box_BEFORENMBYTES, + crypto_box_NONCEBYTES, + crypto_box_ZEROBYTES, + crypto_box_BOXZEROBYTES, + crypto_sign_BYTES, + crypto_sign_PUBLICKEYBYTES, + crypto_sign_SECRETKEYBYTES, + crypto_sign_SEEDBYTES, + crypto_hash_BYTES, + gf, + D, + L, + pack25519, + unpack25519, + M, + A, + S, + Z, + pow2523, + add: add4, + set25519, + modL, + scalarmult, + scalarbase, +}; +function checkLengths(k, n2) { + if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size'); + if (n2.length !== crypto_secretbox_NONCEBYTES) + throw new Error('bad nonce size'); +} +function checkBoxLengths(pk, sk) { + if (pk.length !== crypto_box_PUBLICKEYBYTES) + throw new Error('bad public key size'); + if (sk.length !== crypto_box_SECRETKEYBYTES) + throw new Error('bad secret key size'); +} +function checkArrayTypes() { + for (var i2 = 0; i2 < arguments.length; i2++) { + if (!(arguments[i2] instanceof Uint8Array)) + throw new TypeError('unexpected type, use Uint8Array'); + } +} +function cleanup(arr) { + for (var i2 = 0; i2 < arr.length; i2++) arr[i2] = 0; +} +_nacl.randomBytes = function (n2) { + var b = new Uint8Array(n2); + randombytes(b, n2); + return b; +}; +_nacl.secretbox = function (msg, nonce, key2) { + checkArrayTypes(msg, nonce, key2); + checkLengths(key2, nonce); + var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length); + var c = new Uint8Array(m.length); + for (var i2 = 0; i2 < msg.length; i2++) + m[i2 + crypto_secretbox_ZEROBYTES] = msg[i2]; + crypto_secretbox(c, m, m.length, nonce, key2); + return c.subarray(crypto_secretbox_BOXZEROBYTES); +}; +_nacl.secretbox.open = function (box2, nonce, key2) { + checkArrayTypes(box2, nonce, key2); + checkLengths(key2, nonce); + var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box2.length); + var m = new Uint8Array(c.length); + for (var i2 = 0; i2 < box2.length; i2++) + c[i2 + crypto_secretbox_BOXZEROBYTES] = box2[i2]; + if (c.length < 32) return null; + if (crypto_secretbox_open(m, c, c.length, nonce, key2) !== 0) return null; + return m.subarray(crypto_secretbox_ZEROBYTES); +}; +_nacl.secretbox.keyLength = crypto_secretbox_KEYBYTES; +_nacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES; +_nacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES; +_nacl.scalarMult = function (n2, p) { + checkArrayTypes(n2, p); + if (n2.length !== crypto_scalarmult_SCALARBYTES) + throw new Error('bad n size'); + if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size'); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult(q, n2, p); + return q; +}; +_nacl.scalarMult.base = function (n2) { + checkArrayTypes(n2); + if (n2.length !== crypto_scalarmult_SCALARBYTES) + throw new Error('bad n size'); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult_base(q, n2); + return q; +}; +_nacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES; +_nacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES; +_nacl.box = function (msg, nonce, publicKey, secretKey) { + var k = _nacl.box.before(publicKey, secretKey); + return _nacl.secretbox(msg, nonce, k); +}; +_nacl.box.before = function (publicKey, secretKey) { + checkArrayTypes(publicKey, secretKey); + checkBoxLengths(publicKey, secretKey); + var k = new Uint8Array(crypto_box_BEFORENMBYTES); + crypto_box_beforenm(k, publicKey, secretKey); + return k; +}; +_nacl.box.after = _nacl.secretbox; +_nacl.box.open = function (msg, nonce, publicKey, secretKey) { + var k = _nacl.box.before(publicKey, secretKey); + return _nacl.secretbox.open(msg, nonce, k); +}; +_nacl.box.open.after = _nacl.secretbox.open; +_nacl.box.keyPair = function () { + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_box_SECRETKEYBYTES); + crypto_box_keypair(pk, sk); + return { publicKey: pk, secretKey: sk }; +}; +_nacl.box.keyPair.fromSecretKey = function (secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_box_SECRETKEYBYTES) + throw new Error('bad secret key size'); + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + crypto_scalarmult_base(pk, secretKey); + return { publicKey: pk, secretKey: new Uint8Array(secretKey) }; +}; +_nacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES; +_nacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES; +_nacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES; +_nacl.box.nonceLength = crypto_box_NONCEBYTES; +_nacl.box.overheadLength = _nacl.secretbox.overheadLength; +_nacl.sign = function (msg, secretKey) { + checkArrayTypes(msg, secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error('bad secret key size'); + var signedMsg = new Uint8Array(crypto_sign_BYTES + msg.length); + crypto_sign(signedMsg, msg, msg.length, secretKey); + return signedMsg; +}; +_nacl.sign.open = function (signedMsg, publicKey) { + checkArrayTypes(signedMsg, publicKey); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error('bad public key size'); + var tmp = new Uint8Array(signedMsg.length); + var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey); + if (mlen < 0) return null; + var m = new Uint8Array(mlen); + for (var i2 = 0; i2 < m.length; i2++) m[i2] = tmp[i2]; + return m; +}; +_nacl.sign.detached = function (msg, secretKey) { + var signedMsg = _nacl.sign(msg, secretKey); + var sig = new Uint8Array(crypto_sign_BYTES); + for (var i2 = 0; i2 < sig.length; i2++) sig[i2] = signedMsg[i2]; + return sig; +}; +_nacl.sign.detached.verify = function (msg, sig, publicKey) { + checkArrayTypes(msg, sig, publicKey); + if (sig.length !== crypto_sign_BYTES) throw new Error('bad signature size'); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error('bad public key size'); + var sm = new Uint8Array(crypto_sign_BYTES + msg.length); + var m = new Uint8Array(crypto_sign_BYTES + msg.length); + var i2; + for (i2 = 0; i2 < crypto_sign_BYTES; i2++) sm[i2] = sig[i2]; + for (i2 = 0; i2 < msg.length; i2++) sm[i2 + crypto_sign_BYTES] = msg[i2]; + return crypto_sign_open(m, sm, sm.length, publicKey) >= 0; +}; +_nacl.sign.keyPair = function () { + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + crypto_sign_keypair(pk, sk); + return { publicKey: pk, secretKey: sk }; +}; +_nacl.sign.keyPair.fromSecretKey = function (secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error('bad secret key size'); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + for (var i2 = 0; i2 < pk.length; i2++) pk[i2] = secretKey[32 + i2]; + return { publicKey: pk, secretKey: new Uint8Array(secretKey) }; +}; +_nacl.sign.keyPair.fromSeed = function (seed) { + checkArrayTypes(seed); + if (seed.length !== crypto_sign_SEEDBYTES) throw new Error('bad seed size'); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + for (var i2 = 0; i2 < 32; i2++) sk[i2] = seed[i2]; + crypto_sign_keypair(pk, sk, true); + return { publicKey: pk, secretKey: sk }; +}; +_nacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES; +_nacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES; +_nacl.sign.seedLength = crypto_sign_SEEDBYTES; +_nacl.sign.signatureLength = crypto_sign_BYTES; +_nacl.hash = function (msg) { + checkArrayTypes(msg); + var h = new Uint8Array(crypto_hash_BYTES); + crypto_hash(h, msg, msg.length); + return h; +}; +_nacl.hash.hashLength = crypto_hash_BYTES; +_nacl.verify = function (x, y) { + checkArrayTypes(x, y); + if (x.length === 0 || y.length === 0) return false; + if (x.length !== y.length) return false; + return vn(x, 0, y, 0, x.length) === 0 ? true : false; +}; +_nacl.setPRNG = function (fn) { + randombytes = fn; +}; +(function () { + var crypto3 = + typeof self !== 'undefined' ? self.crypto || self.msCrypto : null; + if (crypto3 && crypto3.getRandomValues) { + var QUOTA = 65536; + _nacl.setPRNG(function (x, n2) { + var i2, + v = new Uint8Array(n2); + for (i2 = 0; i2 < n2; i2 += QUOTA) { + crypto3.getRandomValues(v.subarray(i2, i2 + Math.min(n2 - i2, QUOTA))); + } + for (i2 = 0; i2 < n2; i2++) x[i2] = v[i2]; + cleanup(v); + }); + } else if (typeof __require !== 'undefined') { + crypto3 = __require('crypto'); + if (crypto3 && crypto3.randomBytes) { + _nacl.setPRNG(function (x, n2) { + var i2, + v = crypto3.randomBytes(n2); + for (i2 = 0; i2 < n2; i2++) x[i2] = v[i2]; + cleanup(v); + }); + } + } +})(); +var nacl2 = _nacl.default || _nacl; + +// packages/wasm/src/index.ts +init_shim(); + +// packages/wasm/src/pkg/wasm-internal.js +init_shim(); +import * as pako from 'pako'; +var moduleBuffer = ''; +moduleBuffer += + 'eJzsfQmcXkWV77fv3f31vie3b3eSTqc76X3J3p0dCFtABINJp/trSAOJJkHHmaYJghgUNCoguE0YUXFhJqOzMK4R0eHN6IiM/kYH'; +moduleBuffer += + 'fGZmXHDcojgz4gKvqs6pU3WrqhcWwzxJ0L731r3fvVXn/P+ntnOqQqMHrwmHQqHwZ2Jn745cf31od/R6/pedhq/fHWZnYX7CE9kh'; +moduleBuffer += + 'dr24Gb8ejiH+yH74s3934npMFk+x1Mj1+9kz4mp3KCr+Rvgf9mzyevkwvEs8fT27Eb1+GhP5MbJ/v/jDb+wX90Mh+R32E/kW8etp'; +moduleBuffer += + '/uFp/qvYfvas+F54P3ydv0Lkcmp3eIq9JbL/engle310v3h/GFL2X48f4C9Kw+unp9m7o9PiOwl+NT0tCzktjtNCauxvhP8qe736'; +moduleBuffer += + 'x34hCjjNnoR8y1dNi9yyq8T09fgqLA7mOcVLQSXBQsMtlq/9cM3lmYAHxWNR+nlEPpxQT/KiiseYhPbvj8AJ3IrgHVYCyPN1oMnr'; +moduleBuffer += + 'UEfTcDmNl1NwOYWAmQpFHs2vir52zxUVu3a9ds/efeNXFPbtKhw4sP/Arn2F14YqzFt7D+46eOjA3n1XhNL8VqV2C9J3XVE4FCqa'; +moduleBuffer += + '4d5Mr9y/Z7IwdgheWavdmjz4mtGrd129f//Bwq7Cq0NN/H6Vdn/P/v1XF0b3iW9a+dl37TV7CgdUfvRvjh7E2yGf32rkt67YtQNy'; +moduleBuffer += + 'OTjRWdjTMzTaO9o71j3R328XB1/Ni9PM79XB79n1rsHR/onuHva3MFYY7C+Mhkr5Aw3wwMFDo2NX7eosjA/0jfcP9g307emc6BmD'; +moduleBuffer += + '9+MjIPuBvp7ePYOFodGe/omu0T29oZCWzbEDr3vVof27CuN9g+yZrs7R7qHuwZ6hUIY/swCeedWB/WOFgwd39Y11jfcPdO4Z6+vp'; +moduleBuffer += + '72KvhIcWwkOvKRw4uHf/voO7xga6Rke7+rv7R4d6Cp2jXfBUPZZq/3hhV2f30NBQX0/PWG9htLO70BP42IHCq6/de6Cwa2BoT1dh'; +moduleBuffer += + 'qHugd2y80DM2OABlx49dc3AD5LuTFarQXRjrGe3p7Rnv7odXLcJXje4b33/N5r1XX73jdfvGdo3u6R6bKAwMFfbsmWDv7QxV82cX'; +moduleBuffer += + 'w7NMsxeKx182evW1hYO79ozt6R3q6p7o6u/s7Bwf64WHg7otFMbGeke7uoYGB7q6B8ZRt/jM1YV9Vxy6clehe7x7lL2pp3usa093'; +moduleBuffer += + 'Xz9AS9PxwOBEYU9X5+Ce/t6B7oGuHiinRw/s2z964IqDu7o6+wrjvQNdvQN9o6MTfZ0AfSnVwh8d2tXdN1EYHZ8Y62QfY2eowqog'; +moduleBuffer += + 'OSau3Td2iKkJsoEweQ0v8q6x8a6JidGBPQwiA0O9E10B7e49VDgweoiBaWi0u3dscHB8YrCfiaW/D7JbHfzKtfvGCxN79xXGA6Vl'; +moduleBuffer += + 'It61Z2jPUE9n78AE0+lEb9+eUIv2wEH2QM/AYM9AZ3fPRM84U1FhMLRIK+fEgf3X7Ooe7RvvKXR3DRb6B0ZHB/sC6Nl7cPjAgdHX'; +moduleBuffer += + '7RrtKrBiFDrHO/sHeoa69kBGOvChfYw7+8YK+yd2iadHrp2YYAwsdPX2Dfb19jBEDvQMTIzBb/DTY6NXX72rf4Dpcry7q7+nd7yX'; +moduleBuffer += + 'CSJUYz4xMDY2Nj7eP1ToHBjqGi10hxabaurvG+gtdI0yUnePM6X2Begxvn8fQz77OVN2oXdPT9dY/wDmvUUWcMfoRGHbvkOFK1iW'; +moduleBuffer += + 'GegL3XsK7N9YoWvPnk54FGVR2MdgyqDc093fN97bxQje01PoGx+DL3aTFTm0l3FjjDOc6XfLOeeNDJ+z66Kt23bs6mN5HdxTGCgM'; +moduleBuffer += + 'TQz2dLO3p/gPl7l/uGPTOZuZ9sb4pwZZ3if6BruG4Bcd7l9csu3cjeddsquP8Xugs7dnlAlsaKy3c9bfYPYGB0eHOpn8ekb7+gbG'; +moduleBuffer += + 'OwfgN8i8PaDO/s6hsbEeJpq+rsI4Kz0Uu4uI9dq9h67c87pDDAUTDHiM+8jY8aGBQn/PQGEPx8Po0Gio1mDsaFd3Z2f36MDEUNcY'; +moduleBuffer += + 's7oFeHG7ha2L9+47NAhw7Bro6uvfMzbR1TXYOcgMY0ClmBf8/GjPIMdXYahzrHugf7w3tESj4cFr94wCvln5+/smRofGmcAnhvoh'; +moduleBuffer += + 'k0HTM9rb29811DM+1s1sT/fEYICMnGv9fX1DfXvGxwf7GTQ6O4dCrQZbGfi69zCgToz1dI4XuroB7zrZxwt7rr1C1uLC/OW1u4eu'; +moduleBuffer += + 'PLD/tVDdlGrJ1xSu2X/gdZpBl5Zj395DuxhHCgf2HShM7Do0uufqQqgu+ubsLdlwKMwbqKFwLMbOwrFsNpQVJyw5kYzwE3aT/S+R'; +moduleBuffer += + 'CCdD4WSS3QtH4olISPwyHF4ar2d3w2XsIhoS/xKhaET8i/P74XAiUhkPs/NEPBSP81+XJcU3qxKhynAinEqF2kLqXzgUYX/ZhxNl'; +moduleBuffer += + 'oVBDmF1k2f/D5eyD8ciycKgqwj7PnwrzbLVH+BfYZxIh8a1wJCzSw+L/EZHGytPBHwrF+WPs4+xWMhxlKbFQIsxyJTK5PIz/IuEV'; +moduleBuffer += + 'LCUZTbD3RKvkO3mmwvQvkmRy4p/tDIUj5aFYVHwulkhEYpFQHAqSZCLtYh9kPw/Fwil+v4GnV0Zi8KZEJMLkycQVYj+kfyEmuBiI'; +moduleBuffer += + 'nOeZlbZbiCVcloxzsUSSULpQPBKJRli+cqFYDytoIiSU1Mjex6Qc47lnNyM8OcEFGOrtYwnRaCIZjbCyhRIJ9ukE5DUCkmefjYvc'; +moduleBuffer += + 'h6OhKP860z/7P7sLOY4nufoT2XAYYBFKJpKJcEy8PcRLEY/zF4IGFiyICtDwvCbwK0wiMf66cBh/wu+wjyWErKX6RYcpxg4JkbNY'; +moduleBuffer += + 'NMo1hU/HxAsRafyH0QTknsmNv0q8g+WZITQSSURjPHcRocFYOB4SHxdPYo6S4RyTY4SnRSLJCCt3NJKMCuGy0mW5ipg6ovxfI9dk'; +moduleBuffer += + 'NMyfZs+EQARRnnkGIsg2+1F/ZEDAH2UKcgmFygeHxMt5nlkREuGVOYFyXjaux1VMNfAThomIyI1QH/vfavYT/hh/08KFa9YmkljM'; +moduleBuffer += + 'aDghYMRvhCLeOk/AgglfKH/98AgnXZgzjsmQ6JUIJUW2o9nohhAvaiiSEmiLAeTC8USUP8Z+muLvg18y+UeS9ZF8JJxjX4zlNiY3'; +moduleBuffer += + 'l29l8Itx2SbCDFdMTOwfE3FUpLG/TGYM41xz0WiMl45L8SzOO/5sKhXNceKwcyZV9vM4/wn/TCrCy8PeEwUixGIiY0zu7CwqxMLf'; +moduleBuffer += + 'ALyNxZiSuUCZkmL8/+x17D0RniP+P34SRXskhBYB2ojkMBoLho2I9iC7wTLIXiOoGMF/LDuhsHxTJB4PwR1e6pjIIxdTTCBW/BcN'; +moduleBuffer += + '4aPyHwqS/Qc/ismfR0N1KWZ5I68KvzHyxsj+0OFwnOm7LJFmvebhw4dPhLLJj8XqE2DdI6Hmwtj4wdEN+69h5r0wvG/8ZYUDeyde'; +moduleBuffer += + 'dwmr6Tays9cUxs8uvC70/mSl87HQg8mcfiP0w2RWXOPt21PF4hJexd/0n8n8wcJrdux71ZbCoZeNFa66+MDVoR8lc5CGv/pEMrPn'; +moduleBuffer += + '6oPylTel0uwKb92R4rc27RP9odAbxNXGAlzdmYpfcaDAun4/TGV4HbV39Oq9f1wIfT6bLODz9yZbXyPes4u1I1ilKFJ38Vp918G9'; +moduleBuffer += + 'V+wbPXQt69EcvHL0QOFg6LZk4+wPfDtZMwZZtO/dnMrjh+hW6MfJQOXKmqH7x0L/Gi/TEg8UIPXTiUDX/I94Z3o/e8WDaVapGzXv'; +moduleBuffer += + 'LvjJZ8LlgZ+8av+BQ7t6w+ESLXWCSSf0+XSt/Y5x/PDXI3q7gDWRDhwKrUy/jZF5OJy9OXJ75r/Sd0V+lLkz8+fRr6a/n4bruzO/'; +moduleBuffer += + 'jX8ye0Ps7uxvMr/O/E/mV5mnMj9NfzX9lfh3Ip/LPpR8dwaee0/my+k7w0czvww/FX0/S/tq+lT6huyP0x/K3JD9QvbnkROJ/45+'; +moduleBuffer += + 'PfHPiQ/H/jb6tvDNiS8k/i1zS/Lvk59Nfi/1rcx/RO5IHEl+KXFP5nOJr8efjj8WvSv2wcwHMt9Pfyxzf+bt4R9Gv5y8M3Hwu+Eb'; +moduleBuffer += + 'sv+afizNX/k/0W9m/jzzzsRDiduTNyUfSB7PfCLz1eSPM9+OviP8xcS7Yj+Ofi35nsQXMsey787ek703+/7s+7Lvzf5p9s+yvwn/'; +moduleBuffer += + 'OvGB7Anx313Zr0S+nflo7HvpR5P/nHxX9p3Zrye/iEX6h8w/4tmXM59OfyXzu8g/ZT6TfjTzm+j9mX/JfDfzWOL28L8k/zTxr5mv'; +moduleBuffer += + 'Rr+f/ovEtxN3hL+VvCdx6fHsycx3Mv+X5f93qQeSb0j8e+Y/MrdGjyS/E348eXv6gexnwx9K35f+cPoj6Teln0k9yf7779RPY/+V'; +moduleBuffer += + '+mXqv9j5L1I/SH01/bH0+6L849+K3ZB+e+ax8Juib458L31r8j8yTyQ+HX8zE8F/RW9N/yTzk/QtSa6tw/E7059J/Cz808znkr9K'; +moduleBuffer += + 'nUp/L31H+mfpn6R/mv5a4ufpxzP/kzoW+2Dk7dEbsnemH038JPyzzKnME+EbUw+lv5D+cvoX6SfTn0++I3NP+LOJX2QyX/jYkluy'; +moduleBuffer += + 'f/vq8FvC017Ii/RFQn7UC/NDbNpPjHzxgc89VDw98gz7V3KjXzry5KO3fz837VdgipfAk6kR7wj/dcyv99gPk+q+d2TKL5NPeaUj'; +moduleBuffer += + '//nx4z8onvZTI0/DExXiibx8wk/Ln4psxPzEtF9ENyuMDJXLDGXlryr0DCW8+mm/WN4qEl8qUk+yS5ahX//Tg19kWY7LDKVEel48'; +moduleBuffer += + 'nJIPs6Kl/ApeNJlTLymeKxPPlVAB0+I6TTnO0Z1yWfRK+aWseDZLz2YCRU/5yWm/im6WGUWvlkWvkb8q04ue5EWvlbeqxJeq1JM8'; +moduleBuffer += + '6+Wy6CtkhipFejBbTIgV036zvCoWjxiizKEoP/7uJ07EucTxfXGRLgTK5KtEmfPLuCilbEDYXskcolxAdzLiTobuNNCdainkRpmH'; +moduleBuffer += + 'GvFsDT3bGRByzk9N+y10M28IuVIKeaHKqibkFBeyJ2+1iC+1BAtVLYW8SGaoUaQHs8XUVcHzjFe14hFQGumwAZWGQm6Q71vhVloZ'; +moduleBuffer += + '1yteNWtKI00uQKV957HH7ymZJumihoXqFHeY0vJ+3hM8CSjdrTRCvb94RqUtoTud4k4n3WmlO5VSnUtlaReKZxfSs20Bdeb99LTf'; +moduleBuffer += + 'RDeLDHVWSXUuUzZBU2eaq7Nd3moSX2pST/LiVkp1XioztFSkB7PFgFHB84xXnnjEgEcrwgPV6cn3LdLgsUjBg6lTigURVBuExxKR'; +moduleBuffer += + 'mPDyGo4AGkL7CgyLUe83vPu2T+WmTTwI7SswML1X+EVc71KRSOqSAKmnAA0KB4rb5RJgUt8IZABsw4zw6JoRHtvpTpu400Z3uulO'; +moduleBuffer += + 'lQROj5TrMvHsMnq2NwCcCj877XfQzWIDODUSOH2KJRpwshw4g/JWh/hSh3oSyIzAGZIZ6hHpwWwxCFbwPONVu3jEAGI3AhGB0y7f'; +moduleBuffer += + 'd6kbiGUcq8/oWDWAuF0kJjlwCLGtGsIIdl2IsKJpUg5CcUUQYbI6EJfKzPuNaIgWBA0Rw1iNX8oxRrBbrNkgZUEMW0NAYBhDMEsA'; +moduleBuffer += + 'IBsa5sAYQbJagnRlkLOCjGThbSguojsmFM+lO73iTi/dWUV3aiRIV0sd9oln++jZNQGQ1vjs2X66GTdAWitBulZRVQNpMQfpOnmr'; +moduleBuffer += + 'X3ypXz0JVgdBukFmaLVID2aLwb2C5xmvBsUjBuhXIegRpIPyfUNu0JdxXjyj88IA/bnQkuAgJXZc6kLzIkRz0bSyngD71iCapb0s'; +moduleBuffer += + '1SxTl4Zm4gLwo1Gg2r90SqJYWTiG3wY/zvFr2NLFAVsq8Ut4Viwql1SRiPbPRZrPhWACfLWkgISXt1K8wHMieCW9gJpDlZICG4PW'; +moduleBuffer += + 'x6hwLaC30x0T6OfRnTXizhq6s4nu1EoKbJYIWSueXUvPbglQoMEvn/bX080SgwIrJAW2yl+RteAUKOcU2CZvrRdfWq+eBJuHFDhf'; +moduleBuffer += + 'ZmizSA9mi5GpgucZr9aJRwxKbUJKIQXWyfdtcFOqjLPuGZ11BqXOE4lpTgHi3pCLK+3IlSKtMdPj4koncqVUI9UijStEIMBi3EtM'; +moduleBuffer += + 'm/wR1DIJxJniNWoUYgzx/BLOEIK8XhMohiw2GELwPlfQ0N/OADsnJ8iSVEtaSWPsn4eGyWTFSoMVRKJKSSsJWW/jvFhBJKqStLog'; +moduleBuffer += + 'aC+N5ohFnkG6Y5LnQrqzRdzZQnd20J0VklZnSdRtFc9upWcvCtDK86un/bPpZs6gVbOk1cWqitdoVc1pdZm8dbb40tnqSbCpSKtX'; +moduleBuffer += + 'yAydJdKD2WIEreB5xqtt4hGDpjuQpkirbfJ957tpWsaZ/IzOZIOmF4rELKcV8XmDi3+DyL8iram32sW/jci/Uo2o7Rr/iJSrkFZJ'; +moduleBuffer += + 'zWr3aO0O4t8Q1lUlGlGhibYkyL9uIiXnH3GV8a/Fz3H+ESW7NP6ppvaM/OOc8zpt1g3Ro2S8zhOVtX8uMzRz8oxoUimpKisN/0I0'; +moduleBuffer += + 'oMA0VWOYTKOmbpWkqqSBd8G8mEbErJFU3Rm060ajzCLkOrpjEvJyunORuHMR3Xkl3WmWVH2ZRPLF4tmL6dldAaq2+JXT/iV0M2NQ'; +moduleBuffer += + 'dYGk6m75KzKMXIWVnKoFeesS8aVL1JOe6C4iVUdlhl4m0oPZ8iq8ap5nvLpMPGJQ/5VIfaTqZfJ9r3BRv8wr59bhGd06GNS/XCQW'; +moduleBuffer += + 'c6qSjTjfxel1yOkircG72cXpC5DTpRr5B12cXohUTVnkbw9yeiPWqSUa+Ve5OL0BOZ2zyO/kdKuD061+hnOaSArtXMFsIrrNaaqC'; +moduleBuffer += + 'Jad76NGhmTjNeey1KL7aTCYje6FoqPjnMWYCg2fhLlGvStJfVm7+5Wjo52Ivkb1G0l9Sy9s5L/YS2Wsl/SeC9Y/RILVIvo3umCS/'; +moduleBuffer += + 'gu7sEnd20Z0r6c4CSf89kh27xbO76dm9Afq3+lXT/hjd9Az6N0j6TyrVafSv4vS/St4aE18a05XMM4T03ycztEekB7PF6F/J84xX'; +moduleBuffer += + 'BfGIYU6uRHOC9C/I9426zEkZNyej8uplLnNyhUjMcztBducVLjsBeivyirXG/lkuO7ET7USpZlDWuezEDqR/2jIohp24AOv+Esug'; +moduleBuffer += + 'GHbifLQTOcugzGAnMpZBMexEl9tOxLilaPf1trdqJcxmJ8is9MxpJ8iAbUQ7sYEenbHG57bBWzibdSCTcrlopPkX8L73XPZAGhCv'; +moduleBuffer += + 'RpoUaSH8V2CF9CwsApoUWY97E/OyCGSBVlgm5TJH1Wcbjsvojmk4lEnZK+6QISEzwccM0KTsl4ybFM9O0rOvCpiUdr9m2r96RpMS'; +moduleBuffer += + 'lYKskynXeFEpmWFRnmF6nyywlY5GQKY/LdPR2FjpWAQrHc2bSPdfLf4eEH8Pir+HxN9rxd/XcIRd49Vx7NRN+dEp/xqewo6vxeMf'; +moduleBuffer += + '4fF1ePxjfqybYpxhEolSs4hf1YmMSBF4OUdaiSMt7kgrdaQVOdLyjrQyR1qFI62GG/p6kVYv064WUhGJPswvQIr4qf8n4u+U+Hud'; +moduleBuffer += + '+Dst/l4v/h4Oi8MNYSEp8d6YVxUQErvyxQ1fCclOK3GkxR1ppY60Ikda3pFW5kir4Gkw5UuT11eJS6gFYRq6CmtE/lfchdf4r4fi'; +moduleBuffer += + '3wiHm+DwBjjcHJBJZUAm7Gq5uLFcycROK3GkxR1ppY60Ikda3pFWxtNg3lfOE2PFDrU2zGNXYg3O/4q78Br/jVDUI3C4BQ5vChS8'; +moduleBuffer += + 'OlBwdjUgbgyogttpJY60uCOt1JFW5EjL8zSYd6VpemhtQFMCJvWrR6BZwf+Ku/Aa/81QrFvhcFugdOWB0rGrEXFjRJXOTitxpMUd'; +moduleBuffer += + 'aaWOtCKeBlOONMsOjSJo68Bcbrn4CyniLrzGfwsU4a2BIhQHisCuzhE3zlFFsNOKeUPGSIs7n2NNqFKRVhpshUGLS9zyYW4RUsRd'; +moduleBuffer += + 'eI1/NJDPbCCf7Orl4sbLZVqWt5mstBIrLc5/K2YZPZoWh1YgNO5gAhLmmCBF3BWvocyktcykeRtsXNwYV2k5RxrLjJgH98iZBVqV'; +moduleBuffer += + '0FiEKXKYDICUdfonU9onU45PpvgnwUmF3FOgLQpNTHC3gPnYdv3FSe3FSf5i8GAhXx1op0LzU9zyM/rPE9rPoaUKDdCYeuhSbIRq'; +moduleBuffer += + 'Ey7YrMSXBFug8nV4W7xpipqb3HXI265+pJ5XXkfYEtV/Tk40VK5Vro+p18LvxOemRGubN2CTeBQSOHdK+yKVIWPnK0lJK8184fup'; +moduleBuffer += + '/U+zR6TDjfPJpsoIvBB1KBvTKTzm8Ciyf96UlrGEnf2YmSetRClKanOXCDNAvSLqCcmJF8WB859LAVXWEZOAfN4N4N2cNB5L8Cin'; +moduleBuffer += + 'HkTBL5jS8p+0C56wCx4zs6/JgjyRsNMxgywwh2SHqGdJvUlyoSG7dKEhmvRzEY0qLNoAMH6vEL1XP84yjF0fIawoCisqac56V3jk'; +moduleBuffer += + 'BfPiymxqhiZqy7PRlues2ErbIl4ztzxRJKyqwF9T3UNdfOrWk9cS1UU7DflmXwj5KkCgSYcKED1ylLX0i3Hkci3VOKzC5KX1S0S3'; +moduleBuffer += + 'pHgGfdTq+ihRVasmw6itolpbRfODPLm0KFwq/54t81URyvatpKi30Bm1bmj4hoZsyqnhI09eaais6PehMgVxbA6AClc4VLhCdnnB'; +moduleBuffer += + 'VYI4DEMCW0m10Cp7vgrO2gpO2wpO2QpO2gpO2AqOmXLXmplK5xfNW+dFmuZvI33fSmdvpjNqq9NYH43vVcsTartfZmAg/3vBgHIv'; +moduleBuffer += + 'LpoFE80OTDTPgIlmOQxipMMw6cUGVtAgI2Kq54+Y6jkQQypViCEQKcQQiBRiCEQKMQQiZbUdICLNKRDtmgeI8jNA6U0Em1vo7Aid'; +moduleBuffer += + 'vZHOqJdLA9I0CF0pT6jXe4UBqrIXBFTKgT3/PEC2wAGyBTOAbMEMIFsgx9pkOo6d7ROXu53gg06xhGAuAMHK2SCYe0EgmDe1paFS'; +moduleBuffer += + 'QZBQWU1J80Nl3MTAFMxNzIjKsnlg82ZC3xvo7CY6u5HOXk9nNBalTcDgCXnm09jUXgOlFc8JpVRgRPnvB7UNDtQ2zIDahhlQ2zAD'; +moduleBuffer += + 'ahtUfEYgfb+4nJwFzWg8EdOVAUxLLFe5MF35PDBN8RoK0w5LqzBNVslhfGeFOTWYVPeYZEkxMN6rZoB5xbME+w0E4sN0dr08kTMF'; +moduleBuffer += + '3nXyZEqe/Ik8oYFpOc/gUegDjU97BuTn6h/C8DYV1qJAhUEB03CXGRQwWwd5gwJmi7EIKWDh4o9tXLzOxsUf2bh4rY2La2xcvIaS'; +moduleBuffer += + 'yFpca0PlECUdNCU95R2w0UPdXJq00WeOp7xXB/WCcKp/zqDyhO0YCZFA2WmROk2r07w6TanTMnWaVKcV6jShTuvVaUydyhLDnNJ1'; +moduleBuffer += + 'wpgxCIdvvA5mn64T5gJThBW6TpgaTBH26jphdjBFWLbrhAnCFGEDrxPmCFPEJ68TpimYUmmlZKyUKiulxkqpVSmpIx8arrnWD3vZ'; +moduleBuffer += + 'D73aCw9ff9CPeLUfevWB/ki7F/LCXhFLjng1IqVVpKRFSpVIaREpeZGSESmeSEmJlEqR0iBSykRKTqTUiJSkSKkWKRUipUKklIiU'; +moduleBuffer += + 'vEhJiJRykZITKfUiJS5SUiIlJlKKRUpMpERFSqlICWXfdyjywfB05Prm0HDnVf594ZaQd18Y5jQjIzc8/o7vhqZ9ahBERu55+vvf'; +moduleBuffer += + 'ikyjYYmq9F//zed/F1XpT8v0O7529+ddz7/z7X99rMiR/sW/+9g3Yo70Tx596t+yjvf//aMnv1fieP57N/73U670ux/+z1+5vnvv'; +moduleBuffer += + '33zph1o+fyvTP/yOR74S5vEAnHSiQ41TfteIv6JF6Iua1IeaYrYJVQ/sb7g1EvI/HB6+7f4f3R29+n7GcZySJTl/OHy/T9+OakZE'; +moduleBuffer += + '5TQu8xhF+6FMIU78JqWUwM4o716qkEV0aEx+J6eZp+D8dVpmkPqXgTzFZJ6qZJ5y2Hh4Rssiyxi2Q8pkxqA6yaDRM3Wk9YSg1gqW'; +moduleBuffer += + '0wz9VC2CtJRAkfxQNTZp5LOlmgRSrLgoARUXYwaGZKQEylWmNAlEpQQqpASCgTZYhLSUAMWvQpswmD0mKGzIUf7LsF42BIUgp5ou'; +moduleBuffer += + 'rwkqbwiKGgsxKV9qNYgpW0NnMoxNtcbkBJQpQ65AlDcFVJZjc1I+26jJO8eEi/Km1p8VJp2V8qZWTyBMOi7l3SLlbYTyJRBZZuSo'; +moduleBuffer += + 'jADVs8fUYgaEVrrVgu1u6hAXaWopUmpBm0ShWLKVBLW6lFpNQE1MLahNrVWn1KLaHVWGWooDamFIRO2SUy+04cwg01Kj5dWI7Q9T'; +moduleBuffer += + 'Yxw+qN3FUjrg7VBHz3qadvNMlahdik5lkA1qNye1S1MdSV27Canddqldw08ric1I1O4OmTGIeQtmj4EAtUv5X+QCQUr2tshtrBIb'; +moduleBuffer += + 'r4Z2sSYiCi/ANnJQu3lTuyYohPo96UoS1G69QiZCjiY+GjRkNswMAsQSjeosnBcIKgIgYCwzsSS87w2uSewoxIDLeouFDw5mxJIv'; +moduleBuffer += + 'pRd0/tOc7kREaVJiaQU9UDVTED/55VfpWEpKLHVKLBmRltL4IZYo2BWcXwzfxKzEEuV/hwty2MbWHOcuQtBZaML2jgE66UoyI5oQ'; +moduleBuffer += + 'hL1BEBqB+oguDU0IcQKhmLS3ooEsNCF2CYTLZ0ETQS4jsUvx5YsdvHOADrFL0dIL5wU6IzArYWEX4keClsQOY4KwLYrI0wLpaV2E'; +moduleBuffer += + '0kDcunL/VKFoItA0JbGrwk3NBSgomJ78SgMLUKQkdgckdg3n2zI0Bohdio+DMaVg9hjEzUhSZ5joRTDXuYPZBRut2Go3Qt0qnWgl'; +moduleBuffer += + 'SMckyClgqnd+aEUSSc9UfwhhPidekR0LZEE7NLxShDqgWMcrsoMCmNvmh1dkhwHz2fHKLAmyg2DuOyyJA9bIDhoJXajBWgXTmbBu'; +moduleBuffer += + 'NytQZAc5U0AgY9A2mgG/0u9XBW8rD2BaLaBECh2CKCgwSvmWixjUtGTHMD1grhxSJtlBvtGBlUPSkh0jkh3g0TqsnuZFolUDKMwN'; +moduleBuffer += + 'olSD2VOrSFDc9joXiTgjvNIAJ7CHS+4bPU5OGC7pMYtKF82HE0OCOv5FzOzOwAK1JoNkHcVyAnnAT0vFiy4PsEIOtaqmg78Rw6CB'; +moduleBuffer += + 'B+SGbvMAWbdJCrBtfjxA1hn0mZMHyDqDPmZQaZAHzAYi64g+rlAlKy4gKVlHcQbtGl1U+LZJl85gUyMlWUcR4+B8GbTqtnc9eCfK'; +moduleBuffer += + 'aV/FJN5OQNaVS6ELTy21QIIKyhAhqhnJOhWoaq7TkZeso+CLwDodGcm6cyTrjBCTYmzAIOsuDnQJjeyp1Q22y8e2ucgpWUd+KjTe'; +moduleBuffer += + '9LIgW+dknZusc7BORHmV6FwD7yXiblSymdgH4aZmbLYRErNRkM9fzmoX9HajeBCbXchmqpw2zY9dyGYZM+JvQlrOyS9kc1uwb+Xm'; +moduleBuffer += + 'F5EwJ9lMjHM1ox38QjYbtAwG/FjrT9CSI0TLDQ6bba2tkpJspti8To2GVLlZNBwINr7Sks3kjwEOyMFayIysmgIHWl868iiG8nYT'; +moduleBuffer += + 'svncwMIJxEQtMExEsWYlm2mZCGu5pmLJZooECizXlJVs3iXZLJZIoBfiCEdesnm3zBgsJhLMHiM9spnyf7GL9NtsNuOoMoWyvUxj'; +moduleBuffer += + '88tIPhab0QiMBo3As2Zzj8lm00r0zofNnPJeuRZIhRym+jcurQT5Na6cD4c3CbdWfyWzBnOzFq0EhYi1OVkbjFOTE6eqDmZWwtN4'; +moduleBuffer += + 'q5qRFm/RSjQFe81u3hK5aaEVYvLg/HiLVsKgu7GikLkuCC0fQXTf7qhjrMDGtLQStETSgEZvqowteo8E6M/qS7QS5LkHfv/BWlNa'; +moduleBuffer += + 'BWULIIBEemgq5vN2HloJWj9NeAUTw6dUTKkIds1JK0EhcayCDFqJImklKHicqlAO6py0EmPSSgivMrVeBQxaFFuj27C8UDB7zJig'; +moduleBuffer += + 'laD873YZE4eVwNkoCqAF6wJRGxTrb1sJNC7kMTn6AlkJt/WZw0r0WlYC/O/J1sSl9SG78fL5WAluGbyKWW2DaX3cy7AYtgHaC34b'; +moduleBuffer += + 'Hw4wO5WWNTCtT5NmDVTl7wesg1piRtoHZn1aNXugmtOWPUDrQysbDs7PHqD1MczInPYArY9hRgZmtQesTkTrQ2bkXEedaLYamNlA'; +moduleBuffer += + '6yPX3cHGxdnBxoNlNs4JmBVWv6P1IVdv4Uto1PJm2PkUhLX5KmZ2D90pktZnPLAUBVkOHjOKn1ILUFUb9iYiVc6nVf3CFD3qr+U0'; +moduleBuffer += + 'B/VAgAwFbEekIK10NCcynaaG0RpZ6bRinJGONlCki/hWiG6F2FaIbNVjPL21XmHKj0yJQnjsWMDjdXicxqMI/5TtrmlWeFbmCd5U'; +moduleBuffer += + 'BnNGq3PlpKWChZ2aVTpaGpn+tExHS2E9j0y30pGfVjryyHo/It56HrFppSPYYL0imv0VsaBYZeSw4uB/IUYUVoLTg2NnixUFJ/op'; +moduleBuffer += + 'L0JQYoJFwIhbHomzSALGSkfAyHSaikXAyJhBTIfYMUB5EWKd/xXp8BIMYI14EwIQE6j4N4bx5Ig8uUWeiMDPKdm1RlBcwUdDABQX'; +moduleBuffer += + 'KAYjKETUvrdMpSMoZDotiIygsJ5HUFjpCAorHUFhvR9BYT2PoDDCBc/R7A1MRJ+Dtof/haUIHFGjRgDmBZbWi6XWYbkIklexWizM'; +moduleBuffer += + 'SKeVlUHwgZleaKLACBr0OiDlAlDrFUKtV6Dujkolvk2evF2evAPUmg+o9Uo+tAxqpXURMlKtEMbXrdJRrTL9aZmOarWeR7Va6ahW'; +moduleBuffer += + 'Kx3Var0f1QoLGFEEIFRW0KbNYN3D/4p0eIl/O2jqDjjcCYd3CpHstPSWl3qDeCISSF7qzYg9hiYktA1hXgHOLwXNXCk0cyWKfyce'; +moduleBuffer += + '75L6uFuevAsUUxZQzF4+IwaKobVe0lIxIqDKW6PSUTEy/WmZjoqxnkfFWOmoGCsdFSOjXgNLHUIjA/z/4Fykw0v8d4PI3wOH94oy'; +moduleBuffer += + 'T1qSL5OSN0LYoRkD7RGYd1wFst0rZLsdJbgXj5N4fJ8U7Z+CaKsCoq3i8+kgWnLVTknRikgfb6tKR9HKdFpFHkVrPY+itdJRtEZk'; +moduleBuffer += + 'L4TSQqsQ3CmhYQkpEHZ0DGR3jyjUVZbsoGEpW4hCOlVCOlUohEE8XoXHP5PSeT9Ih7d52XuSUijUF05KoUD84oUqHYUi08llCoVi'; +moduleBuffer += + 'PY9CMSKSoZEP/XhwVIFzkQ4v8e8VmfWx1N4mVjLqskMpWvG4CY8fkMWLiNe3sd4FFoyG8ROyYBC4d7lKx4LJ9KdlOhYMXHfICRd6'; +moduleBuffer += + 'P9BLAc8mOBfp4iUwyDHllYr/xDpbpTJeHrosEHj7QVDFStbFwszSYGpcZvZD8MyHwuoOZtdwnocBXuiUgfM8nItRoJWQoQqvgvpl'; +moduleBuffer += + 'MBYE4zcw7LOcLwED+aA5yOgM/pXQZYWuJfj78XOYu5nyyqlXCXM0MD1/Eev6kv8mTyDvQhhdgw4w3NqBfXDoUcMYPPSjwU1F9oZL'; +moduleBuffer += + '8Jf4IuX6XK+9zBEA3KNu4zvIM071lGNKCjKpQ/udIZLl9u/UHO0683fmV9VAO72w1n6hCsFqtF5oBF+stF9YZ79QhRW0uF9o5lMt'; +moduleBuffer += + 'fxhXhLC+tND+kvKTXDzDlwyefTBsf6rN/pRnf0r5Dy2Z7VPm4hb3qg9SJi6087DRzkOTnQcVnd8+ax4M6xixs/ABhxw22XlotfPg'; +moduleBuffer += + 'UxIMVESeTU7ucUjjmCMrW+2sdNpZUWOosoRaGH/fs8/d+x25+zNH7q6yczdo567Kzp057DKP3JnV/HtVfijf73Hk+92OfK+x873B'; +moduleBuffer += + 'zveAnW+1oMH655rvP3Xk+32OfE/a2d5rZ3u7ne1VdraVn+Lws8u2uSjLO1VGqUB3Ogp0h6NAtzsU0W2X6Fy7RCN2iVSI2FnPr0Tv'; +moduleBuffer += + 'cpTobkeJ7nKUaKddoCvtAl1qF2izXSDlv332cymQ2ZF7q8ouFfUtjqLe5ijqrY6ivtmhvGV2Wc+zy3qOXVa1SsYlL0RZ3+Eo69sd'; +moduleBuffer += + 'ZX2bo6xHHWW9wi7qBXZRz7eLqhwR1C5AlLTruRfVHGR5g8o0CeEmhxBudAjh9Q4h3OAQwmGHwpttKYzZUlBLMZLCVZTBnhdOCm9y'; +moduleBuffer += + 'SOEWhxSOOKTwRocUJmwh3OwQwhZbCOOURBNqqqmsuY7JpNc8XyGYQ64qmJGkc8gWzkFbNgds0bzalsyrbMnstwWzzxaMCsUkdNCq'; +moduleBuffer += + 'mR6t+Sm825V4XkjBXG8LZtoWzHW2YAq2YNbagpmyBfMntmBUcKuMadW6PDKmVUMM0Wa1khDeE6V77QsnKYp2GQmR0IIBphl1qgWY'; +moduleBuffer += + 'alGlWiipFj8aV6dRdaqFkspCylBSLVATQ0nLRsxQ0vyIGUqqhZtiKGnRiBlKqgWpik8Gwk0xpdxKqbBS7HDTtVbKK71qAWdWwFeq'; +moduleBuffer += + 'm4cPH07deL4frl8baefRlmu9nMcvWvlFpZcVFy38osLLiAuPX5R7aXHRwC9KvJS4qOEXpV5SXFTwiyIvIS7y/KLYi4uLHL/I89Vq'; +moduleBuffer += + '2UWKX5R5MXER4xdVXkRchDwe/pl/MM7+DndOtoSynxiN7J8OY3jogZaQdwC2uEzCFpdFKvxMLXPLteC3wmaWPl9CnjgDA4zKp0rW'; +moduleBuffer += + 'i37Wi8LCqTSdlITwxLJpLeaM95pZxn0tVLIY4Uxk4RF9xfyj1ImGBjd0e2iZiObA17SdI+WMudyZDcYT/QHFfD/vxSGzLYHMpvhO'; +moduleBuffer += + 'iGrnKbEeSIpnloKMIA/1emZzfh/PLHn6wQAAxAFRCbJyCzpyRBbbctDocQzbsMB+Zc+A41QwfrlaE6ZhTXxyuecf89equT2/yktP'; +moduleBuffer += + 'BewDlDjnN+vxDWK9Qd9r1valNH1bU16xFkAHTqEweFQeyCdsl9ji6XGKeiQbyatVRgMr1219kX3Df7vM69M2ooExeDCXa2YSW34K'; +moduleBuffer += + '1mrUJBdTkuM3yEdEzdZLyydVCCN6/mZVF/rVXskUGmddpHk/Oq3ttcnnFxlrfW1k1fRcKeYCp1FwqPAM5wWYxhGjeFVcB32ahmAG'; +moduleBuffer += + 'zIiGi0kdVPgxrgPSmFwxIqCDLE5TwKDyLMJvmSZhoQMrzGBsMoRPchyQI658wlFqVzmWmYpRK5Cr0NJSpRNd2pqLkGzB+eT8zmtN'; +moduleBuffer += + 'f4Oqsv16LwPK2hJQVoUfn9YCIflQG7O3vrYfmumxF/WKtd0lwT3P2MgUgmoEl6oZBbmyCCJbXdqFgbW1ctJIOe1qe4PAfqgproHa'; +moduleBuffer += + 'IFTKsfYPcEJsKCg26ikN4sTSfCuTOiq+0lC88sHixoqCziCE0dzY4twAlVhVBRPM7QE8SI2rPSiV7lXMltralEYrVXyTudI8eWZJ'; +moduleBuffer += + 'lyeftpLj7SJ/o2oq+ku9ckDB4gAKavjOlzQe7fPRPyYYX/PzD4YaTcECwOTeDvuAGTGEELMk6F/PYdOneYo4978FZ6vNXolEwRJC'; +moduleBuffer += + 'AeENvDqbOQrIQzvhghREFVUhQLcG7RQEP4hldsko1WI7O4Cl1RJLDX6JV6QZqVINS+QIJlbJWmO77xNexSaHhMcFGozUJpIQFUNY'; +moduleBuffer += + 'y3sDDCMILoUicyfThRZOtEAxtSeq2r/Bsc2YtfsDOfBJjzVJG5jk9jepaW6/wasAZJF3WxLipPLTgT3VmITyHFnkLmhsDsFwV6x2'; +moduleBuffer += + '90PHdiPQDaauhK1ayqHYp0XRdLmgCLOfG5htRmR1ErIIw+AiHeXIoiCILRpMCbsQcVGNoId5FWOjnhiv0AzMAj4JtB2Iz7UMs2jY'; +moduleBuffer += + 'ichNaOq0fYwRxwY8F0p4eqx9U6SBeatmegizEp6q9jHWHCjh8KRwU4A4IFjNkCwIGkaOS2+17i5qItOFPRpS1/YPUdWaCqhTMQa0'; +moduleBuffer += + 'wY6KBzJC/ZTPoBwu9mlDMV4n++eq/rFf41UCWsmnP4nxRdOay7LwHMhwtFI4Afj+qBFAsREV7T8EDrRBRMPop8it18Dh3adtyr3e'; +moduleBuffer += + 'BW9YoHyjVy7Ruo7QamxvE+doJf9i5+IB4HVZj0TqChr/YcR8TLP0vWS2NXIkEPObmZ5Mr1lgY5pDnogD9h3mrokHapNYr19jQg+i'; +moduleBuffer += + 'XY/PbtLQbmx6LPaxq/aKtD2vdBtPaG+fC+1ihwjyhgYqmesJAPqJEgvmRLsL2S48k8NrYMdFeaZ2gVE+8WovOHIJM0PlyJeCtpBd'; +moduleBuffer += + 'JBnA20j+FrVknN/mLQIGkFtvEmJytJ2VYBcI1mv3Nadr8FZXMS1iGwHygoINSoMswZWthe2v4Zs39WkRsTtclAHXt02sfkUGnEcM'; +moduleBuffer += + 'IK7BTH+WM4Cibla46ARLji9Fcq4PVlIXob2OazXSNo1HRLgc8mgD05PpYn420iitkVHnG3ELmM354yU0BgFHSziDjOrI8JEfJloF'; +moduleBuffer += + 'GDSEDKrSGAj1ixEaPygZ1Mr6A0Ua37o1BhGt5sGgas0JvcfJIGMv8pkYpOqGZ88bF1toekNtlap2YlQ7L9K26FosyPYALZRjOK0n'; +moduleBuffer += + 'K40r7CXjb1Vr8PnLvDpgFcW5JSGGpWJac0bnripeBWcVLYBs7PHE6pVybWs1cCEKMg+3PRN1VBunYZ/mor/TRUNYSflcr1Ky6uXE'; +moduleBuffer += + 'KuIveCvmOatox/hVLorC0twNSPgdwcr0cmRVVqs5L3Zx80Lk5kbWaDajIy7AKi5tVbDAYeIrEFw0B3MaYy9CVpZo6zYAtYPxFUhf'; +moduleBuffer += + 'yUpjt7gqzkpqc3S5WDniZuUwsrLaYrXBSqBvEezRttTiMPioElUlK9VEs/TbIlbWq0UJkPLASuXJMCcrg7FCOgMV72arm+binQrl'; +moduleBuffer += + 'UnEXNF2ldjhz7W2mXF2NoA/lqCkDrKSJBpd4f42au/LbvcXAVArGSsKagUX61opyHkza6mlavMyv9ZZIHsGS3nxywi/1CkQqkSwW'; +moduleBuffer += + '2/NKvdopP4mbjyVh1T1+3I/HV+Hx1XgUW4+UavMycg6LZq5ovopmqWhuSq2vSpu81rIcFHGDQ26bxr6PECMgdjSnTWbAZy9omXC/'; +moduleBuffer += + 'LNEuWMYd9/rURrS4l5RhpoQfr7fFWySltYgERNYPFjrOcKtDNm+7y4TBdpI1aBB3BhswV6DVyWutlUtdtmsCbdcmJmhsRNGwDVjV'; +moduleBuffer += + 'NDddZM7Oc5kusKaiWV+pWa1XotXStjHGNs66oNW6nExZwGrhLiC8Lierd5HLaoF53GZaLTCz1dxqkdU7y2W1zndbrbPRatVbVs+w'; +moduleBuffer += + 'WmD1WtGkQQMCDBbEA1JobJm3VFvhD6ziYMCmzdseqbVY5jeiMVdr4tnbMnKQmW9rAtZaV0aO9nRlnFwCFogPMsFOpeRkAVHIY4G2'; +moduleBuffer += + 'FHq4coB67dw3t08bpR3XuEoNFtxokjVlkXp1RD3KHxCkPFDhX+LiMQC7DQd3Yc80GgaQFX7GsgYGgXcigc+d8n1sadH434VIvbzW'; +moduleBuffer += + 'kHm5i78A/Qa0lURd2SMo0XoEq1zUPd9N3bORulUW9Q3qjripK3vT1Vr1u8NF3aEAdanihqq6nlOXGtUXuajb66au7Egv1aYrz3JR'; +moduleBuffer += + 'F8gqSDaAHXIIqYCo1YUB/spOjFq9hVipjTqqscb5cnS2sR2dmWppiB10plr8amXv2dv+5HMMW88xuvVp8wjFWiOJOAjQW+Mtluwp'; +moduleBuffer += + 'JfZQzw8gW8HZQ53vJURTrYuH29BDrxJDCWmM5nxkT7m2ysWlGgepw1+GHNzCCo5jEzTkdxGyJ6OtxXeJi4IAST6o6fka+wDpJZx9'; +moduleBuffer += + 'VHFtd7HvbDf7zkL2VWkVh7PNv83NvhFkX7W20sAqjX1Eyd4A+6ix3IPsq9cGdYZd7OumSoqzj+YEoJJr5uyhGfxBF/s6FPvWIlkE'; +moduleBuffer += + 'wXCWHjg0QBSbIjJqnNLYpIKMXbyy53/m4pqr7ltHZ7TMg1YfKv4p1qnubx/ypWVazbfDXAk4LhCJACztOG68OFh3nY0Qr5g2yWOM'; +moduleBuffer += + 'Jm5DomxlTMQxmGVBdaY5TwzuCHopqwvDqm3CsGkUgd5jxivRBnsWaRQh3gy5KQJwELvNkoE+T6MIWfJuN0W6kCJ6j/AsF0U6AhQx'; +moduleBuffer += + 'RkXjHOJGMwwascQlmHHoRYoY0wVRDnFyaOvRKBJof+EE7mbcskywAHw4bKBrg/ezQ1wtBETrXmqwV2BXC/TNXonoM0s2xFUVoyjY'; +moduleBuffer += + 'jEAs0jxwXIvCYiHbeVc7hVVDe1DoaY5mQvhiDc0EcQCi2KiwWAPyKrS15eY8O3qzE7pXuoHci0DWB/wA3MbaIWp1sACQuxHI1dog'; +moduleBuffer += + '+iCZRW2NkE43kD0Ecr02C9vlArJasY8DmXwwGhHIS6d98ilsIsxrthb2NBV7uGyQQOQoxgXZExYQ1c4hCpJqXH2+4KTQCadNdlli'; +moduleBuffer += + 'NQ2loKuscwvipWia/LzQQQVAFwsKUQzxpKbMtS1LON4In04zu8KNN7An5RwvBE3nnH2TG28LEW/VGl57XXhTq/gG8LYB8VavLT4C'; +moduleBuffer += + 'GIR+3YKgviXeaCmdtYi3pdNq6X9Pw5vUIVa7YqJzowSGMFwQ7KajJmfghULlnMihKX0nhshhSPOkUgZu9to8ifVriebvJ7f+DGBD'; +moduleBuffer += + 'rUXDsZEOykFsbU54gfq5NGjQFrqx0YjYqLZsmYGNhgA2yBZsRGzUa8vmLNGw0RbUjcQGrTnXithYqu2XAHiB1hONI4D7DkeItwnV'; +moduleBuffer += + 'J4AB2wOgbvWdFly6zc5Ty7NbBXL60fzcfNRj1bRy0Sxx6RECUtOmHjehHqs1HLRrNmJTUDhSj8SnzajHem3hy1JNj0TGtYpjZRp1'; +moduleBuffer += + 'KlGPS6eV5+BGUrlmvHNkbmFTZGmCcblaXQ/ZeeghP6tGZmdbGcq8WtvYo8ol841umQ+gzOstnYFXDikCQLoBZd4aFEU5l1l5UA/g'; +moduleBuffer += + 'M0Itr4RC6xZcXhqsVOZ5yizjkJ5CcTHKp17zQa12yafSLZ8EymepJV9jd5CMQsFWWT5Ra5c/z/JRpCUGHRYF8FnvKkuVKssamRex'; +moduleBuffer += + 'uWb1s8iL2gGsiL7hUJbhsAx7x4n8BMMEtE2ttECDYnWq7WTlq1MtEqFFnTar0z512q9OpUshHK4T4RTguK/tXSUCKIK+/lmV8jSk'; +moduleBuffer += + '2HEFeSvF3pDK3rTK3vzKjk+ot1K0iAXaxiqqtrGqwG2sDtA2VvW4jdUB2qKqHLex4inF2oZUnkgp0za2ahApvrb5VY1IgW2s8riN'; +moduleBuffer += + 'FU9pCWxjxVOaRUoWt7HiKX0iJY3bWPGUfm1jq5hIWS1SYrCNlRfyDuTfmPUOQNDCu0bD+6dZmohUSEGkQqkrUoFryF8qIxVKtQYm'; +moduleBuffer += + 'RCqoZfokWf0iK1IhRZEKagMhR6QCkF4FqopIhRL+UWqVQculN1hjmJEKZBbtSAX+e79fhS35VVakQgoiFdLTWj9QRCqkA5EKkAcj'; +moduleBuffer += + 'UqGXZ1b5/pId1raUKpKRClRhCrc4ilyCdnsmSHzTMS+4dKG2dh9FKpCntohUWKNFKlRKT+3qQIlFpIIy8mKGUEQqUEvM3F8qzduU'; +moduleBuffer += + 'NJbmjFSAwR2h6iqKWCi1IhbATpLclqqIhT4aE1Xh5oZbb5nXqzUNVztMtrV1k+YU3agkxx8hD1jVrqUZWVorWkQqbApEKmRBpMmA'; +moduleBuffer += + 'SEWkgmrfiQFxEalAvp7G8sXgo0MtWmgRB8WObW/hF1nJddCraQjGDYxIBWiA96s4gUaS6blBqYlohjjXD6HRGc1QhHqFJZb6DMVs'; +moduleBuffer += + 'UIrRfek3aorZaChGjQaq9q7yeVO1dbHSiS7tQAcRVUJL9vIv+iMqntKv93KgrAUBZVX4sWnNN1m4a8S4sqg1Zrgvg+sHdV/Al9dY'; +moduleBuffer += + 'oxVG/wSXRKRCr5rgR69CQ7vQolqjPIm3kLIIFriNLpduPggV0DxJCQIEqhAB4OJNeK+RKq/xM1zlBhYslS9lyrFW/AYEUF8vzi0Z'; +moduleBuffer += + '6QKQaoa8wKScij5RuleknL1H266UratRG8iUgwgqUkH4Z2zQ/DMaZKTCkgAKarh/hhGpUDRrpEKMo4CGW6Ehb/jvwfCIoL+IVOjV'; +moduleBuffer += + 'Yj3qXLCBftkmZhcRBa2EAmMoRUQqaJuEOSAFHfhKBGhb0E5Bp104QZFRAnzB6HtbEBVVfEJwNc5YEPi2Syg1sOq01FrJtSJgWQWG'; +moduleBuffer += + 'vBp9O8KgkyvrI+pu4os0FKkoBmOxXw0n7RYcNMA6h3tVz49G3Y1NkGaLVLBiYBqtSIUURCpkrUgFEQNDPWQzUqEoMJEwS6SCsFUN'; +moduleBuffer += + 'HIq92gBalwuKMAo7wuzuzJEK0GsVkQo0irLABVMZqQCgrwsa1W5EVrNmQZs0fNbpeOD4XMP0ZO7g2IGmLjNtxCchjgmzwBiOXO7X'; +moduleBuffer += + 'Qaj1JDI91uwpnTYhCyaRhpiL50JmWWAUDLgTHKGUyHTNXD/7SAXXbBqtb6R8csxIBZofpUiF7RKtvL7lkQqyKeTXetuNSIUURCrk'; +moduleBuffer += + '9D1Q+PyVlwtEKpjrswu/CJpehkEgY2YX5qKETW3k8O7VIhXWueANk3UbVKTCWkIr8QJCUWIcreSbv8QFfZjdC0YqEFnWI+bj1t4z'; +moduleBuffer += + 'gHkrUmETj1SACohIAmzMcMiTwdC5YazmL5oFfRoTehDtetwAUCYYk4fcajPR3iHRzgMYSjXKgEX3glZ7Hmiv1OZf2jW0K49tY3F0'; +moduleBuffer += + 'J9oVxmefHVbeGaphp3wylNeF8s4IuuG4IhWkV4IRqbBZi1RYICMVyIMh9dwiFXKcAeTkBBO3xt4/WqRCLadMr+YKdL6LMuDhsNEV'; +moduleBuffer += + 'qUBcA88MMYNOLnnOSAX0a0JyrgtWUjuQR3GtRtqq8YgIl0QejXDvRmN2/SykUUYjozNSAZgtBnkTGruGsZXRPG2yytjZZj3RKsCg'; +moduleBuffer += + 'QWRQpRU3AAwiWgUZRJOUxCAewFBqBQwZu0zOg0HVGguhMmoP1Dk2g1T7RdUI8+WNiy3K33B2L0PbY9oMRiNHRBWpQP7PIlJhixap'; +moduleBuffer += + '0Cb9n8lfL/XcIhVK5o5UANdBUUct4DTs1Zbzv9RFQ3DCPdfbbkcqEH/BuVHE/5AzozNSAXwTG5Hw5wcr053YCirSas6LXNy8ELm5'; +moduleBuffer += + 'YYp1TYxIhYuRmhmrggUOE1+B4KI5mNQYuwNZqfv8ArUN16WziKoBVgJZKwOrKAxorCSqDrtZuR5ZWa0F3gJTjS1DgOrdJiuh6imF'; +moduleBuffer += + 'AIZSrQXWobGSqCpZqaIRgJUzBDA0aXXjzKxUvU8X72arm+binXLdVX6+tJbSPGMWrEgFCmGgSAUKMOD9fn+7WqPWXyb9hClSIQWR'; +moduleBuffer += + 'CjV6pIKMfZAmWPmA+nmvVfII3ITFcjDF3jiRCnYCEJEKxV5+yk9hpEIKIxVSGKmQwkiFFEYqpGBaxit2rLb17CIVKOggz3JQ44hU'; +moduleBuffer += + 'oEETCEAQvhAUveCMVIDAA9EuaBNLDM8VqQBRCJtnjVSAAIRcIFLBtR8SBiPUokG8NNiAmUCrk9VaK5e5bFcBbddG7oQEjSgaIAKr'; +moduleBuffer += + 'muGma/ZIBbCmGICsrJb02a7STB+0cdYGrdZOMmUBqyUjFSo1q+d0d77YbbXAzIpIBcPqBXekQatpWa2z0GrVa1ZvvctqbXNbLTAs'; +moduleBuffer += + 'S9F6qeBk6QRFq76U8vEOI4Bh/vbINd7h6lXOtw0xX1umYhHm2ZqASAVl5FSkAjMgWqRCiVejuSiA20NxsOEFkQocoDxIqIJTj/g7'; +moduleBuffer += + 'pnGVmosA0S3K13oxUc+IZigPVPjOSAUA9gJ3pIKs8HOWNTAIfCkSWEQqQEuLxsovROpltYaMM1IBoN+ItpKoK3sEVVqPwBmpcIGb'; +moduleBuffer += + 'umchdSst6hvU3eamritS4XwXdde7qQvtgPpAR3qHi7qDburKYSN9unKrRt1AsCNSt39KawqgJzxsjLAwQFdtra55jlPPNfKjmGmP'; +moduleBuffer += + '7ejMVJEKKhZBtfhVpMLsbX8VqQADbzWcPdTqBe8UaFERBwF621VAYp7YQz0/V6QCTGa0ButXgGwb+oBBGAON0ciY3HJt0PAyjYNG'; +moduleBuffer += + 'pMICvmCEjFSgkccdyJ6cFalgUBAgyQfsuMcYsQ+Qng1UXOe42Kfi3gLs24bsq9TC9Z1t/q1u9q1H9unN5VUa+4iSgwH2GR3eeUcq'; +moduleBuffer += + 'SPYZqxeVcvbRDP6Qxj5qfjcp9q3BKgt8cdMae/o1DimvFxeb1NpkasGw5xOpoMb1VS2o/O5UzIJrbFWxTnV/e5EveqQCWHFwXKBW'; +moduleBuffer += + 'CoBlGQ67LQnWXWchxCumTfIUB4myFYmyhe9lDmMwbUF1ZjhPiDsw0nhBsOJTWy5yZzyiCPQecxziZMsXaRQxIhUsigwgRSq1cZpZ'; +moduleBuffer += + 'IhUsinQhRfRIhW0uimiRCg1WpEIsEKkAtHFGKgwiRYxpryivIGaPVIDpORGpsAnX4gMXWfDzt4CuDd7PDnHl4qnA7prEmj1SQVUi'; +moduleBuffer += + 'rkgFV1iOomAzArFGc5IHR3IYw6CaO41w3s5+jVXDsqDQMxzNhPAlLjQDEMWAW4kGZLBrwnOc2LBYqzYI3SvdQB5EIFdqFQaA2xmp'; +moduleBuffer += + 'YAG5G4GsRyoAuJ2RChaQ2xHI9dqohDNSQbOODZp3cx0CuXTadMSGMSBq0oD7rpgyGJFAtCIVdCC6IhXUuPp8walCXOZriecTqZDh'; +moduleBuffer += + 'oCMvS3B1hMiUeFCIwgs5reEN1CC80aka0+erCYQr3HiTkQqVWo/BOVvU5Mabh3jTIxVaXXhb6MbbCOKtXvOc0iMVWoP6lngzFmQt'; +moduleBuffer += + '4nihZdLbNbzRgrdQ7Qov7A0SGKKmBv8yHTVJAy/K3dSFHBWB4MKQ8mFX8Qnzrc3BA7eKY4O8pcElNh7ERlMAG5mgbiq4bg28GOP2'; +moduleBuffer += + 'C93YqENsVGtePcUaNggwjQFskC3YgNjQo1D0SIUFQd1IbNCSkksRG7q/44hmC2nAQK0PyqNQYD6GAwM3owfdxpSGnbotmqeWZ7cK'; +moduleBuffer += + 'ylde+WJAl72S65FcNKtcegQHoYypx42ox2oNB8s0PW4MCkfqkfi0CfVYry1kXKfZCCLjGsWxMo06DajHUm0NYD1ihIx3ksytilTg'; +moduleBuffer += + 'SgxEjIAeiuahB1fsyOwWW7EN+kPVXObk1lnpkvkGt8z7Ueb1ls7A84YUASAdQZkvDYqilDdIy4N6AH8IanklFFo3o+MnWKnc85RZ'; +moduleBuffer += + 'ziE9hWLcl80RqWDIp8EtnwSWr8KSb1VQPjmFgi2yfKLWLn+e5VNRF2nMS42Gz3pXWSpVWbbLvIj9GKufRV5UBEgpfcOhrEzg0xip'; +moduleBuffer += + 'IPITjFQoVafa7ggl6tQdqaBFNbgjFXrVqRa0YEYqaOEJWtCCHU+g7YmAkQp2FELWSrH3O8hZKb/XSIWQF/ZKA5EKPCUdiFTgKSWB'; +moduleBuffer += + 'SIUQRSrkMFIhRJEKlRipEKKIhyxGKoQoUqEKIxVCFKlQhJEKPKVXi4FIiZQ+LS4hJlJWa7ELoew9r4i8cjqCGyrsbgl5uyE+Iekl'; +moduleBuffer += + '+fTV74RGZbWNEQoL5G4ILXoQA3okq10KKUYh5bXBkDMNckURs9yS+qyT74k3/c5kAbMhuJVBjaqm/ZzkHjlOw5CAqjypd0FO48EQ'; +moduleBuffer += + 'i0Va5uIygIKaMTnYfURw2C+BMQj6eLvmIu2VyH0HStTQgN8hlwWn7khKLixPtV47jqkBkZWHDywPR9k3FySleQvyKFstyyVWxe3R'; +moduleBuffer += + 'VsXNeKuhXGS2OnjPgZWLN7D8xSzzms+hn9aGa6DkWVbyGh5HimoxG3ZQAtwloEw5T/rl3mI7dtxrk+OZ62k8U+1xuSZo19N8i4n2'; +moduleBuffer += + '2WUTt9drbVPi0QuuxcDJnpPUBHqULtY8SrPeGpAbjX/gTqaiV+2vA097cnCPqNCOKZhNoc0WikTnlm/VYQzkQ50iMJYR/QutvUXi'; +moduleBuffer += + 'bVPirfDb1Ni6X+qts8SbwrEBqP9pKALrSxrYjPAlgtxypZGlRSoepJY0pfZINGWuajG1Q1KRErfelNc83MkfrFvqQfhKdmi+kjmv'; +moduleBuffer += + 'G/RATRzcRleIz08zo9Gm+g5+vdbhYSqqUYEafqWoNf3YFIadUJsC4mGEC0MWmpR+gulQbBkjQW+oDhr9PYzhKKMikhEVDnYhTvCI'; +moduleBuffer += + 'EdAp7ZgEdXhartMf1bSakDqtVDpdwN2/1xkqXR9UaYx7uZsqNSZu4tj4BzTUGrrUozLlmWqRUMyVa/eCYPDLlJrmlw0PCRRcY365'; +moduleBuffer += + 'tsZ83lsG+lU7YuCWLahf4RNNgVRLtMEOZpja1JCE3yo6HH6dtfIc9I0Ed3NTEPlFwPNF49NvsEAB/d3Fck91PuYpNUzLc0Dn18cO'; +moduleBuffer += + 'qwERaB1mECrgj0+MgPZbg9c65cndsaS6Fd8b+M49tN93MWsbY1wbQUxMQ6yeBRZ13hIJizoDFvUKFov4bhmGd7/RxtabmaqFX+lA'; +moduleBuffer += + 'BW04q7nytypA6KrW+vFkLdslUtJoNIkaaa/d2JqmGKKhhQhZi0zsIyKHvfxBbZKBgahGbYLkLxUjyX7zlOn0BYMMwrrkOVLa1Ir/'; +moduleBuffer += + 'zN7ycQ2/04IXDEV1MANqBY7QkPwSgqDfzcySQKA0LQbwAK1ZBCBEPBrujKXMJiLcyFVYhvr3sLoRexbUkYL+1VKv04qrhmHAiFwp'; +moduleBuffer += + 'P67hrciKR5oTbc3eoLnChIxOJLSJEZg1NtBcoFJQanaASg11uhaJVF13Ghcyt9qhOUXa76tKgo9DgG81Vaq0XzUVqMW8Iggjl+AT'; +moduleBuffer += + 'y/bL4RB/lR59leLgk6Mifr8YZvW75OgrDfnDaDuYPgx0I1asFBEbfp+FWBhaWO4ts7eboogEGD4o42iWUvGXCaz7jRaa5eA+oNpY'; +moduleBuffer += + '9hNm45ZhvxqAS9awE4G7mLULcHVCGlLDfTW8laaXDc7piP5ytwZ0YEEf9xBwLmsQkUvbZzTIVs4IWbULtgHZLm/Vc4BsgwHZ2eGp'; +moduleBuffer += + 'RmXVmLwCqoqTUjOmroklGrIMTvJouyNQnF21hLEwOOs0v/tyr3oqWBOJJZwUjDP67hP+Zj3YRMxakW//FjEexYM8g8GGOIUq7HIp'; +moduleBuffer += + 'bgFB/Noqxqd4GK+BfRgKG2BVFcK4n2BMgW0wbRXlxpNibM7F5prFCyBTHvkBuy+TIYAJVk4LVhW0cV4MkTU26NCHdGCdpnYcEqaO'; +moduleBuffer += + '1CCa1XOlmSae4KJwI8JXytxBI8GX0zBYANxpMlkAtNnER7UMFjTrLGjlYW7EgmaLBf4MLFCbFfBxwXmyQG3sbrJgvjhXplnhXI1u'; +moduleBuffer += + 'qxFv5Q+gfARUZLfaLIuiHIsC0FbOO7TlsTSovE/DlL+e95TwTi1rd44EGt7NMF0rmSG80qUvjH++5t4DU2vSK8i/SMyq+9ss1xeY'; +moduleBuffer += + 'rBeVRrmxnDTrJHIHBv8ci04QzrmW1ZLIjHNtLzqIzktxZtCucVWCgn6xRTVYyyaNlIPIYLItW5Fjbcr/0t8smMeqNJNjZyHHlrPu'; +moduleBuffer += + 'KkYlE8VgHHozUs0gFcwhiI5vu9ZIAs5WcYtsRJ4spbZQgE9yGctii0+Dbj4BL8/xLpJ8IkcIoCYuF5/Tmn1JLzIPPpkLXnrnz8mn'; +moduleBuffer += + 'zjn59Oy5o2oLF4uUf5tikb4xkjxTnm7KG5UcMSsDJNFCTaiLViQ5xht2/mrewCNMFpnbqSrfOFlLaMvxxxiGEfXgwZYEKl5MFBDJ'; +moduleBuffer += + '/qWCpl5MLMfPXdf4e3fi8XI8vhKPu0Y8tRx/RFuOn5zMKeRGutZ6tJWGtsQ2nlA4XIzloBHyl9PdlVgbS8XMvRzbSDXKSdy/VPgP'; +moduleBuffer += + '+RdMgUuScuUD/zlRO9fiEqdkyC4RHnf+DsvICJ89bx1rnKHkqklYpENwjBMLB0gN+5cJ8+SfZxkgcNgrRUMEvoNkcbej5WlTAej+'; +moduleBuffer += + '+cIe8cAkw/Kcg5ZngAexgcMEjciBVeLmhzWQo16U2x9ZJRtmBwNUR0QnTVkcsEb9nHmGuQFbNGSaG2hPbPEus8zNiNvcgH06z7vE'; +moduleBuffer += + 'MjdL3eYG7NMO71IZikfmBjft4aFT0NKFMSgwIzRn3ehdIM2I2pa9PmiLpBlRdqYhYGd0g+LqmruaqS+M4VFTpvMzQdaSQmoPe2YI'; +moduleBuffer += + 'wHCIOcwcpw+F0sSEAxWv6MAYUKUPtaKowqswVJps1BbBRMU5w41wPWtWIn0SRB/KJ2BVrJggS+FfKHjKeyAGHwGt5Tj9Bx611NeX'; +moduleBuffer += + 'foltan1tf5ugJ2e2QcR+JOLaKb8Fo+hpzGwT1tupQEeTs5OHHRk8BOCn0Q4SBUeQQMpD1mpPW6QD4G/jU53OhrMkHa2VBMC/0Nth'; +moduleBuffer += + 'ka7RTTpoGVfyJrAXqHqwcSxJR1wEPsU4dYB01GaGYRDhkLMIxt14y2GB4p+2NwWwjFYY0Ea17WFs3dvGRTvlbTNfArraz4qArn6i'; +moduleBuffer += + 'i4qKgODtlNPXI2V9MRGVxpqpol2qAt0BZ6u9Intsm9qJq7Ae0/ti22lU7fxgJQHAqsX5fAi7oDG8lUimNrVQB9MgpxgPGDfINIRk'; +moduleBuffer += + 'WsfXxYHhB5oWWIoUiCtvAda74wzzhywuqR2UvBaNRtA+FH3ULlarpXhEs6yFDBI1ukkEcF3qdVkMWhJgEDUVAa5D3MHQYBAMAPYh'; +moduleBuffer += + 'g6hSARRv5pQDBpFrTH2AQdTQBDecZt7rhMYbOVpBpSNiL3rQUQcWRdwmaQH+yZEgOTRaKK9YNVUwO1VmHzJWxl/RQi0Xqsb5XFRx'; +moduleBuffer += + '1VWKKsuQAlrYl79BzBjzMQyIVCfPJcBZFY7dQ1OFRkyky5g+nDZEfSQwzESUPsT+eu5QDgOQ5ArVhYjNaAN9XYIQfKAPoE9jlLik'; +moduleBuffer += + 'L9dOzZSxIh6rQVJq5Ty/UVDDr7ZQ3+pGPbrZIikA5+ToqXyuAzgH2FYrnFOdBkPUSxDnxvh0nzdk4bxC2fF2rWEDcFzFPSmhRUMj'; +moduleBuffer += + 'rzCxxtHOZ5hjyqqPBGEbXIfaDVu1+JgLwLPbdQVll4V3jQkqP10FagXldoRomzaL0Qa+EYNy9VrD/lTxbmgZDnxUBfUc5aFsNCbY'; +moduleBuffer += + 'CuNdjRLOVCOD064Y3SnRwAnmKsXBSSt7raDRNog4WBoEiQVOnwyS7zOMxnkDTJpTgCZV801uaAJqfG+FDBKg2r/BjUuwgQk+sWbM'; +moduleBuffer += + 'q9QpY5fX5tcjCP42iUuapY1Rw8DrQHdUGNYcfD4wU07bLpff+TYulFOvgqPLvbcNkZBTMRdMFWICYoVFddCBcFYr09DkIRKyamEa'; +moduleBuffer += + 'v0lAjs8Rwep0rUG1WGiSS55l1CJjfoPAmL8EPaXVXGC9G02gwAYEW6+rKrPwA0akic+CVgaNSMKNH/TM83yJH2o9qnUPvOUSDqIN'; +moduleBuffer += + 'ucIFB7V+4rMHhloKT1miagdYihxgURBJotpy2qoBDcL1wI9abKp3q74C1ZZVC6z69QIQviebH9QwKXKrHgS9UBgO1s7LcJskjUBj'; +moduleBuffer += + 'sCaoditeOlLUm51hcJUgrRsBTA2eJ72PyYdnsdL6AKoKWjxRuaq0pkrNqeXZq1MFwqnoHzXvHXMotgWFnVOxQUxiYl2HlAXfarfC'; +moduleBuffer += + '0C+UK4xck6qFGv0KuWUYcaY0oDDiTBqr9iJSnLW6ulTRQFCuCa9CNhYppgNkzBXFd1YCigj3s5T0ZdXkrkk89axl7yKQCj2sQcnk'; +moduleBuffer += + 'VBCMXy7mv/245aS+NiBdculYTnjxl7MGYJYPcUoo17msRSnKtiMojXJuQWCZcYp1AsmIxZnWSRSK7W/jUk4pJS2nnOLzlJjCKDho'; +moduleBuffer += + 'Z7lMyO9tuZiL9TPSicxQ8VqUyeJgvpcHlug3tg4R6l4vFc1FwP3d9ELF51GojKN44HuIboo5Xo4cKWQgUC3jx4VEV6PDpcg7d/my'; +moduleBuffer += + 'szJ7BqKEWHTK1n5qOWWLxVSkU7bmUq35Z2vu15pTdo061dyvteXj29Rpuzpdpk671al0OYVDwClbeWI73Ks1Z2p0yl5tPWMvH7/A'; +moduleBuffer += + 'SllkpfRYKYutlA4rZfmI7ZSdkk7Zo95ydMre7YGv9qjXgU7Zu9HhetRbjE7Zu9Epe9TrQadsnlIjUhahU/ZudLge9RagU/ZuXD5+'; +moduleBuffer += + 'lJaP5yltImU1OmXzlHaRkkOnbJ6yTKRk0Smbp3SLlAw6ZfOUNSIlTsvH784/GPd2w/LxX7kyfDZ30D71YOgqP9IS8iLDqUl/ESv6'; +moduleBuffer += + 'iVj+B+E6dn146aRfxBI6J/M3Rdj1I62Tfppfy/vdk3zh+eGjYflA16QfZQknQ5P00In+Scam8PAp+dBRlpDgnwmrh46kJ/2MXzsc'; +moduleBuffer += + 'YilvibKUkc+/5S3v/8atR35VMxA9mWbXj97z+fc9cf93fhsdiH6TX7/vnT+67eS/3PjYW64fiD7CE+7429vf87tvHH3gm6GB6MPi'; +moduleBuffer += + 'F//4N0//28MPf+PbLOEET/j5yb//xMOf/sUN2weiD7Dr4VMdk34xa83W5u+MstuffNPbP/rzDz32i4qB6HH++BPHfnrn07d8ml/f'; +moduleBuffer += + 'x6/vPXbsl3//8y/d/Gfsi8d4wsd++5Ob/uPW1z/0CPvAXTzhG/945+2f+IeHn2obiB7l11948zf4B2++hf3iCP/iA+lJLCIX1vJJ'; +moduleBuffer += + 'fwGr5ODzw0dZbmJemslOCq5l0o+z4zcjUnAsIckEdywiBVfE3xkVt7leDkfljSy7cVdM3OCiPkk3MqdXxMcZQqpY3k6TiLFwTWEu'; +moduleBuffer += + 'rZ5J1q9A8Ua9JAl25C+eedtD9/3mU28sHYg+0c+ub/nMjfd/9qmb3rOcyYFfP/K197/h3nf+4LZhJgd+ffuHfvCxBz/5gXvPY2Lg'; +moduleBuffer += + '1z9+6gP//rnb7rtHiIEnfOlj7/zB17/xrt98nGXiBE/40Vd+8sbffP7IUykmBn79lfd89Ccf+N13f97Ays2vf/rPp+786Ld+dP/7'; +moduleBuffer += + '2Q/u4wlv/eLjR75y91t/+U5ecJ7wjps/ct9Hf/Evf7WZlZtff+++H9z10Y984KYkK3c/x24/R9KJMC+tz67vy076zayYifxur9aL'; +moduleBuffer += + 'MYyIwsa9MMdA0qtVfGQ44/K5KyPgEWOnTzD2DeIDKXb9K7jFUflwZtIfwlsJN3aEDDXsCBnq2BFC1LEjpKhjR0hRww4X4vBxZn1K'; +moduleBuffer += + 'WP4SFnaETDXsCJnq2BEy1bEjZKphR8hUxw4TalZR82jbJOuYROHTaQ07w4e9Sb+CkzIrTd5Cbt6aUUScrw/kJkHmzKzlJv2VmmDv'; +moduleBuffer += + 'KiLBPsFurXoxBFvMcnaaRCrp2OItkMKMMTG7iHhfd5CIx7qDRLyrO0jEo90GEY90G0Q83B0k4q+6gkQ81WUQ8Ykug4gnu4JE/GZX'; +moduleBuffer += + 'kIiPdHlVRMJqjthBbu1iXpSRMMFMOZKwwmvhWs8yPSuzfWxg0l8KhtvHZM7Kw+wVbZKXj7BnFuPNqBsjQm4aRoTcdIwIwekYEZLT'; +moduleBuffer += + 'MSIkp2GEC274FKtrMixvUQspQo4aUoQcdaQIOepIEXLUkCLkqCOFCTKl1YuLJv0uIUX26aSGl+ET9ZP+EnY8yYS0DOtElpRjauhE'; +moduleBuffer += + 'SbOHhib9dpA3u80uOjTxHls56S+X4j3Fbq54McRbwvJ2mgQrKVjj1UuRpr2cuy7sMOrCDqMu7DDqwg6zLuww68IOoy7sMOrCDrMu'; +moduleBuffer += + '7DDrwg6jLuww6sIOr5gouJDrlNX6HitijFGQV/pIwSVeDdd6julZGeqTrHGyGkx1tcbME+wVa4CZTZgcm8FAdxgGusM00B2mge4w'; +moduleBuffer += + 'DXSHYaA7uB1hlUw5y1XMNtMdhpnuMM10h2mmOwwz3WGa6Q7WQFQ1XxNvHaTh01kNKcOHqyf9PKdQ76S/Fuu+Kt7+91BInJmH+yb9'; +moduleBuffer += + 'dSBpdps9uV4T7El2cxgEy8rILkZeDPFmWN5Ok2Al+Yq9LinSJLN0zvpvqVH/LTXqv6VG/bfUrP+WmvXfUqP+azXqv1az/ms1679W'; +moduleBuffer += + 'o/5rNeq/Vq+EyNfKdbpi0u9mRUwz8vGKHsmX94q51lNMz8pMH1s+CUZ6ocbIwyuw6bQAE9MzmOWlhlleaprlpaZZXmqa5aWGWV7K'; +moduleBuffer += + 'rQerTXpYntK2cW41jHOraZxbTePcahjnVtM4t3pFWq3XMOn3CtmxT+c0lAyfKJv0Gzh9Vsh+YBlvGHejiDgnT0APnTcxj3ZOagI9'; +moduleBuffer += + '1kVt0VN047QKtZzl6jSJU9Ktk4+pwEezDKHOuq7FqOtajLquxajrWsy6rsWs61qMuq7FqOtazLquxazrWoy6rsWo61pE713QjeuT'; +moduleBuffer += + '9VH6WAGTjGy8SkeyNXidXOMlTMsKHydZV2oDIKRVbyqxV2wEFtZjcnIGU9ximOIW0xS3mKa4xTTFLYYpbvF6WH6StiluMUxxi2mK'; +moduleBuffer += + 'W0xT3GKY4hbTFLd4cUm1XiEzQbISrXYrnvQ3ccIsm/Q3Y+1WxEe/+lAwnIGH2yf9LSBddps9uVWXMbu5TbLwOLs468UQaTlfPeD0'; +moduleBuffer += + 'iFTSrZ+vKwEfzTKL9odDN41sTyQmkWqR4Ydj3B5LwvER1Jqr/HBLiDWjUrzdtih/MszOH4nxHtQiPlrnn4NJRXxEL5P/0zi7OM7S'; +moduleBuffer += + 'S5m+4vnjST5OM3w0yn8QHj7FjpVcmuw0MemLQRyBz7L8/+GjrceSk9zZOv+XPEqwNP8pfvuR5KQ/wC7r8j9NsUMlpB5n+WkUz4of'; +moduleBuffer += + 'nkzpP2T5EN84mubfYI/xn7JPsssydo+9gD+EGXkkw99UBg+VszZUI09nH2JfhAeqeOZ5aX7C33I8O8k3qeQZr6aMn8xOcjdX+f0B'; +moduleBuffer += + '/H6Oy6ESfplhBfqfCH9BBXsBUwBDE2cOy1eO50u8syN0vNovzf8TL2mZfM3x4kl2gbk5WsIvRB5ZlqRpDHulK0P3RTz+XpYE7+WV'; +moduleBuffer += + 'KX9vuSfeyD5UxpXIblROsr9PhCbljUfKeZnYA+LGw2G8EfcWsTLtFiV7Lx+FPV496ZXD6dGaSSZBcXqKZekcJtfdPP/3RZoyXi3L'; +moduleBuffer += + 'mRhq9zIrQydi/JmaSQYj0aaKiexFGZtrvUhH6OEiP8w/xkcZWAa9QU9cNnE7VD7pDcFlglueikmvGS75uCAvxUq4XMx/yy5XwWUR'; +moduleBuffer += + '6wuhYCIidwm4bCplbG7wivLvjbJnUnI2oN/LQ0sihWatmNu8ahpDZKXGGzW8ZqmhgS4mAxp7PNo/eTqHulpP4+ihNIeea9xQNHhr'; +moduleBuffer += + 'J+WoBNOzX4JC4SOdh+uolfZIrS7Gk3UkxuN1L5oYF57+EcP4H+yIYTX1mPKec6wwHhwr7PSMUcJiD8cHFxMeHumaAQ+/n+Gr0zcq'; +moduleBuffer += + 'WCNJ5RoPXOItg5EGNfqH434dJCoc61vxYomq9fSP9GX+YEf6FmqD7Y4xvhSr0LCyYrVb/oO8PkzlX8cercp/IsXNiXyySD3Jetr5'; +moduleBuffer += + 'e8VIF3syye7koN5L8lReC97LxdgAhyx/KR8dYFdV3CYvnuRvTqg8MEMp35zgdSV/GeMy/12VVwIPpxwPs4qWP8NqiTV8fmkT9EBO'; +moduleBuffer += + 'rWZNMz/MGtValVusqtximtXlVW6JqnJLXrS6gmV63aS/8DRWvHFtDOVEiLfdsOJgZV/H29thrZe3io+cMCnn5ezdSj6CWar1iQ+X'; +moduleBuffer += + 'ilthfjOvy/dkqaqLS180+VaznJ3murhSr4tnGL38/7MuzpNBKdPqYuovlLC2u+jPJ0jbJxiiaqBGjv8vqpHZB9fw+f/4aauZM4p1'; +moduleBuffer += + 'x9dO+i2yygkHRi4fDPG+nZyq41eNfp7q6xKor1P/i+rrhbwWOd31dbkUXpwh8g+ovq4O1NdxrK/Dkl58BIJpO09zchXeajC9ZdQF'; +moduleBuffer += + 'WgNMa1LmtmMmc/v7motbxXr7p20mrlibiVs9KWTGPpzScDF88vOhSQ8n4I6zc7+JZuBKvXUg0fUkwGEQ4MiLJcBmlpvTPtvWIgUX'; +moduleBuffer += + 'ZshxEmqdQah1BqHWGYRaZxJqnUmodQah1hmEWmcSap1JqHUGodYZhFqnNYDzXjcrXFzMs6VUszYm25Np1oBl7ckKmAwI02RAsbcB'; +moduleBuffer += + 'LGwrtWw2Qqum/sVq0eRPY1uxUtKLGolxr04ipMTbDNVRH9mjLSC9rSSsbSCss146zb8/2MZfGZGp3tX4S6vOWY71/wSZlgAcclp3'; +moduleBuffer += + '7FgDdsd6tK7C4UbsKvS+BEhlUUr0u6D3qqjF6q1GmqM+3jg5rHpcJxZQj+voAr3HdWwh9bhOLXgp9bjCinSiwoaO6h8S+eol+eqI'; +moduleBuffer += + 'e0KxAB7VAQsHO2Azdb1ASi9a9+tF6XhRl6tO2WXsazXO2cUCgb1o3az8ae9m1em9rMY/yF5WndbJqpMUyulDnWJQNOel+WERO8ny'; +moduleBuffer += + '4cmInF9cGWItpPBweEtsPUNEqD9yhNeBf/fdB0Ne7fCn2SH/l8lQ1oNAIRUkdIp161tC2f+zNVJDOz7UtYQYLMOtkZBfP/zFBz73'; +moduleBuffer += + '0PTV98sw22kKDfUTrDA3vPu2T4kQVQh5w/C6yMh3Hnv8nhJH+sff/cSJuEp/Wqb/+p8e/GLMkf6fHz/+g2JH+pOP3v59+V0IbobN'; +moduleBuffer += + 'q2BrFh/C7sR+K7BtQ0JEX/qlU3xtfrGqbkSu2CuXjYYISH4UgdylPHgV801bVKj1flVAM57QQqC0zC2tuEzxsrSFOi0zV38/SWcK'; +moduleBuffer += + 'o5m9I5DDqXmXDkoC5cBS8J04PBUwXjrC1Vg8LVVHyhThq/mp2Ur43AoWtwRU+oKUjEeVYiFiCn8Qgxm18GelI/5kuok/Kx3xZ6Uj'; +moduleBuffer += + '/kQ6BJ76sO49LB0F8dmwljUPzmbGKy+gF0OI5fFYg8daDXoO4KmlSUlBUxQSSqpSC+mT0pS4SH18LQNDkWpVRlLplFdpKpcvf2Go'; +moduleBuffer += + 'WS0mrGCsNB5Vqtcg7ql9kl84sKfOgP0M2F8qYM+dAfsZsL9UwJ4/A/YzYH+pgL3iDNjPgP2lAvaaM2A/A/aXCtgbzoD9DNhfKmD3'; +moduleBuffer += + 'zoD9DNhfKmBvOQP2M2B/qYC99QzYz4D9pQL29jNgPwP2/x/A/nyBMRIiobDTInWaU6dZdZpRp2l1qq1mrC1LHFenCXVaqk6lpgAQ'; +moduleBuffer += + '1wmI4pq+AjrXCY1jigBZYI1hAcfrBIwwRQD3OgEpTBEQv07AK7h+cIWVUmmlVFkp1VZKjZVSO2KvTFwsVyau92pxZWK+qkERS67n'; +moduleBuffer += + 'Kw2LlYl5Sk6kVOPKxDwlK1KqcGVinpIRKZW4MjFPSYuUClyZmKekREo5rkxch2sV1/OVj8XKxDwlLlKiuDIxT0mIlDyuTCzWXRAp'; +moduleBuffer += + 'MVyZWCzFJ1JKaGXiOr4ycR2sTPxUX+QyciXa2RLydoItFa0H0V4WPUQxJiJGAcW4t5jpEXObYjaf/QnJZbOnBbJ9sR1nTJHDT3hx'; +moduleBuffer += + '8JmhzSxSAaOcxqW8ydxFvRT8QC24LwGu7DnHlp+BfQAS2o4hOTRIpqHgRhTeqq9Ejvea5VvF7lo5Hu8qvZj4fsxyJy21l7SxTUlV'; +moduleBuffer += + '4KO43DvVK2VoO01z5se9ZsiS2i2ElnSvkVkS+wDkvTQjLmaomDJElVkCd/euRQMdzGf9DPmMTRm77xpZNXZD9bJom0wr6ae8mims'; +moduleBuffer += + 'FGRBaNPLWlkQ4dlVzWQL+3uUoFmjEiSZaYRiaAWox/owUAAqT4aZJRRKAwmF9uaZo3Bxuf7/Anf5zA1kjU1U1TbzEa92Cu27LD3t'; +moduleBuffer += + 'l1InSy/236hipU8zIhjbgcPWDAm93CXBchvb0MZwyxbYiqNh9gLTFi05r1lKq4mkpbbDXTCrMFJyu70Wtzyw1UMbUgT3i+J7+Eiu'; +moduleBuffer += + 'eXUgLbX1jdx6QMp6Wqwq75fBzj1Rh6CWzC6oViWoDDMj5ia9ppwag3KK46Y6YicktS/PHALKM16jdH2SLm1qJva7nFl4kanZ5Wfu'; +moduleBuffer += + 'XQpbndD2EJ7c2cGv8SpAumrDCLnjgITPtNhWzS+3pbtkLukauz82iAafLdiOGQWbYw0f3NFkvnJN4Y5UsN+QP7tAaXOramYKURvt'; +moduleBuffer += + 'pA3aYmQOYTdbe8UG5Q3baqjtNMSGTSTnKdrNwa/16kEby0gbcjcxqftpn+/q4xf9PrTRMas2xOZt8TkV0aMUwVr2qI2Z9bA0qIeI'; +moduleBuffer += + 'BxukiV1Y/HZDActnUEAVs8yovS7SXjf9eHbl1EzNrh9vWUAlxpaPfJcl1FCdVwnaU9sa0nZ9pVJ7fCstP0vaG5xLe0NzaG/lC6W9'; +moduleBuffer += + 'nqD2xPbnqWejuGpeH7cbels+q96acXtEsXWp2uVxDoWVsZoFtd1t7Vo6lzJrp2bXJ26aRfulwRZktCmlJ7fU8yu8UtC22pKSdklt'; +moduleBuffer += + 'kNqWvSC/2GuQeYbdlXgPzy/xBqgAsJUN33jFK+bbCUVwI+QI35sIjuvwuB6Pw3jke6+yn/Ddipg5Z+0Lljf5Ndj/KSsTbpR9RSDU'; +moduleBuffer += + 'BnzDRjxuwuNmPG7BI2wXXMT+q+PvZ0iX76/EO5X0/iKsqvjfbfj7s/B4Nh7PweN2PMK+4+Xsv1r+fmYH5ftxnziZcKMcToCWaz3+'; +moduleBuffer += + '/jw8no/HC/B4IR53iLeUsf9q+PtrAHG4SyI0e+SAQzce+/F4ER4vxiPsvV7F/mvmr4Lth6vwZjMeu/B4CR5fPqKPYlSz1iv8146s'; +moduleBuffer += + 'hz5+NZKH/71U/L1MPM8Dc1JYsXFOQv8/j4aV/xU7trMGWxwbI5zpMGIA/RtooLDuj9jUkdsN2MQJtkgaRGPE+1WsvQm2KKmGh2CL'; +moduleBuffer += + 'Z9wSCfeco/GsaNBAOZ9Rwyn0NPXV0G7B72KuX8esTzXO9RNl5ejHOTsPamRmgfXCuOu18Zmz1DO/N7yCPknv8u285u28qrGmlhm+'; +moduleBuffer += + 'lHJ9LzWPrC99Ni+8jPJBr77ULlO7XaZqu0y0yyFWE4kXumQ04Lbw2b8/Yhf05XZBL7EL2mUXlLaJVTlSIw7ePPIWmS2Hz04Ui57r'; +moduleBuffer += + '515GOaYPX2zL6CJbRv22jLptGdXYMlJDIIufXaZhbFSNwj9PkbU9v6/voGJQPi60ZXmBLcvzbVmeZ8uy3pZlrS1LNVSw7LmUBmsK'; +moduleBuffer += + 'e4LjeYp2xQuRmXOpbJSt7bbMz7FlfrYt87NsmW+zZV5py7zIlnmd3IL1OZUPqm41y/SCy773hcvbVio85XKLrZTNtlI22UrZaCtl'; +moduleBuffer += + 'g62UUlspWVspFZo2+p5vcaHFZU8lvfCaWfVCZ3WEREOZHrZVtt5W2TpbZWttla2xVbbaVtmArbJiTVclWnuAdZemXhgZiEb1SIia'; +moduleBuffer += + 'H+w0r061iTD37Jc25RVRp9qcmDYRFlOn2r6fND0mDvrEk+gt4Kk2rYXPaZNPuCmnPdFVa6UUWSl1Voq9Aag9YVZspWgTeDT1VS2n'; +moduleBuffer += + 'vi7HSaN2PivEJ5m8y/m8mJj62olTX5fjJFaLSMmIlCxOfe3Eia7LvTqc+tqJ01qX84k0MfW1EyeoLsdptgqRkhIp5Tj1tROnvi7H'; +moduleBuffer += + 'ibecSImJlDKc+tqJ24Ze7jXj1NdOnB67HKfi+NTXTj71tROmvj6+MryYT3wdjV7lR1uYdodzYp8/XAXdiwwnDk02LfFCrZGGpmZ+'; +moduleBuffer += + 'qGlq4YeKpoX8kG/y+CHXtIgfUk2L+SHW1MQPoSY/up69YwkP8I+OHGb/ToQGIi/na7L1R87hCwWE+iPniyXa1l/lt/ZHLhrmi7N9'; +moduleBuffer += + 'OTSZvznt80Uj8ufVD0cONZUOh5oi7F0Rr3Qzf1drZGtTmB82NkX4YX1TCT+sbirlh8GmMn7obSrnh86mCn5ob6rkh9amKn5oaarm'; +moduleBuffer += + 'B6+phh8ammr5oaapjh8qmur5Id/UwA+5pkaWwcX9kVN8YZhF/ZFf8mNLf+RX/NjcH/ktPy7sj9zKN330+iNH+LGpP3ITP/r9kcP8'; +moduleBuffer += + '2Dh813fuuz026cf6Rfkbht92y7dvSU76cVZosRjWXx757ddiV/kJEEjd8GMP3/fx8FV+EgR1MsL3QooOn4rw3ceifONNvwhE5Rfn'; +moduleBuffer += + 'P8mzwH55NZ+t649cyQ7sO+PswF6/m5fiZKQpxo/fjTTF+fGJSFOCH38caUrOI/tJyHUCMhuHPMZ41nJeEbNoUb4Bq8hGK5NTU4of'; +moduleBuffer += + 'fxlpSvPjr/jS8+z420hTFl71W8yukGAcJRpDCWcxKxnMShqzksKs1A4/dtNj/xAlSdYM//z9D301TpKsHn781zf8NEGSrBr+6INv'; +moduleBuffer += + '+VAcJZmHDJPEpiBHfwQZOAT5edU8JDZXNueW2KnTJbHK4Sc+8m+fi1wlJVYxfMPf3HZ7mCRWPvzZN3/pHgYslFjZ8Bd+85f3MYk6'; +moduleBuffer += + 'JXZrGLJ0JAxZuCkMWTocPi1SOxw+TVIrHf7lJ5+6I0k4Kxl+/Xve8FTyKim1yPC3fvHWexTOwsO3vvfok9EZcPYelNpdKLXbUWpH'; +moduleBuffer += + 'T4/Ujs5Xao397KPcPvWzTHC71M8yxe1RP8skZx9KtQalWo1SrUKpVmJWKzCr5ZjVMilVFCbKEEUHNu6RCN+eWErufpHdRyJgk78e'; +moduleBuffer += + 'AaP8zQhY5ccjwiw/XyU3Dn/uY29/LHyVMsu/PnXz68NXKbP8pU/d/HRoUpnlL3/h43x/FaeSP4ZKvg+VfC8q+djpUfKx+Sq5FpVc'; +moduleBuffer += + 'g0quRiVXoZIrUaoVKNVylGoZSrUUs1qCWY1gVsNSqihMlCGKjmfVod4qVG81qrcG1Vv7Aqi3dvhn37z3ZxGtrvjILY/+c0yvK/75'; +moduleBuffer += + 'we/FJ1Vd8a9v+/7fJmdQ76dRvQ+gev8K1Xv89Kj3+HzVW4nqrUD1lqN6y1C9pSjVEpRqBKUaRqk2YlYbMKv1mNU6KVUUJsoQRTeD'; +moduleBuffer += + 'estQveWo3gpUb+ULoN7K4T//9s2fTWgV2zuefOCz8atUxfbA8SefUY2qsuG/O/yuN8RmMNFfRvU+jOp9CNV74vSo98R81VuK6i1B'; +moduleBuffer += + '9UZQvWFUbyNKtQGlWo9SrUOp1mJWazCr1ZjVKilVFCbKEEU3g3rDqN4IqrcE1Vv6Aqi3dPi2J555OHqVqoH/7tv/9mhEq4G/9qUP'; +moduleBuffer += + '90+qCvgHj957T3gG8j6O2v0mavfrqN1HTo92H/nfXwGf9qr3DXc8/pmI1iN64MEf8+4NVb2/fewvfxjTqt53vOvk3TO1Sn+M6n0C'; +moduleBuffer += + '1ftdVO/J06Pek2eqXqvq/fr3P3xfQqt6P3XHfZ9IalXvoz/55c+TWjftNx/82x8nZrDNv0X1/grV+0tU76nTo95TZ6peq+r9zp8f'; +moduleBuffer += + '/s+4VvX+9Sfu/Jxe9R794dd+EtWq3m8//k8PzdQ7ujUCWTqCWbgJs3Q4cnr6lJEzVa9Z9f7gL/7qyYhW9T7+5Lv/Ua96f3P7338n'; +moduleBuffer += + 'pHV+T534yI0z1b3vQfXehVm4HbN09PSo9+h81fsSqnvvfP07vhLW6t4j3/z2z8Na3fvln97zyYhW9/71Uw9+IDpTtxfVex9m4V7M'; +moduleBuffer += + '0rHTo95j81XvS6ju/cTdpx7Wh0j/4ev//t96t/ertz/5uN7tffI7f/f5xEzdXlTvA5iFv8IsHT896j0+X/W+hOren77hs/eqkcmK'; +moduleBuffer += + '4Z996Y4vJrXx3B+/9f9+K6nVvb/6zX/cnZyp24vqfRiz8BBm6cTpUe+JM3WvVffefPimX7OWsKwuhu/44Gf/H3tvH2TXcd0Hvvv1'; +moduleBuffer += + 'vt+8OzNvPoD56nsxAAYkQAw+BwQoEA8SP2BJpuwwjJLSVmmrlAproNoiGIRW1ULk2IIUJCvZk1pWGbb5xzhmTFRWyI5lJgXHcmmk'; +moduleBuffer += + 'MAnWUuKplFxBEqY83jAx47BckzWdwFlG3PM75/S9fWfeAwh9uLYq4Mfc1327T5/T56O7z+0+/W9pamXHje7fuPELV8LzqR1Auj/7'; +moduleBuffer += + 's//wOzS10pHEYa+vfeZpnw1qn7Wlz+5Kyl1R7TugDZpdi8ku0zazi8ms8c3uxWS38cyexWSPsj5WtlNfzSwmM8JxYxYTI0JgksUk'; +moduleBuffer += + 'Ebkw6WKSmrnEawYRf6A0Pq5I8hfnSqW03R2/SH209L3gQrd68Xn6WX2BU/Rr/IXn+ZOn3w0XE7/pNUr0LwKK78Jn2BK+4o3TYwYf'; +moduleBuffer += + 'XEv4+BXTYzc+rZbwxa9KjwQfUUv4EIZvo8sBvpn+8kF/4qXdL+4qdddDvojbP4PPnUt+Wu6ulc61SqbUveovki0vda/Rcyc9r9Bz'; +moduleBuffer += + 'wpT2Bdf81JwNLlHnmLP+peQBeniXkge7/37zm/9bOSl3/+jmT/9CkIx2v/avr3y7kkTdd3/7p/9VORnr1mmIoOqrfpok+01C3Zkk'; +moduleBuffer += + '08i54qcz+Oy6L1j209nkgJlJHjKzyV56HqTnHN5c9dOp5AR+rfjpZPKwmUrmzWRyiJ6H6XlEW6lqqzXFoq5YNfR9U9+39P2Avm/r'; +moduleBuffer += + '+1jfD+r7IX0/HJwx4yE+Be9ZIAzoeWCBOgKf01lCPUjS23wRF0uoB/3bwK3cN2gUwxPfP+UmLzJ78Z+UEep9DbcS0fONgISVnjdw'; +moduleBuffer += + 'qx49vx6Q2fXMQ9rUXm2qqU21tKkBbUqUgTU0B9xUwC0FPKCA21ThoAKeU8BVBVxTwHUF3OgFuKqAawq4roAbVGFGAc8q4DEFHCng'; +moduleBuffer += + 'UQVc7gV4RAF3FHBFAUfo1etm+PpZ86XLxnyRd1W/1o1/Chkm5V+X00e06fi6GZSS019Mp92S01ryQ4rcwwsBI3ViISggsy+gxo/i'; +moduleBuffer += + 'SUidQj9fN20B+WAfkKe18eZ105KSu/uU3K2NH9LG53s1fkwbPw5eXDcNAflAH5D7tPHqdVOTkvv7lHxAGz+ijR/u1fiCNm6wx+O6'; +moduleBuffer += + 'iQTkrj4gH9TGR66bjpRMvsgb2rOSiZbcr41PauNTvRrfpY2fhIaZU19MJxlUU0BN8q/L6ZSC2mOO9imRKlqDKoCxCuCwCuDQNgG8'; +moduleBuffer += + 'obr4ddXFNdXFN0QX95rjfZqyhuAhc6xPib2KTEuRaSoybUVmoBcyTUWmpcgMKDLQX2Pm+jRlNfqgWehTYl6RqSkyVUWmocjUeyFT'; +moduleBuffer += + 'VWRqikxdkYHOz5qTfZo6pMjMQHp6ljisyHQUmRFFJlJkKr2QGVFkOopMRZEp2okP2SarP3U9PaKN4vejl63lzizFI27ZM07Z6cuK'; +moduleBuffer += + '4CkV2qPbhJYQ2JPbDMdW7HaB7naAnrII5NbitFv2EafsjEXguCJwrBcCxxSBbfYiBzrrAP2QRSC3GPvcsqedsolFwCgCC70QWFAE'; +moduleBuffer += + 'ijZjvwt0nwP0AYtAbjUedMs+6JTdbxE4qQjs6oXALkUAdmPK7PliOsXAKj913aRsJPg3WoJpEDuUlZjKX9ohd1gFckgFclAFMu41'; +moduleBuffer += + 'cN1pDD8Aq5AjI2Ykb2/vnZCxw3RbkRlQZFqKTPNex/05WIUcGWPmC8jM3QkZazcaikxdkakpMtV7nSvsModcZA6zGcnbO3QnZKzd'; +moduleBuffer += + 'iBSZiiLTUWRGvv/5xTRk78hlK45xZrB4EDuybZbxKF6f6Vd+Wqk4qsK7p5fwnlDhfbhgP2YAZ3c/wLu3zThO4fUj/crPKCJ3tCOu'; +moduleBuffer += + 'IcvtSAI4s/0Az26bfXwIr0/3K58oIne0J65Bc+wJ4OzrB9hsm4k8gNcP9itvJxF3tCsL+byEBviH+wxjJ7Xp1Jy4yyThnuYjwyqg'; +moduleBuffer += + 'QyrAgyrAMQ/w/aY+jyoye8zePiXOKDL3NB9pKzIDikxLkWliEtt3cnTKrjT6To4eUWTuaT7SUGTqikxNkamyXTncp6kPKTKH+k6O'; +moduleBuffer += + 'Tisy9zQfKSsyo4pMpMjgFsTB62Qq7GrkLoPh8HUyQ1z2SL/BMJuPnFChfbjXJPrh3K6QcSATIfbEBbrfAZpaBNrXyfxsn7s85JTd'; +moduleBuffer += + 'bRHY03dCRAgcUgTmwdfrZBrswiAHutcBetAi0LhOZofLzrpl53pNiI4pAsd7IXBEEeAbf6+bMQE65QJNHKCzFoHydTOaLTPzslNO'; +moduleBuffer += + '2UmLwELBbkyLbUqmrdWhuRBP+vZfTnbjbPCXzEOXkwfFqu+9nOzH4aovmbnLyQMY4miZdDlJDM/Spi6TuXkYw2E+Oh5gy5INgMmB'; +moduleBuffer += + 'nuMiGfBD5lG33rw5U6i3t3e9h8wRLLbc0fiRQr253vUObun4dBLz7jQrylxIpzC/nclrzfKJT52d5dkzZrzrnU/Gm14EdxQ8RUkq'; +moduleBuffer += + 'Dqdkn2FnwiOiixDs0eM+hqnycX9erMZ+MSJzYjNmxYQYMW+TYu3Gxbh1xNbFYoebYparYoVDMcolw06Mzxn2aTxn2FfyrGHXyacN'; +moduleBuffer += + 'u2Q+adhD8wnDvqAnRSfgIaIF7g3P8AJ3FU+aM1zDE5MWPGlmcxVPmlEte6LDVzzR6SU8aYS87YlgbeJJC+e38aTV+waeNPTfwpOW'; +moduleBuffer += + '3ut40hzjpicj6ho94ahLm2aiW13cF5QWApAywb+W4Ie66mPf/Q737Q7+tYy31/xFszN/t5OeyZQpmX1nORaJuXIaH8tKZvK0zwpD'; +moduleBuffer += + 'k+lb+rypzxu6uGcl2Xc2oHqn/XU7lTvtf1fyfc5fy/PfkHyP81fz/Nf93Ismxyz4kxX2UadhvFzOfGu4UtjDLjTK/mookoly/mL8'; +moduleBuffer += + 'pxG8u+J9M0H836JuScz2apDyNPCrQdo5n1K2iUzl4xOw3XP+q/gyEV5clDFvmVJ4XiVUIs7mIfE93K1Kz8tZdlUyNv1FSqb8mxCU'; +moduleBuffer += + 'MYosRrSY1Kn5UZKVMXgUu1fCRVM2tcW0gY73hSndq5xbX0xH3NxrnFtdTDtu7g3ObS+mFTf3JucOAK081zT41xLkfIR/LuNnh3+u'; +moduleBuffer += + '4GeFf67iZ8Q/1+jnWbhF/+nf+4Xl/1Ra4CHxLPyi/+Erv7B8ZCH3czJbqFXhiA+zMEr9/3iLWbePBkepjN83ggUZS0tmlBCPN6h/'; +moduleBuffer += + 'um9j95RpZpJJ9mPJZ/sK0MsEmoH2B1bpxosAFZmWC2Q5B7LyQYAYBoLiq0zOWrh4tyrzXGUMFmzMlAmNBMSfOZ+MNr1GA/LWDBr0'; +moduleBuffer += + '49U/+WYp/lt1vhW03PUWeY8IfvoXF+dgd7rr4X0X/X0X/X0Xvbnvor/vor/vor/vor/vor/vor/vor/vor/vor/vor/vor/vor/v'; +moduleBuffer += + 'or/vor/vor/vor/vor/vor/vov+zc9H//g/PRf/7PwwX/e/fu4v+9z+Ii37zZ771gVz0K4nvvfQ4XPQbtfOpP4tt+mtAhuhKw7Ml'; +moduleBuffer += + 'GMZSGsS/SpKOKnhRTSuIQCd5G5IXp1Getyl542k5z1uKOM+k1TxvWfLm0lqet0J5JbQRIOCdwqM8JCuSXCtLMlIoFUmWFSFNViW5'; +moduleBuffer += + 'WpVkTZMCPnbBL5UL4NeL4FeK4DeL4NeK4NcE/LgLfrkIfqMIfrUIfqlaAL9eBL8u4I0LfqUIfrMIfq0IfrkIfqMIfkPAz7ngV4vg'; +moduleBuffer += + 'lyoF8OtF8CtF8Jtb+h46QUN1SPD/+/t//P7vvP/+n/6Nl3DpUuns//G7iEH4jfd/4yWFRGWR//77v/M3/9P77//utIIIJPvVd/7R'; +moduleBuffer += + '3/+5775+9Q9KSqYv+d/4Oy+/8jub/+I339L8dU/y/+W/+nu/+NZ/+Y9f+bbmb5Qk/xf/2fvf/pXfemNpp3YPMISdI6GHKafJQZiG'; +moduleBuffer += + 'l0z49HXcE0LplRC35eBHlJbxXA/TKtW5yXUupbVLaQMBI+9G31Jv+jb70LcR9KEv6E3fWtCTvhXKDkzlmev0+5qlMiLiLtFgDWoD'; +moduleBuffer += + 'pW4zSutU5paUqZraM9QBA3izQR3Al6YQhIjflk3jGUDg7liNLqVt3MpBv5eoaI3KXRUolLNMvYm47yE3efdeWg569tJSn17a7CMF'; +moduleBuffer += + 'G37vXlr3e/bSKmVXTO1p9NIVtwcupTF3TgC6AlPlfqQRSfqxxUQNsoj73I/dt6V20wxAgJpcOdTeWSuTqNAIUmYot6UvI1MHFBW2'; +moduleBuffer += + 'pTLzpXvDdnQ77+g16eihS2AU9WzA/OleC2xfrwT31tcrfs++XvZ79/VSn77e7KdxXs++pnkU9fUA9/VVwb1uBpjMYe4Cpqtm6tJL'; +moduleBuffer += + 'UqJmYiaqwwKp3BjiEjd95cZgzo11T7hx2/KyCW4MMfjI9l8F/IlMgzG5WdaSLNnKsHVmWBl8hmCUlWGtZ3KGLSvDbvZg2Do1NXIp'; +moduleBuffer += + 'Hb2UjhHnmEM+C1T3hm95turfG89WvZ48W/F682zZ682zpT482+xtJddL4FnM3XBNcG+bmCkd515gugZAPDpKeDZghpmoHawEvnB1'; +moduleBuffer += + 'jEu8bbnaybm6rlwd5RK3vAJXR1Hi08LUK5EKzRCYOsbtR9rBGxVIAPMb4lXRkk3hGPN9pcD3W734vlHg+9VefF9Rvt+yfB/J+b4h'; +moduleBuffer += + 'fN95KZ2gNYfK3arH8t296VnWr3n3xvoz53txfr43401vvsc92d6L5VeYzck0M8+jNTRpE6OeGDBQ3iYgiHlJC2oSa+6pZBfKys9Z'; +moduleBuffer += + '5DIXkt3IlZ97kMtrwWQv90Q1mWPdrNJ6HOlK8gCnK8mDLBp+sh99LY0eAHYC6CG0Lz8PIldgziNXfh7i6tXkMEtJNTnC6UpylPnk'; +moduleBuffer += + 'Jce4GS85jtpC3gJkXH5OcS0vOQEpkKyHQbz8PAmUpPFTKCAtPoJc+fkhbqSanGaBqSaP4vlccgaPOOlSwXEudxYZJvkwZcxxxkeQ'; +moduleBuffer += + 'MZ88RhknOONxUFTin09gUQDNQh+KLA2ZYRa+J7kdD7fNxWocr4qyxmb86UxZl1RZJ8XA+qqsO3Jl3VBlnRBV7KGsa4EO9JEag7FM'; +moduleBuffer += + 'F1erkPg6FBd9VdECg6I8rKWbBS291ktLVwta+nYvLd0saOm1Xlq6qlr69lYtDcxOMUQlNTOjMgiLuRbN5WnRGdHaW1KugqxPpKS0'; +moduleBuffer += + 'Fe6LSVrPUjeYx8wJOAUIkSkTmif53RT4MENdj16czllAqm72mwfNA2afmaOOIStm9hIPx/j1GHgjnbfH6bW8v3Y7HZV30azTN3mv'; +moduleBuffer += + '7HK7Q4gn2mtsYlPLUJ7B4mQ4eiSxgkB85t4YADOHWVaewPl8gTa8ENwA3R82x80xndGUZco4ao6aI+YwxgfC4BDRLYTF6FAhbD4n'; +moduleBuffer += + 'rAyJEMIO9iTsoZywQVDRMp1n4LWsWcKqEMQKaDOGnuOCfAWdEGJaYR6m55TkhiCUtcU8ToQOCYSBhWANxHTNGWqUBIH+Vp/h+cKj'; +moduleBuffer += + '5jQiClD5D9EzdglpU7lH7HhPmKFnmyDLnMoJaUKaZWJ50s4oFeWQyVugt0oeo9xilD9Cb5W81kJwE8jxaEcgMFkkmDSHF/mtqvwK'; +moduleBuffer += + 'bjxf36xC8srAAXpRVb0oZygF2Vz3dsmd66rSlEBKAwiYsw56C8F6jX1fhIK0T0OXNnJbGgl51nvpEm5S5fxi2wvBLdiMpdpiigDn'; +moduleBuffer += + 'q7XF+JZn4JmYj//A24kpYw0eir8ND8XH4KFYrdno6GuykhQPBbsqeD0asIfCh/egateoAXsoYGPZG6F5m5I3zp4MzYOHAqaXvRGa'; +moduleBuffer += + 'tyx5c2k9z1uJ1AsS2VVywB6KyC58A/ZQRHZZHLCHIrJr6IA9FJFdFgfsoUCyrsnIcago+KVyAfx6EfxKEfxmEfxaEfxapL4ZB/xy'; +moduleBuffer += + 'EfxGEfxqEfxStQB+vQh+3bp5HPArRfCbRfBrRfDLRfAbRfAb1mPkgF8tgl+qFMCvF8GvFMFvbul7EouAPRTRXSZgQW8PRdDHQxH0'; +moduleBuffer += + '8VAEfTwUQW8PRcAeisB6KCIg63goykjDQ8EvViIaWwL2UNBMOvNQ1Fnrq3elr6eHIujjoQj6eCiCPh6KoLeHImAPBRtc+n3NUllW'; +moduleBuffer += + 'D0UgHgqmbjMiAxlYDwUvEGHxAvFQtLkzrIeiIhZYugMeipgXF+KhIPNpPRSBeiiqdhp+917q6aEI+ngogj4eiqCPhyLo7aHgcExi'; +moduleBuffer += + '/en3FbcHMDMIxENRp46rcT+qhyJSD8UQi7jP/Wg9FLxYw+gbiIeCewceiqZa78B6KMoYqS5dUmETD0VgPRQVXQZyR69JRw9jJAus'; +moduleBuffer += + 'hyKwHopAPRT30Nc9PRRBHw9F0MdDEfTxUAS9PRQcEpj6eoD7Wj0UDfVQdLgLmK46Rkb0kvVh2JVqIB4KcGOYS6iHIuIFq3IDHgpw'; +moduleBuffer += + '47blZRvqPMzgI9t/FfCnzLOjwHooanZuwQxbZ4ZVeLYXWA9F2U4emGHLyrCbPRgGD8UYz0lHMO8MxEMxCPb6lmfsobgHnvX0UAR9'; +moduleBuffer += + 'PBRBHw9F0MdDEfT2UATsoajy7DKwHopYJpm0pAnEQzGI8EfMkcxDIUuanawEvnB1hEu8bbk6mnN1Xbk6ziXUQ2G5Oo4Snxamqoei'; +moduleBuffer += + 'wQ6QdITbj7SD4aEYEn5DvCpaUqeRzPeVAt9v9eL7RoHvV3vxfUX5fsvyfSzn+4bwXdwTUyp38FB0ICieZT17KO6B9b08FEFvD0XQ'; +moduleBuffer += + '20MR9PZQBL1Yro6HaUireBtmoFBldVIE1vGQILeiTorAOh52MYHVZJZVrprs5nQl2cPpSrKXOe4nc+hCcTzsg1zIzwfAZYH5IFCR'; +moduleBuffer += + 'n/uRW1UnRWB9EA8xpGpykOWgmsxzupIcYk54yWGAFZfCERZELzkKlCXrGGBKo8eBSkWdFIF1OJxAblWdEwE7HE4y/6vJKTyfSx4B'; +moduleBuffer += + 'tJK6JAL2d5wGVGngUUbLS84ApGR1oUSe+iYCXUIkHwaeVXVQAM9q8hiecE8EMtVPnkBGnDxJGeLbOIcMk/wYZYhv46PImE9w8YT4'; +moduleBuffer += + 'Nj5O3A3sAjvA8jqTufTHkXEGy5kqVBXcE+EcxjKQZPIpptSDR2BQra26PAbVoSEWW7V/Siy2dXnsfDqzDxuq/ZOi2z20fy3QmUOk'; +moduleBuffer += + '1mUkU264PIZJiYcYRXV5xHZ9yWq/WVD7a73UfrWg9m/3UvvNgtpf66X2q6r2b29V+4gdEYF1eUR2qSz2P3NWTi0ES3DDfoxWw0fN'; +moduleBuffer += + 'nNlr9pjdZpbIGWaPwjDTzQNGpCSnDq05lYlDXk6YcSjKaZlxiRCUCeM6W9ppywaeyFpHxQO5o2IAnT/I1B2npzo1BsH6KvPzLD2f'; +moduleBuffer += + 'etouvUfhD5BxuaSr1h/XnlgIroD0H6NV/2GdBVVkmjluDpl5c5B6DQPIQ/TMeiHUXjiQ90IE7KUX9vfshQfzXhgCybLs30eUtrK+'; +moduleBuffer += + 'qUOiqewxONKztXtLNaELSp+x9MdmlD3rH6e3o+otWQiWQcyT7KUgXlsHzbA5ZU4S0ZH6RoSQDgjhxb45ga0qGSFVuKiegafCJaQs'; +moduleBuffer += + 'Pg5zxM5C2X9RU0IeRaxBx5XDI7H5qAy/6tW4CuQeJ6SGGbWKTOYfU8TgAZGxuS3aD8Q+rI4ZQSHSb0Qfgjcjc6yUpWlzLnfCVBaC'; +moduleBuffer += + 'FTQW8ZROQMD9IrbAei7arufiCeyFeVp8FtdqBg6IJfFWBHBbzJYay9kuih4+isj6KMIePoqwh4/C+hRcH4V1BLg+Crt6d30Udslt'; +moduleBuffer += + 'fRSh4/OIeDB1fRRh0UcRFn0UYdFHEfbwUTjgl8oF8OtF8CtF8JtF8GtF8JmPwgG/XAS/UQS/WgS/VC2AXy+Cz3wUDviVIvjNIvi1'; +moduleBuffer += + 'IvjlIviNIvjMR+GAXy2CX6oUwK8Xwa8UwW9u6fvMRxEWpmBRHx9F1NtHEfXxUUR9fBRRHx9FdBcfRag+iugSbzTIfRThPfooetG3'; +moduleBuffer += + '1Ju+zT70bQR96At607cW9KQPPoqw6KMI1UcxYH0UYV8fRdv6KFo/gI8iwqQo6jER79VLy0HPXlrq00ubfaRgw+/dS+t+z176YD6K'; +moduleBuffer += + 'sOijUJ9x7qMAJPVRtGRV3Pp+fBRwPHxAH0XbbPFR3FNfr/g9+3rZ793XS336erOfxnk9+1p8FO2ij6Jd9FG0+/koRnIfRVj0UYRb'; +moduleBuffer += + 'fRRoK/NRtHr7KFofzEcxUPRRDGzxUYBh/XwUo3aa2t9HcU88W/V68mzF682zZa83z5b68Gyzt5X8YD6KdtFH0d7qo2jrvNjxUYzk'; +moduleBuffer += + 'XF1Xro65PgrL1TH1UQCZoo9ivKePolX0UbS2+ChaH8xHMVD0Ubh8X1G+Zz6K0aKPYvQD+SjuifVnzvfi/HxvxpvefI97sr0Xy3Xl'; +moduleBuffer += + 'PqPrengldF0Pr4Q6E+CVUGfGLpM5M2ZN5szYbTJnxh6TOTP2msyZMafOjH3qzHhAnRkPqjNjvzoz4JVQZ8ZDJvNgHDSZB2PeZB6M'; +moduleBuffer += + 'QybzYBxWD8YR9WAcVQ/GMfVgHFevArwS6lWAV0JdCNPqYHjYZA6GkyZzeZwymVMDfoqrdutE5tQ4rU6NR9WpcUacGl3xNMA/MW7d'; +moduleBuffer += + 'E/A0fMRYT8Nj4mmAc+KEdU7YXRRPYjNfb5fCOetSiPq5FHbkLoV20aXQVpfCTutSaG93KTjKus2lMJ7p4j24FFpFl4KrpasFLb2j'; +moduleBuffer += + 'S2Gg6FJwtXRVtfTtrVoaFl0KoXzqt+ZaNDdUFw609pb93MxuHlLaquyUUJfD47weJUWmNX9kzvG7afDBUNejF2dyFmBheiDbRyHO'; +moduleBuffer += + 'iTniYbbJYlA7b+8250SL91bkHZV30e5tzokB3lvhdIcQz84JmNhdlqE8gx0gAZjgvRUqCHZDSRvM7LCsPImVrUDrqL/hI7S4Pl70'; +moduleBuffer += + 'N4zRsh/7KGIeLg4T3ULYYO5vOJQTVoFECGHzPQk7uMXfMMBe7ofsxkv1N7DvwCT03JF5S7APA7v6TtJz+mnrFBgQbaF1ctv6Jtrq'; +moduleBuffer += + 'bzhrutTomOtvOGMeJaJB3Wl6DrqEYI/Ih+x4z9tBKjTrg7/hkZyQFqRZJpancn9DTZzxIO8EtpA8k6MsGxEfw4o/2+LB/gYe7QgE'; +moduleBuffer += + 'Jou8QaQs8mudAIKbfBOrQvIq7EywLlD1UwhKYTbX1V0UGWasNCWQ0mR3yIcd9NQXIbs/uP1LsknHZL6IyPoiKrriKLbdzyNxZcRv'; +moduleBuffer += + 'vzQGj8SKbz0SNNh58e8FunDz+ecx/zO4JuWY/ymMNsf8SxhpjvmfxE1Hx/zPYbA55j+N+46O+RdhvI/5n8AAdsx/DuPXMf9juDTn'; +moduleBuffer += + 'mP9ZDGHH/Cdxdc4x/1lcnHTM/wjuTcKPT8PCHfPPpKMvpsOn+ZZqM4zDealvhgwyX8MukBEz8WLaeY3vVLmclTGe8c/hwE5HU+FH'; +moduleBuffer += + 'F1F61OyUioBhKxKMHS+mY6/xtTp8O7ZnonNkHjJQUllg+QLLN2OcJA4gGRLoREBHZqcFXaZWFHSFWhl/MU3pZ03v4vZM9ZxAF6Ak'; +moduleBuffer += + 'jcMKM3JbjKQJ2yKxUVrkw4zwXSEZEQJGECibCeDS4VZ3gGIgUCVcLAKEy8yL6R762ZCbrHEysYCL4ECaMOyiYDFSFCxGJGYuRlWL'; +moduleBuffer += + '0R5OkrIgWSYEpwXBCiFoBEGyFMB1jLEaB65AsE64WgQJ16kX0730s6W3b3um2QNXwRGGxUXRYqwoWowVRYsxKZ6Lcd1ivJeTZEaQ'; +moduleBuffer += + 'JMNtdgsBVSJgWgioEQFGCKBZNWhJGeudloAm0WIJIFomX0zn6GdbbxT3zEBfWoQGMszDLgmWIiXBUqQkWIqUBEtRwzRdipqWojlO'; +moduleBuffer += + '0ioZSbLeZvbFdJSpmrC01olApbVBBCqtTRpKldYW0ToltA4QrZNCa5to3fViOkI/B/UWdc/Ed6FVaIQz2iXR0w5QEn3tACUx1A5Q'; +moduleBuffer += + 'EiPtACWxrB3QMgNCsXTAgKV4hJNtM4gkqKYOmFCqdwv6oHpaugVUq5K1zJRVsgHqgEnpljZ1AFE9JFSv3AvVQi3RPuES6ymGSqyv'; +moduleBuffer += + 'PaPEhtozSqw1d0psWXtGia2YIZdYaN6soArNI2J3MN3TENwJpnsKxI4w3ZMgdlS5TRTuBN16UfoH5mtbMcj4uqPI14kiX0eKfB0t'; +moduleBuffer += + '8nVnka/jlpgq8YiIGWe6psA5oWsSxOxkuhJQkIAuvfLdM+27aWFLcc+0cLyohTuKWrizqIVJUQtnLLIVwpCQnWG8J4Gs4G2AoQHe'; +moduleBuffer += + 'ejm9Z1r9bV5Dccts3kzR5hVQDY0p2rwpi0yZMCBkphivaWAwDbzknnScz+01QtS07WyEmCqOENPFEWLSNhbRzJcam5RR93VpoVYc'; +moduleBuffer += + 'D63EZuPhZHE83GWBhXq3+5AO2JVziy4g3ADfLeHCLHi9uqXuWin+2WAnjsTTzyfCM+oO8xbVJePhvCsftcf9Ux6OyfI3ZtSmun/g'; +moduleBuffer += + 'pVIhiG/ivDaA4+n7L4kfjmrjKrTuu/KzLIt2/KzQz/fkZ9U/Q3XCZqnRLdEf3JmG1f5ZPhvM7j/782r286ycleeLvV7RK3V5HPF1'; +moduleBuffer += + 'bIx0PK/qHKOiM5qyzo5o7rHkMeFG6IY38c50d3EiU/0Qgk+8KPhlGeOL2RqXM2R5K+/eEWo9aYK4FnTXf/ubpfgLdVPSo+8zL8S/'; +moduleBuffer += + 'UYt/KRBfKGais37tJQ8z0fh8Wp0t+S/5Z/J/Tan7J95TIfUe/fpn7/+vT7UqiALaIAnpfu4CceLW6/+4RG2mtcdaYXcmqeDs/Pkk'; +moduleBuffer += + 'pDLvvv9+5eNEd9TF4fzqC38lLZ1/oetdoFfexfPd04tJpWEqXf9i9+u/9o9LQDz1HkNLSanp46g0QeruoBLeC+cJaqU788TExSQI'; +moduleBuffer += + 'gJU354fUPqlRhDCl9DhPv8On6LeX+Kachq0SGE6pUjPkODEdKoCS6JypF7rhhUXqW270iQm8mEjQgx61YLxWqUH86H5XafO7MdPc'; +moduleBuffer += + 'vR0A+8a5iTTqBi+kpReoF4ILIWPUfemvMnGkY93gYlrqfudrRFUaUIXvfs3SN+dX0xDCQAttxJxgoaratozffdGUf+oCSQVCY5W6'; +moduleBuffer += + 'wfNysRrxsoTIrGHX4xzqzsUm9V7UfVNQ/HgrYG5xB1qWlB5rEcnPFnrYl44THvmJx71JmXFaor7z0U34QYiOJxUBiUQzLT3OUQo6'; +moduleBuffer += + '3Vg6szQh8FqeMswwcb4pyc1wvtCFKjg6T2JcmgDzDCLl+NQ9lF3ibEDz6R0lAd23gKkPyt0S90WFhEsQmcyoASlsTyrduNsxlTlE'; +moduleBuffer += + '8nh8YtGwUhHtERjva7IVcLfYvqF+BjDuahQrZd2SIn4E/X8OOHHfE0akUWRxmrgYjwwJwbxIRonE5fzzYNPFC88Kz72M517O89I9'; +moduleBuffer += + '8BwSb3mOm0exOKLVoXK9xMaDClqupyGgEt7SLtnGt+QFrGMmvVGXlmQkrhfT8ALEg1slM8+X/nnMI0KxAWVhroF+4OnjkkI8gG6D'; +moduleBuffer += + 'QcO0SeuMB3GM5LAKvCscVgVy5BNOzP5YOn9ctc9/DPGE8aJjX7B8hd34KQ6pa0n3QDp1klJNvxaBQk51+bGWR6KRkV3qS3aZyS7n'; +moduleBuffer += + 'ZNNwxmSXQHaJyS6rsJJpULJL8ihbCUZnkQL200Zw8i3bJdI5oWgweqeM3vGfF8Pmk+xUYBuoPslO7QJ0NNiiowkEgUhsBNyRVjap'; +moduleBuffer += + 'S8TInUsrEzTildDZ0HfWoMSDrPPGiXOkmwmkuAw/zgT0jjoVak0jDHMhMxtp6eOGZe38UxdE/a3W+0io1vuil47We7nW+xBvz2q9'; +moduleBuffer += + 'p33mQ739LVrvbdV6L9d6zwIuar0viDha723Xet/V+oBNkdV6b6vW+5nW+w1nlMt7xPsoD1kbtoOe4uT/uRQudpeWLl3AWPDCGYxN'; +moduleBuffer += + 'VRq2SeNLHDOoCz3GeyLnpcfJdIiVhobEFw2S4HmVOEksa9V24mczKXffgbRU2ULwb2qShAulN4H3ph2ADKvOOcABvt237QsSq6+T'; +moduleBuffer += + 'EiQljjnEeQFLTFpZRMAVtj5gPYbU25YoIGa8j09AKpEJvtHU6D20+f4Mmr/5Navta19TgeaGuGT3Fv1i5UNiA4nvauK77pu3kXhT'; +moduleBuffer += + 'E2+6xTaReEsTb7nFbiPxjibecYst/Tol3tXEu26xK3jznibwzIot483lX5fEZbfYVSS+rG++7BZ72X2zgsTLmnjFTVxD4hVNvOom'; +moduleBuffer += + 'VpF4VRNfdRM3kPiqJl53E2tIvK6Jr7uJm0h8XRNvuIl1JN7QxHfcxC0kvqOJDSS+q4nvum/eRuJNTbzpFttE4i1NvOUWu43EO5p4'; +moduleBuffer += + 'xy22BOl5VxPvusWu4M17mnjv151iy3hz+XXlj1vsKhJf1jdfdoutIPGyJl52i11D4hVNvOIWW0XiVU286ha7gcRXNfFVt9gaEq9r'; +moduleBuffer += + '4nW32E0kvq6Jr7vF1pF4QxNvuMXeZjXrthdhymnc5JuJiRVuhQ0eO7pziG1Fynx+kQYQtgYYBezUzwSL3Tn61X0XVZeWlqCRGIRp'; +moduleBuffer += + 'ts9Luo8/3+LhqYmJA8w6PV4w5cdbgViA3AwYPs/HVgWj3GISqDGBjYHRFoNSeUIGGRgSj+xIoyd0GgWtJeLxQ2wRzKcvgMhcVs61'; +moduleBuffer += + 'dNxNShwPaXuvBMWOqG3piMDpiFqPjpC4TecxOSBgbDVpuKEJe9CFTWYU99EYW+elVfcNSS4w5PqCX72L4UN5XqXJTceTi2x4S92K'; +moduleBuffer += + 'zIZCzAyIyBJz4/EWbv8OMHy/eAEo823ThFU2s5FRitaF0k2l+LbH0ylawWZzOmdKQ12NRQFNaUr5lIbw2DqTK9mZXGnLTA6DFdYN'; +moduleBuffer += + 'Qo2RWQwxXkYr5gJLZjYXq+SZQB/ToPNJRKzRAYiEihJv2QTB4iGOFkVd73Ge8mKZmHrxmx7P6zjKLvUSimHKgvfSN5iVeNnUF2tr'; +moduleBuffer += + '5EjPYJse9UwZC57+PRNtneMSalt7JpCpQVX6XmcseATomaghkocJUepZrc0GW56T+yJkXo6snRfKXDibi5Z47YQFRbdNy2DO75bs'; +moduleBuffer += + 'FLErrCc4zqzSk3VtNqvkuSSbibcUrUXWD4iRuybwBZZi0hBUmM3EQTB3Cx2qb15mhUC1nfKAPQHgitZ5W+ntaX4CVeXSNmiRgihZ'; +moduleBuffer += + 'ENl0Oe+LN/uVFfJ4csLnk9FOKZ+bmejjLX/nD8ozP1u/8DrYY4HzJDCkrF946uvJ+sWTwJG6frGrl1xjREmy1UvJrl4oxwpzCGGm'; +moduleBuffer += + 'VsM7CPO2Bds9CzMvCLasXPziykU6tUFT2RieoP+80x978fRLJprz9yfHoMr7k+NIzSULSM0lJ5CaTR5GajY5iZRJTiFlkkeQmkw+'; +moduleBuffer += + 'hNRkchqp8eRRpMaTM0h1ki5SneQsUnHyYaTi5CNINZPHkGomjyNVTZ5Aqpo8iVSYnGOzkvwYUiWYHzw+CrbAxQMDi+AfeEwjVUX8'; +moduleBuffer += + 'EzwMUk3EPcEjRSpGvBM8ZpHqIM4JHnuQGkd8EzzmkJpEdBM8HkDKILYJHvuRwu00Ph4PITWHcCZ4zCO1H2FM8DgMTsz58+nHuvyj'; +moduleBuffer += + 'lB7pQq3Sj3dnXriQHqWx7gJKzqc/bo52Kd+/8Hx69Lj/GfbVHaJ35jDlPHXc/zTnHETOPOV84rj/Kc45gJyHKOcnjvuf5JwHkbOf'; +moduleBuffer += + 'cn7yuP805+xDzgOU8+eO+5/gnL3ImaOcp4/7H+Oc3cjZQzl//rj/JOfsQs4s5Txz3P8I5yTISSnnLxyHV5ByZpBjKOeTiMiKnCnk'; +moduleBuffer += + 'TFPOX0RwVqhceIGyj1DOX0KcVpT5+AUMThcWOebhPGX9xS5046W/eh0xP8uvGXQKVyEhvUAqfeG6mcZrUz5rruQlpi48zwcDPPOX'; +moduleBuffer += + 'LqRksqZoYYytHq9RvZmLZopmJSTiz1IDpkftGapNVT95gWBU+A1VnELFUCp+liqmPSomUvEvFCq6LT5HFWd7VNwlFZ/p2+JFqrin'; +moduleBuffer += + 'R8XdUvHP923xc1RxrkfFvVLx6b4tXqKKD/SouE8q/rm+LS5h3ri/R80HpeZP9m3yMmo+1KPmAan5E33bvIKa8z1qHpSan+jb5pdR'; +moduleBuffer += + '83CPmoek5lOFmtNOm8uoWdHvHEdR5WMXFhnIa+bHCeAiwcGXFgyDS5+7YBu8imqM+7RkvOyx6B8DhOMk2QT+IqUXkD5BaWrzBZJ3'; +moduleBuffer += + 'E14/W0IdvHwYL0/Syxl+uQ+vZuTVKbx6hF4ZfvUAXhl59SG8Ok2vEn71IF4l8upRvDpDr1J+tR+vUnnVxauz9GoXvzqAV7vk1Yfx'; +moduleBuffer += + '6iP0apZfPYRXs/LqMbx6nF7t5lcH8Wq3vHoCr56kV3v41Txe7ZFX5/Dqx+jVXn51CK/2yqsIrz5Kr+b41WG8mqNX6ZHrZ//4X7z8'; +moduleBuffer += + 'H5qfT9H3nz/7vveFz5/9w6+t/sHA59NKnvPf/vm3/nH4+bSa53ztl95eiz6f1vKc3/s3b/5y+/NpPc/56V/6ym8S5Eae8z79Q2Wa'; +moduleBuffer += + '23Ja23IGtuW0t+XE23IGXyMJm3mBDN8gZOl8932ydBCiKpmyCcSwLmGb3GsGiTloqWlLYpYSD5oBSRhooWlJYpISB0xTEuPQMtOQ'; +moduleBuffer += + 'RIcSB01dEjG0yNQkgbnCIVOVBFYLh01FEpgsHDFlSdCUgThxnNhBjxPyOCmPR+RxWh5n5HFWHh+Rx+PyeFIePyaPj153OHfJ4dkl'; +moduleBuffer += + 'h1uXHD5dcjh0yeHNJYcrlxx+XHI4ccnhAf0ezH6nQ58/W73yWnf8r7HypWXiB7PoC5dMrL9M+ZJpO78HnN8t53fYhSBdotGqmcEI'; +moduleBuffer += + 'uxC3lyiv4eSxUFJe3clj0aW8mpMHAX+R8qpOHtQAbVRsXiomTcxXlf/W+G+d/zb4b5P/tvjvAP9t81/0ihn6/GuLYg+PiT2cgj2M'; +moduleBuffer += + '1UYuSN408tqa97DkzSBvQPNOSZ5BXkvzPiR5CfKamveo5KXIa2heV/J2Ia+ueR+WvFnk1TTvMcnbjbyq5j0heXvYhmveOeRZIx+R'; +moduleBuffer += + 'PeGrJy5wcPBzKL33AjYO/qA9R2JshYR+tvOfA/nPVv6zmf9s5D/r+c9a/rOa/6zkP8v5zyCziJk0ZxZxaJtFHN5mETvbLOLINos4'; +moduleBuffer += + 'us1ujW3LGd+Ws2Nbzs5tORPbcibzHFVIj0TwAn9VJfZNvnaBhtGb7K4iMQRfJzjrDcka4KydnLUmWS3O2sFZX5esJmeNc9YNyWpw'; +moduleBuffer += + '1hhnvS5Zdc4a5axVyapx1ghnfVWyqpzV4axrklXhrGHOelWyypw1xFkrksVCOcg5r3iNn7u/5Lq/5Lq/5Lq/5Lq/5Lq/5Pr/xZLL'; +moduleBuffer += + 'cxdZ7upKR2pndfU9yaltK1PflvMjXF1la6nYWUvRBOII2TJnNdV2V1MD7mqq5a6mmu5qquGupuruaqrmrqaq7mqq4q6myvlqCgtZ'; +moduleBuffer += + 'c+R81/ur9xdUH2hB1XR+4wOau4iqO+/stDmbNGdTZnp7f3n0P+ryyLpacluWr4vcBZGWcxZEatZGtpW5vyD60S+I3p3wvZdOYzfy'; +moduleBuffer += + 'WmXLfUdy5RBH6tHrbNZDJ8yNvV4odOLn2juBQg0oU8nzlmwUmGqet6IRePSqo1UNGqxJRL1xLlZClBrnriQbYdi5s6iSJxEdp5on'; +moduleBuffer += + 'V/WtvQRI32pyQ5N6pQ/iB5UdAvWyJXsfk0auUcg29LCC2tSGnNuBANnevSQRjJajLeF0g17Xj4Tc7LbrRzR72/Ujmr/t+pFA8rdd'; +moduleBuffer += + 'P6L5W6+yCBazuPUIYc9xdapnvS/p5Q0SqCa7EkguBMLZ/s/TKBHw+dC7k7YW9CQNcVN6kYYYHz1JK/UkrRdZCPDDV0/InTPrYYpP'; +moduleBuffer += + 'sTa6ToXoIzY9euUyzk2XEf37khC/HEq8iMi9IUhj29h7ZwLpkVvZRTPrAXrkg3fHSu/uWA76cDro0x1+H077PTmN2EZyK05bIpzn'; +moduleBuffer += + 'FwHIhTB6g0eop9r5UHB241FVrnzCiER9V5G+q9hLjhBhvy63g4TFw781ubDC7dWbQbFXR7ljbQAcvoTJ7c/wrv256vfsz5U+4rXs'; +moduleBuffer += + '9+7PpT79uen11hxvUW+sGURIPrkbwi+E+RmVazUkOFvDvU5J48i71ylx6D+5HGWFD35ntydV5fakAXt7Ut3eMwWZvpax8BmJ+EHs'; +moduleBuffer += + 'aQp7hjmOXdPejtSSLjfZHUllPVmNU/ngwM3sGp41H/vDPzgH1ryeHFj1enNgpY+CL3u9ObDUmwN8iJtDnozh5LtItA1DO5rf8PGc'; +moduleBuffer += + 'MKBzlxuUKhzeIrs6o6JRYnBBkYb8qQsjsouTKtk9VAjJJ3eQ2Nt4Gs7tHZvglWNzhjViQ3a9U4sDEGQXQGXhApv2lqScdxrlpyyH'; +moduleBuffer += + '8zPe3cru0Vn37o1366WevDtzvifr5ntzzvRmXNyTbxLIBBccSKCcZMLY66SSSWMvEdLrZspy585qGQ5QRBFJtly4c9tGjSlcuHM1'; +moduleBuffer += + 'u3AHIbLgEkVsjyTQ+3tw5Y5Gntkrl8Dgyh0bn2afsVfF4OIdDeMkd+9slPnuHY1Ec0Dvy8HFOxrp5aBekoNbdzS8yyG5iAa37tgg'; +moduleBuffer += + 'MEeMva4Gd+9oKBK9fqeSjMqVOLiFR4K5LMiVOLh4R4K5PCxX4uDOnRMaNwa3s/B1OzdtbFtfrmc5jXggz1xPH7V3eA2a7NYoEfL0'; +moduleBuffer += + 'jL2fK9arPPw89pRGuazY+9jaJrusTaWcViwk2w2R7Qap1o4et1rpUFCC+kR6c9ztLbFXI3s11rDcGGeyy7OqNnRF1d6vlSuNxo4q'; +moduleBuffer += + 'Kg0iI+VKo/GRyjYiS0eUJgvUgtu07CUCpFILwXIF7ihz2MwZYxocdWTCDJpHNW7UjJnWC8CmqHPP2CArofbepNNtWLFR79Sld+p5'; +moduleBuffer += + 'tA2OlG12UsZQFsEDt9oMcwjZyAYSYaZIbzzgdIN0AEzaUYdyCXEi3aLRZcrmtNA8tBBcBVUnzbzZo6HQFJlh+Ms1JsksPcdtDNSy'; +moduleBuffer += + '2WVJIUtCZLTtwF+XK45GJOrIIAe4rdlrbGoSoQT9s09ixColbaXkyDZKhjh0aU7JQrACZE9wVBaJUqJ3vcjlNgdMIAFAiOL9yucH'; +moduleBuffer += + 'idiODacSAN1Q0I1BiVygsxc0Sxsh6JCgcYckrItiWVMsTzlYLgTXgM9xnejI5IWwGTXHjNzKJjOjQFoMiCSQLcFhI9yPZA5KDztN'; +moduleBuffer += + '49aZh+WWAm56IVhFI24TiNIit8hJQCO9momH+EuXFPJCBnkhuFHBRwpEM0U0FL7/dLbUeGeH33wptLfclmf5O4acZapOJBU+kUc/'; +moduleBuffer += + 'GhwXlv7/6ETiu6dUs3M8eF/FZu/kKT5x+9P+U3xW7FptkSPmBrxdPa12l371m6X4D4mIOX+1ljTx/GotqeF5rZa08Hy9lmBWiG2U'; +moduleBuffer += + '1e5yoXxDyw9o+TY1gZimdamXxvjWkg7Gf0K9hQhdaQWHUqkozvlET4UvIXG5mjC8K1UyLNgK3YTYmzj+cYEW3w7oxzyCFWBD7Aow'; +moduleBuffer += + '+OcV1JjHn6N3BRj/XTQ/h/PC38PBVdxjnAPZT6MNPeZMJYkUlA9QZwSEZBJIX3rdF2iEFxUrxdfKWLXHPxd8gOpUmeStZtpmwKXt'; +moduleBuffer += + '7hXhHshaNrYj1nIaZoUGc280QBh87m3CKl4l+ThQukasR3w2+rsKWbGXHIEhjLhTjAO+SoH4RhkO5653fsAPAzTTDS7y+XQceose'; +moduleBuffer += + 'a5FE8Jluxnzz72SYV0XmmiRqOI1ewZA4fLaUDJEOzJ9Pa7MllejhT+BgnmnhJLWf0Dw6CQlylVI1AK5TRVrQD2PqEpohE/IY1jG1'; +moduleBuffer += + 'fUGVh4qS6bBFqtFsBxo6JPGskiESau88AawTGAg6HiGfQm8RDaSawcU0RAESzEVudOgTLVIFHFjMWxpGC9VulQsyCLmyKxni07LU'; +moduleBuffer += + 'bAlO91rXg1O91v36r3wTW6dN7Wy4QHyr0Qyiew3d8r9XufQ8mQPsEL9Bed3d3Q28+q2ohJ3/VZw8IPVdJKbjhvOkIk2UMaWgkbfC'; +moduleBuffer += + '2+KD/wWqx8dGcUw73mCDcZ4XeDQAfnQCQbIQoyL4aAv6hXPymFxHRO+iaaJ8GbNLWPKgu/SacgzToZTVm2XrI1KO1l4EDqq2ASEP'; +moduleBuffer += + 'cXDHNl2RjfT+R1shZI6vNMeebzRTkeonFjnKFa04smZwYzpblxP484iUu8rX3hOr4t8AyusBQmRQu5KkNRsWXyTK/xLSvRYi+EfL'; +moduleBuffer += + 'RJKktQGN0CQ38R+iMHxaZGUkQYLMd3SeYFm3ilHL0lB27tX4b+DoSktfYLO7LUIqg0s0pEgZK3bpzfg3oSkr5UWOAd9Ge4EZyADU'; +moduleBuffer += + '9VeUQ4/iX2Azr2+k3T9CHIV2Vq3Rt1qz8OaPYPNp9s5Swbig+2rxzwBHGnv4euQgvgamWXIRHqElJW7i1uyuL+9bGUI+2eaf8V3y'; +moduleBuffer += + 'D5Ru1cjieE+00G4lfrWGQyq49l1t1Xpuq2L86eDPRjWtdMOPw2gjsjYbqa9XEy61Vm0Y/nG1lka20G0t9K5atNtUKIp/HFv872yR'; +moduleBuffer += + 'w17GMIRFDhURvwcivkXEV0T8Hoj4FhG/OF6NW9I3ctInkxIe44pV5GJVUawiPoUBZjFVJJrxRlkETH4s8Y8mlcPZrU1A/89hqcFK'; +moduleBuffer += + 'v/yaprZNCIhFq1WcqCADXfFKfACaD1/gqd0nkh//agRTPuD7gcUgVXHRwcBKu46D8fueEQn8UgC0elWxRX8+ymtn9+dR5fNSO7Qk'; +moduleBuffer += + 'v1kFbndqXDD243/oNG6rbKnwag05b1QW50ql4yViAbXonz9ZWiHVpF4vfbNyvPTLNZEidMAGy65thlEQJRDLoOaDhBwtQ+3KcnOe'; +moduleBuffer += + 'VUWRRVUO6fvbFfT943pChl9Qez0mbqJKEfMpKBFKAfhU4WdZERTN7MEnfUHaF7idR9hs6zyodrHz3L73eldXm5BzMci5CIuT8UB6'; +moduleBuffer += + 'sR+YrK6CY/mR6o3M+lqrLH39M75leGYDua7tZSPQMJ3+GYal2fytZc5H+Haru0uR6O57oejcEolsxZ0QMeDMsKNbaUTrli/G9tsN'; +moduleBuffer += + '24JKD1tQsbZA4THporVWcNALlgIcGaz8cMAuV4pg17zP/lDgUt8X4Fa/P3QFKA3BqltyY+avj/n+S6N8G0Vkv3HdkE9UpbtebMhu'; +moduleBuffer += + '/15XS18Ne98tfSXsfbn07Z4X/7FfpNcN07fkk8W1EFFJeHJZN/xpTlwk9OpGmPso7nb1AbvZt4d2Zhd1j9jO7DjtEdyZfTQ9ojvD'; +moduleBuffer += + 'ibc9wDM78YHpzQDfEvYFV0Oa3uADIhw3oX4iWA3VMWHjg4ojeyPInTG3gnuh9FpvSq/2DO/PLqXelPYM78++xl6k3pTvKdcC8fFe'; +moduleBuffer += + 'wZ0E+C4q4firTOqK9fZXna8ht3zpDXEYr9to9a2nbW+MySezrDdu9O2NSo/euOHzF8mtvXFNs7f2xlXN39obVzR/a2/c9iR/q/TK'; +moduleBuffer += + '15AbvjD+diCMN/D51PRm62Ury00bk5lKvu25Hbbhq7uv5vgMrwbSYWMiPjZy9FjmsIGirPt5h930+3VYuZeiePz5d2uH3dDsrR12'; +moduleBuffer += + 'TfO3dthVzd/aYVc0f0uHvS0fL2568o3i7UDUfg7usIb6YJfCog+WvxZ9Dm5C26WbnkqPDWfMohjApRdZGQyKXcpfPK75iLltNXLN'; +moduleBuffer += + '1y5tZSGNRw1/h8010rsXGbxV6imDN0u9ZfBEbxGc6y2B4z0FcE286TsMf/jDT6jRksSRb/O3CPwSmfMTdhJf8RMWsGtewn7lJ5O6'; +moduleBuffer += + 'fBBByZb4zz9Jgiz3JPK3dSccuHwOZv/loN4vv+RpYPJBh2G3OTT6sH5/Wg7USzDscOyqLxwbEQkXdnTkenbl2A1PODYqVkMaGs08'; +moduleBuffer += + '58KxTceh/azDsIVgCbNqxLRm5ybT08gJyWlo58iPQ/0E7bEc3zZ0UTDdkaPYgBJb5Dbs7fB69xY1fwXND/BFDfzhels33tavpG3p'; +moduleBuffer += + 'JPsdddw1A554TcUfuuqpWOs3TGbgCfnODN1o5UpB7S9HPBOUr95L9gJSubKG27/iSXxr+TCx4ikFqjNs0+YkxruozJnz0no9a+Kq'; +moduleBuffer += + 'NNESArztTYyjhZAdtviOJg2oxlH9FXZwcLx3fE9zqi8EWCdj94LhbTVpIIGuSzTt/dlgp8jpJq5DOgGX99L3gi+cnfvSZfxceq/y'; +moduleBuffer += + 'hbPjnLu0dLv9hbPVL13Gi+oVzaDf41ekHPLnrnB1+nXiyuXLlxeC27i2oWr4EyjiGXSv/fV/VIr/Q1UafftH1ih/oeoi8FO1e8Nt'; +moduleBuffer += + 'cuNH2ORy1uRNt8lbP8Imr2ZN3nKbXP8RNrmSNfm22+TNH2GT17Imb2uTCO5il+m0FqBJ+9+f9QdfMrwxzeM4maRdHK29Cs80B2uv'; +moduleBuffer += + 'HvNnkw4ek8kIHo8ko3iMJ+N4nEim8OjQIECPo8kuPHAqhh7zyW48msk0HvuTPXjgUA095hKDR5gg1j/9MOlOPErpxIvp2GlaO1cl'; +moduleBuffer += + '9jCCNSMY+hjHat+JIMKI+BrhOIkWMRKqPdDgrp6N9TphQ00DhK0nYbVTCfn6JMg1wTkyYBkkN06sL6B8jQhNhuIcB7ydMHsEcmCM'; +moduleBuffer += + 'hRxSIwq5Qo1MSxDrMo7GoBEnOLoEvZUGAwFpGwxsaHjbYEUi7ErM6TLC0qJRDq09xo0mQGWSG+XI0hL8vJO1T6jMSsDwBs7tAJVa'; +moduleBuffer += + 'ARVBgaztmIuBRSi0UXgFoYoN+WsRqgtCc5rUuMsTCP0rMesTG6O3TvjtEfzKZhqo7uVAxZ0MP4k0v0+iKj/NqLZ6oCoo0hR3zMXQ'; +moduleBuffer += + 'IlyxoaBTF8McYY5gbBGuWYT3nXWiKyO4/JQNyM6RnjnGsESFluj30yBlLyNtLP4tImWH4i+B6B+gnzFOVIGUdl9ShASaroy5FFiC'; +moduleBuffer += + 'lIKcoJrLAaXAEqSB5i1BTepAJugBTcZ4iw+oExKhuywxyCV4/owltUH07bah2WctqU2JU8+x54nUcSE1NiMgVaN5f4pJHbwLqUIi'; +moduleBuffer += + 'ETzhUuhltxNoQOxJl0IblV0pDPI49OeY4DlNaqByob9tCZZg2jQFO6f3CCQSvhvxvWdsUG8OWD2hRO+2Uep3WAVrS+z6lImmSZiG'; +moduleBuffer += + 'bsepug9OtBBLpCcurZ4iWLMx2idcWiPtGKXV2jml1cbrV1orGsFdaQWvZ+xVEhzLfIbJ5sDXiWrdbumBFhG4R3qgSVw1Ej+8jYOE'; +moduleBuffer += + '98DVOLvhQbk6U+RqUuTqziJXJ4pcNUWujtp7BOoSc3yaydoBvs3kUeiNXvqwR64UaOH0HgiI76aBzeyqB9XA6aIGzhQ10BQ1cE9R'; +moduleBuffer += + 'A/kmBHuDBpmTWb3fYZdFewS47pbbPD7LCDb7W7uGopZZu9mitStgGpndRWs3CsMkN5WMA5cdep0I4bJLQsQ/xwg0eo0MZW06Gxl2'; +moduleBuffer += + 'FEeGXcWRYRSWocNjI9+7MS5D7UVuoFwcBSsZaB0Fx4uj4AhuaenIcP85XJZ1dnt09gjR2S9xcPYq1oK9grNXNTY5/cB1ND1ilOMF'; +moduleBuffer += + 'vkYyBA7QvlMnRd4sCo4vdq98+5scVS8oceTn7pKbri52b/+2k950EzyV4jjvOJTizfmfSsvX087ZN77xb78YEQuEqjn/k2n9ejpy'; +moduleBuffer += + '9hf+yRt/NySBQfYi0fzH3/oHP01p4emIrTVtaz2d1q6no7YWS+Eiqn3jv//q93xSDK2mUERoRy2URIuP2OI79b0Wn7CtfCKtADet'; +moduleBuffer += + 'NqbVRm21yWIrqa32sbQB5LTa3q2tzRVb22erPZm2rqfjttoDW1t7kMuN22r7bbWPpM3r6ZStdkCrjdtqD3G5KVvtoK12Jm1fT3fY'; +moduleBuffer += + 'avNabcpWO8Tldthqh4UvVM+QjO+wpY7w7DI4Z47we1I1KjHLMZ9ZiwNzCLlsbA7zGEL5UmrOLfVQVio0B6FGrIjzuA+EoGuN/W6N'; +moduleBuffer += + 'B50a+7MagTkg+ekA5e+w8gHVH6KqosVsHQYUDsGdzyHNOZD2OS08IPm4jQ0ntS3cKS4idzcUoIamjbGTiVUQ1NDRHPikAzx1Gt3r'; +moduleBuffer += + 'oE92yzY0zkXEUrChRUMhb1BowoSjjywIauhEDnynA3zCaXSsQFGmSaNC0WgPiloYLLdQ9EgOfMYBbpxGkwJFmaKPCEUjPShqwPK7'; +moduleBuffer += + 'FO12QE87oPc4+RUhp2J2sRhWFBoGIBmmK6YmiNDs2yIhIxUtDToi3ihVp6GBS5UXof2ZwRIr7doqYbtp5tZqR9FaiY0LHUM1u9VQ'; +moduleBuffer += + '7S6akOmiodqz1XTMFE2H2LXAsVHWtA3mdmO02ITYuhieNVtigm/jic7JRIQGP/7ASoMTFaKxDTk8idvJGlw+l5fgAjNZgTJzXm5Y'; +moduleBuffer += + 'SVh5ZSwdcovvdopPZ8Uj5iauZRnCxlJXTIYxglpBicwQw2kv8o0RDKbLdHTZjXYujSaIewSzhv3BTlsQDJs/m+UH4DNuECrz50KR'; +moduleBuffer += + '9i73Fe6/mMjrjzuSN5XVD1GfVlApKwjskyNeIiAAyOxRgFZkOxnAOm9zOoe5UgNA6ueumwhbMrsMSevB0PKtdZFI+/VLqZUjM4At'; +moduleBuffer += + 'snzdG035rmcSeYn7jV9dxqtBvBJRcV5dwavh6xnizqsv41XH1K7bvM5pHOynadt1VhrOeBkZoZNxFRmBk/GKh20kJVwfQXMNeFg8'; +moduleBuffer += + 'fN44q3OF1fznjewnHit8R0yAwPV88YrHJzpw94qcyVg8xrFlZ/7aVy9hboTk54E2vsPSNMcXsUkinu6UMhwAhJkT/0YN1XGRilz6'; +moduleBuffer += + 'QT+e11tVPHj64RySZ+P6Zc8/8FKZL/qL7EV/2KK1A03HN3FFy0awmE6ncJl+J7QTLlzr4r8RLgS3cLFH4UqWLals6+ucvxZix8bj'; +moduleBuffer += + 'vPO1yuNuBovgUP8QFmdIamYRKyEGpWF3aDGJBEJwhnfwmSB+NzLhgVIV4ffDbnMRiVp8jbh10CMTcKCEoPbPJx41igAyaVna9OL/'; +moduleBuffer += + 'WGt52E+xo1vBDsnhxe4B9qHt6Jb5DpAXTpZKNMX3Tnk0zHKQZb6bJf43dezooNbsT1zwwC0H8b8JpRGPGkFc5R0m3OebBb9Dv3wO'; +moduleBuffer += + '3UywUJQPbkgo5x3dSbQ/l6dnecdmnt6P9IkszSFmJSRrczGpSjeNUTeNCRLfpBX3Pj9ODhHJYxYbIvnQ2TkSlEF6zl9JD7+G+18O'; +moduleBuffer += + 'wfG4tDnzBX6u+z+BEK40IeepEWgzg93qxe7S94ILz9PsBj0Zf6mCttFW0sIe6JKdS8/J5rpDr8X/1OfZMc5qd49ms3Lj7fP3LwTj'; +moduleBuffer += + 'Pt+IM5dxgpiLjxJOsWB8IVC6mgS6SW0xrCoZ5/gfkWZa8poOR5vmEJTKV+S9+F8G8l6kTMANE7hhoF6WtOxnKJ3yqploNhGJp971'; +moduleBuffer += + 'eQ+rfJyvx/8VRxyaGEP4bgm+fSKMvxlIdKBYQgZV5BqKka7/BInEAE41xO8RiAOlWIo00wreYVdefJLEY4CANhbjv1WV+gNOmQAH'; +moduleBuffer += + 'pEAWUYduKaNGKDu3vHi9KjuB+Bfvx2GZotXMnOyIMbFcElJBPAcabFRiyt0I5QYXuwdtOYIq5UqyE4i373QWu/u1wIBAqGhY4zPn'; +moduleBuffer += + '0YOgyMd+X6f/sbPqW7ydKEIrw3kr9AatRKxEDXoDIE3ea90kJYWCRVC6Juk36Sv0LoJSNnOljDhstABv4k1GakRs93PgTcHQO1Da'; +moduleBuffer += + 'j0s8IGe+lbN5GhldKasuBHOyg9nHDmYTxe/VIf8cYQobFKP4/63l16sQ9SOgo8WW15Tj93gPVksY1DJletngz1FCXQvd4HUP2G6Q'; +moduleBuffer += + 'EqiupLSw9dIjze7OSgHmomLYEj3wUUFIY9MONUfve6LaSlvVDJ4slbEUP1mKyJyX0FCVEQMmVWAyljOEy+GSWYtJFS2P5Z1alU6t'; +moduleBuffer += + 'ajTrMenUHaYa/03m8A6hmR5Mcyjvg4PeG/jE9U/Cxczs5pae5L6o0lYH+fOEqDgbr6rVblw7koaWwu3aXS1o9zoZomgWojO5mIRq'; +moduleBuffer += + 'mYix0kiL3qB/+XwOVSzF/wnKTQuuMTMcvx/RS6YBX8r57O4Ja7fwQcefXyBVdwcwRPBKhwU3thEtp3hgUsZ2jIwhNQhbQYbr1yKp'; +moduleBuffer += + 'NSj6Te2Sffh3gendWtbCEy35UE+Aim0sBLEZ44/x8bfZfs7jOztqjYkFApmmJZHtcQgOLA2FczxeDQs47AIOxZTwoBLDAjxihZJL'; +moduleBuffer += + '2oZDaRhwzDCqRg0Zhn2y82oySGCPc4ExNRmE31dqApq/us7bLYahGVT5u6dGsYv3K7WGfBxnhvPmxYg4pzVo/ohhN2ClnvMn05aa'; +moduleBuffer += + 'KHRjK1MxFMO9dDThl6kU7BBh+6dVqaWi56NYjKFXbbHLb96dS9VMtm9SAqhHSranO6wjEjUlruyqeVlwYBvbYuIibJoQC0Iarfax'; +moduleBuffer += + 'DPtYze1jGfaxmtvHcqbKDL3qDgWHBLpc81RlMdehU+jbweOpTE1UrdXEKolQeNZYDp4X/+1yZmZp2nczTA4h/41QQu1ZZWfPyIL/'; +moduleBuffer += + 'Fm9JPO5vqPKPU61xnIcYkHRlFpfl5cpfscpfcZTfan0NWl8paP2Kdz6tE4w6NgHhYmidf9ShxybFj3dLVi7qpr7P/6yo8ousxvU5'; +moduleBuffer += + '/1nbSp0F2SkKFSvd1WbVMSP5IDYr2m6zgL3YLD7GU+ru5U0IUfctmsSzlfrDGmTxWXuCDInPWHEmWyUXPs0vxr/DMnuChJgeR4kV'; +moduleBuffer += + 'EQIHttjsNgQgST42dPiYtjCYMZmMtDhzw8dk+TMY/0gmD5b+8qmSih1l/xUZk/kiO3p+0VvcVyotcN4ZXLYR8W4d8YtG2IIU8XlU'; +moduleBuffer += + 'mkhxD7A+PpceXgjm8evZZJ4gz2LPlkApd2cW+YiOJMYWqePwyxxeKLXpMb9QqqjyNflAAIAsBLQGI1SxWSz+RZ0GYSdl951SPn3x'; +moduleBuffer += + 'j2eqJROgJko8kmuH3qYWOuUwywCWh2zxzdI2bRpTXV3x/kx1dQQmtAk3tdQY6VpYI6Kh9S0aSgL/ZZyWpvwrXjKM52Xs0KLnkpdE'; +moduleBuffer += + 'eF6iYYMen0vG8LhIskOP52gCRI/PkkCxjjSdAXyI4A5BGQZd5eB58v8TAV1ajmFCDv2oIcXrMZ6Lx85cfJSqjYIe1qDRfTTpggaN'; +moduleBuffer += + '8mgp5I5Cg07o4B5T+ZhppGonFtMJ6Md/pKk07P8eeliDRXP0GBaN7X+MZhsCLuZdc3ucUjD/Z0zNTBwkxk0Q43TiQkXPnI//b76/'; +moduleBuffer += + 'AofRKD1p7XcNOFggNQFCXKuZBnMtVvvNNankaM6tmvC3htk5lRwVFuXcHcws8aBY4kFriWXtBxkf5H7tHuXTCX7DTpqTGs+lk1Gq'; +moduleBuffer += + 'U5w6D0IcaxDEQTMK+Rzk5oFf1srYyVJsRYb6bCiXNzOkGImk0YMwGsoxYskbKkjekEoeRCqGAD5HmsSyNJjLEsE2ZHGXvYJtvuJh'; +moduleBuffer += + '5sPmUsTwssrsksrsJRLZQ6+RbA6SYMaQ2H3+y7yMr2MyMUePwwAR80HHccyCsD+xjMGdao0R1BbVOoSeHABf6zBUytgBd2AekAGA'; +moduleBuffer += + 'KB/ojp8sHaWMUC6PoTZo1fQZqvoHJQjGOHsK6rxRs55PQuqYrHwM+wSxIaVueGtLHRbmDDbcIiZqHSBP4CAuop/WYRfm7cjjf4J+'; +moduleBuffer += + 'kbh8Cs11qy+cKv1lgr7JbVTdToMIPwt0eRtsHYPBL0WQDHSFPyt4GFOljoyoE1tQenRaA1zBBlDFGR9U7bgHUx0T4XOLbBEJ+mEc'; +moduleBuffer += + 'gMx6gvDaT49hHJMcAIHj9IgQb3AAlMXSWdgcyQunATHDA6bJcl/PrSYtktVqDkBMK7nVHIAYV3Ixztq2Bo+5VcmNp4tcqNzClb0q'; +moduleBuffer += + '0+MHSo+QQPB8ZyA73EOJcXYjifDS1AdAGpTJMjxNq5m3QjuyBThugM813XfyPMyB3mTXF359NyRbS8DWQ5KynrMjksTgQOndMKXJ'; +moduleBuffer += + 'KO6gCrq/gphE3f8aWsoDjl40zWaFL3mm1KBN0SKr9CfhqdIvY35FTFnCk7r8PV/mW+/qfGuTr+867r/jZx41/wrKRidLKwGRHcRf'; +moduleBuffer += + 'ie40f4sE3rVA4L0aZO64D7Jqi3pM3LZPfcT7golbM5u4Yb8mHzzLp228JvqseI58GJCynf9gYu2uieA3Mk2eoKet+F8T5j7fovks'; +moduleBuffer += + 'pjUE5DIHDpnDkIhTIGROOBbz5xLeVPoczUuahuuhTsitvezJqmrZw4ZmrjrsguJR1IdligVUU0Ax4M8K4Kt8iI8/MFKpw6+hDNds'; +moduleBuffer += + 'Sc261ByWmocFfHrEzJ/1f6LFx3q4YezY8M0R2AQfevlJbEPGliofmvgJepDaPonlCEyNDzMPFjRhanww86h4MubpQUvMOdnkzN3o'; +moduleBuffer += + 'dmIV9gTr4KQp3pGIFUgYVVYfiZ4Kj0xZfSQR2qFJqPhIQpmJYbISv1c14Vnc+c0rPRpl5Dt8gyeus2xRwQr5QCudebdO397L8+hZ'; +moduleBuffer += + '7uoG6ORF6Dx2GCOkKq8b5/CBFmNDiP6ZpEcMuxUC7w49qH+w7ZoNloMvLKTvDBIhboWN3KXp+LaKDdn2LCYu1IkhlekOFCaGYbdd'; +moduleBuffer += + 'mBhKZQDVK7G4LWd+mCEZuW1l00TMoM/6P8kmLtReFm8NxwBwzZxWDXMzl5s0GLh3iwburczAvakG7pYYuGBdzcd3QomRfpMNHEe+'; +moduleBuffer += + 'OwrpxQ33N6w5Yxu6Zs1Z4Dj7V/nqwffC5MGiaZrfYpoimCactp5f8NfVNH0n0AniJJEyiZX8iLvWbPKXJ5iocZioeYwFjokKzXxu'; +moduleBuffer += + 'osbz1Ru2ifjndX16xcdHO3yuh4mq8Pl63Df4sm81p4KV65epV1e9zEdEK9Urvm2nwkxwSlPJbHk5Ra1MYVU8KukJSk8I5hVMjics'; +moduleBuffer += + '5hP9MJ8oYA7jWiMYNdbZNrVHmP8THB+nVXFKUGuOea2Z2pZVcQ1GVlupuXijqLMqtk61ZKuznhqIv6V++nnrp4+sn35epHw+XxU3'; +moduleBuffer += + 't2GfrYrLW1bFTXdVHLqrYvXGhT1WxaGsisuyKh4urIqHDU4Yh/G3dFUcy6p4mDOdVXE1WxVXt6+Kw+2r4vIdVsXzzqr4SLYqPkaQ'; +moduleBuffer += + '8e1HoVSxKi7rqriKVfE8/6IRoIQgacewKq72WhVXC6vi6tZVcVVWu1Vx4fnq/nVWxVygSo+yU86uiudt8XxVXIU6omC8dVVczTz8'; +moduleBuffer += + '1S0e/uqWZUpVptfWGd10ndEKPXI8/MT0VrZKaWOgaeXrrHa2Km6LU71m1ybq5a3xqvgI8mlVHOPJq+Iaj8pNPC/RiFPDSBPhcZFk'; +moduleBuffer += + 'p4ZVcQuPz5JAsY4MOqvinQR3J5RhWtLilaKur8V/jFVxXVbFdehHAyleFdch+YPOqrhD1TqghzWog1UxNKiDVbGUMx1okF0VD8yW'; +moduleBuffer += + 'eCqcGKpGq+IEl17MCKzBWVlCprvMDHRmEF+ZZgjaIFqdtYvOmfgbgdll+H2IP1UoA5eZkTKGLLZ8vTSyDDTo1cFsIQJWD7Ky2zcZ'; +moduleBuffer += + '94xwz5gZXmrGf1gHXww6ZjD/zsSvUWqWeTwobBrAPG4QM/vFbFU2kK3sB4CgEQQHeGU/6JSSlX3DJFjZJ87KfiBf2TcwgRzIV/YN'; +moduleBuffer += + 'xl2BNASIj6BKhrEayFf2XLKTS1xDqGywR7tBb+wSWCV0GmsuXkdPSwdO85K5sLKfZtnIV/Z1XdnT0g4re0N1KqiTqcw0VGoAyjRt'; +moduleBuffer += + 'DHRsOnOoZ63Iyr5udWZnrjNmp2Ik2kIPwmhnYWXfZoHOtWenag/Uog4lwoyZ9WEg1weCndKoka/seXyRlb1M8cqqb7HqW1X0rYlJ'; +moduleBuffer += + 'XMsMYOUPrbMr+xq+Qc7R4whA1POVfZgM0nKWZl5UKyKow1RrHj0JlwuhkE/aRnljgOIzKoMYUT4qS8ZRtiyoWDN1rOxrvLKv68q+'; +moduleBuffer += + 'xiv7Wr6yZ//Nx+jBK/saJpAfoccwpts1wHoEQwpW9jVMQ4/SI8RsVEdPmqnXIC6fQnO6sq/xTLyWr+y5LK/sR2UU53BDurJHV9DK'; +moduleBuffer += + 'nvHAyj42TerEYRguWdnPc6wii3M6nI/dGG5iIpxW9sPSGUewss96Yh4r+1EAnqQHr+xHZYbMvURVQVmTHi0MEaMylIyq3Ndyyz8K'; +moduleBuffer += + 'nxpb/lGI6URu+UchxhO5GGdt2wGAuTWRmxAXuVC51aACKtNT2cp+CI5BO+sd4hkVJmE85R3Slf2UyHCFwyEN0hMhD2WMruBANi1F'; +moduleBuffer += + 'K3xq1OYt+dgSVsFZcHeut0Jzvbc9gH/FJ9mj51Wf5JCeLyPyFT2XfZJHen7ZJxnluSANKZUDpa/7aR1rf0wk/wAnwLvf8G3fVDgU'; +moduleBuffer += + 'rl3tV/goeDNLIZhznCNxsPRb/qnSv/cQg4eDqVfAlDU8qxw2vYKuuoFnyAHSK+D5qifTz7e9BcRkr0Dk3/JkwEAwOzilcXwT886y'; +moduleBuffer += + 'ncAh+ldaFctRNjp9kQmcjwlcOZ/gFT7FNhHVqIwp26tludWpaSdsTfsZgzor/kaICVUMRVY3MX/AJOyacPHyJ74qf79zP/HFjAcq'; +moduleBuffer += + 'NO0Hvpv64cT9vgfBaPGkLP6mDzUfki9ymd1n/6WtNZR9kRtifxWEeUimUNlwxW9QwH4vGMIX9ij/wk5vsAweymZE2Te9IVNWvRiC'; +moduleBuffer += + 'XpRzvRiCXpRzvRgSs8TQm4scrUgVYkg0YQhs5phiItIsirGK4mAfUazrskSdsBXeL1aQbjlxXtCBdc5xNMVqwJMoSDPNnydbxF7Z'; +moduleBuffer += + 'FtnuEFbbVsJSqay7nQKFjiAFOENuszb441Q5526Fj7F33/TyMjSjHqDHW15BC7/rYfZcgaCWgE1drtqB8ERkDkMeFVoGsQYHqQvi'; +moduleBuffer += + 'hGfEI1hXVxCuQQVgBAJhx4cRXZyReRsBC+D7Zqg6SFSwiCpnn6crcFi1REsZ03GxIXL0XbJeZTXn6LKiyV+ljAF3MfgkzDL/Ita+'; +moduleBuffer += + 'oip7STT2c9hJhKMWFZjZ50S9Pyva/SwUGI6higRNyJBC/OdW1t4V146gFRr5lzwUQ2iKfNjhd4T0FRgnWh0lkbiAQra0shAuuIAQ'; +moduleBuffer += + 'S8K6gELghch67ALiT1X8yb8KF1DehyaKf7cmHw6i7nfUFxRm22as4Eg4hkxmnA6GxMYuwmTKiPc0/glzpEg28IFBAgMha+YtkzIW'; +moduleBuffer += + 'YUi0XEiPgQ8j3aM6PI5g8938Av+ipdkR/kUrLxodR2B0x+nRwug4AtpjERicsuIF1IiYiZx04LfmK6EjZpwtAfqmvmjGc0sw0m0g'; +moduleBuffer += + 'nVkCp+8Ycsi9B5kdz43CCPDsIbLWmU38m8Rl6qIg7CQa0e4XJxFxarLoC89BTIoBMwEizsBby/HUrVv8RgjrHODqCtdrtBEuBNdC'; +moduleBuffer += + '/LqlnpzvsidnH7xFR9RbFKmHp6wenpa0+ngLAPkeB5xet5tDOXBQgIP7uhsy4MsbmpmzHAGEqrmzfJ9/O1zwl0PxGG2qx+gdPImX'; +moduleBuffer += + 'b7FD/Li/gSdx881APFLXqM5t/CbW3mJnedeL/3pVHfzz6uC3PqojW3xUZQxeNOXLe5oaP+2/EkljVyNpfDlqCDZfjmSXLUfx29ZK'; +moduleBuffer += + 'uKWVsusJQ8DOYis3QgH6eiitfDVsCG1gBFpJUhnqxVkWk4bTY2gxKWf7aiezfbWTuq92EuPPpK5YJ7Gvtmw3eIUiVtnkIMz21aYY'; +moduleBuffer += + 'ziZzIU4x3IW6rzY1IYbAlEcwlA51M203+Cg28mapx8mST2abayetnwiba1MzqZtrU0wGeMhOxTWRba5Nsbl2Mt9cm0KLJ/PNtSn0'; +moduleBuffer += + 'ezLfXJvKJNRvcKNJIn01M4u71ezm2hk7KZpx9nrM8+baffScv5Ie4c218z031yY6bcLm2n355toj7uZatJXsorY3aSIlfoU53GBo'; +moduleBuffer += + 'HZA7MeTspcfRxXS/qsZOrOd0e+1ObHtUxHZie+0Bs9cp5myvnZ3FdW3ssduJOVaEWd+sJXDW2d5Z8DbOFvx1y/75tD2LFSSmq5H6'; +moduleBuffer += + 'GtvY/p7O0TMfs9umvc9/08Ou98xL2p7zERDHenJI9uac0lQS9qSNyKzPmjZ35Rqx6tOU9Y63mDxET5oWJw/Q83V6HiQBbtMA1QIC'; +moduleBuffer += + 'tBhJOkLo7llcPseEtuFY2W1p3N3Po7o7p7FbSmqg0zufNghOg+cwA4QfUfp/IdDnOOA2MGBmzoPGPv9TNJY4WwYbOAmoLTVcryoK'; +moduleBuffer += + 'BzyXHTCN+NXINA7SkrCBRahVsyry/mfK+3d5XgV5/xPl/V6eV0YrtKSexhNL6gbW6i08LiY78HiOFiENLNnreDxL88XGgdJnaLpI'; +moduleBuffer += + 'j08nI3h8KhkVZCcc91akO+046G/MMwJC9r16+FK3FMnXhQbm+X/M2/ERnRq78hvJOE1TaydLHj3GSSvku0e8mIUMjsQtxtt6IzUx'; +moduleBuffer += + 'EW/dl/FQrIzM8muyLAhl1z0+H4vrYoD3ofL3ZBidyP1q7BidATE6A6Zm/ZnQs1DoE3d5E37+RkxrqZoVkBpaHldnuCx9hlROSpAT'; +moduleBuffer += + 'fj/kePCGhDbeayzhJHn+3oh/k6bsWOSM8wYL6V2cSxinIuNE0+NMW0l3d2c7NbGZF/POLMNTYofwqo3HqVILy4mTJUzCpDVqvPjf'; +moduleBuffer += + 'G75uWA6xVhnK1yqhGedPdmaCh/qhbHt2aGq6VAl5D4n75aqCdP7lygxlOznhMHI/Wc3Lzs1xdRDwUiXK3FADvO5D+wOZ03aAGSOO'; +moduleBuffer += + 'sAav2yBrkMvIkcug+JGHNdTZnASFBB+HLB9tnzNDit8gAvBxqGDTsISVoyfoTLwsxX/os5ynE/xVMPsEGGYeydDxSIa8FJ1wStm9'; +moduleBuffer += + 'RvjoFn8tzLYWhVu2Ftk6NanDG4bEARnmy8iaGVLe1MCboZw3NfBmKOdNLfOr1OzenWw70rxAdxmvn8csd8bVSZhpWlMmnfnW0AHu'; +moduleBuffer += + 'fjBGnIS6dWK7Dav1sFcDYn2GUP3TpObMZZNzmTuy+gLsGn/9nb+TfRsW+1YX+xaLfRs3Bs5EsqBDySD2K1dp0DWDz9OLaRxBO+t9'; +moduleBuffer += + '4az50mWCPIAX5nky0dkaMkwmqBqqD5hRQg8hbyq8iYbm+GQzdyQtqGoH68kGvHTKx467nuyIeae5eUfm5p18OUmVaU1wqnSIqh/B'; +moduleBuffer += + 'kkQsFa3pT5UOUN5BrPttXu1UaR/lPQgFs3nzcCc2sM74GGIUwCFJc3k4JBvikGxgefgIIsPDIdmAHh6lBy3RqC/N6MnSfoj3ydIc'; +moduleBuffer += + '4n3jltEGkCQW8DKrkS8NeZQiEf4kZZotC0MZET/gwrBTXBh23IWhfB3o2PC72bowaGQCMIrY0MSPEXjVSDBgT+vE7WFi/I5kmL3z'; +moduleBuffer += + 'H2j8LPeWx+9bztxxFEJhqqdKg/Qowzp3zMCpUo0/3fjziOODfQkd8G2OHi10fEc2anXAsEl68PaEDhjWocfgyRLCk4Sw8R3s4oE4'; +moduleBuffer += + 'TRTFiX4OY8OACEcH2wvKWaKBTx2cwOeLZeun7ZjdugrtYBW6OzckXGV3bkjcdrJVKEv67tymdGQVuk3SG1SI7UIbfoq0bOZyyWqb'; +moduleBuffer += + 'OV42LnuYDL7qEWPpuYKNNW18tqS15UFVrMiuDgPzAGaHyx5m7Q9g9lHOoBFubxIooHDLMw/hq6p+FoRI8yw1/lmNxz8F/NuI2KqF'; +moduleBuffer += + 'pmDM7Ax0SmegRMpUtv2vzZa9DXV3p7WfJuvOH004wn8khLozWcIVk1Oy9kQ+E+biFa/gWgOsbCg9zt5Ot/IZ+CUY2bKLaNVFNHbw'; +moduleBuffer += + 'ZERuMZ43C3gC0idk0syzbfcV8YA6bEon8m2MNvFbISAtW6fFlJnVcWcK485sLi5TGHdmc3HJEWFMZ3MZmZJxZ0rPNc2KYOw125Yy'; +moduleBuffer += + 'WxYy+AqydR3zacqfXzQH3Gyc6zK7CP5O7ti3eLK0C323Mz9stUs+dxnbAbsEIOG1K0O8Z529fSrg89gmO0lmMEkI6ZFNEmZ40Ygp'; +moduleBuffer += + 'x4yz3EgoVwb4xOw7SbYiwYQupgePtYnz0QoUJMBmJp8suO8LsKzbmAvM5P2eSL8niu6M9HtqkvjX+FRXevZnlvSflxbE6+Oc8rBb'; +moduleBuffer += + 'cSJ1QLCw4hwwrjEr7JLETRG9tkjObd8hifjQ8T+giUhyyGDnUNTEKWZ45wJcmKqUljC+2gPCJbudEVdY8+79kuzWGsKFJgjJHCDM'; +moduleBuffer += + 'sHs0eYPer+PwMl9+133Ht/GyA7ltr/vVIPcwfYdzvhsUILwaLAQ3PPn9HWr7DRC+ziVvBYvqRgMgbv4Vx2H1Kue87DisbnDOqtNh'; +moduleBuffer += + 'a5xzIz9P3Z3nTUt6j6Pt1bQs26eczVP+l6MF/xXZ4+lfoz5e1f2eqwH3NxwFVdlEwkDGASR0d1/NwbDwVtJPyU7ST/LGT7IRgdmD'; +moduleBuffer += + 'WQVvI32SHkdhvgJsHMo9bLBiAl57CkboM7hYBufgv/d+5QLN3ugnfDn+4xOp1y1pKnhi4mTpTZ8dc8FNX3xjb+D5IBzfAYfoDHID'; +moduleBuffer += + 'xcAJ7TX0y5nziS/zD4/nH3JKPdT5R4j5R4QD+zr/8GTDnCfzjxIfN8f8I8L8Q6TH+PF/xhl6yFR3xZfJhyeTj8HGDyjldpftgdI/'; +moduleBuffer += + 'DZvtHxBamHjNVgZjoyAh2zfWzXH5xg+hzdo9tLknkesQfsA22SxEiY8TigpLAp5nsKpu29cYzjzBiBLM3cfMEZzhofpwgm5rehty'; +moduleBuffer += + 'OS6AgfYjB4b/fcGQ+hFuIGngNGz3yxEMXkMMR/y7/Os79Ovn6/j1avaLjFT88/x2w1/k845ed/yFBvzBYh7n888ZAd8ZKd+X5GuG'; +moduleBuffer += + 'qHZ6FMpdwtcM/nJRyr5mlEibacpZgt5P0mMMc80S9D7mIBLvv0+qi2XuxeePbzW0wGmFw4x++yuFeBGyXs7jRXwL62XEixhJ4djI'; +moduleBuffer += + '40Xwmvme4kWEbryI0I0XwStrJ16EBK3geBFBMV4Eh5kI4/8SQRHZrx2wT1edTsG2eBFB/3gRwQ8YL4JbDuPfC6WRPF5E8MHiRQRb'; +moduleBuffer += + '4kUEW+JFBL3iRaDRpFLcuklI/LZnWnbzfmtbvIj23eNFVJx4Ee0+8SJ4m2h9e7yIENv+f/ue40U0+sWLkO1zbryIb/MuOiGv43C0'; +moduleBuffer += + '0+NEeWdrvAi7g+4O8SI6+NBYK8SLqGXxIoYK8SK+XYwXUZV4D6Pi1RzC/smt8SKqhXgRQ8V4EUNOmQAeoR88XkRVjkGOHr9LvIjq'; +moduleBuffer += + '8X7xIoYEguxM0HgRgzZexGD/eBGDfeNFDDrxIjpuvIjOlngRnb7xIjp940V07hwvovFDiBdRl3gRKKUe2LrwqL4tZER9S8gIKSEn'; +moduleBuffer += + 'w0pSsxgyou4eWatnISPqW0JGtCRkRMsJGVExbYSMqEjIiIqEjKhkISMqwKSV86QiISMqGSYVPqKf92tF+rWiISNaNmREpXfIiEDe'; +moduleBuffer += + 'hxwyIiyGjAi3hYywWm3V0Dk1zvareGo8sBRuV/Di4fFCyIhga8gI2cDbxC4x3r9Vit/RkBEtM4iQEXUnZET9A4aMGHRCRtR7hIxo'; +moduleBuffer += + 'IWTE4NaQEW1R8RbObiJkRO/WnPASGjJicEsbGN5bxZARdanVEiMEMk2dgzJlISMC4VzgbI6VCZkNGRFsid4Q6HFQnbfb6A2B7E7F'; +moduleBuffer += + 'Z+8tISMCuLxC+d5eDBkRbAkZEZi2yt89Nfp9hIyoOyEj6v1DRgTFkBHBnUJG1PuGjAgY9vcRMqK+dXtZOTtQWd5yoLK85UDllmPo'; +moduleBuffer += + 'le72Y+jB8cIRyo4TMqLTI2REZ0vIiI46KOS7gFraUBdDITsTAlfZAzng9BZfp5uHjJhRlwp/eSyePGTlL548zDhwx5OH+eGY0WwK'; +moduleBuffer += + 'wodj9vCdknc9HBM4h2N8p6hzOOYONquGSckHsVlR74AX2eGYYMvhmErfkBH1u4aMCORwTL1wOAZ3bOOOym8HWeQJzEfqnPkDhIwI'; +moduleBuffer += + 'fighI4IfZciIejYH6hMyInDKfZCQETa8ixMy4s9CVznEgnNUYTT7zjoqGlrboqE1DRkhh2MGdbN+RTfrR7JZvyWnADpyOCaQwzFl'; +moduleBuffer += + 'OQzgi47UnQE8i7vW3nY45k/ucjjGDRkhUe74cMy3Ocpd1Ua5y0JGjPUMGVGjaicW03Hoxx9pyIiJO4aMSNyQERNOKXuwZBwHS8Z7'; +moduleBuffer += + 'h4xobAkZ0XC/6zaykBENkxzfEjKiIZG4nIMlh6SkbCQe23qwpJ0dLHGPcRQPlrT7HCxpyMGSMapTPFjShjg2IIhtMwb5bGchI7JW'; +moduleBuffer += + 'thwsGc7lzQwrRiJpsp1/uHCwZJSFIZe8YedgSSwHSw6JLLVzWSLYe/odLJGQEYHK6qDKakVkVUNGtDlkRMc9WNKWgyXbQ0bUOWRE'; +moduleBuffer += + 'QLU6BLVFtQ5lG8fdgyVD7sA8lB0skcMGlBEctwdL4vxgSdz/YMmgHCypyMGSSA6WtORgSUcOlgRysKQsB0v8rQdLDsnBkvjuB0tw'; +moduleBuffer += + 'oMR+xpUFjYyIgS5rArusCXoua4ZkWRPIssaSHMU/X5PTF9kn3Hx5U5OIFEwmrkEfNBHxqGUP+yAiReHcSisfViUixVAWkWJIIlJk'; +moduleBuffer += + 'Hc0RKYYAeJIeFbizhiQixRA6LhZeNLH9HjQMiZUf0gmUc25lKIvjM7Qljs/Qljg+WdvWng5tCefjIheqMDjHtWeciBRDbkSKGd0c'; +moduleBuffer += + 'VohIoV9rRmixlLsbQ45I0aZn7pNk55pGpAjVpxqyT7XTe/KF2ChuRIqQI1KETkSKkCNSjKibP+SIFG2bojWcjUgRakSKEF3+ni/T'; +moduleBuffer += + 'uXd1Orfpy8n2d/zMZ4eIFGEWkSKMl6M7TQ8jgXctEHg2IkVg12t3XhT2ikixfWaVR6ToZPPCHzwiRUciUtTjfxWY4F4jUnQM1+sZ'; +moduleBuffer += + 'kaKjVQfvGJGi/gEiUtSLESk6UnPw+4hI0ZGIFIN3iEhR/74jUnTuEpGiU4hI0XEiUgRZRIqyWqwgC/IQ0NTnnoJS9Oz37R29JShF'; +moduleBuffer += + 'IEEpAuC1X1amc/zpjUafQIJSBLLrgxfEHYnA0pT92wV8/z/23gXKrqs8Ezyvex733Mepd1kly+eeiBl5YjdKYiS1EYlOLWRbMcSe'; +moduleBuffer += + 'WV4sZoZew8wwa9G3vHosobgzs4RVxMIUxGmKiZMo4KSLjhMLgkkBhojEgfIjiUhMU502jcKYtKaXQwQ4SSXtOAoRaP7v+/d53Fu3'; +moduleBuffer += + 'bNmBdFYvrOU6d++zz378+9+v//HtYVAKtw5K4ZagFAMfDoBSuGbrCUv+zsDW04XVSG3rqR+rFjDUwicHdqBlJRv1ssqNqFsDpXCH'; +moduleBuffer += + 'QSncgZmu1C6UM101q2GOe25wjnumnOOeNnPcWZ3jFJTCM6AUngGl8OqgFB5BKaaM9sgjKEW3CBUahVVOPwaUojY77R6anQwohWdA'; +moduleBuffer += + 'KTg7bQalmB60JQeQOmapQWtyM0u5dUPkq6rzoQGl0BMwfHEmUOqDyWdxxQk8rXDDWwVKEeJsPARKEdZBKULj71GmHglKMTMEpyGF'; +moduleBuffer += + 'JJ/bAk7D3QSn4dbnVzWfVsSfEDX/LZhPE5TClR/PDRpQD5y74xooRVyvNw3TRoBSBENiPCkgOWNzv8xqN2vVbqpBqFsHpWhuqv2W'; +moduleBuffer += + 'oBTN+rnbrZ+7jbzPHXHudgdAKcYGzt1jvFHUTT43CEoxxsjauTsoz93B5nO3+50BpQioYDK5BHVQiqAEpQgUlCJQUIpg1Lk7GDh3'; +moduleBuffer += + 'B8Pn7kDP04EKCR0jYK6du5kgVF/XMl0FShEMn7sDtXYJNoNSBDz3YItHojWryS8YOggFuoEvxN3Nurjb5K7OyOU5qAKlaA2BUrTK'; +moduleBuffer += + 'c3dLNW/xEChFbEApYgNKEZtzt1oiNtUScUwtERtqieirJWJbLRFdHSPRKFCKqbqVO2z1k7/BuTvSczcN33sI8dxNk/Zu7dytIBNe'; +moduleBuffer += + 'X0dQpwCl6ODc3S1MhWugFCVC5Byw1vpZClAKg4uhniIEpdiBMdOFKmuHOoKUoBRdefcZgFLEiKY9YIjBwDQ7NM0crO54jp7TgyYQ'; +moduleBuffer += + 'c2o2bejqroJSmDdl781p783BDFNqk3yVZqdzIEy3UmbxNVIpKEVXuwm+wFmXdtTluW+8lB0MWJmroWAtlcoOemkK2UFakx2MV7ID'; +moduleBuffer += + 'mnmND5l5FZn0NBNacRVW26XsgCk7FceV9l7dPQpfURyyS3DHaAS4YzQgO5gib1SyA+ME0Bunb4D079SQK8AUzdHpxZjOYYxNlSL7'; +moduleBuffer += + 'shSVHUSbQSlaJSiFjhbFNB0EpWgpKEU8BErBYdHFILpDrXdvV6tyHQ8EpYhrsgOuL4OgFLEBpYiN7CBWaDaCUozL4Opi1BWygxiK'; +moduleBuffer += + 'TthME5SiW8kO3J4c2CV1AUoxVoBSQKgjVag2bXpdg6nPjC5i0vIZPTXOlKAUMTR1b1F7ZjCxWn5TdhBXsoNYQSlilR3Q6vu1ikdy'; +moduleBuffer += + 'QE26YQPuqw14W23AXexGzepJK3KCUoDRVXYQczM+wgT8raguzTHjCpQiVlCKWEEpAkB/ChHHMHEVoBRwlCrqnI1Va7eCUszgcD+m'; +moduleBuffer += + 'xCAoRUkJglLMKCjFjB7uZ3SHPKOgFDMKSjGjoBQzupTM0M8HIrVy5p8xLregsj/gcjsDNq653JZlFwvATOH5YAZXvXKe6a2aq20F'; +moduleBuffer += + 'SjEB0WOx651QUIrQbHknBkEpQoJSdOVZudqHBKVoynO1FqegFGHNbZ97PQNKERpQitCAUoREAgjwJBJASCQAV/eCsqSEBKWIFJQi'; +moduleBuffer += + 'JChFWAOlCGnpWBz4QxoHN8tQHZRCKlGCUoQGlCI0oBQhOu4RW3GcTuPpEpQiRJ+v2rr9NKAUIVzGRoBScN85CEoRvCxQimAQlKK5'; +moduleBuffer += + 'CZRCiJU8OhKUAtemNyFEphIxeAFQilKFeMaoZuoaRDDGACjFxBAoBSWkxVcTpc5volRMTAyBUkyoFnWiBKWYGAKlmFBQionNoBQT'; +moduleBuffer += + 'JSjFxBAoxcQQKMVEaV08MQRKMaEjYcJcFWJAKUIDSqGs2N2CFSNzLDFi3pCG+gPczelucAysM6Y2UooRcBMSVqAUXSgrei5m7eKj'; +moduleBuffer += + 'IVAK5p4166AU4WZQipAGhzVQCl4uOS6PysGVdVBQirAEpYjqoBRNSpUBlBGYNSXpBQpaRLDHCpSCKEbF+jBtDmfE3KFvxfQAKEU4'; +moduleBuffer += + 'CEoRKihF0xxpQ9VihzVQipCgFGEFShESlGK8fhgkKAV/KSgFh+wxHbE/oXBvuP+zq/eMBnrfaUPvZY14v+wAKEU4AEoREpSinEdQ'; +moduleBuffer += + 'ioJShASlCKtlJzRmnkuYnGqgFC5n2nAzKAUAIgspkIt6AUuAUiAqw2hUEEAENF3zPRLyg2MaZjM4XQOncEsJdsFAFTiFcmZF6Do4'; +moduleBuffer += + 'RTGlCQ/IOqidpEnKBZAXsocD4BTorLKr1JxTe0PBKaZhzjmmipXCnHO6BKeYVnCKaQWnmFZwimnQIFHGAXSTq9BNzUE2Qv1KcIrp'; +moduleBuffer += + '9CrjFjQNt6Cr6vBNMcI1+KaShszZUwinZMD1YFrdgjaxbiHXHgFOMT0SnMJ7AXAKj+AUcKM5X5OQA5wikOfGoPTIgFN4BpzCIzgF'; +moduleBuffer += + 'pUkEp/AMOIVnQBe8YXAKj+AUXg2cwiM4hVcDp/AITtEs5eYApwgquXkJTuEZcApKjp7FU8EpPANO4RlwCkqmDDiFV4JT4O6WpdDI'; +moduleBuffer += + '+ncbWX8hq/qhIVmVAadwK0p7BpzCM+AUXgFOwdrc21CTXvgmbS7FHSrFr0vEBsApPANOwUwf9rQUgFN4BpzCewngFDTivQxwCrcA'; +moduleBuffer += + 'pzCbBPeFwSncEpzCVXCKwEgx3AFwCnczOAUtebcX8qLvHjiFu6cGTpEqrXbsNGiCFCfuKDZHO2pWJZcNTpFeBjjFji3AKSiI/P3L'; +moduleBuffer += + 'BKdwXxI4havgFD6U/oPgFKOkjjsH5HYAp1DxhWxbuXLAyM81PvpYJaTeWXCIQrpruAtI7pZTVPLLRFrZjcWkZiBnXuO7MkWzTKF1'; +moduleBuffer += + 'aXLB0bvX3NylQI4r0t0xDEDdmEwgr0oDuIbOxY3ynpIG8C6gwuDi1VCZVyOvjFqHvw+q7+kzwAmxYyA4OrUdChE0hyA4OoTgcAso'; +moduleBuffer += + 'zRoEB5E0FYKjoxAcnRoER8dAcHQMBEenhODoKARHhxAcU4MQHL0gt3h14IZ2xNAuvykfn/Fo3yc7/mbyW2GxlwT4vT2JNQn3jU7r'; +moduleBuffer += + 'gtSs3ymZFIo4ajXca61m5qtSA7ta/kIeYeZT9ZHKwxssXgv3se03Oesxwshxm2u59WNgg3zR1r09PXHZXZwqmvk7bZX0todfXLIO'; +moduleBuffer += + '98aENmPcp9B8NlkkOh6OGEUpsN2kUVI7+UlI6HyV0MkjSpsy4cRDWfux4QvtfWPyXTaksqBJx3J7QQ57aFvalsF9pNfmpaHaWLXC'; +moduleBuffer += + '9utW2E21wk7MFnPLBIXEtpn8esyMTHWaZjNAbvWrg4pW1HxYnhRcWMY3tBfHjG/htdas9Gj7Bvpq/LkFnp8rFVW4CuGKV9u3S+QT'; +moduleBuffer += + 'fLXd7DZUvkwvjZlSkssJXhiCYl4yAQXA6qiBDxDXerUVqky3sIWWR7NPdtJi1ShVq+LXq2J7UhVh7LHc7/nIzr++lpdu2FjG7fAD'; +moduleBuffer += + 'D7CJYj6l5BnCIDRE24BS1Jt0EKmmtBMcRqpxC6Sa2CDVKBg3DjYRhLMPJp9yiKoss2mrhlTTAkr3EFJNq4ZU06qrWpBYkWqitJX8'; +moduleBuffer += + 'Cu5vtP4PSfKndVSaFjztW3VPe6BAW/9M4gaQalqUs12FJ+RsLfWwbylSTQty7TE84GHfgl6li6uEgBXRgof9NB5v6s1oZUci1Uwo'; +moduleBuffer += + 'Ug08glolUg1VjgQR/xs6AkW9mP5AQKqZgNGTLY8CqcZ9yUg1rh79Y10t3BKpJlJuikqkmmgIqSaq70Ai3YHolUIlUo0xeFAdGq8y'; +moduleBuffer += + 'bCW/Z0O8pgwS15BqYpWHTNSRavh+oibWnzCrYFwi1fBQ30qe8PSOz1m94XMkUo1bItWUBuIFUk0ZUSDVTChSzYQi1UwoUk1rCKJG'; +moduleBuffer += + 'qm7D/RlaQymZHYX6lEbis7qg2nsKC/DBa0ZdxbFxjWC8umZUWm6kG1wH4rqyO0C4UnaXUOc0J4/rWu7dak4+a2SKQzg2UYljE5Wr'; +moduleBuffer += + 'dDQKx6alODatLXFs4kGLSQxX9PJE0csTNQ3DxKDakjg2EwPbn3WruMcZHcsrH5M/c0jcbI6GBHU3Z6PEcGsGkO6AAWThhQsGcysc'; +moduleBuffer += + 'G9o7ulvaO7pD9o5uJXmSfjJ9E6NvJqq+idE3E1XfxKUoNi4MCofBt+sdP4BjE5U4NuU43IRjEymOTWsIx2bzDBePmM0inZsm8Pmb'; +moduleBuffer += + 'ZRJgL/eqXiYhiWPTMvgiLzD7jensl+js19XZbzbtQf8g8+tEbxyLfAC4mnHg2Fw1iGMT4UVvAMfG7c0RHTuWis5I9ZpScEjTu2Y6'; +moduleBuffer += + 'LTOqwbEhLmqrhmMzVRdBTenkPxIW1YNeJgSOTQs4NgUESUtxbFp1HJtWGgPHpgUcm7iMI45NC1uG10E/Ch1GS3FsWqrDaGEfsl8e'; +moduleBuffer += + 'XegwWopj0wKADS7tmQGOjbA3cGxaYJSd8iCOTYsSmVYlTWoZJNE3SmSq1vmlLEnXywG/LsiSGiNlSVOlLMm4dtVxOn0DZTMl7d43'; +moduleBuffer += + 'IEWS+bHggRlC2UTSBW4aUlI5mybS4WPS91f0xqjtuqwF1h/Nki+b1eoLLZWAAaBsphTKZgpARJHije6Wx1WwZppC1+1SNNSd8qCF'; +moduleBuffer += + '55SqbKgBBFLqrCKljmOWn0pdLAJTCmUzpVA2daBTQNkUeEhTdSgboqNGBZRNq4KymSqhbKaGoGymhqBsBgBVC5nV1BCUTQmo6g4D'; +moduleBuffer += + 'qr6iuJ5gE5RNp4Ky6RDKxsWTUDYdQtkEo6FsOiOhbDoo+mlb71YjlE1QXlUHru5shrLpbA1l06mgbAqzZL02oVODsuHxsICy6Rgo'; +moduleBuffer += + 'm04NyqZj6opDnkLZdGpQNp0CykblILy6ATqS+sdbQNkE9YomtXqyImdZzzMD9VQoGx4+eWqtvyqgbEgivbkh+bKHnF4WlE1RkS2h'; +moduleBuffer += + 'bFT992JQNqXY42VC2Xz5JUPZFBW/bCgbNVIuoGx2YJ/gyqPcJ+ygiAm7jh01AUxq7qvDFR6EskkVyqZ+XYhbmWWkqM2Oar9Qfz+Q'; +moduleBuffer += + 'V6FsYoIdI24V0eruKKBs0heBshk04GsYcaWrx01gjQ2ZV+/rj7at3rXZtLoOZeMOQNl4W0PZeFtC2XiEsvFqUDYqtlYoG49QNl4N'; +moduleBuffer += + 'ysYjlI1Xg7LxCGXj1aBsmIOBsuFvA2XjUcHr1aFsPELZeDUoG49QNl4NysYjlI1Xg7LxCGXj1aBsQFOYOtagbDyFsvFqUDasjIGy'; +moduleBuffer += + '4W8DZUOBt0LZeBArBiWUjadQNm7dZpNQNp5C2dAE/Y20GJc5wlMoG0+hbDyFsvEIZVPK4wegbJgfoWy8y4ey8QyUjWegbDyFsvEI'; +moduleBuffer += + 'ZeNVE1QBBrnmEQuS57oSykYBNByzBXEKKBvnRaBsHLMFMWg2bolm445As/n7MXphoV+g2fy9cnMVzcbkcW6ASTZb5O5i+vg7UGb0'; +moduleBuffer += + 'Eso0aDZ/3zLraDYmrwrNhnkF9bIH0WxcyaOGZrO56E2Vq+qCPFyi2UzW0WxeRh6Tg2g2Xolm45VoNl6JZuOVaDZeiWbjDaHZuBzI'; +moduleBuffer += + 'LLnUf2Kks3Kl+lNH9+Wj2UyORLNxt0Cz8QyazTMTjn18ugCzUYwS6aDUQj28+W9d+s+XvnDp0t+++/hdmTNvzf/aF78t+X720qeP'; +moduleBuffer += + 'J7/qSVKoAxF/6dIX3vONS5e+uEOjl030A88+/sn3PvXwyT+1NH7RxH/2V+67/wsbf/hbz5j4DVfjv/RHH33/M89/7af/wMSfM/Hv'; +moduleBuffer += + '//ylP/jl335icZtGr0u0LRs7WcRQ0fBYhsnhNPlK6CavVr1MJiHntoeOHZN611vhjWgFDOG9za1YdzR6uBXYenmjWmFp/FArGDfU'; +moduleBuffer += + 'glVtwZqbxXgue7LhlJYkxzL4noW3PSRpTml75JT0BmnGscw9lkUSfZZDV1LJd+vuS2nmyuhmLrujm7nobtFMZ2QzweSjmorFEZ3l'; +moduleBuffer += + 'opOudhe9zENTZ49lcKj22dST2lQ5GGpTAzbOUWpETHJGmx2l8W0FNabQ6TVqrG5JjcYIaqxKvRqbqbFiooepsWzih6mxaOKHqbFh'; +moduleBuffer += + 'a/ww69qkxqqjHb/hasenx7I2TLTZ1KWCkZtKjQgpz9l1gsk2CUn8NLitItiyqwSbUvZRyshZTnPxdJSccSqCrTlbEcwdNUqA/LeZ'; +moduleBuffer += + 'YKsmephgKyZ+mGDLJn6YYIsmfohgOPKhqnY2TTK4OuZ3Hcta8BJlUy+4hn3a2tQOUt5xjHeAKknP24Z7DEkTsqLQCzAnhgfdQZKO'; +moduleBuffer += + 'k2uFByfKEXnaMSQ1PCgknURn2LURab8UHoRdzQgePLAwkgV3j+bAdDQDJiP57zTr2ptBg9maHkbRBf3ZJnwUfinLwSUYdILtGohh'; +moduleBuffer += + 'Ay1ITqA9MhJNdXqxwgTdKnzcSjtvILFdM3G1QGzpL3lvob+6acIEF/ipnFm7tf7acNBhY+k4kyxpHkk6VuuwZUc7bEIZXHtjPJ14'; +moduleBuffer += + 'Q9Vhq7Z22KROGtozk+n0QIedt6oOe3Otv/a6G5ivgXMgjGPaE1UNqdrQrio/jdGn1Z6q6tvGUNSazlRVjDCGi8qp+RM89vSlFH8B'; +moduleBuffer += + 'xbfSaSWjs5mMG9I8aNbaSiRNERTN01lAkshEmkZMcso2XN3WJOzA3ZgKHA6NuBoTUv4iASTTQHvJNuV7VfmLLJ/zNDjINi0wQ4ZT'; +moduleBuffer += + 'WoriixGzz5QelkUsaRGxNmBEEQlKkJMkv99lCjADTr5f5sEg9fh6tv75XvdkA9OUh9PBhpxLz5Iz4Uk7/+Ev4lS8svh97Ot5++0Z'; +moduleBuffer += + 'brqRt2ewUZAAOECmn0uXHvydv7506cPdt6euxEjC+R95V5F2fTDtn7/7l37lwhf/5BNPWsdGJD47mPiDf/bXHzv7ez/3nz4/MvG5'; +moduleBuffer += + 'wcTf+MjP//TH/+65333FqFqcH0z7+a9e+pN/90v/ZrGtaR/M7X5uH04+HSX/AbsF3eX9dkd2eRl3eV6hGsHC5eguz+IIzRqYIlyu'; +moduleBuffer += + 'dPA/zYJ5oJMzbkXjksyv4lY1bjYLqziz2IeY7VJP4zZ0hUwDk5WrQV+D6yYYmqBmkNQzWHQHMlgdzODcYAbnNIPZegbLgxmsDWaw'; +moduleBuffer += + 'MZgBFm4Xk560VSbrS/+nbqbeIfxzhynC7P++/Rt/e+nXF7/2x//eMsWY+Heuvuvzi+94/v4f0miZzRF75pt//eTHv/615/+zSb2u'; +moduleBuffer += + '5cgaHOG57PA2KR3SMk1gFLm67AcSf6EYxy4mAZnIMAIwnreo49oWdVwdXccVEz1cSSzKXBHl9/lytHOwtlhrU72TxcqIuUS2Mq4u'; +moduleBuffer += + 'nSGr63DnUuw8GtjQHTPNwx6vc0wpsGZjBnGL5dTlYiqr84s1tdh2Dzf1nDWyqevW6KbuRktjtvRMsVuI2dIusYVZu4DTqlvMfEHa'; +moduleBuffer += + 'YtXGkOKAkuJUQQrMuLJu4VvHNHGFS0iDM69rVl1DtGOGWtiUgFpnC2p13lBS65zkMy7rm6HwHVg53XISxex8OfRKR5MrGUWtkZTS'; +moduleBuffer += + 'NQXne7Npkj1EAdvcm05dc0QhCLBs2KDWxlGnB6BP99YePLd17etBGauLcW876K7fXYlY/bmDDOT2rqLQq5dSh4tfPcIu9zJqcxHx'; +moduleBuffer += + 'faqmTTN447TZSbrXgW8P6fEK9gAXMLfYykVpUvbSuoseDtGlaGRx3mgVm3ACTNf7b8kd0X/Lpv/OF/03bvovwCZANcvKOmO6po2R'; +moduleBuffer += + 'bWQjAkbz046yhiZqa+9zjEiXl8upJN+dSUf7bNi4LNzoqyzdll6RzuoZCd5KbJy0Dsu+tmu61iC0VpsyVW9Dg1sYopRiHwBIiFeU'; +moduleBuffer += + 'u6cm9j3yxXZAKZqzGkjS5v7HNet1O92pX7RlvUfNUskVGwIPyzq49iqzQdkBdE1WsosiubNOryxGHivpm038XHUg4lGmxV7+PoxB'; +moduleBuffer += + 'UxHZHKAwpSG39ccw27Bi5RGBvIA7JlGfHm7p4NeyefBSc7NevnT+USv5NzAYWPGwfJ7+3vL5veXze8vn95bP7y2f31s+v7d8vsjy'; +moduleBuffer += + 'mfzrauV8rCUr53asnGtuATS1WCxybrFyciVxuHJy8fKK1cXhylmuRyZuTQXNqavBdbNAmmCxXnoaxDLrV99ifXOrxEbGXSQuVrqG'; +moduleBuffer += + 'ycrmEr3qSOlmMnDrk4HDtczdNBs4ujoNTwdOKUIdnBIcLiuOGVTCzg7Xz3DevocCXV3GkM4sYw4XMVeq+va7VZxwbMsarmxVQ2tU'; +moduleBuffer += + 'DUfWblnJcA4ya4dLbUtii6U2kmqm4fyPLJ0AW6n4VNuwTpG1MK2wkFOsf8pYx0zDVkzDTpcNW2XDXqxVi1u0amNkq7iWjWqZ7C0c'; +moduleBuffer += + 'zvsdw9FOMfEYGW8G4OiTxWSH1UpmGadYnR3sP2QeAAUipUDESBuD2ue4c4oFOSiGH2lza500p4ZIo2qgYpUEyQeI4m1BlN2jaZKO'; +moduleBuffer += + 'JEkymiK6PADmUFfQ3gS5zQH6l5mxFSAN16Y6xeozrcBcumo5hTh5llV3e4qqLeuXYxabbUSqluXL0RlPVi9Cnu3OrmR/uNkOUKXo'; +moduleBuffer += + 'iW5Jdux3AEp3puwkrg4YKWmsHRCrVkD1KS12QLkfKdcixwikmxTmOoUodrCL7tAu8pnHUrGB7NxWrCjoIrMaeUh/oNpWJntlryJt'; +moduleBuffer += + 'mpO1QZdTYBvtMJsd4LXJtAm3crO2dtGp1TBqFG0ITRvGh9adJiXTM7UKo66+aU2xzF2pVW3tdU+hMleYYkPM6VxuZbHzlLptlO5p'; +moduleBuffer += + '6T7WMK4zKmuOzcJn1pQGCNhEdbiMNcvVYxWFeMVCJdGgFit0slAIUL2XtqUcriHQ7G3TNYZryGk35U1ELtcQBycNWUPe1Xbc4zbW'; +moduleBuffer += + 'kMVWcd/KqQZv63aH70s51ah5X9JrMl+lMU/mlrZApxp6fYxziOZPrT4tTR6xaYey8VU5+r0XGK2ZnX/TuiG18z+0bzhykHcjfNlG'; +moduleBuffer += + '+OPODUfkSyuXk+JHJHneSR7yJWgbzyQPPj0OHglV/ReCfkZ8fyh54cor691DLO1q90Iw7/4PrOspXoJw0i68f41BwNKgAc1iCLM6'; +moduleBuffer += + 'TQ3QvxM2bQmSr9PgQJY+XjpzujHw0ao0+LyjJLraPdXIykKfbqKMRxr9/IRtLKDONuvXzEi3nmlqLudhhNXU9hAJ++8CtOZ0s3Zz'; +moduleBuffer += + 'KCIuBHuci7HWMf/KM0KfbaCPl1+M+8k3fRhhWCY/xzNkk0erLFbNTtBCliXru1Ztl3M+yJyitIZpcNXDdtlgNBFNNtmq1VlQFQdL'; +moduleBuffer += + '8svppY9s0UunnKqXtAojuum8U+und9pq1WY6ar25ZUedaY7qqGuKfrrPEANO9QPdNKtZnGkCmqfqpIvspFPRy+wkyW6LTvIHO2nN'; +moduleBuffer += + 'LjrprF91kmsau3UnCXdt1Un0k5YMP9LY45CYF6WcL2PATWtdQc+VqBgpJ8LBApyLQUa6vAATcAz/JrJMa2OYtT5jukiamOHcb8j+'; +moduleBuffer += + 'AK3anvEHrAuf9vc693tao6xBnbgmh83NSc9wl5M2dLB+xWHX/Boc9OE9b+H+p82z12J9+moMTF8XgpS8Kr3bSO7H9PX1Jr33q8Fo'; +moduleBuffer += + 'Gvck+nZMGpfbahoHSzbTqa2+9o42Jbfgd2Us+LUpVfvXCrZ7huz+XDDQ/meFrDAFhHkiVXBO1fyzzkDzhazJH9faD3vP71z7zzuX'; +moduleBuffer += + '0/5i5mH7N5zh9ut93vojeT+Diy0sRB+MnaYsRKmH1cCCJ+p+nHngmkHrqutgdwV4KQt2wB15vMOBy21pegX7sm6c27149H1fdEeT'; +moduleBuffer += + '1wCTlofUuRe4uDSoiQsNvVvaThr0WvBVSumGCVvQNOSv8BBvF5IRYsNitLnQi3OrR3NIObzeyGzhN2CrJ3IjbfXQ0Tm8BvmFrPM3'; +moduleBuffer += + 'ZP5cj9fipP5cCp/lmFlCk32obWmVrF6IaiEP1JTVCwG7ItVzR1SvzV/tmweqFy70oqp6ba1eNFi9cKh60YtVL232COCAc7D8f3PW'; +moduleBuffer += + 'mMtah4RmdEqbk0wIpxQc4p0bjUNtzzkOqYdkkbaSn/EJxealssfwb+6h193DvVC7ZSF3D9HPNNDBcexwr4mQe2DeZgZZI3f7P2BZ'; +moduleBuffer += + '90i4gWfaPYGfUnmE9Lejv0/0urJ/CnJAdNwo9Y7TkB70Qb/XYIZFBpIOGQAwSKqQhUyLc0U8p4Q6DscW6ejjyi+h6RR0Ugxb39SX'; +moduleBuffer += + 'XaGMX1JfmryQ+vnxt5Fgt7ThTH38bSnwDRdkRycx0VDXRfwVgbPaOZ0+4gUtRPstupG3F0hVfFNyKH0Q1/rNB/PdkEXoN0mTRnPC'; +moduleBuffer += + 'yuopHGKMDtc6qte6M6rWzbLW0YIyXbw1w3W0DtFArdsjax1trnW7qHV7uNawXwBEexofmlvAYE6Dg8oe8n9TkTOFeZB/Ey9zT7kn'; +moduleBuffer += + '1FfCPeD+0HBP+JK5JxKGEO4JlXv8g21aCW7NPj7Yx2diL5awhctwt5q7YGu9Sx7NPbQudeDTxMkORqaBGpnG8GmycJE3bE27gPvW'; +moduleBuffer += + 'tbMLCaCXr/3C71jJhocrsQZCLdidIvSXCAFGbBWhv0IIq8Nq+Q7r+3r5HRb5c2Vo8F27/u5dHds5bjxAncKJ+aX8Sy24ktkLnRnb'; +moduleBuffer += + 'cb2GH4RRM261O91kbHxmYnJqmpDSnPqdnARz8mc++rgFdzBn3gPitc37spKzgN+a2Zz64tappzenvu/Xt0w9hRuVsMjByt+hWTy6'; +moduleBuffer += + 'zMkd/XS9/FTWu30UM6D39Jnw2r5Wfw/RyJ18Zx9dil9PWn21ua9KmtSSbJO/qdqzZf625v+a0dkO5jWxuY3Lq1u2cXxkyaurQyX/'; +moduleBuffer += + '0hYtGix6bDAzQ6ZzLy+zZHM7Fj+2ZTu6I9vxwMeGiv6Fyyq6s7noM1sX3d6c+vzWqVsjmvXxLVPHm1Of2jp1s2LYGhEe+fgQET50'; +moduleBuffer += + 'WUSINhd9duuiwxFc94ktUwcjmrV1an9z6ie2Tt2oOEFGbf5hG7MtP0z1kUDw8fDjhMJhxGw1LEE293rrJgjqeLnAfLoX5RKeJuXN'; +moduleBuffer += + 'AmDra1K9sw9zdjW4bVJUa+FtNXe4hjif/E7NHe7ITn/4o0Od/muX1enOyGF05pMvawTbAzRgD+bwXa2GyRa9KMutrBJ2PnMj79bY'; +moduleBuffer += + 'NKNc/MRLrw8OLBVrPnwZGWymNXJQUDg3/ljTsY/vgNBs2S1MFijtlrOUT72L/PAqla68GLA6OKdxCa0TCksEjZulZUNhXGCresXG'; +moduleBuffer += + '916lJK9nBcjFmjWBnPhqGSxXGSRFBmuDGWwMZrAymMFKlcFsVlhF2AMmCtA4hVVw1WTgl5pbl9LbTXpe6FuplFYxr1EjwwZWNjnz'; +moduleBuffer += + 'KbQzg9/wYuzSrpeakNgoJ4NCCx5VOueGas8022VbZbiUn86nS9Qm+ixlsGbQNt72kKrVExoSFAbNlNVW2u24sIDoqNVApdMNjMhV'; +moduleBuffer += + 'a7VmalWa8zarWkFBM6aCcFTMLyo2svmq6eiNlwYXvYnSuAH6buhNoOymSfl0oe+Eottok4iAonJ/VXevOtB3X+3upq57X6nqVlUZ'; +moduleBuffer += + 'VN1GzW0UF1eV5EmpzqZuulAHxypU76m9iGoIOnXbjLjQF8dqJ1Kn3JlRlFs3lDtVUG7MUK5p1OBqoNwyatOstamLPdPFsodeg1hk'; +moduleBuffer += + 'TjJpveGhbCydVt3BbdAht9OeaqNUJYBKT1S1bakqOqKioKxgR+uRUJedpOlthaIggiYYhECndt9QdmpCP0433aHyf2OpIny2Ddpv'; +moduleBuffer += + 'SXeFscow1u0sP52VZ6tsnafm5NQMRKW+IFRFC7UE6yiCWgejJQAJmP2VdSt1VcddVQwRyWave1Y/he15g6qyve45aiz3uktyjldO'; +moduleBuffer += + '3Osuuhp3waFB96VLQtsN/D6uMmFjZ0Ubg+Srtho47bTiM5E9dxdOPK9y4Fhmvwoz2l0IWpBqvQqQincdQziEJw1SRRpuCSltJIs1'; +moduleBuffer += + 'nMiglHCate9K+WZn1tE3k0JOCW/PEg3PSkfbeIxreHs2gfBkNqnhFE5OyHBawzuzmRSVaKaSdZgi11aKvLopchhL8d1EitRBOiV/'; +moduleBuffer += + 'vXTmLoDXSnKXyZtM3mLyLpOPmeQTTI6PIn7k4qMGPwr5UZMftfhR13w0xo8m+BE+jfFpduX8tqVj2Tb+neNfWtNcdXe2fb55zzHh'; +moduleBuffer += + '5+5dcK+QDxJmMc4sJpnFNEv3Bz6bnV/+psU6RXeBb1gnUHvOJJhjvtvLZDGqju7ZZhJsY4JtTACHgrtM/SQHfmPquZ1/r3gQ7pNX'; +moduleBuffer += + 'HVbHSVdILp9Ms6khm9pkU1vyd9Y0aOwu2HawQRNs0BQbtHVTrhgqKWFJ0yhpkqQNWV6T5bVYXrdW3gTKG2N5Uyzv8kuaZEmTKGmc'; +moduleBuffer += + 'hNSubLK8FsvrsryxWnlTKG+C5V1+SbMsaRwlJSxpkmyk5bVYXpfljbG8iVp5Myhv6rJL2s6SEpTUZknjLGmSDKvldVneGMubYHlT'; +moduleBuffer += + 'ZXkdlIeSdMK4+1jmmgK9gQIbZYGpFHilppG5HHm4kiIzM87d5qsGv/L4lX1YJSrufAe61uklFPLvhLUMixbpkDt0FdtN7obF5Ttf'; +moduleBuffer += + 'SvEGKynZ/zBky6lbfuvFv9F05lRjCrRJdeqVrYkF5dYYHmHWyZ/+6uNWHiVvHJJ/2Luc3dR2Xmv9cNtG8C09D483wynsWus18Mzn'; +moduleBuffer += + 'TT7uATjm58ffRty416TuwbZLWZxHXNE06l9jWflnj/9o28bRT+JvbEcxX2SQSMnbTLbdN/EKuR857BzH1bULEN4Fa1kzP/BjgPzL'; +moduleBuffer += + 'rzqsV8CbBG6RoFUk6DJBSxLgemq8zoPDuX/0SFz+6RFc1D7cloY4x/PjONTah9rWtvzt+TEEFr1DMEZYTG5B5F1SyT4kY/bV7j6Z'; +moduleBuffer += + 'EYiokd5NPNlGuv1BOTsQe8bGRRvjeLw2A/KecJ38vj3zFmSzA4rhksKF3lRuQeANUHFAAIeH5rJpRMwgzRt7Dh43qcfdPtncSOhW'; +moduleBuffer += + 'OYWQ8Czjtt6skDpM4bLlpOHNc+lsfhziSUBbyuwPPUvansscppD3/d4VRXfKhy6AoHH5cHxL2wc2MO4Thyxxad6++1a9T2mqT5G7'; +moduleBuffer += + 'A0q2pbsaMT91pBy+n8St31dImpmen070mpD6H2y3IHqErxdyBoEXjKyRF2h2+7J1a0p3qLAVt7fbyGabRBEtOIBgVhaZtnCEFB1C'; +moduleBuffer += + 'rNp6vWSIc5nbv1mvFO8zs3HYR0nGDvID1PGNbYc4nmhb6gBU6+KfPG4kgtAvSByKQ/aMwb3pGkPYeXjsl+lxG9fTtZCXP1uGPKkZ'; +moduleBuffer += + 'Oju3ePzEQ/5naw8fhH7TzTxcjiUtwHiAWhYmDE+clwx+oaHj6RqPj11gzd0LRM9oHsKBj76bSP6UJkfuSJniz878TzBCw+QvifjM'; +moduleBuffer += + 'yxQDiHjp9wY5bf5MvZTtWsrsplJkCT/UNh6hsIJx8ufw3VddzgoZ+S/Bn8nklIMhvrvNAY9buuAPCrGvFHbia/oR05PTW8PpsTvr'; +moduleBuffer += + '3Iyb5g7i1y1HeH3lWDkPNPJ70aTd+SPySL7m8z4GSKh1PCmDFOT2jb5ujxPG9CSklMKoHe3UIlzDbnif4jqWS3T7l8NB8qUwo2Ab'; +moduleBuffer += + '66mvC/h21ffplwbkB6JqiJWxHXwS1fl8ZMU/GdqTx+tm/jQN+cWQx0G4qeIBux95tDT+wAIck/FAA+TR1vhzbj+DN6ef/FKodpF0'; +moduleBuffer += + 'i2xpcM0lPnva0MQnIc3ncSHrGhgKFyAKPFwk/SwpI5cI9k4kw7EiEiCGFo1YofzqaAm4yWECwyP515h3ZLuOeDjptvGjLDzUE2vm'; +moduleBuffer += + 'm9wiFQhkLRNu6vE3G6+XdsCUJscj0zwbl4eWpdlFaY6WRr8CqJOLBl/g1YNFo+BCUDXxvISG23bOLa+WoCFXWbkR1dKmsdQVm/yd'; +moduleBuffer += + 'BqjWZWfg5c995FGrqOqajdu5naJpcfKvYiVaeSVGpBKHOsHKELNds9XEGKKQLK6qhwtt4EkcI2sKNmS731Haeem0lnSZleahhj7H'; +moduleBuffer += + 'zDzQNjjaxd0yj6TMYyT7+Pq1XevKor0XnHp7N5x6e887A+0FXtOicT0xvc4WuZrXZdam3o8u+jGQwcQ6TaUTaJdslKV6v4jdD1Ka'; +moduleBuffer += + 'V2195ZhXNA4pKtBOJ/XthFLGondJWQpNlt8ZOY3j7l3VhigPb6H1V3A4czATW8C2y9z8aii83dIWYMVWFFh7ARuxS+7hjMpEqpEx'; +moduleBuffer += + 'ZThH83Pv+R1iuaXOnQ/1oH+FVjm1CmSai4RsgX6Oi4nDo6ccA1I5tAc/jM+g9ZNuKqJxbi/ehFu+aW1+E+FNJD97QQpTUCB3yd4p'; +moduleBuffer += + 'a8hiyWm3aqIz0MQupuKiJZJlLxxosY0WO2wxKVe2j9LNy2ufzaP0qPZt8aa1+c0LtS9Ofe/AcPFRUbykNN9VSlNoBSUWu8Dkf/KO'; +moduleBuffer += + 'Q24F5DTaEB7tp6yGUKHfSN1YiQRO+G6XIjQVtlEGPewZ5WXRb9yBq07aHWZLLLPQOCtboovmLamJYcNG2U1FbNmK+f/vGzMjmdG8'; +moduleBuffer += + 'GMmOI961Rr0L8S7ckiWhsahTtKxLWKNpOExTiSE9b4OGHPR0NtMTcnNuGFa4I0sOk9uf+ZsnrNxJ/m9u0jTqWUS5GrVmadwFxDU0'; +moduleBuffer += + 'btHWuHsvSFzTxDka9zDiJhAnO5Dko/a2bqyAy7vy06eMzlt+mxB2nuuR4x3v4Ay37hSeExcUPEbOP4UFuD9oAX5eZeGbTMDPmvgh'; +moduleBuffer += + 'G/AzJnrYCPy0GvyftxWyJ6TJNFYrlYDKqwt25T9TOkoFg5U5ZVPMvrkylsYPVSbU2OG6nNS6nLIzmp2ftbOmQYmgCQqNs/ViImPY'; +moduleBuffer += + 'XAg56W2hhtDy3elRFQ4HK7ykeoZNFb5gafxQhc+b6OEan6GaxF2y1Wb9jKHiLET1ak1Nv5Grue4Zo+o2Ur4R8uaiTauF0fpYKbiF'; +moduleBuffer += + 'Vf5KrU0nR7WpOdgm2TY3RzRpl0YPtWhWY4cbtFjI8jEu8Yv3e7+1R2+QXT2QenfhGICofVnTuBfREUa7RkFM6DMRKiU6SokhVy1S'; +moduleBuffer += + '4ieUEuNMsaxZdNUVjJToqqarpMRNNUIQQ9GBcY6pRFKVDnVAIT4vS4zBLT4l0tjAa78Y7yzJ7TRyoy9YSv8SbU5SNWcWygDttrEK'; +moduleBuffer += + 'n8qnQN8x7p84MejgCW8jVMkZnOiW4AIMdVTmqsH7Gfnp0UwwpZsTNHIaOI39swngwTaCy2SrdYrQ5ik9JmTyD/PlP3tMjmqhpljW'; +moduleBuffer += + 'FLJKIFW+Un93Ut81zLvV+rsVfeeZd2vmnYJ7Xq13IVtEGSoDoU5PDKjjFH7SQ0s2Vp8K7CtxuDrXKhSS63FfOSBr5rvNne4rjFvG'; +moduleBuffer += + 'RrmIwzBJPuZQv4b73ST0OVRqo9nXUZ4l5edrzT6dR3Cn5FgZiyI6EDVrNsu8cBJB5rPqAxaeh+Hx5AQTBP1su2JVZRMatRHgvh/i'; +moduleBuffer += + 'emWTGrXo94lBVpbi9xWwKptmHKoT9BU5K5tlFLRasCblkMlaVau5XjpleB33NRSZLEa4ApWf+6huBGxfBqGbPBfhxmUG0Zhl3tzB'; +moduleBuffer += + 'YGROL1fhWvnkdnPC2FarMVznxssQnOGmyxD8xCeqtrmAji9CwPebNCEvLZqh1YcMqKgf9DjdoqphUa8Q7i1VFaHe3cYKzqWk//aU'; +moduleBuffer += + 'NL8yrehc1tlQ9oq0pKeXFszTSJVlMCdU5beq8rtV+Z0aiTxwlZLISwuua1aNaVWZOVVmnSqzbq0x3ktuzLayNSBmUjamYF+/bGBQ'; +moduleBuffer += + '1i4seSVKa1zUwFa46OxVZbOiqxuo2A55Y6VXCZNKdGZRzd/WEGB6oXi3i6B0Os2efzOwx6AXo55Kpoa7VLflqmLKu0sVWoHqraC0'; +moduleBuffer += + 'oMIrUo1Z865jcGOE+PIu6hhwkqaGhvq1mNJ46tJaJqWDRKpnCajicY1Oghq2NlNl45Srd+UvvB+QaciUqi2JNassUZm9keSPzTfv'; +moduleBuffer += + 'UcUZNTcszEW1HKrUPKiL4AbVGPiqYyT58JCC0hN6K9QnMe8Tyv7HTCphlrvSrnnV5avEvOqq6qkN/QRrXtRvTBUcAyqnGAV5KfWH'; +moduleBuffer += + 'RV07zC5Ac0OowYSbzJvRNfaH8oVADHlQyYNZ1CgGC7JHd1HT9QI0GM4RiqQmuitEjh5zdMoctb5yREbHR3e9hJrOFjUNlQxN5tsi'; +moduleBuffer += + 'R7TLnmOWl5njdsoIoM1FjiFzVA2UO1TfCHRo1JUsjsnbHcjbG9AEjc9/2+hokIcDTZAzqAny+JU7oAlyoAlyqQlyqAnqzn9LNUHu'; +moduleBuffer += + 'gCZozGiADM/Jd77RN9UqWWqCnJom6Iux3T5u7kbiGQLy2vvlZAGDp+stnKbs/H6nD9snq5E78fVWrhcI8UIhSbW/r4ZoT1v9nufo'; +moduleBuffer += + 'TUBwyPCvtRrm9iXcgAUXKkd9NMzVAnqjS3kNi598LnD0lhVFT/d461VyHw2xPCYqbo1xiVuOsyhuIgLM85t7jZHWuvLqTQXAvEHp'; +moduleBuffer += + 'TB729Qu/fKtuTxDSJp80L4PaS4cvZZef/IZ5G9beukMNsZP3OS+tIZpnVMvTY4kn7KrEZu1tY7hE7EOSD7svp9RY8/WQr6+y+6ft'; +moduleBuffer += + 'wssGXGDTnFDKeBpWbK/NbeWCQ9rlUGUIXX491NxatdwCzW1jIDfneutW5rZBA8cit/++zO3JWm7tWm6h5nbCqefmXm+9kbmdAIfe'; +moduleBuffer += + 'VnDo/1hdcQVrvaesIRZ1DYt2BlnUrljUrrOo6kd5edzvB6pLKWls12ls12hsGxZ1ayxql+3Bx2qUicsnYK+nln24KATGmS0afcKM'; +moduleBuffer += + 'fifWO9p+4vJgmGuGavEZqE2lr4Z/uMM2t3q2e0Dbrl6wYV+lKTCkSj6JDqHjYgPSI/xsQdIhlFCRkaf54MOizlZu30j7YHQOq+/h'; +moduleBuffer += + 'gsfh1kCFZmlpz1jF1VT0F/BUQ2Mp7P8LpmiOTNHQFLyxIRqZwq+lCEemCGopgpEpwloKf2SKqJaiMTJFs5bCG5kirrXWHZmiVUvh'; +moduleBuffer += + 'jEzRrqWgD5ujSwAoGevBSNjuVMPu0s3BLx2ifdw4YJubIsAadPB2kv85ZTSOWMW73dA9uZQCZLFJQJVPmUIv0HP1lJ21mSZMg+Rp'; +moduleBuffer += + 'cwkDjA9zJ3ma3lNppPG4djOp4sMifh1HsSLe46kJGJ5NvIU6MdZkZxt9up67UpoHURdFAF28pD2dJo/TNn5UCXGkoeu7JrSLhM5w'; +moduleBuffer += + 'QpytER7T4tRXOko+CItKO1lr8rpSW1+epN6ikXzRJ3FsrTmUdhHuM9RE590+IY1sLbCJrDxq7eTQZj4dylevZTb5hnjp5ef0Awky'; +moduleBuffer += + 'm8FPXE0syTX3pQb61dcMOqa/6KvFPgrY4bjvz1R5tcH7IySXpyH6DPTD2HzYKD8M+aESCykhIDKlNGulFNxSfd5hTFGAoorgO+l2'; +moduleBuffer += + 'H5z6gcgOj+cpb5xajwpu3Se1yq38jJ38Kxf8hsvMw+Q9IMfsHmfRwT0Lq26PIDp7nHtpOJHfCxv10+ZW5Bz3EC5ILunr4VnYtlWF'; +moduleBuffer += + 'AizkNJSX+Ym/edRK/jygU2qeYjbkn535fXjx6RCBWfzBOT/NH0DsV6GTSaGPZmanAdIu3wbJ39IR+QnX3PWMewXk+YjbUxd4txdx'; +moduleBuffer += + 'WBVlP/G8KXuXw1tXrktx+eVTz2sRkrGP28Ls5E8doCf78sm/kJacsm/PGv0eZFENtaQ4xVtVNT2UmH/Kau0qy3nm+bIpu/DnGt6+'; +moduleBuffer += + '95yWQz3j9UJGkwGoLmPRjPB7qU8J8w8VEcCvutZ6OCJIuOT9cEm/h6O+tndSm5/QCMHnrZC8OciYfBhVPv3j8OLhiL5gKKnRz69C'; +moduleBuffer += + 'Sg9lfCKSKeTI9fKUTTFta2SNfCLSZXkt4kyyx3kEEbI6nI5MT8jfqF+2ZTHsJ++p7QlddaA1Sdx+8jfsstNRZsM9Dr0V5SH3etKB'; +moduleBuffer += + 'kcxAEFul9tWW9U5cPqO1lrwzOhIvhslHY/3BfYPkCGtacKySCwMxIsei1osNbajw/mddMq+vrHFfqDRbDnuhtufJiMz8ZNRn23zJ'; +moduleBuffer += + 'HpedBNAsosfTYCFjt2MWgAHGc+iIC8qAvnbEmq+3+Dzi91jb075uBmQqzk9ckOTfAnw19gK6C7jvAjmCju1M9IRJRLgD4UAgYQC7'; +moduleBuffer += + 'x4Ny0s+f0fSQXaJH3Thf+ttHrfz7td75EwisflPSPKTueHb+FL6g454SMeBUbJOz8ff2/IHn683QS4h87bEsNo2wk192YFiEierd'; +moduleBuffer += + 'ckCVQaNRwqa3SBUbNER52NQOY+qUrdsxZXUfpx/OZn7y7x3tEnqGy9Qjk1EXJwph7QeKyv4Xm5zWTzw2enI6hxebJqeNE4+9wOT0'; +moduleBuffer += + 'dy9tclouyh6YnFZMEdXkdP4lTk7nhyan1aoptclpTcv5e05Oi+987HuT0z+GyWkNHfHNy56c1pF8aHI6987HBien5Xsee6HJafWe'; +moduleBuffer += + 'x4Ymp6ckppyclt8lgYvyp5qcVvDFC05OG3fXm7HV5PTA5snpgeHJadHU7mVPThvvNJV9PnC84y4VwKUHV9KXiWnNwsQE4Uf+qHUL'; +moduleBuffer += + 'L1m9YOHFo3iR0hsoP/Wbj+EKH7WoOicRK/UI2d/nJ2sR0CjdAbl+EXcr5Hbc/Mvxa9llaBlGsWu2USoQhj/370y+EdJ8l8ZuTn7g'; +moduleBuffer += + 'MHj86d9QKgi7XW+dBm38fKOQKstGfN7UY636ebr8adRbtCoq3p6rfp4dSAh3Ejg5QRVyrXXK6WE7L5z8HH1FHsrC+Vffkwbz0T2y'; +moduleBuffer += + 'cw/n3XtOSMzit92753fdc4LWAReDu+dn71FDgQvdu+fDe06ckA/se0yE/O4uaTrEX7XEz9Noft/SiRMn6GUC6ct5mxPJom2uRs+f'; +moduleBuffer += + 'g8jiXpemeoCQwL3Xz4IsFwJKcXoOHiGO9KlD+yJOVw6tXHHmkHmtZTc4cew7nO/T23TltJMbY6w8zC8WZM7vBXBh8pVIjQruNceX'; +moduleBuffer += + 'r0TabTCzNmyTEia0lse9pzUPGDp+BebZqAc0ivMrQoA1a69zAo2w9jgXHTZsAw27wNo/5+CSLtUjyTxjmESz5ghL+8lPe5z9JPVH'; +moduleBuffer += + 'XJxzdjmr7i0ELLDpN/mRkrlkhH075IWIsLOy8Mtjd8qPB1zaHSnCTz57FKYV33YP5+HRI9Bs3skQDGPvPHKEtdNeQRO9/OKndYbB'; +moduleBuffer += + 'NErvvzzVOsvS+uynChKeZM3VsUw5bYUxa7WYU4w5U8Woj9peF0MEozPVpkjGz50upjXattLN0OEQOfFpswSaEb1WDIx1uiF9btIe'; +moduleBuffer += + 'O25M94NREAYQjB0+6FUh5xaa0O9H7rDsUSN6H7gZj7n9w3LyFwLZhyUBbLTxrrEgP/ku1HeZTHQNs04udBzboTOpdWOPUFDRQQXP'; +moduleBuffer += + 'CNPmYdj78xOArfi5c2fu3g67fGTl3i5hLlI3y4QY0J4AwzA/99nHuRcIZEcjq4I8ZntjwMWAM2sA8cxuWPflxw4Dp20XDtUQjQHl'; +moduleBuffer += + 'B5PONXA0wn3IAfyTb4IeKXfvQNL9vKgF8yPcoSHVGKPlfgCGfRMMSvY6t0FnIvuLPc6t/AXP29eZRTmguhZz+ZPy9JI/d1G5N2e0'; +moduleBuffer += + 'eZNf+/Bnf481vwYaQNk09SRN/p8keVeHrJT1avvN8nj0J9/5Hg/OxAE3LLLeLgb4IsGfSRyg88W1x8luwbXW65IHsTWTX6/HLw+/'; +moduleBuffer += + 'fgy//LSL37fIb0DawoGBxQgdvaMkuYT/Vy6VzlFEIozyZaKRPkqegsVngPU1wPq6YooEOq6XRkeOHNH+g5DghiNp40gOq7C2SzAU'; +moduleBuffer += + 'q9cthavgrbQJ6Lvc0f6HiYKXfDnIJg5lk23qfnIXYeDv6CTRosE39dStPmFXYMvdhtrfolLBcG0TPgmemqTdjD0QrArdf5HL2FH7'; +moduleBuffer += + 'syzKPbxooFkEPMlX15SLcAF9L9abqtuwogSvYJMjPBFCloqteSjZQ5LagABxklE+HeIbkLHthnEZGAU6Y/cwWAy/hP/Ikkjd7oMT'; +moduleBuffer += + 'G2jU6+BMvFcYTDZmssMFJ+LXJNQmcIXQe5zy/bJaCgfVRqpU8dbMM9dqX4ebc4SlsvBQm7cDp70WHtt7HVNjLVqidmO16qOa0UGk'; +moduleBuffer += + 'zX8YhqTktga4bX+qeunFR4Ui79CrhvEHFtmtfPlR7fHGtdb+LBF+ycZlb4BOkc2f1ZvK7xBua8CVpwO8HWzuZBMiH/VfaaMnvoCf'; +moduleBuffer += + 'cLQYJ9TKvzVB4Zm5hUfz8McPCyWRGYzuPDXdl7Jvy/yDbRwY7BvaUJAIo96sDX9Tj332RhxErrVsaTXqsalmTq+Dmn2HqpTLvJiv'; +moduleBuffer += + 'PW78OKQ+AFmSLS1omMhAyncfFlLJ2JF6sAovXnZy2WVb8m+9XnZu31gUb6cQy+f7D6cd2T4dyVqXW3zrsouXlTU/VxQvhTs3tz3S'; +moduleBuffer += + 'Y+OF6dH5L0OPjqHHlGwsD5MmncutQufl0+T1mNfqNJFIFxaiUf6a6y0XD44x+4a56y2n1dBWrBSpmeFqGXLl3+ITj5d4RdIwRxom'; +moduleBuffer += + '++Kh/uWZ+WV3L7YwRTVRhvFEc1X34GJqwxRxDi4uQLQarBb3Vh70YbKwTvTTSSBcuXrMctKJBfpKOIfmuCm1uSmV3aiNucLimH1b'; +moduleBuffer += + '2j1SwUphV2vq1IW/0cHcPsqFIrexOTCqsQZeyaaNWthSjTIGBUc7xhL1Fpkh2w38ul1X2LfCkElKw2IIdCeZUHxE2LpiCiu/vs3t'; +moduleBuffer += + 'voMIIrXd0OYnLiJcuKXheN/G+hjp+mjpxNSEWgLLaKzLKOYryY0eDmmsSy1I2z6SxkdSt1gqG0eM7MA4EQn9rrc8VWlpBCZnTzVY'; +moduleBuffer += + '9YiwFsFPAmWj1cfqbLRWhsCQ64/VmepcGcJ3GwPfLT5e/265ZORAfZzij/v2OLaSi41S+5/8dKzuS011ZupqxIEFOKLjkWgEtBLw'; +moduleBuffer += + 'furCTUJt9MbVfwOxicYuEiyNsU5+gXoMmvdmsfHmcGAPBTTlAZciJz9PfyeaymbtIhbYIgf2uucIlA7bcnVhcbWsFZ45vcIFpIFC'; +moduleBuffer += + 'bbVVNhkExmpWQ6FaINczX7GL3E1eLvw+aIxLSGO6kNDOOeswyLdQME3IRBNpPdb4NkrHEZS9jtYjLuvQKssf2TD4QUW1oiG60Xb6'; +moduleBuffer += + 'yNCmFW4W15qUVIQL1bB+IGOLGQN3wWQJnxsocgrHr4JQAGGucl1264RacgcIteia2q646lLkqvuMc5mN1TrVKLymB1KhIRyd6BWn'; +moduleBuffer += + 'DOT10wlN5OJmRdPVRoVGZvMLF5+OxJivm0p7plAXHv21D9rUk15xVbsFqacDjVwZsQsRS1UEW+vtJfbSIq/Ku+DZMcbMql93AXyN'; +moduleBuffer += + 'Gp+GaiWqFs9ZwGgMjZax+2yaoRLzzXpDXQCj5MeNtSjckgKGVhqFs9ZrqK8rzP8asoH/cWOi2saKkHzAZu82JRoiplie1Yet8kPZ'; +moduleBuffer += + 'YvHDNTJz+aFtPnT4oWvUk/q5V5arZokqKCqMDj2T4YbxofOR4eaEXv7Er65ZzE/tS2mGoIUHyT2E6Kzbmxq3xx9Xe9OsSb0yc16l'; +moduleBuffer += + 'PjUkgby0hW83F6eOlaHJw9fCtX806SA97BoltDKV8etaSYofJzPVyttEA091x6FmBSU0qB9Jpq8x3mfmRZMvHH3Bq8VN/k1hA7xq'; +moduleBuffer += + 's7ZqeVlkv0pV6VqotlprjcL6yubJhbbfmGa/6GIb/YjTcwGYWxwwTjs8X+CG8AaEY8ZDtgHM6AYp3jLc3pCjr/yBIrxdRKWNq501'; +moduleBuffer += + 'Zy/PRS7PS/kZXNJdudo2zIheg3cgHP5BtzD5l1q2rLayOzjtypbNuaHtorbEa23kjzhylFPRBo5GwgVPF6FV8mgj/0jpNtig9QDA'; +moduleBuffer += + 'PR+oxa3QXbIBA7UiTiErWe37nL3uSXRwAyobJ1lCUp1p/OTL0JbM9pN3x9yZkEInbYSF/h8MjySfjvCijZ7SNG2XdsPnikqu08wh'; +moduleBuffer += + 'MpKeBpxlsiRtluE1mjXERRgi+5OywEDaSR5FdkHym3CFaPBKH20BDqzrbtVGQNE0eHWPU2bkrLn0O9D5W7Lw85V3r1lV3U4DVhxO'; +moduleBuffer += + 'F0Uuq4zYVSMnI9KBXGf3uiuYQkAxmX+YMcfbp5vmfG7vtNQmSjVhs30peV+RB9UwflUqpfp+VagHV9W0uMw+wyzw27rLEJIvx3rj'; +moduleBuffer += + 'rXwAfCzlPr0A2acrRxFzhjFnqhjkemAv7LLUFZapWHJYfcWaJVWYNZ8twp4axAW0qvhnOlcjLIxguCNffM8acKJXo56b27AR0mFn'; +moduleBuffer += + 'k7nAWhUrVEywVffDD0JHAiBoDyfv9lRmwfEb4ijxPhQ3zeKIkJf8bJMChWQlAspArTbYTn/mpyQ4yaBs/GDJRjskT+2CyEVcu875'; +moduleBuffer += + 'dovWnn5tBgH7nTMzyFOswTNDM8g5M4NwwpBJuZxBOF1ccMx+hFHbEbVRn1TAWUDUntTBmShz8eKUTXPIyYaZQ07CUj35CS1d55AL'; +moduleBuffer += + 'tTnkDNecBtDG8/tsw/S7dV55xu7nF4qB8ATl6tjAhWWtH2HcWcwxZbUfZhyGdLNe7zP2Xucjtlb8lM0Bex+6fpG7Xz/5o5A2qMn7'; +moduleBuffer += + 'arOITFQSlpSPNmuziGvScBYJigqGZp5wS49nMz+Wfs86GXbrw/SUsNEZEAn7IJyxneQpLC2NYmtDRLFGsa/hcD/PWWTJGxjvsrEB'; +moduleBuffer += + 'QJbDWUSyePFpos1Js55Hop2Wn1pag+fiU9TySHaPYcpYLKyK1d3TTi6gfxMZ+P+7ng52Ylv7aPMFBtk5M8h290H5MK0oVdFoJHXI'; +moduleBuffer += + 'RmeKEfYzHGGejjBr6xHWetkjbJlr9NO+0zgeElnH5v4QR/q8cfNBWot6uX8IQ18OpEf7vWDe6nXzc28vz/2KjCjdgT3/CpUI87y9'; +moduleBuffer += + 'oW9CWVhBGjYMDt58ebPiMmNXh2IXGXt6KHaDAsm1odhzlln/a7HdtIQPBFChbK3acMKDmxp8FdISPQ+Ygrg3DM57fNtKAT04cH1e'; +moduleBuffer += + 'mMa8BA6v4xT7qZPl62W8bgJ1jq+bBA44Vb5ewesIrnh8HRFl4HT5ehWvO3ALpANdRk/PTIEK9RIgdfFr42+vS4sHI5tQgMvO/Lcu'; +moduleBuffer += + '/edLX7h06W/ffVw9P3/ti9++dOnSZy99+nh50SSiL136wnu+cenSF3eUkI6IfeDZxz/53qcePvmnVokOiejP/sp9939h4w9/65nq'; +moduleBuffer += + 'FkBEf+mPPvr+Z57/2k//gWUQGyXu/Z+/9Ae//NtPLG4rqB4WbbOGiF7ABgLfcYjixRVxvKpvkNrF9Xa83G6Q0uWtecS5HCRziVfZ'; +moduleBuffer += + 'UbjLzjG94giHXKU0wQKRm96IZeD+cGsdnr12Qea0vdc9D31gS6YdPOO97lk8m3vddTwjjlw37chmUh3bZW7ELe08ZLys0bVyfPTo'; +moduleBuffer += + 'Uq/SYnRpaHB0nbdGja4Na9ToumCNGl3qFjs8upbs742u742uf4yjaylQycbKFYU5yfIs0YySnP2Tecm3pcbzq0bvf3Eqt2ClAPnl'; +moduleBuffer += + 'c1Oq+4erxQauK70wRRHaHoIobEzJwSqCrj4/OYPz8+J0sfOTQmbgIqybLuSxNit5nJhRpJeNqb3OEvBfW3ucB/jkQG/dMgdF3ApS'; +moduleBuffer += + '+XucRSLEzvR7PpW2Dq59UN8PWBDcPwMZ9iIunlMLAVYEJwRpmloUhKVFQQsSb9RbWuFQ8iKVz738xIfX1A5gl5Tao3PN/TM9x7A4'; +moduleBuffer += + 'IIKFQioXyA0mRr44rkYZB4g29tyvrsHPynjCLhPKSr+WD+svFZ7YroKyB+p5uYNcS51+cgOzXhvvD30r63+PfTrbp/vv6mSffr9C'; +moduleBuffer += + 'VjqgLkq4mV90QCutuZ+7d1LDIAVPDGbn597hO/PuYQDN9YSaOpkWhYM9HK1E5lU1WJxRQRazS/45pBhlfgfbHsU/92CH5uBBAmMz'; +moduleBuffer += + 'r4Fzk/wYgfp3ubcAU4OGKbWlmfMQIedSSFbeBgQTSuNl0501km9hDoO8bfdCylBA+Dv+VMWEjPXW5g6x4gJr7DDUlcUgQPsWBtpI'; +moduleBuffer += + 'yeM/15uwtCPKtytXqMGWplMGyO07JcHtfWlZgWRGAZuk0A9ZA1VG/b93287scY9X2nkLWbPUijvXWitOHt3Yxp76g8JUX/8zYct7'; +moduleBuffer += + 'm2DeZv6cJcecLJBjYhbJTNWDQ5j6qPuIa8GfQw5SrXxG+2/meqs14OXUeKWNg0OHCqbk6JGe7pqzNp2uaNgn3fJqG1anO2C1lNwJ'; +moduleBuffer += + 'zYkNtdIsLJQUcFwO/kdz/8geZzL/wM8+buWxekadvE9+n5IItbxzkVNLdVKhPkCPTpWvbtYVlE29qeDMTN+CAejKkIexay05C0HF'; +moduleBuffer += + 'LX/C5N0Eygtz50aqqfb3Afqmzln5PR+SioynVv70g/Lj5IeKGgXACG9hHqKBhi2HWVM+bSdsIWIpQFCQuCY25rReWHOKSfMcdF8V'; +moduleBuffer += + 'TUOQPsigHcufuOdRXB9yg3ecLJj/joSl9xq5FRNLD8A3uJQK6UpfGz+XQ9Oc1KIC4GxJh/rqgBZca10noRk4xHnQ+AHuUY5GuwBp'; +moduleBuffer += + 'J79eab3q1dZYymsMA1lOi2u58gmE96KnhdS5D885Uvpaa4fMG/K4ElW61toO5EnY47QIAaiQk0mvo/VIcp/Okzn70gMHAPvbVqlK'; +moduleBuffer += + 'p682CQQGnb2x7ZSGD1E+udBxLdoRsbRtN7Z59r/WukJ+YVQV0Z6JvqFtw6+qiHbL1C6APFA3GMh2UlawpZ55zxIasZH7xuWqIdSl'; +moduleBuffer += + 'NKj0UJEe37eX1h2+cbpiXEp5BaQZtjkOFwIP2wi4ChGqbQRgFBlIha663sK9ncH11jgyvV6I30gj9EsD7l243joGkRppBwzfSBPj'; +moduleBuffer += + 'ykWDE6vwHHSMUdw5O7O1r4n+Z6ehsDg+tIEaCrOOUBh/jkspTEVoQTebRTJ3mWtufByypSW90JzIVXZHaQkE1Cu+yuOgJ91foQbC'; +moduleBuffer += + 'VFt2IR78O7Op+m1u1+11Zx3ex7YbatsbzFWa2Xgp7YIkMJtMO/W7C2flhY6KSMqPFJXLSz5vp9HVwk9zYApwlHGttNO5+XTpwTxK'; +moduleBuffer += + 'vuTqCy0Kgki7GPjqUealcw8mTzqqeoGm5WGgcpRAkNKbH7H3ClUOVAPolJ11TTkY2a1aYneXyvDs5P9p6OyZbsprya4yAdOVqVdY'; +moduleBuffer += + 'oU3pT9bSA7PLhjDexv4630k+bKVJvQoQFO4Cv5p5qEoYYBwX1Q20ug7MoruGw+mnTCpIzcvZ84S0YrgE55ii/rawBZ5DowmiaZtz'; +moduleBuffer += + 'S7adUUi8ZGdXSoVUIdxK9QW4MUn1u1ReCw2IeNQyPEAhapoUIWIy7XXfyMsP+yR7vT6S6JStEuBe8n0AKM1atDDTTp5ILjZxyJuA'; +moduleBuffer += + 'SVci5JpI/i7CYGph+MgmPZ+63vII5uGxv8LkorlMy1FKEUkQlJLpOE0qUTAJmpSiYgAF74ZtBJwbhnuJ5BogrFJHaKOLh3tgLz0y'; +moduleBuffer += + 'Zs00URE2NRNFQddApxI9GGg9OJeslxHKixkpy0pvL6s7x19C9LLnUdlztqm3DOtX2smrbTTW78tQGzezvIQDhGWTd63BC7HN5MN8'; +moduleBuffer += + 'I3ib7DJv5jT3FnOPVEAelzCMnXSqlOqbKWFoQsAZuJoPAJHVKUJmOngr5e7pZLkkCfeN19MQv9UDV/Ui5QmbPCFrXkL7y+SnmsYO'; +moduleBuffer += + 's4VVSiLeFekWJAJX2MoV+IH74MASDk17UFyYRoYlsEJLC0uWCJUWBUu0CPtm13JCeZJZzE5WmoegwuvQ+6Hexfq0VWW3ExFP1SIm'; +moduleBuffer += + '+5xeTU+HetFkWoaVPg7LM/3D/G/aK7uskEpDDC5DtxBKa6+mNQn1vtP1wQI7ZfKW6ZgRRfEuS/BRHsrez1dQxZoKBzoU+ItWSh6/'; +moduleBuffer += + 'UOrAok8WoCxUBpClj2V4VFvIjsQ1S2bLYECZRQ+f74N+HSLeAcVOgz6mANwqwrP1fJIyn7IsXusoa2Pu9TzeF7eHDiHmyhucYM1h'; +moduleBuffer += + 't4SShX0J7cDLIc1T53kZ0vuwkD5DvwGuwmEe6ip8TV/x2vTAijnCq33rSmN2wtMWdqbmYJj2k6ebKizKFJYBfyaT3zXn0FBfr1Ix'; +moduleBuffer += + 'itMoD6Lyet7qzZlFWxe8Waq2jfpZdWGBQRzi0hYmvycdmN7sHchjCgY40cKKeJezC3vL18s2EZtZmlPBeh52wDHtx9yjNMeVE15O'; +moduleBuffer += + 'xoCFmQdTvHChF5LC6dyx3hwOgeQMADBDxT2H2/2iNDz4kNA0jvN2j1DLsqTrDhznKExnQpGfoNE/zvfHyGBcrHYRJdTOL+pPX+2L'; +moduleBuffer += + 'g51m1x0mPxfoCC+MllMfUQxZbEbyLZcrpbAtUK0dGBtL0QfkKMQGY/olKP127Gx3Aa0tkDqpFd1BTXxHlVj4halfp6lvjXOILga/'; +moduleBuffer += + 'mJt3bhMit0hkNpko/JeuekOb+0DMpKqNVS4nkciRGBDOHqOETL4UKTIkORR8pgeWNm30+Llwcnv+J1Xk4lqK1XkRXtT5fU4lRHmO'; +moduleBuffer += + 'Mfc6xeBx82cZc6IWA+2qXff5GWBc56JsCd5S8LB7q9QhzL0bCDSKG5ooxytwpmSvSoPCNnqI782bNtuGGdG8embolWRrwDX0V0vi'; +moduleBuffer += + 'eWioNRJNXAMkHOzAdzly4uWU0qSrihw2c++InuSAHL/HeQY+6E/9+Zpkc05+4vDxLKJ+YI+z5NIG/QScBM7jtyQ/gXfrzKkJRXzy'; +moduleBuffer += + 'UwDQWpN6ekdkH/czgd4nAKgrHu8KrbrUZM1WO0We+ZtXO0/gnIPGsh4teTzMaoRai0mJ+ME9kopyiBVH3aOamjk0ocyf9QhZDasq'; +moduleBuffer += + 'H5nLCGpi8mzmT8rUMCNLSIE8tsd5q+QjS3RL2xRqnr2J+g6bFTGAseAA7Ll5VsV8oqeCJy09FtRRTpzkfxsAOQnrICfhCJATzPu3'; +moduleBuffer += + '9myZgI7XTNsl8nUF8g4Xkilp3NcjxLd6PKmHhpjAeU7OhMUj8XgSCIG+IINbjpASD88krPBJn3DvPs6VN+EBtw4fS7mHi+58OcH0'; +moduleBuffer += + 'bNNE2UDKbg5N9IYAc6SJnIYBGsS5Vga/2bZEaSP5w1Bv8SUDTxbYG55ikdCp1ypBdFpXS9txeGnV2tvCeJcHN+vY49jJ/Q2kaJkU'; +moduleBuffer += + 'Wh/OcZDpEHApQJv20/iOgEv7Cjib1+iMOLYTBgXqqNLi9cAU8IwZMBuvALORmjm6azB0oKafdOhouTGtOCTL7k7AZnqvtHl675r5'; +moduleBuffer += + 'ADh4OM4hQ1smAFx/kVvw+I3mcAG3zEjyDkKeI/nUkd64JKchb8x9TPK5II1B265ULkaTJ7VanVRSGtp26ItS0baDXSycEyZJ21hp'; +moduleBuffer += + '2yho2wBt42JjQdpyI9EoaQvzCZNCm9bZiU1q0bRO0TTnAMtm4w4ybXUiBoW6JYW0OePJh5vanMmiOdNaj25up5OmOd2h5nTRDqgZ'; +moduleBuffer += + 'puvN8YrmeLXmeNocT/eARXO8qjm4H0civwmttHQtr5dPSms3yBIsdeprmV2g2cG7uoPXFOW+jklNhuiGxOxfmXFjy4wbW2fc0Izl'; +moduleBuffer += + 'aMDMRrijYYk2oEeb6G2Ej8qixCNcdmB0/AcRujTpdbT3W9mYEiMWqncM1WNQvVFRPVaJSkzb8ZjMsYnqjReleqPGRFotKaXLHRpM'; +moduleBuffer += + 'CrADQYWST3ppY5B8A/3SeNF+adT7pSQSpGkuDa6lTh9za/EEreFByk4+WX/hvjhVk/c5Q/TsFvSMXpye3e8IPWsV4n0JdvJxt6hN'; +moduleBuffer += + 'x9SGpud8U4/PnV5nBJMqeQeiwNwdtcdAZb/TXeOxCyBMGeqChukCnTdqU632SauArG0kH3YVhaCrFCwZuyMdMTA7eiNmxzFTLz2M'; +moduleBuffer += + 'Fx0RoyO8goLsCM5dcdkRnLe8Wkdw4lecdR7PwGqSU7eiuWkQp1E2aFy/5CrEKSH5apCOFTPjWG1mHM+dcmYcR1PGqqaM68w4bmbG'; +moduleBuffer += + 'MW1Kp2hKB00pKKJN6RB5rWxKp0YzSE/t5L0G8MLrcz4rDXzHTDd7mkHVzZ52s2fI2THd3N2C4bqbGa67meG6gwwX1xnOqzNcPIrh'; +moduleBuffer += + 'PLNO1BjOVUQ+4hDWEfkCiCJ0m0BEvn0Fht5ruCfgBkGo8oGwlk2g2WwMZOMU2WxcbjahZlPH4AuAwafZnPjHuGmJLnPT8vv/dW1a'; +moduleBuffer += + 'PrTlpiX6h9y0XPhOb1oufHc2LcrjRnSp8kH4boU6EMIifyOOi0a98Qz84BZvgi3f+Fu+aWz5xtvyjTvqjWuO5Fu8sbd6A7FwMasx'; +moduleBuffer += + 'Rauidf1bnnIqWodK6yKPVmHoCQbiic+lHBHOGdaAGHE/hCRTBL0QhpuCpto2J9A9lNPaKsCUCZAcPAVtr31oRIq2SRHq4bgU+aoe'; +moduleBuffer += + 'C1eFlJXxUh5Gb8tcbL3actZcDNFdbbUhf6rEXlTBBQyETLfx+Mz05gSsuXpGhLPl997A9275vVt+DyPn4e9zj6IgjU2qTBPN1DZ8'; +moduleBuffer += + '0UY/+TVZjXmFC2c4lCVFy1jZm/5qa3+ZhE5NMCNzO0WCeSKRfTbc1B+1Z7cWajszeCZKqfpEIUVXGRN6I8KU5MobeOxXE8+EWtJG'; +moduleBuffer += + 'yddlzE2oPW1UKkEVDQCyF6VrITOZqIuA7oNMZ+kvIHtZNiKg+xH1Q3uciyoCugAR0EkjArrgquiHopflQgT0FCFGCvnPWQnNGPlY'; +moduleBuffer += + 'U+UxUOasy0zyYFYspG3bSIKeco1Au6khSarCJyNwgt+j008ebBqTgRBNgvVUk1bJRlVrl4YeLlWTTwASF6bjDdVT2sof9p16Kd9N'; +moduleBuffer += + '9JxcvfdRK/moXrind28CtsmmWXcg38P2ZM2kcYgegy5FOk8FnFavXd7mSCDkxg200gkOcar3+1kEWIAWrgYUNmBItfqtGiJNzdnX'; +moduleBuffer += + 'AWwGSjTe3Ky2YtgkbMRNOJEY8XTSTx6msg04wl9vDkSGqqvXaw6AdmCrMF9lqo18vVZIXVCIPnjA2euccWsSwlN/sUlC+IpB9jiv'; +moduleBuffer += + 'v8+AMQyTrPNisc1yQkf4RJjld6NhYeG+F5QVqiySjE6Z35eiSti3XaLud420zwyNJrR+9xk+WjZc25vkx9LJcw/2POXgngOLmMZC'; +moduleBuffer += + 'FtLkRIambH7eAYS6XoMqI6nM+vNrVgEmEwIb6Sf0cYdOkxuYskO4su1xlgDQQAW87PwuWa/nsphCFNfIV/5K8vizQCJm+zCuBDZd'; +moduleBuffer += + 'CGy6Vbz4dIjALP5sp33T2l+tGXAd+QIXmiAyuDP5hq+aK+R/mCb+izKqqix24c81aiJ1/DD1rppTauNGJlldrrcWHc2TYHC7+/lZ'; +moduleBuffer += + 'NcAK82eEyN8GKMh9XoWIJcF1x9wQH17tnnFkMmTLn/JgRHEWGCuyds3vWcqunN93T3plisuosx0nJFhCQl1ZQUJdOQAJtX3eKSGh'; +moduleBuffer += + 'ts93Skio7fM7DCTUjgIS6izK8R7KtgN7ChdTZygK2FPbq4K2VwVtHyhorlbQXK2gubKgK4uC6PgbYuapsKfQx0+hj5/Fq6TEnlov'; +moduleBuffer += + 'uhVGPuzWhG7+boU9hUvCeu4Q9tSGdVj+v5EcAuSoBAUK1ZP8nOmvMH8W+7RkPVImeNZT9Kn1SNlNWAw7WtNF5xr1PDaKPpdZcJ0b'; +moduleBuffer += + 'L6nJWZj0rhnsvWfQDBnYT3tV00DgXdKtgKdTJpCB72lpmjUVUQcWkvco+pSkvrehxjXLDdiOhgZ96l6MHmih+CkBqELIpl0ogULM'; +moduleBuffer += + 'uCxWDkWYot2jqvMH98xVXTlXdeXcUFeGS1VXzta6cpfpyrkaz7jamR5QudaeXyshq8juMr53G37fnS//ZUH5Dd7BVvi0YpD0OjjD'; +moduleBuffer += + '7dbdypupMVh0FrK2zBttdcX7uSBty3jG3bjAoGlIPNzlJL4u4ie6bxtDXf5sT77lVro3P/mjKLVhpNiGgTqk/SgYR7sVpwStQvm7'; +moduleBuffer += + 'pNqNW+QcCcM9oWDsHXCOFy+ojvOprMRrrXEYA5xCqL9NlXEx7ZwSrp25l3vJZ6RzdBtoq1KGS0eoIVg0QIWf/FXApQUnplot4rIW'; +moduleBuffer += + 'tJWjI9PnAwWBSuPkU/gJawSa91LjQenmEq7UYwYEp7AJWgFMdeoWK6Wh5hMkv0rIi4OEwIJ9EcqSzN0Cbsou0ygMSqLpCrVvcs7X'; +moduleBuffer += + 'T/CUPzh28MPkj+FLDX9slwlw7WHyi4hTQAN4rD0daQb0qVLTV63w5TcCBZiqZ4UrdFBi/rFmv9jQUlzo5qVMRSF56XUrmkU+T/jh'; +moduleBuffer += + 'wJuCAq55SykNTGAwIyxiHyKd/hwqdeZ9j0rUhvyc9/Y6F2ytTL4u0cnPhFZsYBQbBW/KlHThF+Tdg742XU0aJPbhk4ylJc+8ffde'; +moduleBuffer += + 'd8NJtz9orIUl5u09maDT7W/vbc/tXuTC1PFHsH5GAD+J0rl07i6ZIOxj6fa7etvZLrJ7C7Q/oIzeilXq7CTvLNCepD8i7R0IDcCj'; +moduleBuffer += + 'aYvoSTwPJH9NiKfdvSgeTCbh1qEiWSv5+SCmv2pmJ/8R+6dlp7xrCBqsPDiqwGYNc6FqMW+oF7KTrHEZl6zvc+ifje8ltOxQnDyX'; +moduleBuffer += + 'OeVY4s0bMmRRHi4GdfV5xjV5j2FY5v6d2RQu3U6eC4zXqF3eamSnU8l7Ca6ATB2dDYpCWRxnhoGYDApD3J2JeSKLeJe1zMnJO13T'; +moduleBuffer += + 'BLuQ2rEWGpn8Je8dAW+zLbzPQHMV1orLihVE4ZTggPUaai9naARYOLsk/n7tIyX+vor4Mn1kDqjvMMrkKnORsJZMz8lfUVD/gKue'; +moduleBuffer += + 'iiuuzgAk3gO2gn+d4l2U6pR6v60ep5mbPE/Mfu3fCNc2ChNmc1LKMdK66Mn7OQTt5GRgnGAdfOmkBkdNNpXmk/JqKCbOZZrIO8rQ'; +moduleBuffer += + 'rBCIUn5qMoUJ/un3y/i4n9e+5mfM7yJTbWy3zDrChiIyGwogfEhBMCoh8Uny+7mRXdJ8MBzsgmzsFJRvYmJlE/JeTDaIMbUBqOhg'; +moduleBuffer += + 'WWG7YFqaKpZtTS646gt9r6OGwCvUTMCeQuucfMVTIxY/+fnGcNItEv51UPIO8k9qo0lZq6AbDmyOolkWYJ/mTKWzIdZO27iKgEXO'; +moduleBuffer += + 'hlr/ggX1GZonQSIhwKDV2oLM0CffX8xYMidZxZyE2cOVfB0ZQwfR3TccrujUNV0wlo6VVBpLu8QI1FA33fJdvCkTNlQmx/1LD+an'; +moduleBuffer += + 'RvLEVDnux8xtaRBITpV84sGIafu8dw/nTKv8pz4Cp9zk1yMrzs9K3vnO/CKKMLfHc/LRHYKFW93z0z//qKV3aDUUqjTMbV60kd/7'; +moduleBuffer += + 'gUeRoGV+sWL5A5ju/4ONu2IDHPC4TcJxr03rK72NrcADkX0PDLGwIzpvF5OBBJ6wdVch9UjVTaCty15tvmyY+bKNwxs9dSaxaf49'; +moduleBuffer += + 'Lw/6uXtn8rOBGos1tFtb+RKWrpO+ui/ZevMPHB9jsHwa32iMm8FG6Po5vR4mNddVy9BouQ0tZW7+kn33g8l/DLghhd2W2eGTxDFh'; +moduleBuffer += + 'ZE6+r2SiOcll7taDFNqP+JqcGsGiaFKtTmhGsb2yVUoN9hjuzfgMjEB4uGC7UXLyUAQqyMmkzV0JPGdg9SN7bBs7jPzCZ9YozGjr'; +moduleBuffer += + 'SaWNk0qkkjFIPRryWJBkS5/VZIpRRle1topI2hhxLco8bJV5yPCDzE2mB0zYsoD0sxgyjwSjKG1pCLWUfQY9XhT3TN142GDOwyiR'; +moduleBuffer += + 'AFttXsXL3S8RaVVw1r7akROLu2Hn4z3eOn9zBnk+6vOczSaABAFQuLXpuLADLvSH2q62P3Vw5HYWYAuTn/yM7vLbkMAXZQ2UtC+f'; +moduleBuffer += + '7NEUS7Y6gJIm13GaYLHY4uJjVNEtPoTx1y6Udk0vwm6/tk3X7UnmtG3ML7IJ9+EVxi069gXcneuKm4e4JvX/epBIxQMb/Nw/KvWH'; +moduleBuffer += + 'bLujhVGDQvEsNX2mPkb+3VFZvBfTM/BkSV84ly2h+X9B4DPe3USnm2WvMG2CDXYW6OCRSvh4ZjML9Ll8+BNrhIf36ffQo1ESHFxg'; +moduleBuffer += + 'wKoH3IXemA5WR44VZquvgrl0Iv/BvsKZSioPGwfIzFr0mXoEpx790KOx0Q8s4Mqbm2laZMFJytNDiZc//a5HjbOM7EcTWhvlZ5fM'; +moduleBuffer += + 'blRhvboq3O3SCBtOq2mygI+7MHvv82MOJmyRJqUqDkZCi2gLchh0cDaTP9vz80sq/SNOYgv1PJ7iwh33KJaHsH80R1X/5c1zh9vM'; +moduleBuffer += + 'C6jxvI2sBSO1SKXBEeS+MNLCHUXCV5DnqqzW0RFNJayVn1l6tIZHd6EIgba7e+N4XNPrkqnUCmxnz60sxlJhtEm1GNuwKhHWWBrn'; +moduleBuffer += + 'pz5VSa98iK3eqo83Y14zJ8vS7k3GLe3hpuW5Lge2KVx8IeFZwMc7/d4VEi/Td28b58rkEDXn3XQ8+QCs0SCn5hYLu+kVCPwYD/iV'; +moduleBuffer += + 'b0e4HcOqCZUiqJRkZMoMsY7REMG4+kBWFyNt08PCd0WWtMSu+geQJS1jlpwqpEiREpQb0EhvqZKpayp/4DGVIkEnAIkxmAk+oy0d'; +moduleBuffer += + 'Afi0hXHTKuXFDbqzVlKk6VxYDpOZbIkffkxnuIj7hykjQWJINuIIawcB+7aQIF1R+/4J8z08TiE9ilGDdalxKT26z1aGuRdknN3j'; +moduleBuffer += + 'LNHo8IR2JHt6j7NsaymaLUGOK8mRpH5E1ig812xIjiLjdfyInZraqZdxRH03Noc8pLSUzx62dcL8bomNljg3GYKE+dOPV2Ij8LMQ'; +moduleBuffer += + 'brdh6N35E2tKrTjfeLwYa5mDMXaT3il9ILc4vRgism2lMXrq9rWn81ferGumkya3HFFoBoYc+BjrV5wt32a4od9rmQol8HN2ey1m'; +moduleBuffer += + 'c/zG4lPbyB/kV42BbAhIIGaiygHbGbNdicw+LTlImykghUrSHJdT5MHhOw8T0TadkDx0pqY8SmJmcgcIpxOQTnh6j4XsRj4d4WbG'; +moduleBuffer += + '1KMrN/QmlP54+YfeLTPb16VfD2sS41OMnbuskBa3BIlUjtPgyXc/WkJvchkIdBkIymUg0GWAOtildxfLAKianxoqKdBJX5rAJRk9'; +moduleBuffer += + 'cwFzlY9NRx4m73UIBrRbf7hCwXQCv32YaGAG8/OHndoM5hsEit52WPm/WfZ/Pua05xz41G7Y0Ev+Q0jFLwBAz/0HmMlwD0E6Vsxk'; +moduleBuffer += + 'vrS/uIvBV38NGyZLi3a+8nGzTcDy6uCRXMZ1DG5tMvNpGg/5J24aSPLVj+sQ83khw5iZ0HxzIQPCEiguZDATmg+0qVoeax9fKy9k'; +moduleBuffer += + 'wKRGW+gNOXGWk9oJVy2jLzpV6y6w/ryQwVcG4IUMLE2zHhKJ++ZCBr+4kMFPywsZfNVCl3cy+CWCgq8wZj5+8E6G7+LcxlscXEOX'; +moduleBuffer += + 'ML/vU9XcRlanSJxNFXLuztdWC9qn/RfcTXgVSdkXbk1GNp7vpvM9y12T9ndxXO0nv8cWn3GUYE84mbuAPkQn3TKnvPOIgymS7x/m'; +moduleBuffer += + 'T9fgKTjYQdoEYMCsmDWgZls4spZbPyYDPvUOm2ml5DOyaM9AO3fyyRzrm6TkBIFZcU43zXwvW8X8qU+YrTJSo+euK3T/nXQcuyWa'; +moduleBuffer += + 'MsHiiN6UHVXId4xLmA8kMT2yYS574hPVKWeX6jLbwMSVKWkSmpDd+SQsw1QxB4zr/cZh3wjp91NIj/so4LfkGP/9/OI9mAhpYUnh'; +moduleBuffer += + 'vV6BQrV2qMYbjro9J6YkdS+D2ZoVq9XHBkHujDL4HCWZVu7JMC0V88+4e1WvKy17AHrdZ6kUXnFUKfwRRF23x3lKFcHrUAqfcgoF'; +moduleBuffer += + 'MY5x665qe6kUlmVGvTZKbXBs7AnO+aWmt1D04tUi6Bj/rm+Hx9UTWeonE/yxw5KdtQDcf3BMKEeYnDcm4NqMXoANriSWYm7Ioral'; +moduleBuffer += + 'P3E5wjH4eVk8gBrMERuvhJrXyJL32eM/qpNZLeDUA24Z4FEWEKZct6QMZtNzmaNbS6WMx7Uu85hY6C5HYOhBDnJc4I6OfmaZb3A3'; +moduleBuffer += + 'FGC14RMlcbbmg0injHRMpN4WQtOFhm4lnJ4FxBDgMXPSkg3WnIwO0AROVOqvhoHoYSEkBwSHITsxkg7eFIP7SII7U1xFdCR/x0+e'; +moduleBuffer += + 'CA+nLo0QvFHv+Cbc8k1r5BseGRNeF3ojicI70HxDG4ht7swvveNigCs1+Ozn71j0bs+TO1OAtpN0sXOcIqmLUKIdFQrqTTZamF0V'; +moduleBuffer += + 'Rs0LKIotl6Vma5sSqX7GYSoL7bFMGqtGBbsfZ7ZWbTuuxtlUs25M0WkOJBMbVHfoj+3JaUmtNI4d5mVqvPVWiixZy64znV1nOrvO'; +moduleBuffer += + 'dB7hdaD/VapxAbE4STJXu5bSTHy13ZUX/1vf7hzXeUWO/DKZthyqHSazKM94/M0gG8o6Y47FYaOtMeMllQm1K5wSwJ6gUGxC341r'; +moduleBuffer += + 'wxIkU6MYCWZN3omTX7IWqJT7oH1IeirD5Sj509YNR4zJPmYFtARGEX3ILJqoNOSBTWlJJmX+GC3uJQuCCsKP2cp/RAISeZXQUj5w'; +moduleBuffer += + 'ANoT5/8L7wWErMQ9MpAWSpOjEoWLVTTpHYdobtnIW0dN0kY+fjRfXJRdyOBX+plwXICh5mEKkM5OflL1mD6sYxc5VuVnF3862lzG'; +moduleBuffer += + 'wSAId+Hd3IZo3Ai5vZs57ryiT9s2hDYSf2PbwzTc0GQNTYZTokn5unZDbXi6fUkpRyFkAqMIICVRTJc1xhpW265VTO+DgP8FOlTW'; +moduleBuffer += + 'TGj9ItYz89igvtZcMuHHjoypnJDUtkym23KMxMWEP4XtEFj0Ds3FWq+ed9mpgU8EC64Et925B9sgesxLoVMFLVq673es5PMR5VQN'; +moduleBuffer += + 'GWWyPEs+mKuGSOfJ3sIqSeLQWh3bDdqVOQW38p5F52Zz/rBKIv6ofsFDSQpciaIGTn6yrEHEEYUNywLpCsLgFJaRilA1+rqituKf'; +moduleBuffer += + 'Cuzrj/PW715P7cI81eJlaizWUNnQ9xUmZhAQ9XbqSh2o8OkVCg4TqkTqv1HEGIqSZnv/rcLI8CL77b1d6o/L6+fT3tV0y9Xr43f2'; +moduleBuffer += + '/juEdur177t634/QLjVbuKZ3DUKQINGI4VqEdvcShK7r/ROEruuNIbSv90qE9vXGEdrf243Q/t4EQgd6P0D/4N4kQq/t/SBCr+1N'; +moduleBuffer += + 'IXRT74doodabRuh1vevUE3gGoVt7r6JDcI9ytdt6exC6rXcFQm/s7UXojb1tvBa9tw+hN8lZinel/1OE3iwHLAm9pXc9Qm/pXYnQ'; +moduleBuffer += + 'W3uvRuitvR0I3d7bj9DtvasQuqP3Grom91JcEpHSwmIhI7DR0YyK0aNvk5n7bXuco9LL+O81b0vdwxK+Q8JXyb/9Jny7hHfIv1eb'; +moduleBuffer += + '8FslfKX8u96E3yLh7fLvn5rwmyU8J//2mfCbJLxN/u014TdK+Ar5t8eEb5PwrPx7lQnfKuEZ+XedCb9OwtPy74dM+CYJT8m/HzTh'; +moduleBuffer += + '16bY0k2mP2DCmC4m5N9uE96f4maf8fSVJrwvtah/+icmfF2K83CSXmvCu1OLGqlrTPiaFIb1nfT7TXhXSmF3+v+z9/5RelXl2fD5'; +moduleBuffer += + 'fc7znOeZOYEJGUiU8xzTdqhkGbusSYFqziwIpMgLfV8+P1frH75rudbrN8NrSYgs19skMxLAVFFHRQkKNiKWCIkGxJrKDyc/sLFS'; +moduleBuffer += + 'O7YRA0QYbaqhoo4VNVok331d9z4/nplnMFapfVE085y9z9777LPP3ve+9973fV2/a8JLU4uAimeYsDQ4ERSHTHhJSiPQ9HdMeDDl'; +moduleBuffer += + 'Flj62yY8kNKwKv0tE05SeHaG6VITxnETWLpfZMLgK8A5YmbCpHSX/3VM2Ir/IrLtMQW9cJZadc/aZ/8f5nsLHG0n247r+UEYNZpx'; +moduleBuffer += + 'q93Xnyw46WRuLFt4fQca8BLQY1y1hxsSzjBZDpRfIjnUaJ08N+3UfGlPmpv2yfnSLpib9urN86RN5qbdNl/a/rlp750vbd/ctE/P'; +moduleBuffer += + 'l7Y9N+3Wq+dJ25qbdtd8aeO5aQ/Ml7Y5N+2R+dI25qYdv2aetNHctLfOlzbsUd/50gaY+WTpRaefqvuUyW1gZDj5gxZGjsPDDow5'; +moduleBuffer += + 'XLXoGF8V5Z9YUX9/AkV5c9/g6Hxv4PZoxWvnSev06KXzpbV79NJ50iIl4GXi/YETbCqEAe17yfybOdhTcao9FafaU3G69lSc2p6K'; +moduleBuffer += + 'U9tTcco9FUf3VDIXZ38sPnouivdWuKkWnzwXxftAIWLxg89F8QGgmFh8+lwUH8L7hcUPPRfFO+ThyY9du89KPiYK2vCXb38LADfG'; +moduleBuffer += + 'P2dtSJ1Ldw7bG7FHn4Yb5CcEOq1TgfFuRIoNkmT4lW9lqgCpAk1VgfPOSeYjma/JKrDeOck8JPM0WQXeOyeZi2SuJivxfDXVbYBT'; +moduleBuffer += + 'JPQnodkj9Rmwz7KW0+hVRtH7A8cZW7RJR5ES9zi/L4qBLX824HIIl0O8XIrLpbxMcZnycgkul/ByEJeDvBzA5QAvE1wmvGzhssXL'; +moduleBuffer += + 'CJcRLz1cUqm21IOD8EPOGgD6+sPplg1ZwL8h/0b82+DfJv/G/Nvi3zb/9vFvv/wdFo2HEDTSNUTZqS7b1WWruoyry2Z12aguo+oy'; +moduleBuffer += + 'rC6D6tKvLr2der0xS6QmG2EQsjFbUF2eVF4W6U6uYp7RmIE5aRbOiTllTsyiOTGDc2JOnRNz2pyYxVVMtOW2fPBNol/334ZtkbEr'; +moduleBuffer += + '5FMtvm3tOmiRMBHpk2gnPY0xQ4xpM+ZUxixlTIsxg4xJGRMzZhFjlihJFWNOYcwgYxqMWciYAcZEjBlgTMKYkDEnM6alVFmMOYkx'; +moduleBuffer += + 'Sn/lM2YBYzzGeIhIGMEtluStMCbjuHgqdPxN7pgheFHYpQOWodAOcXpeXB4qL3kYSMS752QaAvhW+FxNQsCUC5+rKQjTZ/hcTUCY'; +moduleBuffer += + 'PMPnavrB1Bk+V5MPMQxR+PLnpPBIC1/5nBQOc57JAoAN+HOvIRQmri7BF+HVBWg+Xq0iEiauVqJivFrOQYMTVgc/EQiiAZAGoF53'; +moduleBuffer += + 'ENvhZ7gpN75Dwo++BqMaEFwylHH4LuN3hW7FY2SIgog+rIRySjins/oFik2ZwTZsyxZGEOYwuROHLJMKLaDURvHOxFkw5m4yVu+G'; +moduleBuffer += + 'x44qNvZ2fN334WEMjbFAXw77n+vM7xb+chN+hN6XBOyiBdbywjOdpzkwUIKtFqjbDKIi0R2VInCQYO4eiZQ98kGrJ7tyxgyOkGIq'; +moduleBuffer += + 'C5IbPN3ZHTyPbkY8MI8IbDVJbLMguV/5p+EBkqfJT+UF8qV4GrZ48jN5tVCuXsarU3STi/tSHnwoz3AMuKY88pQS/3nhigL5mYaM'; +moduleBuffer += + 'Duwl+tS1xAEIVAJDQV2WDKlTrrG/g0FUST9FzsPAvC4WJdg5kwfR+mB5IXGTEdjl4hiF3tTyxkrOTS8aHq+28WOpbZSd7I1iBbtu'; +moduleBuffer += + '5/56EKMVVEZNvEOjorZq4k1q4JZNdb4tqbECKQGnunpu2pKGpJcFvQijGmokGqlFgFTHuObC31+pqwES0FJURgNcUvn8EhYgUtg7'; +moduleBuffer += + '+swq1GdrJPlUMyYMsSLf7Xew4a77HAhPOplXwExgf9vF6apOlI7Ojh6nRNg8QJdKriNT7dO2msIes4vsq9vuaZp/3MHGF/v56zX/'; +moduleBuffer += + '62hICEeSbzg4fD1mw2KEQIxYhtnr8j2WgXT/rqUOESYCEPVjMLNYZp1LvIk0VjCC/bxfnUrKc7e4bTt/FwiETkp2cWlpAXxjnId1'; +moduleBuffer += + 'ahKrtEMuGXivc3nQxnEzwXFjzqlZc9EdyBsGNOjStJT4fckKd5etZxy3vc08jCXJ60hj1x5aOISzVXbZZni7sEbKHDO4HTPYacBZ'; +moduleBuffer += + 'DvJjBtt8unBWNmNb7UJ5+s8emnxG6fWGS7DO4ioqroYLCNCA40XPdlcqs6AZN7YC5ydVGCbXTsVAZRvasOVpwR1X5TVj7hIezXWa'; +moduleBuffer += + 'akYPILhthpTKVs5ZCLqI2GzYcKbxdcg+TkP5KG0rEXVkxguGFmhQqhHWUFPNqBpjGF5ZwgFkYlp0n804DhTDiZKtQNN1iJZL1OyT'; +moduleBuffer += + 'Kg5cRklJJ5d0qsUgp1BKyoCM8P4yMAigXQ04GJgwauB2iPqejTfTBWUTOthVdaqKn1y2vsMTnxIAF8fnXl3CeLMkjDdLwni1d0dn'; +moduleBuffer += + 'ID/vUgPi2gWpToDrtAoTaL8snGDsyQqDcEwgVz/5QEAGDzrOYJA40rIlruVWV0kpYH0QmlgyMYBYt0gFkMtjAPI2M1fWzB/cS47d'; +moduleBuffer += + 't4Dz0Cdri3R2eVRyVZOr8uIbOCUBWUFzy9G3xc0GaIeFGlXInKjJdSU7JepxdRkqUDdRC4sm8smUg43wV3D/3ePhm3W+GbRS4y0u'; +moduleBuffer += + 'EDotQnsWCL4WoT+dMgRoUNuIX0KkHLO1lT5JofG0rS7qxk/dTqZckpl1yYYUuLWUz666k8TH+wt1AXwUP1Nd2GXUhB3md3uXunA3'; +moduleBuffer += + 'Gn3q2dSF7SB+rasLzZ9LXXj/r5268P6fT12IS0kSz1IX4lnqQvxfVF04OEtdmJqrLhzqqS6oUVKhLlznqLqwxZmrLkw4ACxmP1+v'; +moduleBuffer += + '+S/ncJ4p1YUtDtWFyR7qwvG56sK7AP0q+sKlqi80VV84OFdf2N5bX9g6j76wo6YvgCK5JfNat75wYD59YbKnvjBZ0xe2ztEXJm0z'; +moduleBuffer += + 'vqG0UV/YbvSFHV36Akf5Fkfn3Lq+sH0efcEr9QWv1Be8Ul/wfiX6gj9HX4hVX4ifW30hnqMv+HP1BX+uvuD/gvqCP0df2HzC+oI/'; +moduleBuffer += + 'S18oOL2oL/iz9AV/lr7g1969ri94s/QFb5a+4M3SF7y5+oKXfDDQfm00A+AH+aW+sJt04aI31PSFltEquvSFLbLs3m6mLllwySTS'; +moduleBuffer += + 'JAN4U/u5PAWqgl8qCKH2AaoKrfqUv52qwhaHk7qIILhAwe1QFQfzIhYMNd2C2ZoRSxBxa6laWDrkRWv4lI9BWqoLHLOiRBgFQPFR'; +moduleBuffer += + '3HyfbSDC51UAtvZSANRmcdqz+8k93jaMrmxeOgiwo+huRKvAynYoFAPddsjaVbQSwNv87auix13dysCvV0UDogm7GfjtrxUS0yhX'; +moduleBuffer += + 'vuxHYXcFvnGf67jivo8PJKXCca+MJljkdyLKKCf5dkQjXh8XEbRbXLg4xNcYN21qTF/a1seMB8oVUNUuQMOWD3Cl2/SbGsFmrKtG'; +moduleBuffer += + 'HOBxLa9FejyZQVkjXytC6jlcAOq6X5/fSBsaAz9sxiQ4AAUzQ/J5DJSpeIQENHc6WkltoOJRoTykT/OFMpy/HZHlmg8J5LXb+vxA'; +moduleBuffer += + 'ujNjzGtLQQ2d1KoaN0ZKUHq8YhPis3z1sLiE5KryEALMBC1+dnS9bfBi1GsW1UYPe9R3WqpibrMLKi1cw/+r6RTWDQ7sG7bZma8G'; +moduleBuffer += + 'cmdcDNPplMR+MP+DzRlviFRuq40opDII0pECBq0BLDJpMtVa3W7QALGj1nvYgYOipxAhGYYFLTPTcGdnAdhE0wZEPUaLmsbmQxe3'; +moduleBuffer += + 'YbXRn3q/71gbUlf+pgs2bcgSGXwpjkJIhenVDBjN48Jc1OgQZUeSjgjtfyI6AczFMhZLyCfUOe1HWW3pIHHKgWyn0ZrFmIE6Ng3A'; +moduleBuffer += + 'uTEorxIWHih4B75BxyZIDeJHeX7GjGo1Lg/Jd29/wBhyd4dMs6JR6e7DtrRUe+/0mZdvwsB0PRkX07AjszLV/77VUlO+MSBKODW6'; +moduleBuffer += + 'qjvT0NOXV2+wSRtFk4K4JYYBbSdQ80u8vV1r1OBZGtWYIwf6wAYatdGjUSEuUKwu6+qNKgKSssQ1jerTghJir7tBTOh7c0PdKckI'; +moduleBuffer += + 'BxAq8JBssxlC597TsBdBfI4Xm62kQUnuwHRCs/+XZf2jqoouXwtzK6pXZ6b2WthaMTDEwKUaWMrAJRpIGXiVBpYwcIEGBhk4VwMD'; +moduleBuffer += + 'DBjlOGHgHA20GFgpdQFzFia/laBWbCd/mpJhFqSjJqTwNHG++4ui2R4G6Ni0V4C17jZYQ3byBV81kQbmY8nnAelBY0k7VsSGuaux'; +moduleBuffer += + 'ooyBY1EEFKKDInrc7o52NBp4FxEKZXSUxxo9ZVJHJvUpGn3MpA5M6jM1ehtn8SJ1U6qg8Qcc0p6JHER8X5F8ZlZyU8OtrhYemsIX'; +moduleBuffer += + 'afSEp68ZmNcMNPqoqzVExX3qI43irdBEQ6XEbph8dnLYpZIhF0Ae+TB0/dgkxfH2EGSyp/w27Ei77KzP9KQd+Ko7HP3GYNdaS28G'; +moduleBuffer += + 'Bm/V4K0muE2D20zwJg3eZIJbNbjVBK/X4PUmOKHBCRO8ToPXmeAWDW7hvqrRRKAtfdUGaZ++oJ0cl8X1FXBeGbuiPMXH3qTTSXRf'; +moduleBuffer += + 'UgEy7nY6C/C721YG1t1O5yT83mt3uJy71+mcrGsUFTyTjizouU6BBOIm80LuJIu00R1lWdzL74N2h5w7DzodcsVO2Z1YV5WdQa42'; +moduleBuffer += + '7U6TDWyrCSYrd8jOTtWl6BVr01OvoLsV/UbSwSvkna+gz5VLM8JFJuIpR1WM9BQTMePo5JsuNBFPOjrlpwMm4qijM3d6sok44qi+'; +moduleBuffer += + 'kJ5kIqYdbq546QITcdhRHSdNTMQhNP5hqn+HiqZvF8C4cHW6GryJ/aX1REtXpehfl0ID5BbQw6ETKSXpdEEqiEXfEviFYaEdwGko'; +moduleBuffer += + 'xeYZDsFhsptFBSuRQgDYhAAAKsr56mc+lIV6x+m6A2GXNeULNvWuW7+bY36Wv8n2gHOSvR7gL0qahLWALKsvzFqLlbQyUtjMCHHx'; +moduleBuffer += + 'YpnFUAVpfrnm94XyLmkxn8kDVtNfKMKk1XeJR0vKEvgAXhR4sAHpAC0VDh0hXgAQcpSso6vU0etcRXK9oEPPwVeRuywt179pQ55j'; +moduleBuffer += + 'cPWwbdch1KZZaIQ46SuB9kKtjEMUD0WZKMAzUlv9SAuMs3x6u/qR2upHatOP9EbjRwrTtxN7m603lm/zKnRzbGeuWaxebediRyN1'; +moduleBuffer += + 'ZKIM9f1s89LDZI2CsoR3AdoIJShWT5m3cUPWr5t4fcNj12R9V6f9mxHYfPXwK9/a8bj4JQZQpA4edJkJ0QAhVBVfnTLRND5cMex8'; +moduleBuffer += + 'O6p4mFUkgMBA2k4Vc3T3jQVGSfKYC+cOmDKUcYShi7QoWf5XpdB/sUUN20uTTcibaHNJx10jHdAi0pSlK3+LKBcywSsbbpQfvXFP'; +moduleBuffer += + 'qUa566GLy1jakPVtyBYoU17/pRK34NXrdorypEqRQVaB4gKrkiA/sHUPjQIDfL2XScSLoAQE+WMWpnz9fZX5PZe+UKtGYeWMq6Uj'; +moduleBuffer += + '0BEC+jVCJwjI9gkdICAMBuZ8ULjlR7cWbsXYRN8eUH/H0P6Yb4djajpMui6Zxel+1DgPkEDYuqPLgqPOLBb5Z7GTZxuKMWWFBlrJ'; +moduleBuffer += + '6rbjjFEto9uYNKD13+CEBM8zaarXrdGAi8DlJuCNxFhXjcLrC18b5ETq4YPypONIQdxBIxqJr25mdCmBo1jpeZJzuesAvFbEA+sV'; +moduleBuffer += + 'Zy58L9mJFxOwAp6W/I54ESdP9Bs6yeXqOWNcLvQaHk8Bk8HjCdHyz+wbt9aq7xli6DOEqmRe6efk1T2gvLoHlFf3gMJk4FMxNn5j'; +moduleBuffer += + 'xl9G3d/c1KulNNp91T4UJsToFfk32vHUv4QC11pmpbABdywbqBysp6dcCPaVpixcAVdFVWgLbhsBfmCPYMFtw6I2btPFxaH9OhhE'; +moduleBuffer += + '6HpjxbndHyv1tZ0SsQyOJfCX74croqu1X22cx4pndBfBwlNvTT9l0wALwvO1rN6x8b+yq44pppcFD5IoXyaTM1Z8cOt6cT4+vt/i'; +moduleBuffer += + 'nQx9ObMXYy8Pbjj85jIVrK28wLgfyU4AlOXLCXmUunpfr9EJGkxmOoGJlg7QKgCVsGEvOnL5ieP6x4/rHz/u9rlsceWSBfrxG8aB'; +moduleBuffer += + 'UtdUIltrKQNdngIvjSscCKCQjlwYqKYtBjJ27sEMvgp4oVtC/SIp3ZI4cNmyppfoBJAFF8+bXYYL80d5tNYMnaSD7ejldHGQXiat'; +moduleBuffer += + 'YHP7SHSFVEuJtJRGWUobbujhKBfABnQJ9jQoMAL8RHevwoIVjMn1LgWdhOUDlyBRh8T6K+lXwUNU4zBDIMODwDJtARKSGFChkp1K'; +moduleBuffer += + '36cfJUdBGBerc0udlzgKAjMKZtUYC+qgu8baAtxOMS9s0Z2DsKXqcFV2lXB16VCpT+wujg+SQY0E8fGGHWPRuMtVHxDJn7yVhKfM'; +moduleBuffer += + 'THb35PEGI5LHDOPzhFOYKsmgF4UuuUv0OPLHufmx3XssY6AgcdcpG6WktJdZ52Yudi/tfAdBuJ60dZc11dhl1qoOya2vc8hTDtpM'; +moduleBuffer += + '7DcYwwT0T4sSPA2uWHvFWdYW1GSmzjJH1E99dJ0YBwjShj/b0EbTLLEMEzpsqDoHdJVrVAmrpaMk9zWVXM5HZaNkAidIbv0s2a1t'; +moduleBuffer += + 'UGvxSRUe1HORcgNb1k+rzrJWFQw7AS1BPAJuZH7yEGYn4LV6yT1NAgAMSSU0egoznkSbSYHiO08VAoL3Rn6fu9Wnv2nHBlMKozYC'; +moduleBuffer += + 'Y5s7GdgXoo7nJf/ShLQk3WlVOwu1D6vaQymhhliEwfpu7qSAiYv041lwAuVbBYABAwYeP/hZ1rmwF4PfPo+YuL/4dT//Mddf0m3U'; +moduleBuffer += + 'r4HWHZKwA9VLKmOZ0wbs1CqGbhl1zNH1f1RG0UCUCKl0L8e+ouIhTke6Bzpssh6qLkuD0wJ5Bq2MA1qc5UQAkVmK13JwCo6Ney3r'; +moduleBuffer += + 'gF0WMFld7rbrZe2CeknQWvkFCTVLu87W4qa4TYCN2JsjnjFhl6FZHfsTZygue6KTb8VeSXlk65whC2HzqjggAFKli6II1IkLh+vf'; +moduleBuffer += + 'Rn7v3+yxihgcMtDyN/kQgkedkfwpuV2e6UxLxJP1CFm/5UfqEYeLwBSePEPzP2xrfwhitFVWv6h4kDbLrFvhF1qNNoeQqE41HB0c'; +moduleBuffer += + '1fFoq9db4npohTvh0sTwuljbEn2H34iLSZebvgokZAGw/Vws3aQvEv7PLDdrYgkrznPR63ZxyXmt79hjDSw5Zyxz7EAG7jOAVzds'; +moduleBuffer += + 'qe128lce65giBh4NlzMG3fkMJ8r8DbCwP8NdviHrTkBhAKcDfWV+VHgqbEC3PsNJNuBMYTi9VvJ35wO5MlLiLqz0UfoqHFOc4Qxu'; +moduleBuffer += + 'yGA8Au+JLEQBHguYUzPk9tSuH7PWq3dq9z6DH6jBSgRcHKLyMpLL8rRC0bC9IWtcQpcNbC9IildX1fFMgZF5qaAqT14KewdNU57H'; +moduleBuffer += + 'KsKfwi/s4JtsA+Nz4fNAQksbZGluvbQUpXlaOw/NxqxlPo/5hrryecyCJ7r6RBTlVk+U1bEkeoWsYhw20Ctk9eMUaTfLyzXZCiib'; +moduleBuffer += + '6V5TpnstD3giNCzrIclCJnldmeT1pMTQL8fPsTkNpE7uK5w38CFIA0dZyqDkcVePWaUffsmzm5iIJ9ql7YusGS7gVKXo6iNk4lgO'; +moduleBuffer += + '45MLzC5pZM7EGua0p8k7E9xNBcD3nYXpgE+YcQZnuP0qH5RpeU7JwxrehFTBRqyPYx/uyuAd1bxXT/5DDG8NTlNsy319qqenTZF5'; +moduleBuffer += + 'qqdpTUnAiA8ohHgXp2fQaU1JUz5Bj2VyQEnjPPNyi5J2BcgKewqWNG3uunp3IuTxXREcJwpYVOZt6XMcU2PetfUgy+URWsSStWXC'; +moduleBuffer += + 'YvtV6xgVL8Tn4kDQ4yGWVjlGyZ42XK1MHJp5VZl6xCV6DN9sVwPP17a3aq/U0LIa2pBNJJIRhESKEF/Ut0n8jzRmuhmma7L5LR6Q'; +moduleBuffer += + 'lgkneNq1N7b9sRIosjjemv2/1O4bCmzzn+PZtmv3+C/Cn5DK42FrdZtujrKKx3FqsGZdO8S6OV/A3ctP7PIuXoyzoDxaR1yjeD2P'; +moduleBuffer += + 'xJ31+b0fe4AE3BK1ZjGORHJvHX+676XOhXrXeda7nGX/I3dnRWJ0rOZ6HwqT3O5cpGRxJhUsSax84ZUdJ/+u3/G5RSCJVqsZlIc7'; +moduleBuffer += + 'MoSKHQHm212ULjLFWhtTj4Z+MXbFiC6/ZTEdSmk0gviuf9HiDmCVsSFnVvsyGgAWizz7b5eyllk8zA0vnIMDQgxq+RZ6EJ/l4+VB'; +moduleBuffer += + 'USAl5xNF8Dye3snE2MTP2TaEuJ0PXJk/9g4t/yyQoeFQ78q8f20ttp+x0azYPsa2ZsW2GZvMiuUm/Lr/lTvgFKK5KeRK/u9EN8Nr'; +moduleBuffer += + '5z9Q7g+cB8okPCJ9DGEaq6IHdZUG5bN5FneYHLwN+eMiNdT4qdxfoGqr+xJb3pJMarAoPNuWlKKh2fD0PXzUxq2o160jvBX2unWY'; +moduleBuffer += + 't4Jet3bzlt/r1jSrwREz7ugSd06aLzINHYLHx721bRtAIRhMKcFBsLw6bnEvC6xQhCISyY++lU//ffN8CTzDwIdmmufDoWzyO83R'; +moduleBuffer += + '/P+sweWum+PRfB0vZ74il2t5OT4jl49dptfjrdH8Q+t5PfVXcv3nGn3VytF81wOXatbNK03a6OI2l3Z33/SAlZ+ZX3ez/EyJVPiQ'; +moduleBuffer += + '/H7DTR62ded47y0SHsrf8xH5ucXJ7/6o/H7MkdvxeQVM5ynaEQfmdsRFPTvi4p4d8bSeHfHUnh1xsLsjDpx4R1xyoh1xoOqIL+ju'; +moduleBuffer += + 'iLqTRRwGhQVEQ83tCvuRODaou/F3fCcYszcpApH6ZbsYUBEeyX0MDDpZU2BEyppChqsKdZE87toszO/qByzMxz+9D9aT8UjyGPb/'; +moduleBuffer += + '8js13CrCd2u4XYQ/reG+WeF+E5bivw3gHnlEfsR6Iy3Z9rRMxIT7xo5u/8wDKEGgJ2760rj0iHX5eSRDmXAvz1rndRr56TyQICzQ'; +moduleBuffer += + 'aF8rsdutuNmIwsD3FmAjZHaCfru87yaivZzHvRAgJTDxC3DRnaNVJHdsqx0Pf9HpyCPi/IWdcHgXrpvx8Lvx29C479tyHcXDB/Eb'; +moduleBuffer += + 'xsOfwm+g927AtR8PH7Pk19O4R3DtxsNny48T50tiiTu9046xiYpOJtW4iOdAlI0WzZKlqqHkwQ9dXe3NwxNLNqUBL0V51qhzNm2Q'; +moduleBuffer += + '1rurfxTOsO7m4W87m1LXJLHzO/tH86fxCZwr0+ZoGo9oqg1pewPw9/X93TXrdm4cHv+Ivwn+vcev+tLxT4SvIXaSdJ4XYtuePRcd'; +moduleBuffer += + 'C4gkLsYdOzita862B4vTMUUgaa9wIzUfrb0M+/qct7N7RGJMhIqsB4Sg+MiAs2DMQX+f9AurbbKUfADfr3UZSeBu8sD340Hl7Mg8'; +moduleBuffer += + 'hP2kzgL5ldVzByNnK/bcwL/qQaHF5ck0ZHZU9EzxiBhMoqRJTt4PzDHvDFndDrv/nS1hSxEFGa8HTV3+TpPWSxfmkviQg40DIm3f'; +moduleBuffer += + 'JIXlu/4Fpytb5RJwEbci6ocKxk1BQ0sNXGJbyyaYixomS12T66D5bm6IEHCl/JgClJR9BgWpxkmbU60Gkc3HG/oqPPqbsEez5lJY'; +moduleBuffer += + 'hrS4DZZ8Eyebh60RZp4qnG5FS77VK4chgLs48pZZto5AX717seOTvDvQkxLFL/XxVf1YczkiMzOlDPl3azUphprPnjOYzRbuJjt0'; +moduleBuffer += + 'o74T1QSDTzrO0T7XcS2eGZoyYKOKTkZe7yi5RxYWzhhTn8fdLx782OvylyrWJjqZnRtDXp9A2/KhYohc58QLsectxD7xQpz5Cim4'; +moduleBuffer += + 'zqEzED94ENu/PuYow9yEJc63GnpA62vzKfEem++HntKntWvNF3U3n6/N56dt03zImsHK5mZZokq1I1NtH9VuVdX2aw3o8zFdDXji'; +moduleBuffer += + 'xdjzFmP/PMU48xWDQriLWrTgCNpPemjETnnOCDs8Is7BAQE1dwn8ofZ29+XOuQb27hUyYZNSGC2OgxAFSZY6/B5N5y0lfJJefm5M'; +moduleBuffer += + 'C8aQVJLvCao38ng4IMMWM7z2XBKi0mmiFueYuFW1OJ4XDD7rEIrVT74k72wus157HqlKf5cL7bKueAc/C9oAz+Z7/J6hN1HNBvSX'; +moduleBuffer += + 'xLRrDjmvIyVqWQW9AtwdnwdZYlgkJ5S8nCLaPN9bZk0Zeao79SeBtACWl/o8ald++XgPTkP0pTHkJDSfDOaoBj5BuEf7HNshyGFA'; +moduleBuffer += + '/wrUfUBtL0AHkvwbzX6i0puCa58irf0z0tq1tM6zpyUFpFlcRJoqmcUxUrgsyCdekm/93h4rfzENpvMtuN7+/T1WspM2fPMn2n0i'; +moduleBuffer += + 'iQ6UiWTOGodtkUcMeXpKBpUx63LYsiqz0O8p5/nykTR4qWUn/xIgQBmVL893fXwvkYrdfKuaNif/bHZ8Uj95BoqKI9OZdA9nU/lx'; +moduleBuffer += + '4N/qssyjylBKx0zpHQDZFR0Ucxg3c/DXYopI7+pfnMTv9s1xTGEbP8mIVaNlxAFG6FZlaRi/fIW7ywf0ogXp5nGdDe8KN9/mYS8Z'; +moduleBuffer += + '1u7G9H2rly2EjwV8INRNqgG/qShtcHrF+q2Brr2LfV8G3bDLEaHfd5c/ku9iZYc5VudG2zpWZkc7MQq3a4XzceYZse5ckexcFQ0Y'; +moduleBuffer += + 'oD6bahHnPzoi331hshP8c5sJAeXhox90SCHgkbeqSuPBijL5Ghb5/8RSby14YSwtV/QUaSXrQj3lYbQl7WNFRu9AI1AfMWrTbv1k'; +moduleBuffer += + 'UqGtkpE1RgIcK8VKuayOPh79BOluYBdlO1q2W5St47+k3m3hWNIz5yRxyd9simJBSbpA3sDgR0sdttg0dGGzl6nxTGyXt5QcmArV'; +moduleBuffer += + 'Fm8k+WBYf2DMW8nfYuNjkvDNx0stc6rRpWXeWNcyQ6NlhqplXueoljnuqJZ5rNIyJ725Wuak161l3mC0zEmv0jK3O5WWOa4N73V1'; +moduleBuffer += + 'hQMeGHSpZT5daZnHjJZ5tTNHyxx3eHlslpZ57BfSMic91TJnemqZ19mqZY7b/yW0TBzjPMdq5tesX4aeWZbyCymaZSnPqmnyjOHE'; +moduleBuffer += + 'VU204S9L1/zQfNqdqfmJKps/u5wT0zZ/djnPqm6yJefRN+EzXSicl9UVzv9dKpzrjcL5xnkVzq9bszTO9YXG+dQvqHFe/vNrnON2'; +moduleBuffer += + 'l8Z5nT1b5fy61VPnNNG9lM4J+0S1zpmeWuekp/L1WKl18mHFI0u9swwftn95iuf3fw7Fc07aZ1E8Z6f9r6p4ThvF84hRPFuV4jlt'; +moduleBuffer += + 'VZrn17Vv81Cq0j2nLVU+p62a9nksVO3zSGRURz85brTPY+Fs7XPK94x3r2qfh0T9ootXpX3CZ8wlNz21z8IZzGif23n3aKVb5rsY'; +moduleBuffer += + 'M1OL2c2YY9365+tWuNuas/TPLbR2H49m6Z/HQuif4/Z/UAHd1hzJJ505Cmgtuq6A1qJPQAFtGQWUOggV0GfROuZVQPeLwDmKzE/P'; +moduleBuffer += + 'UkCPFgroZpZ6tTNLAX2aCuifP7sCeox5oVEdcAoF9FhdAZ2ZXwE9+mwK6GF7jgI6M58CelQV0LudSgE9Op8CGs5WQMOR5Kaw/kCj'; +moduleBuffer += + 'gH4eCuhUAwroT1y7RVfXsHR1Ta5RMFYDt5U1NUKdOPWYP9YoHHkT3C/5Q2Ns1JIBdG1Mm4GYkeoZayJLEm49O8/3/9UkZPIfGlse'; +moduleBuffer += + 'uCkGyQfh9edpBq/MsE3NrST1m4zNUYgzB6RW86wGg29Sc5qsLT09ZMHqVRumLQnZMjavNRXXNyrLn/C6yvdxGsPqBZIPpzAF8Zdn'; +moduleBuffer += + 'kkx6anNga4UDrXBQFljYGSA1DChqzzXEuOXTYIMAg3++DfxfAtZcXXDbTARXG21QGCH4RYPCquEPUwxrV/OKnsD35H09i7f1cvlI'; +moduleBuffer += + 'rTUnQ3z7twS2T3t/+PhYuafUmPmb12YWWU54umyvJfujnheSZAQo/h09OpZveOTuByyDvQHHltxdm7sgAjss8alBheGNTWuJYgDr'; +moduleBuffer += + 'WSI1OrxL41Y3OWzHtSmQ0CN8JtmBj5pHtHFGXTyv7RKfQirrSG6UC4/RonCp3og+vaxhV6X6lVVzdp3KbDwPc9a0YU9hJcdgTGvn'; +moduleBuffer += + 'T0tu/lHQ8Uwd09tevv8uxmWWZ8xnjXltlFkwX9aMx09PeXp6+kWLWQG+FgVEPo3701qwNK4WXNaqeIEUrBB8BRxaWIzOi8o+pWky'; +moduleBuffer += + '96K2WzQYSKpwjF+WnXn5GfJO+b1SX+X20i+qFObokdLwI2tgVMGVmPrc8kFaUT788HwVrZoPRswiP9fmD8qT0JfG8oNFBUlA7F65'; +moduleBuffer += + 'PrNom36QnyR1CdZJigeg7MQdiiLFjlenH/hf4QeOP9J6RZvbbHPw5XUspbOxu9ocZ6OmzSFQLm5rW+VjaLj4L4CTy1PNKX+0gtax'; +moduleBuffer += + 'k6fcoicOVkgrNKNzROspJT4NAweJfZhLd1FyEVKSjn9TtJV3NVih/CfWaknwj/bqdWrQ/IiN8F0O2VSA953v+IbMXn2YvSyi6Kg9'; +moduleBuffer += + '6gEeEIF6gowTyU5QhDgyL5oDIq1s7YzIyY95I2o5WWIyOdjnWeHOeJq8Kg0Mu5BT1HItWYpIysGiYHk005vCjURzVfgmb49KiquU'; +moduleBuffer += + 'fOv50zeKIvXdiG8j7XdzkCp5la5fLJrQldgPsJTT+skKwoDhzH3bHb3fttqr+Lne9poTetvtTo+3fcestxW9cfx9v8DrxuwiyQea'; +moduleBuffer += + '6sQDipCXO/sh3R4UrfQRdIVT0BWcfL8D7JvyRQ86s7regw5gxmfMc4y24emDbdOw7F+fQaFp1b+KGsQ628ls8OHAiRQad7zYXRkm'; +moduleBuffer += + 'LhN/VsJF/7kCwE208OcGADfSwp8bAFxLC39uAHCXa+HPDQDukBb+3ADgprJopp4ov1uelJHy/8jFqlE60099m2HcSkfMXV0UtzC8'; +moduleBuffer += + 'FDE2xo+Dn0EgVOAnQghuW7aiybZU2fbpgrkhayiUDXHToQc1YDTr4/O3YBZMw+jUheVw6r8a1rkO+l0LwDUb1G44VVT2DejzAPL7'; +moduleBuffer += + 'SydtKfloU7cf4vf4jq+oHbvsYraQNfMtsGZ/mf5iDMKK115mvSFzd2Yh+D2lhmkWDTeuhSZKks+wau+wau+wq72jYbsk+YyG+8v2'; +moduleBuffer += + 'joZPN+3dKNobqAnADcq8gugTwuQg+Hwv40inGSJ9WPL9P9pDnk9H6eGJaQcfLJ+7eaUBkm7CjHSCgudz5dp85flq7iV6M175EH7z'; +moduleBuffer += + 'gygPtMPcdfKSrxrehyfpB4OwmhZnotPD9WC7Xc99xOTWlPT0Pct6g/SkbQbA7vWS1Ho5LZ7NG71G+YhsxrxshMCmhIhimVSyUpHZ'; +moduleBuffer += + 'SuzpwEdfZ5UJMhYrrSQ5kB2Tj6yehKl3z1NfbY9+yg5J6AlMovx0g+thePaMqLjR+nVqAYYQIJmuXLdOwSs882qy6hzfW1J0op/k'; +moduleBuffer += + 'Keubp/ndP9CXptcLIfgsa4VlvF4IzleEyTW9pAyLyLcGcEWXDtA/Pj/65MQ1e3+pfXLbNXt/gT65y+R+HvbJI++cr0+Ob977S+uT'; +moduleBuffer += + '7/q/vk8evV9G6LFfXoc8dv8vIiS3fPY5EpJv9X/VHfKmPXvm6ZBb7vvlCcn/+zvk/pv3/lI75MGbfxEJeeTm562EPPaX80nIIx/8'; +moduleBuffer += + '5UnIcd8eMuyTg13sk6d2sU+e1sU+ubiLfXJJF/vkC7rYJ1/YxT55ehf7ZNrFPtnpYp/MutgnX9TFPrm0i33yt7rYJ3+7i33yd7rY'; +moduleBuffer += + 'J4e62CfP6GKf/N0u9skXF+yTljpYy1C8BJ1Afsj8eJZFpsWKHNJOF6UvvqJOufi7BgSooFw8w4QLysUhEy4oF3/HhAvKxd824YJy'; +moduleBuffer += + '8bdMuKBcXGrCBeXii0y4oFzMTLigXOyYcEG5mJpwQbl4ugkXlIsvNOGCcvEFJlxQLi4x4YJycbEJF5SLp5lwQbl4qgkXlIsFWJMV'; +moduleBuffer += + 'P+3pxv+Mc6L+9imP1+Au/ee9fKj/XDczXOC8YXTQjVoDFr7hUMZ9ZvS6tS93NuhIVTS3N5tNEAbWa0DR3C7XgKK5XaYBRXN7gwYU'; +moduleBuffer += + 'ze31GogYeJ3ZcWbgtRqwDLgc+7WrHdrXnuxpFw6074baaRvaW5vaTWPtn63iVS7N2uZVLgGsmE23u9ZamlbjMl5LW2xcNtfSFhuX'; +moduleBuffer += + 'DcCI6WUICDG9DNYaqQbeItpT4dKXy6v10pXLcexdHTPIy+N0o/STP1WxTId1RRZTIZaFmWfwrnRPTdFD/xRl8Vfdv+GWYoDtUKMy'; +moduleBuffer += + 'B/Aq/QIvC3BsSOAmH3bTNv2do5qz81Tl7HypmtRf0uXsPC3l1+C1IFFn4IMfv82teZP47H7cL7cVpYN86fI6axSsA2cONlxd5MWy'; +moduleBuffer += + '1TjQslavA77ARdw/ZY/NPPR6Bdnmgc3UT/dhTSFfDIAtOCgIRjs8IyHn+ShMTAhseZ7SOqfBCMdNvRqow4WLFTGGOAcOiWm0dh5r'; +moduleBuffer += + '5KBGjtbIydM164iHwRrZBjmc7lQyGRBrM1JgzGiUOJyK/zR8ePf3vv7A22/4+GHrmuG3XHX1loltk+P2Rrlxy/4t78a/bFa8/DKc'; +moduleBuffer += + 'brwaisjYNZuHx4sEY5uz8JI2vYHC/3Nb7l4pslRrwh4yiXYxSI+JcsUp+Wryc5Kvlsc1lrFYWNSDhHVg4SmL6Kz5xSdknRclDzRa'; +moduleBuffer += + 'ixB8CMEAwVPoyolgC8GFSoEZjSjS15Z/lRvN/D34aelW5lGk/RDjU2DG58ckIrnRbQ1oVttk3Y0kSo2Zb5fr5BkHPK92/hncSPCw'; +moduleBuffer += + 'k7pzHGCl8sO472rGB5Fxu0si11rKx1mfnikTPOJb/1q8T393xu1P8H3ueqLKuPUJzdiHjD8qM7YR3PwtCcYIthB857eKRiQ82vsR'; +moduleBuffer += + 'bCLYrBOH2vmub1XFb/uWvjrVtE9+q3h1wHrl+75VfAXCwnwewT4EAwS/Uib2u4s/hhvt/JonURu+XH4UUe9ARFBrDvkoXvf73/ok'; +moduleBuffer += + '3//j+PE05fVP6vu73V/+rifZxPfjJ6x9+QcQ0ej+8k53/aZrpU89qa9vd9fjCJL4vT4ghNR/4rj46TNd4+Ka413j4u3H5xkXu4+z'; +moduleBuffer += + 'Hfcer8bFVlx/8Xg1LrYf7zkujh6vxsWh47Vx8a/H5xkX25/huLhufE/ZWE8f7zku3oUkrZ4pOS4+yPs9xsWWZ3ScP1N9j2M/rY2L'; +moduleBuffer += + '28qMHBefRLAaF/cjWI2LzyHYa1xM1+o1JdfluPhn3KjGxfcRrMbFj8f31MfFW9+yp/e42I4b7fxT+DHjYiuu78OfoNYcc8fFQSRp'; +moduleBuffer += + '5o/hx/Tc/XLdY1x8/S1s4u/gJ6x9+R8gotH95WeNi4mrqtLHr9rTa1xcjyR+rw/4nzwufnxoT31cvOXhPfVx8daH9/QeF3c/zHa8'; +moduleBuffer += + 'n/e1da7H9d8xXl/oVrnuMS6OIIkZFwcf3lONi288vKf3uNiPOgb5lkeqxjr28J5e4+Ltj/Cj9UrJcXHDI/OMi1sP8X0+fqjKeP2h'; +moduleBuffer += + 'PdW4+EiZkePiE490jYvPPNI1LvY+Ms+4OFyr14OP1MbF4490jYvvPtI1Ln7wSNe42PzoPOPi1kc5Lu58tBoX1+P6bx6txsUx81Fm'; +moduleBuffer += + 'jYvPPsr3//yjVc+998s9x8XfP8omfvjRalzwy08/Wo2L4svPGhdP10p/8tGe42L8MMdFjw/4nzwunnjfvvq4+B6C1bj4EYK9xsWt'; +moduleBuffer += + '79/HfoQfMy6uxvVnGG86llz3GBcHkcSMi/1IUoyLh3Cj17j4Bm4E+ZP4MY214/p9vcbFd1mfnik5Lv79/ft6j4utN/B9brmhyrjl'; +moduleBuffer += + 'hn3VuPjoDfvq4+JOBKtxce8N++rjYj8L6zVf1IqfumFfbb64YV/XfHHDvq75AsHafLF13zzzBW7IfIGfYr7A9X34E9Sao8d8sZXv'; +moduleBuffer += + '/xh+ivli676e88VWNvF38BPWvvwPENHo/vKz54sbq9LHb9zXc75AEr/XB/xPHhcPf6xrXHztY13j4psfm2dcXH072/Gdt1fj4imk'; +moduleBuffer += + '/cDttXGxvee4uPv2alzcenttXPz17fOMi8/dznHx4O1VY129vee4+AfWp2dKjotHb59nXBzT97nqjirj0dtr4+KaO7rGxbvv6BoX'; +moduleBuffer += + 'N93RNS5uvWOecTFZK37XHbVxse+OrnHxT3d0jYuH7+gaF98sE88aF1t2cFy8b0c1Lo4h7c07qnFx9fae4+IjO/j+O3dUPXfmtp7j'; +moduleBuffer += + '4s4dbOL7dlTjgl9+/47auNjec1xM10qf2tFzXBzZwXHR4wOW4+IgAN/sDcp0dsIjoxwNC+aMBotVWGbZZ1nYqicVmJM/eXg/ERIc'; +moduleBuffer += + 'OGotkYgv2tivRMcdGsFOIwGSSDNns2rJoYbpjme4EQwoyqK2fHVWUf9wAkUlJ1bU1AkUBbPCF9M+pCxn++xyvqRMfan7B+5QWchg'; +moduleBuffer += + 'WXBUK66PNaPbSq1m+2eX+I8nULO2vqTjrWBRthZ1eHZR/3QCRXEgflk+mo48DsQjX91fDUQ7/w6CHMQcdD9BsK8cdFse228GMQfd'; +moduleBuffer += + 'BIJuOejei6BnBp0ono8VRXlUJxHsR9BF8C4E2wg6CH72seJB3EtC03G/TGLUZFx69bcMfNzywiHDPcs6E64iys5mGRp55Y63SBiP'; +moduleBuffer += + 'yAH9aRWDgBu9GfejscubWdiAdszeHJDHOzRxA9LLcYKpjOjWrUUkZwxVGrZ6q5QzhAarZE1YalBq1ca1ICeRN1ngWG2X8gGGpMCG'; +moduleBuffer += + 'slMPyFbGJnUAdcDpjr+eqMD67FdWjzbUkN01sLtqYNdrQL+ZKAWUWuFTs4THgUsU1edMBgb1jvQQqSh3IQEpI/+M5xCrqgbJfY7l'; +moduleBuffer += + '0DHBXQ+A7pbESqOR89UDnktAk3oyA8L7B2LK0yKLonqWE2g5QVlOw5QDvsEGPh3cAshriA+TzW1Wp2jWgulNMaDZah4IcNhC3KYP'; +moduleBuffer += + 'WYTaF6N7Ve0lHUAeju1lommzs73XdLbJU+pYhe931eOndFfAlDHNs0zemrTVt2HSVsBC/MZ6S3lSbCWIcg3uq2P4suhL0CLQnZZj'; +moduleBuffer += + 'nFN9vatEXC25+x3mDRR3sGHyBsqGEmsQiH8eTf31uZG6AETmuY2CCuY7BSwfzNRNUYq+5xRFAQ/QIWsKixpvFaCF+twWX9KwgYF+'; +moduleBuffer += + 'KiNZicnbp0WZ4Hg/QQvz7V/aa5lm7FegWMc8OhkhSKejpW1bgPSNWvrxk9DsQfkVThohNjZbHkdavqnGyQoFaeq8bUBfIWIyAyFo'; +moduleBuffer += + 'mnV8oUIlNk2JC1HjSBsOZPUj/OZau1PQKe72nPYm28ggehEPy8gD/HBWYGtqxJnDll4MFRdLi4u0uFhSXAwWFwPFRVJctIqLqLjw'; +moduleBuffer += + '5AcQmxsJiLQxc2rXXu3ar10Hteuwdh3Vrhu162btOq5dt8rrrL1xONpyWz74pszembkbsj4QQfXLdKStkPYRRNV5hUMCqiLWKWIj'; +moduleBuffer += + 'ifWLWHdDdaMlN+x809qdaWBu124mcjPslWtAbkS9bgzKjUavG0vkRrPXjVRuxL1uLJUbrTk33FeI/OyH9JVg2t5424ie2PYnb43T'; +moduleBuffer += + 'fhUl057jqonIRMnINmQAleHoWFwNFlf4SXQOexkEzzJrVebtlM949rVQd1L5iI1rZewEtBsJKruRoLIbCbrsRsKa3UhYsxsJS7uR'; +moduleBuffer += + 'qLAbWZni/MmYjGBYwKLiVerHCb4DSDcr33q/mtXBpbJDqpmImI4W3Y0NcJw92jG+qL4ajXg1o5GVsPpw+ZNvv79wlXyQ5hdqMsJQ'; +moduleBuffer += + 'ZjGsaBuZzFCAQX4nuGXhm1gVsdsUYdXtRmSCLO1GzlU1gFRd8l3I04VDWn3JhPQefAhLTBX+u7AakZSXZXzNy2Ez4hp1/DLmRR4L'; +moduleBuffer += + 'JiMup+XzlHpHeZzlAkzTxmLEgsWIVVmMWKXFiGUsRtj6+k5efvXeusFIymrmab793qK1JozNx9c80fdb3T0MNicqnFKHEgrS4bZR'; +moduleBuffer += + 'pe7B7JhMh2Daew0onPS9l1mvVbYfqBzm9iVggCJmuNy+lGYiVJvM7QtA+ETU6GXWq2g2oi4RencVCetWMu+5NCOhumPuriQZ1HLe'; +moduleBuffer += + 'PYdmJTydN3eXd0gKx7svo5kJD/LN3aFOK1Wu3mWizdhmkk/N3bTT5njCXRqXLKVxgLk72OljU+IuTV2GaKJi7iadfuO0vMwaoJkK'; +moduleBuffer += + 'j/Z5V6nBWqOTkHp+KdcMPjKPtCkVPIAkw92uDL5BPeg2VDGXkaCKsq4WeznTNWsx6xkT12LezJhWLWYDY9q1mHF12eurRV2tUf1F'; +moduleBuffer += + 'lP8KmARIFPqFMj/ZI2oIZamWAxlWdLIHPTsaKw/VMcah5vlKD7iC9LruG7OmnmSXK0qvgEBs5u5lmZuPXZE6I6BTCWnQcZHob+Rt'; +moduleBuffer += + 'oTUCD73t/GnRuZ8+tI/Yssk0cYbzYL1Mx7Oi86cfwS5JckeE5YcpzaFVW+YprQ3P0TvmGd6zPAPFRTDmStavy5tX9rzvrc9nZkfn'; +moduleBuffer += + 'fyg/eDwSTDxaHH93VyYAECIUxV1lAvD4QHdc03Z5Z7K6g3X1oXpovOvetjKEt8ngbI53VICFZbQE8JUjAI7ccn/2q0TAQlhPbIN5'; +moduleBuffer += + 'XhbUpo11gCade6eRy7LEWT+rFUTQQ2i5BfWCBdJir2RX8HV98XLDHSG96R+bTqBT4rhXgNNsN0z2E8rtiIUavkoWjCR3NfPjtjKV'; +moduleBuffer += + '0nHPh8eeZwA5dKpYOZJc06TAyMc/vccqPd3TkfzYX9fCgyP5TC08TBZrNz9axCUqZQ99co+VL0je44DplA75yYguIyg63+OALmOU'; +moduleBuffer += + 'nPJKKuarRz5RoCX/TEFg/pRNI1BSEvPiDHcbWfSWWUfJrodXuZvkdDtF8ZIZvoHJPRbtBJN7s5rcm9Xk3uya3Bu1yb1Rm9wb5eQe'; +moduleBuffer += + 'F5P7bof4nCR+rM/xdzsy8B90VPCBz0U0dZnlt9y1p5rlHZ3lYRrqVKahDj6+02UaGpazvEgRM0fvdjBJb71rTzHPA9ulmudJJh+Z'; +moduleBuffer += + 'eR5DA6ahirxV5d5ucgPmHVM8kSuO2rU5fr+jk/y9TvVWuwvGQ427HnGTBgdei2Y/q0yWJfWTTsZcM47O9g5n+ye1BORzyuk+KKf7'; +moduleBuffer += + 'UKf7IyjNzPcO5nunmu+dcr53zHy/m5w+5hW9/OBfVzbL7Duc9aXOmPZ36ev7+amGgNpYgfr5AkRcXYtoIOJpu4yQbmc9Za+w7EI5'; +moduleBuffer += + 'k5iXWOP22VZHYl6E1FfZBvE3xn+Q+y4xSYBHsl3aI3fOJyYJYaAw9NblL1LsAgCnQgoMyUdMvgbHcdj1gpjTSm6SV+44pssgiaHV'; +moduleBuffer += + 'xSC6ieMbvUdtlzCIvHwcWNLbHVOeygWR2I4mv3dSxqWNa9QEbpTJ13x6zn/MP0vqqea8uI9tr5kCH2UrDdvs5DogIuy2TUVRx1TL'; +moduleBuffer += + 'va8s90SLlBV7UeABd0SRWdHchEaeYsz2WswhxuyqYlLvDGurvcKZBBbBTa4yei4tGZ6PqP0bQFT+v5S0UG9I6ZP9+parpHe8RxRl'; +moduleBuffer += + 'pRb/UFyXqWr55tICjQl1pB0/7l5EKjoZmq9UiQq5Gxi569XkbliTu4HK3UDlboWv4xm5i4+VH7htbyFXgeycT9bDInd318Iqd6VB'; +moduleBuffer += + 'iriESOj57o/uhdx9L7pMyC7TJXffC3pC6TJhTe56Ru56NbnrFXLXK+SuR7nbRG8+CigVz8hdmdR2yiL3bAhVkbstkZWQu3Eld+NK'; +moduleBuffer += + '7sZdcrdZk7vNmtxtlnK3VZO7kXaIrFHIXQyZQu56Sq9pg+Zb5O5Tt+jqylO565Fm0gyisEvuFjyIkLtRKXc9I3c9Izmv/oiuGDzK'; +moduleBuffer += + '3YaRu56RuwgbyOAQQ9czcrfIfb3JLU+j3PWM3PXqctczcrd8q92sN+Wup5+BcpfP0aILuWvWWJ6Ru14hd71K7nomH+WuB9EKRnFc'; +moduleBuffer += + 'efyW3n9A7hLlw8jdm26rVlqekbuekbvXf1hfP4Dc9WpyN4Dc9WpyN4Dc9WpyN8AgV7lrpkuJKeRuALnrzZa7nspdYDWp1AUqnJuf'; +moduleBuffer += + 'PpL7V3Y86naQv0Elf32Vv77K3yNg76D8DSB/b67LX79b/t7cQ/5CjRFF2DVtd+U6ymItW2UFZTGzbv3LvZCZNxv9GoLzmywhuaMu'; +moduleBuffer += + 'OG/uEpw+ZTFg+t6ByUhl8ZGA9U213BvLck+0SJXFLBCy2K/JYp+y2K/JYp+y2K/JYnlCKYv9+WUx4MJny2K/LosVErwQtoV89o18'; +moduleBuffer += + 'vt+zG2YFVVCVGLJQKXK1miN7HZJU41jCxfrKU9wJB8KX114G2DK9Nt76pA9sKOdeE6ElebRWOk1TRgZPV8j/aNHuPbnNFqHplpyQ'; +moduleBuffer += + 'fo0TkngRoB/Ml4O7T7kJicFItLRR8v5h3xuHDQHoPHI7htZDRa91GUyeqzOWl9i63+8A6B+ymyedQ2osLHcd6UdHw4u9VTL6UOjE'; +moduleBuffer += + 'F601i2nhLYEmGSFkRcnGX7OYVKGwZya1qTxMVgik7iSTaRqs4QJLqlgQd4bw4sicGm2h23EKRlIXZIW6NiONJ7lFUDr5CkPlKySG'; +moduleBuffer += + 'CaBYnPMI1RIBXa6gFyxbkK3qSavqsVXIa3CoApiE5J0ObLpp/c5HzCqIj5AarYnx+LSh5IxNaXk2BXhPPK6YUife7hUoCiCOjrUL'; +moduleBuffer += + 'SQHW+altMO5fXV798WLM/PHwC+AIFg+fDrBY/lwgPy9c4a7S0EoNLdfQkP6kGjmooURDkYasYXd4cFi+C9D1xzN/+C8ewua36OB3'; +moduleBuffer += + '/iAaywL8bMJek/zC+V0m+v+xOHNvy3fc7LwRhFG7fhBtHJbApYuzcPjg1zduolf9bfmn4v+9Q27vvNnZOPypWO5Gw19YX9z8tsOb'; +moduleBuffer += + 'd8cbh7+NnI3h9zIjiF+HnWulu4bDR6xNoBUYfuVb02DD8IS7qYMFv08WgI3suxCDLWk8YN20dBiYrwJ28dYIff7/R5vEYhul6Bak'; +moduleBuffer += + 'YqtlBriC+g/bBoDMHp5YMo7hMHzOuLz2OVd1mvwaIiBb5CBoXZi1QaIVbsC2T2PDhuGpfnCgiQb2/2LEgHvMHR53/oR+Bt5tkrc5'; +moduleBuffer += + 'CkLxxal7W+rfljZvwzgbPmfTxtuSzbbKllZ3Jboi4jQ2PMTv8uz2GATlKMibIVWa6mYQK2N1i1ycfQWmTOrJcHN1v6TjFwM4FSUy'; +moduleBuffer += + 'yMOLiN/jnY8z0o4BLvVlpZ9vWIvTGxmIpHPlwaQMT1gQNFe3fbNFmllK4MPVcmZd1LaJ3ohZx4rdVfn4VVdHwJ+0skb+tuu3T1lX'; +moduleBuffer += + 'jGLrQaPNOWf9ztocvghvNj/ntx0iB3aUsxzwURfpqercGmGdVasR3oWnpAHhpRjieC0y4BN1DK6kEi2V+UhyggmPTMJsK/ci+maY'; +moduleBuffer += + 'zCBfh6Od11G+G2IDxRjPfakj80iY+VIhtGRL0mOc5re++wHYfTQLUUz2X7hZnE8Xkn5Tqw69o8JRgmSFoLJtwUNGnix9H1W1iiJw'; +moduleBuffer += + 'pokntuO0HX9poTOwiT5Z25zRbBHAMDqpwu0PlscOgyJoiquovBoqr5aXVyuLq9pPmg52Fss/yM1T8wjVTuXCWZ91wM/ZkXVnZ4k0'; +moduleBuffer += + '3wvSxfAh7Jwu4dMk7Wma9oXp6emp6WkjeXjh4ixLM2xbL9m5IX0BLkDj4eKAySXL55L0BWD5fEH6QvxITvycLiXJ5ziNKtwgdoY7'; +moduleBuffer += + 'I+kSzI+LcXsxT6Q7tlRJUp3KVIvSQSw9JAmv0hVOmi7CrvGgsvTxDtYfaJkyHI2wfcrw0AhbqQwvH2FbleGVI2yxIgyEkX78gEd9'; +moduleBuffer += + 'EbBIFuAHe9Lyk3ZOws+QdB75WS5dYBEuVq5wXydXLoT5otSHMF+UngRhvijtE2GOc2qnQNlbRDgUCrNha/iZTz/zw8d2Hb/BLska'; +moduleBuffer += + 'EfvhQ08c23n7nuv2WSUXo2+IIP9MY5ZXMRU1JCBURGzPKRWnB2GPYqdNfK3cmVqUKRj4jEBekUXXnJKJxN2j5G0mvlbyrlqUKXlS'; +moduleBuffer += + 'Sx7MWj3qLPdaveps4ut1rkUVdXZG1IW73aPOcq/dq84mvl7nWhRLXgTgTrLpgRZN+TQL8seCPNJQUkLhJhWlR+ZHDaagwqyCy0Fk'; +moduleBuffer += + 'qUHDEAkiz5OliGMFTSYpKC/fkAHVho6hjsEOpVeo3HvdhizEPay5D+kd+JPKnUukTNzBLqih3fSGN23WR6/awAejIgXXZajclcTI'; +moduleBuffer += + 'GUCaXTIHLkzpa6gcm6QY3WaXT8Qzt9r1mk7YWgJXh1v0lls+dNyunurpU/k0vsg02D7xEl0FTtULPDC7wMk5BZ7CWjhoZ6mAM7sC'; +moduleBuffer += + 'TpkeotEmq+jJr96ZnpwOEDYInytKF5Iudbc+bSBdiEqC+VNKmLHRVI30FNJ+HrXNp2hoEr7INmcD2WmbLGWrY77JKZcyiUvMOGIT'; +moduleBuffer += + 'kR8VxKPmwQEJTunvqS0QXlo9eJfDLgLeVHwSp/vBLjRBO233KNVViCMspbtKdaFD2gVVKJsP84QMSzhqQo+1S2RQ9mcZCF/6u+v+'; +moduleBuffer += + '+ROH/u3wFRW3rMRefd9jux/58v3fv3esFFeIHitFFULjFbVsIap6lMiDzh5FTltdZc5YcwotxVSPUslD3aPUbXZXqbsKedSjiMl5'; +moduleBuffer += + 'ipjSPOnsHIuIimqT3la7WiEX/FIucBgWHaIQHyWvq4qLsBjJ1SAuurpnhlTx8QtB5JuPX0oYlRKNAuyqEBPd/WvC1ocUg7b+kF12'; +moduleBuffer += + '2V04JHXoqTBQ+bRhQykPSdO7AeJBu2oprrSrlrXY2t3LqwHnFmhcqcr7pZin5V7KGXnCztyNKWflrXYWbGQPT14tkpMLHVIdww5p'; +moduleBuffer += + 'gTyNZLswcVmEmkqKDWUS2DL1v3rnxg2ahNP79iIJZ/ld9sZa2j6TdkPyE1tn/d02/k7y7wH+neLfQzaTQPioArYIU05xubW8xM+4'; +moduleBuffer += + 'o2UNZsErwKnAQILj4BkTiHAQfNQELOhZ0wgEpPF9GpfK+vsULn1ePolL5fk9UiysHGVpX8SZUf6/iBNphZ4I7cvRw0GoWIuM2CoZ'; +moduleBuffer += + '2fkOZUQ0ou9XRKBu444qVNsccx7tjKkKq8eHy2GE8Wg4j2mzt8xarrssHmBZbve4AbrMeqlo8dnqNk5glq1uQ9X/hsXlS/4dAsG6'; +moduleBuffer += + '+VOggpXfRy3dift3osW6+XJy3GGrIsIivanIDagHcObdlsaeZS3XusGS7F2exIeIj+fGg3ITQPkwPp35KnyBkm+62AVanrrtgIkz'; +moduleBuffer += + 'N/k8dmpD5HarrH4t6/dnZ/W7so47Z9tdeb1a3h8ir1fL63XltWZldWtZreSJJvbYLYW99JjqmyYV96+r9Nw6w97r0pGU4JJW8ghZ'; +moduleBuffer += + 'RIZE35Wfpdj0dHRX90yYxEjzwxLKy/25zWbrDknG9aapRKKVcKtK2KzEoF4BGPrTcYdI3MqsFW/2nNCcnTiFAQ2QDPxkJuCBrtJT'; +moduleBuffer += + 'G6BmBZumYYzMNBX2cXAlls9y8Uol150h/s0kt7zcIedcSBLaygw5q7JI3nJx1pC3zuycMLkNrNS5PyXtM2Xr7zHbVAWIz/6IrF6S'; +moduleBuffer += + 'p/DgbRT+QVWn5F2uiQ5SU6p3kTeWmmfycTKu/K6IjDvobPwozrivCCvZ5BrXVN88INbXWmusmxQ9CPf9/Kbte6xkDw2gW5IXRsSp'; +moduleBuffer += + 'Myppd3bi1N4JOx0C/oqM8GiU0dTZvpm2rr1az4YimA8Y/IJmGm/pNLEV3byE4wxPaSZv9/RQcsrWzdmZEmCb75zayfdC1nESFLJs'; +moduleBuffer += + '4ZxQD3jXZFoGVyh/CW3CDMycrzQljFOkvNXVDdpxvzT5xb53mPxP2hXQ5hdGaBEjDhmzlTD5U2OcJrplMolja9A2iEhPPuzRwJdx'; +moduleBuffer += + 'uzw1h1XMC34n2NV+OSiS1G4eMDvkX9ZtcSJwKKl5wC1xJtpKe2JX8yDC4GpAuyIiJWE8yrK1FkcV6xyB2Y919IE890V+1J6UFSwm'; +moduleBuffer += + 'MMUjeZNvvJu86bZmtrAM9rXCLpsECSNmtfXRW7QBNABzZ3PHokrm6LPHiRf7Dd/uGzMULSrcacbvFcZGLZ4n8hGutM5reNzYSbCr'; +moduleBuffer += + 'pedIg+dxU2qBCv7f1pOiC7I+/Lwqi7FhJPFLO6QtWoJdY/TOtJWPXZHba8+ylvLolEf/8RpKkr6RMy0r/+zYH7VtSHaJP78NSQ4+'; +moduleBuffer += + 'ncsIC9I38nLnDTCehxE9bR2xkmvyrAqbMp70Rli4w8ibx1oWaYOyYDK3/lvbYrRTRNsyfgi4dfraTr/8PM5T2P48WJ/662BnETO9'; +moduleBuffer += + 'W6TH2JSxGKxfx1wzNmot+kfeWl9L7jF5f37S+nx8fMZai5xumXNdh3ZMgZ4vNAj+L7UnEwkE8BJQyKyFYMYpwW9DnCOC96Ux5RJj'; +moduleBuffer += + '3RnLKU6Asj5ucx/fzSFyxse9NYvxm1zMzf24MBbSws3v6/XnddJSCxC14OXOa430vlTaTn4uwcYaMHN4EHiBThnn5GN67nnYghYH'; +moduleBuffer += + '5wcfzCzJJ2ydIbrjbYlnma/12F9el7aBbybLmxEt9vUdWegoAxRYN+7ABqNoOrA10yNCuCBIaumB7VHcNhxUA4W+Q57klh79k06n'; +moduleBuffer += + 'PxYVkB0nf/or+6zk7xtW/IzbdSI05hT49PQG0WNvMlfphp5FHwV1WgnUeyXC6jpvXcZq44ikUZnfkZS5PINRwxYvc/I9llJrq89H'; +moduleBuffer += + '4K4ibPrt730AprVpgO3HCLOZaFYQpxcWfirntUmBi4Q8hmN+VsyRivmcV41fRdR125bbomZIdXAYbPhyOKYj6S04/nH0+Ae6fHix'; +moduleBuffer += + 'koE7tUMgRw+B4LeAbd6myGSyO/EAufnGLM6bl43my9dJuTwPakLwh2C39qW5m5frLT1k9/Wey+wgdu5939P7R8N57vujWuk36j3u'; +moduleBuffer += + 'CON20PXm+GLYZTY9ib4puVWc6cT/Ch32xDxVjT/O6TjUOl0NqA3R80vVWW/hwjBa2FiI/4zT3sIFcn3Swtn/nTywEJ/xJJwZK8i/'; +moduleBuffer += + 'hiIi6zsalk/k1cP2rLAzK+zOCnuzwv6scDArHM4KR7PC8axwa1a4PSvcNyvcPyuczAovmBU+aVb45FnhxqxwU8N2nq7VM0i5XDXC'; +moduleBuffer += + 'T/RKjrZJmTsuAM2FqCNVtAXsKijEA/Cr1K/Rb7jWfQmfIsXqcYOJGECEXYtYqJ9RqyEdzb/yLCuo1ayIUg2XLqHjtrGvVJ/P5OMh'; +moduleBuffer += + 'Zks7dxQPy0vuizNf1kqLgW+1mHoqTzR9EkHhU71OzYOpVvyFr6ckNLf2kh82jXaIg1H3xbJwvqMBm8fottymRaCk+UGToo7mc57q'; +moduleBuffer += + 'k7Avp+Twkn+mueEFBU0U7i43ZJvMoGwL7hnOBSvcodzv+HA/Q5Yz9Wz3IK3xvyYTESIvzQJDspARcA6F0Vb1zBHq7zamHDffv2uv'; +moduleBuffer += + 'BXg3F8fdl0lE/8tpVG29nNbWVOkADKcG6bSN3uXmC/SJq0Yzi2WegzJR4cNWSWSFml66wl2ZBzGnZn0tZZhCrlB+QEnh7fxsh8Q9'; +moduleBuffer += + '0mhJp5m7HTLZNf/AfYPWAwblMiz+J86o5n6CtMGXW6kcBGqUKHVlyFWM8dSKd3kuOgHR0aBcPUs38NENPNMNvJ7d4BL9KqzD27Ub'; +moduleBuffer += + 'KNq66myyqEdJ6BJcyiWp92J3EP0B60Ra90f0RXuxG/2BC+OyuDAdg/Jd7zN+rz6zclaXWVnvMqkSrnb3mJUr3EHTY5hjiX6//V09'; +moduleBuffer += + '5lyZXLp7TKo9ZskIPSUI5urmRx7aJx/lEu0xr9Uec5l+qTewxxxVaFJ1Q0A71XqMrKmtohcG7DEPdveYc9G32WPCoseERY8JfmaP'; +moduleBuffer += + 'eY3W41LtMX+sPWb21zI9xvSRUNt0sOgxSgFoxV917b5NKXzPsM+YBQUk/vCXb38LjL/GPyehPmzEDdu6PcZt8CgjtH6km84EzG9v'; +moduleBuffer += + 'yFxss8NR7h/e9q3jx7/8wo1ZPzfLJSs2yWDog53LjCvEhFvu2LuTv23u4hNqH4cJshS49cl9n3rXwbu3ftPamCXcz+suZTCLudWq'; +moduleBuffer += + 'G9RN7kDrWUCIgrElKFX57Eevv+kfZv7xniNSSrNeF3P2kWYtbr5qXeJy49vsfPtal688/PEPHPnhE+/4gpQS1+tiShlCGUOQJ61L'; +moduleBuffer += + 'K5YArzhTkHp84O+Pf+Ej9+0fP21jcV7TQmtGm7EqQct6m0mswBUJIv3N5EJAuIlwiPAgwwnCwWaSXyDcj3B7M/kqsPvb2IzVCsJW'; +moduleBuffer += + '/JOW06dgieNRMW692SSxd/sjsgjx8u3y2+a2DTljB0c6TdcYCyhd4SHH0MFSh26VdLCHnN50sDMhAbG7mYGnnRXuUVCL0dO9oIM1'; +moduleBuffer += + 'lkhLUiWDfTqkSeCxcKQghj0aEhXxWFio4sn8bLChYt/6qnr3LQXlGTm1QpE0ZIM9BP5bYDr7o1ljKfjl6JAbgA22gRorhahomMFS'; +moduleBuffer += + '2P3Bar5OCBsssyJymC6zGspl6uMd6HSh+4Opr5xtPpY7kdpVSOom9iPVdF4JYQPsLD5bThLCTpW7VqzJHYGa7NcJYV2pUp3MtCgk'; +moduleBuffer += + 'QiGuSuPkM9ICziaq8EocamgZK7Y+MoYqkWI07JKOzznBzHavzPYJZnZ6ZOaGkGNYX0OsZsn66oKw1C1YX0NlH02UIHNWQ/3A04Zq'; +moduleBuffer += + 'zd9QkTZUlLZqDZW2kk9L09UqHPVsqqh3U51AdrtXdvuEszs9spfNVbYVqV0Dbpj+MfvaYUc7MrriYQdGM8usrzrag6W3HXHYEY84'; +moduleBuffer += + 'IGnt0YeR/DHH0L6y4X02vaE5ZAr052cvx8OHDrTm5hYZixE3WItzTNy0U4sk1/Hgsw4ZpCBWrPngjTPco0ZCNYAhEMCMVMmaQnC+'; +moduleBuffer += + '+m0c4wZVnDK9xthmneGz4/LZeoVTXz4IcoMzagM06hQ0ifGqULH4x9xd8fQljoFquk42KfIt+VpY7HGrXKpRRibZAjBGOoUsbXYz'; +moduleBuffer += + 'RjYxYy+gNK0zRi6oGCNjinslbRyPdJeiIo4MIfKadeLIphJHhml/mhTEkW0SR4Z46zYHVZlaHrQNi2hDHOnRScIHcSRt6qq5Z8rr'; +moduleBuffer += + 'mns+UJt7rnd17tni/oy554DdPfe838w9B+xq7qnIzEi+ifa0u+aeKXuFu9v7GXPPgx4nnANeOffs9jj3HPB+KXOPvAnnHvhjzJ17'; +moduleBuffer += + 'Dtk69+Ds/L/G3DNpP8dzzy77F5h7TOb/2NxjMs8390zaP9fcM6uhfoG556/nk/71ppp/7vlZ2X/G3POzss8397C55p97HrSruedB'; +moduleBuffer += + 'W+eev7fLueegzY540H6WueeLdo+5Z7fdNfc8ezk/79wzZf/8c8+03TX3HLJnzT1a4e65p4yrzT3T9onOPepSUp97IBbLuWdKhVf3'; +moduleBuffer += + '3CPyrXvuEblUVGPW3ANZOs/cs9v7GXPP35Iw2Js19yj+TY+5Z7fHuedWu5p7dnu9555xd9bcM+6OJB/UuedR1w7HzD7deHMN91P9'; +moduleBuffer += + 'K9X4GbsW2+zM47RiA0zdy531KSg8WBhOYcswWuqMNXTOCs9T03GgVAxdrI7dlfWDOskyh0tBkY8pVBE2dTvYME+5I4hNNykeEBex'; +moduleBuffer += + '1gROD04aKZa8QyYAksyilDD/nQtBVwvIKux4q/tTABcNecSVOK6FDdHvXKSZkSA1HI2wXSY6Xj6U797+QOmYXg959VD+dbnKX6AR'; +moduleBuffer += + 'TwRyO6zfph00wD6y8ELOIfJaNh+JpgIoPa1EnFE0Dg7uPOyWw9eIVU7tK9cp87uHJg+N88UatpG2CSZ4ei9F680RS9EY+Vi9Jg+5'; +moduleBuffer += + 'TlsUC2WtaeWGu7U5KgoEeWiTrA+G8WQu4TaF1RlQjpPIXZVDQgWLOwmNHGGB2FyzWCKymKwX8ZrFPFa0jXtHK42yhrzyRTzalhE+'; +moduleBuffer += + 'kFudUIaopBmAx9zISy1ry7C9+RLijaUNnNTEHZqpoM+kCyCumohgMNGCfEmYETUuUN4Mi0dk/P5YxTdA3mvLg4B1xY6Q+hfT6j5E'; +moduleBuffer += + 'zuhCDu0QVuM4h8Xv+W01v8FR1uGvVCACjbRPMvBR7SDth30KykhdoGeFkrdzEosyroYo8ST5s7ptcjdH5WZRgCcR7RFYput0JcEY'; +moduleBuffer += + 'EC7yXXn492T5YMAUPFirBt/YlGLzlCQLX84dOlq8g1fky67tFSSiPomW3PXwwO8Yox+46ktrQTajTTqheh1I14KSR94CvAPs1S5s'; +moduleBuffer += + 'GxQyDGDT+IEeGgdz87vd+SXLhTTfL45l0Kain/2U875xefLV0lCivxuAF+LNMir9Nd4Y3M+sER9Rl3Z45zWw25cyknvsAi4Bu4Xb'; +moduleBuffer += + 'XD2H0bnGbN1FZWnh3NJCU1rIx/YorfBM6wLvgP8mvAcdoPz4wx6QcpjgEv15s5aQwexlv5T0LzZBHHB8X9CNQ47f3NTHOfoou3B9'; +moduleBuffer += + 's1WyA7pw4iN7rOR7+NyQmtuK0LRrB7VTsNRRPzcdUtjytHM47Dq59ao27YpIO5L8Dban4cxMzxXprYVgLVww6JunriQQKkOWlfml'; +moduleBuffer += + 'K4m/rtuT5GcUQ0sDd61OBo01bVizuPL86IK2q48gGodojobpvHiOO+s5bVftXUwu31Cjz1sxDDPFCA3zbaDX+F4B/aEMI6ixO6vG'; +moduleBuffer += + 'utiAM0+ZxJmdBGMTbaj9OeR4oF8f7UMu9Mbgf6I+QRefp7ZU6oEihaZKQ25ACmzpflGsAlmmuFGRTP34wmG+q6jv+3w9554uN19a'; +moduleBuffer += + 'aoYyHelGeYGANV1dHiov8XOJbpoXSEUeYX+yOPkg3n03xzT8XvcTaMMuYNz2w4no0AN7rOLWpMHgi5LPIfgUAfya+TFJIjHGPUZX'; +moduleBuffer += + 'ouMO0eaSx+F4CUyD/TAdEE0g+ZLDM4oMW5AmOsw9jV41Cjq3IrqRRxoNhEBY9DeK5ImJJ0ygRBTpU40HbCDSB0X6aUtvbDMZeEMd'; +moduleBuffer += + '37EofIy3fUxXuGEzxe0BvAltnsvRFtahLaWt2txELYJr1i1VBGwXxm01XqC1ZUp8iuLT7Koutzv1r7QN3Wzc0e8Ebwcb3+luO7Px'; +moduleBuffer += + 'ofBF7sOkGiWP47PJSlYC+GwPyOi+AkRPDzX0i9IWGta+jnnOAVvPc8qIKUbAXrmIEVEJWzmcnixfAdtZkCUZtiDpBvsLqiDggE3T'; +moduleBuffer += + '3mvGUYjHbVFpho5OFiUX0agcBv0izu50UgPxSGxDBicIJyG6swb1c0UGErKRXKA+I1JAg2UBkTGocs8QoBEvzuAuA99oCttG+RYU'; +moduleBuffer += + 'wSlHn+yzVKBGNgmqqFldECGH5uY0LbKqSnraiUxwUl20pYd8HsIUJORI3GRWAExqf9aH+gqXFOlDA4V99CSEmco2bRJAJyhsHydE'; +moduleBuffer += + 'Q4hNCLsSW7+wV9SUZGec/BRG39uwuxR/AqJezwgV4ccgE1PO62HbID3Uo+QqLiCXQH/FWbLyIf3IulC9lGGjZKtrMv1j3ihqUc6V'; +moduleBuffer += + 'mmG14xTieaoVELwnMEVCK/NG6Nao4BgWdCkLeo/aNUApdnlcCftlPDjM+y+EDn8x3KrD/LgFi6mQtlaOOpCGk7l1ARQEWvzJ5Hgh'; +moduleBuffer += + 'i4bZg6LfmvWPT/XN1J9gGvJkLzYWFoW1SFTVtqUgr1Hx/lTki/d/i5rDmTa4XNvAi02T7BxOr11Bv+tcXjKf/ttC2eq6HStvPI85'; +moduleBuffer += + 'MVMz7VSR9mlXFF1MDPKSxdoIll32Wh4XOmtJ3lbQaHGouaOZlR+5+wHErlYrJZmn1+bu+W07PyzxacExjxub1iqDnLTQOlyRLFMd'; +moduleBuffer += + '6aXjHrbjQinQ5zo0N3Pyo6Z8gGyVD2vT2xp0XI7k5HRGuAItGS9hlqFFjq4a9eskP7tCZTZ8xXHHWG0kx2wuV4/Za/MH73rAQvOM'; +moduleBuffer += + '5Qe1WLQP7GivXJ/RPI7xkIVc4DjGhiuKyVhpKXC0pUR7jv5gYS+fAm+JO/Lx5Ip/CN4wYhz/q0rOfiNakjDS2JTwWsvi/cPzl1W+'; +moduleBuffer += + 'cPyQJ6tkHa7hUotaGFdgAxngnoBEMEB7K6ypLm5bxUhuGT/YF4/2Sfex0P86gI9OAxo4DkCNhv1cMqVAw2PYEWrhw8pvuw1VB0Wn'; +moduleBuffer += + 'GGsD2KVBi8FpPu6YwW9pG9EURvL0GWN8UaOaFxMipd2Vv1c2fQ1dDjZwRn3h4k5TWTBjmpGKYnA+YQVivox5QgNmaUZXcmDtqAtz'; +moduleBuffer += + 'D57QVn76m/S0/oqUy9MLoEH/0RWLuYmCjYHuFHLzAia7YnGcPOIQCJtAWllA6OP8wRs/+Q3rfJnfwwuBuPQFBP9orW5RNi/DWtKH'; +moduleBuffer += + 'Elah8ok4zbFd6F5C93++o6fviBkmkHcM9B0jNZVNA5pN6gqx5tKANzzXMv8VF+Ops/gP3ELOYnOE1HgD6iHv532m++iC4D0B16hx'; +moduleBuffer += + 'DfVNvgeETPxR13F153+bXcAJlvoeVxvF5YHyEj+00s3T1doCML0fobj9fVVa+BvwiB/OwiGdhQPu/nQ8aqs+7HiKsmeqy6Ndj3ld'; +moduleBuffer += + 'rlDYTtfjYG3jjRTPJaymfM0dONVncGP9qU79qQGckU6/cudG3oINjddVcsqCdeOsVlfegarkQzcrqjpRXW6167Uen1swPNaw8yVd'; +moduleBuffer += + 'T01J6VC/dtaDLPNyTJ/c4ip8inymiaa9iGr73xjfYlkCTNqgYiVX51nWhAjc4X/79LEPvf/gzPviFe4WhL/9vu9/+G1ve+jt/0t3'; +moduleBuffer += + '4IY/87kffv7Jv/jKrT+WOh4TcT287Svvffwj7/jWQ9eOrXBnEHF435cO3fK1v/jy4Ar3KMJfnX7Pv+98z2end0qCaUT8y6c2P/XN'; +moduleBuffer += + 'O4/vkRIOIXzLF+596+Mf/9cnwhXuFMKPv+dTM++/79s/ukcyHEDEI5/72NTf7fzw96UOkwzvfuR7P9h3//0PW4Ricob/butHr7r2'; +moduleBuffer += + '8b1/86BE7ELE9x/d/MEb9rzt8wtWuECZGf7btz008d0P3/PoMLVaZ/ib37j29gMP73zH4hXuVoSvnbnx+nfue/zQ2SvcCYT37fnU'; +moduleBuffer += + 'Nx795J1Tt0sVtjDBk+/63sPvnDn40TE6YTnDX/nx3g/ceteRSV+aQWTH8LeevG7fnU9++5PflSrMIOKJr/7bl770yb/6u62S4ygi'; +moduleBuffer += + 'xr9wx/f+6Ye3Hvww2gERH9jxj/cdPfLMTz4pEYcQMXH91PXbnvrIj9+0gj5zsKdqQDBRPT4peZjQkh8CqlTyUCjdA8tWmcVupFmV'; +moduleBuffer += + 'aHD0nBjJse4hpq4N7dOs7LQQzY/7qubNuCN8jmjkJma3P2KKQsHwixlEB3m5s/tDdv5K80hYZw+Pj18lom/b+BOYbF65didGpwih'; +moduleBuffer += + 'k40RedA5WUFPTtZniyJ9N1CXcJRimbVZTL/RbQsKB40Gde92co+vq8dsQKKgQS9kqKk3VD9304UV8LgnS4+2gTFvUJnXpIBH75Ox'; +moduleBuffer += + 'NwAwcT/tEyVE4ci5qoEyrVjkomr3Y5/MoKhLMEn7zdOIvpmkSYXdjsVBgb8uyvQpkrMfBdE4ijVdYAoKAAPvpSaIhcOitFVUHFDu'; +moduleBuffer += + 'BOfUvC08D8uQU5DaI8Y7a+3pRYMDG18Ewr8tj/w27yJbH9/FvGOiF9IiRQ5puW+jSKzZvlMAw4d8ptYkRk0WyJNLYPigeEfFnv8O'; +moduleBuffer += + 'bnta2mlcWeg3aiGjp+2rmPEy0eo9IMaHxSM9OCRW0PElZD08GZoVYnwoNbq5ocgnXP7KnZjrx6B4NrHkeY56VDpvnHxfpnTjRKgY'; +moduleBuffer += + 'KbX+jh4HhIst7MnpSWdZcoXu/TdM/1dmB3LaqnC8aVC3zVbjxCFdxCwxy1f1XuR2B3TLz1kjL7Gts2018nOXrwA3hWSzh7ksgP3h'; +moduleBuffer += + 'S+xVmZdflehZQHK21ZafRQR54UIFtswj3BZUZwCR5Gfbg2p6H72cay9XlJ7M41o+0sMXWKabtb2Vv3CE4ExSi9zC5Gw84s5wL4BB'; +moduleBuffer += + 'GZYBrOs5pT2iLMnouPayaq3d4tqx9j6W2sVOWcVxuqVGu4fKCC7Mz1Rc8+KN8bawf5QKl0cldAj0Sr9PqRfRhWVin/WeeBG/fLxq'; +moduleBuffer += + '6K4BwNnrO9GYT9MCS4/JAfCcEZNFfe3IiO7HRv8EBrRo7bzj69rRXdPmRqQ676X+hTTejkZiLQN7rw7d6Qp2eGr0oWrL9lLD84Fh'; +moduleBuffer += + 'RYdg/FuzWNTHHbfssZInPAXDVlMA1chc4u560k3vNUnU9SMzeTueOaNQcnZjR+AatzogGPk4c2ujyaysb2PWvyGL9Tyw/9KdABZK'; +moduleBuffer += + '+y7duVEih1/5Vng+Fai9ICvmmbdqk0RsTuNLeLLrrucTXB5tKbNwCA/qEMlJBRzr4cSgrnHJ23XLHl3UYC85YTvk49jsfW/EEQcV'; +moduleBuffer += + 'EIvSByVd3sln+LY4TgrUqUu0vgmJ2hrgfHWJstDz68xqc9e0OS1igdsVsakjsCqjzlRsY9YXMpWNszHrK1tFWgOQ/mm7apV+bpNy'; +moduleBuffer += + 'kzeC0a++pipxPMWEoorKTcL3JMAmQQA886850mBtY4yBU7CjE+oUGcAeBcfJ+cQEAUbv4RlxqnTbxnczOaaU1xoMMIqkD7/bdXzt'; +moduleBuffer += + 'w6VFNZk8oOra9G11pUMF+eSHtbd42jlgaK0eUpH6dQKeP6RbnpRs0tKzq5UBcsxZs1hdqAbUJj0p8CYt04Y446HDZgPcA1YWb8xa'; +moduleBuffer += + 'G7I22rAFu1yRxw1Yxm6EVbC0YbNowxrfjYpYPfBOm1ejqdi37OGxTkP+NaEkcOw12IvNN7LR42zTN/U5sCQ2j2kMW/+9DVysWAsF'; +moduleBuffer += + '4hFMBdarzsFjM+Z3CtCUjnOJyeCZ3Q51QxpUix+MiaLzetp50eb5TbeYzvtpVzHQSwIiJnULt0TELFWnSCd5t6+Skww0Q/RPyKe+'; +moduleBuffer += + 'CigYmwKUu1tkp8m/ZKLt5BtNmSflD7apgLN4pYIuJ5UxjUFylC97kXriSae8mIcKDq9gjuTyimoAjiSIeY6jJgMVTl4ZBQvPpx7d'; +moduleBuffer += + 'Z/GitR77yl1RJ61flydXJo/LrFpFBuvpxVCEO3Ar/ENjpA/krggZ8BnKyOY6xjiKV9q17nDLSYkWJFE15bRG2Azkz8BXkk958Kv7'; +moduleBuffer += + 'ylNpslAcqUXg5fOnahFog/zqx0zE1/zC1GzViBHOsrT6CE5w4DpuHout8syMM8fMdc5wtSWuKLXloZnpAJZueizJlMo946aXm1m6'; +moduleBuffer += + '7HYkNPVnsrLCjoD8XLQ4C5/uB7Dv2Oq2o1nTjDuR3ARKle1Nqm+d33bN0r6w88IGBSpsKVahTB2512lpmgYcCHPsCL5Z2Y9kWTd6'; +moduleBuffer += + 'Uds6DacQI522yhGLu67QGmHcdyFc2XYOO9dmoGu5TUJ9t0mHefr48eO8py6IWeSNcQvdWQ8nUEXixUG351ODGOT3y6F/YiZPtrAh'; +moduleBuffer += + '1F4B4geiMtQtP2BXah07nFeJWRlrsiiWGSqGitOGXZjybyy1zCs1cIRvAqv5VjSdSukJ0YR9FDR6fsaGAiYGKvo4DVNWR1oHSxGM'; +moduleBuffer += + 'mQZTqJZ5vs72kH4goujoNimOwDlRk8GDh13sKKkiycm7sxsD/M0kdI0NBloKnYykXWQ7UZgCp+xry1UvywLT04ouNoTeTq3Hojdh'; +moduleBuffer += + 'CUXmpCbnEE9bbcUukMeP9MdW/LeuE4zZf6Zd3FqqzZffihGwjZCWKREm5WIpdvzO0c3GlfVzV93VBTxHvr3KN6idbQk30VYCDOLD'; +moduleBuffer += + 'Dd1HK8qociayUqxyJppzQHLOzSTrPOKqrz3PbKeRNwdieEh+zlQhoT1rR1VkpEW2TGXKUs/UUousKPj8slw8Sz7rb9nJCxmtWbeB'; +moduleBuffer += + '6cyN8+sfI0/lqZ0guc8GpMJv25ptOQcsgCeMOmsBOeSeQKEUbW1M4rGeY54DHWgtFfdzUH6sObY1mB2/MrBx38NNyAQgCtirF3f4'; +moduleBuffer += + 'pvycdvxPjk4yU6E5lcqP6qEsFklOvv3gXks5r5yCgExvTHrKexXoGsxPflQcTeHk5glMR1v+Ya+V3Iql05Yv78X++v2N5DoewUow'; +moduleBuffer += + '+WhE0HNdU+YHHpIoLUkXvXoyBceM7V/RW3ocFfE46v00d0IZeg7VKAjIcLg5xSM4eAYts7b50oO+iGTbfVQYCRmBKnMTY0tQVtlO'; +moduleBuffer += + 'bmrI3ZsaV+hBHup3c4P6tI2aK5+XW6z0yNnFtyxiZFEXQpkax8Kty5sW3mSiMr7a48/GNHpN2+Wur9R746X4O2xfK9Hy9090e0IS'; +moduleBuffer += + 'i/ZAulJZHPiAAQAJW7QxCzamwavbkbmhp/OiCXdiPX1KGzCmbeCkCCtVezSLYSzQxHz6B7SjkSUtqTdHlI+hMYoZzr24DRM4YFUg'; +moduleBuffer += + '8yh2aFphnL+U6jg2a17K5OzT+XIFCDUepLZmc022fHkM53mJ3AOvpT2vImTlujbslxqmkBGD0FIUgS9+6O0PGIsDhHaXIQeVsxh5'; +moduleBuffer += + 'oIzkUhTLZ9fsAxtnVhYY7wj0LAFuhw53cUROlcYA+NT3KeAXkTPuUVYhHsrKanUABaM7n6JY2c1KaGGSFaHLk6a8bwRdrJm5ipAe'; +moduleBuffer += + 'jCg4JsuIMvdsm/SdZ9te9+P14e4yKynhT3H0loVarj8JhAabG6SKIOTDXZeqI8/b/Pwa+2LeaM++cdxaa4wDuTHQwsneeKRKna1P'; +moduleBuffer += + 'CXLn/LYuxKQiVwFBBmbAHn8acDinrVK96IA6j1o68kDDj+svglIjrbsxZMK7QYUwaBCxviz28H2MnwUj+UvMPo1NLgfOwITumZPA'; +moduleBuffer += + '1wShOabzk0/ELKheHVaYOt3ASH5mUbICSwRmpa5fV6cHfkVPsc7lAw7KF23r2d53gA2SLzYQ6fyS1qln25dJ5H7eWjKiyCTad0NE'; +moduleBuffer += + 'LRrJlxl5EGiHIB0ZO4F8e+2hfDvGtc6G77VWr3LoHmF30sfSAMdUJahXxZYefxlPCwJFZnXPqpWVesYq5iX2ZWfTzTse0XJMEdzr'; +moduleBuffer += + '4IvoO+ApdLw8gdFy769ytNz7fBkt9/5mtPxajJbP/ipHy2efL6Pls78ZLb8Wo+WeX+Vouef5Mlru+c1o+bUYLff/KkfL/c+X0XL/'; +moduleBuffer += + 'b0bLr8Vo2furHC17ny+jZe9vRsuvxWjZ/6scLfufL6Nl/29Gy6/FaNn3qxwt+54vo2Xfb0bLr8Vo2fOrHC17ni+jZc9vRsuvxWh5'; +moduleBuffer += + '4Fc5Wh54voyWB34zWn4tRsvnf5Wj5fPPl9Hy+d+MlufBaLnGVTe6ybaaDdNAqoP747QTomFVp53SWAsMsTBqUnwig1BDv6BOktJ9'; +moduleBuffer += + 'prPg/2fv/aPsuKpzwapTVbfq/uqullp22y1w3ZsGpGDFSuJnacm8oOrBshXj2MnzyuKP9wd/ZOaxbnsxSHYEM0+2Gix4MhgjGAMi'; +moduleBuffer += + 'EYNwRCyCFWSQjWxspyXLoQMCBLZBARMLbIgAAwIcEGCs2d+3z6mqe7sl/8AkM2+NtFbfqlPnV506Z5+999n72xkdbjoLMjoedRZm'; +moduleBuffer += + '9EfqwPgQNS3K6K7TOSOjb1PnzIweUJ0xGkr1OmcpqkqkDgQwvUYwiYiYK8vo7xLR6nOZ99r1MLvCdIZxGUInzoTqUkOzrUa+7/sH'; +moduleBuffer += + 'vPTz8PvZxxAfdfWzQkSZLyTZmdlZ2bBenpGNZUN66ZyHFgG9CwkLslEEK8TlSLYwa+plHYAn6nWWZknhgAaPr9DaySdTtGpWxwWY'; +moduleBuffer += + 'XTVon4mPVvYULkbyEZrNm56RaH3+P5JofX4+olV7gYhWzjgfSrhqOYKNepc6MlV77mSq1k+mPv/vRKZqlkwV/YgK+tRiT23sGjU4'; +moduleBuffer += + '+//J0unJ0neNH20yq/PPn/zvOYDCvTy9bLzrTWX+ZWrLm/lSWf6mdfhdO94Ne7DK/+OuAVK8oWeFgakrYIUyxWXwO/QmM4yeokB0'; +moduleBuffer += + 'UhzW7LnUOLUOaFqIFYU386fQHuztAfMGf5FaTuNYmBXCsDb3163PjYUkCGASGjCVKTB0RQtFJgv20JcJbhh3+NbZXy12nWlixkhL'; +moduleBuffer += + 'AGmjDa8vTeO1fIJHZLDU1oDeIU16y364IF5TwJ6yaQb25ababCjNqu0yPlnQPGJsYLHhEmjmKAOJ0XIXl4o1Q6PaGd/BuPB2BwFg'; +moduleBuffer += + 'IqFJhcltjVgzzGcNgQNCvZSGwIGswl1fEuLMx+qCGjizYbig0hZZa4TPaYOAM3w6EzuoG21eYzS4W5D4gFbGP2TZumau27INRbIN'; +moduleBuffer += + 'bdmmg5HRdlsOR0Y7zaA4vhAQfe12xWfTwBlU6Lkz7JXFvOXLBzx5xfvq6dNwa54exiT+qjWWnrbG0r48p105LYBvCuDKyGAZ6Vfq'; +moduleBuffer += + 'HRvaGI3mu26Azw2tWol1E+jYzVpgH1+7uMtgpwr0FrvDEdNLN4NoHBMalRTgN0cYDf4I6vxgnQbTb9VuHOfXKtxg2ZvDoXYHz7fo'; +moduleBuffer += + 'h9OiOmY19CDO971dO6huveyNT6f7bTRR5hfZCvdo+6ZnMyZpDFp0LOgWFtWf1rd5az0L1jkb6qjsjs/6MCND+YZb+YVpMH3S6G5p'; +moduleBuffer += + 'Q1OVXgJ0jiQN4KICTmOwzoY9DNcSQY8IJzHiZaDXG9d1EgumEBCFQDHS5De1v2P8NT35B38nxNsgWhRxkRWsLOLGFVyTxb3c4poF'; +moduleBuffer += + 'WoglrAsjwCTUJVGBcwxAeXxAh4QXYWtfC/weGcdrOsQkiTSDdLJNv/PA9j3/wO0PeEI/z5Y0IvykD9YRk8u37mK0k1cGWDei/LZ/'; +moduleBuffer += + 'O4i5934fwa5u/tlBL/8Kkod7+WbcPCV/0t2wkZbq0o/X1Vi66vwUVpBOFSvjnsD3bXxTU/0AIFm0FSe4SkBjbI8OOWHZ71Htswf0'; +moduleBuffer += + 'JHplTB8/6C3xvAs8bS8/8aOD3lLPW8H74+WNyUcBX2sUj4Z3mBMBPCxMfuN3D3pwsjCTZoU5n/xQ2NtNh6g9ZzAeBZISm3R8nCEp'; +moduleBuffer += + 'kDTWgzuFc3kFPsCSnoxWx9MYZj6wkhHWDNQ2/Xmd++Yyj89zX9ve8i3Xtu/aHrMNTS9mbAtDL52ul2+Wl3U+OEi87cfufsx28BS9'; +moduleBuffer += + 'oQk95jehcXAlH/WnDd3Vygc+r4WfGIFzD/Y79cQZlkmUj/L7fj3ym2Q2A4dvEipq4TcShRuR/cMT8sF1C6+adpfeDXDBOz/9NTz3'; +moduleBuffer += + 'nyJoQYmxCNIEjwM//c/yt8nfZr7zYzMeL6N8JgB2gDxK/1JW30PyoCi7jZB48jD9SwgicRHfMn1lRmA9UOkg3Z+oiACSxSdbiazn'; +moduleBuffer += + 'C7XnoxkGrUzyIL0f7iQakFJWgz7FRoVwkSh42ALt1fXRVu4p9TzSgtN0EAm1WqS3NH2PUkstBSetWNOP2vSGTde+hVqJ7yo5RzNj'; +moduleBuffer += + '+2uUlTfyV9rehv2V5E97+gC7Y18B+3oAQUOBxBXo2N7UFMLA9jLJZ2xFDsjN15eeZr5a/mI8RTWv5LOPAo6oaTcPEGC4acyA6ALd'; +moduleBuffer += + 'BYxOZWYcNbplNjExTviYGeWcwPeEtJbfZnpy41c8U6WdSfmgJ+uZ+lAqvp6GtwTQHutpF/NDWMVHDOeetlPg5sX54w437y8AmQMc'; +moduleBuffer += + '6eajxoQaLHdHgWhuQDaCjLj5cwPhIuYt8LA1FC687SlVHtepBr97+uCHMk5NG+T2UzFRF98VVPIxnq1PD3Bfve59xq31wXOVcWul'; +moduleBuffer += + 'tdOFrZXHUb7zQ6eMWpsgam19MGqtAgUDbXG+qLVxlmyBo7js3Bq1VhqJi6C1xz0NWrt6qgDIQ7xadE2hkmVo7q4jpwXeSc2oDvDR'; +moduleBuffer += + 'sOL9GVsITXUGzyz4D4IhuKvUXeEHohvhKai+8cfziTyTn/R/K4BgZuCrijvJss/v5XsOHPBcOATEqs93VRN2AQemkoA2ZlB0m0vc'; +moduleBuffer += + 'gTtgyqBhoeTvqdtmNDYnOoMlATC7/Hve1ZBPKlCihMPs78ORwT4cnqcPx/r6MIs7GwzC9QIppqevUFbFlD2VlCNM2dcfEmKHTwyh'; +moduleBuffer += + 'EIHYO3AU30ZfY42GG5IG2re2aTEwpmQJ71euDA5ziFctk0Ae699sbEXwBrwvQEWiwZG5YHBg6L2fPg04s4f3HgCKwNPACTtK5jQW'; +moduleBuffer += + 'qox2+0JXE18gsU9AsnQvSac1Ou/nQptbhRHJz0khszm4TnqDaXEd7w0APKqfxACcoPpJDCC6qp/EEEFL0osvspobJPkoTojQTggC'; +moduleBuffer += + 'JUbqdG5nQ6io5ArHMu0PNH1isOnj8zS9xa+2/TrL8oe2edwS1Wi2ACYhVKe+WNkSU0rwEgMMgdWKwrQ0eC0RjvbpPHfwl742Ikvc'; +moduleBuffer += + 'BkpWtu64ctr85G+a9KK+t75g4KW18WlFXAUyALQ9+fEZ+eYLMa/+QS427z9gecmaTnMNdScz/YRtSgPOjfUsS0e8V5CY4t4627v7'; +moduleBuffer += + 'LLBXNg42WW8ZpbJCtx/VGOlkodKYGkNaj7qbXXKzyN4QCzZUUO18R9jLj8i0Tb9WA7pcuFqlivYEMPuJd9jOT+w9QL4aIP6dxL7Z'; +moduleBuffer += + 'GYRKM8BT7+OkZLMattO/jq/WGZLNfwk0pkQw66SKJtcZQXCFN8i3kp9LOmfhJ+ucTSy6DjRjQgw6Z+bLOy3pJqSFkWzYfu40G7JX'; +moduleBuffer += + 'IxjMYeuDzfsU92l5n+A+cfcp7oeq92mPcReK+zHcF/WdWRIKgt3JmxTPiDRXL8uCT6Qzv7vHnNoBJ+KzZG7Jz9nASY7wnvJ8OfRw'; +moduleBuffer += + '0KdEID9NWeJPUzUDP8+sJTtBC38vH+8umIKvarZA5mCedBpZwjOOhiuJkAqUoEB0Gtj0GgUsigZSVBDUVd5WwxLCSwkfA6WIEioj'; +moduleBuffer += + 'pSwhivLDil8LQhSRdiKa+OfAfS6QjAvyozLX0+8AwmkMgHRbjJulTQxkhAlaJBDbXFaqS8iipd5xH5cR0FSHMwS2D0SiC5oAKGw6'; +moduleBuffer += + '/iXHxIOMhRAjjF1xRnqDny2UG5Hj7eCOAuSiuFuEKVnc1RC2ZCbEHLdAFnK/I1TYo7GeLpMCBwnQs1gqRQJ0rlgurjbZ5BV59UYQ'; +moduleBuffer += + '95drn/J9uHnkDrvYv2GMv6kI2xkzjArXTkysUOwy4LxiyKVpFruowtKajRJsfEP8xWPvegByUG4U5f57xS1F9ifsbdwU2cnwUICw'; +moduleBuffer += + 'vDEkwP8qPzu3IsNrsngyWGH+Qn4o6J3DfSjt7RbO6BLwQpwhuFut9S7vcdlZpIOYweItJhXu5cvhKgOOtrZzpGgnPEU7V/S1g1YB'; +moduleBuffer += + 'LqkC4dYMTTMsTykkIm0lk1b2EOo1BpEQph/ALrtDP3K4Xupzf66qiVq99JMM47G8U6uq/M+lKpkqBkRM9YVzHl/lvbxQmFBZ9HJp'; +moduleBuffer += + 'p2Ww4TEiNCi+IcOFY7ZImWbw6k6NjVj2NwcuOrS2GmprEc4VfVUHKBWk5v1IrB+ppZ0JcJ1KHRazSjLl56vWNyqU4ctVGc46+QaY'; +moduleBuffer += + 'QRPYly4wEOBrFJs5ZgAoU2ZRX6wIXmQIMZbeEVOa7pKNTro14c71KAAgGKrRAEevCtvaBar0sa+WwG094khn7FAr/ZtaX/9wqALn'; +moduleBuffer += + 'eA0rkJ/vTh8L3TdV7NHcDH5HgybPKVcrdeaqy+/L0NRHyBFdYHHRXBRltNhUVa3w58eM374OqUuDJZgmEAzCvoiodQT2RNxOg/FF'; +moduleBuffer += + 'PNRoo1wzXqipBkAVYliGC7WZUwQ6NRro1PQFOm3Ok3sMAU2NBjQ1fQFNW/PkzroJcieauxq4tN2fm1jKRcjWSnxSo/FJhxjv9Xow'; +moduleBuffer += + 'XdmQpJbxSRNJ1HijGe9j3LfK+KQ13DfL+KQR7hsuPmmQhbiva3zSL0MNKbtMXRce1Y7U4AELR3jYp4N1ebIBEDIgdJ025Q2DU9UY'; +moduleBuffer += + 'i9LvGsZbYfCCLlEvRfa+VAi/7HJZS5jkxhqGRWH1QlAgroqovrYNoTvuUU4y1E4pfBHqsax51oZqUpZHXSOAJfnO7Q946U/AmkH0'; +moduleBuffer += + '4h2BEYq2VJfJ4MyyHnrEyDp5MljHZgDJ1CE6z7nE+vb+BIchxGTDsKDvwjTi7U9663isZgjpxBz5zWjt3Q3GhhDG3lfNZz33r4Yo'; +moduleBuffer += + 'm0XatNyvaz5llNgpsFBVs0iOjafCUFRs9TVwTqA63wj42gHCzFDs9rDqLTr6I+Tn47yLLBB09Ri2lqfuuAW63PQJYmYAzK7NQ5QM'; +moduleBuffer += + '53xZOJX+a71SSkZXGIR7DTSuXjWQOagkTiGh+3n6fjvSoCSkfFJpcOpKC/hns9SEK+zppZZRfAqdeVMKxl2UYnVoNwS7HQ6+TaBU'; +moduleBuffer += + '9uivC9wpCPu/dn3jkXjRU4Ucah6G8sRcV4Lgb1JYNWGa/0u4WhZT7VpELEq/C9kvX8gZUZvc+gXvSqjACUZHRPt2L6MWMZwCP4IM'; +moduleBuffer += + '090YP9ddCwwnTKv8ce/14MKuyb/17ge83nmedyHFDTNFnu1x76opzTeQw0MIJrDxJ/d/9bw/z+JOjZMnBqxxPPmYB8wU+SxTXY/9'; +moduleBuffer += + '6FGpqm2xzv7qVAfTuHxOoYF8Sm/9aobl6xlFRmaE/PfcS4ss5E2l1zUp58qI/tj4AKgCKpBi1Bc47QAvCpQPyrjXefkozjqBrmbG'; +moduleBuffer += + 'NVwZY5obq/lNcLpHzTfZKu3SaE+5ODOu8MqwnOgaYlYymVht45SWUbvvKvZsoB0cRQM/kRrlxbI15vfc/gA0QsBrV/VPPqoRB7w1'; +moduleBuffer += + '4z09UwDRUUBwvZVuHgFu+xHFbc+vY2VvXGePxNl3yXYxD1DtK3iKIg/0eQdNL+UATM9yCnhP/C6cjfuOF0i10bGmDpTH815UNqpV'; +moduleBuffer += + 'jzWb3zb+6CaLrmkPNNOHgf/ztgi7N/g7cP9f5rnohCI1vhqmLhrBHICOMHghBic3e5i9aOAGcgDDZAg6xDE7XwQ6Qww8/KwUsY4n'; +moduleBuffer += + '+nX8vAJg1PjKDfysBnIwkKpIFl7VGeVRs4+dYapLpiLrLsLPJVevyxZdDXYHYkMzG70689ddreBmCFCy0N5jv6rL/wX2HgOAkN4j'; +moduleBuffer += + '9h77FyKEpfYe0P2yGLNhew8KAjSlIXtP5kP+t+29Uh2IYydPSidt6oQqI2Rm/8T4PnCKiPhHgPbLaAViLvSrR3LBfkR8++OQ2KVo'; +moduleBuffer += + 'JeCyxjntWub3YHcSaewwnCybKQY1bZvcdHyQQj7LtPhibWCsKJdrufwXNz5A7DRJz2pCu6SOPOiQkhN3EPsOYIUQcQ67W8jAia4u'; +moduleBuffer += + 'XyHtT7CSVNNbNigij/NFvnedkI1Fz26wU6ANrcnnY1uF66Zi65upDiM3hjgiYscn8rDjAMAcS4eQCjc8ANDRzTfaGHb5zXKVn5Pv'; +moduleBuffer += + 'dQlfMhqiJC2oM0H9ZD8F5y6Uh9T5OKlzAwRHJplQ3bXcrENHnWEUAuxFoc6eZni90Gr5uUo23ZI4x4OkNwJxrlHtfgribEMJCuMg'; +moduleBuffer += + 'xPlSoUYeiDOljMcYHSR0Rhj6OaQrQIAP2Z53KgLtKYHuK+TNQ6ANg/IVGeYQaL53LqvREmhuee+2h/RHayW1qBg++NYawtoyzPh6'; +moduleBuffer += + '5u4MDmqaJ1KDgx2RhtJR8we/NJHAyRMrxeES5A2/ahoROpMEnA5ZLDUNMohjJF9D4uzRo3eNb4OVSYMMPfg/7rLpeToyKPaYxfUW'; +moduleBuffer += + 'qlDHRY0KVqaAHv4QrAejGUkHfmitLWRIHrNDkk2Vp7vkqqjys9C+Cv9r8YjjtV2GApQOTnUTxN2MyJdiYi92hNyoRDPWS2+iZYoI'; +moduleBuffer += + 'HitcpJyE2wlq5G7EEijoExlxzG5mtixJbKB0N7Ll3S4WWMKmUqsw56EBVLC/Jie330OwRKg3u/W8ffF6xD+5Lt9E3jVvrOmG451a'; +moduleBuffer += + 'LtMokwuW30QQ+HremBoKfc/zyfN5NHIi4rXyv7E2GqiBTS3DGS7UVsqgJexG09lDGWUMbguE1fIdCrQKr4uppk2/GFJFShTrJQXs'; +moduleBuffer += + 'KABJMxFLDK0LFssmr2I1YRqpDHHZREZjxGvyRCGAu8kiq2mdChH+hX6qNmot/UnUXgBrcQEOBNINQPE2SsB8WG+FeU0t7prlc09D'; +moduleBuffer += + 'qxE2ta9XnmshcGDZzrCsrF2PfmracZrO6SvqzoNAWQxznagGuTBIcPDl7n6iDL7F+3MrsbeUq+a4pO+sK8dEhfO5vXzCmsi1esXg'; +moduleBuffer += + 'eRVEb2PN9HSz2wK8Y4fRGjHcTKzGDiFMsZZ5kez5JMaAhe4meaiwfDJT848Jlcp3yR9KON36uMywIKuPExlapvxI5MlGWOOJf2bm'; +moduleBuffer += + 'puYntkoFAw8YhAt3MHPBi9VdoAKU2I0mgzlVLQaOKfWP45DxlprRFYiHk9/4bmxa5zOqx3iPeyGeyvKcwC+AdBkOe6WGFU5h9BAh'; +moduleBuffer += + 'pHG2ynsFUHQRfzyiSgdRMpfDAkzm8Yd9Qilr9/UOEol8QNtziJrCUeV73s0XlOvztbud2EadirC6YGBpVUSM0uXbLRDEqR838TT/'; +moduleBuffer += + '+XWgbFzomyCManFSbzRb7aHhdGTBQm4Tf3fDfuGn0wfqrYW4vQ+3DdwuwO0sblu4HcHtQ7gdwm2K228Vt8Q3PI7bYdwO4fZkUbaN'; +moduleBuffer += + '23e83d22cPv+t7uyxCv/yNtd2QZu9+J2AW7ruP3H4imCFuUP4/YM3Ma4/X5xW6PpTR5aqfXmd8iDiCQ43yzX6dOG4XVtFti23Oay'; +moduleBuffer += + 'tHr5dpuF0cFux4MElSKyTn7XO1zvQbLzB3Dbxi0Oz/Mv4zaV2yZptiydT1uJXm2FlP/2S4siKH6oX1VBiAiwgFInrDoCeMlcf72a'; +moduleBuffer += + 'gGThVRf3AOub/jRW3scir69Wc0aA9S/pEXdYSImu9hDg3J5y7wECEQspbMKk8hrqOAK7uQmX6DhUdHFlj/0suih7lZDe5Twt5Ea0'; +moduleBuffer += + 'vJf+XxGS0yu47cjVWPqOUIMNGdJ4m8Gb9BFBPLJhutQcRxEssQEGnrMQs2eqqCHf+n7AuMde85OyFVtlHnQdKNINr8W2S7GcDXST'; +moduleBuffer += + 'K3d342sBkX3lbsZXDa/cvZGaskA1diF72pXH15JjiK7tBhthdAmdmss2ptnGBrM1+rNlmi0byKZ6t4CQoxu74R+RmoaT2ZY/Um3o'; +moduleBuffer += + 'JDaf4euly/WNNCANAZYu+ZIiX4sCSU3eIaQuEuwOs6RFllHVekiWgPHl3nB91tgozf4RpaGAeRY37zSMn02jOnK+di6QQRbRg3Mi'; +moduleBuffer += + '1CeZT+PzANSMNskIcaVhsMHaRRriOVKz2iTfuK4b9yC2Y8pAw0Gr4BjRX9XKQzbAsXWEM5WsUMXgnBDGG5JKEq7G7jCHrG9QVZV8'; +moduleBuffer += + 'xWvUSJjZ1RwrAlqrBktl7R4OjAIbAMI7RW4Y7gTrGAYc6sEmZTNYOKuBI8W08vjevaMLY93cb/zAhTAOJyrRD7Gtpza4XQYzRaWl'; +moduleBuffer += + 'KmoETcUc9qwdJc6Q85MeOPBhEfOEDZeGvkok3MbacXU98FVKSNdihW7oQIpvWjO2Z6hoxTPWo4fzgOP2Va0z7eeHZYNJfxRaaeCo'; +moduleBuffer += + 'bjesH+f4HiUClSCeV1GcijCWcPOgcXxCxhPhfJSTxXM6Mo/Q4lSoAmXf6sg8zTDdTZyO7HRiWPiMYpgNU+5ZHVlSiGHJ5GPea6Qb'; +moduleBuffer += + 'ya0de6gDqwx2pieJXbB/RcPhKRtQiY5CWV8N4TxCmYb2LTJYocxkKpTZYYCKScYxi5Q3vtuGMtDjqjxUaWNJN0KAOAaa6MAIkRFR'; +moduleBuffer += + 'aGtVU6FEEjuBqstlrV0e2hMxZnTI7lgPaxB/IA/1tPeToYaUSDQeRYyfsA1uJkKUFSF/RZZAszCARYi9KYIriXzSqFlUL+sRSgZf'; +moduleBuffer += + 'FbdxVqdpsLWzqF1gllSDsODlUTskHytcYTsUFnQsv/nm/ThwhcVEvhnXh9673xpX1Av70DT9ed1FLQnxgJJj+imaBENHV5jd4hDA'; +moduleBuffer += + 'mgobuki5bkHM2fo+qT/L97zPRTvxFbDcV3nK18MpDRTq3tQKPqDuScU0+HHj16/DRvEa2KotDa7QKPaXdLhnre5wE1nZ4XkPThBV'; +moduleBuffer += + 'UqWQXdqf8arrTcp/ofwfe/hp2Tz+4eRdm/5897Ugl7LXlcdU2KFwxhypb9dm/Lui64/jQBU1lKWz8NoM6cuRjrAcf74bcnBWk2o3'; +moduleBuffer += + '2oOla7th5VBrI4IwjsNKiD1BzozS6ZW2RIDdr3qwtRGsyjjOfFHCYJujFi1yJWRTk/2ycriFEy+UuMKWkLo1BoItIRtqecK1kVlf'; +moduleBuffer += + '05wN1GnDxl/wNZpi7AJfukCXLh4P0OQjHKAU3HBdoyzAKe1Scj4MsthtwkizxWCSbYRalM0WogNCVobubOHdc0NW1tQIHoEmOxH4'; +moduleBuffer += + 'whqCZJ6uRNS0uWH9sT7/tremErgyixBxMqje34nQKFk7jy6Vbf4Dn/wOok8eOuvPZEuY3Obu/lz9fLKGRvLUQyuZFpON67LW7smT'; +moduleBuffer += + '/vUbyQoUTVdDUEINE186rqGLWi6mCVTqWQy3LBuGslt3gSjrDAGflYEmfZ5hneJl/P6XaRZHLgfspmvlGR4Q+Krugpk74j/l04y4'; +moduleBuffer += + 'Jb/ToT4RFj1Y32FA2nzBhvy4vx5BuHBX25C/cp3UIAlDTGiVCe08VE8uKW5ccXl+dN7i7TzQLVFy+y63PJ9h7tw0O0S6L/Jb1yjP'; +moduleBuffer += + 'HlVMXapqACFwb9GYGx1rp57Rfo2kzy53qlRdzI3ExiqhGiF9s7qVuTMvFEf0FN1EOIIiD/yzHcOtvgvdbJZ5y2UD860uIl+plnDp'; +moduleBuffer += + '0VrLRe3tEw595I9oi+IZX6MQKw3KwfnBDhrCiff7F3i/nyFwAo/m1WkBohd2A6ow6IgB4fdvI8ySIWMCboJqxm4pnNqx+5kLsqQh'; +moduleBuffer += + 'A/ZGZICD9G0BaLktY/rKmLIOKGzSD8CrTiTnKS2GwUofSdyLPrt2UYdrF52Xsk01r5fpOWN881ynZ2VSDD/PKVqpYujZTdNKifbc'; +moduleBuffer += + 'qQoxspycgZ2csET/exutJmgWs8uo/coLNDnvLXX2YGYayhCWavlIGcKQ/rg9yAwVtXxk1fJxyZYlg9xeDfwgjvifkR+0avmo4Acj'; +moduleBuffer += + 'q5aPOl6FHQypQAcHVDTqnZYX9Pp4wfCUCnrLC4b9CnrHC9oRyBvKC1p+Yrf19dqTcG1TBJ8O1lxkVZ/Q6PfH1IAXuVGfXljXkrWw'; +moduleBuffer += + 's3+WNn2qX89nY11exdNdsLBWzXxA37dIlasm33JEGgjTD0Eve4zuHpL2dUkLNG2WwexNvusbZT4EEGEgkaMuDU4cP8fxBEKmGI0h'; +moduleBuffer += + '4tHpSlukgt/XWJHq0pcwTIrNqWFwNffcWCKBDBCG676afzZJYd3Z5tNZqqbnazU9cMLWkx9+XEqrI3r+SghcRmXmwWioRqOh0roN'; +moduleBuffer += + 'AXHM2Wp92A26EWvq+s6fXbd7Onsegok34+foeUhozcAdzkBEdABaxQZqFQt0gBF4CvlAD2DU385CGnfCBaKlvi3EEQDOAHAEgDNA'; +moduleBuffer += + 'HIFAcQRQE3AEUNNZmeIMkOjVe53xTHEGFisRRPg8yJoM3Z10hqyVbROK8rriDDT7cAYQ7wvHMwhCWuAMtIWNGspn5+IM1DW4GPwc'; +moduleBuffer += + 'x+U7LtTLs7PF2QK9dDgDZ2UjmgAMglQvF2VnZsN62WbAWLY2WuIMRMIH2T60YPPaor1pp0kPD+mQNVWp9NThDLQYhO4wHYX56Qoo'; +moduleBuffer += + 'AsNPJ7P/EE68ZAT15Cr9JFW5JcJB8a0rMAY1mW0aCq2v7nr51acXOMNDW3s3Tl8LxwSjLlxx+nG4ImiUoDj9EMQzeDLFPCrjMwwr'; +moduleBuffer += + 'XVm0YFND2YXpHhZsu3M05kUMXTz7EEP2SQ2SiZF3S9gGqXAB6LPfpJcoFAlUvT3lKytRaCtXWq8V6Pzc1RJ3NUnDUG6FNmZ5nqxp'; +moduleBuffer += + 'Q4FBJ9A8pEWlMBC5uQaU6hU99SkM8rFraH8T0FgKdGYD73Dws2F9VRtkDfADVd5yf1HTpkpkHN/aEHuqqDTW1NeUUV49p7Ys7hNV'; +moduleBuffer += + 'cbrwXVRLNu+wIWSX61ko1TFBvw497HpDQQiDXZxqSS9PPHrQy+P0gToUoViqoNEwzIWTBhgZHuaNUkDw85PIbZCbJouGx3z57KMH'; +moduleBuffer += + '1QESZ3kwMXiYhsPqw6mWn7BpsX7zOAY8UofBV+lbCy0v1oJnVbCnrPlzntbMw7qygaJaVYzQqxTljxblTVk+nVtPkOuh37w1Njn0'; +moduleBuffer += + 'mP/DNmiexkDbx8pbcjWkdmCf/xckhJqHKgKqsLueDZjLcKVPfv2g8jHYNdP3Bl7ziDH163z74VpSrEXJmcrhYEB8DlWJHM2RoQ3s'; +moduleBuffer += + 'RZuq262pJjhWvTHOiyMrV5txWEK2+uXq4NoM6WzXytWh6mmdlJwMytURS6QsITmtlJyUJWKUqMrVWmJsoERclqihRFWu1hLZQIma'; +moduleBuffer += + 'k6ubfXI1ssJEtCXk4mO+EFZ8sOZnrGSROdNrcIbYGIJ0Z8hFsQmyRou60WVem5gd5gKGTsaMFdGX00kkzKbKwArF4cCL+g6wUMOQ'; +moduleBuffer += + 'SC3foOWVj7NFrP9zL6bGBmE3SdpHnfS0M2TbbYYua6t6FtI/D3+kKqloDX2spVGZKkj2YH3CKx/H2Hg4DYMdHgblcV/H5/SXZ9iG'; +moduleBuffer += + '53+2Vloqm3yRlGuqUYIWhb+337R8cGbliHBTFVcmsQNZAaK6SO3D5AO8RwMbEx6EqC+SotZEjDmsZ8w+iKhfEFHKOY6M+iSjwkwn'; +moduleBuffer += + 'GxgSOd1AWgUzXOxO8kvbI/wCUeOknp0WjUP8Ah/fhojE+NZc4pCb0ztCNc8O1XGpUFqF9hSbBYe14BBWjlZT66smRDW+zTykmdua'; +moduleBuffer += + 'uZIrkFwOKqZ5UC0JEfIzxbyh9dg0lPdn5+fg3TQuJlyiqCXd8N9EztkgPBh2iWum8j/qNbuWKDorv04Ic9ZrgA6hFngchTCzh+Gh'; +moduleBuffer += + 'GpkpiaLBXp+ZXwaMEdn13QkalwXYtTeto2GCQi34+VnYXzfANMnk51w8fk0n4mFElL9oQx6u6xHUCGUNNJMRABBk4ap9R0iEFzUP'; +moduleBuffer += + 'Vmd86/vP3qgNxlhmbQo5SxMGZHWn+XNeoPn3bX/YLuiGxtjcZ9SIeK9OKozvXsPoi/Ao6tHxDM+XW5wX2G+Oy2ud35OrfOuH7vfS'; +moduleBuffer += + 'I9b9ImvQgiXkhXCVSsdJkJ2L7HIeC2DA0jdzwsMDDnhaQKRoO6WTs53LVMm0xOBwLoC9XKwbjrB5CisjyVPyljwcXoJdZ4lZfLHq'; +moduleBuffer += + 'ImKrgsZCDaGkiHA6SkCUqU5SkemlpTY+QBM/YReKc1oKNmFJ16RRYfPS8a6IQk10xwZCJTtSo1dcHuQ7H5Bx+CG8XgyxoWDGbo0m'; +moduleBuffer += + 'CZ5UQCQFFqeCroXomBlM8Jt08tuLGjWgn/plRDgCMIoGdm4n5GEBGHAIYHdr6xHYnhAZMvyZyI/gwV0Jbsbwh3Z7+TGkfgcwXmEG'; +moduleBuffer += + 'bh2Gi3NHa5l3LiKKO0V+gPQaxN3h9PYmjf3TTzT58yApiQI4eWWJ0JXQT8kTZrroUfGYmw2KTjOVB6+nB0Qogyx1XJO+i/Y8o11z'; +moduleBuffer += + 'qg8Jna6ii9kBOOEGAIeQVyFDoq43Wz5tB0C9rWsWmoiIaukdzLQE6w6WpBhXGY1L2zQdrzNwrMzSdlA1ps0PwIFYj99kL7ETOCmt'; +moduleBuffer += + 'xEbzgJNWBofKMM6TRCjeuyA2A7SK1q46Uch4gs4lynXJi75az99dCVjVUgtG1vkVlL0PeTIVc/mOd+nLwSyX1rhEQjhxl37d6ndB'; +moduleBuffer += + 'EEqwqyLkXNq2RsDSgkxw28gSNeQ9FwdEmFeQZbZgUE/WyMfpxM5ooJBvu7tod4xGvUSB22VnFey/AD1BRwJ8b9S1Dw8fTKojwAZH'; +moduleBuffer += + 'yxFQw+BuM6QT1yWdmi7RhNZG6LqOq1qJ1XTB0OY10ZUY6krc/IB2LsEYJxhjtH/zA+xcbsCNJlxQHPFl3iXKn9LOKQutW1P/HA5P'; +moduleBuffer += + 'sRqCwbk5Z7L6AwlNemFKQw04aQXCPbVA1kN6SchlizHL6emUN3SDbAmLQ/4F/IQQUtKCxjJvVLatBgLmNhjfWkMk7zVd6CGnp32g'; +moduleBuffer += + '/bRoVkGzN7U999Us2icf1coDBS2zyGf2eAIQZsrq2HTdTIjipju/cXbtWeM8b9GFsnF7+XAPfTpTuaXGUjPGXRqVkb0vLAarnlu+'; +moduleBuffer += + 'bj9UMMqPb3cZoefLsfeQb/qIgdu75J38+B0/3X741nf+TYuHUurABbWm2QiNLlym/MmnDnz4Mx/5u/033q+nSqXLFM1okDHQjP7G'; +moduleBuffer += + 'bnBF39MQT0N9ypDxPMnqryECT420rj/5pc/e+NjHj/zkkauvFzGhJn2i/6gU3nzvv+z72sP3/fSeTddDAUZnMTqAIUuiGtWNhOkS'; +moduleBuffer += + 'bl9P3zbyGc08bOtvuL4b8hWygGy7ZvLVS8ugn5l96WijsPgwWfVLwXWuVVhh/RVb6y+vavxkcgsN8tAnDqh4B2kRnNJWBfghwXAI'; +moduleBuffer += + 'Pa2eHo1ibYt4B4I8T1VPPJ+qyJc/KSXzEVhURbh96ycPWAMrWmO9B7djhTXW3+F2vLTGwu3LrDXWPL3avPe598pJr/B3i6o8fOZp'; +moduleBuffer += + 'UOsltLFa5r2OzEXAms51Ik0+A/2HMhWh7mdgm4n0NePlm3++nxuX6nLV0YSSzs14cBcBbPmnxQ7tROp3EhpgqCNlQAALzKP0F7RB'; +moduleBuffer += + 'fUWH1azsEPX2fNjywGsjpkeOa/bgz2yzoOnyZwKwZflDP9PaYR8KTjT9Pohy/sp13IFmPFVyq09oXtvAx4FlOVDr4z8r+jxGc1hm'; +moduleBuffer += + 'XL0Ohg9Pat00A17lvc5x9b+NMT28+cD8Y3oUD+aM6fHNB049pr969mO61TXbN6Y7bO3Pd0z3lH2eM6YzWvfgmN4R6InL4Jie8HAg'; +moduleBuffer += + 'LoO6D8gA845qPNXlGVZcGdWYKEr5sXtPMaon7p1vVLfc50Y1roxqJ1LZo0ZPA0DSqYZ+DHZnVNTnx/9B4SZq8C4nSGkv34Ym4Auu'; +moduleBuffer += + 'XiShs1RUuzSUozLUOjZmFqJj8KtF+tVC/Wr2tXbdO/jVMPD77q18tUS+2uP10361x+vFV2Ots/ee+qsdubf61fb57rN9vGo7Fahw'; +moduleBuffer += + 'tqRrnbCWWNOfTmyuU1Ama/oT0djgcjUZDaMMpgiXKQzt5c5ZIbaITPCEJQ8IqCZDqCaj5kNgSKWi9MNq8T5vWU4GSKjbtspSJtJh'; +moduleBuffer += + 'WE4DKdpJ3OSI8l3IM0N3ITct0m9CjQO1w76tBb5TqN+IrskKSIdhlAH/sGl2kyvUoCEBWFNhF3N2Zn0Lb7Eni8cL3jwT1tApqeFA'; +moduleBuffer += + '4K5FxK5VVNYJmU73cB4NN36WUFd/QuE/ZaV04/SvfFUb7fOVYUSHSlyaI0xYWSaoYc/qqQKnBi7pMI3h1SUAwJE3ATRCsVr8PLPV'; +moduleBuffer += + 'z9J/BR8JzVKfHaIizyqzo+IGzK+7UaNaz+LvcFKp3ulo4WRxLphznwIInPp1STiBuwI9QLuQEKJhTTVVUFJQZCmKmaIAVHQ0yGcO'; +moduleBuffer += + 'P/1Vvcjk99UaKCRGoM4WQR4oxxi4sulTynyq5mEurEBUhQfoy1BFBzAVHjMsfEUHS5iyRFOPxeCXYjWex73T2lI8OzOKQAEYTLoT'; +moduleBuffer += + 'WG9U5a2cWuWtzAgYw3qejfFE0m/EsHqKeIQmPenzANUvLCbmy4jz07t9ZybhV8wkWnMrR63vj4o2CuWebaRiHqHTa4d0UWkWjGYV'; +moduleBuffer += + '/ELWwaTFxDlcXs4Wl/ihYVGe8RibUDohsdB6/8ngyPacv7xtI7djub22G8OYOp7MttzaIc6cxWPC8UpfLdiJe04wdLl4jJ/10kcD'; +moduleBuffer += + 'hXZ03TleXp7o69lr59SLZRxyP+4poQrxu26gHQsJxOzpLYHCHU3Q/KF+XaamfDRaNwMHEoEat4fXdpPqgURdASwaanMeqYV6Te3Z'; +moduleBuffer += + '4wFDv2TQ0M+ooZ9Hk7okq1vVf3hlYehHI7zqgYSa7aUsQet0GvrFZYkaSsw19BsbKFErS0SDhn5aIhso4Y5JssYcQ78lzZ8EprbJ'; +moduleBuffer += + '/98L0SZ9USdJ7/VxpPJSX4+fshL/BHTqJT43Al6lF2jukLkx19M7dTMiduwY3RUhgCPIAiANYe02rpTJYaEspsEKVB16wgD/qfTD'; +moduleBuffer += + '+AR0Lg+t/ECkefBZgfrS43AhUIOBDDgq6Y66WvaE6kTM88cJhiKuqUO1r81AK1pBdAHha8F8sYSvISZ+LX1nQ92d8J5n63tGfE/r'; +moduleBuffer += + '1xal9zWFalH/30L7JXiNUlNqm6+uIr+QHegGxSt5XZ+iUPlK/txX8uxJCiFf+FJ4QBod6APn+qFP/MqTwD7J8MTJWR+db8+KTrtn'; +moduleBuffer += + '1Qb3rKjYsw6auTtWTXcsGjIfNM93vzpofuPdqvacd6ta3271ty/g9p5ON0+3t+Px8xooKfgfvqu/kOP0jDzQ82aA/uO5n08+f0vS'; +moduleBuffer += + 'eW1IlccJB3mc52wPapqukQp35GvPl5PFOqWZaGTNRAnK/luxEb3DFPJ2qGdby7yUJ4lqSPktftxR9ZvAwUXIY7JcAUGQBzCxFprS'; +moduleBuffer += + 'U2/kAg8rsF+UzuGxhlGI12aBDRSynh4dEew57XGav8pLtVxL6Swqi/tUvOpVnqqFeTBXyyvNucPoSl98V2ep/52nLI88tQ/4Sfpa'; +moduleBuffer += + 'bRGpK1R5931m0JOVC+wiK3kCgqxwidKjEdUstHpwfrRmuJ61vvVK61uvz/rW67O+9Qatb71B69ug2VdFkefovFXA+tb0l2i7PM76'; +moduleBuffer += + '1qoice0302styPKo2uP6dFEGWHnhMLr9xWZ0U+g84xs8LNApmt4YQdt/Pn2v5WK5Vfa/CROpgZSV3RYUnQ188FR+qFMpwVsAukg0'; +moduleBuffer += + 'Fg/OzHx8vv4sxw9Maa/pXWBeIS1O9Drt0hLK6EkLj4bCEhzQKFC+BZIPqTfFB+oEFn9a3XyynmW20uORfuVM7Vep6Amo8Z6hHVYt'; +moduleBuffer += + 'vS/SKZT0cuGuAXP6axsMKVKvDl+6huQnG/DuwGlQU2eYnxEqwc/UAwQ6PNjhFe6CS3pUJtmu+/TsBjfq56M9aleyHo+FS0km6cEy'; +moduleBuffer += + '0qymk2GWSO95boiZ6YHzSgBsYa2heZuWt1ma+9r/r9Tg7QDj6LrcXgWIUQveWoPXurWuliUn7+7EBlWkNAtQA5++6nTCIwq1sorh'; +moduleBuffer += + 'RTyONktNC4PXduh/FlJAxpE4Pjx+butMURZN2MFPNQqrrAadjgdmkjBJsOLi9ZJuG4YTnChjFZzDrKWqt1gxaF6uTid3vX0GOvaq'; +moduleBuffer += + 'n5d8+yGVsXBa2k3dtcieI/ba/nQMdh9DGE1Z5oCQLBBu43ynOqUqumjaSz8IPLJ4mbfTZ3wjWH8AQTL3YVLor8+/r+McZ4kI3XnW'; +moduleBuffer += + 'SYJNWRJuYibW3W2lXw77sNKlq03tC5ji7rC7lrx1e60/9Xwsa+Vj+b7PO6U5gPwXZE2r7lGA/oUFbm2Qb5H7YYsAa5Eq5Grapz6r'; +moduleBuffer += + 'C8teeF/W00/D2FakaAfZSxCG7hnuZtYru0hZGoCs6EpPejNre7MgW2TbWZidYa+Gy76h7dW2bex3rYzN1rPR/AhquEIHWxJa6fXo'; +moduleBuffer += + 'DmedngTH+T2+Q5egOBTneysJCRJuKxOyeKnZ6eMykQlhz5dhGwNP9maTh6pbjSLsj2HrDsJNuR+pksxbQaqzuKegv2xgtJelxY1s'; +moduleBuffer += + 'niN6Y8E41BmQBg+K0PzR3fu9fJFU/spefjOub/t750cYAtt08QqjOO2S5XzX61ARbc8t7znlJty9g2OgjaruYWkJ15fVhAXyeSC1'; +moduleBuffer += + '6yMznl3uihiGuGoP8WA4ReEFfQAo+LRJvvPDM56lUlTE1PPt1ZSV8rnym6spN7obRCsIOYakfum+Bo6+8u23zHjptqTLz4dXrX69'; +moduleBuffer += + '0GK/uo/nyLspyLuMrelEuVHrM1r4XTbeaVJy5rekX3YTZG8BgEtClF2gDGerwG/RE/YIhgS2B1hE7IO9abED7q1A1uwrEbJEXihM'; +moduleBuffer += + '/6HBN0RYBftOsSJqFwApsebOyvvEIm7be/Qw1bdF362XHClwim3G4KfFHWx6hDuBUjJnxkQVdXQN1cJTebQhfUtN0mUbWqh8UCtr'; +moduleBuffer += + 'EdlnVKfFCIuNaiQmFujG6f2IpidjG05mN8CudYSjrpav0lR9AuDVIe3Cws4wdaNolkj9EFmG0YHOkLzMcK8zHMDUGGF8miUlK9jR'; +moduleBuffer += + 'APA/mUK6J9SvNVW/luRbH9nvUcVG3RrMImRCJtZBsJl+u7HKy3RlmHL8QrWkTvtWhinnTKjfjVfhMi/rCul9GY5QNMyApx7AhQnw'; +moduleBuffer += + 'Dd/Yb83Twvxl2ApzVWnn9zy8nzylvWK4gBslc/oVgBAFRYSeYGBOBwNzOhiY08p8chk5grq8uHKG7YEatnP1SZ8RRAQbUJBvBq68'; +moduleBuffer += + 'EmoRBv6KgSi2UcC72e82pxQFaLMvYxxcg8M2ubsRd8JWdZo2XEWSNf+TsVENfBRJFFi9ieFvOtUmG5cNSzWRITxWA6JwcOexGECB'; +moduleBuffer += + '3YnsAinuHWaQ23lIvSN7WimcjDxgq4DnyDRkRkIzJo6U1WgCCb0KeQ6k9Crk+RDNr0rI86FiaxvCyhpyCwwhB7sxbRiHsUDqSqFH'; +moduleBuffer += + 'rFUbCRaqWljAjbSU2wEGuqXlLY3/pN5Pwxc7SzLTy7fv3e8IbMYoBNb5Kcq3Dvc/ran586VAg2xL4lRHw/1MSVcjbM6dEULan/TV'; +moduleBuffer += + 'ELEwQzRksxA3pS4/r1wn3Q0uZ9J/7jEoyZkWCh/IFgl7cVWPQO1CQNe0a8o+SvKncG6WaBAKdbvA+NQxV/BFztxyK5EeLlJ0Sn5U'; +moduleBuffer += + 'Moxxejgm4pF2v6YgKZukA37vmnzT1R14BiOai+sHpJg6Jlcr35QHxP5jPhGIpLdlx8/Kmrs7Z5+291FmwyOZfN8+7X/RYSTOaiJx'; +moduleBuffer += + '64NL28Hg2519fXbm27pjtxJJ0ZY7a8ut2fC69fZNxyaHX+M+6KleWN3Z0vwYWiOaq3yxlMBf+M7dIP0IMaHKmUCPFhmGljDhR1yp'; +moduleBuffer += + 'ed/QFF2232mLfU99A9De5rP+KtofduQqqMAlfw/5TDaE0ajlI2vZci33cUo70jdDRf4EUgOmZzCFu6muXF0+rm/i2zltM6Oz6V7g'; +moduleBuffer += + '+U+PWPiD+CKi5qe6PjA+ga6Jbr0YGCFb7LYp60GHmVrvXy8YwxozTumiasoXSPNdxTdADknYViQsSO9oNBlXgcSdy7kBL5BPiRwB'; +moduleBuffer += + 'qeN7DXBBECkGPeKL54o0qw+otjDpexuwB1MksvecM690HFSk4+jU0vGQSsfRoHQcPxvpOH420nFQlY6D+aXj0EqZTjhS6ThOf2Sl'; +moduleBuffer += + '47GL3F4pBLkiHceFdAzR+KgTjT3F/wgpDSPZisaj/aIxoGNrinW1pEc+qRCNM5WGCtE4tv0GQgcsAKR7FI1xKKpelbJZtCga18CC'; +moduleBuffer += + 'J9J1iLgtFY1jFY1jKwvzdri8FfbF1/5TNI5VND6KNdVy/pzxXNG4pmeOynE40TiEaNyyovH0CyMa3/mMonF8OtGYAwT7dLidRmqS'; +moduleBuffer += + 'QtG4lj8+r2jcqojGw89CNI4oGkdV0TiiaBxSwcGvo6Jx1CcaR1Y0DiuicTQoGjOQCeruDpWisQa1KkXjsCLFhxXROCxFY+Ee8iP3'; +moduleBuffer += + 'qzAaDojGoRWN0+IeonFa8A+hmjpAPA1VNA5L0TisisZhVTQOq6JxWIrGQyoaH7v/1KJxWvYNba+2bUM0HipF4xOo4RZfRxuW5+l0'; +moduleBuffer += + 'Q8NLOdk4GpSNo0HZOOqTjaPTy8YwRVLZuKaycTivbNyqysbDzygb1wZl41opG3/cycYB9GOLCw67VsrGgUZNObePw66VsnFtQDYG'; +moduleBuffer += + 'pRuqCMdxIRw/8r4Z58CNbWFIViLvuty0CqktsOYsbLlIOObNS2xfS8M9Gt+kd2M36TPenyNgmzkCNgyChG7eXE2pCNiGchnpg9Dj'; +moduleBuffer += + 'ffj+pYAdFuGdKsJSMCAsBVVhKSgE7Fpu1HcEIFQQsHVrwoSAPYIImSCeQxYk37LfphSwTSlgh1UBOywHrTmf7nZ5VmD6CRdwT4Nv'; +moduleBuffer += + 'KB/RCdiRblCFgK2MdylgRw7W1t2jh6m+LfpuEeVUpFCDryECTuDDtElblB42J2zgoHkE7CYE7AXKUDSxVvsF7Cb2uqgQsGsqYEdV'; +moduleBuffer += + 'ATuaV8CGOhfe9xUBm74jKQXsYahxe520ELBbgwJ2NJ+A3XIC9rbPVAXsVlXAjrKWFbCjAQE7GhCwowEBOyoEbAYq6xewozkC9v5Z'; +moduleBuffer += + 'J2BH/QL2kc84AZtXcJDJD86WAnZUFbCjAQE7GhCwo0r/nquAHQ0K2NGpBOzWlNpwbvZVligEbMa0YaywiAJ2ywrY1jPaCtgtDH/L'; +moduleBuffer += + 'CthRKWBHL6yAHZ1WwOapgqqbhgcE7OEBAXt4QMAudcfDWFnDTsAGG97VMBDpXAE7LATsBYWA3bQCdlNzhgMCdkt1NSpg33zH/nnR'; +moduleBuffer += + 'RWQTb/U/jdUjWWShiJR8ivoEIb5QYYGA/8YCdmwFOPCKlFdlB4WAHfYL2DV2s3Z6AVt61ELQ3iKsuSXW5EOb6Y6EGOT6PvEcibvV'; +moduleBuffer += + 'L3HHhcTd7Je40zkSd6uUuOd/HYvN9ywk7qZK3AOvW5G4m1WJOx2UuHUEWvOPQGtwBOaK4Fo+1pkgIvjrkLecKk4Cb84jgfe/sSle'; +moduleBuffer += + 'ITyVBN7q/2z1+Ttdn++zaf/YM4jkIUXyHTg2H1b1lIjk6ErsRPLqnH4mkVxXQdEVFcll0retSF67iPqF9OJivANdRd16Je68dtuU'; +moduleBuffer += + '9Wylg/sOfPm+FYZBjZnxFCJ5PCiSD1EkH7LHilWZ/M7nJ5NHc2XyO63DwYyLWkp+34rk8vm2+zBuU8Fsmy9cUiFPkeXZ4WtYcxXH'; +moduleBuffer += + 'abLiTJ+/Y2CAss2nK+FXbaRekV72u0l2hoaC03srHylwRJACmwuCRZDPfgg+Ly5iJpjAiKbo/jLvVTJx3yLim8VK2uX3VB7W1GXe'; +moduleBuffer += + 'agjXy7xZBfs4xFitcMywgD8hcPWnYFV/9bqrV3k3gvV8hC8fp4eNYs6+apUnXKll5OV17jFqTiOv/ojPMecOjwC7j3gWld1TS5/8'; +moduleBuffer += + 'Xe+YAfz1nnrxbdS8x7dSrLHhw03+NQ+VbJdKYHRj7XT89HBQlCx8+ox8KQtN7eBO+hxFELeT3jeH/bnuNzkkoyn4oV42j/vNtJ8f'; +moduleBuffer += + 'v31mfkeR6U/MzOMoshWpA+43WVHZHldZ4Z4BK4WZ22cGnGqIY8kgYMC15sCc9NRbQw1FCm+NeIPkrvjYSCOHb5+Zx1tjehPdNY5q'; +moduleBuffer += + 'W9Zd47CfadDu5jY7eKVwsZhWijYmYWaDG8GC1CE2RFS9pHttBn/gscb1Q4wDDNvuzN+tvENiY0IbXRNvZnEPqhaj8h/daUMbok/q'; +moduleBuffer += + '1VoHQvRNzB+iL5ybwe8EFRsyC35h5uQrDYCI/VA40Z56ZO487chkvSLD/6wjc+cpFtxpvN2cr9v8y02Iw5HbT+FBeOz2+TwIT9w+'; +moduleBuffer += + '14Ow9GHb5irrW267bp/jFzh3uT1rj7Z9Zb/m+EbN3j7oJbj8tzVuB285hT/bQ7fM58/2+C1zvQTLcdt8y6AXGcbt5lvm+P79BuO2'; +moduleBuffer += + '85ZT+5TtvWXQE5DjtncQvgeoM33IPYlF7qlzxUQ2wBgUiAVyT2s+5B7HuS/zGnlXd3KUO6eX7zwqn/BvsJerpeT3AdCsYFEYfV9t'; +moduleBuffer += + 'Ir/mV8PYKHSEruKMSWPpd4juQ9BpNRYjZg030Poqz1ezc0/9Xgi019TV3ko/NbfDtFYcKOk3y0yBDSGa/UeN2sH/z4/aow0zZA9m'; +moduleBuffer += + 'Aj2YQRj2qzQ0L6ODyq3iwmW1NRrYgnAsCNausNge9b5/StI8GWhAZmvArJ8jdOp/LB9hxITX3ee/Pk/yPT7OQkJsNC0LpoK6Si1R'; +moduleBuffer += + 'jVGZNX8XYingF+jOw7MKAqICFTzRyr4CDmGpCTsjON9T1ZFcjVh1EmEe6b2YqPein8XErIJwX1fKgXquQjDzpGxYXhgKB4iKewCw'; +moduleBuffer += + 'Kr94edwhp+KDaiADOqRYsAe0lnZJqFqFSWBoZfhQZfiGRgZtONsV8OIM465Rp9vYiSC0IrA6zEfbcCKBfUl3KGdAxlDD/w2h252a'; +moduleBuffer += + 'g/CTT+XcUeoEMBxyrxVq9BBImUB9CfgOIsF1YJ4CSzc9IJIcRAdLkI1EWF5uCjoarQjD9PqsdSlmYq1D8+y6oq7XMQgtVbbUIYh8'; +moduleBuffer += + 'pN72Oaw9Vca1FPWvrqMUqAVS3IF2B4dVh0NnVnX4e/th0i4DDhtsfYVuCyYKoX3LIVWeyeDk08f2M+bniCqQdkjSiX/VpAWaJBx3'; +moduleBuffer += + 'ftwmLdSkY/Z2dEWwFecDsyJG2AoQYMwWlG+daYFMMu7xNfgsomVQAK2rv9lMoOfa8p7pjaD9xyl01NLt9jgAkU5wgiIixpXWVj+m'; +moduleBuffer += + 'JcUeAwND9UrX95Vy9fSzMDmgqTpdnIbTN8M/pqY5zobqkJo0Diw/QMx+HKa5okz/9Baj3ZGihyLbdk0uoTzRr24FU0zkqU7dfhgb'; +moduleBuffer += + 'Bd4209R1GQEi0x5XM4bJDDRaGq2VkGLsRfqxJkHJiMXCbMuRC3Aqkz5iD8ui2IUTL6HH7SVml68nptJeGztmG7Vow7b53FPHZgvN'; +moduleBuffer += + 'dgHPBCkFYclo+QYSuiGxWeTPYBUa6VG+shAFT62KtjqUZH7rNJ2FKJ0Lpcw3f+CAFcAha8sfPQbSWdUAQsptPuZTqt68IxqqawGI'; +moduleBuffer += + 'iyV9WPVSIaXsoJ/ATseOwM6aPgI7a+YlsLPmNyCwswYEdsY8WwIr+Z+JwEplLwiBnTFVAouGKwR2xiiBxcvj7oUmsEfD+QnsPvNM'; +moduleBuffer += + 'BHbGnJ7A2teaQ2DxDs+JwLIiDNNzI7Bo59kQ2OnEEdij3xcCS2RZS2Cl5XkJrAzOIIEVojVIYHeZ0xHYHaBGR0xBYA+bgsDKt64Q'; +moduleBuffer += + '2BkzP4E9GimBlfdUAjsdVAjsjkAJLOFySWB3GEdgQZoLAsv3JYE9lBBYtySw25TAWqzdgsBiYCsE9qjpI7Dy1BFYtO0IrH71gsDK'; +moduleBuffer += + 'vj5IYG0zBYGdTk5LYNmLZ0Ng95mCwO4zgwRWatGGbfPzEtijoV05Wr6BhJLADlYxD4G1DwoC+4+nJrAHzQCBvcc8CwL7jySw0zEI'; +moduleBuffer += + '7NufH9b/c0L3B+uu4Ssczv/pkP1dbrPeYfxX/IrcQ399M6uGobBH/0H6/vlR+79Ya/Zh9YORV1ubCmr/MSsDHS5Uulv7VLo3V1S6'; +moduleBuffer += + 'W+eqdLdZ/GLrZxwqRTVWn7tV9blfnEefOzSgz52u6HPfJVsarCeEUG99UAjOQ06hC4OQ0Cl0r0xvQuUPsbthekekStgrV3lvImCo'; +moduleBuffer += + 'VcIeKpWwD1WUsEdk03/yuStht1ol7JephL352SlhDxvrPfhCK2H33TTjpT+YR7Uxe9N8GtgjN51SA3vinbamPr3GlpteUPXrtptO'; +moduleBuffer += + 'o37dddP86tffwrA9uf8Uw7b5wHzDdvOBUw7b3v3zDdvB/S/osD20/zTD9vj++YdtzwutSdt3n6zVE/PNtfvmUz8eue+U6scT99qa'; +moduleBuffer += + '+ufafS+k7nHbfafWPe66b17d4ws+Yjd/8MD8I7bzg/MpHvd+8JSKx4e2H5hnxB7f/kJqHZ/cfmqt4+YPzqt1POm70M6K9AUHSuDF'; +moduleBuffer += + 'MnJYr2subROPvIejSgzUut0iEwCKOcrfnKwdR5/XjHcTCzSe+9cIP4ay9bXjxIlN8Lv7um4DZjVSV+PWbl33H6kMldfgQ0bD7Ogq'; +moduleBuffer += + 'WGeqeSxMMMOIpnBjaigZMgzcaC/dwljBiY0fTNjMzDrQQ8dlQ74xzjDi/wozx2yI0qvgvjRV9iz2GNAGYhu1FAD0DP0J9JNAUSuN'; +moduleBuffer += + '2u8liC5qFJHSTD79qV+c/Pj0d//lQY8h3krgSZs77cv91j3/4/PTb/7Z9j9ELNS5mcf6Ms/+8t8OfeJ73/3ZT6XqxOXuxjaCKI7E'; +moduleBuffer += + 'N3ZVGARSZaUn13dr6LYBCCWz0JW8bBxliYkZMmypBl5lxpQZy4avzxIg+igGPYKbblwRjDX3mUpU6YA4r7CArkaVZpRpC7uwGMGB'; +moduleBuffer += + 'CNEd29AqYRFf2uDaBnu+yMEGK6o5M92FTH4lU5slFndIVBkR2kl8CLXiIkJjYWtEaD5lRGiYzXUYQx5m4vTtZ0TogP5OiAgNLDOZ'; +moduleBuffer += + 'digMLMnlmEY4jTI27DPtmYqwz0EZ9lmtu7PQ5QS6WxEHOlJIGfrOyxILrnNK6roFsZZquZoB8qe2JbS2DrNY5iHDAfC3pmau+BYR'; +moduleBuffer += + 'gUXpguSr+WmiJhEAmlMrnyugSEC44ADRXZlLJrY8npTeTfq0TUwQ7L5sqKbmTgnyalUE1rFNhVe4aKd1Rf6rK/JfPT/8zv3UeNcV'; +moduleBuffer += + '+Q9yaX7oPfsV+U+aC5vOtCls3vRbDAwcnSIwcOyyxZX4wV0XibfbsMF/LRJs0LeQEsT9hYajUUGCDapLqe6WUsIIwIr4GupSCvqW'; +moduleBuffer += + 'UrxRxrNexAnmUvqoDRN13FgkJPmWu6BfrZGayycgkELCkH6yDYBTT5BiVAHf9dIbGtLOLryMv8I8bnSnO2oy6395FDFxoHLye+mx'; +moduleBuffer += + 'SE0lVD8BG3na5S253IY4hzQxoRscgiHdE1stEHYBoi9xy8TGF1kLpRXBUZjm1C9vh4Ql1/bC/PAvuSlzLlKymPXTv9fNtGu7Lh2x'; +moduleBuffer += + 'xhjGXnZ8a6103GhcnhBKJ9QEPPX/WYdq+5YDL9BQ3YiaMFR3BioF7iikQHU46JrJu9/+no/9+Nav/2R0RfAa2WOO7fjh+56+4R7c'; +moduleBuffer += + 'XiG3O3fsePIzP/7Ht92yiXiHk7c99YPNj934loOHaZRvJh/+3Ptu/uRnZ3/xu4hSaibvf8fDn5y95ydvu2ET7ZEnv/yunz369W88'; +moduleBuffer += + '+t6hFQHAECc/eOLuO7972/u+tIxaczN560cffPDXW7d8+09XBLtw/+Nf3/21t336bzaftyLYgfunnvqnh95z5Ofv+K8rgm24/9qH'; +moduleBuffer += + 'bnz4I09+919/5VE/L1vivTc88ZlHH/9ec0WwBfd3ffOnj/3ynx6850U0/DeT256amf3So5/9ynukQ2+S+0/8cMvXt3zg3TevXBG8'; +moduleBuffer += + 'QW6vv/5tdx65dctnD3gAcTSTX7rjJ3/3tXd85f1/BPtzQ4U9EWV66WbMgxkVnQs0vUCjmCGLCI7IE2R9EWCJOWcNxVzO42VOBD9z'; +moduleBuffer += + 'OXG8EJRGd9RCNT9WwPLZOE5gpZRFWqPwKi1qDyYQgFltQhX0WkGRYQmuvFdpLQ63kKr9vTW3X0I7i/yeoweRZ0kvfT+7Af6RNbj4'; +moduleBuffer += + '8bJ5R6BlPs8qlbWK1G0H22nkULednwTHS37KaN/4KaP5Ci8h3chbeYigvlDfCwfZSn/c0OC91gdCW7NVePnj32N4IZXA1fafVlCO'; +moduleBuffer += + 'XbWAuVz+suOaTcIxSHMJnGcY+qnKhORV9uMO+ZNF47kBFzteZTPUSsxt6Nj2okrhOwd5F+T/TfiS+PR8SdzHl+T+IGciLzo/a9JU'; +moduleBuffer += + 'HCGlV55lQzKv+T908Jxzh6qEhkzo+YiPpSHX85dPDQVCScDb8Faj1zAGu8kba2kr2g06NtyDKrYSKKwtFiNLwdcur1+KsVMlqqtB'; +moduleBuffer += + 'SFbjKj3osNp96ghZkjFVXPGoLC4Z0Ey4e7JxXZfYkmRzbJcYVj3K4lu7NTpVXa4B4oFm747Ih5uZA93iuXjzrgRAhQ4JU53kDnmq'; +moduleBuffer += + 'Mrs+gjPNFZ26g4dYYl7tTJtqWR00ECShyKYZAoZt0AyrNTxdDasQ/jXpFumWnvPXODEVfixQ7ECZx8kEWDCLxDNduHAd8tQSa3OE'; +moduleBuffer += + '6VL2KESDsUM8Y4+Am1Vk0wyR9ijUHtFWN0SPQtujED3S6OCojBB7mOyb+AnAgOInvhhjKzJcZAGrevnLaOmbvyzdG4PlDdS+iuGA'; +moduleBuffer += + 'QrVVqCYENjQSPcEsbFYgfYJKk3KYCsmnyhFZrV2QR8hR7+XnOagwctisoghpnyXLvLRAhkM8iQIZzgbSKNw5dYfEEMc09OtG6S7C'; +moduleBuffer += + 'IZTjbDCMvjVq03EWvrnMVmTAOBsdZ6M20St7JFgYZ1p4qGmbG2ceYBaRTRQxAt8BI+qX4+cPDqhfHVAz33D51QE9dQ43oKY6oH51'; +moduleBuffer += + 'QE11QH0dSlPpvbOqI5ykWt85MzvbSQ8NJPmIa4Bqh3lg7zRdTVUGS/hawrBLCclYX1tB0VYLS618XU9ftwx0deocQRHnIkKOetm6'; +moduleBuffer += + 'hb1Uq8CahYj9mQhzm4JSX1IKcrIJkYxpcPGYp7cbIcPzt46NOM4SEeSI8bqRLuz0eLGCXInmAL+7KxDQpirKRSrKhSJbJSLKQWSM'; +moduleBuffer += + 'KFYXTdX1XC2ZIoooKuNpq21MZMA/I2lUvQcDYPaDue/66/1zwNy3b7ci3bdfQDsrr2KQWdhZ+VqLtbWyllZ71dLqOZhZ+dbMSjZp'; +moduleBuffer += + 'GIFfxIBAzoEX3zLNLDaen0fYJ8l2+Gjs0I+ksXfpqU9SMFuhWodad0wN7NVWM6yms8OqvlBgA8+1SubFAq/aOeui6TkYyBJWVabX'; +moduleBuffer += + '515mXr7JWP4G55gEvmKYmfQeeLWPElQrq8mdEilhJ3mSI8wl7AjgyZmf+PZ+Lz8/3V1zngBB+r1GlljvgXjApTyGC3kCFy8LtbW4'; +moduleBuffer += + '78ko2PzYwYPYsAAzkdul9kQ2bPGPESz5eEBmci83ln1R+kvqhLq+RjlB4vFA47aFOHlBecpDJ4Jed8SawXhVSw7ZWaUFdN9hduHj'; +moduleBuffer += + 'FOf+iju01c/U965Ip0NcsAuilHSpUwfVDx1UnIhPXTBo1iIkUiulTEHAGuplSAsCkMldkhmhxjoLcbaadEbzXR84QK5zEeTSIfru'; +moduleBuffer += + '4Vw/fbBRxObLj9eFl0//GXC2r4K3j/wd4t9h/j2Df8/k3zHNLldnFVdnF1fjxdXi4upFxdWLi6tziqusuOoUV93i6neKq4ni6iXF'; +moduleBuffer += + '1UuLq5cVV0uKq6XF1e8WVy8vrs4trpYVV79XXJ1XXC0vrn4/89z1Ku9RmazZ76/y/gW/y1d538Dveau8R/D7e6u8r+N32Srva/g9'; +moduleBuffer += + 'd5X3z/h9+SrvCH5/d5X3VfwuXeV9Bb9LVnkP4/dlq7yH8PvSVd6D+H3JKu/L+J1Y5X0Jv7+zyjuM3+4q74v47azyvoBf4cA/j99z'; +moduleBuffer += + 'VnmH8PviVd7n8PuiVd5n8bt4lfdP+B1f5c3i9+xV3mfwe9Yq7x/xO7bKewC/Z67yDuL3jFXe/fgdXuUdwO/QKm8/fmurvJkaR2Gm'; +moduleBuffer += + 'hnDqv35KSNBjwlOm30JQuzRrpk+BtwCcgpUhJ+DlbtK3I9lLb2uy9EHhY4YvMIe0rq0N4fvZ7tAFhv2T/VLaGZZ6b4v13K07xMYg'; +moduleBuffer += + 'Kl2CP69OH0aNrcJMKj9SQ9zzY57zaJRiTDlaSZllypEyJfOWBlesCPBScCLs4qC8BqM2ky3MRrNF6V4w4fCYKlqCL9yewDY6bdTJ'; +moduleBuffer += + 'zU+/BOfmo790xoB4uKMNVc2QVqfvnu8Z6gGLLP2RYbjJ4MiQdKK5e0VweAhC5BDUKdLzoV56D8I4YUT/tZ5neOUnhoiPll02br3b'; +moduleBuffer += + 'ajxz56co6t/RRJuS+9iQlkn/QkdY+1N2bguTZod6Sz07ONNMmamknKgjZV+ZIsPl7RlaERyvZ4kuBSHjtkLpO8gePy4od0BLgMfl'; +moduleBuffer += + '42s38dyaB0jfjA1055E7R/DMJ4bUow6OzPmHfy0DmaUy6RIHoLGHUc/1lFvomKJxCEN61AinV1gIRDTiJFleah43nT/AmPuwyfEK'; +moduleBuffer += + 'w0XOFoNXG6tMFiaklbnChKRvqng0/KnTNFFJv1nl3QNq/gcrzF7u+xZAcp+Pgt0/UIOhaGmwx+/+YeHf+wfqPv+HNIZpY9ga+FPH'; +moduleBuffer += + 'xN+Ds6rp0MaZ2RGVqpUFCrkQWIzF4wF3knb++cdksM7A9tlIr68rx41twNPdRNap/UhS35HA1kdAaa94gr3EBa7UXYecS1RqTiIi'; +moduleBuffer += + 'v5fWZLBjasn+o4lAb6HFGvZ/YK3+bVPPNel5L7Pzq8KfdDxqKiV9jXq3KmPRxEBL8570/2ADsUp9GiARJaWtyCxgHbpe26MxGe1L'; +moduleBuffer += + 'e+mPa0xpqKVo+vGQtzXAZGhNHsOFe87KDE2rNZvzP0+cf3kJ3ZKUgC1JRo1OJJ9G0Zn0k2z13RBC+NkX9XSrh0rK7ubBUsm0ItgD'; +moduleBuffer += + '9WxIJRHwptPtyF9wBzt4kWvUTnAaTwpn9QSYEpiohevz/xuf9Tx81jB/Iuil34wV7AQuGaZsDraS5jaDqbbVVy5TtVqYkwTV12gS'; +moduleBuffer += + 'tmG8jdAfXaCBOr/LpIvyvd+U5l6uPcx34ubxxxxgh4/5tstofS1a0ho7ZmqPBZF2JrKBD18Ihm264Rg2ITJUSyrDtiMmw/YktQYn'; +moduleBuffer += + '6ukv5jBsO2LHsO1ULT81CbtiMGxqVudVLcOEYcOOzk+CRTMvw7bDzM+wzUIxJF0iw7Yndktna6QMm7Uwi9TqkQlzGbbZcJBh215h'; +moduleBuffer += + '2LaOlAzbQxWGbbpZMGwXkWG7iAzbRWTYLiLDdhEZtovIsEl2uTqruDq7uBovrhYXVy8qrl5cXJ1TXGXFVae46hZXv1NcTRRXLymu'; +moduleBuffer += + 'Xlpcvay4WlJcLS2ufre4enlxdW5xtay4+r3i6rzianlxpQwbr1d5P4qVYfthrAzbD2Jl2J6IlWH7fqwM2/diZdi+GyvDdixWhu1f'; +moduleBuffer += + 'Y2XYvhMrw/btWBm2x2Nl2B6LlWH7VqwM2zdjZdiOxsqwPRorw/YvsTJs34iVYXskVobt67EybF+LlWH751gZtiOxMmxfjZVh+0qs'; +moduleBuffer += + 'DNvDsTJsD8XKsD0YK8P25VgZti/FyrAdjjkKh2NsBN94xwHLsD3mGLZfz8+wvWM+hu0RrUuYjAsM2xWGjf2TfUvaGWDY0Nhchs2Z'; +moduleBuffer += + 'XebH4kGG7Wg8yLAdiedn2PBSFYbtUMmw3R0VDJttqY9h2xo4hu0rsFHZs+WAV/YIzBkYtkMVhu1wqgzbccuwnUgtw3Yc1p+bR5Rh'; +moduleBuffer += + 'O57Ow7DdODI/w4ZPUdQ/07YM25YRLZP+r255a4/K7u1rc8DSkkHbw5SjlZRdTDmS9rFsh1MhYW2CIxx2lUnP52HXNo84dg3PLbsm'; +moduleBuffer += + 'PZvLrt04UmHX3nzjgUF2DQbSBbu2daRg16ajQXZtxlh2bXNEdg2OEmBNivc+EZINNeW0OM6UPZWUY0zZZfomyg6zIjiqhji2EfBr'; +moduleBuffer += + 'h4zyawdNhV+bNQP82ox5lvzaDB1YYsscHK2fkl/bEXMjmZ9fwy7g6WYiy9R+JalvS9zPr7kn2Ep+E37tsD/Ar+1q2hAmjmH7lKkw'; +moduleBuffer += + 'bEe9Z8WxMdCH1HnYn4dlkx5XWTZYyBcs2yHzW2XZdpgqywaxhpt9P8uG2XK8XrBswmJYlq3gD47WB1i2nfEFZjvYMvl8gyzb9tiy'; +moduleBuffer += + 'bLvIhjwUDrBsh0LMth3mNCybbXguy7ZT5t3xesmyQRCbj2WbDSss2+FwDssmIt8EgT14WPkD3w82ZepVY+MhQH0Y5We9UcZy6I1X'; +moduleBuffer += + 'w0xgw9W9np7C1PLhN8qna0t6LW9IeremYFDwrdEgSThCkMIxC8dlYU8qHUalbVbKwjY0CT1yYrXP81HYZ2HfFp7TqFVbEmdIzxpl'; +moduleBuffer += + 'lUsxj8U8FsvmtIb3f6hqSqjGGj5ioBgc5MksTD9e95p5Yk3EYCroq0/tpTQVzNVUkCd8iCVZFIE6/FZ5QZjmxZfRNSkMN2WMvI0D'; +moduleBuffer += + 'Uk/tBXPf2QsqypX8jPbSBwOFPkeAErXRYKSfFJaVtcxnA5ru67Zb4KkEqpG92/jJJrvAracBP2JoY3pCU/2EBdFdqcg+O+n0qO5d'; +moduleBuffer += + 'tKd/XcbgZ3+RxTwgsgAFtLiHyQOAQHgw5YLAqmZ7jzG0Qmm5oz70O72ZQW1CZsrPVwQDe8JLeBYcfymOC6ETqBpGPPr8cYTGSx8h'; +moduleBuffer += + 'usL5HZ5yL++wMuwyFguBiHmg7xZDAaeSPg8quhE90apaa4rzQliYl4Rs0qywEAr+f+zYbf1/w9it/E3G7oRv/E2t60pjZljPdWjd'; +moduleBuffer += + 'hnNb+VnSaTLuIMAHlwZZh1EIs06bBnAdBiMcgxCzNEAcI9jQ0eJAre1oe7exO6y7aQh7NhwXDcN4NIHFG8CSYxjO0XANpm6lkVsg'; +moduleBuffer += + 'G84QDOAky5/jWXylfTZGv8E2wr5HMJ9zZm8wKMnglZa1NuKU/EraM6pB3BIMSXqkMHt/hw3RlDqDZGGR1gk9mJ4+6KldLzhNf4Pw'; +moduleBuffer += + 'O/mbXRqkVZxzg3C8RRPh7q7Rlmp6iCIfQz7QMmG7ovS9oUaBiZn74raadyFo0+XgDJZ5LRnBhMC2KBDPUyBgNrgmXUNfnig3PR69'; +moduleBuffer += + 'ESgebjqcIsAPNPlT9x8owLB9TKkbD7oEmidHjErZZ57MAEM/9nUJ2ektk2qqE1lXQhHv1xRnsaoogLFnVgN0HbFWEphUBOojivnY'; +moduleBuffer += + 'racfZWTTlp6Sq/1awy4SROmK7ElokLfnnNw2LnARzRoaLMorjpttYFLrQyPDtpIOnTA5qLjVofO+srm67IabDrkaULadiM9O+n59'; +moduleBuffer += + 'Ux/qMsPA+wW4Mg7tDGi/j5PKUc2Q6c8lPKljUDGh/t/Gax+2YYGX22WZ9NIPMjTFepgyQRhiRCGFFRe69Bq6pdZgELPEvKkb8mw2'; +moduleBuffer += + 'WtulR2KiyVd2EOWMjrxSM45pe3mC4ME8Zc1iINnZ4FhXAhm2Y8Op0QLGn9LvpWGSDxemZBYUuXlD4DcqXgxGN+/aef5NRgloPd8k'; +moduleBuffer += + 'G7x/IRIYBaehTrjwOWxd1QVWZkW3AusGjDPgtVpZCFDVOYoXrOnExlgKiHpIcgbDSulW8zKF/dFo3omdbZKeH7x+Rq0PcQpNJ9qe'; +moduleBuffer += + 'wj46pwgs0p8/dr+XL8l3PH6/l363xsDgsrFcZa3gAOZvymYCu/tmptLMQ0UzYdbqFWGoiaONFm6U59LCXmRjC6ZsQagNB8oDA0dO'; +moduleBuffer += + 'nqS34SzNFEmSwdJGK2GclBa9sz8WoZ5Up78SQWWt9cXo2lCDEWMie6eKuxw6A6H+fPMFHwyfIfhgXw2IQjhvkEG/xDQqzp9byuIk'; +moduleBuffer += + 'xeOCcpwy5KBaP7iQgz/31Rx3urAxTUlY85nPH/BgODTjd+P0CxCMoUwIcqLhAS1UcU9gkpof+6JQvp/YQKrcSxPd9WAKDquZyxn4'; +moduleBuffer += + 'fHl+4ovOm0a+hlSUbzlclAy1JLwgkqLAtsOugFnmvSGXdTiVz3jr1qu35RuEin+lrsab6S+TdelddZqk2bz+VJ6tYzavaqRJJ8Tm'; +moduleBuffer += + 'ZutuWkCBQzym+QPemvAt8muNpAxs/TylQO+udTxGRMTzmojq37DH9efS6z8/YzAv7Qc82BvCem8Uwptiu5RpVsJB86qllapbXdPm'; +moduleBuffer += + 'F2grrLtcDUlbawgaM9CKrqpFfWlNxO27iF1Ke+nfhTbyXdIhWDttH7zmY74agSwvY7hPWovTseIqrQZm16hvndBif0lNa4QWB+tp'; +moduleBuffer += + 'K2LNTvMxWLlMPx2sy5NrEAws2cA7kLYN69czwC23MBEJMXAINvfU5xxaeThFsD/gV1uS6sKqewrWm/WqodiNPaPyLBkw9ojK8zIb'; +moduleBuffer += + '0fYRX9iPTEMgKhEzKrWdDZFnEUWe+I2QnUiLY5WREklel8VXcx+U6VkIbzpNNdXr1tUQzFy9DhZj666WF3jxG+XPwjfisoFqu3bl'; +moduleBuffer += + '1jM1L+8JGwJuKrl63dWQ186GvLaI8hq60Q16dkWjJp81+agp42bDhkKUDCikbX7uBO1ZUbPfkJT9O9OxHZGyGGpko4Pgwlnmm3iS'; +moduleBuffer += + 'AsknscB4oV3yXSCrd8ix7TVwfwqsheg+A6CLrKH7ZJ1jg9AQsM+CyW4t/QUl6sW0RyRwA09RMrv1UwGC6Ym9sb5GpNu5xejaMFAs'; +moduleBuffer += + 'bBats09RFhGv6EOy036hpiFM6woF0JD/0sOpLk1zRruIBdiCYSe4B1DYGRQ6UtOgVYyMCw3XYaR+BzOQDYCDFi51r8IKJ4pNkXCQ'; +moduleBuffer += + 'EXcMSZHqWgiih3gRoziGQkcC/LTc3PHVzl1NlH0EaFbpS2OlXkYdVciZpyopBCy1Lcmdx8/JakOt1kaVLiaGWm3hux80boK4CQYz'; +moduleBuffer += + 'qlNEd1bqpnDcvoZQ3X7TA9QFepP+CpJMLz+vt5vc6OFzNjNGOg/DwaQSrXvbX9+vRnMZzQ7jasDYau90VvaNRKE7Ohj5USkEqUWx'; +moduleBuffer += + 'l34iMpsgdWDDMfP+x9NIpssPvamhJPZFevDrDepQovxbkhZFkkYeLO9iIkb5eWso/Dwie4UBm2gN19BiuqfWYnyNbvponHutOq4f'; +moduleBuffer += + '8fSGCATn6XWM60Sva7hu6XWE64ZeE32srdcI3JrX9RrRBVzEdJXgyckiyPU7A7vBBef58DKMLsJVDUE+TshuMb0vuHi9IqeNotMy'; +moduleBuffer += + 'E9DjwJoUcr+ZnhX2+uRJ5D4RrIXUptWH6a8iCEJhO8QP3h/GrdRCJl39Gkk2T75/89SsWqZUkeWdgfYw1O4Jf7R6qmj0coRlUsqC'; +moduleBuffer += + 'JJnS35YJWfjy2J4Hdrij5tzMsnvKxb0GD8uGg/zM/qLh3KI67PpS9pXmFKN1frWE0WiBSk6L8cNYHnZj2bimB1SNni2ijkt6WA0h'; +moduleBuffer += + 'uemk17stw1BGTczKOCgaUpYkVESHNVRUG7WhpnI8C6dyQ8nqkNdTSdWAVzAlr2AKXsFYXsGzvADELJjTBpHKv4ZO05DlV3l66ELd'; +moduleBuffer += + 'u2Kz2I65oNKK//kr/7ntlM+8Tf4me+S/8wb5IHS5QUWXS2+7WsbQz/QneCsQOegCQq7xXPgM5N4lHBoEHdg9edK7fhI7wUlvXfre'; +moduleBuffer += + 'yLlqWMeNMI8Zb4Lg+5txmC/CWRZvduDlWXSbMEv1yVf+j7IGj59SS1hfS9zECi6rb7eIb53PHjzgleA2VpX7EzsbC1VhotHIKQ13'; +moduleBuffer += + 'He5JEakTikSVMcP0hsDqE4vPBb8fK1R6aknur/JGleJH5VmKZ0NYhno1scKMaR4MaOHsxFhURZAW4BXwGxX3cPLKX1EI7UXbS0xG'; +moduleBuffer += + 'v6L0O42m2074RVOrYME7P/tZ/AxT+HnP33/nybvfSqlHA2vzgqVP1zyCuccqAsKqWhMBKRWpq57MOZu4g6emUOftkceN9N8wZ2HU'; +moduleBuffer += + 'FmWN9GM4LBBWKf0BOCOAwsuFVCGy6A8glMwQYkaKoy6kh+kPEz2Khz8NbiKcduKxugUilUWPBlb7a9QOPJ3SQPV9mzxiknd5IpSu'; +moduleBuffer += + 'tT6CwpnRbyf/Pd3WH/DWyN9ve2vWt3WRmkm/U9MtxCfD56VPkLv02kYP4FzynZoM3aE6plxQADHJdiJrOgAigfdfwtWTBnBX6uIV'; +moduleBuffer += + '3H0veSL+27TZoi8PloceDBpsDWevrtU1HgOHumU88memo8h5x+Op7kL5fAvzbVGvM2RTdOU+ZXqdYYunyMNYxAdpKfO2YEIj2pJ9'; +moduleBuffer += + 'Xz5lzeizHsD36Fgwfd/9Xt5Mf6weCyRLweq8Rp3XJhwMk0aFTrT2us28Ae672fZ1/CpVtInQQcoW2j1dKRyOBjiLa5zFeQPccQ1u'; +moduleBuffer += + 'S8XHRDTsTJiZBqHaQGB98LITIi43lWleIt+zuTbclHtAGmuylbzZw96YN/OtB9mJJ5JxRJ/ydTH4SgVi0AiyxmPdplBoG8XCV4re'; +moduleBuffer += + 'rs4oG1sRGmBGSqBmucnZlObLpmAjlT/pr81SocN693F/7bouYUIkg6La4rK+Rv5ka9aPE5tDtcMxxwPYZS5F+MNIPfd60Fk0XTrV'; +moduleBuffer += + '9SGh79rUQKqOWzWs8uH9nO7fl413RhEro5dvXJfJiCwK3Gg2XKdnuiO59yfSh0Ui7+QBQHUb2ejlbTAXyNTVAHwyxdfn029+y+Y3'; +moduleBuffer += + 'rRO+sIHdQLKtVZ9EncpZ5yVqANCZYCPX9a9DNpvmW97/gIeWczM1FHi+IUyZgkytlWXnSSVeZ0K4Z1wOPJoQPnreZAyc9FX21fwf'; +moduleBuffer += + 'Nv1xu1ZJsGheaX5UZn8a4qrNzTiSr0d9zWvX5TtkJofK3H1IynOJj8DNBR+wBZelkfy6dfnr6dKVr76kzfXKK6PIFpW2bHvHfREg'; +moduleBuffer += + 'fE9msIfKhrUycymK/cl6V8NxT9OXX25ryt8lHSAmWkN41y4id/AVo/5X5HtLloDjAI/58umr22qJMX0UwoP9OPhMWsTYIqaviMs4'; +moduleBuffer += + '4zXL7wgJW0Z79+ZsYjO25UiRwWp23Wp8Db3SLl/W9uy8Qb3eJVTi82s1Lta5gvtL6VsV6ZKPsiZV5SqmytC1LWBNiGAzUY5Zju9R'; +moduleBuffer += + 'c6hlXHDdEHNoGcWLZZ5fXJniKiiuQl7xs0R5NNVthGwkRXRZqFXT/P/s+ELSDDJHsh4aWKYjMk+6I+j8xVgUIyrwudUnOWs53in/'; +moduleBuffer += + 'P6RsjCOLmr5ITWMV1XiCprESgXAEMFKD1Uo/srbKy+38xL33U15uqx8ZFnN+/D4nEtes7N5WpaIQqKyrgVdA+doaE5ykj9Tr3K6f'; +moduleBuffer += + '/g2vRjNSx7Trj4scEF7WDmg9ILNkvIs1LUTYjh/c0U31JqjehOUNSLcMHsUCTYmzNvSNMdQBS6QvdQA+xPlfH7yfR0w0p/XzN9gj'; +moduleBuffer += + 'OBVOI0W5QaBL8E+qj1BSntCUJ0s0XEqisyNBGzhspcqhwRChUziXmqIHfWeE2KNCrFPd/okemxHCsKEwVJIdXd+y734C2Y9khDpN'; +moduleBuffer += + 'iHcq20EnxRSmrU4qlJ8fyXVBzZqSPMGRnupRKMlL/ZI1gj+bpqIE3CtrTRsGi+3KBqFWall8nte5EBHshJHHRvY74PcS2B9PrOBL'; +moduleBuffer += + '+pUWApQI+zoQVx6jf2XoVNX3aB+Yrclxx64ObZKPHxxlL8Awt+UDLMBAj9KeKiphFAwj2mELJxrmDA2ZQmsKlMVFYAqVdEP1KQ3h'; +moduleBuffer += + 'MI6daJk30eFOiPmZqvYN2AjeS4h6QT30Es+7wFtBUAXJ5624AJJl1oQYYLBiUpYIlq/wFlkZuDjOnMjUN7JLS26iDjGOq0w6oaVT'; +moduleBuffer += + 'dElOv+k7Zm+14h/K1au6McStZd4letSMUQ/BVdAdP1SrQrouqgofh8krUfASGTF7XtC39TPHK2DdlsXCBl/KI4BqDwbbb5yqfdK/'; +moduleBuffer += + 'SPbbbpzLAI93G2vbCFQGfvsLnjV4lLe/0H81YrAuMa/ojlxGfcXqKTLlK2Gz9haewa4GTahhHbJReXhIagjS/8aHF+l22MhGcHQs'; +moduleBuffer += + 'hAx6zUU9+HefgeBQ2aJed0RVIWMwdp8gZGx+AuvlZI1HHGyf8XvxZ3G+5a77CZ0GlprsNf5w4F6Rb7ur0IEyQQSDS9t19RxFvbvw'; +moduleBuffer += + '/MHEjltp7NXX53aCLo/k//2ytox0HipC8oTUgErOcJoJPcJn3DvEDZ5F1bQSsJ/QfpuVvTwsh8pWlYd2uPIjtsc+zuxXKle6zHvV'; +moduleBuffer += + 'nE+WYMq82Vzok1Fzl7UmAy5K8/uK5kMbHEnILFZzRE2yfOs8uCo3G2D7sEEueyqUvIqBly5vc135WohmG4gRnQOfglyKqohlqWUX'; +moduleBuffer += + 'KbjnBPnCpEdUW7V0mQApuNCXn0kPeBikY2PyM4G9JcFqAylNlVq81M6yhP7vdkkmdhFG3KqXeZ0OVNe63rWCZqbwItkCWEb4SlCM'; +moduleBuffer += + 'LvoWrCEWwBridyhztnSHaGWj2CFaSuZaelot9TMhklIe0wvRtaX0t4UhSLQS97gp1ZO81WGhAeMJmTdW1K9n9aXmVUJyZB3W8a1t'; +moduleBuffer += + 'r+o8zUcoZth7i/Q+oba1iLwbMUAzU1+iqSco7dZp9y2pL9XUVs9aBbIhrJSXrjAakTB7iV4t6WGcbTeuQCNvyIZZEGUY43C5NGJC'; +moduleBuffer += + 'Nd1FRnvHz1OHF7YvJc6H1m/aUO2HqMk4SRjWYN3DaCS0GDDDjMlY3IxpdMYVrq03SKUKRvY5TzuP7zucDwGRd1gDe9fZqRXe/8Ii'; +moduleBuffer += + '3uoVXlsejcLW6jMerbgx+YZtdy3UfrDEPGWIvTBrFIBpOrAWYoYnuhdTWbIvInZtvlcebnaGw/fEqkU63+EoXED0F5412jTYhAOC'; +moduleBuffer += + '0RVpSRugPAZnNzSy3IsDddrU+hDoh6hFssWHsOSL0kN4zVmD4LI82hhSvcvQJLdORuYllzGEE5OWpPt2Sx2iHS5esKjXt2qT47S2'; +moduleBuffer += + 'XphvFzkbFH/hErONXM1CaDxoTDOrrS9USx9j75VB0V2NGNAn/koIxidIl5KlZoksX5/QETbWEwxfsoXZhAuhPYHQuPv+dkbEWDTq'; +moduleBuffer += + '4U8oHIxIvI1IHjX1TZADlKMOypEtXOZti6zYrNu9SvytMu555GK+atcYhDBMvxDShFl6U08/reR6gnbd5/mjF/oJdy9LiBuF1BM5'; +moduleBuffer += + 'VAEc7eVDPcRxbXR9NfiqWVRm1pHAIgfHavJjLRJVNQFwEzReB5hGbOutY1xsvfGMyKttuPdPK86xQhOYgjWP87dacOv24ANg0EK6'; +moduleBuffer += + 'b2AvV+BunqBdCsQxHvylbwFQozQOiEH5qWfxGlVbVCvjsQ0XhcGmEbZ4klh0Hb0d0t6C05a1grcBQ3rNeopKTX09EPAIi62A8TBK'; +moduleBuffer += + 'Ig18W+zJz2CGWDM4rISiH7HlYoye/mnHbIeb1PlMEENltFPX72T0dFU+0ZiMbRsyD47CsJbG3Q6Lb+WddaF/lSQe5KPF9niObCrY'; +moduleBuffer += + '2Sg/s5cvs4ZrNf3kyt7iM8vX1W3I8rWS1rqQh5N1PZzUnSVv9DhhtFm8l+tKrdoVP5SuUDtTg9KIfHNZV2Z3Kcl31YUeIjI0e1qP'; +moduleBuffer += + 'rSJRSnHQAZugFTp4ZguWGqotyCe7mSb7JgCU8nr61aDvgbBp4FGbTsG2tdbrtK3e2LN64zDdIoT91i5JlAfVMU04hAj5UAp7qhT2'; +moduleBuffer += + 'ILRFDhVHn6NkkcUUWfoObK2ul3rjtioODxqrOIYMKc8KxW9bdV3tAkymrYrjthLDth7qtovdd255vyzfVMUsXxs4FPjdXut1xwsb'; +moduleBuffer += + 'uWCpubm2IjgemELq0+OArTU3fjxk8iol6E7sWTw+bw49gs74AR+AavqR/MrZgql+JN9C7+hYBTL+6Z+qZtU/z09BcDxQJT9f4KaE'; +moduleBuffer += + 'lw/jfqGbwrAsDuy5gD3VG+2RNS5OpSdWqK2KKmoN9bFKHqVr8NOeNH8GDUPhRVQZVEVtS9JbaiLxa1HPBliQnUW2izPld6eM5+Li'; +moduleBuffer += + 'ZOWEpI7K72210khxX2KRDyXni4pYzTOJfg/45L+4SJ1NFIx+tiyPb7RdvtGxREd/j1zvoRHitlrnLKTIt3rJpPlTGsTexq3wUK2X'; +moduleBuffer += + 'P85IQx252yxpZ1puI8hvlLvRonPbcNRZBpDGWXxxtyu0rAi7cdYF5gRMg1+C6aJdOSYC3lP2ek+yIthqN4ezZYTOhmjd0vsU8jrm'; +moduleBuffer += + 'hqdzI3VzI62u0+rcSNU7w+hGuKPAMhOesLtI58osfBGX9LpdOCXlTxaMZQ3wZVetCDKn1cTB7etcK7X/h723AberKs9F5xzzZ821'; +moduleBuffer += + '5lp7z53sJBt2IHMtooaniWx7kOQEemDmMfwUKLTH6+Pp7b2P91x7r8/anHNMSLnt00A2EDRWFFTUaFFTQZNWolGxRkXdIaFGRY2K'; +moduleBuffer += + 'ipZqUFRQtGnFFnsgud/7fmPMOdfKToyKLfUo7sw1xxxzzPH7jW98P+9Xn83IyljbQ2hlYRlWXT2h4PW0x4dBqVY7qlU70j3f1T5C'; +moduleBuffer += + '7aOjaq+rA9Apwi4+i9yiT9t7KNSy7zXRzy/pepUS5MW9pu2WYpnGepjqZ5/j+WtVl2YlZ3ZpMzuFjBd0KJ98yKOZPl0S9wVaTEux'; +moduleBuffer += + 'rZpMPEgYuherwM4/w/vDsz1IDrDZr/D+Xz3F3uOhwb7sy5an1GOsUSNeO9N5pKVlccmic8m/FCz4FH69pPssKXkp5pOWEhZL7FTj'; +moduleBuffer += + 'zSIw4DyvPXOlNyqXZ630GlZYgf2fxb2EyJmwgtvq97M3J2pNRFijRz1H8kL15Aqxsagahnx8cY6jAsxAm5taPj/VWi512Q95Vf6l'; +moduleBuffer += + 'K5mxRRrqa1x1loztKsM2yU6LKtIU6u5akiZ+0wYjaWvk+uHSlUeNHDFKSp+OBeBnEajdvrGgpPYLdFeMlSo55DBM+Bv97jORvsXv'; +moduleBuffer += + 'tnDdjLgDcp1BLBy5blRDqj/u0n5rA+K1LzMvVQjxK2RCcY2Mcq7o5J+QciewGFK9HyFHm8B06zFwXSPKdYGf743hrpnt8PMRzPxR'; +moduleBuffer += + 'N/PltYXy2kKCBmIFLTzdJFxBC2ErqPnyhVhBq6wcaXSpp+ewWF6TQ+MSrI/vG0ah7+U8OdnFO5qPQv8coO9G8dnTtLhRRFbO81qu'; +moduleBuffer += + 'gHCvY/kSYUnyJcqkFNmG9ZL1vOnsmzzBI0y93AvDtJR9PoY6uELGtBAZtbH8NI7aqB7x9U3JubAarTEdX3mHORfqEI2UoyvnFas3'; +moduleBuffer += + 'T5WfSlHACKw3qRRnsHL2q55mePLRidaVjpb5110o7zTwTjndUkzHMUxE+SLmZ8rPo37lVxat9rKUZy7Ot4lqvuUTtkY60+QiNZqo'; +moduleBuffer += + 'asSZNzEw8ybszMOUGsEEfKmsJM6ltJpLUnZPETjqtHmLD8sykkudhpvtnJ2xc3ajTNml22VuwnR3BDNWuBSfJoGQ2i+TyzNRxAiV'; +moduleBuffer += + 'MRNgx7zuaJ7A0Ffe8uGiIG8tRU+2Ma4xCJUd2DYtjG192roBUGAxsdo7U4UZHIIYnvEvlle/63F0rkLnEmeP207ZIKERl0BhDgeN'; +moduleBuffer += + 'GFzX82CXfxa2HZR1jipLV8GaG5CpMejClNt5zOXyS6bLH+BzRXLV2d4f0sG+z32qvksR4retOyAswvvZn1Pqg64wS7UeeR5KR0bS'; +moduleBuffer += + 'ic1upJ2WYlQgbbB17jWrfQ+kOpOGL+uTIkrpUlRe9YTUC9KgFvxR2mjghFwiWGWwlzKVDUHyk6jkh2S4bed9XFHNdp5ZqtnGNM0q'; +moduleBuffer += + 'qtnGNM6qaVx+2xFPjlZWEc965UI7WqlksHP65BXeOTIhyNC11UGH/By5kYqZYyGpJHIOy5GgiS1vsuTitmKjzhfb/geXtyt2O994'; +moduleBuffer += + 'fkqZb6YJkcGpw9z0lqb+3mG5NnDTEMGs8PbFcjiYOJ/Get+lxccnyiNTUNyVWO6LnNm+hPITy6cdSOo83P1yN17eHUzUVdZW4gzv'; +moduleBuffer += + 'nvhs79uJSmx2WbZxS3OluTOp+Lb9iUKNPpQMMT++3iukSsWzhY75CWtsezjI/BgwP+EA83PAczan7b4a6HrZ7TwuZQpHip9leZF8'; +moduleBuffer += + '62Mh0I4zmcnuiSzwuvKjDdiJJpgmY0tRQ/XREtA0+3iQj+TETVQvjOyeQPM03XdoDEVNJilepLCipa84zupssHtSzsBIp16ka4a+'; +moduleBuffer += + '1g4bwFTGt5GeciO7GKwQFkcKgjVUBlIy4NzEtLHu5MgtzNTy6BYGbb+HPWuPUf13hmNKuWf5Khu2UNV2KkHX7M6Svp5rylr6Wku/'; +moduleBuffer += + '5pEUIUMpwJAPQoDhW6BSz+56huEh7Jr2sabDak37WNNhtab9cjH7CoZbdqWvXelKD4/mhDpw3eLOpCdeuYyDNcpd/yG8odzXd6qO'; +moduleBuffer += + '8kjBEI+0qFzf4+XKLlesW6Wct/T8hz1TubBJ9atlf8DrD5CEgBR7UXluks2mOmE5QnBhufQChKjZlfSzNzZzK+qaQIHbYjeQsOIu'; +moduleBuffer += + '96iGPXILpW2oEKDBw2ibEMWzaV8PoyU12J8Ofp2rfXeqteRB9AnYIVSg6qwwnRyz6tB6gBDNQhqBNlFhm7Ereklewz9jX8mxozar'; +moduleBuffer += + 'A8Kps6F27l4IyQOpbFcPphAWz7Du0hPWlTJQLUF1HOWxo6RscAcMVYYeqOWj1DApb5dRE1Bv+EtwFOGvC9UPUI6wW3w9ws5gkG/1'; +moduleBuffer += + '6yQWqJ2+60a8NbVS2OqcIQsYekGzIQJtVYkdvpXxO+yOjOD/AaHFvOJOJxjfGvcpSanXD/ieiPYw4yvVnXIAThRS9Uz2RMuqj+Ae'; +moduleBuffer += + 'DWLzP5tn1cQZxQIszoYuarhPZE+4yZH72dYmHWdxsjEqP/OojFHg5UNebd4cPWvtHN89OPA12cBBry4bqCa2EwVcqN6zhwZeepyF'; +moduleBuffer += + 'yu468JlFA5+gDGXgM9xn65+Srcx9Cl+9MBc256ScCHbZG7gqGCXgELGA9HCKuaQVqJA8MJ98rUN9ThmtSH1ehVqTgbnVe8bg7AJW'; +moduleBuffer += + 'mWJzcPVSudSAzgjL9qRq2ep6zhTjbJmdcUimP355s6rc0tGeA6klu14+ry4bmzckG5s3h2zMr8vG5s0hG/PrsrF5ikUtn5pfPCqE'; +moduleBuffer += + 'fD7Q52gOAPXG/NO9N0UrAWg1H9LchxpWTQKCO794qAFs4cRl190OKiwniseuQWkAZeKne/5Kr5lbyOPESRu0JqhxpaM50+L7JJXq'; +moduleBuffer += + 'yVV4vup4FJLk+ObAgJx/snVMS2D7eMASONQckbMEDue2BMaLx7QEtm44FTr4U2EJfILNPXL85h75eZt75OnZ3Jn0uM2dSX/O5s6k'; +moduleBuffer += + 'T8vmHj7+6B7+eUf38NNzdK87/uhe9/OO7nX/yqP7KABQkmtq3kP+6UYRUIwioJgJYp4YgJ3wHBKrPqVh3TiIcmK8jb10COUkPUGU'; +moduleBuffer += + 'k2beOhrlJFaUk8iBmMgLRE1YowycRhjDOYQpq3IbU5D74JpNFu6EO2b2HbuxHnNwXz40uMdz0bCP8dLPPLjHc9H4pQzuW4zv18I3'; +moduleBuffer += + 'D5mlDdhXe2o5MNL2TRBGcSNpttI2Bc67H97jFfOze5rtNm4/jdtTcEsj/IdxOw+3NLH8F9xO4LaJ29c+Ircn4zbB7R24HcMtDdY/'; +moduleBuffer += + 'its2bqEWJ9+oIQMewIOMx+viXvmdHaZXnl88igcdvAGpfPGTRwhJd09TT6A3fU9uR3DL8+VbvucqzvPeLtyeJLcuprOC/9D9YzZ2'; +moduleBuffer += + 'GtlD6sKW3WNU+yjHHbPG/C5nB6KkE4mtNO4IYNxxO/jmzYdgPLFNfsIU5A4kPfcsc1fMSbg7lobtiFUIshvPbom1KDlnZa+MyY0X'; +moduleBuffer += + 'C2RW/T2RdwKtiDLLPcbvC6FUs/BEkTrZ44xUHHThwCP18ggtvxIojlHJeUk6w5jOxmj5j5umeU1rU03O7cMWOCuii8JNZIAUCK1L'; +moduleBuffer += + 'K70EUq1gQzdD1Iv5lHt3x2nWCLN4c3kHAJLz+70FCFSequ/DyFKP4RA9hkWEXGeXP91rVx4RuenFf7LmvKu398by8E/ytBfgLg/X'; +moduleBuffer += + 'eL83ub3XAaBQpzj34k6QjxXf8C6GXXXemS7yi2QRtiHPy+M1WMj52HRvXnZLlLefa7b5a/yNLrIMKwj8c8QNg2WqvN7rMOfpwc1Q'; +moduleBuffer += + 'RXTyeRfR9gycv5SWu6eX95qXr1Un8xk4lLTBsUtbABAN0BTJcl6v+fxeB0ApkI9ghFrPh5bmdydVodW6Ou/svJqh6ppXwykb2AIg'; +moduleBuffer += + 'c8nzESikTe87oYtC6UD1NuIFIjbhnbj+DiKTlq+1UJkZejI1Z3qokjRiGuYp0rTXwyIOp5yyqm0eWqS6L5Wfj7OeueY7XU6dPVYp'; +moduleBuffer += + 'IU1uw9SNfn4bEcdkjC1TlNOrtcUvYlDInoxVwKiQA8N1aQeQ3udeSk+Ty224UWke++jydbA8l3mLZS+JM4hbKdfruhojs9YviGmp'; +moduleBuffer += + '3j+u92LtiURGthddzk6gs23AEZN/f78QTv7yyV5nshc/v/5SZ2c3UrH7lE6WwSkw1Us4yG36BeKL9kGeJ3bUM50WEbtyjVf+tP6R'; +moduleBuffer += + 'bUW5kH2tbaPQNBhJFrcZgmG+EI37ffzzu5OT/BhHPGBsWBnzBF3b0EpHMs4A9ckbUncsG/UWq2epPYO0XXe866VXWLK9lR/5FqB/'; +moduleBuffer += + 'wCE5j2ZgI3rN1bDBxk3obphDEmIkwE8slNfoGYpfL8vjzVy8NAyKXdXZLTpwGnx0JGdk2xGGnpMLsclG8gZoURvSCWibQBVCoRoZ'; +moduleBuffer += + 'gJFGnPwGQvqQb6mLApVjiD8KWbIQYOnnBZqBZCeDFgmTUYP30IaxN5K7CIIj2eNBjrJwi9emnFpsNC22vkW2kNmGl95g90Ns/yq/'; +moduleBuffer += + 'hd/1tr/Z45Ux/eB8vaOegGBGu+oJVDavqqIATvWpEC/vcY6Wf8r7xJ4o3b2l3OX9hFqJlFEEhZnKweoYK7hCnq2uArTkKXbLrWwW'; +moduleBuffer += + 'N6U9P/vzQD1bYYhf3K8PmCYkC6Le4vEyzVi24G+tt2rpoTuhIreJSgqXqa9mVqUkdGGtSepc9eDYxu0Ryyj7RkKn97J/ILcrOycm'; +moduleBuffer += + 'Q1YWELClnvXsa/v0PbZCL0/lkBP98j6z0RbdfaJCrFLWSEfcNP2RL2Occ0NDyZ9vXAGEJFkaS9apAJtuaaaIN+D9k6+CWMA+DfUp'; +moduleBuffer += + 'JAQD6UlucWqG0tuang2nZ5o+Ppw+rukTw+kTmr54OH2xpufD6bmmL9X0s8zS9Cu+AidNWVhdWT8zsXpGZQoMTEC3iCZJ4G/63H3C'; +moduleBuffer += + 'fvYJ+hwvQ9hqRGJFuEDgIOTBZZNdpi1GPCyakYzjl6+Q0BcoQSBqn6/XK0HE0HuxGnEmisRMj2ZI5dUUL4ZLV3wWLYwJxkfPDDue'; +moduleBuffer += + 'USX1jUqYoKQKiGUI8UwbTe/A/3imn90W9GzkTl9BSnwY6CoCbNeyMLEC2KkrIm37rSYjBCvBsPQezeiJVGw22GCcdmHKQnDRMkvh'; +moduleBuffer += + 'UC8pp7CFFvHU8ShSg0pdGPALiFWl0dDXCYnnglCNpl769+NmvIyzKbyR0MxQLX6yaYXMUdvxDnkKHc1QTZ9DqzXy1Aalpi5SSKmw'; +moduleBuffer += + 'BrMcnKd4crCa7dBzzjrjtwB21wOaXXe02CQ91cL3WyrlHVEAsHmF383IS42iFs1uTN89jQPAqABjHFR5e7RoT3dHpZC2FGIQ5HCe'; +moduleBuffer += + 'MBIjOW0ILp7MXhf3eDudj0320sK7IJd/LpyE5nzEeL5JEaMyg9tDrAor+htEOogRNcYyN5NJQvQw7nZHPi0jVtxMVORuBzSEXmUQ'; +moduleBuffer += + 'dCYKHEIfgIaqyBRbOYWaI0SNGxaOKFQlclhBMgM0QbVyoeJAl+Jyp2YrB0IzZgNDMjHwytAQpXS/0/AI0rgKV7yNzaVdBZog59KW'; +moduleBuffer += + 'RWvnG/XjUEO7e+E0jGx2eQ1kifwMQjNka9VbEVi8jewDTYVeaKj9Pv3/OlUNpZvspG3QWYETwxSpLLXi5mtnZQEWd1znYP/UrZhw'; +moduleBuffer += + 'f5AU95p6Sm2qv0ITRYRWlydTq68i2YZKYMsvEtzNdZgP7lPj5/KOTHutdnLKPhn/rjpZ2B6LFR6qpYOF5MzRnEx1SWWbdCFOqAh7'; +moduleBuffer += + 'jtYigMfSvkxZehxm1OB151nrdlU6J+oTf0DN3Y16kPeggeml6CR2kcyr5cBLjOAb5deMVxMF/ow0z5l9QnDKp5qySKLpEWMQAdb6'; +moduleBuffer += + 'sSZctEXYTYkxo4mtojHdbRWxrDU8p33zQPaom8pfq3oAI3WkMkMqawTmJ3HXPW8rKUjURh/VAZwupkeSfcCo3+hSNRDJcQ7hkEwo'; +moduleBuffer += + '7fSpoGIgWFqa0A/3QoWsfB6xRa2xdyaMwC0xaPuq7gRW7nny7gjsPnCeNeqSYvKJlWaZKqzxUuJeG6lW4QhevgS5R1Da8+QFZD+g'; +moduleBuffer += + 'sXXUXBqgOyV4/SjuV6F9o7ASmLJ6WEnMuzQHWEpUFJhujnGZ9ubbtaSoFQqQ0Bt3iRpKGIz8MrO8SwXgsi6Bu87sLsBlqruQn+wu'; +moduleBuffer += + 'kjcf8vqKV6bBomNSlhiGN8QsutGgn4iU3odRDuG7SixMfCt4IaRbnHUt4LN7OvvUpNkQQaA4hzsSgMz96fPD0khaiGM1Hy2MT3QR'; +moduleBuffer += + '/QyXY26DR+0G7uzN2eerRWGM7ir3KjUlwLSzGO9+dsSouCU6OqO1skYezXCOGksuXWnOhK6kj4HLk2ybTBnwxrSCiY5TGIsiZD8P'; +moduleBuffer += + 'kNXb5aRQWc9SbdMy8CZCSo5TWKpKfVRMd/JV8ivjr6OriLdsLf20eAyAp88t7thcUj7V39fmnBxs09xNl7F8/lwTpz716tOILBD3'; +moduleBuffer += + 'irAWUIQIdWEtnoibGNZqdDlOhbA84wa0NGfozBxuBl5Ppx3hiEEemqXnUHZns8dt9WajlhcRQZezL6k8U+gS+aPEbn0ai5OeQ6Gu'; +moduleBuffer += + '/MCi5ytqrF/mu0SrYSctIgiM92vf1dmmU1mnbUunrU5Zw30mkEnbUVgUONZxY8FNm6w7doam3RmCob04oDVn+RDbRrO2U8OiRrkD'; +moduleBuffer += + 'wumq9Ulb/TWT3EF5AKHre7FtL+Jg3yU7XTFVPOo2PLcDPuES4Nm2SInMAhQxmi+0ViOHrCVmMSOvZK9B7PUODbTZuw7vTOYCt7Pl'; +moduleBuffer += + 'JzskOmCAufkNUzPw0fJPZvdPuCFirxRqaspt0gMBtbul+rTDU7+2baqOkjVr6/Hoc0chhY2qGXjXYoXhMJt9yBRLLJDoKClMDVeU'; +moduleBuffer += + 'BinwfMCyZ/DqkEPfk7b766Yd7Jd9mIezRXhVX01xcHqgXztRqvr2awQTCSUXX5WyRtdpIaavOFbTJeQoPiw1rcOHPVyBTYVKIVd4'; +moduleBuffer += + 'UzJpfLXi97Pbm2Xw2zqyD3IBM37ENHwIzJ3Eai2RXCF+iJQt5Q7NBgZM/z6l9LJRvSygHEqfgAL+M4L7yJSb1oeQ8mcPJGoDXr6O'; +moduleBuffer += + 'TO51VzDSbwd+JGEkVkkfrspp1a6WEmqKlH4gUrhqoJEEdHQ5GDomZXeoqmkYysgkyz6toYnBmAlh+99hhuZSp+hGaVOjItDU+wnY'; +moduleBuffer += + 'JAlMbrjkGX8w2WjyDgURzptMjotUkw/Y3LHNvVCTH7e5Gzb3ck1mULEyd0uqoOlwDSXWB9NTl/3QUHZbw62BFh7ZwhdpMiyFovKb'; +moduleBuffer += + 'URFp8sPBnK2ftclNm8xmBsWNfpUbG8RfBNmXm6u9ZSDOGuhQTiPBCu9OvxfCOEgo2i5/nTXrkZs7ZGDldrO93aG3M/b2dr3dqHfb'; +moduleBuffer += + '9O6P9e5Wvdugd1v17qW5jXvHuyv07ma9e4ne3ah3Lx6Ivm5B+QP1yEAT7XBj97T2F5Bi9QAEgOf0nAXI1t/5zCN9zl/eau9ygDKp'; +moduleBuffer += + 'Ly8O9C9C1Lgv7vGK+zynhYBZRfZqWq0RZf2RKGhtCq/x/we46hLPGh/I3m5PqGrtmesRGgYgZhPj5fAgrFDQQqHu/NJe6KjGQtnl'; +moduleBuffer += + 'KHzABlKY83uk8T0YWxF6KiIGkgacw5ale68GDQ8Y8KQbq+sGI51Q18Jfl0324mw/8KmkrPAZslfgL7vPZOPcMrO/Rjf6jDk9ob+S'; +moduleBuffer += + 'Hk2QI/e5PO6r+HmaXMl4P/uLpgWr4u/iVaDx3Vi9q5XJq1cRdWM1gaUkKc/w6dDNOs4YqWCU/YfuaPZRX0Zv9Jm+ShYyV9/GM/wM'; +moduleBuffer += + 'OiRXz7Csp9droJ4NW89AiFRVQRVyAGDzqxEkxmhCI9s2UHHmkbRiizagRKtGU4qbP7fXK/4GJGtJv5jBzY4DezWgD4FOyEf4NIf1'; +moduleBuffer += + 'FWeaxuim2P/hu8mPGejMnicJr/XBlBnOx7PIOQABhKcFgDHc8ZG7Lb6NbIbtLi/jDMxhFjMih/BYI8UtH5Jc74i7frHV/gr4OmKN'; +moduleBuffer += + 'O/d4Rjt51GiNHpYrtMgHcT+yMrgf187K4ACu7ZXBflxTBlE1RDjZTci2Yrexi+cQ0cu/4Buz0WwqpTd58GGo6txhMNDwjkv+CCjW'; +moduleBuffer += + 'iUz74gMG/Hn0PM/+7//qQFFFdEcGy4RA7Xnb9n//hh/d++Cm27oRRkRhW4INxdZH9nr93wg88lx8R/g7ZOJJL357L3qTLfjQpv/a'; +moduleBuffer += + '4Rl5xEUdgvQje21M6EaFT4zy6M25mfyPgHhMVU5AScm9vocW0N9KXb9mMnudIVYOtp1z1yn0O/fBIr6qTDAaIaBK8Jkw76qisU7Y'; +moduleBuffer += + 'BcTzKEIFZvKPfukgMwyX6ReBgkH5Q6VKnlkt0iimFHzGCU0Zqn4cxg7+vE16iA30SBuqkKsUFVLypY71cswjdn5TOeSWWninKmkk'; +moduleBuffer += + 'XPm4zDnIeVVUNtEdpXRXziUGsHBjlOl25xHcpjufktwuRMCA4KD8FqLbHKZs430V6o7l8/oq9h3Ns74Khjv5SF9Fx8LFKfoxLCb6'; +moduleBuffer += + 'Kn5u5IkFJpcxt1GlAoJGeem7Ggq/vSuwhh0rvLt85xnvDoJW7a9nwcZaRRdr2EBOZKixg1h/VGEiPtQkeh2YAQDgHzOLsNEef2mW'; +moduleBuffer += + '4sBry5CFVE8f4z2c+WxMeh2GO30dnN2+4oR3tC0NMr3N7L4Wgg00si/iylgDKHtLoqgd25zF645Wn6/Y2/sZQih08RWpAInJI30e'; +moduleBuffer += + 'IUvuShnrQzlrxLwOigdSvNEiH/DinJi6h+RLThb1sGLzMpReKu/K9aFUtpPPRgO9jfBIyprScmS8519ENGTYRs2Sgdgi7BtdMmRr'; +moduleBuffer += + 'T3qhKyj3py8mQ4vvI6Y5OxfIE0HxcMpIiGoHT7XNRR0IT+OLO5FWqGvReUMoBQKd2ho3RKi9pEpf+2VBKtQ+lOop71Fc5ez0MFGU'; +moduleBuffer += + '0W8hgqazYo/SqDZVaRgiqGvH+zwG2Y59LKXaCIHUsYnd0iaw+S30/dBOPcvcSAMhOZpq6l0I07mFQJ8IyxkU29ouaDu5IYYLuLWN'; +moduleBuffer += + 'wJw84DhraOiOpJ56JKqHNIdIgNHRhfBl30c1Z9vgiSQ9uxYagESmjzBO0qN5us72q8bia2oEvQMda6ssBRX7ntxjo6RQg3VjstLc'; +moduleBuffer += + 'HxZbfmKD2kkfFXfi5r4nq6B2UfEQ7v6RkYmkjIfKMhoAPhVCe9fRi/Ve87Mt1m3Griht91yL9RhZ6otVshSzr7nb9Z4u1rnf08XK'; +moduleBuffer += + 'RaaLdZ/RxbrfcLHOjLnFCma/qYtUxuC+ORdruTq3Nvt85acu1i+HA4sVkRoPDS/WP/xffLF+a87F+uRxF+srf+HFyhi6J7xY6+Fs'; +moduleBuffer += + '5dwwogcWxscNq5mAg8W7Y7t6iQ2SbaX+TubTcVfvzFht9d5+491zrN77XnZ3tXpnXi43dyJfuXr34a5cvfvKMtzq/Umlf60Z2mkM'; +moduleBuffer += + 'Rhwv9nrTOCsWh48c8dYxxNr5k9VKNlbjaGMshgrNAnXww6/cS9RHg7B10PeedhbVym+g6onhHMk64FfYt1h4VrYl6yS7v6lILx7k'; +moduleBuffer += + 'hWS7UeqNN7pSQzhZVnn9o/PecYy8aW4DuTwIDGXqMA85o8rcaLRvX30BENdMiw6mi2dcVn8U20cB4AjCEo6AJvmS/9H9CrAmjOVq'; +moduleBuffer += + 'b0pyPQeS0WfZiSL1eiEnIc4KL1KxO3EM6DOR3Ul574s1IOVLGBrQSZ2c1wFhzNRazryEZnVarzxaaZxnCpngMkoE5C0e9OWBKnU8'; +moduleBuffer += + 'Ht8sEAB0g18OqtAe2SsS6IL0hah6Ac5MoCWexf+X8xgAAbFA8NFgg8ZoCjb0Gn0GpZF+CzZkj7VOJjhow1Z+maqmUe4mGk9KRgbj'; +moduleBuffer += + '66vOMVPrlydeJZvRqcXjr96jwsv3Tpqugs6XnpWL+4rfIGwx0J6Nw4jIdSppkA9FJpCDwwfDY9uRnsh/DKRkYzl1eCKH7aZsOzd/'; +moduleBuffer += + 'V6p4b8jjmq+sPz7dzomrN2KPrK4SSBtXlMQFKMU/oVIWMhrd4oFSFncIRXEKSjEnVMqpjGW3dKCUpcA9XeE9A6UEJ1TKM2mNsHyg'; +moduleBuffer += + 'lOUdXlaglPCESnk23MyhxqiVcqbsJnJ5LkqJTqiUs3DOKc4ZKOWcTozLb6GU+IRK+U8IiEltXq2Y53UauKxFMY0TKuZ8HLMYj6JW'; +moduleBuffer += + 'zCWdBJdLUUxyQsX8ThfGxPcNFvN8YEqu8P43FNM8oWJegGNe8cBgMX/QaeHyf6CY1gkV8392Ya720GAxL+7w2R+imPSEivl/cMwE'; +moduleBuffer += + '4ki9mCs6bVz+G4ppn1Ax/53qs8cGi9nQ6eDyRyimc0LFXIVjbvHEYDEbOyO4XI1iRk6omGvkmOwXm/2BYjb7nVFcbwDgWjF6QgW9'; +moduleBuffer += + 'zMdJG6Lbekk3+p0M11expOyESnq134Xc75bBkm7xO2O4vp4ljZ1QSW/wuwsk462DJd3qd+bh+haWNO+ESnqr310oGW8fLOl2vzMf'; +moduleBuffer += + '13ewpPknVNI7/e4iyXjHYEl3+J1xXHeypPETKundfndCMt45WNKdfmcBrh9gSQtOqKS/9rsnSca7Bku6y+8sxPWjLGnhCZX0Mb8L'; +moduleBuffer += + 'D/R9gyXt8zuLcL2HJS06oZL+xu9OghQNlnSv35nA9TMsaeKESvqs310MajRY0n1+5yRcv8SSTjqhkr7sd08BQRos6QG/czKuf8eS'; +moduleBuffer += + 'Tj6hkr7ud08FTRos6SG/M4nrt1nS5AmV9B2/uwRkabCkR/3OYlx/wJIWn1BJP/S7OSjTYEmP+Z1TcP0xSzrlhEr6J7/bBXEaLOkJ'; +moduleBuffer += + 'v3Mqrk+ypFNPqKTDfrcH+mQqDmgTKZSxbMwN+FEsGSzMiimFKAn3Ch69t9pbIpfuau9UueSrvVPksmS1J3x2fupqb1Iup6z2IJxe'; +moduleBuffer += + 'vNo7SS6Tqz0ofE9e7S2Sy0mrvYWwmlntLZDLIgXAXrjamy+XBau9eXIZX+2NyWX+ag8ngXmrvVG5jK32RuSSrfY6chnF+cgAUAa1'; +moduleBuffer += + '66z2oFVrr4bzK1B6if+42oMeT05SUK0lQNot0SNjFfNGKqcNKHxVNlpFo1tMelQnLmE/yHFazzZ41D7Vpk3U0k6xaXktbbFNW1ZL'; +moduleBuffer += + 'm7RpU7W0k23aqlraSTbtvFrahE27sJa2yKZdXktbaNNeWEtbYNNeVEsbt2kvqaXNt2kvraXNs2l/XEsbs2kzfi0xs4lb6omjNvHm'; +moduleBuffer += + 'euKITdxaT+zYxG31xLZN3FFPTG3irnpiyyburic2beJsPTGxifvriQ2beKCeGNvE++uJkU08WE8MbeLD9cTAJh6qJxqb+Hg90Xf9'; +moduleBuffer += + 'aapEMFU3EyYRaoxQmH2eTfPwDO+Usz1jwQpWeEsUOI3wugwR1TutZoxzZgUtZ+11zqHdgkX5Dk83SxUFmtY+KLVrMWu94iQLLgco'; +moduleBuffer += + 'k/w0/sqfAWdzKCU8e+j0bWQtFkC9TKoVou7/5Sfgx6fCBg9wYv70SLN04/PUtU4tT4Qz2rlXjt0qzHvijr10rVNXPTwYK131bsNt'; +moduleBuffer += + 'Vrrqvb+8pe5vL24j3NKWaz8LLd3yPovbpHTL+zJuJ0q3vB/i9iTrllf3+tv6bnkwv3gXLgmVxMUW+Z3tCEqPvTeFKiU94PMoDkDD'; +moduleBuffer += + 'wOmUEV8K567zpnsx3BBMcdD06VcaZPtwO2sImM5n8DZFKkhVkH0e8pMcYiejmQMg0iIZDjkJUho0F2BG+QDujc1ov0XckSCPNbUp'; +moduleBuffer += + 'nWVfb+rXZxj2KipGtZBtiGwCAFqXf8zlj93nbvJtVoOGNfKWLcgoGsoZ+vSgj6ctaZc20tenBk9DnKF68KKN9em2QHX3cbH7Htmj'; +moduleBuffer += + '/iqmRUMOswu/v8aan81WP3eXP3HZBWnhzfxASOiRACvniuw62CqqCYpU4y0JOxPig767lQ2C2k/JjTUDBJYHPrzHk5OitRtQE5rr'; +moduleBuffer += + 'WurLEvJ8Q8RGm+jl/jRev9Hvebg+78p1uXclS4XdiUyN/er3Ueopw2x/krsQRDA9NnzKSF6YdUPqQg8hFy+1z+rKR29Y+Whn7ZCa'; +moduleBuffer += + '0xtWc3pDas60J5yBNMIrc9mYpNI/WJujkDQi6Gd6Vy2YnAv/Lf2wvcVVSzUkggBSA9kLJ7MvJaodWOEla/FvE8Kpi4vfyoOroPBf'; +moduleBuffer += + 'v15tE2RObCi2vXOW2CGEDS6WyOTIbmip07b05GO3zVLeZgVle7y6mIyIH7LhJ+ishvojWwoLOatzLnpkMBQe5Xg7/Cv6CkisRAqz'; +moduleBuffer += + 'zRrKymP6kmgMIR9mo5RlL8uBZwNrAaxpWBzRaFhduns0wsr+LGKzKMwLKLK3UDHL+tk/U+p9eS9EZCv59fwiuaDDtBf2FMSO8B83'; +moduleBuffer += + 'qLusjfy938/endqIoQet81ip2PmG1y/24WbXv1jFzq9aU0spOJp6M6TgT7zcSsE/LftJ6amiloOUwhtAn0FT0jWqMmlXbvAG0GdQ'; +moduleBuffer += + 'vjG6IzGw9gSap4TZDayThbq25zZmYx36LFDIgTKaY4kYE9t4kLQDtT4Z1its/Ci/+Mj6xXM7fYoas/dXqTH7/h035mPDjfnEL60x'; +moduleBuffer += + '3/nXb8z+X6XGfOpp0hgLAxJN12LUwrChxJ/L/irlljgbwrIhJN6/1Tt9nDAQIWwacMqAtCLPvkiN8Iz8FBpf2zQiu2k8VloDkEZv'; +moduleBuffer += + '7PkOYqp0EHb3zkHY3TsHYb1nDVWxeTDqH7sx35q7MU8eozGvPHZjqm0hstvCfaVy9KluzA+tIvWQ431ya8nO6HHdIPfOkAt4orf6'; +moduleBuffer += + 'qqd8m68KUHotb1ifvUdYlDNUgwpH2+As+vNufete+r1RPbqU+tIz+qrhlPxXqNrzJblZs01tBF4kP69D9MOV5oVa2OWa9RIwYfB3'; +moduleBuffer += + 'MGvkmXBd3M3l5yrNplHLpvqqpzVWJVss1jMO1bTZ/QAaU9XiXkCQ+NeUrppqLkgTLmEWoTOeXocYatf0YqCawrZ1e896DMqziyUh'; +moduleBuffer += + '1ANtoDB8jOCCdSPsLqVTRAOV8rIbGnTPpcMVETH87G1M8oQ1HQ4RUVh+T8H9KMaxpoL6BY34bN0pv+Dr8fTAiELjaxtMdl8LNvQU'; +moduleBuffer += + 'kWVfLH/HxbZUARei7M4Qt8IYw14HtjlxMdvBDLHGIDGPP3Aa82TyAlpQ3nWWIIhUiyR3mzMPTj6tIikAMf9kiI9OKuKOPPoLWYQy'; +moduleBuffer += + 'vffE2hJJ+dphSVkiKaltUiytOF6bvlhr031ztunDkcJM06wBFgtxsYuqU2vHgDaxeT9Tm74cHqNN18paHGzTh19199xtepNRftVa'; +moduleBuffer += + 'KVAVW4Q89BSec1GGE3UXp5x6VHJqXWVdy6n+H0kbJhjzD2Yxa9WXZzFDFxK+z4DYYqlprG8aCqvDLPJl74FIAsIYo9YRqhaH8W64'; +moduleBuffer += + 'Jn/FSjfRaIkZaM0S68qyTAGVNqjZbfaeljVW5QSFKyFMAHDYWWNBC3zYOdMzSVEjjPLbhG1Q7wprxfARy8rDRN05fhZbD8jkeNyz'; +moduleBuffer += + '4XPMbNH4o15wpSy7blRIH9HeoKmRhGb8dUXjKpg0+dblQb/bM66A0EYNC7LH0VMwmPlQgzUpM9CMOLJBBWAVcGUvFhIQT6+fLbzf'; +moduleBuffer += + 'kcLxBgMd0AQIfvloVXqHi8Rtajb/IPuXKp0hlMNUv9dgwnnTPZ2o7zU8Uzy+Za+X3R9Q9LEzzb4sx0d4oKigISlkuqjFNP074pz4'; +moduleBuffer += + 'DtlHNeB2nF0gD3YxMGycbbaCDXjeygPQh4NoG06NL1J5jHT1DlOPD1+ZVYQKeWUdruEU8xVnClXzjNMwYu2ucTZaiPhaC5ClMOAw'; +moduleBuffer += + 'VshuatEYX2G4QO+uVL9AFCLjp2yJwnvJ/TpGb4YXEJ+ZbCboGrXOsJHe6W0XFDdvhQl4rkBPcmYrRmHMjtPaqj4PcznhM0IYtmPl'; +moduleBuffer += + 'UByT97NdZH0mdBHsgrEdrJSEMG9rphWfotyMsilfAg0atABUP3mcvBGnyEPgTiyOVCPyUfwGuWRAcxLfho61SUK6YUKxHMLG31Er'; +moduleBuffer += + 'nDkLYdBw9VGl5TQDignx0Vjjwaxam5dvL5K3WXJVgrENSlK3nRgbihxc2NsDPwIx9dQg7/mgpV0bwziBIw1wN2fu/soZMz25fmzH'; +moduleBuffer += + 'gdFrNm4XQnHzZ73/LnufXF4qPOZDchMX/oZix9f2eX3hCs726FQ+zbGWTFdM0/QqWMes4dFZ42m1xZScmu+oHEYLO1YOadF2TBXJ'; +moduleBuffer += + 'h/lID7mbPutptM1veUpY4cYmXRoxGyQ+2g6/OPTeTfRvnLN2pvrw8JOC8WEtNZPiyib6x64oKX1TK+QjsuXUeicwZ62G86c/Dk1j'; +moduleBuffer += + 'E512SnZfiGjDug4qkZFVsDy7O2VAdyEqYWEjm5D6g5mE54aTVnP3XGbOYxVWwZp0v1f5aQrxP48RXxXJhl6I10a0nIcvDCzmKfJf'; +moduleBuffer += + 'Zp7HJZoTncNi7yR9m3dCAYoX6+ZlyQpdmyK1owSzczIpgKyI3Vmr24QvjZ83n+krtdYo8jZ6Mm241Gc36cXKSyEYitTt1TQuVaG6'; +moduleBuffer += + 'CqfVu9ZTZ/jQkSrI6uCNC1Fdyqky1c9ua6Z2i1NodemOWkcEU0D5UUkf4NU/1VQ3BPZCghD0Df1EQ/dXYwN8kir6daqo0iWQeBRe'; +moduleBuffer += + '+F3rFewPUDyjFA/iV6F4vlI8/5dC8fxBiudXnhmO4j3q1/cGPWNG3At+wsqPa+Uzx32UYP2yVhXBUehPG6ZgCPToX6wTvti3Tba4'; +moduleBuffer += + 'v6fRpzwz07ojOEs59IYeUWFwdd+2vVYGaixrscJrw0yxTnZjpZj2bOLIHhmw4VOqIho7fEdTP4a+2u6EzmrUqnCUOhsNFGQKjoUp'; +moduleBuffer += + '9h3Yy/2RvlI42bxfD0Dya6meNnK1BtWgx21r0Ak6q8eFK2WFjlxMB7jQxmLeIOTniS/t5ULEXlnMupvAWqWWbJwya+jpXGMZOAWO'; +moduleBuffer += + 'q98Dw/U7Tavn0eNroJbLB2tZMmFf8Us1l6IYeRqPnOJUhIgZizxa92rXyJpfC512pJAmXJw46GxnXX3gy0Qydj2zvgujVH8tKrtu'; +moduleBuffer += + 'fYc3hQ9ZLOkCtx79hRc6EKOaFd7iIlzXwbJRSXux+zX3eAVXoa1KR7nU8WLvq4aedBlLiRQA6yx9xDeJnvIUx0h98mI4v5PFBb8H'; +moduleBuffer += + 'D/0QEBwhfeIjRihGxAewx42iXTx0/ay1Oo6t7yGd22+RDSbBjmfAd8G1rxfg1H4jsAuWFXde77ALEmoALDNLrUjY8wEAAKBvRLjI'; +moduleBuffer += + 'ffU9itXxyNSRmYyFAnNIXKYMcyA5WyuJUQU+P/2iPcCXcbgVG8lXs2Lf2eBDzsDTNI1Mz9HnF8rl4J+D1jxPE87Uy3Luczk9Aq0Z'; +moduleBuffer += + '6vJ+9pmoFnt6WYWl7lsENRtg2hPKQ5IP0mPD/CmElBxQTRkgGZL+W6XHVjJv8bhUo7jjLbMq5rjTng7UGVWXqSk2nY/FVHg80VBj'; +moduleBuffer += + '6W/o0faBKO15ePEkUPaK5NJJgGpdWMuNSQ2gzZx23r41/B4v/Ignmgnuarl10fxiYMEDbHBwwltlthzywpazclyk+mai1mZTdYrz'; +moduleBuffer += + '8Tk5kFw8WGtPF4tUndKRPLxoskdSIrUOh2otFZFaBzpRgqNrrdw69wDUOihrTQeGoKy17lVKFT23E+hBMT1g1Nj6kFOqKJOOHsg+'; +moduleBuffer += + 'CZkWMXpN9oWm8iRhtarAUX+khfj0QLyi8IpE/rk8Ay/5ozs2Surjn9njIeVqxnxSABx1rYT/bvbtlupDJwbmeKhzPusPY265+xLJ'; +moduleBuffer += + 'SJeBVA3Wq2G2DydFqB6lyZc4VILgdPP8lUYDV0AT6lVLi6B3D9USAKoHbahyCNivqeyB2+1Nr5wF9O6uJpgC6uDsZmp3G2e+/svu'; +moduleBuffer += + '0a37/lfr0Y/AISCna+p0EVyV/ajhrPwDIOieR5pJmfUy6YkiBFa2E890ua0l8jSQZCyhVNZZsAG+44H1Em4QL4qrQ/WG8DIi+K+X'; +moduleBuffer += + 'vTIkcbBQGqVSsYzdwCHkcZeiHM2KsdDy0vQTfikFCpaqby9Cl3E/9HUbWyYEgV4F2OiF/0onyRZmb6JHEp6Gl4IQECe44imTVIVA'; +moduleBuffer += + '2RsbWkqoeMKG+ehoqyGQ6P10geKuFXfcvsfLHlPfmrAS7iC+Z3ZQTngpKYUKbGBTAz8QsgvvQ0Ms/WJHgh7Dt2a0OsB69vDLQyth'; +moduleBuffer += + 'IQvjkuFATJe3JevI/HzDv5Se1/GG3Ky3ZQQus5HMOVAj1/OVQ77aEYRFe4PLG1q/i3kbpBaHvHV4LShfWw/vDNQ5qFxJZCbHZlPB'; +moduleBuffer += + 'YMsXdryTdVaHDsApUtg/SoMkB8S1oUrFcDLhYXyZHjmkvz7YBCthgenk/oaGggoocA/dypycmDgDhQbiUNprZJbisN5XCENPzzJ6'; +moduleBuffer += + 'iEnvxj6is0RGtHFpAZlzHqyfVC8fU4kBjmKJR8HrUtt9mft42577D85avQ/eGFW/Fwit+BkrE/Rh4+jecvy4cHrT6gZtdmIKXrVz'; +moduleBuffer += + 'zbKXyQ95byeQbTdLsaPkxKsapd8edNA6T8PtHnH/865XpfzMzONHvN/XU4NK8Dcf3EfYRbK1UBfcpxAGuee472V9xVkAMRNuthtY'; +moduleBuffer += + 'Nyq1swT7D2Hhz16icXxX9oOWcqTqNFPcKAUURvhvYUALZdW5IGR+fcxy0I5Ryb7fJA8hv/62wTM4nWY854azoPiN6ZHA8z1MBcls'; +moduleBuffer += + '42J52beiAS8d6TcSiZba1nQslin2+dcCTYOiD/sZ/YTR4t17JIryAVAi1S2Ah7FYlRMOTgLDdFxDt9zZtzWsfZtXmZDBuu2+T+71'; +moduleBuffer += + 'ilbxdVyUsS72fZImZGrG9iAeNEsztu/htmHN2JyVHJjVzZ+SB53iNZ+yxnLtfvGYLYcWbm/8lLN/o4XbrZ9y9m9kKN/Ot0vg+ffg'; +moduleBuffer += + 'Nq0Dz99k/HhTbZflEseKV5BS5c2DYtdh+eQPGyo5aRc0T/Jzq9EK7RjkiPSW/SByMvOenFcDrHahWdhkhM5h+1HtmU9DLSukh9Bn'; +moduleBuffer += + 'Vj7Rf7ZPyBS5u26f3jXKZ2f4nq6t8rmkrN+DgPTre8HZviJ1eb9ztuQz8ghr5wzfgGYXHhKlipLLxpcfqrPDQk3fBbKIdha0z/K6'; +moduleBuffer += + 'druU12WDFbKDbTPUJwF3O41SSDl7dFHH4/5mgOVqio3MTyiN3+Z0Re2vvW5zcgVBYHQfVOBDOuLhZSNfgUOzIVUP+l1z1GeM5vTS'; +moduleBuffer += + 'XbrvyD5X7fumtu8Huu9LT2M7LPf9UPf9AMTW7vvw8cPHdN+XIbmMe6KxfElt71/DjR9HCzmu6sZPU6L6lq9P8xpklhaVpjdGygHm'; +moduleBuffer += + 'TtI+3qenX17h8eiRNMpuV+e+TSW9kWsHEixoUsfRyRi618R2umXqr6z9RMkfH6zwRuCy75E1qZYxaEKo+rLlGkwDsMJcdeNaC1SA'; +moduleBuffer += + 'n+4QQIzAtwZYgeOyRM15ruTeBSzkSe982rGN4XmcakVgSguT42IBUrlcPdiuy1vnsyFjAw05qv58Nzl+HsKgG2vRHpTGy0DpkTkP'; +moduleBuffer += + 'ohBUb5fmvOrpilXhJj47JRR6yZ1eHRkhr4ltKRwUX6m4SldVFUdow69RNDmhEspxDXEL3QktMZi4WIjIoXfdLSQxe5QSQaiN/gUJ'; +moduleBuffer += + 'kU0whZEeU4kq+q7cu9yV1pZt2BF2CFuYdTmfrZ8smAerKLam/F5pis03OzCGVANCSJy42D9sifxUnfpl/+RXVow67ZpQYnCGW4UC'; +moduleBuffer += + 'oZeSWlAuRzi97AZlLNdaVSJimiGjz+AXKlRe5vAUPT2K5NW9E2jwXus++LFSRHV3aQYzVUlyKvhRC0aNgVd5uGcNBLKVhA/P+4p7'; +moduleBuffer += + 'GNQB4ZdZYHMHAB9Y1FpuO3fJZs/KZW8k1JANr9oLSsF5uxdpFPTEIlf7cF+mu/ND39vn1dRKtg2vCEp35kh40B3/PCu0pphw4KD1'; +moduleBuffer += + '/4qk1sArFervMnquJ0m1A0c87ZTbdvHj7+4TOl3M74bVwge19e3mHRjP18kd9nw9Fajzsc5DHVM+0q1wmcnHPB0Se4DQ/YE8vNkg'; +moduleBuffer += + 'x5E7/mGflVti8z5kbxikmQe32GF6UyYX6ShZ4V8jLWa1C06VYuO0+LrejcldlBZ/r3cndbH1F1se5905XQD8Ffv0bglrXnxL775g'; +moduleBuffer += + 'dy9fqb2etq3yq5R3W8uJu60EuDJ3sf4M5/Sr4cBmT/FWaI2b5UrkKNiBhASlwAAlFxE+quS2A2WAVfpPikWLlgOMTRq628xG+Q6c'; +moduleBuffer += + 'uYvaXPHOoefqHfh1j0T/PNQNP85BVCQiROomiR2aR3MiqnkUsqEWWWGdM2Qw2oVJbRRAfaaaJKoKLSl4IC5NuQyciUtbLtuDGuTI'; +moduleBuffer += + 'mdC8wZRiLkzn3e+9R/+hiFUPgdjQoEjXU1YhU+QD94CTxA1+kmYVM/iFf6gdwXtSVR5HYiWuhJXDtqXO/uBcZV56aXFH+Tl8gLe5'; +moduleBuffer += + '/TRvil2aQdiGSF8cx4SOgKF3Cqxx4ANGNOWJEq0/cy9xrhR36o2+6T4oiynKY5hAaDM0dvPajgcO4e32qDkTlLGNfA1VIaM2Zc2/'; +moduleBuffer += + 'piBS2WwoakRaz2G9DOQ6SBsCU94Du8k95Z6Y/TcoD3wNI+FyHdCCrF3LlEoGAdKCzDPEzdhTHYetYNVq9uteLaFVepuOD9GPcEbq'; +moduleBuffer += + '/9NxklisMM9iUyvLDbOa7PN+dVNIXxU+jFdqyxLoLb6N7JDDUIEAqp611KqwD7SQ7A+s7cAoBaHAd4Aw8/PWqCYrI4rRPtvLbqZQ'; +moduleBuffer += + 'IrGyiZ7wceR8L1PgB88in5riAXJJRnka2QgsiBe+uCsWRi6qpBkJLRTCwYSwZv2gDX9fVLFaFeMVybd+6AnlDmX/Df3QUC1sim9K'; +moduleBuffer += + 'WsQ0Lqre+fLPGeevh0rHO399hwectt1FbKVCPefwY6+SvjjDDxU4ldFh09xBB/d84KoGNDIPh9ulQKvFNhxyDqluToECIaFyp8BU'; +moduleBuffer += + 'Z8WwFkh4nhSzvQP/TBy0U1UJpdbYjR4v3/IBjwawNPmJN4Qd6Rlc2r1AdUJCtSCe8S9Y37FKGU8VP2sVqmO8eD+0PgOfVgYBz96n'; +moduleBuffer += + 'GiFvQO+T1vQ+2wcCrThqvpZapZAcf3g+6ThWjrJ+rezzibKSNILxGYY4+0uDE1zWjVTpCXrUwQnuiMxg7vRpJetQRWUVKS4Ce1FG'; +moduleBuffer += + '0fbguhlaCU+pifxLuw5xQBBeY01pbuN+JXU/IK+wZ8JpnsaiIlcpbFiP3RIOxW4Jh2K3hGXsFkWdBNvCXY5wrvh1ZR6sy+Mr3WFN'; +moduleBuffer += + 'RcrpOywYy67IsY8PW8cvoT/ZPzuHKYDJHPQs1iO1vSu8/WH2WeerpUKzN4BXm/U1tA1CZSFJsbDUTvagtf4CvRKS7m4x6Q5CQPk+'; +moduleBuffer += + '6nbV1rmZfRWygl00ZN1uqzkzz1Jffu9FSgFJJrcZJaq4xnwyGzoA3fcASukg4i7TUIy3M01CBecNLSVVf6sg24WHsx19GOrtQcA6'; +moduleBuffer += + 'y83bIkqpA5TgkbKXZohS4DxqiUaC6JqRTf5Gq7Rr1fGLwLAFQh582eYwXVqIKlQLwd2yAZVXyRPERcrewLNECwzhfKZ1pYN+I0i6'; +moduleBuffer += + 'C3Q9z6PEecFHB0Rv9tc/H/FeKPNoHl4e1+yZ9NyCj/aMy9K4Htz1Gu8/hwgBsoIAj91Oas6riYooR1hz5pbtxZHRdT1vbR5cvs5K'; +moduleBuffer += + 'Ki/Cifn31ndHnROOcE2bocialE+Yl7Fs/3rAyFJt/oFkurj3/8PTpto8mWL/e/cBfrFZ3PD2/3xFMX6V/Np0wXQP4QSKcIP0TT5W'; +moduleBuffer += + 'vPerH9h0RTH/qmniYmSIX9XPR7NXNoR5zRCWz+DiEW+IfFywZlPu7XzZmk03XH/5Wkk897L1nVhdXJvFnofDK4p5+FBw8TS/Ujz8'; +moduleBuffer += + 'MiCsjOXNafna5975KQ9f68tp+PhfGysWXtaB41iwfVq+Gc1sL/70CvI1lxODLFhjNudj2QeTnVfLWsNxmndrO5HaDMeITzYqudd1'; +moduleBuffer += + 'R2DBYqBT7iAk+6G/3edZ8yRYahf/KPc2FLRZc66MRNDvNiCBG90pjcyDjbZg7OcjhZd2IUCM1rRmsCBwCV4o5G0EPm6o6vbiqivO'; +moduleBuffer += + 'l49CLAWleJtmt3m6ritnyu1Ck+SNEJn63XYeWAGJTLNozUMeIpwZXgNMLujbo26s/CjfxSN5+dZNV/SL51zcBXvabUh1YpSKcI5y'; +moduleBuffer += + 'MaiO/fjgB4vwYmCBCsdPocyItCk4z9ZbW4JsF1Svn1DdsYX9bt5ej0qOrM3j7euxtH93XREWQixlil4+mcueJ1sMriyyiM5nIB2p'; +moduleBuffer += + '0PoUEU3ysT5NSWBqWyCcn/S9f/1GrqXrD7/z6w+OvQDsL+TQR4686Z3fe8+3fCaMMuHh69/79YW8H8H9xz/1o823Gd53cP+2W97x'; +moduleBuffer += + 'qlN4C4OPI5/7272P6dMUt594z7Zn8K6Fu9d9/4GAd03c7fnKGbxJcHPHN0PeCNFb8/HNv8XfGK63vSrmb8yGmz7r8becitZ8t8Gf'; +moduleBuffer += + 'WKbf0lQDhdWa5gsm056Qx7QYu3CdZXrQPdO9kYJwtSnsoiMclZqKlmgn7rc9yidkuIQ/xXQdwZPCrJcVne0WwtDXcIOGfESnj426'; +moduleBuffer += + '0c/+xdgCKDLO0+yxVp72i2eX7uqauzeKb/hVfiEccmTFd5rIDMmI1gCfHZWVU/+sW16jxa4HsLSEC0mnhc9FPs7QlIYhUyguxeRK'; +moduleBuffer += + '7RxDECRXhdyzFZZ6cWZpTfKmrRTyYOY1hYOSv9+eFKIihW/KG3JWaWvhDQgUMXOl8DYKFz6Lre8X7z5YLvpUlg3ihJL7Gc/pIDqu'; +moduleBuffer += + 'YRfmqfXdPCitfIR1FyZQybr3X3rJJMezJPCX97xJvDuv+JqQueLv5J9c8jyIK56wOE+LC9Mu4HP5kfm5p6+xAq3i0zQcaYERGpfL'; +moduleBuffer += + 'vd/dS61LS7UurbwltHGlmcIvumss4y+nzGmpMkcPEA/Iu0VIAX7Lxh14g/pt5OoW4O/shdY9I9zes3ji8M0ILBDekG9G8ab38vx5'; +moduleBuffer += + 'snPSED40+2JT5YN+dl/zOB4Z1s/Dn9MjI/0rGy9tykp63bHOFOF6GmpSLw2ZU7ehkpQEtE7FKst6PgUo0UW95lq1pQQiClh68Mp0'; +moduleBuffer += + 'L4XEWtZSMg39mfd7ktSQLMweddUyDBJCMP48VMJ22LmdusOglUPd5mtEgyl3eMGpOvsSrZuW9zwNScsD29IeD1y56kcWa4zmiR5z'; +moduleBuffer += + 'jvcIPZr1ErXuaaompbXe/W+tLLZZYSZl6BrwGoeE5FT5kazLG8JfrsujdXm4DrymWccIe+evB5akr5W8vYQ3hBlNyRsHJW8clLyx'; +moduleBuffer += + 'SuOhwBeGWO0vEeJK/nmu1dLy18aNveg/IUFmDLQa1A24CBc/X/TDdJcV6UlXenrQKJ7YRREBcGluUWmBHJ3xy4ol19JEPCTbOBZ4'; +moduleBuffer += + 'g9ooCHhcCTBOpg1PMSNv02BSA2tR9N2uolua0lPERfHjJgulvLyI0HcssrAm7lpaaZ6KW1uuV2zhTVlucbPeu3JTdlBPTWLVjup0'; +moduleBuffer += + '02aMP1TAVBHUKCo3NoIaBCaRdRmxViU4u3V4YMJosxKjdkkt01W2WC73H1QQTE9BMPHxYvbBvRaL3pPPSeuOeuvgg0e/9bB7612l'; +moduleBuffer += + 'IHmm6fr9wEN3w92HgojiXJwQSV1CYTHD89bgnHjuOmETZ2Y2Qxw383vX4zwIeZQsRD31qewGMpb3J1xw2xxEvZweKLkwPGXgvPIn'; +moduleBuffer += + '1NzxcyfDykIYI8Z5hQHHOxNI64Xsh+RH/syeY0tRkmT5SFQJhvRG5T+RyofkSPPJxMqccBh/r9GDUvaDxBoo/CCxhyG4H34kIq2y'; +moduleBuffer += + '5yvk2w4qhyMZXFV+mJQiozt8E2nHzfpOsHX/K/Z6+i6F71N9hlGwYSpjOBXAC76bSKeqIdMmaIK0+vjWR9QhTksAtGyEnt4CRktN'; +moduleBuffer += + 'MA4yYAZsgt4QEJNWKwrRt3RSxE7SCDUHnWPlrG8VmwTnFM6MKtFNVxYz16zvIviEMHvFf+2CXnghUUKLj+3Z60EopJvG3Xus+tWH'; +moduleBuffer += + '/GqPfSYlaMKsTRCisq5I/midbgWz7iWv+LjN0CMZCvRFZk2pooz7Xc/qOtWbAMATTu7SOKbcpaFyl4bKXRoqd2kMyl2QTYUtjV+u'; +moduleBuffer += + 'sKVRE7Z8sxK2lEFGMFHfHytyf2T16FZmXXM8ov3oWaZtVH9GnRuUXoto4Jm9J6W7lbGkz+o4UfSdcVq39Nf9r+bcDG+v22JdmonS'; +moduleBuffer += + 'oWFZtl/KaYYzRIPCbspp7p+jjUr0sg8MNzNwzawZ00udvwN7AkiRtJKhmmXeElgPPeicztS5rbIhLdWvdx1b5h+zZX5V8eO2LKi3'; +moduleBuffer += + '7POR362UghUHIwOxpGsxV4lxeUqXGJUnd4kxOdklRCS8D+WyqEuYx4kuMRpP6hK+dH6XOIvjXYIkLuiOKwws7VTmdYlSONYlxGDW'; +moduleBuffer += + 'JT5gpzuheLNE5hvtEna01SW6XtolNB6jQqzw4i7h7RpdYtMlXQLLNbtEBo0AiLfCC7s57cC63TIMFLRW8QYalfV6hblqPW3UipEN'; +moduleBuffer += + '6+lukS/Jc5hX5F34M+e9IlhXTOBZLs9OLcwG4WRieemUoiWPFxfz8AzmuJNFuEF4nVCenQyzNMl37rpiHI8n5PFJ+GjC703gY5J1'; +moduleBuffer += + 'dF2xEI/H5fGCfCG/uohfTcqvZvJsHF9t8Kvz+dV5+tU2RAT4asyvZvxqo/wqgI1G8dWIXx3hV+PyqxCbITIZvtrhV6Pyq/Dof1kE'; +moduleBuffer += + 'cumvU2mcoXk/3SpAepYxltVS2jyv8Jb3mOQRJ0j5gmXrNLqGRtuwUZPhUMSbxXqzmDcTejPBGxuhY5w3md5kvGlbtTBvEr1JeBPq'; +moduleBuffer += + 'TcibUs96+4DNGeXlILywpbNhZ63utxawTnW/uTP+yvvZEZplEyYIKodvNlXR4dtPUgegyrSJOcvK1Ibs7dKH1h3Y2fxpLbfjJGNq'; +moduleBuffer += + '+N15QFGe7NDbfNZWCMQqPaTwCwcYmLDnK79HvnS/JoVMAhN7Xi9Sc1wY51ciYHUXwCMLd1aMnS17CY0H2/YgI5dRNR601XVGt9ts'; +moduleBuffer += + 'd1aKFiuhlMPNQ9Q1BrSegyucsa5warb0Tdk61LNtpNAtpTDEEGhd1uGRi+dkdIj1iqPTBw1qBl5O6QTtU/qtr3hFcGV2jdVcpLPY'; +moduleBuffer += + 'P+E9erQi/Vj/KWsApfhCr4Rsa6XtzshoNjZvfHx8vtR1NC0C+QvlL5K/WP6a8teSv7b8Tcnfc+RvnvzNl79x+Vsgfwvlb5H8Tcjf'; +moduleBuffer += + 'yfJ3Kg9mYG+zQ/T3vKrIeR46fKQhfMFV69enH6z0cdZSfFgf58+lj/OdPs4v9XF+TR8HUylVxjFeo18p4xjfgFuQVcYFqozzVRlX'; +moduleBuffer += + 'ek+Z+l4YOC0cX1Qt3JsDxxUi8Bm9h2AvTuXY4P73l4F6kMV2G+w17EZYNIV3+ULiwvLlNRQRGxEzZCDvcmOMTjeXdxNDL6JL7HYL'; +moduleBuffer += + 't8CVZDFhzARpuclupZnT4IasZlhtFxbw/VCoh1a1UzInwB2Ia8xJPMycWK7EsiNSzp1BKrlc3E5Xmsx2u1WHqofRc7izTKslpXlp'; +moduleBuffer += + '+osmli9FZQ67b5e+bhGw9ktnt2RlbWePNFRc+o0mfEnd2DQYEARjE2hXYLB8dUGKdIj+1naqqz/0V0WWt7ZPIjWzgxRpxHf6nETV'; +moduleBuffer += + 'WAXWVN8quCIdqwbGqiXFNjBWFqGmkbcwVg0NT+3GqlFh2JRWBWpHH+j899QVdKI6kQeqpC9P5AFZP/5KTqvC9w4spIjcwBl+JkzV'; +moduleBuffer += + 'W0et2+5vXhRuKm7xGU2xTBMiVUylRHlva2QAxBpP+tnmUEUeIdSBfq5PAuFqBp+Y6sn8wSdB9WR88ElYPVkw+CSqniwsnwSOLzTF'; +moduleBuffer += + '17zstQlk/Z6u9eGJE+NJBi1nNFceco3hMZ8Ex3xijvnEP9YTF89XY1A/FeMZ63ge+YSvTuBc4Abid25LSdlhTR0y+1DYLexXw8Om'; +moduleBuffer += + 'T+OjBjSonswfHrbyyfjwsJVPhgY0rp4cZ0CTYw5oY8jWXkd4OGvTGiE9PUYc4533awSuUc8Z1QlcY4DAtVbW0KQalsDdXcoIZ0qR'; +moduleBuffer += + 'BIMXZJsxbYTyRLrZXOIOUIEwQYQPobewozzBnKdTtYm6jttgLbbIB5yTedmGYO5+aNuAKGUbopUDm6m2Yccx27Aj/DnbwAqXRnxS'; +moduleBuffer += + '4aemph9pmM5xthO3s0Jtbi1WI7e5Jm47aeaR3UXUZbG+fUS6fSRnaUTnavvI3PYRuu0jO9b2Eda2+pYyUknRvqLbVnNAnyZCbcYb'; +moduleBuffer += + 'UWfsFux2E9smbQLaFB3FvuwyQ+xL0/IdRatkX6Ih9iVS9iXiIizZl9C1KayxL6G2iR0Ylm0Kh9mX1LVp1RUaAzHsNtmmjraJ0oQU'; +moduleBuffer += + 'bYqOmlHN7Hq7KjI3o9w2rx+fa0bFtY+TLQJpHc2bjneKkWlEi5FknKvADdXTpVojDI7JmOEDXNBQEpTdIwqc5LigaGjaKtqDvjs0'; +moduleBuffer += + 'bSNpBXs7rk/bPLV9eAFNF6S0tCwtkuPvqmnpyCYMJuBEktJdG1VIyyokg6yazaDxQDlaVRUSrUJiGbHQVqHlaD7li1Jaq1aFdtGe'; +moduleBuffer += + '7ipyDvn51MJ/eTT6OBapDI9NKrP64nWkcudwvG5rKnqptV2nRcufcd2Oq2E7jJ5qvCyRUYBntOXNFqfBasTsGUEZYmNrFM6BxGCl'; +moduleBuffer += + 'T278nCTOea61iXBrgbffPXiEN86H68537x304Xqn8+EiBINz44KV9oTZBDyK3LqHQWmtdotQRBPsX92o21Xp9w6Xvt2WHtAvjGI/'; +moduleBuffer += + 'etO7Qkvz9FvoqkcECbmgm1ZUsdfpTQOnk295l1D40LyELgHG6r69YslVknFU7fKGYGf4kG6Rvj1jB/Y1n3qEo6FqfH0n6MPgP6h5'; +moduleBuffer += + 'nJ6nQdrDYwZphzzMhWcP4SwR2vDsamV4dCB2k7oXa5HbGVqtCs1OpcJgXPY5Q7J7jMae5tbJ9HvWvBNxGRvuIBBVNR0Myeg0Lj2a'; +moduleBuffer += + 'dyE6tu8mn1p8Uc/w1Vfd7WWPGQZvLN9IBt7AF407yGYw5kqsLsfSUyWC4xo9/lUJtBx9VVQgbmAM0yMZac5pYgDLyQxiOg34AyVF'; +moduleBuffer += + 'Uz2gfAusZqET4tPNhpWkfEoyfCJqfBdg9UluqwgWBKez4qEb2Q71lI4AA6a89Al2w03aDVUUvYd/1r5WGD2GaZWPWF2XfuRmhScv'; +moduleBuffer += + 'fnJ4j5f9qOxrfSMZeAMo8v5QX5ejAJO4gb5+ZdnXU7ar7z26q5+HKIHs6qnj9PTztKcVv2eop1nBsqc3aytcT2/zaz19Ap3wHn29'; +moduleBuffer += + '6untxgQq9CuVvhC6neWp+lf12UYvvlqP+XoWgu0UBFw02DrivSCP13i/l8eXT6pv6nzY2MiluOueu61Zr9xdoHRG6rfdQZ/Ha/7j'; +moduleBuffer += + 'y6SExpbNLBv0SdIaWxgcPZUC5hf3VkXw3XM80A7kldaO0/9a1c1e9rZAIzAHCshCURLFu1aUFFbkP6yUD1YJPMo6Fg/cU0WGNA6o'; +moduleBuffer += + '8K1CUK+BF1Ie7FxzxL/+atgenB4sA1iGXG64Pg9vWBkAUVBSc03Nb8gjTc81fULTJ8r0CU3PND0r0zNNTzQ9KdM1vjMGoqdwLfLd'; +moduleBuffer += + 'CHje6R+U8jodxbBvZZQUrzkMRdlgrD1H+9hdUZq2GydUe+GchdvO/kUKfnOFTKKWH/Q5vt1G1anHBoQLfs3Z+DUxaT3VM7LmnrSm'; +moduleBuffer += + '88tpx18sHMwZWKhz62Bo3Y7pFljLpWbrWemC/IFAwRQPlQv/HFlE2UwCXvI8ROTFD+f5QlpAJhcg8Mq4L+9bI5S8kd0Wg3mZ6iaW'; +moduleBuffer += + 'hoUwbWnpqxqe4FKpelMFp0l2pFV7p1HmhjCgmfOxn/3PZpmjOVBeCP4+USklDocB1hn06ngxe4Jm5ZGSrjOro0FTjwYte9Y+OkNS'; +moduleBuffer += + 'y0BO2CgBS6wXz9FvNKo3Ut2T0I/0b3YHQx4LGWwjKBlL8PRzMJZJX4lpqT5s1IXBsdUO/JsO25PHH7Ynf95he/JpO2x7fhWG7fDx'; +moduleBuffer += + 'h+3wzztsh5+2w3b3UzRsW/3Kb1GHwQ1biGGzApdz3JnNYphE2ctVguUE8LWa3RPUNBTtuWRxbHe9ZrWDHBr+i9XsZces2V3m37Zm'; +moduleBuffer += + 'W45Zs7/+N+6za49Zs795imr21X9D8qARXNz/28cjFcNZfy6yMVTI05WEfPIpIiEHnh5De6Lj+osP6tN2RD/1FI3oJ54GI3pCw/kL'; +moduleBuffer += + 'juXTdiA/8avAlF2XHpcpuy79OZmy69Jf9WF7m196opvSZMFhSQfZ57CPe4rsk4TnFbSVXuE17QnYI3qDxYWNLuhohE0ckj8XIZ+n'; +moduleBuffer += + '2QFkA9szGPPSv88d7/0yrBm85yG87YXqQg9pAC2kb3KIBFbHRacET/2g+8UR2lONroNgeb2UvxJqldZFk/oVf5phNbOL0FFXdb21'; +moduleBuffer += + 'HdqOIqaCV1yr8HJyVxx4zT0W6hlSkINqUMzyJSsc86aza5xCJL35Z6rQV7xffo1eP1wjdLwptFaeq5U5Vq0gH4VlmzyUKkEun12m'; +moduleBuffer += + 'DuKolrHVMseslldVy6tXa1swZHdMx4YS2gY2hrLUzoFAjZoKPEcICUXzPVMTluplMTUYWZ+xcorFqrhVH6A64JvagUvXThN2JlLY'; +moduleBuffer += + 'mRBGcpQIVnFDqTXxix2vUa2Jr1oTv/haCR3svLp8qzgJaBkA/y562u+SNzVAacCSB4rdP1zsG/2fXiyUC9LDUuxpFgYuKH6E23n0'; +moduleBuffer += + 'IlPfIsSJUshhM4Q37Mw/JypUY0L9ZBTLwtCUqMZG4y5SU7Wv1N/vKiOibv303Z4VDxvKgl1cHRk3ILpsm3nEIw5BqI4f1huDeXtB'; +moduleBuffer += + '9n714LKy+9B6Q5yGIstgG0JXrvVJKGw2Cp1hYCH5t7ioK67g7CFGPHG5e16pGLBy6aoVB2PXii1fuNuz6gQz4MJ+rFbMqlOTxk3N'; +moduleBuffer += + 'PqetsHLxWiu2mXortmorbDYqKY5qhS04+7ZrhQtN5ITucNmXt27QuB25xtnQSDehikkTYqgbIs5DLZh9kOpe/FwL1aBzDKSg9Yul'; +moduleBuffer += + 'H+CAGaRDzHTJhXNJUAPaVFNg0lGCOmhPQlie3aihEiDD1wiiCtD5xwrtC8E36HamUERtVTomdGlzWmM/210ifWKiIsKfSYu/AHju'; +moduleBuffer += + 'KYrzb528SktjzeSngw9K+L9fXk2//hTX9I0DBrKqlLI4tzIBifUb2g1V7lKzqbiWoboMYUsvhcKXFieAuAC4w2VQWMYKiB0WnoXM'; +moduleBuffer += + 'XreWGbF3Zt+zcWpo7OoBbq+Ur0dnWRNsje3UqFnuyl59tg/zfP9sX6McZ1f1GggETyJ1VS9B4HcQXJLcXIPGwZi6SfuLXiy/L1Cg'; +moduleBuffer += + 'Esu3NYtxYoWaAKijIaDyDYzGwJq1j05jJJ2hNA83Pm7884ETw66qklKFb/NRcxkwxZWdr5ZlI30EoscOl/YRi95zAbODM/zkbD+k'; +moduleBuffer += + 'QxOMElsM6ZvWuuYW34SWqJQW7rt+eLdHRss5jEUKwMigAHAYAwhTt6FeePDAU4exKdhfBtmlMC/V12PE4RjwFothZDzoP6euYTU0'; +moduleBuffer += + 'JQQ7WGAWbApsQMURqdRIYSOsgO1WZeQq3RyzAaC8H9PDx8LkKZBR9vKGjVQk/Fy2w3dAo3l0hvdbcOxb4Z1T2XFDpbiqNKeQ0keM'; +moduleBuffer += + 'CaBMRNdGxbn9YgVr2sgDDEEjNxiChhoRNbgssFHy8Zg+ziT9dc/GuDWIuadc8qrSKKs02YE+7tNUfmbdRcba7bhzRL5IAfAWwZe6'; +moduleBuffer += + 'yLKvWPsd44x/wBVpT+yn514M6L/v0SPiEne+GDLLlEcXOhuppOgw7vEab6UXOfUmnRGLTvbpQPNaGzFgUAoHAWNLA7efFi6t7ii7'; +moduleBuffer += + 'uEuIy6Sb4dIAAAR8gcZwibodXMLuPFwCOZ8YALHOh+UO2Wgy0dkPiHIpldaPjqvxJvLMz5vl06Y+na8GnHg6L++UTzv6dJ4aceLp'; +moduleBuffer += + 'WN4un7b16RieNvg0y9PyaapPMzxN+HQ0b5VPW/p0FE/lgFU8OlIcGJXue87Fk7nMwWbeAfyEvHA91awXlr4sxNaxFrNGYRfvV98Q'; +moduleBuffer += + 'O7Tm9ODy3gQ0oEE+kS/ann3Ib7d1uhbhepkJsAxWN4FQ/dDyQGccduDTZZgXqdOJKe4rbY0CTJxEbfbCdtOCJzEwTmnVl6g7UtMC'; +moduleBuffer += + 'dqLEpvojuE8yLZkjrYG0Jgr8jOdglAJQIxQ47uBAj87R1BzzkSOcM0dHc8xDjmDOHArhl49ZnM05cqSaI3NuiUfnaGmOUe5j2iZ7'; +moduleBuffer += + 'UFGrLlllZ/gZ94mihZPmvL4FbwlAEeJivqMIgfXdJiOiX8uQYeKokQirfk6tGR3JTmk6Hzk/okUrLcSd/GP9iCaYBBy883onraR7'; +moduleBuffer += + 'qUwlZmzgXT5v5Cfh4NHAKkYOrzycMxI9qI/MKDuHGphQprxxTpe/KIka+8VJ1BCBGi0JVGOQQI3WCdQFio47UhGojhKothKoVAlU'; +moduleBuffer += + 'SwlUUwlUogSqoQQqVgIVCWUiuRpXcrVAydVCWX1jc5ErZWbLCiPXwnwBn0syTQtl028WcLYmQj1fW+C6Q7KP5/PnpG8xCzsWfWvw'; +moduleBuffer += + '6bHoW8Knx6JvTT6dm76p0Ijm9/mCp5ay7QzanTplGzsWZWv/tFXbbh2do2AoMEfQ4OEN9kjp14kQP0foxgYJ3YmR2GiOl386DZyb'; +moduleBuffer += + 'wtVp4NwUrk4D56ZwNRr4q0jh/BqF80+cwqWM80wfWVm2IyU88oiDR8Y3R4ZwkUeGcJFHSlzkovKrAKsqn9YQMm+PraPmiEoifm7G'; +moduleBuffer += + '9h//vTO2e5+WjO2eXzO2v2Zsf83Y/vsj+78MxvYESdS/KmO759eM7a8Z218ztr9mbJ/mjO27KgASc0xdJQJ+Dukq6wGq7vjxrFeo'; +moduleBuffer += + 'nqG4VX5nh42GqNmFB7HVQRqng9yPVMA2tvvFbpudRuyfwYMqxNTXcNuoh5h6B3RQOfXUCDJ++MiR4ApCKU4rLA6Tzr1C8RXzaQuP'; +moduleBuffer += + 'Q3jFaQuPQ5DFaQuPQ6jFaQuPQ4t5F4SNDuPTFh6HPTet2ir5xGH5BBn5aYf+/vVDNskDMORT0qe7v7Kn7NMd8rvs07vw4Kg+vQ+p'; +moduleBuffer += + 'tk/32ezs06/iQdWn38HtQJ9eB6ic8JoydAp9duTvokmNSkX4D0NgzDzM3klzRkZz6DWIk72xl2zsNTED47z5gp00G5FkoNS/YOfG'; +moduleBuffer += + 'jYjWBZ2BBi7rqjNhV8EzbTThOH1V5TphSjRKU6JRDnvv0J3WwrObOrikGQKXNEPgkqYGzw6QOLTTQQsFRDIiGvurrc3JbELNCq1N'; +moduleBuffer += + 'ZhsMCWIjWMkGGRPZpdjfIFiZVYD1e1H2fyMeKyD+5F+ub4NbC4IcuYwyFkOPLVgmBny2YcnbbGJtYOrziTpYYXtuak2q4pVuvNl3'; +moduleBuffer += + 'YtfItmsTuseENuAJX5IHz/Cz0yZ7PvWNfvbXFjgS9Oi4RQA6qak0hQpLS7U5h27VYIorvMy6PyL2SFLTNjLuEAIYahA4hWNAcPOi'; +moduleBuffer += + 'bYO29nysXfWZ9TRUu4sH0S4CjTWjGGyuUJxztUQCR5WRzRkKnQCzOaJihumOoK4q0ylu+kSilK7EzOzFRERUD+8YnlYeg8sVR+DO'; +moduleBuffer += + 'ipRp2p3QoStY7vkIiaLhR60TOr2CIq1KxOA4pdqyjnpAql8CBYWKEBSeV0NAYCjhcJlG64AuzrfbWx5ovCMLzUfAn7BnFK+M8Zeo'; +moduleBuffer += + 'OI9gpgafI1PzQc6ZjRfhRxUMyMbRSfrZ64SxgyMtZ0Lo4hbjK4Vh2C1p0HLnkH9Sn1uZfs/TbdFM9RorvTH1TmaqLP+VnlXfp30b'; +moduleBuffer += + 'WKu41lSB5rGQUtX+ewxJgHn0T5GGEFSsxookRdoDkfYAIzMFA3jAmC4WU+LHLWeQlyBSh3Lk7NrvxsREYKgp9n22s6lRxjTUFfKC'; +moduleBuffer += + 'eQwVabWnmEGAFBiH11sgnRoCtldOG8XXoW0PywBkcfHNekJQQzjADGnr4DFYOYHpikO3z9IAJ1hjYIATFEthURQgRNtyzXWOXB5+'; +moduleBuffer += + '5SxtjrBXqF0Ofq2ilRGDcKuFDuxz3ooICdjRFULZ1OLGkS/y+Dtl7DMgsNEeoEJkCpVxGu0XM2+QHfmvOO9cdDjOCEVgUmhIoQS5'; +moduleBuffer += + 'RaoDSGYPqz+yMq7IWt9FGsQb7I9kL0xq3ao5kDqHGxqyCvxOQ97GsewChxKiIrUqBJcONIOmwvg+e3cj3FR40WllmJjQutqjDY9+'; +moduleBuffer += + 'eS/aoOaSnDMueAuWZqLhd1mMNCRWS8h4YHlFGsy7QXfVs8je+VXNAYeG2gNIukHgbj0cwsgBB8OOIX4YUAw6ChWmI2FS55qvsfMs'; +moduleBuffer += + '1Gf6mWYNj7lhe5Wus3cBm3Rc0Wbv8u1XDloPwVm6hHrF49+WTf3MbCfxsNipROzIoMeHrUmIy2IumYONEpc3tE7T/4CteVdEN977'; +moduleBuffer += + 'eDK8P8z+pVEdeHdFiqBrilt80K9dxOPdHfXV0Kn+r1BxKRcWXLAIuIBuswcIzRs6EFm/2GEUoPYh2FH6iGACw40HhGFQGHsfZcsL'; +moduleBuffer += + 'zmwJwep2Rdbz12dVfXbIRyx21c1+kWig513cWLf6Lu6cD/Dlm4Uj3wHy/bqHpJ9Oln6Sjr2etrkHwtL+pjOwtdl4RKdLj1ToX8px'; +moduleBuffer += + 'SY/cGZ1lHoCbsjQFTP1j35KCl6BgUzzQ6GcP4tlWdtadxtJKZ+52hwG3hDhKpFe6aTU1Jrj2nTJuspDZaCmv+MaDezxteXHXN4W5'; +moduleBuffer += + '29mgheOdcr8bY/8sfNov/pz9c5dGnAnO8mz774zki97r7BcDpc+Swv37YMN5XR933hwo8ZxvbeIjs77Om0Mx5802ygZub2Y/qc2b'; +moduleBuffer += + 'Q7GbN7dzxhzg7vd43NeRrf8r80bK1XkzpdNG7jltpuys2R/qrPmWnTX3R5g19zarWSMlS35nsodZcyi2nvk+K6qz5sN21mwzbtbo'; +moduleBuffer += + 'UpCxrM+abfL+/nDOWXNr86fNmm3NOWbNY7ITSH0NmjI8a+5t2lmzg111Xzg0a+4NMWu2mblmjfZcOWvYaCnPzRpp+cCseSwenDXv'; +moduleBuffer += + 'Yv88EQ/NmsdizJrbzJyz5kCTewFIEwatoRZmPBdL+o08pjFuVmSxgXRO5MHFCNPMaFEwTLrIutAvF1br45t+W/EwYLBERAxF27eZ'; +moduleBuffer += + 'ApvpEs0k6eczOFdOTl6G5jNgnBz7F5bsn5duqcJHB3oa02AmazvmZBW/eNkBxhRu44PWRTtgfNZc0d81HjSeEZ/XY1RM5QYNeUMy'; +moduleBuffer += + '70HRHHzFZyzzDE9yC/bpDxscj1cGxwBLCVZ7MDHOCbdSWDPjrTeBDZjShDx3hsq5QqYsp8Rxop99wXeRQgEbXx55xkvwVPIHo2kx'; +moduleBuffer += + 'e5M10D23X+zC74dutja67zjGyVUxqr0eD69GD6+hHl4DObxyXn30yVmsk9rBFOfYh5+sZAP3P1k77D+KB217MHUnXxxltxyeRbjr'; +moduleBuffer += + '1+IS6In2cby4IyjPG9f7ZWQAi+i5rCeMxqVAzZcP2UnHS5IiNMQKbwrxOOViQ0JoZsPMFbSnZEaAqd0xhXUx55YckeiVAPwV4qnk'; +moduleBuffer += + 'FkTl7Tg4J9dYOA3UQzoetoFywcSHaTO+fbpQ0gaDAADtEM+auGRAVMazVGMsAAg5VYFkC6AJgSw2leGVYRgulLsGwaTyGOGpCFYG'; +moduleBuffer += + 'TjBUtAZlE7PvgHXTiB6/yHj+4Ct75hjPueQSHM+X379n7vG8HQ9axbtxseN5i/yuj+fVxKNwWBDAJNxIrIhevObcV+TxmlWvuIE4'; +moduleBuffer += + 'GjdsZDg2SV6B5IDJsSRTAIYXE0JN5BHei/hexPf4YtKL8GLEFyP7YgLz13BThfLa0yDIvVBjX1u7ZBIZUhbScgWgP8tYa1nGdW1r'; +moduleBuffer += + 'CI+sZxhQHrNnWsMu6gGX9Egq2HFWzWrvbFTKdDTKRPrBsIxpawMUyEPatQqfsKWFM/xpA/GvqQ15W5MHTRp1P5jUDJDZRG1polUN'; +moduleBuffer += + 'pxHdE7viZZMaQ4LhuJVYtBXYhcsje00zu42gNRR+AAA5207x/AQ0ICu8k8iQ4pUV3snZNxouOMrcpKiMRrxYT/Ru/2QRspE4y+Rc'; +moduleBuffer += + 'gyuXkHZs+A0WYddqyEm4ofGBYtwb2I6tcbnMzxosB04E63D2tWcR+DlQnFJvos8m4mu3kGyglb62UuNUD7TSr7fSH2qlf3QrfddK'; +moduleBuffer += + 'Xw9HFqWjPJD5S1UcpYeZQ68X4veXRA4ebpk91qh8HwVZ4+D/oqv+QGkZnEkTi1lEDkTW1d5okeOjxY4v7yHeGEhagZ0lL3bbJLwm'; +moduleBuffer += + 'X9/jQj8oQdlSGbVryRxX4YIh0ngS0q3FZZBogmYnK3neHYdk7JsNrIlsf4IBnOA5vG/FHIAj5rmce3bOvOpPXcqhApzDKajjZvoJ'; +moduleBuffer += + 'K6QrzeuP2kzt/qg75QRxyxZzxgCObV+rF3QIW65xiCmg5Lm/G+HwRh7BL54jXMbJZD/chh/h1ZB+UWGKMn7KNK+PWaALbGCOp/v/'; +moduleBuffer += + 'VRryoPfLb8l7Gg6vusJ5VooVW4oVuOO9LsUAxIpMa1t3cz31y4L80l9FA+QqtOQqgDtBHl5KcsVtS3JeNpm9pWFXblQsVYDs3ApL'; +moduleBuffer += + 'lUB7pE8UEN3PHZ8H87Di3P1UAX8CJddtlTyyC6Sahy0GU+mqwV2e0zHUnlpcjw5EFw+VPlxbk5XmVrKwVFPPZ9TlvE+ZnZ3mFKct'; +moduleBuffer += + '7TXACDS2V98jIGOYfSi2gnNh9/4aqFpRfbyiIdIjn1o2RHpQTvbmFoqg+EYJiIo96ZCpBDYmFJIlsDEIrH8MAhuUBHaq3GYsgTXV'; +moduleBuffer += + 'LCm8aoRMbYRqNEQ+fH1DfUZKqHnrOQJ0NM8MDBfvXN9aoaVuE/SyOUyR6LjUujZiQkAmcCwLy/gkAT1xji7JceyMs1ANltUkL6+i'; +moduleBuffer += + 'EZg5B8sMDJYpB+un7YbDg2XcYBlL3hUQsdwnAhpBEMNTKPUTr7+b+4Q/OEA1cW6q4wuZl97fEJT+NQ3FMCwaEBgjoKQG85X1dgEC'; +moduleBuffer += + 'Mq2lpwj1OCHj84CEhMWzLxDqQekBRXXluPlF0C82roOkn7J0BLBgIAM5AU72Ag0WDO8UhA+DoP3Z5xPmWYMGo9CcCiOhCBd3jEaC'; +moduleBuffer += + 'SKZJ0IK0ePcDu//BoHrFzHWbGc+6T2d5fXBlrzmdN9frs0SJonuSTOfJ+nXFzLXXbf5jeyFitQYxiS7twK1FKgnDiGdL+1wlA1tJ'; +moduleBuffer += + 'HAy7oTLEDA4foK5wCYqkc5V5i9WFqcGpe36Xka4j+LyG6xmkmNjBsund03Tiv23H59KPxaD/3cNzHbi2PFIduB5/uHbguvGRYxy4'; +moduleBuffer += + 'djzCA9f7HqkOXFsfGTxwvfVYNTS1c0Q4VzXrOs25zoKMxP3uw05PbGo6zX2HKz3xnYc1O/VYnzw8rBje7MtE5pcYBQqu+3JZ1u+y'; +moduleBuffer += + 'vxNGzoq61LhIZblEoot6DR70VWkTdxWDDZIJH/EAjY0HeDl1CJD3MneP+iaIGiCeQEFlMEBVg5WUEL7oXAq3/p2cfCalupR9eHYz'; +moduleBuffer += + '0lYaVQiYYlYyDcCjPuopPKqxkv85EFItgKhfHMAXEMuRIpHiPtxignUDB6KaB9Bqqhe2KV1pbWx7BAILioP7hX7cHxBSdGeafbm5'; +moduleBuffer += + 'GqdleIcJESimbNRpPEfUaT/7aJAr1uiFFEkTF7JvbxFserV3M1z93ktWEm+h1K9A2DVDN9TXDXj2q0+exj4MimdpLEREQ+j5Y8br'; +moduleBuffer += + 'WBUl59m1JruO7pOypIoZDeNnw9ZI1rVOQASTq56+x2PJaO5NU64/FnkaIeVZfKEblga4YbqtqUeu3PEioaqawErb3U3DVpA2C0cT'; +moduleBuffer += + 'k6PBYwX9m6IZmfI1wM6XHngQ2A1xdp31ObSrx4WjloYCNpYUWzY6z/gpGbbPef3iIFj/D2tgepwyzqSzNsjMhPY2viEFDxdigoiK'; +moduleBuffer += + '0TNpdVTtBmoH047omjvwBf94+f3q88v080trn99uEQ6nLMLhc4iWPUcLVni/CSEMgr/HPPI42FCLKlruqwzFOKFxd+SwMqFfX7qS'; +moduleBuffer += + 'OjFwKVanT2sfYN/rPWnJsRoh+Za6Q9eE+8Ezje4uU6r1BvNjAMHhOzn2Cu/M+ulyoGDfmkEZVHNcJ0fmCpMl+vK5hxwfcKxJNeRm'; +moduleBuffer += + 'uMPIXnDIWfDEQMHDhXDIDVvvz1FJDrkZHvJj5/erzy/Tzy+tff6WUBE3OOSmHPKjW4Ahx3dXYVWYasgNh9zUh9yUQ+5jyJW3Koc8'; +moduleBuffer += + 'rA+5GRjyYzaCnKY9n0y4H1ReDpy0Tak2PGhP2nNPH+WgjNUaGp08qh0PK96PLHlYWqREVdROT23KXNROx7K37b3VmSbZTDAXC+eC'; +moduleBuffer += + 'O6QbGdlKZxPtdDo8SV1MBi3Y0A2VVTLcxXQ3nAbQBg5Oa/Nw7XqIveV33wKvCgNGkdrzO2CEJS+jz4DRi/L4hWDvTFoc8dNRmUHp'; +moduleBuffer += + 'R2qGOo4aZu5gZTXvptS8m9xXeNTvxnqQquRJO5u1A9X57ug5XuOOaweq+lhldqxufINyu8Ec59JqrDI7Vuy511ZMjK+4KANxoAhZ'; +moduleBuffer += + 'PhAFyoORgosC5ficsGsspIoyI9iVbCAovZGN7jVRmn086VEyFNYkQ+2K5GmIx/RPVfIZUmipMLnRmt+EjPLZlFEuegVkl5SJJgqT'; +moduleBuffer += + 'mxAmd6PcYE1sHMLRDTiWtIrqNSRnnDeuRzlLUeSpLPIkFAmY3dcNqSMgYl7FxcoGPsPPVqqw85yeKiLwexUVEbkyJ8V+XxUVRqfB'; +moduleBuffer += + '5m/uVa4GTIyyLMv7PUVJ4Wok+sgy/WdC19IbZbLXID9ePzTDdGr9hQ0AqTaRJ3pq//vhU/vxJpkewSb0CDZ8ak8PRSZV0UZp1+Fr'; +moduleBuffer += + 'YEPDGIYaJZeXczRxlXJHhdlgzTWIsBLwZNlrSX/WRbeUbUpX+Yy3BzvCwlxVhMLTPRnRHqWXqkwt5FRZacZ1Hieq/ajewbSgINiu'; +moduleBuffer += + 'tKQXT19MdjMGMyMFfjlGGAYYda3JXwFj1oSdLO2usz0T9YjHag7rIhcHOt1kNYxg8iW0b7Wh/ELICTYwGjcqMLIdFiAYoCaRCJoM'; +moduleBuffer += + 'XVviheM0inCWTpMWOjM4NfOhuVIlTGIsIip2Gmr0JeRlDYMGk5zGDjCjgY80coPugPgr91VbN41vKDlwH0rL6GOU+PuKYtLutbXr'; +moduleBuffer += + 'cITrsc6w9eghlIU0DkbnvKKp2WOtk6ku6BK43M+bOOuU8cqUZksfqc0W4dYx2KmjA2pdZJykO29l9zTkn7e0auZ+xiFZ1ERh3kVW'; +moduleBuffer += + 'fUWBNsb1/lArbYUZVInLvcyH1NpOMSKDZ3ndUk5lTc5Ue6Kxv7kQ/1TXYT2mhb+uF9mohKByn7dh5RjgIipaiFA4tT57rVqy1QA0'; +moduleBuffer += + 'eZZvXTGtT+eI0Ja74EM2QsV9bdNWm9Spyh6GkWSqcI77q0B4SijAjwJum5zWAHcC/wuoc2lTB5qjCNmOcQjVzqkUIlWc328WPcVl'; +moduleBuffer += + 'wXvn9ovHDu7xstuw55HcZ9+30svEfl6j2XyNu96Z6i8xJSvXnN/R05uui1XdAWln1u91srcndkdvF7OeWtrBdUtu8k6RZ+/jMkqK'; +moduleBuffer += + '62b2eRoVLTrdy1Z6sDyjZXyshnnL+qd73krej/U5+8r7Zp/LWu8BbXLgTXd7xUj2dTS5+DpuOnKTdiEdYofEdEEoRYV0WInyVE3m'; +moduleBuffer += + '/XXgF4SOeB1UI9RqhKiGKZ7hPhuiGqY4pbqnN8ACVw2WDmQYHjGwjrIPHj0kJv3Fv8SZagttWvAbzDVVIF2oKn9DsJWL1dVgmY2A'; +moduleBuffer += + 'Yymd6kPykZV8uKhPCycSRCYswfoMioe90lchD87wLjrbt6aal5zlBdSImMtXeg0bncFfOhSiHkAsp3tJb8wZQAO5RkZaK0Dhf4qE'; +moduleBuffer += + 'id6o+rHIb6+nCFrFlkeFJTogCz3P1sD2c3Rjnj1/5xr/6h68CbN8bGNv7AU7N+Zjaw5/8CdH3jPzyNe/6F2djz1/50bJs+bcl0u2'; +moduleBuffer += + 'Efkv29jLkC1bc8Oul39m5tp/uvU/XI2CXC7kGd0ol1FJy/9/9t4GzI6qTBetVT971961O10xAVqS0dqbBIKSQ+Y8SGcSRqg+Qsgg'; +moduleBuffer += + 'gope5xydYe54ZpjdjGMCh3HuiUkrIbZjxKCgQVFbxSEoaFTUeAbHzg8aFbV1QDIz6LQaNaOoUVEzYzT3e99vrara3Z2QYMhz7znK'; +moduleBuffer += + 'Y7pq7apVq1atn+/n/d5v1tDu//jZ/R/+3r/9/KdS2SwpukOWc01wu8zL1JOW2BgFbClZozhxqhwhN34lXAe72mIvS7/aoOWmmacr'; +moduleBuffer += + 'qOQ3Za6DO64BkIjt5whRK16mOcvlUtlLmrqJQEJHDgtru6CdI8deneX7f7CDTi5DCjk4pV4Lf8j7Yfag6HzBsMWRubYuVaKxsoDz'; +moduleBuffer += + 'fbQsAB75YmqqwYiBPz4ckilk8yvM0owJ/Rn41TpMm3B91s+kCaEmTei3SRNmaXmq5bGWx0U5TAmzVNjrd0kTUI4BL48bZr91yG2Y'; +moduleBuffer += + 'XbMqi67Rb8DcGhQ9sjD9Mgbq235Eo9TXQ4CMLs5iTYmbXaj8lQoiNUzYdGawSPf5TBNY2ReONbfg0m5xztyCS9w5V+j0lzXFFVtr'; +moduleBuffer += + '+7NlbsfqYI4LS3sZ9VIvol7q1aiX+pSol/qUqJf61KgXgtkUZUlTrAI2XgcDmMKSgtJSzd3/QlJHiuYjcr9SExpGW0C08on97vNx'; +moduleBuffer += + 'gbWTtLJgGPBlX0GetiRTPrjL2mG+DgMh81fOK4DrFd8+IM/J35WopIqce31d5dnSA+L3eEC8Hg9IKadaJVFNGfSAWNm36gHxrI5d'; +moduleBuffer += + 'zdCuXGTTayoE31tDhWS7nKaQ9rBQYhqGWOLU4SilNVtaz2oorVG3Rfwjv7Z0Ccz76bWr0w+qKAGATb1aEK7AJeB8JL9WSvNpVInn'; +moduleBuffer += + 'DJTjbn+PW1sXa6odyOVcFCB1djAUDTrpfC5lb1hQAbc+j2BCEaylqyYcGVgAVcfmuWcNS7UGBVvPJdYqpKAuC8ZEWFzPtJaL/AVt'; +moduleBuffer += + 'pg7GFrJIxlEfFhJOqks0B/A5bd9aOeWKpX2y30JZxy9LLukjS9p8veEspHmrV4MaZOMKFVwY9pDm2eh+q77YsIfKT07UwrwtRC2N'; +moduleBuffer += + 'NrPzTseRi51Y5kD7EaSF2S5mT3/JHDerpp9NXqn25B6C3AjyT0yhUPayKH1dQpf/6zQTSXpfzM09O9d/kf65HOtcDmSVrFQvBp/c'; +moduleBuffer += + 'uf4Vmpr42YR0349FxFcVWQNsbazAaElaV8WGay+Y9LUNpFiDffIzsomogLlAYTfz1U4woF02V9eQirZjlfW4MNRQ27FpvokKq62c'; +moduleBuffer += + 'B61PseLJXhiykaEMyDJfWfN6fBA5cOK++xjOJxHRzQaLAlBnMg4uqhLdsjJEiIVqmFBTPvXEdSvoewLFnm+Z9WT5evgWWdBn5yNv'; +moduleBuffer += + 'FhH1k5F6XlS+/56pGF5eGztjd29b8AxpUQLXBwDWGssMfwl1ai/51qmm34FK9HMvUoLk8bAwBqUv5LLRqfPkBRSxOvJAlsPLUMti'; +moduleBuffer += + 'HmPXBfLex0VA4PNi2aVEvGnYs3E568tqeq8ctzLksn6B+g9kRxV1Uu8CI2aWyHV10fkn4DAa95FHsZX18YJJOWvyR94coH1N+9uY'; +moduleBuffer += + 'nKVy1pKzllyjVY4H5R0NkZz0zsmgK9fM0lqQaFAe+gKEH/P3WXImD4/lAvnTLy8xgfS0/WyRNgzvK3/wUhMi3xfxddIMhl+9kBKe'; +moduleBuffer += + '/LMtLIOXae/cWimg4WJLWQAxYCzULRcOWnU6a8fgOY0n+jkXDJ+Qx4ycoNexz6k/0c+R4XRCniNDFc9pPuHDzZyY7zOu/faET59J'; +moduleBuffer += + '/0Q8x+AZs57wbxOcmDFg+6z/CX+OOUHv452YsTai75M+4XPnhIxp7t0nZm0LTtCaY05Qv53Y7/Pb5/z2++A50RP9nOwEPgaujnzf'; +moduleBuffer += + '93d46T/XiGLK1J/lF1Yi9Wc5cohAXUuZI4cIPEt4oQ8fD4kMEl32yxGNVNCJ1A2ZFGYy9eAWBquwaqAa0IzdVYNVWDzaRd1beP2b'; +moduleBuffer += + 'HlOprVGpBTIqJN8AvVygT68dF/0W2q0oKpdU9dsRZzfzipgLDXnJDcCihjYzoyBE+Nk6REt2wrypcZlISaDOUKIo+y6a1zYWHQLw'; +moduleBuffer += + 'lQ9iqubwrNAzhgibtinJHtRYtqH0VFse+AohQkCHdfnxGD0PY9Dod3fSN8MYewQhtDW4/nPWc+vxhiXWJ8tofPTbokxDvNSvG3fT'; +moduleBuffer += + 'twTOJ/b42rHluLdjW6AotZEiw3OsEPrMuUpF70Zos6WSqjazZmHoNM/ByhJhzFyuf15ReTmlQih8vgFclYhT4wAgXVKHJrAFHYRP'; +moduleBuffer += + 'BTR+KCbSfxkAXlDsr17RBVA//WldJw4i7zSrAOkz1YhQy4GpMOqioUcY5A3w8ipiM0w6RGTW5Y7Ajr+MMVa1Ss8HpZGYgSeZdCkB'; +moduleBuffer += + 'zNYsnb6D6Ij08j6fWPBgIH2dEtnbjrcXeEPmufSwOTMZetwyaFoPaV0br35rVpFvest2Lx2ve0pq0zFF4DIii35cl1LNOfP/FFZf'; +moduleBuffer += + 'hQseU45gZgjOl6lXdXoO4NqRcwDfavGW0+x1/1Sx171R7XVvrAL6sd7U6blIv2ayenqoQW/9EhugdRxsea+z8yotLUlqCQfutgI3'; +moduleBuffer += + 'ph2rag1XVgtNilwawGlK/3q9oF31yKu3zPOVmMZoh6l1DLZuS8ZgscQbikQn22V1PWRW5TXG8+XfcKcruawh+JTnTesQt2HHKLOx'; +moduleBuffer += + 'ffTXlqbVKUUmHxyeqfQhD8XJztA011VYTuA/buh5TWEfqWOZoYtcN4m6TPCzu+R+5ZqPJYi5zGKSjrWbJZjVreNKx3MRIHzWnwEU'; +moduleBuffer += + 'd1cRdGfBjEmMdFAdt0y+tZGgglbbBtTHnaR0Nhg28Fw1aWtGoQTjM9LxeX2g3GgW6RHQ5aADleQaxGAG+sXPkjElNTaZwyt9V8Pe'; +moduleBuffer += + '5ig2LOGfDK4CXMgwjV2e2+CsjHFecW6RjYpcA0JfW5DFcAgAp2QvjAlak8LinGR9BYQvtiEdYaLuLDxKE98rst8nH6XlqG0UlHAN'; +moduleBuffer += + 'fpF8ARYIQEU4k0hO0gId0DrOED+lpwYtwipZgAbnWvHCnbeseMHz3ESFREGf1//Wg2j9bwfRCRlEN/csz5XluIz9OMaAjzL4X+MX'; +moduleBuffer += + 'ENAxZ4bQlEfxAxBbrW6+V0NAipiPf0QGHN/RevmKGVgCt4r65nX/lU//IhU6gJdaquH+5+jgWJo4wu5wgUZ9tE2wNjPhWpUQvCFv'; +moduleBuffer += + 'yAflHVyVDDyvr+nUdONSkrtaVr/i7jXEsMXDbQ0kgj4SOR6hWpLYBF7SpppIHBoN5LOATex44BTw7E74uLt6prj8oDcun139OZzO'; +moduleBuffer += + '1NX78YPt6sk923u6+hrVSiYKqvN+xBNvRzzxqcAVD1OxC6VEZZOoEjkc6WCOWAjmUxvyBZSqHl2TBauy2jWK6kFYGaF5r+2VCYzT'; +moduleBuffer += + 'ugiLKDQrMwUKYKqaVqxqT0WxZFJHfwoY11eYrihjIz+EDw3K5j45eOSH25UVY9RXH7gbZ1zQwqqo3FJJ6v305qZM7oVIxk6dWCkv'; +moduleBuffer += + '/10iUAIiBCM5+7CvV9DrG6brGx1yd+D1+bt0nAL0FInRruG4tmwKjskBKMhmapNgnmUFnrO9xcs9eJCDLorPpoDDwAaLfZW3OKeb'; +moduleBuffer += + 'Pw0UPE8rHcNhXmJhl5Q8Vb4dnjfZnhgveJMftjC80in/WH3xDa+nM+T0yL3xDe8Yu6PEk8iLv7joj5dU++OPbX9cWe2PvV43/2c8'; +moduleBuffer += + 'Tf+doUuurHbJOCX6/6lzY9y4HRbjRN4Qjn7Hn5mPBIAAhtYHauBhRbK09M2BNWEoBR5c1rJK3B5bYoGCNCvUh/UngHrmW761w0v3'; +moduleBuffer += + 'h3h2BUOiHmivunt6zKqIoAI73zFFgHvnYlLqdtzbMH/cueikOIp7wNpQQU0BDFlvKK0iQLZ+tdKvgnSVJ5mezOfJfD0Z4MmAnszl'; +moduleBuffer += + 'yVw9SXmS6kmLJy09iXkS60nIk1BPPJ54yUTN9LnubxFNtzWqwuny3Rt2evm+G3Z6jEtbCpeySS+Vw33yKer8OevjbxoNV+ePu4kK'; +moduleBuffer += + 'w9mHMDAOkMIsYoI1W0IHdpBv3sCaA33Eeh9CQHpnrDgBBLzdGNN2hEq30A+Ns4vlg/KGO0n0rI8Mif5DxBwesMeHL7wmP+JiPCZr'; +moduleBuffer += + 'yqEM93QLXPijiHmVokulwoQ/yYO0vjgfQd17gMvZxstQK15xXwDHeZ2V4rpt2i94rO2DEKoekr3xAtYesPZZInDIk9Jfkwgn91ak'; +moduleBuffer += + 'n2h0QrxenU++EfapNyA18hvia+Q3bIZyIj1Sh+UBv0sPpn8Hr3+Qfi/KWpwMRiquSfXE09Xdng2mM/mELbuLdyzaDhk86wUhGOZL'; +moduleBuffer += + 'jTeSwRw7+da4/PZlNrxT9WvLxByLwIDhK5jP1pNeSivB/lDza4zW8JE4eGT2oYpW+gnsqyNEYIf52E+lLNEykL/at5KurhGciXcD'; +moduleBuffer += + '0mnrL+S6VK/bV9OvgH5HHVt/5X4r7t5cV3qz72HkAFlwMWU69i2+zNaYm6hvCWcVCiIt0shL1Et6vLBIyLfEstnCqGcFjWofU+Co'; +moduleBuffer += + '9pGx69krTFXfVhOfr7A4QuJQNsXE58PE508x8QXWYAETH27uNfIZBcYFFSPfK2Vr0fhPpWJmwHhwybx2qApCFLBFGT4Uvjdgy2Rv'; +moduleBuffer += + 'lYWU8kTeECUmP+WS3GT1a/M3jYyEqy5czegoH6HasIW6DqEtADq5USOCl/ylbzS+Y0kJLiPOckiWOcqAUAggexQFxJtBKiR2PltD'; +moduleBuffer += + 'RBmNUFi6AaH180Peqnzcuya9WW1LmeWOuspECPsJFKd7PTD97jBaC0OM/JSNdupruQoZHMdr13TkYIM8ZlCfkNWuuBuzby02lCvu'; +moduleBuffer += + 'lt945fo1a9Bxa8lttKE0KDvLioulsUZsb7lxSMCQEe/TYmkQfpd+HQnSD29QUerc0qSivVsyBP+PnlTLJp/V1eTb5mzTaitHBDKU'; +moduleBuffer += + 'NWwshbawEkNACoNrV8s1X7EBBJZCocgebu3FkY3aoZ30Fbo/LrH7I6Nev4rg6H5GY0N2xZbJxKRFQLbRgOx9jyMg20VbA5wWrpsq'; +moduleBuffer += + 'udvYMs/Gx9ntGcQ5v1BiZcQzg1DAXqJkLtSuGbfua6Dz7EAZgkNXQHOp1AHxvpWHPBIVT482ztQSWVAx2urDjDR+DQSGi+e55rlU'; +moduleBuffer += + 'sce1NfZoLfnbNW82Z3+ms39+1Qkx1T3h3BedsCgZUEm/4AaimIJmDXcYZmWDTobz8LoOf4dDY1GypjDfK6swI4YiZU6g9j5Xo45S'; +moduleBuffer += + 'WU3Zqig/uOk+su1FMN4voNk87d5Ncp79T12PgLmI7iMtGsnWw5IfMWYCb0fPU5i+KfaSV5XsAKaQ1hR6TMixGk18Da4m0Z9R/w3P'; +moduleBuffer += + 'UivOYRlbpL8MKHbPB52tp0XgAvTUXmJJFFrd9LW6S8qw/HbgxwVBj4s80+U27ASqC/EbMx5Mw3galkp5uB0VsViySsQVXrL8BgUP'; +moduleBuffer += + 'hzT5pN+MNUl7V4OX7GoDY6kbc8GUMefbMUeek4MRo2w5YCBF3S3rWJXvhJp3u8k9hWzpHoMsyAxvKWaaQ4e8F3E7b17WR2xlN2ue'; +moduleBuffer += + 'JxvTuiIlrnyZxopV2vl1pMOIcsp8AQzyu5qdOniR6NOSPY4xQKjjjnzErFbp34DMvjlUH9Vwg7wp/z26yQrmuCvfW5wFll4gq4fr'; +moduleBuffer += + 'sjpYTESmZVhWmMXqlCnpiaEMhZYkgkGmZCBp6K6npn7psF1NfHONnMMCliTO5NADjTUWs52fVNKOKwJeRWrLnmCKODBlZs/7uvkX'; +moduleBuffer += + 'PrDDs8E0lKd2V8/HyxMvP6mKSVYqdBuC29WGFLFOGosBHpeMtnNnOFji7AZLrM1gCaWdkFDUTMlQ1V4gR9ZeoAaq0NkL/qZ3o3OL'; +moduleBuffer += + 'iC5WQaHnq2kA0Q4lP7pbe0JrCdNlRYnSPXXBevmGDRsHGOmVfqdpzWPF3gbBBdYjX4OyWbO5hDEFBk78PGxHKq7A1yWDllaqON0H'; +moduleBuffer += + 'L5cvuy5msazKmYw6WPOMIpa7mQbsISLKI3GXrnYgJk+2hbqljsXsXHgDQzepn86c4SpdhaRfykd8at10JR/0VVs+AKFsJGCqAr/L'; +moduleBuffer += + 'zsR17zDg+BkJuPfmD79XRMSny48b/W4++ndyMnr7DrWLaGHH1iKbyiM2o4H6kwClTB/UhEgjysoLw8A7GoxZ3Gi6RakykOhvIQCL'; +moduleBuffer += + 'HCwjNSZOST8FMwHQwBj3PzZE07JsMsBdtsww3z2sNP2OXsxPv4LE4AAISzen74V7eqRB8Tn9ksgCQ9tvvPE9D24cPTAwGOwTvXDo'; +moduleBuffer += + 'K+/a/o59d//rwWAwmMT5O97y/ddPPnT9v9y4bjDYg4JbPn7zbb96cNO2PTKMJnjH5z/262/s3v3g16RgNwp+PPmZj+y+9yevunQw'; +moduleBuffer += + 'GO+DWa2vW41AqpHUGMJ2n6h70P/lsE4m7kY3fTviCcc4csebXaf8w2BQl3fDb4nSi/C9xguNcTNC8aC1fZ66nlz9eWVd8XEgdfdr'; +moduleBuffer += + 'j44xncQuvxDGHN+a5kMvfJBKf2AuszGk0nsBHlW/TBYqnTWr1EDDJAIGMiBQCvWScN1ycUirlAuzVoxIOBt9S7UFk0+9a7MNhXmf'; +moduleBuffer += + 'XlSrVONb+07siNx5V+xYSeyTtR1TryCfwtw2EzKkjLtgMEnN5ZHiSMof+dhOhIKpUNnSIEmbPagncCexE89FP3zPlEZBm6NAlifg'; +moduleBuffer += + '8n/GYM1F8iBanSOSzDIpRI1RnEmm3nF8uedwrWN+IOcv9pXFyFd/i68sRgD6M4iaARRY0uptOAiilZ0mPgX1bWUmgqAH9gUPPnNj'; +moduleBuffer += + 'WYyGvOeRxsjLmgXpkXxVEBnVKYoiC5EjMoIUW05M2n/9amiCv85KDFaDKNIMMGeAkqRy/ZWnpOtrR/LDVpWGXjfsdyumRsXC+Doh'; +moduleBuffer += + 'OjSjqUmysI9RsepE6UX0WWR6oNa2gMdQjuUIFZZ0qmrEE9W8lu70e8yauDVyawcukm/1Zuqa8iPsEI30Z+oERwBi+n68Oa5Vfbyu'; +moduleBuffer += + 'V3PVko5FkRa4dzjVmQ/ltnHmhwJR0A9AxDkWcarJZP4gUjrI4oCEE/ASSRsxMzXpnbzMVvwuywbWRXljno7N0jXznYAEYaH8IHg0'; +moduleBuffer += + 'lQLd8ulLnSpsWIW/qx+3hAXYTRppJqHjppeUmYBC9nKmrE9FXp8lXcZMLoEsAvPWltJ+ucSaL3Uc/Y/p8Jm5ikvBo2wMl68RWuPM'; +moduleBuffer += + 'kDGgqJkFipoBGcxpTJRRImMoXLkkGS3lWgDdS5EQI/krp9qXvNvLLJMLhwASlKQ7A6dzGqdzIjWfDYgil3OgC4RfXSCCQV0ZrN/u'; +moduleBuffer += + '6J+34wQ/b9cJft59J/h524/f8/5MJEmfUmH67maH3C/wRFTONHsQtB2NS2aEncGqrRcpBxk2lFrPfXU9Y+jo0b3W505wN376BD/v'; +moduleBuffer += + 'syf4ebtP8PM+c/yetzP0m0WSmEjpOh1RhO/4lyPV7aJKAqma2jTma7KqAWvoqKqHWsF1jMgN8rsOjnvpB2I1ujZUW6yrPSWT4RwM'; +moduleBuffer += + 'yzX32mvsFkBWFpXnXNZUTo91YE1tZE04vxDaS2KWZreTwPiHzJ1BFusZNv4EuSMdprcayQ9z+sN4IpXpkrK2kTXy+4tyj/F1N4Xk'; +moduleBuffer += + '2KrmN1ICEe4udVppxlXXs15Ljz+DMP1MeYs+jYY9T6rrG5SdhsaqC/TPVfLnApBcevk53fTbVMq4w+Hd07c3oUGtBkMqyVAV3Kjm'; +moduleBuffer += + 'k3ZT+qOmotuiTtwGCkREN3JpNLU4PLLo1pB7eLmmMFLRLVbRLa6IbuWWu7+CISnYw/5Urfvr1BpIOKaLMJU1iiBeA65XYzP1UUCj'; +moduleBuffer += + 'zOpLm2yL/uYO7vdy5zobNyq6be3azB/uT0Q1fnsxUJU8Rik7lCmG3ZJ028lp1czp52GqjMQYthe06yqon2ez9Jbpvqru944OTNF0'; +moduleBuffer += + '3lNTv3Zc2prO6jRthl6OzEs5CBnoH6fXJ5V76sXVCOFG4On1oHX5ZaO4otFTnw/qEBAb11XGDZTow+eN6cFYE0dzOp1T5nO1SV+b'; +moduleBuffer += + 'Vi2afkFcuYCJu3zlBgJ6t2VmuqNe3pFk1jnPue86rabKVSL9+nl6YsgTTGrtJVap9C2QqKY8dLuKDLQ1rV6vKNKSqlWqso6F5ToG'; +moduleBuffer += + 'oFG7VeKIinWsVV3HwmNYNz9//NbNYxE699+54zcSOisQbb8nRQm4Y4iTWFJhzgsJmM9EokZevgzWEZkRmKqXzWvXlLwdurPaH2kc'; +moduleBuffer += + 'PVCzHUUUA4EPFoYsk98iszNQAvqkrpARsYIp8Agx80piHWXPWeD4ayx7zvzyvFFi1BzMwrMOHeWTXez1w3q6+x92ePnT8gc+tcOG'; +moduleBuffer += + 'nXskrFHD4ICFZTtDIaHYWXnOcHbHSeR8Y8fyvbbt+s2+16Hiex3VqPzYCZYe7vWP4yzwp/gBD9lUJmSAaWUurQktHkwncKgnH6fL'; +moduleBuffer += + 'UWLNompyISjkTbK4tgNrE/Uc6Tu3nb+ufsseAxPaLI34Bc0WLft2XPgUp0bDjsKJXOLiisVnhgSjcQUMlbxS/Uyb/G76+gZ37fQt'; +moduleBuffer += + '+HvAkznalIP1xh7cjgP8JEo9aAi9/GGjdO35fnuwyF/vV1hU8vXgeUnvhIr+/mai6rXWsccnzei/BKa5Ll8CIy6WVWxN2P6ty++l'; +moduleBuffer += + 'skYjea2/zqIWxnyHpPUWe1chre5i7y86jSL9zEvVOtNd5l0lAs670etbDfA6C7r6AKwZcrRXXu4z3LfGTYeTfxtEKKbwgxG9TSfv'; +moduleBuffer += + 'LjkcVvUlU/VFWtMXqIMjyBI4Zkm1BGSelccclADQn06QfqNGRrcsvQ2+FTR6mbdVWd62AkQjI/c2+tfTb8Aq5qV3RvYC+1NIlJa1'; +moduleBuffer += + 'gxC2kG40Lkpri3ELgg3TGqsUcCPcXBaAFmyTsVnJxnxKPFljJYztmfx32/h2lQ4h06DvqXrlT2XcEvZtx9alHh30NZO91iqrKt40'; +moduleBuffer += + 'v8tVlLweuKd87z9u9zSBb4ejqlJwqg6dKSX7/Kklk8HUkj3h1JKJaGrJ7lpPSbKxZeZhim31nflmM7kyivTCoU0p59C9gLD4NvrN'; +moduleBuffer += + 'FWz2bfibLWAmq0F/E75USyqEiIvwopGnOJVhpF+WrfQfack+ucsDWPn70SFPwq+5l+9QoJ/XPilrKacSqjjJbYj7E0jHT+oAuYHq'; +moduleBuffer += + '5rTDiupAY1rG3MgifW36snT/SineI9rDbCCxUHB5BsKvCffbpjkA4Ii4or8F+ehcGP5nZ0l6fVMureebvmJ/mUiInsoi/NIArRoy'; +moduleBuffer += + 'D44VmOwGWfmA76oUxQBPyWPKItC5jc51vMSdk9FAqbnfhUyh4lNgpJPCtCiUOTQAxJgUzi2Cq6SmiYQJv6BiPDlrFpcv7XZOzfqK'; +moduleBuffer += + '0yXdzrxsVnFfg0egHt3tKXLp4QfkJf+bdAwR7YvcttAEDjcjtNyWkFRyfvq2WruP23Tnd3A8K5ubDVjIbJqdYo/6s5OrwVXxYDCB'; +moduleBuffer += + 'iKg4/Qd03IiMn/ly2pe+LZDbn1zcfmpx+7zq7Yt4e+RuB7tLf/Y7UjALFUgnwliLUVm89QRLNlVKdrNktCxBF474g8G4kU/upwci'; +moduleBuffer += + 'ax1NZZ7PlqatlvrTdFLEbekLOznwBnIhOFzq8vDV8luCS4yorp16n7KmMhu3DFL4aWKXmxu1I3r2q7KIZP34UychYpS31UbdxsVt'; +moduleBuffer += + 'u8ZtpreY45wa0A6gZjVYUh7FfBdJvnminOhzZJS0Q/q4PcBhmDcFzto8Q5oNu50gcC5QM4COaWOnQZi+19DNVOQY1yyFgP5ggYNZ'; +moduleBuffer += + 'HHMJHgb2kmj2RNH52RxwAlHyxAM7UZ+8E1Nk4KrQvhFvxlm3eEWje4k620yZwhzNStTLVRZiZkZYqWX5TX/u21bXZT5OIEeUaLb2'; +moduleBuffer += + 'B+tnL3sMPci8vHIl/e7Sifn4V9zqbAu2uoLsJK3bdYSM1ZNgPSDGwGhSF7Yc7wKrRMz8Jsxaj1dpTH2V+syvAmqi4j1q7j0wvMqX'; +moduleBuffer += + 'cI13L1PrfYlJ12aeTfScjfxj9Wx/8Xay1D6FSElkvhW556HANNb1SB1+IXUEpdQRWqkjOEqpI4DUEUyVOmpZrZQ6AkodjPJRqSOg'; +moduleBuffer += + '1BFB6ggodUTDBF/IcNL+ptRB22lopY6wInWUkQC6Yobp3hrlhix9O4xJhdQRasM6kYgWb2dwYfpdIDC99P2RvcD+FNEoYj8bpI4o'; +moduleBuffer += + 'fT0IVKmllFJHTdWUsUoB9ZRS6iBJp5U6ghmkjgPv2DFF6qDab6WOoCp1BFbq0AlalTrkTfPRd9qKkjcGzqYyqV7+03rzJ2Ecbw2u'; +moduleBuffer += + 'Jrp8WI5elsf5gVvLlGzNKSnZSsuY5mbL3H2yq38mJoe97Ap1SlwaB9andNHwkr3Nhh3TahbDHtXIYk1rQ101hmWmgedfTcrbrIGd'; +moduleBuffer += + 'PgIItx0jE4tIzn+HnVquUFkFwvcWxD+10m1kt2Xjv2t4BaWxrYHLtgpbuvRPQ32x0pjSzKV4Jho0mwXDcm/euMzmSaQtg+MPAHQ2'; +moduleBuffer += + 'NT0YMiqqw0Lmp5uf/oRWvvQCUHc1pd1fgpVvEgiF5C9L/jvHQMx0KiO7dzAW6UoRlT9JRFx6GdQrIGMRLJOPe6tW4yj9aoNus/T5'; +moduleBuffer += + 'YEsdzjMptvgiVmdXVvWdOVxuFjJFDXS1SNPbR1e7NLs1qIsX0vwDYPGnREAh8IRh/WzJ1TKRPt7Anb5Fm6GLIkbBkgKyHViWwSIL'; +moduleBuffer += + '5eqe1D+At4yYywiuUsBkZkmV/8USzqntIX1L7GyHHbLcaWhQ+qVaorhHwFmqcyB2WFFRJK8rkHJWbUwP0m1NWzQj2dNfNmgIUD7E'; +moduleBuffer += + 'ID9J+Qk1ayLUxYNwmI4pktHRG/pVlA/kXR0jibM8vCb0G4VS7tK/yLO2G0yIuJ2oZTIsLJNI2Lr0tEp2GJlqDK+sBAa1sf6IDIcB'; +moduleBuffer += + 'yWT28ptapKnp19LXQMkHYWnHxvipGV2vLKLE4aPegCtNBcOASQcJP1X4Q5F/TnNHFuzaoSKGMqOx7O6KevWKmFfUC07kQilvMIyH'; +moduleBuffer += + '6dTSR2tqdsd75edo5KENPyI3saHAWc2Olg0Gqdow5ncCa0QlKotvqfaJWTJb81pFEwP3K41jzbNNuNw4w+KZgcuT4alieJYNf9Tf'; +moduleBuffer += + 'TYEGtRVY8JaX+WWiFwvxSEtjSTJYQtAdtuNPbf5qZBUmhmOGrMLEKGfBpXQARpfQEN+TfBr28nPL3LHpT4gExC6U/lgOr7TPgHi3'; +moduleBuffer += + 'roDmgkAypM2lNL7bjBMx+TVwiTct1bFaQADe/ZXGpPsrk+Fei4+OiQIE6KujyK+AAEsyeBzhJaD3WVtlK7MZxoqsfmE3fbGz8/xt'; +moduleBuffer += + 'ASwtRj5nzue4/Mbtpg6pYuYwx3Fl5uiNTBmpU4ZqT70yERxSCWbx9FW+b8E8jQLMg4UnTrdGxfCOqsO7Ufm8nKbyFd4nc+qoB29Y'; +moduleBuffer += + 'GbxR7+Ctzzx469XBGz2ewRvONHiD6uBtVgevtX29/PGt1+9/vOt1clOkSB0nj2TKtgu3jUyK9NEGI8wz9bSxsanz1aR/n6j4TVuw'; +moduleBuffer += + 'R5B3+kmRRRmlBrv4QGYB6DZPmlnBmRYRMw7Jxk/vSXQE04iafreZvqOm0ybSRC01TftAuSLdi6k41iCZbnH7rjePe/n9b2beItXL'; +moduleBuffer += + 'aFjXbRA3W9QtAIt7A013aRHUls+nv5tvwv3vM1gg3P2RItkomvjkuVeruNSo48AeZEV2CI9ZfBd7sZuUAbFRaXU3YPeaMj+s0azx'; +moduleBuffer += + 'RrPGG80ab/JdGzRrvAOTa9Z4w+3kXP+sKdzTgfIDLTTpyWoKjnU9+GaDfgC1J9qh8i36zQY4MYjDT3/aROiipnHJbFokF607Y27k'; +moduleBuffer += + 'ci/KH5F25oNScH43fxjHm0ZtNnpNEwxe5HRf00sI2pXpJ6K/xq4s9iAq5/e+exwRtrjECnnJQ5ETl+UzNR1LQUa0vWw2BNi5HCLc'; +moduleBuffer += + 'Np3gFBSbKN3fvhM5lPBIl0nl1AlLTh3FaPucYxTjRXLc5DvtZYgyR2C5k0FAUE2CG2grAlL8MvM0iLFENhyt6UN9J/eoCdblNvLK'; +moduleBuffer += + 'hvKp8on1JQG0NytURAz71L2v79GSB6zjZ8QDwdnjAFybfCZEkZGLxlZSY5MiQR7bDjS7EaTWeR19gSUlfMCF0fuKYY/bTAHiYUxQ'; +moduleBuffer += + 'O9DMvGebG/0sZjwZ1+esgZekByIK1c/Rji3SseVH7lsEiSbljHX1sh7YyG1CHZIjGBDy1PBM7LE11FmTN4RE41/b5QvWA4pZXifR'; +moduleBuffer += + 'U2sIEWUi90RVT1SQ9PSzJqotxep7aqjvCSlEilyBRrnq83tvkNF6U9OzicCpaoArJ7OMWx2/wrlVJAMzuDbutAaDLNMMwgpdbent'; +moduleBuffer += + 'Ns1rvu2drvKmi8T/TSTjUMXidx6bWHxcnnmMovhxeeZbju2Z3zaeIxvipHrjXTu8PEofIXYVBW9BwRwpUJar/H04n20vsDJMscc5'; +moduleBuffer += + 'f5k+Hyxsu963g4E8HpyV2L0WnEuAScyIJdA9nSd/7r0LVy3FtmcDzXC0lD5LHUdY5bl5vCWga2uBpzx03NL8ZZ5pVbmReAy0LaAZ'; +moduleBuffer += + '8OC+MoDn0awpYmp6OCaUXQm94j09QJxC4FAO0e8FMWs7M+An0E1O+n8wUNHBlftleaIo2/QNRQri4SJkPaIfMliptABEJuUakJXf'; +moduleBuffer += + '9ZbtGpM1FA4yGCt2QVTOv+i5WAipYdh2Npp6LekwLNjlqJ51/9iJe9a97zkuz/rzqZMDSkGoeBxDPE5IGb4o9G3hSt3A0o/VqayY'; +moduleBuffer += + '9BDJb3Bki3wpKibEXxQMHFU7U/qVyCqInV4fcWZ54OKzYOi4GCQy0EXS99RaFUa/3HIQwn/sIqOSF7mYnCVKsdVcCfuHHjc02EDu'; +moduleBuffer += + 'X+7ByXqKen4TrrDXLcOzbKBOhixTXWmvLAW5jyU8eY1fpJMj3xFW7IP/utPL/7PKC7WcPiL6JjNyw6Sz62ryEzGYCcB87horw5K3'; +moduleBuffer += + 'TWVXFqtJr46dSHNwaT6RSg4ufjL1aasApoPB5Nu+qbSARgcD9tF847d2ejoeNChP1bE683j5iW5NdZvHq0ZaIPxDKa1m2dK4C1qv'; +moduleBuffer += + 'OGE8Oma6U+ObM5dqVeP2LFfhwzff18NVSClza9jR0L6719PVBJsrDrOsQlnITYxtn/4ofYZ9onvU7jcc9lGV59inHvWjZnyrg0/I'; +moduleBuffer += + 'W834qK23/OaP+kuiFxZ7/J6LPQhHLnrZrEKsssbwLvbm5+EquyvOzT9y031ezmEzoEmOrRQ7N/8wfjGVX5IOEooQTbHqMT9XoC82'; +moduleBuffer += + '8ubf/HP95QwxeunNBLnYEBEEiBBG/Uap+UKHPeHGDroXbmaBqqEuNXERP2J/KvTSGZ92yxP1tL+uZrMm+4lyomUr1epPpXl+xfqV'; +moduleBuffer += + 'dlQ9VNOF7K9Xd89VDQvbaOU5Gt3sNoGKYSBVKoGj2HhG/v3xbTwz73Bh+aBQHxTqg8LiQaE+CKJtfs/Pt3tH+yxNg3h0L3X/hh0n'; +moduleBuffer += + '5qXcg6ovNbJ+x7G+1GbfrxUA7iLvpw/Hy4Fbzcs6yM8ZFwk/4xkTfpLdVX0YjjAp7tSZ4jOguwZVIMVncCbdMjVOP4VzNmzCzxpz'; +moduleBuffer += + 'OKmBJFC3jb9Cg8LQLzLMmPy3bJhoSxHxQpZtlZbEfV5X9Xi6aBz1WdVDE1Uim6n/xMXO1Jv1MvkzXDCxV3r0BuzwZCb5Ns/gGMkQ'; +moduleBuffer += + 'mCU63HeqJWN+N9//HXfHSNDNJ75b/R3omq37ihL8P/kjborpL+Os4BiQE3uDJRkoCyzHQFmQKd1YWUAlb5ErcIFUheFNdURdBar5'; +moduleBuffer += + 'OgPaYF2+zmBqvs4gKWZ9ZZ73J1UL7Z97ul6LtpFv/tB9sIg4/BwMjg/82y4OWA/cFXN1aJ5F7eEsS1SwNeQq7fG1qJRgUD8q99lB'; +moduleBuffer += + '7XhKgooE6JQvF9tXMQk9xKHUUktG3ImUwZa+XT+9scmIX+OWr8hOFN04uYr9sczDnKBz2ehehZ1uZN2qfMRcBJaOV/PcH85Hfo10'; +moduleBuffer += + '16fm17NgJJSSkYN1FPF8JEbByAFvZdvP1yOaEPIQ1JHkj4psproXkG5kkz+FbiRwOMTGYxONBFWikRmrv7F2uOqjY6z+xYXAb/cW'; +moduleBuffer += + 'pIaa6gMInGNCLb2e/mH2dqdDpDcEWdWzWEj5kCgWqDhvLlHop7kIhRn+mY9/yDYxF/+kNM7SKruK/8PlT71oVUE35uVfrnfzU6/r'; +moduleBuffer += + 'IusYfrtk1WpMkD/jk8hj3gmPC115qCwfvrJ8hKQtd5tHIc70knRbOW3zB3bMSMrdsZzcDjbcS8iNFeNQkBUsPkfxoHu2Pt4HMYKR'; +moduleBuffer += + 'D3ql9RWllFLy9a/facmmdZXIwpcd3/4Mjr0/H/jqzCTnx/KaV/WyQKsL6UcWcx1OSWRY5lX3CypHy2MUpyMBROdqYniX1JCrzc75'; +moduleBuffer += + '/mmaX1hm7IA8awBep6aez5LzWY7FcLsB1i5tL5RGzKp4XmdlCzVRwMKhbPSOvJE+FOjvylikNaVSU4qa5+I3jwQqmwqewD0e8yan'; +moduleBuffer += + 'nwG8CWzq8+Tv3oKAFhu//+LB4GJrnAlBZGr5kCg4zKtcGFysrKRS8CwRU1yQ03kInPK67d8B7iY92CQHoTyX4TfSwH5pSL++apju'; +moduleBuffer += + 'NFm/e9X+yqv2975qE6/aP/VVZ0tNs/GqJ+E3fdX9xhkOABxCYPCngZAaVZ6V/F7jXpXQvXvMYDBiykyMW41rAAYNcx0UCBYkWB1Q'; +moduleBuffer += + 'Y+0aq4ngda/FdBNhpC1/vy1/n1KgSQcQGy7vb7Qx7bq2+mRp3cmO+nyHyU52738y3u9JLpSm8o1PLjsGoNsiXhww1TnoozvSzwLw'; +moduleBuffer += + 'td9T+Op60+NRXDMYXCWNWusilV7h3pHMjFHl0uAqgEHnqL4wP70dlf1cKn2y/H2d9GDHehz9/JsesKx+/gbjvJA+6C5fa5aba/Xw'; +moduleBuffer += + '9XJ4JR43ZjQD9W2m/ST83Wzap6JZm0z7DChDG037FPwdNQh8OtMfMe2FuG5NO9LWtjRSys9/KoP3yUUTviNNOI2YPX18Y5n3cj7a'; +moduleBuffer += + 'XLvcW6VHVy43L5UjGUtXaee3iFtrFYCJvgXIdS1zfn66ywDwGrdPl17qgy3fIiP6stNLt3G8wHIpz5fblnY7TwXbwPd8KZMey5if'; +moduleBuffer += + '1vZnnMVgQgY9EGTQVmeBhU8AM5tllauAUQXk4alnmzB7qvp1yTsWI4Tgm7SWARtMkmfrv22gDa6ShlYiC2QjW8AtPC79t7yyr/Tf'; +moduleBuffer += + 'NuR1eKWCL/oc+KJVgC/mZC3L4TxHrdhzUEWrAHOj1jnsxWy+Bkkkckaf9pOzzgzDoefbnq7fNi6/LUdip9s7mvLTK9/ajafMfV+z'; +moduleBuffer += + 'wI6cvnIkuZFVjjSOPJiTT8eIOtO/nebqhXe0McKfUh1L8rDTioedMRi8wrZosfc/XQPwVNGks1PPlbfQkpeyHWjc37BtZ/pX64PW'; +moduleBuffer += + 'tBdlZ9whjWvQmHgK5Oyo3cqeJO1bJG2tSfvmSLtOAYZN2ng6Uz2oi15WKvuNCdZx07Ou0xOoOBgjzwFduo3t8/NTgdbGWxQvdDIg'; +moduleBuffer += + 'bniHouRfCcR+SnW6mgXLzYAeZcvNXD2av9x7iRydAu8uZo6/RP7MURa6iKJdvrybnVqtZmC593ty1LfMOy9DyvqsVf117nLv93V6'; +moduleBuffer += + 'vlj+yOC7Qv1qlyO0F1ka/OxJyAbtZ4sGsUAhaQWXpurCFOOb1HXNI2QivTFiOhd8Oi5SxYtyJH3T63nRa92XwoqQSb/36XhIMByl'; +moduleBuffer += + '+1zndU5x3ec6rxOXvdWZU/ZX58nosXo+p5vxnno2Z7k3W/48ebl3Er6RTFeWu68lL36WfrRF8udJkFDqGEyZ/DljUCSnOjpwLjCd'; +moduleBuffer += + 'y7xU/iwcJCl+pEjIlhXNtxpr2a1nJ59t0uUmJBREdpQnuTeuI+T/ZGlZvtiOo+qAMYkOrJPL4K3igoUcX2icPOtkndLcFaG0L/b2'; +moduleBuffer += + 'Yl4F/D5tK84/SQY3d8sfktLkKZqOWX0xTznb85abRxhstQYhCYv8a3VrfdTrpp+v0dX+iuyUfCkhpFZzJ62BPKIIGX0S2lbLgrOl'; +moduleBuffer += + 'quXeM+SSwW6x7AdyO1S8NRa+urTnbo1jJbIWj7yjacWCElz2Ed9u+5EuRLaGe3priGeqIabymb41KGtgyPmUGhJ76zubWXHFElLE'; +moduleBuffer += + 'SP9WZZGlsGeepK1FXKwuAifhWznr+kkaxyAf6SR2F2a/vWPc9NwRVe8QyYW31IpY3wsQT3/Q65GFrpVdzjJZT21bIG27Sgq3GY2l'; +moduleBuffer += + 'rP40MBhsNUS8s19gokm/pZTYBMnOVvDS7HJnnJ3NLnbG2RWZL5Fy3caSyivgCyR4x9nl7lf9vbxNrlOypNkK8/BR0G8nSYJJ0l9O'; +moduleBuffer += + 'kgSTpL+cJGo50oe18EsxOxKdFonFM/brtJiX/U7hzBUx83cYEHJxITCv6COe91kdohHOU/n5vG56f43ElbArtjjqKUb7Fu9dStcR'; +moduleBuffer += + 'R/WzNFXQXIX77CsGxVw00V0819YRylF0rqOvWoo7dvUK9ueBJlKJjMJq4zUzzotQExUEEO6k36bledqjwS+AZkPAmKILZPqKb2ky'; +moduleBuffer += + 'HJuDtlMrLsg6IoWl2vSatnth2ehE2ZKou3C8pOV4SbO0GC9pZbw0pVzHS3PKeAFuQWooxkv19/I2BOCwJWkxXprZLDteAA4VjawY'; +moduleBuffer += + 'L02Ml1nleGkW44WVzyrHS1Pfq2nHyywnYA2UIafZQJEkwwI1pIqB4o3V5D9QiUJN5MzSxPzGEAVPV3tuoq9vWPdCvtStVVSKX1KY'; +moduleBuffer += + 'lhyiGBadxV6avjF2ftiwiA5WewCb+lGbyj20mEHHLxZWwYLvOWpN+HNPvCb8qf+PaMKfPd6a8GShCY9ZTfjvsfcc8FQTvqtXE75d'; +moduleBuffer += + 'tNuXl4rwWEURTqcowi/XiEEpuLqiB79Uim63evCDPXpwXNGDxw6jB+8+Tnrwx54IPfi9/0fpwZ953HrwD36rB/9WD/6tHvxbPfh/'; +moduleBuffer += + 'Uz14zOrBD6geDEVpmh789cPpwQ9TD75a9eCX6s66t9SDr5pRD5ZHzKAHP3x4Pfhqqwcv6rlbtdgx1VuvYjus5jtW0Xx5z+3mCPeo'; +moduleBuffer += + 'rjtW0XV770nsO1V13Ux13SU90sYimNKt5nrO4VXdgRlV3a1HUHVfPlXTXYI7HunVdF8qmjZ+m/S6U1sGloAXZYzMzYJy7jn+gTHV'; +moduleBuffer += + 'dNkrkOSspjv5W033t5rubzXd46rpvrQAthShfX4ZSRhYfbeIJAzVGkfoalAhojTqkY5LkEOoLmT6ZL9WqwTfOpmWgSWVyEAwH6ef'; +moduleBuffer += + 'NlkNCgrCcWsV9beGcFxsjAn1FAM9pabpDKyesslUog1dPlTyGWPcpFuhXIiW2GmIGvS+2BLWQWx7qVJwX9mOytRIi/wXd+ouRhZq'; +moduleBuffer += + '47/7PZfW9RLOS6PdZ3N1K0H0V/C0+dIOf53GMtZLNDVpPJtKqW6Z1cGM3gTQ39cIx1f5gEOHeU1jf8EXRiw0I1ciF3M2oMmipsc1'; +moduleBuffer += + 'alRj5PSYPdTTSCxuQUexyz7AiMSOdC2kI/ZwowL8ecS+bahv29BVCN3JRE2AC5wZXD7oILLWguGmTYQl26QTZE6UCq5qN1TLRbod'; +moduleBuffer += + 'N5EYf1OaUVT8IAei5VNkOMe+ktfGXWhZEt36FEwJvAwqyR60nelgeUPJu7jXK4kXbdRXw4o+m5zoI69s53CAOVwr53CAOVwr53BQ'; +moduleBuffer += + 'EC/y+bVyDgcai+wixWpuDseVORzPMIfjKXM47pnDsc7htchNsdaFlK0l+5XvAGrAPc7raOyyUQg7s3oxgFnu8m0aMJ3f5hnsT1kB'; +moduleBuffer += + 'vHzLTY6KBCCSpB0OmWhI/oJ+HAEg8ieSIZO80Ji1MGeA+4BxdheSeoV0COevunsDEUpy0AlH1wPBlIWjbQ50X8tH22bI05xhRtNf'; +moduleBuffer += + '+QgvmblaV9UGYO7tE6RaAKHCDWV2Yjy37Uu1Zmq1f4GefeLI4zyQx3kgj0ueY8FXiPtmpLlHQNdMUd/+NMSXb6O+/fTvEWh7IHDG'; +moduleBuffer += + 'Ql2pc6OxrF1LIGSUQAgZj303uNODpDpj7trFXsxguHaYzLxE/5GFIbmASEW2XdjH6Eml90UGOIR/fGrds8mBjfKL+tjhiIlGhrsv'; +moduleBuffer += + 'NAhcCqux8hhnyfNYPUaZLFqXcLiHEFhoFMVfP193DWhxW1enjzZPTVx5x4MkWeaOCsrQrj89HjbaAdpo5UPPbKD9ixkNtMDYhqJt'; +moduleBuffer += + 'INuFs56kHwxmMtpie/yFOQpj7UoCmR6DAUADf4xe4PMCX0NDfF5g0o+FyfWmshwEXA7AhWI03oVp93qXg0C/EX5SKiNCrmQhGDr/'; +moduleBuffer += + 'eptTKVhhA2A7/u96FCc3rNcY2MOsCX8yhT8lYwpC4GUxezphkWEBIdvvNwoDzkw17wO+Bg81DWKZXEE5U75tTGS5FUgJECIEtQNW'; +moduleBuffer += + 'o05No8ph2X4rANWjUjWZsvWUEbGaEwozqIPE52CkwxiHaU2WRjYYfw2GZdSVYx2WrjxQMbS2XB5awtoiwjGjlfPaGmbfDnW2e+R6'; +moduleBuffer += + 'DZwRlMkeHeNCaLliNXDIKBNOKEtOjamPnl0NdPA1Chih5jbkYU9kkcYXKi9sC5N9+iS32LgXO54Z4A2B5Xz1yC7PxRNrHabIYCff'; +moduleBuffer += + '6mUu8+PVK7q6QKuM5+LTkbT24Ni4AhZf8ticFKbCSWGmcFKQ7VSRzT2ge9v0XZEfrwvW9nKsOBGyEPcgQoIEEyJk07esxs6dAF4K'; +moduleBuffer += + 'DMUmRcgIImTYI0KOFabuBtLLevkZJDmklEBhIv1eQyWZqBQUX+oMt1G+SKkYRNf5Eu2NS9s2I7kSTuPCFX20Iu2lPVtZC3YGWk1D'; +moduleBuffer += + '5bWYhZPkFHrphSplne399+WeFT+k+M/VanSftb/fUJBXAVKMXFqwaRXpf5d21Y4lBR3bAyInvhxS3xIcXdUGxnMBeCwcV+9TZb5A'; +moduleBuffer += + 'peHJKV3pONo+kkGvX/60Br26lfgo2rGSwWCzsoRuls3xrXGFDPuRiohlxbu4kNoo3p1XSkmRSne1ynXKhnsVaMf08v0VabA52COz'; +moduleBuffer += + 'jZUyW1iV2cIpMlt4WJktrMpszVJmTKzG4Cufj0N7O6odS9qR+4WkVu+R1JR85xhG8Wf+fzaKd/92FP8fM4pXVgRbiiKHF2yPTGeU'; +moduleBuffer += + '/ImIKrQL7LeCAvM0QKtlngbZHZGnwdc8Db7mafA1T4Nv8zQQ6AMThK95GjwkjatrB0tbr9D9c8x6ac1ib4mjIAKZi8uovI/5qmUc'; +moduleBuffer += + '3p1+SVNPdvziZwq06YZATZILwO9U2eryjLIy4nQsVw35RGReoCcYmvHhZgdBLpf1mZJiQrbObR9Gulop6e/mj3xEjnfLP2RHuaS6'; +moduleBuffer += + '61O8zy6yMYxdhoYhFQXkUEdjrJkMyf2zvikyS/rtpts5j1NjN9++o2js/cgbuOW9NlXgS6qZeLMpjFK55fbZdacSJPgu5W48PeOu'; +moduleBuffer += + '0h/4lv7AdxiJo6j95vc9zto/UDOzmInMJ2PiaWWOeaS37sg0uw4Jz2G5qF2XG8SCkT80cifo5gMiPQZFJkAZjhg5+ZbP7UDyuYxr'; +moduleBuffer += + '4AE/f+qqZfIHnyq9FlYZip/uJlJjdzRvnVy+pNMHesEg/RAWUo17a6Zf1YMwvTtZpWnYfZDkIjO5DGCVjkHktB9T4auNNlUfJqBf'; +moduleBuffer += + 'SvpYm258LNSxv+1zmvEe7Nxbd+9gVnloTZdisUh/HTKRpaaVdzNBxOZl3mamTI+6nf5K8ydAF5n1Z7PkVrQ8i5EfnqabjInr0+dn'; +moduleBuffer += + 'TSSPx6+mSGVSA0+ivlbEd6LiVsj6WbjMm2RymmXeHtyHNbGVPlSj9t8azhLwm4bQb6+6ZlUWXkMe9awPfTjGD7RM/iLjWslJrvnn'; +moduleBuffer += + '6/oB0MF1IhlCxvrXUV9DHmBHgrLgbGMyyjB9EBVtYVrMIP0yGrqZAQ++nsQKstiLq3aHmjxzX5k2cx/6+2Is1VLRaZWMdIzkZFY6'; +moduleBuffer += + 'fp8lZKzOaiyKWYSjRJPG6zWbjPP3ZLgiliHBbPXyh/2oBJSRGzIiLsgH5aFUYw9X8xebq87YfmnYkeW5tmNAXSV9NE4S2oN2voCp'; +moduleBuffer += + 'tMb5Mtl8rPlSnzpfRmszzpeJynwZrXG+gENIg6oxaabdI7p0vs3dhrUZo5yzi9iUyvCULQNpoEPUvbTTIndnviXovWhPgCcxBd5i'; +moduleBuffer += + 'b8LoHJTmhrDD2Z0i/TC8pNNm5D80ihm5jTMBJNbljByp6Yzklp7+feTmP0/fjIeMK/dcvhuv8wO8zp46Zl6UTpCcrKnTbdKzbR1r'; +moduleBuffer += + '4HrMN2nrtjj9Iq2nyDIqLfC75ASN0v+I7aT7YsxJZ+dVvZx1vLsy88ZNOfMmZBvN6su83SDRQP1J+k8685JhuER3G516u42de7uN'; +moduleBuffer += + 'nXoBa0TOKaP9IEvd/fSz3x50F3neuR5NI4u8dwXnep81NFG0dLruxutONrv0CmxG6ll0eQ0s4STzqGU1PFFagsFXc4Fr8krMkejr'; +moduleBuffer += + 'GHgvNnHNvhikX4GAPRK4XJMuNWSEntdMks3CQtHQQk0dqaYHe51WzbmY8aqGfHUmZJQ/Oun8nkknorqLWZaq7OFqHSbMqkuT0mSN'; +moduleBuffer += + 'r4p3ykwx+erabRg7u8FjrKy0L5hujoKBadSfbneiET/9W/8oTE9gxMz9duC0AcsRxAnt54fI4ecjb9RZIB16jtr+ihNSECl7iwyV'; +moduleBuffer += + 'GHkvyOBiU8rYaNeXTCUuLKKnQ1U3wpJbM+ymP4y03Z5y7VlWQvdegUrBhXyS3G6KrLfoGM/vlRjSD6nUjdzUmncnX7LCGjSfwUj1'; +moduleBuffer += + 'p/6Pu9ZI6T13bfdQ8kroVjSwFhJWKBJVmxIiOxEfZokVInLaV88jM9up2tk246v12Nh+/q9TDJYw5uWhZfgBr+Wl89QyGhQPsSQ+'; +moduleBuffer += + 'JO7QIpD4ZD7M2iadrDk75Qu16pFC9Vui4etWoveV8sYUp3tE+Vj/oEicRVoZJp6QOt+UpKtV9ZJqf9Ry1J/YqxoqH9WLfu2E6e1I'; +moduleBuffer += + 'vcv0CbGalor/bCqyaglpki03h+HfXJSSSWWtnPS76U01mpUXe76sF//iAdlg8l96IBOHzPHBurT6GyIiv8e0g1ZKu1GIoOhYc8XE'; +moduleBuffer += + 'tHnhhxBM7wOk4F/mgZfnkFkF5Tn9fiM38N7BoXZ7qOa3sVAfr6JRehM12X0+9N0zg0m/0xzyn0tH2jido+uDwuGGtV7+PeiXeupW'; +moduleBuffer += + 'ljxalkDte8QfDLbIcnA5TPT5A/8qHf+w/JN+LpTR1Uz08ZovxvQk7qOolv7cqNHOMpvI3wbsc0N4gKqJhnwiGqEbKDkMM39B2/9E'; +moduleBuffer += + '5PjsVJclefAmXeaDIWOvn1oHaqCyYzvDVDsDm8w+vugjfjffqHXx7cyMb3cPl365w13rI52O9mjRlxMskR612ST8fDdLtpYlaMOW'; +moduleBuffer += + 'cDAYF1WwXW81UPcAR1BYjqD6zJ//wr6I31+//V3222/BjfvQ+UyKoKNgi4yCTcVyuNib9Ps8d/wNWMFnBSZEFzXv6Kv13LWVFhO5'; +moduleBuffer += + 'niM6tCmw3PvssctwUTARqkejeL+AR7vDIdNuwioRufqV/hvPgME7AqlNXcnAI/nAmuqNc0ATvCW2GZ79UIH94DL4I2L4Fvl75Zu2'; +moduleBuffer += + 'RKfnZxvDR2umd0VaBoqH/H0oi4oyP99cc19xk/uKm1g0WflmoyzZUykZYclE71fcLV/xgCzHWjO67sYGzM5egubV+EjXqrsjrsGu'; +moduleBuffer += + 'QThNcpO0a3ib4lt38aXDdDwAUQkWgr2+Iv4mff3EUNQiZHze6kQc2ZlEl6lxZvRR1rG/Mdcf16fN0rL3gU1JFpzaTMNt+vJTT2Zq'; +moduleBuffer += + '1zafBCqPsh0ysJUzWBcPHfxFiSwwOkEKv768xT6/8lZ1fSucjwbaoeP+oCwzct9G3o24qI2971nX92RmMKYssu+Kyc89XeaUBTlW'; +moduleBuffer += + '3hpj0CPeGFNRBxEXDKZ8Tz+eaHJvBxesd3X/zRp2yaHXDnDinps9/N4qbpULxqdsOBO+23BG+o7zhjNCCR8a7GNtOIda3fzm47fh'; +moduleBuffer += + 'PFDXRQdyNR6P7153G85opBvOSFRuOPvrFJmjcpHcx5LbonLDmWTJzVHPhrMxGgz21I+04cjjueEgt1Rlw5H2/MYbzraZNhyXoPyI'; +moduleBuffer += + 'Gw4TndjOMNXOwKq9mQ3cGHXz2/zH2nB2cVLJHe5amfvcr6RHi77czxLp0WKp0j1tst6zVO2pDwaTYc+GM0JN0o2go9pwHrbffg++'; +moduleBuffer += + '/WjkNhwdBaLq9Ww4I1G54bwqmr7hlHfphjMSccPZFE/ZcEbjKRvOSDzjhnOg3rvhYHDohrOnPsOGs+0wGw6abT9UYD94ZcNZHx3r'; +moduleBuffer += + 'hoM8RPoVx9xXnGDRprgiJLBktFIyzpKRuOcrHpCvuK3pNhx03XHfcNZHulSPRPqJIc00seGM++VCLLp0z4ajv5Ubzu769A2nZ7gd'; +moduleBuffer += + '44Zzc2Q37WJ7uY0l+yslt7PkQNiz4YxGlbeq61vhfEukHToZDsoyI/fdxbtlxhVzzb5nz4Yj/eHedYYNp/LWPRuO3nGEDWek7/Ab'; +moduleBuffer += + 'TvXm6RvOBO1Zr6mZxKXYUyBirJFTMP6pkj0aaHbXUrkCIt1wJ3KbzMvtJrOKy3Z0rgIjYY2/qWaJa65N2mWKVv1wJimn/Oq8o6lg'; +moduleBuffer += + 'cd8hUc8emOS+c66fcnXFQmJya/VmA5SI6p/pR79Wkxm/vJMoHhyPtjEvTO5XpmNOmS/I2pF0x8xasvu6bMzcirMmLviwT6yiBQlw'; +moduleBuffer += + '1HX1F3zlmMq5TJ584tYdXj4r/TpeKP86TvrkJEGwib5uzDTJRbZhvG5LBixTXkegvVQGMVy+2lUfavW8C2upkqEv8lMZAdM6kgBl'; +moduleBuffer += + 'o2xB0+sgpNJe3rBUQdRvYTVZ7I0GulPJliFnr7OMyMHZ3muD5YYBCRsDcJ/RUMQkbEE3/yeXa6qOL+HOMv9cj1SZ6V7a29JDsEl9'; +moduleBuffer += + '7EeyjJwkXdJRea3uk0r3Sjy2zhfIjcZJxDayu9gtMfjSX9bUjsCJw9YYZO/SMB1jU6Oq9RYToVadCLVy73UTodYzEWo2u9h/RDoR'; +moduleBuffer += + 'oID2TIRJ302E3UYnQpkR54LhKfPgAjsP8sPPg2cdeR4MVefBl5B88wjzAM+vToNn6TS4YPo0uJjToMg1YmfBkp5JMOlVJsEkENpL'; +moduleBuffer += + 'DjcHljz+KaCw4yPNgCW/+QRY8ljjf8Irxv9uUx3/nzfF+P+sseP/ftO2dAoY/hOiWpxZHf1nTh3839LB/+tpg3+3cYN/yWEG/9LS'; +moduleBuffer += + 'NIHxNnXs329mGvuT/uHH/iZzpLGv7txP+epu3RS6VXITMpNh3Swyrz5dwdqBcn6myIE6YmiLD+F6f8TXT7EPjp6DhiEOftfSiZr0'; +moduleBuffer += + 'HQab80HN9Jz/w90yQJ6uAQr5IziZfL/1pWphx9YiSskjpf9IBi2zlDxoTdiejVgy6XU07iP7pyukAVDKQ3kF5o8n7A4pqd6NWJCR'; +moduleBuffer += + 'AM+ImOXy3dblkb4KSPYxpw+InEenljbHwKvFnLwpGRzHbK2bQnWy0/y6qXBoGXpnOgHciy53mgyMz2LS0tGFK/AjLg7TFeSkhM9C'; +moduleBuffer += + 'Di3yOvlj5E6alshDAZ5hO8hvVW7MU/M4D9N/bChozSh2zGQWQr3lYbBlOjBZf+IlZFH9cdNL/tsU6jujWFFlusMQA9Pd7hvvo2M5'; +moduleBuffer += + 'UMdyQOlZaTZHMkuNHFgns2LQybG5dkpGbu9cJVVsWX87aA2JClRqTzMMWAQT2RQWZ73dphxQSGZHMwm11A4eawKCuEvUgwsKoD38'; +moduleBuffer += + 'v3t2QcUNuQ/Wfw/wvaFXj9j/rSN4r8yfYEi6B+z5XE3lUoBuWypq6Hk/gYU2Pdhzikxa4TSUR1gSVmbE+yo++EfhdHywzaXVU93U'; +moduleBuffer += + 'xFyPq7oeL4Bd7ZlTVZYyl1OoypYZEQGLIVTEozGbDHGYz9PRAkCrHS6KOjE2O4yOd/mI59Nf4eq1qVnZa1pmLH41SZ5vKTMXexmw'; +moduleBuffer += + 'GOsyx9aIzzBfGWqLzzBX9ejez+J4HnOjFPJe8km/yNcUumAYI6sqVXc20h0tckf4k2UeASUZ2YCp+cUX9XHxl8qvaxM9m9dXMrEM'; +moduleBuffer += + '9YT8qddmtdVRVrMxKdJRke0vvDZzzjClzYB6HpY6bcxwHWNTihLr+1xUlEhHBBnJHnBkM1kzj1dQnKao2C9Oidixqbgsw2/RWYhn'; +moduleBuffer += + 'rKLI/ZIUs8iTTbLi/6ugjLbzVj7oSFOr86ufI+3Jsm2pKiu0m+4J/uHrfdVxqPe5U7hpPWwAxSgf99wwH3fgB0gfRxznM7X0+uPQ'; +moduleBuffer += + '0hdPrzc/8AUR7a73f/PK7eScqEzORb2Tc5FOzj/h5Fw0w+RcZCfnhJ2cL5yhH66otFQHatlSd+5aas91gAZFS/+wt1pcDqD4QpMC'; +moduleBuffer += + 'pDE9NZd32NRc6U/lq5RZuZLLZQ/O51DXnnPZPM0vrVOZwVrwy0I4NW0CurucpJ1a29eEHn2YrJ4iFq3L9oU9Ltt1ueew5+pPRLxF'; +moduleBuffer += + 'zbLs50RMxMrVjBElQhvd2IHSNBuFeqbqqpzesS/4zTtWFtO1lcWUx7widuzelboH7GJaeZYp6h7iYgqL5HMpgWgiLfRZO9QO7VBi'; +moduleBuffer += + 'Dtmh9E1z7QSftV7tQ5D2LrR9WiV9fm7Rp2pzDeXzp98wmgBCvjF7VyM1rOG1ZfOrUHCdqwj8NPeLZGF/OAUe5ykO0OLixj67sxcX'; +moduleBuffer += + 'd6uZDoxrERhn2N3pnobdDZMJY+IKf36oAhKl3TQziLaA0QkqxnwEhCirvjxtbhkPSTQzs6DFmgWtYentZbC0a1pU1zRpMIfWRNEB'; +moduleBuffer += + 'lOOS1dSLNB1YBPwsRFQiHGtwtmf1lZ3mPFSQNclnX8ZLuOhIT5mMbQyBXd3HfRP1zL6BcpMNdIAWm2xgZ6fbZGlHNHpUZi+APDxi'; +moduleBuffer += + 'TqskTMuKDXagOEqrWy1o+OeLdhFonmzkKV6tSagY3xzkAwA6jfw6WJXH166GvHkdz2DZvW71anw+mtrDLrADiHgM8/HPbicGqpaH'; +moduleBuffer += + 'w8xBH7r82pwFMYDPdtRnXQuJtqN+oDyPy1nhqaxAET9TwZI9+BfIJ/JXpxUZEkPCGXfLstHCVFns0ZaCz55+LFHFs2VTD7bbUfpJ'; +moduleBuffer += + 'A5Dt6TLWVYVtIUliMUVsUgQd168y+q0qCYraNvQqYhw4s/UydQQGBUQ+xMQlary03l0UWWxMzFyUWBRt6hRPI5m/22xXEhhlfiUk'; +moduleBuffer += + '7speIT79YqOj6VGBAuNxi8cf0bR19m0Ua8F3tku7LHDPkMv4W2ivSXXJ7o2YwWYAgaOh4JC447monk4gbXcKD5QUp/BUIbpesgGZ'; +moduleBuffer += + 'xP21le+DkVAvn4G4H5fQT8dvoHMMsF6dZhgCmoMjVNoim5mi5KFvISghUAVDZqAiaSBCdBJNShSSzMJLN0YI5o7bLU3aF9tYSVHT'; +moduleBuffer += + 'GtSC0nchc2frmb5LR5j1tVtqEH6VZfeGcT6Rx7bafVmspRf1KeK5palYYxtQm3YXuNho7T7PXg5DQ8EWTlNDIT7U3a5iQwptZ/oM'; +moduleBuffer += + 'ueghJQ+rpORhDyl5SUWeuMF7cZGYyqrDQPTKXgiDiE1nWiBqObGQSNgZterapPR99WKzhPlWlXIMgBR4PLxfg10PcC/qY+RiPvKz'; +moduleBuffer += + 'cS9Hox79qRxs/JlLtylNCImCRft+5vt1HSeTrmbEe+yvU4Xy2LSOR3wlxKga1XPa/mxL+O2pymID93Th8i+ah7m5qFPXzGQRM5PV'; +moduleBuffer += + 'k5ADxea/ppC6+02yXo3rWNO5yIRYP6qpI/GCYVRb6EuxUhLsmXJTzLEoN8nUnKxxTi91kbZY16g6ztVA2oGEimFbOnZYPW8X9hGK'; +moduleBuffer += + 'DcUjptrQaQyZ0fV23cce3hg6f0M7VsKMkH2T/q9GpYE9SbgRc5C4/s1qgGbVCpCzZ1W+F1V3/9J+Ear9Ajs+j2GcgHiGCeEyimng'; +moduleBuffer += + 'Hc+4q2EhuSNyQsDztOJCOXUWFx+9A4jpj7nLMhAZcDtuvIznU0019yHBzQOkLbBthR5gAwV0d5K1tJtn6Rt9l0qY/VnGN/pqfsFY'; +moduleBuffer += + 'YKFc6XoSk6btsScfx4je/dXtOqLvAmDtga9un2lEP3dKegHKpxM1GgVdRiiaXZs5/zTmaQbFatanHFlFCjn1o5FfK9ZSDdWSBbGm'; +moduleBuffer += + 'FqmwWEKrD11XbjxZpFgEOnkZjP3xUGVkisoNGX6cFJ/2lBTo/BVsnOjq/srVWNajfNuOHV7+++kXakUGSHO3CFBmXMR18FIMHfKu'; +moduleBuffer += + 'zzTSPYvXQ8KSpcNmko3ws6n8LHKH5ouMyrdt8TE/w2N+1z0mKUMufVJV8OtHSP8YV8XMkFJlFkOe8W2U568iXcQWqINQVtj52gXl'; +moduleBuffer += + 'Ng6xk6QY3CUhoHfiyykxeMX3MFk8ZF6JieiS0cTp+hpD2C9UBhLpv2Wer0Zte1Nokym7jxhYe9hib5H2+JnqmHiaxqAu6JDTYr5G'; +moduleBuffer += + '5M7vMhW2j5QooU2F7dukNgvYn0Bm+PMLWh0/X1DZABgXd5ZufUVWCtb6PYIRbMJXrodtU72oZk3YVmhFLkD63evcHqv7T12xEtDg'; +moduleBuffer += + 'uKsVQovntLa6Dtsrpm89u820vcdh02fYfPJNt+zQGZQ/cgus0nUoV9MqvWpanS7SYaY6N77V1bnvrbbOwy0wbzrqBeZNMy4wG4wJ'; +moduleBuffer += + '1mWFworkb4VSFXH8RC8D3xDkxqtXdNGjo1t3aAgz+FHmqyA6NyvCkK0p2SqJi4oMjBQi4mzGzCoDM/XZldP6bPIIfXbnF1yf3fUF'; +moduleBuffer += + 'BOrUi3X+8coV+WvX77RVbpQjVnlpoY6rGNCCRnp7qNJ8C1sSleo+6XzsxSdrz8BCbF16ECmTzFjzhss32JNXNP3bOom92mH6UCwa'; +moduleBuffer += + 'QDjoMugWZCemVxLD3mVlNCuMP56a6b96YmomLv2xav6Orxo0Nrsi2DfuccfLuG30SOX0vapULipO/iPPJnhzYnmNpjoYu0wFSx9q'; +moduleBuffer += + '2sEWDD2anJweobCrmbQfcZG/N/pQkggVcKmrrs6JVAvIAACJPNDM4J5W46sh5lGvmz/sBiuSwSWZzSXZUMqoluNtSLKG4xyYMBrF'; +moduleBuffer += + 'Ue4msSMldWtnzD7I99pbHUJAFzxrFS/CU/UBuYksrr5uN/+v+6bu4O/FTh3bgnCK2tPTwSGgFofp4BG/p4OjSgdH2sFR0cHrjcW+'; +moduleBuffer += + '3eoTiwMIm3E9vN4ctoujShdvlOXv0Rm7OCy6+IDtp1DpC31pZE8Xh/T3TO3iMD/o7lPgg/Zv2NO/sau92r8aBvCHR0mZA6acBxtH'; +moduleBuffer += + 'yZSTjjWT5JIeDRgMLuE6ZGz37c7vpY9GLpMnpKdeq6J0a0Vge+y6fnLUdX3NjiirJpeVccZaIdCUenZ5QUjchPVbFsK+DoRxWnh3'; +moduleBuffer += + '+ZdWDBG6hoy+TZbjD9dVu46VwiaYIs+CwhFj6B7Ssm3z87F3yk1frCksIM5Vjp3XCeCkkV01Yk5wQ93cW1G+HJZzWoHlmjYi9WM6'; +moduleBuffer += + 'eYapwNa1QwhYXaWLHO8J0W8+/rDfasi8Zzhr9LLQ6t+4LMQf271hb/dGR/upfn7Un2q/UY+Xy2NYVBZM/1TTn+Y+VWRdZW4PjNJv'; +moduleBuffer += + 'qq0DrJ282ti2pSpXzJ2XPhgTGQvnJNsYgfpNey8qes/BPXCZX/Re2Nt79sME2slB8cZ+7xsHR9t7PzvWSbOkHGcaJ9QVef5hBHKB'; +moduleBuffer += + 'eTR9EBaACYLOJgragtJrYg3Gz7cO+wXqrl3ULt2eHWY2HQYG5AKVr5aqfHWOyldLaHigFBWqFGUgRZ1HcZaavdZ5nq1zl9db6RVa'; +moduleBuffer += + '6bO10ou10mfNXOnlTjR7XMFo3mFC0C6n1Imw+qAIq/cUvMDjgP57RTbNDpQ9MXQFNFCmv2jgKa08xFFFo3WGPPhWaHD8iY+FHnQ6'; +moduleBuffer += + 'MFOpahuWGYVLK2o/xQBHs/O8qo7sW+4kaXIrP4WmmfymH4zLZpDe11ByNk8pibawVPefzXKc/tov3vqyniod3kC1qliBAwWmlBAD'; +moduleBuffer += + 'dd2kX7L5lh2UwNU3VY0/LIeQ1ed7X9ovX7rgFrp4uo2VuWE/Wtf7Y66XegOYnaS5MteT0mfzGE2LRWV5nE1bacd2qKlR2XnK4aa6'; +moduleBuffer += + 'ue4CmS/nMoy4J7d0ZE/hSEreBXue6bH7yuDslz/9VfOvfRzVIK56NZX8sW5GCgLzFMiiWJj8wH0uvyWTI2NFzR/+tEuO7Ks1ylfO'; +moduleBuffer += + 'UzJqDatNvGbjNQPrPIARuAHcVunNzB/5tMZtm6wBBANElapnzBqANQYz/WbsTF1tU5onjB36i71+mYqtwo4vIhjZ0uJyZyLYYqbB'; +moduleBuffer += + 'r8pn/sgdO3uGPl8Ao39ky85i9O+Xi6qjf+Y6rc1khjrDGeq8eUtvnVP874puvMeOT+p4DPBIB4OBfP9npJ4++rHyyU/L8cjundY4'; +moduleBuffer += + '5tmLCs8NGEUyw+GkWcl1FJxtNvrkWzEUOE0+7udInTuPq1BW5PMN7s7Cu4eyDetBc7uyasdkOC39mN8MHQUlFzU0GAx+ymbGuH8y'; +moduleBuffer += + 'KVpciPbgYYBKjgFTNsCwB6Z0tglBh+OBDsdo7gL5yD2wpD+0OKIWXD9l9eEs3zPo5z6ZXjql6GpQzjNiqyzrotd2Yyn9stGqZcna'; +moduleBuffer += + 'Xnuiar67lrzT9NDwTpEerZRIKxhxLqqda5p7WRxpCGhIR5uL5mGLKG2bvnUcO7OYleYwWIPCKqr2tMIaOpMhTYbPDPbVV8dqX4WD'; +moduleBuffer += + 'Sq1V5jKK9y0GglcmpF+xKyZ/YN3q2jshwAjKP5f5l85TRRqbNthRcIgyLsaZZS8see2SSzzd+FMtaOm6GGe97l/uPhQCjObOBWFl'; +moduleBuffer += + '0CsVzE3ebPygagiY6pmDL1stT51Q7VOm6ww+6Yd0hrbVfKDWxVg5Aj1VEVXCg0UhgkUBPInM5x3PaFYqLJgiWVTsEz2tgYkCuQra'; +moduleBuffer += + 'gVYYHLlC31X4X2Qp8GlPw+TFGtgJNdo/UjooWQsoKCoXIXO+I1yDaucw9VLSKtnvV5Av5uRCoTBVc1yLoF6MoG/zNIvAl6gWy9h+'; +moduleBuffer += + 'Q5WoIHE5W1S5nkKcOmrZ5P7v9comR6rt1ldvn6G2t7NUazt4qLe2mYQnXeY/dbPclU6taxKlcb4Pf2pa5YQcp1uCosoLjx0/+WO7'; +moduleBuffer += + 'tlf2/pUFBExXCuZsNkNEcxqdG0YF7gJ5F5I4CyPCudjIT3C+1FThmjL5nl1KhyAXkiBBqi/ZEbQixz+Vfrs5/f7NXzym+4/0wW54'; +moduleBuffer += + 'eKYP9tqHyw924J+293ywr4emUVHhI0zfukIMIsdfGVZVn1RVn2lwj5gbLKk/MLPheITYPZyba9XeMoLYgNWdsOKhM9YJRKZYorbS'; +moduleBuffer += + '3TG3Yhtx52Uuz8hABtpqWeyC1dD8c381LIK5Wd1u0nk0YBE0UOPxJMVBG31qnz69bVSdIKRGgZtWBoNpmswgBhQj8NL2r8KmaZdZ'; +moduleBuffer += + 'WQJxRjoJrZG9res4Lcdnca0eSS/TH0ZUQ5LDJ12X7zerl3ln8ax2XX7+KrlPCv4TC1plweIcwIFYGYP5y+SMNy7OEUpnvzB/Ged1'; +moduleBuffer += + '4CbJmmihu5Imd/RoyAzp8s5K/i2F6o7lVwoggzI0QvU7fCxSKNLbw1sD6+0JHcWIjkaFvnAprRfraGQhAJGbvUF1R7S8ZBhlMt0A'; +moduleBuffer += + 'KyEmDAehQru9LJyuVRxpzG+5eecMY/7em0vh8a6bd05Z8vx1dK6RbJ7LhsgjrUJ9nWt3S/aon7Std6OlbauQ9xOsdqS2TZVtpwu2'; +moduleBuffer += + '66cItn9QaDuB9aGWe5VlVsSmJy2Zl4Fpp1DBV5IZWsWLlavQsItQDkBeB6Y0lUEOJ374hfhBORI/WaRR8l+kGnu7YejuY4sw0+rI'; +moduleBuffer += + 'prhP9BMvoqhFuTvX2WpWXWjpuU2Sr+Ou+ufXQVbL/cvmieS2boXutSXNbrHALy/YFoNpbIuBZVuUqXyZwnBkKVXKduDgk2dOpyBf'; +moduleBuffer += + 'VGFqlOUpseTE/koLFcZ2r5bjJPl9XdFlPuiKnpGTAJfh7zVKQwj53qK9YWhMP5Io/2B5d/Z47r5oJonzZr/How8jlw0ra8lADxJr'; +moduleBuffer += + 'oSklrpmrueWYq3n2lDQZXHCs07tMknGU6TAuLWMJfK4zoJTyswr7dccHk5cjxUbS2YIUexoR9iVTNEbb7Hs+sFMNL4B+YmWqwbfJ'; +moduleBuffer += + 'qaqwzwGq6GgwMZ8crZfOKGs+XkHzBYfR7o4mDOXwYSePlmRPauro79J8W0F/M3bHrhDyuvkSKgCyPdbyJZfNgy2lgIbbvMVzu+kB'; +moduleBuffer += + 'aFcIu2Ac3Gw1khLNa2DFXGFlFb6Q1LOyz46D4mYioMkrzoqscBXRWahYC6XEChRkTrsFVoU9Hxch9mn53m0icX4y0oiWCrZIhbML'; +moduleBuffer += + '9SsXSH/aBW5kkH4lhQTjA28OHJm9LMOFfe3wtXy+cTxquTM4HrX8S3w8avmgf4y1wI6ZG1XrZfAhi57CuZ2mnxktlDEcGHwinIpW'; +moduleBuffer += + 'FLhDRrNjt+tPZKuA1VFJ6Gn+1TgM5mrC0ptpaoOgoutNnUu+iiPJu3yVYgu8Ma7CRI6wogwogHOuuqWapf0vkjGpkMuQDuaOhVpz'; +moduleBuffer += + '420FeKF61rqo2JKyWEPamMEajJjwpHLF0kQrvtKmYbQaTTFBP1eiQM4a/njPVi9EA5LncMfCidp9mucK6a76qA9jja1RJIOXMqul'; +moduleBuffer += + 'b2ucmmmaCsRiSI9LpxLJkTV1H2xWTdoUxCA3O2hy8iJwCP9Vr/FkoVoaF5p0QRV2jH5OP6YZxbH/cenuhIWNQGQPisy6TA9NscDH'; +moduleBuffer += + 'jJlReC5FSlNY3rmMfrzR8fpMUsBAqWrL/usXmBWRQocLirf0A8qVDIXac8Jo5ttl3lfxNcfY1LFkuZU9EPVpZTRfchm6/ab7KHhJ'; +moduleBuffer += + 'U2ZHKMuteSlvXqTxvBo7PNvG2VUFV7VaqgD36A5ZioL8F/zDVTh/AMf/gX8inTl75Ti9NXA745GqO/iI3NbMN0BLr3HHyPf9G2Cp'; +moduleBuffer += + 'Pyire+SRnuounmGjTUdqx77JPscrbXSYobMC4wecuSb9clzZdLAqV42MWK97zmGEPOJr3vUrvE7+oV/RGMHX3Ijjj+IfRYbnt/3q'; +moduleBuffer += + 'qHtt9E7YDPIb79yu1YXSa1vk+I0osL12QAqOsrqbH8Jt+a0PbS9a9ygglW9HgW3d+oeOorrCfr3/oyLmN/J/xx/00wQO1n8MhVrd'; +moduleBuffer += + 'pBRUqrvwGKx0vSa6qn3u+ZV5XgXkxz2A/GAhvZzp2e0Q814eeLpq7oq7b1Xw9zI/h3vFd7XVybmqwfB9nFaG4eb33zDuwm/ZF/C5'; +moduleBuffer += + 'sz83Te7ydLbwiCrNPRvkg3/VeAU26nO+MixUcoWpezp1LpqwRJsQDOxbjEB25HROseZvsYM9CDVztlyLrJU0AHeaubm2k6S3qGbc'; +moduleBuffer += + 'aZDPQN10BkQJIfgIWjnj/HGbyZLcrJ56fR/Sxmq2gUDThDYUxoIlmymjNr9jXFNGQTbOt7gz1p+18vDa1fQyZE31rwA7Gagr3J+K'; +moduleBuffer += + 'IsBnBI7A+qs9KOqmVL7dAC3M4wpDl6eG+dL0Hba/bAyAYihNkW/EHE0traOs5fzpjkEMwJui9FO4NVboTrmzWzNCMQbPJzokCy6l'; +moduleBuffer += + 'NDriX9JndIPoTaHUT5b3LEx/ElKGHEHgPOyBR3oLaChH9xbPov+ayIYOb0g7wcrQ5WyCjIFbMuY7EtkjAQC3cIljUMIZjq2qDFOp'; +moduleBuffer += + '+j2CMkqfKHcNwc+MrgBGbSJe/uj3quH6R94+Xx0c1fa5cupapmvY/fu4Zn95X7lm34XjB/eVa/a9+3rW7Gk1MYaOlWE/m5N/+N/s'; +moduleBuffer += + 'tnkXzv8V/zRtTT/oqWm9mQrYP6ervZ4hQy8tjwOD1NMMk8KlehQPcrUrFC2iLTomP/k6UttjozskWx0g2AEtUfLAAqyBvfPF6Vf8'; +moduleBuffer += + 'AuJfyjdF7kKONo6ydyjxSe+oiYpRY+fheZ67BVTZntLOLulmmtpJy+T1hhX9SiDMldesyrxrlnlXys0+rQKXqnn7UqZ3C7NIrdw4'; +moduleBuffer += + 'iXSw687gZkPA8P6h8slfjK0KrXTNytBsi93Dx40+fdzYx48b2/j0l3Gpy8oJ+Zo9FwpYFthYQVtwuGG155adGFZfu2VnMay24fgb'; +moduleBuffer += + '+McOq9239OyOF0wxjJUkzhjl76lRFJlmKKs4wQ7TlN13silfuLNsyhYcf/nOsinb7uxpyn+mRwJ2YgNrn0EUj/z1IXkWOG3/UoUx'; +moduleBuffer += + 'rESYbHKOM/ov6UlQ4a+eYuCfZhkqlyyvEpkiz5X1cSh77aDaJgoEwAebxVL1HI9TL72hmXmWvAAe8N3bt3uViN58vHqO71A931qc'; +moduleBuffer += + 'HK66rSM7eqrbUj0HJV31fHNxcrjqNr2ht7rRN/RWN1I9P3DjY1U3NtZb3eax3uo2Vc9HixPZl3uNRS401S/CVX0NUvWLpIn56CM7'; +moduleBuffer += + 'vPQFzkQ0NH27M+lHRbaoWyBi+k+RHbBSPNOeJyPeNULtNf65pFah5MezuRXLyiHao63Kp4CS5Du9waHWF+dpsh4agyovKI255+Fd'; +moduleBuffer += + 'mihutoc1h7a/M4N06MCrb/3kLT/89H2fWPdc7EooHBj6wf+6+2NfuOGBn33Le24fTQSYZ3Jjfu/3d3ltkQuUp9MbuuWhr23e+Za/'; +moduleBuffer += + '3Zg8DyuXtHBoz7tuv/5D3/zy19agBPJyWzoi6RJqYxPCIQKnppGWFiVNiIxCwDQk9b7GFA3UdZTK0IFa+IjJibXb5itvzQDJaAa6'; +moduleBuffer += + 'qrgrE83/rcaycqpZRFrcthkrNEVdrutrWO61AEMB9OvA7dwMsmC52eir4O7QBMkFvr9WzcyqJ8gUDi6AqHr3mk44CBdzvpucPwiz'; +moduleBuffer += + 'w+bywrvX6NjCfv1gM/m9KQuYsWw51lQTpt9l6CyyNxJM8vOaG0nPsLoxBAxPCXXyjGYNVX+7zpsdpO9uduDxlu85413pY961vJcv'; +moduleBuffer += + 'KLfMGR623kAdEsyfc0OQubg6Jqpwa3zVSatLNG0u4556auGbTW+t6WpX5jGyvtljeNFdZZPPn77D+za/imzxexhD3VJJ28IVrCod'; +moduleBuffer += + 'lcZzPHXkViML9E6mL8ZHGfOvxn405qQtvYRyovxl0MkuL9/z/R0q/p/nWR9NkQO5cDtBf89tkgL6VYh2S8qm6EbvU+2Xf7r2Nhv+'; +moduleBuffer += + 'Gdu0AECUcQ/t2pAdG1PqUVa43GWZcrMAjqxwhdtuuN5Zx287oNQOEzf2zCJSi7Y9i56p9mtppIDrNt/7U5HzPmENTMYamCr9auf1'; +moduleBuffer += + 'IL+m7va+Bb+sqAjbFFWIQ1TQLhJwwnRc3hd3fHf9sCrBRmXg3vsU+E0JwaqHBUatQ2HxUH0YKJv8NXjRi+dZJJOnMC0uYenBqAJL'; +moduleBuffer += + 'vXCGmtxNReZIiuNQPX7RmFLLXK1leaFs2MAVeZ2Lp76PDOW3NaIsKPog/AO8y9KjEDmnC4OfDJLlRycxFi6XjFlCWJycN90USPFG'; +moduleBuffer += + 'fv2hasT82mHv1w6nKog9oyXM939q59GMlsM8HOmhPhE/1sPP5RTG7LPjrJh+oUUyi6LZ1c8Ew5dOvuRNRJT+Ve9jubOWWF+AGwAq'; +moduleBuffer += + 'oKUiKPCbpQ02Pb3dUONrY6rxFeS3NL7Gih1lhpmK8bWS11YJvLkpcBFxhBJnUByVg/mVp6jLtqb50v2EDkbafBz3jf6EXdgUtCKF'; +moduleBuffer += + 'Mv4YfflFnwuJrsN8yfkdaa5mp86zVVYATt/Y7E9s9BHFE9n2yMfDZVvmKIKOsvCOvH+VrKpLkG5jEKOtuXIe1WmlgwuH0ivkn3C0'; +moduleBuffer += + 'HXI1R30AU77KYjNGTD5x032ecqBB05+EDdjXB8ilsE0Np2thKTCEHh9bix7ynvAmJcumTwzyA6TvrD/WnHgGC5Yb+CFP0ewzc0q3'; +moduleBuffer += + 'vPyZRf3tOm29y0YDd3jeomby63IrMmqZ1P2rlQc2FbmN9LMSrFSe/IOGlla+vm+/vl/5+h8Iir4O7WbDfg5A2YJ+9g7z4QNlGkLS'; +moduleBuffer += + 'nfC6NgflZX1q6wHS0Hazd9hu5gO0mwN0c+i+PJv1pYBy1mM2f1PT3vCFwB58MXCyT48XXSOzHfDR2F258qmsjHYu1hhvyN/QkX/W'; +moduleBuffer += + 'U+Z7b6jcbpBJ1l2D1DtFoWePk4PXBKetO3WtWcOm5mYV5Nany7g9X22kMdHQUJ01YKrVnoMBLa3cHzN1QHb+J9tn+OtknTz/1md5'; +moduleBuffer += + '/N/+dX/S550qXXXGkHVAHzjkXd85vXL2XAQLnzF0SP9Xv75zpvsxXi/lZsPQr/Wn/uvl9JzRO/JD8jXNvM7CIXN9e1F2+uXUJM68'; +moduleBuffer += + 'XONlPxLLxBky7dOzRZfLEuTqyjK5fIP84+p+bseb11445A9JP85rn55//q/z+/9aDjMKdYsuBxJQBvlysy+Wv6cPBpPyF1z6e3C+'; +moduleBuffer += + 'cDCYwF9Z2r4X+5U0CBBKZBiq2y7/5UYZJwflH2m59/xONE9LTBbNy/x57SdL8fmjd0B3n5+DyTXMg8vm0W/vB7KqNnIkkpDn5L/a'; +moduleBuffer += + 'CFbMm3HoLzeb5FO0n4wnyPmmuAuqgvLakdf3XmuvCZLc5w1aOAdyQyObc64/hivkRW/jHbaSfy8fiJv9JL82Fy1zu8wK7+J5mXe1'; +moduleBuffer += + 'HIz/ygOGhVe0W6QAbyMqMbwuP6nbBgXMWpkZc4azOXLoXzYP4Zk9fdXIJ0Qfmg1SgoWXYzoUn2ck+6/SvPqFfSL6rstmn20GOtDK'; +moduleBuffer += + 'ZLDqJekV8vkwm4Zlo1o4lMmXlW/XcfePe/b3WH9Pp/w+MmLsBaFeEE+7wD3B1wvCaRfoM+Qnv/jJ+0P59MPb8wnv6nzrHVE3/2L6'; +moduleBuffer += + 'l9LuL3uX9UFICq+V+iZ+tcsD45PMAR3UnTPk9oVD626QobBBKslGO4vWyiTIRrPTcSIDee2a7HS5xF6/cG0HP6zJzrQlcv8Za1ni'; +moduleBuffer += + '6lzDVsZrUNhZmF9ANvs9ePLZxusOd2pgqeicMXoHF71/tj+08aImO2NDZ9GQeWXnTJmnl5PLp3lJXx0p26/NH/7b+zzFFEkR9qNN'; +moduleBuffer += + 'X/R0jRxf//sr+2CHGNnx0NlSlMc59oiRm7//cLCyE85rR/xFC7JwHkj0a3kdl9z9zdBeIZXwFL/DdZ/vRe0i5qP79tXtVXtxrJfk'; +moduleBuffer += + 'zRx6f+MSmVutKMnv+HdRg+bnG6WZ6b/VvCS/TY7yBfl4UbDvtVLQzidcQYbvk4+O3mfdKCGGeT72+pp9mLwgzuRxSTssRm6EGDfT'; +moduleBuffer += + '3Q5IwfaO/wchECqHDgWr2n1Q94a3I65TrsnqK+d14J5vz1J6QIg6L2vDxlFHzhOsycnV2Or9rNnNEhGplQtj1kWk8Y+UVBsoNVkc'; +moduleBuffer += + 'mivxz8tUGMhHX3efkihkrawpn0edzguHmiNZeLd8xWxROm6kU9z9fdIMfPf202R5XChNWZg9bZTTrqWhyzU2C2OVjTl9qCkjLZNR'; +moduleBuffer += + 'YlslVa9tL5SheOb1srzWWG/HX9HnWgDfkrRABmy2EI8O4byq55tfZ/u25yqPTTx9TbWtxKvW8y3lDQ7zt709gPVikb+J+LEGsje2'; +moduleBuffer += + '50qXYuMfrzHI3H2c3v+yyvIih7GMaVlZ5CjtnHG5dK7MnTXZwivkpeXNrpBOn/2fzEAbEesLn6n0d7lfLjpGJOa7wCiC3shk6UZB'; +moduleBuffer += + 'KudzwU+9Wfmpa0wG5OW3uVPZnLca/Tshe+pdmGav/JtXDu146/Z94dqhkXd9YeweH5P1jo68aT9Uvdx7DscU2SE+oDkcavlWK9Jt'; +moduleBuffer += + 'R1Ei1/UrNQ2ukx/6hzkG0z8qrqaDwkhJAkawCV+GZ435KLSuMWMZrfvO9e+tZfVOlDcvY303R10iUOSue2sic595WR8SoweKfvCv'; +moduleBuffer += + 'bTOihQotmK31YFUHsXhDngwSfYrXtXhOkAaC3oVSYH1VO8RFpEwNGdIBzDqW8fVYYLFCjHROfyZ1pYA/yWBk8dpXznBR5Vd5ckDG'; +moduleBuffer += + 'KXka9uE+a6LkJFjVJ2vwcM/jbD3P9OlhaQxLBzQu6fNIayjL3aRd7uDMNUgvU+kO0atIzou+AFHQwmqHGNchvnbI6T0d4ld7Qrqn'; +moduleBuffer += + '1mV/B7hwSqeczveV1X+kc0alQ07nmv/KKT/aUnnazJ2gQSYqeFZ6gs+QStgLfENEsndI3n4X1DwiAmQjW3RJ3+zMU1yt14qpwa5q'; +moduleBuffer += + 'QyMwimyKWtwUnrmqPRtn+tLUAVvk8lRsvNeZRWi4MqKbVd1O6jhxYbPEBScz/pbXgDx31kr5J71kNdGFAGWdjIJo5eq2jf8P1RAd'; +moduleBuffer += + 'ZLNlDUWCZqxK2B/shrD14C67/j+Agt/Jx4uC9f/BKyaKgn2/lIJzRbpxBWMoGMy3FgWHtsgeMi/ftsXtIS0ZCfJc2d/1lTWrbajR'; +moduleBuffer += + 'VpzEvr6MNE15JLKQb3DJannhhOkG6HbAcm9HCs3BxgJkRCaF697jNPWyPvxfPgkHop2QAbmvQFtIymhkbOck76qJOLAtowVsBXQH'; +moduleBuffer += + 'uV82EsYZ5eDuCea1QwVbyrCha8giqLHcYdlrMV7RDLux7XH9zwMO4jxYaRcijuOFyip4UAe5V/lBR4GMO9lNsoUinjzTfXvZ6Vyx'; +moduleBuffer += + 'Ci7PtEi9w/3Smv4LFwSIR1wJ0i5zo2KoYzzI1OtHX/aTwCq8YGpTTndNkbtsHbDTcwYl/y97bwNl11WdCd6/9959776qupJKclmS'; +moduleBuffer += + 'pfuuS9KTrLLKSFYJ2YCugn80QONksdJuFp3lXu2ecT+x0rZxGCYjWSIWTkEEFiCIICKpEAUXRAZBHCNAJGUjkwooQUkUWp04sZIx'; +moduleBuffer += + 'IMCA0q1JFFDw7O/b59x736sqSSZkMr0m9lLdn3fOuefss8/e++y9z96Jblri19NTpQ3uXVWnWZmohD3SE1yRRpk6TP1Hv+FCAyI5'; +moduleBuffer += + 'J0MiKtyeXoP1N5AMUUhwrJBQ6XMjG5+kmp1i6lvOX+p0kenzesrh425rmSHpKHeB6QVKJaUDB+C55KHk8lJJwYEZJY/BT/ew9D1B'; +moduleBuffer += + '2l+v02rJ9bzfaaXICCwr+Fpo2tHSsNKElluwk7Z0qbUI1wOV1mKlH635MpR5RMh5rWa+M1q9jcKGfGgewdaCK4vJwqV6kVv7XIWq'; +moduleBuffer += + '3zET0WYEZNg/5+Mf6ZAg/SAXSDfSJ9cqdhfo31R8D27joa7Z8F06EAPft3HHhsd+rDcNmiJ0LDaYa0hZiYYt1LNIu96EmYpIxqKN'; +moduleBuffer += + 'JVRGmassGWMx+Dsu3CZ/IlAyPaWeXLWNpt37W1EPJYuTflCy/tuIfKC0QmT6QWQURPlH0Oxwp9SXjjpYoln5E4DGREpjBpSGHHaz'; +moduleBuffer += + 'UEamp5CSxfj3Kux1BK5XAWceYMRGH7svgDW1JGQmWB0LVlldjHVXe5Wsi0rSBAAbiUglo3jaDkEoSgaTgZvcUC4VpFCpd5EdrDS4'; +moduleBuffer += + 'mrjqguWV5sPT+fAwHwuL+bjgd83HVcV8ODPmwzhuLemaDzA2Ab+j82FOaC3BC3eW+VjYNR9eaT4cMx/mI2h2eafUl451eHW3EWDF'; +moduleBuffer += + 'fPQxlh1FyjgL7m8h4WGyCP8sns+bDc9bmptitglx58DzAsBeSw/ZzIHwJQCf8uYC8JwIv2QGwl/Vi/BL5kL4hS8G4ZddGcL3RRbj'; +moduleBuffer += + 'BcAynDgqcU+XUq1Som4AJy+ekBQANg7ebgnArgLY7QHwEffKMXgOAM/AYE8x+PIAdmfB4BzAunlwZsVib1Ysdg2QXQK5VlAAeafb'; +moduleBuffer += + 'R4I7yqUK7EyvVJpY2QxmlyZWdrHwlT9uaYK/4JYidY804ev2dh/EQuxWkaxSCGA2gRf0qOoVMcr9k6ZMwyURw+4zGdfeCIO5iLFy'; +moduleBuffer += + 'FhFDPjgP0wksE6STPlkFm2z3yW77FNx96G7f5cANhFR490pv+S/FgCqzA7wyJ8B7f2nO8ctcAHcxgraK3TPhW3lx8O0DfCsG0fsK'; +moduleBuffer += + 'APcBwMToPu7WXSEXbiFs+1csbBuS4d5mtk+zy9okG3CWp0lXfunv8xZrPCsZtfpeNmBjZs6yJg0ltezMRYNzQDjYVCpSCLJU0oCS'; +moduleBuffer += + 'ikCpQJYyuRIUBImIfrTEv/RWGpPULO9ycVYQngGhA17bp8FYslGaR8C45averuwG6ZqzOGlkN8DSN4oe3qovWLhiCmejVshOrkHv'; +moduleBuffer += + 'Xnt/n6uByOQdpVuskXMX7RqhyCB4jM1pLh84mqSORXfny2kwaTCGazZVRYDXCna1JXSQe/NkzmOWf5vGlm1xactWz6aZdu5Afgao'; +moduleBuffer += + 'ntRXe/vCMX9KdrZDSf16dzpMNfIvzC/1tjcV4u9x+D8sULV3/FcMrQ5rDNJhzlSyqyFAXrhGsf7QO7sU6370opTwe6R2tiI7/E6r'; +moduleBuffer += + 'zrxU4wBpHXTiBEwV8sM0rks3YgT15OqNGE+ourT419DMudAEznXKsIPzoTH0WHPmKz4Pdceshp4Vlzb0rJjD0LOi29CzIjf0OEvS'; +moduleBuffer += + 'VbMYepy5DT2wGRX2pvAnU3dJaxUNPW5h6HGXCHfLDT0+DD1vkcvKMf9eTZl8jzytGvPvgrJys/Pz1mqh9h3l7U7JvrMC9p0gt+8E'; +moduleBuffer += + 'tO8MZdDH0sKzpHV1Rp+l3MLje8xl4tObyRh44EUsmJNI40P4AN3vgCN5OTXu2HL6O/JDM5GUXAaEv9vA0YHRie6aoRPV1JrN1Cl0'; +moduleBuffer += + 'ow50o6ugG3WgG12pulGhqCutdnQVtKMryxYaBBhxaJvBsg1QZme6So2KxlyzstCcWnMN1E3JSpmBHDtgSnFzc81KmGu6fqe5xs3N'; +moduleBuffer += + 'NSthrukpYL/gaYFgRgH9hvzkmZ/WbnX+XYq53P4kUlPe3ocQxauSxmPpyodTwbbxdPWYH8ub1T8lQmKQ2DGqIRU6x1c8lK56mBpy'; +moduleBuffer += + 'DDrG8KUoDFbu7EagmhqBnMIItCo36qixZ/2D6RpcbxIElsvqRF7cvCNZnVt20pUPpvzpZTta1ydrCgvQSrUArZppAWq9ZKsG9nFK'; +moduleBuffer += + 'JiAagK57WL7m7mytk/pt2poezHvEV+abbW27nax+MG3P8oENsAk82LqRjbQ2su+tMflebllyZQhrE++xh2m6Sjc9mL5UPrDJjGW0'; +moduleBuffer += + 'd4TszA3FaIrx5Z9PN5dsXFvdHelIct34o2mvRao+l0VKVmSjbJHyljSjbosUS+QWKfm9MZtFiqXUIsUihUWqsQRbXKOAPDD+dLcC'; +moduleBuffer += + 'cjJ/YRSQR/MXRgF5+u1Pdysgp/MXp6VsNpKN5y/2/j0bPf73xy9r1WKHrVXLWxK1vOT65CXAppFkHQw7DYRucnGKdSS5MRnbkWzc'; +moduleBuffer += + 'kWzYsTN9OaDcRplVkN97iQoVON7PtkRcyuZBdHUTEf0GRKAalX3MZvUDlsXZ90YRbB5LBPfWUmBL2tSoJQ2kKVHx1tqnhOivaq1G'; +moduleBuffer += + 'e6/tq7I9a5S6jkap1NN9BeMmGevUKhRYJQi5TjDpTsg5K2Qc1+98ML0uWbGjtVYW9MqdyZrXiUhZS+TVTnm/8qf7fGiu23hcJWiK'; +moduleBuffer += + '3rVfJ5BBzfQ6GXhrjVRsvy65DpZRqXbn/X2VrV6yEfDZsCO5ERbaNkazdscOWVBbneSm5GU7BK6ClzfjR76/PilhbfqSZDS5YceO'; +moduleBuffer += + '5KU7WrABj2AVrE827XxwRzK6M7lhZ/KSna3VtNOt3ZGOJte9TrpwPQqt3fF6ZjBCq60VPA4mvR/AnnE7Qc3OyFSuStbtaMnCSEZ/'; +moduleBuffer += + 'WorL+t0h4FyB31ZgODvlu+1k5E7md5Gbn5YRa5tmc6bxqBrb8OdnW3RyzQ683ZodMSEwbTaS1dzdJGtkiCPJmuR6PGJs5eFinPJ+'; +moduleBuffer += + 'J8zZQnEE6jtbo7KjwAhRVWAnI1ydjAJa63SEtDNUeC6ZYTIwtNUCqPQGmcEWLD/XgQutTtbsxMBkxGuSGzDpsl/M5sn/k28vxMF5'; +moduleBuffer += + '2VH75NH4+frEu192AmsIEUEW3O1EX3a+7j7GFaBVNAAGvXyrv/NO2Ppff59mELY/VZI6+ELFODMxMfDK1gr9wtrXJw6+sBZf4xfW'; +moduleBuffer += + '6hfWdn3Bi0hs73wwWbXjTt4OPtj1Ha/8Hc1fYLLwBHmug4CRJEuHJ+3Bz4BhtvOTk6cfeRp3TXOHJI/ZKZANnJyEaND2EnWvOykC'; +moduleBuffer += + 'UiwNTjTyDDRWBuoWKZJmIUY0cxNrs8vEKoSjbGRtrnUWtxYkTbW1urn6vGxr9ZaIWAySYG2t3hI9nBKWbK0udm2HXFN3ZbnucWax'; +moduleBuffer += + 'JV/VupModtjtqr3q5d60Z2qvKtc+67P2qrz2CRQ76ZVrZ+f8kp2Xkaie9/W6twI7b3tOO6/3ZCsq7LyuGnml6iG3k99PeyXjr5s9'; +moduleBuffer += + '7/cYfyM1/qKbkVp+Uyf+mbyRn8mb+Jm8AbqEqz3YbQt06Zl3kWedjEGAR4AONtR79ayfBkbjVYH1r86opdbQB9udcAluBBGo++X3'; +moduleBuffer += + 'kfhfDDWanXy7FZIr6FEM4QUhjWCNTlpVu1YgQmjSxG+DSWgNfvASGNgmlRrb7pfCKNlImtuSZjK47f5WVQqGyDGuKShkd16DUqtG'; +moduleBuffer += + 'g1/hAXL8H3oMfuf/ocfgN/H9HoPfxMUeg9/pH1huWg920f8ldXR88j3GqUprFsbadZhytceyS4earPEqZmy9hYu9DZ8OBXelsO7p'; +moduleBuffer += + 'xpjR7Ql4AfveijRcwe53m1EDB6oGdpTNUu1gLLjaH/RFAzXLJPOpcRuUAjJxYVnv4CxphWrjk80pMM+7xYRGZ5S8HvVQBeqh0KqH'; +moduleBuffer += + 'ZD9iDXsVqxpq2LecZ6fHqucYi+5MnRomb65fmjN/KVv1cPqqhVzxMvyGUQtFgCE1cmGwpbcrK21XWnkbIbhJWLbqQSXkmRmiCcSY'; +moduleBuffer += + '9DwTIYrLYsJVT8jjHowl25iqA3mtFl8WdFiSBNTKXvAVv3T1e+WPG4RlzdosIBThdwbsyn1o5ZVLsPNKCrXFCj7fkB+v0KgBhJGS'; +moduleBuffer += + '4ySQhRTMqoUMSQ0NtEA6FNnckh6yUf5lboSbVYnrzKn4dS5nRu6F1j8ByUjqAzAXjehiADbNxPU5zsFRRjNCnKXFfV9Fo0jK0i6M'; +moduleBuffer += + 'wS7ixByhExYMs0uVbpCeP17lIbMuin6qhi+g5DWlkqdrM0teQPoKGnuXKbMHn0gZyeZCKHS6lgwqO3gNp2pvpdNaLtcjVZiP3exU'; +moduleBuffer += + 'DeZj/cQArkeqrUW4nqq1FiPHiY9Erg1SwG56ZsxaXk7Zuk0uM+mYtFaHLAJIUwlKrUxVXlN/ehsFqJfDQQW59WSs3eyornkYaEcp'; +moduleBuffer += + 'c6RAHTf6LEdiCbDBOlw2qrkXCn04gqRvFqbULDEl5ZM8a6MspGRmcUp2LPKOGSYW8I6GYQ4TMNsKv23Volz0qiXQFhvz7TZaSWfA'; +moduleBuffer += + 'Va1ZQTdcK7fh5Pcc/AEQhe65VjbGKmDLxlgFrKBbN2D7CsAGZcAa3575XYCtEITyh4DVIJ7JfLyoXBawXi9gA+tz4yTXdAPWRNUO'; +moduleBuffer += + 'ANiKBexATteRVOf+Vr1sfg3Ad12uyx54LrfstgzP2m1UZV8aniZTUFCCZ6DwDAp4ynKfE57eFcDTAzy7EbWyjUC9HDyDSyDq0lnh'; +moduleBuffer += + '6c2EZ2DgKYS6jgDGA/hHikFr68x1b+UYK7kwQ7WFqXdZmAbGqnDJxS9tXxlMDQbNn7H4Z8CUi//yMJ178atA7lwBARjICQB0/YRr'; +moduleBuffer += + 'Q3UsjaQfRoxRY8NR2aQJlwvrQNCkgaZ1KQHykDsn4L0ewPNMZs9+QcXWitkv9MkdrGV17BcQOKuuEibPgzlmguo6QXVMUHqpLcO1'; +moduleBuffer += + 'Zsswv5MO53NU1cTNC4stQzWZn1y7Tf4MY4Lm00oEVxt5/6qZE5R2TVBdJ+iKxfuwJN6HhXhfBzNvGujUC/HeTpiL0D0CpwHYmWR/'; +moduleBuffer += + 'k0/P5QX7WpdgH94mBD+cc1GIWJ8CPRfcLpOnrp59jJQP3SSzWsgerq/KMIndYlhtVmm/GglorlzaF8DNIXzN8Utz5i+XlPZVMaU7'; +moduleBuffer += + 'ZEomjtkx8ZD8q3rAijOTDCiZnRUKULFQRlFkIhJYdOi/KoVkEepWtGnmHnBubpsNzoJP3ra+sFmPmvMoxpUMjdA6nfu+Nc/Wu+zV'; +moduleBuffer += + 'L1purJS2J4t1Bwk9aKWQFbF7jBA5kHuTJjCxeXn52u45ZsrX+S//s8rXTRVZmgZW3Iw0C3g1y/u544hamTtIuHM5SPz/YmtiXSKq'; +moduleBuffer += + 'huT1FTCzLhEuXCLO+tgBlHYBaIW7GWFFstIaWEgAGbqR7YITAvI2gLCAV+nB1rITQj+gzEQGlcIdQVZvJ2nAMUDkWbgXhHREEJD3'; +moduleBuffer += + '0/8gachk9KvnQUOdC4Nsnsq/o/hdNQICGfiwqX50Xrb7B3ZdyhN2DHESQasaa6DwOOnXIBsTDShVq1pp3w9yV4VLeBs4l/Y28LPT'; +moduleBuffer += + 'OPCeta2zgZ/4q71kzL8jUu+vO/DndYm/zr0zU7MvXAsYRJQncqnjzY2+rhqDH8qNwUnHmLE3em/QCCV3yuVq5Onyk6GNaB76XJj5'; +moduleBuffer += + '8+PJ2LAXff7bwVJGo3DYwQHvelJd6ZpAv5rmcUhDrX2jmpBDLoWyq633Q2kf+lJjbkXEhTdlBlOmG+N9jEgDazULPOJO2TJNyD23'; +moduleBuffer += + '630I2fKVUmZDp4WPT/TbaIAXwFnj8/4sh3wcbE7L+Q4ZhWZ3nRyzrhzbWS1lEHmiDuoNI90QUmUE8THcD3cYweUYyGgjO8O4/I1s'; +moduleBuffer += + 'yr2VVqmgkx3++pNO1h8/VlUFr0NzIGIJMrpLUyODJy3G+l6Kc5Btb22LmRjbLeDH0SpUm30IJv23MB5ORyYUzDHKOlPV+Ps13ExH'; +moduleBuffer += + 'PCx4EmKHSogYB95EnWwfhK7y38VJE6l+mBA3PozOO6v96Wir/1MEA0AWZJMMG6KOHVNVtHU6KuLjSYWT0Zh/tGrKo6W3udpjJlR2'; +moduleBuffer += + 'kB4c2/Lxelet3fUxfxQ3F8K0f6v/k9RSXmSP99Y72X4TrASOupR5tWL/mH/W1wZGx/xzvvmqAw5txi18M/6c3zW1oU6rwEDhYVJG'; +moduleBuffer += + '5LM6bUCcvfc5mabFmCaCOH6IU3C0mtp0mH0Eg/wkwnMlvkiYX2jmP6JJTIIIa/3atewxNLlcmzzY34m/X22Sg8inj1W7wmYRL+i8'; +moduleBuffer += + 'qkOSrwgKKRja3mQj9e136grWAkm9HKyAJgDLtIga9keAVrRf/9HwTvoxB979g8U7zN/obGjHuDPlv11o99gcaHfALdDunD8H2p31'; +moduleBuffer += + 'S2i3x1U8MGgnuDoX3gFbC8TDXvw5zyLeHgPx7IzXg3g4fYd6R6tj/mkvnyZda6OKeJ/9ERBPujwH4smOaHbE+wGBPt7/IyLe8/5M'; +moduleBuffer += + 'xGt0I95JzyLe0ahAvFpBBObAvKPVOVGPSd6kwYuyCSK9OCHf+XMQxkXaS5CMiXo+36ei7i94J6JU1/8lvkBq+1k0mhTUllJS/MEG'; +moduleBuffer += + 'D5ihCyciJrEknIL7s/P/VwGq0U7817W8D3t6Rimdv3QfcsrHvYbSqeJHraRIBQNw3pmT3uy9EeT6MXXHN90R7J2jP55d8KYvaZBN'; +moduleBuffer += + 'WSr8OOf8eNcK9I5FY97hqmIwVEd5cURpmTSonOJEhw7krzQr0m9hPJPICOftmo375quFirIu9jsdaXzREyJPxQcRc+hbDaXQpWVC'; +moduleBuffer += + 'FDgB7J8nQDTJGdGCHTqOxQKLdSwaQicPoTRaHv8RSwzO1xiYrtE1/sONMe/5mgEaxm+LY/xna13jB136y9L4z9Z+nOMfvZLhj5ZG'; +moduleBuffer += + 'v6l38BGlGDaHsJm8cs3gh4n+DgW441BjIK10LVvb0euwppkWse6wDwHsdpE4Q28Xbl9psmNCb8BeyLtXg/HwnWMyZIYJc1aGSoxC'; +moduleBuffer += + 'DS5dMzkXoL/BnwB/mPpYKpQjJfXG7P9yEbN/E4OebbIRZk2E/rE8MptXZH3tyvTqlDO9OibTa7SmyK2Sh3HzOvZ0vIvIcz6PmvnR'; +moduleBuffer += + 'dbbotHPlZacuX3ZslqguRRICm/8KS74t3PB7NRvR5abegKOsAW3ThfcKltSyF95b5OU6+15mPbN1XzpbhhHXplLRLCPyQcckOS1F'; +moduleBuffer += + 'jVyfp0vzZqRL8/J0aV0xxTWgaTm+qMbR54bbBP+JJ6s2E+P2+BE/ut/E+EGwbYMGvflQbHTlMBtFnFxmkQ2KOLlBkeLV9t1EKM5G'; +moduleBuffer += + 'iUKjebYjRaHNs8MklJ3v5YAyZ9Wjl4Xnz72YgR51X+RIj7oc6lG3Z6wv6qsy/hf31WkNTDjt9Xx1DqxDkO/LQOklXaFqXVWbOPER'; +moduleBuffer += + 'xurVwEPxkbosj29B6aLLA76F8E4rQmH7JoZZ/Kd1PY6F+1P1Vp6iyiLs73hugEwkFW+LyQjMXWdigq6pAdSkWHZtFE/N0XsL4yf7'; +moduleBuffer += + '83wTPM0nH8YBjHIdjRxs8tN5ia9ZyzxNfZa/0HRgQebd1kdPDCHcUzBHmWCleh5HMwllJvHZM3/1BfbD01zBqJMdf/YLea7gEJR+'; +moduleBuffer += + 'qj6j3nPPdtUTad9WStltqObtSWSs9fi8AZvJ+QB+Fm3uzvJcJGOTFuLfjTL3Vsxvnt3sliLmW7SJs8Xkd8j4YqJqI1OGTaPh35IT'; +moduleBuffer += + 'UkRFcjXJRnQsyBPP11VB0Zc4K13cSE/1JkT6Adw0mH8kbDXVFz6UXvbFfx20+sh9qKF4CMwqNBqKRO9jxHYlJxui1SCpJrW8YBMF'; +moduleBuffer += + '1+p9CMUHCw5LwaEOrQzDnZYv39vnmQxuRr0oX2tu9PYiqYAwzHGPkEhrsg/w471cboOKPLHGBttPB4qhTtrIzpvUU0CTfa7UqJb5'; +moduleBuffer += + 'RZX8Quc+4ak7ud3nduBnr3tDT0+lKKrN2Yl3XroTz1xZJ7p60CmvCeYy9bK9HncH1fh9TE7MJ6SsEdDpKglNZmuEwVXZAZxGDfUa'; +moduleBuffer += + 'pLKecRFl7n2pv0RP7Xg8T8XqmkYQuXGYJ4dnchiXStDuUS/PH1hjrllotarDOE9UaLVoWlqaMsQs74dwbHVYyhRaLb43Wi3eG61W'; +moduleBuffer += + 'taTV4nuj1eK90WpVEXce+zaGgaT26TAO+eViWdWIZdVcLAshllVVLKsJiarOIpZVZxPLaiqW1ZTc1VQsqxqxDCYO/AmocqMOjqo7'; +moduleBuffer += + 'AdS6XmFDQDNdLZItxk9Eml/RK8prgGNXub0j4hAz9SiJRqIhqrJbmuPuoJ/nCb2kFFRKwsQInDZ1PEPPAqu24wg0COy2JXCXQdKa'; +moduleBuffer += + 'SrYUCKtJRzVvkTeYkwxmaUL2jss2xZNSYREYvU5iADjWoUg3WcBCJlegNRJ/QOFlhCD/bFkWF0294fY02EY2CuEdpl5/W+pCMY7k'; +moduleBuffer += + 'HvjuEvm+KhoFWDXOJxhNVRPTon0frh7URSDooMkXpbm46S9EJXeUmC50dSkyK4DbgaSRb38qq71BTa+pOeNLEekZoLrd0QkNNWgl'; +moduleBuffer += + 'NzaMSukCMUUuN6HmL4UAXy8hwCaLAL35Oz7/uGZ5YSB9OCqTlT13+EkTjpp3bjb1uMnvsslByHyTnN3JkzP05MdjFH/uqbhNxgbp'; +moduleBuffer += + 'icBt9IZnLuWfrZQwL09SK3utSvxwoBMe5wnhhQLkIrTAL40yg7wIVM5EEuAJbjmWeAg7tWnLz5PLU8kfA+GYnUwRrplorPA8HQ7Y'; +moduleBuffer += + 'F509Avg1cHuTmHjKgWCMYkpd8cYF9JN6BzlgSvhhLNEGdfoYT6YOZ3IgLDNPmLabrYZhfcWiDA2VNzS5ptu6IGmgD6FOfQNdafDj'; +moduleBuffer += + 'tRkfr+FSgy+CtVTVZkXV0KTtJk6qzUPjrKv04mfnvvekSl8qvQCs2ZH//qSReogDUbuU+mVIRUvrJu9p+HAKQ0vlos0NqTCUcNay'; +moduleBuffer += + 'C+dscyYq90u74wGrsBNYbMUh+2z8E0/hrmnuwCqAqjf2pIp5ax5pfQUeVrhxhft5kFMVZjPnNhNrVUTc78wSNllf9gRNlpdFre/O'; +moduleBuffer += + 'Vuu7s9X6bnglYzs7/gUzNt7Zsf282R4ixzGDWb1G0dkE1M6FP03dpPFwR60tR+GQTb3rad0CIGfmIHYi2brOYzRJnlm+h8kX5FXS'; +moduleBuffer += + 'YcBYTU2GiXnkA663Zle/2V+sU2GwP/ForUKOl6vkI1dRl618/arkqra3YaNgOu9GweFvlhLtDnOviIDH92vB7V+t923w7qswiFdK'; +moduleBuffer += + 'wYRZ1fOmhtMbYFvjfZK+BAa2qyBGyMLIyyyFWPAGvR+CKHCnlIk7rVG5CL9vDSB0XVuWwzAsuJBB0jCbqEPU0nEtoZhyRFZMH6RX'; +moduleBuffer += + 'WCfjpC8758A6G3fit3lJX9u7tziKlfSNODheyACijmD7EtURLuFUYA8hAvNm524cad/o3SWtOOgVLxv0slYuFx1Is7BUdezRLrSd'; +moduleBuffer += + 'HZAl3K8ULRqGiTVER047cB2R/cpDNay8Zis/KYLHkBkcXWQh7c+pcZNPb7W0uT8/741A6L9a5QIWghKp9bMW/3pdhRmSEdSIhI/L'; +moduleBuffer += + 'xL4/QpnB1Cl0b/1JxDUfaKtc81IGp0xmfBF+4yAzCrq2d8BNa9oSugxq1Jf0rfYOuun6MRwe6QPNOuSaMXOr6OhmEDbywY7JKpPw'; +moduleBuffer += + 'rL6zODv2y1NOdkN8tiECxfd8fGFQmwfd70On0NYhl8rdAN4HW7bLn6WW6PLrg2P+pmQ9E7gvStY/2lrA0ASr/U1jlOY4BVu2p05e'; +moduleBuffer += + 'Z9FG7y1yWbDRe0B7fG9iRgVn4z7If/L3gpN/BeJ64pS/ee+Yfzvv5Cv+uMvBpSi5FlWn2cC4dPvPsDF/ok7JQ8Zz0G314hzrxB8P'; +moduleBuffer += + '1LlCMDf+hbqUaKKFDbYHS/DNtZizJRrvEdSQQJaZ15qhQfnP1/AhJLLsw41saDYRYvJnUyf+tboicVsvg3q5Qy+3W8w2hxXZHeLz'; +moduleBuffer += + 'lo7BZ5HsRPprLch3CUT7Qc51CNeaWp626HRFbdVMB6k2bGCuY0K51RR1KyabOaLBORpj36XkgPxemYvJrGCmHCN765pBEMXyalEU'; +moduleBuffer += + 'Rgj3COJthetKkF9LLy2QP8J2DbF5hjs5QkRYEEuxP5POAA2LKpA4o+zmYvIRflT9qcpVhTRgVfkxlgGWEVRGlHLwECNq6aaOeY6S'; +moduleBuffer += + '9WN+m+sbH0ow9NK6q2V7XJjea/EpeunMWijCREOdHTETB2mc/ooO92VniX+7XSu2kVApSqeOfUc0lg77d8qiKSDUg+zZhNsl5ljs'; +moduleBuffer += + 'B84bieeAWaPE/xz1lRp2LwAibIHeJ50u/L69wG+MfAmG9cBGvnO1L9K4rJSIGAeSR5RmHP1CgujTNFkDnWzi/SINf9QVJMsXnLPR'; +moduleBuffer += + '5DWBfo7LhevoCNw9hMNMy+ZtUGjUkrZG+B+UmoEBmVQcVLNCmJsV0M1BlA7i3b4ml+V3VEKTfcSJZmtJ+SQg3k03b2Hcn8Zq72Qz'; +moduleBuffer += + '3TLmTdXlSXbnx+rJAPcSuAQUFwf4pZNNzTd7wlyneU0Y/3Cjdwr+q0eXdVorVHoYkE8PZBzpAJjyYCG+DySDvBuSuwHKHG25yraz'; +moduleBuffer += + 'Vl7jQisGsEyq8V9UuhbQrQx1rFvmPE+MkNj4dyt6xAimPavAxBLLmRQGhQWKlckFY7cWis1Yk4ZtQXc2CC4HTo5lQ8VCafURGc14'; +moduleBuffer += + 'IoOBba6I1gK5yJasqsjQP+yQK/cjHRTGkvRjz2bWtZMsoMoBF5pVFmgyofwxsRkXv1oV1F3QZgYapEiWJW1SR1Hc6i8SKS6gr6Gq'; +moduleBuffer += + 'LSOChat/2FJFU6wGGMRj4J66fqWTA4amrUgGVntNNL4CVQaYM9muiBXED0zsimLbhvlLnfgjNQgGDUSWGTXId2xZi9ejywS6OXtr'; +moduleBuffer += + '4NXUMsEqoJ00faJusKpuAgWnUj3Nznmd1jCEK3kzJG+GsFzTq2ncm6jKYwKr31D2jGNnY0iAL7R1KHsuX9dDydBq73WCcDLEobZ3'; +moduleBuffer += + 'R2pUvkPY6i1DCi1TM+6kSQ4g1PKHdJcpWLlWvr5WUwcOxX/oJmsFeq310uJaYFSuRKYEkNXj/+qXf4AWK1LVRj3bV+2kq6X59Y/G'; +moduleBuffer += + 'Jzx5RkxIOIwflPetdinGzf4q/G7KoUEYWblqv1YvzydqSGnt74THbYL2XHe17Hk9/qILhzbtuT9Xz8s/yH4UPf0pdR3017kxcksE'; +moduleBuffer += + 'SCPhZ/M7+e5xAM8LOtmI5mbf6plEBkZ/HkASRAouk3YxEAaUb2BMcWwiDSYGSCPmwUlltVSdyP2iVlN3Z8L8hPGHq8lqUxWlqFRE'; +moduleBuffer += + 'dJz0WrkeEni2DVbUaWWeJ9fD1hgt90ehesdVSi41WMAwO4JTdXq1LM/fToc6S9NFfczRQZkjZh4Q6B+R+yMMPXSg2lqDNzJXN271'; +moduleBuffer += + 'frIP03w4gL/5iWonew6mn1afPO2Rd9callzP9srTvLxzBwLDvvn5CXny86fJoDzxazZ6F6TDyY1002JXzoZj3kVzfyQc8/cFigvX'; +moduleBuffer += + 'C4Suh3f9Yn0ekeeREm6MWNwYmQs3RrqwekI2PfOljfng9ulCxZWnPHmWVbhIWp2fnc/X4fxk/mrvjbJZFFR+kOg8v+3dY78yv4zN'; +moduleBuffer += + 'KOon+eLTPDsFi1CtELs9P/6SCxWZdrtS6nYFMo6T976C3ldm9F4ItNDHujCazMlW8YB4P2gH1Tjxt+qg1/fYrRse7s7BkrVfSwFw'; +moduleBuffer += + 'tBN/JcRPm4TPyGWD7Mr6uXmFmYh7KGlQcGo+wsHFv+/nzciviEEmL894Sf+Iczeoby3pX+f8p5sc7KKqHbz+37DE+rOnsZuR69tE'; +moduleBuffer += + 'pHKcMb7DlgIyaC5l9YNb9UPIkhfpRr4Cr7g33QBnNbm7p7We3gSJa1qpZcsNqvHhqk6ykXfJhjFnQC7rxxymFTCeNGzuHkpc0lXK'; +moduleBuffer += + 'Vx8MGWVPOdHzjs3GWdO9RS2xTi81yC79IsoaKsAC0K5WS+Ugb9pesrjI/3n59WN5QcB1AjITW04qJE0GaJWCNNWyGp5z0lR8hc1X'; +moduleBuffer += + 'CprU03olJ0ZQAnLKF4KLI1CDqbFQgSJtLSR+AqFBlUCOKBMLwu91WxvwftxtRbjucVsVXHe7rQDXHS0fl7cIm5TLA4I786EsqOHy'; +moduleBuffer += + 'RkEorpEFxBVF/ljajbEYrtPnlfK8EqCfH/8dRKWVIw42XiuxPpp4qseyKV4JzB+wmC/VrpFq12A8XEHXrBbxCCvoGigt+3W412AF'; +moduleBuffer += + 'bTImmFVSfhXHKNU2dVJIhfHznrwTyrhALkN2na9KVkG08AG7VfisaW4V5fIFpVKgZ1uSZjKwzoWcWGUAvfiB+6Xolu3x37h6QkBE'; +moduleBuffer += + '6VUiD2bD6tCIPthGmtqIzFqTTuGRlKThRGtKyWuK2Wrq/NqS1+gUrcxn97pkJUWiILlOM9xfhwZWysBUcw0cv45wzTaQISGGiCKa'; +moduleBuffer += + 'SH0rBf9a/VKnhjo5ul0HdFwARLwu6Qd+XpcMGJzJv3LVZidGUwbf4gLfktj0SDFNLgzUmfeImBd3YV5sMA8oNQAEvFdWEnGpv8Al'; +moduleBuffer += + 'aXuRUNx9bhdtHnehyVMlRtXgamRwtaK4GkC3IcteEHOgRfzezwQS8wHUtlw2oIkBhErMhhgpSEBTk9JVHOORVn2ptR6QXIx5nQ9C'; +moduleBuffer += + 'ZSZ2MUNomv4sVgYgI1+cDW12NsgLLlsfnxqAbmx+9g2HewSmsppPx/35heP+fFhPXy2XClQK82FxeaVcfOgW5ydUK84H2dkklxrU'; +moduleBuffer += + 'avNBi0Yt5/HukDtBlzfgc1n45puc/yStn+M3wjLQgML3oLvc784HM/iVCjADoPCGtR9JUkGUV0R+w6IH0CJQBWgTTZ9Tv+B72A/H'; +moduleBuffer += + 'MnBoPRUY66H0ziEhDa+VSwTV+GIMcEguAbYsi3XLsjihHXAxRhYicDTI62JqMKRjBdVcnIwYqrkYaDpSUM3FQOORAo27Z8GNdLZG'; +moduleBuffer += + 'CuKZF+AaW2xo6IjF6etHnJsFISjQLVZXMcpzlEYKYY6NRPKSOCyych16lFYuxR2og4+2Dfwh5R2pWs43L1mal9tdB6tc3itNj9f1'; +moduleBuffer += + 'ftJIbZCmYXEZcY5Dqh7C1qSefYMnA3+/amFRz44hFEgupx2HF3Qup50MyzLcaXmalz+d6RbQ1zlPV29yvgZxUWbriBEbx+tj3uNh'; +moduleBuffer += + 'IbfRpikffi7sFnao75JnPeFRyGw1K/zUSsJPrVv48SD81Lo3JI7dpTdh8IICLD5UxeYu1ljvuM3bq8q3nhIaPeLEAjD7iyxw7ZNK'; +moduleBuffer += + 'UeyTb4QmtoKbvI1++e13Yb3l7wH+hPEX/a4yVfB+EvSqUryqygB2zVFlxQHbX3IMrCrqMY609Cb+ekNj9FMoGbQySVU9GKq5CEFM'; +moduleBuffer += + 'G8go3g8UTGwAe+CY+opS9wbIwtxSGWVhC3B4GjzrSUZoWQDaNlDwrAVl0rZAa0knFuSC0QK7zza9XKC9XJAvtwVZBQXmdbJ1pgCz'; +moduleBuffer += + '/i4wwxgwXA9NJTWzphdgTdeKNb0Aa7pWrOly680OTw0ZUC5QUNrWa3YVV3LOtJoyNwqt1nlajQ0eTNRmlKutcFVwqtVEY7vYrYAl'; +moduleBuffer += + 'q7iVr+B274q1q5QTgExoVCLmC5tUv1j20JmXSUKdFPvafN8kzKbYYVlCcHu+9ISQS+2wE/+yLEBwtatBoGXzVbUTeTUNGqaFq82W'; +moduleBuffer += + 'Wyjt1bqPvZqbUfijy/Yx6uhmNKcGOFJQ/jpX+9FIe5nC8HsR3t2FZokdhldzoXziGLkR3YcT1pk27xtQpA4VVfkrRA+t0XEm/2yF'; +moduleBuffer += + 'bctAkyqL3Q7NA7Y/SZ9uTBeDfLLvAgnj1FuHwFfhrlwb3oIwxQUNHEIv3fzXhDH788c2+lUrD/webEV4dzs4Hbew465uYXdTF+J2'; +moduleBuffer += + 'eMBfm4eLU05+UWt0TMRqbNxLSuK65lEq9shuaceMSrKYeTD/GHXJj3tmZAeqHWpSyv2TSvuqgIOrvgE2SKvR3vjxxQZjr6lOEcqo'; +moduleBuffer += + 'H9Q3ltQZ2UIszqtVWRGQW4TxRYsfst07QHvJ1QhNxn7kEeICgw4F6sxEXIPmR7vnvqQeOOP06IUMblttwO2gE/qZStcnyGC7PnNt'; +moduleBuffer += + '1yeoRun6TN14z+efEm5mP4Wv3p4EEXQhOFURv58LY1NHv41gdBssOmkH6DlRQin2oRut2JFu1GJPutALAlQZwa6GOpkNcwFvGOPq'; +moduleBuffer += + 'Xa8rd02xcnVJxxBhr6b0ZT50NZMp5w+bcqzDeE5GhvJenaw16rGroR5bW1Deq6EeW1tQ3vxrVj3Gbq0tCHDeuRJZiaQACebQav8O'; +moduleBuffer += + '4X9DakUa0oWvWxJh99SaDfF831C21+1YTB+CRDAFZem0D9uElh/iLCa5J8YyqwzFV+TuDikx5eerwDdW2KtFDsAKuDr+Ja6Eq2lQ'; +moduleBuffer += + 'xlHW+Be5Enztua8rYRgrAdHeE0eWAWA1nKO+hkV2u4uhPSkp5eyKeT8cMCY80mY3O+2p6UmzyLNB1AVIzMC0ImA7DPXvPRCghzFz'; +moduleBuffer += + 'Q1jVZrzDmNchoywZ44s2XpwrvVharKVhKjENIRpW/bCMdVjHOmxmaQgMyMApFQbhbfV+UkCUZmcQ112uFzzbyRT2BhG60uzgOfhW'; +moduleBuffer += + 'TcgtPCwO49WNTPiTyt3RaoenfFJ86Ch+21/VpoQzxb+EF0KqFwpwv1fDiFPVnCuANXj0BqgheXhMtvnJoJ67lZ3xGUWOQSAHIrpv'; +moduleBuffer += + 'MEBLTUEFv/4sbzWke9JY7U830/Vo04Um/2STp9tP1cHG5ApnMNuw9ZVIVmRHjk852dfmxX/koYWjyxRXG9nZhVjsKwxCyM37vioF'; +moduleBuffer += + '3zd/RsHpJZ2iWCM7zQXg5/XgSFPR3wCpiWG5SscPyDU7NAxa/JytOtnutNYYU0NzGPEGpoNOK1CjjXqbhuokXHZCW5GsiP+LJpYc'; +moduleBuffer += + 'ccKMnl1wXhRQvOA+tDX4KZwKsiUxBamL8pcqLejOFMe564ePpa8uVbyz3k1GA1llU7eqO2PT5KHinbqvutx6BzyfRNm3Ij0B5mlP'; +moduleBuffer += + 'qnlPqr09CbQnQd6TIO+JvHssqTyG/HPsUbXUI2m0OeJMB9qpZts7YSL9mFtcp4OufjWz0Y3eSWhiBrOzFWacOaFPExXB9Gm5pzKc'; +moduleBuffer += + 'k5LW4kdrXVWOYDmwgmsKH4agq8UOMIuQfHNfgL/7g/hTVXk95QHFmghzhr+PV+W18QCHz17ITNLV/AhKyIxesk2If7uiYRilJp1I'; +moduleBuffer += + 'w9Xe466sjBCUIoQwIUNToh3qNr0KqmSMHKivdeFGmlc9TaevUq078Akas+Jnq4BUH/pEUa94EeQNh9kZtzgvU1Ot5BnHPFlFCdzd'; +moduleBuffer += + '4/dBNxqSUlm3HMwtHAfz38LSb6769uW/xcVv+IUO394WM6lVzUo66WOuTgQd0wfOftJcLZM0BvLWRPXjnlzPfgZkbkpuQeZO4NUK'; +moduleBuffer += + 'kjkprmRu2uM9jDc+iV0+pZhDHC/h97K28ITv1UTy+mI9UgxIA/gxE3N4I9K9j32xXTja1xhdPSINnHZypaBQPrZOLxPhcgtoOrPZ'; +moduleBuffer += + '17eSIfqySVoHs6pcleyQE2ydqO/QjbbKCqG6GfnWTWRB2xu6hZZcuUvg+rxAXV7kBRlJs3AcDbkP22hfcZ8vIJdd9YC8xIY8GaTS'; +moduleBuffer += + 'tZpGfY4+BfZpkDvI+FCDT0Y/ADoff1cL4CnJn1h5tKupDUVTm9DUVGCeRDrLG2bJ27vqvbqoB4lxIH5PzTzCh2Mg3lfLv08PSFv4'; +moduleBuffer += + 'TPnXQWBWT2EvL4zHM16p7m6/q4fjIqH4iFrlIzvOkLpfVyHmu3CRG8DZvsiEBwKV8bu6eaa7sbN8/HDDPH6z+/Fb3Y/f7n58vvvx'; +moduleBuffer += + 'O92P3+1+/F7347lSN7xd8uKCGVXkb0HoYNnR3IqUGn4SdWzcFFZ3NfFexIpblIpCmRG/2wCTSgv7CO83zExX0+e8SzfdErhJXdSI'; +moduleBuffer += + 'jA+UdQGO6AUl2KweA3Q7WlB4DHQ5FMKRiHoNuNLqMeAFiIbgdpfR2NkL1IdAKM2UZ30HoFFmJOLjyMZmKAtYQTb+OVAWcANQllN4'; +moduleBuffer += + 'tXKjdzAgNTkALxNyD9kEHMBvh3zyAzIYl4fWhKL4QlG8LVmIDxyuptjf6mffhJxxWfjaJf2hE+h/SPYx4gSZf1sfDebCeeNHEIes'; +moduleBuffer += + 'mQXx39dBf9co/6waYnjcg2PWPsO39gp31Rwrf+rciUjbSOCYOdlbEaTadGxBduGoCEJThlKBEO2r6HVcrtDnTim5lLUigqSvA0vW'; +moduleBuffer += + 'PyrwqsTfrmaI9Llb2k2y6U9LM18HoUs2OwcAOeirF2SnTXQSkTJwHOjRBoNrtcgrhXsLKTrnFH6kNMCezM2m0kRrmSlihSZ4gieV'; +moduleBuffer += + 'JfGfhRn1/iNOvbUoF13gdAfFnfDWRfF0LamudWLNStmUPtdv62PWWOT03ff3U9zV0QlBAPPXjmZpxmEcecjOnJcBfSYs/NKRSyk7'; +moduleBuffer += + 'd16HuQxJklCOo1uWYRsGXFyWMcvRsqxmXFmXZXXQiXmdbL0WTRZtdqS+6sy1OASec44S9P4R5x71+6t10kUocL/5CtxURJxIBA4J'; +moduleBuffer += + 'XBThN3wy2J4uZb1F8UVE2JOxwc+eL/6ykv1QZCK1xuAJElJFdar7/O3pcmlpOcYef6Ye/6mbLM8OQ6LM9hyeQn4Ldnd5dsKl8kVK'; +moduleBuffer += + 'Lh9x7k4r8T/W5e1FGf7y7BkPf0dxNAJvR5y7ZEbkshdmiOW02VeZZEbbwreSynYcVnjTfW/a7EzTTdszfs0w7KYCb/tpeHum2IDx'; +moduleBuffer += + 'PFf8ARFw9AM+XkgRJOSB8/JukyR1tCO9+3wInztIL/EnG0lI7znh3Hx9RLobymtkyMLBKR/h7UfVHxC/+R2kQXaz5T93eIdpha92'; +moduleBuffer += + '0mLlmnxi9Hty4681BIkH8FlsglxCgaoagQTR8i7t3Rm6jQwQerArLRfYY0/pRwyJyYn5B/c+nQOg0FJQagHEouyGjpHAlhIU0ve/'; +moduleBuffer += + 'DOUecHIFY0eJsEuzm6E7A1iWjjib8Pml0G+lcGhnecKnVP6kiqJa4YSrNWT8TFZciV+GUx75h6foPSRv+N7l1c0O/daUw9ulGA26'; +moduleBuffer += + 'JhD5OZmXU/JDXveMp4JMiJ9KbcLZpJLLsG780ar2BEDgIHBD6IaKO2gFsHOxzu5CBEkXJaBQL5AV6HA3wHcy6HCNEHOzk48X2Jwo'; +moduleBuffer += + '7BI0nchCS6sYfEJ1YEKcTrIN8KPDW5kvwWK5HPZkl4H1hTn6Kn+5x/RwGc9WlHuIXA1JdTsOABLH75ImjxAFaljbJ1wc99mlMvUy'; +moduleBuffer += + '06/MqahTpXoNuMZycJIOmwuEocK5kFIeakU8C2Uq0iURwvQCuOZC62/cMyOlKCpI39LnzRSYwbuy42RrBwxbOxTMFJgnghkCM4Rh'; +moduleBuffer += + 'V9nerAKzcCZKx+DXVl5mmjajU1EWxlL+dGAs32Ux30yXEbHBrTwrVj9TEqvBnNCJ1lIjX6P7honARW3hMCzag534h3W5HnfA/6aU'; +moduleBuffer += + 'zC9UBoUonntIWE66zIwpO5It6Y1bN46nG7ZuejjZIBg4rarEjVsbD6fr98j73T/0H9rafnhPIre7L9Ye2jr0MG93Xxh4aGv48J49'; +moduleBuffer += + 'ycat3sPmhdz3j2s5vF82zurCmzeN79mzhy7GCxP/MWn2poeTG/kNacx/+Mo+dGPpQzeWPnTjzA/tU8KJPR/EN9mQUi+QveC8qcXo'; +moduleBuffer += + 'OhDKFgqc9sC78yCIY5W+5NQwVnF6r2oD7LvwA/EFw+6Tfzz6BdE7i6X2OK7Z8Y8rm1zIpVWJT1IfvdDQJTzLw4SrdGm35s1YCBG9'; +moduleBuffer += + '1MYp04YwHymPzaH05KSAa+sUU4GNefvlAbudvW7RccCTjgX6TiadZ5X5NW0azvcwpb0joOeslD7mCgGV65SLLOoLjYPrMdQKO6Zq'; +moduleBuffer += + 'Jf5hiDIhg3jgrqmfkM0+Fr3/ALFkPbBmfTFz64uZW981c+u3huN25tZvHcpnbv3W9iwoAgascAmz458gXMiGFvJUQjZq0Hs0O/WY'; +moduleBuffer += + 'BfwEYymaPTxy9smCUPe8g6T/gVllZq3wXJrlZqG6II8q/2kFpMOd7OykIe4tYNI+Tt/5j8g7E4LuegheLWUTwv+ERKbkLi00FyiS'; +moduleBuffer += + 'JOYN1MJo5Zx9FaqDpRFq1HtImkN4nGOhkQHVT28L0mzW4j0RfaJoEj5al9JgVddKY89AgiP1m6UaRImemtdS+16qJm0JT12OHziu'; +moduleBuffer += + 'a8g2lskViV4sQGHgjnFQj/RmX2V7Ok+qzstOOZ2tu0D65sFt2Nzi8mq5PPsXz/z6rx3500/eNua9Uh6//0dPPX3oiYfeeVoo983y'; +moduleBuffer += + '/D/+ZP/XDz/28N+9Eact5gG375bLWVKuDVwl8zB9OTOfl50J8iecDTZBbVq1/EFQfF52JEBU/nnQ2rf65DotV5EUKQZp0a+GiHI+'; +moduleBuffer += + 'L9svQJSditxtQNYufjxdoJ9N+/WDaRi/Cuai476QhHnksxCqVec8j/IGTvzY58epG2sbYM5DhDYBfWKe2ypyc5nbVsGfbXsL8pb6'; +moduleBuffer += + '8zbCvDYiOLdqTSdyoorpvZssizPtOA6g4hSq9UmH/FbjwpHv3C37Aq0xkPpbHTPEBakLiS9dbxLMyQ/yYu1WR2/a9mbY3iT2Zqm9'; +moduleBuffer += + 'GbI3g/YmtjdNexPam0Au8KHYCU3pjp3pS0v3m0v3N5Xuby7dj5XuX1a6f3np/hWl+xtL9xvz+3TDTqFHj2ZDPydLGki4477HdqTr'; +moduleBuffer += + 'mURXaMi3PnXkGw/e91jyUpt1j11mAU5cBjwOpMDmmQVIwLNP/crZqYoUuGlmAT3kjIWxSwrcPLNAzAJv/ZV3fk56lYzNLDCIAo+l'; +moduleBuffer += + 'Y8nLZv42JL+93KYPHCv9sFR+eMVsPyTyw42z/TAsP2yc7Yc26TMekw07H+3g9OQ8bpTnIc2UYPLyn0v7EaqiD2duWqG8n+SvzDnM'; +moduleBuffer += + 'dzWU5bvH83dYW0f47mj+Dkj+ON8dy98FKMF3U/k7LOBjfHc8fyfLW54n+HbSvmUokHnYjU7iKiLeIVwRvR9XBHXHtSpCIq6yrd2P'; +moduleBuffer += + 'q8hN+zy2d5DtHSraG9f3B/h+oni/B+8HsJ71eTfLCdf1k/77cDONDFaLMuffLLl/o3dYft167De/+N53Prvn5HVj3jEf5PFTX734'; +moduleBuffer += + '1l8/++1fFmr6OF48cfFTj3xn/4k/+x15cRgvntrz95/75iee+trrx6CumLf1O29969HJb+3/w5vHvIN4/tYT7z7yrmc+cvgPhODu'; +moduleBuffer += + 'B5Co+yXNSgbim5JYqNBTAPK+ijCCitK7hH4tBz76pDMLJYlFjL8gP8kuRjYHm51ReROPOKOpyFdjicn4HoOUb5LLGNwrN3Xij9Xo'; +moduleBuffer += + 'IXqQVoDYELPYBOW4hiTVTYRNxR8Ik2uxxzaM6CIFqGv5AxQCvrUeTYDoZvs/VnDjCvdWPyt/W/krZdrcpv6stCLyQfyf5e0RX5kl'; +moduleBuffer += + '9Astaa4FhtdqCwMUNt1KMo2FBBanzsEnLV+LYWqwt1JWVwcf8fZ2efsgHCNjnqS6F0wutmU2yI9lzhZ3cba4h7O5lrO5+QNcWcnZ'; +moduleBuffer += + '+uQKzrZIruBskeFsWlQ5W0xKv0xWaqycLTacLTacLTac7dXwjxUeVJM3JygpRYb/xORsBaeLydmgxLHT9xw5XZ95XgbHc6MUsK36'; +moduleBuffer += + 'TM9oOduinLMtyzmbre2Cs7mGs2nv/USgpx1PKMf6Fh9xtl6jcOA7d7ciU0M5W/yvnI2c7bF0U87ULCvr5mSbZ7wF+7JMK9k0g209'; +moduleBuffer += + 'ODfLGputFljVy2b7oYtPbZqLT22ai09tmotPbbo0n4rJp2LyqSjnU4sMn4rJp2LyqUWGT8XkUzH51CLDp2LyqZh8apHhUzH5VEw+'; +moduleBuffer += + 'tcjwqZh8KiafWmT4VEw+FZNPLTJ8Sigo+VRMPrUo51Ox4VOx4VOx4VOx4VOx4VOx4VOx4VNo7yDbO1S0N67vD/D9RPF+D96DTy3K'; +moduleBuffer += + '+VSMVaV8KjZ8Kir4FIjbu4S8vedBsil5HN8vj2/1yaSE3j0L4vfrLlmUPH7i+zI1T+wih5LHR1944XsvPOaSQcnjr33xhUd2/+b/'; +moduleBuffer += + 'SfYUK3uKDXt6edJW9hRb9kSiRVqQTX6sYE8lctAWUXn8t8rsqdWjEGxRIQjMaCetEeeg2aAxCc61QrpeRt8x3SXpE5RwSUsLg83d'; +moduleBuffer += + 'I4L5nslCzXYNFMMQ+cmBpDVqcVvUBbSgYDMvpaPb0coJqM/keveb7ktc6sxaRmd2jaqk5bufBx90ZSuYLE1kZybDgTo72JUJFK6B'; +moduleBuffer += + 'Amxpck2XAuwaowe8HsOlIoj7S4a5aba9AzyJuoY+Cbk9+WAwphoua/W5MNPqs4Lp1pqqBjNWH6rKoB6jyeiQr+qxaVWPrem1JRuF'; +moduleBuffer += + 'mAcLTtnvAXrNiYrxqH7ms1Mm3UDTOsWMOJPtLLg1DezRan+yPeaPr0oa2XOrAO9GNr4K5qazPpxmzq7C3+dXxUfqcJ1iEK74IrLo'; +moduleBuffer += + '4iC1FPtj+NJMtjp6c2CYN8EtfXiaanbk78nc944nuacRcBsHsceX56YkMKrJ9xRWpAasR7uX6/UC9KOH3ye/VuMPIgjrS5IbeJN9'; +moduleBuffer += + 'Ci8D3DeSLRywkyxBulWc+t7yKFw2nmvqifEz+KJ04hk+Z85tCNpy2pwSP2UKnTSFeHrc0dPj2XNDnZbvb1FPHtqabHgb6FH1JLwb'; +moduleBuffer += + '/02gZ7CC1NFcu+WAC0imyfNZPBQt1YzfFp1wnOJUNAIDj+shOa/J+GKJUxx/iXioSw8snx4qzpm78durPKncRACJUGcmewKwaQA2'; +moduleBuffer += + 'JtAWjjk3Kc1IqXr+lv33NdYIIlPE79YgQjhUj4Zkzr/ArXEFU7kKIz5DT92Up9DlaVWHgZPKc3x6aMyfXoVogHTkPb3KoIue9F8l'; +moduleBuffer += + 'XcacZdOrNLIwYCu3X4AsDFFF8XJqmdQcyva8WwZynYI/O79PHo7sFzR5LLhsuYm83ED8dE3+fEhmuSUD1yzQUvVkE1VN53zrrGVQ'; +moduleBuffer += + '/9gyPf89C+pP1zvxgQbujtVtRBKFpGPAbyyWXFTxww31H9ObfX1Q8rU2ogPjfa0bFdcOtbE2D/QLg2skZd3xP5PKeLKNGFv/L6iM'; +moduleBuffer += + 'j4CAC2XoEwh3jMIYYDjUhnpUegFvFwT2Eiw6+y6Zse/UAPdBRdm4xYizjBfsaDIXDRvHfOKqQw5KOmQhK/3Q/9J5LouzC+9SVabM'; +moduleBuffer += + 'FFxljQ6ZT+QIONrPWXcKHbLM5NXlNsYf0TbcxKEOuYGeHOgX6mR1yI+3lXAcbnNok4vgCtlG/w+1WzpcmX6h+W39mjbNcFSFDllK'; +moduleBuffer += + 'nx9KiXoXhqBDbpjwV+eBoYi2x6o+dMgNjRfYRxg19RNCphHa7J9RhyxDcrlaAZcw2/+eQoes3AME3LpKym02/k4LffWCLAi8LpbC'; +moduleBuffer += + 'lMKaLupMvc/WeQepzZea1kFZxrjOmW7e5IJbtZ0vqzNvI/tKs5O91DR7tImVKTePkCy9NHe0dH5pVca+OR1lcfjye6u39PmLsykh'; +moduleBuffer += + 'FLJZlYUeRS0nQhRRNxnVECijiaFzU23Q3quAmS4ucQtRwRCm5Z11uTlpb24211Djhe2rozC6ug43TPi2Tpu+CptdaXMdnAPWgQCv'; +moduleBuffer += + '03graxymhvSSPI6k9DSl/9b2xEFWMuc2xDu+fUk06no2bhpp+G3lsGmyg/UY91Zjp+EITNRmMDXE1HZmxOF2NA43XHSrDNhdjl1I'; +moduleBuffer += + '6m4j3snAziPjmWf2mRoTT+M9uohW5mXxfRr6NdG8cQBFQ0N1x3/om5s/8jkAGBbcUmTDwMSeux98M7ugKGNSDZWCBWsUvD6ghptd'; +moduleBuffer += + 'fPZJJ3tG/sSPIMyrY9Id2JwW8YuqSkLTVVUjWWp04TD13qjgdmxwOnp24JQ7E8dtQwDZ6CcQtfq/YA48jeEcH4tsPGTPxEN2Vrjx'; +moduleBuffer += + '6paPiHMyayvLkZE5WxvmjNW+99NfEIFIY1pefOILTvxDryvq5pyz8Kw7yyyYWPKJhYyD45quBtZzs8c/qoH1XA2T6BK3GTsPseTN'; +moduleBuffer += + 'CNHSWbfP0aBUz7zzaScjtIY04DL8uiEwoRCw0ovGA7dWxNDVeMsmAnPdRmCudkdgrjICc6J+PCEiMBv/YROB2UTK9XDmVCPlYhxV'; +moduleBuffer += + 'wHJQCg52WmFPROWoO6JyvQhmLDQt/sCLjKccliPPhuV4yvUkusJ4yj1deNeLjKY8exe6vn+JaMphbzTlenEWsa4EQKMpVzWack2z'; +moduleBuffer += + 'ZzKacq03mnKtFE25qnFheyMFFwjbG8MXTl4MhR5qvHgI/BDBDI7f0LswFFOfOyCUvKKr4pTcl1bFnIFlbUxZzTUT2MCyB3w3LAez'; +moduleBuffer += + 'xJpoFgTRVRAyinslfgpxpxm71cRzdzVahEsboQCDyCYDSTiBQ5i/djFPHtO3xQybhJhyMJsjIHw1a8JgztlNGB/Hevu7JshuimCr'; +moduleBuffer += + 'yFIrbS3mykRIYj3hmOZhq+NP1jWktW7sgX2hUrK67lYCjTb5LqRerZmo+xr1vabzXkvCghpyWuh0aRC5Ev9GXaPKtxUzSyPTk0oe'; +moduleBuffer += + 'OxV/qd6De7gOt3zDcwPFtUB5rjIV8ABz3ie45NxPf3Mqp4hHv9k19yNC+LNai+GnseMX6aTyKqDqrfcjcDP2Zzjbk9Wx6Y8ecnvj'; +moduleBuffer += + '0a9zA5yY8swhG+RwJHD8Eadyi41VoZSzCQntYw0l+eYcKkEex/v9phL4PDhDRCcCDQThsF6eE+Gf3omP/oid+OiPsxOTP2InJotO'; +moduleBuffer += + 'zDHdkz8spvvAD7ume2+/V98VPGjCt4JXuNy4wyfAL46E0N/TgyjkIr2IRvAWUSjS0MXtNNTXFb4O4ZudV+upYUI5izw7+SGRIx7F'; +moduleBuffer += + 'sdWt7k9hCcvieKJGP4j472rI5xaq3FWh3IW2ZS1iFUd0eg5eEyhIkY6enAELXJdNhFjJQspr8T/6QON+z/N5OmeCyXL5IT+bpH2B'; +moduleBuffer += + 'xDc7mvcm/oqHvqjPo7/aP+21mhoPedLT60mEkG/Gv4TgMsaxDhq3Wvy3NaSJq0r3OQx+B7m1qvGzlXxgtUg7v4udr+gyZ+jyEN12'; +moduleBuffer += + '4T3mw2cf6gX/gaQmO4jt0q//I+17NI3iUxBaIZt7CR4EFH5bGFpqAAL3EbgKdXjkCHFCeLL33kjWdCAyvJAGadMzbXJkB1weab1L'; +moduleBuffer += + 'c8ewvZulW5GdOrSCqduOfKGN+P9G96bdTubFnwYU4dfOVz5CTfPbrQrUQDxTS4dFV79iTS3xBR/lzA+b7Hv5znkfyZ9xd85PK7IS'; +moduleBuffer += + 'lqSzoV0SZdU3p96raJSq6IKBPMy5nJiQmZyq6GTTl5sR0ERS18DWk17vdxndUWoe6a0Z48+g1ERIpyo++4r7bumr4S3PQFW2ATyI'; +moduleBuffer += + '31XBu0OYR7lOBhGnriVcZnurkvRtfcVDrYGtTtK3E3d9YKfQP7lJBVlW+hm9PG0mA+N7ePgEteAY3/dwq58WKfnGlA/kUbDFn60D'; +moduleBuffer += + 'i+y8d01S0pCJ2Q7dCJh1QyfWLU8sDoC9pg8biAsueKBOpj2J5MSTVVUgEweD7OyHFCiE4ig853GzAbvn+G2+WVKB8RFenMM3kAXy'; +moduleBuffer += + 'FU87nh9tqtCrFycjtO9B0XeDpto93J7103r+83FfFjag7st6RbrAJwIkf1JwHwi0oS2KQdrSBb/F2W6bgTSyC2Ygrrbfxp+1hj6o'; +moduleBuffer += + '2Rjhz816kI3vr0rxJyuMdiMlE/wZNh0Lyh0LbMfQ8/hjHuPi2Y8eMK2Yrg7hz9Jyp3d1d9q08jlFUF0o09T4TPkFvgIHzlSbHlAV'; +moduleBuffer += + 'Xr8h6ItCvq5FpXEtDEn1lw1K87y1mWipz7wItpRZj6VnoTGomdcxKkcn0o1FHlAckZenGVDc0YDiTbnsfeTp3bsTRAV1mBeN0caz'; +moduleBuffer += + 'yV+1Id5zGgmKGETZNCbn3Q0nyk7bu9JSlb7nYyc+CaWNeDJvn4GKImwZRgI1jFHHgcXrGwuFU7jaLZZ+SJmqqhei66g4eJUqBmQW'; +moduleBuffer += + 'vscUw9AsbDc7TS5rSKlz8dq9j8sOecBsNn/7yTKvvb7Yv1vhPWWynvg/JlyNZoNidu9zfOD46SdzZv746a4PzFFj90VktNMa535w'; +moduleBuffer += + 'JTXOvOOpvMZJub98jSMfeSof9sRHumpscJgbEKhmgc4w+dmFP5A6u6efcpBW4q7484SFlohe6pRj6dsTDYykn41/RepN/aHWm5JN'; +moduleBuffer += + 'eciKWmauDn79/YUS4OAHupQA6+RbqhoKzbkklxnUsuZmJ8yMnAU8z7zoEjP/xY8VX3j+cNcX1lDNYDJ5pNjqSb3XLkmpELl3+0CU'; +moduleBuffer += + 'HfqiVJiqYe+lXRlUtUm8TfNfCZtmXDJmmnSM0mWz40Zr887oemROcze7+NfHnSyKD8sOJ/4fAc+GSz/+yHWDYqMGZUHFBO8fLXRK'; +moduleBuffer += + 'iYndb+OGMue1ORKlWa8H9TyDI+LNv5XHYZNDBycUDrMkNLmBCibDec6ciubMAdFF1tyunDk20AbsyvmmRoMBMG4I7UX4E9I6ZLc3'; +moduleBuffer += + 'n/b9YJf3oLujdLyTmRR0RCpchyqd4IySapHawYOJuQ3T8JUO/zvzhf+1VdEDXPjP8R5Mwg/Y337iP8Ln+oh0n341/G9X+T6pLEnC'; +moduleBuffer += + 'V2rVZ3/i7iVbcfoz/A9LWtWtbmWrA7FOZEocTPWSGiPpqawfmmQkiPJd3er8uz4bdBqYhbyCA7IA36cRpyuFuo1QUtwidiI90dbd'; +moduleBuffer += + '3ut1i77ZGcKmmlkcyrkf0JBNDbFO1XGI9YN8EBOHphzNB+ExH0TWgrOCk6WYcJQHAe9KCpEQL5jp8ldrXODDDoNV63Kp3uzI/EY8'; +moduleBuffer += + 'bOWaeYTWQA/SRqOzpqD8Sp6CspNYxaLZYbdd90E8Ppb4jyXuY8btJHg5ByFtw6S5Xfal0Y32YD2zU+JPv+e4XDYB1M2aqlRuYZ5y'; +moduleBuffer += + 'skEejSj1x52tP0J0Uu2Pa/pTJGvKlw3UsLJsnJLE+Vg+4OtKRDDe43URN5sl0dK+dV20L/5QvZxBJCeFBcV7iWNpFzH3NUpnZBH/'; +moduleBuffer += + 'hkn4qCxa+TOJWrQRd7uJKY5JBkhsjsdUSWvsqg7DI+VqsmiT6jAFRiMOreKaAhRazM+++2l+NNdimtx1iAPiRk8XKeSMArNqFZgV'; +moduleBuffer += + 'KDBVooDyqApVZVVjAhtVJRe+UVUqEYCqMlBVJQIRU9NzpqSqrKry7xDdyUT2id+CncMh+NF7I84xT7arjD6laiG5TApg97smoJiX'; +moduleBuffer += + 're0UzPiEp3oaY4j2slN8kRQvnvF6dFQ+z3FSVyUAPe4xhcl+1RIlmu0Xh+zc++L3Bl0KTuqFil7/7+VeHzK9drp6LSLyRcdIbJVc'; +moduleBuffer += + 'xYl4KvJ3Tx5F1mOubQ+JGPI303xzvnhDJx9X+/1GnvZBv8cjJkwrdfrtQZdmyqVGqlJopCqqkdKDeIHVfgZXpv0MLqX9PFDJFY29'; +moduleBuffer += + 'aBQUaFQp0KhSQqOKRgsmGvGeaFQxaCR9hBcBQ4bgfIZfRiXfTIrsoJE4EDs8t8XrIQSCMLulw4JERs/to9W1RquiYcJ5RtZHWo7T'; +moduleBuffer += + 'njl0q1LgV3gMM4jfAW3k9+ShkSAJmD73Q7UdJo34HBLLPoL9WuZkT9qzs/gtiN8bxb8CfqAH2OrGVsbNTDX+jdDsR+wWJr7Ani/V'; +moduleBuffer += + 'AQxpvJ5ifO/sHZ9THt8zPeM7Ocv4npt9fF+tlMaXdPR5lvHFb2vkI3ukZ2QnzcjifGRheZ+uI2tq10ODmYHOMS6BihUaWbxiMbNy'; +moduleBuffer += + 'ZZhZuRRmPlvLLTR+nuXQM5pnK1GpfQL+ubyLIVttMV7FkFWEqv4iNoJyfdgHvx9x3oojH3LdDQdZo7N24KtnzcNuUtvs3A5+v9nZ'; +moduleBuffer += + 'BoXCZud/wQ53s/OqkliIs0DyHeSu+F6I86T0g3biD1WNaCjvqhu9CVevB8x1n7mO41rb6O3msXkkunGz8f0QGR7QF/cmSImMF2/U'; +moduleBuffer += + 'F/fAwsAXd/P815cdHnLj/Zdwv1/v/wD3e/V+Gvd7cC/ztEMlmcMm7eukXLceEQ51TojuBB7ArpIx7wAKyPTu87XCXlNh3FY4IxV2'; +moduleBuffer += + 'lypc8LTCOU8rPO9phbOeqXBSKpzxigqnTYWTpsIJU2HaVkDCiqlShaOmwhHuFmUMpsIkykxImdExOFG6W3/BDMGU32fK7zXlx215'; +moduleBuffer += + 'KbO7VP6Ca0bgavnnXTMC15QXpnPGLcqfNuVPmvInTPlplJHfp0plj5qyR8xM36WXO7Cz5XS+Wl/cyRk7AmHoDbx9DpP3OjVruNkJ'; +moduleBuffer += + 'kVv+WOZRM1HS3V1+QnBzbBQ8j5q8dpEfxmNIC1gxyoae9pivCl7B1BcCXTTGxvU3dX0MEPiX6X8d3al52F449EncoHuzTdaKtKET'; +moduleBuffer += + 'P4RtjZqQQr0bMuxRCQvWtk8LtZXhrAD3fi/X7182jalbSmPq/NPSmL6ylMZ0C9OY0uBvk5h+zZd3AlZvlhym2Hah7oYCzFWCuZrd'; +moduleBuffer += + 'bMFcRa6TDQJmSnVe/OF6C/FB8zjvcBldomFbZ+QvzQVbZNR7Lbceu+EnpEoT3FutibTcMQ4Vl1av2IL/GXImTi3/bpiSxHuFqZaz'; +moduleBuffer += + 'BskrTzrNkn9aTz2kL0Zylb+F8siD7AkWeuGYbns8Db6MTcTW5OGtPkNf3dCTKFD38nkeGptHL/7vNevesLbb2cNI7Sl12rkMb/Y8'; +moduleBuffer += + '0c/rftvsrl3NK6qGULX/KIvwNA1nhemhQf3A85yNzC5tMDgGwfbQla8ReLk3CUMIunDYgzHob2tm2xyNzLQUo9xX/dIqentoNRSH'; +moduleBuffer += + 'XLfSs6GxKW80UiZzy1eg8N6SVFrSEQ0KZtLMe7s0UxQYUOJtfw3SsKlXDhR4r5JHlejRg2+5lOdhjqDFw1GvgzzSr3HdLHZRbw/t'; +moduleBuffer += + 'IuyFPX0zkKPmTHWmh82VTu2jlZlTazQJtBLJsvjlChV0VrM4miP+k44i/pRTID68s3rw+WvVPAGqZh0M1AHciz+O/Djngu1FCgyc'; +moduleBuffer += + 'XvlGzRwOCklqJnwTPcrGsDvj2kEhZkYQHwo0qwwUYicZ1kxu/tjtA3ZSGodf+LurxpPmlBtRI+Ka5aSRU6y1bsT5EzdLTY5Tqf8s'; +moduleBuffer += + 'tkZnROL8DdeEWAnib9fVyB/aHsCCGcR/7mrzON/eFnaTwpTZRwPoabeFkZ70SrrPKIN8TEkWBrd6EuHxU56aGp3sF5CpnMwBJ4fk'; +moduleBuffer += + '5/gTFaFTTAI84hzxjO6EPiPx15BBrqqpRs9oTDIvE5noKDdizOl6jPiYHeW+5yuIp7j/KSfeFzA6Eb0QyEHq5V+/FOhhfToD0FEh'; +moduleBuffer += + '0s2ULmdHAMnMWx63ASZLXTbtGkxhyCRUuaVPw+4hwtenZ4KfMvjstWnEMGX1+y5CbcGrh0GuZdZrJlxFLTvtQv0H0mxbcTV750cj'; +moduleBuffer += + 'ZY8uo4YXWcVqkCWJetOeNhaaxlgRMaFMuh5bP+yqH+rBAYM8IklPe+omQafRCiBl6gNtKingZBIGm9dGMQFRAWEpKJef8FRlYSPY'; +moduleBuffer += + 'dbmoRVwnDG1RkaWjSda4fv/80ssMyDdzmSFpjC4zrKquZbY7X2YIrdu9zO41q+y+ORbZA5deY/eXl9gLTifbc4klxq+Xl9gDusLu'; +moduleBuffer += + 'LS2wt3B9Tbk962u0a3mNzrq6Nuni+nhpcU24XYvr66XFNUrhkGtr0s3X1mGXa2uS7la/JyTj+Q/MtbbyX2dfW1PupdfWWeefsra6'; +moduleBuffer += + 'a8+2tnbPtbYQu9usLdOKWVuPzrm2dJ1WcE5rjrWlB0XnWltM7FCsraNu19qCNtAcNO1dW+b1bGvrmHula0upnFlbv9Dwwl2uyfzL'; +moduleBuffer += + 'HX9CqaXOlD9YLBUb1KJOjGgaFlYxHi48fWbe5QFZQ8Pd1G3MxiPLmcSZkuCGIFJEtpxrYCkypNSZEptosIxyCr+bUzCfUUM5hX85'; +moduleBuffer += + 'TlGbySnGK4RQjd0BPE2J+NMBPnOUlE9uPsMbv1z1RKDloa3ooMxnPY0G49oAV7Imj3lRy7epdvmVErMJBX0Cgz6BofNBic6H3XRe'; +moduleBuffer += + '7SQFLgU5nYeBCPYC0xb7VO0l8x43IEX1qjkfBkFJqj9I9VlevVJU36qOOFS1CV5s9SJmeLfVkXzXUxoIk0ekgYDd7Bg0/sivcFCZ'; +moduleBuffer += + 'QvQocvnizNyJbzzpZKfkj8BQrV/muNCUZzx/uXQ0P6eg7t94lkLHutLOKBOAw2FgNJ1udjbQYC2ykqr5y3N0DYLkvs51bnKByi43'; +moduleBuffer += + 'iKcDtDcPOWZlh+F29QnkBQpweAmuc+e3oLuqmfpBHo7dpQbOPmDwpwN4MbrZ6cB0/Dl6lp8OZMPzVg2NSLr+jPpZzxi0r5+NZv+V'; +moduleBuffer += + 'hC3f9mkzcLGUuzNCky8GqmS5gKvg2fmg3JN3VhWApwPD4/4bOuXjOLg/Y+w0FpwPqAFxqFN2s4uB3aypHzOm186sg7hdJ9DRcKP7'; +moduleBuffer += + 'YVwbN7kTtuNS4XfZRJtzAJNL9gRfJB2T0MzJPs4XQ/kL4tKY8xHPAOWZYHaoSKXzgYlTmXk9mDVLeXKDiioeSQP/sX4ZGnjGm0kD'; +moduleBuffer += + 'IV/00kC866KBED26aGDByEdnJ4GjXRRwNOfkhv59vET/LDM39O/rJfo3JzOvzWTms5A/ljDkb9I15O+jriV/edUZ5O9j7kzyd9id'; +moduleBuffer += + 'lfypPNBN/pQVByVWHHaz4pnkz7LiOclfmRPPJH8T7mXIn1afi/xNuJckf4ddQ/72uldK/o64V0b+NFB2D/mb9mYhf8JnZid/0Gf+'; +moduleBuffer += + 'uMnfUU/J31Gvi/wd9XrI3zGvvDSLQc9G/rpA0k3+pBlD/qakwDOekr/TnpK/U165J5b8KT93wc8vQ/5OeWP8OM/ju7AHdpM/GE7M'; +moduleBuffer += + 'zJL8HXOV/L3HVfK3zy3I38fdHvL3EbeH/P2qOyv5e79rgAIxYjaoSKVT3uXJX16eG02vRP6o8fioUfVNllR9k7Oo+tReL9DbR+rz'; +moduleBuffer += + 'YLdkutWFfynSKxQFJ7yuglaesAXXGC+dK3DQWe26MN3BshF/MsLRPyf+lF5hBJM/S2+FedrVkw7ybSf1NPunl63KLk5/wRwFNweb'; +moduleBuffer += + 'rNmfvZ31kJHHhFDxWdfq0/ZXS6yiorZKH7bKLtPQsNobi30mj/wfjNQ5ZLSEwlhArtB3G3AAaDeqS4jQihFX/4s1PbDgG9eS+5QE'; +moduleBuffer += + 'bNkujdKEc9zp6I9b9Jd2fh45DbVZnEJO63Ad4YYz1H1tfYyWWQ3FE3+QmwlXk9QUilnXHGG+Q/d0iB46/QGoXu9KXHgFwjJ0FQ07'; +moduleBuffer += + 'cnMB5oJ7eIsIib7alDZYn4cjvjlFrOaEm4uMehz5hlIX/a4u6mYSE/9Bnvjn+r4rmzzAE8/qb3EAD+cP2BPPJAsbtAOm3wd7+z0E'; +moduleBuffer += + 'Lb7LdWi7fUG7nShYy/2eqBvg0A7S3fNXoud3zNXzYv8JO0rLVTvJ8C25haTwxYByleA2TAiK4MsaSZTpz9UQtv/azofrOGLiYU8M'; +moduleBuffer += + 'I4qrKujBwohSgRJ+KYwovBssG1FgTqVxlVySrNCkvIguFufYqromgi43ENzUjEeaDaJP/34cRbPHHqEmR7yXQPPS1GC+903KLbh5'; +moduleBuffer += + 'xV+vqsU7iP+uziQLsXk3TFvxA/jzlvigMU8FdGjTAqOzFfAJMOu2mxSuw3SDxp9N8WGPzgJyf7vKWr4GXAQCMANYbrzQfF13qt5B'; +moduleBuffer += + 'vpQ9/0Hg2r2JD1zbIS+uokEUfr/jIDpv4S1yAlVoiPWZfLgmfTtCX7t76D0df7IuHK6G/lZMJHZ5fYd6Fb86rRQZ6lnpdWkNtiUC'; +moduleBuffer += + 'cYuC9GYDRDhy1OJjbgkSv1mDEV1hcXNHr6PmOmyuQ7hmhvXO/iO9RAhs4wim1yavdTV71NV7xMfpO8y+krMqNSewhyGssUP7h3tf'; +moduleBuffer += + 'GqhpCtqcJFiix7Zic+TOxBCHnGfSm0QHCxuHq9jnGYqcWKsHPdm9mGAeBAapP6NIbYk5aDFIf8Yg92Vc2oJvd4CDqsaX0QXToG+/'; +moduleBuffer += + 'OdamA0qsWqsIIKGOncb48GthiWNo+ghvs4OQzAO6ACbyc78I045Rf0uuNVUPYReAk8YVRLF39AQJsl7Lk4t0wf46956kZtLxMl65'; +moduleBuffer += + 'j5zV5uhEEH+z3se8rw5yCvrZtx2b2spB0kGRtN+s/m8BEhHSAVF1bzwiBkvkXzRwu63Py++Tyq19Bl2lZ38R6BcD+jDR7Lfaewud'; +moduleBuffer += + 'DZOqSRGJ+B7cExnXKgfJmnybDJsvsITzwB94sbajyGJfENyq83uOJMGNnyRnuqdF9av2wjNHRpIIea+7eHJTY6gfYCwRZNCEp4aC'; +moduleBuffer += + 'mVTVwgxHQj7PnU/cqugvDWbQxC+ygr6tu6nUTXpO+WkWSlaoalNeVxZKngQkYafnSpGFMqAVuchCGZSzUAZaiw5YVQMCdaIrslAG'; +moduleBuffer += + 'IJbWQ4tqZmSh9IoslAHcR1CgQWaUm8VJflwlEGa/QAKXenRbL6ibz0zid+RTfRsxgNkFbbo1ktOUx53ySv4dY/6mJIITZ+rFZ+sZ'; +moduleBuffer += + '/igZRcQLk6GLRN0tV9s0xpxkspkU2pxRVvOR/dXZ7FwDiDH3mBefRKFNNggQ2/RLWciBBYw7ZrT08uMGlNif5xXzFc325mimvMQ6'; +moduleBuffer += + '2HnGJcktd7Q8Pm/HGOOKcaT8lCrGleTEv6emVPpgqD8xszL5ZtsY/hgJxN/9f5ZAPPsvRyC+9M9GIJ6+BIF4/l8JxL8SiB8ngVhH'; +moduleBuffer += + 'Pw2jPgkYvMqliwT8YQai7Jn34RxQdk4u8TerTjTtu5Hxd9CUeXp2JP5LagC4b9nsLNf7OA02O/P1PkkFCdQjIpRVv4x3WP/X6O+B'; +moduleBuffer += + 'oG1VHpdg5Wb9crdYfwjTWha8mU7nyGgld1clBtHDzJPHhfRUbMjdIO/my92ChGpRuZvHO3wo1mqDaZ0f6k+go8CH+vSHIVlp+BAA'; +moduleBuffer += + '2OCHTISEpWnED+HEUMQP1XiHD8GFpMIPkYDxQ75WG05dfojg5IccDnrozZl/HzJbP3A/MAzDXfTmbOA+xKvFq6s50ME3Z6+4T0ZT'; +moduleBuffer += + 'xatFHIRWrGvFAXZfKza0YpMd14qRVqyzU1rR1YpIx0BflNXqm3bO6TpZ5sbf9+kU9F/hOcRI69bFBW7JupmiykaPUOWJY3xzHM40'; +moduleBuffer += + 'e9LtafagNvtpEDB65lLjUvac0VZ5oqvHbWZFXlIV5U78Wihg1mWajcT4TWnoHbrMoWsQ+bfzlFjqgKDe9ab7EgeBC3myquvUPdf2'; +moduleBuffer += + 'AL2BBjqZGz9vD8rYPubnhDwtB/rDkr+jW0VsU13ZzllOqyN3zVF+9dCCWbIcXEK2Dc5qRtx0zWmwJBizRZxhdTRKGXtI3f3LZ+oD'; +moduleBuffer += + 'c0DF73NlB+5ROc9HswhLvvYaDCdX1Tmq9uIBnm8fL20sUmcEKD7i1OP3+U5PXCMpvedSpX9riTeQjz7uCTdT7dqm68bdt/v1PKvU'; +moduleBuffer += + 'PI04E5ogxoExYu/qCiegunxwnOd95UlnfTpAXvT11EBFK+jJgbDYwQZ6zD/ILgTqTG6Tk+F0CNKW+efAouoMJUpedhF+FuFGeM5C'; +moduleBuffer += + '1XLB7cQP2Y+weTUrjPvwhIBzetq0LSI1XdqHJdtJ+w1rC5Dyldw2HbCv8OVQvgyzBJJeNEpdkv4wDza+vbv07VC/LSJRqN50AWyQ'; +moduleBuffer += + 'sL7r9jLIDiNrZt6VQ/LUb/hJkB2UpwH7pJ/39uMTSLVZzyvtkac+w3cCphFm9+0bds8b8877CqpzvoJqH+WE+NQsYDrB9JR5Zvgg'; +moduleBuffer += + 'O84XQ8aYwFfHAgOgvp4ePm7EiyMB9Qwf8DQUpLbfV4fQsoceZUJr+u1xCtYAAHlGeX787ogpNK2Pjjr1QOPDLOp1c1qHlpe4Q/V1'; +moduleBuffer += + '/hxqdnD7jKTx5pdNnWzfHz3p5M+jnWy8/NzuZLvLzxf+0Dwk8iDyT3boROlXEYyyg+UXItRk+8sv9toHuHSIjLTVvD9X3J7Nb3G5'; +moduleBuffer += + 'CyXjjzGvmMwEn15AhiRGZsXT0xWpJMJUTd4LcJ/WoiIF1LID0vX4DxCyBt+VO5jdfDqWAN9rXS3VtCWmmy83xYyLrNAaQCYL+RfK'; +moduleBuffer += + 'v4YufxEimNoiYYaapJYMML9XQ/N7yaeZ2ytd8Oj9gvkLmOOrUY7s3gTeIbhrsxPvaTC357ADPU8t2yWtePctkTZrS3hc34OyfkCG'; +moduleBuffer += + '/CXTUQ5cnrDpqLCL+tOW7fo7fvIjO6hZwIGD7ZHarO5SHB7q6MTkiyfu6PTkL2j8O1u8SOoyPQz7C5xQTW7AvMHQ1x0nkp/zEPE1'; +moduleBuffer += + 'yJ7hChHqkq+Z5/hmvPTmeb7Z53fRtwseI+PyJNx5jxFxA4Rlt6uiklSxnBAO1+AayNdU/tQvT0fzJzZ5JFCyBg+IKsnUScZm/z3M'; +moduleBuffer += + 'z+T4FM5TneIBmmy8q9XdXa1e8LtaPefjFu2xJUP9tCkSYfkW4PJUg6Rmf8Sn/wbMmR9P1/sa2e53TInEGh+pN+tRxqiuz/sabqtV'; +moduleBuffer += + 'Q2TWAMk95RlBV/7FOMmef0FOsud/Hk7yZy+Gk8zgI5fmIu/q5iJhmYvYI2tdPCR+u1krhoPkBzlmcJBqDwep9nCQas5BquAgR47n'; +moduleBuffer += + 'FJ5BJibLz8JBJsrPB47nHKRKDnKy/Cs4yHT5BTjIVPnF0eM5B6kWHKRacJBqwUGqloNUzdiVg1Tjd0SG6FdB9HmaBGyF3MSyD+Fv'; +moduleBuffer += + '8qn4iyCoR/UuZx8IVyc18mYq2gzIbFc7yjtQutUwvAOOKGHBMhCJqUGWESrLqJZZRsWwjLDMMqSF2+LfjsAkKsIkQjIJ6WWJSTRk'; +moduleBuffer += + 'YL9vesThyROYRJV90Z+ESfB3/ORHtvezDNoyiWqZSVR7mUS1l0lUe5jE2yPDJKplJtHFIqplFlESrHImkVZ+RDZhUL9Gcj7x9inH'; +moduleBuffer += + 'ZFSslDgGTs4WHKNCKlUpcY0K7FjgGuc8dcJGTC0yOtRU5nGswWwctfizDZXOKiXmUVFmujvokswqJRbCTygLQVfZXkW5qm0TLIQp'; +moduleBuffer += + 'P+LPMBofzirj6c9DDgDrXNhIvcRGwlnYSFiwEfm5KFspPwRR9m48LMKDX/7FKz+4pWIRIl4QT4HukSb3CTSnD2aNKQWSiMkm8aeJ'; +moduleBuffer += + 'ALiRksgYN5zLWGtFatiKYT+KsXGLzVY1cgd25eLXTIuqbrXVq30oP4NWQ8wOD+7KQ/izFIEK4NjMHLe7y4ZWq4pKfNXsVGAW9xPq'; +moduleBuffer += + 'M0VCF1Z7t9UucwH9ImIj7YZreR9I7ej2rLFNrs++8IJzX/aksz2rbru/D3GDBTgnPyCQWkbLpSrVzhgbbmDMsc2SDTcs7LrQHdLy'; +moduleBuffer += + 'WZhoeQY4pQZ5sAMbPnt914/Ute+iW8uLbkGeuFuhcdeP0NyMUU47+dGqiEerqBkLjLuGpwgQIRBHiIxEnH0qZHUudbMD7317KJl7'; +moduleBuffer += + '7nzVRLwb4lpBmuw2XbpbfVrbOhlyRcoi/RIc/gMkcg6QlZcHDvryUBAUHZDwuaFiSyzL8MMgG5Q3hjLGH9iV1JeIsCM88TVLMjdz'; +moduleBuffer += + '439UNgzBCijTnzSgL4Nwlc5TB40g6YcNn5IVgrm01Rs+FwOSDu3+uUQUmjFBoW13GyF2G1AjJLGMAilFHXj4yNVt9WvU7zplJ6iJ'; +moduleBuffer += + 'Q+h5Y/S9AVMyYqin86Xn85fE02GEYtIXEYk0dnZdg3yQwxiLMpIjI2cWO9inwqHmGRiliz4dHmQS7amKKqgXE6hXFdp5AnWXNIrR'; +moduleBuffer += + 'B0CmAg35mmt0Sv73oya8S5XzMb57KuQno/x83B0tRp17tVr5b0+rhcMQ0XWtLoO24vCwOjhALj7o0pJfnJzvdm8wTg1f47K62aZP'; +moduleBuffer += + 'YOoPH2KJ/D3erdO/ecy/XV0a7kaRD6r7jK/uM766/fhqCoD/jG+U/BW6NyCDo8lb3TFODXfizxvUqaFqnRqsA8Gs3gXqSGAU+Bj8'; +moduleBuffer += + 'Bh38aNGtI73dulqdHwAK26vRjnpCnKInxFxdqpjEul1fBk2LEk/fhMa5IeB1QKd5wDo3KNOnP24NU1BD8AKh/jU9F9nkqRMUbaoD'; +moduleBuffer += + 'Wk0j6EB+Zx53szeO3lH16rmqrlryMitHxIhLp5rCcvwxKAVjHoKAWtczbjLq5wMS6xkS62swYQVJAPe0XYX28nXlQ9wMafuM02XM'; +moduleBuffer += + 'eh1j2sKHgpE5l7Ya1mFJpK8v1jT+CSOKhHR6pRtzUkfKhfjf4vUmGzH0JI+I34zQdiXnJfVqvR06Wkyzl03/ik6zp9PsKfZBV22w'; +moduleBuffer += + 'z1N7GtxJ3sI4K0fI3O7EH06wr84u9tiMvN6iCtibC0caT12rXolWNigsR/UI71oD0grPOB9zS8D8zZptGzFm9JrAVY1QVwcaGE3Z'; +moduleBuffer += + 'HfQuH9Th3kEN6ffQjh2T8UhbSyDZTuQuaRZ+x0suaZygm9NI4YeYoua1vLlLOvrhuuqieSY596LzSl50H7RedGYgUT4SLlbPePmE'; +moduleBuffer += + 'qoAObWwYswAU3atEd43AUe2NwAGEtBE4apfy7lnNM0xCzjVkE4I5mZhMdLt16BXH2E0r6fSp4Z7815rT6F58jh6fVIpnlQc60bW9'; +moduleBuffer += + 'p4GlzE00fPxiZK0Za3vND0TGsIi2FOoZdPZwsjLj+AC097KO6no2IHVHHGM8ZmQuUP8uFecJIzps6ZgoIzbidh5tOLDRhlWDWkOD'; +moduleBuffer += + 'SIAuaBtkDs2mS4DDcOQfcaTMA/dnC+9v1RJ76lodWb/MEKex9QOgfU7ZGlQ0fxKSLdGdvzAeW15Gp9GIVl10erWwqUgZ5KtTX5up'; +moduleBuffer += + 'AMG2kNepis6LD5rwPFoip2iwlZuhVUuBlKt2cBpIuXCgBYSCHEI6nFo82dDhhHY4DePWkHki0ehwgp7hBBrG25q6zXBcOxy3NBxX'; +moduleBuffer += + 'h8M4zm4+HLcYTsJIMvE/MPK3cQqPi8Bffn4Ujw2czg3PDgzPgSmRO4eqv7M2GBn0zxuuzNlwZe6Gja4ysp7eV7BCRt+Yr5CkvEJe'; +moduleBuffer += + 'zxWyLzIeb9HwLGW+7F1BoW/7PYVWF6bL4vT/v0/0nKA5+K92y4dd17dFFS0ufuZJs83l+Zt9bhEcEE6A8XOe4k6KTz4H2u7Ee5Wo'; +moduleBuffer += + 'MeSdPNA86Yw4POOy5U3ILJI42++fypx/I78Y46V6LVr76SrEQzVe+0Mdexfnd6HeRW+gv7o9HBz/DfUlqdD+7f0Vx/Ncz49kIzGl'; +moduleBuffer += + '5r8sYU4ISLBe9pSjTusyuue++uQMr3VM7prZwPadcDa4zVr0/f4lik4F5aIf0qJTgSk6FczZ6ndn7cCqWeI7fJLHsbpDO6ycpdzt'; +moduleBuffer += + 'M4utUofLUjx1k7jrvAmMZwKqrzEZSwzzCCFDSdky+xCeRN4xwmYG8VyOdedpVE44RXjqP0DY2/Qig9nJd/WGx5ujyrW0SL9GO1wY'; +moduleBuffer += + 'bQfoyi60FzP89hmx5pWNeIaN+JaNZE78CXhyKzcxLSpT6Y49/+WakrQrjT2fR5xfY0YovCt+T8AQLJyNtwUDvUeLr2PwQFkn7JCe'; +moduleBuffer += + 'YEsRFFEDweZREGHWX9dTlgd+Uw0by/CvRRTEzc6Uy5UGBKxfInKiPEafDFRdMlHE1phXeCJ8rqIV05o2kzb11RSjZdXMQx9VJ/8P'; +moduleBuffer += + 'dV8CXlV1LXyGO+UOyQkJEAjDvhfQIEPCmECx9dwQIEAgzMNrfw1JyEiGm4GhUbASi68OOFUs2qK1FatYrENpHQoIVStWbNXaqpVa'; +moduleBuffer += + 'p7YOtOorba3+a9jn3HOSS4Cq7/9++HLPHtce1tp7r7WHtSD5O/g2/xjZhNNkXh8JMkzfKtkI9uK6yN4tdCgA6xzmxKdHqgShkzo/'; +moduleBuffer += + 'ywujJoY3Wrzs3eXFUwMvF7DFh/rSqFGxIAZpIIymIXjUCJTGw0re44hmCLT2F0YwsoZYNz+n9okQOoJ26iACEBkWLC8O/LAVi9Xy'; +moduleBuffer += + 'y7MhWS0yPuQD6Yy8W9IcsT7jdmpXGiaBtR5BAYAgXy63AIQoFpGkiXSsnU59wF0VZv45IjsynfvcLwvLoD6HNnH/ZdD2I5AxJd6P'; +moduleBuffer += + 'b/SgYVRswEoWILrwWIQTILrwW14oIpNUQ+NOILAE7/vw9T3Zr/xJFpAM1OviAPMax1nvk/MqA7/PxwtmnaaOgqXeGlPBBX7A3UJS'; +moduleBuffer += + 'vJRTj9sGeP74s0cV4ycB0hQVjZCSqKgBCUiO8OEILaAr7V2tlh4pjVRIyadVY8FlsC4oWLvngC9i6i2YdAa6Ba5srDZKFQakL2I1'; +moduleBuffer += + 'UMiPfpkOAbSltPVdVI9avXykLGqqNh83tggok7+PHy4Y7+pYwQvYBCa4ivBnBpoSQjVbafgpQBHdfFXB43pSTAxlfUG9AD4Hvtb9'; +moduleBuffer += + '3x7UGEZnKCg6biEjOAZpwMIb/+aW/Y+SBTPfOGW+cbseDaOrDF1edC1AV5pIR/dCcMO4SOPbULxF7WnHO1Sd4K8QaAlUa8dA9F/A'; +moduleBuffer += + '7KkfTSTgNhpLCjjB7ZJFpuNbAxFOJBJmoBPkDaiNOish1IT5ySd6a0SXWovTbXad9goiCXwDqUX5+j8K+Mbv/LGs0lh2BPeFABfo'; +moduleBuffer += + '95ZG8EoXXQXyAhqAv0YWnw7LcTc4LNdDVq0Eo7tBKm/V56FVKGgHCJp6E5pyEkEgpNl4GuHBON67w/0sc+9+JiRSphTis0zcTNOR'; +moduleBuffer += + 'XJBFA7Lw4gMlvJXkJbLI4VPSbAry17NC1TBSnAfpr0jgRrPeilSGLibByZQ6TFuJ9AZsvvAgHc2kU0g0TXgeuXDjdQZeSqUXXbhL'; +moduleBuffer += + 'OKMeCMgeIFDB8hi9DfbgCxoPUhCpBR3Cx5cCrdqYv0IdDkxIHiSkci5zBt11hcGNjb7Y71AKTTqIJE4945TyWAZQRKwfsET1QERB'; +moduleBuffer += + 'VJodMFsQ9jhlUTRoWzI6euBRBV9ZgvNpdEJC0Y/K+KX0AlHkNhwwAx2twouwHFZ+6R7sDJEBFGgW0K29zgQUTGViYX2WknFGpZyL'; +moduleBuffer += + 'Vx/azRl0gxBKCZ5mKcEzKuWLAP1LrSDmnR7wwBkB/xJMtF40Cu8nogDfcUZY2Ed0uzTm5VNGdVZEoxspaNkDY77MFLISnxfjxm6Q'; +moduleBuffer += + 'H2u6UAwhWjTTqnIJ6eP5j5GLB3ymBv/3Pwo1RIEH6uOn+yxepMk+MX7ysk8L5VQ2cjtHnWWzZQoqXrVJITMVKZy8+NOiBSpehf/H'; +moduleBuffer += + 'rOKhcG0ezITYH8cdgbCK7pdPZKm+u6w4yr7XTkmV1qCyQFmfOdn6Td3uGNIhYMK6a245ZBWeJkL8oCwsFQDQTXW8zRDzIGcMjEFW'; +moduleBuffer += + 'vcjOhZkBjX/hTXWR1UB8hV6aG9XwYSXJVmpDlO+V4gyitIn0RDRdsFFVXDPq6VwnJNLpsNxU26l+pooPjNMs3aooz6l82x2WCWbr'; +moduleBuffer += + 'DRTOw7Q0VeEAoO2sRl5Ua6N08KLg+hfggeHFAJUXSRggZXhCDJSPAXj2qs+K+DFAxwBoNp5r4ukFLIlhXhJxRQI4ZN4OV04/r5yo'; +moduleBuffer += + 'qwKgBQVdoeHVVYNuDSeEPyE81uqoJmS/W1tbpNobL97Ye10KBgQcAZTCzzSy96CTRvbbPqSto7YPUXjM9mG+4658Wx515ttuU5qP'; +moduleBuffer += + 'rzeTVIeIRMayBlUgXmTuuuewgoaOVHLxZQgFFZ9u+yILybdDr6DkhVY8zc2MeEQrCGjxp268940j8Df/opgSv4+cR26ctDRCz4a1'; +moduleBuffer += + 'stDtIJvzll5y78J4Xz4pZPkqR17AUFnwZ/M+los+VKBgdWAandHSJQgPX4LQ6KIh34Pwor57L12DYGWQtCMgdWhihk4QmYzn04yd'; +moduleBuffer += + 'rPJhpPXwMBQjsTKpelNuFDgNaC50m/yki8xOFcJSgUlMk2/e+Uo/23UJ1Bv3B5OqhA2rSKf0PU7xGLtVl+B9i919Dp2Lj2jIejl3'; +moduleBuffer += + 'DFBGlBpPaJutgE8bUJ0+yuiu7lLNx+9I2V2OqUMj7SR4FpbssXuoH4wZ1l6EtcP7tHw02kPfJ23DWuepIPDE8QGoW6y2ta95zLFs'; +moduleBuffer += + 'EAvKnAUTjJ6g1/dS77SZg6+At3yst+JmLL2pIB89L0gkkPUhIV2rNz30FB6m39vuOkD8DpMA8rwNdO3LFtYtJaS0Z8lnlHQfSe61'; +moduleBuffer += + '2apTSWpG1anYobTHoNBrEVciS7+qgnjMCNkqVnsiGPWvPeCXCGZTBqn20L9I+3oHvVYPj7Q3GxVpEqJhHgHEvvaYwnjeF+o7UUAm'; +moduleBuffer += + 'Ovl+5Cu6NRCE23wrtHcLCuKfpMkB09eGZRLKWX1X58SN6qlrjUflViJnH2lkH4KGwj2a1UkP6vxyXlgkpxnn48a3tf+Gd8t2PHlQ'; +moduleBuffer += + 'sTS/0cHRS3iYppDiZ/oeUvkk5yH6ki6D/Sq/4YgiMR2CL/AbUV1HHTI623vVzIfUeuMI2SBAIyTwkXoEFCyBTwEPqTQi0XoWCOk7'; +moduleBuffer += + '6HqIiKiWycpk8ah/jpKSRuaH0LAVvk3R6E4PPaXL4WxDemQ7ytnwZRbI51yCwUmz7aRHVTwriuA+lTxjTNY9jesewMtiBIpvK2HP'; +moduleBuffer += + 'xXTjXpwWfVbv8R7Oxdg3x1QyqUX3iv6N4Wl2F+dB81F9EW3hIQLsvt9CG58h4UlSywjbrACh+HV8d4RHqzvIvJXWB473+h043var'; +moduleBuffer += + 'g4qlOZNwTK8IoenH5PdZjXF8RLNxfBSjjmmM42e1lDg+op0Ux29LlZHPaqeB42fp7PKIlsQx2s9AHG/39oFjznZMOw0cH9N64jhZ'; +moduleBuffer += + '9144hkKTOH6acSx7j3G8Q5WUYOH4Y8ax1cV50HwXju2+3+t34ZgmvUcVuXELyRrrcT41Dyny4CSafNKE76IsYzC8EGEYpTC9X8CX'; +moduleBuffer += + 'XqiQy3GKGKoniTjE6zCn8PdIgctuZ89EA0+RSA3YpwVyi9gMJhPhYyu2qwcLDSqX7n26MIqeP3ES3dy+v7fmHD65og121cPKdlCl'; +moduleBuffer += + 'j/WYTpmNJY1ijT2a1NEDy6J0keqzRkDU39NCPVal7J6rUjatSn2Aot5vNH4GoGL2LC9XdTS3gajaxzaBkX/pleR5ogLj93YSqdGB'; +moduleBuffer += + 'Nr3pceZRtZD26tl3HH0WHOvFm3EcbS7gmnOpbj13O3Getv6idJlqE6TahJM/XpNVkwyPKjYRo7PRYnRe+IFkdIjD2ejkcDYarwej'; +moduleBuffer += + 'l6rOh3ab8rSxsY17YrPQlRf76p7YbHSNjHXtic1Bl4hduCdWiq4hsYv2xOaiKye2eU9sHrqyY1vUPbH56DRiF4OzDJ3h2NfAOQ6d'; +moduleBuffer += + 'gdgl4ByKTiW2FZx+sqaVcVFMZ8cluIXbBXUV/vjHHONhxyWxwFahQ0zM2xXDL9lzivXvQmCeWDcAGyEsKDLFiF4wBmztivlkIjt1'; +moduleBuffer += + 'LCNZCwCZ1pWM0UUG1qYrFrQh4wNjMdSCPMyCPHArV2g4UMFWWLbb98REVyzLyiZ8BMYuO0jedBtq2IoIWUVHrEoR2GAXgJcxHhHh'; +moduleBuffer += + 'SoXs7AZWapxVqZFWpbK3imGYe5To5iqdhXUb3rkndjbdlMYXNwFHLWOZPerbz+6rLpHurrIIk99RcfTm2aBGWxGGVe9hVosQdiyE'; +moduleBuffer += + 'ZcgYnxjGLTLs7FFsUZnVovFWi/K3ipGYe6QYTfXPI0roEpdw+/Kwodi+0YAGoA1qZCzHqkompg5sdbazn7udaSLDKnOQLLMrNthO'; +moduleBuffer += + '3XcfdMXOsV25yea7G1ZgRUSt1mdZ/RLAlmV0iYAVExBZ3C9RO/sEbMJ8q47TrH6ZuFWMx9zjRQH1CxGEr0t8jfulQORScFBErKyG'; +moduleBuffer += + '3Ty7qudQmku4B88RA/CIpwtGZI67F6FfMymkZy8OsKlFDCJQg12da3XfoJN2n93RsZjtmm67hiR7zt0nk6yICVbHpVtdGpGTRMQe'; +moduleBuffer += + 'ViKdu3SCnX0y9tU8q1++aHXpl7aKaZh7mphEjSGKDHSJi7lLo2IIBYfEMCvrELtL7RpNpzRf4y6dLmLk9TBRME5s0uDeEgOFoA4X'; +moduleBuffer += + 'WldM2D3l7nAxvEsMcCMFGBKY9XqQcxfjoVePD+w17zj7PjcFFs6zXVOSne3uxjFWxGSrr4dbWMC6xoZhnWXMAGgBZZ9sZ5+KbZ5r'; +moduleBuffer += + 'daVpYWHBVvFFzP1FMYa6h+g/0iW2MBYmiCkUnAFDXWadYmPBrtF5lOZixsJ5Egs+iUDCrt1UOVAQFyIbURXsinl6DGLuRTFKnCWE'; +moduleBuffer += + 'xJQ9DfrF2V2x7B54O9v281A6y0qN6IK51TGSBvVA4EDyj7K7Kcd2DUqBOn8KJA6xXZNsV2ESV24sjLUiplqoEhYSsSaxLKyRjAFK'; +moduleBuffer += + 'ZSROtbMXYXtKLUzELSQu3CpMzG2KsdRzNOIGdInNhMPJopBC+8P8IHMW2ji0K8SDcAvjcJLEXUCin2gjOUEwDv1YSj4iOgQ9w1iP'; +moduleBuffer += + '5btHG3a3GCnnS08XLJ0ymhBFiHahN5uCzyZQFpbFCDHaieOz3DjO7IXjHmtOHpBSDyz3XkZPhXlfCswnh+8U2zUmiWA36r5gRRRZ'; +moduleBuffer += + '+DUszOO0HRuB07eMSRcGY77Izj4DWznHwl+xhfnyrSKOuePiC9RzNMoHdomLCPNT5aAeJoZbOcfYmLcrxCjeTIifIgdvRNLM2FSD'; +moduleBuffer += + 'F/kLMRGpIwM6hkkluco5ED++S+Tj198FHIYL8chdiIIuYjaQLmxuJq8PukhSBBHIyQjh7B6EYM/qQ8U5zqF/cqLIP02iSLIjBbYr'; +moduleBuffer += + 'YLsmppgiCm3X2CQ9uDF9rhUxwyKHkRahDEdUD+0Sw+0VAMYWZZ9hZ5+JvTDbQvcii1AWbxXFmLtYnEt9RzNJepe4kAilSE4cWTDh'; +moduleBuffer += + 'ypxjbUKxK8QkcRERSqGcIQZIEvuCe4aYyNMHFvIlpKb+0DFyhrC6RXJSyBSJabxYA0dl96mTjqJdxH0hHUXddDROTHfQVn6Stk5O'; +moduleBuffer += + 'U3lumrInrB7UdHYvaurBI/TjRcq9npyCYHJTEMy0FPNJkin7Uq+ZJTlyu2JLbNdS27UsST9uylhuRcy0yCfbIiwNSQNWfc2KGQeL'; +moduleBuffer += + 'M2WfaWdfYcWNSuaSIQK6QZJNCfUKwQuLEpuGKDi2Evs0DMtaDPCwSuJjtfz+l/x+WX6/Ir//hzIhEUXEOGSXoW5Wadlyssq2C2Kk'; +moduleBuffer += + 'nk+/F0gIFfK7Rn4r5bdKfqsJylD4Pxzhw6Cy4EdkTMSGTyGxkfS7Vuavkd9a+a2T33r5bSAoI0S6GIHwYXa34A+VMUNt+MzCD5X8'; +moduleBuffer += + 'EOdvlN918tskv83y2yLHbhbM/AB/oBzMNNBjzOCMkEnHyu+58tsqvwn5bZPrxQCQGAEUT+0DZGSW/A6R33b57ZBfLc5sRkD+x0kA'; +moduleBuffer += + '5d9hctzjbyf9rqffQJxZSzK2xxMBTAD9KY5kpdgG+iVZWaBqAj9LCTAPZMRZRsFff5xlL4899FlY9lA4ibBeXom6YngUBay8Pbx1'; +moduleBuffer += + 'SuN1TwJed6DeYwrQ+0okF52UaTw2IDu1vccgWVc9WfOT5U5mHm9PkX1mtLnWJAhbuBMZ7vnWvcVjAfT3BVacJ8qSrLHkEXpsFTGK'; +moduleBuffer += + '7Pb3BdbmtJIFbLCD7NWhv3sV6VHtk5Tk66s8MUnMd+wgoWwqJpwKMu/jJHu4r4JsziBZ5Ho7qDO5ckrHMMsRO50WnqQKgb4qIqaI'; +moduleBuffer += + 'eUmGhWRp8cVeqJt8qrIEj+Mkh9xH0ZrdYLvYDjuo3Qqy2Qhr58yWbMWXenSG1qMz9B4V9PSo2+l3TqGY6+gc5HLEguQKySULs1d3'; +moduleBuffer += + 'Tf0su6utd3cl7KBWK8hm0GyecoTlsIRJKR5oPfrtDImqr0rH0ihFmlWg3YYLiV/0iiUpaiAW9uq/eK8hVtSrB72iFEvtOZy4VoL7'; +moduleBuffer += + 'MMmH91HJFhuGXd1mO6jJClpnORoth71TMdRyWLKbWPp5dHRfrYkFefmzKmA3ros6Pg2+yOIHxbLTqJko79X9xb26P9iry9PEHKxN'; +moduleBuffer += + 'T2Ll2oo0F1H3WfkGG4bdjHo7qM4KqrUcNZZjreWwNxisHUlig3FD73NGSV/tY37EXuuTzf0qoSgIX0RRSCyK4w61WP4f0JBY3AtP'; +moduleBuffer += + 'Gb3wFOqFm6CY7Th96dEIPkaxUdFnm6ptGHbrquygSitojeWosBwXWI7zLYct5VsdIGZSgTRhjPvcEddXc5ntTPJMdus3EiJD8EVE'; +moduleBuffer += + 'ZiSrPsti9TVLEu8vVgCQrSxKsKSknWmj8IygB2q1XqjN6IXOkJjVFUsuwe6GCs01FK12a6mQ/X9sGHZDv2IHfdkK+i/LsdpyrLIc'; +moduleBuffer += + 'Ky1HieWwmVp74ILMB4Jll6MWNEOJzx3jvfrAgXsST+KKzX+CMyPpDCWdwaQzLen0Jp2BpNOXdPqTTk/SqSedVofz50Kiogvjn6iX'; +moduleBuffer += + 'XEhylnQOsJ1WuqxkyMccMrBXmhG9QtJ7hQztFTK8V8i4XiGiV0g4GRLYdruZ0xHbKPrf3gojaHNb7KsifHtrAt9AqGKjyIDgrwpB'; +moduleBuffer += + 'IXkUEqKQcRQykkKCFDKcQgSFpFHIUAoZQiFeCkmnkBwKCVDICArJphAfhQykEINC/BSSRSFhCvFQyAAKCVCITiHDKMRDIRqFRCiE'; +moduleBuffer += + 'H8Yd9MqrBuC7VJ2uFIhNfPMg5QXWB4Of7QVW1HP2aS+wjuh5GwPquZquY7yiW9cxtsp3ka6m2JcoZAW5bpp1iWLHYeclCs11TRQv'; +moduleBuffer += + 'UWjOy4K6eQIVga2mPn3FriK94BR2TRW+cYM3ZFVbDX3AaXMntAIq6rpti4rqPGbYVIzv+Fkpr0ZX5OlCLT37tW9dksUnxWl3SZGl'; +moduleBuffer += + 'qKFVPRRBQzXv9koVzlwO2kjVjXsC/KQbb0vVgv83PmrSc3grTZ+ubMcHf0elISJWHP3lHrqgIfUPEfJ23YL8uIqQf+SA/Lhq/JYB'; +moduleBuffer += + 'P4+AKWS6sgs7ebvOwFl9dJ4ib0nilX+tPaaY933/UdJTAQ29/HvsNA6nhYYRFmbb15g/kHeNBN28w9tIeBnH/OiVRxVzovFWUHFc'; +moduleBuffer += + 'CKc3rZlZSmgQXiPawubqG4SyELPXmeqs3NA7qupLPqzl2zOKpWhBlXqcEUt0efNvZKEuEGXTw6ylhNxh44dpSogVAKBeM/PDW/cr'; +moduleBuffer += + 'eYoyVUElDu+AZ7Qin4CPhD4zw6xny8t6tjyWCauR/G5c6GjXCe9WYxflkPkyNO1ENKXgczoF1cdgCL4Ew0tOilQfo8kL3jz08eI2'; +moduleBuffer += + '6ZeyHu8OUfhdA3Z7zwft2HGIEbzNA67RqMRlTxfqcqFbbEYxdSOiYZZns0TBtb4Sr/CEQkPlVTd6u+266AYhydgnAj1jnwjwxTRd'; +moduleBuffer += + 'jh6u/BbSdSVz0SvsQdgzvnbzvAass5ndQOr+9NLc0GBZqYVQKU2wCoG3A1SrEX0QB5FGiXLqNL7TSDP7NNKETyNNKdub41tsbPdu'; +moduleBuffer += + 'QyKpbkcqYuCrcaNoBNnD56P3D1nD59m/HbKHzxCFLcP1L7NVjPAzbeOZQGgYlQVoiKnGEsDmHogxlqBigwTSw1A01IcGDJAYlG7g'; +moduleBuffer += + 'iqCyF26NK6so1p7jxlov5pNmpulRu3nLj6Gd18CPNdJjSq4ZMTOEkot1s+4I4v0yqa2cbCThlT2yvRc9aX9Rb6nymiFS1luBqO54'; +moduleBuffer += + '3SAVyNCFRiyYjd/9+9rDiuk1LqRrml+7Djwe40KcYbB6jm5GNT2K1MoVypHRWgNfjESdGxTxc5W7DxWAzfZsdloMYR3tpDU+wHdY'; +moduleBuffer += + '84CTkjrWBF6cnK7MxzWMzLRhPGrjOXr7QQUf8lLAZP6Mpbu6gp5cysuvY+uNV2CpME9AcrOQRrb5FrpvuuOgrZqHLuLmudQyCTQe'; +moduleBuffer += + 'SOp5viykGQ+vqYRCg5lh+NiTHJvgaaUZQRKjQa84zX3feFQx9vttlSBNoVyZIBCj2TzcwHOKUMtykXwobr/GkYc0Z2wP0HuPOECH'; +moduleBuffer += + 'EfTwkyCfUA+YHWrfxGSLlC+xejx5/5R0AwHmcbyMn5UgdQs0seUR56WQVgaCM1hWxBNTeYgp9hB7N6imycGooK4DD0wxHlRh6kny'; +moduleBuffer += + 'JQpr0FPosW9SyT8qzNJZPwPQ021kFCYcoU+Ejft5p5KhG1KedLUPGBB/yKkuH1OmwxwQY2OQ42bRU78XSfegar4BFEeqQ8x3FU7w'; +moduleBuffer += + 'gYz5F3xJWwvPkMHSCN6GDvYszMCh/hdcUo6/fEAxdeNNHRAR8YUz7Ij3nRHecLod8T8Y4ZERnnBERgSMHRSi4xM3VGYgdWvQwPR6'; +moduleBuffer += + 'uJPRGrDHsgTsFXqIOg+yQ6/6hBols8HoD7mNtEHYH714fR1QWuJxv8NH5RfQUwVsHYY6/EU/hobR1Ax0uN0ZCyOoWDLCnaFzZ+D7'; +moduleBuffer += + 'NdWcwCkC81hpLeoOwqeq7sTX+MLeEKmDzE4Wko2GlcYp/R2FqNQCel7ZM61CaWNIlISuw4g+E0nudWV2xDMYG/8NnQzVAIlCVbTN'; +moduleBuffer += + 'qEs0yY8gZGJuUWkxAbbMLNB7qwgt8F4H+nXh59lPPkJMwzaTNU+PrJgzn0hARWahIWJp55c0JWGdQpJDIb1DiDDUdIpNlGbxAqh2'; +moduleBuffer += + 'RJdG7yIwd3htc8mK8Q8f3dLHJ4p0ad/DVptRZZhKA4UmATXqw1eU/A7BNXB8zoFBhhflQDLxyQO+tfTQ2NDw7dW/qAH/RCrNM7e8'; +moduleBuffer += + 'Im3fWAPqZTlA/q3wkBo7CyjWFzKRFN1jJBJi2ABwdoS0ovnwzSbh1mPFvQhxqhwBmt1SRbZUJTuBLFxAZsX0u6qrW9XVrOput6pr'; +moduleBuffer += + '4quMZPFKX1OJ3nsqodbC5AHodwxOmgvOHMx0eu6FzSYhyfT1TOgNmYFe3UfPNzJ7hmohtp6lspZcNSRFORBlaCViM9v4EBQvzlvq'; +moduleBuffer += + 'p2gVdq7uKr4Txol+MC7c+5EXUsmxMJcYRIjlPKn42N5TPt3Ox1cCN6fpPpCO1Wbzvr2HKUZn5WT8zK+nDhAiSEUCIQU/rE7P1JEq'; +moduleBuffer += + 'eApTMJu5n8EBCTzOrqhGLn6pQc9gMgNsK95IGt+Jeq2MrNPtEHg4yLgljXxsJh5DiPGisKgO63oUVTETW+Ul61/0djMqzRuFuSch'; +moduleBuffer += + '3WyuL8se1CnMidOqR2YtNTIqJY12aibrB6d65zC3h9ZoXoNVmqbyuKcQ5ROUgd6GMOPagBLqlfql3/dOfciRmgmC2oJ87AdpWBNg'; +moduleBuffer += + 'oUapRno0gKouFRE4S+Unq2NxENcbVwRxyEGKjF4pZtArSkhBwxeSGL2SFBDfA9IsJMJlBHVDe0OUOLNX4hzUHBSijRI2/VsgvzNY'; +moduleBuffer += + 'x/TsiNfo58qFXNcDAWZ1qT/JgrpidyeBnSzIHHEBzbCjgTr9ctvEf3tU4WWKJtNb/EJlUVOjTNKkD+REYuSXphrq9lDNfc8B8+Qz'; +moduleBuffer += + '7kmDTnDaJiKz0qOwYnm2awa7jFFcc41qTg99HwiwoOlhzilgWTempzq5zPXzO2CSi7EqQ9itoLLMHOGhIR3VUHW2BoR/ObLaUdwv'; +moduleBuffer += + 'ks03h5A2blJch0Ea27ifIfu1iGI9GDQZnQzlSoZCCxUnDREBZKVAGOIqpiGR4BQASEIAX2cAISYgKimPStLsoJC5RTMmMkCPxGWe'; +moduleBuffer += + '1CQOjcFJAs1A+c19OBZxLFOYZX5d1APL+xCTMcahU4r7wl+o5wDC/Lej3jfWApNTb3oSNMzYhDm2SKrfIrAozllsLIl/sIaTxB52'; +moduleBuffer += + 'crKKNa0lhcX+xAxPNgeSfIMtuAJCUag2/upFY1JavXED8nYvkL14nDqxn27wCvtlL3iP+UItrGfP1kKpkTpntpLFumqMx9JQCU0O'; +moduleBuffer += + 'D3pD8H4e6g0Ps5yffIAmpLIwUlPVgBo+yDcvlxTW8I7FAFt4hIr4WzvZahgFmwU41YPUiqtkbr1xVYCCYSbf6tiFAE8om4M7rdDz'; +moduleBuffer += + 'GoxOS+65j1lQ0yk99Le62dzKdueNZ7VQqB+HWjIgICc0wFpJaFzAOCPhUeb39Mg/SJqeL4iy/roH/LyPWGA1kkaM8TsfrfrK7FAu'; +moduleBuffer += + 'P8Lftw1mxhdIvIXGkh2BgtBAKtk4J6Za9uppKrfCx5wkfOxJwsf1DKcu06ahZlMK21OoM/lJrKI+IJzAUajdj3uRoYEKIzbgWKmn'; +moduleBuffer += + 'ynApJLmeCM5iAc9eJHutEi98eKjXKvEBhMlVQpo5hAY0kwfmFx72Gs5byXA9VThME+OjKoer7vACd3gBvi7cbO7XjGfk00Pem4UA'; +moduleBuffer += + 'fhKPOouu1Ow3l1aG7T0zbD9ZhgGpNiBCoVd9qm+zSyQEsmuIkQ4Bn7kBeUhUy+5D3WP+XKHWI6X5iTc6m2zRlOZGVOaYzTR6r4m2'; +moduleBuffer += + '9dRYgLj7NBRNjnzyVRB4TAOcoXoAid/SXGTJLaFhi1ZKmqU8idIEOhrMi7cEFiZASiI9IAFgVYTHNjmLQojwzKN6vHUfzXrIbPvN'; +moduleBuffer += + '1ywPmSBAc5EamS3CZvgE2eBWSyNoDsRnvKRSQTHdNEpRR5BgvQkw8BOmluC5U2PbozodgGANYmz23lTlkYhu3M8MPEPKmAdLShjt'; +moduleBuffer += + 'RHl6AqPcqtzQxdzhUMh8ietr1wwfRFugykidrY8UiJ0UiElMGMsy2AJfquqrzupb6pkRxEWtqD6Reo3GCtWHdbsG+4DH3eGnLnb3'; +moduleBuffer += + 'BKxjx1xNmhcB5l435qLATouk2WVuYP0UKhAUkBOghqAiiNJc1AioGF9XkQ2hAe6IGMz5NESmThoccNMLqFLLrUf5k3bjRNq8XBKe'; +moduleBuffer += + 'vg49gmqgzH8fO6SY4827/nBISjwP/YEC3rYDTpkidVdojCpVYuKY3YtIktIgIrEaIWuGxQXOPHHHAZwu7vDJGba/rekZmo6WI2Hq'; +moduleBuffer += + 'zrAWAVPjgQpLIs32tFz+Gc+fjvl4pRyQXKp5dUA9McHk0uIIbg1l8UJG6xN8aYkzWCzgjXZcxHsUfQsEGQopVuLiMU2WQkpvhLIn'; +moduleBuffer += + 'Li6Nq1tx1h6ksEbSd68AISHk0Ehqx/wDY9KdMVx73CrT5GYZBWckl0DjKj+VbzVEaTD1TgqA6v7AXsOcOX7gCVFLaZww20hnYxhm'; +moduleBuffer += + '6yulgwwPrT+SyYHEksN5OsCqWfC0i/Rj87mBl5Ydl1QGaxptE6jmxWgTyITVc6yyRTN/tnkubhKA5xMVPPNh9tPIwh1SSDZ8cHUz'; +moduleBuffer += + 'SUyFNB9jmrlAiGi5rH6sonAWlqjs1F5g/47feFiKXH5kfikBHvpqpTE/DZQE613Q56Ee+RKMKaMgqREbGXugXS5ibi7Kh2i7Dtsn'; +moduleBuffer += + 'cKjFtFLa3YKKoOViHeZd1ptelgtREdTaDQw7WjiDsdcQpVM9CxpNx2pD1EcbK0LHVJAOz6G0hliaM5UmU6VRbWIEkEpzpdJlqoBI'; +moduleBuffer += + '4wSwLOnOBB6ZQOcq+U0vBGDZvnrgmjX5Vh/6QOpGsWoaoT0HCJ8d8dEXVg+5uUX1UcfiGYKpzPHQbpdqfqk1im/rh7eiYGueP49s'; +moduleBuffer += + 'S/vahS/BcgHytkCIU7WRjFPUHIcWdn2o9YqytpSSknPdDLdjHrLX0q8d1uLjSism1+3kiZgirb/4Qox6AIqHVbA+KINNXNC3GOSE'; +moduleBuffer += + 'DqFDLFiB8QyDyDNPkCoB0ufpNclahdc88a3DJHt6495CkFK9ZKNlD/FUWwSM3VoKMpxBF1BQngzahUErKWikDDrWbyua22aLiBy0'; +moduleBuffer += + '1wNBc8JUbTw98eeykRida7Fvp1ULPWUtVvauRbmrFhK+l1VikAFA46k00jLu4SJ22A31pCzigt5FcKlhZxFcasBdKm4ziYD5GjTC'; +moduleBuffer += + '+BvuF3mMq/msQKVLA1ZV2CAnisVeUgRFXGR/TW1WNxvTomRIQ0VDGkINZSZnNTlrZ9pHoyRSPReEydihUon0UoRuQ20umtws4h0c'; +moduleBuffer += + 'aLRwiUtkeZNlJs3W2a/TxjhOoWRAYSTZXMaUAVzHaCbRme3WBWXWObPOCut1lqNImwnOPE75CfmJyWxafWQ9m7QYK1CDHdnZAPBs'; +moduleBuffer += + 'qF7QjQkvHWfrZFBZYY1F9SgXoGlLSonzDwBx6MCDai7kMYw3EhR5fq1Ja3rkJwv1RtJPh1gBy6+ReMsaqgssOUA4xUNTY3HgxBFr'; +moduleBuffer += + '00grxE1FcwSOJfqMFJSrnuVNRVpBInlcyL2op+TuEoh9sDiozBEjT/NLlXe454ZCMxRaOVJGIqNEtwEa8MhVb2UfLttX6qgkmxY6'; +moduleBuffer += + '3OW8QcqAOMmam9ukvIqxyBrQAg/cQaZcX+l8XzVuUCm98ZjH9NfjOoqScPy5I7/65Nvffe7Pf2cLE/Ef/2Lr9quu+cmOQ3gFh1fN'; +moduleBuffer += + 'PF5Gd3/9AK2khsWKPOUnVkQu0DbhFofSsRjWN296Z9nej9F43ixkMVAcAKSZ1118EDWOOYM+uIqDDKWHKEcLCtKLMJ5TXYMFqnJN'; +moduleBuffer += + 'mlULuScB/E6mOwBG2ER5GIzXifDGyWloZqce+6FuCmhJJ/fw8QA1bIs6i8p0KkGnBNTpZOspm7v4iV88+tAjv//X8Rs3cxff9Nw7'; +moduleBuffer += + 'd77w3us/3rUZu5iSvPPTPQ881f3sh3+UWDjxtRsfvv7dnx/+CSXJtC6yUDXpWBszvXDLbZfc8+ozL3dxnut/8/KOR2/478tDmMXB'; +moduleBuffer += + 'NCW5P/ODP7sOMA033AupIOLI6EYIUkwmdJmctkapNHFFLPTfEDCVULF9N8raTobSbg/SaIzRVBCgvWDz6M79ivEeKRI3bvbZG/JI'; +moduleBuffer += + 'xWukoQKSPZNcvpPHl5Inc/koewKjL4UF7TR4+NAbfi20GW8aINOj8uwp9ewEzKLGaJjYRZygoBphVsZMFk9DeOZq2fMMjEQjkg5z'; +moduleBuffer += + 'KWz3jGyb/EZFlbIGGmEn3ckxv7RtYqZBix22TTxO2yY62zbxT2WrX6RYL4DGQNIBTACNgXgYTECkozGQABYWsI2BBLAgj2XbBCrE'; +moduleBuffer += + 'FkfDJH6Rej/jXlKVTEqqLbMhIMyYpHt0cu50vEVh23KCmFA9K/33S7WMaXT5Q1o1cdmO4VNT6Ay8twQNRINdXG80HmbZQtG53nRk'; +moduleBuffer += + 'qtv1dllLIaxiOQ3GNQFkoDx4aqgnLY6wsRS2pkJgkhZHPADeZU5FWhxJ2vShVs+OqD1rHU3jHmMjVoTCF0iqNaJBbD/mjHAN04Cz'; +moduleBuffer += + 'D0oUppH+7yQK07Bk1AcboQr4GYXurvCfsiv8dlc4zEnc70ndGf5Tdobf2RncCZKMvIxEMlntqScV6hKul7aM2RB3zxjL4EvqmBCZ'; +moduleBuffer += + 'Oh2ZzBvoBZXyEuUma+vl2nIK1CnLtQ3x9TaWPxFayIbmFWGzqAHHqllUT8d8dMeTjD+FeAc7XYp3eIPzKm/oQVSzmRz0hn2Dk9iP'; +moduleBuffer += + 'DCfXpJsZ9XaopW8T+jijHqnby0C8vP1Eu0u4OHtRplAW0DKNo81UgIT52ARRGmE+QbjM8ljowzUGGClAs7X/nrSWRLvSuckTRJrG'; +moduleBuffer += + 'nTdbaEl9mVZY4/mgPSfDTHOPJxSmbU5WExqS+soki2Ct3XR51vix2iPgEs0JaqeejEZtsZjeAkcGcpn/UMwDil0U+Pazz8EEYBVp'; +moduleBuffer += + 'qeTMo1Qjlmul3q06896hOirNJ0Jl1B6c9PEmoFUB46GQCQtwDm2oytMlPJgBvD8LDBqVzkVNwB2CdKsX8MAX+SjzGTSdMkbw+oDR'; +moduleBuffer += + 'o3WO/pMaekTTNFwtMAsq+fUkJw/rGgSqMwPqIeOasPy1krVOzo6GXJWoop9H8rH5CRqIuN3MQNM7BQnoyt+QwbRgae50YlWB6cWL'; +moduleBuffer += + '8cZS+PFsi3qArkJ8bn1yEIWnhEAyI9ryuVjlhXOLah69GsSX9zx0FqWax8BnalwAJKVrmsZFfDz2H2VNTr9+hdlTRJxxGI2a3BzE'; +moduleBuffer += + 'PlbNXdv24+044GDOVTW+1RWlzR9ae2kvSjV2I195J/IQrCQbl2BLSzTeV34+wJC/j5C/LSH/8GoL8mQbMu/rkO5lVg0O8FS2pYhX'; +moduleBuffer += + 'FKxb4ggjbG0FGRd7GOBDN1sAQzSMQf56IWC5w+imSuzGStwp23qH9GxSdXlKhrdjo3w/tue5O67Rxh7iiOqtOJh1MCdff5W3dT1e'; +moduleBuffer += + 'PmCkMzBUw/sRyhm7cC8ARCScS0LGW37r9u15NGugfQLNqWZZo81FvrtJU9qbeBLnoTtreND0Pz55vhp6yCf7jyHgNphi0b37v0ms'; +moduleBuffer += + 'nTxTaEMVxGZgYS7alwqomu7x+vx8hqKRrFTOhy5fhs/+f6DZwZXAs6qFWhUEPEF3ErFu5zWgPUJ0HVXoQiLufsCiYbyQRkrAJbAZ'; +moduleBuffer += + 'UsYzrsU9mV+Q+QjFfJLB4BqHxRyxi9GoGBzjgUKsCESicc45zoKSpTuK9FOR4xQP2mVgMZOL9KUs8USKEo0zK9EXkuItl4MFLE32'; +moduleBuffer += + '3LZ/unsOC8gpdMAqTxbgAkv7Jhptic4gMdYqYETKhuz4Z++GiDNriEdeyahN1v64DdVT6E6MF/LIzudptzrvdFqt8W73GYAtOB2w'; +moduleBuffer += + 'akheeLf3brBx9KDhXLzPTIuGe/ihiCaHX6DeDNjDD2eN5Ng7qlrH65S9QA49okB+CUDU6J2u+BlXQ+Bz6JuH+UwTcYW7FJpj74r3'; +moduleBuffer += + 'KvzWvp2ylWRFqgW9KkpKe3jR5AZVXo9gyFtusCCrvSH3CYb7HVqUnFd/pcqFfLTmQQk1bLFqxhv+0AFNDUhGTU8+LGEGOhDDPSOd'; +moduleBuffer += + 'ZlCYAN9W0PANsYA++NyGWqZBWvPo8kpKLbJtaN7Uz+8qmE9XkVXdgTcrblJtW448E5Opst+ouGNsmyoj3FqmyjyUyDJVpkmTjXna'; +moduleBuffer += + 'LjWqMS9wk2ox2Cof/r+Ga7zxEhmXnBwlrr6ALXWjCaixltEzul/pk1XUsUk6bYPFvBGntlvPVOuxTxqnJSwhumlB5tcu+ZbNNIvy'; +moduleBuffer += + 'mIPVmKklDiqj3rg6IJcVayUrwuX0uOqa8wt6TPmmxhM9bsHjTjxP8jpM8o75Pcx0g5tmW684IA/wgW6QkH5HV6hoL6meCErgXS9+'; +moduleBuffer += + '+oakL6cA1bwccpqDYdGloSs0F9jdPcE+dRpg6Y7PXgSbzRsnTJdvpB5pyQugxC321cibrnn0P2zkbZATuNnD8g7Qk+gdhV41dW9e'; +moduleBuffer += + '26OgHeopC7LbeY1qsSJRpQf7oUv2A/X2AimW4e1pCPdKdoxYKKlf2tTbedA4WBSPg0XRbRZFZxbl8p0HJIsS6M2iEOUFYBIEHurS'; +moduleBuffer += + 'VHjgpUrhC3l03RG5lENXHObLDEj4dH3QHGtt0w/fyncvFfu8YD8GYd9otVZv5dTT40bXBpfVT2nUTuMRLTSDhoJQLQEUJx1BB4/E'; +moduleBuffer += + 'kOskXKJ9BDTHTUdCMF6VCCrt1phzvG3PASfniHYEkpyjsDhHk6zGJT0nyPM/mq2tnY3zBuyOt6+pg5hJgP6m0fQY9fE8SdbUaI8/'; +moduleBuffer += + 'zCZmfWwW3LAMvlMUPyLzmkPqQUSl/vQKL/FF2WRPHhWbGwcDpkqPQkDWjAWQbfYkTSPH0tCQMW50oVku2tiwHiSi7XK6Ymb7DZZ+'; +moduleBuffer += + 'bb98sCj9HgatAz9C6tBx00uk0clBxIqFMRMK/edlhNiCMJsTwW0d+ejLO1rLxuRefl4ZtHY1vxJ6za+G8FhXoV2+43bPP56RPHTQ'; +moduleBuffer += + 'MWB/RvLUgQL2ZSSPHXTSyE+uvRkQtx3tBxq3BoQe3yWvM72UjkIeH7s8m0523/aicb2j6bitk44CgsYoPJpeb1yWRjT3OJrTNo+l'; +moduleBuffer += + 'W89uaCfJk2w7cjgI6WhGPVur10cDwEKtCCMJp8Cj48gq5wIxWQGvPR5dHoIuxANXEi+QOQSqKUBuo72e7x9TB+Mti48DvDwruBWC'; +moduleBuffer += + 'tBX18qnRUTI0yfUGSr38IbYrAknKo0Sz83lOYFzq5g7oQ0X2IRoCMHc5AvIwYHcyABqkbDeAs7EkZHNLeDadW8PKq9Q7jPLiodkx'; +moduleBuffer += + 'pd4uq8AdqaNdXaEmvcfRPA+wEopurQIw7vjBx95wz7xHyVITfMkOH3wjaAmBMBhNwy/4g+ZHKjEmRKMemELIGBUUHHGDA+GytRPk'; +moduleBuffer += + '+yisB1EFr33Sux5ZOJKOwpWIackaAOpieN5L4Iyv4HaSDY8uIQM14+GuAr+Eihg+mEH38QjlNGpdefBE3RPWvLLEMAOORZAZxufX'; +moduleBuffer += + 'oTYYj2y3yfhJWsxrfC2I258oTTQI8vnp2g45NbZ1FBHh3rhQ6L9Q5MVcLg6ZrGMwzTqbhwKv8RV6FCFxkMQVzWr4hIUSMvJNtRNS'; +moduleBuffer += + 'NNYbtQS9PkrnOJiAM1INNHpQYk3476s0MdPQv1WljSBz32N0Secvemin5rYk5H6STjedEu4n5/TQdiwUOrbe2Bqkuc16367bb96R'; +moduleBuffer += + 'yqULP2i/kREuZuGzI4eXugcFXXnzCwps5cv0HqslXisFHrzbVp26qIbO1/Ff+jod/Dofx9O0zysj1QnEFvajrQyc6fTkM3Nsh/RL'; +moduleBuffer += + '4zH2lFludaFqvKTxOgcyk3GLnkxSSfeAnbeK6cINPY6bdCY7Foh2U+F1dsf3D8p1Nszr7H7NXk8D5j7V4dnr9DxOyQjEXXdYIMi7'; +moduleBuffer += + '+26390cu7+P3gTdie687AF4DvRGGi/Z5kgs9sTfX6FqQCeiYh3aanS/OAnTgaO7VG3E4wtjaqzdJMP9GrA4hm5V87M64yk5asMc3'; +moduleBuffer += + 'XzHcQeZ8sTTjsQCuNx60/kqrEB8tReLiskItgFa1d8pX9j6UO/D+HkxYfkaHF2naj+Isld+IVvFoJcYTuLdQ4kKCFGR82Pg+CkGQ'; +moduleBuffer += + 'CucI1diNWgzDxj6UrfbqOCl6OZruu0EqAJWGPFIa8Uj8ghwrw9ajeIsL+VF6eRC01Q/ocoHW+aTQw+2lozUdhxlQD1fV+MhD5lJi'; +moduleBuffer += + 'FJhDtj+Nv6lI4AZU2jgahFo+HURjfR63SPrTECMLrTrvkW406fxIWmjbEi1t82BCnEp2Wunkx8StUbK+lWZug8VDAQTtl7Z+oVF+'; +moduleBuffer += + 'YItCJIeGsD/T+KIJcO0vqDBTAtd+BM3ibVHJdhK+BMB9Vlz88fA7zTwCRV+ahrdMTQNELL2drnfSVCDkC6Hj0vY8VibmH63nRIWA'; +moduleBuffer += + 'jxEdhJ9AdBh+lOhIrl8sgCkGC/gURQfix4hm46cg2g8/gWh//ORFM/CjRLOg5uAQsUihXgTurEK9AD4Zhfoc+PQvpKb1w2szqsjG'; +moduleBuffer += + 'qzKqGIgXiFQxGK/X0HUSHz9y8dKZRoxMRyp81wRtAHvEyPitL936kyve/8bhg0qXscWDj79FFPsPHHmxgVzyYC45wiVncckZXHJ/'; +moduleBuffer += + 'Lrkfl5yNJfvkpSOPGBZ/6smHv3PNNc/s/KsDfLYFvh+Dz2bwAxn8YAYfYfBZDD6Dwfd3gx8Uf+ayJ2+++NID3/mFcqENvr8FPoPB'; +moduleBuffer += + '92fw/Rh8NoMfyOAHM/gIg89ygxfxQ4+/8P7t37jsewOS0LMQp0XRMH4Koun4yYsa+BHRTKvk/wxjyZIz4/v+fOu3fvbk3junpcDK'; +moduleBuffer += + '8E+JFSN+464b9u585NCJ354aK8PPGCvp8dePfevr99/5nWPvpMJKtA+sDD8NrITjb/37ibtu/d5bf31W6YGWldEYfsqjI/AzBwYZ'; +moduleBuffer += + 'fM6LDkiNlmgfaBmeEi0D4o/86/03P7zr+o/OTpacYUHPZegZqdASPQ20DIw/8sqBO6879vyBfqfESi5Dz0iFlWhKrIyIX/76NX9/'; +moduleBuffer += + '7cd/2DGyqzdShvSBlFyGntEXUmLxV//08Q8f3vedS59zkFQE+38D46YF6Bc+tdHh+LkgGrWKzuGiI1z0kD6QkstFZ7iLjsbfu+bd'; +moduleBuffer += + 'a5+++4ZX/uYo+iRYyWHwEQY/5DSwMjz+9K++d/tN+3+9/RMHudloGdoHWnIYfITBD0mJlsHxJ1/84zNX3Pnx1a+lGixuvAztAy85'; +moduleBuffer += + 'DD7iBp8Vf/tHL26995lLfvTFCx1oQdiw6KhiJMMfxvAHMXzhmiJHMPzBDryrFnzjHb1XtkzOZnC2GGeL8opkoN15qf2E8uIaOAo/'; +moduleBuffer += + 'ObBYouIRWDpVXApHMkJOShlDT4MyRsbv/vNPt73x2Pd+lJtsvOhBd8JF8ikJY2hKwhgUv/m+Rx++6ap3dxlJ6IN60MUgF9kJF1X3'; +moduleBuffer += + 'SRfD4vffee9Lb+1781hGkqhzLejDGHquiywGuahOuIi6B1mMir++70cPP/aT3Zc6JoN+TBZDGIdzGIcIMZ0hhntPjRY8v0RmAQ4M'; +moduleBuffer += + 'XB77c7YizoaVHMAgBzLILAY5kkH2T9XBEiQNZaxXhPuqiBtVwFQ7h3vBQRGDXMNBuNvdP/7h1rue+PCKJz8Y19WbItJdFCHprR9D'; +moduleBuffer += + 'H8bQc10UMcgNPTt+yRM7P/z+9bf89BeOmcgmCcNFEukukpAE14/BD2PwuW7wkfizf//6n5988AcvvKSkoIlMF00YLppId9GEpLh+'; +moduleBuffer += + 'bvAZ8ftvP7xj985XP/ofB/gh3PlhxmARY7CAp4U5PL7P4xooXAaOZddKkZEaqwOTk9AIBhxzLcvDbcBGqll6YGqoMYY6gumuiBtb'; +moduleBuffer += + 'kKRoSSuGi1bSU9JKv/hz+1+7/Jnn/nLsTSXF9OEmljCDH+KaAiWxGCmJZWD8+M4fXrPnR1e++RslxfzRF7GEGfwQBp+ZklhGxA88'; +moduleBuffer += + 'fO2+/7n0gY+fdoD/D4glzOCH9Fzvb3r10W1bv77r1/sd4B3EIrm84VzAYBczlO2a/0ZwAbHUCB3OIKO9gGS4RozkeYZbk5LqAFKA'; +moduleBuffer += + 'khROSoM/A6qIxh859vI1Ry7+91XTku1OF+41Jf0/JYrh8Rfvee7NS3+z865zktAN4V5TDNeakn76NDE4/t7WK7d8+887XvclB7gt'; +moduleBuffer += + 's8g1JdO1phiuNSW9L5LIih9/6SdHj9/1i+uyk9DDjL4Boi92AtHldyDsPBxlyL8P4mHv4HliDCTKQAY5UIQvSTUX1nMZ60OSU1fY'; +moduleBuffer += + 'tW5kutYNw7VupPdc6z965fEHnj168MWzu06FdbnQhV3rRqZr3TB6ypnfv2bnH7pvf/yK8V1nhvUBrpVZLhuZbuhD4u88t/35wz/b'; +moduleBuffer += + '+c2nlE+F9gEMPuwGnxt/5c3n3/7JrZfc9GslJd77uzjkiItDdst7QxxU24PFdGeTDNRAzpblGEq9ucts5i77M3cZYe4y4zOgiYz4'; +moduleBuffer += + '7x97+OXH/3xT9+vK50AUkfju13//x3t/87X7ncvxZ0YV/ePfuvWJ/Tt/99S3P3ZM4J8ZVWTHD1//9xfvfu+Dnzv3ABxU0c/FDo5g'; +moduleBuffer += + 'kDEGKRzzS58cZl+Mg1s6Om0O89NSRf/4Tf94cMdf/tK962VHw2M9qCL2n1JFdvyT7/z95kMPvPE3J9cwogdVjHBRRez0qSISf+/o'; +moduleBuffer += + 'zSf+dvXNvzs3xeo2zEXSkihGuIgi1hdRZMSPXrLnqaef/MsTRb1owhB98wyfisEc7Nr3cYurZ8hgZjHUwYya3qSS7iKVES5SifVk'; +moduleBuffer += + 'MN968eDjr350+IHxKUZgjmsEGqkoJd1FKSN68Zd7/vTsTx985N7RSej2TpgklAEuQsl0sUFuQknvyUo8/7MHD/3g6b+dCJ0uoQxw'; +moduleBuffer += + 'EUqmiw0K92Ql9n33vesvuXL3/UavJcVgDPYW1HJTMZdONqNPacENxM1cOjnU3szlcJ6PoqdHEQNcFNFj+I2IP37Lkz//y617fzUo'; +moduleBuffer += + 'xUp9xhQxoCfP/uvnL/3v7otf3Dms67OniGj8xt88+NFTf7r5tlQs0qeliOHx3Ve/c/nvv/nDFyanpAj3dr5TGjgD5jLLNWhPm7n8'; +moduleBuffer += + 'tFgfFP/jfd+7+6FvXnLltM8B6yL+5PWXfuvuJ37w9i+VzwHtQ+Lv//yqB//+xI9++WIqLujT4j03/t2//uL+hz/eecNbvblLQ/TN'; +moduleBuffer += + 'XbqFhf+Quxx+5tzlyM+AKEbGP3r9kfdef/nYYx+k2tXOdO1qnzlVROLHfv/Sjg/eeeFXJ1z79RL8ANfOa6are06HKvrHr7zj4eP3'; +moduleBuffer += + '//sPO/+lnFJMHuDaes108W2pqSI7ft3l79318SM/u+n93tylIXpyl4NdxyOnzV26uQb3flfuGexfnpRlSMm1R1wSfEbPfn3h0fdf'; +moduleBuffer += + 'e3nL/l3vKSlOoPqiipRce6Rnv96w9cNvHHz1td+8qFz4aagiNW88OP6XK97409aLb7jkgAP8QAt8umt/8cypIiv+3G8feO2ZP9zy'; +moduleBuffer += + 'mGNrpl9yS+oU24y92MvT5h3cfOsp2Mu+t7uiSRoOu/a6010UfTq0MiL+2kNv3H319/e+PeWUpBJ27XWnuybA1KQSi//jXx/99Yo3'; +moduleBuffer += + 'n3lo/BlSStjFW6Wn4raFEX/1jo+2X3v42DX9PxWhhFPudEfj214+dPnF2+86EOxFKMPFabGXg12EGE2NTMEgB/UC0hej0ZO9dDAa'; +moduleBuffer += + 'wz8lRQyK//SVl7ff/uGNJ3wplpSwiyKGnzFFiPj377n1m7/b98o9wRQrSqaLIsKpdoH6pIgh8bt3vvb3J7e88Z3MrlNRRKaLIsIu'; +moduleBuffer += + 'ihiekiJy4zuv/OuOZ944uC+313nYcGFzEkZvTqI3ezmA2UvJnDjYy6hre9lwrMu92cscxvrQU2A904X1cEqsG/Gt/7p6x68+fvmd'; +moduleBuffer += + 'vBRYj5421jNTYn1A/Nonbrr0vvd+8PrEFFgf5MJ69IyxPjT+0L+/f/ctB3749IwUWA+7sD7IhfXoaWA9J37kW/uPPXHit1c+qqRE'; +moduleBuffer += + 'u5u5dG9ICNeGu+SyclIwl+5s7p2uXMcmT2/mMsbM5QhmLrOZuczqRRJhF0kMcpFENCVJZMUf6P7Hb9++4cNXjzganmX1q5vxcdNE'; +moduleBuffer += + '2EUTg07CRvzgo+v/+PS9v/hZyvtFffWqmyjCKYliRPztD198/t4PX3z9lVSsccRF0e4h6OYEU1NFLH7D3pt/deieS2992wafh/f1'; +moduleBuffer += + '6FYeFdaFl4UDgu7pBUjfS0DQTT6jC9/4BUQWenK68MlLQNBVP0HqyAMiQlf8wJMHHrrvV9CFNQ0IvhjYRbXn54sCtUnqXtZyodH1'; +moduleBuffer += + 'VLx3H8uKF10KONzysX5JPO/Srejc8pH/kngOhW7ZciLjknjg0q0YEdgmA8Cds43TYXjeNsoOrqJtW7eizkC6pEqXkelCtgjypUXr'; +moduleBuffer += + 'QmWaeUy1XuagEoGSU75SU/nVlpbqlZpqXn7to4p5Fj6z0ns/Ldvf843V6Tzmotdbj1/b9+ut7df1gHzjGbzeSl5V/bHu8PxVCz3n'; +moduleBuffer += + '7bMvTu8/PQ7EThpgvddOC4bCkfQMI7NfVnb/AdRvu3dCA/3YwAHo/aHt7Y/eB9AbRG82evejN4zeLPQeQS8qLAr3o4eK6M1EbyZ6'; +moduleBuffer += + '/2DHGuh93QZFtnPes73p6P0HegPojaD34pseRcMh4A2jdyt68Wp2mPSFXY3eDPQG0bvLjiVd13vQm45e0nf+IHrT0It6Ac1DN1kN'; +moduleBuffer += + '9NHrPBuUF72/s0GR2o437bw62THQWPn9OEXlJ7q7b+6hT2wXY9+8RSWNYqa0SaWberu5FRJbSsUcisb8/MSWruFLsktR0rOfQ0lq'; +moduleBuffer += + 'ypJOfPYl2QSPDwZQ3dbwVvuxsGI9Fmbafz3N4XlaD/1K6/MhZ0pyT7PJXT7tVN1j9q4He4zZH556zDJp3Qc5zSE2aR1F7zCbtN5F'; +moduleBuffer += + 'b9QmraseAu8Am7S+h95+Nmn9GL3jJGmp5msPuR6NfuNh8OalmHY0bsJLD/dowt7/aNrZ7tSM8ayXTW7d93Mo+4mfu01u9TcHSpNb'; +moduleBuffer += + 'yQxvpIV+qqEGHkKP69E1m6vCxzIFAo1IkY4tfmpnbuaHlrgGeY2v+6ynPPjWzFRnRUi1EesdZGXeBCabfWFtM92XxxfbkFfjl7wx'; +moduleBuffer += + '3XMe6+BAFUvgyIl5Ue+gVHuotkZQ4QqNLIQ1BEmC7GKZe594VFrWgn5Ee1mkCdCyl1VAriGSmLEd0I2scXXzLOhiX1kCbQFgxYqS'; +moduleBuffer += + 'MB+yYXoK0SiEnRFqgeZqwE/KjHAwSL099DQBles9HwgNceq8MYa7NY/LZ01FSmirV/O7bXCycrajPqm8VkdjOR4ybZSG9oVQYSjK'; +moduleBuffer += + 'ENi5aIaITe6E0eSOEtdxwVZIBz9EaJQrGPOZBbNJoZg0bZRWSg+WIi5AvfKTdlZ8hhsjTVcGakdFnUnCg8/jHGaFVKlhM64Yh0iD'; +moduleBuffer += + 'rhv01b1BqyEn4Bip4p6XG0VV2gUNe9A2azRIZUV99NjRwy9fPMIni475yXROwFm8CMriA6Z3ngjGb7z3jSP4N2hxwulb3cpmMVBz'; +moduleBuffer += + 'ZYwoMhgPXiT8VGxXNChfIRr1UR+a9+Ia+rm+3gYoEjWwBRbmRv3cG158fYNkGk3Tk3OYj2uEW4iz0VSYCGDNY25rTF42/eQ1Dyuz'; +moduleBuffer += + '4Pd1ZVYCMOwBqS9k/E7DCcUGY7yt8gM7y/8A6YBA/ehp9azj01bEqWgXkdUqUnok9DF6zjQ9EJfarCAiG1AQ10n/oHy2kyRcfnEF'; +moduleBuffer += + 'nNalhxRbGaVqvgBeUzMu5MjtL1mR5H3omMt714cOr2reBl5+ncVWFszd9xyWFhX+AHSRm6korNnJvPzqwzJjEF8EovvC0HVeNYDL'; +moduleBuffer += + 'BBl6ipFB0YZ58mVfTI+yJl2youBDJfHaYBiWXa1oa0mQUkJ/Az6fYoXJDVGdHuzhAytbtymH44wyj14+kaI/JLCu1pgPFRt5UT+y'; +moduleBuffer += + 'F2DREFLmR/A1pt4e082cVkI9JEzDV5moA1RvwFDgkUlHhn4evdeMoWLWYDtbQdFFoJMVlFMeLLgUdUkhdhE6zBbCX09xyeyq9d7K'; +moduleBuffer += + 'nYeGOLYbMU08uiDtXQ3Yci8+0PZyjFC56c5Wkw5YHAQSGjcdSNyHLfLXs9YMoG+r8X6uXqrG15+k8QJba7U72G61G5+focY8fE4q'; +moduleBuffer += + 'G8LQFeHlZjtb3DN1iAwdsIbtejQb5StBTdqoUZobqcpGotJa7C1upG51sx97h5Tdw4RDWm+BpkJSpwcruGISccDhXteZRKxHlaNU'; +moduleBuffer += + 'Q0s6/UzvJ76xn/kD9v735fuZmZavEb+73/lW8R+37mfumb2XfNdKHEAO619pJQQeta98ErSd/046t/BzOFKxekhjIUyx1LCy4lVc'; +moduleBuffer += + 'G6zkXwsRYBhYMyzHl0Lf9Gn65oHy9ay0WTkFVQPDTxf+5tEPOUfSDzkF/ZBzCP2QM4d+yJlNP+Q06IecYfohZ4B+yOmRP0wo+EFs'; +moduleBuffer += + '66V7uqSldLanzlbW2ZY6W0x32UkP02+EftNty+lxl6H09KQzknSGz8CSeiClzXRfSlPrnj2W1XEjaSI9M+nsdxrW0rN7penfK6S3'; +moduleBuffer += + '1fXeNtZzeoUM6hUyuFdIbi9r6SqZRVfRWroucqW1dNzuTIdgXQyW1tIxJEIhg6S1dAwJU0iOtJaOISEKGSitpWNIkEIGSGvpGJJG'; +moduleBuffer += + 'If2ltXQMCVBItrSWTputFGJZS8cQH4X0k9bSMcRLIZnSWjqpBMcAwzaWrqGxdM2la+Sg13K9pvHT5CMHDyjGD3wsBX2CFstDf1TZ'; +moduleBuffer += + 'GJI1guyX45r9mlyzX5hr9JpcoKUrtgmIW1CmmIX7IdI2gIcGgpnTDhP1lo/1VjPQnkDOsJN8+Oq7M8H9TtwiLBcCrcGaHvOhg6zF'; +moduleBuffer += + 'gfUECIdFc1TMrQccirn5JbkiX5Jr8iW5Il+Sa/IluaL06BBouXS9Ekg+Kf95gPpjnHIeMsJWAt4OMe86wj0mg3+iybTljrQvOKcv'; +moduleBuffer += + 'GfaxLpX8AcNBuwrs/ejdA4rZ3/ZeeYyYE8t79XsH5Jw6X3FaFJI2iY/+8aDUT6OSfhoUFVDy2kfhLHFJFTSA3hfSBNugs6r0gR5a'; +moduleBuffer += + 'kTQOzmBRJfb+Gw+y2XcEm8Ng8+jRsiXQjaxnA4ioDweHg0qiHZdA/XtGcPerpw23QpEGiRlwQT3qN0kC4gqerDwbbLIoZwFkOzh1'; +moduleBuffer += + 'R+8/krqjdx/pu6MJiW/ff9C5in5yJ3izbO8Hd7tiDyF50LL5rsqKrlmBUu/9haRyAxhdOMP50Yi4zubf5tBOpF/uOqCZULbarJqX'; +moduleBuffer += + 'P3YQ7XXiYDM/+vlBxfhYI4uYQpECPbC5mIQFWvO6xzgJbR98/zGpjoC3D+5Fb7q9fXAAvSF7++CI7aXtg9+gd4DcPlDNd9BL7RRS'; +moduleBuffer += + 'R5Mkyn/qlus5v+W6yQ573h+6Vud+Oe6xJijAj8e4Uodu2I+qb42FqC9CkA/Vl5on/kQK3nGSRIpZyIpZcBegwNz252QcPsrHSPjK'; +moduleBuffer += + '2B2O2O0qx8JXxu52xO6Xsfvt2H2O2OMy9rgd+7gjFjUcYCx8ZewLjtijMvaoHfuWI3aLzrHwlbEnHLF7ZexeO3bbXxztlbHH7Ngd'; +moduleBuffer += + 'jtjtHtlej91eGUuaiDyWWhRbw4H5Fsb/zmexY+dz6JZ3kYI8oR+naXkXWSvLOaRqTzVzyjznmTls1yiHZCEzx7zvqkel0YtzKA7H'; +moduleBuffer += + '4DmkEszccQVt7iniHLLphB8PqQobiyoQ96vRAfjdoeIGIr7HDeIHH0krfLMcPvtUFLFG69vVaA5+a2FpUfBQM0SqLaOD8LNXjYbx'; +moduleBuffer += + 'u02NDsbvBdFc/OAZNSrYjA7Fz241Ogy/W9RoBL8ro8NJoSNaYMFjLIGfXWo0E78bolH8lEdjpEsyOoJ1NvrpzGYsGe1F/2hYRMdA'; +moduleBuffer += + '2BgzD7cJzsHla4xcbMfg6cUYuQBminOgjG4R7RaxbjGiW/i7YyNFGENzusXgbpHbLYZ0i6HdsVFx9bLuWD/h646PvSx2lhiAafK6'; +moduleBuffer += + 'hd4tgt1iYLcwumPpYhiGGt0i0i2Gd0NaIbqB5cScPgR9dnxz9yVAF5BIdAsowdMtQt1iUHfMK0ZSMr8Y0B1PvyyWB/Vg1Wj9xLDu'; +moduleBuffer += + 'uHZZLAs4VfUyMao7lg154oWXQXFDgbWEsIzuWP/u+Bcvg6IAfjdeqtivogAM7YqPvgyAZ4gsjhpVCKgTuGMR7I6ffVkMT6C8HJVV'; +moduleBuffer += + 'CAgTqAAqQNVM78ZLebsxKABlYxAUlF4IyEDWQWR3x4suA6HIB/0WH4mg/NAJ8dzLgBEngEYh0BAk7Q8dGc/AaqQBq0NRGYVAOdS4'; +moduleBuffer += + '4d3x4GWxIMCT1RhcCPRC1QhSmQHonEKgDggKypqldeNp9AZqYWZ3vB/Woj/gKe6DsgGm6IZeARGA4AUL9RYcbND/8cBlwFKFrErQ'; +moduleBuffer += + 'OTXqEIeWDLosRhZLOSaAB32Yx2OVR8eNmJbaBgiIpeHRIAgKArr+XITrByqIZ2NdsgGj8SEAkaGRugqQLkS/7vi4y2KoD1iWE8LD'; +moduleBuffer += + 'RmxFrDuuXxaLQIlhjqH3qwg9wiQDBISHfwiFag+UExuBZ4MKlJbTHe+PNThb5HHuQaxCrz+Qb3wM1ijPKnEoqxbVJZSzumOCVYKO'; +moduleBuffer += + 'htafRWnE2UCGOFJQsQtIuQZMAyNh1I+CEZ8Boz0ThnoWDOwAjGYvjNl0GJpp0RgpNTIPwaxjAru1bfuj0gzbOcxzBORxoLUGbQ9S'; +moduleBuffer += + 'EKq/k45wScjPmxWWCAsy9ECHe7Ittt6bFlpiW2DTeBYEADjzsZ0mzVImJzcNNOtEglj6a3xRbF226UG7aMKycMy8wz7kHchYh59q'; +moduleBuffer += + '2hDa6gVe3mEuw80/yLMJeV6pSTPJHqpCDAFue4u40buQxboJ3ax4yrwc3MYfcTdi9HQly9xrRWXVm7s4yrYiBFVVjV+nocY2tqdr'; +moduleBuffer += + 'bjl+SMlTlKmSOTdPvHdIQU1r5D+e9GhmNktRvOOOvmzzEBaF3Et2vXkfF2W874mS9sZs3AghAyA5gi3EshUlhc6RApQJm4W2Up7k'; +moduleBuffer += + 'KidNw2ECRRr4NMGXJixDlswqUbtu12K4hU2WJFErY4wUIDLiTPjQkqbSpqwH7SWrtNNNGsdIqf44ZYjpaZV2ks19qNNcddQBd+Nx'; +moduleBuffer += + 'NwvqwmbGKBfZdnn0CkqbtFkXwxqzRjO2CUYqNBVuJOq+efot2qu8izTEcWsVuyGAINmTivmsoxvZlJoirR1nI3uKyXy9IJj/JPCM'; +moduleBuffer += + 'iNcQwo06mhzWWHUSd4iZTaofaZDAIFAth8dy+CxHLitw35UWuoPOEJrJ3tQxxWFBdbK0ymoUEouvT1dWCjKpNIfjUcvykb3Ijpdz'; +moduleBuffer += + 'wHn8KZJ8P568zJfCA4wEQJeHkhThnuBtfzrEh8i4awd9HPXjh5R2BmhrUSeh37zt2CEyvqShTTHcKdClaa8hW3HWwyMNl2mvOYKV'; +moduleBuffer += + 'FzqC+KioiM7B/NRfxg1qhGVqx6YRmtqIoTdTIXXMsDY7TPQsAq4JT5ZQ36Oe47DlsyhCCoMFbzxBXtr3h0QOYz2L8YAIeIekNR8I'; +moduleBuffer += + 'MQOkOc5TTwrlSO+iTkYshNfc+ycplLK9a7SggQY4D9PxEXYk4p2kJzKJTQd+MSSWydYkpqDl77HEFaDGJs3cg3rOgsYNASMUTWNr'; +moduleBuffer += + 'P2lklxs1bQJBhFmQJztSCmrXetMHaw24DLJ1ZOxJYzotwJ/JAAdq8GOEiUaChEIaKh1l64IWJT7f+8STNPVgRIQPlfOr0qSxiiaN'; +moduleBuffer += + 'SdRlFabmB0BSZiFV23wN3TugFGMPMKehI6rqYcNoLC7SjZB9fCLAAlkr9NeW+ykAe+que6TTvI9dUXaZx14nO1fmXhmskQsP73BK'; +moduleBuffer += + 'YauC9pmi0DPpegkOUh2jJLYDtCKw4MlqyN12h/f9ubfd4Wf/THaH8TKMtBmX47YZp0HMr6/w3qSizv39Sui3vvxlbdWJtvzK2kRd'; +moduleBuffer += + 'W/74REdbe0dLfntzc2NlbUVdU1v+hPFFk8ZVVCQqa6dOHlfR0tJYPa6qIrG+rim/sW5NPqbHb1uiktwYmKhIbMyvaGxsrqTgyubG'; +moduleBuffer += + 'xurK9rpmALamPVFdnb+uoiW/uqk9sXF8ok1RFEPZDL+tKq0hSkUb1AdTi7UVdY3VVdNFXdUGMUMUm+VmcenSVf8P6tvUXFVNVd0L'; +moduleBuffer += + 'dd0EdbxBU5S0lHWtrqqpHl9bXVdT2y7OPVe0VTeutbzjxAQr/w9lfst/70nhQYXGN1Y35Y1GaFVt7eyx8uX7FcXrgPNDj6KMcMLt'; +moduleBuffer += + '4X8P/CNPu97U7GTlHXCO61zf/xe4qOisq6loZ3zM0AzlIqjHSui/AgUZjp51qqxI1DTnJ6pr6tqA3ghmXVNV9YbxlQkA0ja+rnnc'; +moduleBuffer += + '1LUTCqsmTlyzpmLClIKCCWvza6qbqhN1leMqEomKjeMKxk+YPL6QckL9mGKPQrkVCpbP/QCkq4ThD7pXgSBFJ7f52qUwwq7XMBax'; +moduleBuffer += + 'VCFm1rW1NFZsFHXroCvWwRCoICQkqts7Ek3VVaKiSVQnEs0J0dFUvaEFGl5d1bjxc+9k6Jm6phpu2Xd1Q6mH71eDipIO3xKsDnx3'; +moduleBuffer += + 'DDyhHV6+S/nO9VdoRT9u1D/aqekHDt6if3m0T1t+z7vaS/+4SLuxeZiy71lD/3jEB+qhG021/7di6n0D/62cE9+q7//ZQq3z+kz9'; +moduleBuffer += + 'u2et1x5I7wc9Zu66DHrHnJF9R86zBW9uVB945/yPrv9phzFqzfoxbf/a+PNlhd/rPH97TnD59b9cseRvL3/5tUE/fW3f3G+Mej/6'; +moduleBuffer += + '8rZL3/pV91e2jcr5pLUbAL2NgA54P3H8w+MJqLVS19RZ0VhXJdrqapoqoJOrrYB11W1tFTXVoqquprqtvalZtNVWJKrbREuiubOu'; +moduleBuffer += + 'qrpqfunS8+fMPH9eyarzS+EzccrU81eWzZy+ZI45Dt1LlqxYdv7ihecvWDb/fHfS8r6SVlY0NTW3i6pqwGgd1GPTSeojYJTXtNda'; +moduleBuffer += + 'kQlR2dycqKqDJlSXVFa1VSyvgOxN7VgtLE9Rfu81iPheld9OTgBTJxBZ3dq66kR1U8c64cz86ccJ1xUHSIEcIJXNierzK1rq8ivb'; +moduleBuffer += + 'z6cqrGnkgZrrM5QGqFeXwhPQpy98DVBvw7g1HWvXVie4CpMdY3QHlHcBlHMb/OUg+Tr8wuG/G/6ye/gHO/w398iP/uE9/KMc/nEq'; +moduleBuffer += + 'XmVK+ovAP8zhn6IyvDTHhAEjDeRVmjD2XYUThs+aTv5/mDD+7ndPGBH4C8iWob8SskFFL1hc3dbR2D59ekfT+kRFS97oCwS0A6p/'; +moduleBuffer += + 'AcwwFwig845qmms+PWXASJ7IFFHkIkqu730BQ/kKfC+HvyyF/wWeeOj9mjfS6r9w+y+2dt9d8+CYE9d9nHi/acZfpw49f/qHC7/3'; +moduleBuffer += + 'zNfe2LN5cfqi4Y1fHHN5rXdnw8Pmv+787SXDN0Yvyhr01LH/yv/SmsYl5fPPPau9upq+bU0t9O2ohCUUXbxEKErvb22aQe46+MJq'; +moduleBuffer += + 'rrTAF/tvg/xugS9SSG17e0vb9Pz8hqq2uqb2teMr1lWNr2xepxyB+IE4ojorqxvyOyfkg/ttCEMKK6trrGjCQoIGLUCEu+rO86F6'; +moduleBuffer += + '1BkGhCOOkDKHKEl/hfQvrm5pTsB0VdFeIaqaYXbEyWtdRXtl7XghltbWtQlaKgHDQKFNVXWViBPRXlvRDj/VlG+sAKJrxOkM2aim'; +moduleBuffer += + 'yuqxAqjVno7bBMy6Yk1FFTAbGItZkpFWfb5LI8R84XoYHV7sLEMx37I9mYp5wvb0U8xt37Q8WcDd255sxdyNngno6Q9/BRMmTpo8'; +moduleBuffer += + 'ZWph0bSKNZVV1WuRwTkvZNiYsah4gGJ+hBlVWGq23QAOo9dKYz6E4T/xWMS+sAWHqUXs57fXJprXWyQvLljQ3FQtST45bIW9JCRE'; +moduleBuffer += + 'c0d7Swf04caW6uniHajSCDkteeRf7pkNLGqOlRcRSyMNqWFNYxtSQl2YiWwQ/I2Bv1nEFYr2ZtFSkWirlovjdLEV0uW44oEE19Q1'; +moduleBuffer += + 'VScxaqe9DdLiVL/EjlkHs4lYUw1dUFu9QfAkUt6xprGuUjRUb0wZnSyoqhrHkqMcSDQdp/JIxKApfTn031okQSdbi1MwxCO6S5oq'; +moduleBuffer += + 'Extb3LErIQ4nAav9LbL9/wX9MrOa0n9FnKwzIN1WyI/Tv0zrgn2fhN2TzIY6pv5hcjmBqX/LTUBBh3UkPvH/ydT/pfQUvOKnn78B'; +moduleBuffer += + 'sTB9Tx4/yclzH4CylkMZj8kF1+k3lf/3kkhRBksiP4e/s2Ge2AXY7FbVz69muKoxRmD8VOfXtVcnGCthw1DWwfevXp7mYNa66xao'; +moduleBuffer += + 'zT/0zwA1VeNgpLaNq+xIdFa3jVtf0bZu3ITxsNZS9ioYgZ0g3TdXcU3ukjWZIBkcyz8J/jJOOoO5Z0vXPDanGtAxVmCx0QqYMFs7'; +moduleBuffer += + 'qmHNqBDQo43VonktzA6bqsWkCoEbDJ+ej6iunACEWCgJsaUZ1l1q2I2ZhrIK6t8gR6/FplMdp4uxwp7TYWT3M6itWfANOdIygy+U'; +moduleBuffer += + 'gh7xHU0NTc3rm4TFwF9wgQucUg7p8FZqBXxxFoFoWGphOsR1FMQYma/NSrelH87Y5tHvyQVs1/fBsVSVDEhU/pnyW1yyeGnprNJi'; +moduleBuffer += + 'c2mJcmSceXPrtszA2xPnb3phz+i/j9fEoJ3ib+tf/e9rr3t3XuEfrxPa8A+iYx74x88WXjAvM/CUYt52O8DORLjW4siMjvnabojo'; +moduleBuffer += + 'bxXaI3LHHRD5jvrp8UVTcPO4NXU1gChA3JTxUyhjB3jzgVCaq6yZa0c2T1zfIu5BUfLu31+6tuPouUW/fH7Xqxv+KJrKcpd+NP2m'; +moduleBuffer += + 'r3+S/t1VWy9dWjXm9wsqRvw9/+Ks/t8efXDP9LKPb9Pn7TnXM+KuO+776s92/+yW8r2XjF/+5p5v/PaTD2oHLX705+ftrpt2lrbl'; +moduleBuffer += + '5T8d7r/64J0bxqRo9W13Qqsv+AgCdMluoPtfn/T978xx8tpdUM6f/L0nos9X4Ksd8L8r7702wC1vWX5L3vq8pYqqgW6p4n+zr58d'; +moduleBuffer += + '+L/b1+U5btna6RcOvyVbO/2DHf6be+S3ZGunf5TDb8nWlt/CteX/7HCdaKuAZk+T/V7RWNOcqGuvXdeW39LWxvguH8QbgGervMha'; +moduleBuffer += + '/skqb/VZ/mnqZ0UPbR1r2oE1mDh+qlxtGRkA/7VBvBw9TJuR5t77YcQ/WvTZjPhTyNKDe8vSL3zbe+ArNz/4pP+5rqnnjP7WmoEv'; +moduleBuffer += + 'txSsVlddPW1V+t9feDu//4TQ/k9qzppUk9l/Ze3X59535e1X/aMqMj784m0L//nI0Dn3z/68qbc2102NS5B9smUPFFvbKtZVW+tz'; +moduleBuffer += + 'RRsF0U7w57+xrA1hqvmyxgz1Z9Gfax0SlC1iOsSotYnmdaINWDGQbVCm2Qd1GP/Z0E51J5BrwfiJlHxtXWLdemBS8ms6YF7LR9m2'; +moduleBuffer += + 'LV9uRBwfwjNYQmXRaFkTzm1Y52SN12xsJ6GrcahB4m/qdrUkxUluGPBwdlZlO+SdCHmXF5fMS25oYF8wltshnS1m4dYHZDoCecZ8'; +moduleBuffer += + 'Jv3R1LHOYk5gcgf0F0nChMAOi7cE4SEpHub18I+WYbXDDOUchUXVsTgzwt9ng7OTz3wVkqm/bRjTKPJNgR5+nK1JSqnMn1awZtKU'; +moduleBuffer += + 'iqkTJ02rnFRVtKYKZN8pkwoqplYUFE2YurZw7VoQhwsqKtaeTJ6xhYi84YZSBt8/6MyiOv3jHf7XdV59nH7sHwXqhxsgF8Lf0B7+'; +moduleBuffer += + 'z6bPTn+lfmH4/+5KvVS4V2qnXzj81krt9A92+G/ukd9aqZ3+UQ6/tVJbfmultvzWSo3/kP2ltUr6rW0qPM4zmza2V9SQWPW5LmWb'; +moduleBuffer += + 'o5/9OjYO/8VLZpcuEA6pikKDZaWls1dtKi6Ox+fVmOtL42ZN6UxzkWmWlayaXbykdfaS0jWTZi4qiRfXm1OazaL1MxetmruqdHWp'; +moduleBuffer += + 'uWLZzLhZWhyMLyqunTPTrIjXNLTWNtTNnra+IG4uqumVENLVYQFl88pmmjUl8bI5bRtmzTSXBOM1C5bHzbay4oLlHasnNnasXrF8'; +moduleBuffer += + 'Y8WKKU1li9rWFy9aNXP5okWzS9bPXb5sU8mysnjpbHPCspL4+vXzl02c1VE1u6QmuGjihtrKdSUbijeZcxlYTZnZsCBetrho/RwG'; +moduleBuffer += + 'MG9mfHV89ZzVtWvWLWhcXRxfULFiwcY1G+Mlq1eubgmumrh8U9ni0vUlJiWeOdNsjC9raGtfuqKxbdWKyevn1FYuKKs3N5TNLN1Y'; +moduleBuffer += + 'trRyY9kmc8IKCFswcxmFBe3A+nhh2eJF60tqCND8mWb7rDXrqlrWrFveWLkOmrapZD5UjZtQW1a8fHmZsw8qy4onLKhd07S4trRk'; +moduleBuffer += + 'QduqlXNrHX0AaJk7c9HSkrVl8QICUFyzfsWiFYsnrloxpT64esWiGqhufeW6oprFs5dPhPY1Vm4qWVIWNymxuX793EXL586fv2xC'; +moduleBuffer += + 'y5rZszoA7cWl9eYCC2tBRlvJLNNcWGzWFJmYoLhmHrhLzIL5VVMmLp67sKq6bm5j67yJc6valq+bWTirob2juX3F+pUT1i6oCa6Y'; +moduleBuffer += + 'PGHlqmkrN02YU1K7ZNm62vmbphV3TJs5Z3FjZ83cJQs2rKletaqtae7azo31GyaUrV1WsHxKe8O8umUTSqrbFsxqrwhOaFhqFrRt'; +moduleBuffer += + 'WlDXVrWqclpdW2tD4bqVS6eMmbd29uI1aysnL8+ftmlxaWVJUX3jnAVTJyyZUN9RtHLapDFTqzbMXJaYPTG4ZNOG1rmT47WtG1et'; +moduleBuffer += + 'WzYz0VG+cu6SlZM7l1UWTCgvrJ9WVNbSunDJtCmJhYurZs+pLp0ycUHFpinrJsbHLBzTWd9WXBCcWlA1qbB+1bT5s6o7FpZPLoOl'; +moduleBuffer += + 'vKi1Zm3dxCVTGua11uRXzJpaUd7eYa5etHxxYcekebNWrSyfMm3lurk17ZXNNQVTgjXrSguW5i+sa59f27FpeWfL6sr5LbUFzVW1'; +moduleBuffer += + '+RNKy1e2bpg0pqypfua0QrNw7cqW1tlV+RuL5m1YWVjf0La0ZJO5sCa4Zp5ZXbFuUuO6MZM2ziutXLqqrLFtcdnK8sr6BWtKO9e1'; +moduleBuffer += + 'xTc2zMzP37Ckqa6jrWNOvKGmqbFkQcmKDROWVa5ZtCjRFhxTs3xmQ8fy8tq2pk2lixfUrOosm1y0akzh/Nl1c1c1JdaVFG2oTFRv'; +moduleBuffer += + 'qG6Ib0h0VkxcPm3p3EWtTQsmLZoyqaF9SmddcFHdpDE1xWvXNawvLphV0F6XKF29Zn7DyvJE+fpNqwvKplUv2FBbunHJmolNLXPX'; +moduleBuffer += + '1jS1bpoypbSgY9Kk9bWTEwWrFywKVi+dvXZ9waSy+LL2jR2bZle3zW6oXD+msbm1rKJ1Quviye31s9eUr9pQ3NlS3Fo4ZmFNS3Fx'; +moduleBuffer += + 'c9mCuvaJHfObp5VNKAqunbNpQkHjwrKlRU0rzGWdi1fP2tRevbJ43ZjC8jlVq8ob1y1av2z9pPmd1U1z80vnr2xeVD5n7ZqGOQXF'; +moduleBuffer += + 'G8vX1jZOqA+uqJ07a3VFW7EJA9qsWDCmbM769TNxRC4uKDcXzckHOscZaLYcSFUzaxatiMeXzErEE4sX5a8tDSZmrVy2YfGE+JJ5'; +moduleBuffer += + 'ncurSxLLlm0yy3GEzlkMw2ltUUl8qTkTAZXNbCYAc9Yv2lQ2s2T9/Klme3Nxx+zgvBW1BVVz4psW1hVBJy/eBNNZweq6KbVrVizq'; +moduleBuffer += + 'WDVxWvv8SavrV69o66yqL+mUk0znqklz26xJN3iqWfdUk27wZLOuORnm/kXFU9cVNMxsmbqpc/LC+rU1G8dsaqyurm3bMLW5saC5'; +moduleBuffer += + 'smZ5dWOwZGnzmpYNY0o6ittal89aXD5vQv3qCW0t+Y0bq6aNKVi7qCAxdWpTYUNFzeKGycUVk6bVTJ26YvbSuWXVc6taVyXq1geX'; +moduleBuffer += + 'LK2vn1k8b3n5kuq2FStXlS83N86sXVc+pWli55j4qrqW1StqWzpbWyrqFo4pmT1vSmm8fMyUwqJF1Svy25Y0NyTmBavmVMw3N8ye'; +moduleBuffer += + 'OL929Yb6aRWzCietbS0uXGjOXT2lory5af3kxSUTp02btbwiUTth6YaJ1UsnrV9S0zCzpqO9eGl8wqrW4KalU2Z2rO80q8dUNk8s'; +moduleBuffer += + 'Ll1eCkiqWLeqY8ms+vIFBfHimub6xsLlY9Ysbe4orCpray3tyF+6Ij9RXrxyWn7JssqW4LzZ81rLF00qH7NgWmJCbX3JrFUTWhrj'; +moduleBuffer += + 'NdMmtU+ZtHBh8+RpsxeUjlk+YVPnyvL5pVM3lM5a3vZ/2fsOgCaW7t8FERUs2LvGLiK9o6ghBQKBBJLQLBiSJQTSSKHZsHfFXi4o'; +moduleBuffer += + '9t57uyo27L333hUVe+HN7OyGJddbvB/6/977P+4dN7/dmZ3ZKeecmTnnTLKT2qj1iDIqOLGuuJ1OHR4mjojw0Rli/AAl8ZW5J4tj'; +moduleBuffer += + 'jBE+4YlRpki3dDWgPK4exrAgrkeynzgk0d9LkJ4eEqLlsnWJLA5flWYXouHFJWdmucWFxQYDpugekZIk4Wfq9erMaMCXZBpvjl+w'; +moduleBuffer += + 'XK5Oj5D6AKLnZ5CFShUcpbunOjnY5BWalmznGSnxNCT5KSUiid7NPzOSnRFiFERKonlpmV5qaVC8MMgoCk9ySpOwjSmxIlGanyop'; +moduleBuffer += + 'RgaEZL7eXy03SDR2ofGhbk5GkzA8TB2kEYX4+bipVGGpTtG66EiDIi0xm81LF/DT2T4x7hJ1mod3ojaTFRfqJDYFaaVeBqeQEDtW'; +moduleBuffer += + 'tJKZrhD7pwKJPijNXe6kTE/xMaSmhmSasmWZianumek+8cGZeiMemhkd4humivWNi5LH++DMqLAMPu5lx+TGA/alDWNFBgbaEUIL'; +moduleBuffer += + 'J4L9R0Hm74QcpRgIOWwlXcgJ+v9Czp8JOYqsCDYvw0LIIW/+Vws5QK6I+VdCjkbiIdfrI8RJickRkTyVKskpxiPLKUrAShRl8+Tu'; +moduleBuffer += + '0rD4JKOdh9g/OyU+UpCdEiyTqdx9le5qXliMyjdCLAtyi46LNXqGZsaLsgXxKYYUfkQ0kxPhER6c4i9W4nK+UySeYRcWH+sWqo7k'; +moduleBuffer += + 'mOJS1E4xYakGvjFTIefr/Dm+nPiIjAh2WrS73i0tSuhtDPITxKRmRSby5Hzc5CVlZfumuIrsVO7c1KAsI57ub0jkBmcbfWUZmpRs'; +moduleBuffer += + 'pb/aV6NNM6Q6maKig3SeTjyNp3ekUC5L8YtLUnHUmpCgiHSThB2abMdnhYbH+IUJUoQ+Tk7C5ESDp5KlNIbKmBEcY4xXmjiCqw2L'; +moduleBuffer += + '8WSFqBJlIlaKONwvzBCRKMn0ZPrhqd6caL4d4Fwh7jqjP8dTnKSL8onNSooM08T5pKq8pRyeMEMe44lz46RpLK5Qz9P66yLFPjEm'; +moduleBuffer += + 'tkjoFQoIQ2K8BrcLC+Mlxqdkx6aGGj0jIoM9PTim1DieOijRX8RKVfs7JYm8+fFchb82JduUGB7r6RSRGqQVxfJ8BcJ0TUh4pl2K'; +moduleBuffer += + 'SeevzvA24D6AkvkGp+lYTA9xRJZOq1KbIp1kTGlmtG9oWgjHT67y18UkOcV5SvWJTv5KJZeVwTV6qeyYqtAMb7YbSxwlZrnHecfF'; +moduleBuffer += + 'cNlBLD3TNT1YoxZr0oL9WE4pKRKmyFeWkhLll+YlECZnsdWhUUKNlOUaH+xtZxK6hbll+wRrBa6eJlzjn5FmSGaZQnAFX6wT4CGc'; +moduleBuffer += + '0KgwfSRX7yWM5mVEC4LcnPBEgTdXoc0SZHh5arK4dmxvSVgQO5MT5BUUpnV1MzGVYSH8qPR0BT9REJUo8QtjRvEM7hxtGidFzfWT'; +moduleBuffer += + 'GPXqyJhoj2RJSkZ2WkZ6CNcOV/rphZnhpJAjCNJms4K0bKackFMivThcRaRE4BdvCmbp2a5id2U8R5no5SsP4fPFfumuigy7kAxC'; +moduleBuffer += + 'IkoJClJkcLVMSbI0Q+omEQK5MzPaPVwij5Qo9e6xyWHu3HA01KPcxEh6UmQEAdJm5woJKZspQDn6IcmICUoUGZkhQAmSgtjhGeFi'; +moduleBuffer += + 'ZrqW5aEI84rTSUOi3GQh4T78LH+9XXxIhA7QATVfzTXGs7xTEj3c0uWAdEmz/D3CRf6AfGUmJyr9wXDPyIhSxIWGaeN5yemyCDCC'; +moduleBuffer += + 'AXlVK+zY2XBsqxTJqYqg+MhwDiDrXGYYRxYepC1P1tnfi8dj24Fxn6HNgEXmsBUK8Dk8BS6JFMmYSZ4qdlyaIkbiHm1UsRPVvAg/'; +moduleBuffer += + 'kYec5Z2qjsw2xLuGGJkpkRo+x07Ic09J9lSEJvIz+T6KJM8wv5RMmTFbEKNJjZMlypPCBQK9h1+Y2NObJ2VGebjp8dSwKK7OKA5J'; +moduleBuffer += + 'xp3YXL2dJ5ObHc9ns31lMWEe/q7BOqHSKAxlh7HSeb5ML4nCzUef6hvqlh2Euydlu6bhXkoPV667hz49KYMVHJcss4vKFGb5RnI9'; +moduleBuffer += + '0/ySonyCWaHyIHdJpLdIlcFK4WayvUx4tiQq28hT8Zgp4alGXzY3PSwq2ckjO8zJW6eKDg624xpS2KHG8GwPk9w/y02XLuB4pXjK'; +moduleBuffer += + 'Q7x5Mf4pwZlSUbDImBahlyZqNDquh6cPR6x3d5V6eSb6cblhfO/ICDu10S9a75+piY3SZWvSWFHpaSl6p9RofaKPXJVkEqtUylg8'; +moduleBuffer += + 'UhyuCtJGxXBDBVF8P6YsKDQzON4rzEMdC4gqkNkl3mI+nuwdFsv3j4jxlbqmMQU8icGDqxQkp+mN2czk0CiFPy/FLzI10l+Y6iQL'; +moduleBuffer += + 'C87O8OGoPMWeqaASOQqf7NRMdXq4SZoYLzDIw5KiUmOSkkM84sNkYhU7SR3iHuKWneYW6ZEY7GlKl0bLlSwjEOb4qpisIE+/UDuR'; +moduleBuffer += + 'R1KEIcpVmOVj9E7Uc0JZ3Ij0bCk7NcsnDGd5KbUaV1m0QiJV+mZnizwTgyNjssPYYRJPb1FahMQjJlVox/PLZMW7ucUYecqwMK4m'; +moduleBuffer += + 'NkYSmZmuClOrFfFBvDgh7uaezXaL8JMauZnqGKVIkxSq8vF3C/LXh+oiouCUQ5qSyYrxFOHKDIOP3j1e7WRkmaITw5URRp3IX5yc'; +moduleBuffer += + 'EhHrZUrHvY3JWUkcD7ZCmxnFTY9zZxm0XO/wvxCK0PpRZ3Idy8diXcsXIxVlUpUauU5rUMLlZia10CqU6qVq3IjrDeFKg0GpUZRL'; +moduleBuffer += + '6wfXxAwa9zA8K1yqStLq1bic/twfBIFSLkE6BFql3CLvABD4xMYGW2rExUo1jnSbuOCfCK2RqzVpyr2vi0X6riDwNDIt1Egy4pRa'; +moduleBuffer += + 'QoIK10hlRpNUBX/R4wfC+FqeRo4nKTVKI47yLv/ObiAYpYoIrUYm1Wg1SplUBT7B/Hki3Mg26VSEaiH4LdBDJRONQpCO65NU2gx4'; +moduleBuffer += + 'VZnfSr2zOwhCXC3E9WpYi1oNG9cAaSAKl4LUYqkiXCvHyUoCKMKkTsT1PKSYUW5Nsgdcs5QqJGYFK+qKPrfcdzCpuMRr4ZaDWA8q'; +moduleBuffer += + 'F5QV1LUUaa/J9bhaCmqCbFZz2iAQJMYkv2izsl7ZMxZ8DjcwBBkaXE7phWtwPdQitIjLBkGkVRO3O5LfwLGIw4Vlpbobz6werjN3'; +moduleBuffer += + 'vGqdRoSMeF/DysoOY056sQez39XIpDGYdHA/BKdp0jPMuwNwa6W2rwOxPE/pt0SJmLTNmABGV1+kOVi2bUNoZOAMY6IhQQaNUQjd'; +moduleBuffer += + 'PRzuuLE5UYR2XS+QxtHinebsQYxcX6T6CjUMcT2D/hbz5g6VhvgHx+mRiDzWgnf40/IQcsKJ+yXgfg3afapM1f3Q/V+5bdDW79du'; +moduleBuffer += + 'GxT4ld8WoOMmNExtC9BxSwvcjoapbQEKU9sCFK64DXw58Vm+Lv5oGwuQTJDGiCtwvSu505bj74DBwc7DylSx/cghElwhZfhT9THM'; +moduleBuffer += + 'JqBMf6ymBabrkwGyaH62l6xL+lCm2AGLUHwq/ywEBGGqzOAnhPlySO2naPBNkLP+XL2A2wHlt1P+060USnHMnQxS8op0URlKNNJR'; +moduleBuffer += + 'nZkAGaXqz+THyEgG5AbpDsOoiUjtUl8uDahmBmA2DMJChv4gSIlIFCQmmg5GBkkE4aa0HA8IYJftO+sDAmi70AlSTRahSAB3pFVK'; +moduleBuffer += + 'tdLISAZkLRHH4b6yVJaMm18NeB5Dq1FlUdSQ0mk0MKQaOVRjJNXpk6XpUDEa8hZia5x4tTQZMDSo9mgEnFypRerAgEpt6oq0mSHB'; +moduleBuffer += + 'ovp2EbgHLdNo2oRuUBPfvTP4dsD2GbRxcA3EbUzDVBQKOwQi0wR6/aCddLKCiI//B5XEABwnWSvvCN4XUiFj7h9ssVfw/vT1wPLb'; +moduleBuffer += + '03TsQsPU9jQdw+3pzMDy29N07ELVPzmmIyzG/3+HKFlGff5Ae0hyQysJPStzfAGMT8gKoDR/LZma0wgtyvO/TTSNxP4HRFMockL5'; +moduleBuffer += + 'kiKwOqmcIKsGQNKA1NmK6YA1APHlZdYQBEnqAe47gPvpdAsNHBmWxoJndcAzyv7RqNUyVFpQa2QapQZawlDqWYCMAuI5DjyDcolG'; +moduleBuffer += + 'pwcdxWB+2i2Q4bGUfAbfk4RnMMgogEgqlOmA/pJ6XUD+RKZLUOLUEFIiEFNBuv0gvTdWxoOJ9KQVjU0QaS1C2Wxq5SaVyYAxgpAO'; +moduleBuffer += + 'N3UfNAWoKI3RL4j6BnRfpsWTwPcrwSNMSL6LfAf6bkDx4NhXBSHdbVJ+pl5HxDGopSrYuqOCEI3+XhzqPSuDytNxKALpNVIVVfeX'; +moduleBuffer += + 'gpB5lUqaiKvMNY9hxeR9y2amenNVFmpn6jnIzgQNVAh1HRYqu3kWYYUxi0fsxez3OnQlu1QUWRwKi8h7KpBUDLsbCNC0IwaEWKI7'; +moduleBuffer += + 'GWR6JdGfOjpCBi3HdXocjjp5F4bJgFOWMmpQlG4MNM5PsRy+Y6D+c3RB77GQBhQU0arSMDRNaUDDRRgShyh83CL+DQyxAArfxZA1'; +moduleBuffer += + 'pRVGEgAhagcRMdrKTI7ohk/haBiJtVo+aEoeHDyAfIYQwyYCjQXwTAQ7Ebhy8QwhcY/KAALydzjqmCTikP2LhKyynkzGgznCbofo'; +moduleBuffer += + 'OBWdyusPd/lkF6WTmjiSbbhb3DezEx7Zf/mwv5o/kaoaQMFJwKT6Y8Xy+juc8qyejl1omGL1dAxZvTCMJWrjzmCKIlzcKVlNx0Xk'; +moduleBuffer += + 'inyGTBgUeqkuGQ5qNEyp4UvGSUdMFT2l9/n9XNTnZckmTSqSECnKCLiXMxDAtNglLtKe/I6TDTgQGF0D4csqYH4AWz0dlzm7u7h7'; +moduleBuffer += + 'khqglPeEJsEOWC9Qhpe233Mi8fM0K0cFI9Hqdwy1D4XhuLWjkUnqvr81Yn8UDgDYi4a7WKPpLIUfWKNpCYUfWsR/bI2mcBTOrFK+'; +moduleBuffer += + 'HP2roOkvhYcC3JCGa1VFWpZyJfRQwEjMYsAmbYVtDUHsh4qnqPbT65VGBgFNAtV7C5RBRdK3Jr8sb0MytHnrxUN5w7qBhrIUrkO2'; +moduleBuffer += + 'M52W9MTgtEUhAa+FpsbEM8rOF/bJHzCqZUl1UpnSmEXJe+XygdNfJrQdBPEBa9KaKsDdwl+NKU0oGlNRVogWycjCMbRlpaPiMElH'; +moduleBuffer += + 'OxQ+YYOWIf5IEzR4RgJ4ExSsAFWg4s+yQXypgqir2XKxR5gDMcWhDBfptK0gDNI25p4ZQJIorv0Te5daqzESbon2gBxlZK+CFh0U'; +moduleBuffer += + 'hpS/A9mzKIrB5iOrccsrlcbD4h1hILSnYT6GDCIpDGuhEw1DAd7RArNpGFKphjTMsojPtXj/EHKkUniVRfqNGDITp/AeDFEmCi8l'; +moduleBuffer += + 'Rxode363B6ld4DDr6dab0Z7hDh0LudPLUNlidCZYtHpeeEVJcf+ckq0N/5+gZICmg7w7R6C8YR8DzBGjcGeSmlEY6kb70zDsDy1p'; +moduleBuffer += + 'GErUzWkYmrW3oOF+5DsoPBhDpv8UHmKBYV/9de1gSFaBuvAToLybkGX5lRxlo6A8R6EwxVHofbSH8Ff2UYOJ0OsXltUNoadP4qYk'; +moduleBuffer += + 'ZiE3Q9BkTC+VAQkQGcNIgSgok8IZUyKcRhHTRD1cXwSszeUWeIcX7V1O5PikMMsiLzaJ/zjmpQnJShelIQFX64xZHR1paUIs3hlm'; +moduleBuffer += + 'gUUknaKwmMT0+l4b+dPru5zUuD8SSVWRVSvKku+ftLNaKgPZd40qa1dIj0Fu+jKWzpCbiPVvNZBUlGgdCjQDpB1UOsptCIXZ5Lso'; +moduleBuffer += + 'PAJDM1QKj7TAM8k+T+FZFnihBd5skd8GC3yWpDsUPmeBL1ngyyT+lXRnrag83ZHjBiN0vKUkBEA5w6A16WU4g5BdDGhdXq6E+2hw'; +moduleBuffer += + '9QWtkBg6i9FYgn8Ub+trgaHsySckQzhTA9NWhQYbfyHAc9qDunWHxwq2hL++v4Rxpsh+4Po8P4xZtAwIPm4GxwPHUho/e5a9ZG3I'; +moduleBuffer += + '+hpNYm86+5YMDpcd+jNzcYy5dPne75vkX4IP3KgbGBnh29/Yn2PMrStAunVVf6W1/lYJstYfQ1LkH64FrPxS6M1d+x0Tb+ZdynUb'; +moduleBuffer += + 'lnm8cvHKCy6t3q9gzL/vFTLSprmt2zWqQmCtJWLkEjtceUwwahOQpSRJ636RQ41UD28fUBO/RztgkAJC2btmhYyKf5S7DuUORmVM'; +moduleBuffer += + 'Ref/z7fAd8b82i1wv9jylnN0zKBhaoucjpvQcL5FemqLnI7b0TC1RU5haoucwtQWObmMTbGC/7w6cJUKLrHKUF+AFeJJbu3Cnu9B'; +moduleBuffer += + '3EU/k5S4Su6KZ+oANUxQG9AYDY5DTlyhc1DI5UM8WM6CaE6UiBfPcWaLxM4Ys2QDoBzQXp4Q/+mDEu5siPVZXCCj8DRG5HGSuX/j'; +moduleBuffer += + 'XuSxZOMm8sce+OM7vrdK4P3BFeDd5q+N3Uvi0a42nGxRRoLQaRx0GAedxUFHcdBJHHQQB53DEY7hfrHHnVE9kYeddIxceiIxXEr3'; +moduleBuffer += + 'peHB5DCm46Y0DLesWtOwEkPLCnTcgYYhw2wMmMM2itt8obVSJYx5Dj7oaEM++FsCzMzbTrb50u3fb/O8HeD+qgpya/LPWVFB7/KO'; +moduleBuffer += + 'Y34lCWzW5xe70Oxj4UKzT3kSSGGzC80+5UkghfMt0ptdaPYpTwIpbHah2cfChWafitYS+vc0zzVTTYy4mQkO2FBQlkwMLfJQeBKG'; +moduleBuffer += + 'BGOsAtwa/RVV6tb3f4Im/fPxcqovXXRjPisEo3Z0BdQJlElQe6FlUCkhwuOgLWlNR5RAJUUliCFHLIV7ohLl7gclcqTW8SLbyb4U'; +moduleBuffer += + 'Htn2ZtichktWfXqwky5BwiuUm2EC/tLJ7gOl969lBZ0cezZ6gOEGGQ9ywBx4pXw6wZufaXL1VxBssDJhHMnUaw+Ad1alhHSQB8Q1'; +moduleBuffer += + 'LEhoMbzp+E9JKPQwdfD7pPPSQZK23vuTCDMPgfuMv6sLjHkNxntrTRetf6abm0cyupubX0v3xfLyU5D/PO9Ucw/2suzBaIrhmqGU'; +moduleBuffer += + '454epL9xOeKzj0m6AjfVj4Daz7diMn1OjetzZneXgpA1D66t3m45g/uVtZSLl68lUMpjxypoxP9FfVmMeH4SKkUeWQoKF6ARX3wc'; +moduleBuffer += + 'lIhHjfi/q74CRtNkruvjm82FC2MMmpjeFo8HVQGj9yR4oaJiJJG/+Eq1Ca5OACn4FDl8c0/DGbz72quc2YwpjwYdeZRWb8zywPpP'; +moduleBuffer += + 'h02+l6t6dDz13JJWZ0a47bu3227ZILG246iaVhcGsu5hzFMw3S6rtEH7x6zemFb/oO3b/JVV67TebxGxc/S6wKXH8YtqL2OVA3Yd'; +moduleBuffer += + 'x1jWzMmhdTY5FJ28Veh/aMKXbTlLF/72POPr3cvxLU8u6L4hKm/lRgVa55dZIXGFwnILHG2FxAkKx1hgqP1ZjYYjCMy8dZashnHn'; +moduleBuffer += + 'yB/X4A/HF1bTrJrZ9bSu22sWdiHsnBWvOM8qoEaNSk+y2NbbmM2w/riTdfz2FrBvrj0PEpy2o7R+LdURKoie/akW8LEURM/gIlwn'; +moduleBuffer += + 'Gh6NIYc+dC1g6hmlBUzhPFL2gn+UlmCSxXd8V0vQIg5U+vozTWI4F/hTTeI/1za0VCz8F5qFf6Y3WBYXzkN+VHMwxeId/9s0B+Ec'; +moduleBuffer += + '4i80B39UUfCvNQWxvyexP1NmcNOUlxnKrEcCiCHB6Eeu5wYwYGmJzYotGuQsfacGbeLCT2EMKDN7obSs72uQRrVJpdKbcKnKgJfX'; +moduleBuffer += + 'rwtg4BDjcoZJQ2h9E4rbsAorgqqALpOQYtBq0GKApze5HAA+u7XWAesDyjXbBs2jKJxrgzbyyo6EINQYQKYmmZHBxpOkJpVRBH1b'; +moduleBuffer += + 'MzLAiGZ4MHDkdxoQqzVa5IMc/pW5RccwDZ4BHblRXmexZ1qoisIcd2sv6XRdDabqZqDBmCvNQIsxd5qBDkgKZpAGaLkZ6MGswQwA'; +moduleBuffer += + '+/tiBkaQz20KmEA+EOyzQQjDMmhdE07PfkCzoyImbd/vkqAct3R/L8YqlEZwA5elwt0BkNTonKgi1378cF8PD7mvm6ebh6ebdyLu'; +moduleBuffer += + 'Kvf0wZM8fGiZWPorp/nEkxoYUgbsNjQX62XO9nDkIZ3w24/x0xwIrUxPkiSXvRUmJb2xl7267DGh5ZtVZqj13YQypS4Z1xvxTGM5'; +moduleBuffer += + 'D+8we8vify8qzRH7P3FFP06PXNHT4koNRjKNDkQxgLuQ3KFtHYz56D7oS4sI991QKRiuavYj2ASpEFtWo4hOuzDCSU07fx/CqsLf'; +moduleBuffer += + 'A36t0mhwodKgsjDhHhGRd4b5yBk44vR4mkkJaMX3fc1TbQENagiRlsS7CMyc+RDuyRCu4+HiEDmiISsk+DnLXIFoYHvRBnaBAXkS'; +moduleBuffer += + 'tBzY8A8SavhO65BK2Kctw2LfCnY+eykYN0tb+cDKuHVtG1ET1m89v5VaL9wlqnxpXrWql/w9QwbkO4qWPIed3ey5EJozQNoC+lu4'; +moduleBuffer += + 'UiNOBh+VrFXJyVt8aCPDB80gTpaWPSRrTqTMxqOgWYzBSEYnH5QZL5L3zTz1D0/CpZnkK6iXwnq1YGADy1o4GOmGaykGKgJdEy+X'; +moduleBuffer += + 'lqXVkIqYQMjgUS76cTk9DgfdBBE4Gq1JkUzcLCsboGY5T6EM/7UU8pFq6dZY9f32WMnT7bGHRDEzQxI4MVE6UeyJDPWz6PkzmlTp'; +moduleBuffer += + 'NeVezqd9fd7VB5OAZ/8uXc4LkO6oFahek0oOTZpAj4VKhP85wUs3GAzOeoOztwtgSEi7CycE3doZDlg8KR4wQIDKBtD9KVTJJ3cx'; +moduleBuffer += + 'PD3KnLmX17sn1t2o7ko9Uui1Jh11E2Oeewm+6Xk1xEa+r/l2LcPhO9P2n3BIQDoOrkCaSoD6FglQsy1BAzodTi7PfwDlgCMBisBw'; +moduleBuffer += + 'Gj/o3/OoX/Ip1L7Cvky09HymBlZBxq+AnyWZVIA/epOr3mainUCQPFRfPbKQ7gXcUepJw6EYMoChMNSyFlRIuf7xcnwFGBbAtWTQ'; +moduleBuffer += + 'WuB/kJ8nKScoAMcnPp6V7UDow8HldrjVcinr1y7/789Gy+2x5PI7heeT5aEwtT1AxwwaprYH6LgJDedbpKe2B+i4HQ3vtHgftV1A'; +moduleBuffer += + 'YT+L8lLbBRSGhKI9DduTGrN0XIeG4bEFnS1wAxqG4qeHBfa3wDA+XYfJ2J/U1P/BI3woDp0DxOWP0KamBqR6gyukN4Bh50nfZoCO'; +moduleBuffer += + 'kNEwPNcfUXBYy1AapDDhFdkCQ22tBtVFX3NHbuj1tjR9luJLw8y987rUOzRNUD/44ak3x1NWF/coudrqmObEc9Nn+znMDKs6aa0f'; +moduleBuffer += + 'Vj8/ZeX2CV8bZTWRtR53ol2VmLoJcdenRvYQOsaujNwTh63qPq5ZzZT5VYVfuu20/2G2R6OytK1mwvF3BR1ZQ5IzTzAXc3MGAiWq'; +moduleBuffer += + 'QiOYPAP5HVrnJhCiLVTd44Vz+AJWWEIQX+Tu4ennnhAr4AaEhLG5zqIQpgdxYiBNvFQi/+NozgaYGrF+BL6h9kCkpQQndoE0nEBy'; +moduleBuffer += + 'FgonktSCwlDGgTYKIPcEES/YXIpgj++eWciUEFH+SVShQJhQJnl/t9z/8E3woMSfvZm/cND/xMYZFLVkWl0WWhD0puub5CDd+q72'; +moduleBuffer += + 'aAz9v8TJag0uz8kW5vxaTpY7uDwnozDFyShMcTI6ZtAwxcnouAkN51ukpzgZHbej4Z0W76M4GYX9LMpLcTIKU5yMwhQno+M6NExx'; +moduleBuffer += + 'MjpuQMMUJ6Njfwtsycl6DP2POdnMkYWY/Shi9jrkJ3OygqHlORmFKU5Gx7VIquBgN9V6/sTXb5tM3ziy/ee3G3Lud+q2acrSeY9X'; +moduleBuffer += + 'd22SP2vqzFQfWSPZFoX24k4ha/KkwZVt37WZY9qzbNG+vsd35h8oWG6bOeJOo4Hruig2MIcf29ykafDw+q9rPt9c+OZ5X0O1TpNr'; +moduleBuffer += + 'h/J5fT/YGfjxeT59Wn7qHxcvs1uuGv7gYQKvhubxppc75rd7WWxadrbK/Ss5Ayd8HYr1Xiu/OfnLnlXXpPWc7Dosb1Tw9F6XlJWr'; +moduleBuffer += + 'RgQsCDwc0YuX9fxI14XC2IYPXze9IZtX6PTj3JJ5bgxokMe2/6+xzLTh5VkmhSmWSWGKZVL4T1mm+z9nmd+P+m9Y5vff9CtYps3I'; +moduleBuffer += + '/y6WOXNkRbNMtKqeCKafxDa3W/mFW5tR6Pvh7nY1Gob7d3BS/J31NlN6BnKNMGMU2kuYSV5nkdfZ4GqLMYsnFf6r5Zy1U/5dug9T'; +moduleBuffer += + 'QbrBVmhN/o8nVP7M9e9JY8odVjRseiG5gj8UY06F4CLBCYb98wEH+/7PGZs/IK/+HHn6Z1FZM9EhmqTFOOQKK4fkes3GOmDBIOhB'; +moduleBuffer += + 'yAehCIQ3IEgZ1IJd2ebBynFoE2z1OOTGo/zxhhQinHhgzJJZoH3P26N9oV/b7WqMr2jloX+uuJk5/tfKuyXjy8uzdMygYUqepeMm'; +moduleBuffer += + 'NJxvkZ6SZ+m4HQ1T8iuFKfmVwv9NipslE8orblL4Vyluzp5Ynpn+fEb6z/trx9xf218X5pbvr3TMoGGqv9JxExrOt0hP9Vc6bkfD'; +moduleBuffer += + 'VH+lMNVfKVxx/RVQYXePBCi56lQmA2F95o76RJIOafgtnORACJ5ZVsi11X+bfUeHyX9r33FuEaDunpC4D8d+bELIzF0MGQMhj0Bp'; +moduleBuffer += + 'ClmAoL+/sBH5qSO0+5Qfl3ah+SS14TkKQ5pcNkC6WwK+7iMh5EDZ8f+Gk71dp37nZG81UuwiN+X6wiGybipyPbJnKpJnLU43Lnd0'; +moduleBuffer += + '8Tky7t2p6KRjObVbS70QVvE0tFFHve/vTkNuS8b3nvbXpyFT8cTTHH7BkEZ12H8acuO0tBIa0n+vdxMkNShlpAcnpklh7hlCvVab'; +moduleBuffer += + 'JEgSag0GnND8wupMRzpKDacjL2Kdpn9vg/MnCIzm3bkfGt8lq8AIeG4NW3Qs9tfnZX+ZjnqJ/QzUSyhaIJ6OeiSkLQ1p70BaG+Tm'; +moduleBuffer += + 'Mb0yQZziacgP5qdpqLaoXlTWEuVpzB81Pn/+ae0zZyDN7mW2yOmJWeszS2dZNVijmcgvW/uZqG4oJeZxNLozHoQJiO48Wwtq/Sgx'; +moduleBuffer += + 'nZr4fwndWTHzO3THzk5klMpSA+zAH1U9sENCWqTVQT0N8BUBDP9ZyLVVuUmHIYDRa1Z5L3zmvlymagCGF8/yKenUkH6fYXZrSIwC'; +moduleBuffer += + 'c3VpZYB9QkU/0iDfQGiLEJEApDye0tweEp6kn4Fy1f9RTrlnYyF5kjqUVMnCkRqozI/w4Uwbt59FBZJxFahuuKifPRuJK3A5uP13'; +moduleBuffer += + 'R9avFFgx7NvsXyuy9v+tvAhKYUqkpDAlUlK44kTKZLVUBsvlUW6i2yzPgXCZCOsB6mtSGNZRC4yZtw10kMu2P3ulMC/vx2UnQmEG'; +moduleBuffer += + 'dB69Vpdl9iQC0rnlo1FSUbtUWmJxz6f8geb5aCVxrlVFqbf8gGF7/i82bJ9TfvOLwmZD9znlJ18UNhu6zynf8ymcb5HebOg+p/zk'; +moduleBuffer += + 'i8JmQ/c5Fobuc8qPlP+m47n1c8sfz03fCLs3l3BQlrMHjLBvhF3ylIoZ56nyJDTO6a1YtQCNayhSwREmjApDDh+VBgboaXrAuzEq'; +moduleBuffer += + 'DnTO5VjGLIT6VMQvfvoWe8GPUwGZFqr5mRCrTFQaoVdKYo5ACCdlciMaP85kLyBd+5tFpSSTHs4C0Lnf4OmfJaiA1sEzQQV4kcY9'; +moduleBuffer += + 'qG0Wz3Mg3NeyrJBER8fQszBNprOYLoEROR9Jv83mIwnvu1Luf15saLrnnK1UZEuhK5zyLATrPR/ZC+wmDa8ovJ2kjhS+aPVH50zP'; +moduleBuffer += + '5leUc6bv7sUQ9g3YAkStu1kjR2kU7m6Nygf/KIl+KgjkhKrc/WlwPGjLTGA42iSmJktSdswJOVigPQvl8hZIcyKyBdAAiiJ1tsOl'; +moduleBuffer += + 'uvI3MObaIkAGHlmveFJaWrp70IvSUvHK0tLlVUYHrgxc6nXs8hr27a63zzS/7P30TO7zxwcnL/6YMCGbnWO7bDmhT72ttFS07lvp'; +moduleBuffer += + 'ihZt3619V3DGTbG7zvA3w8Iy5BdXhrE2L2kaNvvBIP8nta2a/MxprMIdDWP496M7TLkLEaGcZYX01d+UwulJh+V2mNcXD+yYaFCO'; +moduleBuffer += + 'XWr244nBF9tuf/D7wLPrXFdk7u5iODxh4I2hgZGcC9UeycdkNfV55dYp/sTAFde3vnmfUf9gwJGlDX6z/mr84JpSqGmm65u0xcen'; +moduleBuffer += + 'r7Rp2xULm1bGmEVH/91O2NJjIN0kK+hkiq6YjEgHGKuL0bqC32IHwiHfz7RVEi4utzNWcAIK8xWwDP0XTezx75sYYz46CQpYYM1Y'; +moduleBuffer += + 'gtqaa4UmoXRcj4aDLZ4Hk+SRwlfJvkLhe/+y7/xofBcJFIPS2QwshDUb23otbqwm9MTjgdqDPZft2eJWad0WcYvPX9b1kN7eaD+o'; +moduleBuffer += + '2u+DK/1ofFBRZ/5l3zxHVHAvyUdAFJ6O/FQ68cr9Ui1+JuAsZ4rxVK2SdNxW9iDy8tmcx8zAJo43ath8G8BPql919XLoIOAt62tp'; +moduleBuffer += + '8PPXpVs8lPmP5/MCHlXJ3uEx1P3N0mfKPSUFLcbXe2lrXdqt/QY7GwfCYcuplcePjSvKn3U5f3eUbMvhTkc2ncjdWbLTuOnVYN2S'; +moduleBuffer += + 'ji03Xgmq0+J4vZUHXeu2aQ2J1PS7M2fVOO7quVuwn1/apOuusOqxR9pntZ+Ulzq95P3qxeGrHSfFNHad6qJ02CAIlkgkXXMr1+ac'; +moduleBuffer += + 'mHZsZsKNT7deusROmJt4asfqzdzRB0U3HtQ8HZrNrRxwZ2gJN63mh/ity5cvL3T89KLm3WTPurs5n0/a6rPnH+oVdJh9wuZF/tAT'; +moduleBuffer += + 'cq/7vebZTFuZv+ntkYn2GPPDBVBRxVZBUXUrYVjA/eHWH27Uql7Vate7Hnevzhn10MrWvX2kb6T9CvahhjEzL1grxE+yHm9k1Fmf'; +moduleBuffer += + '/wF0lSetF9r5pd30KNJoFm8K7DG1qWa7YeoSUdfdJi+7zkzlorOBpwXXjH2u9vrh+Il9bjU7lPYuuJu/bZ0qMddt56d9fdPpeE7/'; +moduleBuffer += + 'xFOqOU8qDbZ553uqaGUDzgHmE0Y1ycScuj8aH2POvAw+fI/VqTQ+qOH7CQuWp7S5Xtp9ZKOPmvWNuakpHN7IqsNGFbY6sGKc9ZLj'; +moduleBuffer += + 'Ph13xX9d4uB5yG5fWhyIX91u9fI5LQF9uzojK6v5VNfP65ppmC+Dqkw/WxJdufBOD2xLF//B96WZ+fUe+S0GLfJ6TaRk06QXpXNZ'; +moduleBuffer += + '4/r7Xq6+wHvT/IUsmyD27dw7Eu7gs0lNp/ZZ9U00apas8vN2h9KaHVreY8LdYdkSSbXG+1YwJ9pVbnhpnXZQ0bnh8ktxp4Z/yNqo'; +moduleBuffer += + 'UZ6xzvEwNpkAHQddJT5kxoq6oGsFtOxWuqC59EvP11XXN/Y7GuN7pNGzcVqfDvJuo9dO61vUb0alqGX+3dflv7P50bE4QHIJvH+U'; +moduleBuffer += + '6WapvUZe+oZ5JCVo5ZlH695/2HzV43gT44aWsc4h295eebzV3bj9lmhQg38xZq+DD+n7e8aXXcPeXZp+51RSl5J7bpu+Rk33LR0V'; +moduleBuffer += + '2ui2zaNPz9ocjVn2dMGqOXfP1Np3/oB7n8pFVX80PqiwG0SF2W6cBLqM3e6vfuljz0jU4S/iGQkTPg7JP9+oSfN+87Pnj5gw5cz6'; +moduleBuffer += + '9fusB+VUsw+qO6C6sZkItPzHi0uXXwl5X3qyFff331QjTs+OjzzTyrrVfF3Iq04L9ig31AhdE13quP/YOmvfCStBy1e+Ey3JSq6C'; +moduleBuffer += + 'Xfty3bf+mCZW06tresheyZbZNnsweOkQfkkNq6cTc2q15wga9nqjcJ23S7ew3cYOnnf8vu0Zryg++PrU2cMuM+N7TjksaSZXGIvv'; +moduleBuffer += + '7HnXQZy7vKOmT//aoMJuwQq7GZ/+qbQ00cr0eSgW8qTfxNo+j+Nad20afd5UtGzv3Nu1+6b7YF+6pR2JrH2FGVhwsNKPxgcVdpuo'; +moduleBuffer += + 'sAPWXb6Wlq7tvf3r09g2b+tebNIgfKm0yuI+ofsXRywwdd7xW+29reIMB+3efV65q+7luzUPlELbx3VJbtgz+UOs3lHb04u0m/p0'; +moduleBuffer += + 'W7Ks2reCuoeHja47aFXmZ7vbtaMmTupWMz+o8oPl+0EPCxedLFXwG5bOEDVvZz/yqeH17vrVRkalDXl9ZZ/znCPb8wL8Q2JefLpq'; +moduleBuffer += + '/L3ev+hhd8GHXLKi2CR0JwPXw/v+iQSzcx2SYIrW/XwJ5ta68koW/06uyH0MNwOtf6bgo5MqiZVZKP7kbnQg3B+0prRhSdyG0rYl'; +moduleBuffer += + 'cVsr5A+Uwu2sSO1fEre3wB0scEcL7GiBO1lgJwvc2QKbtYVJ3KoSqb1LPbfAvjaEWDnqGajdt1bqvNdvch/POtym1+SRR5+rnCb6'; +moduleBuffer += + 'i/XT652tXLs0bu7lyyFVfmbtI/82SPTsuBlZcG0mFzIovIWUHim8lZQWKbyNxBOjNjJ3aoLjovZ+Ya2vvuCAftexHv4PvJxG6doe'; +moduleBuffer += + 'aZfbsAUVf3YlwkHd2hdw8DT90U7ZrC625s3mRuHj7nybMqPVp8arGw/ivhresbvNhtLXXk+utRFje0rPxPY8XfI7w47xe91qY3dd'; +moduleBuffer += + '7eU3fPTo5UmXD3W9l9U1oM3xkim3Z9Rf1SYpvMVL3xH9htQ488J5fe1Vw0bOOtCvWpWwJPuQgNigRQeT77ffo0z7snjTpQj3l/N7'; +moduleBuffer += + 'Piy2jtwzSdwzC+s0QDdLc7OtpO/FFvWHVWF2eK/r2CqC18pt4S7X+7+tCOTfnZoV87Z9310vOz36lm8zOkrYMfP6FfxpE6sn7uem'; +moduleBuffer += + '1OSEL7kQlvEid/i63cwxza5ky0vabRCNblKrV869pq3a8h0mZj9pfNZ/UoN3TqIJq2q+rralvU/JnSnX1bsuHps3u3PIol0lQxvJ'; +moduleBuffer += + 'OB71ru4Z+P7YVDuXuSHRNUOcO651HO2z8ejukkZfnXuIDhcfaPNYcCJWWcrKlt1c5BxYw79zrYsfb8/sdfPUjPX6RcqZl0q/PWrn'; +moduleBuffer += + 'eqg0o87ipba1eMUlWYO/uuUsnfphuIN87Dqx25U6eI1RlfFBi+68wu71fW0s2NHxVKt3WYlbqtqvPZ+5naN/YJI3ajl7e/SwjV02'; +moduleBuffer += + 'PHi3e1Tm0RG1FmwbXv/Oi2+Sl9fyFldeuejm7OuzHlSrkvZ2d8y++zXWOzRJXb2xht344xs2KHZE3xGsz4+IiT43Jov5VZgwiWVj'; +moduleBuffer += + 'ko298T5sXLVDjpcHDJSufWAyiILO+Wq+zQnJrnvlxprmT/und191+uW9k7drDUq6FBnabEjz3WE3BZX7pY/HhZ2u6s9viJn/adLu'; +moduleBuffer += + 'McEr5L5DLygfP63m0Kmejsl1/d3t6nIrwbreaT20w1NWN+J8XPs1oyBxW0HdKy9rGZctZh+40G1cdPjebnXH5vbb131jg9w4x8MB'; +moduleBuffer += + '9nkJtVdNUS3HrS7vtV3UZXaHNikN8al2R05OLi2W+K4LdewyZbVO2OyKujaH8Yw/2Y3z/MSrwc8vDPWs+uXZXPbiwuEziz0zzh4T'; +moduleBuffer += + 'O4UG7fUb+XXulYZfP23w6LDkc0Gd5LD7PgKf0jttKid13etYi1mcOaT2Md7dzzYerhNbjzwnjLwxe1i7s4dvFtbPu+C0jHWvH3Mn'; +moduleBuffer += + 'O7Nzs+rsKiXDIq3r9Kt8NGU1Pii2JaNHpMdLdj3eFV2dh9M+fg5KYen72l45tj61US1BblVj/T3vnsu6bqvLaFzveOsRkz5vvH6k'; +moduleBuffer += + 'W5CcH9r+8/sOjm2e2hcGBnx4F/7RbdSbnIttzz1f/XTH1PPOPY7ZTuy+PrJ2estzGxrHsPC2yzy2dT446pFPifzewZj385bpbg7m'; +moduleBuffer += + 'x/Ucv8BTaZu00Vc/SFv9fVF6prFqV2VxzsmP9sMPt267V7jtSlruhDZr+jW7kLhzdJv+569cupO6s/W8estHKic1/Nqgbh6r9G7T'; +moduleBuffer += + 'JTfTTAFt8VmDj79NdHz3/lAzn6lvZi8/6FHSofB2oxeFO7x2uB/Y3tmhepXdK/sdrpc+a8/kSdv0sg/Sfd29632ZNq6nK29kJ5Wt'; +moduleBuffer += + '05HaI5W7e05s2ODRrZLii9cW1/lReqLQD73zZlC0k2JJ7LaYOeHNDYZdNk8mWp+4eVZlb7fA/diU9sohixv1G+BQqdM5dhW3Gt15'; +moduleBuffer += + 'QYsSJIWzMj8YQ8CM9tuYvjMmju1b3LuI51TZw+9WvYXnB0xb3F6mk3CYhZdXjbcLeNer0+Sgy3UHtGivues50Ht81ehh/edXPlks'; +moduleBuffer += + '3P6w+S4Mu9FynKvo0KmhlR13j31j/77ujl1rdk/7GtOrSkNxn8VxCzqq7X3ebTwx1F+kHvjx3dzba947NRZyJnJBbx+bf+/4Zvvu'; +moduleBuffer += + 'kWNKDyXax309cUR/lx/mji3dOvWEx8vUhMC0aQXDbqontZq5ln/iiXz8qKZ411YjKl3f2bS2u537oiGj6115uyd03uMzbcSH81Z9'; +moduleBuffer += + 'XHKvW8dpezTLq0xq5mLdsufJKQ1HPY+/+dVKeHnJxbX6RXjjgOChg5173dk1YOTRh0+/FK4dPTtddXZ95c9zNI+aTq+zveWNm3sd'; +moduleBuffer += + 'mz6t0vb4/vf6abemTBJmpedOjvDZFLkmeSBXObyW11v/qUsHLJSH3xuSM+lTSVa88sECp/N24oQaEcMc603yXJ8auSCy+6kkjahH'; +moduleBuffer += + '9MDYwCFeS5YtODPik6/k+atV52sum2Lok+KRl1evyeQ6Xdf+7sRtGNrB7tPb2deeP/V5tGuCZDZ3taDJqw9z5InXujrht7HBR69M'; +moduleBuffer += + 'KkzcldiofedXo49sPVxZsHLbsloNplp1/pSVHB8oT8m/zR11vWdSvd3vuq8R1Wi+437i6PX7bh+q07DbGPvc3X027bea3ORZxrVv'; +moduleBuffer += + 'JeFNnjhcrdIyPK7J/t6nP9eYJAr1fB08zW9hWmyDmXOZ1owvnCrYmgYb355a3CK/W/SEKNuA9Ibd0vu/3DGnfvEEjlXdHdNbBn3j'; +moduleBuffer += + 'Dj3T9m7ekH7ONepzL/htSq02JWBI82mN23fSLhRExj3ZkDTRtdp7G98HsrefLr/mq+qG6Xm7T508Gae04Yp6aMLGG59MPG/dOa/K'; +moduleBuffer += + '40lxv6mn4jxb5ovbO868clcUNO2+QHFnxocqCTVbNa7m2NBhhnDmgL2LO43sFC2v00B07IW18G1p9t01VfySf7+fmWsSLz025mp9'; +moduleBuffer += + '5237t9Vtvun0SLVDM6f7wfneqqd9w2UOYxJeNhrYM39UQdqn623qfjlwLa2bXtmrxhYspiTq1aT0ey1mjrX7vM1bIuiaIq19+eo0'; +moduleBuffer += + 'Q6UE7RW8190D/ITXse0PLvh2U9gtvUp0m0XXPFO6fUvt9/7lqlp5lXUl6s2PnYIUZxfE7Z3f1rdT9dPZv/euHT7qvgseKttc0uTS'; +moduleBuffer += + '1vVjv9kw875Fz19SaDViganLyw/9Xnevcjjd6DN2dEKE67hUl5C2tlVrf7uw41bRGLZ7+qC9a+N27Q4ce75/pdoHXyjmu0w65I5t'; +moduleBuffer += + 'OZ7QTLu7+bqvI7bfFdQ4u3D+498nRq3uOnvVspTfHhxb93mqs2zHFJbNo0ObXrx8pzko2aG/Prqw7czmMxu/OrNwXdqxxtU+L98r'; +moduleBuffer += + 'cOi4OOiy1U1ezXN6j4xqAapqJS9XJTytvXN2cceYUXaLrnnwDcr6+gUtP2+wxZ+kJW7ZP0F/YpZkSdK555v5CfJzg6v3vDe2Z81X'; +moduleBuffer += + 's5huWY/WTbsnv1J6z/O3b928jx5sK1/e9vOcObixjV2y5/hiWyO/m3WmZ41FZ43PJq/eOHCG18q5yzcy941Mz50zutKDnk939Vpy'; +moduleBuffer += + '7PLuSlM+pS7zduRHb/p6J81z35uaLivf8c61fDzQLdt7W69d5+/n1E1tvGhcQEabUxEN9fO+nlq1On1JrT7bVKX9n1VfeL51jcbD'; +moduleBuffer += + 'vw6ffKvD+36jG7otleRfWz01s/KuSzzTh0u5gdLGwxra8UBWfR5/mbO/++vVpQqbpgl+/VPmpO+t1GzPkxpTdmZtuvu8TfwhqZhT'; +moduleBuffer += + 'vU2vOUMYmuOiThktak0YUtqvDm/Jy5TadnvZHXY7NHMQu6cEVB7/aof1u/bFc948KxBFXpvOy8e+nK2663w1a2xb14vVg+8lzGl0'; +moduleBuffer += + 'pk/MPJV410BJ06rNZ8YPuNfqyLnN7TavjznGGN7aZvu8tW8GORQOHW2YeWFwftb+q9frevOG+rvMda/WqtfaXZ2nzak0Rf5+/rKM'; +moduleBuffer += + '7RKFvOrBm3dtvroYMwe4DJ32uWafNcciCj/W/FH6/zMnYWv3VrSm+9+rui3/wX2OnEI0GW2Z0OrskbRNrEJnXbOXfTces3eYIRCM'; +moduleBuffer += + 'cjY6+S3w8+jW+eqoiSe6z+te617p/Mkz18w3YJHL386uuRx33ddgWAtnPnfEHfddWybd77W1f8TrTZOa3e7g3ehL6hWNb8fhzavc'; +moduleBuffer += + '3ycR1781r/W3NOWsz1pnY88N3ZbN3n9g1o26fYPHpd1vNX9fh24jR12Kir+3SX8k1W8MU9pjiO21Uqg0oRrVHMt1G4/pau3rGPu8'; +moduleBuffer += + 'YVtFRo+G11iP26zMb1W/bl7T7hLho812v7umjavCbejVzKvlzZJXNqerLX6Qbnd+8zS+Kvj++D1D86csG/VU4Tyt8abh3bJmL797'; +moduleBuffer += + 'ZPL9iTNrNytEk/at5GyHwtvI2Q6Ft5OzGwrvsMA7LfAuEt+ax7+cujLk+YdVSyq1GJrgft2xj7STt2i2tGGLyX0i9nh1DNbj3ufq'; +moduleBuffer += + 'tAvvbZrU12ux3Y/uN9G30KCy3I+m/9F+8uOLB1vH7MPsD7Al56FzztJrpaXLYktLJbXq9IvtJ1TO3JAwujCrcFGX9akXFrW6enZ8'; +moduleBuffer += + 'u/A3u5u9HYXVqOijzJIPoKPMcqqgTQxKiwyePS6VgVgMhtTIoJwxMrCiA8h85gq4wj1MgVzO0BAe/OBajlypUBoNHw6goyLNGmno'; +moduleBuffer += + '9HOzo8B6B0lNmQr+Fq+D5b8F/lGah0Ny0HUMuuYQ/4Hr2BxzPOLXYPJ+NTLeGDL9KPJaDT2H2prEdSyJx6LHOaPJdJXIqzV5JbPJ'; +moduleBuffer += + 'sSN/kOlzqPzICDlUOaqS9yvAUysuk0lTofaDC90oEbw89hAiwG8w5FOfydBDH5QJMvCvkaHQ41IjdepSGIfFYoYlcBOiBJIIdgIL'; +moduleBuffer += + '/CumTqA3b0W3or3zBYaIOnG0EiPLWabV6uXwdJoK8Sn4fU+lnYpQ3vWskYaOiMOyOMQUw6YWof5LPPvOIaZUf6GsEBiEvQEycWVQ'; +moduleBuffer += + 'PoRRVOIV5c44Jc499bPMEqt8mHZ0qp9FrtAQGLqxY6gpn5tkNPN5P9DBGuldtCwSzYzYnJHuMPo2s6vTMg9e5d6BtOPLl3L9YTSe'; +moduleBuffer += + 'RcIw3t+WkFR2dzWVqSHQiivgsQMYzw+X+WGE5ztAQgzPIoA+KjGsvP9R6NCyAjTZCCUyXxd/IrrUoHF3lWrgAYmUagozAnSOHkcc'; +moduleBuffer += + 'CAdNUPHJjywf5Y/2NxL/pT/af+i7Nc/iXRXjuxX9+xf+Wsvl+Qf/tT/kzbXi/blCzbpffhK8RTvATZKK7mt6oiIQTV15DNEgaH5U'; +moduleBuffer += + 'QRqa38nLVYerUX6NjiPdtbkYEqwoDA/KbEzD+zCkgxQkEPA5zAhehJgTzIkK4okZInEULyJYwBJzqN8REj5fEBTKYYkZPDYnQszj'; +moduleBuffer += + '8jhRURwmnxMhCedEMcUctkTM9RMRbF3EiZRwIlgcEUcMWh5qJaL7QvCPEaqyISjGYb/PRCBaKce1ZsRjeqMfEjELjizk0lClzMbl'; +moduleBuffer += + 'EEYrDUrza4LChegH9LoHxmM66AgaZKACaOIJpNOVdQLppDGFQj6PxRTzBBGMnr0ZhM/cqScQnZsHrrBfLjyB7HdYAlAjsWJnkZDD'; +moduleBuffer += + 'At/LYgAisecEoqeWcYVRvGhQCTAK9ozM0zIO6Lsd3TIDGA4n0QSiwUlkfkw9/9n9wu0kavcuGHIYQmF4ukQDGoZ+qTvRMNTwbU/D'; +moduleBuffer += + '0OKjYvTAv0OfKe1G8gzDWyeRebcLqCDYfnQMJXqK0FoSIpZWowF0BOAoPMlkKH/DgBtDtAajpMyzcQRuzAA0nXanLD4zkeBmICfy'; +moduleBuffer += + 'Hi5nyuWAmoHPhz/AA2Y6oEO097ABfQrSa1NxjVCpw5kq2BJZnExQM4YY6LwyCGo5w3RsJdR21eqzeIay3+Yf0PcmlJUgVRVoVFmQ'; +moduleBuffer += + 'sxiyDEZcXfaLr9XqREapOWv4JESqkaso4w8etCQhf0M6CcePXGAyxgDOjMfjeq0IZCVV4FyTSgUyFOF4KvySshwiTVqjlJMpwwFx'; +moduleBuffer += + 'JpgbPLwenr4JKpJwPx1kMoCPw2UmI5UQ3mGDQsPPZOkJyy82ng7PHARpwwEL5is1qQayUDCBBggi1MH3fFBNMAst9JUKpBO9SQeq'; +moduleBuffer += + 'nKbeWE7zEXyJICkcV8M6hLZmCugQVwA1aCUayNOgBAKoBnTZA+1o4BygFhnqkBjuMFcjn8M+ZkfSaepanYwH49ckx0p1Mm5VMq09'; +moduleBuffer += + 'GRqSz6qT8auSaaqTedalxa1By68yieWnHDAVCP1BGA9CHggrQNgFwgkQroBwF4Q3IHwDoeppMG8CoSUInUHwA4EHQk8QlCAMAmEs'; +moduleBuffer += + 'CNNBmAPCEhDWg7ALhHMg3ALhGQjfQLA9A2RSEBgguIIQBEI4CLEg4CDoQMgGYdAZB4J/UjLcfOyPMhzk1aQL9XJyHR13/Vk0JFFp'; +moduleBuffer += + 'TDAbZlGiXhlfa3sO2f+ISBdT8I+S9xZYlPE/kfegFcL/dvluEfYL/PVbPAuwwCthfKkB9/FiUSsY1EEQ4CrVGUwqqKQvxjONIcT3'; +moduleBuffer += + 'sZUGaOGXgcv50kRcRZ7nAIi4GtA3cC1LBSomCLa7VJ8lBBzluw/KlQX6YyqrDHGWDieyoG6Y1ybgCgubE4V05+FYuYhkFDmcLUMH'; +moduleBuffer += + 'U2iWhokvIp17sykhaX6kuojsBpMAIGbkSah7DruIrDDRTA/moEYa5nDmrjR31oAyNf/ODNRUDCzvInK3ffAikm94rgLzXPHWRUrn'; +moduleBuffer += + 'n+q9lF2A3FyZJSBOMyIOaeVBRQH9GH5jo0toDQiVjSi1ucOrstBMG84qDbDcIJ7fJSRHdQNXaK1jnovC6SbAukuozr43NSUmpODZ'; +moduleBuffer += + 'KBAHysRAVGUIuAxowgENQxlm+27Yf8rH0ZJDiGwBDDtFlpsUXcx+D4ovoTb4bl0btVqGSkv066qXHYgDz4WccHN9ul1G9akzD0CG'; +moduleBuffer += + 'nBiB4B77MrKXRvIdQ67Fyy26EEZFeuQwHHypuWdgfUE617L6gGezMNSgSmdeLm9jCu+j9TsMW3sZybtlRrWMss8BEWElHgNxoCxG'; +moduleBuffer += + '6zJY8WXURz5eRjKuApSv+hUHYgx8rz0sXuoGXZs0AvGh1ZWRJAtoxUEK11zkcGWRVqMBpGt+Oak61pm8Muj0IwS8D55NYwJXyJcH'; +moduleBuffer += + 'XEHfXdZvykpBWKySHXMpiNfCgqasssCrSXpE8AqiGhNMugSjlmhPSOgrmtFlQPFNj5Y7AZercRW5qYRuYNp+hx4iGkZSaIr6lbfA'; +moduleBuffer += + 'taqOWbUkJJguFbQKS3rg3g7KBp1c17dDSl8VsKlDUHOZ0dndxcdsXQPbn5hxN7qG6uK+FbLio2MvC8yi4SdWaN5D4TtWyPaMjpvT'; +moduleBuffer += + '8F4rdLA5hU9gSIak4zY0fM7iOcStLbAvDV/FkNUhhaEz+HoWuKUFdqVhuD7dwQJ7kHQG8cOydcKZ19E4h8/K1vnLL26a6RO0SsNp'; +moduleBuffer += + 'nJMB3cXBp8kERTLQaD4YhowoLsvXy8cPRiDOW1FBjkeZj8G7ZsM28x0dyWzLCDJFnAga0DFCwicGuGO5MoFUzjidBTMSKeZcLhrg'; +moduleBuffer += + '1H8Sj0bmyheXYoiwMlqDRttww4GYE1++gebu5ezIbiDa5wz/gjjBvAhGBRwaiaud9UkyWJEEFUC9XqGXqtWUOqL9TSTXFpD97qeM'; +moduleBuffer += + 'M9qZeTk3kbUrdF4P9wooDO3ZalngVjQM7e8cLXBtGt5n8b4bGJo30XE7Gr6FoTPH6Lg+DZ8mxw0dtycoJDN+TymGSbO3g3/d/Ctj'; +moduleBuffer += + 'Vk5Q7rVy7QH/bWyLWXluKrUKfFVq1a3Sz6lNqUqXDLoXOlTtxC1Uvg7k91G4owV2tMCdLDCcy1SjYWcL7GKBoX+XOjQcaYGjLLDY'; +moduleBuffer += + 'Ir3EAkdb4BgS08YD8ZMTwa6AgfHXvKDtHUT7vMhNZjp2pmEuqSBNx+1/wRjaf6fMYhzWkXm2iuhzeU+EFNEmk8MeTLkiXlchZSUW'; +moduleBuffer += + 'Tp3BrBGQGH8XdCyTVC9DnrAx3V20/gd5lCsNdyUxkKnL9oNoz+F6YeOfVj60delwD9nRQttYuD5D4aXk2BckpgDqXbb5BRd+x91D'; +moduleBuffer += + 'cnT+PUTDqbkXHB9byXsYVl6OYuplpNQE6gUAsVYbpFTAhnH38LOID9dA2HD3m1Nuzkss6SGZy3y4DniTwTz71RqR7IrcQCF53syW'; +moduleBuffer += + 'oKE8LMt9NOf5lSekyu8j/za1yPFc0Xv1t+6jvXpGVcQPgpFHAya0CgkIMB9KA2R6Ga5Mh7I+dRQUI9FkLKuiHg8cCH4jBdeGFVJH'; +moduleBuffer += + 'f+dbAchWD5Ayi8YKreXR+8H6CinDX/uph/lUf4ho1wMMloE56uQ+6C8F9uKNGPTUo4GdSSqTgSkTQ8qAJ1VJ5Qy+FsyuGeQaMDnt'; +moduleBuffer += + 'IT0BAWlJmgQrXE76+wKS0r9tc4NRTpTXSOTqqoK5opq7AEoNJQgbckVfIGJwKKnU7xHygUWuEZkf8B+hVQ8FboTVolUHgEECJ9Vw'; +moduleBuffer += + 'Wdr4ByUEIPlptGCKCEgovI9cRoEqQOt56eRn02Q/cBu5cRDhsigiA5ZWlxUER2UAQwlKCO6DOjJmMZLgFjpcdyfWXUx6PMqoAv02'; +moduleBuffer += + 'iixVDGhWbYaBgVbSGUkmjcy8SAMjs6OYEewAcs2GoTapjEodPM5OqYY5sYQS8C0G0CIqZSquyqKiKzXm9ij/oTF4IgOdgspgCnmw'; +moduleBuffer += + 'HkwaKbU3wQIiOWxWGAk+RQPfBVQYKi2xlGYgywKrlfhIMLWOzowBH2hgREUEw/UCkwqnahgu9CjRtlwE4LguKQbyrQyWVq3WakJF'; +moduleBuffer += + 'tATfKQqViFYc1J5cpUolytLIyNJQ8TjU+8qIo5zYLFFllVVCZ4YBxxnJRqPOEODqKtcS7MvV3FXaaMDLUgzOuMEZvcuZTAn60yY4'; +moduleBuffer += + 'TshTZKEU1p7kHh6kFAW5HKQszQnMfHYejDBPd/IhNMOHpFkOOudYENaBcACE9yC0feyAiUAwgjAJBObSCyBp4O/g50sQmj1xwPgg'; +moduleBuffer += + '/JX/NL+naOWO+5Tyn8YsgS+5TBwaublC6LFR76qTGuE5oHBs9n+KRmZRZVQLdNyKhndaYL5NhXkDIgSeBJVSkWz8o7ZS9WeI3gWT'; +moduleBuffer += + 'rQT5LVwXhnN6uP7HgbVFPoduP3kYOnwrDJYRQwdvQX4DywxlYCj3QllXhCEZF8q1UJaF8iv0RQP38OEBC5DOw3mWDEOePWGjw3OL'; +moduleBuffer += + 'oUAGl9Hh/inkk3DfFGowQPkHzgvh0cTwkLc0DJ4MivxawV4HD/xMx9D8Ha57UYc2wg7lTvY+eOADXLuAPlh8MCSDQXkDrvdTB0AE'; +moduleBuffer += + 'BmLmOiHWW7AyHEHybQp3sXje1QIHEpj5+SroYcJuWDesO3J2HdClayDJ3jAr60o2lW2rVK1mZ1+9Rs1aDrXr1K1Xv0HDRlDWw7pj'; +moduleBuffer += + 'TZo2a96iJaNV6zZt27Xv0NGxk1NnZxdX6DcbY566Dt67176GXVmO8Ivr0ErQzwL3t8ADSExSc0j/MX5sbSwWBDkIOhD40uwsglpK'; +moduleBuffer += + 'NTJAEqQGuESQrtSaDIBgJOI4XAtQGrQaKK66vUSr2/95r9WCzBJkuEoFRH4PNxeP8pKC/CWSiqtWQlKxHoeOwwj/c4CaYti5l2ic'; +moduleBuffer += + 'U/GySc8wMpXWQJy0oEnXpgKSoIfU2QC4F/gUM6dOxIl1Ur1Wp4ObF//0612Kf8239y3+628/VYy+nYpHfXuogWBOhLbGh2K0eou9'; +moduleBuffer += + 'IrUq9Ep05qgBlFqTCn9JGSooCOgZ1HGK9V6hI1T/LYUs8/eol2YkpOMy8Dk9wDshFVls/Z9Jw2XvlmlVKqRyYHBNNIK6cYWsCmQl'; +moduleBuffer += + 'NYBmoW3uBDBAdBcwN+zoyAgMZMgNRgSwvFdIk821CpJC//MymbdRK5q5YP1eI27R0hZRbzpuRcN1LZ7XJZ9/p1JwVZKL0gCFZH0C'; +moduleBuffer += + 'taLXUYNnwPV3RzeQHlL+PZVRn6LeV0ByK7ixoIIn8DJAO5jUZQ67vsOM1W9QP+33prynK9InLDbzDZJPqedJKq2UWDpEOqOE9+Gt'; +moduleBuffer += + 'b9DuQ9Eb1I81JpXqp52tTax9kkc4v0EzlfdWqB4p/Jl0cUNha+vyz+2t0UoThWtZw5Um5pzHgJIfbV7cHfGEtj3QNQ5de0xE11H7'; +moduleBuffer += + '0DXlA3HNGeYCmTV2qo6MuA67OIO44sePwysjocAaMvJH6SG+8Dp/ahM1uPa4n+c2H1xzW+zfeQFcvdq/Ta3OwnJu+WbtY7KwgkvD'; +moduleBuffer += + 'Y7zSWVhRhEK9dwULC5zU917sbVaPcZsym6+pzxa+vHPhXpMw9uTz4bYni3PY70JvH7J23sTemH85i5X5hD3JumPnTmMZHO9KHltK'; +moduleBuffer += + 'Vok51sO+3Uu7PJozuE5L14cd9nBaXXzw6ZZ7CefJuAL/uG6O3LZrq456OT6B21BTedOmrVO4eYe5re8uLuJW6n/pyW+nvnGHhB/S'; +moduleBuffer += + 'S4M8g+8ysk5+rJMc3FQZw9racE7wunkNOp09cSa4eWheycghVUIW9dr3ylEWGPKwcRPfT731IdKCW/sz3y4OySpq9O7C+msh/AEn'; +moduleBuffer += + '4w6+rM2b04tVvCWVyzvoKX62yLY/r1fBxg0dhq3jGYrmFbjfv8+bGHCk6sA+TUNnywceqNk0MnTP1+vpZ6TDQ90GTKsXvH17aDfN'; +moduleBuffer += + 'dZVqY3HoicP1Ro283TaM+aVxyuPG8WHLAoV33IW5YXXD78V3k+8Pi+mb/yp8wMcw9VYbzbxrrnz2m8J79x7L+PXXvmne595MftM8'; +moduleBuffer += + '3SJT85P8SdKkkUp9pfC3H7s/riTwC9d/mHh3f6ImPPizf80dX+eHN84uOu2462L43JkBXOPKGhHyufdWFI0Nigg8dP3CdpeMiOr+'; +moduleBuffer += + '08YpP62MWMK6/n5wszsRk6aeM81f0ECwaRuv7lg+X1C7Xs1nF9YMFjSYVXvJsaabBT1Lz5/aPf+pYNbu4Xe2cFoJB7l2uNpuhkSY'; +moduleBuffer += + '8Lk48uWXMcKm+T5T6t/YI0xk23yYXf+tsJ+k8marnp0i1ZJ9tW9n9o0s6uQV3XjG1Mhs770rbu48HKnaG3vUvgEWdeiVy+8TmnpF'; +moduleBuffer += + '+a/erta3VkYdinOsVit1blTzS9vwx/PPRrWN6Lh7wdiqolXS16vHre4mqj4g5nlDZ4NI0GvVo94flohkGy4lmt5dF7XQHepdbXsd'; +moduleBuffer += + 'cTu+/6axycFil7kj568OGiAesG9qu1W89eJeJR81ja49EBvSto5pMaWZ5BF3Q4M3VyMl8xv1vfYyaoTkSIvMsyse7pB0r+skP6p7'; +moduleBuffer += + 'Jal5yTvw27F20XUihh4L7NEz+qjDmbntq06K/jb1YLBb6IHowICtcTvzPkUnta279e08t5ic5w3bG47IY249yn9Z6+usmHHrCt86'; +moduleBuffer += + 'djsV87K3p2FjuE1sqjeW20rqH3sgCCtRbtPG7nDM8btzdkFsJ6+Cg1eKLsV6M0Mya3+uGbe3o/PTJ71Yca/0Hxa188qMWzUxvZYr'; +moduleBuffer += + 'c3XcscbLlbse3YnrXlBv/7P5DeMFRY3fLhkbHu/R3O1jSMaQ+IFt+/s2rb8lfo5zz8qJV57FD/kSyxpQtXXPBV1cp+aNie45zq7L'; +moduleBuffer += + 'NpbzuJ4zHuwXhebt7RnI2PyoV6V3PcOX3m3tNcyplxvvxLQCD2mv/leZO0IGTevVM6rOkyY3j/TKMoSd0R3FescIb9iGf/Pqrb43'; +moduleBuffer += + 'LeRWYErv/at7O69MKuhtarLJLybnXO860ju26oJqfVb0D2/LtunR58LVvs6SysY+x+psy1xuu6zPoJiHDSQhN/usmS508R5fN6Hn'; +moduleBuffer += + 'zntZQ3QhCfqnvRstGDcwocOGgJf3G25IeJVQLfXm9YcJz7cc5cScb963JGru2OhFUX3XdRjpsjJiJBgdHQNiWu/qaz0jbli69+u+'; +moduleBuffer += + '+75o250rbC8t+XzUZbShlzRzQPdd3kWTpBd6TezMCjgore614f3Zos/Skdip7GG93ROXYcNm3d+IJ57D7pe2aP1b4jDGywTR21OJ'; +moduleBuffer += + 'ix498V3qUVl2cv59TtSgANne4WtSp0zUyTwUv3EzNyyUfesRFBt967JsbrLje+/ODvKDhW+MLF+2PHODW1Q9TpY8+tbOpLjpa+Q+'; +moduleBuffer += + '1X1uvd91V86ayLpkWtUIr2cQR5y9FIE/O1TiMCx4KP7oo3t9vPFWXJo5MP73li/wQPuJHy6cbZ1U/cT6zcdGxSRNHJxwrzRlfNLH'; +moduleBuffer += + 'tTte3EwsTPLLT3ky4/O7pBHsyvcHbO+sOBfaZs2EEqlidPNn8evTpiuetl3yqkXNY4q6GVVjzo6ySr449Ujnqk+9k2sEfPU9gqcm'; +moduleBuffer += + 'h7C/Jc5pOS85/vyuz8MV55PXha7KVuy1U66JWLny1tYeyvjEixcbPTQqXwUcr3GTsVx5gV2QPFZ8S1k9uihotbJeysTU7LONh/FS'; +moduleBuffer += + 'DLZxIYz7g1KqLvR19nq5IcVu/HA/q6ePUvjFi0fsbdcy1S26Y8nMDFHqjlQP90GSUanLbQd9vZHye2onubbPUes3qd6B9j4D93VQ'; +moduleBuffer += + 'Dak+YV/vjb1Vpw/5zd6eO1l18OPBHo+9Dql8t37IbWP9VdXG8FtAdCsP9VNB0OEVy5LUD+5O3tFAnKfWnejiPWHjaXX1wjGF61rZ'; +moduleBuffer += + 'aibqnT1bLO+imaX4cjMqNE0zaPDnGQ/zFmluSj8NaGVzVdN5wM4XU+84aNPzUjsFNOVopw613VQ1MVsbWKdtGmfAWu2xBurj0/Pu'; +moduleBuffer += + 'aQf1KsrZua+x7qT/gFOSJkIda1Qe+yljmE68fF/99o7bdI+nev2mNbzU1b6O7W23tE1adD2mu+vk2LTUuElft2+ekHb3YvYNL499'; +moduleBuffer += + 'adfGN25Q+O19mujV3N/035z1596x5lXZnagfXTJ19GHNDP0K909P+4Ue19sn9DeMj7A2HE/vecrtjo9hsFhvs2u2ynDKeKj15lvz'; +moduleBuffer += + 'DDZRWSvuxl4wjFgcM73ZS3tjvaJ319NMTGOjbKPkxBmTcc7M008GB68wykoLPdZVv23sutsw6Lqgvsl+jfDmuQWhJoV6sj2+OMe0'; +moduleBuffer += + 'p2pGxLeTG02vjtS787XSE9OFb/xVA4MY6eO6FcS2EInTXSOKXtxXjE7fIc1Oubl3d3r9AePmO11+kx6f5zo2/WTHDN3Qz87iSgkZ'; +moduleBuffer += + '7T125dVLnJKxduCzfbMCijJ6zXno1YP3LeNjoUOroucemVvfiB0DlikyF7kt3zBqSn6mok+ozrv/mUyrd72OBTWtkjXE0zio7p2u'; +moduleBuffer += + 'We4FS135NfRZgUWTu8zNXZwVnp1hd8jrWpZu5ZikLwW1s8fFOOd0qcbN1q7y6ztmbL9sXNWmv4/vuuxBwZ2b2gy/n90n7n0rzoMm'; +moduleBuffer += + '/a7OCPB+elLY70zgaOsHlYb34453GnqTvb0f3+/zOvvU4n4JttlzTgxv2//dyEbcoCVx/T+JT6aOrprb36/TvoMr7Pb3P1Ri2Bpd'; +moduleBuffer += + '42P/D69yk1YKXQd0mdFkT+pk2QC7wFZrbTNmDuCPc+xVNPXEgLXvZ/l/bVZpYJ4JG9X1nu/ASlOw5WHX1QPv9OwRKlg+f+AV/alm'; +moduleBuffer += + 'd8UXB+ZOtLnXtFONQdsvD9FEBgQNcsxtc+R+UfogT+PKri37rRxUUPR0+Jtjtwf9NNkSLujC+dA3tJNVYIVWXii8yAqtJlB4FbnO'; +moduleBuffer += + 'S+ENpJYGhT+R5qUUrmSNNEcpXGqFVkMoXM0a7cxQONq6fPpkazTXLP3Jf3BFzhqrhNmAmZctVgXMUatZ5GkH5gLVwdyjJpgb/Jsc'; +moduleBuffer += + '/tP0///vZ/5B3R4G5ob1wISg3+mwHCzXopUKsLXYHuwUdgsr/lft95+m/9/9dxQrO2fkGAjHyd8dHZWaJGcQIqRwkRSuq78fsR+z'; +moduleBuffer += + 'P92JMXtWub/G9VcH386uV/bPjba2g6exxqoefl726kx4osP0c9WSW6sysxd1ZjV7esenyQqWZkTT4o/SYcXJd0dt+lCvtU+sH+/N'; +moduleBuffer += + 'oY0+459vKnh/0CGlzfg9NaMWj4wJWbNz9uuLTUYJLiYtYm6de9N/nNudCVn1qyyu0zLSyvnB+qkX2j+yd6m9sFrk0cHJqy9s2b7r'; +moduleBuffer += + '4uWb/Zs+CVgy3+v5qxsJ0+RZtwd9rb+jaPijd8UdBjWu/cR58KwZtT/UuNDj943V8cLB6bzkwnbNpqTd8JyZq3ti9ZvTvBG/DWvA'; +moduleBuffer += + '2jvQ8dbiN61+qx/9cM6aSnV8vd1rHb84XOm0c/SlGevPNPuYG9/94k3fVqOnn+Ny39Zs+MkQcozzIOFhwQrWmdO99XV6j6iR3TUw'; +moduleBuffer += + 'aZHXyjObBYeHNl835+JU2YwWkb3bBE2uPi+v4d6wrOtDbg68MkDwW027jXfrJK/smXh6przT9Pt9Gjow/FuIiu8MXnJr8wt25Po6'; +moduleBuffer += + 'PTY4N1rWXnAiKnxybMqSCUtnFcbUZS4cuHZLP2GH5ZcGXHl76nULLyG+J+Hw4qgddY+u3t+jsFHu4iez+Oee1jxc6/+0dybgVH3/'; +moduleBuffer += + 'vz/7zOYzH+dwOEllnucQpUJIEQkZcgxlyhAaZEqKDE0qDZQiURQpKg1SkmhCGkSKJklJynD3Xvuovv1/v9//Ps+9z3Ofe5+r59PZ'; +moduleBuffer += + 'n73XWntae+219n7t98d0yODAPXqCKPVGmVNchSXH2/HKt3L5AHIUNv2Z+rWAhedOTKxcwVmar6wfVq6ol3rk+vuJRdaMp5yB7CE3'; +moduleBuffer += + 'XvbhzYHbBG3GFC/l8krejZ92uTpFxY+nf+OcrXHzrNDfa1bqLl8T87aeoeTbvWnWylO5LjZ2P3duPUSROBTY2NF4amhQcv336uN7'; +moduleBuffer += + 'uObsGpP1BZfcV0RoqO9KsWI2zf+pcZt758zpzPTtcw/hqPNFdlacGHl21rY3tuTQTyMZfIHltfc7Nw2HJqsvq9C8xcRVBgRsi/ar'; +moduleBuffer += + 'X37QNWbWzGDqgw/HO56mhYR8bZgxJGb2Uubp9PcLWKQr228YySkdG7dj2Zxf9oAaPBF60HuR02Ltdqrk9k/nF9NzK7wD5m+RTkqX'; +moduleBuffer += + 'PV5Q9z1CqnQW9+JqwzKojSXnsN/7eoTLxW7vZWqK96xoe1jXm3FyrsP692rpIa9MeKdOQWI46VIV1Q7NddsX+7JdtumFYV9eql1G'; +moduleBuffer += + '/1IfKl5F21b8saL17q2dn+QuPLJdP8Aj1bhmWog+fDq0aBcl7OdnNvF211rM4+KNw2FSncvHZtHbxP3f6tYW/ai1O6uc6X1Cjtqe'; +moduleBuffer += + 'slV5bOmexmOZzmLcLdKSpa0PahqLS0jJHevCTh+ivyrlyq181vn8+P2rrmfLfeUXb7detKjcOn6J5YHSzKsynCcFDx8/dgtp6mzu'; +moduleBuffer += + 'djmuy2JsSHwWQ93gatrT3nfq3XUqRaXF2y1p5VCDwcwTpSX485za4wkLA6WH19xc8t5l2aEcxt4UDPFjnMr0+0UKXc83RVFcSHrH'; +moduleBuffer += + 'urOe308Uv6+9d8yJOz/4Wz83srdIz6zoq9W4FPOwy3enHiWek2fuUs/VuU8ovq47LuKe+rzXGHLcQ6kb5vbPL7zVYu1wabl75/MT'; +moduleBuffer += + 'ghwmf01y8JOHa1eV9XSz5eUsqc3UI2VKqbJHrPG4L36r8mTEnkpfcVpT/pp4SD+L95bJOspc2CS17cu7NbY5Eb38U1TDS2tj7Z5e'; +moduleBuffer += + 'sFpQIpMSAs2X9Vp1raGNeQtHWGaDu3LgEIvztnnN/BdGBoYxpKCJ02zaNUvWgqOrrrksXx4hmVsxJHsv4NT9RFmoK44+vJaWqcQ+'; +moduleBuffer += + '/mGZ5T2W3mafZ9nXJDtSaaELXfQ3KfIF2Ft9gb0ZhbwZxrEjWryEd1DwRT6v/Tw75Yfa6Jfy/bV6033s2aXfacYjC5WcHDy8nI0C'; +moduleBuffer += + 'mUOlK+Q01B5ejBbbtHmet5OV+3Zr6eXTn90aeay1v4Vz0mDj7BD6zAejERnbKjPPZkl+HlVlyl+w1Mg6RlKJUDoh9vXWpefSPw5c'; +moduleBuffer += + 'Ob7YuPZaqlybBzG3l/5tREuEc33lwXatwR9tio/kv3utIDECX9vE7Zip2ZW8juP9pptA4S8JvSW6tO51y0oGd0viffGEzs+EMMn9'; +moduleBuffer += + 'KU8WUYYfBSYxMPWL23pffc0fpnFVYz5CJfuDnlCrZUfOjTxlXLq5HUpjDJRF7Sy/6TF6hqIm8iLwxMeNNs7vEsJ2K53jKj7qdbrg'; +moduleBuffer += + 'eseEsuxA3Tq+BzN5HW+ed9xs38iS05MrE1jUw5dv3/cfVj10gVKh06TrKrPZL8Ryaf2lTd4SXzOPenQx757fHvA0aPzOG7MbHQ6b'; +moduleBuffer += + 'NlO7tsdE3JTSPNWuScjs1ZiUSXi80x0fOZRWmrHanFcnYPlbzbVpVRp+6GK2bJ/t5DvqsXzcXHvLtIuue2q/UHROyb59gw1sbzb2'; +moduleBuffer += + 'iYsZu27h/onlvBTLj1vr06c+2hjYzHSjpToe2p9ZFXh8o/u6KKaLO+/BCdtu8xz+knHmzW/PrTayJeWPcict7IvuWBnurGhtpNk2'; +moduleBuffer += + 'BY343TstRg1d7ri4UkputunATceOdNOiz3GRc7LFpRsbPxt2xonc2fL11nUdCzP607lv675dLz4ZViN+uNr/ttyrvJq7qi1O02bu'; +moduleBuffer += + 'CY9XW5ovnWSzJ3xbxEnuheczBYNR5+iHotO4UinRIxma5uS+rVvk2SvzN0QY5HiJztxH/HDEkNPVy9nr/t2C8zhlAWFwsxrD7t3C'; +moduleBuffer += + 'U2caMN0UQ8L9jP3TKQufz5lvVxhwr0/xceXCrAccYsXdQ21vl3bIVz+/cSSimGE0S3TR/IGncRy1+CDO9VSKW8dJ6tFXXspZC7Sk'; +moduleBuffer += + 'sgzWctfTa4sSZc/VHF/zpaNj5Sym5sk9Hw68UvJdsi2r7OWiDxR29KeXI0aSh/ol7c4cKKXLxKm4cXepd5Q7RbTN6HE5ydRYttBa'; +moduleBuffer += + '6krcjmfXXlQnznembqwV64zfm8XcfTA3o4VcI5Or2caYpJ6IWVfe1RYRosGKy3gxb7JoyWjOl7Oxw5evUDPLxh9MzJG9LvuheoXC'; +moduleBuffer += + 'Kj/Zju1+c3V0yyH2oBezquo8fHEm52Ved4NK3d48z65XpR3DGXux8d/ulV4/NsZ9ROMlH1S3Kw1aGXE5T/aO9by57IOvtrdtc5Ye'; +moduleBuffer += + 'Hu9hkUlBebQGwqnLUs47BjTXfBbviLrJI6xRmIhY134lQ+Fa+AKV+2z8JYcmpZu0yTaHgB1raiXo+aObYqNmL2lSjO/YQPPaKGfv'; +moduleBuffer += + 'MzGq3CghUq1dNma5eZW0aGLT7mmP2vNvzlK8o3c3iR5zL9a55WJdQJh4yLxpZYbyo2vVnx/ffVfeLXx7i73rqPStr5c3LXnetnn9'; +moduleBuffer += + 'l4I55qU/6GIDmo39Glcmb1w4qDMeNyLfpvgln1+n7W/wg3V9/NZOTizPg8u9O+vCyp+noKbgaIZ378YNp0Wcdkk3Xgo4OuhJ2Z+/'; +moduleBuffer += + '+2b53PdyX6N2z1ndp8ntfrMOPwu77bWHynOdNPkvjL73qoe23MuvLh8oV8rffJ3S0dXlE2YLuVXaOkTp3m3lltm96ZvxuPml8lHz'; +moduleBuffer += + '7Ky2SObntiWpS2LW2g9UNj2JiFWm9ru+beu/0r+h3Lk0K2VHtAyfPq3LSadmzO35NvHVhSPMhLl90vOUbq86bRsaPvB2J9V/dccs'; +moduleBuffer += + 'IwkJIptqy2XPk5N9P63sg1qh2RpaVOgG2sF4louD6+VB2Ym0px7LxyxfTVCn287wrdy919LLZ4e3AaFJ9u0jXr9yyamAzX1m9t9b'; +moduleBuffer += + 'yeytz9n82mkuF3Uu+rWPRobQju/J8FcNmn793TWToesfNvB4L9rkttUk3avV83XHuu5lS0t3LSL56h8f+1bZA5W+oLl98YvrOJg2'; +moduleBuffer += + 'e/fnrYYGdG257uHkWwtsQ8aerSA25MydJc1VxRGPhLpqsc8cvl+Ut5Se/eK+adOmGdwZ0tqyJ3a+k7N4XaRlOsGzro5b8SqluFYa'; +moduleBuffer += + 'syT1aqP2ooc3b51OOuTUSG+uPNY89y11qcgJ9v3bW4rlC7NlzbHTnkaRLnRZmBx24jhK2DZBlcwRgjcn4GfvXEaRKFkkT/nFd8Nz'; +moduleBuffer += + '65eOJetT2p+LF+fM1cp0u6BSvcv4E4e+SJQvid1h3j068H2uTx1DypScYJ5nJui7tfxHHnc/pVdNAuP3/XbocfHM7NHsTO676YX7'; +moduleBuffer += + '344+TK8+ttbCp9OcWSvr2F2z+6TpaNLX/VzmJEXV51xefU30rcz7/Buetdoy27jKrNV76h+ISfYFVvheYxZsqKGmxbQ+DTOX3zor'; +moduleBuffer += + 'KYCat9NT1qIuQe3Nqn3mc1o7ZGyie2107+peXnJ+gWBSfCHrkadjaFZb1p2ilYQld8MfUJ0az71a5MqxejIe6lDWlyx70uRbkkjc'; +moduleBuffer += + 'Qlx37ozj2z+0sGp+1gc+8g5uSYhLeRc6OIemMkqS3Kq3/vWB4YeURVxdnsJuY7HgbI0lPSrzOslMD3bVyVuPL51I70xc1tL9kFJO'; +moduleBuffer += + '2yr1REFjbVf2wWWvsU6Jb3jB4ozF6SvsOlkveC3FB96ztx87efzohmOnY+MrjvN7FOgnCSePrvZ6sGlWbtXRAwaH5Zzv85PSNj/N'; +moduleBuffer += + 'lS8dcWDujJeOKUq4R/TfGGc3vaHjedQ++mcxqFc0XD2rbM2xWXudV8ivaMM4HnVTFL/yqUo+lsLkMOcfeJLI4IVPDI2cHX1CYcSs'; +moduleBuffer += + '3sDIm8e+OuHeoKSxQYIyNG/nx3rC0N07aqKSm1TPcK4flLzSauguGna5YO0dhQzGvVfmTZGj1uSM3MpZj2XCKeVH/GI/uEt2ls5w'; +moduleBuffer += + 'Fl82ase9utnRe/CM+YbL1SfbKD6iTF1/i4QvdU17ctUGXkRyH1OWhjf7L/Uv/bR8YbnfxewB7lO3wguSW6bPXBj85fyPE+lMm9Pn'; +moduleBuffer += + 'd3W0JskFT1f22rPFlBpdvl3+K/fweKlR8cQAebfMiNvjs8pnKnIv70rdN4NEYaltiBmumZFZmvvsMF0u+ASVfnO5gqrIpvV16hMX'; +moduleBuffer += + 'GuPMZNetLnP4lD/uc9e1ybtgdy7r5sBlMTfuRJ8IXaTP/jmNZlIxNt/dc9WJZymSHWd+vpO9vUNrzRlb2S3lreb0L74K7EftMy8N'; +moduleBuffer += + 'hb5qndnZFH29P5GWmlHY8I59pLJdecG2Q0UHeWvCHQmfuqRVFgzgC9ip5extX54cmnHupfOa9EP2cYe/0KKWfvMNe9+8NXa+5kal'; +moduleBuffer += + '3KVynsUrk+oUxB42rK5rTKXNle69uCjwroyp1JG0SZMHkoH0EOU4i/Vq3tL7OvflJPeKyytO26172+XcAnoPXdKA1y593n6ecn5s'; +moduleBuffer += + 'ltGzymeFObZd9O1n1hT7z9q8wnuaT0FSSZP80bpPF99v0WHaV9pX5tWGcRz2Z/hsu59ZYpZd+K3H140h3t3GLSjqGLjz5Lzq4qSF'; +moduleBuffer += + 'lPl5iivzImbFU79t76rAiXPxNjxpm+EtExLfZ3Pcg9oYrfm29Eeeh5sKRzUZG7eeothD1KVOjau6TDzeXBwVK+WuDeiMkiqQ5WiW'; +moduleBuffer += + 'y/38EebCvLbUWuVJQnnZjKuLNDW/UKl6SyRKMvX6mCLNtLPx7xfL1EusHTD3lD8VIiqlpLPtCfNQ4Y50AZtzyZUszld6tJ6622Qj'; +moduleBuffer += + 'zXToq5qbxMu7Ty6OyMzbs/fp2Ncbgy/NzoV33/Ji4ag0Vq6nwQpu0/DMROM3VHy/7KDimEt29gsFMf2sY7KtH15l8LS6npxYlHTU'; +moduleBuffer += + 'c85bVuf0ZLMKt83d74/ec6jQcaZ5GBtpVl1vCoy7v6nXIcWJ90rdu85Tv81pd5GfYwRuHVs2/Y2gQiX25LoP509kttTTfli1h1WV'; +moduleBuffer += + 'zJT6TE9v33SWJOe7uqtORWHpnFnzwkr9lIjSDmmb96c5PBXIHxza5sg3ottK3FWKsr0ZJtj1TqpS96rc7EKRrd8KVrulSClEfru+'; +moduleBuffer += + 'X3rveVLw976BMoMnlcM5+qfpLq7iL7/MibdRHK5RSFbYJD+/tM3u26Tfo7fZe/oD+7U497fFmn2fTJ43EGn10Yk/ixFVsCu34e7B'; +moduleBuffer += + 'ls9ZuM9S9vKUpdiLMwoX+myWPUfo33y6iSOlf6v67QP7uyyP+x8mPx9lPMl+4DVNSsyMVt45Xdc9iXKtz3F/4KJTPo7nVIhbVFdz'; +moduleBuffer += + 'Ay5aMGqOKjhYeCxbs/rSNKbTbszz3f0OYs02VpcGGvsoSz5ibm/tZNOsTz5ssF0nLtN5GZMfbL3gafDWZ2se5xxjnvFrtrtMJNhs'; +moduleBuffer += + 'P/Lq0/OixdQKk571t0XJxfMmjd5onjgr81Wj/6fxUWOnoMldcl9SlFieQx80f1beit46KXV2GFdD1Xi38E3OtCcKcyY3n1d46CE7'; +moduleBuffer += + '5EzcYpm4vkowOZnTX1zOGp5nZAhBvvXVOrpPUz/OpA0c+fIZCjQwcUt5n1PIFOOlc77Nyru48ufLoEtRjlRTdtv6lak9P+I1+7au'; +moduleBuffer += + '8rSI2ktzyRlvax3Jfb32iZFvc+pl3qnOO7ESu+JSrq1X7zd7cIftwgxTXzvXp/XA7e2p2sVkuoKC9BmH1YH2OZ0lZostouT6K+OG'; +moduleBuffer += + 'zNOcCjtPp/nNwXhKb/X0UZoMfvb29PIQx7v7N9EL9wRKCE57n+zdYc1d76Epn2z10az6yrma5LX5p33Kh6QNDm3XVtP5pmFw7c2V'; +moduleBuffer += + 'Prdh+qBPTBKdd7l3W1577pxvA/IrHNT0T266k1xwpqtL53s6h3ncZYQ/UXCwb+is3fXRMEYJjzZ6TlvG9qJSVnjebjfK8z3nr32o'; +moduleBuffer += + 'WjlvWOJ1ws2PSlzbFysh15Wv9esLeQH49I+MxxXSUGl8dX0QL35pK/kKReH8iry43BkFUppa1eeKGrmJK5k2PqXV9k+Wf/l+XT6U'; +moduleBuffer += + 'mbfIipQ4vaG97OXwLv03ilTV0ofmeQQzNxs9l1QFs1CZS9ueNTEPj78MuUElJN35zFxV8CqMKj1xTjHI0jBvdib1ft6DzVVuq1JJ'; +moduleBuffer += + '0fozbt5kyUq+ktTNYby9/yB7xNHwcCxLTHZOVue6mqhoiQYLNekf1NgG7dfZiiMfa62PBbx0uyGrTnCvtuCppTc+rJK3P41lK+I3'; +moduleBuffer += + 'ejVvcgl7JKX6Jjw9kEYMadhn3TgY//Es1cyBFsU7cvnwS2LB1X2u14vGCyWz2W/uLLJ/kIBZGJf34Y7j8Se0o1Zx1rx7mI7Mm2VW'; +moduleBuffer += + 'iWRluaRW9RB2hy59zn3XQwce8qXvnVBUjFvwrVhQVGrLXGdP31Rokp9pdjkq7Pj6mDSXHjk/xz1vzLX9PDOqf94k0qqkq0+UvG/a'; +moduleBuffer += + 'cd42XG3v/TWS9XTXwhIanaVI5S4c7Kex8+W73g5IPrNK7mQEf3Ga22XHSZhW17HxELZn3nTleYGbzRi6iTrrxzcFOhjIwt1oHW3K'; +moduleBuffer += + 'hXuO2XsaLWwvN1xcpLykn9MgVnQi5pEuWfvBrbCtnRcZa0Q+yDWsU87fIfmw7sHp3ZSup6V+x1znYmzYFyZ58Vu5nFfT31V1Qc35'; +moduleBuffer += + 'NO/9FdrGzNNVsmk5dvfC7aPflM3K/EHpWbb7RFXZK+6Z2nAb8U0qMv0x87bUu77dMOS7g2SWW8vcOqqPXx23tTGzSpTo1+VLXXv9'; +moduleBuffer += + 'EpGSdTy6Ny2mLVhwX2aW/p01J45Xj7x9uPPUIM+SJV9fcElOrsFrQErKZUdFM1XwEOvjt+rYJOtcxTbrxRtllzzLs3eUfavTpZT5'; +moduleBuffer += + 'iPikkSW5yWZt5Ct+1ll+xzoCYzZto4ZU0hZCXvy7ZrfPs51UeXeuHIcOG55pGmhf+FXz2TJ2wb4UvUWjy0XqSoNvZLBO0TCW7RX1'; +moduleBuffer += + 'GDGIgrHsAxMMjOUImOBgLFPPwhNYC3mM5V4wlUbHWJ4AU6ulMZZVyBQuIUUOY3kTTLbS4OWPwWRKOxtj+RpMCpp5GMuvyCSe75UP'; +moduleBuffer += + 'rzDlHDLdv84aTrIbTB/dzYXTHEOmCQhRBCc6BxwEK2JhLG8AB2GLZDGWDxCHCAgjKsayB3iAM4ITDgEP0EYyGMukSsQDzBGcMgfx'; +moduleBuffer += + 'SEL0CGNZAFyUQILTViBuqyVKIqFaKggUhRJJzCmfj5JJ3Cl/dzYglH6lv6gHSCWG0LXogwCxxBH6aVoouTSVvmQjSjAJ0yc8evoW'; +moduleBuffer += + 'kEzC9PmNS1GiSR718VfOsQDZJIx+uaXMGyWcpNG1vemIRUkn9Mv4/qytqijxhKbviQw63wPIJ5A+obMV54cSUCB9dppvkhxKQgEF'; +moduleBuffer += + 'lkqVnwr+KBGFfLGD8Rm+eKquEJBRCGuf72Hs3DTyBhBSSPrb5xYqX6nyBqQU8rVXTf7+c+qvYgExJQtvXBTeIntsxyKUnMJgHHMI'; +moduleBuffer += + 'jpUb1qIEFZy+cJjoV9ApgZJUspiEVLeUF4XFt90BUUXF8PvDZrDuPaiJAGQVE6PU03Q6L3FrkJCwwriFzLGHKr4W7AekFdXijHVW'; +moduleBuffer += + 'vuXztaIoccWkPOWeI+90lpRAySvuu9uDYfOfflUiowQWRfHnhyYWTUd3ezMgsRgfjfvjD+6dqPtgAYgsrp7ikpZpcpMju4oBmUWx'; +moduleBuffer += + 'DJkxr+T1xPAFGiC0GDtvDzxkHInXDUBJLc759e/InQtWYixRYkv+bMbO+dYfTPKtUXKL/kJzxGVFkc3tFSjBJd32s/KDFtVjfQUX'; +moduleBuffer += + 'kFzyAt7nXVe2x304nQ2ILnqd30ej0I+5RZ1fAdkl/emy0q3G/k1LqCjhJVe1Lk42vmLggS1KetF8H+Uee+5ZspWHEl/sDY2bxJcN'; +moduleBuffer += + '737rh5JfvI+H7s1axhmnHlkFCDBa4Pzra0u8NralmgISjH29TUdyT4xMRrEYIMJkjRu6lC6r5LjaoGQY7XY1OzI4OrpMRkiI1Rx/'; +moduleBuffer += + 'nnXrwYN9vigpJrt767uLl24kH/FEiTFqnLKg/1SlH6mKCcgxVntkfE9bt5mNAkqQyfiTs+xnljWEDO8DJBk14c7Qy7DlRo06KFHG'; +moduleBuffer += + '5G/SfJIemrphciUgy7h6py8HsAl6ZV4oYUa5ximz9CQm7jNESTOmjrf0zq8LC+JvrgfEGVfedPHT73cVw2qDAXlGmSU2nWaIGbB9'; +moduleBuffer += + 'dwsQaIzB5lNtVgknn/fGARKNc95blag6uE1UEyXSKL1G52/pB6s1m6BkGoN365jxvK0xCSIoocbpvSBOZgTtebkIJdXkM7+QtpT6'; +moduleBuffer += + 'eAZnyQJijR4xaHOCXRO18Nx0QK5JZwU/yzrUv4STXwoINrknN97G+Wo/lOoVAyQbvUXPT7p2/Bb9uQMg2ti4uZteKI9fXL7bF5Bt'; +moduleBuffer += + 'vLk2kqom5lHVB3ko4bbz6f2q2/ZLXuNQ0o0ds3TBK5OC4y+sUOKNt/2L2L36lFli7zcC8o0WMpgJfRN8bp6BEnCstNKhxMi6EEtN'; +moduleBuffer += + 'IQn3+JShdnFub9p4HyDiqHf2bjHbeZn3fqwAkHGsTWNv7n5Tez1jI0rIydzzpFhwTc/k7jAHpBx1bjSjlS+WN66FEnPMnTs5+LfN'; +moduleBuffer += + 'kNllKiDnZPJ+Zh2t4E9bwEIJOmrSD12xF4En25+OA5KOOX0Uk8m8sat5KUrUcc/nXY396LbxqhNK1lGOXR9sCwzPK+/fDAg7ht2X'; +moduleBuffer += + 'UvFku+vPeroAaceRkv7Qdz9stPFjOiDuKHS5Pp+GphjTtwOAvGPse+39o/rKnvRjqwGBx5mQG/0u0NgQaoeSePJe5/JqJ8fEby5G'; +moduleBuffer += + 'iTy6YX5SyRxTx/PTUTJP2sp6+p7Fi3qPleoBQk9OVcLgMvVM6Jv3VwGpR4/OTlZrWyH6ciZK7EnviiqsTv8svi8cJffknt1uWDrC'; +moduleBuffer += + 'Inv5owQfjb4hdlaV7J1vm4UkX/t+l7U9xzZ+9UKJPt5MfltqyJvm73nagOyjaRWn95O9oREsSvixTXeeVhC7cK0y+RAg/WQFMmXD'; +moduleBuffer += + 'RPqoYwRK/NHm+Eqfu+1q+FoSJf9YLetfdNWobzn8IB0QgLLXxN837TalH1uFkoDUzy2vJy6KdaSbokQga2DekfhiyXun0+0AGSgT'; +moduleBuffer += + 'vX36YuVGC/t2TUAIUmkhH45G/szmN28ApCDTJa0o3dGkKvDqCkAMcg2qrF0jrNZaXogF5CAluYf7MXNP85I3LoAgZCjm+RQP/bB4'; +moduleBuffer += + 'cyQYkITcEYzZyfaD/Z9e3QBEIUXPMmOXRH3P+2dRgCxkJC4J+06JfjqTgRKGnM875+epKNvss0NJQ0rZCGtudKT7FXmUOGTsqzq4'; +moduleBuffer += + 'c6njUFlREyAPOZM98wwDekP358QDAlG+K2R70lWH15NcIYnoKqJ+LPzoi7ruFYBIlC5b9L1JfFGb5oG1gEyUs9PcMNk38NoTgxKK'; +moduleBuffer += + 'dPmfbpMFq72irw4CUpHdF6e12XZ+9c7BDyixqGUXn+WQftadhZKLNNMuT10FjSNDMijByBZz1b9aMrrgky9KMvICXKZdEPXIeOyJ'; +moduleBuffer += + 'Eo00qFTZXyLyk+3wdUA2siB2ZV3r4lOHzn4BhKOsd2ZrTA81/ehilHSkjlbUM93b1NNXocQjK+aF/tPPi0ZDxsQA+SgjegpSjmmp'; +moduleBuffer += + 'rd+EEpDUZubcL8433ul7oiQk0yKPpqUSJUiufAiISBlygdjKA4HyDxxRMpJiuy1z+OrcIqIAJSSZh1SHdNbSl1hfuQdISe5c9/a6'; +moduleBuffer += + 'maU6Hw1QYpJC02kO03LdXJyiDchJRm781fQxtSMPXo8DgpIjt3h5O2/jsWNnDqMk5RtfDfsZ7hkZ7ihRyTjyMy5/YO2ZsKEYQFZy'; +moduleBuffer += + 'tq7fZ73aIU/s0zJAWMrvtvMKwVItA6r0AWlJr5GvJs9bRr2mICQui/t67+wqWbb2PR2Ql3KNlJaVB7c/nhmJEpj0n4+S1s37uH0w'; +moduleBuffer += + 'qw+QmNIm26c77y4u+xCJEplyfgZ7Kz22fYjsNwVkJm38Rm33uVN92Qooocker1TpzN87TV8VJTV5chUr0hQn9KANKLFJE3iuLSkz'; +moduleBuffer += + 'S7r2xBCQm6y6Sgkmp7lHu3ULIDhlR7KVyjSvqssffQhITqp+VcS+2VqjJ7anAaKTleSbFW+7sdqx7B0gO2VzDnGyTpdFLC2lAcKT'; +moduleBuffer += + '+g3/UofrJhXgipKeTF3ivjpvzYcW6ijxKfMSVxdzcDzZ2hQlP6kd9af34MYLVyxCCVCm5DruBitTB+0X5YAE5TZuG7xb8rr1xfbT'; +moduleBuffer += + 'gAilzC5VS2DKb9mrjpKhDNt2w5ed/jPHLgwCQpSb+UbhrjVm36FIlBSl6OSrTq7ATKRQhMSoedq3K2sTzE4wUHKU46BSqZH58m7L'; +moduleBuffer += + 'kwhAkMqHH9B6vlz85bTbJECS0iWubWSESS1XqREBRKm04+e8J7b0gUolIVn6YB10W/IuY+1+TUCY0lMfQetpk27Nm1HSVLrYJkm6'; +moduleBuffer += + 'Pb78qhdKnMqJhC4JW7A4tGMDSp7S0xtniEm/2naPixKo7IHZnyReuKsl+aAkKi96S9Xt1RfdP29EiVTagzc9628WnVV/dhOQqezU'; +moduleBuffer += + '/Lwn55fIGzuhhCrP2Qqypu06h9utAEhVWtAeqLMtJh9vjBKrrBs/ErPv7rk9n4SSq7I1pks6j3geSq8PAwQrtT/9dSupKuV0lRgg'; +moduleBuffer += + 'WVmvBuRu2vTM4B7LBESrjP0yXZnQMtfBGSjZSi1QwRxt3BcSHIYSrkwb/QTRsYm0hYtQ0lXGYVp2queRKvEsVZR4LVDW69cjvWqJ'; +moduleBuffer += + 'QMlXpqiepQK28WmyFErAclOvBi4r8Aw6u80UkLCUosHrJSJVOPnSJkDEMu6XRjLtjtbPzI1HyVicXeCOsNcmsXIoIUvBeV0Pbzps'; +moduleBuffer += + 'w3ozF5CyjPpvQ3bxxGd5R5wAMctZV6n5kkd+mLS1H5Cz8o2tvFLa6xsVzihBSx+zmuHq+kLvxcllgKSVnr13QO0j8/oyBkrUyr3m'; +moduleBuffer += + 'MU0r7fdXfegBZC19pYC7aFrBZE/RU0DYss9PvDwUtK3uac5SQNrytI+UYnuqXJXzHgLiljbR4Jq84ljZl8Q0QN6yL19QV9QW3x9+'; +moduleBuffer += + 'tAQQuLx1uw6eP1zklXpcFJC4NOcL8/xSc0b6HFAilxV0wnm8L3q44GgCIHNloX7nifIg4+MClNClYhXemfHqt0puRkldVlKJ3w7F'; +moduleBuffer += + 'KuUHh7cAYlcm593KDgPqinnJdEDuUg2Or8tM2aPF8EMJXmayA+Ps6xpTziaU5JWhVdhltXy9qSmJEr1Ul+fykbiI6tr7s1Gyt/RR'; +moduleBuffer += + '3+IUh+MqDaKA8OW+7x2soC0p6qz1B6QvZaZcyErXGUvur0aJX0a5gGxQFnp8y5ZBQP5yM+fctFQTbI10Qglgytosg6Ux5kGO/emA'; +moduleBuffer += + 'BGY46NbPZGYm+/VoACKYo2ARHX5gbeH4gRpABsszrW1SMbdSX+QzACFM5x54WnQ1VonV6AZIYemChAf3B/eedZ+NEsPyftnTk10O'; +moduleBuffer += + 'L+bMQMlhenzUh+kfthzzOn0GEMTSh3L61AICMkb2uwOSWA5bS9mYf7XaxAIlimk33jLybpcLbLKrAVnM1lXsvPZDts49CiWMefku'; +moduleBuffer += + 'ShdlI1wvBqKkMc06OKLvmENZ31yUOGavIC3utju6r2BXIiCPZff53RcPF0xajWkBApl25TKBctd8jstslERmaaiTGJslW1S32wEi'; +moduleBuffer += + 'WdZsY0qwVJCPe1sYSibb5R1f6HTDeKgpHRDKLHlsFkdJ7/bAlVBAKss4+YxK7eebLTNEiWVq8cURp7rADJUt8YBcZtKKh5U+JWlG'; +moduleBuffer += + 'zxQSzGLb9sc9rjAT6egEJDPF4f1ku63cDrHM+4BoZiq8mdzxXBCe+Xk+IJu5jz/VxZbMIY6eXwQIZ8qd959Ye1oWVheuBKQz4/Kb'; +moduleBuffer += + 'Ux7rb3Be26PEM8cg/H2cGlfrzOAoIJ8p8+z891XzxzqDUQKa4dy1Of61Ui01rQGQ0ByVdvkXcl+UWSooES2//s1D2y+GnfZclIym'; +moduleBuffer += + 'c16m8QZvOna/FAGEtLS89HvF4JFCjhtKSsvRP9Fyj3FJ5dVnADFN7yhp32jXTT54PA+Q0+zMPRIHj3DEcFlYQFDz4jalXcMNvvHZ'; +moduleBuffer += + '3w1Ialr7wXcV+FLvmskngKhmS1gJXhDavxdvRslqXprtZMmq1LzGxShhTVPh1e0ZC8BeeqUESGtWVK9G7U8Id0oWJa5lGx3Gnc26'; +moduleBuffer += + 'u999PgLIa+qGo6YlGW4HBAO3avwDtCxY3KamR58+YSbfxgVZJJq2ygyunOwd3uM9R+eD5e3WGb7UUoM5KyNrjVrMA5b+sDpTw3TF'; +moduleBuffer += + 't+g7viMmS0J9Rix3ZZnzvgXTIpb2Uk96Z7/62DFK8asVKZEM8HR5GBvlobzYiGmmkuH84OpXVXJuzrkvvqlc/wPtUcnfY2UEEyaO'; +moduleBuffer += + 'HeO7KJhEiaWFBq6+E5dt/BzGLzAsurP97fEff2xS9xgvMO3j3M7gepcrPLoUetDN/PUWLcoPzWmxHqoiwdtxgztWFpkyvm9Q3qu7'; +moduleBuffer += + 'TowUgg/WNri/iPOt89yGq073rNMIty4n3zws3xnoaL/8a4J69KqDLhGzb9ApyYXeodrdsUs3zvvgIFopraWlpa2lo6Wrpaelr2Wg'; +moduleBuffer += + 'ZahlpGWsraWtra2jrautp62vbaBtqG2kbayjpaOto6Ojq6Ono69joGOoY6RjrKulq62ro6urq6err2uga6hrpGusp6Wnraejp6un'; +moduleBuffer += + 'p6evZ6BnqGekZ6yvpa+tr6Ovq6+nr69voG+ob6RvbKBloG2gY6BroGegb2BgYGhgZGBsqGWobahjqGuoZ6hvaGBoaGhkaGykZaRt'; +moduleBuffer += + 'pGOka6RnpG9kYGRoZGRkbAxvojG8emO4aGM4mzEyS0MLPOqakmBqg60dtg7Ynggfuk0t68Sgcn7P/pr/HIPIYQZF+QgD4vjwfcMi'; +moduleBuffer += + 'IoBwHjoD6L8C2RnfsLBggU8o+vGolwYVfHQcCP8iH49OSY8iyzb+tezvj0/3wfMpfyz/LffnjbkAzxP7Y5kwTA/mEeyThNuKfuW6'; +moduleBuffer += + 'OBx8ewumQwUxQCkPVSWJRKRHQ1cJQnzCBaHRIcIsEUE+oVFTCYVuVDQidiJ00MxTniAW0V+Fc4b7hAat+t/07QL4bEFH21AoEibU'; +moduleBuffer += + 'p3TXpIKPzd+TUUGBqX2f+vVGPq/3/u13wOmJfywPCxUgaqRqfMwfElJa0UANakoCCJGsM/ljOV8LzTv124P5DSe/gq0XttcY4Qfc'; +moduleBuffer += + '8KaGR2r6BYeAz7LV4V0QSl9NzfqXn4iHI0pRfHMzoBjFV+WHBIV6Icq0iEYjxhleL/IxfTEe/Xj932U3/Z3dJ/Z39l/5T+PRj6kt'; +moduleBuffer += + 'gaoQkOf5tY+I1FZU3G/x4f8iZbvql8Q+PwIV6f/HnEhBVGBYZBQ/+rcofyiqcf/nrD+y+KBC/UA3eEqp38fPDxGER2Qf4RVMeUAI'; +moduleBuffer += + 'aUqMZqpQP0SFGoj288ODwgXCzfdBxfv5AqDe/1tmOQbR8ef7Igr3oDShEE1YRFxQ5J/erwmwUhD6CClQPSw0OI7v/0tkH6ljkUIR'; +moduleBuffer += + 'phCBX1B0yB/LgsPCwvlAuxItDVl/MBLrgq8k0AjQ4EfGhQQj0gdIOuVIJBgAf2qngP5zIIgHMPWRehASEOB38J8/hTUR3SE/flh0'; +moduleBuffer += + 'FFCX5a8XRISFhv3arshwH/gsCwRr+PD6o0MjhZECwDr+2Nq1SLwA+HihAQPABgCxYyDJIAwZwPeNjowT/IoZgG4mMs9PGDVgFRI1'; +moduleBuffer += + 'QN0PBA3gg50LQ4S/kDgBSGEhPqFxYPYveXd/YRQBH2EUAXgpXHemVJZ/n7eg3yEF/tAf/kP7SSgujJQHHwhkMgREFwD6omh4gTAk'; +moduleBuffer += + 'vACqJxr9Z5ABdNbiSOEbFKEhclyIHiFGeP0j1gcboij/53XfD5tQzngRvGi+UF36173iLeaf5b6DbR7cPISFoMqmSmGRQo1T5V/X'; +moduleBuffer += + '4GY9tD3froe2M6A1RdRDfKL4JqLojvFBG4IeHXhvhcLJaDtwFs6HvJC6Bf9KgPuBn1C3Em12evXQe8kqoXyhUGQMbliD/OOAcB1Y'; +moduleBuffer += + 'Iz8wLAyuixFhIYjqFtgG5LaCioHh9alA2maq7F/LkY/K4GXICytE1ljkr3by/V/30g9/+R8xaMixT7ANwvYZg8rvIsuGMGiIs6+w'; +moduleBuffer += + 'DcM2NyzW1C8ulG8ZGmf+/0OK/P+QIv8zIUV+tymR0eD25x8dPBVihCasa4jRhT5y/SCiIUzM7/AhTKFJCZchaRHRMaTzgLyYnQon'; +moduleBuffer += + 'gtR9UWF5bOEySWGZDGGdlxHOQ9KwhOWKCaenQo2ICddB0aZi+LBpwzYPNifYVsG2DrY02PbAdgy2C7DVw9YCWy9so7CRdagYFmzK'; +moduleBuffer += + 'sC2GbSts+bBVw3YDtruwtcH2BrZxJK0uFaMImzZs82Gzhy0QtnWwpcJ2ELYK2C7B9gC2LtjewTYM2/8tYVtuw+1UK2wvYfsMG8aA'; +moduleBuffer += + 'ipGCbRpsOrCZw7YQNlfYfGELhi0OtmTYsmE7CFsZbHWwNcP2CrZPsP2ADWsIt+GwsWCbBpsRbFawOcLmC9tq2GJhS4FtF2wnYKuA'; +moduleBuffer += + '7RJsjbA9gu0FbK9gm7qpfPujHR2B7Ttso6D9RgWTfsUwgOfVm1DBcfxXIkgvTdD2WRocC8uMb/UYsXJx5E7zA8mBCOiH+ESB0Qei'; +moduleBuffer += + '4h/FD0LiSyCXpI+wl4eIdyH3I2G4RH5MoCAU3DjgFlgQERyHZIW7+QKfkCn9xt/b4R+CCievno3eheKx6Fn7r71ZuJ0JhjslcG9Y'; +moduleBuffer += + '65cgETw20fQLivMC4yNQzkm4HOTKshPWjinfQehfCxtKRYS1Ez+VbnG3DFEfgA8fJL/67xfmGMh8j4bI/i7cuBFTSrM3avqH4ZaH'; +moduleBuffer += + '5Gf4+s7y5kuczboncDPl3zrA2wpt1NjnvvXhlYgjTzq2ajJpDY4v1oSH2rZIdex5HLr27Mxy/4YyRQMmb8XDuaaSzpOrrkYuu8v+'; +moduleBuffer += + 'NCoYUrq0bOTWs4RnH0O/3vv0zGvEiYD5x275B0fp+AmA5hLSXsVp+sHNcVjovxwn+GmEIAJc5nwtTIIpFcgerhPW7H+ZOCg0OhKk'; +moduleBuffer += + 'xvxKH/Mf0iNRl5HkU2lj/21a32h/oaYVfJrsLZd7Odks9LKyWWjj7PTHujYI80/514XnZsr/Kbwip3wshArm/bsd11gVKEB6RF6R'; +moduleBuffer += + '0b5Kwt1TRlSkIuF+lZLyr3LW/6dj8mc58BhDCd3tP4v5VU7cX9svBv3TF//Ll/jLR6KRKv557CFUoHDKTxHu75TvD/3zeNhBaNCB'; +moduleBuffer += + 'KV/qr/IlhX7XfK4ZroX75trPuxOwi7nTcOAWeyL81LOfj4C/+NmlK2MVMZPffj4DvnjbGstPOS5XqGO9wDcd25xdJt+6Q23sA/CT'; +moduleBuffer += + 'DyzTVvJY8nDB2FfgVzWeKMsqXXvIZ2wM+E3pA9NjFA6+2zCGn0T8EKdYixybu6f3jokD3/Xeec84mmlSxRgD+IYuP+0NdlOuN43J'; +moduleBuffer += + 'An/xPmujsHd7s9+MKQL/lknSjKYtUe2YcTXgf82ty21uSc2XGdcD/utSFfY+Ub1P+uOmwM88q6/yM8DorOO4FfBnz2l40PXodsqa'; +moduleBuffer += + 'cTvg1zQ/5M6yen5zy7gz8Pc2zqi9d2TNrvxxD+CnHPfdpBhc+rRm3A/43zq9JJb7nzr2eDwY+DM/33ix63vPl0/jUcC/kDBZUlxW'; +moduleBuffer += + 'VSU6sRH46bYbgwlevltnTKQA30nrmp735KXGORMZwF82syYnY4vD3hUTu4F/OV45XDFmtCtq4iDwsy68vnDkcteJrIlC4O/eFJXW'; +moduleBuffer += + '4nXy+8mJUuC35BVn7Qq3ulg/UQn8NUypuu+D5O1dE5eAf15bW7BsRnnz6EQ98Es3b2ht6JmznzF5F/jE2aoq9RSPXo3JR8B/uDMy'; +moduleBuffer += + 'aL+iYonN5DPgS97BJA9VbR1fNdkL/Pdc6k4/8utL8ZMfgH83zTFM5O6ljP2TX4GvJuD0LGdX3z83OTaJsWxIuongeAfvTeIxlo8Q'; +moduleBuffer += + 'p5JJOf6ov38SuUshf76lN9/HluEwKL6WIrL7e6zxnEQ5EIADgznHJDVuuJd71UgY/CTc492GezrxWU5ADB+DCUx4e6rQ6MHjEDDS'; +moduleBuffer += + 'wGDmKxxgz5y1+EgaEL7EYGb9rH+kfXTVx6NAOBSDKS67nWEkeFF+GdwLMJinglPcTPKt5A4gDIrBHOCtnTvK86wfAiLjGMzyPpkT'; +moduleBuffer += + 'akH2OyUgNPzVux3hXL8BqHMWhIYwtY35dGD/sZCjc6Eo4G9Zs6lyQ6zIkAe0Efgx0s/jCnqdK2OgFOBfv5nnvjPVPXUnlAF8M8+9'; +moduleBuffer += + 't2866d8uhXaj+5uf+8OjUmXPLQgNKvvKK3//5SMLXnRDhcCfkWH8VO963vExqBT4Hkf2HYs40PCNha0E/r0rb52d6p5Va2MvAb/H'; +moduleBuffer += + 'UmGI/WUszQ5bD/zjsR4P8+7x7/pj7wK/y2nahi8rWPsSsY+Ab6Iln/usKr8nD4s+0dx77pWH0/0nxeexvcA3tSoqfLIx72crFh2V'; +moduleBuffer += + 'UawKi+zs1tW+x34FPvegxflPmafSibgx4KuluJ6gfJJv5eOAmi1GWTvn7etCSt5sHOhMYA6JHyz4mUfpW4ZjoMu/zvZ9wlcqDcfJ'; +moduleBuffer += + 'An9LS9H6lYusEtJxisBXf16Ks+idVnccpwb8rEmrlZoHAzKv4vSAb3kh4+Ahtu6jTpwp8E/KvKrc+ZRzeBhnBfwnMV01oXV730vh'; +moduleBuffer += + '7YD/n++uARFBkdGohPk8Kui/I+KkIKa90D+JQVvVKb/kL//UX/5pzH++2/BVp26tpnwlbb6pKd9AW/mP/Gf+Kk8UQvvCU76EcLw+'; +moduleBuffer += + '5Vv85Zf9lb/0327PNOS2Dd/nwJMtpT+34Rn03+zDH5s+lec59M/1vhD6yElA+tvI1dWPg+sTfKvKT4UwFnOlMAl792Ew3cMEzJ0D'; +moduleBuffer += + 's6fy6WL/ub8G2H/uX/Bf/iss2sub8j9hUangKf+u0P+X9UAY5qh/PhWMwWr/7bGCD5W7lifcG/KdpTXrV/pL/zZ9uE9EVOTvPhHc'; +moduleBuffer += + 'dE3luSzMo6Gloa7q4OMQFOqv9d/0qEJ8YtHwNFNlxAvFVYVnQXnqmdGlBeiz/hsL0GdGGhqIZi8q/+vju8pP4D8XvKMAYwl00j46'; +moduleBuffer += + 'CnhTD0unXmKAEGukhVQwpppaGAIG9f9MpAin4WJ+Px93R0K+wcMCb/Q1g4lJdGhMhE+4krI38uzRh++NxJv0Rt8+/PNVAQazES4L'; +moduleBuffer += + 'GQWAdwJ84TM8IAcaaQJGFvBhQPTIQdAAxEcTwnPguyacF9nmSuE2I39Tz9twiJCR2TQzeEAD9/X+6El7Bwv8o/j8CESl2lt48EX5'; +moduleBuffer += + 'fGSuCV8UnQ/v5JeF6CgFZ00F402uNfqe5p8ZkRzCrPCyqTym1uivnTDPVF4k0dQxi4XnYYXTU2M7pDUlwIZEAeAjfxv4avB/omqi'; +moduleBuffer += + 'm/iblJTgX89fVRoeTSHVGrRjtXBZyJgXkbVGtlUr9v+Zt3b/i3//OFzole/vExwpiIpA4lC+s0GP2zER9DnOlF8qgopeRfiEIg/S'; +moduleBuffer += + 'o+ALW1jtpioougQJOAeiYiCzhGGxlGzRumgC/yr8KgN5TI2WEGyL1o2p5Wh+dBlYUyTytBcNkQFfA4iDyYDTIs9DjtoKn+uiT+XR'; +moduleBuffer += + 'rFPrVf4dWhDUeRAHIihU+MzrH0mv2qLPiR/Dv6p/tB1TT+ejo/zVjfhTbwb/fMyMPBNGt1V6EdoG6CxC9/d3NEphdvAu9FcZf+TE'; +moduleBuffer += + 'YJzhPIg4LfR/+A9jeWcf3HnVxf7HP9xff3jkD2OZth/OWsL+d4rJaXZou+FKQJ9R/ekr/eHbEtG+x5Qf+5cfJ/TdNTQ0PH0FAUGh'; +moduleBuffer += + 'yGs+pD4pIRPK6CMY5Pwiz168vYft0PYUZ08FbQrJHq1vbHv0HIPTIqzMwrgQPiCG3K+oarP5QVFofNHIID8Bn6+EnntlpB54Y4zs'; +moduleBuffer += + '0XcU8+zRe22QPfrcb609+p51aj1ICf9ozdHsv/Ln26N1eir9P46j8B7dao9ej8i7ALU/00TDt44wP4Fm+FSIelQs+SucHvkABamX'; +moduleBuffer += + 'Bn/4SF8EqedwwwrhIDyWQCJhyWQRrChBDCuJp0BULI1Al2VATCwby5GQJfDI8pAitBq/BnsGV4G9hG3B3sc+En8s0oZtx3ZCLwnd'; +moduleBuffer += + '2D58P3aAP4j/jv2B/wmJz5pt7rA46/DhIxvSd+09erYmtYJIEjEwM3f50nofz5A2MHRx3Vxy+sxl/Ze0rdsyD+MlJKk0ZW09k/kL'; +moduleBuffer += + 'bGwdFvsJtmfsyDp/7UZ9Q1Obx/lqGVkSWVSMwTYwNik+2fFExDA7p5gkOtvcPyhrJzXMq27g0wrfr2OTTs4H8jQ0ZyktO5RfcKyw'; +moduleBuffer += + 'qLis5lI9UUycyTOZM3/JiaK7zfkkDldhhvmcvg+fJm824PnTZ8xU0jUysba1c3Ra5rJ8hcdK71UC/zWRsZs2by8sOVN+tfX0mdCw'; +moduleBuffer += + '5y92rVTYQMDh1XH+OEhTIyGJh9OWksUrisgRVAlWeEmVhBKiIl4Rr0TWE3PA6YknGoqwRMnSs+cb41aRRbRYhGk4GQJkYYRfRNDE'; +moduleBuffer += + 'i5JESBb8WXhxEQOcCYFLwouTHG0MdSV0SRpkUeJMHI+MTWhdSsEZqpFVWNyZsgy2iAO8KisJDkmUaE2eJRItNtdchTibIEpcQoQI'; +moduleBuffer += + 'FBxBzI2M5fnKWZNFE06sVJgvJkqUoJsQRYkMWTU8O+GiqZ+TuLWI6IL5MtZkJwkbkmjCeQVJUeICUR5uoY0hThJeqzFJNNGAQ5qN'; +moduleBuffer += + '4y2DpHQkkvP8o8US6rfbrZJI0aKwRLPyCEkLD1w0SW1IMiap4D2IM0UXiCoR6InlJgkN7oJFeGMS1QKpObnfySltyqJH+xJ1pSAe'; +moduleBuffer += + 'URJPTszYhl9DkMCJkChZ3gk/iImVdgtFokwTvolGksOZC9YzxBniriKchK2JC3Fb5koxUxzlicSEx6oE82lQuDqOi8cmWshTTQhQ'; +moduleBuffer += + 'YqtKQpsqHkp8mTCibIcXxWOTqVZ2ZgnXTYkQfhlBRg+bKKmG9xN3EU04bcSTUMOLkLCSxIQDyR14Kk4CF4P3IorjISlxvBG8v0pk'; +moduleBuffer += + 'NTzWPNFZnIcTJRiRZIkipIQfKUQMhCMQiEQsiUgmiVBFZcU44lwJiqS4FJ6Co9HoIiyIjZeGODguSQaSxcqz+DhVnLqYBqSF18bq'; +moduleBuffer += + 'QEX4k9gS/CnyD+xPwjh2AjcpUhYbl77jqJbr8vSMbNnnklKL7H6OaWjO8fD06knZkZmz82RFTe3NhsY7L3pfT2Lw4AIwNJltZmPr'; +moduleBuffer += + 'mZIJL6ysqW24c6+l9zXm1+UxG7k+VvoJUnLyDjXea5GgKsOzbFzdPVZ6+Ql25JyEs9xs7Op9PShBnW/jJ0hIOXvpSt3j9sHPyVvS'; +moduleBuffer += + 'C09cqbt5q6XzqfW+y80N91psHBa7uq302paZVXG+uu5aw612Kovt7vFtZGIyIWTtiy5J+dAwWZ7XpvjTZ+xrL7HYcvILFjosRi6S'; +moduleBuffer += + '+M1VNx89fjb4eTgiMisqeu9MDc2iM9V1t1rauw5gLHL3aWXJ32t58OjepMPiFe4kshRllubAp9AwQ7M5c+dn5zgFRN9ubL3f8aRv'; +moduleBuffer += + 'YhLD91JI6sInWZFl8ERqYqlkwimCPDlRFschQ3hNvB6ehINIRBJV1FGKRlpGwuFlRUVwZBwJh9yDxPEEnBgRkmQSHEgyJFcSlsgW'; +moduleBuffer += + 'd8TPw6nDLRqVKCVugufN8OKH4FfPSLhNSCrHcYlJ4zg3EktEWgSpdqvhS4RLdCOpEhaIquHhyoHTFlPDc4liuIRSeJGmdsJXsilO'; +moduleBuffer += + 'CmdOMCKrEpImqdJkTao6bprUNKmEDHzSAZYYM203QZMwG65o0iIJVxSixBPauIkUQkK3yNBhnKFIogcj4QI54TlzNk6UaEReQBYn'; +moduleBuffer += + 'RonJ4Vbg3UQSkqVlRVkidviE7cRTheJsvHYBPrFzJkmcQEg4QUkcJkF8FSK8dAc+4QpOBicl8V8aeuGvF4I9oG39cye074+MA5X+'; +moduleBuffer += + '8JGQL6y/x36+QQFTfWW+M3rfKYHQvvh/HYeFhqFjnX8xEkbCwyGDeL1/MXxDMQNzvhbSB4CH10hoC7+gdcgt1DcOwBmYA87oGwok'; +moduleBuffer += + '3noyno/JIXhjPOn5GBqbLy/O95b/pMZXVdHKVw074a2GLX6pJvfzpTpmgm9weNLbYBzqNoBEpxkqSnQbnpL0MdaU7jbWku22/SLX'; +moduleBuffer += + '7WChV7BUzqfbaXC1j/PisG7nQ5d8lmFafFwE9wtcMJ3TXDEvC5af7pm24kNvt3trv48HHzPgMQht9sSEw0NHdbgjhIX/QdZiWkwK'; +moduleBuffer += + 'JIArFhYL4adDcjLuYiYiIpA0HhKBb5sEVdxsERVpiG8IZ8CT4QpEEsXyIBMkO54MJxHFciEs1hi+v+KRThMkh8VBYohPgBNADCwL'; +moduleBuffer += + 'vvuaIOuCU5Nwolg5aDacVxzOqQQXD5eKI8BVmYQVA6XC2wDhhL4s1hj7ey08yBrCQ3DhEBlaAmFJ4mRfCCsiRrLByoBenaEkBK+R'; +moduleBuffer += + 'IAYpikD+eIgIF4XlYPE4Cl4CniRCUhCi+yqL42HlsBZYiESGsGIiEHwZQdFYBWgdDo8VgYi4p/AGwFtLQkrEkomiWEhLXhuvJYrH'; +moduleBuffer += + 'zRQRx/LxWKIRBDYCvl6w2H04SAIiISvDYRssMNCNaRjcDsibjyEGYeFhnSgf64jFIH0PiIMlQLlYLk0CmknmiEGQGk4LQg4YFu5x'; +moduleBuffer += + 'zCMi/U1xeL80IV1497FYArzfKlgyNIAcNgiusBQKEqEb6oH2EOAhLpaAV8LhoePwOiwJGOxi/AIxbfwGyEBKGd5TUZw2XC4JMsMp'; +moduleBuffer += + 'EiCyOSSO1ROBjxkeC3nhsHj4sECHIByZCY4teh4kSTjCPAg+REh1wOHhnZPELiMjO8lGjjQ6H64r7+EtJsK/MshSeM5qcIwEoCZA'; +moduleBuffer += + 'BIwIhB2GRPF4KBtePx7iiyoRwbkjYnEa8CnAkODDBC1lwZsGl7GeiEPKhI+zNbIiCAOfbz0CAceG95YohRHH4TBwm4OB5uCXwLUJ'; +moduleBuffer += + '3ncNLBtDwBHJZCxJDr8bhzHE65AhSYhFgKTgkqmgVIIflA/nMcNj8BPw+kJIGO+EQYxlZTncZYdwGMvbyIR2NXwlTg3BL/wxffGP'; +moduleBuffer += + '6Zo/pmsxlrsrkBIaMRtFwiPC/KJXCSIiseRgeIgX7RMggPBLoyOjMOLwIgQwEPip+8bhCCASC09bw0hXQ4uv9CsiCx8eeuupa2ur'; +moduleBuffer += + '6xgoE2N8guFkRC0NHV0NXXG45QlR94X76AGCUDrCD2prwTl14KG8YJWOr54yxkYKDZ3n5S/wiYqOEETiVaXQ5zQC9YDgMF94hKtK'; +moduleBuffer += 'joTbPHVBbJSqVITAXxCBjMLUEZwzUlUURK4DT2P+B/8WymA='; +function getModule() { + let module2 = pako.inflate( + new Uint8Array(Buffer.from(moduleBuffer, 'base64')) + ); + return Uint8Array.from(module2); +} +var wasm; +var WASM_VECTOR_LEN = 0; +var cachedUint8ArrayMemory0 = null; +function getUint8ArrayMemory0() { + if ( + cachedUint8ArrayMemory0 === null || + cachedUint8ArrayMemory0.byteLength === 0 + ) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} +var cachedTextEncoder = + typeof TextEncoder !== 'undefined' + ? new TextEncoder('utf-8') + : { + encode: () => { + throw Error('TextEncoder not available'); + }, + }; +var encodeString = + typeof cachedTextEncoder.encodeInto === 'function' + ? function (arg, view) { + return cachedTextEncoder.encodeInto(arg, view); + } + : function (arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length, + }; + }; +function passStringToWasm0(arg, malloc, realloc) { + if (realloc === void 0) { + const buf = cachedTextEncoder.encode(arg); + const ptr2 = malloc(buf.length, 1) >>> 0; + getUint8ArrayMemory0() + .subarray(ptr2, ptr2 + buf.length) + .set(buf); + WASM_VECTOR_LEN = buf.length; + return ptr2; + } + let len = arg.length; + let ptr = malloc(len, 1) >>> 0; + const mem = getUint8ArrayMemory0(); + let offset = 0; + for (; offset < len; offset++) { + const code9 = arg.charCodeAt(offset); + if (code9 > 127) break; + mem[ptr + offset] = code9; + } + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + ptr = realloc(ptr, len, (len = offset + arg.length * 3), 1) >>> 0; + const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); + const ret = encodeString(arg, view); + offset += ret.written; + ptr = realloc(ptr, len, offset, 1) >>> 0; + } + WASM_VECTOR_LEN = offset; + return ptr; +} +var cachedDataViewMemory0 = null; +function getDataViewMemory0() { + if ( + cachedDataViewMemory0 === null || + cachedDataViewMemory0.buffer.detached === true || + (cachedDataViewMemory0.buffer.detached === void 0 && + cachedDataViewMemory0.buffer !== wasm.memory.buffer) + ) { + cachedDataViewMemory0 = new DataView(wasm.memory.buffer); + } + return cachedDataViewMemory0; +} +function addToExternrefTable0(obj) { + const idx = wasm.__externref_table_alloc(); + wasm.__wbindgen_export_4.set(idx, obj); + return idx; +} +function handleError(f, args) { + try { + return f.apply(this, args); + } catch (e2) { + const idx = addToExternrefTable0(e2); + wasm.__wbindgen_exn_store(idx); + } +} +var cachedTextDecoder = + typeof TextDecoder !== 'undefined' + ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) + : { + decode: () => { + throw Error('TextDecoder not available'); + }, + }; +if (typeof TextDecoder !== 'undefined') { + cachedTextDecoder.decode(); +} +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode( + getUint8ArrayMemory0().subarray(ptr, ptr + len) + ); +} +function isLikeNone(x) { + return x === void 0 || x === null; +} +function debugString(val) { + const type = typeof val; + if (type == 'number' || type == 'boolean' || val == null) { + return `${val}`; + } + if (type == 'string') { + return `"${val}"`; + } + if (type == 'symbol') { + const description = val.description; + if (description == null) { + return 'Symbol'; + } else { + return `Symbol(${description})`; + } + } + if (type == 'function') { + const name = val.name; + if (typeof name == 'string' && name.length > 0) { + return `Function(${name})`; + } else { + return 'Function'; + } + } + if (Array.isArray(val)) { + const length = val.length; + let debug = '['; + if (length > 0) { + debug += debugString(val[0]); + } + for (let i2 = 1; i2 < length; i2++) { + debug += ', ' + debugString(val[i2]); + } + debug += ']'; + return debug; + } + const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); + let className; + if (builtInMatches && builtInMatches.length > 1) { + className = builtInMatches[1]; + } else { + return toString.call(val); + } + if (className == 'Object') { + try { + return 'Object(' + JSON.stringify(val) + ')'; + } catch (_) { + return 'Object'; + } + } + if (val instanceof Error) { + return `${val.name}: ${val.message} +${val.stack}`; + } + return className; +} +function passArrayJsValueToWasm0(array, malloc) { + const ptr = malloc(array.length * 4, 4) >>> 0; + for (let i2 = 0; i2 < array.length; i2++) { + const add5 = addToExternrefTable0(array[i2]); + getDataViewMemory0().setUint32(ptr + 4 * i2, add5, true); + } + WASM_VECTOR_LEN = array.length; + return ptr; +} +function takeFromExternrefTable0(idx) { + const value = wasm.__wbindgen_export_4.get(idx); + wasm.__externref_table_dealloc(idx); + return value; +} +function ecdsaCombine(variant, presignature, signature_shares) { + const ptr0 = passArrayJsValueToWasm0( + signature_shares, + wasm.__wbindgen_malloc + ); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.ecdsaCombine(variant, presignature, ptr0, len0); + if (ret[2]) { + throw takeFromExternrefTable0(ret[1]); + } + return takeFromExternrefTable0(ret[0]); +} +function ecdsaVerify(variant, message_hash, public_key, signature2) { + const ret = wasm.ecdsaVerify(variant, message_hash, public_key, signature2); + if (ret[1]) { + throw takeFromExternrefTable0(ret[0]); + } +} +function ecdsaDeriveKey(variant, id2, public_keys) { + const ptr0 = passArrayJsValueToWasm0(public_keys, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.ecdsaDeriveKey(variant, id2, ptr0, len0); + if (ret[2]) { + throw takeFromExternrefTable0(ret[1]); + } + return takeFromExternrefTable0(ret[0]); +} +function passArray8ToWasm0(arg, malloc) { + const ptr = malloc(arg.length * 1, 1) >>> 0; + getUint8ArrayMemory0().set(arg, ptr / 1); + WASM_VECTOR_LEN = arg.length; + return ptr; +} +function sevSnpGetVcekUrl(attestation_report) { + let deferred3_0; + let deferred3_1; + try { + const ptr0 = passArray8ToWasm0(attestation_report, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.sevSnpGetVcekUrl(ptr0, len0); + var ptr2 = ret[0]; + var len2 = ret[1]; + if (ret[3]) { + ptr2 = 0; + len2 = 0; + throw takeFromExternrefTable0(ret[2]); + } + deferred3_0 = ptr2; + deferred3_1 = len2; + return getStringFromWasm0(ptr2, len2); + } finally { + wasm.__wbindgen_free(deferred3_0, deferred3_1, 1); + } +} +function sevSnpVerify( + attestation_report, + attestation_data, + signatures, + challenge, + vcek_certificate +) { + const ptr0 = passArray8ToWasm0(attestation_report, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ptr1 = passArrayJsValueToWasm0(signatures, wasm.__wbindgen_malloc); + const len1 = WASM_VECTOR_LEN; + const ptr2 = passArray8ToWasm0(challenge, wasm.__wbindgen_malloc); + const len2 = WASM_VECTOR_LEN; + const ptr3 = passArray8ToWasm0(vcek_certificate, wasm.__wbindgen_malloc); + const len3 = WASM_VECTOR_LEN; + const ret = wasm.sevSnpVerify( + ptr0, + len0, + attestation_data, + ptr1, + len1, + ptr2, + len2, + ptr3, + len3 + ); + if (ret[1]) { + throw takeFromExternrefTable0(ret[0]); + } +} +function blsCombine(signature_shares) { + let deferred2_0; + let deferred2_1; + try { + const ret = wasm.blsCombine(signature_shares); + var ptr1 = ret[0]; + var len1 = ret[1]; + if (ret[3]) { + ptr1 = 0; + len1 = 0; + throw takeFromExternrefTable0(ret[2]); + } + deferred2_0 = ptr1; + deferred2_1 = len1; + return getStringFromWasm0(ptr1, len1); + } finally { + wasm.__wbindgen_free(deferred2_0, deferred2_1, 1); + } +} +function blsVerify(public_key, message, signature2) { + const ptr0 = passStringToWasm0( + signature2, + wasm.__wbindgen_malloc, + wasm.__wbindgen_realloc + ); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.blsVerify(public_key, message, ptr0, len0); + if (ret[1]) { + throw takeFromExternrefTable0(ret[0]); + } +} +function blsEncrypt(encryption_key, message, identity) { + const ret = wasm.blsEncrypt(encryption_key, message, identity); + if (ret[2]) { + throw takeFromExternrefTable0(ret[1]); + } + return takeFromExternrefTable0(ret[0]); +} +function blsDecrypt(ciphertext, signature_shares) { + const ret = wasm.blsDecrypt(ciphertext, signature_shares); + if (ret[2]) { + throw takeFromExternrefTable0(ret[1]); + } + return takeFromExternrefTable0(ret[0]); +} +async function __wbg_load(module2, imports) { + if (typeof Response === 'function' && module2 instanceof Response) { + if (typeof WebAssembly.instantiateStreaming === 'function') { + try { + return await WebAssembly.instantiateStreaming(module2, imports); + } catch (e2) { + if (module2.headers.get('Content-Type') != 'application/wasm') { + console.warn( + '`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n', + e2 + ); + } else { + throw e2; + } + } + } + const bytes = await module2.arrayBuffer(); + return await WebAssembly.instantiate(bytes, imports); + } else { + const instance = await WebAssembly.instantiate(module2, imports); + if (instance instanceof WebAssembly.Instance) { + return { instance, module: module2 }; + } else { + return instance; + } + } +} +function __wbg_get_imports() { + const imports = {}; + imports.wbg = {}; + imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function (arg0, arg1) { + const ret = String(arg1); + const ptr1 = passStringToWasm0( + ret, + wasm.__wbindgen_malloc, + wasm.__wbindgen_realloc + ); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_String_eecc4a11987127d6 = function (arg0, arg1) { + const ret = String(arg1); + const ptr1 = passStringToWasm0( + ret, + wasm.__wbindgen_malloc, + wasm.__wbindgen_realloc + ); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_buffer_609cc3eee51ed158 = function (arg0) { + const ret = arg0.buffer; + return ret; + }; + imports.wbg.__wbg_call_672a4d21634d4a24 = function () { + return handleError(function (arg0, arg1) { + const ret = arg0.call(arg1); + return ret; + }, arguments); + }; + imports.wbg.__wbg_call_7cccdd69e0791ae2 = function () { + return handleError(function (arg0, arg1, arg2) { + const ret = arg0.call(arg1, arg2); + return ret; + }, arguments); + }; + imports.wbg.__wbg_crypto_ed58b8e10a292839 = function (arg0) { + const ret = arg0.crypto; + return ret; + }; + imports.wbg.__wbg_done_769e5ede4b31c67b = function (arg0) { + const ret = arg0.done; + return ret; + }; + imports.wbg.__wbg_entries_3265d4158b33e5dc = function (arg0) { + const ret = Object.entries(arg0); + return ret; + }; + imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function (arg0, arg1) { + let deferred0_0; + let deferred0_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + console.error(getStringFromWasm0(arg0, arg1)); + } finally { + wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); + } + }; + imports.wbg.__wbg_from_2a5d3e218e67aa85 = function (arg0) { + const ret = Array.from(arg0); + return ret; + }; + imports.wbg.__wbg_getRandomValues_bcb4912f16000dc4 = function () { + return handleError(function (arg0, arg1) { + arg0.getRandomValues(arg1); + }, arguments); + }; + imports.wbg.__wbg_get_67b2ba62fc30de12 = function () { + return handleError(function (arg0, arg1) { + const ret = Reflect.get(arg0, arg1); + return ret; + }, arguments); + }; + imports.wbg.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) { + const ret = arg0[arg1 >>> 0]; + return ret; + }; + imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function (arg0) { + let result; + try { + result = arg0 instanceof ArrayBuffer; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function (arg0) { + let result; + try { + result = arg0 instanceof Uint8Array; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_isArray_a1eab7e0d067391b = function (arg0) { + const ret = Array.isArray(arg0); + return ret; + }; + imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function (arg0) { + const ret = Number.isSafeInteger(arg0); + return ret; + }; + imports.wbg.__wbg_iterator_9a24c88df860dc65 = function () { + const ret = Symbol.iterator; + return ret; + }; + imports.wbg.__wbg_length_a446193dc22c12f8 = function (arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_length_e2d2a49132c1b256 = function (arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function (arg0) { + const ret = arg0.msCrypto; + return ret; + }; + imports.wbg.__wbg_new_78feb108b6472713 = function () { + const ret = new Array(); + return ret; + }; + imports.wbg.__wbg_new_8a6f238a6ece86ea = function () { + const ret = new Error(); + return ret; + }; + imports.wbg.__wbg_new_a12002a7f91c75be = function (arg0) { + const ret = new Uint8Array(arg0); + return ret; + }; + imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function (arg0, arg1) { + const ret = new Function(getStringFromWasm0(arg0, arg1)); + return ret; + }; + imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function ( + arg0, + arg1, + arg2 + ) { + const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function (arg0) { + const ret = new Uint8Array(arg0 >>> 0); + return ret; + }; + imports.wbg.__wbg_next_25feadfc0913fea9 = function (arg0) { + const ret = arg0.next; + return ret; + }; + imports.wbg.__wbg_next_6574e1a8a62d1055 = function () { + return handleError(function (arg0) { + const ret = arg0.next(); + return ret; + }, arguments); + }; + imports.wbg.__wbg_node_02999533c4ea02e3 = function (arg0) { + const ret = arg0.node; + return ret; + }; + imports.wbg.__wbg_process_5c1d670bc53614b8 = function (arg0) { + const ret = arg0.process; + return ret; + }; + imports.wbg.__wbg_randomFillSync_ab2cfe79ebbf2740 = function () { + return handleError(function (arg0, arg1) { + arg0.randomFillSync(arg1); + }, arguments); + }; + imports.wbg.__wbg_require_79b1e9274cde3c87 = function () { + return handleError(function () { + const ret = module.require; + return ret; + }, arguments); + }; + imports.wbg.__wbg_set_37837023f3d740e8 = function (arg0, arg1, arg2) { + arg0[arg1 >>> 0] = arg2; + }; + imports.wbg.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) { + arg0.set(arg1, arg2 >>> 0); + }; + imports.wbg.__wbg_stack_0ed75d68575b0f3c = function (arg0, arg1) { + const ret = arg1.stack; + const ptr1 = passStringToWasm0( + ret, + wasm.__wbindgen_malloc, + wasm.__wbindgen_realloc + ); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function () { + const ret = typeof global === 'undefined' ? null : global; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function () { + const ret = typeof globalThis === 'undefined' ? null : globalThis; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function () { + const ret = typeof self === 'undefined' ? null : self; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function () { + const ret = typeof window === 'undefined' ? null : window; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_subarray_aa9065fa9dc5df96 = function (arg0, arg1, arg2) { + const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function (arg0) { + const ret = arg0.value; + return ret; + }; + imports.wbg.__wbg_versions_c71aa1626a93e0a1 = function (arg0) { + const ret = arg0.versions; + return ret; + }; + imports.wbg.__wbindgen_as_number = function (arg0) { + const ret = +arg0; + return ret; + }; + imports.wbg.__wbindgen_boolean_get = function (arg0) { + const v = arg0; + const ret = typeof v === 'boolean' ? (v ? 1 : 0) : 2; + return ret; + }; + imports.wbg.__wbindgen_debug_string = function (arg0, arg1) { + const ret = debugString(arg1); + const ptr1 = passStringToWasm0( + ret, + wasm.__wbindgen_malloc, + wasm.__wbindgen_realloc + ); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbindgen_error_new = function (arg0, arg1) { + const ret = new Error(getStringFromWasm0(arg0, arg1)); + return ret; + }; + imports.wbg.__wbindgen_init_externref_table = function () { + const table = wasm.__wbindgen_export_4; + const offset = table.grow(4); + table.set(0, void 0); + table.set(offset + 0, void 0); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + }; + imports.wbg.__wbindgen_is_function = function (arg0) { + const ret = typeof arg0 === 'function'; + return ret; + }; + imports.wbg.__wbindgen_is_object = function (arg0) { + const val = arg0; + const ret = typeof val === 'object' && val !== null; + return ret; + }; + imports.wbg.__wbindgen_is_string = function (arg0) { + const ret = typeof arg0 === 'string'; + return ret; + }; + imports.wbg.__wbindgen_is_undefined = function (arg0) { + const ret = arg0 === void 0; + return ret; + }; + imports.wbg.__wbindgen_jsval_loose_eq = function (arg0, arg1) { + const ret = arg0 == arg1; + return ret; + }; + imports.wbg.__wbindgen_memory = function () { + const ret = wasm.memory; + return ret; + }; + imports.wbg.__wbindgen_number_get = function (arg0, arg1) { + const obj = arg1; + const ret = typeof obj === 'number' ? obj : void 0; + getDataViewMemory0().setFloat64( + arg0 + 8 * 1, + isLikeNone(ret) ? 0 : ret, + true + ); + getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true); + }; + imports.wbg.__wbindgen_number_new = function (arg0) { + const ret = arg0; + return ret; + }; + imports.wbg.__wbindgen_string_get = function (arg0, arg1) { + const obj = arg1; + const ret = typeof obj === 'string' ? obj : void 0; + var ptr1 = isLikeNone(ret) + ? 0 + : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbindgen_string_new = function (arg0, arg1) { + const ret = getStringFromWasm0(arg0, arg1); + return ret; + }; + imports.wbg.__wbindgen_throw = function (arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); + }; + return imports; +} +function __wbg_init_memory(imports, memory) {} +function __wbg_finalize_init(instance, module2) { + wasm = instance.exports; + __wbg_init.__wbindgen_wasm_module = module2; + cachedDataViewMemory0 = null; + cachedUint8ArrayMemory0 = null; + wasm.__wbindgen_start(); + return wasm; +} +function initSync(module2) { + if (wasm !== void 0) return wasm; + if (typeof module2 !== 'undefined') { + if (Object.getPrototypeOf(module2) === Object.prototype) { + ({ module: module2 } = module2); + } else { + console.warn( + 'using deprecated parameters for `initSync()`; pass a single object instead' + ); + } + } + const imports = __wbg_get_imports(); + __wbg_init_memory(imports); + if (!(module2 instanceof WebAssembly.Module)) { + module2 = new WebAssembly.Module(module2); + } + const instance = new WebAssembly.Instance(module2, imports); + return __wbg_finalize_init(instance, module2); +} +async function __wbg_init(module_or_path) { + if (wasm !== void 0) return wasm; + if (typeof module_or_path !== 'undefined') { + if (Object.getPrototypeOf(module_or_path) === Object.prototype) { + ({ module_or_path } = module_or_path); + } else { + console.warn( + 'using deprecated parameters for the initialization function; pass a single object instead' + ); + } + } + const imports = __wbg_get_imports(); + __wbg_init_memory(imports); + const { instance, module: module2 } = await __wbg_load( + await module_or_path, + imports + ); + return __wbg_finalize_init(instance, module2); +} + +// packages/wasm/src/index.ts +var loadingPromise = null; +var wasmSdkInstance; +async function initWasm() { + return initSync(getModule()); +} +async function loadModules() { + if (wasmSdkInstance) { + return wasmSdkInstance; + } + if (loadingPromise) { + return loadingPromise; + } + loadingPromise = initWasm(); + try { + wasmSdkInstance = await loadingPromise; + } finally { + loadingPromise = null; + } + return; +} +async function blsCombine2(signature_shares) { + await loadModules(); + return blsCombine(signature_shares); +} +async function blsDecrypt2(ciphertext, signature_shares) { + await loadModules(); + return blsDecrypt(ciphertext, signature_shares); +} +async function blsEncrypt2(encryption_key, message, identity) { + await loadModules(); + return blsEncrypt(encryption_key, message, identity); +} +async function blsVerify2(public_key, message, signature2) { + await loadModules(); + return blsVerify(public_key, message, signature2); +} +async function ecdsaCombine2(variant, presignature, signature_shares) { + await loadModules(); + return ecdsaCombine(variant, presignature, signature_shares); +} +async function ecdsaDeriveKey2(variant, id2, public_keys) { + await loadModules(); + return ecdsaDeriveKey(variant, id2, public_keys); +} +async function ecdsaVerify2(variant, message_hash, public_key, signature2) { + await loadModules(); + return ecdsaVerify(variant, message_hash, public_key, signature2); +} +async function sevSnpGetVcekUrl2(attestation_report) { + await loadModules(); + return sevSnpGetVcekUrl(attestation_report); +} +async function sevSnpVerify2( + attestation_report, + attestation_data, + signatures, + challenge, + vcek_certificate +) { + await loadModules(); + return sevSnpVerify( + attestation_report, + attestation_data, + signatures, + challenge, + vcek_certificate + ); +} + +// packages/crypto/src/lib/crypto.ts +var LIT_CORS_PROXY = `https://cors.litgateway.com`; +var encrypt2 = async (publicKeyHex, message, identity) => { + const publicKey = Buffer.from(publicKeyHex, 'hex'); + if (publicKeyHex.replace('0x', '').length !== 96) { + throw new InvalidParamType( + { + info: { + publicKeyHex, + }, + }, + `Invalid public key length. Expecting 96 characters, got ${ + publicKeyHex.replace('0x', '').length + } instead.` + ); + } + return Buffer.from(await blsEncrypt2(publicKey, message, identity)).toString( + 'base64' + ); +}; +var verifyAndDecryptWithSignatureShares = async ( + publicKeyHex, + identity, + ciphertextBase64, + shares +) => { + const publicKey = Buffer.from(publicKeyHex, 'hex'); + const signature2 = await combineSignatureShares(shares); + await blsVerify2(publicKey, identity, signature2); + const sigShares = toJSONShares(shares); + return doDecrypt(ciphertextBase64, sigShares); +}; +var toJSONShares = (shares) => { + return shares.map((s2) => { + return JSON.stringify(s2); + }); +}; +var combineSignatureShares = async (shares) => { + const sigShares = toJSONShares(shares); + const signature2 = await blsCombine2(sigShares); + if (signature2.length !== 192) { + throw new Error( + `Signature length is not 192. Got ${signature2.length} instead.` + ); + } + return signature2; +}; +var verifySignature = async (publicKeyHex, message, signature2) => { + const publicKey = Buffer.from(publicKeyHex, 'hex'); + await blsVerify2(publicKey, message, signature2); +}; +var ecdsaSigntureTypeMap = { + [LIT_CURVE.EcdsaCaitSith]: 'K256', + [LIT_CURVE.EcdsaK256]: 'K256', + [LIT_CURVE.EcdsaCAITSITHP256]: 'P256', + [LIT_CURVE.EcdsaK256Sha256]: 'K256', +}; +var combineEcdsaShares = async (sigShares) => { + const validShares = sigShares.filter((share) => share.signatureShare); + const anyValidShare = validShares[0]; + if (!anyValidShare) { + throw new NoValidShares( + { + info: { + shares: sigShares, + }, + }, + 'No valid shares to combine' + ); + } + const variant = ecdsaSigntureTypeMap[anyValidShare.sigType]; + const presignature = Buffer.from(anyValidShare.bigR, 'hex'); + const signatureShares = validShares.map((share) => + Buffer.from(share.signatureShare, 'hex') + ); + const [r3, s2, recId] = await ecdsaCombine2( + variant, + presignature, + signatureShares + ); + const publicKey = Buffer.from(anyValidShare.publicKey, 'hex'); + const messageHash = Buffer.from(anyValidShare.dataSigned, 'hex'); + await ecdsaVerify2(variant, messageHash, publicKey, [r3, s2, recId]); + const signature2 = (0, import_utils11.splitSignature)( + Buffer.concat([r3, s2, Buffer.from([recId + 27])]) + ); + if (!signature2.r) { + throw new UnknownSignatureError( + { + info: { + signature: signature2, + }, + }, + 'signature could not be combined' + ); + } + const _r = signature2.r.slice('0x'.length); + const _s = signature2.s.slice('0x'.length); + const _recid = signature2.recoveryParam; + const encodedSig = (0, import_utils11.joinSignature)({ + r: '0x' + _r, + s: '0x' + _s, + recoveryParam: _recid, + }); + return { + r: _r, + s: _s, + recid: _recid, + signature: encodedSig, + }; +}; +var computeHDPubKey = async (pubkeys, keyId, sigType) => { + const variant = ecdsaSigntureTypeMap[sigType]; + switch (sigType) { + case LIT_CURVE.EcdsaCaitSith: + case LIT_CURVE.EcdsaK256: + pubkeys = pubkeys.map((value) => { + return value.replace('0x', ''); + }); + keyId = keyId.replace('0x', ''); + const preComputedPubkey = await ecdsaDeriveKey2( + variant, + Buffer.from(keyId, 'hex'), + pubkeys.map((hex) => Buffer.from(hex, 'hex')) + ); + return Buffer.from(preComputedPubkey).toString('hex'); + default: + throw new InvalidParamType( + { + info: { + sigType, + }, + }, + `Non supported signature type` + ); + } +}; +var generateSessionKeyPair = () => { + const keyPair2 = nacl2.sign.keyPair(); + const sessionKeyPair = { + publicKey: uint8arrayToString(keyPair2.publicKey, 'base16'), + secretKey: uint8arrayToString(keyPair2.secretKey, 'base16'), + }; + return sessionKeyPair; +}; +async function doDecrypt(ciphertextBase64, shares) { + const ciphertext = Buffer.from(ciphertextBase64, 'base64'); + const decrypt3 = await blsDecrypt2(ciphertext, shares); + return decrypt3; +} +async function getAmdCert(url) { + const proxyUrl = `${LIT_CORS_PROXY}/${url}`; + log( + `[getAmdCert] Fetching AMD cert using proxy URL ${proxyUrl} to manage CORS restrictions and to avoid being rate limited by AMD.` + ); + async function fetchAsUint8Array(targetUrl) { + const res = await fetch(targetUrl); + if (!res.ok) { + throw new NetworkError( + { + info: { + targetUrl, + }, + }, + `[getAmdCert] HTTP error! status: ${res.status}` + ); + } + const arrayBuffer = await res.arrayBuffer(); + return new Uint8Array(arrayBuffer); + } + try { + return await fetchAsUint8Array(proxyUrl); + } catch (e2) { + log(`[getAmdCert] Failed to fetch AMD cert from proxy:`, e2); + } + log('[getAmdCert] Attempting to fetch directly without proxy.'); + try { + return await fetchAsUint8Array(url); + } catch (e2) { + log('[getAmdCert] Direct fetch also failed:', e2); + throw e2; + } +} +var checkSevSnpAttestation = async (attestation, challengeHex, url) => { + const noonce = Buffer.from(attestation.noonce, 'base64'); + const challenge = Buffer.from(challengeHex, 'hex'); + const data = Object.fromEntries( + Object.entries(attestation.data).map(([k, v]) => [ + k, + Buffer.from(v, 'base64'), + ]) + ); + const signatures = attestation.signatures.map((s2) => + Buffer.from(s2, 'base64') + ); + const report = Buffer.from(attestation.report, 'base64'); + if (!noonce.equals(challenge)) { + throw new NetworkError( + { + info: { + attestation, + challengeHex, + noonce, + challenge, + }, + }, + `Attestation noonce ${noonce} does not match challenge ${challenge}` + ); + } + const parsedUrl = new URL(url); + const ipWeTalkedTo = parsedUrl.hostname; + let portWeTalkedTo = parsedUrl.port; + if (portWeTalkedTo === '') { + if (url.startsWith('https://')) { + portWeTalkedTo = '443'; + } else if (url.startsWith('http://')) { + portWeTalkedTo = '80'; + } else { + throw new NetworkError( + { + info: { + url, + }, + }, + `Unknown port in URL ${url}` + ); + } + } + const ipAndAddrFromReport = data['EXTERNAL_ADDR'].toString('utf8'); + const ipFromReport = ipAndAddrFromReport.split(':')[0]; + const portFromReport = ipAndAddrFromReport.split(':')[1]; + if (ipWeTalkedTo !== ipFromReport) { + throw new NetworkError( + { + info: { + attestation, + ipWeTalkedTo, + ipFromReport, + }, + }, + `Attestation external address ${ipFromReport} does not match IP we talked to ${ipWeTalkedTo}` + ); + } + if (portWeTalkedTo !== portFromReport) { + throw new NetworkError( + { + info: { + attestation, + portWeTalkedTo, + portFromReport, + }, + }, + `Attestation external port ${portFromReport} does not match port we talked to ${portWeTalkedTo}` + ); + } + let vcekCert; + const vcekUrl = await sevSnpGetVcekUrl2(report); + if (globalThis.localStorage) { + log('Using local storage for certificate caching'); + vcekCert = localStorage.getItem(vcekUrl); + if (vcekCert) { + vcekCert = uint8arrayFromString(vcekCert, 'base64'); + } else { + vcekCert = await getAmdCert(vcekUrl); + localStorage.setItem(vcekUrl, uint8arrayToString(vcekCert, 'base64')); + } + } else { + const cache = (globalThis.amdCertStore ??= {}); + cache[vcekUrl] ??= await getAmdCert(vcekUrl); + vcekCert = cache[vcekUrl]; + } + if (!vcekCert || vcekCert.length === 0 || vcekCert.length < 256) { + throw new UnknownError( + { + info: { + attestation, + report, + vcekUrl, + }, + }, + 'Unable to retrieve VCEK certificate from AMD' + ); + } + return sevSnpVerify2(report, data, signatures, challenge, vcekCert); +}; + +// packages/core/src/lib/endpoint-version.ts +init_shim(); +var composeLitUrl = (params) => { + try { + new URL(params.url); + } catch (error) { + throw new Error(`[composeLitUrl] Invalid URL: "${params.url}"`); + } + const version28 = params.endpoint.version; + return `${params.url}${params.endpoint.path}${version28}`; +}; + +// packages/core/src/lib/lit-core.ts +var EPOCH_PROPAGATION_DELAY = 45e3; +var BLOCKHASH_SYNC_INTERVAL = 3e4; +var BLOCKHASH_COUNT_PROVIDER_DELAY = -30; +var NETWORKS_REQUIRING_SEV = [LIT_NETWORK.DatilTest, LIT_NETWORK.Datil]; +var FALLBACK_RPC_URLS = [ + 'https://ethereum-rpc.publicnode.com', + 'https://eth.llamarpc.com', + 'https://eth.drpc.org', + 'https://eth.llamarpc.com', +]; +var LitCore = class { + config = { + alertWhenUnauthorized: false, + debug: true, + connectTimeout: 2e4, + checkNodeAttestation: false, + litNetwork: LIT_NETWORK.Custom, + minNodeCount: 2, + // Default value, should be replaced + bootstrapUrls: [], + // Default value, should be replaced + nodeProtocol: null, + priceByNetwork: {}, + }; + connectedNodes = /* @__PURE__ */ new Set(); + serverKeys = {}; + ready = false; + subnetPubKey = null; + networkPubKey = null; + networkPubKeySet = null; + hdRootPubkeys = null; + latestBlockhash = null; + lastBlockHashRetrieved = null; + _networkSyncInterval = null; + _stakingContract = null; + _stakingContractListener = null; + _connectingPromise = null; + _epochCache = { + currentNumber: null, + startTime: null, + }; + _blockHashUrl = + 'https://block-indexer.litgateway.com/get_most_recent_valid_block'; + // ========== Constructor ========== + constructor(config2) { + if (!(config2.litNetwork in LIT_NETWORKS)) { + const validNetworks = Object.keys(LIT_NETWORKS).join(', '); + throw new InvalidParamType( + {}, + 'Unsupported network has been provided please use a "litNetwork" option which is supported (%s)', + validNetworks + ); + } + switch (config2?.litNetwork) { + case LIT_NETWORK.DatilDev: + this.config = { + ...this.config, + checkNodeAttestation: NETWORKS_REQUIRING_SEV.includes( + config2?.litNetwork + ), + ...config2, + }; + break; + default: + this.config = { + ...this.config, + ...config2, + }; + } + this.setCustomBootstrapUrls(); + setMiscLitConfig(this.config); + bootstrapLogManager( + 'core', + this.config.debug ? LogLevel.DEBUG : LogLevel.OFF + ); + if (this.config.storageProvider?.provider) { + log( + 'localstorage api not found, injecting persistence instance found in config' + ); + Object.defineProperty(globalThis, 'localStorage', { + value: this.config.storageProvider?.provider, + }); + } else if ( + isNode() && + !globalThis.localStorage && + !this.config.storageProvider?.provider + ) { + log( + 'Looks like you are running in NodeJS and did not provide a storage provider, your sessions will not be cached' + ); + } + } + // ========== Logger utilities ========== + getLogsForRequestId = (id2) => { + return globalThis.logManager.getLogsForId(id2); + }; + getRequestIds = () => { + return globalThis.logManager.LoggerIds; + }; + /** + * Retrieves the validator data including staking contract, epoch, minNodeCount, and bootstrapUrls. + * @returns An object containing the validator data. + * @throws Error if minNodeCount is not provided, is less than or equal to 0, or if bootstrapUrls are not available. + */ + async _getValidatorData() { + const { + stakingContract, + epochInfo, + minNodeCount, + bootstrapUrls, + priceByNetwork, + } = await LitContracts.getConnectionInfo({ + litNetwork: this.config.litNetwork, + networkContext: this.config.contractContext, + rpcUrl: this.config.rpcUrl, + nodeProtocol: this.config.nodeProtocol, + sortByPrice: true, + }); + if (!minNodeCount) { + throw new InvalidArgumentException( + {}, + `minimum validator count is %s, which is invalid. Please check your network connection and try again.`, + minNodeCount + ); + } + if (!Array.isArray(bootstrapUrls) || bootstrapUrls.length <= 0) { + throw new InitError( + {}, + `Failed to get bootstrapUrls for network %s`, + this.config.litNetwork + ); + } + log('[_getValidatorData] epochInfo: ', epochInfo); + log('[_getValidatorData] minNodeCount: ', minNodeCount); + log('[_getValidatorData] Bootstrap urls: ', bootstrapUrls); + log('[_getValidatorData] stakingContract: ', stakingContract.address); + return { + stakingContract, + epochInfo, + minNodeCount, + bootstrapUrls, + priceByNetwork, + }; + } + // ========== Scoped Class Helpers ========== + /** + * See rust/lit-node/common/lit-node-testnet/src/validator.rs > threshold for more details + */ + _getThreshold = () => { + return Math.max(3, Math.floor((this.connectedNodes.size * 2) / 3)); + }; + async _handleStakingContractStateChange(state) { + log(`New state detected: "${state}"`); + const validatorData = await this._getValidatorData(); + if (state === STAKING_STATES.Active) { + this._epochState = await this._fetchCurrentEpochState( + validatorData.epochInfo + ); + if (CENTRALISATION_BY_NETWORK[this.config.litNetwork] !== 'centralised') { + try { + log( + 'State found to be new validator set locked, checking validator set' + ); + const existingNodeUrls = [...this.config.bootstrapUrls]; + const delta = validatorData.bootstrapUrls.filter((item) => + existingNodeUrls.includes(item) + ); + if (delta.length > 1) { + log( + 'Active validator sets changed, new validators ', + delta, + 'starting node connection' + ); + } + await this.connect(); + } catch (err) { + const { message = '' } = err; + logError( + 'Error while attempting to reconnect to nodes after epoch transition:', + message + ); + } + } + } + } + /** + * Sets up a listener to detect state changes (new epochs) in the staking contract. + * When a new epoch is detected, it triggers the `setNewConfig` function to update + * the client's configuration based on the new state of the network. This ensures + * that the client's configuration is always in sync with the current state of the + * staking contract. + * + * @returns {Promise} A promise that resolves when the listener is successfully set up. + */ + _listenForNewEpoch() { + if (this._stakingContractListener) { + return; + } + if (this._stakingContract) { + log( + 'listening for state change on staking contract: ', + this._stakingContract.address + ); + this._stakingContractListener = (state) => { + this._handleStakingContractStateChange(state); + }; + this._stakingContract.on('StateChanged', this._stakingContractListener); + } + } + /** + * Gets the set of nodes from validator data, transforming bootstrap URLs into NodeSet objects. + * + * @returns {Promise} A promise that resolves with an array of NodeSet objects. + */ + _getNodeSet = async () => { + const validatorData = await this._getValidatorData(); + const bootstrapUrls = validatorData.bootstrapUrls; + const nodeSet = bootstrapUrls.map((url) => { + const urlWithoutProtocol = url.replace(/(^\w+:|^)\/\//, ''); + return { + socketAddress: urlWithoutProtocol, + // FIXME: This is a placeholder value. Brendon said: It's not used anymore in the nodes, but leaving it as we may need it in the future. + value: 1, + }; + }); + return nodeSet; + }; + /** + * Stops internal listeners/polling that refresh network state and watch for epoch changes. + * Removes global objects created internally + */ + async disconnect() { + this.ready = false; + this._stopListeningForNewEpoch(); + setMiscLitConfig(void 0); + } + // _stopNetworkPolling() { + // if (this._networkSyncInterval) { + // clearInterval(this._networkSyncInterval); + // this._networkSyncInterval = null; + // } + // } + _stopListeningForNewEpoch() { + if (this._stakingContract && this._stakingContractListener) { + this._stakingContract.off('StateChanged', this._stakingContractListener); + this._stakingContractListener = null; + } + } + /** + * + * Set bootstrapUrls to match the network litNetwork unless it's set to custom + * + * @returns { void } + * + */ + setCustomBootstrapUrls = () => { + if (this.config.litNetwork === LIT_NETWORK.Custom) return; + const hasNetwork = this.config.litNetwork in LIT_NETWORKS; + if (!hasNetwork) { + throw new LitNodeClientBadConfigError( + {}, + 'the litNetwork specified in the LitNodeClient config not found in LIT_NETWORKS' + ); + } + this.config.bootstrapUrls = LIT_NETWORKS[this.config.litNetwork]; + }; + /** + * Return the latest blockhash from the nodes + * @returns { Promise } latest blockhash + */ + getLatestBlockhash = async () => { + await this._syncBlockhash(); + if (!this.latestBlockhash) { + throw new InvalidEthBlockhash( + {}, + `latestBlockhash is not available. Received: "%s"`, + this.latestBlockhash + ); + } + return this.latestBlockhash; + }; + /** + * + * Connect to the LIT nodes + * + * @returns { Promise } A promise that resolves when the nodes are connected. + * + */ + async connect() { + if (this._connectingPromise) { + return this._connectingPromise; + } + this._connectingPromise = this._connect(); + await this._connectingPromise.finally(() => { + this._connectingPromise = null; + }); + } + async _connect() { + this._stopListeningForNewEpoch(); + if (!this.config.contractContext) { + this.config.contractContext = await LitContracts.getContractAddresses( + this.config.litNetwork, + new ethers_exports.providers.StaticJsonRpcProvider({ + url: this.config.rpcUrl || RPC_URL_BY_NETWORK[this.config.litNetwork], + skipFetchSetup: true, + }) + ); + } else if ( + !this.config.contractContext.Staking && + !this.config.contractContext.resolverAddress + ) { + throw new InitError( + { + info: { + contractContext: this.config.contractContext, + litNetwork: this.config.litNetwork, + rpcUrl: this.config.rpcUrl, + }, + }, + 'The provided contractContext was missing the "Staking" contract' + ); + } + if (this.config.contractContext) { + const logAddresses = Object.entries(this.config.contractContext).reduce( + (output, [key2, val]) => { + output[key2] = val.address; + return output; + }, + {} + ); + if (this.config.litNetwork === LIT_NETWORK.Custom) { + log('using custom contracts: ', logAddresses); + } + } + const validatorData = await this._getValidatorData(); + this._stakingContract = validatorData.stakingContract; + this.config.minNodeCount = validatorData.minNodeCount; + this.config.bootstrapUrls = validatorData.bootstrapUrls; + this.config.priceByNetwork = validatorData.priceByNetwork; + this._epochState = await this._fetchCurrentEpochState( + validatorData.epochInfo + ); + const { connectedNodes, serverKeys, coreNodeConfig } = + await this._runHandshakeWithBootstrapUrls(); + Object.assign(this, { ...coreNodeConfig, connectedNodes, serverKeys }); + this._listenForNewEpoch(); + this.ready = true; + log( + `\u{1F525} lit is ready. "litNodeClient" variable is ready to use globally.` + ); + log('current network config', { + networkPubkey: this.networkPubKey, + networkPubKeySet: this.networkPubKeySet, + hdRootPubkeys: this.hdRootPubkeys, + subnetPubkey: this.subnetPubKey, + latestBlockhash: this.latestBlockhash, + }); + if (isBrowser()) { + document.dispatchEvent(new Event('lit-ready')); + } + } + async _handshakeAndVerifyNodeAttestation({ url, requestId }) { + const challenge = this.getRandomHexString(64); + const handshakeResult = await this.handshakeWithNode( + { url, challenge }, + requestId + ); + const keys = { + serverPubKey: handshakeResult.serverPublicKey, + subnetPubKey: handshakeResult.subnetPublicKey, + networkPubKey: handshakeResult.networkPublicKey, + networkPubKeySet: handshakeResult.networkPublicKeySet, + hdRootPubkeys: handshakeResult.hdRootPubkeys, + latestBlockhash: handshakeResult.latestBlockhash, + }; + if ( + keys.serverPubKey === 'ERR' || + keys.subnetPubKey === 'ERR' || + keys.networkPubKey === 'ERR' || + keys.networkPubKeySet === 'ERR' + ) { + logErrorWithRequestId( + requestId, + 'Error connecting to node. Detected "ERR" in keys', + url, + keys + ); + } + log(`Handshake with ${url} returned keys: `, keys); + if (!keys.latestBlockhash) { + logErrorWithRequestId( + requestId, + `Error getting latest blockhash from the node ${url}.` + ); + } + if ( + this.config.checkNodeAttestation || + NETWORKS_REQUIRING_SEV.includes(this.config.litNetwork) + ) { + const attestation = handshakeResult.attestation; + if (!attestation) { + throw new InvalidNodeAttestation( + {}, + `Missing attestation in handshake response from %s`, + url + ); + } + log('Checking attestation against amd certs...'); + try { + await checkSevSnpAttestation(attestation, challenge, url); + log(`Lit Node Attestation verified for ${url}`); + } catch (e2) { + throw new InvalidNodeAttestation( + { + cause: e2, + }, + `Lit Node Attestation failed verification for %s - %s`, + url, + e2.message + ); + } + } else if (this.config.litNetwork === LIT_NETWORK.Custom) { + log( + `Node attestation SEV verification is disabled. You must explicitly set "checkNodeAttestation" to true when using 'custom' network` + ); + } + return keys; + } + /** Handshakes with all nodes that are in `bootstrapUrls` + * @private + * + * @returns {Promise<{connectedNodes: Set, serverKeys: {}}>} Returns a set of the urls of nodes that we + * successfully connected to, an object containing their returned keys, and our 'core' config (most common values for + * critical values) + */ + async _runHandshakeWithBootstrapUrls() { + const requestId = this._getNewRequestId(); + const connectedNodes = /* @__PURE__ */ new Set(); + const serverKeys = {}; + let timeoutHandle; + await Promise.race([ + new Promise((_resolve, reject) => { + timeoutHandle = setTimeout(() => { + const msg = `Error: Could not handshake with nodes after timeout of ${ + this.config.connectTimeout + }ms. Could only connect to ${Object.keys(serverKeys).length} of ${ + this.config.bootstrapUrls.length + } nodes. Please check your network connection and try again. Note that you can control this timeout with the connectTimeout config option which takes milliseconds.`; + try { + throw new InitError({}, msg); + } catch (e2) { + logErrorWithRequestId(requestId, e2); + reject(e2); + } + }, this.config.connectTimeout); + }), + Promise.all( + this.config.bootstrapUrls.map(async (url) => { + serverKeys[url] = await this._handshakeAndVerifyNodeAttestation({ + url, + requestId, + }); + connectedNodes.add(url); + }) + ).finally(() => { + clearTimeout(timeoutHandle); + }), + ]); + const coreNodeConfig = this._getCoreNodeConfigFromHandshakeResults({ + serverKeys, + requestId, + }); + return { connectedNodes, serverKeys, coreNodeConfig }; + } + _getCoreNodeConfigFromHandshakeResults({ serverKeys, requestId }) { + const latestBlockhash = mostCommonString( + Object.values(serverKeys).map( + (keysFromSingleNode) => keysFromSingleNode.latestBlockhash + ) + ); + if (!latestBlockhash) { + logErrorWithRequestId( + requestId, + 'Error getting latest blockhash from the nodes.' + ); + throw new InvalidEthBlockhash( + { + info: { + requestId, + }, + }, + `latestBlockhash is not available. Received: "%s"`, + latestBlockhash + ); + } + return { + subnetPubKey: mostCommonString( + Object.values(serverKeys).map( + (keysFromSingleNode) => keysFromSingleNode.subnetPubKey + ) + ), + networkPubKey: mostCommonString( + Object.values(serverKeys).map( + (keysFromSingleNode) => keysFromSingleNode.networkPubKey + ) + ), + networkPubKeySet: mostCommonString( + Object.values(serverKeys).map( + (keysFromSingleNode) => keysFromSingleNode.networkPubKeySet + ) + ), + hdRootPubkeys: mostCommonString( + Object.values(serverKeys).map( + (keysFromSingleNode) => keysFromSingleNode.hdRootPubkeys + ) + ), + latestBlockhash, + lastBlockHashRetrieved: Date.now(), + }; + } + _getProviderWithFallback = async (providerTest) => { + for (const url of FALLBACK_RPC_URLS) { + try { + const provider = new ethers_exports.providers.JsonRpcProvider({ + url, + // https://docs.ethers.org/v5/api/utils/web/#ConnectionInfo + timeout: 6e4, + }); + const testResult = await providerTest(provider); + return { + provider, + testResult, + }; + } catch (error) { + logError(`RPC URL failed: ${url}`); + } + } + return null; + }; + /** + * Fetches the latest block hash and log any errors that are returned + * Nodes will accept any blockhash in the last 30 days but use the latest 10 as challenges for webauthn + * Note: last blockhash from providers might not be propagated to the nodes yet, so we need to use a slightly older one + * @returns void + */ + async _syncBlockhash() { + const currentTime = Date.now(); + const blockHashValidityDuration = BLOCKHASH_SYNC_INTERVAL; + if ( + this.latestBlockhash && + this.lastBlockHashRetrieved && + currentTime - this.lastBlockHashRetrieved < blockHashValidityDuration + ) { + log('Blockhash is still valid. No need to sync.'); + return; + } + log( + 'Syncing state for new blockhash ', + 'current blockhash: ', + this.latestBlockhash + ); + try { + const resp = await fetch(this._blockHashUrl); + if (!resp.ok) { + throw new NetworkError( + { + responseResult: resp.ok, + responseStatus: resp.status, + }, + `Error getting latest blockhash from ${this._blockHashUrl}. Received: "${resp.status}"` + ); + } + const blockHashBody = await resp.json(); + const { blockhash, timestamp } = blockHashBody; + if (!blockhash || !timestamp) { + throw new NetworkError( + { + responseResult: resp.ok, + blockHashBody, + }, + `Error getting latest blockhash from block indexer. Received: "${blockHashBody}"` + ); + } + this.latestBlockhash = blockHashBody.blockhash; + this.lastBlockHashRetrieved = parseInt(timestamp) * 1e3; + log('Done syncing state new blockhash: ', this.latestBlockhash); + } catch (error) { + const err = error; + logError( + 'Error while attempting to fetch new latestBlockhash:', + err instanceof Error ? err.message : err.messages, + 'Reason: ', + err instanceof Error ? err : err.reason + ); + log( + 'Attempting to fetch blockhash manually using ethers with fallback RPC URLs...' + ); + const { testResult } = + (await this._getProviderWithFallback( + // We use a previous block to avoid nodes not having received the latest block yet + (provider) => provider.getBlock(BLOCKHASH_COUNT_PROVIDER_DELAY) + )) || {}; + if (!testResult || !testResult.hash) { + logError('All fallback RPC URLs failed. Unable to retrieve blockhash.'); + return; + } + try { + this.latestBlockhash = testResult.hash; + this.lastBlockHashRetrieved = testResult.timestamp; + log( + 'Successfully retrieved blockhash manually: ', + this.latestBlockhash + ); + } catch (ethersError) { + logError('Failed to manually retrieve blockhash using ethers'); + } + } + } + /** Currently, we perform a full sync every 30s, including handshaking with every node + * However, we also have a state change listener that watches for staking contract state change events, which + * _should_ be the only time that we need to perform handshakes with every node. + * + * However, the current block hash does need to be updated regularly, and we currently update it only when we + * handshake with every node. + * + * We can remove this network sync code entirely if we refactor our code to fetch latest blockhash on-demand. + * @private + */ + // private _scheduleNetworkSync() { + // if (this._networkSyncInterval) { + // clearInterval(this._networkSyncInterval); + // } + // this._networkSyncInterval = setInterval(async () => { + // if ( + // !this.lastBlockHashRetrieved || + // Date.now() - this.lastBlockHashRetrieved >= BLOCKHASH_SYNC_INTERVAL + // ) { + // await this._syncBlockhash(); + // } + // }, BLOCKHASH_SYNC_INTERVAL); + // } + /** + * + * Get a new random request ID + * + * @returns { string } + * + */ + _getNewRequestId() { + return Math.random().toString(16).slice(2); + } + /** + * + * Get a random hex string for use as an attestation challenge + * + * @returns { string } + */ + getRandomHexString(size) { + return [...Array(size)] + .map(() => Math.floor(Math.random() * 16).toString(16)) + .join(''); + } + /** + * Handshake with Node + * + * @param { HandshakeWithNode } params + * @param { string } requestId + * @returns { Promise } + * + */ + handshakeWithNode = async (params, requestId) => { + const { url } = params; + const urlWithPath = composeLitUrl({ + url, + endpoint: LIT_ENDPOINT.HANDSHAKE, + }); + log(`handshakeWithNode ${urlWithPath}`); + const data = { + clientPublicKey: 'test', + challenge: params.challenge, + }; + return await this.sendCommandToNode({ + url: urlWithPath, + data, + requestId, + }); + }; + async _fetchCurrentEpochState(epochInfo) { + if (!this._stakingContract) { + throw new InitError( + {}, + 'Unable to fetch current epoch number; no staking contract configured. Did you forget to `connect()`?' + ); + } + if (!epochInfo) { + log( + 'epochinfo not found. Not a problem, fetching current epoch state from staking contract' + ); + try { + const validatorData = await this._getValidatorData(); + epochInfo = validatorData.epochInfo; + } catch (error) { + throw new UnknownError( + {}, + '[_fetchCurrentEpochNumber] Error getting current epoch number: %s', + error + ); + } + } + const startTime = epochInfo.endTime - epochInfo.epochLength; + return { + currentNumber: epochInfo.number, + startTime, + }; + } + get currentEpochNumber() { + if ( + this._epochCache.currentNumber && + this._epochCache.startTime && + Math.floor(Date.now() / 1e3) < + this._epochCache.startTime + + Math.floor(EPOCH_PROPAGATION_DELAY / 1e3) && + this._epochCache.currentNumber >= 3 + ) { + return this._epochCache.currentNumber - 1; + } + return this._epochCache.currentNumber; + } + set _epochState({ currentNumber, startTime }) { + this._epochCache.currentNumber = currentNumber; + this._epochCache.startTime = startTime; + } + // ==================== SENDING COMMAND ==================== + /** + * + * Send a command to nodes + * + * @param { SendNodeCommand } + * + * @returns { Promise } + * + */ + sendCommandToNode = async ({ url, data, requestId }) => { + data = { ...data, epoch: this.currentEpochNumber }; + if (data.sessionSigs) { + delete data.sessionSigs; + } + logWithRequestId( + requestId, + `sendCommandToNode with url ${url} and data`, + data + ); + const req = { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + 'X-Lit-SDK-Version': version, + 'X-Lit-SDK-Type': 'Typescript', + 'X-Request-Id': 'lit_' + requestId, + }, + body: JSON.stringify(data), + }; + return sendRequest(url, req, requestId); + }; + /** + * + * Get and gather node promises + * + * @param { any } callback + * + * @returns { Array> } + * + */ + getNodePromises = (callback) => { + const nodePromises = []; + for (const url of this.connectedNodes) { + nodePromises.push(callback(url)); + } + return nodePromises; + }; + getRandomNodePromise(callback) { + const randomNodeIndex = Math.floor( + Math.random() * this.connectedNodes.size + ); + const nodeUrlsArr = Array.from(this.connectedNodes); + return [callback(nodeUrlsArr[randomNodeIndex])]; + } + /** + * Retrieves the session signature for a given URL from the sessionSigs map. + * Throws an error if sessionSigs is not provided or if the session signature for the URL is not found. + * + * @param sessionSigs - The session signatures map. + * @param url - The URL for which to retrieve the session signature. + * @returns The session signature for the given URL. + * @throws An error if sessionSigs is not provided or if the session signature for the URL is not found. + */ + getSessionSigByUrl = ({ sessionSigs, url }) => { + if (!sessionSigs) { + throw new InvalidArgumentException( + {}, + 'You must pass in sessionSigs. Received: %s', + sessionSigs + ); + } + const sigToPassToNode = sessionSigs[url]; + if (!sessionSigs[url]) { + throw new InvalidArgumentException( + {}, + 'You passed sessionSigs but we could not find session sig for node %s', + url + ); + } + return sigToPassToNode; + }; + validateAccessControlConditionsSchema = async (params) => { + const { + accessControlConditions, + evmContractConditions, + solRpcConditions, + unifiedAccessControlConditions, + } = params; + if (accessControlConditions) { + await validateAccessControlConditionsSchema(accessControlConditions); + } else if (evmContractConditions) { + await validateEVMContractConditionsSchema(evmContractConditions); + } else if (solRpcConditions) { + await validateSolRpcConditionsSchema(solRpcConditions); + } else if (unifiedAccessControlConditions) { + await validateUnifiedAccessControlConditionsSchema( + unifiedAccessControlConditions + ); + } + return true; + }; + /** + * + * Get hash of access control conditions + * + * @param { MultipleAccessControlConditions } params + * + * @returns { Promise } + * + */ + getHashedAccessControlConditions = async (params) => { + let hashOfConditions; + const { + accessControlConditions, + evmContractConditions, + solRpcConditions, + unifiedAccessControlConditions, + } = params; + if (accessControlConditions) { + hashOfConditions = await hashAccessControlConditions( + accessControlConditions + ); + } else if (evmContractConditions) { + hashOfConditions = await hashEVMContractConditions(evmContractConditions); + } else if (solRpcConditions) { + hashOfConditions = await hashSolRpcConditions(solRpcConditions); + } else if (unifiedAccessControlConditions) { + hashOfConditions = await hashUnifiedAccessControlConditions( + unifiedAccessControlConditions + ); + } else { + return; + } + return hashOfConditions; + }; + /** + * Handle node promises + * + * @param { Array> } nodePromises + * + * @param { string } requestId requestId to be logged in case of error + * @param { number } minNodeCount number of nodes we need valid results from in order to resolve + * @returns { Promise | RejectedNodePromises> } + */ + handleNodePromises = async (nodePromises, requestId, minNodeCount) => { + async function waitForNSuccessesWithErrors(promises, n2) { + let responses = 0; + const successes2 = []; + const errors2 = []; + return new Promise((resolve) => { + promises.forEach((promise) => { + promise + .then((result) => { + successes2.push(result); + if (successes2.length >= n2) { + resolve({ successes: successes2, errors: errors2 }); + } + }) + .catch((error) => { + errors2.push(error); + }) + .finally(() => { + responses++; + if (responses === promises.length) { + resolve({ successes: successes2, errors: errors2 }); + } + }); + }); + }); + } + const { successes, errors } = await waitForNSuccessesWithErrors( + nodePromises, + minNodeCount + ); + if (successes.length >= minNodeCount) { + return { + success: true, + values: successes, + }; + } + const mostCommonError = JSON.parse( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + mostCommonString(errors.map((r3) => JSON.stringify(r3))) + ); + logErrorWithRequestId( + requestId || '', + `most common error: ${JSON.stringify(mostCommonError)}` + ); + return { + success: false, + error: mostCommonError, + }; + }; + /** + * Throw node error + * + * @param { RejectedNodePromises } res + * @param { string } requestId + * + * @returns { never } + * + */ + _throwNodeError = (res, requestId) => { + if (res.error) { + if ( + ((res.error.errorCode && + res.error.errorCode === LIT_ERROR_CODE.NODE_NOT_AUTHORIZED) || + res.error.errorCode === 'not_authorized') && + this.config.alertWhenUnauthorized + ) { + log('You are not authorized to access this content'); + } + throw new NodeError( + { + info: { + requestId, + errorCode: res.error.errorCode, + message: res.error.message, + }, + cause: res.error, + }, + 'There was an error getting the signing shares from the nodes. Response from the nodes: %s', + JSON.stringify(res) + ); + } else { + throw new UnknownError( + { + info: { + requestId, + }, + }, + `There was an error getting the signing shares from the nodes. Response from the nodes: %s`, + JSON.stringify(res) + ); + } + }; + /** + * + * Get different formats of access control conditions, eg. evm, sol, unified etc. + * + * @param { SupportedJsonRequests } params + * + * @returns { FormattedMultipleAccs } + * + */ + getFormattedAccessControlConditions = (params) => { + const { + accessControlConditions, + evmContractConditions, + solRpcConditions, + unifiedAccessControlConditions, + } = params; + let formattedAccessControlConditions; + let formattedEVMContractConditions; + let formattedSolRpcConditions; + let formattedUnifiedAccessControlConditions; + let error = false; + if (accessControlConditions) { + formattedAccessControlConditions = accessControlConditions.map((c) => + canonicalAccessControlConditionFormatter(c) + ); + log( + 'formattedAccessControlConditions', + JSON.stringify(formattedAccessControlConditions) + ); + } else if (evmContractConditions) { + formattedEVMContractConditions = evmContractConditions.map((c) => + canonicalEVMContractConditionFormatter(c) + ); + log( + 'formattedEVMContractConditions', + JSON.stringify(formattedEVMContractConditions) + ); + } else if (solRpcConditions) { + formattedSolRpcConditions = solRpcConditions.map((c) => + canonicalSolRpcConditionFormatter(c) + ); + log( + 'formattedSolRpcConditions', + JSON.stringify(formattedSolRpcConditions) + ); + } else if (unifiedAccessControlConditions) { + formattedUnifiedAccessControlConditions = + unifiedAccessControlConditions.map((c) => + canonicalUnifiedAccessControlConditionFormatter(c) + ); + log( + 'formattedUnifiedAccessControlConditions', + JSON.stringify(formattedUnifiedAccessControlConditions) + ); + } else { + error = true; + } + return { + error, + formattedAccessControlConditions, + formattedEVMContractConditions, + formattedSolRpcConditions, + formattedUnifiedAccessControlConditions, + }; + }; + /** + * Calculates an HD public key from a given keyId + * The curve type or signature type is assumed to be k256 unless provided + * @param keyId + * @param {LIT_CURVE_VALUES} sigType + * @returns {string} public key + */ + computeHDPubKey = async (keyId, sigType = LIT_CURVE.EcdsaCaitSith) => { + if (!this.hdRootPubkeys) { + logError('root public keys not found, have you connected to the nodes?'); + throw new LitNodeClientNotReadyError( + {}, + 'root public keys not found, have you connected to the nodes?' + ); + } + return await computeHDPubKey(this.hdRootPubkeys, keyId, sigType); + }; + /** + * Calculates a Key Id for claiming a pkp based on a user identifier and an app identifier. + * The key Identifier is an Auth Method Id which scopes the key uniquely to a specific application context. + * These identifiers are specific to each auth method and will derive the public key portion of a pkp which will be persisted + * when a key is claimed. + * | Auth Method | User ID | App ID | + * |:------------|:--------|:-------| + * | Google OAuth | token `sub` | token `aud` | + * | Discord OAuth | user id | client app identifier | + * | Stytch OTP |token `sub` | token `aud`| + * | Lit Actions | user defined | ipfs cid | + * *Note* Lit Action claiming uses a different schema than other auth methods + * + * @param {string} userId user identifier for the Key Identifier + * @param {string} appId app identifier for the Key Identifier + * @param {boolean} isForActionContext should be set for true if using claiming through actions + * + * @returns {string} public key of pkp when claimed + */ + computeHDKeyId(userId, appId, isForActionContext = false) { + if (!isForActionContext) { + return ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes(`${userId}:${appId}`) + ); + } else { + return ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes(`${appId}:${userId}`) + ); + } + } +}; + +// packages/lit-node-client-nodejs/src/lib/helpers/encode-code.ts +init_shim(); +var encodeCode = (code9) => { + const _uint8Array = uint8arrayFromString(code9, 'utf8'); + const encodedJs = uint8arrayToString(_uint8Array, 'base64'); + return encodedJs; +}; + +// packages/lit-node-client-nodejs/src/lib/helpers/get-bls-signatures.ts +init_shim(); +function getBlsSignatures(responseData) { + if (!responseData) { + throw new Error('[getBlsSignatures] No data provided'); + } + const signatureShares = responseData.map((s2) => ({ + ProofOfPossession: { + identifier: s2.signatureShare.ProofOfPossession.identifier, + value: s2.signatureShare.ProofOfPossession.value, + }, + })); + log(`[getBlsSignatures] signatureShares:`, signatureShares); + if (!signatureShares || signatureShares.length <= 0) { + throw new Error('[getBlsSignatures] No signature shares provided'); + } + return signatureShares; +} + +// packages/lit-node-client-nodejs/src/lib/helpers/get-claims.ts +init_shim(); +var getClaims = (claims) => { + const keys = Object.keys(claims[0]); + const signatures = {}; + const claimRes = {}; + for (let i2 = 0; i2 < keys.length; i2++) { + const claimSet = claims.map((c) => c[keys[i2]]); + signatures[keys[i2]] = []; + claimSet.map((c) => { + const sig = ethers_exports.utils.splitSignature(`0x${c.signature}`); + const convertedSig = { + r: sig.r, + s: sig.s, + v: sig.v, + }; + signatures[keys[i2]].push(convertedSig); + }); + claimRes[keys[i2]] = { + signatures: signatures[keys[i2]], + derivedKeyId: claimSet[0].derivedKeyId, + }; + } + return claimRes; +}; + +// packages/lit-node-client-nodejs/src/lib/helpers/get-claims-list.ts +init_shim(); +var getClaimsList = (responseData) => { + const claimsList = responseData + .map((r3) => { + const { claimData } = r3; + if (claimData) { + for (const key2 of Object.keys(claimData)) { + for (const subkey of Object.keys(claimData[key2])) { + if (typeof claimData[key2][subkey] == 'string') { + claimData[key2][subkey] = claimData[key2][subkey].replaceAll( + '"', + '' + ); + } + } + } + return claimData; + } + return null; + }) + .filter((item) => item !== null); + return claimsList; +}; + +// packages/lit-node-client-nodejs/src/lib/helpers/get-signatures.ts +init_shim(); +var getSignatures = async (params) => { + let { networkPubKeySet, threshold, signedMessageShares, requestId } = params; + if (networkPubKeySet === null) { + throw new ParamNullError( + { + info: { + requestId, + }, + }, + 'networkPubKeySet cannot be null' + ); + } + if (signedMessageShares.length < threshold) { + logErrorWithRequestId( + requestId, + `not enough nodes to get the signatures. Expected ${threshold}, got ${signedMessageShares.length}` + ); + throw new NoValidShares( + { + info: { + requestId, + shares: signedMessageShares.length, + threshold, + }, + }, + `The total number of valid signatures shares "${signedMessageShares.length}" does not meet the threshold of "${threshold}"` + ); + } + const curveType = signedMessageShares[0].sigType; + if (!curveType) { + throw new CurveTypeNotFoundError( + { + info: { + requestId, + }, + }, + 'No curve type "%s" found', + curveType + ); + } + const curveGroup = CURVE_GROUP_BY_CURVE_TYPE[curveType]; + if (curveGroup !== 'ECDSA') { + throw new UnknownSignatureType( + { + info: { + requestId, + signatureType: curveType, + }, + }, + 'signature type is %s which is invalid', + curveType + ); + } + const combinedSignature = await combineEcdsaShares(signedMessageShares); + const _publicKey = mostCommonString( + signedMessageShares.map((s2) => s2.publicKey) + ); + const _dataSigned = mostCommonString( + signedMessageShares.map((s2) => s2.dataSigned) + ); + if (!_publicKey || !_dataSigned) { + throw new Error('No valid publicKey or dataSigned found'); + } + const sigResponse = { + ...combinedSignature, + publicKey: _publicKey, + dataSigned: _dataSigned, + }; + return sigResponse; +}; + +// packages/lit-node-client-nodejs/src/lib/helpers/normalize-array.ts +init_shim(); +var normalizeArray = (toSign) => { + const arr = []; + const uint8Array = new Uint8Array(toSign); + for (let i2 = 0; i2 < uint8Array.length; i2++) { + arr.push(uint8Array[i2]); + } + return arr; +}; + +// packages/lit-node-client-nodejs/src/lib/helpers/normalize-params.ts +init_shim(); +var normalizeJsParams = (jsParams) => { + for (const key2 of Object.keys(jsParams)) { + const value = jsParams[key2]; + if (ArrayBuffer.isView(value)) { + jsParams[key2] = Array.from( + new Uint8Array(value.buffer, value.byteOffset, value.byteLength) + ); + } else if (value instanceof ArrayBuffer) { + jsParams[key2] = Array.from(new Uint8Array(value)); + } + } + return jsParams; +}; + +// packages/lit-node-client-nodejs/src/lib/helpers/parse-as-json-or-string.ts +init_shim(); +var parseAsJsonOrString = (responseString) => { + try { + return JSON.parse(responseString); + } catch (e2) { + log( + '[parseResponses] Error parsing response as json. Swallowing and returning as string.', + responseString + ); + return responseString; + } +}; + +// packages/lit-node-client-nodejs/src/lib/helpers/parse-pkp-sign-response.ts +init_shim(); +var snakeToCamel = (s2) => s2.replace(/(_\w)/g, (m) => m[1].toUpperCase()); +var convertKeysToCamelCase = (obj) => + Object.keys(obj).reduce( + (acc, key2) => ({ + ...acc, + [snakeToCamel(key2)]: obj[key2], + }), + {} + ); +var cleanStringValues = (obj) => + Object.keys(obj).reduce( + (acc, key2) => ({ + ...acc, + [key2]: + typeof obj[key2] === 'string' ? obj[key2].replace(/"/g, '') : obj[key2], + }), + {} + ); +var parsePkpSignResponse = (responseData) => { + const ecdsaSignedMessageShares = responseData.map(({ signatureShare }) => { + const resolvedShare = + typeof signatureShare === 'object' && + !Array.isArray(signatureShare) && + Object.keys(signatureShare).length === 1 && + typeof signatureShare[Object.keys(signatureShare)[0]] === 'object' + ? signatureShare[Object.keys(signatureShare)[0]] + : signatureShare; + if (!resolvedShare || typeof resolvedShare !== 'object') { + throw new Error('Invalid signatureShare structure.'); + } + const camelCaseShare = convertKeysToCamelCase(resolvedShare); + const parsedShareMessage = cleanStringValues(camelCaseShare); + if (parsedShareMessage.digest) { + parsedShareMessage.dataSigned = parsedShareMessage.digest; + } + delete parsedShareMessage.result; + return parsedShareMessage; + }); + return ecdsaSignedMessageShares; +}; + +// packages/lit-node-client-nodejs/src/lib/helpers/process-lit-action-response-strategy.ts +init_shim(); +var _findFrequency = (responses) => { + const sorted = responses.sort( + (a2, b) => + responses.filter((v) => v === a2).length - + responses.filter((v) => v === b).length + ); + return { min: sorted[0], max: sorted[sorted?.length - 1] }; +}; +var processLitActionResponseStrategy = (responses, strategy) => { + const executionResponses = responses.map((nodeResp) => { + return nodeResp.response; + }); + const copiedExecutionResponses = executionResponses.map((r3) => { + return '' + r3; + }); + if (strategy.strategy === 'custom') { + try { + if (strategy.customFilter) { + const customResponseFilterResult = + strategy?.customFilter(executionResponses); + return customResponseFilterResult; + } else { + logError( + 'Custom filter specified for response strategy but none found. using most common' + ); + } + } catch (e2) { + logError( + 'Error while executing custom response filter, defaulting to most common', + e2.toString() + ); + } + } + let respFrequency = _findFrequency(copiedExecutionResponses); + if (strategy?.strategy === 'leastCommon') { + log( + 'strategy found to be most common, taking most common response from execution results' + ); + return respFrequency.min; + } else if (strategy?.strategy === 'mostCommon') { + log( + 'strategy found to be most common, taking most common response from execution results' + ); + return respFrequency.max; + } else { + log( + 'no strategy found, using least common response object from execution results' + ); + respFrequency.min; + } +}; + +// packages/lit-node-client-nodejs/src/lib/helpers/remove-double-quotes.ts +init_shim(); +var removeDoubleQuotes = (obj) => { + for (const key2 of Object.keys(obj)) { + const value = obj[key2]; + for (const subkey of Object.keys(value)) { + if (typeof value[subkey] === 'string') { + value[subkey] = value[subkey].replaceAll('"', ''); + } + } + } + return obj; +}; + +// packages/lit-node-client-nodejs/src/lib/helpers/validate-bls-session-sig.ts +init_shim(); +import { SiweError, SiweErrorType } from 'siwe'; +var LIT_SESSION_SIGNED_MESSAGE_PREFIX = 'lit_session:'; +var blsSessionSigVerify = async ( + verifier, + networkPubKey, + authSig, + authSigSiweMessage +) => { + let sigJson = JSON.parse(authSig.sig); + const eip191Hash = ethers_exports.utils.hashMessage(authSig.signedMessage); + const prefixedStr = + LIT_SESSION_SIGNED_MESSAGE_PREFIX + eip191Hash.replace('0x', ''); + const prefixedEncoded = ethers_exports.utils.toUtf8Bytes(prefixedStr); + const shaHashed = ethers_exports.utils + .sha256(prefixedEncoded) + .replace('0x', ''); + const signatureString = sigJson.ProofOfPossession; + const checkTime = /* @__PURE__ */ new Date(); + if (!authSigSiweMessage.expirationTime || !authSigSiweMessage.issuedAt) { + throw new Error( + 'Invalid SIWE message. Missing expirationTime or issuedAt.' + ); + } + const expirationDate = new Date(authSigSiweMessage.expirationTime); + if (checkTime.getTime() >= expirationDate.getTime()) { + throw new SiweError( + SiweErrorType.EXPIRED_MESSAGE, + `${checkTime.toISOString()} < ${expirationDate.toISOString()}`, + `${checkTime.toISOString()} >= ${expirationDate.toISOString()}` + ); + } + const issuedAt = new Date(authSigSiweMessage.issuedAt); + if (checkTime.getTime() < issuedAt.getTime()) { + throw new SiweError( + SiweErrorType.NOT_YET_VALID_MESSAGE, + `${checkTime.toISOString()} >= ${issuedAt.toISOString()}`, + `${checkTime.toISOString()} < ${issuedAt.toISOString()}` + ); + } + await verifier(networkPubKey, Buffer.from(shaHashed, 'hex'), signatureString); +}; + +// packages/lit-node-client-nodejs/src/lib/lit-node-client-nodejs.ts +var REALM_ID2 = 1; +var _LitNodeClientNodeJs = class extends LitCore { + defaultAuthCallback; + // ========== Constructor ========== + constructor(args) { + if (!args) { + throw new ParamsMissingError({}, 'must provide LitNodeClient parameters'); + } + super(args); + if (args !== void 0 && args !== null && 'defaultAuthCallback' in args) { + this.defaultAuthCallback = args.defaultAuthCallback; + } + } + // ========== Payment Delegation ========== + createCapacityDelegationAuthSig = async (params) => { + if (!params.dAppOwnerWallet) { + throw new InvalidParamType( + { + info: { + params, + }, + }, + 'dAppOwnerWallet must exist' + ); + } + if (!params.delegateeAddresses || params.delegateeAddresses.length === 0) { + log( + `[createCapacityDelegationAuthSig] 'delegateeAddresses' is an empty array. It means that no body can use it. However, if the 'delegateeAddresses' field is omitted, It means that the capability will not restrict access based on delegatee list, but it may still enforce other restrictions such as usage limits (uses) and specific NFT IDs (nft_id).` + ); + } + const dAppOwnerWalletAddress = ethers_exports.utils.getAddress( + await params.dAppOwnerWallet.getAddress() + ); + if (!this.ready) { + await this.connect(); + } + const siweMessage = await createSiweMessageWithCapacityDelegation({ + uri: 'lit:capability:delegation', + litNodeClient: this, + walletAddress: dAppOwnerWalletAddress, + nonce: await this.getLatestBlockhash(), + expiration: params.expiration, + domain: params.domain, + statement: params.statement, + // -- capacity delegation specific configuration + uses: params.uses, + delegateeAddresses: params.delegateeAddresses, + // paymentId: params.paymentId, + }); + const authSig = await generateAuthSig({ + signer: params.dAppOwnerWallet, + toSign: siweMessage, + }); + return { capacityDelegationAuthSig: authSig }; + }; + /** + * + * we need to send jwt params iat (issued at) and exp (expiration) because the nodes may have different wall clock times, the nodes will verify that these params are withing a grace period + * + */ + getJWTParams = () => { + const now2 = Date.now(); + const iat = Math.floor(now2 / 1e3); + const exp = iat + 12 * 60 * 60; + return { iat, exp }; + }; + // ==================== SESSIONS ==================== + /** + * Try to get the session key in the local storage, + * if not, generates one. + * @return { SessionKeyPair } session key pair + */ + getSessionKey = () => { + const storageKey = LOCAL_STORAGE_KEYS.SESSION_KEY; + const storedSessionKeyOrError = getStorageItem(storageKey); + if ( + storedSessionKeyOrError.type === EITHER_TYPE.ERROR || + !storedSessionKeyOrError.result || + storedSessionKeyOrError.result === '' + ) { + console.warn( + `Storage key "${storageKey}" is missing. Not a problem. Continue...` + ); + const newSessionKey = generateSessionKeyPair(); + try { + localStorage.setItem(storageKey, JSON.stringify(newSessionKey)); + } catch (e2) { + log( + `[getSessionKey] Localstorage not available.Not a problem. Continue...` + ); + } + return newSessionKey; + } else { + return JSON.parse(storedSessionKeyOrError.result); + } + }; + /** + * Check if a given object is of type SessionKeyPair. + * + * @param obj - The object to check. + * @returns True if the object is of type SessionKeyPair. + */ + isSessionKeyPair(obj) { + return ( + typeof obj === 'object' && + 'publicKey' in obj && + 'secretKey' in obj && + typeof obj.publicKey === 'string' && + typeof obj.secretKey === 'string' + ); + } + /** + * Generates wildcard capability for each of the LIT resources + * specified. + * @param litResources is an array of LIT resources + * @param addAllCapabilities is a boolean that specifies whether to add all capabilities for each resource + */ + static async generateSessionCapabilityObjectWithWildcards( + litResources, + addAllCapabilities + ) { + const sessionCapabilityObject = new RecapSessionCapabilityObject({}, []); + const _addAllCapabilities = addAllCapabilities ?? false; + if (_addAllCapabilities) { + for (const litResource of litResources) { + sessionCapabilityObject.addAllCapabilitiesForResource(litResource); + } + } + return sessionCapabilityObject; + } + // backward compatibility + async generateSessionCapabilityObjectWithWildcards(litResources) { + return await _LitNodeClientNodeJs.generateSessionCapabilityObjectWithWildcards( + litResources + ); + } + // backward compatibility + getExpiration = () => { + return _LitNodeClientNodeJs.getExpiration(); + }; + /** + * + * Get the signature from local storage, if not, generates one + * + */ + getWalletSig = async ({ + authNeededCallback, + chain, + sessionCapabilityObject, + switchChain, + expiration, + sessionKeyUri, + nonce, + resourceAbilityRequests, + litActionCode, + litActionIpfsId, + jsParams, + sessionKey, + }) => { + let walletSig; + const storageKey = LOCAL_STORAGE_KEYS.WALLET_SIGNATURE; + const storedWalletSigOrError = getStorageItem(storageKey); + log(`getWalletSig - flow starts + storageKey: ${storageKey} + storedWalletSigOrError: ${JSON.stringify(storedWalletSigOrError)} + `); + if ( + storedWalletSigOrError.type === EITHER_TYPE.ERROR || + !storedWalletSigOrError.result || + storedWalletSigOrError.result == '' + ) { + log('getWalletSig - flow 1'); + console.warn( + `Storage key "${storageKey}" is missing. Not a problem. Continue...` + ); + if (authNeededCallback) { + log('getWalletSig - flow 1.1'); + const body = { + chain, + statement: sessionCapabilityObject?.statement, + resources: sessionCapabilityObject + ? [sessionCapabilityObject.encodeAsSiweResource()] + : void 0, + ...(switchChain && { switchChain }), + expiration, + uri: sessionKeyUri, + sessionKey, + nonce, + // for recap + ...(resourceAbilityRequests && { resourceAbilityRequests }), + // for lit action custom auth + ...(litActionCode && { litActionCode }), + ...(litActionIpfsId && { litActionIpfsId }), + ...(jsParams && { jsParams }), + }; + log('callback body:', body); + walletSig = await authNeededCallback(body); + } else { + log('getWalletSig - flow 1.2'); + if (!this.defaultAuthCallback) { + log('getWalletSig - flow 1.2.1'); + throw new ParamsMissingError( + {}, + 'No authNeededCallback nor default auth callback provided' + ); + } + log('getWalletSig - flow 1.2.2'); + walletSig = await this.defaultAuthCallback({ + chain, + statement: sessionCapabilityObject.statement, + resources: sessionCapabilityObject + ? [sessionCapabilityObject.encodeAsSiweResource()] + : void 0, + switchChain, + expiration, + uri: sessionKeyUri, + nonce, + }); + } + log('getWalletSig - flow 1.3'); + const storeNewWalletSigOrError = setStorageItem( + storageKey, + JSON.stringify(walletSig) + ); + if (storeNewWalletSigOrError.type === 'ERROR') { + log('getWalletSig - flow 1.4'); + console.warn( + `Unable to store walletSig in local storage. Not a problem. Continue...` + ); + } + } else { + log('getWalletSig - flow 2'); + try { + walletSig = JSON.parse(storedWalletSigOrError.result); + log('getWalletSig - flow 2.1'); + } catch (e2) { + console.warn('Error parsing walletSig', e2); + log('getWalletSig - flow 2.2'); + } + } + log('getWalletSig - flow 3'); + return walletSig; + }; + _authCallbackAndUpdateStorageItem = async ({ + authCallbackParams, + authCallback, + }) => { + let authSig; + if (authCallback) { + authSig = await authCallback(authCallbackParams); + } else { + if (!this.defaultAuthCallback) { + throw new ParamsMissingError( + {}, + 'No authCallback nor default auth callback provided' + ); + } + authSig = await this.defaultAuthCallback(authCallbackParams); + } + const storeNewWalletSigOrError = setStorageItem( + LOCAL_STORAGE_KEYS.WALLET_SIGNATURE, + JSON.stringify(authSig) + ); + if (storeNewWalletSigOrError.type === EITHER_TYPE.SUCCESS) { + return authSig; + } + console.warn( + `Unable to store walletSig in local storage. Not a problem. Continuing to remove item key...` + ); + const removeWalletSigOrError = removeStorageItem( + LOCAL_STORAGE_KEYS.WALLET_SIGNATURE + ); + if (removeWalletSigOrError.type === EITHER_TYPE.ERROR) { + console.warn( + `Unable to remove walletSig in local storage. Not a problem. Continuing...` + ); + } + return authSig; + }; + /** + * + * Check if a session key needs to be resigned. These are the scenarios where a session key needs to be resigned: + * 1. The authSig.sig does not verify successfully against the authSig.signedMessage + * 2. The authSig.signedMessage.uri does not match the sessionKeyUri + * 3. The authSig.signedMessage does not contain at least one session capability object + * + */ + checkNeedToResignSessionKey = async ({ + authSig, + sessionKeyUri, + resourceAbilityRequests, + }) => { + const authSigSiweMessage = new SiweMessage4(authSig.signedMessage); + if (authSig.algo === `ed25519` || authSig.algo === void 0) { + try { + await authSigSiweMessage.verify( + { signature: authSig.sig }, + { suppressExceptions: false } + ); + } catch (e2) { + log(`Error while verifying BLS signature: `, e2); + return true; + } + } else if (authSig.algo === `LIT_BLS`) { + try { + await blsSessionSigVerify( + verifySignature, + this.networkPubKey, + authSig, + authSigSiweMessage + ); + } catch (e2) { + log(`Error while verifying bls signature: `, e2); + return true; + } + } else { + throw new InvalidSignatureError( + { + info: { + authSig, + resourceAbilityRequests, + sessionKeyUri, + }, + }, + 'Unsupported signature algo for session signature. Expected ed25519 or LIT_BLS received %s', + authSig.algo + ); + } + if (authSigSiweMessage.uri !== sessionKeyUri) { + log('Need retry because uri does not match'); + return true; + } + if ( + !authSigSiweMessage.resources || + authSigSiweMessage.resources.length === 0 + ) { + log('Need retry because empty resources'); + return true; + } + const authSigSessionCapabilityObject = decode3( + authSigSiweMessage.resources[0] + ); + for (const resourceAbilityRequest of resourceAbilityRequests) { + if ( + !authSigSessionCapabilityObject.verifyCapabilitiesForResource( + resourceAbilityRequest.resource, + resourceAbilityRequest.ability + ) + ) { + log('Need retry because capabilities do not match', { + authSigSessionCapabilityObject, + resourceAbilityRequest, + }); + return true; + } + } + return false; + }; + // ==================== API Calls to Nodes ==================== + /** + * @deprecated - Delete me for Naga + * Combine Shares from network public key set and signature shares + * + * @param { NodeBlsSigningShare } signatureShares + * + * @returns { string } final JWT (convert the sig to base64 and append to the jwt) + * + */ + combineSharesAndGetJWT = async (signatureShares, requestId = '') => { + if ( + !signatureShares.every( + (val, i2, arr) => val.unsignedJwt === arr[0].unsignedJwt + ) + ) { + const msg = + 'Unsigned JWT is not the same from all the nodes. This means the combined signature will be bad because the nodes signed the wrong things'; + logErrorWithRequestId(requestId, msg); + } + const signature2 = await combineSignatureShares( + signatureShares.map((s2) => s2.signatureShare) + ); + logWithRequestId(requestId, 'signature is', signature2); + const unsignedJwt = mostCommonString( + signatureShares.map((s2) => s2.unsignedJwt) + ); + const finalJwt = `${unsignedJwt}.${uint8arrayToString( + uint8arrayFromString(signature2, 'base16'), + 'base64urlpad' + )}`; + return finalJwt; + }; + _decryptWithSignatureShares = ( + networkPubKey, + identityParam, + ciphertext, + signatureShares + ) => { + const sigShares = signatureShares.map((s2) => s2.signatureShare); + return verifyAndDecryptWithSignatureShares( + networkPubKey, + identityParam, + ciphertext, + sigShares + ); + }; + // ========== Promise Handlers ========== + getIpfsId = async ({ dataToHash, sessionSigs }) => { + const res = await this.executeJs({ + ipfsId: LIT_ACTION_IPFS_HASH, + sessionSigs, + jsParams: { + dataToHash, + }, + }).catch((e2) => { + logError('Error getting IPFS ID', e2); + throw e2; + }); + let data; + if (typeof res.response === 'string') { + try { + data = JSON.parse(res.response).res; + } catch (e2) { + data = res.response; + } + } + if (!data.success) { + logError('Error getting IPFS ID', data.data); + } + return data.data; + }; + /** + * Run lit action on a single deterministicly selected node. It's important that the nodes use the same deterministic selection algorithm. + * + * Lit Action: dataToHash -> IPFS CID + * QmUjX8MW6StQ7NKNdaS6g4RMkvN5hcgtKmEi8Mca6oX4t3 + * + * @param { ExecuteJsProps } params + * + * @returns { Promise | RejectedNodePromises> } + * + */ + runOnTargetedNodes = async (params) => { + log('running runOnTargetedNodes:', params.targetNodeRange); + if (!params.targetNodeRange) { + throw new InvalidParamType( + { + info: { + params, + }, + }, + 'targetNodeRange is required' + ); + } + const ipfsId = await this.getIpfsId({ + dataToHash: params.code, + sessionSigs: params.sessionSigs, + }); + const randomSelectedNodeIndexes = []; + let nodeCounter = 0; + while (randomSelectedNodeIndexes.length < params.targetNodeRange) { + const str = `${nodeCounter}:${ipfsId.toString()}`; + const cidBuffer = Buffer.from(str); + const hash3 = (0, import_utils12.sha256)(cidBuffer); + const hashAsNumber = BigNumber.from(hash3); + const nodeIndex = hashAsNumber + .mod(this.config.bootstrapUrls.length) + .toNumber(); + log('nodeIndex:', nodeIndex); + if ( + !randomSelectedNodeIndexes.includes(nodeIndex) && + nodeIndex < this.config.bootstrapUrls.length + ) { + randomSelectedNodeIndexes.push(nodeIndex); + } + nodeCounter++; + } + log('Final Selected Indexes:', randomSelectedNodeIndexes); + const requestId = this._getNewRequestId(); + const nodePromises = []; + for (let i2 = 0; i2 < randomSelectedNodeIndexes.length; i2++) { + const nodeIndex = randomSelectedNodeIndexes[i2]; + const url = this.config.bootstrapUrls[nodeIndex]; + log(`running on node ${nodeIndex} at ${url}`); + const sessionSig = this.getSessionSigByUrl({ + sessionSigs: params.sessionSigs, + url, + }); + const reqBody = { + ...params, + targetNodeRange: params.targetNodeRange, + authSig: sessionSig, + }; + const singleNodePromise = this.sendCommandToNode({ + url, + data: params, + requestId, + }); + nodePromises.push(singleNodePromise); + } + return await this.handleNodePromises( + nodePromises, + requestId, + params.targetNodeRange + ); + }; + // ========== Scoped Business Logics ========== + /** + * Retrieves the fallback IPFS code for a given IPFS ID. + * + * @param gatewayUrl - the gateway url. + * @param ipfsId - The IPFS ID. + * @returns The base64-encoded fallback IPFS code. + * @throws An error if the code retrieval fails. + */ + async _getFallbackIpfsCode(gatewayUrl, ipfsId) { + const allGateways = gatewayUrl + ? [gatewayUrl, ...FALLBACK_IPFS_GATEWAYS] + : FALLBACK_IPFS_GATEWAYS; + log( + `Attempting to fetch code for IPFS ID: ${ipfsId} using fallback IPFS gateways` + ); + for (const url of allGateways) { + try { + const response = await fetch(`${url}${ipfsId}`); + if (!response.ok) { + throw new Error( + `Failed to fetch code from IPFS gateway ${url}: ${response.status} ${response.statusText}` + ); + } + const code9 = await response.text(); + const codeBase64 = Buffer.from(code9).toString('base64'); + return codeBase64; + } catch (error) { + console.error(`Error fetching code from IPFS gateway ${url}`); + } + } + throw new Error('All IPFS gateways failed to fetch the code.'); + } + async executeJsNodeRequest(url, formattedParams, requestId) { + const sessionSig = this.getSessionSigByUrl({ + sessionSigs: formattedParams.sessionSigs, + url, + }); + const nodeSet = await this._getNodeSet(); + const reqBody = { + ...formattedParams, + authSig: sessionSig, + nodeSet, + }; + const urlWithPath = composeLitUrl({ + url, + endpoint: LIT_ENDPOINT.EXECUTE_JS, + }); + return this.generatePromise(urlWithPath, reqBody, requestId); + } + /** + * + * Execute JS on the nodes and combine and return any resulting signatures + * + * @param { JsonExecutionSdkParams } params + * + * @returns { ExecuteJsResponse } + * + */ + executeJs = async (params) => { + if (!this.ready) { + const message = + '[executeJs] LitNodeClient is not ready. Please call await litNodeClient.connect() first.'; + throw new LitNodeClientNotReadyError({}, message); + } + const paramsIsSafe = safeParams({ + functionName: 'executeJs', + params, + }); + if (!paramsIsSafe) { + throw new InvalidParamType( + { + info: { + params, + }, + }, + 'executeJs params are not valid' + ); + } + const checkedSessionSigs = validateSessionSigs(params.sessionSigs); + if (checkedSessionSigs.isValid === false) { + throw new InvalidSessionSigs( + {}, + `Invalid sessionSigs. Errors: ${checkedSessionSigs.errors}` + ); + } + let formattedParams = { + ...params, + ...(params.jsParams && { jsParams: normalizeJsParams(params.jsParams) }), + ...(params.code && { code: encodeCode(params.code) }), + }; + const overwriteCode = + params.ipfsOptions?.overwriteCode || + GLOBAL_OVERWRITE_IPFS_CODE_BY_NETWORK[this.config.litNetwork]; + if (overwriteCode && params.ipfsId) { + const code9 = await this._getFallbackIpfsCode( + params.ipfsOptions?.gatewayUrl, + params.ipfsId + ); + formattedParams = { + ...params, + code: code9, + ipfsId: void 0, + }; + } + const requestId = this._getNewRequestId(); + const getNodePromises = async () => { + if (params.useSingleNode) { + return this.getRandomNodePromise((url) => + this.executeJsNodeRequest(url, formattedParams, requestId) + ); + } + return this.getNodePromises((url) => + this.executeJsNodeRequest(url, formattedParams, requestId) + ); + }; + const nodePromises = await getNodePromises(); + const res = await this.handleNodePromises( + nodePromises, + requestId, + params.useSingleNode ? 1 : this.connectedNodes.size + ); + if (!res.success) { + this._throwNodeError(res, requestId); + } + const responseData = res.values; + logWithRequestId( + requestId, + 'executeJs responseData from node : ', + JSON.stringify(responseData, null, 2) + ); + const mostCommonResponse = findMostCommonResponse(responseData); + const responseFromStrategy = processLitActionResponseStrategy( + responseData, + params.responseStrategy ?? { strategy: 'leastCommon' } + ); + mostCommonResponse.response = responseFromStrategy; + const isSuccess = mostCommonResponse.success; + const hasSignedData = Object.keys(mostCommonResponse.signedData).length > 0; + const hasClaimData = Object.keys(mostCommonResponse.claimData).length > 0; + if (isSuccess && !hasSignedData && !hasClaimData) { + return mostCommonResponse; + } + if (!hasSignedData && !hasClaimData) { + return { + claims: {}, + signatures: null, + decryptions: [], + response: mostCommonResponse.response, + logs: mostCommonResponse.logs, + }; + } + const signedDataList = responseData.map((r3) => { + return removeDoubleQuotes(r3.signedData); + }); + logWithRequestId( + requestId, + 'signatures shares to combine: ', + signedDataList + ); + const key2 = Object.keys(signedDataList[0])[0]; + const flattenedSignedMessageShares = signedDataList.map((item) => { + return item[key2]; + }); + const signatures = await getSignatures({ + requestId, + networkPubKeySet: this.networkPubKeySet, + threshold: params.useSingleNode ? 1 : this._getThreshold(), + signedMessageShares: flattenedSignedMessageShares, + }); + const parsedResponse = parseAsJsonOrString(mostCommonResponse.response); + const mostCommonLogs = mostCommonString(responseData.map((r3) => r3.logs)); + const claimsList = getClaimsList(responseData); + const claims = claimsList.length > 0 ? getClaims(claimsList) : void 0; + const returnVal = { + claims, + signatures: { + [key2]: signatures, + }, + // decryptions: [], + response: parsedResponse, + logs: mostCommonLogs, + }; + log('returnVal:', returnVal); + return returnVal; + }; + /** + * Generates a promise by sending a command to the Lit node + * + * @param url - The URL to send the command to. + * @param params - The parameters to include in the command. + * @param requestId - The ID of the request. + * @returns A promise that resolves with the response from the server. + */ + generatePromise = async (url, params, requestId) => { + return await this.sendCommandToNode({ + url, + data: params, + requestId, + }); + }; + /** + * Use PKP to sign + * + * @param { JsonPkpSignSdkParams } params + * @param params.toSign - The data to sign + * @param params.pubKey - The public key to sign with + * @param params.sessionSigs - The session signatures to use + * @param params.authMethods - (optional) The auth methods to use + */ + pkpSign = async (params) => { + const requiredParamKeys = ['toSign', 'pubKey']; + requiredParamKeys.forEach((key2) => { + if (!params[key2]) { + throw new ParamNullError( + { + info: { + params, + key: key2, + }, + }, + `"%s" cannot be undefined, empty, or null. Please provide a valid value.`, + key2 + ); + } + }); + if ( + !params.sessionSigs && + (!params.authMethods || params.authMethods.length <= 0) + ) { + throw new ParamNullError( + { + info: { + params, + }, + }, + 'Either sessionSigs or authMethods (length > 0) must be present.' + ); + } + const requestId = this._getNewRequestId(); + const checkedSessionSigs = validateSessionSigs(params.sessionSigs); + if (checkedSessionSigs.isValid === false) { + throw new InvalidSessionSigs( + {}, + `Invalid sessionSigs. Errors: ${checkedSessionSigs.errors}` + ); + } + const nodeSet = await this._getNodeSet(); + const nodePromises = this.getNodePromises((url) => { + const sessionSig = this.getSessionSigByUrl({ + sessionSigs: params.sessionSigs, + url, + }); + const reqBody = { + toSign: normalizeArray(params.toSign), + pubkey: hexPrefixed(params.pubKey), + authSig: sessionSig, + // -- optional params + ...(params.authMethods && + params.authMethods.length > 0 && { + authMethods: params.authMethods, + }), + // nodeSet: thresholdNodeSet, + nodeSet, + signingScheme: 'EcdsaK256Sha256', + }; + logWithRequestId(requestId, 'reqBody:', reqBody); + const urlWithPath = composeLitUrl({ + url, + endpoint: LIT_ENDPOINT.PKP_SIGN, + }); + return this.generatePromise(urlWithPath, reqBody, requestId); + }); + const res = await this.handleNodePromises( + nodePromises, + requestId, + // thresholdNodeSet.length + nodeSet.length + ); + if (!res.success) { + this._throwNodeError(res, requestId); + } + const responseData = res.values; + logWithRequestId( + requestId, + 'pkpSign responseData', + JSON.stringify(responseData) + ); + const signedMessageShares = parsePkpSignResponse(responseData); + try { + const signatures = await getSignatures({ + requestId, + networkPubKeySet: this.networkPubKeySet, + threshold: this._getThreshold(), + signedMessageShares, + }); + logWithRequestId(requestId, `signature combination`, signatures); + return signatures; + } catch (e2) { + console.error('Error getting signature', e2); + throw e2; + } + }; + /** + * + * Encrypt data using the LIT network public key. + * + * @param { EncryptSdkParams } params + * @param params.dataToEncrypt - The data to encrypt + * @param params.accessControlConditions - (optional) The access control conditions for the data + * @param params.evmContractConditions - (optional) The EVM contract conditions for the data + * @param params.solRpcConditions - (optional) The Solidity RPC conditions for the data + * @param params.unifiedAccessControlConditions - (optional) The unified access control conditions for the data + * + * @return { Promise } The encrypted ciphertext and the hash of the data + * + * @throws { Error } if the LIT node client is not ready + * @throws { Error } if the subnetPubKey is null + */ + encrypt = async (params) => { + if (!this.ready) { + throw new LitNodeClientNotReadyError( + {}, + '6 LitNodeClient is not ready. Please call await litNodeClient.connect() first.' + ); + } + if (!this.subnetPubKey) { + throw new LitNodeClientNotReadyError({}, 'subnetPubKey cannot be null'); + } + const paramsIsSafe = safeParams({ + functionName: 'encrypt', + params, + }); + if (!paramsIsSafe) { + throw new InvalidArgumentException( + { + info: { + params, + }, + }, + 'You must provide either accessControlConditions or evmContractConditions or solRpcConditions or unifiedAccessControlConditions' + ); + } + await this.validateAccessControlConditionsSchema(params); + const hashOfConditions = await this.getHashedAccessControlConditions( + params + ); + if (!hashOfConditions) { + throw new InvalidArgumentException( + { + info: { + params, + }, + }, + 'You must provide either accessControlConditions or evmContractConditions or solRpcConditions or unifiedAccessControlConditions' + ); + } + const hashOfConditionsStr = uint8arrayToString( + new Uint8Array(hashOfConditions), + 'base16' + ); + const hashOfPrivateData = await crypto.subtle.digest( + 'SHA-256', + params.dataToEncrypt + ); + const hashOfPrivateDataStr = uint8arrayToString( + new Uint8Array(hashOfPrivateData), + 'base16' + ); + const identityParam = this._getIdentityParamForEncryption( + hashOfConditionsStr, + hashOfPrivateDataStr + ); + const ciphertext = await encrypt2( + this.subnetPubKey, + params.dataToEncrypt, + uint8arrayFromString(identityParam, 'utf8') + ); + return { ciphertext, dataToEncryptHash: hashOfPrivateDataStr }; + }; + /** + * + * Decrypt ciphertext with the LIT network. + * + */ + decrypt = async (params) => { + const { sessionSigs, authSig, chain, ciphertext, dataToEncryptHash } = + params; + if (!this.ready) { + throw new LitNodeClientNotReadyError( + {}, + '6 LitNodeClient is not ready. Please call await litNodeClient.connect() first.' + ); + } + if (!this.subnetPubKey) { + throw new LitNodeClientNotReadyError({}, 'subnetPubKey cannot be null'); + } + const paramsIsSafe = safeParams({ + functionName: 'decrypt', + params, + }); + if (!paramsIsSafe) { + throw new InvalidArgumentException( + { + info: { + params, + }, + }, + 'Parameter validation failed.' + ); + } + const hashOfConditions = await this.getHashedAccessControlConditions( + params + ); + if (!hashOfConditions) { + throw new InvalidArgumentException( + { + info: { + params, + }, + }, + 'You must provide either accessControlConditions or evmContractConditions or solRpcConditions or unifiedAccessControlConditions' + ); + } + const hashOfConditionsStr = uint8arrayToString( + new Uint8Array(hashOfConditions), + 'base16' + ); + const { + error, + formattedAccessControlConditions, + formattedEVMContractConditions, + formattedSolRpcConditions, + formattedUnifiedAccessControlConditions, + } = this.getFormattedAccessControlConditions(params); + if (error) { + throw new InvalidArgumentException( + { + info: { + params, + }, + }, + 'You must provide either accessControlConditions or evmContractConditions or solRpcConditions or unifiedAccessControlConditions' + ); + } + const identityParam = this._getIdentityParamForEncryption( + hashOfConditionsStr, + dataToEncryptHash + ); + log('identityParam', identityParam); + const requestId = this._getNewRequestId(); + const nodePromises = this.getNodePromises((url) => { + const authSigToSend = sessionSigs ? sessionSigs[url] : authSig; + if (!authSigToSend) { + throw new InvalidArgumentException( + { + info: { + params, + }, + }, + 'authSig is required' + ); + } + const reqBody = { + accessControlConditions: formattedAccessControlConditions, + evmContractConditions: formattedEVMContractConditions, + solRpcConditions: formattedSolRpcConditions, + unifiedAccessControlConditions: formattedUnifiedAccessControlConditions, + dataToEncryptHash, + chain, + authSig: authSigToSend, + epoch: this.currentEpochNumber, + }; + const urlWithParh = composeLitUrl({ + url, + endpoint: LIT_ENDPOINT.ENCRYPTION_SIGN, + }); + return this.generatePromise(urlWithParh, reqBody, requestId); + }); + const res = await this.handleNodePromises( + nodePromises, + requestId, + this._getThreshold() + ); + if (!res.success) { + this._throwNodeError(res, requestId); + } + const signatureShares = res.values; + logWithRequestId(requestId, 'signatureShares', signatureShares); + const decryptedData = await this._decryptWithSignatureShares( + this.subnetPubKey, + uint8arrayFromString(identityParam, 'utf8'), + ciphertext, + signatureShares + ); + return { decryptedData }; + }; + getLitResourceForEncryption = async (params) => { + const hashOfConditions = await this.getHashedAccessControlConditions( + params + ); + if (!hashOfConditions) { + throw new InvalidArgumentException( + { + info: { + params, + }, + }, + 'You must provide either accessControlConditions or evmContractConditions or solRpcConditions or unifiedAccessControlConditions' + ); + } + const hashOfConditionsStr = uint8arrayToString( + new Uint8Array(hashOfConditions), + 'base16' + ); + const hashOfPrivateData = await crypto.subtle.digest( + 'SHA-256', + params.dataToEncrypt + ); + const hashOfPrivateDataStr = uint8arrayToString( + new Uint8Array(hashOfPrivateData), + 'base16' + ); + return new LitAccessControlConditionResource( + `${hashOfConditionsStr}/${hashOfPrivateDataStr}` + ); + }; + _getIdentityParamForEncryption = ( + hashOfConditionsStr, + hashOfPrivateDataStr + ) => { + return new LitAccessControlConditionResource( + `${hashOfConditionsStr}/${hashOfPrivateDataStr}` + ).getResourceKey(); + }; + /** ============================== SESSION ============================== */ + /** + * Sign a session public key using a PKP, which generates an authSig. + * @returns {Object} An object containing the resulting signature. + */ + signSessionKey = async (params) => { + log(`[signSessionKey] params:`, params); + if (!this.ready) { + throw new LitNodeClientNotReadyError( + {}, + '[signSessionKey] ]LitNodeClient is not ready. Please call await litNodeClient.connect() first.' + ); + } + const _expiration = + params.expiration || + new Date(Date.now() + 24 * 60 * 60 * 1e3).toISOString(); + const sessionKey = params.sessionKey ?? this.getSessionKey(); + const sessionKeyUri = LIT_SESSION_KEY_URI + sessionKey.publicKey; + log( + `[signSessionKey] sessionKeyUri is not found in params, generating a new one`, + sessionKeyUri + ); + if (!sessionKeyUri) { + throw new InvalidParamType( + { + info: { + params, + }, + }, + '[signSessionKey] sessionKeyUri is not defined. Please provide a sessionKeyUri or a sessionKey.' + ); + } + const pkpEthAddress = (function () { + params.pkpPublicKey = hexPrefixed(params.pkpPublicKey); + if (params.pkpPublicKey) return computeAddress(params.pkpPublicKey); + return '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'; + })(); + let siwe_statement = 'Lit Protocol PKP session signature'; + if (params.statement) { + siwe_statement += ' ' + params.statement; + log(`[signSessionKey] statement found in params: "${params.statement}"`); + } + let siweMessage; + const siweParams = { + domain: params?.domain || globalThis.location?.host || 'litprotocol.com', + walletAddress: pkpEthAddress, + statement: siwe_statement, + uri: sessionKeyUri, + version: '1', + chainId: params.chainId ?? 1, + expiration: _expiration, + nonce: await this.getLatestBlockhash(), + }; + if (params.resourceAbilityRequests) { + siweMessage = await createSiweMessageWithRecaps({ + ...siweParams, + resources: params.resourceAbilityRequests, + litNodeClient: this, + }); + } else { + siweMessage = await createSiweMessage(siweParams); + } + const nodeSet = await this._getNodeSet(); + const body = { + nodeSet, + sessionKey: sessionKeyUri, + authMethods: params.authMethods, + ...(params?.pkpPublicKey && { pkpPublicKey: params.pkpPublicKey }), + siweMessage, + curveType: LIT_CURVE.BLS, + // -- custom auths + ...(params?.litActionIpfsId && { + litActionIpfsId: params.litActionIpfsId, + }), + ...(params?.litActionCode && { code: params.litActionCode }), + ...(params?.jsParams && { jsParams: params.jsParams }), + ...(this.currentEpochNumber && { epoch: this.currentEpochNumber }), + signingScheme: LIT_CURVE.BLS, + }; + log(`[signSessionKey] body:`, body); + const requestId = this._getNewRequestId(); + logWithRequestId(requestId, 'signSessionKey body', body); + const nodePromises = this.getNodePromises((url) => { + const reqBody = body; + const urlWithPath = composeLitUrl({ + url, + endpoint: LIT_ENDPOINT.SIGN_SESSION_KEY, + }); + return this.generatePromise(urlWithPath, reqBody, requestId); + }); + let res; + try { + res = await this.handleNodePromises( + nodePromises, + requestId, + this._getThreshold() + ); + log('signSessionKey node promises:', res); + } catch (e2) { + throw new UnknownError( + { + info: { + requestId, + }, + cause: e2, + }, + 'Error when handling node promises' + ); + } + logWithRequestId(requestId, 'handleNodePromises res:', res); + if (!this._isSuccessNodePromises(res)) { + this._throwNodeError(res, requestId); + return {}; + } + const responseData = res.values; + logWithRequestId( + requestId, + '[signSessionKey] responseData', + JSON.stringify(responseData, null, 2) + ); + const curveType = responseData[0]?.curveType; + if (curveType === 'ECDSA') { + throw new Error( + 'The ECDSA curve type is not supported in this version. Please use version 6.x.x instead.' + ); + } + log(`[signSessionKey] curveType is "${curveType}"`); + const signedDataList = responseData.map((s2) => s2.dataSigned); + if (signedDataList.length <= 0) { + const err = `[signSessionKey] signedDataList is empty.`; + log(err); + throw new InvalidSignatureError( + { + info: { + requestId, + responseData, + signedDataList, + }, + }, + err + ); + } + logWithRequestId( + requestId, + '[signSessionKey] signedDataList', + signedDataList + ); + const validatedSignedDataList = this._validateSignSessionKeyResponseData( + responseData, + requestId, + this._getThreshold() + ); + const blsSignedData = validatedSignedDataList; + const sigType = mostCommonString(blsSignedData.map((s2) => s2.curveType)); + log(`[signSessionKey] sigType:`, sigType); + const signatureShares = getBlsSignatures(blsSignedData); + log(`[signSessionKey] signatureShares:`, signatureShares); + const blsCombinedSignature = await combineSignatureShares(signatureShares); + log(`[signSessionKey] blsCombinedSignature:`, blsCombinedSignature); + const publicKey = removeHexPrefix(params.pkpPublicKey); + log(`[signSessionKey] publicKey:`, publicKey); + const dataSigned = mostCommonString( + blsSignedData.map((s2) => s2.dataSigned) + ); + log(`[signSessionKey] dataSigned:`, dataSigned); + const mostCommonSiweMessage = mostCommonString( + blsSignedData.map((s2) => s2.siweMessage) + ); + log(`[signSessionKey] mostCommonSiweMessage:`, mostCommonSiweMessage); + const signedMessage = normalizeAndStringify(mostCommonSiweMessage); + log(`[signSessionKey] signedMessage:`, signedMessage); + const signSessionKeyRes = { + authSig: { + sig: JSON.stringify({ + ProofOfPossession: blsCombinedSignature, + }), + algo: 'LIT_BLS', + derivedVia: 'lit.bls', + signedMessage, + address: computeAddress(hexPrefixed(publicKey)), + }, + pkpPublicKey: publicKey, + }; + return signSessionKeyRes; + }; + _isSuccessNodePromises = (res) => { + return res.success; + }; + getSignSessionKeyShares = async (url, params, requestId) => { + log('getSignSessionKeyShares'); + const urlWithPath = composeLitUrl({ + url, + endpoint: LIT_ENDPOINT.SIGN_SESSION_KEY, + }); + return await this.sendCommandToNode({ + url: urlWithPath, + data: params.body, + requestId, + }); + }; + /** + * + * Retrieves or generates sessionSigs (think access token) for accessing Lit Network resources. + * + * How this function works on a high level: + * 1. Generate or retrieve [session keys](https://v6-api-doc-lit-js-sdk.vercel.app/interfaces/types_src.SessionKeyPair.html) (a public and private key pair) + * 2. Generate or retrieve the [`AuthSig`](https://v6-api-doc-lit-js-sdk.vercel.app/interfaces/types_src.AuthSig.html) that specifies the session [abilities](https://v6-api-doc-lit-js-sdk.vercel.app/enums/auth_helpers_src.LitAbility.html) + * 3. Sign the specific resources with the session key + * + * The process follows these steps: + * 1. Retrieves or generates a session key pair (Ed25519) for the user's device. The session key is either fetched from local storage or newly created if not found. The key does not expire. + * 2. Generates an authentication signature (`authSig`) by signing an ERC-5573 "Sign-in with Ethereum" message, which includes resource ability requests, capabilities, expiration, the user's device session public key, and a nonce. The `authSig` is retrieved from local storage, and if it has expired, the user will be prompted to re-sign. + * 3. Uses the session private key to sign the session public key along with the resource ability requests, capabilities, issuedAt, and expiration details. This creates a device-generated signature. + * 4. Constructs the session signatures (`sessionSigs`) by including the device-generated signature and the original message. The `sessionSigs` provide access to Lit Network features such as `executeJs` and `pkpSign`. + * + * See Sequence Diagram: https://www.plantuml.com/plantuml/uml/VPH1RnCn48Nl_XLFlT1Av00eGkm15QKLWY8K9K9SO-rEar4sjcLFalBl6NjJAuaMRl5utfjlPjQvJsAZx7UziQtuY5-9eWaQufQ3TOAR77cJy407Rka6zlNdHTRouUbIzSEtjiTIBUswg5v_NwMnuAVlA9KKFPN3I0x9qSSj7bqNF3iPykl9c4o9oUSJMuElv2XQ8IHAYRt3bluWM8wuVUpUJwVlFjsP8JUh5B_1DyV2AYdD6DjhLsTQTaYd3W3ad28SGWqM997fG5ZrB9DJqOaALuRwH1TMpik8tIYze-E8OrPKU5I6cMqtem2kCqOhr4vdaRAvtSjcoMkTo68scKu_Vi1EPMfrP_xVtj7sFMaHNg-6GVqk0MW0z18uKdVULTvDWtdqko28b7KktvUB2hKOBd1asU2QgDfTzrj7T4bLPdv6TR0zLwPQKkkZpIRTY4CTMbrBpg_VKuXyi49beUAHqIlirOUrL2zq9JPPdpRR5OMLVQGoGlLcjyRyQNv6MHz4W_fG42W--xWhUfNyOxiLL1USS6lRLeyAkYLNjrkVJuClm_qp5I8Lq0krUw7lwIt2DgY9oiozrjA_Yhy0 + * + * Note: When generating session signatures for different PKPs or auth methods, + * be sure to call disconnectWeb3 to clear auth signatures stored in local storage + * + * @param { GetSessionSigsProps } params + * + * An example of how this function is used can be found in the Lit developer-guides-code repository [here](https://github.com/LIT-Protocol/developer-guides-code/tree/master/session-signatures/getSessionSigs). + * + */ + getSessionSigs = async (params) => { + const sessionKey = params.sessionKey ?? this.getSessionKey(); + const sessionKeyUri = this.getSessionKeyUri(sessionKey.publicKey); + const sessionCapabilityObject = params.sessionCapabilityObject + ? params.sessionCapabilityObject + : await this.generateSessionCapabilityObjectWithWildcards( + params.resourceAbilityRequests.map((r3) => r3.resource) + ); + const expiration = + params.expiration || _LitNodeClientNodeJs.getExpiration(); + let authSig = await this.getWalletSig({ + authNeededCallback: params.authNeededCallback, + chain: params.chain || 'ethereum', + sessionCapabilityObject, + switchChain: params.switchChain, + expiration, + sessionKey, + sessionKeyUri, + nonce: await this.getLatestBlockhash(), + // -- for recap + resourceAbilityRequests: params.resourceAbilityRequests, + // -- optional fields + ...(params.litActionCode && { litActionCode: params.litActionCode }), + ...(params.litActionIpfsId && { + litActionIpfsId: params.litActionIpfsId, + }), + ...(params.jsParams && { jsParams: params.jsParams }), + }); + const needToResignSessionKey = await this.checkNeedToResignSessionKey({ + authSig, + sessionKeyUri, + resourceAbilityRequests: params.resourceAbilityRequests, + }); + if (needToResignSessionKey) { + log('need to re-sign session key. Signing...'); + authSig = await this._authCallbackAndUpdateStorageItem({ + authCallback: params.authNeededCallback, + authCallbackParams: { + chain: params.chain || 'ethereum', + statement: sessionCapabilityObject.statement, + resources: [sessionCapabilityObject.encodeAsSiweResource()], + switchChain: params.switchChain, + expiration, + sessionKey, + uri: sessionKeyUri, + nonce: await this.getLatestBlockhash(), + resourceAbilityRequests: params.resourceAbilityRequests, + // -- optional fields + ...(params.litActionCode && { litActionCode: params.litActionCode }), + ...(params.litActionIpfsId && { + litActionIpfsId: params.litActionIpfsId, + }), + ...(params.jsParams && { jsParams: params.jsParams }), + }, + }); + } + if ( + authSig.address === '' || + authSig.derivedVia === '' || + authSig.sig === '' || + authSig.signedMessage === '' + ) { + throw new WalletSignatureNotFoundError( + { + info: { + authSig, + }, + }, + 'No wallet signature found' + ); + } + const sessionExpiration = + expiration ?? new Date(Date.now() + 1e3 * 60 * 5).toISOString(); + const capabilities = params.capacityDelegationAuthSig + ? [ + ...(params.capabilityAuthSigs ?? []), + params.capacityDelegationAuthSig, + authSig, + ] + : [...(params.capabilityAuthSigs ?? []), authSig]; + let priceByNetwork = this.config.priceByNetwork; + if (params.getNewPrices) { + log(`Getting new prices from the contract`); + const priceFeedInfo = await LitContracts.getPriceFeedInfo({ + realmId: REALM_ID2, + litNetwork: this.config.litNetwork, + networkContext: this.config.contractContext, + rpcUrl: this.config.rpcUrl, + }); + priceByNetwork = priceFeedInfo.networkPrices.mapByAddress; + } + const sessionSigningTemplate = { + sessionKey: sessionKey.publicKey, + resourceAbilityRequests: params.resourceAbilityRequests, + capabilities, + issuedAt: /* @__PURE__ */ new Date().toISOString(), + expiration: sessionExpiration, + // fetch it from the contract, i don't want to spend more than 10 cents on signing + // FIXME: This is a dummy value for now + // maxPrice: '0x1234567890abcdef1234567890abcdef12345678', + }; + const sessionSigs = {}; + this.connectedNodes.forEach((nodeAddress) => { + const maxPrice = priceByNetwork[nodeAddress]; + if (maxPrice <= 0) { + throw new Error(`Invalid maxPrice for node: ${nodeAddress}`); + } + const toSign = { + ...sessionSigningTemplate, + nodeAddress, + maxPrice: maxPrice.toString(), + }; + const signedMessage = JSON.stringify(toSign); + const uint8arrayKey = uint8arrayFromString( + sessionKey.secretKey, + 'base16' + ); + const uint8arrayMessage = uint8arrayFromString(signedMessage, 'utf8'); + const signature2 = nacl2.sign.detached(uint8arrayMessage, uint8arrayKey); + sessionSigs[nodeAddress] = { + sig: uint8arrayToString(signature2, 'base16'), + derivedVia: 'litSessionSignViaNacl', + signedMessage, + address: sessionKey.publicKey, + algo: 'ed25519', + }; + }); + log('sessionSigs:', sessionSigs); + try { + const formattedSessionSigs = formatSessionSigs( + JSON.stringify(sessionSigs) + ); + log(formattedSessionSigs); + } catch (e2) { + log('Error formatting session signatures: ', e2); + } + return sessionSigs; + }; + /** + * Retrieves the PKP sessionSigs. + * + * @param params - The parameters for retrieving the PKP sessionSigs. + * @returns A promise that resolves to the PKP sessionSigs. + * @throws An error if any of the required parameters are missing or if `litActionCode` and `ipfsId` exist at the same time. + */ + getPkpSessionSigs = async (params) => { + const chain = params?.chain || 'ethereum'; + const pkpSessionSigs = this.getSessionSigs({ + chain, + ...params, + authNeededCallback: async (props) => { + if (!props.expiration) { + throw new ParamsMissingError( + { + info: { + props, + }, + }, + '[getPkpSessionSigs/callback] expiration is required' + ); + } + if (!props.resources) { + throw new ParamsMissingError( + { + info: { + props, + }, + }, + '[getPkpSessionSigs/callback]resources is required' + ); + } + if (!props.resourceAbilityRequests) { + throw new ParamsMissingError( + { + info: { + props, + }, + }, + '[getPkpSessionSigs/callback]resourceAbilityRequests is required' + ); + } + if (props.litActionCode && props.litActionIpfsId) { + throw new UnsupportedMethodError( + { + info: { + props, + }, + }, + '[getPkpSessionSigs/callback]litActionCode and litActionIpfsId cannot exist at the same time' + ); + } + const overwriteCode = + params.ipfsOptions?.overwriteCode || + GLOBAL_OVERWRITE_IPFS_CODE_BY_NETWORK[this.config.litNetwork]; + if (overwriteCode && props.litActionIpfsId) { + const code9 = await this._getFallbackIpfsCode( + params.ipfsOptions?.gatewayUrl, + props.litActionIpfsId + ); + props = { + ...props, + litActionCode: code9, + litActionIpfsId: void 0, + }; + } + const authMethods = params.authMethods || []; + const response = await this.signSessionKey({ + sessionKey: props.sessionKey, + statement: props.statement || 'Some custom statement.', + authMethods: [...authMethods], + pkpPublicKey: params.pkpPublicKey, + expiration: props.expiration, + resources: props.resources, + chainId: 1, + // -- required fields + resourceAbilityRequests: props.resourceAbilityRequests, + // -- optional fields + ...(props.litActionCode && { litActionCode: props.litActionCode }), + ...(props.litActionIpfsId && { + litActionIpfsId: props.litActionIpfsId, + }), + ...(props.jsParams && { jsParams: props.jsParams }), + }); + return response.authSig; + }, + }); + return pkpSessionSigs; + }; + /** + * Retrieves session signatures specifically for Lit Actions. + * Unlike `getPkpSessionSigs`, this function requires either `litActionCode` or `litActionIpfsId`, and `jsParams` must be provided. + * + * @param params - The parameters required for retrieving the session signatures. + * @returns A promise that resolves with the session signatures. + */ + getLitActionSessionSigs = async (params) => { + if (!params.litActionCode && !params.litActionIpfsId) { + throw new InvalidParamType( + { + info: { + params, + }, + }, + 'Either "litActionCode" or "litActionIpfsId" must be provided.' + ); + } + if (!params.jsParams) { + throw new ParamsMissingError( + { + info: { + params, + }, + }, + "'jsParams' is required." + ); + } + return this.getPkpSessionSigs(params); + }; + /** + * + * Get Session Key URI eg. lit:session:0x1234 + * + * @param publicKey is the public key of the session key + * @returns { string } the session key uri + */ + getSessionKeyUri = (publicKey) => { + return LIT_SESSION_KEY_URI + publicKey; + }; + /** + * Authenticates an Auth Method for claiming a Programmable Key Pair (PKP). + * A {@link MintCallback} can be defined for custom on chain interactions + * by default the callback will forward to a relay server for minting on chain. + * @param {ClaimKeyRequest} params an Auth Method and {@link MintCallback} + * @returns {Promise} + */ + async claimKeyId(params) { + if (!this.ready) { + const message = + 'LitNodeClient is not ready. Please call await litNodeClient.connect() first.'; + throw new LitNodeClientNotReadyError({}, message); + } + if (params.authMethod.authMethodType == AUTH_METHOD_TYPE.WebAuthn) { + throw new LitNodeClientNotReadyError( + {}, + 'Unsupported auth method type. Webauthn, and Lit Actions are not supported for claiming' + ); + } + const requestId = this._getNewRequestId(); + const nodePromises = this.getNodePromises((url) => { + if (!params.authMethod) { + throw new ParamsMissingError( + { + info: { + params, + }, + }, + 'authMethod is required' + ); + } + const reqBody = { + authMethod: params.authMethod, + }; + const urlWithPath = composeLitUrl({ + url, + endpoint: LIT_ENDPOINT.PKP_CLAIM, + }); + return this.generatePromise(urlWithPath, reqBody, requestId); + }); + const responseData = await this.handleNodePromises( + nodePromises, + requestId, + this.connectedNodes.size + ); + if (responseData.success) { + const nodeSignatures = responseData.values.map((r3) => { + const sig = ethers_exports.utils.splitSignature(`0x${r3.signature}`); + return { + r: sig.r, + s: sig.s, + v: sig.v, + }; + }); + logWithRequestId( + requestId, + `responseData: ${JSON.stringify(responseData, null, 2)}` + ); + const derivedKeyId = responseData.values[0].derivedKeyId; + const pubkey = await this.computeHDPubKey(derivedKeyId); + logWithRequestId( + requestId, + `pubkey ${pubkey} derived from key id ${derivedKeyId}` + ); + const relayParams = params; + let mintTx = ''; + if (params.mintCallback && 'signer' in params) { + mintTx = await params.mintCallback( + { + derivedKeyId, + authMethodType: params.authMethod.authMethodType, + signatures: nodeSignatures, + pubkey, + signer: params.signer, + ...relayParams, + }, + this.config.litNetwork + ); + } else { + mintTx = await defaultMintClaimCallback( + { + derivedKeyId, + authMethodType: params.authMethod.authMethodType, + signatures: nodeSignatures, + pubkey, + ...relayParams, + }, + this.config.litNetwork + ); + } + return { + signatures: nodeSignatures, + claimedKeyId: derivedKeyId, + pubkey, + mintTx, + }; + } else { + throw new UnknownError( + { + info: { + requestId, + responseData, + }, + }, + `Claim request has failed. Request trace id: lit_%s`, + requestId + ); + } + } + /** + * Note: ✨ This is to check data integrity of the response from the signSessionKey endpoint. + * As sometimes the response data structure has changed and we need to update the required fields. + * Validates the response data from the signSessionKey endpoint. + * Each response data item must have all required fields and valid ProofOfPossession. + * + * @param responseData - Array of BlsResponseData to validate + * @param requestId - Request ID for logging and error reporting + * @param threshold - Minimum number of valid responses needed + * @returns Filtered array of valid BlsResponseData + * @throws InvalidSignatureError if validation fails + */ + _validateSignSessionKeyResponseData(responseData, requestId, threshold) { + const requiredFields = [ + 'signatureShare', + 'curveType', + 'siweMessage', + 'dataSigned', + 'blsRootPubkey', + 'result', + ]; + const validatedSignedDataList = responseData + .map((data) => { + for (const field of requiredFields) { + const key2 = field; + if ( + data[key2] === void 0 || + data[key2] === null || + data[key2] === '' + ) { + log( + `Invalid signed data. "${field}" is missing. Not a problem, we only need ${threshold} nodes to sign the session key.` + ); + return null; + } + } + if (!data.signatureShare.ProofOfPossession) { + const err = `Invalid signed data. "ProofOfPossession" is missing.`; + log(err); + throw new InvalidSignatureError( + { + info: { + requestId, + responseData, + data, + }, + }, + err + ); + } + return data; + }) + .filter((item) => item !== null); + logWithRequestId( + requestId, + 'validated length:', + validatedSignedDataList.length + ); + logWithRequestId(requestId, 'minimum threshold:', threshold); + if (validatedSignedDataList.length < threshold) { + throw new InvalidSignatureError( + { + info: { + requestId, + responseData, + validatedSignedDataList, + threshold, + }, + }, + `not enough nodes signed the session key. Expected ${threshold}, got ${validatedSignedDataList.length}` + ); + } + return validatedSignedDataList; + } +}; +var LitNodeClientNodeJs = _LitNodeClientNodeJs; +/** + * + * Get expiration for session default time is 1 day / 24 hours + * + */ +__publicField(LitNodeClientNodeJs, 'getExpiration', () => { + return new Date(Date.now() + 1e3 * 60 * 60 * 24).toISOString(); +}); + +// packages/lit-node-client/src/lib/lit-node-client.ts +var LitNodeClient = class extends LitNodeClientNodeJs { + constructor(args) { + super({ + ...args, + defaultAuthCallback: checkAndSignAuthMessage, + }); + this._overrideConfigsFromLocalStorage(); + } + /** + * + * (Browser Only) Get the config from browser local storage and override default config + * + * @returns { void } + * + */ + _overrideConfigsFromLocalStorage = () => { + if (isNode()) return; + const storageKey = 'LitNodeClientConfig'; + const storageConfigOrError = getStorageItem(storageKey); + if (storageConfigOrError.type === EITHER_TYPE.ERROR) { + log(`Storage key "${storageKey}" is missing. `); + return; + } + const storageConfig = JSON.parse(storageConfigOrError.result); + this.config = { ...this.config, ...storageConfig }; + }; +}; + +// local-tests/setup/tinny-person.ts +init_shim(); + +// packages/lit-auth-client/src/index.ts +init_shim(); + +// packages/lit-auth-client/src/lib/providers/AppleProvider.ts +init_shim(); + +// packages/lit-auth-client/src/lib/utils.ts +init_shim(); +import * as cbor from 'cbor-web'; + +// packages/lit-auth-client/src/lib/providers/DiscordProvider.ts +init_shim(); + +// packages/lit-auth-client/src/lib/providers/BaseProvider.ts +init_shim(); +import depd5 from 'depd'; + +// packages/lit-auth-client/src/lib/validators.ts +init_shim(); +var validateMintRequestBody = (customArgs) => { + let isValid = true; + const validKeys = [ + 'keyType', + 'permittedAuthMethodTypes', + 'permittedAuthMethodIds', + 'permittedAuthMethodPubkeys', + 'permittedAuthMethodScopes', + 'addPkpEthAddressAsPermittedAddress', + 'sendPkpToItself', + ]; + for (const key2 of Object.keys(customArgs)) { + if (!validKeys.includes(key2)) { + console.error( + `Invalid key found: ${key2}. This key is not allowed. Valid keys are: ${validKeys.join( + ', ' + )}` + ); + isValid = false; + } + } + if (customArgs.keyType !== void 0 && typeof customArgs.keyType !== 'number') { + console.error('Invalid type for keyType: expected a number.'); + isValid = false; + } + if ( + customArgs.permittedAuthMethodTypes !== void 0 && + (!Array.isArray(customArgs.permittedAuthMethodTypes) || + !customArgs.permittedAuthMethodTypes.every( + (type) => typeof type === 'number' + )) + ) { + console.error( + 'Invalid type for permittedAuthMethodTypes: expected an array of numbers.' + ); + isValid = false; + } + if ( + customArgs.permittedAuthMethodIds !== void 0 && + (!Array.isArray(customArgs.permittedAuthMethodIds) || + !customArgs.permittedAuthMethodIds.every( + (id2) => typeof id2 === 'string' + )) + ) { + console.error( + 'Invalid type for permittedAuthMethodIds: expected an array of strings.' + ); + isValid = false; + } + if ( + customArgs.permittedAuthMethodPubkeys !== void 0 && + (!Array.isArray(customArgs.permittedAuthMethodPubkeys) || + !customArgs.permittedAuthMethodPubkeys.every( + (pubkey) => typeof pubkey === 'string' + )) + ) { + console.error( + 'Invalid type for permittedAuthMethodPubkeys: expected an array of strings.' + ); + isValid = false; + } + if ( + customArgs.permittedAuthMethodScopes !== void 0 && + (!Array.isArray(customArgs.permittedAuthMethodScopes) || + !customArgs.permittedAuthMethodScopes.every( + (scope) => + Array.isArray(scope) && scope.every((s2) => typeof s2 === 'number') + )) + ) { + console.error( + 'Invalid type for permittedAuthMethodScopes: expected an array of arrays of numberr.' + ); + isValid = false; + } + if ( + customArgs.addPkpEthAddressAsPermittedAddress !== void 0 && + typeof customArgs.addPkpEthAddressAsPermittedAddress !== 'boolean' + ) { + console.error( + 'Invalid type for addPkpEthAddressAsPermittedAddress: expected a boolean.' + ); + isValid = false; + } + if ( + customArgs.sendPkpToItself !== void 0 && + typeof customArgs.sendPkpToItself !== 'boolean' + ) { + console.error('Invalid type for sendPkpToItself: expected a boolean.'); + isValid = false; + } + return isValid; +}; + +// packages/lit-auth-client/src/lib/providers/BaseProvider.ts +var deprecated5 = depd5('lit-js-sdk:auth-browser:base-provider'); +var BaseProvider2 = class { + /** + * Relay server to subsidize minting of PKPs + */ + relay; + /** + * Client to connect to Lit nodes + */ + litNodeClient; + constructor(options) { + this.relay = options.relay; + this.litNodeClient = options.litNodeClient; + } + /** + * Mint a new PKP for the given auth method through the relay server + * + * @param {AuthMethod} authMethod - Auth method object + * @param {MintRequestBody} [customArgs] - Extra data to overwrite default params + * + * @returns {Promise} - Mint transaction hash + */ + async mintPKPThroughRelayer(authMethod, customArgs) { + const data = await this.prepareRelayRequestData(authMethod); + if (customArgs && !validateMintRequestBody(customArgs)) { + throw new InvalidArgumentException( + { + info: { + customArgs, + }, + }, + 'Invalid mint request body' + ); + } + const body = this.prepareMintBody(data, customArgs ?? {}); + const mintRes = await this.relay.mintPKP(body); + if (!mintRes || !mintRes.requestId) { + throw new UnknownError( + { + info: { + mintRes, + }, + }, + 'Missing mint response or request ID from relay server' + ); + } + return mintRes.requestId; + } + /** + * @deprecated - Use {@link fetchPKPs} instead + * Fetch PKPs associated with given auth method from relay server + * + * @param {AuthMethod} authMethod - Auth method object + * + * @returns {Promise} - Array of PKPs + */ + async fetchPKPsThroughRelayer(authMethod) { + deprecated5( + 'fetchPKPsThroughRelayer is deprecated. Use fetchPKPs instead.' + ); + const data = await this.prepareRelayRequestData(authMethod); + const body = this.prepareFetchBody(data); + const fetchRes = await this.relay.fetchPKPs(body); + if (!fetchRes || !fetchRes.pkps) { + throw new ParamsMissingError( + { + info: { + fetchRes, + }, + }, + 'Missing PKPs in fetch response from relay server' + ); + } + return fetchRes.pkps; + } + /** + * Fetch PKPs associated with given auth method type and id from pkp contract + * + * @param {AUTH_METHOD_TYPE} authMethodType - Auth method type + * @param {string} authMethodId - Auth method id + * + * @returns {Promise} - Array of PKPs + */ + async getPKPsForAuthMethod({ authMethodType, authMethodId }) { + if (!authMethodType || !authMethodId) { + throw new InvalidArgumentException( + { + info: { + authMethodType, + authMethodId, + }, + }, + 'Auth method type and id are required to fetch PKPs by auth method' + ); + } + const litContracts = new LitContracts({ + randomPrivatekey: true, + network: this.litNodeClient.config.litNetwork, + }); + try { + await litContracts.connect(); + } catch (err) { + throw new UnknownError( + { + cause: err, + }, + 'Unable to connect to LitContracts' + ); + } + try { + const pkpPermissions = await litContracts.getLitContractWithContext( + this.litNodeClient.config.litNetwork, + 'PKPPermissions' + ); + const tokenIds = await pkpPermissions['getTokenIdsForAuthMethod']( + authMethodType, + authMethodId + ); + const pkps = []; + for (const tokenId of tokenIds) { + const pubkey = await pkpPermissions['getPubkey'](tokenId); + if (pubkey) { + const ethAddress = ethers_exports.utils.computeAddress(pubkey); + pkps.push({ + tokenId: tokenId.toString(), + publicKey: pubkey, + ethAddress, + }); + } + } + return pkps; + } catch (err) { + throw new UnknownError( + { + cause: err, + }, + 'Unable to get PKPs for auth method' + ); + } + } + /** + * Fetch PKPs associated with given auth method from pkp contract + * + * @param {AuthMethod} authMethod - Auth method object + * + * @returns {Promise} - Array of PKPs + */ + async fetchPKPs(authMethod) { + const authMethodId = await this.getAuthMethodId(authMethod); + const authMethodType = authMethod.authMethodType; + const pkps = await this.getPKPsForAuthMethod({ + authMethodType, + authMethodId, + }); + return pkps; + } + /** + * Generate session sigs for given auth method and PKP + * + * @param {BaseProviderSessionSigsParams} params + * @param {string} params.pkpPublicKey - Public key of PKP to auth with + * @param {AuthMethod} params.authMethod - Auth method verifying ownership of PKP + * @param {GetSessionSigsProps} params.sessionSigsParams - Params for getSessionSigs function + * @param {LitNodeClient} [params.litNodeClient] - Lit Node Client to use. If not provided, will use an existing Lit Node Client or create a new one + * + * @returns {Promise} - Session sigs + */ + async getSessionSigs(params) { + if (params.litNodeClient && params.litNodeClient instanceof LitNodeClient) { + this.litNodeClient = params.litNodeClient; + } + if (!this.litNodeClient.ready) { + await this.litNodeClient.connect(); + } + let authNeededCallback = params.sessionSigsParams.authNeededCallback; + const sessionKey = + params.sessionSigsParams.sessionKey || this.litNodeClient.getSessionKey(); + if (!authNeededCallback) { + const nodeClient = this.litNodeClient; + authNeededCallback = async (authCallbackParams) => { + let chainId = 1; + try { + const chainInfo = ALL_LIT_CHAINS[authCallbackParams.chain]; + chainId = chainInfo.chainId; + } catch {} + let response; + const commonData = { + sessionKey, + statement: authCallbackParams.statement, + pkpPublicKey: params.pkpPublicKey, + expiration: authCallbackParams.expiration, + resources: authCallbackParams.resources, + chainId, + ...(params.resourceAbilityRequests && { + resourceAbilityRequests: params.resourceAbilityRequests, + }), + }; + if (params.authMethod.authMethodType === AUTH_METHOD_TYPE.EthWallet) { + const authSig = JSON.parse(params.authMethod.accessToken); + response = await nodeClient.signSessionKey({ + ...commonData, + authSig, + authMethods: [], + }); + } else { + response = await nodeClient.signSessionKey({ + ...commonData, + authMethods: [params.authMethod], + }); + } + return response.authSig; + }; + } + const sessionSigs = await this.litNodeClient.getSessionSigs({ + ...params.sessionSigsParams, + sessionKey, + authNeededCallback, + }); + return sessionSigs; + } + /** + * Authenticates an auth Method for claiming a Programmable Key Pair (PKP). + * Uses the underyling {@link litNodeClient} instance to authenticate a given auth method + * @param claimRequest + * @returns {Promise} - Response from the network for the claim + */ + async claimKeyId(claimRequest) { + if (!this.litNodeClient.ready) { + await this.litNodeClient.connect(); + } + const res = await this.litNodeClient.claimKeyId(claimRequest); + return res; + } + /** + * Calculates a public key for a given `key identifier` which is an `Auth Method Identifier` + * the Auth Method Identifier is a hash of a user identifier and app idendtifer. + * These identifiers are specific to each auth method and will derive the public key protion of a pkp which will be persited + * when a key is claimed. + * | Auth Method | User ID | App ID | + * |:------------|:-------|:-------| + * | Google OAuth | token `sub` | token `aud` | + * | Discord OAuth | user id | client app identifier | + * | Stytch OTP |token `sub` | token `aud`| + * @param userId + * @param appId + * @returns + */ + computePublicKeyFromAuthMethod = async (authMethod) => { + let authMethodId = await this.getAuthMethodId(authMethod); + authMethodId = authMethodId.slice(2); + if (!this.litNodeClient) { + throw new LitNodeClientNotReadyError( + { + info: { + authMethod, + method: 'computePublicKeyFromAuthMethod', + }, + }, + 'Lit Node Client is not configured' + ); + } + return this.litNodeClient.computeHDPubKey(authMethodId); + }; + /** + * Generate request data for minting and fetching PKPs via relay server + * + * @param {AuthMethod} authMethod - Auth method obejct + * + * @returns {Promise} - Relay request data + */ + async prepareRelayRequestData(authMethod) { + const authMethodType = authMethod.authMethodType; + const authMethodId = await this.getAuthMethodId(authMethod); + const data = { + authMethodType, + authMethodId, + }; + return data; + } + /** + * Generate request body for minting PKP using auth methods via relay server + * + * @param {IRelayRequestData} data - Data for minting PKP + * @param {number} data.authMethodType - Type of auth method + * @param {string} data.authMethodId - ID of auth method + * @param {string} [data.authMethodPubKey] - Public key associated with the auth method (used only in WebAuthn) + * @param {MintRequestBody} [customArgs] - Extra data to overwrite default params + * + * @returns {string} - Relay request body for minting PKP + */ + prepareMintBody(data, customArgs) { + const pubkey = data.authMethodPubKey || '0x'; + const defaultArgs = { + // default params + keyType: 2, + permittedAuthMethodTypes: [data.authMethodType], + permittedAuthMethodIds: [data.authMethodId], + permittedAuthMethodPubkeys: [pubkey], + permittedAuthMethodScopes: [[ethers_exports.BigNumber.from('1')]], + addPkpEthAddressAsPermittedAddress: true, + sendPkpToItself: true, + }; + const args = { + ...defaultArgs, + ...customArgs, + }; + const body = JSON.stringify(args); + return body; + } + /** + * Generate request body to fetch PKPs using auth method info via relay server + * + * @param {IRelayRequestData} data - Data for fetching PKP + * @param {string} data.authMethodType - Type of auth method + * @param {string} data.authMethodId - ID of auth method + * @param {string} [data.authMethodPubKey] - Public key associated with the auth method (used only in WebAuthn) + * + * @returns {string} - Relay request body to fetch PKPs + */ + prepareFetchBody(data) { + const args = { + authMethodId: data.authMethodId, + authMethodType: data.authMethodType, + authMethodPubKey: data.authMethodPubKey, + }; + const body = JSON.stringify(args); + return body; + } +}; + +// packages/lit-auth-client/src/lib/providers/DiscordProvider.ts +var DiscordProvider = class extends BaseProvider2 { + /** + * The redirect URI that Lit's login server should send the user back to + */ + redirectUri; + /** + * OAuth client ID. Defaults to one used by Lit + */ + clientId; + constructor(options) { + super(options); + this.redirectUri = options.redirectUri || window.location.origin; + this.clientId = options.clientId || '1052874239658692668'; + } + /** + * Redirect user to the Lit's Discord login page + * + * @returns {Promise} - Redirects user to Lit login page + */ + async signIn() { + const loginUrl = await prepareLoginUrl('discord', this.redirectUri); + window.location.assign(loginUrl); + } + /** + * Validate the URL parameters returned from Lit's login server and return the authentication data + * + * @returns {Promise} - Auth method object that contains OAuth token + */ + async authenticate() { + if (!window.location.href.startsWith(this.redirectUri)) { + throw new UnauthorizedException( + { + info: { + url: window.location.href, + redirectUri: this.redirectUri, + }, + }, + `Current url does not match provided redirect uri` + ); + } + const { provider, accessToken, state, error } = parseLoginParams( + window.location.search + ); + if (error) { + throw new UnknownError( + { + info: { + error, + }, + cause: new Error(error), + }, + error ?? 'Received error from discord authentication' + ); + } + if (!provider || provider !== 'discord') { + throw new UnauthorizedException( + { + info: { + provider, + redirectUri: this.redirectUri, + }, + }, + 'OAuth provider does not match "discord"' + ); + } + if (!state || decode4(decodeURIComponent(state)) !== getStateParam()) { + throw new UnauthorizedException( + { + info: { + state, + redirectUri: this.redirectUri, + }, + }, + 'Invalid state parameter in callback URL' + ); + } + window.history.replaceState( + null, + window.document.title, + window.location.pathname + ); + if (!accessToken) { + throw new UnauthorizedException( + { + info: { + accessToken, + redirectUri: this.redirectUri, + }, + }, + `Missing access token in callback URL` + ); + } + const authMethod = { + authMethodType: AUTH_METHOD_TYPE.Discord, + accessToken, + }; + return authMethod; + } + /** + * Sign in using popup window + * + * @param baseURL + */ + async signInUsingPopup(baseURL) { + const width = 500; + const height = 600; + const left = window.screen.width / 2 - width / 2; + const top = window.screen.height / 2 - height / 2; + const url = await prepareLoginUrl('discord', this.redirectUri, baseURL); + const popup = window.open( + `${url}&caller=${window.location.origin}`, + 'popup', + `toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, copyhistory=no, width=${width}, height=${height}, top=${top}, left=${left}` + ); + if (!popup) { + throw new UnknownError({}, 'Failed to open popup window'); + } + return new Promise((resolve, reject) => { + const interval = setInterval(() => { + if (popup.closed) { + clearInterval(interval); + reject(new Error('User closed popup window')); + } + }, 1e3); + window.addEventListener('message', (event) => { + if (event.origin !== (baseURL || LIT_LOGIN_GATEWAY)) { + return; + } + const { provider, token, error } = event.data; + if (error) { + clearInterval(interval); + reject(new Error(error)); + } + if (provider === 'discord' && token) { + clearInterval(interval); + popup.close(); + resolve({ + authMethodType: AUTH_METHOD_TYPE.Discord, + accessToken: token, + }); + } + }); + }); + } + /** + * Get auth method id that can be used to look up and interact with + * PKPs associated with the given auth method + * + * @param {AuthMethod} authMethod - Auth method object + * + * @returns {Promise} - Auth method id + */ + async getAuthMethodId(authMethod) { + const userId = await this._fetchDiscordUser(authMethod.accessToken); + const authMethodId = ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes(`${userId}:${this.clientId}`) + ); + return authMethodId; + } + static async authMethodId(authMethod, clientId) { + const _clientId = clientId || '1052874239658692668'; + let userId; + const meResponse = await fetch('https://discord.com/api/users/@me', { + method: 'GET', + headers: { + authorization: `Bearer ${authMethod.accessToken}`, + }, + }); + if (meResponse.ok) { + const user = await meResponse.json(); + userId = user.id; + } else { + throw new UnknownError({}, 'Unable to verify Discord account'); + } + const authMethodId = ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes(`${userId}:${_clientId}`) + ); + return authMethodId; + } + /** + * Fetch Discord user ID + * + * @param {string} accessToken - Discord access token + * + * @returns {Promise} - Discord user ID + */ + async _fetchDiscordUser(accessToken) { + const meResponse = await fetch('https://discord.com/api/users/@me', { + method: 'GET', + headers: { + authorization: `Bearer ${accessToken}`, + }, + }); + if (meResponse.ok) { + const user = await meResponse.json(); + return user.id; + } else { + throw new UnknownError({}, 'Unable to verify Discord account'); + } + } +}; + +// packages/lit-auth-client/src/lib/providers/EthWalletProvider.ts +init_shim(); +import { SiweMessage as SiweMessage5 } from 'siwe'; +var EthWalletProvider = class extends BaseProvider2 { + /** + * The domain from which the signing request is made + */ + domain; + /** + * The origin from which the signing request is made + */ + origin; + constructor(options) { + super(options); + const { domain, origin } = EthWalletProvider.getDomainAndOrigin(options); + this.domain = domain; + this.origin = origin; + } + static getDomainAndOrigin(options) { + let domain, origin; + try { + domain = options.domain || window.location.hostname; + origin = options.origin || window.location.origin; + } catch (e2) { + log( + '\u26A0\uFE0F Error getting "domain" and "origin" from window object, defaulting to "localhost" and "http://localhost"' + ); + domain = options.domain || 'localhost'; + origin = options.origin || 'http://localhost'; + } + return { domain, origin }; + } + /** + * Generate a wallet signature to use as an auth method + * + * @param {EthWalletAuthenticateOptions} options + * @param {string} [options.address] - Address to sign with + * @param {string} [options.chain] - Name of chain to use for signature + * @param {number} [options.expiration] - When the auth signature expires + * + * @returns {Promise} - Auth method object containing the auth signature + */ + async authenticate(options) { + if (!options) { + throw new InvalidArgumentException( + { + info: { + options, + }, + }, + 'Options are required to authenticate with EthWalletProvider.' + ); + } + return EthWalletProvider.authenticate({ + signer: options, + address: options.address, + chain: options.chain, + litNodeClient: this.litNodeClient, + expiration: options.expiration, + domain: this.domain, + origin: this.origin, + }); + } + /** + * Generate a wallet signature to use as an auth method + * + * @param {EthWalletAuthenticateOptions} options + * @param {object} options.signer - Signer object + * @param {object} options.litNodeClient - LitNodeClient instance + * @param {string} [options.address] - Address to sign with + * @param {string} [options.chain] - Name of chain to use for signature + * @param {number} [options.expiration] - When the auth signature expires + * @param {string} [options.domain] - Domain from which the signing request is made + * @param {string} [options.origin] - Origin from which the signing request is made + * @returns {Promise} - Auth method object containing the auth signature + * @static + * @memberof EthWalletProvider + * + * @example + * ```typescript + * const authMethod = await EthWalletProvider.authenticate({ + * signer: wallet, + * litNodeClient: client, + * }); + * ``` + */ + static async authenticate({ + signer, + address, + chain, + litNodeClient, + expiration, + domain, + origin, + }) { + chain = chain || 'ethereum'; + let authSig; + address = address || (await signer?.getAddress()) || signer?.address; + if (!address) { + throw new InvalidArgumentException( + { + info: { + address, + signer, + }, + }, + `Address is required to authenticate with EthWalletProvider. Cannot find it in signer or options.` + ); + } + address = ethers_exports.utils.getAddress(address); + if (signer?.signMessage) { + const selectedChain = LIT_CHAINS[chain]; + const chainId = selectedChain?.chainId ? selectedChain.chainId : 1; + expiration = + expiration || new Date(Date.now() + 1e3 * 60 * 60 * 24).toISOString(); + const { domain: resolvedDomain, origin: resolvedOrigin } = + EthWalletProvider.getDomainAndOrigin({ domain, origin }); + const preparedMessage = { + domain: resolvedDomain, + uri: resolvedOrigin, + address, + version: '1', + chainId, + expirationTime: expiration, + nonce: await litNodeClient.getLatestBlockhash(), + }; + const message = new SiweMessage5(preparedMessage); + const toSign = message.prepareMessage(); + const signature2 = await signer.signMessage(toSign); + authSig = { + sig: signature2, + derivedVia: 'web3.eth.personal.sign', + signedMessage: toSign, + address, + }; + } else { + authSig = await checkAndSignAuthMessage({ + chain, + nonce: await litNodeClient.getLatestBlockhash(), + }); + } + const authMethod = { + authMethodType: AUTH_METHOD_TYPE.EthWallet, + accessToken: JSON.stringify(authSig), + }; + return authMethod; + } + /** + * Get auth method id that can be used to look up and interact with + * PKPs associated with the given auth method + * + * @param {AuthMethod} authMethod - Auth method object + * + * @returns {Promise} - Auth method id + */ + async getAuthMethodId(authMethod) { + return EthWalletProvider.authMethodId(authMethod); + } + static async authMethodId(authMethod) { + let address; + try { + address = JSON.parse(authMethod.accessToken).address; + } catch (err) { + throw new WrongParamFormat( + { + info: { + authMethod, + }, + cause: err, + }, + 'Error when parsing auth method to generate auth method ID for Eth wallet' + ); + } + return ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes(`${address}:lit`) + ); + } +}; + +// packages/lit-auth-client/src/lib/providers/GoogleProvider.ts +init_shim(); +import * as jose2 from 'jose'; +var GoogleProvider = class extends BaseProvider2 { + /** + * The redirect URI that Lit's login server should send the user back to + */ + redirectUri; + constructor(options) { + super(options); + this.redirectUri = options.redirectUri || window.location.origin; + } + /** + * Redirect user to the Lit's Google login page + * + * @param {Function} [callback] - Optional callback to handle login URL + * @returns {Promise} - Redirects user to Lit login page + */ + async signIn(callback) { + const loginUrl = await prepareLoginUrl('google', this.redirectUri); + if (callback) { + callback(loginUrl); + } else { + window.location.assign(loginUrl); + } + } + /** + * Validate the URL parameters returned from Lit's login server and return the authentication data + * + * @returns {Promise} - Auth method object that contains OAuth token + */ + async authenticate(_, urlCheckCallback) { + const isUrlValid = urlCheckCallback + ? urlCheckCallback(window.location.href, this.redirectUri) + : window.location.href.startsWith(this.redirectUri); + if (!isUrlValid) { + throw new UnauthorizedException( + { + info: { + url: window.location.href, + redirectUri: this.redirectUri, + }, + }, + `Current url does not match provided redirect uri` + ); + } + const { provider, idToken, state, error } = parseLoginParams( + window.location.search + ); + if (error) { + throw new UnknownError( + { + info: { + error, + }, + cause: new Error(error), + }, + error ?? 'Received error from discord authentication' + ); + } + if (!provider || provider !== 'google') { + throw new UnauthorizedException( + { + info: { + provider, + redirectUri: this.redirectUri, + }, + }, + 'OAuth provider does not match "google"' + ); + } + if (!state || decode4(decodeURIComponent(state)) !== getStateParam()) { + throw new UnauthorizedException( + { + info: { + state, + redirectUri: this.redirectUri, + }, + }, + 'Invalid state parameter in callback URL' + ); + } + window.history.replaceState( + null, + window.document.title, + window.location.pathname + ); + if (!idToken) { + throw new UnauthorizedException( + { + info: { + idToken, + redirectUri: this.redirectUri, + }, + }, + 'Missing ID token in callback URL' + ); + } + const authMethod = { + authMethodType: AUTH_METHOD_TYPE.GoogleJwt, + accessToken: idToken, + }; + return authMethod; + } + /** + * Sign in using popup window + * + * @param baseURL + */ + async signInUsingPopup(baseURL) { + const width = 500; + const height = 600; + const left = window.screen.width / 2 - width / 2; + const top = window.screen.height / 2 - height / 2; + const url = await prepareLoginUrl('google', this.redirectUri, baseURL); + const popup = window.open( + `${url}&caller=${window.location.origin}`, + 'popup', + `toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, copyhistory=no, width=${width}, height=${height}, top=${top}, left=${left}` + ); + if (!popup) { + throw new UnknownError({}, 'Failed to open popup window'); + } + return new Promise((resolve, reject) => { + const interval = setInterval(() => { + if (popup.closed) { + clearInterval(interval); + reject(new Error('User closed popup window')); + } + }, 1e3); + window.addEventListener('message', (event) => { + if (event.origin !== (baseURL || LIT_LOGIN_GATEWAY)) { + return; + } + const { provider, token, error } = event.data; + if (error) { + clearInterval(interval); + reject(new Error(error)); + } + if (provider === 'google' && token) { + clearInterval(interval); + popup.close(); + resolve({ + authMethodType: AUTH_METHOD_TYPE.GoogleJwt, + accessToken: token, + }); + } + }); + }); + } + /** + * Get auth method id that can be used to look up and interact with + * PKPs associated with the given auth method + * + * @param {AuthMethod} authMethod - Auth method object + * + * @returns {Promise} - Auth method id + */ + async getAuthMethodId(authMethod) { + return GoogleProvider.authMethodId(authMethod); + } + static async authMethodId(authMethod) { + const tokenPayload = jose2.decodeJwt(authMethod.accessToken); + const userId = tokenPayload['sub']; + const audience = tokenPayload['aud']; + const authMethodId = ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes(`${userId}:${audience}`) + ); + return authMethodId; + } +}; + +// packages/lit-auth-client/src/lib/providers/StytchAuthFactorOtp.ts +init_shim(); + +// packages/lit-auth-client/src/lib/providers/StytchAuthFactors.ts +init_shim(); +var emailOtpAuthFactorParser2 = (parsedToken, provider) => { + const session = parsedToken[provider]; + const authFactors = session['authentication_factors']; + let authFactor = authFactors.find((value, _index, _obj) => { + if (value.email_factor) return value; + }); + if (!authFactor) { + throw new WrongParamFormat( + { + info: { + parsedToken, + provider, + }, + }, + 'Could not find email authentication info in session' + ); + } + const audience = parsedToken['aud'][0]; + if (!audience) { + throw new WrongParamFormat( + { + info: { + parsedToken, + provider, + }, + }, + 'Token does not contain an audience (project identifier), aborting' + ); + } + const userId = authFactor.email_factor.email_address; + const authMethodId = ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes( + `${userId.toLowerCase()}:${audience.toLowerCase()}` + ) + ); + return authMethodId; +}; +var smsOtpAuthFactorParser2 = (parsedToken, provider) => { + const session = parsedToken[provider]; + const authFactors = session['authentication_factors']; + let authFactor = authFactors.find((value, _index, _obj) => { + if (value.phone_number_factor) return value; + }); + if (!authFactor) { + throw new WrongParamFormat( + { + info: { + parsedToken, + provider, + }, + }, + 'Could not find email authentication info in session' + ); + } + const audience = parsedToken['aud'][0]; + if (!audience) { + throw new WrongParamFormat( + { + info: { + parsedToken, + provider, + }, + }, + 'Token does not contain an audience (project identifier), aborting' + ); + } + const userId = authFactor.phone_number_factor.phone_number; + const authMethodId = ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes( + `${userId.toLowerCase()}:${audience.toLowerCase()}` + ) + ); + return authMethodId; +}; +var whatsAppOtpAuthFactorParser2 = (parsedToken, provider) => { + const session = parsedToken[provider]; + const authFactors = session['authentication_factors']; + let authFactor = authFactors.find((value, _index, _obj) => { + if (value.phone_number_factor) return value; + }); + if (!authFactor) { + throw new WrongParamFormat( + { + info: { + parsedToken, + provider, + }, + }, + 'Could not find email authentication info in session' + ); + } + const audience = parsedToken['aud'][0]; + if (!audience) { + throw new WrongParamFormat( + { + info: { + parsedToken, + provider, + }, + }, + 'Token does not contain an audience (project identifier), aborting' + ); + } + const userId = authFactor.phone_number_factor.phone_number; + const authMethodId = ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes( + `${userId.toLowerCase()}:${audience.toLowerCase()}` + ) + ); + return authMethodId; +}; +var totpAuthFactorParser2 = (parsedToken, provider) => { + const session = parsedToken[provider]; + const authFactors = session['authentication_factors']; + let authFactor = authFactors.find((value, _index, _obj) => { + if (value.phone_number_factor) return value; + }); + if (!authFactor) { + throw new WrongParamFormat( + { + info: { + parsedToken, + provider, + }, + }, + 'Could not find email authentication info in session' + ); + } + const audience = parsedToken['aud'][0]; + if (!audience) { + throw new WrongParamFormat( + { + info: { + parsedToken, + provider, + }, + }, + 'Token does not contain an audience (project identifier), aborting' + ); + } + const userId = authFactor.authenticator_app_factor.totp_id; + const authMethodId = ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes( + `${userId.toLowerCase()}:${audience.toLowerCase()}` + ) + ); + return authMethodId; +}; + +// packages/lit-auth-client/src/lib/providers/StytchAuthFactorOtp.ts +var _StytchAuthFactorOtpProvider = class extends BaseProvider2 { + _params; + _factor; + constructor(params, config2, factor) { + super(params); + this._params = config2; + this._factor = factor; + } + /** + * Validates claims within a stytch authenticated JSON Web Token + * Will parse out the given `authentication factor` and use the transport + * for the otp code as the `user identifier` for the given auth method. + * @param options authentication option containing the authenticated token + * @returns {AuthMethod} Authentication Method for auth method type OTP + * + */ + async authenticate(options) { + return new Promise((resolve, reject) => { + if (!options) { + reject( + new Error( + 'No Authentication options provided, please supply an authenticated JWT' + ) + ); + } + const accessToken = options?.accessToken; + if (!accessToken) { + reject( + new Error('No access token provided, please provide a stych auth jwt') + ); + } + const parsedToken = _StytchAuthFactorOtpProvider._parseJWT(accessToken); + const factorParser = _StytchAuthFactorOtpProvider._resolveAuthFactor( + this._factor + ); + try { + factorParser.parser( + parsedToken, + _StytchAuthFactorOtpProvider._provider + ); + } catch (e2) { + reject(e2); + } + resolve({ + authMethodType: factorParser.authMethodType, + accessToken, + }); + }); + } + /** + * Get auth method id that can be used to look up and interact with + * PKPs associated with the given auth method + * + * @param {AuthMethod} authMethod - Auth method object + * + * @returns {Promise} - Auth method id + */ + async getAuthMethodId(authMethod) { + return _StytchAuthFactorOtpProvider.authMethodId(authMethod); + } + /** + * Get auth method id that can be used to look up and interact with + * PKPs associated with the given auth method. + * Will parse out the given `authentication factor` and use the transport + * for the otp code as the `user identifier` for the given auth method. + * @param {AuthMethod} authMethod - Auth method object + * + * @returns {Promise} - Auth method id + */ + static async authMethodId(authMethod) { + return new Promise((resolve, reject) => { + const accessToken = authMethod.accessToken; + const parsedToken = _StytchAuthFactorOtpProvider._parseJWT(accessToken); + let factor = 'email'; + switch (authMethod.authMethodType) { + case AUTH_METHOD_TYPE.StytchEmailFactorOtp: + factor = 'email'; + break; + case AUTH_METHOD_TYPE.StytchSmsFactorOtp: + factor = 'sms'; + break; + case AUTH_METHOD_TYPE.StytchWhatsAppFactorOtp: + factor = 'whatsApp'; + break; + case AUTH_METHOD_TYPE.StytchTotpFactorOtp: + factor = 'totp'; + break; + default: + throw new InvalidArgumentException( + { + info: { + authMethodType: authMethod.authMethodType, + }, + }, + 'Unsupport stytch auth type' + ); + } + const factorParser = this._resolveAuthFactor(factor).parser; + try { + resolve(factorParser(parsedToken, this._provider)); + } catch (e2) { + reject(e2); + } + }); + } + static _resolveAuthFactor(factor) { + switch (factor) { + case 'email': + return { + parser: emailOtpAuthFactorParser2, + authMethodType: AUTH_METHOD_TYPE.StytchEmailFactorOtp, + }; + case 'sms': + return { + parser: smsOtpAuthFactorParser2, + authMethodType: AUTH_METHOD_TYPE.StytchSmsFactorOtp, + }; + case 'whatsApp': + return { + parser: whatsAppOtpAuthFactorParser2, + authMethodType: AUTH_METHOD_TYPE.StytchWhatsAppFactorOtp, + }; + case 'totp': + return { + parser: totpAuthFactorParser2, + authMethodType: AUTH_METHOD_TYPE.StytchTotpFactorOtp, + }; + } + } + /** + * + * @param jwt token to parse + * @returns {string}- userId contained within the token message + */ + static _parseJWT(jwt) { + const parts = jwt.split('.'); + if (parts.length !== 3) { + throw new WrongParamFormat( + { + info: { + jwt, + }, + }, + 'Invalid token length' + ); + } + const body = Buffer.from(parts[1], 'base64'); + const parsedBody = JSON.parse(body.toString('ascii')); + return parsedBody; + } +}; +var StytchAuthFactorOtpProvider = _StytchAuthFactorOtpProvider; +__publicField( + StytchAuthFactorOtpProvider, + '_provider', + 'https://stytch.com/session' +); + +// packages/lit-auth-client/src/lib/providers/StytchOtpProvider.ts +init_shim(); +var StytchOtpProvider = class extends BaseProvider2 { + _params; + _provider = 'https://stytch.com/session'; + constructor(params, config2) { + super(params); + this._params = config2; + } + /** + * Validates claims within a stytch authenticated JSON Web Token + * @param options authentication option containing the authenticated token + * @returns {AuthMethod} Authentication Method for auth method type OTP + * */ + authenticate(options) { + return new Promise((resolve, reject) => { + if (!options) { + reject( + new Error( + 'No Authentication options provided, please supply an authenticated JWT' + ) + ); + } + const userId = this._params.userId ?? options.userId; + const accessToken = options?.accessToken; + if (!accessToken) { + reject( + new Error('No access token provided, please provide a stych auth jwt') + ); + } + const parsedToken = StytchOtpProvider._parseJWT(accessToken); + const audience = parsedToken['aud'][0]; + if (audience != this._params.appId) { + reject(new Error('Parsed application id does not match parameters')); + } + if (!audience) { + reject( + new Error( + 'could not find project id in token body, is this a stych token?' + ) + ); + } + const session = parsedToken[this._provider]; + const authFactor = session['authentication_factors'][0]; + if (!authFactor) { + reject(new Error('Could not find authentication info in session')); + } + if (userId && userId != parsedToken['sub']) { + reject( + new Error( + 'UserId does not match token contents. is this the right token for your application?' + ) + ); + } + resolve({ + authMethodType: AUTH_METHOD_TYPE.StytchOtp, + accessToken, + }); + }); + } + /** + * Get auth method id that can be used to look up and interact with + * PKPs associated with the given auth method + * + * @param {AuthMethod} authMethod - Auth method object + * + * @returns {Promise} - Auth method id + */ + async getAuthMethodId(authMethod) { + return StytchOtpProvider.authMethodId(authMethod); + } + static async authMethodId(authMethod) { + const tokenBody = StytchOtpProvider._parseJWT(authMethod.accessToken); + const userId = tokenBody['sub']; + const orgId = tokenBody['aud'][0]; + const authMethodId = ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes( + `${userId.toLowerCase()}:${orgId.toLowerCase()}` + ) + ); + return authMethodId; + } + /** + * + * @param jwt token to parse + * @returns {string}- userId contained within the token message + */ + static _parseJWT(jwt) { + const parts = jwt.split('.'); + if (parts.length !== 3) { + throw new WrongParamFormat( + { + info: { + jwt, + }, + }, + 'Invalid token length' + ); + } + const body = Buffer.from(parts[1], 'base64'); + const parsedBody = JSON.parse(body.toString('ascii')); + console.log('JWT body: ', parsedBody); + return parsedBody; + } +}; + +// packages/lit-auth-client/src/lib/providers/WebAuthnProvider.ts +init_shim(); +import base64url from 'base64url'; +var WebAuthnProvider = class extends BaseProvider2 { + /** + * Name of relying party. Defaults to "lit" + */ + rpName; + constructor(options) { + super(options); + this.rpName = options.rpName || 'lit'; + } + /** + * Generate registration options for the browser to pass to a supported authenticator + * + * @param {string} username - Username to register credential with + * + * @returns {Promise} - Options to pass to the authenticator + */ + async register(username) { + return await this.relay.generateRegistrationOptions(username); + } + /** + * Mint PKP with verified registration data + * + * @param {PublicKeyCredentialCreationOptionsJSON} options - Registration options to pass to the authenticator + * @param {MintRequestBody} [customArgs] - Extra data to overwrite default params + * + * @returns {Promise} - Mint transaction hash + */ + async verifyAndMintPKPThroughRelayer(options, customArgs) { + const { startRegistration } = await import('@simplewebauthn/browser'); + const attResp = await startRegistration(options); + const authMethodId = await this.getAuthMethodId({ + authMethodType: AUTH_METHOD_TYPE.WebAuthn, + accessToken: JSON.stringify(attResp), + }); + const authMethodPubkey = + WebAuthnProvider.getPublicKeyFromRegistration(attResp); + const defaultArgs = { + keyType: 2, + permittedAuthMethodTypes: [AUTH_METHOD_TYPE.WebAuthn], + permittedAuthMethodIds: [authMethodId], + permittedAuthMethodPubkeys: [authMethodPubkey], + permittedAuthMethodScopes: [[ethers_exports.BigNumber.from('1')]], + addPkpEthAddressAsPermittedAddress: true, + sendPkpToItself: true, + }; + const args = { + ...defaultArgs, + ...customArgs, + }; + const body = JSON.stringify(args); + const mintRes = await this.relay.mintPKP(body); + if (!mintRes || !mintRes.requestId) { + throw new UnknownError( + { + info: { + mintRes, + }, + }, + 'Missing mint response or request ID from relay server' + ); + } + return mintRes.requestId; + } + /** + * @override + * This method is not applicable for WebAuthnProvider and should not be used. + * Use verifyAndMintPKPThroughRelayer instead to mint a PKP for a WebAuthn credential. + * + * @throws {Error} - Throws an error when called for WebAuthnProvider. + */ + async mintPKPThroughRelayer() { + throw new RemovedFunctionError( + { + info: { + method: 'mintPKPThroughRelayer', + }, + }, + 'Use verifyAndMintPKPThroughRelayer for WebAuthnProvider instead.' + ); + } + /** + * Authenticate with a WebAuthn credential and return the relevant authentication data + * + * @returns {Promise} - Auth method object containing WebAuthn authentication data + */ + async authenticate() { + const blockHash = await this.litNodeClient.getLatestBlockhash(); + const blockHashBytes = ethers_exports.utils.arrayify(blockHash); + const rpId = getRPIdFromOrigin(window.location.origin); + const authenticationOptions = { + challenge: base64url(Buffer.from(blockHashBytes)), + timeout: 6e4, + userVerification: 'required', + rpId, + }; + const { startAuthentication } = await import('@simplewebauthn/browser'); + const authenticationResponse = await startAuthentication( + authenticationOptions + ); + const actualAuthenticationResponse = JSON.parse( + JSON.stringify(authenticationResponse) + ); + const userHandle = authenticationResponse.response?.userHandle; + if (userHandle) { + actualAuthenticationResponse.response.userHandle = + base64url.encode(userHandle); + } + const authMethod = { + authMethodType: AUTH_METHOD_TYPE.WebAuthn, + accessToken: JSON.stringify(actualAuthenticationResponse), + }; + return authMethod; + } + /** + * Get auth method id that can be used to look up and interact with + * PKPs associated with the given auth method + * + * @param {AuthMethod} authMethod - Auth method object + * + * @returns {Promise} - Auth method id + */ + async getAuthMethodId(authMethod) { + return WebAuthnProvider.authMethodId(authMethod, this.rpName); + } + static async authMethodId(authMethod, rpName) { + let credentialId; + const rpNameToUse = rpName || 'lit'; + try { + credentialId = JSON.parse(authMethod.accessToken).rawId; + } catch (err) { + throw new WrongParamFormat( + { + info: { + authMethod, + }, + cause: err, + }, + 'Error when parsing auth method to generate auth method ID for Eth wallet' + ); + } + const authMethodId = ethers_exports.utils.keccak256( + ethers_exports.utils.toUtf8Bytes(`${credentialId}:${rpNameToUse}`) + ); + return authMethodId; + } + /** + * Parse the WebAuthn registration response to get the WebAuthn credential public key + * + * @param {RegistrationResponseJSON} attResp - WebAuthn registration response + * + * @returns {string} - WebAuthn credential public key in hex format + */ + static getPublicKeyFromRegistration(attResp) { + let publicKey; + try { + const attestationBuffer = Buffer.from( + attResp.response.attestationObject, + 'base64' + ); + const authenticationResponse = parseAuthenticatorData(attestationBuffer); + const publicKeyCoseBuffer = + authenticationResponse.attestedCredentialData.credentialPublicKey; + publicKey = ethers_exports.utils.hexlify( + ethers_exports.utils.arrayify(publicKeyCoseBuffer) + ); + } catch (e2) { + throw new UnknownError( + { + cause: e2, + }, + 'Error while decoding WebAuthn registration response for public key retrieval. Attestation response not encoded as expected' + ); + } + return publicKey; + } +}; + +// packages/lit-auth-client/src/lib/utils.ts +var STATE_PARAM_KEY = 'lit-state-param'; +var LIT_LOGIN_GATEWAY = 'https://login.litgateway.com'; +async function prepareLoginUrl( + provider, + redirectUri, + baseUrl = LIT_LOGIN_GATEWAY +) { + const loginUrl = `${baseUrl}${getLoginRoute(provider)}`; + const state = encode5(await setStateParam()); + const authParams = { + app_redirect: redirectUri, + }; + const queryAuthParams = createQueryParams(authParams); + return `${loginUrl}?${queryAuthParams}&state=${state}`; +} +function getLoginRoute(provider) { + switch (provider) { + case 'google': + return '/auth/google'; + case 'discord': + return '/auth/discord'; + default: + throw new InvalidArgumentException( + { + info: { + provider, + }, + }, + `No login route available for the given provider "${provider}".` + ); + } +} +function createQueryParams(params) { + const filteredParams = Object.keys(params) + .filter((k) => typeof params[k] !== 'undefined') + .reduce((acc, key2) => ({ ...acc, [key2]: params[key2] }), {}); + return new URLSearchParams(filteredParams).toString(); +} +function parseLoginParams(search) { + const searchParams = new URLSearchParams(search); + const provider = searchParams.get('provider'); + const accessToken = searchParams.get('access_token'); + const idToken = searchParams.get('id_token'); + const state = searchParams.get('state'); + const error = searchParams.get('error'); + return { + provider, + accessToken, + idToken, + state, + error, + }; +} +async function setStateParam() { + const state = Math.random().toString(36).substring(2, 17); + sessionStorage.setItem(STATE_PARAM_KEY, state); + return state; +} +function getStateParam() { + return sessionStorage.getItem(STATE_PARAM_KEY); +} +function encode5(value) { + return window.btoa(value); +} +function decode4(value) { + return window.atob(value); +} +function getRPIdFromOrigin(origin) { + const newOrigin = origin.replace(/(^\w+:|^)\/\//, ''); + return newOrigin.replace(/:\d+$/, ''); +} +function parseAuthenticatorData(authDataBuffer) { + try { + const authDataBufferDecoded = cbor.decode(authDataBuffer); + const authenticatorData = {}; + const authData = authDataBufferDecoded.authData; + authenticatorData.rpIdHash = authData.slice(0, 32); + authenticatorData.flags = authData[32]; + authenticatorData.signCount = + (authData[33] << 24) | + (authData[34] << 16) | + (authData[35] << 8) | + authData[36]; + if (authenticatorData.flags & 64) { + const attestedCredentialData = {}; + attestedCredentialData['aaguid'] = unparse(authData.slice(37, 53)); + attestedCredentialData['credentialIdLength'] = + (authData[53] << 8) | authData[54]; + attestedCredentialData['credentialId'] = authData.slice( + 55, + 55 + attestedCredentialData['credentialIdLength'] + ); + let publicKeyCoseBufferCbor = authData.slice( + 55 + attestedCredentialData['credentialIdLength'], + authData.length + ); + const publicKey = cbor.decode(publicKeyCoseBufferCbor); + publicKeyCoseBufferCbor = cbor.encode(publicKey); + attestedCredentialData['credentialPublicKey'] = publicKeyCoseBufferCbor; + authenticatorData.attestedCredentialData = attestedCredentialData; + } + if (authenticatorData.flags & 128) { + let extensionDataCbor; + if (authenticatorData.attestedCredentialData) { + extensionDataCbor = cbor.decode( + // decodeAllSync( + authData.slice( + 55 + authenticatorData.attestedCredentialData.credentialIdLength, + authData.length + ) + ); + extensionDataCbor = extensionDataCbor[1]; + } else { + extensionDataCbor = cbor.decode(authData.slice(37, authData.length)); + } + authenticatorData.extensionData = cbor + .encode(extensionDataCbor) + .toString('base64'); + } + return authenticatorData; + } catch (e2) { + throw new UnknownError( + { + info: { + authDataBuffer, + }, + cause: e2, + }, + 'Authenticator Data could not be parsed' + ); + } +} +function unparse(buf) { + const _byteToHex = []; + const _hexToByte = {}; + for (let it = 0; it < 256; it++) { + _byteToHex[it] = (it + 256).toString(16).substr(1); + _hexToByte[_byteToHex[it]] = it; + } + let i2 = 0; + const bth = _byteToHex; + return ( + bth[buf[i2++]] + + bth[buf[i2++]] + + bth[buf[i2++]] + + bth[buf[i2++]] + + '-' + + bth[buf[i2++]] + + bth[buf[i2++]] + + '-' + + bth[buf[i2++]] + + bth[buf[i2++]] + + '-' + + bth[buf[i2++]] + + bth[buf[i2++]] + + '-' + + bth[buf[i2++]] + + bth[buf[i2++]] + + bth[buf[i2++]] + + bth[buf[i2++]] + + bth[buf[i2++]] + + bth[buf[i2++]] + ); +} +function log2(...args) { + const logger48 = getLoggerbyId('auth-client'); + logger48.debug(...args); +} +async function getAuthIdByAuthMethod2(authMethod) { + let authId; + switch (authMethod.authMethodType) { + case AUTH_METHOD_TYPE.EthWallet: + authId = await EthWalletProvider.authMethodId(authMethod); + break; + case AUTH_METHOD_TYPE.Discord: + authId = await DiscordProvider.authMethodId(authMethod); + break; + case AUTH_METHOD_TYPE.WebAuthn: + authId = await WebAuthnProvider.authMethodId(authMethod); + break; + case AUTH_METHOD_TYPE.GoogleJwt: + authId = await GoogleProvider.authMethodId(authMethod); + break; + case AUTH_METHOD_TYPE.StytchOtp: + authId = await StytchOtpProvider.authMethodId(authMethod); + break; + case AUTH_METHOD_TYPE.StytchEmailFactorOtp: + case AUTH_METHOD_TYPE.StytchSmsFactorOtp: + case AUTH_METHOD_TYPE.StytchTotpFactorOtp: + case AUTH_METHOD_TYPE.StytchWhatsAppFactorOtp: + authId = await StytchAuthFactorOtpProvider.authMethodId(authMethod); + break; + default: + log2(`unsupported AuthMethodType: ${authMethod.authMethodType}`); + throw new InvalidArgumentException( + { + info: { + authMethod, + }, + }, + `Unsupported auth method type: ${authMethod.authMethodType}` + ); + } + return authId; +} + +// packages/lit-auth-client/src/lib/providers/AppleProvider.ts +import * as jose3 from 'jose'; + +// packages/lit-auth-client/src/lib/relay.ts +init_shim(); +var LitRelay = class { + /** URL for Lit's relay server */ + static getRelayUrl(litNetwork) { + const relayerUrl = RELAYER_URL_BY_NETWORK[litNetwork]; + if (!relayerUrl) { + throw new WrongNetworkException( + { + info: { + litNetwork, + }, + }, + `Relay URL not found for network ${litNetwork}` + ); + } + return relayerUrl; + } + /** + * URL for Lit's relay server + */ + relayUrl; + /** + * API key for Lit's relay server + */ + relayApiKey; + /** + * Route for minting PKP + */ + mintRoute = '/mint-next-and-add-auth-methods'; + /** + * Route for fetching PKPs + */ + fetchRoute = '/fetch-pkps-by-auth-method'; + /** + * Create a Relay instance + * + * @param {LitRelayConfig} config + * @param {string} [config.relayApiKey] - API key for Lit's relay server + * @param {string} [config.relayUrl] - URL for Lit's relay server. If not provided, will default to the last dev relay server. + */ + constructor(config2) { + this.relayUrl = + config2.relayUrl || LitRelay.getRelayUrl(LIT_NETWORK.DatilDev); + this.relayApiKey = config2.relayApiKey || ''; + log2("Lit's relay server URL:", this.relayUrl); + } + /** + * Mint a new PKP for the given auth method + * + * @param {string} body - Body of the request + * + * @returns {Promise} Response from the relay server + */ + async mintPKP(body) { + const response = await fetch(`${this.relayUrl}${this.mintRoute}`, { + method: 'POST', + headers: { + 'api-key': this.relayApiKey, + 'Content-Type': 'application/json', + }, + body, + }); + if (response.status < 200 || response.status >= 400) { + log2('Something wrong with the API call', await response.json()); + const err = new Error('Unable to mint PKP through relay server'); + throw err; + } else { + const resBody = await response.json(); + log2('Successfully initiated minting PKP with relayer'); + return resBody; + } + } + /** + * Mints a new pkp with all AuthMethods provided. Allows for permissions and flags to be set separately. + * If no permissions are provided then each auth method will be assigned `1` for sign anything + * If no flags are provided then `sendPkpToitself` will be false, and `addPkpEthAddressAsPermittedAddress` will be true + * It is then up to the implementor to transfer the pkp nft to the pkp address. + * **note** When adding permissions, each permission should be added in the same order the auth methods are ordered + * + * @throws {Error} - Throws an error if no AuthMethods are given + * @param {AuthMethod[]} authMethods - AuthMethods authentication methods to be added to the pkp + * @param {{ pkpPermissionScopes?: number[][]; sendPkpToitself?: boolean; addPkpEthAddressAsPermittedAddress?: boolean;}} options + * + * @returns {Promise<{pkpTokenId?: string; pkpEthAddress?: string; pkpPublicKey?: string}>} pkp information + */ + async mintPKPWithAuthMethods(authMethods, options) { + if (authMethods.length < 1) { + throw new InvalidParamType( + { + info: { + authMethods, + options, + }, + }, + 'Must provide at least one auth method' + ); + } + if ( + !options.pkpPermissionScopes || + options.pkpPermissionScopes.length < 1 + ) { + options.pkpPermissionScopes = []; + for (let i2 = 0; i2 < authMethods.length; i2++) { + options.pkpPermissionScopes.push([ + ethers_exports.BigNumber.from('1').toNumber(), + ]); + } + } + const reqBody = { + keyType: 2, + permittedAuthMethodTypes: authMethods.map((value) => { + return value.authMethodType; + }), + permittedAuthMethodScopes: options.pkpPermissionScopes, + addPkpEthAddressAsPermittedAddress: + options.addPkpEthAddressAsPermittedAddress ?? true, + sendPkpToItself: options.sendPkpToitself ?? false, + }; + const permittedAuthMethodIds = []; + const permittedAuthMethodPubkeys = []; + for (const authMethod of authMethods) { + const id2 = await getAuthIdByAuthMethod2(authMethod); + permittedAuthMethodIds.push(id2); + if (authMethod.authMethodType === AUTH_METHOD_TYPE.WebAuthn) { + permittedAuthMethodPubkeys.push( + WebAuthnProvider.getPublicKeyFromRegistration( + JSON.parse(authMethod.accessToken) + ) + ); + } else { + permittedAuthMethodPubkeys.push('0x'); + } + } + reqBody.permittedAuthMethodIds = permittedAuthMethodIds; + reqBody.permittedAuthMethodPubkeys = permittedAuthMethodPubkeys; + const mintRes = await this.mintPKP(JSON.stringify(reqBody)); + if (!mintRes || !mintRes.requestId) { + throw new NetworkError( + { + info: { + mintRes, + }, + }, + `Missing mint response or request ID from mint response ${mintRes.error}` + ); + } + const pollerResult = await this.pollRequestUntilTerminalState( + mintRes.requestId + ); + return { + pkpTokenId: pollerResult.pkpTokenId, + pkpPublicKey: pollerResult.pkpPublicKey, + pkpEthAddress: pollerResult.pkpEthAddress, + }; + } + /** + * Poll the relay server for status of minting request + * + * @param {string} requestId - Request ID to poll, likely the minting transaction hash + * @param {number} [pollInterval] - Polling interval in milliseconds + * @param {number} [maxPollCount] - Maximum number of times to poll + * + * @returns {Promise} Response from the relay server + */ + async pollRequestUntilTerminalState( + requestId, + pollInterval = 15e3, + maxPollCount = 20 + ) { + for (let i2 = 0; i2 < maxPollCount; i2++) { + const response = await fetch( + `${this.relayUrl}/auth/status/${requestId}`, + { + method: 'GET', + headers: { + 'api-key': this.relayApiKey, + }, + } + ); + if (response.status < 200 || response.status >= 400) { + log2('Something wrong with the API call', await response.json()); + const err2 = new Error( + `Unable to poll the status of this mint PKP transaction: ${requestId}` + ); + throw err2; + } + const resBody = await response.json(); + log2('Response OK', { body: resBody }); + if (resBody.error) { + log2('Something wrong with the API call', { + error: resBody.error, + }); + const err2 = new Error(resBody.error); + throw err2; + } else if (resBody.status === 'Succeeded') { + log2('Successfully authed', { ...resBody }); + return resBody; + } + await new Promise((r3) => setTimeout(r3, pollInterval)); + } + const err = new Error('Polling for mint PKP transaction status timed out'); + throw err; + } + /** + * Fetch PKPs associated with the given auth method + * + * @param {string} body - Body of the request + * + * @returns {Promise} Response from the relay server + */ + async fetchPKPs(body) { + const response = await fetch(`${this.relayUrl}${this.fetchRoute}`, { + method: 'POST', + headers: { + 'api-key': this.relayApiKey, + 'Content-Type': 'application/json', + }, + body, + }); + if (response.status < 200 || response.status >= 400) { + console.warn('Something wrong with the API call', await response.json()); + const err = new Error('Unable to fetch PKPs through relay server'); + throw err; + } else { + const resBody = await response.json(); + console.log('Successfully fetched PKPs with relayer'); + return resBody; + } + } + /** + * Generate options for registering a new credential to pass to the authenticator + * + * @param {string} [username] - Optional username to associate with the credential + * + * @returns {Promise} Registration options for the browser to pass to the authenticator + */ + async generateRegistrationOptions(username) { + let url = `${this.relayUrl}/auth/webauthn/generate-registration-options`; + if (username && username !== '') { + url = `${url}?username=${encodeURIComponent(username)}`; + } + const response = await fetch(url, { + method: 'GET', + headers: { + 'api-key': this.relayApiKey, + }, + }); + if (response.status < 200 || response.status >= 400) { + const err = new Error( + `Unable to generate registration options: ${response}` + ); + throw err; + } + const registrationOptions = await response.json(); + return registrationOptions; + } + /** + * returns the relayUrl + */ + getUrl() { + return this.relayUrl; + } +}; + +// local-tests/setup/tinny-person.ts +var TinnyPerson = class { + privateKey; + wallet; + siweMessage; + authSig; + authMethod; + contractsClient; + // public capacityTokenId: string; + // public capacityDelegationAuthSig: AuthSig; + pkp; + authMethodOwnedPkp; + // Pass this to data to sign + loveLetter = ethers_exports.utils.arrayify( + ethers_exports.utils.keccak256([1, 2, 3, 4, 5]) + ); + provider; + envConfig; + constructor({ privateKey, envConfig }) { + this.envConfig = envConfig; + this.privateKey = privateKey; + this.provider = new ethers_exports.providers.StaticJsonRpcProvider({ + url: this.envConfig.rpc, + skipFetchSetup: true, + }); + this.wallet = new ethers_exports.Wallet(privateKey, this.provider); + } + async getAuthMethodId() { + return EthWalletProvider.authMethodId(this.authMethod); + } + /** + * FIXME: Enabling this is causing the test to fail + * Switches the current wallet to a new funding wallet by creating a new funding wallet, + * funding it with a small amount of ethers, and updating the current wallet to the new one. + * + * @private + * @returns {Promise} A promise that resolves once the wallet has been switched. + */ + async _switchWallet() { + const fundingWallet = ethers_exports.Wallet.createRandom().connect( + this.provider + ); + if (this.envConfig.network != LIT_NETWORK.Custom) { + const balance = await this.wallet.getBalance(); + console.log( + '[\u{10B3A}\u{1F9EA} Tinny Person\u{10B3A}] Wallet balance:', + ethers_exports.utils.formatEther(balance) + ); + const transferTx = await this.wallet.sendTransaction({ + to: fundingWallet.address, + value: ethers_exports.utils.parseEther('0.00001'), + }); + const transferReciept = await transferTx.wait(); + console.log( + '[\u{10B3A}\u{1F9EA} Tinny Person\u{10B3A}] Transfered Assets for person tx: ', + transferReciept.transactionHash + ); + this.wallet = fundingWallet; + } + } + async spawn() { + console.log( + '[\u{10B3A}\u{1F9EA} Tinny Person\u{10B3A}] Spawning person:', + this.wallet.address + ); + this.siweMessage = await createSiweMessage({ + nonce: await this.envConfig.litNodeClient.getLatestBlockhash(), + walletAddress: this.wallet.address, + }); + this.authSig = await generateAuthSig({ + signer: this.wallet, + toSign: this.siweMessage, + }); + console.log( + '[\u{10B3A}\u{1F9EA} Tinny Person\u{10B3A}] Crafting an authMethod from the authSig for the eth wallet auth method...' + ); + this.authMethod = await EthWalletProvider.authenticate({ + signer: this.wallet, + litNodeClient: this.envConfig.litNodeClient, + }); + if (this.envConfig.network === LIT_NETWORK.Custom) { + const networkContext = this.envConfig.contractContext; + this.contractsClient = new LitContracts({ + signer: this.wallet, + debug: this.envConfig.processEnvs.DEBUG, + rpc: this.envConfig.processEnvs.LIT_RPC_URL, + // anvil rpc + customContext: networkContext, + network: LIT_NETWORK.Custom, + }); + } else { + this.contractsClient = new LitContracts({ + signer: this.wallet, + debug: this.envConfig.processEnvs.DEBUG, + network: this.envConfig.network, + }); + } + await this.contractsClient.connect(); + console.log('[\u{10B3A}\u{1F9EA} Tinny Person\u{10B3A}] Minting a PKP...'); + const walletMintRes = + await this.contractsClient.pkpNftContractUtils.write.mint(); + this.pkp = walletMintRes.pkp; + console.log( + '[\u{10B3A}\u{1F9EA} Tinny Person\u{10B3A}] Minting a PKP with eth wallet auth method...' + ); + this.authMethodOwnedPkp = ( + await this.contractsClient.mintWithAuth({ + authMethod: this.authMethod, + scopes: [AUTH_METHOD_SCOPE.SignAnything], + }) + ).pkp; + console.log( + '[\u{10B3A}\u{1F9EA} Tinny Person\u{10B3A}] \u{1F423} TinnyPerson spawned:', + this.wallet.address + ); + } +}; + +// local-tests/setup/shiva-client.ts +init_shim(); +var ShivaError = class extends Error { + constructor(shivaResponse) { + let message = `An error occurred on request to testnet with id: ${shivaResponse.testnetId}`; + for (const error of shivaResponse.errors) { + message += ' ' + error; + } + super(message); + this.name = 'ShivaError'; + this.message = message; + } +}; +var TestnetClient = class { + _id; + _info; + _processEnvs; + _currentState; + constructor(id2, envs) { + this._processEnvs = envs; + this._id = id2; + } + /** + Returns info on a given testnet instance + if information cannot be accessed we retured undefined + @returns TestNetInfo | undefined + */ + get Info() { + return this._info; + } + get ContractContext() { + const testNetConfig = this.Info; + if (!testNetConfig) { + return void 0; + } + const contractResolverAbi = testNetConfig.contractResolverAbi; + const contractResolverAddress = + testNetConfig.contractAddresses[`contractResolver`]; + const networkContext = { + abi: JSON.parse(contractResolverAbi), + resolverAddress: contractResolverAddress, + provider: new ethers_exports.providers.StaticJsonRpcProvider({ + url: `http://${testNetConfig.rpcUrl}`, + skipFetchSetup: true, + }), + environment: 0, + // test deployment uses env value 0 in test common + contractContext: { + Allowlist: {}, + Multisender: {}, + Staking: { + abi: JSON.parse(testNetConfig.contractAbis.staking), + }, + PKPNFT: { + abi: JSON.parse(testNetConfig.contractAbis.pkpnft), + }, + PKPPermissions: { + abi: JSON.parse(testNetConfig.contractAbis.pkpPermissions), + }, + PKPHelper: { + abi: JSON.parse(testNetConfig.contractAbis.pkpHelper), + }, + LITToken: { + abi: JSON.parse(testNetConfig.contractAbis.litToken), + }, + PKPNFTMetadata: {}, + PubkeyRouter: {}, + PriceFeed: {}, + }, + }; + return networkContext; + } + /** + * Polls a given testnet for the ACTIVE state + * polls on a 500 milisecond interval + */ + async pollTestnetForActive() { + let state = 'Busy'; + while (state != 'Active' && state != `UNKNOWN`) { + const res = await fetch( + this._processEnvs.TESTNET_MANAGER_URL + '/test/poll/testnet/' + this._id + ); + const stateRes = await _processTestnetResponse(res); + state = stateRes.body; + console.log('found state to be', state); + await new Promise((res2, _) => { + setTimeout(() => { + res2(); + }, 500); + }); + } + return state; + } + /** + * Returns the config for a given testnet + */ + async getTestnetConfig() { + const res = await fetch( + this._processEnvs.TESTNET_MANAGER_URL + + '/test/get/info/testnet/' + + this._id + ); + const testnetInfoRes = await _processTestnetResponse(res); + this._info = testnetInfoRes.body; + return testnetInfoRes; + } + /** + * Will wait for the NEXT epoch and return a resposne when the epoch has fully transitioned. + * The return time is directly proportional to the epoch transition time config and where the network is with the current epoch. + */ + async transitionEpochAndWait() { + const res = await fetch( + this._processEnvs.TESTNET_MANAGER_URL + + '/test/action/transition/epoch/wait/' + + this._id + ); + let transitionEpochAndWaitRes = _processTestnetResponse(res); + return transitionEpochAndWaitRes; + } + /** + * Stops a random peer and waits for the next epoc to transiton. + * The return time is directly proportional to the epoch transition time config and where the network is with the current epoch. + */ + async stopRandomNetworkPeerAndWaitForNextEpoch() { + const res = await fetch( + this._processEnvs.TESTNET_MANAGER_URL + + '/test/action/stop/random/wait/' + + this._id + ); + return _processTestnetResponse(res); + } + /* + Stops the testnet + */ + async stopTestnet() { + console.log('stopping testnet with id:', this._id); + const res = await fetch( + this._processEnvs.TESTNET_MANAGER_URL + '/test/delete/testnet/' + this._id + ); + return _processTestnetResponse(res); + } +}; +var ShivaClient = class { + _clients; + processEnvs = { + STOP_TESTNET: process.env[`STOP_TESTNET`] === 'true', + TESTNET_MANAGER_URL: + process.env['TESTNET_MANAGER_URL'] || 'http://0.0.0.0:8000', + USE_LIT_BINARIES: process.env[`USE_LIT_BINARIES`] === `true`, + LIT_NODE_BINARY_PATH: + process.env['LIT_NODE_BINARY_PATH'] || + `./../../lit-assets/rust/lit-node/target/debug/lit_node`, + LIT_ACTION_BINARY_PATH: + process.env['LIT_ACTION_BINARY_PATH'] || + `./../../lit-assets/rust/lit-actions/target/debug/lit_actions`, + }; + constructor() { + this._clients = /* @__PURE__ */ new Map(); + console.log('Shiva environment loaded current config: ', this.processEnvs); + } + /** + * Used to start an instance of a lit network through the Lit Testnet Manager + * if an instance exists, we will just take it as we optimistically assume it will not be shut down in the test life time. + * If an instance does not exist then we create one + */ + async startTestnetManager(createReq) { + const existingTestnetResp = await fetch( + this.processEnvs.TESTNET_MANAGER_URL + '/test/get/testnets' + ); + const existingTestnets = await existingTestnetResp.json(); + if (existingTestnets.length > 0) { + this._clients.set( + existingTestnets[0], + new TestnetClient(existingTestnets[0], this.processEnvs) + ); + return this._clients.get(existingTestnets[0]); + } else { + console.log( + 'lit node binary path: ', + this.processEnvs.LIT_NODE_BINARY_PATH + ); + console.log( + 'lit action server binary path: ', + this.processEnvs.LIT_ACTION_BINARY_PATH + ); + let body = createReq ?? { + nodeCount: 3, + pollingInterval: '2000', + epochLength: 9e4, + }; + if (this.processEnvs.USE_LIT_BINARIES) { + body.customBuildPath = this.processEnvs.LIT_NODE_BINARY_PATH; + body.litActionServerCustomBuildPath = + this.processEnvs.LIT_ACTION_BINARY_PATH; + } + console.log('Testnet create args: ', body); + const createTestnetResp = await fetch( + this.processEnvs.TESTNET_MANAGER_URL + '/test/create/testnet', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(body), + } + ); + const createTestnet = await _processTestnetResponse(createTestnetResp); + this._clients.set( + createTestnet.testnetId, + new TestnetClient(createTestnet.testnetId, this.processEnvs) + ); + return this._clients.get(createTestnet.testnetId); + } + } +}; +async function _processTestnetResponse(response) { + let createTestnet; + try { + createTestnet = await response.json(); + } catch (err) { + let message = await response.text(); + throw new Error('Error while performing testnet request: ' + message); + } + if (response.status === 500) { + throw new ShivaError(createTestnet); + } + return createTestnet; +} + +// local-tests/setup/tinny-utils.ts +init_shim(); +import { importer } from 'ipfs-unixfs-importer'; +import { Buffer as Buffer2 } from 'buffer'; +async function stringToIpfsHash(input) { + const blockput = { + put: async (block) => { + return block.cid; + }, + }; + const content = Buffer2.from(input); + const files = importer([{ content }], blockput); + const result = (await files.next()).value; + const ipfsHash = result.cid.toString(); + if (!ipfsHash.startsWith('Qm')) { + throw new Error('Generated hash does not start with Qm'); + } + return ipfsHash; +} +function randomSolanaPrivateKey() { + const BASE58_ALPHABET = + '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; + const SOLANA_PRIVATE_KEY_LENGTH = 88; + let result = ''; + const charactersLength = BASE58_ALPHABET.length; + for (let i2 = 0; i2 < SOLANA_PRIVATE_KEY_LENGTH; i2++) { + const randomIndex = Math.floor(Math.random() * charactersLength); + result += BASE58_ALPHABET.charAt(randomIndex); + } + return result; +} +function withTimeout(promise, ms) { + const timeout = new Promise((_, reject) => + setTimeout(() => reject(new Error('Timed out')), ms) + ); + return Promise.race([promise, timeout]); +} +function isErrorWithMessage(error) { + return ( + typeof error === 'object' && + error !== null && + 'message' in error && + typeof error.message === 'string' + ); +} +function toErrorWithMessage(maybeError) { + if (isErrorWithMessage(maybeError)) return maybeError; + try { + return new Error(JSON.stringify(maybeError)); + } catch { + return new Error(String(maybeError)); + } +} + +// local-tests/setup/tinny-environment.ts +console.log('checking env', process.env['DEBUG']); +var DEFAULT_ANVIL_PRIVATE_KEYS = [ + '0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d', + '0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a', + '0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6', + '0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a', + '0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba', + '0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e', + '0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356', + '0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97', + '0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6', +]; +var TinnyEnvironment = class { + network; + customNetworkContext; + /** + * Environment variables used in the process. + */ + processEnvs = { + MAX_ATTEMPTS: parseInt(process.env['MAX_ATTEMPTS']) || 1, + TEST_TIMEOUT: parseInt(process.env['TEST_TIMEOUT']) || 45e3, + NETWORK: process.env['NETWORK'] || LIT_NETWORK.Custom, + DEBUG: process.env['DEBUG'] === 'true', + REQUEST_PER_KILOSECOND: + parseInt(process.env['REQUEST_PER_KILOSECOND']) || + process.env['NETWORK'] === 'datil-dev' + ? 1 + : 200, + LIT_RPC_URL: process.env['LIT_RPC_URL'], + WAIT_FOR_KEY_INTERVAL: + parseInt(process.env['WAIT_FOR_KEY_INTERVAL']) || 3e3, + TIME_TO_RELEASE_KEY: parseInt(process.env['TIME_TO_RELEASE_KEY']) || 1e4, + RUN_IN_BAND: process.env['RUN_IN_BAND'] === 'true', + RUN_IN_BAND_INTERVAL: parseInt(process.env['RUN_IN_BAND_INTERVAL']) || 5e3, + // Available Accounts + // ================== + // (1) "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" (10000.000000000000000000 ETH) + // (2) "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" (10000.000000000000000000 ETH) + // (3) "0x90F79bf6EB2c4f870365E785982E1f101E93b906" (10000.000000000000000000 ETH) + // (4) "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65" (10000.000000000000000000 ETH) + // (5) "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc" (10000.000000000000000000 ETH) + // (6) "0x976EA74026E726554dB657fA54763abd0C3a0aa9" (10000.000000000000000000 ETH) + // (7) "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955" (10000.000000000000000000 ETH) + // (8) "0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f" (10000.000000000000000000 ETH) + // (9) "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720" (10000.000000000000000000 ETH) + PRIVATE_KEYS: + process.env['NETWORK'] === LIT_NETWORK.Custom + ? DEFAULT_ANVIL_PRIVATE_KEYS + : process.env['PRIVATE_KEYS']?.split(',') || DEFAULT_ANVIL_PRIVATE_KEYS, + KEY_IN_USE: new Array(), + NO_SETUP: process.env['NO_SETUP'] === 'true', + USE_SHIVA: process.env['USE_SHIVA'] === 'true', + NETWORK_CONFIG: process.env['NETWORK_CONFIG'] ?? './networkContext.json', + }; + litNodeClient; + contractsClient; + rpc; + superCapacityDelegationAuthSig; + bareEthAuthSig; + bareSolAuthSig = { + sig: '706047fcab06ada3cbfeb6990617c1705d59bafb20f5f1c8103d764fb5eaec297328d164e2b891095866b28acc1ab2df288a8729cf026228ef3c4970238b190a', + derivedVia: 'solana.signMessage', + signedMessage: + 'I am creating an account to use Lit Protocol at 2024-05-08T16:39:44.481Z', + address: 'F7r6ENi6dqH8SnMYZdK3YxWAQ4cwfSNXZyMzbea5fbS1', + }; + bareCosmosAuthSig = { + sig: 'dE7J8oaWa8zECuMpaI/IVfJXGpLAO1paGLho+/dmtaQkN7Sh1lmJLAdYqZchDyYhQcg+nqfaoEOzLig3CPlosg==', + derivedVia: 'cosmos.signArbitrary', + signedMessage: + '8c857343720203e3f52606409e6818284186a614e74026998f89e7417eed4d4b', + address: 'cosmos14wp2s5kv07lt220rzfae57k73yv9z2azrmulku', + }; + testnet; + //=========== PRIVATE MEMBERS =========== + _shivaClient = new ShivaClient(); + _contractContext; + constructor(override) { + this.customNetworkContext = override?.customNetworkContext; + this.processEnvs = { + ...this.processEnvs, + ...override, + }; + if (this.processEnvs.PRIVATE_KEYS.length === 1) { + this.processEnvs.PRIVATE_KEYS = new Array(10).fill( + this.processEnvs.PRIVATE_KEYS[0] + ); + } + this.network = override?.NETWORK || this.processEnvs.NETWORK; + if (Object.values(LIT_NETWORK).indexOf(this.network) === -1) { + throw new Error( + `Invalid network environment "${ + this.network + }". Please use one of ${Object.values(LIT_NETWORK)}` + ); + } + this.processEnvs.KEY_IN_USE = new Array( + this.processEnvs.PRIVATE_KEYS.length + ).fill(false); + if (this.processEnvs.LIT_RPC_URL) { + this.rpc = this.processEnvs.LIT_RPC_URL; + } else if (this.network in RPC_URL_BY_NETWORK) { + this.rpc = RPC_URL_BY_NETWORK[this.network]; + } else { + const availableNetworks = Object.keys(RPC_URL_BY_NETWORK).join(', '); + throw new Error( + `No RPC URL found for network "${this.network}". Available networks are: ${availableNetworks}` + ); + } + console.log( + '[\u{10B3A}\u{1F9EA} Tinny Environment\u{10B3A}] Done configuring environment current config: ', + this.processEnvs + ); + } + world = /* @__PURE__ */ new Map(); + /** + * Retrieves an available private key from a list, marking it as in use and scheduling + * its automatic release. If no unused keys are available, it waits for a set interval + * before rechecking. + * + * This function loops until it finds an unused key, marks it, and returns the key with + * its index. If all keys are in use, it logs a wait message and pauses before retrying. + * + * Outputs: + * - privateKey: The selected private key. + * - index: The index of the selected key. + * + * Environment variables required: + * - KEY_IN_USE: Boolean array indicating key usage. + * - PRIVATE_KEYS: Array of key strings. + * - TIME_TO_RELEASE_KEY: Milliseconds until a key is automatically released. + * - WAIT_FOR_KEY_INTERVAL: Wait time in milliseconds if no keys are free. + */ + async getAvailablePrivateKey() { + while (true) { + const index = this.processEnvs.KEY_IN_USE.findIndex((used) => !used); + if (index !== -1) { + this.processEnvs.KEY_IN_USE[index] = true; + return { privateKey: this.processEnvs.PRIVATE_KEYS[index], index }; + } else { + console.log( + '[\u{10B3A}\u{1F9EA} Tinny Environment\u{10B3A}] No available keys. Waiting...', + { + keysInUse: this.processEnvs.KEY_IN_USE, + } + ); + await new Promise((resolve) => + setTimeout(resolve, this.processEnvs.WAIT_FOR_KEY_INTERVAL) + ); + } + } + } + /** + * Marks a private key as available again after use. + * @param {number} index - The index of the key to mark as available. + */ + releasePrivateKeyFromUser(user) { + const index = this.processEnvs.PRIVATE_KEYS.indexOf(user.privateKey); + this.processEnvs.KEY_IN_USE[index] = false; + } + /** + * Marks a private key as available again after use. + * @param {number} index - The index of the key to mark as available. + */ + releasePrivateKey(index) { + this.processEnvs.KEY_IN_USE[index] = false; + } + /** + * Initializes the LitNodeClient based on the specified network configuration and environment variables. + * This setup differentiates between local and production environments, adjusts node attestation checks, + * and sets network-specific parameters. The function ensures the client is connected and ready before proceeding. + * + * The LitNodeClient is configured differently based on the network: + * - Custom: Uses custom settings for local testing, with node attestation disabled. + * - DatilTest (or other specified testnets): Configures for specific network environments with node attestation enabled. + * + * Logs the process and exits if the client is not ready after attempting to connect. + */ + async setupLitNodeClient() { + console.log( + '[\u{10B3A}\u{1F9EA} Tinny Environment\u{10B3A}] Setting up LitNodeClient' + ); + console.log('this.network:', this.network); + const centralisation = CENTRALISATION_BY_NETWORK[this.network]; + if (this.network === LIT_NETWORK.Custom || centralisation === 'unknown') { + const networkContext = + this.customNetworkContext || + (this?.testnet?.ContractContext ?? this._contractContext); + this.litNodeClient = new LitNodeClient({ + litNetwork: LIT_NETWORK.Custom, + rpcUrl: this.rpc, + debug: this.processEnvs.DEBUG, + checkNodeAttestation: false, + // disable node attestation check for local testing + contractContext: networkContext, + }); + } else if (centralisation === 'decentralised') { + this.litNodeClient = new LitNodeClient({ + litNetwork: this.network, + checkNodeAttestation: true, + debug: this.processEnvs.DEBUG, + }); + } else if (centralisation === 'centralised') { + this.litNodeClient = new LitNodeClient({ + litNetwork: this.network, + checkNodeAttestation: false, + debug: this.processEnvs.DEBUG, + }); + } else { + throw new Error(`Network not supported: "${this.network}"`); + } + if (globalThis.wasmExports) { + console.warn( + 'WASM modules already loaded. Will override when connect is called' + ); + } + if (globalThis.wasmECDSA) { + console.warn( + 'WASM modules already loaded. wil override. when connect is called' + ); + } + if (globalThis.wasmSevSnpUtils) { + console.warn( + 'WASM modules already loaded. wil override. when connect is called' + ); + } + await this.litNodeClient.connect(); + if (!this.litNodeClient.ready) { + console.error('\u274C litNodeClient not ready'); + process.exit(); + } + } + /** + * Retrieves the environment configuration. + * @returns The TinnyEnvConfig object containing the environment configuration. + */ + getEnvConfig() { + const contractContext = + this?.testnet?.ContractContext ?? this._contractContext; + return { + rpc: this.rpc, + litNodeClient: this.litNodeClient, + network: this.network, + processEnvs: this.processEnvs, + contractContext, + }; + } + /** + * Creates a new person with the given name. + * @param name - The name of the person. + * @returns The newly created person. + * @throws Error if the name is not provided. + */ + async createNewPerson(name) { + console.log( + '[\u{10B3A}\u{1F9EA} Tinny Environment\u{10B3A}] Creating new person:', + name + ); + if (!name) { + throw new Error('Name is required'); + } + const key2 = await this.getAvailablePrivateKey(); + const privateKey = key2.privateKey; + const envConfig = this.getEnvConfig(); + const person = new TinnyPerson({ + privateKey, + envConfig, + }); + await person.spawn(); + this.world.set(name, person); + return person; + } + /** + * Retrieves a person from the world by their name. + * @param name - The name of the person to retrieve. + * @returns The person object if found, or undefined if not found. + */ + getPerson(name) { + return this.world.get(name); + } + /** + * Creates a random person. + * @returns A promise that resolves to the created person. + */ + async createRandomPerson(name) { + return await this.createNewPerson(name || 'Alice'); + } + setUnavailable = (network) => { + if (this.processEnvs.NETWORK === network) { + throw new Error('LIT_IGNORE_TEST'); + } + }; + /** + * Init + */ + async init() { + try { + if (this.processEnvs.NO_SETUP) { + console.log( + '[\u{10B3A}\u{1F9EA} Tinny Environment\u{10B3A}] Skipping setup' + ); + return; + } + if (this.network === LIT_NETWORK.Custom && this.processEnvs.USE_SHIVA) { + this.testnet = await this._shivaClient.startTestnetManager(); + let state = await this.testnet.pollTestnetForActive(); + if (state === `UNKNOWN`) { + console.log( + 'Testnet state found to be Unknown meaning there was an error with testnet creation. shutting down' + ); + throw new Error(`Error while creating testnet, aborting test run`); + } + await this.testnet.getTestnetConfig(); + } else if (this.network === LIT_NETWORK.Custom) { + const context = + this.customNetworkContext || + (await Promise.resolve().then(() => + __toESM(require_networkContext(), 1) + )); + this._contractContext = context; + } + await this.setupLitNodeClient(); + await this.setupSuperCapacityDelegationAuthSig(); + await this.setupBareEthAuthSig(); + } catch (e2) { + const err = toErrorWithMessage(e2); + console.log( + `[\u{10B3A}\u{1F9EA} Tinny Environment\u{10B3A}] Failed to init() tinny ${err.message}` + ); + console.log(err.stack); + process.exit(1); + } + } + /** + * Setup bare eth auth sig to test access control and decryption + */ + async setupBareEthAuthSig() { + const privateKey = await this.getAvailablePrivateKey(); + try { + const provider = new ethers_exports.providers.JsonRpcBatchProvider( + this.rpc + ); + const wallet = new ethers_exports.Wallet(privateKey.privateKey, provider); + const toSign = await createSiweMessage({ + walletAddress: wallet.address, + nonce: await this.litNodeClient.getLatestBlockhash(), + expiration: new Date( + Date.now() + 29 * 24 * 60 * 60 * 1e3 + ).toISOString(), + litNodeClient: this.litNodeClient, + }); + this.bareEthAuthSig = await generateAuthSig({ + signer: wallet, + toSign, + }); + } finally { + this.releasePrivateKeyFromUser(privateKey); + } + } + //============= SHIVA ENDPOINTS ============= + /** + * Will stop the testnet that is being used in the test run. + */ + async stopTestnet() { + if ( + this.network === LIT_NETWORK.Custom && + this._shivaClient.processEnvs.STOP_TESTNET + ) { + await this.testnet.stopTestnet(); + } else { + console.log('skipping testnet shutdown.'); + } + } + //============= END SHIVA ENDPOINTS ============= + /** + * Sends funds from the current wallet to the specified wallet address. + * @param walletAddress - The address of the recipient wallet. + * @param amount - The amount of funds to send (default: '0.001'). + * @throws If there is an error sending the funds. + */ + getFunds = async (walletAddress, amount = '0.001') => { + const privateKey = await this.getAvailablePrivateKey(); + try { + const provider = new ethers_exports.providers.JsonRpcBatchProvider( + this.rpc + ); + const wallet = new ethers_exports.Wallet(privateKey.privateKey, provider); + const tx = await wallet.sendTransaction({ + to: walletAddress, + value: ethers_exports.utils.parseEther(amount), + }); + await tx.wait(); + } catch (e2) { + throw new Error(`Failed to send funds to ${walletAddress}: ${e2}`); + } finally { + this.releasePrivateKeyFromUser({ privateKey }); + } + }; + /** + * Context: the reason this is created instead of individually is because we can't allocate capacity beyond the global + * max capacity. + */ + setupSuperCapacityDelegationAuthSig = async () => { + const privateKey = await this.getAvailablePrivateKey(); + const provider = new ethers_exports.providers.JsonRpcBatchProvider( + this.rpc + ); + const wallet = new ethers_exports.Wallet(privateKey.privateKey, provider); + if (this.network === LIT_NETWORK.Custom) { + const networkContext = + this?.testnet?.ContractContext ?? this._contractContext; + this.contractsClient = new LitContracts({ + signer: wallet, + debug: this.processEnvs.DEBUG, + rpc: this.rpc, + customContext: networkContext, + network: LIT_NETWORK.Custom, + }); + } else if ( + CENTRALISATION_BY_NETWORK[this.network] === 'decentralised' || + CENTRALISATION_BY_NETWORK[this.network] === 'centralised' + ) { + this.contractsClient = new LitContracts({ + signer: wallet, + debug: this.processEnvs.DEBUG, + network: this.network, + }); + } else { + const rpc = this.rpc; + async function _switchWallet() { + const capacityCreditWallet = + ethers_exports.Wallet.createRandom().connect(provider); + const balance = await wallet.getBalance(); + console.log('this.rpc:', rpc); + console.log('this.wallet.address', wallet.address); + console.log('Balance:', balance.toString()); + const transferTx = await wallet.sendTransaction({ + to: capacityCreditWallet.address, + value: ethers_exports.utils.parseEther('0.001'), + }); + await transferTx.wait(); + } + this.contractsClient = new LitContracts({ + // signer: capacityCreditWallet, // disabled switch wallet for now + signer: wallet, + debug: this.processEnvs.DEBUG, + network: this.network, + }); + } + if (!this.contractsClient) { + console.log('\u2757\uFE0FContracts client not initialized'); + process.exit(); + } + await this.contractsClient.connect(); + if (CENTRALISATION_BY_NETWORK[this.network] === 'decentralised') { + await this.mintSuperCapacityDelegationAuthSig(wallet); + } + }; + async mintSuperCapacityDelegationAuthSig(wallet) { + console.log( + '[\u{10B3A}\u{1F9EA} Tinny Environment\u{10B3A}] Mint a Capacity Credits NFT and get a capacity delegation authSig with it' + ); + try { + this.superCapacityDelegationAuthSig = ( + await this.litNodeClient.createCapacityDelegationAuthSig({ + dAppOwnerWallet: wallet, + // capacityTokenId: capacityTokenId, + // Sets a maximum limit of 200 times that the delegation can be used and prevents usage beyond it + uses: '200', + }) + ).capacityDelegationAuthSig; + } catch (e2) { + if ( + e2.message.includes(`Can't allocate capacity beyond the global max`) + ) { + console.log( + '\u2757\uFE0FSkipping capacity delegation auth sig setup.', + e2 + ); + } else { + console.log( + '\u2757\uFE0FError while setting up capacity delegation auth sig', + e2 + ); + } + } + } +}; + +// local-tests/setup/tinny-operations.ts +init_shim(); +var getFiltersFlag = () => { + const filterArg = process.argv.find((arg) => arg.startsWith('--filter=')); + return filterArg ? filterArg.replace('--filter=', '').split(',') : []; +}; +var getExcludeFlags = () => { + const filterArg = process.argv.find((arg) => arg.startsWith('--exclude=')); + return filterArg ? filterArg.replace('--exclude=', '').split(',') : []; +}; +var runInBand = async ({ tests, devEnv }) => { + const filters = getFiltersFlag(); + const testsToRun = Object.entries(tests).filter( + ([testName]) => filters.length === 0 || filters.includes(testName) + ); + let skippedTests = []; + let failedTests = []; + let passedTests = []; + for (const [testName, testFunction] of testsToRun) { + const maxAttempts = devEnv.processEnvs.MAX_ATTEMPTS; + let attempts = 0; + let testPassed = false; + while (attempts < maxAttempts && !testPassed) { + const startTime = performance.now(); + try { + console.log(`Attempt ${attempts + 1} for ${testName}...`); + await testFunction(devEnv); + testPassed = true; + const endTime = performance.now(); + const timeTaken = (endTime - startTime).toFixed(2); + console.log(`${testName} - Passed (${timeTaken} ms)`); + passedTests.push(`${testName} (Passed in ${timeTaken} ms)`); + } catch (error) { + if (error.message === 'LIT_IGNORE_TEST') { + skippedTests.push(`${testName} (Skipped)`); + break; + } + attempts++; + if (attempts >= maxAttempts) { + const endTime = performance.now(); + const timeTaken = (endTime - startTime).toFixed(2); + console.error( + `${testName} - Failed after ${maxAttempts} attempts (${timeTaken} ms)` + ); + console.error(`Error: ${error}`); + failedTests.push( + `${testName} (Failed in ${timeTaken} ms) - Error: ${error}` + ); + } + } + await new Promise((resolve) => + setTimeout(resolve, devEnv.processEnvs.RUN_IN_BAND_INTERVAL) + ); + } + } + passedTests.forEach((test) => console.log(`- ${test}`)); + failedTests.forEach((test) => console.log(`- ${test}`)); + skippedTests.forEach((test) => console.log(`- ${test}`)); + console.log(); + console.log( + `Test Report: ${passedTests.length} test(s) passed, ${failedTests.length} failed, ${skippedTests.length} skipped.` + ); + if (failedTests.length > 0) { + return 1; + } else { + return 0; + } +}; +var runTestsParallel = async ({ tests, devEnv, chunkSize }) => { + const CHUNK_SIZE = chunkSize || parseInt(process.env.CHUNK_SIZE) || 5; + const filters = getFiltersFlag(); + const excludeFilters = getExcludeFlags(); + const testsToRun = Object.entries(tests).filter( + ([testName]) => + (filters.length === 0 || + filters.some((filter) => testName.includes(filter))) && + (excludeFilters.length === 0 || + !excludeFilters.some((exclude) => testName.includes(exclude))) + ); + if (!testsToRun || testsToRun.length <= 0) { + throw new Error( + '\u274C No tests to run. You might have provided an invalid filter or no tests are available.' + ); + } + const runTest = async ([testName, testFunction], testIndex) => { + const maxAttempts = devEnv.processEnvs.MAX_ATTEMPTS; + const testTimeout = devEnv.processEnvs.TEST_TIMEOUT; + let attempts = 0; + let testPassed = false; + while (attempts < maxAttempts && !testPassed) { + const startTime = performance.now(); + try { + console.log( + `\x1B[90m[runTestsParallel] Attempt ${attempts + 1} for ${ + testIndex + 1 + }. ${testName}...\x1B[0m` + ); + await withTimeout(testFunction(devEnv), testTimeout); + testPassed = true; + const endTime = performance.now(); + const timeTaken = (endTime - startTime).toFixed(2); + console.log( + `\x1B[32m\u2714\x1B[90m ${ + testIndex + 1 + }. ${testName} - Passed (${timeTaken} ms)\x1B[0m` + ); + return `${testName} (Passed in ${timeTaken} ms)`; + } catch (error) { + console.log(error); + if (error.message === 'LIT_IGNORE_TEST') { + return `${testName} (Skipped)`; + } + attempts++; + const endTime = performance.now(); + const timeTaken = (endTime - startTime).toFixed(2); + if (error.message === 'Timed out') { + console.error( + `\x1B[31m\u2716\x1B[90m ${ + testIndex + 1 + }. ${testName} - Timed out after ${testTimeout}ms (${timeTaken} ms)\x1B[0m` + ); + return `${testName} (Timed out in ${timeTaken} ms)`; + } + if (attempts >= maxAttempts) { + console.error( + `\x1B[31m\u2716\x1B[90m ${ + testIndex + 1 + }. ${testName} - Failed after ${maxAttempts} attempts (${timeTaken} ms)\x1B[0m` + ); + console.error( + `\x1B[31m\u274CError:\x1B[90m ${ + JSON.stringify(error) || error + }\x1B[0m` + ); + return `${testName} (Failed in ${timeTaken} ms) - Error: ${JSON.stringify( + error + )}`; + } + } + } + }; + const results = []; + for (let i2 = 0; i2 < testsToRun.length; i2 += CHUNK_SIZE) { + const chunk = testsToRun.slice(i2, i2 + CHUNK_SIZE); + const chunkResults = await Promise.all( + chunk.map((test, index) => runTest(test, i2 + index)) + ); + await new Promise((resolve) => setTimeout(resolve, 3e3)); + results.push(...chunkResults); + } + const skippedTests = results.filter((result) => result.includes('Skipped')); + const failedTests = results.filter( + (result) => result.includes('Failed') || result.includes('Timed out') + ); + const passedTests = results.filter((result) => result.includes('Passed')); + if (skippedTests.length > 0) { + console.log(`\x1B[90mTest Report: Some tests were skipped.\x1B[0m`); + skippedTests.forEach((skippedTest) => + console.log(`\x1B[90m- ${skippedTest}\x1B[0m`) + ); + } + if (failedTests.length > 0) { + console.log(`\x1B[31mTest Report: Some tests failed.\x1B[0m`); + failedTests.forEach((failedTest) => + console.log(`\x1B[31m- ${failedTest}\x1B[0m`) + ); + } + if (passedTests.length > 0) { + console.log( + `\x1B[32mTest Report: ${passedTests.length} test(s) passed.\x1B[0m` + ); + passedTests.forEach((passedTest) => + console.log(`\x1B[32m- ${passedTest}\x1B[0m`) + ); + } + if (failedTests.length > 0) { + console.log( + `\x1B[31mTest Report: ${failedTests.length} test(s) failed.\x1B[0m` + ); + return 1; + } else { + console.log('\x1B[32mTest Report: All tests passed.\x1B[0m'); + return 0; + } +}; + +// local-tests/tests.ts +var tests_exports = {}; +__export(tests_exports, { + testBatchGeneratePrivateKeys: () => testBatchGeneratePrivateKeys, + testCosmosAuthSigToEncryptDecryptString: () => + testCosmosAuthSigToEncryptDecryptString, + testEthAuthSigToEncryptDecryptString: () => + testEthAuthSigToEncryptDecryptString, + testEthereumBroadcastTransactionGeneratedKey: () => + testEthereumBroadcastTransactionGeneratedKey, + testEthereumBroadcastTransactionWrappedKey: () => + testEthereumBroadcastTransactionWrappedKey, + testEthereumBroadcastWrappedKeyWithFetchGasParams: () => + testEthereumBroadcastWrappedKeyWithFetchGasParams, + testEthereumSignMessageGeneratedKey: () => + testEthereumSignMessageGeneratedKey, + testEthereumSignMessageWrappedKey: () => testEthereumSignMessageWrappedKey, + testEthereumSignTransactionWrappedKey: () => + testEthereumSignTransactionWrappedKey, + testExecutJsDecryptAndCombine: () => testExecutJsDecryptAndCombine, + testExecuteJsBroadcastAndCollect: () => testExecuteJsBroadcastAndCollect, + testExecuteJsSignAndCombineEcdsa: () => testExecuteJsSignAndCombineEcdsa, + testExportWrappedKey: () => testExportWrappedKey, + testFailBatchGeneratePrivateKeysAtomic: () => + testFailBatchGeneratePrivateKeysAtomic, + testFailEthereumSignTransactionWrappedKeyInvalidDecryption: () => + testFailEthereumSignTransactionWrappedKeyInvalidDecryption, + testFailEthereumSignTransactionWrappedKeyWithInvalidParam: () => + testFailEthereumSignTransactionWrappedKeyWithInvalidParam, + testFailEthereumSignTransactionWrappedKeyWithMissingParam: () => + testFailEthereumSignTransactionWrappedKeyWithMissingParam, + testFailImportWrappedKeysWithEoaSessionSig: () => + testFailImportWrappedKeysWithEoaSessionSig, + testFailImportWrappedKeysWithExpiredSessionSig: () => + testFailImportWrappedKeysWithExpiredSessionSig, + testFailImportWrappedKeysWithInvalidSessionSig: () => + testFailImportWrappedKeysWithInvalidSessionSig, + testFailImportWrappedKeysWithMaxExpirySessionSig: () => + testFailImportWrappedKeysWithMaxExpirySessionSig, + testFailImportWrappedKeysWithSamePrivateKey: () => + testFailImportWrappedKeysWithSamePrivateKey, + testGenerateEthereumWrappedKey: () => testGenerateEthereumWrappedKey, + testGenerateSolanaWrappedKey: () => testGenerateSolanaWrappedKey, + testImportWrappedKey: () => testImportWrappedKey, + testPkpEthersWithEoaSessionSigsToEthSign: () => + testPkpEthersWithEoaSessionSigsToEthSign, + testPkpEthersWithEoaSessionSigsToEthSignTransaction: () => + testPkpEthersWithEoaSessionSigsToEthSignTransaction, + testPkpEthersWithEoaSessionSigsToEthSignTypedData: () => + testPkpEthersWithEoaSessionSigsToEthSignTypedData, + testPkpEthersWithEoaSessionSigsToEthSignTypedDataUtil: () => + testPkpEthersWithEoaSessionSigsToEthSignTypedDataUtil, + testPkpEthersWithEoaSessionSigsToEthSignTypedDataV1: () => + testPkpEthersWithEoaSessionSigsToEthSignTypedDataV1, + testPkpEthersWithEoaSessionSigsToEthSignTypedDataV3: () => + testPkpEthersWithEoaSessionSigsToEthSignTypedDataV3, + testPkpEthersWithEoaSessionSigsToEthSignTypedDataV4: () => + testPkpEthersWithEoaSessionSigsToEthSignTypedDataV4, + testPkpEthersWithEoaSessionSigsToPersonalSign: () => + testPkpEthersWithEoaSessionSigsToPersonalSign, + testPkpEthersWithEoaSessionSigsToSendTx: () => + testPkpEthersWithEoaSessionSigsToSendTx, + testPkpEthersWithEoaSessionSigsToSignMessage: () => + testPkpEthersWithEoaSessionSigsToSignMessage, + testPkpEthersWithEoaSessionSigsToSignWithAuthContext: () => + testPkpEthersWithEoaSessionSigsToSignWithAuthContext, + testPkpEthersWithLitActionSessionSigsToEthSign: () => + testPkpEthersWithLitActionSessionSigsToEthSign, + testPkpEthersWithLitActionSessionSigsToEthSignTransaction: () => + testPkpEthersWithLitActionSessionSigsToEthSignTransaction, + testPkpEthersWithLitActionSessionSigsToEthSignTypedData: () => + testPkpEthersWithLitActionSessionSigsToEthSignTypedData, + testPkpEthersWithLitActionSessionSigsToEthSignTypedDataUtil: () => + testPkpEthersWithLitActionSessionSigsToEthSignTypedDataUtil, + testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV1: () => + testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV1, + testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV3: () => + testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV3, + testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV4: () => + testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV4, + testPkpEthersWithLitActionSessionSigsToPersonalSign: () => + testPkpEthersWithLitActionSessionSigsToPersonalSign, + testPkpEthersWithLitActionSessionSigsToSendTx: () => + testPkpEthersWithLitActionSessionSigsToSendTx, + testPkpEthersWithLitActionSessionSigsToSignMessage: () => + testPkpEthersWithLitActionSessionSigsToSignMessage, + testPkpEthersWithPkpSessionSigsToEthSign: () => + testPkpEthersWithPkpSessionSigsToEthSign, + testPkpEthersWithPkpSessionSigsToEthSignTransaction: () => + testPkpEthersWithPkpSessionSigsToEthSignTransaction, + testPkpEthersWithPkpSessionSigsToEthSignTypedData: () => + testPkpEthersWithPkpSessionSigsToEthSignTypedData, + testPkpEthersWithPkpSessionSigsToEthSignTypedDataUtil: () => + testPkpEthersWithPkpSessionSigsToEthSignTypedDataUtil, + testPkpEthersWithPkpSessionSigsToEthSignTypedDataV1: () => + testPkpEthersWithPkpSessionSigsToEthSignTypedDataV1, + testPkpEthersWithPkpSessionSigsToEthSignTypedDataV3: () => + testPkpEthersWithPkpSessionSigsToEthSignTypedDataV3, + testPkpEthersWithPkpSessionSigsToEthSignTypedDataV4: () => + testPkpEthersWithPkpSessionSigsToEthSignTypedDataV4, + testPkpEthersWithPkpSessionSigsToPersonalSign: () => + testPkpEthersWithPkpSessionSigsToPersonalSign, + testPkpEthersWithPkpSessionSigsToSendTx: () => + testPkpEthersWithPkpSessionSigsToSendTx, + testPkpEthersWithPkpSessionSigsToSignMessage: () => + testPkpEthersWithPkpSessionSigsToSignMessage, + testRelayer: () => testRelayer, + testSignMessageWithSolanaEncryptedKey: () => + testSignMessageWithSolanaEncryptedKey, + testSignTransactionWithSolanaEncryptedKey: () => + testSignTransactionWithSolanaEncryptedKey, + testSolAuthSigToEncryptDecryptString: () => + testSolAuthSigToEncryptDecryptString, + testUseCustomAuthSessionSigsToPkpSignExecuteJs: () => + testUseCustomAuthSessionSigsToPkpSignExecuteJs, + testUseEoaSessionSigsToEncryptDecryptFile: () => + testUseEoaSessionSigsToEncryptDecryptFile, + testUseEoaSessionSigsToEncryptDecryptString: () => + testUseEoaSessionSigsToEncryptDecryptString, + testUseEoaSessionSigsToEncryptDecryptUint8Array: () => + testUseEoaSessionSigsToEncryptDecryptUint8Array, + testUseEoaSessionSigsToExecuteJsClaimKeys: () => + testUseEoaSessionSigsToExecuteJsClaimKeys, + testUseEoaSessionSigsToExecuteJsClaimMultipleKeys: () => + testUseEoaSessionSigsToExecuteJsClaimMultipleKeys, + testUseEoaSessionSigsToExecuteJsConsoleLog: () => + testUseEoaSessionSigsToExecuteJsConsoleLog, + testUseEoaSessionSigsToExecuteJsJsonResponse: () => + testUseEoaSessionSigsToExecuteJsJsonResponse, + testUseEoaSessionSigsToExecuteJsSigning: () => + testUseEoaSessionSigsToExecuteJsSigning, + testUseEoaSessionSigsToExecuteJsSigningInParallel: () => + testUseEoaSessionSigsToExecuteJsSigningInParallel, + testUseEoaSessionSigsToPkpSign: () => testUseEoaSessionSigsToPkpSign, + testUseEoaSessionSigsToRequestSingleResponse: () => + testUseEoaSessionSigsToRequestSingleResponse, + testUseInvalidLitActionCodeToGenerateSessionSigs: () => + testUseInvalidLitActionCodeToGenerateSessionSigs, + testUseInvalidLitActionIpfsCodeToGenerateSessionSigs: () => + testUseInvalidLitActionIpfsCodeToGenerateSessionSigs, + testUsePkpSessionSigsToEncryptDecryptFile: () => + testUsePkpSessionSigsToEncryptDecryptFile, + testUsePkpSessionSigsToEncryptDecryptString: () => + testUsePkpSessionSigsToEncryptDecryptString, + testUsePkpSessionSigsToExecuteJsClaimKeys: () => + testUsePkpSessionSigsToExecuteJsClaimKeys, + testUsePkpSessionSigsToExecuteJsClaimMultipleKeys: () => + testUsePkpSessionSigsToExecuteJsClaimMultipleKeys, + testUsePkpSessionSigsToExecuteJsConsoleLog: () => + testUsePkpSessionSigsToExecuteJsConsoleLog, + testUsePkpSessionSigsToExecuteJsJsonResponse: () => + testUsePkpSessionSigsToExecuteJsJsonResponse, + testUsePkpSessionSigsToExecuteJsSigning: () => + testUsePkpSessionSigsToExecuteJsSigning, + testUsePkpSessionSigsToExecuteJsSigningInParallel: () => + testUsePkpSessionSigsToExecuteJsSigningInParallel, + testUsePkpSessionSigsToPkpSign: () => testUsePkpSessionSigsToPkpSign, + testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptFile: () => + testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptFile, + testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptString: () => + testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptString, + testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimKeys: () => + testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimKeys, + testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimMultipleKeys: + () => + testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimMultipleKeys, + testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsConsoleLog: () => + testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsConsoleLog, + testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsJsonResponse: () => + testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsJsonResponse, + testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigning: () => + testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigning, + testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigningInParallel: + () => + testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigningInParallel, + testUseValidLitActionCodeGeneratedSessionSigsToPkpSign: () => + testUseValidLitActionCodeGeneratedSessionSigsToPkpSign, + testUseValidLitActionIpfsCodeGeneratedSessionSigsToExecuteJsSigning: () => + testUseValidLitActionIpfsCodeGeneratedSessionSigsToExecuteJsSigning, + testUseValidLitActionIpfsCodeGeneratedSessionSigsToPkpSign: () => + testUseValidLitActionIpfsCodeGeneratedSessionSigsToPkpSign, + tinnyTests: () => tinnyTests, +}); +init_shim(); + +// local-tests/tests/testUseEoaSessionSigsToExecuteJsSigning.ts +init_shim(); + +// local-tests/setup/session-sigs/get-eoa-session-sigs.ts +init_shim(); +var getEoaSessionSigs = async (devEnv, person, resourceAbilityRequests) => { + const centralisation = + CENTRALISATION_BY_NETWORK[devEnv.litNodeClient.config.litNetwork]; + if (centralisation === 'decentralised') { + console.warn( + 'Decentralised network detected. Adding superCapacityDelegationAuthSig to eoaSessionSigs' + ); + } + const _resourceAbilityRequests = resourceAbilityRequests || [ + { + resource: new LitPKPResource('*'), + ability: LIT_ABILITY.PKPSigning, + }, + { + resource: new LitActionResource('*'), + ability: LIT_ABILITY.LitActionExecution, + }, + ]; + const sessionSigs = await devEnv.litNodeClient.getSessionSigs({ + chain: 'ethereum', + resourceAbilityRequests: _resourceAbilityRequests, + authNeededCallback: async ({ + uri, + expiration, + resourceAbilityRequests: resourceAbilityRequests2, + }) => { + console.log('resourceAbilityRequests:', resourceAbilityRequests2); + if (!expiration) { + throw new Error('expiration is required'); + } + if (!resourceAbilityRequests2) { + throw new Error('resourceAbilityRequests is required'); + } + if (!uri) { + throw new Error('uri is required'); + } + const toSign = await createSiweMessageWithRecaps({ + uri, + expiration, + resources: resourceAbilityRequests2, + walletAddress: person.wallet.address, + nonce: await devEnv.litNodeClient.getLatestBlockhash(), + litNodeClient: devEnv.litNodeClient, + }); + const authSig = await generateAuthSig({ + signer: person.wallet, + toSign, + }); + return authSig; + }, + ...(centralisation === 'decentralised' && { + capabilityAuthSigs: [devEnv.superCapacityDelegationAuthSig], + }), + }); + log('[getEoaSessionSigs]: ', getEoaSessionSigs); + return sessionSigs; +}; +var getEoaSessionSigsWithCapacityDelegations = async ( + devEnv, + fromWallet, + capacityDelegationAuthSig +) => { + const centralisation = + CENTRALISATION_BY_NETWORK[devEnv.litNodeClient.config.litNetwork]; + if (centralisation === 'decentralised') { + console.warn( + 'Decentralised network detected. Adding superCapacityDelegationAuthSig to eoaSessionSigs' + ); + } + const sessionSigs = await devEnv.litNodeClient.getSessionSigs({ + chain: 'ethereum', + resourceAbilityRequests: [ + { + resource: new LitPKPResource('*'), + ability: LIT_ABILITY.PKPSigning, + }, + { + resource: new LitActionResource('*'), + ability: LIT_ABILITY.LitActionExecution, + }, + ], + authNeededCallback: async ({ + uri, + expiration, + resourceAbilityRequests, + }) => { + if (!expiration) { + throw new Error('expiration is required'); + } + if (!resourceAbilityRequests) { + throw new Error('resourceAbilityRequests is required'); + } + if (!uri) { + throw new Error('uri is required'); + } + const toSign = await createSiweMessageWithRecaps({ + uri, + expiration, + resources: resourceAbilityRequests, + walletAddress: fromWallet.address, + nonce: await devEnv.litNodeClient.getLatestBlockhash(), + litNodeClient: devEnv.litNodeClient, + }); + const authSig = await generateAuthSig({ + signer: fromWallet, + toSign, + }); + return authSig; + }, + ...(centralisation === 'decentralised' && { + capabilityAuthSigs: [ + capacityDelegationAuthSig ?? devEnv.superCapacityDelegationAuthSig, + ], + }), + }); + log('[getEoaSessionSigs]: ', getEoaSessionSigs); + return sessionSigs; +}; + +// local-tests/tests/testUseEoaSessionSigsToExecuteJsSigning.ts +var testUseEoaSessionSigsToExecuteJsSigning = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const eoaSessionSigs = await getEoaSessionSigs(devEnv, alice); + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: eoaSessionSigs, + code: `(async () => { + const sigShare = await LitActions.signEcdsa({ + toSign: dataToSign, + publicKey, + sigName: "sig", + }); + })();`, + jsParams: { + dataToSign: alice.loveLetter, + publicKey: alice.pkp.publicKey, + }, + }); + devEnv.releasePrivateKeyFromUser(alice); + if (!res.signatures.sig.r) { + throw new Error(`Expected "r" in res.signatures.sig`); + } + if (!res.signatures.sig.s) { + throw new Error(`Expected "s" in res.signatures.sig`); + } + if (!res.signatures.sig.dataSigned) { + throw new Error(`Expected "dataSigned" in res.signatures.sig`); + } + if (!res.signatures.sig.publicKey) { + throw new Error(`Expected "publicKey" in res.signatures.sig`); + } + log('\u2705 testUseEoaSessionSigsToExecuteJsSigning'); +}; + +// local-tests/tests/testUseEoaSessionSigsToPkpSign.ts +init_shim(); +var testUseEoaSessionSigsToPkpSign = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const eoaSessionSigs = await getEoaSessionSigs(devEnv, alice); + const runWithSessionSigs = await devEnv.litNodeClient.pkpSign({ + toSign: alice.loveLetter, + pubKey: alice.pkp.publicKey, + sessionSigs: eoaSessionSigs, + }); + devEnv.releasePrivateKeyFromUser(alice); + if (!runWithSessionSigs.r) { + throw new Error(`Expected "r" in runWithSessionSigs`); + } + if (!runWithSessionSigs.s) { + throw new Error(`Expected "s" in runWithSessionSigs`); + } + if (!runWithSessionSigs.dataSigned) { + throw new Error(`Expected "dataSigned" in runWithSessionSigs`); + } + if (!runWithSessionSigs.publicKey) { + throw new Error(`Expected "publicKey" in runWithSessionSigs`); + } + if (!runWithSessionSigs.signature.startsWith('0x')) { + throw new Error(`Expected "signature" to start with 0x`); + } + if (isNaN(runWithSessionSigs.recid)) { + throw new Error(`Expected "recid" to be parseable as a number`); + } + const signature2 = ethers_exports.utils.joinSignature({ + r: '0x' + runWithSessionSigs.r, + s: '0x' + runWithSessionSigs.s, + recoveryParam: runWithSessionSigs.recid, + }); + const recoveredPubKey = ethers_exports.utils.recoverPublicKey( + alice.loveLetter, + signature2 + ); + console.log('recoveredPubKey:', recoveredPubKey); + if (recoveredPubKey !== `0x${runWithSessionSigs.publicKey.toLowerCase()}`) { + throw new Error( + `Expected recovered public key to match runWithSessionSigs.publicKey` + ); + } + if (recoveredPubKey !== `0x${alice.pkp.publicKey.toLowerCase()}`) { + throw new Error( + `Expected recovered public key to match alice.pkp.publicKey` + ); + } + log('\u2705 testUseEoaSessionSigsToPkpSign'); +}; + +// local-tests/tests/testUsePkpSessionSigsToExecuteJsSigning.ts +init_shim(); + +// local-tests/setup/session-sigs/get-pkp-session-sigs.ts +init_shim(); +var getPkpSessionSigs = async ( + devEnv, + alice, + resourceAbilityRequests, + expiration +) => { + const centralisation = + CENTRALISATION_BY_NETWORK[devEnv.litNodeClient.config.litNetwork]; + if (centralisation === 'decentralised') { + console.warn( + 'Decentralised network detected. Adding superCapacityDelegationAuthSig to eoaSessionSigs' + ); + } + const _resourceAbilityRequests = resourceAbilityRequests || [ + { + resource: new LitPKPResource('*'), + ability: LIT_ABILITY.PKPSigning, + }, + { + resource: new LitActionResource('*'), + ability: LIT_ABILITY.LitActionExecution, + }, + ]; + const pkpSessionSigs = await devEnv.litNodeClient.getPkpSessionSigs({ + pkpPublicKey: alice.authMethodOwnedPkp.publicKey, + authMethods: [alice.authMethod], + expiration, + resourceAbilityRequests: _resourceAbilityRequests, + ...(centralisation === 'decentralised' && { + capabilityAuthSigs: [devEnv.superCapacityDelegationAuthSig], + }), + }); + log('[getPkpSessionSigs]: ', pkpSessionSigs); + return pkpSessionSigs; +}; + +// local-tests/tests/testUsePkpSessionSigsToExecuteJsSigning.ts +var testUsePkpSessionSigsToExecuteJsSigning = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const pkpSessionSigs = await getPkpSessionSigs(devEnv, alice); + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: pkpSessionSigs, + code: `(async () => { + const sigShare = await LitActions.signEcdsa({ + toSign: dataToSign, + publicKey, + sigName: "sig", + }); + })();`, + jsParams: { + dataToSign: alice.loveLetter, + publicKey: alice.authMethodOwnedPkp.publicKey, + }, + }); + devEnv.releasePrivateKeyFromUser(alice); + if (!res.signatures.sig.r) { + throw new Error(`Expected "r" in res.signatures.sig`); + } + if (!res.signatures.sig.s) { + throw new Error(`Expected "s" in res.signatures.sig`); + } + if (!res.signatures.sig.dataSigned) { + throw new Error(`Expected "dataSigned" in res.signatures.sig`); + } + if (!res.signatures.sig.publicKey) { + throw new Error(`Expected "publicKey" in res.signatures.sig`); + } + if (!res.signatures.sig.signature.startsWith('0x')) { + throw new Error(`Expected "signature" to start with 0x`); + } + if (isNaN(res.signatures.sig.recid)) { + throw new Error(`Expected "recid" to be parseable as a number`); + } + log('\u2705 res:', res); +}; + +// local-tests/tests/testUsePkpSessionSigsToPkpSign.ts +init_shim(); +var testUsePkpSessionSigsToPkpSign = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const pkpSessionSigs = await getPkpSessionSigs(devEnv, alice); + const res = await devEnv.litNodeClient.pkpSign({ + toSign: alice.loveLetter, + pubKey: alice.authMethodOwnedPkp.publicKey, + sessionSigs: pkpSessionSigs, + }); + devEnv.releasePrivateKeyFromUser(alice); + if (!res.r) { + throw new Error(`Expected "r" in res`); + } + if (!res.s) { + throw new Error(`Expected "s" in res`); + } + if (!res.dataSigned) { + throw new Error(`Expected "dataSigned" in res`); + } + if (!res.publicKey) { + throw new Error(`Expected "publicKey" in res`); + } + if (!res.signature.startsWith('0x')) { + throw new Error(`Expected "signature" to start with 0x`); + } + if (isNaN(res.recid)) { + throw new Error(`Expected "recid" to be parseable as a number`); + } + const signature2 = ethers_exports.utils.joinSignature({ + r: '0x' + res.r, + s: '0x' + res.s, + recoveryParam: res.recid, + }); + const recoveredPubKey = ethers_exports.utils.recoverPublicKey( + alice.loveLetter, + signature2 + ); + if (recoveredPubKey !== `0x${res.publicKey.toLowerCase()}`) { + throw new Error(`Expected recovered public key to match res.publicKey`); + } + if ( + recoveredPubKey !== `0x${alice.authMethodOwnedPkp.publicKey.toLowerCase()}` + ) { + throw new Error( + `Expected recovered public key to match alice.authMethodOwnedPkp.publicKey` + ); + } + log('\u2705 res:', res); +}; + +// local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToPkpSign.ts +init_shim(); + +// local-tests/setup/session-sigs/get-lit-action-session-sigs.ts +init_shim(); +var VALID_SESSION_SIG_LIT_ACTION_CODE = ` +// Works with an AuthSig AuthMethod +if (Lit.Auth.authMethodContexts.some(e => e.authMethodType === 1)) { + LitActions.setResponse({ response: "true" }); +} else { + LitActions.setResponse({ response: "false" }); +} +`; +var INVALID_SESSION_SIG_LIT_ACTION_CODE = ` +(async () => { + let utf8Encode = new TextEncoder(); + const toSign = utf8Encode.encode('This message is exactly 32 bytes'); + const sigShare = await LitActions.signEcdsa({ toSign, publicKey, sigName }); +})(); +`; +var VALID_IPFS_ID = 'QmRf5K7PVi5TWXiJdw7YYtcgpgRY6ufXGr9yYnxBLvLjDp'; +var INVALID_IPFS_ID = 'QmeUByesskboEkLLcE9Hd3bWFZT5Xt53RSauMNTJSVhfqm'; +var getLitActionSessionSigs = async ( + devEnv, + alice, + resourceAbilityRequests +) => { + const centralisation = + CENTRALISATION_BY_NETWORK[devEnv.litNodeClient.config.litNetwork]; + if (centralisation === 'decentralised') { + console.warn( + 'Decentralised network detected. Adding superCapacityDelegationAuthSig to eoaSessionSigs' + ); + } + const _resourceAbilityRequests = resourceAbilityRequests || [ + { + resource: new LitPKPResource('*'), + ability: LIT_ABILITY.PKPSigning, + }, + { + resource: new LitActionResource('*'), + ability: LIT_ABILITY.LitActionExecution, + }, + ]; + const litActionSessionSigs = + await devEnv.litNodeClient.getLitActionSessionSigs({ + pkpPublicKey: alice.authMethodOwnedPkp.publicKey, + authMethods: [alice.authMethod], + resourceAbilityRequests: _resourceAbilityRequests, + litActionCode: Buffer.from(VALID_SESSION_SIG_LIT_ACTION_CODE).toString( + 'base64' + ), + jsParams: { + publicKey: alice.authMethodOwnedPkp.publicKey, + sigName: 'unified-auth-sig', + }, + ...(centralisation === 'decentralised' && { + capabilityAuthSigs: [devEnv.superCapacityDelegationAuthSig], + }), + }); + return litActionSessionSigs; +}; +var getLitActionSessionSigsUsingIpfsId = async ( + devEnv, + alice, + resourceAbilityRequests +) => { + const centralisation = + CENTRALISATION_BY_NETWORK[devEnv.litNodeClient.config.litNetwork]; + if (centralisation === 'decentralised') { + console.warn( + 'Decentralised network detected. Adding superCapacityDelegationAuthSig to eoaSessionSigs' + ); + } + const _resourceAbilityRequests = resourceAbilityRequests || [ + { + resource: new LitPKPResource('*'), + ability: LIT_ABILITY.PKPSigning, + }, + { + resource: new LitActionResource('*'), + ability: LIT_ABILITY.LitActionExecution, + }, + ]; + const litActionSessionSigs = await devEnv.litNodeClient.getPkpSessionSigs({ + pkpPublicKey: alice.authMethodOwnedPkp.publicKey, + authMethods: [alice.authMethod], + resourceAbilityRequests: _resourceAbilityRequests, + litActionIpfsId: VALID_IPFS_ID, + jsParams: { + publicKey: alice.authMethodOwnedPkp.publicKey, + sigName: 'unified-auth-sig', + }, + ...(centralisation === 'decentralised' && { + capabilityAuthSigs: [devEnv.superCapacityDelegationAuthSig], + }), + }); + return litActionSessionSigs; +}; +var getInvalidLitActionSessionSigs = async (devEnv, alice) => { + const litActionSessionSigs = await devEnv.litNodeClient.getPkpSessionSigs({ + pkpPublicKey: alice.authMethodOwnedPkp.publicKey, + authMethods: [alice.authMethod], + resourceAbilityRequests: [ + { + resource: new LitPKPResource('*'), + ability: LIT_ABILITY.PKPSigning, + }, + ], + litActionCode: Buffer.from(INVALID_SESSION_SIG_LIT_ACTION_CODE).toString( + 'base64' + ), + jsParams: { + publicKey: alice.authMethodOwnedPkp.publicKey, + sigName: 'unified-auth-sig', + }, + ipfsOptions: { + overwriteCode: + GLOBAL_OVERWRITE_IPFS_CODE_BY_NETWORK[ + devEnv.litNodeClient.config.litNetwork + ], + }, + }); + return litActionSessionSigs; +}; +var getInvalidLitActionIpfsSessionSigs = async (devEnv, alice) => { + const litActionSessionSigs = await devEnv.litNodeClient.getPkpSessionSigs({ + pkpPublicKey: alice.authMethodOwnedPkp.publicKey, + authMethods: [alice.authMethod], + resourceAbilityRequests: [ + { + resource: new LitPKPResource('*'), + ability: LIT_ABILITY.PKPSigning, + }, + ], + litActionIpfsId: INVALID_IPFS_ID, + jsParams: { + publicKey: alice.authMethodOwnedPkp.publicKey, + sigName: 'unified-auth-sig', + }, + ipfsOptions: { + overwriteCode: + GLOBAL_OVERWRITE_IPFS_CODE_BY_NETWORK[ + devEnv.litNodeClient.config.litNetwork + ], + }, + }); + return litActionSessionSigs; +}; + +// local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToPkpSign.ts +var testUseValidLitActionCodeGeneratedSessionSigsToPkpSign = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice); + const res = await devEnv.litNodeClient.pkpSign({ + toSign: alice.loveLetter, + pubKey: alice.authMethodOwnedPkp.publicKey, + sessionSigs: litActionSessionSigs, + }); + devEnv.releasePrivateKeyFromUser(alice); + if (!res.r) { + throw new Error(`Expected "r" in res`); + } + if (!res.s) { + throw new Error(`Expected "s" in res`); + } + if (!res.dataSigned) { + throw new Error(`Expected "dataSigned" in res`); + } + if (!res.publicKey) { + throw new Error(`Expected "publicKey" in res`); + } + if (!res.signature.startsWith('0x')) { + throw new Error(`Expected "signature" to start with 0x`); + } + if (isNaN(res.recid)) { + throw new Error(`Expected "recid" to be parseable as a number`); + } + const signature2 = ethers_exports.utils.joinSignature({ + r: '0x' + res.r, + s: '0x' + res.s, + recoveryParam: res.recid, + }); + const recoveredPubKey = ethers_exports.utils.recoverPublicKey( + alice.loveLetter, + signature2 + ); + if (recoveredPubKey !== `0x${res.publicKey.toLowerCase()}`) { + throw new Error(`Expected recovered public key to match res.publicKey`); + } + if ( + recoveredPubKey !== `0x${alice.authMethodOwnedPkp.publicKey.toLowerCase()}` + ) { + throw new Error( + `Expected recovered public key to match alice.authMethodOwnedPkp.publicKey` + ); + } + log('\u2705 res:', res); +}; + +// local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigning.ts +init_shim(); +var testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigning = async ( + devEnv +) => { + const alice = await devEnv.createRandomPerson(); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice, [ + { + resource: new LitPKPResource('*'), + ability: LIT_ABILITY.PKPSigning, + }, + { + resource: new LitActionResource('*'), + ability: LIT_ABILITY.LitActionExecution, + }, + ]); + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: litActionSessionSigs, + code: `(async () => { + const sigShare = await LitActions.signEcdsa({ + toSign: dataToSign, + publicKey, + sigName: "sig", + }); + })();`, + jsParams: { + dataToSign: alice.loveLetter, + publicKey: alice.authMethodOwnedPkp.publicKey, + }, + }); + devEnv.releasePrivateKeyFromUser(alice); + if (!res.signatures.sig.r) { + throw new Error(`Expected "r" in res.signatures.sig`); + } + if (!res.signatures.sig.s) { + throw new Error(`Expected "s" in res.signatures.sig`); + } + if (!res.signatures.sig.dataSigned) { + throw new Error(`Expected "dataSigned" in res.signatures.sig`); + } + if (!res.signatures.sig.publicKey) { + throw new Error(`Expected "publicKey" in res.signatures.sig`); + } + log('\u2705 res:', res); +}; + +// local-tests/tests/testUseValidLitActionIpfsCodeGeneratedSessionSigsToExecuteJsSigning.ts +init_shim(); +var testUseValidLitActionIpfsCodeGeneratedSessionSigsToExecuteJsSigning = + async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const litActionSessionSigs = await getLitActionSessionSigsUsingIpfsId( + devEnv, + alice, + [ + { + resource: new LitPKPResource('*'), + ability: LIT_ABILITY.PKPSigning, + }, + { + resource: new LitActionResource('*'), + ability: LIT_ABILITY.LitActionExecution, + }, + ] + ); + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: litActionSessionSigs, + code: `(async () => { + const sigShare = await LitActions.signEcdsa({ + toSign: dataToSign, + publicKey, + sigName: "sig", + }); + })();`, + jsParams: { + dataToSign: alice.loveLetter, + publicKey: alice.authMethodOwnedPkp.publicKey, + }, + }); + devEnv.releasePrivateKeyFromUser(alice); + console.log('\u2705 res:', res); + if (!res.signatures.sig.r) { + throw new Error(`Expected "r" in res.signatures.sig`); + } + if (!res.signatures.sig.s) { + throw new Error(`Expected "s" in res.signatures.sig`); + } + if (!res.signatures.sig.dataSigned) { + throw new Error(`Expected "dataSigned" in res.signatures.sig`); + } + if (!res.signatures.sig.publicKey) { + throw new Error(`Expected "publicKey" in res.signatures.sig`); + } + log('\u2705 res:', res); + }; + +// local-tests/tests/testUseEoaSessionSigsToExecuteJsSigningInParallel.ts +init_shim(); +var testUseEoaSessionSigsToExecuteJsSigningInParallel = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const eoaSessionSigs = await getEoaSessionSigs(devEnv, alice); + const fn = async (index) => { + log(`Index: ${index}`); + return await devEnv.litNodeClient.executeJs({ + sessionSigs: eoaSessionSigs, + code: `(async () => { + const sigShare = await LitActions.signEcdsa({ + toSign: dataToSign, + publicKey, + sigName: "sig", + }); + })();`, + jsParams: { + dataToSign: alice.loveLetter, + publicKey: alice.pkp.publicKey, + }, + }); + }; + const res = await Promise.all([fn(1), fn(2), fn(3)]); + devEnv.releasePrivateKeyFromUser(alice); + log('res:', res); + res.forEach((r3) => { + if (!r3.signatures.sig.r) { + throw new Error(`Expected "r" in res.signatures.sig`); + } + if (!r3.signatures.sig.s) { + throw new Error(`Expected "s" in res.signatures.sig`); + } + if (!r3.signatures.sig.dataSigned) { + throw new Error(`Expected "dataSigned" in res.signatures.sig`); + } + if (!r3.signatures.sig.publicKey) { + throw new Error(`Expected "publicKey" in res.signatures.sig`); + } + if (!r3.signatures.sig.signature.startsWith('0x')) { + throw new Error(`Expected "signature" to start with 0x`); + } + if (isNaN(r3.signatures.sig.recid)) { + throw new Error(`Expected "recid" to be parseable as a number`); + } + }); + log('\u2705 testUseEoaSessionSigsToExecuteJsSigningInParallel'); +}; + +// local-tests/tests/testUseEoaSessionSigsToExecuteJsClaimKeys.ts +init_shim(); +var testUseEoaSessionSigsToExecuteJsClaimKeys = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const eoaSessionSigs = await getEoaSessionSigs(devEnv, alice); + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: eoaSessionSigs, + code: `(async () => { + Lit.Actions.claimKey({keyId: "foo"}); + })();`, + }); + devEnv.releasePrivateKeyFromUser(alice); + console.log('res:', res); + if (!res.claims.foo) { + throw new Error(`Expected "foo" in res.claims`); + } + if (!res.claims.foo.derivedKeyId) { + throw new Error(`Expected "derivedKeyId" in res.claims.foo`); + } + if (!res.claims.foo.signatures) { + throw new Error(`Expected "signatures" in res.claims.foo`); + } + res.claims.foo.signatures.forEach((sig) => { + if (!sig.r) { + throw new Error(`Expected "r" in sig`); + } + if (!sig.s) { + throw new Error(`Expected "s" in sig`); + } + if (!sig.v) { + throw new Error(`Expected "v" in sig`); + } + }); + log('\u2705 testUseEoaSessionSigsToExecuteJsClaimKeys'); +}; + +// local-tests/tests/testUseEoaSessionSigsToExecuteJsClaimMultipleKeys.ts +init_shim(); +var testUseEoaSessionSigsToExecuteJsClaimMultipleKeys = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const eoaSessionSigs = await getEoaSessionSigs(devEnv, alice); + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: eoaSessionSigs, + code: `(async () => { + Lit.Actions.claimKey({keyId: "foo"}); + Lit.Actions.claimKey({keyId: "bar"}); + })();`, + }); + devEnv.releasePrivateKeyFromUser(alice); + if (!res.claims.foo) { + throw new Error(`Expected "foo" in res.claims`); + } + if (!res.claims.foo.derivedKeyId) { + throw new Error(`Expected "derivedKeyId" in res.claims.foo`); + } + if (!res.claims.foo.signatures) { + throw new Error(`Expected "signatures" in res.claims.foo`); + } + res.claims.foo.signatures.forEach((sig) => { + if (!sig.r) { + throw new Error(`Expected "r" in sig`); + } + if (!sig.s) { + throw new Error(`Expected "s" in sig`); + } + if (!sig.v) { + throw new Error(`Expected "v" in sig`); + } + }); +}; + +// local-tests/tests/testUseEoaSessionSigsToExecuteJsJsonResponse.ts +init_shim(); +var testUseEoaSessionSigsToExecuteJsJsonResponse = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const eoaSessionSigs = await getEoaSessionSigs(devEnv, alice); + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: eoaSessionSigs, + code: `(async () => { + console.log('hello world') + + LitActions.setResponse({ + response: JSON.stringify({hello: 'world'}) + }); + + })();`, + }); + devEnv.releasePrivateKeyFromUser(alice); + if (!res.response) { + throw new Error(`Expected "response" in res`); + } + if (!res.response.startsWith('{')) { + throw new Error(`Expected "response" to start with {`); + } + if (!res.response.endsWith('}')) { + throw new Error(`Expected "response" to end with }`); + } + if (!res.logs) { + throw new Error(`Expected "logs" in res`); + } + if (!res.logs.includes('hello world')) { + throw new Error(`Expected "logs" to include 'hello world'`); + } + if (!res.success) { + throw new Error(`Expected "success" in res`); + } + if (res.success !== true) { + throw new Error(`Expected "success" to be true`); + } +}; + +// local-tests/tests/testUseEoaSessionSigsToExecuteJsConsoleLog.ts +init_shim(); +var testUseEoaSessionSigsToExecuteJsConsoleLog = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const eoaSessionSigs = await getEoaSessionSigs(devEnv, alice); + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: eoaSessionSigs, + code: `(async () => { + console.log('hello world') + })();`, + }); + devEnv.releasePrivateKeyFromUser(alice); + console.log('res:', res); + if (res.response) { + throw new Error(`Expected "response" to be falsy`); + } + if (!res.logs) { + throw new Error(`Expected "logs" in res`); + } + if (!res.logs.includes('hello world')) { + throw new Error(`Expected "logs" to include 'hello world'`); + } + if (!res.success) { + throw new Error(`Expected "success" in res`); + } +}; + +// local-tests/tests/testUseEoaSessionSigsToEncryptDecryptString.ts +init_shim(); + +// local-tests/setup/accs/accs.ts +init_shim(); +var AccessControlConditions; +((AccessControlConditions2) => { + AccessControlConditions2.getEmvBasicAccessControlConditions = ({ + userAddress, + }) => { + return [ + { + contractAddress: '', + standardContractType: '', + chain: 'ethereum', + method: '', + parameters: [':userAddress'], + returnValueTest: { + comparator: '=', + value: userAddress, + }, + }, + ]; + }; + AccessControlConditions2.getSolBasicAccessControlConditions = ({ + userAddress, + }) => { + return [ + { + method: '', + params: [':userAddress'], + pdaParams: [], + pdaInterface: { offset: 0, fields: {} }, + pdaKey: '', + chain: 'solana', + returnValueTest: { + key: '', + comparator: '=', + value: userAddress, + }, + }, + ]; + }; + AccessControlConditions2.getCosmosBasicAccessControlConditions = ({ + userAddress, + }) => { + return [ + { + conditionType: 'cosmos', + path: ':userAddress', + chain: 'cosmos', + returnValueTest: { + key: '', + comparator: '=', + value: userAddress, + }, + }, + ]; + }; +})(AccessControlConditions || (AccessControlConditions = {})); + +// packages/encryption/src/index.ts +init_shim(); + +// packages/encryption/src/lib/encryption.ts +init_shim(); +var encryptUint8Array = async (params, litNodeClient) => { + const paramsIsSafe = safeParams({ + functionName: 'encryptUint8Array', + params, + }); + if (paramsIsSafe.type === EITHER_TYPE.ERROR) + throw new InvalidParamType( + { + info: { + params, + }, + }, + 'Invalid params' + ); + return litNodeClient.encrypt({ + ...params, + }); +}; +var decryptToUint8Array = async (params, litNodeClient) => { + const paramsIsSafe = safeParams({ + functionName: 'decrypt', + params, + }); + if (paramsIsSafe.type === EITHER_TYPE.ERROR) + throw new InvalidParamType( + { + info: { + params, + function: 'decryptToUint8Array', + }, + cause: paramsIsSafe.result, + }, + 'Invalid params' + ); + const { decryptedData } = await litNodeClient.decrypt(params); + return decryptedData; +}; +var encryptString = async (params, litNodeClient) => { + const paramsIsSafe = safeParams({ + functionName: 'encryptString', + params, + }); + if (paramsIsSafe.type === EITHER_TYPE.ERROR) + throw new InvalidParamType( + { + info: { + params, + function: 'encryptString', + }, + cause: paramsIsSafe.result, + }, + 'Invalid params' + ); + return litNodeClient.encrypt({ + ...params, + dataToEncrypt: uint8arrayFromString(params.dataToEncrypt, 'utf8'), + }); +}; +var decryptToString = async (params, litNodeClient) => { + const paramsIsSafe = safeParams({ + functionName: 'decrypt', + params, + }); + if (paramsIsSafe.type === EITHER_TYPE.ERROR) + throw new InvalidParamType( + { + info: { + params, + function: 'decryptToString', + }, + cause: paramsIsSafe.result, + }, + 'Invalid params' + ); + const { decryptedData } = await litNodeClient.decrypt(params); + return uint8arrayToString(decryptedData, 'utf8'); +}; +var decryptToFile = async (params, litNodeClient) => { + const paramsIsSafe = safeParams({ + functionName: 'decrypt', + params, + }); + if (paramsIsSafe.type === EITHER_TYPE.ERROR) + throw new InvalidParamType( + { + info: { + params, + function: 'decryptToFile', + }, + cause: paramsIsSafe.result, + }, + 'Invalid params' + ); + const { decryptedData } = await litNodeClient.decrypt(params); + return decryptedData; +}; + +// local-tests/tests/testUseEoaSessionSigsToEncryptDecryptString.ts +var testUseEoaSessionSigsToEncryptDecryptString = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const accs = AccessControlConditions.getEmvBasicAccessControlConditions({ + userAddress: alice.wallet.address, + }); + const encryptRes = await encryptString( + { + accessControlConditions: accs, + dataToEncrypt: 'Hello world', + }, + devEnv.litNodeClient + ); + log('encryptRes:', encryptRes); + if (!encryptRes.ciphertext) { + throw new Error(`Expected "ciphertext" in encryptRes`); + } + if (!encryptRes.dataToEncryptHash) { + throw new Error(`Expected "dataToEncryptHash" to in encryptRes`); + } + const accsResourceString = + await LitAccessControlConditionResource.generateResourceString( + accs, + encryptRes.dataToEncryptHash + ); + const eoaSessionSigs2 = await getEoaSessionSigs(devEnv, alice, [ + { + resource: new LitAccessControlConditionResource(accsResourceString), + ability: LIT_ABILITY.AccessControlConditionDecryption, + }, + ]); + const decryptRes = await decryptToString( + { + accessControlConditions: accs, + ciphertext: encryptRes.ciphertext, + dataToEncryptHash: encryptRes.dataToEncryptHash, + sessionSigs: eoaSessionSigs2, + chain: 'ethereum', + }, + devEnv.litNodeClient + ); + devEnv.releasePrivateKeyFromUser(alice); + if (decryptRes !== 'Hello world') { + throw new Error( + `Expected decryptRes to be 'Hello world' but got ${decryptRes}` + ); + } +}; + +// local-tests/tests/testUseEoaSessionSigsToEncryptDecryptUint8Array.ts +init_shim(); +var testUseEoaSessionSigsToEncryptDecryptUint8Array = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const accs = AccessControlConditions.getEmvBasicAccessControlConditions({ + userAddress: alice.wallet.address, + }); + const message = 'Hello world'; + const messageToEncrypt = uint8arrayFromString(message, 'utf8'); + const encryptRes = await encryptUint8Array( + { + accessControlConditions: accs, + dataToEncrypt: messageToEncrypt, + }, + devEnv.litNodeClient + ); + log('encryptRes:', encryptRes); + if (!encryptRes.ciphertext) { + throw new Error(`Expected "ciphertext" in encryptRes`); + } + if (!encryptRes.dataToEncryptHash) { + throw new Error(`Expected "dataToEncryptHash" to in encryptRes`); + } + const accsResourceString = + await LitAccessControlConditionResource.generateResourceString( + accs, + encryptRes.dataToEncryptHash + ); + const eoaSessionSigs2 = await getEoaSessionSigs(devEnv, alice, [ + { + resource: new LitAccessControlConditionResource(accsResourceString), + ability: LIT_ABILITY.AccessControlConditionDecryption, + }, + ]); + const decryptRes = await decryptToUint8Array( + { + accessControlConditions: accs, + ciphertext: encryptRes.ciphertext, + dataToEncryptHash: encryptRes.dataToEncryptHash, + sessionSigs: eoaSessionSigs2, + chain: 'ethereum', + }, + devEnv.litNodeClient + ); + const decryptResString = uint8arrayToString(decryptRes, 'utf8'); + devEnv.releasePrivateKeyFromUser(alice); + if (decryptResString !== message) { + throw new Error( + `Expected decryptRes to be 'Hello world' but got ${decryptRes}` + ); + } +}; + +// local-tests/tests/testUsePkpSessionSigsToEncryptDecryptString.ts +init_shim(); +var testUsePkpSessionSigsToEncryptDecryptString = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const accs = AccessControlConditions.getEmvBasicAccessControlConditions({ + userAddress: alice.authMethodOwnedPkp.ethAddress, + }); + const encryptRes = await encryptString( + { + accessControlConditions: accs, + dataToEncrypt: 'Hello world', + }, + devEnv.litNodeClient + ); + log('encryptRes:', encryptRes); + if (!encryptRes.ciphertext) { + throw new Error(`Expected "ciphertext" in encryptRes`); + } + if (!encryptRes.dataToEncryptHash) { + throw new Error(`Expected "dataToEncryptHash" to in encryptRes`); + } + const accsResourceString = + await LitAccessControlConditionResource.generateResourceString( + accs, + encryptRes.dataToEncryptHash + ); + const pkpSessionSigs2 = await getPkpSessionSigs(devEnv, alice, [ + { + resource: new LitAccessControlConditionResource(accsResourceString), + ability: LIT_ABILITY.AccessControlConditionDecryption, + }, + ]); + const decryptRes = await decryptToString( + { + accessControlConditions: accs, + ciphertext: encryptRes.ciphertext, + dataToEncryptHash: encryptRes.dataToEncryptHash, + sessionSigs: pkpSessionSigs2, + chain: 'ethereum', + }, + devEnv.litNodeClient + ); + devEnv.releasePrivateKeyFromUser(alice); + if (decryptRes !== 'Hello world') { + throw new Error( + `Expected decryptRes to be 'Hello world' but got ${decryptRes}` + ); + } +}; + +// local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptString.ts +init_shim(); +var testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptString = + async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const accs = AccessControlConditions.getEmvBasicAccessControlConditions({ + userAddress: alice.authMethodOwnedPkp.ethAddress, + }); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice); + const encryptRes = await encryptString( + { + accessControlConditions: accs, + dataToEncrypt: 'Hello world', + }, + devEnv.litNodeClient + ); + log('encryptRes:', encryptRes); + if (!encryptRes.ciphertext) { + throw new Error(`Expected "ciphertext" in encryptRes`); + } + if (!encryptRes.dataToEncryptHash) { + throw new Error(`Expected "dataToEncryptHash" to in encryptRes`); + } + const accsResourceString = + await LitAccessControlConditionResource.generateResourceString( + accs, + encryptRes.dataToEncryptHash + ); + const litActionSessionSigs2 = await getLitActionSessionSigs(devEnv, alice, [ + { + resource: new LitAccessControlConditionResource(accsResourceString), + ability: LIT_ABILITY.AccessControlConditionDecryption, + }, + ]); + const decryptRes = await decryptToString( + { + accessControlConditions: accs, + ciphertext: encryptRes.ciphertext, + dataToEncryptHash: encryptRes.dataToEncryptHash, + sessionSigs: litActionSessionSigs2, + chain: 'ethereum', + }, + devEnv.litNodeClient + ); + devEnv.releasePrivateKeyFromUser(alice); + if (decryptRes !== 'Hello world') { + throw new Error( + `Expected decryptRes to be 'Hello world' but got ${decryptRes}` + ); + } + }; + +// local-tests/tests/testUseInvalidLitActionCodeToGenerateSessionSigs.ts +init_shim(); +var testUseInvalidLitActionCodeToGenerateSessionSigs = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + await getInvalidLitActionSessionSigs(devEnv, alice); + } catch (e2) { + console.log('\u274C This error is expected', e2); + if ( + e2.message === + 'There was an error getting the signing shares from the nodes' + ) { + console.log( + '\u2705 testUseInvalidLitActionCodeToGenerateSessionSigs passed' + ); + } else { + throw e2; + } + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testUseEoaSessionSigsToEncryptDecryptFile.ts +init_shim(); +var testUseEoaSessionSigsToEncryptDecryptFile = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const message = 'Hello world'; + const blob = new Blob([message], { type: 'text/plain' }); + const blobArray = new Uint8Array(await blob.arrayBuffer()); + const accs = AccessControlConditions.getEmvBasicAccessControlConditions({ + userAddress: alice.wallet.address, + }); + const encryptRes = await encryptString( + { + accessControlConditions: accs, + dataToEncrypt: 'Hello world', + }, + devEnv.litNodeClient + ); + log('encryptRes:', encryptRes); + if (!encryptRes.ciphertext) { + throw new Error(`Expected "ciphertext" in encryptRes`); + } + if (!encryptRes.dataToEncryptHash) { + throw new Error(`Expected "dataToEncryptHash" to in encryptRes`); + } + const accsResourceString = + await LitAccessControlConditionResource.generateResourceString( + accs, + encryptRes.dataToEncryptHash + ); + const eoaSessionSigs2 = await getEoaSessionSigs(devEnv, alice, [ + { + resource: new LitAccessControlConditionResource(accsResourceString), + ability: LIT_ABILITY.AccessControlConditionDecryption, + }, + ]); + const decriptedFile = await decryptToFile( + { + accessControlConditions: accs, + ciphertext: encryptRes.ciphertext, + dataToEncryptHash: encryptRes.dataToEncryptHash, + sessionSigs: eoaSessionSigs2, + chain: 'ethereum', + }, + devEnv.litNodeClient + ); + devEnv.releasePrivateKeyFromUser(alice); + if (blobArray.length !== decriptedFile.length) { + throw new Error( + `decrypted file should match the original file but received ${decriptedFile}` + ); + } + for (let i2 = 0; i2 < blobArray.length; i2++) { + if (blobArray[i2] !== decriptedFile[i2]) { + throw new Error(`decrypted file should match the original file`); + } + } + console.log('decriptedFile:', decriptedFile); +}; + +// local-tests/tests/testUsePkpSessionSigsToExecuteJsSigningInParallel.ts +init_shim(); +var testUsePkpSessionSigsToExecuteJsSigningInParallel = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const pkpSessionSigs = await getPkpSessionSigs(devEnv, alice); + const fn = async (index) => { + log(`Index: ${index}`); + return await devEnv.litNodeClient.executeJs({ + sessionSigs: pkpSessionSigs, + code: `(async () => { + const sigShare = await LitActions.signEcdsa({ + toSign: dataToSign, + publicKey, + sigName: "sig", + }); + })();`, + jsParams: { + dataToSign: alice.loveLetter, + publicKey: alice.authMethodOwnedPkp.publicKey, + }, + }); + }; + devEnv.releasePrivateKeyFromUser(alice); + const res = await Promise.all([fn(1), fn(2), fn(3)]); + log('res:', res); + res.forEach((r3) => { + if (!r3.signatures.sig.r) { + throw new Error(`Expected "r" in res.signatures.sig`); + } + if (!r3.signatures.sig.s) { + throw new Error(`Expected "s" in res.signatures.sig`); + } + if (!r3.signatures.sig.dataSigned) { + throw new Error(`Expected "dataSigned" in res.signatures.sig`); + } + if (!r3.signatures.sig.publicKey) { + throw new Error(`Expected "publicKey" in res.signatures.sig`); + } + if (!r3.signatures.sig.signature.startsWith('0x')) { + throw new Error(`Expected "signature" to start with 0x`); + } + if (isNaN(r3.signatures.sig.recid)) { + throw new Error(`Expected "recid" to be parseable as a number`); + } + }); + log('\u2705 testUsePkpSessionSigsToExecuteJsSigningInParallel'); +}; + +// local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigningInParallel.ts +init_shim(); +var testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigningInParallel = + async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice); + const fn = async (index) => { + log(`Index: ${index}`); + return await devEnv.litNodeClient.executeJs({ + sessionSigs: litActionSessionSigs, + code: `(async () => { + const sigShare = await LitActions.signEcdsa({ + toSign: dataToSign, + publicKey, + sigName: "sig", + }); + })();`, + jsParams: { + dataToSign: alice.loveLetter, + publicKey: alice.authMethodOwnedPkp.publicKey, + }, + }); + }; + devEnv.releasePrivateKeyFromUser(alice); + const res = await Promise.all([fn(1), fn(2), fn(3)]); + log('res:', res); + res.forEach((r3) => { + if (!r3.signatures.sig.r) { + throw new Error(`Expected "r" in res.signatures.sig`); + } + if (!r3.signatures.sig.s) { + throw new Error(`Expected "s" in res.signatures.sig`); + } + if (!r3.signatures.sig.dataSigned) { + throw new Error(`Expected "dataSigned" in res.signatures.sig`); + } + if (!r3.signatures.sig.publicKey) { + throw new Error(`Expected "publicKey" in res.signatures.sig`); + } + if (!r3.signatures.sig.signature.startsWith('0x')) { + throw new Error(`Expected "signature" to start with 0x`); + } + if (isNaN(r3.signatures.sig.recid)) { + throw new Error(`Expected "recid" to be parseable as a number`); + } + }); + log('\u2705 testUsePkpSessionSigsToExecuteJsSigningInParallel'); + }; + +// local-tests/tests/testUsePkpSessionSigsToExecuteJsClaimKeys.ts +init_shim(); +var testUsePkpSessionSigsToExecuteJsClaimKeys = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const pkpSessionSigs = await getPkpSessionSigs(devEnv, alice); + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: pkpSessionSigs, + code: `(async () => { + Lit.Actions.claimKey({keyId: "foo"}); + })();`, + }); + devEnv.releasePrivateKeyFromUser(alice); + console.log('res:', res); + if (!res.claims.foo) { + throw new Error(`Expected "foo" in res.claims`); + } + if (!res.claims.foo.derivedKeyId) { + throw new Error(`Expected "derivedKeyId" in res.claims.foo`); + } + if (!res.claims.foo.signatures) { + throw new Error(`Expected "signatures" in res.claims.foo`); + } + res.claims.foo.signatures.forEach((sig) => { + if (!sig.r) { + throw new Error(`Expected "r" in sig`); + } + if (!sig.s) { + throw new Error(`Expected "s" in sig`); + } + if (!sig.v) { + throw new Error(`Expected "v" in sig`); + } + }); +}; + +// local-tests/tests/testUsePkpSessionSigsToExecuteJsClaimMultipleKeys.ts +init_shim(); +var testUsePkpSessionSigsToExecuteJsClaimMultipleKeys = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const pkpSessionSigs = await getPkpSessionSigs(devEnv, alice); + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: pkpSessionSigs, + code: `(async () => { + Lit.Actions.claimKey({keyId: "foo"}); + Lit.Actions.claimKey({keyId: "bar"}); + })();`, + }); + devEnv.releasePrivateKeyFromUser(alice); + if (!res.claims.foo) { + throw new Error(`Expected "foo" in res.claims`); + } + if (!res.claims.foo.derivedKeyId) { + throw new Error(`Expected "derivedKeyId" in res.claims.foo`); + } + if (!res.claims.foo.signatures) { + throw new Error(`Expected "signatures" in res.claims.foo`); + } + res.claims.foo.signatures.forEach((sig) => { + if (!sig.r) { + throw new Error(`Expected "r" in sig`); + } + if (!sig.s) { + throw new Error(`Expected "s" in sig`); + } + if (!sig.v) { + throw new Error(`Expected "v" in sig`); + } + }); +}; + +// local-tests/tests/testUsePkpSessionSigsToExecuteJsJsonResponse.ts +init_shim(); +var testUsePkpSessionSigsToExecuteJsJsonResponse = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const pkpSessionSigs = await getPkpSessionSigs(devEnv, alice); + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: pkpSessionSigs, + code: `(async () => { + console.log('hello world') + + LitActions.setResponse({ + response: JSON.stringify({hello: 'world'}) + }); + + })();`, + }); + devEnv.releasePrivateKeyFromUser(alice); + if (!res.response) { + throw new Error(`Expected "response" in res`); + } + if (!res.response.startsWith('{')) { + throw new Error(`Expected "response" to start with {`); + } + if (!res.response.endsWith('}')) { + throw new Error(`Expected "response" to end with }`); + } + if (!res.logs) { + throw new Error(`Expected "logs" in res`); + } + if (!res.logs.includes('hello world')) { + throw new Error(`Expected "logs" to include 'hello world'`); + } + if (!res.success) { + throw new Error(`Expected "success" in res`); + } + if (res.success !== true) { + throw new Error(`Expected "success" to be true`); + } +}; + +// local-tests/tests/testUsePkpSessionSigsToExecuteJsConsoleLog.ts +init_shim(); +var testUsePkpSessionSigsToExecuteJsConsoleLog = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const pkpSessionSigs = await getPkpSessionSigs(devEnv, alice); + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: pkpSessionSigs, + code: `(async () => { + console.log('hello world') + })();`, + }); + devEnv.releasePrivateKeyFromUser(alice); + if (res.response) { + throw new Error(`Expected "response" to be falsy`); + } + if (!res.logs) { + throw new Error(`Expected "logs" in res`); + } + if (!res.logs.includes('hello world')) { + throw new Error(`Expected "logs" to include 'hello world'`); + } + if (!res.success) { + throw new Error(`Expected "success" in res`); + } +}; + +// local-tests/tests/testUsePkpSessionSigsToEncryptDecryptFile.ts +init_shim(); +var testUsePkpSessionSigsToEncryptDecryptFile = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const message = 'Hello world'; + const blob = new Blob([message], { type: 'text/plain' }); + const blobArray = new Uint8Array(await blob.arrayBuffer()); + const accs = AccessControlConditions.getEmvBasicAccessControlConditions({ + userAddress: alice.authMethodOwnedPkp.ethAddress, + }); + const encryptRes = await encryptString( + { + accessControlConditions: accs, + dataToEncrypt: 'Hello world', + }, + devEnv.litNodeClient + ); + log('encryptRes:', encryptRes); + if (!encryptRes.ciphertext) { + throw new Error(`Expected "ciphertext" in encryptRes`); + } + if (!encryptRes.dataToEncryptHash) { + throw new Error(`Expected "dataToEncryptHash" to in encryptRes`); + } + const accsResourceString = + await LitAccessControlConditionResource.generateResourceString( + accs, + encryptRes.dataToEncryptHash + ); + const pkpSessionSigs2 = await getPkpSessionSigs(devEnv, alice, [ + { + resource: new LitAccessControlConditionResource(accsResourceString), + ability: LIT_ABILITY.AccessControlConditionDecryption, + }, + ]); + const decriptedFile = await decryptToFile( + { + accessControlConditions: accs, + ciphertext: encryptRes.ciphertext, + dataToEncryptHash: encryptRes.dataToEncryptHash, + sessionSigs: pkpSessionSigs2, + chain: 'ethereum', + }, + devEnv.litNodeClient + ); + devEnv.releasePrivateKeyFromUser(alice); + if (blobArray.length !== decriptedFile.length) { + throw new Error( + `decrypted file should match the original file but received ${decriptedFile}` + ); + } + for (let i2 = 0; i2 < blobArray.length; i2++) { + if (blobArray[i2] !== decriptedFile[i2]) { + throw new Error(`decrypted file should match the original file`); + } + } + console.log('decriptedFile:', decriptedFile); +}; + +// local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimKeys.ts +init_shim(); +var testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimKeys = async ( + devEnv +) => { + const alice = await devEnv.createRandomPerson(); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice, [ + { + resource: new LitPKPResource('*'), + ability: LIT_ABILITY.PKPSigning, + }, + { + resource: new LitActionResource('*'), + ability: LIT_ABILITY.LitActionExecution, + }, + ]); + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: litActionSessionSigs, + code: `(async () => { + Lit.Actions.claimKey({keyId: "foo"}); + Lit.Actions.claimKey({keyId: "bar"}); + })();`, + }); + devEnv.releasePrivateKeyFromUser(alice); + if (!res.claims.foo) { + throw new Error(`Expected "foo" in res.claims`); + } + if (!res.claims.foo.derivedKeyId) { + throw new Error(`Expected "derivedKeyId" in res.claims.foo`); + } + if (!res.claims.foo.signatures) { + throw new Error(`Expected "signatures" in res.claims.foo`); + } + res.claims.foo.signatures.forEach((sig) => { + if (!sig.r) { + throw new Error(`Expected "r" in sig`); + } + if (!sig.s) { + throw new Error(`Expected "s" in sig`); + } + if (!sig.v) { + throw new Error(`Expected "v" in sig`); + } + }); +}; + +// local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimMultipleKeys.ts +init_shim(); +var testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimMultipleKeys = + async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice); + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: litActionSessionSigs, + code: `(async () => { + Lit.Actions.claimKey({keyId: "foo"}); + Lit.Actions.claimKey({keyId: "bar"}); + })();`, + }); + devEnv.releasePrivateKeyFromUser(alice); + if (!res.claims.foo) { + throw new Error(`Expected "foo" in res.claims`); + } + if (!res.claims.foo.derivedKeyId) { + throw new Error(`Expected "derivedKeyId" in res.claims.foo`); + } + if (!res.claims.foo.signatures) { + throw new Error(`Expected "signatures" in res.claims.foo`); + } + res.claims.foo.signatures.forEach((sig) => { + if (!sig.r) { + throw new Error(`Expected "r" in sig`); + } + if (!sig.s) { + throw new Error(`Expected "s" in sig`); + } + if (!sig.v) { + throw new Error(`Expected "v" in sig`); + } + }); + }; + +// local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsJsonResponse.ts +init_shim(); +var testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsJsonResponse = + async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice); + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: litActionSessionSigs, + code: `(async () => { + console.log('hello world') + + LitActions.setResponse({ + response: JSON.stringify({hello: 'world'}) + }); + + })();`, + }); + devEnv.releasePrivateKeyFromUser(alice); + if (!res.response) { + throw new Error(`Expected "response" in res`); + } + if (!res.response.startsWith('{')) { + throw new Error(`Expected "response" to start with {`); + } + if (!res.response.endsWith('}')) { + throw new Error(`Expected "response" to end with }`); + } + if (!res.logs) { + throw new Error(`Expected "logs" in res`); + } + if (!res.logs.includes('hello world')) { + throw new Error(`Expected "logs" to include 'hello world'`); + } + if (!res.success) { + throw new Error(`Expected "success" in res`); + } + if (res.success !== true) { + throw new Error(`Expected "success" to be true`); + } + }; + +// local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsConsoleLog.ts +init_shim(); +var testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsConsoleLog = async ( + devEnv +) => { + const alice = await devEnv.createRandomPerson(); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice, [ + { + resource: new LitPKPResource('*'), + ability: LIT_ABILITY.PKPSigning, + }, + { + resource: new LitActionResource('*'), + ability: LIT_ABILITY.LitActionExecution, + }, + ]); + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: litActionSessionSigs, + code: `(async () => { + console.log('hello world') + })();`, + }); + devEnv.releasePrivateKeyFromUser(alice); + console.log('res:', res); + if (res.response) { + throw new Error(`Expected "response" to be falsy`); + } + if (!res.logs) { + throw new Error(`Expected "logs" in res`); + } + if (!res.logs.includes('hello world')) { + throw new Error(`Expected "logs" to include 'hello world'`); + } + if (!res.success) { + throw new Error(`Expected "success" in res`); + } +}; + +// local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptFile.ts +init_shim(); +var testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptFile = async ( + devEnv +) => { + const alice = await devEnv.createRandomPerson(); + const message = 'Hello world'; + const blob = new Blob([message], { type: 'text/plain' }); + const blobArray = new Uint8Array(await blob.arrayBuffer()); + const accs = AccessControlConditions.getEmvBasicAccessControlConditions({ + userAddress: alice.authMethodOwnedPkp.ethAddress, + }); + const encryptRes = await encryptString( + { + accessControlConditions: accs, + dataToEncrypt: 'Hello world', + }, + devEnv.litNodeClient + ); + log('encryptRes:', encryptRes); + if (!encryptRes.ciphertext) { + throw new Error(`Expected "ciphertext" in encryptRes`); + } + if (!encryptRes.dataToEncryptHash) { + throw new Error(`Expected "dataToEncryptHash" to in encryptRes`); + } + const accsResourceString = + await LitAccessControlConditionResource.generateResourceString( + accs, + encryptRes.dataToEncryptHash + ); + const pkpSessionSigs2 = await getPkpSessionSigs(devEnv, alice, [ + { + resource: new LitAccessControlConditionResource(accsResourceString), + ability: LIT_ABILITY.AccessControlConditionDecryption, + }, + ]); + const decriptedFile = await decryptToFile( + { + accessControlConditions: accs, + ciphertext: encryptRes.ciphertext, + dataToEncryptHash: encryptRes.dataToEncryptHash, + sessionSigs: pkpSessionSigs2, + chain: 'ethereum', + }, + devEnv.litNodeClient + ); + devEnv.releasePrivateKeyFromUser(alice); + if (blobArray.length !== decriptedFile.length) { + throw new Error( + `decrypted file should match the original file but received ${decriptedFile}` + ); + } + for (let i2 = 0; i2 < blobArray.length; i2++) { + if (blobArray[i2] !== decriptedFile[i2]) { + throw new Error(`decrypted file should match the original file`); + } + } + console.log('decriptedFile:', decriptedFile); +}; + +// local-tests/tests/testUseValidLitActionIpfsCodeGeneratedSessionSigsToPkpSign.ts +init_shim(); +var testUseValidLitActionIpfsCodeGeneratedSessionSigsToPkpSign = async ( + devEnv +) => { + const alice = await devEnv.createRandomPerson(); + let litActionSessionSigs; + try { + litActionSessionSigs = await getLitActionSessionSigsUsingIpfsId( + devEnv, + alice + ); + } catch (e2) { + console.log('\u274C This error is NOT expected:', e2); + throw new Error(e2); + } + const res = await devEnv.litNodeClient.pkpSign({ + toSign: alice.loveLetter, + pubKey: alice.authMethodOwnedPkp.publicKey, + sessionSigs: litActionSessionSigs, + }); + devEnv.releasePrivateKeyFromUser(alice); + console.log('\u2705 res:', res); + if (!res.r) { + throw new Error(`Expected "r" in res`); + } + if (!res.s) { + throw new Error(`Expected "s" in res`); + } + if (!res.dataSigned) { + throw new Error(`Expected "dataSigned" in res`); + } + if (!res.publicKey) { + throw new Error(`Expected "publicKey" in res`); + } + if (!res.signature.startsWith('0x')) { + throw new Error(`Expected "signature" to start with 0x`); + } + if (isNaN(res.recid)) { + throw new Error(`Expected "recid" to be parseable as a number`); + } + const signature2 = ethers_exports.utils.joinSignature({ + r: '0x' + res.r, + s: '0x' + res.s, + recoveryParam: res.recid, + }); + const recoveredPubKey = ethers_exports.utils.recoverPublicKey( + alice.loveLetter, + signature2 + ); + if (recoveredPubKey !== `0x${res.publicKey.toLowerCase()}`) { + throw new Error(`Expected recovered public key to match res.publicKey`); + } + if ( + recoveredPubKey !== `0x${alice.authMethodOwnedPkp.publicKey.toLowerCase()}` + ) { + throw new Error( + `Expected recovered public key to match alice.authMethodOwnedPkp.publicKey` + ); + } + log('\u2705 res:', res); +}; + +// local-tests/tests/testUseInvalidLitActionIpfsCodeToGenerateSessionSigs.ts +init_shim(); +var testUseInvalidLitActionIpfsCodeToGenerateSessionSigs = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + await getInvalidLitActionIpfsSessionSigs(devEnv, alice); + } catch (e2) { + console.log('\u274C THIS IS EXPECTED: ', e2); + if (e2.message === 'An error related to validation has occured.') { + console.log( + '\u2705 testUseInvalidLitActionIpfsCodeToGenerateSessionSigs is expected to have an error' + ); + } else { + throw e2; + } + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testSolAuthSigToEncryptDecryptString.ts +init_shim(); +var testSolAuthSigToEncryptDecryptString = async (devEnv) => { + const accs = AccessControlConditions.getSolBasicAccessControlConditions({ + userAddress: devEnv.bareSolAuthSig.address, + }); + const encryptRes = await encryptString( + { + solRpcConditions: accs, + dataToEncrypt: 'Hello world', + }, + devEnv.litNodeClient + ); + console.log('encryptRes:', encryptRes); + if (!encryptRes.ciphertext) { + throw new Error(`Expected "ciphertext" in encryptRes`); + } + if (!encryptRes.dataToEncryptHash) { + throw new Error(`Expected "dataToEncryptHash" to in encryptRes`); + } + const decryptRes = await decryptToString( + { + solRpcConditions: accs, + ciphertext: encryptRes.ciphertext, + dataToEncryptHash: encryptRes.dataToEncryptHash, + authSig: devEnv.bareSolAuthSig, + chain: 'solana', + }, + devEnv.litNodeClient + ); + if (decryptRes !== 'Hello world') { + throw new Error( + `Expected decryptRes to be 'Hello world' but got ${decryptRes}` + ); + } + console.log('\u2705 decryptRes:', decryptRes); +}; + +// local-tests/tests/testEthAuthSigToEncryptDecryptString.ts +init_shim(); +var testEthAuthSigToEncryptDecryptString = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const accs = AccessControlConditions.getEmvBasicAccessControlConditions({ + userAddress: alice.authSig.address, + }); + const encryptRes = await encryptString( + { + accessControlConditions: accs, + dataToEncrypt: 'Hello world', + }, + devEnv.litNodeClient + ); + log('encryptRes:', encryptRes); + if (!encryptRes.ciphertext) { + throw new Error(`Expected "ciphertext" in encryptRes`); + } + if (!encryptRes.dataToEncryptHash) { + throw new Error(`Expected "dataToEncryptHash" to in encryptRes`); + } + const decryptRes = await decryptToString( + { + accessControlConditions: accs, + ciphertext: encryptRes.ciphertext, + dataToEncryptHash: encryptRes.dataToEncryptHash, + authSig: alice.authSig, + chain: 'ethereum', + }, + devEnv.litNodeClient + ); + if (decryptRes !== 'Hello world') { + throw new Error( + `Expected decryptRes to be 'Hello world' but got ${decryptRes}` + ); + } + console.log('\u2705 decryptRes:', decryptRes); +}; + +// local-tests/tests/testCosmosAuthSigToEncryptDecryptString.ts +init_shim(); +var testCosmosAuthSigToEncryptDecryptString = async (devEnv) => { + console.log( + '\u274C\u274C THIS IS A KNOWN FAILING TEST, PLEASE IGNORE FOR NOW. \u274C\u274C' + ); + devEnv.setUnavailable(LIT_NETWORK.Custom); + devEnv.setUnavailable(LIT_NETWORK.DatilDev); + const accs = AccessControlConditions.getCosmosBasicAccessControlConditions({ + userAddress: devEnv.bareCosmosAuthSig.address, + }); + const encryptRes = await encryptString( + { + unifiedAccessControlConditions: accs, + dataToEncrypt: 'Hello world', + }, + devEnv.litNodeClient + ); + console.log('encryptRes:', encryptRes); + if (!encryptRes.ciphertext) { + throw new Error(`Expected "ciphertext" in encryptRes`); + } + if (!encryptRes.dataToEncryptHash) { + throw new Error(`Expected "dataToEncryptHash" to in encryptRes`); + } + try { + const decryptRes = await decryptToString( + { + unifiedAccessControlConditions: accs, + ciphertext: encryptRes.ciphertext, + dataToEncryptHash: encryptRes.dataToEncryptHash, + authSig: devEnv.bareCosmosAuthSig, + chain: 'cosmos', + }, + devEnv.litNodeClient + ); + console.log('decryptRes:', decryptRes); + if (decryptRes !== 'Hello world') { + throw new Error( + `Expected decryptRes to be 'Hello world' but got ${decryptRes}` + ); + } + console.log('\u2705 decryptRes:', decryptRes); + } catch (e2) { + console.log('\u274C ERROR:', e2); + } +}; + +// local-tests/tests/testPkpEthersWithEoaSessionSigsToSignMessage.ts +init_shim(); + +// packages/pkp-ethers/src/index.ts +init_shim(); + +// packages/pkp-ethers/src/lib/handler.ts +init_shim(); +init_lib2(); +import { typedSignatureHash } from '@metamask/eth-sig-util'; + +// packages/pkp-ethers/src/lib/helper.ts +init_shim(); +function convertHexToUtf8(value) { + try { + if (ethers_exports.utils.isHexString(value)) { + return ethers_exports.utils.toUtf8String(value); + } + return value; + } catch (e2) { + return value; + } +} +var getTransactionToSign = (txParams) => { + const formattedTx = Object.assign({}, txParams); + if (formattedTx.gas) { + delete formattedTx.gas; + } + if (formattedTx.from) { + delete formattedTx.from; + } + return formattedTx; +}; +function isSignedTransaction(tx) { + try { + const parsedTx = ethers_exports.utils.parseTransaction(tx); + return !!parsedTx.v && !!parsedTx.r && !!parsedTx.s; + } catch (err) { + return false; + } +} + +// packages/pkp-ethers/src/lib/handler.ts +var signTypedData = async (signer, msgParams) => { + if (typeof msgParams === 'string') { + msgParams = JSON.parse(msgParams); + } + const { types, domain, primaryType, message } = msgParams; + if (types['EIP712Domain']) { + delete types['EIP712Domain']; + } + const signature2 = await signer._signTypedData(domain, types, message); + return signature2; +}; +var signTypedDataLegacy = async (signer, msgParams) => { + const messageHash = typedSignatureHash(msgParams); + let sig; + if (signer.runLitAction) { + const _signer = signer; + sig = await _signer.runSign(ethers_exports.utils.arrayify(messageHash)); + } else { + throw new InvalidArgumentException( + { + info: { + signer, + msgParams, + }, + }, + 'Unabled to runLitAction. This signer is not a PKPEthersWallet' + ); + } + const encodedSig = joinSignature({ + r: '0x' + sig.r, + s: '0x' + sig.s, + v: sig.recid, + }); + return encodedSig; +}; +var validateAddressesMatch = (signerAddress, requestAddress) => { + if (signerAddress.toLowerCase() !== requestAddress.toLowerCase()) { + throw new UnauthorizedException( + { + info: { + signerAddress, + requestAddress, + }, + }, + `PKPWallet address does not match address requested` + ); + } +}; +var validateSignature = (signature2) => { + if (signature2 === null || signature2 === void 0 || signature2 === '') { + throw new InvalidParamType( + { + info: { + signature: signature2, + }, + }, + 'Signature is null or undefined' + ); + } +}; +function getTypedDataVersionInfo({ signer, payload }) { + if (!payload.params[0]) { + throw new InvalidParamType( + { + info: { + payload, + }, + }, + 'signTypedDataHandler: payload.params[0] is not defined' + ); + } + const ethersIsAddress = ethers_exports.utils.isAddress(payload.params[0]); + let info; + if (ethersIsAddress) { + info = { + logMessage: 'RUNNING VERSION 3 or 4', + addressIndex: 0, + msgParamsIndex: 1, + signTypedDataFn: signTypedData, + }; + } else { + info = { + logMessage: 'RUNNING VERSION 1', + addressIndex: 1, + msgParamsIndex: 0, + signTypedDataFn: signTypedDataLegacy, + }; + } + let addressRequested = payload.params[info.addressIndex]; + validateAddressesMatch(signer.address, addressRequested); + let msgParams = payload.params[info.msgParamsIndex]; + return { addressRequested, msgParams, info }; +} +var signTypedDataHandler = async ({ signer, payload }) => { + if (!signer || !payload) { + throw new ParamsMissingError( + { + info: { + signer, + payload, + }, + }, + `signer or payload is not defined` + ); + } + const { msgParams, info } = getTypedDataVersionInfo({ + signer, + payload, + }); + const signature2 = await info.signTypedDataFn(signer, msgParams); + validateSignature(signature2); + return { signature: signature2 }; +}; +var signTransactionHandler = async ({ signer, payload }) => { + const unsignedTx = payload.params[0]; + const addressRequested = unsignedTx.from; + const _signer = signer; + validateAddressesMatch(_signer.address, addressRequested); + const unsignedTxFormatted = getTransactionToSign(unsignedTx); + const signedTxSignature = await _signer.signTransaction(unsignedTxFormatted); + validateSignature(signedTxSignature); + return signedTxSignature; +}; +var sendTransactionHandler = async ({ signer, payload }) => { + const unsignedTx = payload.params[0]; + const addressRequested = unsignedTx.from; + const _signer = signer; + validateAddressesMatch(_signer.address, addressRequested); + const unsignedTxFormatted = getTransactionToSign(unsignedTx); + const signedTxSignature = await _signer.signTransaction(unsignedTxFormatted); + validateSignature(signedTxSignature); + const txRes = await _signer.sendTransaction(signedTxSignature); + return txRes; +}; +var sendRawTransactionHandler = async ({ signer, payload }) => { + const tx = getTransactionToSign(payload.params[0]); + const signature2 = await signer.sendTransaction(tx); + validateSignature(signature2); + return { signature: signature2 }; +}; +var signHandler = async ({ signer, payload }) => { + const addressRequested = payload.params[0]; + validateAddressesMatch(signer.address, addressRequested); + const msg = convertHexToUtf8(payload.params[1]); + const signature2 = await signer.signMessage(msg); + validateSignature(signature2); + return { signature: signature2 }; +}; +var personalSignHandler = async ({ signer, payload, capability }) => { + const addressRequested = payload.params[1]; + validateAddressesMatch(signer.address, addressRequested); + const msg = convertHexToUtf8(payload.params[0]); + if (capability) { + } + const signature2 = await signer.signMessage(msg); + validateSignature(signature2); + return { signature: signature2 }; +}; +var methodHandlers = { + // signing + eth_sign: signHandler, + personal_sign: personalSignHandler, + // signing typed data - the handler will choose the correct version to use + eth_signTypedData: signTypedDataHandler, + eth_signTypedData_v1: signTypedDataHandler, + eth_signTypedData_v3: signTypedDataHandler, + eth_signTypedData_v4: signTypedDataHandler, + // sign tx + eth_signTransaction: signTransactionHandler, + // send tx + eth_sendTransaction: sendTransactionHandler, + eth_sendRawTransaction: sendRawTransactionHandler, +}; +var ethRequestHandler = async ({ signer, payload }) => { + if (!methodHandlers.hasOwnProperty(payload.method)) { + throw new UnsupportedMethodError( + { + info: { + payload, + signer, + }, + }, + `Ethereum JSON-RPC signing method "${payload.method}" is not supported` + ); + } + const fn = methodHandlers[payload.method]; + try { + const data = await fn({ signer, payload }); + if (data['signature']) { + return data.signature; + } + if (data['txRes']) { + await data.txRes.wait(); + return data.txRes; + } + return data; + } catch (e2) { + throw new UnknownError( + { + info: { + payload, + signer, + }, + cause: e2, + }, + 'Something went wrong when handling Ethereum JSON-RPC requests for the given method and payload' + ); + } +}; + +// packages/pkp-ethers/src/lib/pkp-ethers.ts +init_shim(); +init_lib7(); +init_lib2(); +init_lib12(); +init_lib22(); +init_lib24(); +init_lib5(); +init_lib(); +init_lib4(); +init_lib23(); +init_lib17(); + +// packages/pkp-base/src/index.ts +init_shim(); + +// packages/pkp-base/src/lib/pkp-base.ts +init_shim(); +import depd6 from 'depd'; +var deprecated6 = depd6('lit-js-sdk:pkp-base:pkp-base'); +var compressPubKey = (pubKey) => { + const testBuffer = Buffer.from(pubKey, 'hex'); + if (testBuffer.length === 64) { + pubKey = '04' + pubKey; + } + const uint8array = Buffer.from(pubKey, 'hex'); + const compressedKey = publicKeyConvert(uint8array, true); + const hex = Buffer.from(compressedKey).toString('hex'); + return hex; +}; +var PKPBase = class { + rpcs; + _controllerAuthSig; + controllerAuthMethods; + controllerSessionSigs; + authContext; + uncompressedPubKey; + uncompressedPubKeyBuffer; + compressedPubKey; + compressedPubKeyBuffer; + litNodeClient; + litActionCode; + litActionIPFS; + litActionJsParams; + debug; + useAction; + // -- debug things + PREFIX = '[PKPBase]'; + orange = '\x1B[33m'; + reset = '\x1B[0m'; + get litNodeClientReady() { + return this.litNodeClient.ready; + } + /** + * @deprecated - Use a different authentication method instead. + */ + get controllerAuthSig() { + deprecated6('controllerAuthSig is deprecated.'); + return this._controllerAuthSig; + } + /** + * @deprecated - Use a different authentication method instead. + */ + set controllerAuthSig(value) { + deprecated6('controllerAuthSig is deprecated.'); + this._controllerAuthSig = value; + } + // Rest of the PKPBase class... + constructor(pkpBaseProp) { + const prop = { ...pkpBaseProp }; + this.debug = prop.debug || false; + if (prop.pkpPubKey.startsWith('0x')) { + prop.pkpPubKey = prop.pkpPubKey.slice(2); + } + this.setUncompressedPubKeyAndBuffer(prop); + this.setCompressedPubKeyAndBuffer(prop); + this.rpcs = prop.rpcs; + this.controllerAuthSig = prop.controllerAuthSig; + this.controllerAuthMethods = prop.controllerAuthMethods; + this.controllerSessionSigs = prop.controllerSessionSigs; + this.authContext = prop.authContext; + this.validateAuthContext(); + this.setLitAction(prop); + this.setLitActionJsParams(prop.litActionJsParams || {}); + this.litNodeClient = prop.litNodeClient; + } + /** + * Creates a new instance of the PKPBase class with the provided properties. + * + * @param { PKPBaseProp } pkpBaseProp - The properties for the PKPBase instance. + * + * @returns { PKPBase } - A new instance of the PKPBase class. + * */ + static createInstance(pkpBaseProp) { + return new PKPBase(pkpBaseProp); + } + /** + * Sets the uncompressed public key and its buffer representation. + * + * @param { PKPBaseProp } prop - The properties for the PKPBase instance. + */ + setUncompressedPubKeyAndBuffer(prop) { + try { + this.uncompressedPubKey = prop.pkpPubKey; + this.uncompressedPubKeyBuffer = Buffer.from(prop.pkpPubKey, 'hex'); + } catch (e2) { + throw new UnknownError( + { + info: { + param: 'pkpPubKey', + value: prop.pkpPubKey, + }, + cause: e2, + }, + 'Failed to set uncompressed public key and buffer' + ); + } + } + /** + * Sets the compressed public key and its buffer representation. + * + * @param {PKPBaseProp} prop - The properties for the PKPBase instance. + */ + setCompressedPubKeyAndBuffer(prop) { + try { + this.compressedPubKey = compressPubKey(prop.pkpPubKey); + this.compressedPubKeyBuffer = Buffer.from(this.compressedPubKey, 'hex'); + } catch (e2) { + throw new UnknownError( + { + info: { + param: 'pkpPubKey', + value: prop.pkpPubKey, + }, + cause: e2, + }, + 'Failed to set compressed public key and buffer' + ); + } + } + /** + * Sets the Lit action to be executed by the LitNode client. + * + * @param {PKPBaseProp} pkpBaseProp - An object containing the parameters for the Lit action. + * + * @returns {void} - If both `litActionCode` and `litActionIPFS` are present, throws an Error. Otherwise, does not return a value. + */ + setLitAction(pkpBaseProp) { + this.litActionCode = pkpBaseProp.litActionCode; + this.litActionIPFS = pkpBaseProp.litActionIPFS; + if (pkpBaseProp.litActionCode && pkpBaseProp.litActionIPFS) { + throw new InitError( + { + info: { + pkpBaseProp, + }, + }, + 'Both litActionCode and litActionIPFS cannot be present at the same time.' + ); + } + if (!pkpBaseProp.litActionCode && !pkpBaseProp.litActionIPFS) { + this.log( + 'No lit action code or IPFS hash provided. Using default action.' + ); + this.useAction = false; + } + } + /** + * A function that sets the value of the litActionJsParams property to the given params object. + * @template CustomType - A generic type that extends T, where T is the type of the litActionJsParams property. + * + * @param { CustomType } params - An object of type CustomType that contains the parameters to be set as litActionJsParams. + * + * @returns { void } + */ + setLitActionJsParams(params) { + this.litActionJsParams = params; + } + /** + * Initializes the PKPBase instance by connecting to the LIT node. + */ + async init() { + try { + await this.litNodeClient.connect(); + this.log('Connected to Lit Node'); + } catch (e2) { + throw new LitNodeClientNotReadyError( + { + info: { + litNodeConfig: this.litNodeClient.config, + }, + cause: e2, + }, + 'Failed to connect to Lit Node' + ); + } + } + validateAuthContext() { + const providedAuthentications = [ + this.controllerAuthSig, + this.controllerSessionSigs, + this.authContext, + ].filter(Boolean).length; + if (providedAuthentications !== 1) { + if (this.controllerAuthSig) { + logError('controllerAuthSig is provided'); + } + if (this.controllerSessionSigs) { + logError('controllerSessionSigs is provided'); + } + if (this.authContext) { + logError('authContext is provided'); + } + throw new InitError( + { + info: { + authContext: this.authContext, + controllerAuthSig: this.controllerAuthSig, + controllerSessionSigs: this.controllerSessionSigs, + }, + }, + 'Must specify one, and only one, authentication method ' + ); + } + if (this.authContext && !this.authContext.getSessionSigsProps) { + throw new InitError( + { + info: { + authContext: this.authContext, + }, + }, + 'authContext must be an object with getSessionSigsProps' + ); + } + } + async getSessionSigs() { + const sessionSigs = this.authContext + ? await this.litNodeClient.getSessionSigs( + this.authContext.getSessionSigsProps + ) + : this.controllerSessionSigs; + if (!sessionSigs) { + throw new UnknownError({}, 'Could not get sessionSigs'); + } + return sessionSigs; + } + /** + * Runs the specified Lit action with the given parameters. + * + * @param {Uint8Array} toSign - The data to be signed by the Lit action. + * @param {string} sigName - The name of the signature to be returned by the Lit action. + * + * @returns {Promise} - A Promise that resolves with the signature returned by the Lit action. + * + * @throws {Error} - Throws an error if `pkpPubKey` is not provided, if `controllerAuthSig` or `controllerSessionSigs` is not provided, if `controllerSessionSigs` is not an object, if `executeJsArgs` does not have either `code` or `ipfsId`, or if an error occurs during the execution of the Lit action. + */ + async runLitAction(toSign, sigName) { + if (this.litActionCode && this.litActionIPFS) { + throw new InitError( + { + info: { + litActionCode: this.litActionCode, + litActionIPFS: this.litActionIPFS, + }, + }, + 'litActionCode and litActionIPFS cannot exist at the same time' + ); + } + await this.ensureLitNodeClientReady(); + if (!this.uncompressedPubKey) { + throw new InitError( + {}, + 'pkpPubKey (aka. uncompressedPubKey) is required' + ); + } + this.validateAuthContext(); + const controllerSessionSigs = await this.getSessionSigs(); + const executeJsArgs = { + ...(this.litActionCode && { code: this.litActionCode }), + ...(this.litActionIPFS && { ipfsId: this.litActionIPFS }), + sessionSigs: controllerSessionSigs, + jsParams: { + ...{ + toSign, + publicKey: this.uncompressedPubKey, + sigName, + }, + ...{ + ...this.litActionJsParams, + }, + }, + }; + if (!executeJsArgs.code && !executeJsArgs.ipfsId) { + throw new InitError( + { + info: { + litActionCode: this.litActionCode, + litActionIPFS: this.litActionIPFS, + }, + }, + 'executeJsArgs must have either code or ipfsId' + ); + } + this.log('executeJsArgs:', executeJsArgs); + const res = await this.litNodeClient.executeJs(executeJsArgs); + const sig = res.signatures[sigName]; + this.log('res:', res); + this.log('res.signatures[sigName]:', sig); + if (sig.r && sig.s) { + sig.r = sig.r.length % 2 === 0 ? sig.r : '0' + sig.r; + sig.s = sig.s.length % 2 === 0 ? sig.s : '0' + sig.s; + } + return sig; + } + /** + * Sign the provided data with the PKP private key. + * + * @param {Uint8Array} toSign - The data to be signed. + * + * @returns {Promise} - A Promise that resolves with the signature of the provided data. + * + * @throws {Error} - Throws an error if `pkpPubKey` is not provided, if `controllerAuthSig` or `controllerSessionSigs` is not provided, if `controllerSessionSigs` is not an object, or if an error occurs during the signing process. + */ + async runSign(toSign) { + await this.ensureLitNodeClientReady(); + if (!this.uncompressedPubKey) { + throw new InitError( + {}, + 'pkpPubKey (aka. uncompressedPubKey) is required' + ); + } + this.validateAuthContext(); + const controllerSessionSigs = await this.getSessionSigs(); + try { + const sig = await this.litNodeClient.pkpSign({ + toSign, + pubKey: this.uncompressedPubKey, + sessionSigs: controllerSessionSigs, + }); + if (!sig) { + throw new UnknownError({}, 'No signature returned'); + } + sig.r = sig.r.length % 2 === 0 ? sig.r : '0' + sig.r; + sig.s = sig.s.length % 2 === 0 ? sig.s : '0' + sig.s; + return sig; + } catch (e2) { + console.log('err: ', e2); + throw e2; + } + } + /** + * Ensures that the LitNode client is ready for use by waiting for initialization if necessary. + * If the client is already ready, this function does nothing. + * + * @returns {Promise} - A Promise that resolves when the LitNode client is ready for use. + */ + async ensureLitNodeClientReady() { + if (!this.litNodeClientReady) { + await this.init(); + } + } + /** + * Logs the provided arguments to the console, but only if debugging is enabled. + * + * @param {...any[]} args - The values to be logged to the console. + * + * @returns {void} - This function does not return a value. + */ + log(...args) { + if (this.debug) { + console.log(this.orange + this.PREFIX + this.reset, ...args); + } + } +}; + +// packages/pkp-ethers/src/lib/pkp-ethers.ts +var logger47 = new Logger(version27); +var PKPEthersWallet = class { + pkpBase; + address; + _isSigner; + rpcProvider; + provider; + // -- manual tx settings -- + manualGasPrice; + manualGasLimit; + nonce; + chainId; + get litNodeClientReady() { + return this.pkpBase.litNodeClientReady; + } + constructor(prop) { + this.pkpBase = PKPBase.createInstance(prop); + const rpcUrl = + prop.rpc || RPC_URL_BY_NETWORK[prop.litNodeClient.config.litNetwork]; + if (!rpcUrl) { + throw new InitError( + { + info: { + rpcUrl, + network: prop.litNodeClient.config.litNetwork, + }, + }, + 'No RPC URL provided, and none could be found for the provided LitNodeClient' + ); + } + this.rpcProvider = new ethers_exports.providers.StaticJsonRpcProvider({ + url: rpcUrl, + skipFetchSetup: true, + }); + this.provider = prop.provider ?? this.rpcProvider; + defineReadOnly(this, '_isSigner', true); + defineReadOnly( + this, + 'address', + computeAddress(this.pkpBase.uncompressedPubKeyBuffer) + ); + } + getRpc = () => { + return this.rpcProvider.connection.url; + }; + setRpc = async (rpc) => { + this.rpcProvider = new ethers_exports.providers.StaticJsonRpcProvider({ + url: rpc, + skipFetchSetup: true, + }); + }; + handleRequest = async (payload) => { + return await ethRequestHandler({ + signer: this, + payload, + }); + }; + request = async (payload) => { + return this.handleRequest(payload); + }; + setGasPrice = (gasPrice) => { + this.manualGasPrice = gasPrice; + }; + setGasLimit = (gasLimit) => { + this.manualGasLimit = gasLimit; + }; + setNonce = (nonce) => { + this.nonce = nonce; + }; + setChainId = (chainId) => { + this.chainId = chainId; + }; + resetManualSettings = () => { + this.manualGasPrice = void 0; + this.manualGasLimit = void 0; + this.nonce = void 0; + this.chainId = void 0; + }; + get publicKey() { + return this.pkpBase.uncompressedPubKey; + } + getAddress() { + const addr = computeAddress(this.pkpBase.uncompressedPubKeyBuffer); + return Promise.resolve(addr); + } + /** + * Initializes the PKPEthersWallet instance and its dependencies + */ + async init() { + await this.pkpBase.init(); + } + connect() { + throw new UnsupportedMethodError( + { + info: { + method: 'connect', + }, + }, + 'Use setRPC to set a new JSON RPC provider' + ); + } + async signTransaction(transaction) { + this.pkpBase.log('signTransaction => transaction:', transaction); + await this.pkpBase.ensureLitNodeClientReady(); + const addr = await this.getAddress(); + this.pkpBase.log('signTransaction => addr:', addr); + if (this.manualGasPrice) { + transaction.gasPrice = this.manualGasPrice; + } + if (this.manualGasLimit) { + transaction.gasLimit = this.manualGasLimit; + } + if (this.nonce) { + transaction.nonce = this.nonce; + } + if (this.chainId) { + transaction.chainId = this.chainId; + } + try { + if (!transaction['gasLimit']) { + transaction.gasLimit = await this.rpcProvider.estimateGas(transaction); + this.pkpBase.log('signTransaction => gasLimit:', transaction.gasLimit); + } + if (!transaction['nonce']) { + transaction.nonce = await this.rpcProvider.getTransactionCount(addr); + this.pkpBase.log('signTransaction => nonce:', transaction.nonce); + } + if (!transaction['chainId']) { + transaction.chainId = (await this.rpcProvider.getNetwork()).chainId; + this.pkpBase.log('signTransaction => chainId:', transaction.chainId); + } + if (!transaction['gasPrice']) { + transaction.gasPrice = await this.getGasPrice(); + this.pkpBase.log('signTransaction => gasPrice:', transaction.gasPrice); + } + } catch (err) { + this.pkpBase.log( + 'signTransaction => unable to populate transaction with details:', + err + ); + } + return resolveProperties(transaction).then(async (tx) => { + this.pkpBase.log('tx.from:', tx.from); + this.pkpBase.log('this.address:', this.address); + if (tx.from != null) { + if (getAddress(tx.from) !== this.address) { + logger47.throwArgumentError( + 'transaction from address mismatch', + 'transaction.from', + transaction.from + ); + } + delete tx.from; + } + const serializedTx = serialize(tx); + const unsignedTxn = keccak256(serializedTx); + const toSign = arrayify(unsignedTxn); + let signature2; + if (this.pkpBase.useAction) { + this.pkpBase.log('running lit action => sigName: pkp-eth-sign-tx'); + signature2 = ( + await this.pkpBase.runLitAction(toSign, 'pkp-eth-sign-tx') + ).signature; + } else { + this.pkpBase.log('requesting signature from nodes'); + signature2 = (await this.pkpBase.runSign(toSign)).signature; + } + this.resetManualSettings(); + return serialize(tx, signature2); + }); + } + async signMessage(message) { + await this.pkpBase.ensureLitNodeClientReady(); + const toSign = arrayify(hashMessage(message)); + let signature2; + if (this.pkpBase.useAction) { + this.pkpBase.log('running lit action => sigName: pkp-eth-sign-message'); + signature2 = await this.runLitAction(toSign, 'pkp-eth-sign-message'); + } else { + this.pkpBase.log('requesting signature from nodes'); + signature2 = await this.runSign(toSign); + } + return joinSignature({ + r: '0x' + signature2.r, + s: '0x' + signature2.s, + v: signature2.recid, + }); + } + async _signTypedData(domain, types, value) { + await this.pkpBase.ensureLitNodeClientReady(); + const populated = await TypedDataEncoder.resolveNames( + domain, + types, + value, + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + (name) => { + if (this.provider == null) { + throw new UnsupportedChainException( + { + info: { + operation: 'resolveName', + value: name, + domain, + }, + }, + `cannot resolve ENS names without a provider`, + Object.keys(LIT_CHAINS) + ); + } + return this.provider.resolveName(name); + } + ); + const toSign = TypedDataEncoder.hash( + populated.domain, + types, + populated.value + ); + const toSignBuffer = arrayify(toSign); + let signature2; + if (this.pkpBase.useAction) { + this.pkpBase.log('running lit action => sigName: pkp-eth-sign-message'); + signature2 = await this.runLitAction( + toSignBuffer, + 'pkp-eth-sign-message' + ); + } else { + this.pkpBase.log('requesting signature from nodes'); + signature2 = await this.runSign(toSignBuffer); + } + return joinSignature({ + r: '0x' + signature2.r, + s: '0x' + signature2.s, + v: signature2.recid, + }); + } + encrypt(password, options, progressCallback) { + if (typeof options === 'function' && !progressCallback) { + progressCallback = options; + options = {}; + } + if (progressCallback && typeof progressCallback !== 'function') { + throw new InvalidParamType( + { + info: { + progressCallback, + }, + }, + 'invalid callback' + ); + } + if (!options) { + options = {}; + } + return encrypt(this, password, options, progressCallback); + } + async sendTransaction(transaction) { + this.pkpBase.log('sendTransaction => transaction:', transaction); + let res; + let signedTxn; + try { + if (!isSignedTransaction(transaction)) { + const unsignedTxFormatted = getTransactionToSign(transaction); + signedTxn = await this.signTransaction(unsignedTxFormatted); + } else { + signedTxn = transaction; + } + res = await this.rpcProvider.sendTransaction(signedTxn); + } catch (e2) { + throw new UnknownError( + { + info: { + transaction, + }, + cause: e2, + }, + 'could not send transaction' + ); + } + return res; + } + /** + * Static methods to create Wallet instances. + */ + static createRandom(options) { + let entropy = randomBytes(16); + if (!options) { + options = {}; + } + if (options.extraEntropy) { + entropy = arrayify( + hexDataSlice(keccak256(concat([entropy, options.extraEntropy])), 0, 16) + ); + } + const mnemonic = entropyToMnemonic(entropy, options.locale); + return Wallet.fromMnemonic(mnemonic, options.path, options.locale); + } + static fromEncryptedJson(json, password, progressCallback) { + return decryptJsonWallet(json, password, progressCallback).then( + (account) => { + return new Wallet(account); + } + ); + } + static fromEncryptedJsonSync(json, password) { + return new Wallet(decryptJsonWalletSync(json, password)); + } + static fromMnemonic(mnemonic, path, wordlist2) { + if (!path) { + path = defaultPath; + } + return new Wallet( + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + HDNode.fromMnemonic(mnemonic, null, wordlist2).derivePath(path) + ); + } + getBalance(blockTag) { + return this.rpcProvider.getBalance(this.address, blockTag); + } + getTransactionCount(blockTag) { + return this.rpcProvider.getTransactionCount(this.address, blockTag); + } + estimateGas(transaction) { + return this.rpcProvider.estimateGas(transaction); + } + async call(transaction, blockTag = 'latest') { + return this.rpcProvider.call(transaction, blockTag); + } + async getChainId() { + return (await this.rpcProvider.getNetwork()).chainId; + } + getGasPrice() { + return this.rpcProvider.getGasPrice(); + } + getFeeData() { + return this.rpcProvider.getFeeData(); + } + resolveName() { + throw new UnsupportedMethodError( + { + info: { + method: 'resolveName', + }, + }, + 'resolveName is not available in PKPEthersWallet' + ); + } + checkTransaction() { + throw new UnsupportedMethodError( + { + info: { + method: 'checkTransaction', + }, + }, + 'checkTransaction is not available in PKPEthersWallet' + ); + } + populateTransaction() { + throw new UnsupportedMethodError( + { + info: { + method: 'populateTransaction', + }, + }, + 'populateTransaction is not available in PKPEthersWallet' + ); + } + _checkProvider() { + this.pkpBase.log( + 'This function is not implemented yet, but will skip it for now.' + ); + } + get mnemonic() { + throw new UnsupportedMethodError( + { + info: { + method: 'mnemonic', + }, + }, + "There's no mnemonic for a PKPWallet" + ); + } + get privateKey() { + throw new UnsupportedMethodError( + { + info: { + method: 'privateKey', + }, + }, + 'This PKP contains no private key (can you imagine!?)' + ); + } + /** + * Runs the specified Lit action with the given parameters. + * + * @param {Uint8Array} toSign - The data to be signed by the Lit action. + * @param {string} sigName - The name of the signature to be returned by the Lit action. + * + * @returns {Promise} - A Promise that resolves with the signature returned by the Lit action. + * + * @throws {Error} - Throws an error if `pkpPubKey` is not provided, if `controllerAuthSig` or `controllerSessionSigs` is not provided, if `controllerSessionSigs` is not an object, if `executeJsArgs` does not have either `code` or `ipfsId`, or if an error occurs during the execution of the Lit action. + */ + async runLitAction(toSign, sigName) { + return this.pkpBase.runLitAction(toSign, sigName); + } + /** + * Sign the provided data with the PKP private key. + * + * @param {Uint8Array} toSign - The data to be signed. + * + * @returns {Promise} - A Promise that resolves with the signature of the provided data. + * + * @throws {Error} - Throws an error if `pkpPubKey` is not provided, if `controllerAuthSig` or `controllerSessionSigs` is not provided, if `controllerSessionSigs` is not an object, or if an error occurs during the signing process. + */ + async runSign(toSign) { + return this.pkpBase.runSign(toSign); + } +}; + +// packages/pkp-ethers/src/lib/pkp-ethers-types.ts +init_shim(); + +// local-tests/tests/testPkpEthersWithEoaSessionSigsToSignMessage.ts +var testPkpEthersWithEoaSessionSigsToSignMessage = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const eoaSessionSigs = await getEoaSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: eoaSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const signature2 = await pkpEthersWallet.signMessage(alice.loveLetter); + console.log('\u2705 signature:', signature2); + } catch (e2) { + throw new Error('\u274C Error: ' + e2.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithEoaSessionSigsToSignWithAuthContext.ts +init_shim(); +var testPkpEthersWithEoaSessionSigsToSignWithAuthContext = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const pkpEthersWallet = new PKPEthersWallet({ + pkpPubKey: alice.pkp.publicKey, + litNodeClient: devEnv.litNodeClient, + authContext: { + client: devEnv.litNodeClient, + getSessionSigsProps: { + authNeededCallback: async function (params) { + const toSign = await createSiweMessageWithRecaps({ + uri: params.uri, + expiration: params.expiration, + resources: params.resourceAbilityRequests, + walletAddress: alice.wallet.address, + nonce: await devEnv.litNodeClient.getLatestBlockhash(), + litNodeClient: devEnv.litNodeClient, + }); + const authSig = await generateAuthSig({ + signer: alice.wallet, + toSign, + }); + return authSig; + }, + resourceAbilityRequests: [ + { + resource: new LitPKPResource('*'), + ability: LIT_ABILITY.PKPSigning, + }, + { + resource: new LitActionResource('*'), + ability: LIT_ABILITY.LitActionExecution, + }, + ], + }, + }, + }); + await pkpEthersWallet.init(); + try { + const signature2 = await pkpEthersWallet.signMessage(alice.loveLetter); + console.log('\u2705 signature:', signature2); + } catch (e2) { + throw new Error('\u274C Error: ' + e2.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSign.ts +init_shim(); +var testPkpEthersWithEoaSessionSigsToEthSign = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const eoaSessionSigs = await getEoaSessionSigs(devEnv, alice); + console.log('devEnv.network:', devEnv.network); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: eoaSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const message = 'Hello world'; + const hexMsg = ethers_exports.utils.hexlify( + ethers_exports.utils.toUtf8Bytes(message) + ); + const signature2 = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_sign', + params: [alice.pkp.ethAddress, hexMsg], + }, + }); + const recoveredAddr = ethers_exports.utils.verifyMessage( + message, + signature2 + ); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr !== alice.pkp.ethAddress) { + throw new Error( + `\u274C test eth_sign recoveredAddr should be ${alice.pkp.ethAddress} but got ${recoveredAddr}` + ); + } + console.log('\u2705 recoveredAddr:', recoveredAddr); + } catch (e2) { + throw new Error('\u274C Error: ' + e2.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithEoaSessionSigsToPersonalSign.ts +init_shim(); +var testPkpEthersWithEoaSessionSigsToPersonalSign = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const eoaSessionSigs = await getEoaSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: eoaSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const message = 'Free the web'; + const hexMsg = ethers_exports.utils.hexlify( + ethers_exports.utils.toUtf8Bytes(message) + ); + const signature2 = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'personal_sign', + params: [hexMsg, alice.pkp.ethAddress], + }, + }); + const recoveredAddr = ethers_exports.utils.verifyMessage( + message, + signature2 + ); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr !== alice.pkp.ethAddress) { + throw new Error( + `\u274C recoveredAddr should be ${alice.pkp.ethAddress} but got ${recoveredAddr}` + ); + } + console.log('\u2705 personal_sign recoveredAddr:', recoveredAddr); + } catch (e2) { + throw new Error('\u274C Error: ' + e2.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithEoaSessionSigsToSendTx.ts +init_shim(); +var testPkpEthersWithEoaSessionSigsToSendTx = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const eoaSessionSigs = await getEoaSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: eoaSessionSigs, + }); + await devEnv.getFunds(alice.pkp.ethAddress); + await pkpEthersWallet.init(); + try { + const from = alice.pkp.ethAddress; + const to = alice.pkp.ethAddress; + const gasLimit = ethers_exports.BigNumber.from('21000'); + const value = ethers_exports.BigNumber.from('0'); + const data = '0x'; + const tx = { + from, + to, + gasLimit, + value, + data, + }; + const txRes = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_sendTransaction', + params: [tx], + }, + }); + console.log('\u2705 txRes:', txRes); + } catch (e2) { + if (e2.message.includes('insufficient FPE funds')) { + console.log( + `\u{1F9EA} PKPEthersWallet should be able to send tx (insufficient FPE funds \u2757\uFE0F)` + ); + } else { + throw new Error(`\u274C Error: ${e2.toString()}`); + } + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithPkpSessionSigsToSignMessage.ts +init_shim(); +var testPkpEthersWithPkpSessionSigsToSignMessage = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const pkpSessionSigs = await getPkpSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: pkpSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const signature2 = await pkpEthersWallet.signMessage(alice.loveLetter); + console.log('\u2705 signature:', signature2); + } catch (e2) { + throw new Error('\u274C Error: ' + e2.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSign.ts +init_shim(); +var testPkpEthersWithPkpSessionSigsToEthSign = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const pkpSessionSigs = await getPkpSessionSigs(devEnv, alice); + console.log('devEnv.network:', devEnv.network); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: pkpSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const message = 'Hello world'; + const hexMsg = ethers_exports.utils.hexlify( + ethers_exports.utils.toUtf8Bytes(message) + ); + const signature2 = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_sign', + params: [alice.pkp.ethAddress, hexMsg], + }, + }); + const recoveredAddr = ethers_exports.utils.verifyMessage( + message, + signature2 + ); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr !== alice.pkp.ethAddress) { + throw new Error( + `\u274C test eth_sign recoveredAddr should be ${alice.pkp.ethAddress} but got ${recoveredAddr}` + ); + } + console.log('\u2705 recoveredAddr:', recoveredAddr); + } catch (e2) { + throw new Error('\u274C Error: ' + e2.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithPkpSessionSigsToPersonalSign.ts +init_shim(); +var testPkpEthersWithPkpSessionSigsToPersonalSign = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const pkpSessionSigs = await getPkpSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: pkpSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const message = 'Free the web'; + const hexMsg = ethers_exports.utils.hexlify( + ethers_exports.utils.toUtf8Bytes(message) + ); + const signature2 = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'personal_sign', + params: [hexMsg, alice.pkp.ethAddress], + }, + }); + const recoveredAddr = ethers_exports.utils.verifyMessage( + message, + signature2 + ); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr !== alice.pkp.ethAddress) { + throw new Error( + `\u274C recoveredAddr should be ${alice.pkp.ethAddress} but got ${recoveredAddr}` + ); + } + console.log('\u2705 personal_sign recoveredAddr:', recoveredAddr); + } catch (e2) { + throw new Error('\u274C Error: ' + e2.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithPkpSessionSigsToSendTx.ts +init_shim(); +var testPkpEthersWithPkpSessionSigsToSendTx = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const pkpSessionSigs = await getPkpSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: pkpSessionSigs, + }); + await devEnv.getFunds(alice.pkp.ethAddress); + await pkpEthersWallet.init(); + try { + const from = alice.pkp.ethAddress; + const to = alice.pkp.ethAddress; + const gasLimit = ethers_exports.BigNumber.from('21000'); + const value = ethers_exports.BigNumber.from('0'); + const data = '0x'; + const tx = { + from, + to, + gasLimit, + value, + data, + }; + const txRes = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_sendTransaction', + params: [tx], + }, + }); + console.log('\u2705 txRes:', txRes); + } catch (e2) { + if (e2.message.includes('insufficient FPE funds')) { + console.log( + `\u{1F9EA} PKPEthersWallet should be able to send tx (insufficient FPE funds \u2757\uFE0F)` + ); + } else { + throw new Error(`\u274C Error: ${e2.toString()}`); + } + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTransaction.ts +init_shim(); +var testPkpEthersWithEoaSessionSigsToEthSignTransaction = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const eoaSessionSigs = await getEoaSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: eoaSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const from = alice.pkp.ethAddress; + const to = alice.pkp.ethAddress; + const gasLimit = ethers_exports.BigNumber.from('21000'); + const value = ethers_exports.BigNumber.from('0'); + const data = '0x'; + const tx = { + from, + to, + gasLimit, + value, + data, + }; + const rawSignedTx = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_signTransaction', + params: [tx], + }, + }); + const parsedTransaction = + ethers_exports.utils.parseTransaction(rawSignedTx); + const signature2 = ethers_exports.utils.joinSignature({ + r: parsedTransaction.r, + s: parsedTransaction.s, + v: parsedTransaction.v, + }); + const rawTx = { + nonce: parsedTransaction.nonce, + gasPrice: parsedTransaction.gasPrice, + gasLimit: parsedTransaction.gasLimit, + to: parsedTransaction.to, + value: parsedTransaction.value, + data: parsedTransaction.data, + chainId: parsedTransaction.chainId, + // Include chainId if the transaction is EIP-155 + }; + const txHash = ethers_exports.utils.keccak256( + ethers_exports.utils.serializeTransaction(rawTx) + ); + const { v, r: r3, s: s2 } = parsedTransaction; + const recoveredAddress = ethers_exports.utils.recoverAddress(txHash, { + r: r3, + s: s2, + v, + }); + if (!parsedTransaction) { + throw new Error('\u274C parsedTransaction should not be null'); + } + if (signature2.length !== 132) { + throw new Error( + `\u274C signature should be 132 characters long, got ${signature2.length}` + ); + } + if (recoveredAddress.toLowerCase() !== alice.pkp.ethAddress.toLowerCase()) { + throw new Error( + `\u274C recoveredAddres should be ${alice.pkp.ethAddress}, got ${recoveredAddress}` + ); + } + } catch (e2) { + if (e2.message.includes('insufficient FPE funds')) { + console.log( + `\u{1F9EA} PKPEthersWallet should be able to send tx (insufficient FPE funds \u2757\uFE0F)` + ); + } else { + throw new Error(`\u274C Error: ${e2.toString()}`); + } + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTransaction.ts +init_shim(); +var testPkpEthersWithPkpSessionSigsToEthSignTransaction = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const pkpSessionSigs = await getPkpSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: pkpSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const from = alice.pkp.ethAddress; + const to = alice.pkp.ethAddress; + const gasLimit = ethers_exports.BigNumber.from('21000'); + const value = ethers_exports.BigNumber.from('0'); + const data = '0x'; + const tx = { + from, + to, + gasLimit, + value, + data, + }; + const rawSignedTx = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_signTransaction', + params: [tx], + }, + }); + const parsedTransaction = + ethers_exports.utils.parseTransaction(rawSignedTx); + const signature2 = ethers_exports.utils.joinSignature({ + r: parsedTransaction.r, + s: parsedTransaction.s, + v: parsedTransaction.v, + }); + const rawTx = { + nonce: parsedTransaction.nonce, + gasPrice: parsedTransaction.gasPrice, + gasLimit: parsedTransaction.gasLimit, + to: parsedTransaction.to, + value: parsedTransaction.value, + data: parsedTransaction.data, + chainId: parsedTransaction.chainId, + // Include chainId if the transaction is EIP-155 + }; + const txHash = ethers_exports.utils.keccak256( + ethers_exports.utils.serializeTransaction(rawTx) + ); + const { v, r: r3, s: s2 } = parsedTransaction; + const recoveredAddress = ethers_exports.utils.recoverAddress(txHash, { + r: r3, + s: s2, + v, + }); + if (!parsedTransaction) { + throw new Error('\u274C parsedTransaction should not be null'); + } + if (signature2.length !== 132) { + throw new Error( + `\u274C signature should be 132 characters long, got ${signature2.length}` + ); + } + if (recoveredAddress.toLowerCase() !== alice.pkp.ethAddress.toLowerCase()) { + throw new Error( + `\u274C recoveredAddres should be ${alice.pkp.ethAddress}, got ${recoveredAddress}` + ); + } + } catch (e2) { + if (e2.message.includes('insufficient FPE funds')) { + console.log( + `\u{1F9EA} PKPEthersWallet should be able to send tx (insufficient FPE funds \u2757\uFE0F)` + ); + } else { + throw new Error(`\u274C Error: ${e2.toString()}`); + } + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTransaction.ts +init_shim(); +var testPkpEthersWithLitActionSessionSigsToEthSignTransaction = async ( + devEnv +) => { + const alice = await devEnv.createRandomPerson(); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: litActionSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const from = alice.pkp.ethAddress; + const to = alice.pkp.ethAddress; + const gasLimit = ethers_exports.BigNumber.from('21000'); + const value = ethers_exports.BigNumber.from('0'); + const data = '0x'; + const tx = { + from, + to, + gasLimit, + value, + data, + }; + const rawSignedTx = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_signTransaction', + params: [tx], + }, + }); + const parsedTransaction = + ethers_exports.utils.parseTransaction(rawSignedTx); + const signature2 = ethers_exports.utils.joinSignature({ + r: parsedTransaction.r, + s: parsedTransaction.s, + v: parsedTransaction.v, + }); + const rawTx = { + nonce: parsedTransaction.nonce, + gasPrice: parsedTransaction.gasPrice, + gasLimit: parsedTransaction.gasLimit, + to: parsedTransaction.to, + value: parsedTransaction.value, + data: parsedTransaction.data, + chainId: parsedTransaction.chainId, + // Include chainId if the transaction is EIP-155 + }; + const txHash = ethers_exports.utils.keccak256( + ethers_exports.utils.serializeTransaction(rawTx) + ); + const { v, r: r3, s: s2 } = parsedTransaction; + const recoveredAddress = ethers_exports.utils.recoverAddress(txHash, { + r: r3, + s: s2, + v, + }); + if (!parsedTransaction) { + throw new Error('\u274C parsedTransaction should not be null'); + } + if (signature2.length !== 132) { + throw new Error( + `\u274C signature should be 132 characters long, got ${signature2.length}` + ); + } + if (recoveredAddress.toLowerCase() !== alice.pkp.ethAddress.toLowerCase()) { + throw new Error( + `\u274C recoveredAddres should be ${alice.pkp.ethAddress}, got ${recoveredAddress}` + ); + } + } catch (e2) { + if (e2.message.includes('insufficient FPE funds')) { + console.log( + `\u{1F9EA} PKPEthersWallet should be able to send tx (insufficient FPE funds \u2757\uFE0F)` + ); + } else { + throw new Error(`\u274C Error: ${e2.toString()}`); + } + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataV1.ts +init_shim(); +import { + SignTypedDataVersion, + recoverTypedSignature, +} from '@metamask/eth-sig-util'; +var testPkpEthersWithEoaSessionSigsToEthSignTypedDataV1 = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const eoaSessionSigs = await getEoaSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: eoaSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const msgParams = [ + { + type: 'string', + name: 'Message', + value: 'Hi, Alice!', + }, + { + type: 'uint32', + name: 'A number', + value: '1337', + }, + ]; + const signature2 = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_signTypedData_v1', + params: [msgParams, alice.pkp.ethAddress], + }, + }); + const signatureBytes = ethers_exports.utils.arrayify(signature2); + const recoveredAddr = recoverTypedSignature({ + data: msgParams, + signature: signatureBytes, + version: SignTypedDataVersion.V1, + }); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr.toLowerCase() !== alice.pkp.ethAddress.toLowerCase()) { + throw new Error( + `\u274C recoveredAddr ${recoveredAddr} should be ${alice.pkp.ethAddress}` + ); + } + console.log('signature: ', signature2); + console.log('recoveredAddr: ', recoveredAddr); + } catch (e2) { + throw new Error(`\u274C ${e2.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataV1.ts +init_shim(); +import { + SignTypedDataVersion as SignTypedDataVersion2, + recoverTypedSignature as recoverTypedSignature2, +} from '@metamask/eth-sig-util'; +var testPkpEthersWithPkpSessionSigsToEthSignTypedDataV1 = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const pkpSessionSigs = await getPkpSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: pkpSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const msgParams = [ + { + type: 'string', + name: 'Message', + value: 'Hi, Alice!', + }, + { + type: 'uint32', + name: 'A number', + value: '1337', + }, + ]; + const signature2 = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_signTypedData_v1', + params: [msgParams, alice.pkp.ethAddress], + }, + }); + const signatureBytes = ethers_exports.utils.arrayify(signature2); + const recoveredAddr = recoverTypedSignature2({ + data: msgParams, + signature: signatureBytes, + version: SignTypedDataVersion2.V1, + }); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr.toLowerCase() !== alice.pkp.ethAddress.toLowerCase()) { + throw new Error( + `\u274C recoveredAddr ${recoveredAddr} should be ${alice.pkp.ethAddress}` + ); + } + console.log('signature: ', signature2); + console.log('recoveredAddr: ', recoveredAddr); + } catch (e2) { + throw new Error(`\u274C ${e2.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV1.ts +init_shim(); +import { + SignTypedDataVersion as SignTypedDataVersion3, + recoverTypedSignature as recoverTypedSignature3, +} from '@metamask/eth-sig-util'; +var testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV1 = async ( + devEnv +) => { + const alice = await devEnv.createRandomPerson(); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: litActionSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const msgParams = [ + { + type: 'string', + name: 'Message', + value: 'Hi, Alice!', + }, + { + type: 'uint32', + name: 'A number', + value: '1337', + }, + ]; + const signature2 = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_signTypedData_v1', + params: [msgParams, alice.pkp.ethAddress], + }, + }); + const signatureBytes = ethers_exports.utils.arrayify(signature2); + const recoveredAddr = recoverTypedSignature3({ + data: msgParams, + signature: signatureBytes, + version: SignTypedDataVersion3.V1, + }); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr.toLowerCase() !== alice.pkp.ethAddress.toLowerCase()) { + throw new Error( + `\u274C recoveredAddr ${recoveredAddr} should be ${alice.pkp.ethAddress}` + ); + } + console.log('signature: ', signature2); + console.log('recoveredAddr: ', recoveredAddr); + } catch (e2) { + throw new Error(`\u274C ${e2.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataV3.ts +init_shim(); +import { + SignTypedDataVersion as SignTypedDataVersion4, + recoverTypedSignature as recoverTypedSignature4, +} from '@metamask/eth-sig-util'; +var testPkpEthersWithEoaSessionSigsToEthSignTypedDataV3 = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const eoaSessionSigs = await getEoaSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: eoaSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const msgParams = { + types: { + EIP712Domain: [ + { name: 'name', type: 'string' }, + { name: 'version', type: 'string' }, + { name: 'chainId', type: 'uint256' }, + { name: 'verifyingContract', type: 'address' }, + ], + Person: [ + { name: 'name', type: 'string' }, + { name: 'wallet', type: 'address' }, + ], + Mail: [ + { name: 'from', type: 'Person' }, + { name: 'to', type: 'Person' }, + { name: 'contents', type: 'string' }, + ], + }, + primaryType: 'Mail', + domain: { + name: 'Ether Mail', + version: '1', + chainId: 80001, + verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', + }, + message: { + from: { + name: 'Cow', + wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', + }, + to: { + name: 'Bob', + wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', + }, + contents: 'Hello, Bob!', + }, + }; + const signature2 = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_signTypedData_v3', + params: [alice.pkp.ethAddress, JSON.stringify(msgParams)], + }, + }); + const recoveredAddr = recoverTypedSignature4({ + data: { + // @ts-ignore + types: msgParams.types, + // @ts-ignore + domain: msgParams.domain, + // @ts-ignore + primaryType: msgParams.primaryType, + // @ts-ignore + message: msgParams.message, + }, + signature: signature2, + version: SignTypedDataVersion4.V3, + }); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr.toLowerCase() !== alice.pkp.ethAddress.toLowerCase()) { + throw new Error( + `\u274C recoveredAddr ${recoveredAddr} should be ${alice.pkp.ethAddress}` + ); + } + } catch (e2) { + throw new Error(`\u274C ${e2.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataV4.ts +init_shim(); +import { + SignTypedDataVersion as SignTypedDataVersion5, + recoverTypedSignature as recoverTypedSignature5, +} from '@metamask/eth-sig-util'; +var testPkpEthersWithEoaSessionSigsToEthSignTypedDataV4 = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const eoaSessionSigs = await getEoaSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: eoaSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const msgParams = { + domain: { + chainId: 80001, + name: 'Ether Mail', + verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', + version: '1', + }, + message: { + contents: 'Hello, Bob!', + from: { + name: 'Cow', + wallets: [ + '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', + '0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF', + ], + }, + to: [ + { + name: 'Bob', + wallets: [ + '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', + '0xB0BdaBea57B0BDABeA57b0bdABEA57b0BDabEa57', + '0xB0B0b0b0b0b0B000000000000000000000000000', + ], + }, + ], + }, + primaryType: 'Mail', + types: { + EIP712Domain: [ + { name: 'name', type: 'string' }, + { name: 'version', type: 'string' }, + { name: 'chainId', type: 'uint256' }, + { name: 'verifyingContract', type: 'address' }, + ], + Mail: [ + { name: 'from', type: 'Person' }, + { name: 'to', type: 'Person[]' }, + { name: 'contents', type: 'string' }, + ], + Person: [ + { name: 'name', type: 'string' }, + { name: 'wallets', type: 'address[]' }, + ], + }, + }; + const signature2 = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_signTypedData_v4', + params: [alice.pkp.ethAddress, JSON.stringify(msgParams)], + }, + }); + const recoveredAddr = recoverTypedSignature5({ + data: msgParams, + signature: signature2, + version: SignTypedDataVersion5.V4, + }); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr.toLowerCase() !== alice.pkp.ethAddress.toLowerCase()) { + throw new Error( + `\u274C recoveredAddr ${recoveredAddr} should be ${alice.pkp.ethAddress}` + ); + } + } catch (e2) { + throw new Error(`\u274C ${e2.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedData.ts +init_shim(); +var testPkpEthersWithEoaSessionSigsToEthSignTypedData = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const eoaSessionSigs = await getEoaSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: eoaSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const msgParams = { + types: { + EIP712Domain: [ + { name: 'name', type: 'string' }, + { name: 'version', type: 'string' }, + { name: 'chainId', type: 'uint256' }, + { name: 'verifyingContract', type: 'address' }, + ], + Person: [ + { name: 'name', type: 'string' }, + { name: 'wallet', type: 'address' }, + ], + Mail: [ + { name: 'from', type: 'Person' }, + { name: 'to', type: 'Person' }, + { name: 'contents', type: 'string' }, + ], + }, + primaryType: 'Mail', + domain: { + name: 'Ether Mail', + version: '1', + chainId: 80001, + verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', + }, + message: { + from: { + name: 'Cow', + wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', + }, + to: { + name: 'Bob', + wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', + }, + contents: 'Hello, Bob!', + }, + }; + const signature2 = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_signTypedData', + params: [alice.pkp.ethAddress, JSON.stringify(msgParams)], + }, + }); + const recoveredAddr = ethers_exports.utils.verifyTypedData( + msgParams.domain, + { Person: msgParams.types.Person, Mail: msgParams.types.Mail }, + msgParams.message, + signature2 + ); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr.toLowerCase() !== alice.pkp.ethAddress.toLowerCase()) { + throw new Error( + `\u274C recoveredAddr ${recoveredAddr} should be ${alice.pkp.ethAddress}` + ); + } + } catch (e2) { + throw new Error(`\u274C ${e2.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataUtil.ts +init_shim(); +var testPkpEthersWithEoaSessionSigsToEthSignTypedDataUtil = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const eoaSessionSigs = await getEoaSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: eoaSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const msgParams = { + types: { + EIP712Domain: [ + { name: 'name', type: 'string' }, + { name: 'version', type: 'string' }, + { name: 'chainId', type: 'uint256' }, + { name: 'verifyingContract', type: 'address' }, + ], + Person: [ + { name: 'name', type: 'string' }, + { name: 'wallet', type: 'address' }, + ], + Mail: [ + { name: 'from', type: 'Person' }, + { name: 'to', type: 'Person' }, + { name: 'contents', type: 'string' }, + ], + }, + primaryType: 'Mail', + domain: { + name: 'Ether Mail', + version: '1', + chainId: 80001, + verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', + }, + message: { + from: { + name: 'Cow', + wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', + }, + to: { + name: 'Bob', + wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', + }, + contents: 'Hello, Bob!', + }, + }; + const signature2 = await signTypedData(pkpEthersWallet, msgParams); + const recoveredAddr = ethers_exports.utils.verifyTypedData( + msgParams.domain, + { Person: msgParams.types.Person, Mail: msgParams.types.Mail }, + msgParams.message, + signature2 + ); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr.toLowerCase() !== alice.pkp.ethAddress.toLowerCase()) { + throw new Error( + `\u274C recoveredAddr ${recoveredAddr} should be ${alice.pkp.ethAddress}` + ); + } + } catch (e2) { + throw new Error(`\u274C ${e2.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithLitActionSessionSigsToSignMessage.ts +init_shim(); +var testPkpEthersWithLitActionSessionSigsToSignMessage = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: litActionSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const signature2 = await pkpEthersWallet.signMessage(alice.loveLetter); + console.log('\u2705 signature:', signature2); + } catch (e2) { + throw new Error('\u274C Error: ' + e2.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSign.ts +init_shim(); +var testPkpEthersWithLitActionSessionSigsToEthSign = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice); + console.log('devEnv.network:', devEnv.network); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: litActionSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const message = 'Hello world'; + const hexMsg = ethers_exports.utils.hexlify( + ethers_exports.utils.toUtf8Bytes(message) + ); + const signature2 = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_sign', + params: [alice.pkp.ethAddress, hexMsg], + }, + }); + const recoveredAddr = ethers_exports.utils.verifyMessage( + message, + signature2 + ); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr !== alice.pkp.ethAddress) { + throw new Error( + `\u274C test eth_sign recoveredAddr should be ${alice.pkp.ethAddress} but got ${recoveredAddr}` + ); + } + console.log('\u2705 recoveredAddr:', recoveredAddr); + } catch (e2) { + throw new Error('\u274C Error: ' + e2.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithLitActionSessionSigsToPersonalSign.ts +init_shim(); +var testPkpEthersWithLitActionSessionSigsToPersonalSign = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: litActionSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const message = 'Free the web'; + const hexMsg = ethers_exports.utils.hexlify( + ethers_exports.utils.toUtf8Bytes(message) + ); + const signature2 = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'personal_sign', + params: [hexMsg, alice.pkp.ethAddress], + }, + }); + const recoveredAddr = ethers_exports.utils.verifyMessage( + message, + signature2 + ); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr !== alice.pkp.ethAddress) { + throw new Error( + `\u274C recoveredAddr should be ${alice.pkp.ethAddress} but got ${recoveredAddr}` + ); + } + console.log('\u2705 personal_sign recoveredAddr:', recoveredAddr); + } catch (e2) { + throw new Error('\u274C Error: ' + e2.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithLitActionSessionSigsToSendTx.ts +init_shim(); +var testPkpEthersWithLitActionSessionSigsToSendTx = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: litActionSessionSigs, + }); + await devEnv.getFunds(alice.pkp.ethAddress); + await pkpEthersWallet.init(); + try { + const from = alice.pkp.ethAddress; + const to = alice.pkp.ethAddress; + const gasLimit = ethers_exports.BigNumber.from('21000'); + const value = ethers_exports.BigNumber.from('0'); + const data = '0x'; + const tx = { + from, + to, + gasLimit, + value, + data, + }; + const txRes = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_sendTransaction', + params: [tx], + }, + }); + console.log('\u2705 txRes:', txRes); + } catch (e2) { + if (e2.message.includes('insufficient FPE funds')) { + console.log( + `\u{1F9EA} PKPEthersWallet should be able to send tx (insufficient FPE funds \u2757\uFE0F)` + ); + } else { + throw new Error(`\u274C Error: ${e2.toString()}`); + } + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataV3.ts +init_shim(); +import { + SignTypedDataVersion as SignTypedDataVersion6, + recoverTypedSignature as recoverTypedSignature6, +} from '@metamask/eth-sig-util'; +var testPkpEthersWithPkpSessionSigsToEthSignTypedDataV3 = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const pkpSessionSigs = await getPkpSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: pkpSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const msgParams = { + types: { + EIP712Domain: [ + { name: 'name', type: 'string' }, + { name: 'version', type: 'string' }, + { name: 'chainId', type: 'uint256' }, + { name: 'verifyingContract', type: 'address' }, + ], + Person: [ + { name: 'name', type: 'string' }, + { name: 'wallet', type: 'address' }, + ], + Mail: [ + { name: 'from', type: 'Person' }, + { name: 'to', type: 'Person' }, + { name: 'contents', type: 'string' }, + ], + }, + primaryType: 'Mail', + domain: { + name: 'Ether Mail', + version: '1', + chainId: 80001, + verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', + }, + message: { + from: { + name: 'Cow', + wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', + }, + to: { + name: 'Bob', + wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', + }, + contents: 'Hello, Bob!', + }, + }; + const signature2 = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_signTypedData_v3', + params: [alice.pkp.ethAddress, JSON.stringify(msgParams)], + }, + }); + const recoveredAddr = recoverTypedSignature6({ + data: { + // @ts-ignore + types: msgParams.types, + // @ts-ignore + domain: msgParams.domain, + // @ts-ignore + primaryType: msgParams.primaryType, + // @ts-ignore + message: msgParams.message, + }, + signature: signature2, + version: SignTypedDataVersion6.V3, + }); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr.toLowerCase() !== alice.pkp.ethAddress.toLowerCase()) { + throw new Error( + `\u274C recoveredAddr ${recoveredAddr} should be ${alice.pkp.ethAddress}` + ); + } + } catch (e2) { + throw new Error(`\u274C ${e2.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV3.ts +init_shim(); +import { + SignTypedDataVersion as SignTypedDataVersion7, + recoverTypedSignature as recoverTypedSignature7, +} from '@metamask/eth-sig-util'; +var testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV3 = async ( + devEnv +) => { + const alice = await devEnv.createRandomPerson(); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: litActionSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const msgParams = { + types: { + EIP712Domain: [ + { name: 'name', type: 'string' }, + { name: 'version', type: 'string' }, + { name: 'chainId', type: 'uint256' }, + { name: 'verifyingContract', type: 'address' }, + ], + Person: [ + { name: 'name', type: 'string' }, + { name: 'wallet', type: 'address' }, + ], + Mail: [ + { name: 'from', type: 'Person' }, + { name: 'to', type: 'Person' }, + { name: 'contents', type: 'string' }, + ], + }, + primaryType: 'Mail', + domain: { + name: 'Ether Mail', + version: '1', + chainId: 80001, + verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', + }, + message: { + from: { + name: 'Cow', + wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', + }, + to: { + name: 'Bob', + wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', + }, + contents: 'Hello, Bob!', + }, + }; + const signature2 = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_signTypedData_v3', + params: [alice.pkp.ethAddress, JSON.stringify(msgParams)], + }, + }); + const recoveredAddr = recoverTypedSignature7({ + data: { + // @ts-ignore + types: msgParams.types, + // @ts-ignore + domain: msgParams.domain, + // @ts-ignore + primaryType: msgParams.primaryType, + // @ts-ignore + message: msgParams.message, + }, + signature: signature2, + version: SignTypedDataVersion7.V3, + }); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr.toLowerCase() !== alice.pkp.ethAddress.toLowerCase()) { + throw new Error( + `\u274C recoveredAddr ${recoveredAddr} should be ${alice.pkp.ethAddress}` + ); + } + } catch (e2) { + throw new Error(`\u274C ${e2.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataV4.ts +init_shim(); +import { + SignTypedDataVersion as SignTypedDataVersion8, + recoverTypedSignature as recoverTypedSignature8, +} from '@metamask/eth-sig-util'; +var testPkpEthersWithPkpSessionSigsToEthSignTypedDataV4 = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const pkpSessionSigs = await getPkpSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: pkpSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const msgParams = { + domain: { + chainId: 80001, + name: 'Ether Mail', + verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', + version: '1', + }, + message: { + contents: 'Hello, Bob!', + from: { + name: 'Cow', + wallets: [ + '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', + '0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF', + ], + }, + to: [ + { + name: 'Bob', + wallets: [ + '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', + '0xB0BdaBea57B0BDABeA57b0bdABEA57b0BDabEa57', + '0xB0B0b0b0b0b0B000000000000000000000000000', + ], + }, + ], + }, + primaryType: 'Mail', + types: { + EIP712Domain: [ + { name: 'name', type: 'string' }, + { name: 'version', type: 'string' }, + { name: 'chainId', type: 'uint256' }, + { name: 'verifyingContract', type: 'address' }, + ], + Mail: [ + { name: 'from', type: 'Person' }, + { name: 'to', type: 'Person[]' }, + { name: 'contents', type: 'string' }, + ], + Person: [ + { name: 'name', type: 'string' }, + { name: 'wallets', type: 'address[]' }, + ], + }, + }; + const signature2 = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_signTypedData_v4', + params: [alice.pkp.ethAddress, JSON.stringify(msgParams)], + }, + }); + const recoveredAddr = recoverTypedSignature8({ + data: msgParams, + signature: signature2, + version: SignTypedDataVersion8.V4, + }); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr.toLowerCase() !== alice.pkp.ethAddress.toLowerCase()) { + throw new Error( + `\u274C recoveredAddr ${recoveredAddr} should be ${alice.pkp.ethAddress}` + ); + } + } catch (e2) { + throw new Error(`\u274C ${e2.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV4.ts +init_shim(); +import { + SignTypedDataVersion as SignTypedDataVersion9, + recoverTypedSignature as recoverTypedSignature9, +} from '@metamask/eth-sig-util'; +var testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV4 = async ( + devEnv +) => { + const alice = await devEnv.createRandomPerson(); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: litActionSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const msgParams = { + domain: { + chainId: 80001, + name: 'Ether Mail', + verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', + version: '1', + }, + message: { + contents: 'Hello, Bob!', + from: { + name: 'Cow', + wallets: [ + '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', + '0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF', + ], + }, + to: [ + { + name: 'Bob', + wallets: [ + '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', + '0xB0BdaBea57B0BDABeA57b0bdABEA57b0BDabEa57', + '0xB0B0b0b0b0b0B000000000000000000000000000', + ], + }, + ], + }, + primaryType: 'Mail', + types: { + EIP712Domain: [ + { name: 'name', type: 'string' }, + { name: 'version', type: 'string' }, + { name: 'chainId', type: 'uint256' }, + { name: 'verifyingContract', type: 'address' }, + ], + Mail: [ + { name: 'from', type: 'Person' }, + { name: 'to', type: 'Person[]' }, + { name: 'contents', type: 'string' }, + ], + Person: [ + { name: 'name', type: 'string' }, + { name: 'wallets', type: 'address[]' }, + ], + }, + }; + const signature2 = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_signTypedData_v4', + params: [alice.pkp.ethAddress, JSON.stringify(msgParams)], + }, + }); + const recoveredAddr = recoverTypedSignature9({ + data: msgParams, + signature: signature2, + version: SignTypedDataVersion9.V4, + }); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr.toLowerCase() !== alice.pkp.ethAddress.toLowerCase()) { + throw new Error( + `\u274C recoveredAddr ${recoveredAddr} should be ${alice.pkp.ethAddress}` + ); + } + } catch (e2) { + throw new Error(`\u274C ${e2.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedData.ts +init_shim(); +var testPkpEthersWithPkpSessionSigsToEthSignTypedData = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const pkpSessionSigs = await getPkpSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: pkpSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const msgParams = { + types: { + EIP712Domain: [ + { name: 'name', type: 'string' }, + { name: 'version', type: 'string' }, + { name: 'chainId', type: 'uint256' }, + { name: 'verifyingContract', type: 'address' }, + ], + Person: [ + { name: 'name', type: 'string' }, + { name: 'wallet', type: 'address' }, + ], + Mail: [ + { name: 'from', type: 'Person' }, + { name: 'to', type: 'Person' }, + { name: 'contents', type: 'string' }, + ], + }, + primaryType: 'Mail', + domain: { + name: 'Ether Mail', + version: '1', + chainId: 80001, + verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', + }, + message: { + from: { + name: 'Cow', + wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', + }, + to: { + name: 'Bob', + wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', + }, + contents: 'Hello, Bob!', + }, + }; + const signature2 = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_signTypedData', + params: [alice.pkp.ethAddress, JSON.stringify(msgParams)], + }, + }); + const recoveredAddr = ethers_exports.utils.verifyTypedData( + msgParams.domain, + { Person: msgParams.types.Person, Mail: msgParams.types.Mail }, + msgParams.message, + signature2 + ); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr.toLowerCase() !== alice.pkp.ethAddress.toLowerCase()) { + throw new Error( + `\u274C recoveredAddr ${recoveredAddr} should be ${alice.pkp.ethAddress}` + ); + } + } catch (e2) { + throw new Error(`\u274C ${e2.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedData.ts +init_shim(); +var testPkpEthersWithLitActionSessionSigsToEthSignTypedData = async ( + devEnv +) => { + const alice = await devEnv.createRandomPerson(); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: litActionSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const msgParams = { + types: { + EIP712Domain: [ + { name: 'name', type: 'string' }, + { name: 'version', type: 'string' }, + { name: 'chainId', type: 'uint256' }, + { name: 'verifyingContract', type: 'address' }, + ], + Person: [ + { name: 'name', type: 'string' }, + { name: 'wallet', type: 'address' }, + ], + Mail: [ + { name: 'from', type: 'Person' }, + { name: 'to', type: 'Person' }, + { name: 'contents', type: 'string' }, + ], + }, + primaryType: 'Mail', + domain: { + name: 'Ether Mail', + version: '1', + chainId: 80001, + verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', + }, + message: { + from: { + name: 'Cow', + wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', + }, + to: { + name: 'Bob', + wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', + }, + contents: 'Hello, Bob!', + }, + }; + const signature2 = await ethRequestHandler({ + signer: pkpEthersWallet, + payload: { + method: 'eth_signTypedData', + params: [alice.pkp.ethAddress, JSON.stringify(msgParams)], + }, + }); + const recoveredAddr = ethers_exports.utils.verifyTypedData( + msgParams.domain, + { Person: msgParams.types.Person, Mail: msgParams.types.Mail }, + msgParams.message, + signature2 + ); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr.toLowerCase() !== alice.pkp.ethAddress.toLowerCase()) { + throw new Error( + `\u274C recoveredAddr ${recoveredAddr} should be ${alice.pkp.ethAddress}` + ); + } + } catch (e2) { + throw new Error(`\u274C ${e2.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataUtil.ts +init_shim(); +var testPkpEthersWithPkpSessionSigsToEthSignTypedDataUtil = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const pkpSessionSigs = await getPkpSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: pkpSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const msgParams = { + types: { + EIP712Domain: [ + { name: 'name', type: 'string' }, + { name: 'version', type: 'string' }, + { name: 'chainId', type: 'uint256' }, + { name: 'verifyingContract', type: 'address' }, + ], + Person: [ + { name: 'name', type: 'string' }, + { name: 'wallet', type: 'address' }, + ], + Mail: [ + { name: 'from', type: 'Person' }, + { name: 'to', type: 'Person' }, + { name: 'contents', type: 'string' }, + ], + }, + primaryType: 'Mail', + domain: { + name: 'Ether Mail', + version: '1', + chainId: 80001, + verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', + }, + message: { + from: { + name: 'Cow', + wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', + }, + to: { + name: 'Bob', + wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', + }, + contents: 'Hello, Bob!', + }, + }; + const signature2 = await signTypedData(pkpEthersWallet, msgParams); + const recoveredAddr = ethers_exports.utils.verifyTypedData( + msgParams.domain, + { Person: msgParams.types.Person, Mail: msgParams.types.Mail }, + msgParams.message, + signature2 + ); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr.toLowerCase() !== alice.pkp.ethAddress.toLowerCase()) { + throw new Error( + `\u274C recoveredAddr ${recoveredAddr} should be ${alice.pkp.ethAddress}` + ); + } + } catch (e2) { + throw new Error(`\u274C ${e2.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataUtil.ts +init_shim(); +var testPkpEthersWithLitActionSessionSigsToEthSignTypedDataUtil = async ( + devEnv +) => { + const alice = await devEnv.createRandomPerson(); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice); + const pkpEthersWallet = new PKPEthersWallet({ + litNodeClient: devEnv.litNodeClient, + pkpPubKey: alice.pkp.publicKey, + controllerSessionSigs: litActionSessionSigs, + }); + await pkpEthersWallet.init(); + try { + const msgParams = { + types: { + EIP712Domain: [ + { name: 'name', type: 'string' }, + { name: 'version', type: 'string' }, + { name: 'chainId', type: 'uint256' }, + { name: 'verifyingContract', type: 'address' }, + ], + Person: [ + { name: 'name', type: 'string' }, + { name: 'wallet', type: 'address' }, + ], + Mail: [ + { name: 'from', type: 'Person' }, + { name: 'to', type: 'Person' }, + { name: 'contents', type: 'string' }, + ], + }, + primaryType: 'Mail', + domain: { + name: 'Ether Mail', + version: '1', + chainId: 80001, + verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', + }, + message: { + from: { + name: 'Cow', + wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', + }, + to: { + name: 'Bob', + wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', + }, + contents: 'Hello, Bob!', + }, + }; + const signature2 = await signTypedData(pkpEthersWallet, msgParams); + const recoveredAddr = ethers_exports.utils.verifyTypedData( + msgParams.domain, + { Person: msgParams.types.Person, Mail: msgParams.types.Mail }, + msgParams.message, + signature2 + ); + if (signature2.length !== 132) { + throw new Error('\u274C signature should be 132 characters long'); + } + if (recoveredAddr.toLowerCase() !== alice.pkp.ethAddress.toLowerCase()) { + throw new Error( + `\u274C recoveredAddr ${recoveredAddr} should be ${alice.pkp.ethAddress}` + ); + } + } catch (e2) { + throw new Error(`\u274C ${e2.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testUseCustomAuthSessionSigsToPkpSignExecuteJs.ts +init_shim(); +var testUseCustomAuthSessionSigsToPkpSignExecuteJs = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const customAuthMethod = { + authMethodType: 89989, + authMethodId: 'app-id-xxx:user-id-yyy', + accessToken: 'xxx', + }; + const addPermittedAuthMethodReceipt = + await alice.contractsClient.addPermittedAuthMethod({ + pkpTokenId: alice.pkp.tokenId, + authMethodType: customAuthMethod.authMethodType, + authMethodId: customAuthMethod.authMethodId, + authMethodScopes: [AUTH_METHOD_SCOPE.SignAnything], + }); + console.log( + '\u2705 addPermittedAuthMethodReceipt:', + addPermittedAuthMethodReceipt + ); + const litActionCodeString = `(async () => { + const a = 1; + const b = 2; + + if (a + b === 3 && customAuthMethod.authMethodType === 89989) { + LitActions.setResponse({response:"true"}); + } else { + LitActions.setResponse({response:"false"}); + } + + console.log("Lit.Auth:", Lit.Auth); + })()`; + const IPFSID = await stringToIpfsHash(litActionCodeString); + console.log('\u2705 IPFSID:', IPFSID.toString()); + const addPermittedActionReceipt = + await alice.contractsClient.addPermittedAction({ + ipfsId: IPFSID, + pkpTokenId: alice.pkp.tokenId, + authMethodScopes: [AUTH_METHOD_SCOPE.SignAnything], + }); + console.log('\u2705 addPermittedActionReceipt:', addPermittedActionReceipt); + const centralisation = + CENTRALISATION_BY_NETWORK[devEnv.litNodeClient.config.litNetwork]; + const litActionSessionSigs = + await devEnv.litNodeClient.getLitActionSessionSigs({ + pkpPublicKey: alice.pkp.publicKey, + resourceAbilityRequests: [ + { + resource: new LitPKPResource('*'), + ability: LIT_ABILITY.PKPSigning, + }, + { + resource: new LitActionResource('*'), + ability: LIT_ABILITY.LitActionExecution, + }, + ], + // litActionIpfsId: IPFSID, + litActionCode: Buffer.from(litActionCodeString).toString('base64'), + jsParams: { + publicKey: `0x${alice.pkp.publicKey}`, + customAuthMethod, + sigName: 'custom-auth-sig', + }, + ...(centralisation === 'decentralised' && { + capabilityAuthSigs: [devEnv.superCapacityDelegationAuthSig], + }), + }); + try { + const res = await devEnv.litNodeClient.pkpSign({ + toSign: alice.loveLetter, + pubKey: alice.pkp.publicKey, + sessionSigs: litActionSessionSigs, + }); + console.log('\u2705 pkpSign res:', res); + } catch (e2) { + throw new Error(e2); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } + try { + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: litActionSessionSigs, + code: `(async () => { + const sigShare = await LitActions.signEcdsa({ + toSign: dataToSign, + publicKey, + sigName: "sig", + }); + })();`, + jsParams: { + dataToSign: alice.loveLetter, + publicKey: alice.pkp.publicKey, + }, + }); + console.log('\u2705 executeJs res:', res); + } catch (e2) { + throw new Error(e2); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testExecuteJsSignAndCombineEcdsa.ts +init_shim(); +var testExecuteJsSignAndCombineEcdsa = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const bob = await devEnv.createRandomPerson(); + const appOwnersCapacityDelegationAuthSig = ( + await devEnv.litNodeClient.createCapacityDelegationAuthSig({ + dAppOwnerWallet: alice.wallet, + }) + ).capacityDelegationAuthSig; + const bobsSessionSigs = await getEoaSessionSigsWithCapacityDelegations( + devEnv, + bob.wallet, + appOwnersCapacityDelegationAuthSig + ); + const bobsSingleSessionSig = + bobsSessionSigs[devEnv.litNodeClient.config.bootstrapUrls[0]]; + console.log('bobsSingleSessionSig:', bobsSingleSessionSig); + const regex = /urn:recap:[\w+\/=]+/g; + const recaps = bobsSingleSessionSig.signedMessage.match(regex) || []; + recaps.forEach((r3) => { + const encodedRecap = r3.split(':')[2]; + const decodedRecap = Buffer.from(encodedRecap, 'base64').toString(); + console.log(decodedRecap); + }); + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: bobsSessionSigs, + code: `(async () => { + const sigShare = await LitActions.signAndCombineEcdsa({ + toSign: dataToSign, + publicKey, + sigName: "sig", + }); + Lit.Actions.setResponse({ + response: sigShare + }); + })();`, + jsParams: { + dataToSign: alice.loveLetter, + publicKey: bob.pkp.publicKey, + }, + }); + devEnv.releasePrivateKeyFromUser(alice); + devEnv.releasePrivateKeyFromUser(bob); + if (!res.response) { + throw new Error('Response not found, expecting signature in response'); + } + const sig = JSON.parse(res.response); + console.log('signature returned as a response', sig); + if (!sig.r) { + throw new Error('invalid signature returned from lit action'); + } + if (!sig.s) { + throw new Error('invalid signature returned from lit action'); + } + if (sig.v === void 0) { + throw new Error('invalid signature returned from lit action'); + } + console.log( + '\u2705 testDelegatingCapacityCreditsNFTToAnotherWalletToExecuteJs' + ); +}; + +// local-tests/tests/testExecuteJsDecryptAndCombine.ts +init_shim(); +var testExecutJsDecryptAndCombine = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const accs = AccessControlConditions.getEmvBasicAccessControlConditions({ + userAddress: alice.authMethodOwnedPkp.ethAddress, + }); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice); + const encryptRes = await encryptString( + { + accessControlConditions: accs, + dataToEncrypt: 'Hello world', + }, + devEnv.litNodeClient + ); + log('encryptRes:', encryptRes); + if (!encryptRes.ciphertext) { + throw new Error(`Expected "ciphertext" in encryptRes`); + } + if (!encryptRes.dataToEncryptHash) { + throw new Error(`Expected "dataToEncryptHash" to in encryptRes`); + } + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: litActionSessionSigs, + code: `(async () => { + const resp = await Lit.Actions.decryptAndCombine({ + accessControlConditions, + ciphertext, + dataToEncryptHash, + authSig: null, + chain: 'ethereum', + }); + Lit.Actions.setResponse({ + response: resp + }); + })();`, + jsParams: { + accessControlConditions: accs, + dataToEncryptHash: encryptRes.dataToEncryptHash, + ciphertext: encryptRes.ciphertext, + }, + }); + devEnv.releasePrivateKeyFromUser(alice); + if (res.response !== 'Hello world') { + throw new Error('content does not match what was expected'); + } +}; + +// local-tests/tests/testExecuteJsBroadcastAndCollect.ts +init_shim(); +var testExecuteJsBroadcastAndCollect = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const accs = AccessControlConditions.getEmvBasicAccessControlConditions({ + userAddress: alice.authMethodOwnedPkp.ethAddress, + }); + const litActionSessionSigs = await getLitActionSessionSigs(devEnv, alice); + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: litActionSessionSigs, + code: `(async () => { + let rand = Math.floor(Math.random() * 100); + const resp = await Lit.Actions.broadcastAndCollect({ + name: "temperature", + value: rand.toString(), + }); + Lit.Actions.setResponse({ + response: JSON.stringify(resp) + }); + })();`, + jsParams: {}, + }); + devEnv.releasePrivateKeyFromUser(alice); + const response = res.response; + if (!response) { + throw new Error('Should contained broadcast data'); + } +}; + +// local-tests/tests/testRelayer.ts +init_shim(); +var testRelayer = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + const litRelay = new LitRelay({ + relayUrl: LitRelay.getRelayUrl(devEnv.network), + relayApiKey: 'test-api-key', + }); + const ethWalletProvider = new EthWalletProvider({ + relay: litRelay, + litNodeClient: devEnv.litNodeClient, + }); + const pkps = await ethWalletProvider.fetchPKPsThroughRelayer( + alice.authMethod + ); + if (pkps.length <= 0) { + throw new Error('No PKPs found'); + } else { + console.log('\u2705 1. [testRelayer] /fetch-pkps-by-auth-method works'); + } + const claimRequest = { + authMethod: alice.authMethod, + signer: alice.wallet, + }; + const claimRes = await devEnv.litNodeClient.claimKeyId(claimRequest); + if (!claimRes.claimedKeyId) { + throw new Error(`Expected "claimedKeyId" in claimRes`); + } + if (!claimRes.pubkey) { + throw new Error(`Expected "pubkey" in claimRes`); + } + if (!claimRes.mintTx) { + throw new Error(`Expected "mintTx" in claimRes`); + } + claimRes.signatures.forEach((sig) => { + if (!sig.r) { + throw new Error(`Expected "r" in sig`); + } + if (!sig.s) { + throw new Error(`Expected "s" in sig`); + } + if (!sig.v) { + throw new Error(`Expected "v" in sig`); + } + }); + log('\u2705 2. [testRelayer] Claim works'); +}; + +// local-tests/tests/wrapped-keys/testEthereumSignMessageGeneratedKey.ts +init_shim(); + +// packages/wrapped-keys/src/index.ts +init_shim(); + +// packages/wrapped-keys/src/lib/api/index.ts +init_shim(); + +// packages/wrapped-keys/src/lib/api/batch-generate-private-keys.ts +init_shim(); + +// packages/wrapped-keys/src/lib/api/utils.ts +init_shim(); + +// packages/wrapped-keys/src/lib/constants.ts +init_shim(); +var CHAIN_ETHEREUM = 'ethereum'; +var LIT_PREFIX = 'lit_'; +var NETWORK_EVM = 'evm'; +var NETWORK_SOLANA = 'solana'; + +// packages/wrapped-keys/src/lib/api/utils.ts +function getKeyTypeFromNetwork(network) { + if (network === NETWORK_EVM) { + return 'K256'; + } else if (network === NETWORK_SOLANA) { + return 'ed25519'; + } else { + throw new Error(`Network not implemented ${network}`); + } +} +function getFirstSessionSig(pkpSessionSigs) { + const sessionSigsEntries = Object.entries(pkpSessionSigs); + if (sessionSigsEntries.length === 0) { + throw new Error( + `Invalid pkpSessionSigs, length zero: ${JSON.stringify(pkpSessionSigs)}` + ); + } + const [[, sessionSig]] = sessionSigsEntries; + log(`Session Sig being used: ${JSON.stringify(sessionSig)}`); + return sessionSig; +} +function getPkpAddressFromSessionSig(pkpSessionSig) { + const sessionSignedMessage = JSON.parse(pkpSessionSig.signedMessage); + const capabilities = sessionSignedMessage.capabilities; + if (!capabilities || capabilities.length === 0) { + throw new Error( + `Capabilities in the session's signedMessage is empty, but required.` + ); + } + const delegationAuthSig = capabilities.find(({ algo }) => algo === 'LIT_BLS'); + if (!delegationAuthSig) { + throw new Error( + 'SessionSig is not from a PKP; no LIT_BLS capabilities found' + ); + } + const pkpAddress = delegationAuthSig.address; + log(`pkpAddress to permit decryption: ${pkpAddress}`); + return pkpAddress; +} +function getPkpAccessControlCondition(pkpAddress) { + if (!ethers_exports.utils.isAddress(pkpAddress)) { + throw new Error( + `pkpAddress is not a valid Ethereum Address: ${pkpAddress}` + ); + } + return { + contractAddress: '', + standardContractType: '', + chain: CHAIN_ETHEREUM, + method: '', + parameters: [':userAddress'], + returnValueTest: { + comparator: '=', + value: pkpAddress, + }, + }; +} + +// packages/wrapped-keys/src/lib/lit-actions-client/index.ts +init_shim(); + +// packages/wrapped-keys/src/lib/lit-actions-client/batch-generate-keys.ts +init_shim(); + +// packages/wrapped-keys/src/lib/lit-actions-client/utils.ts +init_shim(); + +// packages/wrapped-keys/src/lib/lit-actions-client/code-repository.ts +init_shim(); +var litActionCodeRepository = Object.freeze({ + signTransaction: Object.seal({ + evm: '', + solana: '', + }), + signMessage: Object.seal({ + evm: '', + solana: '', + }), + generateEncryptedKey: Object.seal({ + evm: '', + solana: '', + }), + exportPrivateKey: Object.seal({ + evm: '', + solana: '', + }), +}); +var litActionCodeRepositoryCommon = { + batchGenerateEncryptedKeys: '', +}; + +// packages/wrapped-keys/src/lib/lit-actions-client/constants.ts +init_shim(); +var LIT_ACTION_CID_REPOSITORY = Object.freeze({ + signTransaction: Object.freeze({ + evm: 'QmRpAgGKEmgeBRhqdC2EH17QUt6puwsbm8Z2nNneVN4uJG', + solana: 'QmR1nPG2tnmC72zuCEMZUZrrMEkbDiMPNHW45Dsm2n7xnk', + }), + signMessage: Object.freeze({ + evm: 'QmXi9iqJvXrHoUGSo5WREonrruDhzQ7cFr7Cry3wX2hmue', + solana: 'QmcEJGVqRYtVukjm2prCPT7Fs66GpaqZwmZoxEHMHor6Jz', + }), + generateEncryptedKey: Object.freeze({ + evm: 'QmeD6NYCWhUCLgxgpkgSguaKjwnpCnJ6Yf8SdsyPpK4eKK', + solana: 'QmPkVD3hEjMi1T5zQuvdrFCXaGTEMHNdAhAL4WHkqxijrQ', + }), + exportPrivateKey: Object.freeze({ + evm: 'QmUJ74pTUqeeHzDGdfwCph1vJVNJ1rRzJdvMiTjS1BMwYj', + solana: 'QmUJ74pTUqeeHzDGdfwCph1vJVNJ1rRzJdvMiTjS1BMwYj', + }), +}); +var LIT_ACTION_CID_REPOSITORY_COMMON = Object.freeze({ + batchGenerateEncryptedKeys: 'QmR8Zs7ctSEctxBrSnAYhMXFXCC1ub8K1xvMn5Js3NCSAA', +}); + +// packages/wrapped-keys/src/lib/lit-actions-client/utils.ts +function postLitActionValidation(result) { + if (!result) { + throw new Error('There was an unknown error running the Lit Action.'); + } + const { response } = result; + if (!response) { + throw new Error( + `Expected "response" in Lit Action result: ${JSON.stringify(result)}` + ); + } + if (typeof response !== 'string') { + throw new Error( + `Lit Action should return a string response: ${JSON.stringify(result)}` + ); + } + if (!result.success) { + throw new Error(`Expected "success" in res: ${JSON.stringify(result)}`); + } + if (response.startsWith('Error:')) { + throw new Error(`Error executing the Signing Lit Action: ${response}`); + } + return response; +} +function getLitActionCid(network, actionType) { + assertNetworkIsValid(network); + return LIT_ACTION_CID_REPOSITORY[actionType][network]; +} +function getLitActionCode(network, actionType) { + assertNetworkIsValid(network); + return litActionCodeRepository[actionType][network]; +} +function assertNetworkIsValid(network) { + const validNetworks = ['evm', 'solana']; + if (!validNetworks.includes(network)) { + throw new Error( + `Invalid network: ${network}. Must be one of ${validNetworks.join(', ')}.` + ); + } +} +function getLitActionCodeOrCid(network, actionType) { + const litActionCode = getLitActionCode(network, actionType); + if (litActionCode) { + return { litActionCode }; + } + return { litActionIpfsCid: getLitActionCid(network, actionType) }; +} +function getLitActionCodeOrCidCommon(actionType) { + const litActionCode = getLitActionCodeCommon(actionType); + if (litActionCode) { + return { litActionCode }; + } + return { litActionIpfsCid: getLitActionCidCommon(actionType) }; +} +function getLitActionCidCommon(actionType) { + return LIT_ACTION_CID_REPOSITORY_COMMON[actionType]; +} +function getLitActionCodeCommon(actionType) { + return litActionCodeRepositoryCommon[actionType]; +} + +// packages/wrapped-keys/src/lib/lit-actions-client/batch-generate-keys.ts +async function batchGenerateKeysWithLitAction(args) { + const { + accessControlConditions, + litNodeClient, + actions, + pkpSessionSigs, + litActionIpfsCid, + litActionCode, + } = args; + const result = await litNodeClient.executeJs({ + useSingleNode: true, + sessionSigs: pkpSessionSigs, + ipfsId: litActionIpfsCid, + code: litActionCode, + jsParams: { + actions, + accessControlConditions, + }, + ipfsOptions: { + overwriteCode: + GLOBAL_OVERWRITE_IPFS_CODE_BY_NETWORK[litNodeClient.config.litNetwork], + }, + }); + const response = postLitActionValidation(result); + return JSON.parse(response); +} + +// packages/wrapped-keys/src/lib/lit-actions-client/export-private-key.ts +init_shim(); +async function exportPrivateKeyWithLitAction(args) { + const { + accessControlConditions, + litNodeClient, + pkpSessionSigs, + litActionCode, + litActionIpfsCid, + storedKeyMetadata, + } = args; + const { + pkpAddress, + ciphertext, + dataToEncryptHash, + ...storeKeyMetadataMinusEncryptedAndPkp + } = storedKeyMetadata; + const result = await litNodeClient.executeJs({ + sessionSigs: pkpSessionSigs, + code: litActionCode, + ipfsId: litActionIpfsCid, + jsParams: { + pkpAddress, + ciphertext, + dataToEncryptHash, + accessControlConditions, + }, + ipfsOptions: { + overwriteCode: + GLOBAL_OVERWRITE_IPFS_CODE_BY_NETWORK[litNodeClient.config.litNetwork], + }, + }); + const decryptedPrivateKey = postLitActionValidation(result); + return { + decryptedPrivateKey, + pkpAddress, + ...storeKeyMetadataMinusEncryptedAndPkp, + }; +} + +// packages/wrapped-keys/src/lib/lit-actions-client/generate-key.ts +init_shim(); +async function generateKeyWithLitAction({ + litNodeClient, + pkpSessionSigs, + litActionIpfsCid, + litActionCode, + accessControlConditions, + pkpAddress, +}) { + const result = await litNodeClient.executeJs({ + useSingleNode: true, + sessionSigs: pkpSessionSigs, + ipfsId: litActionIpfsCid, + code: litActionCode, + jsParams: { + pkpAddress, + accessControlConditions, + }, + ipfsOptions: { + overwriteCode: + GLOBAL_OVERWRITE_IPFS_CODE_BY_NETWORK[litNodeClient.config.litNetwork], + }, + }); + const response = postLitActionValidation(result); + return JSON.parse(response); +} + +// packages/wrapped-keys/src/lib/lit-actions-client/sign-message.ts +init_shim(); +async function signMessageWithLitAction(args) { + const { + accessControlConditions, + litNodeClient, + messageToSign, + pkpSessionSigs, + litActionIpfsCid, + litActionCode, + storedKeyMetadata, + } = args; + const { pkpAddress, ciphertext, dataToEncryptHash } = storedKeyMetadata; + const result = await litNodeClient.executeJs({ + sessionSigs: pkpSessionSigs, + ipfsId: litActionIpfsCid, + code: litActionCode, + jsParams: { + pkpAddress, + ciphertext, + dataToEncryptHash, + messageToSign, + accessControlConditions, + }, + ipfsOptions: { + overwriteCode: + GLOBAL_OVERWRITE_IPFS_CODE_BY_NETWORK[litNodeClient.config.litNetwork], + }, + }); + return postLitActionValidation(result); +} + +// packages/wrapped-keys/src/lib/lit-actions-client/sign-transaction.ts +init_shim(); +async function signTransactionWithLitAction({ + accessControlConditions, + broadcast, + litActionIpfsCid, + litActionCode, + litNodeClient, + pkpSessionSigs, + storedKeyMetadata: { ciphertext, dataToEncryptHash, pkpAddress }, + unsignedTransaction, + versionedTransaction, +}) { + const result = await litNodeClient.executeJs({ + sessionSigs: pkpSessionSigs, + ipfsId: litActionIpfsCid, + code: litActionCode, + jsParams: { + pkpAddress, + ciphertext, + dataToEncryptHash, + unsignedTransaction, + broadcast, + accessControlConditions, + versionedTransaction, + }, + ipfsOptions: { + overwriteCode: + GLOBAL_OVERWRITE_IPFS_CODE_BY_NETWORK[litNodeClient.config.litNetwork], + }, + }); + return postLitActionValidation(result); +} + +// packages/wrapped-keys/src/lib/service-client/index.ts +init_shim(); + +// packages/wrapped-keys/src/lib/service-client/client.ts +init_shim(); + +// packages/wrapped-keys/src/lib/service-client/utils.ts +init_shim(); + +// packages/wrapped-keys/src/lib/service-client/constants.ts +init_shim(); +var SERVICE_URL_BY_NETWORKTYPE = { + TestNetworks: 'https://test.wrapped.litprotocol.com/encrypted', + Production: 'https://wrapped.litprotocol.com/encrypted', +}; +var SERVICE_URL_BY_LIT_NETWORK = { + [LIT_NETWORK.DatilDev]: SERVICE_URL_BY_NETWORKTYPE.TestNetworks, + [LIT_NETWORK.DatilTest]: SERVICE_URL_BY_NETWORKTYPE.TestNetworks, + [LIT_NETWORK.Datil]: SERVICE_URL_BY_NETWORKTYPE.Production, +}; +var LIT_SESSIONSIG_AUTHORIZATION_SCHEMA_PREFIX = 'LitSessionSig:'; + +// packages/wrapped-keys/src/lib/service-client/utils.ts +function composeAuthHeader(sessionSig) { + const sessionSigUintArr = uint8arrayFromString(JSON.stringify(sessionSig)); + return `${LIT_SESSIONSIG_AUTHORIZATION_SCHEMA_PREFIX}${uint8ArrayToBase64( + sessionSigUintArr + )}`; +} +var supportedNetworks = ['datil-dev', 'datil-test', 'datil']; +function isSupportedLitNetwork2(litNetwork) { + if (!supportedNetworks.includes(litNetwork)) { + throw new Error( + `Unsupported LIT_NETWORK! (${supportedNetworks.join('|')}) are supported.` + ); + } +} +function getServiceUrl({ litNetwork }) { + isSupportedLitNetwork2(litNetwork); + return SERVICE_URL_BY_LIT_NETWORK[litNetwork]; +} +function getBaseRequestParams(requestParams) { + const { sessionSig, method, litNetwork } = requestParams; + return { + baseUrl: getServiceUrl(requestParams), + initParams: { + method, + headers: { + 'x-correlation-id': requestParams.requestId, + 'Content-Type': 'application/json', + 'Lit-Network': litNetwork, + Authorization: composeAuthHeader(sessionSig), + // As Base64 string to avoid escaping issues + }, + }, + }; +} +async function getResponseErrorMessage(response) { + try { + const parsedResponse = await response.json(); + if (parsedResponse.message) { + return parsedResponse.message; + } + return JSON.stringify(parsedResponse); + } catch (e2) { + return response.text(); + } +} +async function getResponseJson(response) { + try { + return await response.json(); + } catch (e2) { + return await response.text(); + } +} +function generateRequestId() { + return Math.random().toString(16).slice(2); +} +async function makeRequest({ url, init: init2, requestId }) { + try { + const response = await fetch(url, { ...init2 }); + if (!response.ok) { + const errorMessage = await getResponseErrorMessage(response); + throw new Error(`HTTP(${response.status}): ${errorMessage}`); + } + const result = await getResponseJson(response); + if (typeof result === 'string') { + throw new Error(`HTTP(${response.status}): ${result}`); + } + return result; + } catch (e2) { + throw new Error( + `Request(${requestId}) for wrapped key failed. Error: ${e2.message}${ + e2.cause ? ' - ' + e2.cause : '' + }` + ); + } +} + +// packages/wrapped-keys/src/lib/service-client/client.ts +async function listPrivateKeyMetadata(params) { + const { litNetwork, sessionSig, pkpAddress } = params; + const requestId = generateRequestId(); + const { baseUrl, initParams } = getBaseRequestParams({ + litNetwork, + sessionSig, + method: 'GET', + requestId, + }); + return makeRequest({ + url: `${baseUrl}/${pkpAddress}`, + init: initParams, + requestId, + }); +} +async function fetchPrivateKey(params) { + const { litNetwork, sessionSig, id: id2, pkpAddress } = params; + const requestId = generateRequestId(); + const { baseUrl, initParams } = getBaseRequestParams({ + litNetwork, + sessionSig, + method: 'GET', + requestId, + }); + return makeRequest({ + url: `${baseUrl}/${pkpAddress}/${id2}`, + init: initParams, + requestId, + }); +} +async function storePrivateKey(params) { + const { litNetwork, sessionSig, storedKeyMetadata } = params; + const requestId = generateRequestId(); + const { baseUrl, initParams } = getBaseRequestParams({ + litNetwork, + sessionSig, + method: 'POST', + requestId, + }); + const { pkpAddress, id: id2 } = await makeRequest({ + url: baseUrl, + init: { + ...initParams, + body: JSON.stringify(storedKeyMetadata), + }, + requestId, + }); + return { pkpAddress, id: id2 }; +} +async function storePrivateKeyBatch(params) { + const { litNetwork, sessionSig, storedKeyMetadataBatch } = params; + const requestId = generateRequestId(); + const { baseUrl, initParams } = getBaseRequestParams({ + litNetwork, + sessionSig, + method: 'POST', + requestId, + }); + const { pkpAddress, ids } = await makeRequest({ + url: `${baseUrl}_batch`, + init: { + ...initParams, + body: JSON.stringify({ keyParamsBatch: storedKeyMetadataBatch }), + }, + requestId, + }); + return { pkpAddress, ids }; +} + +// packages/wrapped-keys/src/lib/api/batch-generate-private-keys.ts +async function batchGeneratePrivateKeys(params) { + const { pkpSessionSigs, litNodeClient } = params; + const sessionSig = getFirstSessionSig(pkpSessionSigs); + const pkpAddress = getPkpAddressFromSessionSig(sessionSig); + const allowPkpAddressToDecrypt = getPkpAccessControlCondition(pkpAddress); + const { litActionCode, litActionIpfsCid } = getLitActionCodeOrCidCommon( + 'batchGenerateEncryptedKeys' + ); + const actionResults = await batchGenerateKeysWithLitAction({ + ...params, + litActionIpfsCid: litActionCode ? void 0 : litActionIpfsCid, + litActionCode: litActionCode ? litActionCode : void 0, + accessControlConditions: [allowPkpAddressToDecrypt], + pkpSessionSigs, + }); + const keyParamsBatch = actionResults.map((keyData) => { + const { generateEncryptedPrivateKey, network } = keyData; + return { + ...generateEncryptedPrivateKey, + keyType: getKeyTypeFromNetwork(network), + }; + }); + const { ids } = await storePrivateKeyBatch({ + sessionSig, + storedKeyMetadataBatch: keyParamsBatch, + litNetwork: litNodeClient.config.litNetwork, + }); + const results = actionResults.map((actionResult, ndx) => { + const { + generateEncryptedPrivateKey: { memo, publicKey }, + } = actionResult; + const id2 = ids[ndx]; + const signature2 = actionResult.signMessage?.signature; + return { + ...(signature2 ? { signMessage: { signature: signature2 } } : {}), + generateEncryptedPrivateKey: { + memo, + id: id2, + generatedPublicKey: publicKey, + pkpAddress, + }, + }; + }); + return { pkpAddress, results }; +} + +// packages/wrapped-keys/src/lib/api/export-private-key.ts +init_shim(); +async function exportPrivateKey(params) { + const { litNodeClient, network, pkpSessionSigs, id: id2 } = params; + const sessionSig = getFirstSessionSig(pkpSessionSigs); + const pkpAddress = getPkpAddressFromSessionSig(sessionSig); + const storedKeyMetadata = await fetchPrivateKey({ + pkpAddress, + id: id2, + sessionSig, + litNetwork: litNodeClient.config.litNetwork, + }); + const allowPkpAddressToDecrypt = getPkpAccessControlCondition( + storedKeyMetadata.pkpAddress + ); + const { litActionCode, litActionIpfsCid } = getLitActionCodeOrCid( + network, + 'exportPrivateKey' + ); + return exportPrivateKeyWithLitAction({ + ...params, + litActionIpfsCid: litActionCode ? void 0 : litActionIpfsCid, + litActionCode: litActionCode ? litActionCode : void 0, + accessControlConditions: [allowPkpAddressToDecrypt], + pkpSessionSigs, + storedKeyMetadata, + }); +} + +// packages/wrapped-keys/src/lib/api/generate-private-key.ts +init_shim(); +async function generatePrivateKey(params) { + const { pkpSessionSigs, network, litNodeClient, memo } = params; + const firstSessionSig = getFirstSessionSig(pkpSessionSigs); + const pkpAddress = getPkpAddressFromSessionSig(firstSessionSig); + const allowPkpAddressToDecrypt = getPkpAccessControlCondition(pkpAddress); + const { litActionCode, litActionIpfsCid } = getLitActionCodeOrCid( + network, + 'generateEncryptedKey' + ); + const { ciphertext, dataToEncryptHash, publicKey } = + await generateKeyWithLitAction({ + ...params, + pkpAddress, + litActionIpfsCid: litActionCode ? void 0 : litActionIpfsCid, + litActionCode: litActionCode ? litActionCode : void 0, + accessControlConditions: [allowPkpAddressToDecrypt], + }); + const { id: id2 } = await storePrivateKey({ + sessionSig: firstSessionSig, + storedKeyMetadata: { + ciphertext, + publicKey, + keyType: getKeyTypeFromNetwork(network), + dataToEncryptHash, + memo, + }, + litNetwork: litNodeClient.config.litNetwork, + }); + return { + pkpAddress, + id: id2, + generatedPublicKey: publicKey, + }; +} + +// packages/wrapped-keys/src/lib/api/get-encrypted-key.ts +init_shim(); +async function getEncryptedKey(params) { + const { pkpSessionSigs, litNodeClient, id: id2 } = params; + const sessionSig = getFirstSessionSig(pkpSessionSigs); + const pkpAddress = getPkpAddressFromSessionSig(sessionSig); + return fetchPrivateKey({ + pkpAddress, + id: id2, + sessionSig, + litNetwork: litNodeClient.config.litNetwork, + }); +} + +// packages/wrapped-keys/src/lib/api/import-private-key.ts +init_shim(); +async function importPrivateKey(params) { + const { + pkpSessionSigs, + privateKey, + publicKey, + keyType, + litNodeClient, + memo, + } = params; + const firstSessionSig = getFirstSessionSig(pkpSessionSigs); + const pkpAddress = getPkpAddressFromSessionSig(firstSessionSig); + const allowPkpAddressToDecrypt = getPkpAccessControlCondition(pkpAddress); + const saltedPrivateKey = LIT_PREFIX + privateKey; + const { ciphertext, dataToEncryptHash } = await encryptString( + { + accessControlConditions: [allowPkpAddressToDecrypt], + dataToEncrypt: saltedPrivateKey, + }, + litNodeClient + ); + const { id: id2 } = await storePrivateKey({ + sessionSig: firstSessionSig, + litNetwork: litNodeClient.config.litNetwork, + storedKeyMetadata: { + ciphertext, + publicKey, + keyType, + dataToEncryptHash, + memo, + }, + }); + return { pkpAddress, id: id2 }; +} + +// packages/wrapped-keys/src/lib/api/list-encrypted-key-metadata.ts +init_shim(); +async function listEncryptedKeyMetadata(params) { + const { pkpSessionSigs, litNodeClient } = params; + const sessionSig = getFirstSessionSig(pkpSessionSigs); + const pkpAddress = getPkpAddressFromSessionSig(sessionSig); + return listPrivateKeyMetadata({ + pkpAddress, + sessionSig, + litNetwork: litNodeClient.config.litNetwork, + }); +} + +// packages/wrapped-keys/src/lib/api/sign-message-with-encrypted-key.ts +init_shim(); +async function signMessageWithEncryptedKey(params) { + const { litNodeClient, network, pkpSessionSigs, id: id2 } = params; + const sessionSig = getFirstSessionSig(pkpSessionSigs); + const pkpAddress = getPkpAddressFromSessionSig(sessionSig); + const storedKeyMetadata = await fetchPrivateKey({ + pkpAddress, + id: id2, + sessionSig, + litNetwork: litNodeClient.config.litNetwork, + }); + const allowPkpAddressToDecrypt = getPkpAccessControlCondition( + storedKeyMetadata.pkpAddress + ); + const { litActionCode, litActionIpfsCid } = getLitActionCodeOrCid( + network, + 'signMessage' + ); + return signMessageWithLitAction({ + ...params, + litActionIpfsCid: litActionCode ? void 0 : litActionIpfsCid, + litActionCode: litActionCode ? litActionCode : void 0, + accessControlConditions: [allowPkpAddressToDecrypt], + pkpSessionSigs, + storedKeyMetadata, + }); +} + +// packages/wrapped-keys/src/lib/api/sign-transaction-with-encrypted-key.ts +init_shim(); +async function signTransactionWithEncryptedKey(params) { + const { litNodeClient, network, pkpSessionSigs, id: id2 } = params; + const sessionSig = getFirstSessionSig(pkpSessionSigs); + const pkpAddress = getPkpAddressFromSessionSig(sessionSig); + const storedKeyMetadata = await fetchPrivateKey({ + pkpAddress, + id: id2, + sessionSig, + litNetwork: litNodeClient.config.litNetwork, + }); + const allowPkpAddressToDecrypt = getPkpAccessControlCondition( + storedKeyMetadata.pkpAddress + ); + const { litActionCode, litActionIpfsCid } = getLitActionCodeOrCid( + network, + 'signTransaction' + ); + return signTransactionWithLitAction({ + ...params, + litActionIpfsCid: litActionCode ? void 0 : litActionIpfsCid, + litActionCode: litActionCode ? litActionCode : void 0, + storedKeyMetadata, + accessControlConditions: [allowPkpAddressToDecrypt], + }); +} + +// packages/wrapped-keys/src/lib/api/store-encrypted-key.ts +init_shim(); +async function storeEncryptedKey(params) { + const { pkpSessionSigs, litNodeClient } = params; + const sessionSig = getFirstSessionSig(pkpSessionSigs); + const { publicKey, keyType, dataToEncryptHash, ciphertext, memo } = params; + return storePrivateKey({ + storedKeyMetadata: { + publicKey, + keyType, + dataToEncryptHash, + ciphertext, + memo, + }, + sessionSig, + litNetwork: litNodeClient.config.litNetwork, + }); +} + +// packages/wrapped-keys/src/lib/api/store-encrypted-key-batch.ts +init_shim(); +async function storeEncryptedKeyBatch(params) { + const { pkpSessionSigs, litNodeClient, keyBatch } = params; + const sessionSig = getFirstSessionSig(pkpSessionSigs); + const pkpAddress = getPkpAddressFromSessionSig(sessionSig); + const storedKeyMetadataBatch = keyBatch.map( + ({ keyType, publicKey, memo, dataToEncryptHash, ciphertext }) => ({ + pkpAddress, + publicKey, + memo, + dataToEncryptHash, + ciphertext, + keyType, + }) + ); + return storePrivateKeyBatch({ + storedKeyMetadataBatch, + sessionSig, + litNetwork: litNodeClient.config.litNetwork, + }); +} + +// packages/wrapped-keys/src/lib/lit-actions-client/types.ts +init_shim(); + +// packages/wrapped-keys/src/index.ts +var api = { + exportPrivateKey, + generatePrivateKey, + getEncryptedKey, + listEncryptedKeyMetadata, + importPrivateKey, + signMessageWithEncryptedKey, + signTransactionWithEncryptedKey, + storeEncryptedKey, + storeEncryptedKeyBatch, + batchGeneratePrivateKeys, +}; + +// local-tests/tests/wrapped-keys/testEthereumSignMessageGeneratedKey.ts +var { + generatePrivateKey: generatePrivateKey2, + signMessageWithEncryptedKey: signMessageWithEncryptedKey2, +} = api; +var testEthereumSignMessageGeneratedKey = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + const pkpSessionSigs = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const { + pkpAddress, + id: id2, + generatedPublicKey, + } = await generatePrivateKey2({ + pkpSessionSigs, + network: 'evm', + litNodeClient: devEnv.litNodeClient, + memo: 'Test key', + }); + const alicePkpAddress = alice.authMethodOwnedPkp.ethAddress; + if (pkpAddress !== alicePkpAddress) { + throw new Error( + `Received address: ${pkpAddress} doesn't match Alice's PKP address: ${alicePkpAddress}` + ); + } + const pkpSessionSigsSigning = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const unsignedStringMessage = 'This is a test message'; + const signature2 = await signMessageWithEncryptedKey2({ + pkpSessionSigs: pkpSessionSigsSigning, + network: 'evm', + messageToSign: unsignedStringMessage, + litNodeClient: devEnv.litNodeClient, + id: id2, + }); + if (!ethers_exports.utils.isHexString(signature2)) { + throw new Error(`signature isn't hex: ${signature2}`); + } + const unsignedBinaryMessage = ethers_exports.utils.arrayify( + ethers_exports.utils.toUtf8Bytes(unsignedStringMessage) + ); + const signatureBinary = await signMessageWithEncryptedKey2({ + pkpSessionSigs: pkpSessionSigsSigning, + network: 'evm', + messageToSign: unsignedBinaryMessage, + litNodeClient: devEnv.litNodeClient, + id: id2, + }); + if (!ethers_exports.utils.isHexString(signatureBinary)) { + throw new Error(`signatureBinary isn't hex: ${signatureBinary}`); + } + if (signatureBinary !== signature2) { + throw new Error( + `signature: ${signature2} doesn't match it's signatureBinary form: ${signatureBinary}` + ); + } + log('\u2705 testEthereumSignMessageGeneratedKey'); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/wrapped-keys/testEthereumBroadcastTransactionGeneratedKey.ts +init_shim(); + +// local-tests/tests/wrapped-keys/util.ts +init_shim(); + +// packages/wrapped-keys-lit-actions/src/index.ts +init_shim(); +var batchGenerateEncryptedKeys2 = __toESM(require_batchGenerateEncryptedKeys()); +var exportPrivateKey3 = __toESM(require_exportPrivateKey()); +var generateEncryptedEthereumPrivateKey2 = __toESM( + require_generateEncryptedEthereumPrivateKey() +); +var signMessageWithEthereumEncryptedKey = __toESM( + require_signMessageWithEncryptedEthereumKey() +); +var signTransactionWithEthereumEncryptedKey = __toESM( + require_signTransactionWithEncryptedEthereumKey() +); +var generateEncryptedSolanaPrivateKey2 = __toESM( + require_generateEncryptedSolanaPrivateKey() +); +var signMessageWithSolanaEncryptedKey = __toESM( + require_signMessageWithEncryptedSolanaKey() +); +var signTransactionWithSolanaEncryptedKey = __toESM( + require_signTransactionWithEncryptedSolanaKey() +); + +// packages/wrapped-keys-lit-actions/src/lib/raw-action-functions/index.ts +init_shim(); + +// packages/wrapped-keys-lit-actions/src/lib/raw-action-functions/common/batchGenerateEncryptedKeys.ts +init_shim(); + +// packages/wrapped-keys-lit-actions/src/lib/internal/common/encryptKey.ts +init_shim(); + +// packages/wrapped-keys-lit-actions/src/lib/constants.ts +init_shim(); + +// packages/wrapped-keys-lit-actions/src/lib/internal/ethereum/generatePrivateKey.ts +init_shim(); + +// packages/wrapped-keys-lit-actions/src/lib/internal/ethereum/signMessage.ts +init_shim(); + +// packages/wrapped-keys-lit-actions/src/lib/internal/solana/generatePrivateKey.ts +init_shim(); +import { Keypair } from '@solana/web3.js'; + +// packages/wrapped-keys-lit-actions/src/lib/internal/solana/signMessage.ts +init_shim(); +import { Buffer as Buffer3 } from 'buffer'; +import { Keypair as Keypair2 } from '@solana/web3.js'; +import nacl3 from 'tweetnacl'; + +// packages/wrapped-keys-lit-actions/src/lib/raw-action-functions/common/exportPrivateKey.ts +init_shim(); + +// packages/wrapped-keys-lit-actions/src/lib/internal/common/getDecryptedKeyToSingleNode.ts +init_shim(); + +// packages/wrapped-keys-lit-actions/src/lib/abortError.ts +init_shim(); + +// packages/wrapped-keys-lit-actions/src/lib/utils.js +init_shim(); + +// packages/wrapped-keys-lit-actions/src/lib/raw-action-functions/ethereum/generateEncryptedEthereumPrivateKey.ts +init_shim(); + +// packages/wrapped-keys-lit-actions/src/lib/raw-action-functions/ethereum/signMessageWithEncryptedEthereumKey.ts +init_shim(); + +// packages/wrapped-keys-lit-actions/src/lib/raw-action-functions/ethereum/signTransactionWithEncryptedEthereumKey.ts +init_shim(); + +// packages/wrapped-keys-lit-actions/src/lib/internal/ethereum/signTransaction.ts +init_shim(); + +// packages/wrapped-keys-lit-actions/src/lib/raw-action-functions/solana/generateEncryptedSolanaPrivateKey.ts +init_shim(); + +// packages/wrapped-keys-lit-actions/src/lib/raw-action-functions/solana/signMessageWithEncryptedSolanaKey.ts +init_shim(); + +// packages/wrapped-keys-lit-actions/src/lib/raw-action-functions/solana/signTransactionWithEncryptedSolanaKey.ts +init_shim(); + +// packages/wrapped-keys-lit-actions/src/lib/internal/solana/signTransaction.ts +init_shim(); +import { + clusterApiUrl, + Connection, + Keypair as Keypair3, + Transaction, + VersionedTransaction, +} from '@solana/web3.js'; + +// local-tests/tests/wrapped-keys/util.ts +function getChainForNetwork(network) { + switch (network) { + case 'datil-dev': + return { + chain: 'yellowstone', + chainId: LIT_CHAINS['yellowstone'].chainId, + }; + case 'datil-test': + return { + chain: 'yellowstone', + chainId: LIT_CHAINS['yellowstone'].chainId, + }; + case 'datil': + return { + chain: 'yellowstone', + chainId: LIT_CHAINS['yellowstone'].chainId, + }; + default: + throw new Error(`Cannot identify chain params for ${network}`); + } +} +function getGasParamsForNetwork(network) { + switch (network) { + case 'datil-dev': + return { gasLimit: 5e6 }; + case 'datil-test': + return { gasLimit: 5e6 }; + case 'datil': + return { gasLimit: 5e6 }; + default: + throw new Error(`Cannot identify chain params for ${network}`); + } +} +function getBaseTransactionForNetwork({ toAddress, network }) { + return { + toAddress, + value: '0.0001', + // in ethers (Lit tokens) + ...getChainForNetwork(network), + ...getGasParamsForNetwork(network), + dataHex: ethers_exports.utils.hexlify( + ethers_exports.utils.toUtf8Bytes('Test transaction from Alice to bob') + ), + }; +} + +// local-tests/tests/wrapped-keys/testEthereumBroadcastTransactionGeneratedKey.ts +var { + signTransactionWithEncryptedKey: signTransactionWithEncryptedKey2, + generatePrivateKey: generatePrivateKey3, +} = api; +var testEthereumBroadcastTransactionGeneratedKey = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + const pkpSessionSigs = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const { + pkpAddress, + generatedPublicKey, + id: id2, + } = await generatePrivateKey3({ + pkpSessionSigs, + network: 'evm', + litNodeClient: devEnv.litNodeClient, + memo: 'Test key', + }); + const generatedKeysWalletAddress = + ethers_exports.utils.computeAddress(generatedPublicKey); + console.log(`Sending funds to ${generatedKeysWalletAddress}`); + await devEnv.getFunds(generatedKeysWalletAddress, '0.005'); + const alicePkpAddress = alice.authMethodOwnedPkp.ethAddress; + if (pkpAddress !== alicePkpAddress) { + throw new Error( + `Received address: ${pkpAddress} doesn't match Alice's PKP address: ${alicePkpAddress}` + ); + } + const pkpSessionSigsSigning = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const unsignedTransaction = getBaseTransactionForNetwork({ + network: devEnv.litNodeClient.config.litNetwork, + toAddress: alice.wallet.address, + }); + const signedTx = await signTransactionWithEncryptedKey2({ + pkpSessionSigs: pkpSessionSigsSigning, + network: 'evm', + unsignedTransaction, + broadcast: true, + litNodeClient: devEnv.litNodeClient, + id: id2, + }); + if (!ethers_exports.utils.isHexString(signedTx)) { + throw new Error(`signedTx isn't hex: ${signedTx}`); + } + log('\u2705 testEthereumBroadcastTransactionGeneratedKey'); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/wrapped-keys/testEthereumSignMessageWrappedKey.ts +init_shim(); +var { + importPrivateKey: importPrivateKey2, + signMessageWithEncryptedKey: signMessageWithEncryptedKey3, +} = api; +var testEthereumSignMessageWrappedKey = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + const pkpSessionSigs = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const privateKey = ethers_exports.Wallet.createRandom().privateKey; + const { pkpAddress, id: id2 } = await importPrivateKey2({ + pkpSessionSigs, + privateKey, + litNodeClient: devEnv.litNodeClient, + publicKey: '0xdeadbeef', + keyType: 'K256', + memo: 'Test key', + }); + const alicePkpAddress = alice.authMethodOwnedPkp.ethAddress; + if (pkpAddress !== alicePkpAddress) { + throw new Error( + `Received address: ${pkpAddress} doesn't match Alice's PKP address: ${alicePkpAddress}` + ); + } + const pkpSessionSigsSigning = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const unsignedStringMessage = 'This is a test message'; + const signature2 = await signMessageWithEncryptedKey3({ + pkpSessionSigs: pkpSessionSigsSigning, + network: 'evm', + messageToSign: unsignedStringMessage, + litNodeClient: devEnv.litNodeClient, + id: id2, + }); + if (!ethers_exports.utils.isHexString(signature2)) { + throw new Error(`signature isn't hex: ${signature2}`); + } + const unsignedBinaryMessage = ethers_exports.utils.arrayify( + ethers_exports.utils.toUtf8Bytes(unsignedStringMessage) + ); + const signatureBinary = await signMessageWithEncryptedKey3({ + pkpSessionSigs: pkpSessionSigsSigning, + network: 'evm', + messageToSign: unsignedBinaryMessage, + litNodeClient: devEnv.litNodeClient, + id: id2, + }); + if (!ethers_exports.utils.isHexString(signatureBinary)) { + throw new Error(`signatureBinary isn't hex: ${signatureBinary}`); + } + if (signatureBinary !== signature2) { + throw new Error( + `signature: ${signature2} doesn't match it's signatureBinary form: ${signatureBinary}` + ); + } + log('\u2705 testEthereumSignMessageWrappedKey'); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/wrapped-keys/testFailEthereumSignTransactionWrappedKeyInvalidDecryption.ts +init_shim(); +var testFailEthereumSignTransactionWrappedKeyInvalidDecryption = async ( + devEnv +) => { + const alice = await devEnv.createRandomPerson(); + const bob = await devEnv.createRandomPerson(); + try { + const privateKey = ethers_exports.Wallet.createRandom().privateKey; + const alicePkpAddress = alice.authMethodOwnedPkp.ethAddress; + const decryptionAccessControlCondition = + getPkpAccessControlCondition(alicePkpAddress); + const { ciphertext, dataToEncryptHash } = await encryptString( + { + accessControlConditions: [decryptionAccessControlCondition], + dataToEncrypt: LIT_PREFIX + privateKey, + }, + devEnv.litNodeClient + ); + const pkpSessionSigsSigning = await getPkpSessionSigs( + devEnv, + bob, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const unsignedTransaction = getBaseTransactionForNetwork({ + network: devEnv.litNodeClient.config.litNetwork, + toAddress: alice.wallet.address, + }); + try { + const _res = await devEnv.litNodeClient.executeJs({ + sessionSigs: pkpSessionSigsSigning, + ipfsId: LIT_ACTION_CID_REPOSITORY.signTransaction.evm, + jsParams: { + ciphertext, + dataToEncryptHash, + unsignedTransaction, + accessControlConditions: [decryptionAccessControlCondition], + }, + ipfsOptions: { + overwriteCode: + GLOBAL_OVERWRITE_IPFS_CODE_BY_NETWORK[ + devEnv.litNodeClient.config.litNetwork + ], + }, + }); + } catch (e2) { + if ( + e2.message.includes( + 'There was an error getting the signing shares from the nodes' + ) + ) { + console.log('\u2705 THIS IS EXPECTED: ', e2); + console.log(e2.message); + console.log( + '\u2705 testFailEthereumSignTransactionWrappedKeyInvalidDecryption is expected to have an error' + ); + } else { + throw e2; + } + } + log('\u2705 testFailEthereumSignTransactionWrappedKeyInvalidDecryption'); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + devEnv.releasePrivateKeyFromUser(bob); + } +}; + +// local-tests/tests/wrapped-keys/testEthereumSignTransactionWrappedKey.ts +init_shim(); +var { + importPrivateKey: importPrivateKey3, + signTransactionWithEncryptedKey: signTransactionWithEncryptedKey3, +} = api; +var testEthereumSignTransactionWrappedKey = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + const pkpSessionSigs = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const privateKey = ethers_exports.Wallet.createRandom().privateKey; + const { pkpAddress, id: id2 } = await importPrivateKey3({ + pkpSessionSigs, + privateKey, + litNodeClient: devEnv.litNodeClient, + publicKey: '0xdeadbeef', + keyType: 'K256', + memo: 'Test key', + }); + const alicePkpAddress = alice.authMethodOwnedPkp.ethAddress; + if (pkpAddress !== alicePkpAddress) { + throw new Error( + `Received address: ${pkpAddress} doesn't match Alice's PKP address: ${alicePkpAddress}` + ); + } + const pkpSessionSigsSigning = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const unsignedTransaction = getBaseTransactionForNetwork({ + network: devEnv.litNodeClient.config.litNetwork, + toAddress: alice.wallet.address, + }); + const signedTx = await signTransactionWithEncryptedKey3({ + pkpSessionSigs: pkpSessionSigsSigning, + network: 'evm', + unsignedTransaction, + broadcast: false, + litNodeClient: devEnv.litNodeClient, + id: id2, + }); + if (!ethers_exports.utils.isHexString(signedTx)) { + throw new Error(`signedTx isn't hex: ${signedTx}`); + } + log('\u2705 testEthereumSignTransactionWrappedKey'); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/wrapped-keys/testFailEthereumSignTransactionWrappedKeyWithInvalidParam.ts +init_shim(); +var { + importPrivateKey: importPrivateKey4, + signTransactionWithEncryptedKey: signTransactionWithEncryptedKey4, +} = api; +var testFailEthereumSignTransactionWrappedKeyWithInvalidParam = async ( + devEnv +) => { + const alice = await devEnv.createRandomPerson(); + try { + const pkpSessionSigs = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const privateKey = ethers_exports.Wallet.createRandom().privateKey; + const { pkpAddress, id: id2 } = await importPrivateKey4({ + pkpSessionSigs, + privateKey, + litNodeClient: devEnv.litNodeClient, + publicKey: '0xdeadbeef', + keyType: 'K256', + memo: 'Test key', + }); + const alicePkpAddress = alice.authMethodOwnedPkp.ethAddress; + if (pkpAddress !== alicePkpAddress) { + throw new Error( + `Received address: ${pkpAddress} doesn't match Alice's PKP address: ${alicePkpAddress}` + ); + } + const pkpSessionSigsSigning = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const unsignedTransaction = { + ...getBaseTransactionForNetwork({ + network: devEnv.litNodeClient.config.litNetwork, + toAddress: alice.wallet.address, + }), + dataHex: 'Test transaction from Alice to bob', + }; + try { + const _res = await signTransactionWithEncryptedKey4({ + pkpSessionSigs: pkpSessionSigsSigning, + network: 'evm', + unsignedTransaction, + broadcast: false, + litNodeClient: devEnv.litNodeClient, + id: id2, + }); + } catch (e2) { + if (e2.message.includes('invalid hexlify value')) { + console.log('\u2705 THIS IS EXPECTED: ', e2); + console.log(e2.message); + console.log( + '\u2705 testFailEthereumSignTransactionWrappedKeyWithInvalidParam is expected to have an error' + ); + } else { + console.log('ERROR', e2.message); + throw e2; + } + } + log('\u2705 testFailEthereumSignTransactionWrappedKeyWithInvalidParam'); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/wrapped-keys/testFailEthereumSignTransactionWrappedKeyWithMissingParam.ts +init_shim(); +var { + importPrivateKey: importPrivateKey5, + signTransactionWithEncryptedKey: signTransactionWithEncryptedKey5, +} = api; +var testFailEthereumSignTransactionWrappedKeyWithMissingParam = async ( + devEnv +) => { + const alice = await devEnv.createRandomPerson(); + try { + const pkpSessionSigs = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const privateKey = ethers_exports.Wallet.createRandom().privateKey; + const { pkpAddress, id: id2 } = await importPrivateKey5({ + pkpSessionSigs, + privateKey, + litNodeClient: devEnv.litNodeClient, + publicKey: '0xdeadbeef', + keyType: 'K256', + memo: 'Test key', + }); + const alicePkpAddress = alice.authMethodOwnedPkp.ethAddress; + if (pkpAddress !== alicePkpAddress) { + throw new Error( + `Received address: ${pkpAddress} doesn't match Alice's PKP address: ${alicePkpAddress}` + ); + } + const pkpSessionSigsSigning = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + try { + const _res = await signTransactionWithEncryptedKey5({ + pkpSessionSigs: pkpSessionSigsSigning, + network: 'evm', + unsignedTransaction: { + ...getChainForNetwork(devEnv.litNodeClient.config.litNetwork), + // @ts-expect-error This test is intentionally using the type incorrectly. + serializedTransaction: 'random-value', + }, + broadcast: false, + litNodeClient: devEnv.litNodeClient, + id: id2, + }); + } catch (e2) { + if (e2.message.includes('Missing required field: toAddress')) { + console.log('\u2705 THIS IS EXPECTED: ', e2); + console.log(e2.message); + console.log( + '\u2705 testFailEthereumSignTransactionWrappedKeyWithMissingParam is expected to have an error' + ); + } else { + throw e2; + } + } + log('\u2705 testFailEthereumSignTransactionWrappedKeyWithMissingParam'); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/wrapped-keys/testEthereumBroadcastTransactionWrappedKey.ts +init_shim(); +var { + importPrivateKey: importPrivateKey6, + signTransactionWithEncryptedKey: signTransactionWithEncryptedKey6, +} = api; +var testEthereumBroadcastTransactionWrappedKey = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + const pkpSessionSigs = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const wrappedKeysWallet = ethers_exports.Wallet.createRandom(); + const wrappedKeysWalletPrivateKey = wrappedKeysWallet.privateKey; + const wrappedKeysWalletAddress = wrappedKeysWallet.address; + console.log(`Sending funds to ${wrappedKeysWalletAddress}`); + await devEnv.getFunds(wrappedKeysWallet.address, '0.005'); + const { pkpAddress, id: id2 } = await importPrivateKey6({ + pkpSessionSigs, + privateKey: wrappedKeysWalletPrivateKey, + litNodeClient: devEnv.litNodeClient, + publicKey: '0xdeadbeef', + keyType: 'K256', + memo: 'Test key', + }); + const alicePkpAddress = alice.authMethodOwnedPkp.ethAddress; + if (pkpAddress !== alicePkpAddress) { + throw new Error( + `Received address: ${pkpAddress} doesn't match Alice's PKP address: ${alicePkpAddress}` + ); + } + const pkpSessionSigsSigning = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const unsignedTransaction = getBaseTransactionForNetwork({ + network: devEnv.litNodeClient.config.litNetwork, + toAddress: alice.wallet.address, + }); + const signedTx = await signTransactionWithEncryptedKey6({ + pkpSessionSigs: pkpSessionSigsSigning, + network: 'evm', + unsignedTransaction, + broadcast: true, + litNodeClient: devEnv.litNodeClient, + id: id2, + }); + if (!ethers_exports.utils.isHexString(signedTx)) { + throw new Error(`signedTx isn't hex: ${signedTx}`); + } + log('\u2705 testEthereumBroadcastTransactionWrappedKey'); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/wrapped-keys/testEthereumBroadcastWrappedKeyWithFetchGasParams.ts +init_shim(); +var { + importPrivateKey: importPrivateKey7, + signTransactionWithEncryptedKey: signTransactionWithEncryptedKey7, +} = api; +var testEthereumBroadcastWrappedKeyWithFetchGasParams = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + const pkpSessionSigs = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const wrappedKeysWallet = ethers_exports.Wallet.createRandom(); + const wrappedKeysWalletPrivateKey = wrappedKeysWallet.privateKey; + const wrappedKeysWalletAddress = wrappedKeysWallet.address; + console.log(`Sending funds to ${wrappedKeysWalletAddress}`); + await devEnv.getFunds(wrappedKeysWallet.address, '0.005'); + const { pkpAddress, id: id2 } = await importPrivateKey7({ + pkpSessionSigs, + privateKey: wrappedKeysWalletPrivateKey, + litNodeClient: devEnv.litNodeClient, + publicKey: '0xdeadbeef', + keyType: 'K256', + memo: 'Test key', + }); + const alicePkpAddress = alice.authMethodOwnedPkp.ethAddress; + if (pkpAddress !== alicePkpAddress) { + throw new Error( + `Received address: ${pkpAddress} doesn't match Alice's PKP address: ${alicePkpAddress}` + ); + } + const pkpSessionSigsSigning = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const unsignedTransaction = { + toAddress: alice.wallet.address, + value: '0.0001', + // in ethers (Lit tokens) + dataHex: ethers_exports.utils.hexlify( + ethers_exports.utils.toUtf8Bytes('Test transaction from Alice to bob') + ), + ...getChainForNetwork(devEnv.litNodeClient.config.litNetwork), + }; + const signedTx = await signTransactionWithEncryptedKey7({ + pkpSessionSigs: pkpSessionSigsSigning, + network: 'evm', + unsignedTransaction, + broadcast: true, + litNodeClient: devEnv.litNodeClient, + id: id2, + }); + if (!ethers_exports.utils.isHexString(signedTx)) { + throw new Error(`signedTx isn't hex: ${signedTx}`); + } + log('\u2705 testEthereumBroadcastWrappedKeyWithDefaultGasParams'); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/wrapped-keys/testImportWrappedKey.ts +init_shim(); +var { + importPrivateKey: importPrivateKey8, + listEncryptedKeyMetadata: listEncryptedKeyMetadata2, +} = api; +var testImportWrappedKey = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + const pkpSessionSigs = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const privateKey = randomSolanaPrivateKey(); + const { pkpAddress, id: id2 } = await importPrivateKey8({ + pkpSessionSigs, + privateKey, + litNodeClient: devEnv.litNodeClient, + publicKey: '0xdeadbeef', + keyType: 'K256', + memo: 'Test key', + }); + const alicePkpAddress = alice.authMethodOwnedPkp.ethAddress; + if (pkpAddress !== alicePkpAddress) { + throw new Error( + `Received address: ${pkpAddress} doesn't match Alice's PKP address: ${alicePkpAddress}` + ); + } + const keys = await listEncryptedKeyMetadata2({ + pkpSessionSigs, + litNodeClient: devEnv.litNodeClient, + }); + if (keys.length !== 1 || keys[0].id !== id2) { + throw new Error( + 'Keys returned by `listPrivateKeyMetadata()` do not match expected result.' + ); + } + log('\u2705 testImportWrappedKey'); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/wrapped-keys/testGenerateEthereumWrappedKey.ts +init_shim(); +var { generatePrivateKey: generatePrivateKey4 } = api; +var testGenerateEthereumWrappedKey = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + const pkpSessionSigs = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const { + pkpAddress, + generatedPublicKey, + id: id2, + } = await generatePrivateKey4({ + pkpSessionSigs, + network: 'evm', + litNodeClient: devEnv.litNodeClient, + memo: 'Test key', + }); + const alicePkpAddress = alice.authMethodOwnedPkp.ethAddress; + if (pkpAddress !== alicePkpAddress) { + throw new Error( + `Received address: ${pkpAddress} doesn't match Alice's PKP address: ${alicePkpAddress}` + ); + } + const pkpSessionSigsExport = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const { decryptedPrivateKey } = await exportPrivateKey({ + pkpSessionSigs: pkpSessionSigsExport, + litNodeClient: devEnv.litNodeClient, + network: 'evm', + id: id2, + }); + const wallet = new ethers_exports.Wallet(decryptedPrivateKey); + const decryptedPublicKey = wallet.publicKey; + if (decryptedPublicKey !== generatedPublicKey) { + throw new Error( + `Decrypted decryptedPublicKey: ${decryptedPublicKey} doesn't match with the original generatedPublicKey: ${generatedPublicKey}` + ); + } + log('\u2705 testGenerateEthereumWrappedKey'); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/wrapped-keys/testGenerateSolanaWrappedKey.ts +init_shim(); +import { Keypair as Keypair4 } from '@solana/web3.js'; +import nacl4 from 'tweetnacl'; +var { + generatePrivateKey: generatePrivateKey5, + signMessageWithEncryptedKey: signMessageWithEncryptedKey4, + exportPrivateKey: exportPrivateKey4, +} = api; +var testGenerateSolanaWrappedKey = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + const pkpSessionSigs = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const { + pkpAddress, + generatedPublicKey, + id: id2, + } = await generatePrivateKey5({ + pkpSessionSigs, + network: 'solana', + litNodeClient: devEnv.litNodeClient, + memo: 'Test key', + }); + console.log(`generatedPublicKey: ${generatedPublicKey}`); + const alicePkpAddress = alice.authMethodOwnedPkp.ethAddress; + if (pkpAddress !== alicePkpAddress) { + throw new Error( + `Received address: ${pkpAddress} doesn't match Alice's PKP address: ${alicePkpAddress}` + ); + } + const pkpSessionSigsSigning = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const messageToSign = 'This is a test message'; + const signature2 = await signMessageWithEncryptedKey4({ + pkpSessionSigs: pkpSessionSigsSigning, + network: 'solana', + messageToSign, + litNodeClient: devEnv.litNodeClient, + id: id2, + }); + const signatureIsValidForPublicKey = nacl4.sign.detached.verify( + Buffer.from(messageToSign), + ethers_exports.utils.base58.decode(signature2), + ethers_exports.utils.base58.decode(generatedPublicKey) + ); + if (!signatureIsValidForPublicKey) + throw new Error( + `signature: ${signature2} doesn't validate for the Solana public key: ${generatedPublicKey}` + ); + const pkpSessionSigsExport = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const { decryptedPrivateKey } = await exportPrivateKey4({ + pkpSessionSigs: pkpSessionSigsExport, + litNodeClient: devEnv.litNodeClient, + network: 'solana', + id: id2, + }); + const solanaKeyPair = Keypair4.fromSecretKey( + Buffer.from(decryptedPrivateKey, 'hex') + ); + const decryptedPublicKey = solanaKeyPair.publicKey; + if (decryptedPublicKey.toString() !== generatedPublicKey) { + throw new Error( + `Decrypted decryptedPublicKey: ${decryptedPublicKey} doesn't match with the original generatedPublicKey: ${generatedPublicKey}` + ); + } + log('\u2705 testGenerateSolanaWrappedKey'); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/wrapped-keys/testFailImportWrappedKeysWithSamePrivateKey.ts +init_shim(); +var { importPrivateKey: importPrivateKey9 } = api; +var testFailImportWrappedKeysWithSamePrivateKey = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + const pkpSessionSigs = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const privateKey = + '4rXcTBAZVypFRGGER4TwSuGGxMvmRwvYA3jwuZfDY4YKX4VEbuUaPCWrZGSxujKknQCdN8UD9wMW8XYmT1BiLxmB'; + try { + await importPrivateKey9({ + pkpSessionSigs, + privateKey, + litNodeClient: devEnv.litNodeClient, + publicKey: '0xdeadbeef', + keyType: 'K256', + memo: 'Test key', + }); + await importPrivateKey9({ + pkpSessionSigs, + privateKey, + litNodeClient: devEnv.litNodeClient, + publicKey: '0xdeadbeef', + keyType: 'K256', + memo: 'Test key', + }); + throw new Error( + 'Expected an AlreadyExists error but the importPrivateKey succeeded!' + ); + } catch (e2) { + if ( + e2.message.includes( + 'There is already a wrapped key stored with the same dataToEncryptHash' + ) + ) { + console.log('\u2705 THIS IS EXPECTED: ', e2); + console.log(e2.message); + console.log( + '\u2705 testFailImportWrappedKeysWithSamePrivateKey is expected to have an error' + ); + } else { + throw e2; + } + } + console.log('\u2705 testFailImportWrappedKeysWithSamePrivateKey'); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/wrapped-keys/testFailImportWrappedKeysWithEoaSessionSig.ts +init_shim(); +var { importPrivateKey: importPrivateKey10 } = api; +var testFailImportWrappedKeysWithEoaSessionSig = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + const eoaSessionSigs = await getEoaSessionSigs(devEnv, alice); + const privateKey = randomSolanaPrivateKey(); + try { + await importPrivateKey10({ + pkpSessionSigs: eoaSessionSigs, + privateKey, + litNodeClient: devEnv.litNodeClient, + publicKey: '0xdeadbeef', + keyType: 'K256', + memo: 'Test key', + }); + } catch (e2) { + if (e2.message.includes('SessionSig is not from a PKP')) { + console.log('\u2705 THIS IS EXPECTED: ', e2); + console.log(e2.message); + console.log( + '\u2705 testFailImportWrappedKeysWithEoaSessionSig is expected to have an error' + ); + } else { + throw e2; + } + } + console.log('\u2705 testFailImportWrappedKeysWithEoaSessionSig'); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/wrapped-keys/testFailImportWrappedKeysWithMaxExpirySessionSig.ts +init_shim(); +var { importPrivateKey: importPrivateKey11 } = api; +var testFailImportWrappedKeysWithMaxExpirySessionSig = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + const pkpSessionSigs = await getPkpSessionSigs(devEnv, alice); + try { + const privateKey = randomSolanaPrivateKey(); + await importPrivateKey11({ + pkpSessionSigs, + privateKey, + litNodeClient: devEnv.litNodeClient, + publicKey: '0xdeadbeef', + keyType: 'K256', + memo: 'Test key', + }); + } catch (e2) { + if (e2.message.includes('Expires too far in the future')) { + console.log('\u2705 THIS IS EXPECTED: ', e2); + console.log(e2.message); + console.log( + '\u2705 testFailImportWrappedKeysWithMaxExpirySessionSig is expected to have an error' + ); + } else { + throw e2; + } + } + console.log('\u2705 testFailImportWrappedKeysWithMaxExpirySessionSig'); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/wrapped-keys/testFailImportWrappedKeysWithInvalidSessionSig.ts +init_shim(); +var { importPrivateKey: importPrivateKey12 } = api; +var testFailImportWrappedKeysWithInvalidSessionSig = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + const pkpSessionSigs = await getPkpSessionSigs(devEnv, alice); + try { + const privateKey = randomSolanaPrivateKey(); + await importPrivateKey12({ + pkpSessionSigs: tamperPkpSessionSigs(pkpSessionSigs), + privateKey, + litNodeClient: devEnv.litNodeClient, + publicKey: '0xdeadbeef', + keyType: 'K256', + memo: 'Test key', + }); + } catch (e2) { + if (e2.message.includes('bad public key size')) { + console.log('\u2705 THIS IS EXPECTED: ', e2); + console.log(e2.message); + console.log( + '\u2705 testFailImportWrappedKeysWithInvalidSessionSig is expected to have an error' + ); + } else { + throw e2; + } + } + console.log('\u2705 testFailImportWrappedKeysWithInvalidSessionSig'); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; +var tamperPkpSessionSigs = (pkpSessionSig) => { + const tamperedPkpSessionSigs = {}; + for (const key2 in pkpSessionSig) { + if (pkpSessionSig.hasOwnProperty(key2)) { + const authSig = pkpSessionSig[key2]; + const updatedAuthSig = { + ...authSig, + address: authSig.address.slice(0, -1), + }; + tamperedPkpSessionSigs[key2] = updatedAuthSig; + } + } + return tamperedPkpSessionSigs; +}; + +// local-tests/tests/wrapped-keys/testFailImportWrappedKeysWithExpiredSessionSig.ts +init_shim(); +var { importPrivateKey: importPrivateKey13 } = api; +var testFailImportWrappedKeysWithExpiredSessionSig = async (devEnv) => { + const pkpSessionSigs = { + 'https://207.244.70.36:8474': { + sig: '1827d1c7b79c979ce76d0b9e130f6804dbf7c7838b6dfa41d4cadf690b9a8bec23321dde6cc573e8a592c395193074ade303d94f3c198d8f0017ca0aca91bd0f', + derivedVia: 'litSessionSignViaNacl', + signedMessage: `{"sessionKey":"4fd3d6ae41190cdd33a07bc5feb4a51b0c882474e6b51eb37cf799d6668eb44b","resourceAbilityRequests":[{"resource":{"resource":"*","resourcePrefix":"lit-pkp"},"ability":"pkp-signing"},{"resource":{"resource":"*","resourcePrefix":"lit-litaction"},"ability":"lit-action-execution"}],"capabilities":[{"sig":"{\\"ProofOfPossession\\":\\"8f060f34f55e996e8396c5036cb456dbf3b3cf79a6c9d2a9c036a27dae6be5cb286c0170c45404ce60d45ad5df384a030450f4eabe61af68d7267d2de035a1ff0697097b3b32413581d8550b198599b8ee5c29a78999c05f8806e33923705748\\"}","algo":"LIT_BLS","derivedVia":"lit.bls","signedMessage":"litprotocol.com wants you to sign in with your Ethereum account:\\n0xd1Af1AAC50aC837C873200D17b78664aFCde597C\\n\\nLit Protocol PKP session signature I further authorize the stated URI to perform the following actions on my behalf: I further authorize the stated URI to perform the following actions on my behalf: (1) 'Threshold': 'Execution' for 'lit-litaction://*'. (2) 'Threshold': 'Signing' for 'lit-pkp://*'. I further authorize the stated URI to perform the following actions on my behalf: (1) 'Threshold': 'Execution' for 'lit-litaction://*'. (2) 'Threshold': 'Signing' for 'lit-pkp://*'. (3) 'Auth': 'Auth' for 'lit-resolvedauthcontext://*'.\\n\\nURI: lit:session:4fd3d6ae41190cdd33a07bc5feb4a51b0c882474e6b51eb37cf799d6668eb44b\\nVersion: 1\\nChain ID: 1\\nNonce: 0xa8b687976835989b8ac57e8e6cb17fa316cc9ef74ea6174a588f08b11571829c\\nIssued At: 2024-06-02T19:46:47Z\\nExpiration Time: 2024-06-03T19:47:14.907Z\\nResources:\\n- urn:recap:eyJhdHQiOnsibGl0LWxpdGFjdGlvbjovLyoiOnsiVGhyZXNob2xkL0V4ZWN1dGlvbiI6W3t9XX0sImxpdC1wa3A6Ly8qIjp7IlRocmVzaG9sZC9TaWduaW5nIjpbe31dfSwibGl0LXJlc29sdmVkYXV0aGNvbnRleHQ6Ly8qIjp7IkF1dGgvQXV0aCI6W3siYXV0aF9jb250ZXh0Ijp7ImFjdGlvbklwZnNJZHMiOltdLCJhdXRoTWV0aG9kQ29udGV4dHMiOlt7ImFwcElkIjoibGl0IiwiYXV0aE1ldGhvZFR5cGUiOjEsImV4cGlyYXRpb24iOjE3MTc0NDQwMjAsInVzZWRGb3JTaWduU2Vzc2lvbktleVJlcXVlc3QiOnRydWUsInVzZXJJZCI6IjB4MkY2ZjU4NzRhNGQyNTFlMzVDZDc4YjM1NzZDQTkwYkQyZjA1RmUwQiJ9XSwiYXV0aFNpZ0FkZHJlc3MiOm51bGwsImN1c3RvbUF1dGhSZXNvdXJjZSI6IiIsInJlc291cmNlcyI6W119fV19fSwicHJmIjpbXX0","address":"0xd1Af1AAC50aC837C873200D17b78664aFCde597C"}],"issuedAt":"2024-06-02T19:47:16.707Z","expiration":"2024-06-03T19:47:14.907Z","nodeAddress":"https://207.244.70.36:8474"}`, + address: + '4fd3d6ae41190cdd33a07bc5feb4a51b0c882474e6b51eb37cf799d6668eb44b', + algo: 'ed25519', + }, + 'https://207.244.70.36:8473': { + sig: '762b9849d2cc77d0c75aa354c3cce63abca008a9a07ec3efc69ee8a4954650c3362b8cb83cd3d63310ad98b446be5e68cb8193f9d486453b2df72188dc698d0e', + derivedVia: 'litSessionSignViaNacl', + signedMessage: `{"sessionKey":"4fd3d6ae41190cdd33a07bc5feb4a51b0c882474e6b51eb37cf799d6668eb44b","resourceAbilityRequests":[{"resource":{"resource":"*","resourcePrefix":"lit-pkp"},"ability":"pkp-signing"},{"resource":{"resource":"*","resourcePrefix":"lit-litaction"},"ability":"lit-action-execution"}],"capabilities":[{"sig":"{\\"ProofOfPossession\\":\\"8f060f34f55e996e8396c5036cb456dbf3b3cf79a6c9d2a9c036a27dae6be5cb286c0170c45404ce60d45ad5df384a030450f4eabe61af68d7267d2de035a1ff0697097b3b32413581d8550b198599b8ee5c29a78999c05f8806e33923705748\\"}","algo":"LIT_BLS","derivedVia":"lit.bls","signedMessage":"litprotocol.com wants you to sign in with your Ethereum account:\\n0xd1Af1AAC50aC837C873200D17b78664aFCde597C\\n\\nLit Protocol PKP session signature I further authorize the stated URI to perform the following actions on my behalf: I further authorize the stated URI to perform the following actions on my behalf: (1) 'Threshold': 'Execution' for 'lit-litaction://*'. (2) 'Threshold': 'Signing' for 'lit-pkp://*'. I further authorize the stated URI to perform the following actions on my behalf: (1) 'Threshold': 'Execution' for 'lit-litaction://*'. (2) 'Threshold': 'Signing' for 'lit-pkp://*'. (3) 'Auth': 'Auth' for 'lit-resolvedauthcontext://*'.\\n\\nURI: lit:session:4fd3d6ae41190cdd33a07bc5feb4a51b0c882474e6b51eb37cf799d6668eb44b\\nVersion: 1\\nChain ID: 1\\nNonce: 0xa8b687976835989b8ac57e8e6cb17fa316cc9ef74ea6174a588f08b11571829c\\nIssued At: 2024-06-02T19:46:47Z\\nExpiration Time: 2024-06-03T19:47:14.907Z\\nResources:\\n- urn:recap:eyJhdHQiOnsibGl0LWxpdGFjdGlvbjovLyoiOnsiVGhyZXNob2xkL0V4ZWN1dGlvbiI6W3t9XX0sImxpdC1wa3A6Ly8qIjp7IlRocmVzaG9sZC9TaWduaW5nIjpbe31dfSwibGl0LXJlc29sdmVkYXV0aGNvbnRleHQ6Ly8qIjp7IkF1dGgvQXV0aCI6W3siYXV0aF9jb250ZXh0Ijp7ImFjdGlvbklwZnNJZHMiOltdLCJhdXRoTWV0aG9kQ29udGV4dHMiOlt7ImFwcElkIjoibGl0IiwiYXV0aE1ldGhvZFR5cGUiOjEsImV4cGlyYXRpb24iOjE3MTc0NDQwMjAsInVzZWRGb3JTaWduU2Vzc2lvbktleVJlcXVlc3QiOnRydWUsInVzZXJJZCI6IjB4MkY2ZjU4NzRhNGQyNTFlMzVDZDc4YjM1NzZDQTkwYkQyZjA1RmUwQiJ9XSwiYXV0aFNpZ0FkZHJlc3MiOm51bGwsImN1c3RvbUF1dGhSZXNvdXJjZSI6IiIsInJlc291cmNlcyI6W119fV19fSwicHJmIjpbXX0","address":"0xd1Af1AAC50aC837C873200D17b78664aFCde597C"}],"issuedAt":"2024-06-02T19:47:16.707Z","expiration":"2024-06-03T19:47:14.907Z","nodeAddress":"https://207.244.70.36:8473"}`, + address: + '4fd3d6ae41190cdd33a07bc5feb4a51b0c882474e6b51eb37cf799d6668eb44b', + algo: 'ed25519', + }, + 'https://207.244.70.36:8475': { + sig: '5e506dc973cc1540dcb3bd1de251afa687caf277cb5f3efe107339ecf4c25607d4bdf5d8c8910874519252e026a49cc66cea0b07bc5d38342c7cb2613decbe0a', + derivedVia: 'litSessionSignViaNacl', + signedMessage: `{"sessionKey":"4fd3d6ae41190cdd33a07bc5feb4a51b0c882474e6b51eb37cf799d6668eb44b","resourceAbilityRequests":[{"resource":{"resource":"*","resourcePrefix":"lit-pkp"},"ability":"pkp-signing"},{"resource":{"resource":"*","resourcePrefix":"lit-litaction"},"ability":"lit-action-execution"}],"capabilities":[{"sig":"{\\"ProofOfPossession\\":\\"8f060f34f55e996e8396c5036cb456dbf3b3cf79a6c9d2a9c036a27dae6be5cb286c0170c45404ce60d45ad5df384a030450f4eabe61af68d7267d2de035a1ff0697097b3b32413581d8550b198599b8ee5c29a78999c05f8806e33923705748\\"}","algo":"LIT_BLS","derivedVia":"lit.bls","signedMessage":"litprotocol.com wants you to sign in with your Ethereum account:\\n0xd1Af1AAC50aC837C873200D17b78664aFCde597C\\n\\nLit Protocol PKP session signature I further authorize the stated URI to perform the following actions on my behalf: I further authorize the stated URI to perform the following actions on my behalf: (1) 'Threshold': 'Execution' for 'lit-litaction://*'. (2) 'Threshold': 'Signing' for 'lit-pkp://*'. I further authorize the stated URI to perform the following actions on my behalf: (1) 'Threshold': 'Execution' for 'lit-litaction://*'. (2) 'Threshold': 'Signing' for 'lit-pkp://*'. (3) 'Auth': 'Auth' for 'lit-resolvedauthcontext://*'.\\n\\nURI: lit:session:4fd3d6ae41190cdd33a07bc5feb4a51b0c882474e6b51eb37cf799d6668eb44b\\nVersion: 1\\nChain ID: 1\\nNonce: 0xa8b687976835989b8ac57e8e6cb17fa316cc9ef74ea6174a588f08b11571829c\\nIssued At: 2024-06-02T19:46:47Z\\nExpiration Time: 2024-06-03T19:47:14.907Z\\nResources:\\n- urn:recap:eyJhdHQiOnsibGl0LWxpdGFjdGlvbjovLyoiOnsiVGhyZXNob2xkL0V4ZWN1dGlvbiI6W3t9XX0sImxpdC1wa3A6Ly8qIjp7IlRocmVzaG9sZC9TaWduaW5nIjpbe31dfSwibGl0LXJlc29sdmVkYXV0aGNvbnRleHQ6Ly8qIjp7IkF1dGgvQXV0aCI6W3siYXV0aF9jb250ZXh0Ijp7ImFjdGlvbklwZnNJZHMiOltdLCJhdXRoTWV0aG9kQ29udGV4dHMiOlt7ImFwcElkIjoibGl0IiwiYXV0aE1ldGhvZFR5cGUiOjEsImV4cGlyYXRpb24iOjE3MTc0NDQwMjAsInVzZWRGb3JTaWduU2Vzc2lvbktleVJlcXVlc3QiOnRydWUsInVzZXJJZCI6IjB4MkY2ZjU4NzRhNGQyNTFlMzVDZDc4YjM1NzZDQTkwYkQyZjA1RmUwQiJ9XSwiYXV0aFNpZ0FkZHJlc3MiOm51bGwsImN1c3RvbUF1dGhSZXNvdXJjZSI6IiIsInJlc291cmNlcyI6W119fV19fSwicHJmIjpbXX0","address":"0xd1Af1AAC50aC837C873200D17b78664aFCde597C"}],"issuedAt":"2024-06-02T19:47:16.707Z","expiration":"2024-06-03T19:47:14.907Z","nodeAddress":"https://207.244.70.36:8475"}`, + address: + '4fd3d6ae41190cdd33a07bc5feb4a51b0c882474e6b51eb37cf799d6668eb44b', + algo: 'ed25519', + }, + }; + try { + const privateKey = randomSolanaPrivateKey(); + const res = await importPrivateKey13({ + pkpSessionSigs, + privateKey, + litNodeClient: devEnv.litNodeClient, + publicKey: '0xdeadbeef', + keyType: 'K256', + memo: 'Test key', + }); + } catch (e2) { + if (e2.message.includes('Invalid sessionSig: Expired')) { + console.log('\u2705 THIS IS EXPECTED: ', e2); + console.log(e2.message); + console.log( + '\u2705 testFailImportWrappedKeysWithExpiredSessionSig is expected to have an error' + ); + } else { + throw e2; + } + } + console.log('\u2705 testFailImportWrappedKeysWithExpiredSessionSig'); +}; + +// local-tests/tests/wrapped-keys/testExportWrappedKey.ts +init_shim(); +var { + exportPrivateKey: exportPrivateKey5, + importPrivateKey: importPrivateKey14, +} = api; +var testExportWrappedKey = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + const pkpSessionSigsImport = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const privateKey = randomSolanaPrivateKey(); + const { pkpAddress, id: id2 } = await importPrivateKey14({ + pkpSessionSigs: pkpSessionSigsImport, + privateKey, + litNodeClient: devEnv.litNodeClient, + publicKey: '0xdeadbeef', + keyType: 'K256', + memo: 'Test key', + }); + const alicePkpAddress = alice.authMethodOwnedPkp.ethAddress; + if (pkpAddress !== alicePkpAddress) { + throw new Error( + `Received address: ${pkpAddress} doesn't match Alice's PKP address: ${alicePkpAddress}` + ); + } + const pkpSessionSigsExport = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const { decryptedPrivateKey } = await exportPrivateKey5({ + pkpSessionSigs: pkpSessionSigsExport, + litNodeClient: devEnv.litNodeClient, + network: 'solana', + id: id2, + }); + if (decryptedPrivateKey !== privateKey) { + throw new Error( + `Decrypted private key: ${decryptedPrivateKey} doesn't match with the original private key: ${privateKey}` + ); + } + log('\u2705 testExportWrappedKey'); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/wrapped-keys/testSignMessageWithSolanaEncryptedKey.ts +init_shim(); +import { Keypair as Keypair5 } from '@solana/web3.js'; +import nacl5 from 'tweetnacl'; +var { + importPrivateKey: importPrivateKey15, + signMessageWithEncryptedKey: signMessageWithEncryptedKey5, +} = api; +var testSignMessageWithSolanaEncryptedKey = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + const pkpSessionSigs = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const solanaKeypair = Keypair5.generate(); + const privateKey = Buffer.from(solanaKeypair.secretKey).toString('hex'); + const { pkpAddress, id: id2 } = await importPrivateKey15({ + pkpSessionSigs, + privateKey, + litNodeClient: devEnv.litNodeClient, + publicKey: '0xdeadbeef', + keyType: 'K256', + memo: 'Test key', + }); + const alicePkpAddress = alice.authMethodOwnedPkp.ethAddress; + if (pkpAddress !== alicePkpAddress) { + throw new Error( + `Received address: ${pkpAddress} doesn't match Alice's PKP address: ${alicePkpAddress}` + ); + } + const pkpSessionSigsSigning = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const messageToSign = 'This is a test message'; + const signature2 = await signMessageWithEncryptedKey5({ + pkpSessionSigs: pkpSessionSigsSigning, + network: 'solana', + messageToSign, + litNodeClient: devEnv.litNodeClient, + id: id2, + }); + console.log('signature'); + console.log(signature2); + const signatureIsValidForPublicKey = nacl5.sign.detached.verify( + Buffer.from(messageToSign), + ethers_exports.utils.base58.decode(signature2), + solanaKeypair.publicKey.toBuffer() + ); + if (!signatureIsValidForPublicKey) + throw new Error( + `signature: ${signature2} doesn't validate for the Solana public key: ${solanaKeypair.publicKey.toString()}` + ); + log('\u2705 testSignMessageWithSolanaEncryptedKey'); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/wrapped-keys/testSignTransactionWithSolanaEncryptedKey.ts +init_shim(); +import { + Connection as Connection2, + Keypair as Keypair6, + LAMPORTS_PER_SOL, + PublicKey, + SystemProgram, + Transaction as Transaction2, + clusterApiUrl as clusterApiUrl2, +} from '@solana/web3.js'; +var { + importPrivateKey: importPrivateKey16, + signTransactionWithEncryptedKey: signTransactionWithEncryptedKey8, +} = api; +var testSignTransactionWithSolanaEncryptedKey = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + const pkpSessionSigs = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const solanaKeypair = Keypair6.generate(); + const privateKey = Buffer.from(solanaKeypair.secretKey).toString('hex'); + const { pkpAddress, id: id2 } = await importPrivateKey16({ + pkpSessionSigs, + privateKey, + litNodeClient: devEnv.litNodeClient, + publicKey: '0xdeadbeef', + // publicKey: publicKey.toBase58(), + keyType: 'K256', + memo: 'Test key', + }); + const solanaConnection = new Connection2( + clusterApiUrl2('devnet'), + 'confirmed' + ); + const alicePkpAddress = alice.authMethodOwnedPkp.ethAddress; + if (pkpAddress !== alicePkpAddress) { + throw new Error( + `Received address: ${pkpAddress} doesn't match Alice's PKP address: ${alicePkpAddress}` + ); + } + const pkpSessionSigsSigning = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const solanaTransaction = new Transaction2(); + solanaTransaction.add( + SystemProgram.transfer({ + fromPubkey: solanaKeypair.publicKey, + toPubkey: new PublicKey(solanaKeypair.publicKey), + lamports: LAMPORTS_PER_SOL / 100, + // Transfer 0.01 SOL + }) + ); + solanaTransaction.feePayer = solanaKeypair.publicKey; + const { blockhash } = await solanaConnection.getLatestBlockhash(); + solanaTransaction.recentBlockhash = blockhash; + const serializedTransaction = solanaTransaction + .serialize({ + requireAllSignatures: false, + // should be false as we're not signing the message + verifySignatures: false, + // should be false as we're not signing the message + }) + .toString('base64'); + const unsignedTransaction = { + serializedTransaction, + chain: 'devnet', + }; + const signedTx = await signTransactionWithEncryptedKey8({ + pkpSessionSigs: pkpSessionSigsSigning, + network: 'solana', + unsignedTransaction, + broadcast: false, + // broadcast: true, + litNodeClient: devEnv.litNodeClient, + id: id2, + }); + const signatureBuffer = Buffer.from( + ethers_exports.utils.base58.decode(signedTx) + ); + solanaTransaction.addSignature(solanaKeypair.publicKey, signatureBuffer); + if (!solanaTransaction.verifySignatures()) { + throw new Error( + `Signature: ${signedTx} doesn't validate for the Solana transaction.` + ); + } + log('\u2705 testSignMessageWithSolanaEncryptedKey'); + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/wrapped-keys/testBatchGeneratePrivateKeys.ts +init_shim(); +var import_bs58 = __toESM(require_bs58(), 1); +import nacl6 from 'tweetnacl'; +var { batchGeneratePrivateKeys: batchGeneratePrivateKeys2 } = api; +async function verifySolanaSignature(solanaResult, solanaMessageToSign) { + const { + signMessage: { signature: signature2 }, + generateEncryptedPrivateKey: { generatedPublicKey }, + } = solanaResult; + const signatureIsValidForPublicKey = nacl6.sign.detached.verify( + Buffer.from(solanaMessageToSign), + import_bs58.default.decode(signature2), + import_bs58.default.decode(generatedPublicKey) + ); + console.log({ signatureIsValidForPublicKey, signature: signature2 }); + if (!signatureIsValidForPublicKey) { + throw new Error( + `signature: ${signature2} doesn't validate for the Solana public key: ${generatedPublicKey}` + ); + } +} +async function verifyEvmSignature(evmResult, messageToSign) { + function verifyMessageSignature() { + try { + return ethers_exports.utils.verifyMessage( + messageToSign, + evmResult.signMessage.signature + ); + } catch (err) { + throw new Error( + `When validating signed Ethereum message is valid: ${err.message}` + ); + } + } + const walletAddress = ethers_exports.utils.computeAddress( + evmResult.generateEncryptedPrivateKey.generatedPublicKey + ); + const recoveredAddress = verifyMessageSignature(); + console.log({ + recoveredAddress, + walletAddress, + signature: evmResult.signMessage.signature, + }); + if (recoveredAddress !== walletAddress) { + throw new Error( + "Recovered address from verifyMessage doesn't match the wallet address" + ); + } +} +var testBatchGeneratePrivateKeys = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + const pkpSessionSigsSigning = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const solanaMessageToSign = 'This is a test solana message'; + const evmMessageToSign = 'This is a test evm message'; + const { results } = await batchGeneratePrivateKeys2({ + pkpSessionSigs: pkpSessionSigsSigning, + actions: [ + { + network: 'evm', + signMessageParams: { messageToSign: evmMessageToSign }, + generateKeyParams: { memo: 'Test evm key' }, + }, + { + network: 'solana', + signMessageParams: { messageToSign: solanaMessageToSign }, + generateKeyParams: { memo: 'Test solana key' }, + }, + ], + litNodeClient: devEnv.litNodeClient, + }); + if (results.length !== 2) { + throw new Error( + `Incorrect # of results; expected 2, got ${results.length}` + ); + } + if ( + results[0].generateEncryptedPrivateKey.memo !== 'Test evm key' || + results[1].generateEncryptedPrivateKey.memo !== 'Test solana key' + ) { + throw new Error( + 'Results not in order sent; expected evm as first result, solana as second' + ); + } + if ( + !results[0].signMessage.signature || + !results[1].signMessage.signature + ) { + throw new Error('Missing message signature in response'); + } + console.log('solana verify sig'); + await verifySolanaSignature(results[1], solanaMessageToSign); + console.log('evm verify sig'); + await verifyEvmSignature(results[0], evmMessageToSign); + console.log('results', results); + log('\u2705 testBatchGenerateEncryptedKeys'); + } catch (err) { + console.log(err.message, err, err.stack); + throw err; + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/wrapped-keys/testFailStoreEncryptedKeyBatchIsAtomic.ts +init_shim(); +var { storeEncryptedKeyBatch: storeEncryptedKeyBatch2 } = api; +var testFailBatchGeneratePrivateKeysAtomic = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + const pkpSessionSigsSigning = await getPkpSessionSigs( + devEnv, + alice, + null, + new Date(Date.now() + 1e3 * 60 * 10).toISOString() + ); + const solanaMessageToSign = 'This is a test solana message'; + const evmMessageToSign = 'This is a test evm message'; + const sessionSig = getFirstSessionSig(pkpSessionSigsSigning); + const pkpAddress = getPkpAddressFromSessionSig(sessionSig); + const allowPkpAddressToDecrypt = getPkpAccessControlCondition(pkpAddress); + const { litActionCode, litActionIpfsCid } = getLitActionCodeOrCidCommon( + 'batchGenerateEncryptedKeys' + ); + const actionResults = await batchGenerateKeysWithLitAction({ + litNodeClient: devEnv.litNodeClient, + litActionIpfsCid: litActionCode ? void 0 : litActionIpfsCid, + litActionCode: litActionCode ? litActionCode : void 0, + accessControlConditions: [allowPkpAddressToDecrypt], + actions: [ + { + network: 'evm', + signMessageParams: { messageToSign: evmMessageToSign }, + generateKeyParams: { memo: 'Test evm key' }, + }, + { + network: 'solana', + signMessageParams: { messageToSign: solanaMessageToSign }, + generateKeyParams: { memo: 'Test solana key' }, + }, + ], + pkpSessionSigs: pkpSessionSigsSigning, + }); + const keyParamsBatch = actionResults.map((keyData) => { + const { generateEncryptedPrivateKey, network } = keyData; + return { + ...generateEncryptedPrivateKey, + keyType: getKeyTypeFromNetwork(network), + }; + }); + delete keyParamsBatch[0].publicKey; + try { + await storeEncryptedKeyBatch2({ + pkpSessionSigs: pkpSessionSigsSigning, + litNodeClient: devEnv.litNodeClient, + keyBatch: keyParamsBatch, + }); + throw new Error( + 'storeEncryptedKeyBatch() succeeded but we expected it to fail!' + ); + } catch (err) { + if ( + err.message.includes( + 'storeEncryptedKeyBatch() succeeded but we expected it to fail!' + ) || + !err.message.includes( + 'keyParamsBatch[0]: Missing "publicKey" parameter in request' + ) + ) { + throw err; + } + try { + const keys = await listEncryptedKeyMetadata({ + litNodeClient: devEnv.litNodeClient, + pkpSessionSigs: pkpSessionSigsSigning, + }); + console.error( + 'Got a value back we shouldnt have from listEncryptedKeyMetadata()', + keys + ); + throw new Error( + 'Expected `listEncryptedKeyMetadata() to fail, but it didnt!`' + ); + } catch (err2) { + if (err2.message.includes('No keys exist for pkpAddress')) { + log('\u2705 testFailBatchGeneratePrivateKeysAtomic'); + } else { + throw err2; + } + } + } + } catch (err) { + console.log(err.message, err, err.stack); + throw err; + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests/testUseEoaSessionSigsToRequestSingleResponse.ts +init_shim(); +var testUseEoaSessionSigsToRequestSingleResponse = async (devEnv) => { + const alice = await devEnv.createRandomPerson(); + try { + const eoaSessionSigs = await getEoaSessionSigs(devEnv, alice); + const res = await devEnv.litNodeClient.executeJs({ + sessionSigs: eoaSessionSigs, + code: `(async () => { + console.log('hello world') + })();`, + useSingleNode: true, + }); + console.log('res:', res); + if (res.response) { + throw new Error(`Expected "response" to be falsy`); + } + if (!res.logs) { + throw new Error(`Expected "logs" in res`); + } + if (!res.logs.includes('hello world')) { + throw new Error(`Expected "logs" to include 'hello world'`); + } + if (!res.success) { + throw new Error(`Expected "success" in res`); + } + } finally { + devEnv.releasePrivateKeyFromUser(alice); + } +}; + +// local-tests/tests.ts +var relayerTests = { + testRelayer, +}; +var wrappedKeysTests = { + // -- valid cases + testBatchGeneratePrivateKeys, + testEthereumSignMessageGeneratedKey, + testEthereumBroadcastTransactionGeneratedKey, + testEthereumSignMessageWrappedKey, + testEthereumSignTransactionWrappedKey, + testEthereumBroadcastTransactionWrappedKey, + testEthereumBroadcastWrappedKeyWithFetchGasParams, + // -- generate wrapped keys + testGenerateEthereumWrappedKey, + testGenerateSolanaWrappedKey, + // -- import wrapped keys + testImportWrappedKey, + // -- export wrapped keys + testExportWrappedKey, + // -- solana wrapped keys + testSignMessageWithSolanaEncryptedKey, + testSignTransactionWithSolanaEncryptedKey, + // -- invalid cases + testFailEthereumSignTransactionWrappedKeyWithMissingParam, + testFailEthereumSignTransactionWrappedKeyWithInvalidParam, + testFailEthereumSignTransactionWrappedKeyInvalidDecryption, + testFailBatchGeneratePrivateKeysAtomic, + // -- import wrapped keys + testFailImportWrappedKeysWithSamePrivateKey, + testFailImportWrappedKeysWithEoaSessionSig, + testFailImportWrappedKeysWithMaxExpirySessionSig, + testFailImportWrappedKeysWithInvalidSessionSig, + testFailImportWrappedKeysWithExpiredSessionSig, +}; +var eoaSessionSigsTests = { + testUseEoaSessionSigsToExecuteJsSigning, + testUseEoaSessionSigsToPkpSign, + testUseEoaSessionSigsToExecuteJsSigningInParallel, + testUseEoaSessionSigsToExecuteJsClaimKeys, + testUseEoaSessionSigsToExecuteJsClaimMultipleKeys, + testUseEoaSessionSigsToExecuteJsJsonResponse, + testUseEoaSessionSigsToExecuteJsConsoleLog, + testUseEoaSessionSigsToEncryptDecryptString, + testUseEoaSessionSigsToEncryptDecryptUint8Array, + testUseEoaSessionSigsToEncryptDecryptFile, +}; +var pkpSessionSigsTests = { + testUsePkpSessionSigsToExecuteJsSigning, + testUsePkpSessionSigsToPkpSign, + testUsePkpSessionSigsToExecuteJsSigningInParallel, + testUsePkpSessionSigsToExecuteJsClaimKeys, + testUsePkpSessionSigsToExecuteJsClaimMultipleKeys, + testUsePkpSessionSigsToExecuteJsJsonResponse, + testUsePkpSessionSigsToExecuteJsConsoleLog, + testUsePkpSessionSigsToEncryptDecryptString, + testUsePkpSessionSigsToEncryptDecryptFile, +}; +var litActionSessionSigsTests = { + testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigning, + testUseValidLitActionCodeGeneratedSessionSigsToPkpSign, + testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigningInParallel, + testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimKeys, + testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimMultipleKeys, + testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsJsonResponse, + testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsConsoleLog, + testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptString, + testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptFile, + // -- invalid cases + testUseInvalidLitActionIpfsCodeToGenerateSessionSigs, + // -- custom auth methods + testUseCustomAuthSessionSigsToPkpSignExecuteJs, +}; +var litActionIpfsIdSessionSigsTests = { + testUseValidLitActionIpfsCodeGeneratedSessionSigsToPkpSign, + testUseValidLitActionIpfsCodeGeneratedSessionSigsToExecuteJsSigning, + // -- invalid cases + testUseInvalidLitActionCodeToGenerateSessionSigs, +}; +var bareAuthSigTests = { + // -- eth auth sig + testEthAuthSigToEncryptDecryptString, + // -- solana auth sig + testSolAuthSigToEncryptDecryptString, + // -- cosmos auth sig + testCosmosAuthSigToEncryptDecryptString, +}; +var pkpEthersTest = { + eoaSessionSigs: { + testPkpEthersWithEoaSessionSigsToSignWithAuthContext, + testPkpEthersWithEoaSessionSigsToSignMessage, + testPkpEthersWithEoaSessionSigsToEthSign, + testPkpEthersWithEoaSessionSigsToPersonalSign, + testPkpEthersWithEoaSessionSigsToSendTx, + testPkpEthersWithEoaSessionSigsToEthSignTransaction, + testPkpEthersWithEoaSessionSigsToEthSignTypedDataV1, + testPkpEthersWithEoaSessionSigsToEthSignTypedDataV3, + testPkpEthersWithEoaSessionSigsToEthSignTypedDataV4, + testPkpEthersWithEoaSessionSigsToEthSignTypedData, + testPkpEthersWithEoaSessionSigsToEthSignTypedDataUtil, + }, + pkpSessionSigs: { + testPkpEthersWithPkpSessionSigsToSignMessage, + testPkpEthersWithPkpSessionSigsToEthSign, + testPkpEthersWithPkpSessionSigsToPersonalSign, + testPkpEthersWithPkpSessionSigsToSendTx, + testPkpEthersWithPkpSessionSigsToEthSignTransaction, + testPkpEthersWithPkpSessionSigsToEthSignTypedDataV1, + testPkpEthersWithPkpSessionSigsToEthSignTypedDataV3, + testPkpEthersWithPkpSessionSigsToEthSignTypedDataV4, + testPkpEthersWithPkpSessionSigsToEthSignTypedData, + testPkpEthersWithPkpSessionSigsToEthSignTypedDataUtil, + }, + litActionSessionSigs: { + testPkpEthersWithLitActionSessionSigsToSignMessage, + testPkpEthersWithLitActionSessionSigsToEthSign, + testPkpEthersWithLitActionSessionSigsToPersonalSign, + testPkpEthersWithLitActionSessionSigsToSendTx, + testPkpEthersWithLitActionSessionSigsToEthSignTransaction, + testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV1, + testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV3, + testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV4, + testPkpEthersWithLitActionSessionSigsToEthSignTypedData, + testPkpEthersWithLitActionSessionSigsToEthSignTypedDataUtil, + }, +}; +var litActionCombiningTests = { + ecdsaSignAndCombine: { + testExecuteJsSignAndCombineEcdsa, + }, + decryptAndCombine: { + testExecutJsDecryptAndCombine, + }, + broadcastAndCombine: { + testExecuteJsBroadcastAndCollect, + }, +}; +var tinnyTests = { + // testExample, + // testBundleSpeed, + ...eoaSessionSigsTests, + ...pkpSessionSigsTests, + ...litActionSessionSigsTests, + ...litActionIpfsIdSessionSigsTests, + ...bareAuthSigTests, + ...pkpEthersTest.eoaSessionSigs, + ...pkpEthersTest.pkpSessionSigs, + ...pkpEthersTest.litActionSessionSigs, + ...litActionCombiningTests.broadcastAndCombine, + ...litActionCombiningTests.decryptAndCombine, + ...litActionCombiningTests.ecdsaSignAndCombine, + ...relayerTests, + ...wrappedKeysTests, +}; +export { + AccessControlConditions, + TinnyEnvironment, + getEoaSessionSigs, + getLitActionSessionSigs, + getPkpSessionSigs, + runInBand, + runTestsParallel, + tests_exports as tinnyTests, +}; +/*! Bundled license information: + +js-sha3/src/sha3.js: + (** + * [js-sha3]{@link https://github.com/emn178/js-sha3} + * + * @version 0.8.0 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2015-2018 + * @license MIT + *) + +safe-buffer/index.js: + (*! safe-buffer. MIT License. Feross Aboukhadijeh *) +*/ diff --git a/packages/access-control-conditions/package.json b/packages/access-control-conditions/package.json index 7fdfd001f..4dfadd8dd 100644 --- a/packages/access-control-conditions/package.json +++ b/packages/access-control-conditions/package.json @@ -21,7 +21,7 @@ "tags": [ "universal" ], - "version": "7.0.9", + "version": "7.0.10-alpha.0", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/auth-browser/package.json b/packages/auth-browser/package.json index 8c3a5cd61..91ea834ce 100644 --- a/packages/auth-browser/package.json +++ b/packages/auth-browser/package.json @@ -31,7 +31,7 @@ "tags": [ "browser" ], - "version": "7.0.9", + "version": "7.0.10-alpha.0", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/auth-helpers/package.json b/packages/auth-helpers/package.json index 3dfd8bc15..28a1dd48f 100644 --- a/packages/auth-helpers/package.json +++ b/packages/auth-helpers/package.json @@ -25,7 +25,7 @@ "crypto": false, "stream": false }, - "version": "7.0.9", + "version": "7.0.10-alpha.0", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/constants/package.json b/packages/constants/package.json index d7c823378..db39afc95 100644 --- a/packages/constants/package.json +++ b/packages/constants/package.json @@ -20,7 +20,7 @@ "tags": [ "universal" ], - "version": "7.0.9", + "version": "7.0.10-alpha.0", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/constants/src/lib/version.ts b/packages/constants/src/lib/version.ts index 8bf305ab2..1d62c2aa1 100644 --- a/packages/constants/src/lib/version.ts +++ b/packages/constants/src/lib/version.ts @@ -1 +1 @@ -export const version = '7.0.9'; +export const version = '7.0.10-alpha.0'; diff --git a/packages/contracts-sdk/package.json b/packages/contracts-sdk/package.json index 722b92597..61287dcb7 100644 --- a/packages/contracts-sdk/package.json +++ b/packages/contracts-sdk/package.json @@ -25,7 +25,7 @@ "tags": [ "universal" ], - "version": "7.0.9", + "version": "7.0.10-alpha.0", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/core/package.json b/packages/core/package.json index e9aac81ed..d6e751d8d 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@lit-protocol/core", - "version": "7.0.9", + "version": "7.0.10-alpha.0", "type": "commonjs", "license": "MIT", "homepage": "https://github.com/Lit-Protocol/js-sdk", @@ -27,4 +27,4 @@ ], "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/crypto/package.json b/packages/crypto/package.json index 96c4abc67..24e85c4f0 100644 --- a/packages/crypto/package.json +++ b/packages/crypto/package.json @@ -21,7 +21,7 @@ "tags": [ "universal" ], - "version": "7.0.9", + "version": "7.0.10-alpha.0", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/encryption/package.json b/packages/encryption/package.json index 969f9e3ab..18cbf3e95 100644 --- a/packages/encryption/package.json +++ b/packages/encryption/package.json @@ -25,7 +25,7 @@ "crypto": false, "stream": false }, - "version": "7.0.9", + "version": "7.0.10-alpha.0", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/event-listener/package.json b/packages/event-listener/package.json index 13bbfe043..3c24d3b87 100644 --- a/packages/event-listener/package.json +++ b/packages/event-listener/package.json @@ -26,7 +26,7 @@ "scripts": { "generate-lit-actions": "yarn node ./esbuild.config.js" }, - "version": "7.0.9", + "version": "7.0.10-alpha.0", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/lit-auth-client/package.json b/packages/lit-auth-client/package.json index 564be0338..0d045d8b6 100644 --- a/packages/lit-auth-client/package.json +++ b/packages/lit-auth-client/package.json @@ -1,6 +1,6 @@ { "name": "@lit-protocol/lit-auth-client", - "version": "7.0.9", + "version": "7.0.10-alpha.0", "type": "commonjs", "license": "MIT", "homepage": "https://github.com/Lit-Protocol/js-sdk", @@ -31,4 +31,4 @@ }, "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/lit-node-client-nodejs/package.json b/packages/lit-node-client-nodejs/package.json index 2971c53ae..f8778443e 100644 --- a/packages/lit-node-client-nodejs/package.json +++ b/packages/lit-node-client-nodejs/package.json @@ -24,7 +24,7 @@ "tags": [ "nodejs" ], - "version": "7.0.9", + "version": "7.0.10-alpha.0", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/lit-node-client/package.json b/packages/lit-node-client/package.json index d6d9a3ba8..fea05fa5b 100644 --- a/packages/lit-node-client/package.json +++ b/packages/lit-node-client/package.json @@ -28,7 +28,7 @@ "crypto": false, "stream": false }, - "version": "7.0.9", + "version": "7.0.10-alpha.0", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/logger/package.json b/packages/logger/package.json index 0c005a80c..4fddc8113 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -1,6 +1,6 @@ { "name": "@lit-protocol/logger", - "version": "7.0.9", + "version": "7.0.10-alpha.0", "type": "commonjs", "tags": [ "universal" @@ -11,4 +11,4 @@ }, "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/misc-browser/package.json b/packages/misc-browser/package.json index 660ef92f5..61d7f58f4 100644 --- a/packages/misc-browser/package.json +++ b/packages/misc-browser/package.json @@ -21,7 +21,7 @@ "tags": [ "browser" ], - "version": "7.0.9", + "version": "7.0.10-alpha.0", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/misc/package.json b/packages/misc/package.json index fa0d2aca4..f9079c8d2 100644 --- a/packages/misc/package.json +++ b/packages/misc/package.json @@ -21,7 +21,7 @@ "tags": [ "universal" ], - "version": "7.0.9", + "version": "7.0.10-alpha.0", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/nacl/package.json b/packages/nacl/package.json index 4170e1be3..86a5646ab 100644 --- a/packages/nacl/package.json +++ b/packages/nacl/package.json @@ -21,7 +21,7 @@ "access": "public", "directory": "../../dist/packages/nacl" }, - "version": "7.0.9", + "version": "7.0.10-alpha.0", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/pkp-base/package.json b/packages/pkp-base/package.json index 55a22462c..13f0d9389 100644 --- a/packages/pkp-base/package.json +++ b/packages/pkp-base/package.json @@ -1,6 +1,6 @@ { "name": "@lit-protocol/pkp-base", - "version": "7.0.9", + "version": "7.0.10-alpha.0", "type": "commonjs", "license": "MIT", "homepage": "https://github.com/Lit-Protocol/js-sdk", @@ -27,4 +27,4 @@ ], "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/pkp-cosmos/package.json b/packages/pkp-cosmos/package.json index 5bb80c628..d0366e8e1 100644 --- a/packages/pkp-cosmos/package.json +++ b/packages/pkp-cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@lit-protocol/pkp-cosmos", - "version": "7.0.9", + "version": "7.0.10-alpha.0", "type": "commonjs", "license": "MIT", "homepage": "https://github.com/Lit-Protocol/js-sdk", @@ -27,4 +27,4 @@ ], "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/pkp-ethers/package.json b/packages/pkp-ethers/package.json index d0be02c92..f2f90d632 100644 --- a/packages/pkp-ethers/package.json +++ b/packages/pkp-ethers/package.json @@ -20,7 +20,7 @@ "tags": [ "universal" ], - "version": "7.0.9", + "version": "7.0.10-alpha.0", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/pkp-sui/package.json b/packages/pkp-sui/package.json index 1b8669f7b..2345e0cd0 100644 --- a/packages/pkp-sui/package.json +++ b/packages/pkp-sui/package.json @@ -1,6 +1,6 @@ { "name": "@lit-protocol/pkp-sui", - "version": "7.0.9", + "version": "7.0.10-alpha.0", "type": "commonjs", "license": "MIT", "homepage": "https://github.com/Lit-Protocol/js-sdk", @@ -27,4 +27,4 @@ ], "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/pkp-walletconnect/package.json b/packages/pkp-walletconnect/package.json index 57bea04e4..f94ee3238 100644 --- a/packages/pkp-walletconnect/package.json +++ b/packages/pkp-walletconnect/package.json @@ -1,6 +1,6 @@ { "name": "@lit-protocol/pkp-walletconnect", - "version": "7.0.9", + "version": "7.0.10-alpha.0", "type": "commonjs", "license": "MIT", "homepage": "https://github.com/Lit-Protocol/js-sdk", @@ -34,4 +34,4 @@ ], "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/types/package.json b/packages/types/package.json index 4bd51cf18..10c39fb29 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -23,7 +23,7 @@ "buildOptions": { "genReact": false }, - "version": "7.0.9", + "version": "7.0.10-alpha.0", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/types/src/lib/interfaces.ts b/packages/types/src/lib/interfaces.ts index 85569b7df..cdc567c61 100644 --- a/packages/types/src/lib/interfaces.ts +++ b/packages/types/src/lib/interfaces.ts @@ -482,6 +482,11 @@ export interface JsonExecutionSdkParams * auth methods to resolve */ authMethods?: AuthMethod[]; + + /** + * Whether or not the the action is a js "module" with import statements + */ + module?: boolean; } export interface ExecuteJsAdvancedOptions { diff --git a/packages/uint8arrays/package.json b/packages/uint8arrays/package.json index 28c69b94e..3a2e1d3b1 100644 --- a/packages/uint8arrays/package.json +++ b/packages/uint8arrays/package.json @@ -21,7 +21,7 @@ "tags": [ "universal" ], - "version": "7.0.9", + "version": "7.0.10-alpha.0", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/wasm/package.json b/packages/wasm/package.json index b76a952f0..52d9eb5fe 100644 --- a/packages/wasm/package.json +++ b/packages/wasm/package.json @@ -1,6 +1,6 @@ { "name": "@lit-protocol/wasm", - "version": "7.0.9", + "version": "7.0.10-alpha.0", "type": "commonjs", "homepage": "https://github.com/Lit-Protocol/js-sdk", "repository": { @@ -31,4 +31,4 @@ }, "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/wasm/rust/rust-toolchain.toml b/packages/wasm/rust/rust-toolchain.toml new file mode 100644 index 000000000..315be31a7 --- /dev/null +++ b/packages/wasm/rust/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "1.83" +components = ["rustfmt", "clippy"] +profile = "minimal" diff --git a/packages/wrapped-keys-lit-actions/package.json b/packages/wrapped-keys-lit-actions/package.json index e400b1505..22205f806 100644 --- a/packages/wrapped-keys-lit-actions/package.json +++ b/packages/wrapped-keys-lit-actions/package.json @@ -26,7 +26,7 @@ "scripts": { "generate-lit-actions": "yarn node ./esbuild.config.js" }, - "version": "7.0.9", + "version": "7.0.10-alpha.0", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file diff --git a/packages/wrapped-keys/package.json b/packages/wrapped-keys/package.json index 01926abb3..e749d2e98 100644 --- a/packages/wrapped-keys/package.json +++ b/packages/wrapped-keys/package.json @@ -23,7 +23,7 @@ "buildOptions": { "genReact": false }, - "version": "7.0.9", + "version": "7.0.10-alpha.0", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" -} +} \ No newline at end of file