diff --git a/assets/index-fc6d18d2.js b/assets/index-27f9f029.js similarity index 99% rename from assets/index-fc6d18d2.js rename to assets/index-27f9f029.js index 406035a..62a715e 100644 --- a/assets/index-fc6d18d2.js +++ b/assets/index-27f9f029.js @@ -8053,6 +8053,22 @@ function assertSize(hexOrBytes, { size: size2 }) { maxSize: size2 }); } +function hexToBigInt(hex, opts = {}) { + const { signed } = opts; + if (opts.size) + assertSize(hex, { size: opts.size }); + const value = BigInt(hex); + if (!signed) + return value; + const size2 = (hex.length - 2) / 2; + const max = (1n << BigInt(size2) * 8n - 1n) - 1n; + if (value <= max) + return value; + return value - BigInt(`0x${"f".padStart(size2 * 2, "f")}`) - 1n; +} +function hexToNumber$2(hex, opts = {}) { + return Number(hexToBigInt(hex, opts)); +} const hexes$3 = /* @__PURE__ */ Array.from({ length: 256 }, (_v3, i2) => i2.toString(16).padStart(2, "0")); function toHex$3(value, opts = {}) { if (typeof value === "number" || typeof value === "bigint") @@ -11284,7 +11300,7 @@ function version4(parameters) { options: ((_a3 = parameters.preference) == null ? void 0 : _a3.options) ?? "all" }; })(); - const { createCoinbaseWalletSDK } = await __vitePreload(() => import("./index-90d26802.js"), true ? ["./index-90d26802.js","./hooks.module-2202d2c9.js"] : void 0, import.meta.url); + const { createCoinbaseWalletSDK } = await __vitePreload(() => import("./index-90f34287.js"), true ? ["./index-90f34287.js","./hooks.module-2202d2c9.js"] : void 0, import.meta.url); const sdk = createCoinbaseWalletSDK({ ...parameters, appChainIds: config2.chains.map((x3) => x3.id), @@ -11456,7 +11472,7 @@ function version3(parameters) { var _a3; if (!walletProvider) { const CoinbaseWalletSDK = await (async () => { - const { default: SDK } = await __vitePreload(() => import("./index-a373930a.js").then((n5) => n5.i), true ? ["./index-a373930a.js","./hooks.module-2202d2c9.js"] : void 0, import.meta.url); + const { default: SDK } = await __vitePreload(() => import("./index-bfdec467.js").then((n5) => n5.i), true ? ["./index-bfdec467.js","./hooks.module-2202d2c9.js"] : void 0, import.meta.url); if (typeof SDK !== "function" && typeof SDK.default === "function") return SDK.default; return SDK; @@ -11553,6 +11569,339 @@ function version3(parameters) { } })); } +metaMask$1.type = "metaMask"; +function metaMask$1(parameters = {}) { + let sdk; + let provider; + let providerPromise; + let accountsChanged; + let chainChanged; + let connect2; + let displayUri; + let disconnect2; + return createConnector((config2) => ({ + id: "metaMaskSDK", + name: "MetaMask", + rdns: ["io.metamask", "io.metamask.mobile"], + type: metaMask$1.type, + async setup() { + const provider2 = await this.getProvider(); + if (provider2 == null ? void 0 : provider2.on) { + if (!connect2) { + connect2 = this.onConnect.bind(this); + provider2.on("connect", connect2); + } + if (!accountsChanged) { + accountsChanged = this.onAccountsChanged.bind(this); + provider2.on("accountsChanged", accountsChanged); + } + } + }, + async connect({ chainId, isReconnecting: isReconnecting2 } = {}) { + const provider2 = await this.getProvider(); + if (!displayUri) { + displayUri = this.onDisplayUri; + provider2.on("display_uri", displayUri); + } + let accounts2 = []; + if (isReconnecting2) + accounts2 = await this.getAccounts().catch(() => []); + try { + let signResponse; + let connectWithResponse; + if (!(accounts2 == null ? void 0 : accounts2.length)) { + if (parameters.connectAndSign || parameters.connectWith) { + if (parameters.connectAndSign) + signResponse = await sdk.connectAndSign({ + msg: parameters.connectAndSign + }); + else if (parameters.connectWith) + connectWithResponse = await sdk.connectWith({ + method: parameters.connectWith.method, + params: parameters.connectWith.params + }); + accounts2 = await this.getAccounts(); + } else { + const requestedAccounts = await sdk.connect(); + accounts2 = requestedAccounts.map((x3) => getAddress$2(x3)); + } + } + let currentChainId = await this.getChainId(); + if (chainId && currentChainId !== chainId) { + const chain = await this.switchChain({ chainId }).catch((error) => { + if (error.code === UserRejectedRequestError.code) + throw error; + return { id: currentChainId }; + }); + currentChainId = (chain == null ? void 0 : chain.id) ?? currentChainId; + } + if (displayUri) { + provider2.removeListener("display_uri", displayUri); + displayUri = void 0; + } + if (signResponse) + provider2.emit("connectAndSign", { + accounts: accounts2, + chainId: currentChainId, + signResponse + }); + else if (connectWithResponse) + provider2.emit("connectWith", { + accounts: accounts2, + chainId: currentChainId, + connectWithResponse + }); + if (connect2) { + provider2.removeListener("connect", connect2); + connect2 = void 0; + } + if (!accountsChanged) { + accountsChanged = this.onAccountsChanged.bind(this); + provider2.on("accountsChanged", accountsChanged); + } + if (!chainChanged) { + chainChanged = this.onChainChanged.bind(this); + provider2.on("chainChanged", chainChanged); + } + if (!disconnect2) { + disconnect2 = this.onDisconnect.bind(this); + provider2.on("disconnect", disconnect2); + } + return { accounts: accounts2, chainId: currentChainId }; + } catch (err) { + const error = err; + if (error.code === UserRejectedRequestError.code) + throw new UserRejectedRequestError(error); + if (error.code === ResourceUnavailableRpcError.code) + throw new ResourceUnavailableRpcError(error); + throw error; + } + }, + async disconnect() { + const provider2 = await this.getProvider(); + if (chainChanged) { + provider2.removeListener("chainChanged", chainChanged); + chainChanged = void 0; + } + if (disconnect2) { + provider2.removeListener("disconnect", disconnect2); + disconnect2 = void 0; + } + if (!connect2) { + connect2 = this.onConnect.bind(this); + provider2.on("connect", connect2); + } + await sdk.terminate(); + }, + async getAccounts() { + const provider2 = await this.getProvider(); + const accounts2 = await provider2.request({ + method: "eth_accounts" + }); + return accounts2.map((x3) => getAddress$2(x3)); + }, + async getChainId() { + const provider2 = await this.getProvider(); + const chainId = provider2.getChainId() || await (provider2 == null ? void 0 : provider2.request({ method: "eth_chainId" })); + return Number(chainId); + }, + async getProvider() { + async function initProvider() { + var _a3; + const MetaMaskSDK = await (async () => { + const { default: SDK } = await __vitePreload(() => import("./metamask-sdk-bfcf1e83.js").then((n5) => n5.m), true ? [] : void 0, import.meta.url); + if (typeof SDK !== "function" && typeof SDK.default === "function") + return SDK.default; + return SDK; + })(); + const readonlyRPCMap = {}; + for (const chain of config2.chains) + readonlyRPCMap[numberToHex(chain.id)] = (_a3 = extractRpcUrls({ + chain, + transports: config2.transports + })) == null ? void 0 : _a3[0]; + sdk = new MetaMaskSDK({ + _source: "wagmi", + forceDeleteProvider: false, + forceInjectProvider: false, + injectProvider: false, + // Workaround cast since MetaMask SDK does not support `'exactOptionalPropertyTypes'` + ...parameters, + readonlyRPCMap, + dappMetadata: parameters.dappMetadata ?? (typeof window !== "undefined" ? { url: window.location.origin } : { name: "wagmi", url: "https://wagmi.sh" }), + useDeeplink: parameters.useDeeplink ?? true + }); + const result = await sdk.init(); + const provider2 = (() => { + if (result == null ? void 0 : result.activeProvider) + return result.activeProvider; + return sdk.getProvider(); + })(); + if (!provider2) + throw new ProviderNotFoundError(); + return provider2; + } + if (!provider) { + if (!providerPromise) + providerPromise = initProvider(); + provider = await providerPromise; + } + return provider; + }, + async isAuthorized() { + try { + const timeout = 200; + const accounts2 = await withRetry(() => withTimeout(() => this.getAccounts(), { timeout }), { + delay: timeout + 1, + retryCount: 3 + }); + return !!accounts2.length; + } catch { + return false; + } + }, + async switchChain({ addEthereumChainParameter, chainId }) { + var _a3, _b2, _c2, _d2; + const provider2 = await this.getProvider(); + const chain = config2.chains.find((x3) => x3.id === chainId); + if (!chain) + throw new SwitchChainError(new ChainNotConfiguredError()); + try { + await Promise.all([ + provider2.request({ + method: "wallet_switchEthereumChain", + params: [{ chainId: numberToHex(chainId) }] + }).then(async () => { + const currentChainId = await this.getChainId(); + if (currentChainId === chainId) + config2.emitter.emit("change", { chainId }); + }), + new Promise((resolve) => { + const listener = (data) => { + if ("chainId" in data && data.chainId === chainId) { + config2.emitter.off("change", listener); + resolve(); + } + }; + config2.emitter.on("change", listener); + }) + ]); + return chain; + } catch (err) { + const error = err; + if (error.code === 4902 || // Unwrapping for MetaMask Mobile + // https://github.com/MetaMask/metamask-mobile/issues/2944#issuecomment-976988719 + ((_b2 = (_a3 = error == null ? void 0 : error.data) == null ? void 0 : _a3.originalError) == null ? void 0 : _b2.code) === 4902) { + try { + const { default: blockExplorer, ...blockExplorers } = chain.blockExplorers ?? {}; + let blockExplorerUrls; + if (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.blockExplorerUrls) + blockExplorerUrls = addEthereumChainParameter.blockExplorerUrls; + else if (blockExplorer) + blockExplorerUrls = [ + blockExplorer.url, + ...Object.values(blockExplorers).map((x3) => x3.url) + ]; + let rpcUrls; + if ((_c2 = addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.rpcUrls) == null ? void 0 : _c2.length) + rpcUrls = addEthereumChainParameter.rpcUrls; + else + rpcUrls = [((_d2 = chain.rpcUrls.default) == null ? void 0 : _d2.http[0]) ?? ""]; + const addEthereumChain = { + blockExplorerUrls, + chainId: numberToHex(chainId), + chainName: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.chainName) ?? chain.name, + iconUrls: addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.iconUrls, + nativeCurrency: (addEthereumChainParameter == null ? void 0 : addEthereumChainParameter.nativeCurrency) ?? chain.nativeCurrency, + rpcUrls + }; + await provider2.request({ + method: "wallet_addEthereumChain", + params: [addEthereumChain] + }); + const currentChainId = hexToNumber$2( + // Call `'eth_chainId'` directly to guard against `this.state.chainId` (via `provider.getChainId`) being stale. + await provider2.request({ method: "eth_chainId" }) + ); + if (currentChainId !== chainId) + throw new UserRejectedRequestError(new Error("User rejected switch after adding network.")); + return chain; + } catch (error2) { + throw new UserRejectedRequestError(error2); + } + } + if (error.code === UserRejectedRequestError.code) + throw new UserRejectedRequestError(error); + throw new SwitchChainError(error); + } + }, + async onAccountsChanged(accounts2) { + if (accounts2.length === 0) { + if (sdk.isExtensionActive()) + this.onDisconnect(); + else + return; + } else if (config2.emitter.listenerCount("connect")) { + const chainId = (await this.getChainId()).toString(); + this.onConnect({ chainId }); + } else + config2.emitter.emit("change", { + accounts: accounts2.map((x3) => getAddress$2(x3)) + }); + }, + onChainChanged(chain) { + const chainId = Number(chain); + config2.emitter.emit("change", { chainId }); + }, + async onConnect(connectInfo) { + const accounts2 = await this.getAccounts(); + if (accounts2.length === 0) + return; + const chainId = Number(connectInfo.chainId); + config2.emitter.emit("connect", { accounts: accounts2, chainId }); + const provider2 = await this.getProvider(); + if (connect2) { + provider2.removeListener("connect", connect2); + connect2 = void 0; + } + if (!accountsChanged) { + accountsChanged = this.onAccountsChanged.bind(this); + provider2.on("accountsChanged", accountsChanged); + } + if (!chainChanged) { + chainChanged = this.onChainChanged.bind(this); + provider2.on("chainChanged", chainChanged); + } + if (!disconnect2) { + disconnect2 = this.onDisconnect.bind(this); + provider2.on("disconnect", disconnect2); + } + }, + async onDisconnect(error) { + const provider2 = await this.getProvider(); + if (error && error.code === 1013) { + if (provider2 && !!(await this.getAccounts()).length) + return; + } + config2.emitter.emit("disconnect"); + if (chainChanged) { + provider2.removeListener("chainChanged", chainChanged); + chainChanged = void 0; + } + if (disconnect2) { + provider2.removeListener("disconnect", disconnect2); + disconnect2 = void 0; + } + if (!connect2) { + connect2 = this.onConnect.bind(this); + provider2.on("connect", connect2); + } + }, + onDisplayUri(uri) { + config2.emitter.emit("message", { type: "display_uri", data: uri }); + } + })); +} walletConnect$1.type = "walletConnect"; function walletConnect$1(parameters) { const isNewChainsStale = parameters.isNewChainsStale ?? true; @@ -11689,7 +12038,7 @@ function walletConnect$1(parameters) { const optionalChains = config2.chains.map((x3) => x3.id); if (!optionalChains.length) return; - const { EthereumProvider: EthereumProvider2 } = await __vitePreload(() => import("./index.es-326aeb41.js"), true ? [] : void 0, import.meta.url); + const { EthereumProvider: EthereumProvider2 } = await __vitePreload(() => import("./index.es-d980d16b.js"), true ? [] : void 0, import.meta.url); return await EthereumProvider2.init({ ...parameters, disableProviderPing: true, @@ -16739,7 +17088,7 @@ function v$4() { case 0: if ((typeof window === "undefined" ? "undefined" : o$1(window)) > "u") return [2]; - return [4, __vitePreload(() => import("./index-a0bd348d.js"), true ? [] : void 0, import.meta.url)]; + return [4, __vitePreload(() => import("./index-c990757b.js"), true ? [] : void 0, import.meta.url)]; case 1: l2 = s2.sent().default, f4 = h4 || ((e18 = a3.chains[0]) === null || e18 === void 0 ? void 0 : e18.id), d4 = n5.infuraId ? {} : a3.chains.reduce(function(n6, e19) { return c$3(r$3({}, n6), t({}, e19.id, e19.rpcUrls.default.http[0])); @@ -121265,11 +121614,15 @@ function metaMask(props = {}) { return `https://metamask.app.link/wc?uri=${encodedUri}`; }, getCreateConnectorFn() { - return injected({ - shimDisconnect: true, - target: "metaMask", - ...connectorOptions - }); + if (isTMA()) { + return metaMask$1(); + } else { + return injected({ + shimDisconnect: true, + target: "metaMask", + ...connectorOptions + }); + } }, ...restProps }; diff --git a/assets/index-efd9f7df.js b/assets/index-89f4c82c.js similarity index 99% rename from assets/index-efd9f7df.js rename to assets/index-89f4c82c.js index 1fc416e..ed5d432 100644 --- a/assets/index-efd9f7df.js +++ b/assets/index-89f4c82c.js @@ -1,4 +1,4 @@ -import { aa as __vitePreload } from "./index-fc6d18d2.js"; +import { aa as __vitePreload } from "./index-27f9f029.js"; const t = Symbol(); const s = Object.getPrototypeOf, c = /* @__PURE__ */ new WeakMap(), l = (e) => e && (c.has(e) ? c.get(e) : s(e) === Object.prototype || s(e) === Array.prototype), y = (e) => l(e) && e[t] || null, h = (e, t2 = true) => { c.set(e, t2); @@ -791,7 +791,7 @@ class WalletConnectModal { } async initUi() { if (typeof window !== "undefined") { - await __vitePreload(() => import("./index-53847741.js"), true ? ["./index-53847741.js","./index-fc6d18d2.js","./index-51b56c12.css"] : void 0, import.meta.url); + await __vitePreload(() => import("./index-c8c01036.js"), true ? ["./index-c8c01036.js","./index-27f9f029.js","./index-51b56c12.css"] : void 0, import.meta.url); const modal = document.createElement("wcm-modal"); document.body.insertAdjacentElement("beforeend", modal); OptionsCtrl.setIsUiLoaded(true); diff --git a/assets/index-90d26802.js b/assets/index-90f34287.js similarity index 99% rename from assets/index-90d26802.js rename to assets/index-90f34287.js index 896543e..23e4bc8 100644 --- a/assets/index-90d26802.js +++ b/assets/index-90f34287.js @@ -1,4 +1,4 @@ -import { R as Hash, S as createView, T as exists$1, U as toBytes, V as output$1, X as wrapConstructor, Y as rotr, Z as getAugmentedNamespace, k as getDefaultExportFromCjs, $ as bytesToHex, O } from "./index-fc6d18d2.js"; +import { R as Hash, S as createView, T as exists$1, U as toBytes, V as output$1, X as wrapConstructor, Y as rotr, Z as getAugmentedNamespace, k as getDefaultExportFromCjs, $ as bytesToHex, O } from "./index-27f9f029.js"; import { q, _, c as clsx, h, y } from "./hooks.module-2202d2c9.js"; const crypto$1 = typeof globalThis === "object" && "crypto" in globalThis ? globalThis.crypto : void 0; const crypto$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ diff --git a/assets/index-a373930a.js b/assets/index-bfdec467.js similarity index 99% rename from assets/index-a373930a.js rename to assets/index-bfdec467.js index 0225cce..6a49d3d 100644 --- a/assets/index-a373930a.js +++ b/assets/index-bfdec467.js @@ -1,4 +1,4 @@ -import { n as commonjsGlobal, a0 as bnExports, a1 as safeBufferExports, a2 as inherits_browserExports, Z as getAugmentedNamespace, a3 as eventsExports, a4 as buffer, a5 as require$$3, a6 as eventemitter3Exports, k as getDefaultExportFromCjs } from "./index-fc6d18d2.js"; +import { n as commonjsGlobal, a0 as bnExports, a1 as safeBufferExports, a2 as inherits_browserExports, Z as getAugmentedNamespace, a3 as eventsExports, a4 as buffer, a5 as require$$3, a6 as eventemitter3Exports, k as getDefaultExportFromCjs } from "./index-27f9f029.js"; import { p as preact_module, a as clsx_m, b as hooks_module } from "./hooks.module-2202d2c9.js"; function _mergeNamespaces(n, m) { for (var i = 0; i < m.length; i++) { diff --git a/assets/index-53847741.js b/assets/index-c8c01036.js similarity index 99% rename from assets/index-53847741.js rename to assets/index-c8c01036.js index 22e359d..1fe1f7b 100644 --- a/assets/index-53847741.js +++ b/assets/index-c8c01036.js @@ -1,5 +1,5 @@ -import { T as ThemeCtrl, M as ModalCtrl, R as RouterCtrl, E as ExplorerCtrl, C as CoreUtil, a as ToastCtrl, b as EventsCtrl, O as OptionsCtrl, c as ConfigCtrl } from "./index-efd9f7df.js"; -import { ac as browser } from "./index-fc6d18d2.js"; +import { T as ThemeCtrl, M as ModalCtrl, R as RouterCtrl, E as ExplorerCtrl, C as CoreUtil, a as ToastCtrl, b as EventsCtrl, O as OptionsCtrl, c as ConfigCtrl } from "./index-89f4c82c.js"; +import { ac as browser } from "./index-27f9f029.js"; /** * @license * Copyright 2019 Google LLC diff --git a/assets/index-a0bd348d.js b/assets/index-c990757b.js similarity index 99% rename from assets/index-a0bd348d.js rename to assets/index-c990757b.js index d30ffe3..0b1883e 100644 --- a/assets/index-a0bd348d.js +++ b/assets/index-c990757b.js @@ -1,4 +1,4 @@ -import { O, e as ea$2, Q as Q$2, z as z$1, a as ep$1, r as rm, b as ed$1, m, W as W$1, c as reactExports, d as eh$1, f as createRoot, g as rP, h as rT, i as rj, j as rC, k as getDefaultExportFromCjs, l as rh, _ as _BN, n as commonjsGlobal, o as eD, p as ej, q as q$1, s as rl, t as rd, u as rp, v as r_, w as rA, x as rS, y as rs, A as W$2, B as rN, C as rc, D as rf, G as G$1, E as eM, F as decode, H as et$1, I as ef$1, J as rx, K as rD, L as ey$1, M as ev$1, N as ee$1, P as eC } from "./index-fc6d18d2.js"; +import { O, e as ea$2, Q as Q$2, z as z$1, a as ep$1, r as rm, b as ed$1, m, W as W$1, c as reactExports, d as eh$1, f as createRoot, g as rP, h as rT, i as rj, j as rC, k as getDefaultExportFromCjs, l as rh, _ as _BN, n as commonjsGlobal, o as eD, p as ej, q as q$1, s as rl, t as rd, u as rp, v as r_, w as rA, x as rS, y as rs, A as W$2, B as rN, C as rc, D as rf, G as G$1, E as eM, F as decode, H as et$1, I as ef$1, J as rx, K as rD, L as ey$1, M as ev$1, N as ee$1, P as eC } from "./index-27f9f029.js"; function e$6(e2, t3, r2, n11, i2, o2, s2) { try { var u2 = e2[o2](s2); diff --git a/assets/index.es-326aeb41.js b/assets/index.es-d980d16b.js similarity index 98% rename from assets/index.es-326aeb41.js rename to assets/index.es-d980d16b.js index e4b3385..fefbad4 100644 --- a/assets/index.es-326aeb41.js +++ b/assets/index.es-d980d16b.js @@ -1,4 +1,4 @@ -import { a3 as eventsExports, a7 as Wo, a8 as er, a9 as Ev, aa as __vitePreload, ab as Nr } from "./index-fc6d18d2.js"; +import { a3 as eventsExports, a7 as Wo, a8 as er, a9 as Ev, aa as __vitePreload, ab as Nr } from "./index-27f9f029.js"; const R = "wc", T = "ethereum_provider", $ = `${R}@2:${T}:`, j = "https://rpc.walletconnect.org/v1/", u = ["eth_sendTransaction", "personal_sign"], y = ["eth_accounts", "eth_requestAccounts", "eth_sendRawTransaction", "eth_sign", "eth_signTransaction", "eth_signTypedData", "eth_signTypedData_v3", "eth_signTypedData_v4", "eth_sendTransaction", "personal_sign", "wallet_switchEthereumChain", "wallet_addEthereumChain", "wallet_getPermissions", "wallet_requestPermissions", "wallet_registerOnboarding", "wallet_watchAsset", "wallet_scanQRCode", "wallet_sendCalls", "wallet_getCapabilities", "wallet_getCallsStatus", "wallet_showCallsStatus"], g = ["chainChanged", "accountsChanged"], b = ["chainChanged", "accountsChanged", "message", "disconnect", "connect"]; var q = Object.defineProperty, N = Object.defineProperties, D = Object.getOwnPropertyDescriptors, M = Object.getOwnPropertySymbols, U = Object.prototype.hasOwnProperty, Q = Object.prototype.propertyIsEnumerable, O = (r, t, s) => t in r ? q(r, t, { enumerable: true, configurable: true, writable: true, value: s }) : r[t] = s, p = (r, t) => { for (var s in t || (t = {})) @@ -171,7 +171,7 @@ class C { if (this.rpc = this.getRpcConfig(t), this.chainId = this.rpc.chains.length ? m(this.rpc.chains) : m(this.rpc.optionalChains), this.signer = await Ev.init({ projectId: this.rpc.projectId, metadata: this.rpc.metadata, disableProviderPing: t.disableProviderPing, relayUrl: t.relayUrl, storageOptions: t.storageOptions, customStoragePrefix: t.customStoragePrefix, telemetryEnabled: t.telemetryEnabled }), this.registerEventListeners(), await this.loadPersistedSession(), this.rpc.showQrModal) { let s; try { - const { WalletConnectModal: i } = await __vitePreload(() => import("./index-efd9f7df.js").then((n) => n.i), true ? ["./index-efd9f7df.js","./index-fc6d18d2.js","./index-51b56c12.css"] : void 0, import.meta.url); + const { WalletConnectModal: i } = await __vitePreload(() => import("./index-89f4c82c.js").then((n) => n.i), true ? ["./index-89f4c82c.js","./index-27f9f029.js","./index-51b56c12.css"] : void 0, import.meta.url); s = i; } catch { throw new Error("To use QR modal, please install @walletconnect/modal package"); diff --git a/assets/metamask-sdk-bfcf1e83.js b/assets/metamask-sdk-bfcf1e83.js new file mode 100644 index 0000000..2f5a441 --- /dev/null +++ b/assets/metamask-sdk-bfcf1e83.js @@ -0,0 +1,40959 @@ +import { k as getDefaultExportFromCjs, n as commonjsGlobal } from "./index-27f9f029.js"; +function _mergeNamespaces(n, m) { + for (var i = 0; i < m.length; i++) { + const e = m[i]; + if (typeof e !== "string" && !Array.isArray(e)) { + for (const k in e) { + if (k !== "default" && !(k in n)) { + const d = Object.getOwnPropertyDescriptor(e, k); + if (d) { + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: () => e[k] + }); + } + } + } + } + } + return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" })); +} +var metamaskSdk$2 = { exports: {} }; +(function(module, exports) { + !function(e, t) { + t(exports); + }(commonjsGlobal, function(e) { + var t = "undefined" != typeof commonjsGlobal ? commonjsGlobal : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, n = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof commonjsGlobal ? commonjsGlobal : "undefined" != typeof self ? self : {}; + function r(e2) { + return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2; + } + function i(e2) { + if (e2.__esModule) + return e2; + var t2 = e2.default; + if ("function" == typeof t2) { + var n2 = function e3() { + return this instanceof e3 ? Reflect.construct(t2, arguments, this.constructor) : t2.apply(this, arguments); + }; + n2.prototype = t2.prototype; + } else + n2 = {}; + return Object.defineProperty(n2, "__esModule", { value: true }), Object.keys(e2).forEach(function(t3) { + var r2 = Object.getOwnPropertyDescriptor(e2, t3); + Object.defineProperty(n2, t3, r2.get ? r2 : { enumerable: true, get: function() { + return e2[t3]; + } }); + }), n2; + } + var o = { exports: {} }; + !function(e2, t2) { + var r2 = "undefined" != typeof globalThis && globalThis || "undefined" != typeof self && self || void 0 !== n && n, i2 = function() { + function e3() { + this.fetch = false, this.DOMException = r2.DOMException; + } + return e3.prototype = r2, new e3(); + }(); + !function(e3) { + !function(t3) { + var n2 = void 0 !== e3 && e3 || "undefined" != typeof self && self || void 0 !== n2 && n2, r3 = "URLSearchParams" in n2, i3 = "Symbol" in n2 && "iterator" in Symbol, o3 = "FileReader" in n2 && "Blob" in n2 && function() { + try { + return new Blob(), true; + } catch (e4) { + return false; + } + }(), a2 = "FormData" in n2, s2 = "ArrayBuffer" in n2; + if (s2) + var u2 = ["[object Int8Array]", "[object Uint8Array]", "[object Uint8ClampedArray]", "[object Int16Array]", "[object Uint16Array]", "[object Int32Array]", "[object Uint32Array]", "[object Float32Array]", "[object Float64Array]"], l2 = ArrayBuffer.isView || function(e4) { + return e4 && u2.indexOf(Object.prototype.toString.call(e4)) > -1; + }; + function c2(e4) { + if ("string" != typeof e4 && (e4 = String(e4)), /[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e4) || "" === e4) + throw new TypeError('Invalid character in header field name: "' + e4 + '"'); + return e4.toLowerCase(); + } + function d2(e4) { + return "string" != typeof e4 && (e4 = String(e4)), e4; + } + function f2(e4) { + var t4 = { next: function() { + var t5 = e4.shift(); + return { done: void 0 === t5, value: t5 }; + } }; + return i3 && (t4[Symbol.iterator] = function() { + return t4; + }), t4; + } + function h2(e4) { + this.map = {}, e4 instanceof h2 ? e4.forEach(function(e5, t4) { + this.append(t4, e5); + }, this) : Array.isArray(e4) ? e4.forEach(function(e5) { + this.append(e5[0], e5[1]); + }, this) : e4 && Object.getOwnPropertyNames(e4).forEach(function(t4) { + this.append(t4, e4[t4]); + }, this); + } + function p2(e4) { + if (e4.bodyUsed) + return Promise.reject(new TypeError("Already read")); + e4.bodyUsed = true; + } + function m2(e4) { + return new Promise(function(t4, n3) { + e4.onload = function() { + t4(e4.result); + }, e4.onerror = function() { + n3(e4.error); + }; + }); + } + function g2(e4) { + var t4 = new FileReader(), n3 = m2(t4); + return t4.readAsArrayBuffer(e4), n3; + } + function v2(e4) { + if (e4.slice) + return e4.slice(0); + var t4 = new Uint8Array(e4.byteLength); + return t4.set(new Uint8Array(e4)), t4.buffer; + } + function b2() { + return this.bodyUsed = false, this._initBody = function(e4) { + var t4; + this.bodyUsed = this.bodyUsed, this._bodyInit = e4, e4 ? "string" == typeof e4 ? this._bodyText = e4 : o3 && Blob.prototype.isPrototypeOf(e4) ? this._bodyBlob = e4 : a2 && FormData.prototype.isPrototypeOf(e4) ? this._bodyFormData = e4 : r3 && URLSearchParams.prototype.isPrototypeOf(e4) ? this._bodyText = e4.toString() : s2 && o3 && ((t4 = e4) && DataView.prototype.isPrototypeOf(t4)) ? (this._bodyArrayBuffer = v2(e4.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : s2 && (ArrayBuffer.prototype.isPrototypeOf(e4) || l2(e4)) ? this._bodyArrayBuffer = v2(e4) : this._bodyText = e4 = Object.prototype.toString.call(e4) : this._bodyText = "", this.headers.get("content-type") || ("string" == typeof e4 ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : r3 && URLSearchParams.prototype.isPrototypeOf(e4) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8")); + }, o3 && (this.blob = function() { + var e4 = p2(this); + if (e4) + return e4; + if (this._bodyBlob) + return Promise.resolve(this._bodyBlob); + if (this._bodyArrayBuffer) + return Promise.resolve(new Blob([this._bodyArrayBuffer])); + if (this._bodyFormData) + throw new Error("could not read FormData body as blob"); + return Promise.resolve(new Blob([this._bodyText])); + }, this.arrayBuffer = function() { + if (this._bodyArrayBuffer) { + var e4 = p2(this); + return e4 || (ArrayBuffer.isView(this._bodyArrayBuffer) ? Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset, this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength)) : Promise.resolve(this._bodyArrayBuffer)); + } + return this.blob().then(g2); + }), this.text = function() { + var e4, t4, n3, r4 = p2(this); + if (r4) + return r4; + if (this._bodyBlob) + return e4 = this._bodyBlob, t4 = new FileReader(), n3 = m2(t4), t4.readAsText(e4), n3; + if (this._bodyArrayBuffer) + return Promise.resolve(function(e5) { + for (var t5 = new Uint8Array(e5), n4 = new Array(t5.length), r5 = 0; r5 < t5.length; r5++) + n4[r5] = String.fromCharCode(t5[r5]); + return n4.join(""); + }(this._bodyArrayBuffer)); + if (this._bodyFormData) + throw new Error("could not read FormData body as text"); + return Promise.resolve(this._bodyText); + }, a2 && (this.formData = function() { + return this.text().then(_2); + }), this.json = function() { + return this.text().then(JSON.parse); + }, this; + } + h2.prototype.append = function(e4, t4) { + e4 = c2(e4), t4 = d2(t4); + var n3 = this.map[e4]; + this.map[e4] = n3 ? n3 + ", " + t4 : t4; + }, h2.prototype.delete = function(e4) { + delete this.map[c2(e4)]; + }, h2.prototype.get = function(e4) { + return e4 = c2(e4), this.has(e4) ? this.map[e4] : null; + }, h2.prototype.has = function(e4) { + return this.map.hasOwnProperty(c2(e4)); + }, h2.prototype.set = function(e4, t4) { + this.map[c2(e4)] = d2(t4); + }, h2.prototype.forEach = function(e4, t4) { + for (var n3 in this.map) + this.map.hasOwnProperty(n3) && e4.call(t4, this.map[n3], n3, this); + }, h2.prototype.keys = function() { + var e4 = []; + return this.forEach(function(t4, n3) { + e4.push(n3); + }), f2(e4); + }, h2.prototype.values = function() { + var e4 = []; + return this.forEach(function(t4) { + e4.push(t4); + }), f2(e4); + }, h2.prototype.entries = function() { + var e4 = []; + return this.forEach(function(t4, n3) { + e4.push([n3, t4]); + }), f2(e4); + }, i3 && (h2.prototype[Symbol.iterator] = h2.prototype.entries); + var y2 = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"]; + function w2(e4, t4) { + if (!(this instanceof w2)) + throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.'); + var n3 = (t4 = t4 || {}).body; + if (e4 instanceof w2) { + if (e4.bodyUsed) + throw new TypeError("Already read"); + this.url = e4.url, this.credentials = e4.credentials, t4.headers || (this.headers = new h2(e4.headers)), this.method = e4.method, this.mode = e4.mode, this.signal = e4.signal, n3 || null == e4._bodyInit || (n3 = e4._bodyInit, e4.bodyUsed = true); + } else + this.url = String(e4); + if (this.credentials = t4.credentials || this.credentials || "same-origin", !t4.headers && this.headers || (this.headers = new h2(t4.headers)), this.method = function(e5) { + var t5 = e5.toUpperCase(); + return y2.indexOf(t5) > -1 ? t5 : e5; + }(t4.method || this.method || "GET"), this.mode = t4.mode || this.mode || null, this.signal = t4.signal || this.signal, this.referrer = null, ("GET" === this.method || "HEAD" === this.method) && n3) + throw new TypeError("Body not allowed for GET or HEAD requests"); + if (this._initBody(n3), !("GET" !== this.method && "HEAD" !== this.method || "no-store" !== t4.cache && "no-cache" !== t4.cache)) { + var r4 = /([?&])_=[^&]*/; + if (r4.test(this.url)) + this.url = this.url.replace(r4, "$1_=" + (/* @__PURE__ */ new Date()).getTime()); + else { + this.url += (/\?/.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime(); + } + } + } + function _2(e4) { + var t4 = new FormData(); + return e4.trim().split("&").forEach(function(e5) { + if (e5) { + var n3 = e5.split("="), r4 = n3.shift().replace(/\+/g, " "), i4 = n3.join("=").replace(/\+/g, " "); + t4.append(decodeURIComponent(r4), decodeURIComponent(i4)); + } + }), t4; + } + function S2(e4, t4) { + if (!(this instanceof S2)) + throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.'); + t4 || (t4 = {}), this.type = "default", this.status = void 0 === t4.status ? 200 : t4.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = void 0 === t4.statusText ? "" : "" + t4.statusText, this.headers = new h2(t4.headers), this.url = t4.url || "", this._initBody(e4); + } + w2.prototype.clone = function() { + return new w2(this, { body: this._bodyInit }); + }, b2.call(w2.prototype), b2.call(S2.prototype), S2.prototype.clone = function() { + return new S2(this._bodyInit, { status: this.status, statusText: this.statusText, headers: new h2(this.headers), url: this.url }); + }, S2.error = function() { + var e4 = new S2(null, { status: 0, statusText: "" }); + return e4.type = "error", e4; + }; + var E2 = [301, 302, 303, 307, 308]; + S2.redirect = function(e4, t4) { + if (-1 === E2.indexOf(t4)) + throw new RangeError("Invalid status code"); + return new S2(null, { status: t4, headers: { location: e4 } }); + }, t3.DOMException = n2.DOMException; + try { + new t3.DOMException(); + } catch (e4) { + t3.DOMException = function(e5, t4) { + this.message = e5, this.name = t4; + var n3 = Error(e5); + this.stack = n3.stack; + }, t3.DOMException.prototype = Object.create(Error.prototype), t3.DOMException.prototype.constructor = t3.DOMException; + } + function k2(e4, r4) { + return new Promise(function(i4, a3) { + var u3 = new w2(e4, r4); + if (u3.signal && u3.signal.aborted) + return a3(new t3.DOMException("Aborted", "AbortError")); + var l3 = new XMLHttpRequest(); + function c3() { + l3.abort(); + } + l3.onload = function() { + var e5, t4, n3 = { status: l3.status, statusText: l3.statusText, headers: (e5 = l3.getAllResponseHeaders() || "", t4 = new h2(), e5.replace(/\r?\n[\t ]+/g, " ").split("\r").map(function(e6) { + return 0 === e6.indexOf("\n") ? e6.substr(1, e6.length) : e6; + }).forEach(function(e6) { + var n4 = e6.split(":"), r6 = n4.shift().trim(); + if (r6) { + var i5 = n4.join(":").trim(); + t4.append(r6, i5); + } + }), t4) }; + n3.url = "responseURL" in l3 ? l3.responseURL : n3.headers.get("X-Request-URL"); + var r5 = "response" in l3 ? l3.response : l3.responseText; + setTimeout(function() { + i4(new S2(r5, n3)); + }, 0); + }, l3.onerror = function() { + setTimeout(function() { + a3(new TypeError("Network request failed")); + }, 0); + }, l3.ontimeout = function() { + setTimeout(function() { + a3(new TypeError("Network request failed")); + }, 0); + }, l3.onabort = function() { + setTimeout(function() { + a3(new t3.DOMException("Aborted", "AbortError")); + }, 0); + }, l3.open(u3.method, function(e5) { + try { + return "" === e5 && n2.location.href ? n2.location.href : e5; + } catch (t4) { + return e5; + } + }(u3.url), true), "include" === u3.credentials ? l3.withCredentials = true : "omit" === u3.credentials && (l3.withCredentials = false), "responseType" in l3 && (o3 ? l3.responseType = "blob" : s2 && u3.headers.get("Content-Type") && -1 !== u3.headers.get("Content-Type").indexOf("application/octet-stream") && (l3.responseType = "arraybuffer")), !r4 || "object" != typeof r4.headers || r4.headers instanceof h2 ? u3.headers.forEach(function(e5, t4) { + l3.setRequestHeader(t4, e5); + }) : Object.getOwnPropertyNames(r4.headers).forEach(function(e5) { + l3.setRequestHeader(e5, d2(r4.headers[e5])); + }), u3.signal && (u3.signal.addEventListener("abort", c3), l3.onreadystatechange = function() { + 4 === l3.readyState && u3.signal.removeEventListener("abort", c3); + }), l3.send(void 0 === u3._bodyInit ? null : u3._bodyInit); + }); + } + k2.polyfill = true, n2.fetch || (n2.fetch = k2, n2.Headers = h2, n2.Request = w2, n2.Response = S2), t3.Headers = h2, t3.Request = w2, t3.Response = S2, t3.fetch = k2; + }({}); + }(i2), i2.fetch.ponyfill = true, delete i2.fetch.polyfill; + var o2 = r2.fetch ? r2 : i2; + (t2 = o2.fetch).default = o2.fetch, t2.fetch = o2.fetch, t2.Headers = o2.Headers, t2.Request = o2.Request, t2.Response = o2.Response, e2.exports = t2; + }(o, o.exports); + var a = r(o.exports), s = [], u = [], l = "undefined" != typeof Uint8Array ? Uint8Array : Array, c = false; + function d() { + c = true; + for (var e2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", t2 = 0; t2 < 64; ++t2) + s[t2] = e2[t2], u[e2.charCodeAt(t2)] = t2; + u["-".charCodeAt(0)] = 62, u["_".charCodeAt(0)] = 63; + } + function f(e2, t2, n2) { + for (var r2, i2, o2 = [], a2 = t2; a2 < n2; a2 += 3) + r2 = (e2[a2] << 16) + (e2[a2 + 1] << 8) + e2[a2 + 2], o2.push(s[(i2 = r2) >> 18 & 63] + s[i2 >> 12 & 63] + s[i2 >> 6 & 63] + s[63 & i2]); + return o2.join(""); + } + function h(e2) { + var t2; + c || d(); + for (var n2 = e2.length, r2 = n2 % 3, i2 = "", o2 = [], a2 = 16383, u2 = 0, l2 = n2 - r2; u2 < l2; u2 += a2) + o2.push(f(e2, u2, u2 + a2 > l2 ? l2 : u2 + a2)); + return 1 === r2 ? (t2 = e2[n2 - 1], i2 += s[t2 >> 2], i2 += s[t2 << 4 & 63], i2 += "==") : 2 === r2 && (t2 = (e2[n2 - 2] << 8) + e2[n2 - 1], i2 += s[t2 >> 10], i2 += s[t2 >> 4 & 63], i2 += s[t2 << 2 & 63], i2 += "="), o2.push(i2), o2.join(""); + } + function p(e2, t2, n2, r2, i2) { + var o2, a2, s2 = 8 * i2 - r2 - 1, u2 = (1 << s2) - 1, l2 = u2 >> 1, c2 = -7, d2 = n2 ? i2 - 1 : 0, f2 = n2 ? -1 : 1, h2 = e2[t2 + d2]; + for (d2 += f2, o2 = h2 & (1 << -c2) - 1, h2 >>= -c2, c2 += s2; c2 > 0; o2 = 256 * o2 + e2[t2 + d2], d2 += f2, c2 -= 8) + ; + for (a2 = o2 & (1 << -c2) - 1, o2 >>= -c2, c2 += r2; c2 > 0; a2 = 256 * a2 + e2[t2 + d2], d2 += f2, c2 -= 8) + ; + if (0 === o2) + o2 = 1 - l2; + else { + if (o2 === u2) + return a2 ? NaN : 1 / 0 * (h2 ? -1 : 1); + a2 += Math.pow(2, r2), o2 -= l2; + } + return (h2 ? -1 : 1) * a2 * Math.pow(2, o2 - r2); + } + function m(e2, t2, n2, r2, i2, o2) { + var a2, s2, u2, l2 = 8 * o2 - i2 - 1, c2 = (1 << l2) - 1, d2 = c2 >> 1, f2 = 23 === i2 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, h2 = r2 ? 0 : o2 - 1, p2 = r2 ? 1 : -1, m2 = t2 < 0 || 0 === t2 && 1 / t2 < 0 ? 1 : 0; + for (t2 = Math.abs(t2), isNaN(t2) || t2 === 1 / 0 ? (s2 = isNaN(t2) ? 1 : 0, a2 = c2) : (a2 = Math.floor(Math.log(t2) / Math.LN2), t2 * (u2 = Math.pow(2, -a2)) < 1 && (a2--, u2 *= 2), (t2 += a2 + d2 >= 1 ? f2 / u2 : f2 * Math.pow(2, 1 - d2)) * u2 >= 2 && (a2++, u2 /= 2), a2 + d2 >= c2 ? (s2 = 0, a2 = c2) : a2 + d2 >= 1 ? (s2 = (t2 * u2 - 1) * Math.pow(2, i2), a2 += d2) : (s2 = t2 * Math.pow(2, d2 - 1) * Math.pow(2, i2), a2 = 0)); i2 >= 8; e2[n2 + h2] = 255 & s2, h2 += p2, s2 /= 256, i2 -= 8) + ; + for (a2 = a2 << i2 | s2, l2 += i2; l2 > 0; e2[n2 + h2] = 255 & a2, h2 += p2, a2 /= 256, l2 -= 8) + ; + e2[n2 + h2 - p2] |= 128 * m2; + } + var g = {}.toString, v = Array.isArray || function(e2) { + return "[object Array]" == g.call(e2); + }; + _.TYPED_ARRAY_SUPPORT = void 0 === t.TYPED_ARRAY_SUPPORT || t.TYPED_ARRAY_SUPPORT; + var b = y(); + function y() { + return _.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823; + } + function w(e2, t2) { + if (y() < t2) + throw new RangeError("Invalid typed array length"); + return _.TYPED_ARRAY_SUPPORT ? (e2 = new Uint8Array(t2)).__proto__ = _.prototype : (null === e2 && (e2 = new _(t2)), e2.length = t2), e2; + } + function _(e2, t2, n2) { + if (!(_.TYPED_ARRAY_SUPPORT || this instanceof _)) + return new _(e2, t2, n2); + if ("number" == typeof e2) { + if ("string" == typeof t2) + throw new Error("If encoding is specified then the first argument must be a string"); + return k(this, e2); + } + return S(this, e2, t2, n2); + } + function S(e2, t2, n2, r2) { + if ("number" == typeof t2) + throw new TypeError('"value" argument must not be a number'); + return "undefined" != typeof ArrayBuffer && t2 instanceof ArrayBuffer ? function(e3, t3, n3, r3) { + if (t3.byteLength, n3 < 0 || t3.byteLength < n3) + throw new RangeError("'offset' is out of bounds"); + if (t3.byteLength < n3 + (r3 || 0)) + throw new RangeError("'length' is out of bounds"); + t3 = void 0 === n3 && void 0 === r3 ? new Uint8Array(t3) : void 0 === r3 ? new Uint8Array(t3, n3) : new Uint8Array(t3, n3, r3); + _.TYPED_ARRAY_SUPPORT ? (e3 = t3).__proto__ = _.prototype : e3 = M(e3, t3); + return e3; + }(e2, t2, n2, r2) : "string" == typeof t2 ? function(e3, t3, n3) { + "string" == typeof n3 && "" !== n3 || (n3 = "utf8"); + if (!_.isEncoding(n3)) + throw new TypeError('"encoding" must be a valid string encoding'); + var r3 = 0 | A(t3, n3); + e3 = w(e3, r3); + var i2 = e3.write(t3, n3); + i2 !== r3 && (e3 = e3.slice(0, i2)); + return e3; + }(e2, t2, n2) : function(e3, t3) { + if (x(t3)) { + var n3 = 0 | C(t3.length); + return 0 === (e3 = w(e3, n3)).length || t3.copy(e3, 0, 0, n3), e3; + } + if (t3) { + if ("undefined" != typeof ArrayBuffer && t3.buffer instanceof ArrayBuffer || "length" in t3) + return "number" != typeof t3.length || (r3 = t3.length) != r3 ? w(e3, 0) : M(e3, t3); + if ("Buffer" === t3.type && v(t3.data)) + return M(e3, t3.data); + } + var r3; + throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object."); + }(e2, t2); + } + function E(e2) { + if ("number" != typeof e2) + throw new TypeError('"size" argument must be a number'); + if (e2 < 0) + throw new RangeError('"size" argument must not be negative'); + } + function k(e2, t2) { + if (E(t2), e2 = w(e2, t2 < 0 ? 0 : 0 | C(t2)), !_.TYPED_ARRAY_SUPPORT) + for (var n2 = 0; n2 < t2; ++n2) + e2[n2] = 0; + return e2; + } + function M(e2, t2) { + var n2 = t2.length < 0 ? 0 : 0 | C(t2.length); + e2 = w(e2, n2); + for (var r2 = 0; r2 < n2; r2 += 1) + e2[r2] = 255 & t2[r2]; + return e2; + } + function C(e2) { + if (e2 >= y()) + throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + y().toString(16) + " bytes"); + return 0 | e2; + } + function x(e2) { + return !(null == e2 || !e2._isBuffer); + } + function A(e2, t2) { + if (x(e2)) + return e2.length; + if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e2) || e2 instanceof ArrayBuffer)) + return e2.byteLength; + "string" != typeof e2 && (e2 = "" + e2); + var n2 = e2.length; + if (0 === n2) + return 0; + for (var r2 = false; ; ) + switch (t2) { + case "ascii": + case "latin1": + case "binary": + return n2; + case "utf8": + case "utf-8": + case void 0: + return te(e2).length; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return 2 * n2; + case "hex": + return n2 >>> 1; + case "base64": + return ne(e2).length; + default: + if (r2) + return te(e2).length; + t2 = ("" + t2).toLowerCase(), r2 = true; + } + } + function R(e2, t2, n2) { + var r2 = false; + if ((void 0 === t2 || t2 < 0) && (t2 = 0), t2 > this.length) + return ""; + if ((void 0 === n2 || n2 > this.length) && (n2 = this.length), n2 <= 0) + return ""; + if ((n2 >>>= 0) <= (t2 >>>= 0)) + return ""; + for (e2 || (e2 = "utf8"); ; ) + switch (e2) { + case "hex": + return H(this, t2, n2); + case "utf8": + case "utf-8": + return U(this, t2, n2); + case "ascii": + return K(this, t2, n2); + case "latin1": + case "binary": + return q(this, t2, n2); + case "base64": + return z(this, t2, n2); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return W(this, t2, n2); + default: + if (r2) + throw new TypeError("Unknown encoding: " + e2); + e2 = (e2 + "").toLowerCase(), r2 = true; + } + } + function T(e2, t2, n2) { + var r2 = e2[t2]; + e2[t2] = e2[n2], e2[n2] = r2; + } + function P(e2, t2, n2, r2, i2) { + if (0 === e2.length) + return -1; + if ("string" == typeof n2 ? (r2 = n2, n2 = 0) : n2 > 2147483647 ? n2 = 2147483647 : n2 < -2147483648 && (n2 = -2147483648), n2 = +n2, isNaN(n2) && (n2 = i2 ? 0 : e2.length - 1), n2 < 0 && (n2 = e2.length + n2), n2 >= e2.length) { + if (i2) + return -1; + n2 = e2.length - 1; + } else if (n2 < 0) { + if (!i2) + return -1; + n2 = 0; + } + if ("string" == typeof t2 && (t2 = _.from(t2, r2)), x(t2)) + return 0 === t2.length ? -1 : L(e2, t2, n2, r2, i2); + if ("number" == typeof t2) + return t2 &= 255, _.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? i2 ? Uint8Array.prototype.indexOf.call(e2, t2, n2) : Uint8Array.prototype.lastIndexOf.call(e2, t2, n2) : L(e2, [t2], n2, r2, i2); + throw new TypeError("val must be string, number or Buffer"); + } + function L(e2, t2, n2, r2, i2) { + var o2, a2 = 1, s2 = e2.length, u2 = t2.length; + if (void 0 !== r2 && ("ucs2" === (r2 = String(r2).toLowerCase()) || "ucs-2" === r2 || "utf16le" === r2 || "utf-16le" === r2)) { + if (e2.length < 2 || t2.length < 2) + return -1; + a2 = 2, s2 /= 2, u2 /= 2, n2 /= 2; + } + function l2(e3, t3) { + return 1 === a2 ? e3[t3] : e3.readUInt16BE(t3 * a2); + } + if (i2) { + var c2 = -1; + for (o2 = n2; o2 < s2; o2++) + if (l2(e2, o2) === l2(t2, -1 === c2 ? 0 : o2 - c2)) { + if (-1 === c2 && (c2 = o2), o2 - c2 + 1 === u2) + return c2 * a2; + } else + -1 !== c2 && (o2 -= o2 - c2), c2 = -1; + } else + for (n2 + u2 > s2 && (n2 = s2 - u2), o2 = n2; o2 >= 0; o2--) { + for (var d2 = true, f2 = 0; f2 < u2; f2++) + if (l2(e2, o2 + f2) !== l2(t2, f2)) { + d2 = false; + break; + } + if (d2) + return o2; + } + return -1; + } + function I(e2, t2, n2, r2) { + n2 = Number(n2) || 0; + var i2 = e2.length - n2; + r2 ? (r2 = Number(r2)) > i2 && (r2 = i2) : r2 = i2; + var o2 = t2.length; + if (o2 % 2 != 0) + throw new TypeError("Invalid hex string"); + r2 > o2 / 2 && (r2 = o2 / 2); + for (var a2 = 0; a2 < r2; ++a2) { + var s2 = parseInt(t2.substr(2 * a2, 2), 16); + if (isNaN(s2)) + return a2; + e2[n2 + a2] = s2; + } + return a2; + } + function O(e2, t2, n2, r2) { + return re(te(t2, e2.length - n2), e2, n2, r2); + } + function N(e2, t2, n2, r2) { + return re(function(e3) { + for (var t3 = [], n3 = 0; n3 < e3.length; ++n3) + t3.push(255 & e3.charCodeAt(n3)); + return t3; + }(t2), e2, n2, r2); + } + function D(e2, t2, n2, r2) { + return N(e2, t2, n2, r2); + } + function j(e2, t2, n2, r2) { + return re(ne(t2), e2, n2, r2); + } + function B(e2, t2, n2, r2) { + return re(function(e3, t3) { + for (var n3, r3, i2, o2 = [], a2 = 0; a2 < e3.length && !((t3 -= 2) < 0); ++a2) + r3 = (n3 = e3.charCodeAt(a2)) >> 8, i2 = n3 % 256, o2.push(i2), o2.push(r3); + return o2; + }(t2, e2.length - n2), e2, n2, r2); + } + function z(e2, t2, n2) { + return 0 === t2 && n2 === e2.length ? h(e2) : h(e2.slice(t2, n2)); + } + function U(e2, t2, n2) { + n2 = Math.min(e2.length, n2); + for (var r2 = [], i2 = t2; i2 < n2; ) { + var o2, a2, s2, u2, l2 = e2[i2], c2 = null, d2 = l2 > 239 ? 4 : l2 > 223 ? 3 : l2 > 191 ? 2 : 1; + if (i2 + d2 <= n2) + switch (d2) { + case 1: + l2 < 128 && (c2 = l2); + break; + case 2: + 128 == (192 & (o2 = e2[i2 + 1])) && (u2 = (31 & l2) << 6 | 63 & o2) > 127 && (c2 = u2); + break; + case 3: + o2 = e2[i2 + 1], a2 = e2[i2 + 2], 128 == (192 & o2) && 128 == (192 & a2) && (u2 = (15 & l2) << 12 | (63 & o2) << 6 | 63 & a2) > 2047 && (u2 < 55296 || u2 > 57343) && (c2 = u2); + break; + case 4: + o2 = e2[i2 + 1], a2 = e2[i2 + 2], s2 = e2[i2 + 3], 128 == (192 & o2) && 128 == (192 & a2) && 128 == (192 & s2) && (u2 = (15 & l2) << 18 | (63 & o2) << 12 | (63 & a2) << 6 | 63 & s2) > 65535 && u2 < 1114112 && (c2 = u2); + } + null === c2 ? (c2 = 65533, d2 = 1) : c2 > 65535 && (c2 -= 65536, r2.push(c2 >>> 10 & 1023 | 55296), c2 = 56320 | 1023 & c2), r2.push(c2), i2 += d2; + } + return function(e3) { + var t3 = e3.length; + if (t3 <= F) + return String.fromCharCode.apply(String, e3); + var n3 = "", r3 = 0; + for (; r3 < t3; ) + n3 += String.fromCharCode.apply(String, e3.slice(r3, r3 += F)); + return n3; + }(r2); + } + _.poolSize = 8192, _._augment = function(e2) { + return e2.__proto__ = _.prototype, e2; + }, _.from = function(e2, t2, n2) { + return S(null, e2, t2, n2); + }, _.TYPED_ARRAY_SUPPORT && (_.prototype.__proto__ = Uint8Array.prototype, _.__proto__ = Uint8Array, "undefined" != typeof Symbol && Symbol.species && _[Symbol.species]), _.alloc = function(e2, t2, n2) { + return function(e3, t3, n3, r2) { + return E(t3), t3 <= 0 ? w(e3, t3) : void 0 !== n3 ? "string" == typeof r2 ? w(e3, t3).fill(n3, r2) : w(e3, t3).fill(n3) : w(e3, t3); + }(null, e2, t2, n2); + }, _.allocUnsafe = function(e2) { + return k(null, e2); + }, _.allocUnsafeSlow = function(e2) { + return k(null, e2); + }, _.isBuffer = ie, _.compare = function(e2, t2) { + if (!x(e2) || !x(t2)) + throw new TypeError("Arguments must be Buffers"); + if (e2 === t2) + return 0; + for (var n2 = e2.length, r2 = t2.length, i2 = 0, o2 = Math.min(n2, r2); i2 < o2; ++i2) + if (e2[i2] !== t2[i2]) { + n2 = e2[i2], r2 = t2[i2]; + break; + } + return n2 < r2 ? -1 : r2 < n2 ? 1 : 0; + }, _.isEncoding = function(e2) { + switch (String(e2).toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "latin1": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return true; + default: + return false; + } + }, _.concat = function(e2, t2) { + if (!v(e2)) + throw new TypeError('"list" argument must be an Array of Buffers'); + if (0 === e2.length) + return _.alloc(0); + var n2; + if (void 0 === t2) + for (t2 = 0, n2 = 0; n2 < e2.length; ++n2) + t2 += e2[n2].length; + var r2 = _.allocUnsafe(t2), i2 = 0; + for (n2 = 0; n2 < e2.length; ++n2) { + var o2 = e2[n2]; + if (!x(o2)) + throw new TypeError('"list" argument must be an Array of Buffers'); + o2.copy(r2, i2), i2 += o2.length; + } + return r2; + }, _.byteLength = A, _.prototype._isBuffer = true, _.prototype.swap16 = function() { + var e2 = this.length; + if (e2 % 2 != 0) + throw new RangeError("Buffer size must be a multiple of 16-bits"); + for (var t2 = 0; t2 < e2; t2 += 2) + T(this, t2, t2 + 1); + return this; + }, _.prototype.swap32 = function() { + var e2 = this.length; + if (e2 % 4 != 0) + throw new RangeError("Buffer size must be a multiple of 32-bits"); + for (var t2 = 0; t2 < e2; t2 += 4) + T(this, t2, t2 + 3), T(this, t2 + 1, t2 + 2); + return this; + }, _.prototype.swap64 = function() { + var e2 = this.length; + if (e2 % 8 != 0) + throw new RangeError("Buffer size must be a multiple of 64-bits"); + for (var t2 = 0; t2 < e2; t2 += 8) + T(this, t2, t2 + 7), T(this, t2 + 1, t2 + 6), T(this, t2 + 2, t2 + 5), T(this, t2 + 3, t2 + 4); + return this; + }, _.prototype.toString = function() { + var e2 = 0 | this.length; + return 0 === e2 ? "" : 0 === arguments.length ? U(this, 0, e2) : R.apply(this, arguments); + }, _.prototype.equals = function(e2) { + if (!x(e2)) + throw new TypeError("Argument must be a Buffer"); + return this === e2 || 0 === _.compare(this, e2); + }, _.prototype.inspect = function() { + var e2 = ""; + return this.length > 0 && (e2 = this.toString("hex", 0, 50).match(/.{2}/g).join(" "), this.length > 50 && (e2 += " ... ")), ""; + }, _.prototype.compare = function(e2, t2, n2, r2, i2) { + if (!x(e2)) + throw new TypeError("Argument must be a Buffer"); + if (void 0 === t2 && (t2 = 0), void 0 === n2 && (n2 = e2 ? e2.length : 0), void 0 === r2 && (r2 = 0), void 0 === i2 && (i2 = this.length), t2 < 0 || n2 > e2.length || r2 < 0 || i2 > this.length) + throw new RangeError("out of range index"); + if (r2 >= i2 && t2 >= n2) + return 0; + if (r2 >= i2) + return -1; + if (t2 >= n2) + return 1; + if (this === e2) + return 0; + for (var o2 = (i2 >>>= 0) - (r2 >>>= 0), a2 = (n2 >>>= 0) - (t2 >>>= 0), s2 = Math.min(o2, a2), u2 = this.slice(r2, i2), l2 = e2.slice(t2, n2), c2 = 0; c2 < s2; ++c2) + if (u2[c2] !== l2[c2]) { + o2 = u2[c2], a2 = l2[c2]; + break; + } + return o2 < a2 ? -1 : a2 < o2 ? 1 : 0; + }, _.prototype.includes = function(e2, t2, n2) { + return -1 !== this.indexOf(e2, t2, n2); + }, _.prototype.indexOf = function(e2, t2, n2) { + return P(this, e2, t2, n2, true); + }, _.prototype.lastIndexOf = function(e2, t2, n2) { + return P(this, e2, t2, n2, false); + }, _.prototype.write = function(e2, t2, n2, r2) { + if (void 0 === t2) + r2 = "utf8", n2 = this.length, t2 = 0; + else if (void 0 === n2 && "string" == typeof t2) + r2 = t2, n2 = this.length, t2 = 0; + else { + if (!isFinite(t2)) + throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); + t2 |= 0, isFinite(n2) ? (n2 |= 0, void 0 === r2 && (r2 = "utf8")) : (r2 = n2, n2 = void 0); + } + var i2 = this.length - t2; + if ((void 0 === n2 || n2 > i2) && (n2 = i2), e2.length > 0 && (n2 < 0 || t2 < 0) || t2 > this.length) + throw new RangeError("Attempt to write outside buffer bounds"); + r2 || (r2 = "utf8"); + for (var o2 = false; ; ) + switch (r2) { + case "hex": + return I(this, e2, t2, n2); + case "utf8": + case "utf-8": + return O(this, e2, t2, n2); + case "ascii": + return N(this, e2, t2, n2); + case "latin1": + case "binary": + return D(this, e2, t2, n2); + case "base64": + return j(this, e2, t2, n2); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return B(this, e2, t2, n2); + default: + if (o2) + throw new TypeError("Unknown encoding: " + r2); + r2 = ("" + r2).toLowerCase(), o2 = true; + } + }, _.prototype.toJSON = function() { + return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) }; + }; + var F = 4096; + function K(e2, t2, n2) { + var r2 = ""; + n2 = Math.min(e2.length, n2); + for (var i2 = t2; i2 < n2; ++i2) + r2 += String.fromCharCode(127 & e2[i2]); + return r2; + } + function q(e2, t2, n2) { + var r2 = ""; + n2 = Math.min(e2.length, n2); + for (var i2 = t2; i2 < n2; ++i2) + r2 += String.fromCharCode(e2[i2]); + return r2; + } + function H(e2, t2, n2) { + var r2 = e2.length; + (!t2 || t2 < 0) && (t2 = 0), (!n2 || n2 < 0 || n2 > r2) && (n2 = r2); + for (var i2 = "", o2 = t2; o2 < n2; ++o2) + i2 += ee(e2[o2]); + return i2; + } + function W(e2, t2, n2) { + for (var r2 = e2.slice(t2, n2), i2 = "", o2 = 0; o2 < r2.length; o2 += 2) + i2 += String.fromCharCode(r2[o2] + 256 * r2[o2 + 1]); + return i2; + } + function $(e2, t2, n2) { + if (e2 % 1 != 0 || e2 < 0) + throw new RangeError("offset is not uint"); + if (e2 + t2 > n2) + throw new RangeError("Trying to access beyond buffer length"); + } + function V(e2, t2, n2, r2, i2, o2) { + if (!x(e2)) + throw new TypeError('"buffer" argument must be a Buffer instance'); + if (t2 > i2 || t2 < o2) + throw new RangeError('"value" argument is out of bounds'); + if (n2 + r2 > e2.length) + throw new RangeError("Index out of range"); + } + function Y(e2, t2, n2, r2) { + t2 < 0 && (t2 = 65535 + t2 + 1); + for (var i2 = 0, o2 = Math.min(e2.length - n2, 2); i2 < o2; ++i2) + e2[n2 + i2] = (t2 & 255 << 8 * (r2 ? i2 : 1 - i2)) >>> 8 * (r2 ? i2 : 1 - i2); + } + function G(e2, t2, n2, r2) { + t2 < 0 && (t2 = 4294967295 + t2 + 1); + for (var i2 = 0, o2 = Math.min(e2.length - n2, 4); i2 < o2; ++i2) + e2[n2 + i2] = t2 >>> 8 * (r2 ? i2 : 3 - i2) & 255; + } + function Z(e2, t2, n2, r2, i2, o2) { + if (n2 + r2 > e2.length) + throw new RangeError("Index out of range"); + if (n2 < 0) + throw new RangeError("Index out of range"); + } + function Q(e2, t2, n2, r2, i2) { + return i2 || Z(e2, 0, n2, 4), m(e2, t2, n2, r2, 23, 4), n2 + 4; + } + function J(e2, t2, n2, r2, i2) { + return i2 || Z(e2, 0, n2, 8), m(e2, t2, n2, r2, 52, 8), n2 + 8; + } + _.prototype.slice = function(e2, t2) { + var n2, r2 = this.length; + if ((e2 = ~~e2) < 0 ? (e2 += r2) < 0 && (e2 = 0) : e2 > r2 && (e2 = r2), (t2 = void 0 === t2 ? r2 : ~~t2) < 0 ? (t2 += r2) < 0 && (t2 = 0) : t2 > r2 && (t2 = r2), t2 < e2 && (t2 = e2), _.TYPED_ARRAY_SUPPORT) + (n2 = this.subarray(e2, t2)).__proto__ = _.prototype; + else { + var i2 = t2 - e2; + n2 = new _(i2, void 0); + for (var o2 = 0; o2 < i2; ++o2) + n2[o2] = this[o2 + e2]; + } + return n2; + }, _.prototype.readUIntLE = function(e2, t2, n2) { + e2 |= 0, t2 |= 0, n2 || $(e2, t2, this.length); + for (var r2 = this[e2], i2 = 1, o2 = 0; ++o2 < t2 && (i2 *= 256); ) + r2 += this[e2 + o2] * i2; + return r2; + }, _.prototype.readUIntBE = function(e2, t2, n2) { + e2 |= 0, t2 |= 0, n2 || $(e2, t2, this.length); + for (var r2 = this[e2 + --t2], i2 = 1; t2 > 0 && (i2 *= 256); ) + r2 += this[e2 + --t2] * i2; + return r2; + }, _.prototype.readUInt8 = function(e2, t2) { + return t2 || $(e2, 1, this.length), this[e2]; + }, _.prototype.readUInt16LE = function(e2, t2) { + return t2 || $(e2, 2, this.length), this[e2] | this[e2 + 1] << 8; + }, _.prototype.readUInt16BE = function(e2, t2) { + return t2 || $(e2, 2, this.length), this[e2] << 8 | this[e2 + 1]; + }, _.prototype.readUInt32LE = function(e2, t2) { + return t2 || $(e2, 4, this.length), (this[e2] | this[e2 + 1] << 8 | this[e2 + 2] << 16) + 16777216 * this[e2 + 3]; + }, _.prototype.readUInt32BE = function(e2, t2) { + return t2 || $(e2, 4, this.length), 16777216 * this[e2] + (this[e2 + 1] << 16 | this[e2 + 2] << 8 | this[e2 + 3]); + }, _.prototype.readIntLE = function(e2, t2, n2) { + e2 |= 0, t2 |= 0, n2 || $(e2, t2, this.length); + for (var r2 = this[e2], i2 = 1, o2 = 0; ++o2 < t2 && (i2 *= 256); ) + r2 += this[e2 + o2] * i2; + return r2 >= (i2 *= 128) && (r2 -= Math.pow(2, 8 * t2)), r2; + }, _.prototype.readIntBE = function(e2, t2, n2) { + e2 |= 0, t2 |= 0, n2 || $(e2, t2, this.length); + for (var r2 = t2, i2 = 1, o2 = this[e2 + --r2]; r2 > 0 && (i2 *= 256); ) + o2 += this[e2 + --r2] * i2; + return o2 >= (i2 *= 128) && (o2 -= Math.pow(2, 8 * t2)), o2; + }, _.prototype.readInt8 = function(e2, t2) { + return t2 || $(e2, 1, this.length), 128 & this[e2] ? -1 * (255 - this[e2] + 1) : this[e2]; + }, _.prototype.readInt16LE = function(e2, t2) { + t2 || $(e2, 2, this.length); + var n2 = this[e2] | this[e2 + 1] << 8; + return 32768 & n2 ? 4294901760 | n2 : n2; + }, _.prototype.readInt16BE = function(e2, t2) { + t2 || $(e2, 2, this.length); + var n2 = this[e2 + 1] | this[e2] << 8; + return 32768 & n2 ? 4294901760 | n2 : n2; + }, _.prototype.readInt32LE = function(e2, t2) { + return t2 || $(e2, 4, this.length), this[e2] | this[e2 + 1] << 8 | this[e2 + 2] << 16 | this[e2 + 3] << 24; + }, _.prototype.readInt32BE = function(e2, t2) { + return t2 || $(e2, 4, this.length), this[e2] << 24 | this[e2 + 1] << 16 | this[e2 + 2] << 8 | this[e2 + 3]; + }, _.prototype.readFloatLE = function(e2, t2) { + return t2 || $(e2, 4, this.length), p(this, e2, true, 23, 4); + }, _.prototype.readFloatBE = function(e2, t2) { + return t2 || $(e2, 4, this.length), p(this, e2, false, 23, 4); + }, _.prototype.readDoubleLE = function(e2, t2) { + return t2 || $(e2, 8, this.length), p(this, e2, true, 52, 8); + }, _.prototype.readDoubleBE = function(e2, t2) { + return t2 || $(e2, 8, this.length), p(this, e2, false, 52, 8); + }, _.prototype.writeUIntLE = function(e2, t2, n2, r2) { + (e2 = +e2, t2 |= 0, n2 |= 0, r2) || V(this, e2, t2, n2, Math.pow(2, 8 * n2) - 1, 0); + var i2 = 1, o2 = 0; + for (this[t2] = 255 & e2; ++o2 < n2 && (i2 *= 256); ) + this[t2 + o2] = e2 / i2 & 255; + return t2 + n2; + }, _.prototype.writeUIntBE = function(e2, t2, n2, r2) { + (e2 = +e2, t2 |= 0, n2 |= 0, r2) || V(this, e2, t2, n2, Math.pow(2, 8 * n2) - 1, 0); + var i2 = n2 - 1, o2 = 1; + for (this[t2 + i2] = 255 & e2; --i2 >= 0 && (o2 *= 256); ) + this[t2 + i2] = e2 / o2 & 255; + return t2 + n2; + }, _.prototype.writeUInt8 = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || V(this, e2, t2, 1, 255, 0), _.TYPED_ARRAY_SUPPORT || (e2 = Math.floor(e2)), this[t2] = 255 & e2, t2 + 1; + }, _.prototype.writeUInt16LE = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || V(this, e2, t2, 2, 65535, 0), _.TYPED_ARRAY_SUPPORT ? (this[t2] = 255 & e2, this[t2 + 1] = e2 >>> 8) : Y(this, e2, t2, true), t2 + 2; + }, _.prototype.writeUInt16BE = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || V(this, e2, t2, 2, 65535, 0), _.TYPED_ARRAY_SUPPORT ? (this[t2] = e2 >>> 8, this[t2 + 1] = 255 & e2) : Y(this, e2, t2, false), t2 + 2; + }, _.prototype.writeUInt32LE = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || V(this, e2, t2, 4, 4294967295, 0), _.TYPED_ARRAY_SUPPORT ? (this[t2 + 3] = e2 >>> 24, this[t2 + 2] = e2 >>> 16, this[t2 + 1] = e2 >>> 8, this[t2] = 255 & e2) : G(this, e2, t2, true), t2 + 4; + }, _.prototype.writeUInt32BE = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || V(this, e2, t2, 4, 4294967295, 0), _.TYPED_ARRAY_SUPPORT ? (this[t2] = e2 >>> 24, this[t2 + 1] = e2 >>> 16, this[t2 + 2] = e2 >>> 8, this[t2 + 3] = 255 & e2) : G(this, e2, t2, false), t2 + 4; + }, _.prototype.writeIntLE = function(e2, t2, n2, r2) { + if (e2 = +e2, t2 |= 0, !r2) { + var i2 = Math.pow(2, 8 * n2 - 1); + V(this, e2, t2, n2, i2 - 1, -i2); + } + var o2 = 0, a2 = 1, s2 = 0; + for (this[t2] = 255 & e2; ++o2 < n2 && (a2 *= 256); ) + e2 < 0 && 0 === s2 && 0 !== this[t2 + o2 - 1] && (s2 = 1), this[t2 + o2] = (e2 / a2 >> 0) - s2 & 255; + return t2 + n2; + }, _.prototype.writeIntBE = function(e2, t2, n2, r2) { + if (e2 = +e2, t2 |= 0, !r2) { + var i2 = Math.pow(2, 8 * n2 - 1); + V(this, e2, t2, n2, i2 - 1, -i2); + } + var o2 = n2 - 1, a2 = 1, s2 = 0; + for (this[t2 + o2] = 255 & e2; --o2 >= 0 && (a2 *= 256); ) + e2 < 0 && 0 === s2 && 0 !== this[t2 + o2 + 1] && (s2 = 1), this[t2 + o2] = (e2 / a2 >> 0) - s2 & 255; + return t2 + n2; + }, _.prototype.writeInt8 = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || V(this, e2, t2, 1, 127, -128), _.TYPED_ARRAY_SUPPORT || (e2 = Math.floor(e2)), e2 < 0 && (e2 = 255 + e2 + 1), this[t2] = 255 & e2, t2 + 1; + }, _.prototype.writeInt16LE = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || V(this, e2, t2, 2, 32767, -32768), _.TYPED_ARRAY_SUPPORT ? (this[t2] = 255 & e2, this[t2 + 1] = e2 >>> 8) : Y(this, e2, t2, true), t2 + 2; + }, _.prototype.writeInt16BE = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || V(this, e2, t2, 2, 32767, -32768), _.TYPED_ARRAY_SUPPORT ? (this[t2] = e2 >>> 8, this[t2 + 1] = 255 & e2) : Y(this, e2, t2, false), t2 + 2; + }, _.prototype.writeInt32LE = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || V(this, e2, t2, 4, 2147483647, -2147483648), _.TYPED_ARRAY_SUPPORT ? (this[t2] = 255 & e2, this[t2 + 1] = e2 >>> 8, this[t2 + 2] = e2 >>> 16, this[t2 + 3] = e2 >>> 24) : G(this, e2, t2, true), t2 + 4; + }, _.prototype.writeInt32BE = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || V(this, e2, t2, 4, 2147483647, -2147483648), e2 < 0 && (e2 = 4294967295 + e2 + 1), _.TYPED_ARRAY_SUPPORT ? (this[t2] = e2 >>> 24, this[t2 + 1] = e2 >>> 16, this[t2 + 2] = e2 >>> 8, this[t2 + 3] = 255 & e2) : G(this, e2, t2, false), t2 + 4; + }, _.prototype.writeFloatLE = function(e2, t2, n2) { + return Q(this, e2, t2, true, n2); + }, _.prototype.writeFloatBE = function(e2, t2, n2) { + return Q(this, e2, t2, false, n2); + }, _.prototype.writeDoubleLE = function(e2, t2, n2) { + return J(this, e2, t2, true, n2); + }, _.prototype.writeDoubleBE = function(e2, t2, n2) { + return J(this, e2, t2, false, n2); + }, _.prototype.copy = function(e2, t2, n2, r2) { + if (n2 || (n2 = 0), r2 || 0 === r2 || (r2 = this.length), t2 >= e2.length && (t2 = e2.length), t2 || (t2 = 0), r2 > 0 && r2 < n2 && (r2 = n2), r2 === n2) + return 0; + if (0 === e2.length || 0 === this.length) + return 0; + if (t2 < 0) + throw new RangeError("targetStart out of bounds"); + if (n2 < 0 || n2 >= this.length) + throw new RangeError("sourceStart out of bounds"); + if (r2 < 0) + throw new RangeError("sourceEnd out of bounds"); + r2 > this.length && (r2 = this.length), e2.length - t2 < r2 - n2 && (r2 = e2.length - t2 + n2); + var i2, o2 = r2 - n2; + if (this === e2 && n2 < t2 && t2 < r2) + for (i2 = o2 - 1; i2 >= 0; --i2) + e2[i2 + t2] = this[i2 + n2]; + else if (o2 < 1e3 || !_.TYPED_ARRAY_SUPPORT) + for (i2 = 0; i2 < o2; ++i2) + e2[i2 + t2] = this[i2 + n2]; + else + Uint8Array.prototype.set.call(e2, this.subarray(n2, n2 + o2), t2); + return o2; + }, _.prototype.fill = function(e2, t2, n2, r2) { + if ("string" == typeof e2) { + if ("string" == typeof t2 ? (r2 = t2, t2 = 0, n2 = this.length) : "string" == typeof n2 && (r2 = n2, n2 = this.length), 1 === e2.length) { + var i2 = e2.charCodeAt(0); + i2 < 256 && (e2 = i2); + } + if (void 0 !== r2 && "string" != typeof r2) + throw new TypeError("encoding must be a string"); + if ("string" == typeof r2 && !_.isEncoding(r2)) + throw new TypeError("Unknown encoding: " + r2); + } else + "number" == typeof e2 && (e2 &= 255); + if (t2 < 0 || this.length < t2 || this.length < n2) + throw new RangeError("Out of range index"); + if (n2 <= t2) + return this; + var o2; + if (t2 >>>= 0, n2 = void 0 === n2 ? this.length : n2 >>> 0, e2 || (e2 = 0), "number" == typeof e2) + for (o2 = t2; o2 < n2; ++o2) + this[o2] = e2; + else { + var a2 = x(e2) ? e2 : te(new _(e2, r2).toString()), s2 = a2.length; + for (o2 = 0; o2 < n2 - t2; ++o2) + this[o2 + t2] = a2[o2 % s2]; + } + return this; + }; + var X = /[^+\/0-9A-Za-z-_]/g; + function ee(e2) { + return e2 < 16 ? "0" + e2.toString(16) : e2.toString(16); + } + function te(e2, t2) { + var n2; + t2 = t2 || 1 / 0; + for (var r2 = e2.length, i2 = null, o2 = [], a2 = 0; a2 < r2; ++a2) { + if ((n2 = e2.charCodeAt(a2)) > 55295 && n2 < 57344) { + if (!i2) { + if (n2 > 56319) { + (t2 -= 3) > -1 && o2.push(239, 191, 189); + continue; + } + if (a2 + 1 === r2) { + (t2 -= 3) > -1 && o2.push(239, 191, 189); + continue; + } + i2 = n2; + continue; + } + if (n2 < 56320) { + (t2 -= 3) > -1 && o2.push(239, 191, 189), i2 = n2; + continue; + } + n2 = 65536 + (i2 - 55296 << 10 | n2 - 56320); + } else + i2 && (t2 -= 3) > -1 && o2.push(239, 191, 189); + if (i2 = null, n2 < 128) { + if ((t2 -= 1) < 0) + break; + o2.push(n2); + } else if (n2 < 2048) { + if ((t2 -= 2) < 0) + break; + o2.push(n2 >> 6 | 192, 63 & n2 | 128); + } else if (n2 < 65536) { + if ((t2 -= 3) < 0) + break; + o2.push(n2 >> 12 | 224, n2 >> 6 & 63 | 128, 63 & n2 | 128); + } else { + if (!(n2 < 1114112)) + throw new Error("Invalid code point"); + if ((t2 -= 4) < 0) + break; + o2.push(n2 >> 18 | 240, n2 >> 12 & 63 | 128, n2 >> 6 & 63 | 128, 63 & n2 | 128); + } + } + return o2; + } + function ne(e2) { + return function(e3) { + var t2, n2, r2, i2, o2, a2; + c || d(); + var s2 = e3.length; + if (s2 % 4 > 0) + throw new Error("Invalid string. Length must be a multiple of 4"); + o2 = "=" === e3[s2 - 2] ? 2 : "=" === e3[s2 - 1] ? 1 : 0, a2 = new l(3 * s2 / 4 - o2), r2 = o2 > 0 ? s2 - 4 : s2; + var f2 = 0; + for (t2 = 0, n2 = 0; t2 < r2; t2 += 4, n2 += 3) + i2 = u[e3.charCodeAt(t2)] << 18 | u[e3.charCodeAt(t2 + 1)] << 12 | u[e3.charCodeAt(t2 + 2)] << 6 | u[e3.charCodeAt(t2 + 3)], a2[f2++] = i2 >> 16 & 255, a2[f2++] = i2 >> 8 & 255, a2[f2++] = 255 & i2; + return 2 === o2 ? (i2 = u[e3.charCodeAt(t2)] << 2 | u[e3.charCodeAt(t2 + 1)] >> 4, a2[f2++] = 255 & i2) : 1 === o2 && (i2 = u[e3.charCodeAt(t2)] << 10 | u[e3.charCodeAt(t2 + 1)] << 4 | u[e3.charCodeAt(t2 + 2)] >> 2, a2[f2++] = i2 >> 8 & 255, a2[f2++] = 255 & i2), a2; + }(function(e3) { + if ((e3 = function(e4) { + return e4.trim ? e4.trim() : e4.replace(/^\s+|\s+$/g, ""); + }(e3).replace(X, "")).length < 2) + return ""; + for (; e3.length % 4 != 0; ) + e3 += "="; + return e3; + }(e2)); + } + function re(e2, t2, n2, r2) { + for (var i2 = 0; i2 < r2 && !(i2 + n2 >= t2.length || i2 >= e2.length); ++i2) + t2[i2 + n2] = e2[i2]; + return i2; + } + function ie(e2) { + return null != e2 && (!!e2._isBuffer || oe(e2) || function(e3) { + return "function" == typeof e3.readFloatLE && "function" == typeof e3.slice && oe(e3.slice(0, 0)); + }(e2)); + } + function oe(e2) { + return !!e2.constructor && "function" == typeof e2.constructor.isBuffer && e2.constructor.isBuffer(e2); + } + var ae = Object.freeze({ __proto__: null, Buffer: _, INSPECT_MAX_BYTES: 50, SlowBuffer: function(e2) { + return +e2 != e2 && (e2 = 0), _.alloc(+e2); + }, isBuffer: ie, kMaxLength: b }), se = {}, ue = {}, le = {}, ce = i(ae), de = {}; + function fe() { + throw new Error("setTimeout has not been defined"); + } + function he() { + throw new Error("clearTimeout has not been defined"); + } + var pe = fe, me = he; + function ge(e2) { + if (pe === setTimeout) + return setTimeout(e2, 0); + if ((pe === fe || !pe) && setTimeout) + return pe = setTimeout, setTimeout(e2, 0); + try { + return pe(e2, 0); + } catch (t2) { + try { + return pe.call(null, e2, 0); + } catch (t3) { + return pe.call(this, e2, 0); + } + } + } + "function" == typeof t.setTimeout && (pe = setTimeout), "function" == typeof t.clearTimeout && (me = clearTimeout); + var ve, be = [], ye = false, we = -1; + function _e() { + ye && ve && (ye = false, ve.length ? be = ve.concat(be) : we = -1, be.length && Se()); + } + function Se() { + if (!ye) { + var e2 = ge(_e); + ye = true; + for (var t2 = be.length; t2; ) { + for (ve = be, be = []; ++we < t2; ) + ve && ve[we].run(); + we = -1, t2 = be.length; + } + ve = null, ye = false, function(e3) { + if (me === clearTimeout) + return clearTimeout(e3); + if ((me === he || !me) && clearTimeout) + return me = clearTimeout, clearTimeout(e3); + try { + return me(e3); + } catch (t3) { + try { + return me.call(null, e3); + } catch (t4) { + return me.call(this, e3); + } + } + }(e2); + } + } + function Ee(e2) { + var t2 = new Array(arguments.length - 1); + if (arguments.length > 1) + for (var n2 = 1; n2 < arguments.length; n2++) + t2[n2 - 1] = arguments[n2]; + be.push(new ke(e2, t2)), 1 !== be.length || ye || ge(Se); + } + function ke(e2, t2) { + this.fun = e2, this.array = t2; + } + ke.prototype.run = function() { + this.fun.apply(null, this.array); + }; + function Me() { + } + var Ce = Me, xe = Me, Ae = Me, Re = Me, Te = Me, Pe = Me, Le = Me; + var Ie = t.performance || {}, Oe = Ie.now || Ie.mozNow || Ie.msNow || Ie.oNow || Ie.webkitNow || function() { + return (/* @__PURE__ */ new Date()).getTime(); + }; + var Ne = /* @__PURE__ */ new Date(); + var De, je = { nextTick: Ee, title: "browser", browser: true, env: {}, argv: [], version: "", versions: {}, on: Ce, addListener: xe, once: Ae, off: Re, removeListener: Te, removeAllListeners: Pe, emit: Le, binding: function(e2) { + throw new Error("process.binding is not supported"); + }, cwd: function() { + return "/"; + }, chdir: function(e2) { + throw new Error("process.chdir is not supported"); + }, umask: function() { + return 0; + }, hrtime: function(e2) { + var t2 = 1e-3 * Oe.call(Ie), n2 = Math.floor(t2), r2 = Math.floor(t2 % 1 * 1e9); + return e2 && (n2 -= e2[0], (r2 -= e2[1]) < 0 && (n2--, r2 += 1e9)), [n2, r2]; + }, platform: "browser", release: {}, config: {}, uptime: function() { + return (/* @__PURE__ */ new Date() - Ne) / 1e3; + } }, Be = { exports: {} }, ze = { exports: {} }; + function Ue() { + return De || (De = 1, function(e2, t2) { + var n2 = ce, r2 = n2.Buffer; + function i2(e3, t3) { + for (var n3 in e3) + t3[n3] = e3[n3]; + } + function o2(e3, t3, n3) { + return r2(e3, t3, n3); + } + r2.from && r2.alloc && r2.allocUnsafe && r2.allocUnsafeSlow ? e2.exports = n2 : (i2(n2, t2), t2.Buffer = o2), o2.prototype = Object.create(r2.prototype), i2(r2, o2), o2.from = function(e3, t3, n3) { + if ("number" == typeof e3) + throw new TypeError("Argument must not be a number"); + return r2(e3, t3, n3); + }, o2.alloc = function(e3, t3, n3) { + if ("number" != typeof e3) + throw new TypeError("Argument must be a number"); + var i3 = r2(e3); + return void 0 !== t3 ? "string" == typeof n3 ? i3.fill(t3, n3) : i3.fill(t3) : i3.fill(0), i3; + }, o2.allocUnsafe = function(e3) { + if ("number" != typeof e3) + throw new TypeError("Argument must be a number"); + return r2(e3); + }, o2.allocUnsafeSlow = function(e3) { + if ("number" != typeof e3) + throw new TypeError("Argument must be a number"); + return n2.SlowBuffer(e3); + }; + }(ze, ze.exports)), ze.exports; + } + var Fe = 65536, Ke = 4294967295; + var qe = Ue().Buffer, He = n.crypto || n.msCrypto; + He && He.getRandomValues ? Be.exports = function(e2, t2) { + if (e2 > Ke) + throw new RangeError("requested too many random bytes"); + var n2 = qe.allocUnsafe(e2); + if (e2 > 0) + if (e2 > Fe) + for (var r2 = 0; r2 < e2; r2 += Fe) + He.getRandomValues(n2.slice(r2, r2 + Fe)); + else + He.getRandomValues(n2); + if ("function" == typeof t2) + return Ee(function() { + t2(null, n2); + }); + return n2; + } : Be.exports = function() { + throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11"); + }; + var We = Be.exports, $e = { exports: {} }; + "function" == typeof Object.create ? $e.exports = function(e2, t2) { + t2 && (e2.super_ = t2, e2.prototype = Object.create(t2.prototype, { constructor: { value: e2, enumerable: false, writable: true, configurable: true } })); + } : $e.exports = function(e2, t2) { + if (t2) { + e2.super_ = t2; + var n2 = function() { + }; + n2.prototype = t2.prototype, e2.prototype = new n2(), e2.prototype.constructor = e2; + } + }; + var Ve = $e.exports, Ye = { exports: {} }; + function Ge() { + } + function Ze() { + Ze.init.call(this); + } + function Qe(e2) { + return void 0 === e2._maxListeners ? Ze.defaultMaxListeners : e2._maxListeners; + } + function Je(e2, t2, n2, r2) { + var i2, o2, a2; + if ("function" != typeof n2) + throw new TypeError('"listener" argument must be a function'); + if ((o2 = e2._events) ? (o2.newListener && (e2.emit("newListener", t2, n2.listener ? n2.listener : n2), o2 = e2._events), a2 = o2[t2]) : (o2 = e2._events = new Ge(), e2._eventsCount = 0), a2) { + if ("function" == typeof a2 ? a2 = o2[t2] = r2 ? [n2, a2] : [a2, n2] : r2 ? a2.unshift(n2) : a2.push(n2), !a2.warned && (i2 = Qe(e2)) && i2 > 0 && a2.length > i2) { + a2.warned = true; + var s2 = new Error("Possible EventEmitter memory leak detected. " + a2.length + " " + t2 + " listeners added. Use emitter.setMaxListeners() to increase limit"); + s2.name = "MaxListenersExceededWarning", s2.emitter = e2, s2.type = t2, s2.count = a2.length, function(e3) { + "function" == typeof console.warn ? console.warn(e3) : console.log(e3); + }(s2); + } + } else + a2 = o2[t2] = n2, ++e2._eventsCount; + return e2; + } + function Xe(e2, t2, n2) { + var r2 = false; + function i2() { + e2.removeListener(t2, i2), r2 || (r2 = true, n2.apply(e2, arguments)); + } + return i2.listener = n2, i2; + } + function et(e2) { + var t2 = this._events; + if (t2) { + var n2 = t2[e2]; + if ("function" == typeof n2) + return 1; + if (n2) + return n2.length; + } + return 0; + } + function tt(e2, t2) { + for (var n2 = new Array(t2); t2--; ) + n2[t2] = e2[t2]; + return n2; + } + Ge.prototype = /* @__PURE__ */ Object.create(null), Ze.EventEmitter = Ze, Ze.usingDomains = false, Ze.prototype.domain = void 0, Ze.prototype._events = void 0, Ze.prototype._maxListeners = void 0, Ze.defaultMaxListeners = 10, Ze.init = function() { + this.domain = null, Ze.usingDomains && (void 0).active, this._events && this._events !== Object.getPrototypeOf(this)._events || (this._events = new Ge(), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0; + }, Ze.prototype.setMaxListeners = function(e2) { + if ("number" != typeof e2 || e2 < 0 || isNaN(e2)) + throw new TypeError('"n" argument must be a positive number'); + return this._maxListeners = e2, this; + }, Ze.prototype.getMaxListeners = function() { + return Qe(this); + }, Ze.prototype.emit = function(e2) { + var t2, n2, r2, i2, o2, a2, s2, u2 = "error" === e2; + if (a2 = this._events) + u2 = u2 && null == a2.error; + else if (!u2) + return false; + if (s2 = this.domain, u2) { + if (t2 = arguments[1], !s2) { + if (t2 instanceof Error) + throw t2; + var l2 = new Error('Uncaught, unspecified "error" event. (' + t2 + ")"); + throw l2.context = t2, l2; + } + return t2 || (t2 = new Error('Uncaught, unspecified "error" event')), t2.domainEmitter = this, t2.domain = s2, t2.domainThrown = false, s2.emit("error", t2), false; + } + if (!(n2 = a2[e2])) + return false; + var c2 = "function" == typeof n2; + switch (r2 = arguments.length) { + case 1: + !function(e3, t3, n3) { + if (t3) + e3.call(n3); + else + for (var r3 = e3.length, i3 = tt(e3, r3), o3 = 0; o3 < r3; ++o3) + i3[o3].call(n3); + }(n2, c2, this); + break; + case 2: + !function(e3, t3, n3, r3) { + if (t3) + e3.call(n3, r3); + else + for (var i3 = e3.length, o3 = tt(e3, i3), a3 = 0; a3 < i3; ++a3) + o3[a3].call(n3, r3); + }(n2, c2, this, arguments[1]); + break; + case 3: + !function(e3, t3, n3, r3, i3) { + if (t3) + e3.call(n3, r3, i3); + else + for (var o3 = e3.length, a3 = tt(e3, o3), s3 = 0; s3 < o3; ++s3) + a3[s3].call(n3, r3, i3); + }(n2, c2, this, arguments[1], arguments[2]); + break; + case 4: + !function(e3, t3, n3, r3, i3, o3) { + if (t3) + e3.call(n3, r3, i3, o3); + else + for (var a3 = e3.length, s3 = tt(e3, a3), u3 = 0; u3 < a3; ++u3) + s3[u3].call(n3, r3, i3, o3); + }(n2, c2, this, arguments[1], arguments[2], arguments[3]); + break; + default: + for (i2 = new Array(r2 - 1), o2 = 1; o2 < r2; o2++) + i2[o2 - 1] = arguments[o2]; + !function(e3, t3, n3, r3) { + if (t3) + e3.apply(n3, r3); + else + for (var i3 = e3.length, o3 = tt(e3, i3), a3 = 0; a3 < i3; ++a3) + o3[a3].apply(n3, r3); + }(n2, c2, this, i2); + } + return true; + }, Ze.prototype.addListener = function(e2, t2) { + return Je(this, e2, t2, false); + }, Ze.prototype.on = Ze.prototype.addListener, Ze.prototype.prependListener = function(e2, t2) { + return Je(this, e2, t2, true); + }, Ze.prototype.once = function(e2, t2) { + if ("function" != typeof t2) + throw new TypeError('"listener" argument must be a function'); + return this.on(e2, Xe(this, e2, t2)), this; + }, Ze.prototype.prependOnceListener = function(e2, t2) { + if ("function" != typeof t2) + throw new TypeError('"listener" argument must be a function'); + return this.prependListener(e2, Xe(this, e2, t2)), this; + }, Ze.prototype.removeListener = function(e2, t2) { + var n2, r2, i2, o2, a2; + if ("function" != typeof t2) + throw new TypeError('"listener" argument must be a function'); + if (!(r2 = this._events)) + return this; + if (!(n2 = r2[e2])) + return this; + if (n2 === t2 || n2.listener && n2.listener === t2) + 0 == --this._eventsCount ? this._events = new Ge() : (delete r2[e2], r2.removeListener && this.emit("removeListener", e2, n2.listener || t2)); + else if ("function" != typeof n2) { + for (i2 = -1, o2 = n2.length; o2-- > 0; ) + if (n2[o2] === t2 || n2[o2].listener && n2[o2].listener === t2) { + a2 = n2[o2].listener, i2 = o2; + break; + } + if (i2 < 0) + return this; + if (1 === n2.length) { + if (n2[0] = void 0, 0 == --this._eventsCount) + return this._events = new Ge(), this; + delete r2[e2]; + } else + !function(e3, t3) { + for (var n3 = t3, r3 = n3 + 1, i3 = e3.length; r3 < i3; n3 += 1, r3 += 1) + e3[n3] = e3[r3]; + e3.pop(); + }(n2, i2); + r2.removeListener && this.emit("removeListener", e2, a2 || t2); + } + return this; + }, Ze.prototype.removeAllListeners = function(e2) { + var t2, n2; + if (!(n2 = this._events)) + return this; + if (!n2.removeListener) + return 0 === arguments.length ? (this._events = new Ge(), this._eventsCount = 0) : n2[e2] && (0 == --this._eventsCount ? this._events = new Ge() : delete n2[e2]), this; + if (0 === arguments.length) { + for (var r2, i2 = Object.keys(n2), o2 = 0; o2 < i2.length; ++o2) + "removeListener" !== (r2 = i2[o2]) && this.removeAllListeners(r2); + return this.removeAllListeners("removeListener"), this._events = new Ge(), this._eventsCount = 0, this; + } + if ("function" == typeof (t2 = n2[e2])) + this.removeListener(e2, t2); + else if (t2) + do { + this.removeListener(e2, t2[t2.length - 1]); + } while (t2[0]); + return this; + }, Ze.prototype.listeners = function(e2) { + var t2, n2, r2 = this._events; + return n2 = r2 && (t2 = r2[e2]) ? "function" == typeof t2 ? [t2.listener || t2] : function(e3) { + for (var t3 = new Array(e3.length), n3 = 0; n3 < t3.length; ++n3) + t3[n3] = e3[n3].listener || e3[n3]; + return t3; + }(t2) : [], n2; + }, Ze.listenerCount = function(e2, t2) { + return "function" == typeof e2.listenerCount ? e2.listenerCount(t2) : et.call(e2, t2); + }, Ze.prototype.listenerCount = et, Ze.prototype.eventNames = function() { + return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : []; + }; + var nt = i(Object.freeze({ __proto__: null, EventEmitter: Ze, default: Ze })), rt = nt.EventEmitter, it = "function" == typeof Object.create ? function(e2, t2) { + e2.super_ = t2, e2.prototype = Object.create(t2.prototype, { constructor: { value: e2, enumerable: false, writable: true, configurable: true } }); + } : function(e2, t2) { + e2.super_ = t2; + var n2 = function() { + }; + n2.prototype = t2.prototype, e2.prototype = new n2(), e2.prototype.constructor = e2; + }, ot = /%[sdj%]/g; + function at(e2) { + if (!St(e2)) { + for (var t2 = [], n2 = 0; n2 < arguments.length; n2++) + t2.push(dt(arguments[n2])); + return t2.join(" "); + } + n2 = 1; + for (var r2 = arguments, i2 = r2.length, o2 = String(e2).replace(ot, function(e3) { + if ("%%" === e3) + return "%"; + if (n2 >= i2) + return e3; + switch (e3) { + case "%s": + return String(r2[n2++]); + case "%d": + return Number(r2[n2++]); + case "%j": + try { + return JSON.stringify(r2[n2++]); + } catch (e4) { + return "[Circular]"; + } + default: + return e3; + } + }), a2 = r2[n2]; n2 < i2; a2 = r2[++n2]) + yt(a2) || !Ct(a2) ? o2 += " " + a2 : o2 += " " + dt(a2); + return o2; + } + function st(e2, n2) { + if (kt(t.process)) + return function() { + return st(e2, n2).apply(this, arguments); + }; + if (true === je.noDeprecation) + return e2; + var r2 = false; + return function() { + if (!r2) { + if (je.throwDeprecation) + throw new Error(n2); + je.traceDeprecation ? console.trace(n2) : console.error(n2), r2 = true; + } + return e2.apply(this, arguments); + }; + } + var ut, lt = {}; + function ct(e2) { + if (kt(ut) && (ut = je.env.NODE_DEBUG || ""), e2 = e2.toUpperCase(), !lt[e2]) + if (new RegExp("\\b" + e2 + "\\b", "i").test(ut)) { + lt[e2] = function() { + var t2 = at.apply(null, arguments); + console.error("%s %d: %s", e2, 0, t2); + }; + } else + lt[e2] = function() { + }; + return lt[e2]; + } + function dt(e2, t2) { + var n2 = { seen: [], stylize: ht }; + return arguments.length >= 3 && (n2.depth = arguments[2]), arguments.length >= 4 && (n2.colors = arguments[3]), bt(t2) ? n2.showHidden = t2 : t2 && Dt(n2, t2), kt(n2.showHidden) && (n2.showHidden = false), kt(n2.depth) && (n2.depth = 2), kt(n2.colors) && (n2.colors = false), kt(n2.customInspect) && (n2.customInspect = true), n2.colors && (n2.stylize = ft), pt(n2, e2, n2.depth); + } + function ft(e2, t2) { + var n2 = dt.styles[t2]; + return n2 ? "\x1B[" + dt.colors[n2][0] + "m" + e2 + "\x1B[" + dt.colors[n2][1] + "m" : e2; + } + function ht(e2, t2) { + return e2; + } + function pt(e2, t2, n2) { + if (e2.customInspect && t2 && Rt(t2.inspect) && t2.inspect !== dt && (!t2.constructor || t2.constructor.prototype !== t2)) { + var r2 = t2.inspect(n2, e2); + return St(r2) || (r2 = pt(e2, r2, n2)), r2; + } + var i2 = function(e3, t3) { + if (kt(t3)) + return e3.stylize("undefined", "undefined"); + if (St(t3)) { + var n3 = "'" + JSON.stringify(t3).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'"; + return e3.stylize(n3, "string"); + } + if (_t(t3)) + return e3.stylize("" + t3, "number"); + if (bt(t3)) + return e3.stylize("" + t3, "boolean"); + if (yt(t3)) + return e3.stylize("null", "null"); + }(e2, t2); + if (i2) + return i2; + var o2 = Object.keys(t2), a2 = function(e3) { + var t3 = {}; + return e3.forEach(function(e4, n3) { + t3[e4] = true; + }), t3; + }(o2); + if (e2.showHidden && (o2 = Object.getOwnPropertyNames(t2)), At(t2) && (o2.indexOf("message") >= 0 || o2.indexOf("description") >= 0)) + return mt(t2); + if (0 === o2.length) { + if (Rt(t2)) { + var s2 = t2.name ? ": " + t2.name : ""; + return e2.stylize("[Function" + s2 + "]", "special"); + } + if (Mt(t2)) + return e2.stylize(RegExp.prototype.toString.call(t2), "regexp"); + if (xt(t2)) + return e2.stylize(Date.prototype.toString.call(t2), "date"); + if (At(t2)) + return mt(t2); + } + var u2, l2 = "", c2 = false, d2 = ["{", "}"]; + (vt(t2) && (c2 = true, d2 = ["[", "]"]), Rt(t2)) && (l2 = " [Function" + (t2.name ? ": " + t2.name : "") + "]"); + return Mt(t2) && (l2 = " " + RegExp.prototype.toString.call(t2)), xt(t2) && (l2 = " " + Date.prototype.toUTCString.call(t2)), At(t2) && (l2 = " " + mt(t2)), 0 !== o2.length || c2 && 0 != t2.length ? n2 < 0 ? Mt(t2) ? e2.stylize(RegExp.prototype.toString.call(t2), "regexp") : e2.stylize("[Object]", "special") : (e2.seen.push(t2), u2 = c2 ? function(e3, t3, n3, r3, i3) { + for (var o3 = [], a3 = 0, s3 = t3.length; a3 < s3; ++a3) + jt(t3, String(a3)) ? o3.push(gt(e3, t3, n3, r3, String(a3), true)) : o3.push(""); + return i3.forEach(function(i4) { + i4.match(/^\d+$/) || o3.push(gt(e3, t3, n3, r3, i4, true)); + }), o3; + }(e2, t2, n2, a2, o2) : o2.map(function(r3) { + return gt(e2, t2, n2, a2, r3, c2); + }), e2.seen.pop(), function(e3, t3, n3) { + var r3 = e3.reduce(function(e4, t4) { + return t4.indexOf("\n"), e4 + t4.replace(/\u001b\[\d\d?m/g, "").length + 1; + }, 0); + if (r3 > 60) + return n3[0] + ("" === t3 ? "" : t3 + "\n ") + " " + e3.join(",\n ") + " " + n3[1]; + return n3[0] + t3 + " " + e3.join(", ") + " " + n3[1]; + }(u2, l2, d2)) : d2[0] + l2 + d2[1]; + } + function mt(e2) { + return "[" + Error.prototype.toString.call(e2) + "]"; + } + function gt(e2, t2, n2, r2, i2, o2) { + var a2, s2, u2; + if ((u2 = Object.getOwnPropertyDescriptor(t2, i2) || { value: t2[i2] }).get ? s2 = u2.set ? e2.stylize("[Getter/Setter]", "special") : e2.stylize("[Getter]", "special") : u2.set && (s2 = e2.stylize("[Setter]", "special")), jt(r2, i2) || (a2 = "[" + i2 + "]"), s2 || (e2.seen.indexOf(u2.value) < 0 ? (s2 = yt(n2) ? pt(e2, u2.value, null) : pt(e2, u2.value, n2 - 1)).indexOf("\n") > -1 && (s2 = o2 ? s2.split("\n").map(function(e3) { + return " " + e3; + }).join("\n").substr(2) : "\n" + s2.split("\n").map(function(e3) { + return " " + e3; + }).join("\n")) : s2 = e2.stylize("[Circular]", "special")), kt(a2)) { + if (o2 && i2.match(/^\d+$/)) + return s2; + (a2 = JSON.stringify("" + i2)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (a2 = a2.substr(1, a2.length - 2), a2 = e2.stylize(a2, "name")) : (a2 = a2.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), a2 = e2.stylize(a2, "string")); + } + return a2 + ": " + s2; + } + function vt(e2) { + return Array.isArray(e2); + } + function bt(e2) { + return "boolean" == typeof e2; + } + function yt(e2) { + return null === e2; + } + function wt(e2) { + return null == e2; + } + function _t(e2) { + return "number" == typeof e2; + } + function St(e2) { + return "string" == typeof e2; + } + function Et(e2) { + return "symbol" == typeof e2; + } + function kt(e2) { + return void 0 === e2; + } + function Mt(e2) { + return Ct(e2) && "[object RegExp]" === Lt(e2); + } + function Ct(e2) { + return "object" == typeof e2 && null !== e2; + } + function xt(e2) { + return Ct(e2) && "[object Date]" === Lt(e2); + } + function At(e2) { + return Ct(e2) && ("[object Error]" === Lt(e2) || e2 instanceof Error); + } + function Rt(e2) { + return "function" == typeof e2; + } + function Tt(e2) { + return null === e2 || "boolean" == typeof e2 || "number" == typeof e2 || "string" == typeof e2 || "symbol" == typeof e2 || void 0 === e2; + } + function Pt(e2) { + return ie(e2); + } + function Lt(e2) { + return Object.prototype.toString.call(e2); + } + function It(e2) { + return e2 < 10 ? "0" + e2.toString(10) : e2.toString(10); + } + dt.colors = { bold: [1, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], white: [37, 39], grey: [90, 39], black: [30, 39], blue: [34, 39], cyan: [36, 39], green: [32, 39], magenta: [35, 39], red: [31, 39], yellow: [33, 39] }, dt.styles = { special: "cyan", number: "yellow", boolean: "yellow", undefined: "grey", null: "bold", string: "green", date: "magenta", regexp: "red" }; + var Ot = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + function Nt() { + console.log("%s - %s", function() { + var e2 = /* @__PURE__ */ new Date(), t2 = [It(e2.getHours()), It(e2.getMinutes()), It(e2.getSeconds())].join(":"); + return [e2.getDate(), Ot[e2.getMonth()], t2].join(" "); + }(), at.apply(null, arguments)); + } + function Dt(e2, t2) { + if (!t2 || !Ct(t2)) + return e2; + for (var n2 = Object.keys(t2), r2 = n2.length; r2--; ) + e2[n2[r2]] = t2[n2[r2]]; + return e2; + } + function jt(e2, t2) { + return Object.prototype.hasOwnProperty.call(e2, t2); + } + var Bt, zt, Ut = { inherits: it, _extend: Dt, log: Nt, isBuffer: Pt, isPrimitive: Tt, isFunction: Rt, isError: At, isDate: xt, isObject: Ct, isRegExp: Mt, isUndefined: kt, isSymbol: Et, isString: St, isNumber: _t, isNullOrUndefined: wt, isNull: yt, isBoolean: bt, isArray: vt, inspect: dt, deprecate: st, format: at, debuglog: ct }, Ft = i(Object.freeze({ __proto__: null, _extend: Dt, debuglog: ct, default: Ut, deprecate: st, format: at, inherits: it, inspect: dt, isArray: vt, isBoolean: bt, isBuffer: Pt, isDate: xt, isError: At, isFunction: Rt, isNull: yt, isNullOrUndefined: wt, isNumber: _t, isObject: Ct, isPrimitive: Tt, isRegExp: Mt, isString: St, isSymbol: Et, isUndefined: kt, log: Nt })); + function Kt() { + if (zt) + return Bt; + function e2(e3, t3) { + var n3 = Object.keys(e3); + if (Object.getOwnPropertySymbols) { + var r3 = Object.getOwnPropertySymbols(e3); + t3 && (r3 = r3.filter(function(t4) { + return Object.getOwnPropertyDescriptor(e3, t4).enumerable; + })), n3.push.apply(n3, r3); + } + return n3; + } + function t2(t3) { + for (var r3 = 1; r3 < arguments.length; r3++) { + var i3 = null != arguments[r3] ? arguments[r3] : {}; + r3 % 2 ? e2(Object(i3), true).forEach(function(e3) { + n2(t3, e3, i3[e3]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t3, Object.getOwnPropertyDescriptors(i3)) : e2(Object(i3)).forEach(function(e3) { + Object.defineProperty(t3, e3, Object.getOwnPropertyDescriptor(i3, e3)); + }); + } + return t3; + } + function n2(e3, t3, n3) { + return (t3 = i2(t3)) in e3 ? Object.defineProperty(e3, t3, { value: n3, enumerable: true, configurable: true, writable: true }) : e3[t3] = n3, e3; + } + function r2(e3, t3) { + for (var n3 = 0; n3 < t3.length; n3++) { + var r3 = t3[n3]; + r3.enumerable = r3.enumerable || false, r3.configurable = true, "value" in r3 && (r3.writable = true), Object.defineProperty(e3, i2(r3.key), r3); + } + } + function i2(e3) { + var t3 = function(e4, t4) { + if ("object" != typeof e4 || null === e4) + return e4; + var n3 = e4[Symbol.toPrimitive]; + if (void 0 !== n3) { + var r3 = n3.call(e4, t4 || "default"); + if ("object" != typeof r3) + return r3; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === t4 ? String : Number)(e4); + }(e3, "string"); + return "symbol" == typeof t3 ? t3 : String(t3); + } + zt = 1; + var o2 = ce.Buffer, a2 = Ft.inspect, s2 = a2 && a2.custom || "inspect"; + return Bt = function() { + function e3() { + !function(e4, t3) { + if (!(e4 instanceof t3)) + throw new TypeError("Cannot call a class as a function"); + }(this, e3), this.head = null, this.tail = null, this.length = 0; + } + var n3, i3; + return n3 = e3, i3 = [{ key: "push", value: function(e4) { + var t3 = { data: e4, next: null }; + this.length > 0 ? this.tail.next = t3 : this.head = t3, this.tail = t3, ++this.length; + } }, { key: "unshift", value: function(e4) { + var t3 = { data: e4, next: this.head }; + 0 === this.length && (this.tail = t3), this.head = t3, ++this.length; + } }, { key: "shift", value: function() { + if (0 !== this.length) { + var e4 = this.head.data; + return 1 === this.length ? this.head = this.tail = null : this.head = this.head.next, --this.length, e4; + } + } }, { key: "clear", value: function() { + this.head = this.tail = null, this.length = 0; + } }, { key: "join", value: function(e4) { + if (0 === this.length) + return ""; + for (var t3 = this.head, n4 = "" + t3.data; t3 = t3.next; ) + n4 += e4 + t3.data; + return n4; + } }, { key: "concat", value: function(e4) { + if (0 === this.length) + return o2.alloc(0); + for (var t3, n4, r3, i4 = o2.allocUnsafe(e4 >>> 0), a3 = this.head, s3 = 0; a3; ) + t3 = a3.data, n4 = i4, r3 = s3, o2.prototype.copy.call(t3, n4, r3), s3 += a3.data.length, a3 = a3.next; + return i4; + } }, { key: "consume", value: function(e4, t3) { + var n4; + return e4 < this.head.data.length ? (n4 = this.head.data.slice(0, e4), this.head.data = this.head.data.slice(e4)) : n4 = e4 === this.head.data.length ? this.shift() : t3 ? this._getString(e4) : this._getBuffer(e4), n4; + } }, { key: "first", value: function() { + return this.head.data; + } }, { key: "_getString", value: function(e4) { + var t3 = this.head, n4 = 1, r3 = t3.data; + for (e4 -= r3.length; t3 = t3.next; ) { + var i4 = t3.data, o3 = e4 > i4.length ? i4.length : e4; + if (o3 === i4.length ? r3 += i4 : r3 += i4.slice(0, e4), 0 == (e4 -= o3)) { + o3 === i4.length ? (++n4, t3.next ? this.head = t3.next : this.head = this.tail = null) : (this.head = t3, t3.data = i4.slice(o3)); + break; + } + ++n4; + } + return this.length -= n4, r3; + } }, { key: "_getBuffer", value: function(e4) { + var t3 = o2.allocUnsafe(e4), n4 = this.head, r3 = 1; + for (n4.data.copy(t3), e4 -= n4.data.length; n4 = n4.next; ) { + var i4 = n4.data, a3 = e4 > i4.length ? i4.length : e4; + if (i4.copy(t3, t3.length - e4, 0, a3), 0 == (e4 -= a3)) { + a3 === i4.length ? (++r3, n4.next ? this.head = n4.next : this.head = this.tail = null) : (this.head = n4, n4.data = i4.slice(a3)); + break; + } + ++r3; + } + return this.length -= r3, t3; + } }, { key: s2, value: function(e4, n4) { + return a2(this, t2(t2({}, n4), {}, { depth: 0, customInspect: false })); + } }], i3 && r2(n3.prototype, i3), Object.defineProperty(n3, "prototype", { writable: false }), e3; + }(), Bt; + } + function qt(e2, t2) { + Wt(e2, t2), Ht(e2); + } + function Ht(e2) { + e2._writableState && !e2._writableState.emitClose || e2._readableState && !e2._readableState.emitClose || e2.emit("close"); + } + function Wt(e2, t2) { + e2.emit("error", t2); + } + var $t = { destroy: function(e2, t2) { + var n2 = this, r2 = this._readableState && this._readableState.destroyed, i2 = this._writableState && this._writableState.destroyed; + return r2 || i2 ? (t2 ? t2(e2) : e2 && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = true, Ee(Wt, this, e2)) : Ee(Wt, this, e2)), this) : (this._readableState && (this._readableState.destroyed = true), this._writableState && (this._writableState.destroyed = true), this._destroy(e2 || null, function(e3) { + !t2 && e3 ? n2._writableState ? n2._writableState.errorEmitted ? Ee(Ht, n2) : (n2._writableState.errorEmitted = true, Ee(qt, n2, e3)) : Ee(qt, n2, e3) : t2 ? (Ee(Ht, n2), t2(e3)) : Ee(Ht, n2); + }), this); + }, undestroy: function() { + this._readableState && (this._readableState.destroyed = false, this._readableState.reading = false, this._readableState.ended = false, this._readableState.endEmitted = false), this._writableState && (this._writableState.destroyed = false, this._writableState.ended = false, this._writableState.ending = false, this._writableState.finalCalled = false, this._writableState.prefinished = false, this._writableState.finished = false, this._writableState.errorEmitted = false); + }, errorOrDestroy: function(e2, t2) { + var n2 = e2._readableState, r2 = e2._writableState; + n2 && n2.autoDestroy || r2 && r2.autoDestroy ? e2.destroy(t2) : e2.emit("error", t2); + } }, Vt = {}; + var Yt = {}; + function Gt(e2, t2, n2) { + n2 || (n2 = Error); + var r2 = function(e3) { + var n3, r3; + function i2(n4, r4, i3) { + return e3.call(this, function(e4, n5, r5) { + return "string" == typeof t2 ? t2 : t2(e4, n5, r5); + }(n4, r4, i3)) || this; + } + return r3 = e3, (n3 = i2).prototype = Object.create(r3.prototype), n3.prototype.constructor = n3, n3.__proto__ = r3, i2; + }(n2); + r2.prototype.name = n2.name, r2.prototype.code = e2, Yt[e2] = r2; + } + function Zt(e2, t2) { + if (Array.isArray(e2)) { + var n2 = e2.length; + return e2 = e2.map(function(e3) { + return String(e3); + }), n2 > 2 ? "one of ".concat(t2, " ").concat(e2.slice(0, n2 - 1).join(", "), ", or ") + e2[n2 - 1] : 2 === n2 ? "one of ".concat(t2, " ").concat(e2[0], " or ").concat(e2[1]) : "of ".concat(t2, " ").concat(e2[0]); + } + return "of ".concat(t2, " ").concat(String(e2)); + } + Gt("ERR_INVALID_OPT_VALUE", function(e2, t2) { + return 'The value "' + t2 + '" is invalid for option "' + e2 + '"'; + }, TypeError), Gt("ERR_INVALID_ARG_TYPE", function(e2, t2, n2) { + var r2, i2, a2; + if ("string" == typeof t2 && (i2 = "not ", t2.substr(0, i2.length) === i2) ? (r2 = "must not be", t2 = t2.replace(/^not /, "")) : r2 = "must be", function(e3, t3, n3) { + return (void 0 === n3 || n3 > e3.length) && (n3 = e3.length), e3.substring(n3 - t3.length, n3) === t3; + }(e2, " argument")) + a2 = "The ".concat(e2, " ").concat(r2, " ").concat(Zt(t2, "type")); + else { + var s2 = function(e3, t3, n3) { + return "number" != typeof n3 && (n3 = 0), !(n3 + t3.length > e3.length) && -1 !== e3.indexOf(t3, n3); + }(e2, ".") ? "property" : "argument"; + a2 = 'The "'.concat(e2, '" ').concat(s2, " ").concat(r2, " ").concat(Zt(t2, "type")); + } + return a2 += ". Received type ".concat(typeof n2); + }, TypeError), Gt("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"), Gt("ERR_METHOD_NOT_IMPLEMENTED", function(e2) { + return "The " + e2 + " method is not implemented"; + }), Gt("ERR_STREAM_PREMATURE_CLOSE", "Premature close"), Gt("ERR_STREAM_DESTROYED", function(e2) { + return "Cannot call " + e2 + " after a stream was destroyed"; + }), Gt("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"), Gt("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"), Gt("ERR_STREAM_WRITE_AFTER_END", "write after end"), Gt("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError), Gt("ERR_UNKNOWN_ENCODING", function(e2) { + return "Unknown encoding: " + e2; + }, TypeError), Gt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"), Vt.codes = Yt; + var Qt = Vt.codes.ERR_INVALID_OPT_VALUE; + var Jt, Xt, en, tn, nn = { getHighWaterMark: function(e2, t2, n2, r2) { + var i2 = function(e3, t3, n3) { + return null != e3.highWaterMark ? e3.highWaterMark : t3 ? e3[n3] : null; + }(t2, r2, n2); + if (null != i2) { + if (!isFinite(i2) || Math.floor(i2) !== i2 || i2 < 0) + throw new Qt(r2 ? n2 : "highWaterMark", i2); + return Math.floor(i2); + } + return e2.objectMode ? 16 : 16384; + } }, rn = function(e2, t2) { + if (on("noDeprecation")) + return e2; + var n2 = false; + return function() { + if (!n2) { + if (on("throwDeprecation")) + throw new Error(t2); + on("traceDeprecation") ? console.trace(t2) : console.warn(t2), n2 = true; + } + return e2.apply(this, arguments); + }; + }; + function on(e2) { + try { + if (!n.localStorage) + return false; + } catch (e3) { + return false; + } + var t2 = n.localStorage[e2]; + return null != t2 && "true" === String(t2).toLowerCase(); + } + function an() { + if (Xt) + return Jt; + function e2(e3) { + var t3 = this; + this.next = null, this.entry = null, this.finish = function() { + !function(e4, t4, n2) { + var r3 = e4.entry; + e4.entry = null; + for (; r3; ) { + var i3 = r3.callback; + t4.pendingcb--, i3(n2), r3 = r3.next; + } + t4.corkedRequestsFree.next = e4; + }(t3, e3); + }; + } + var t2; + Xt = 1, Jt = S2, S2.WritableState = _2; + var r2 = { deprecate: rn }, i2 = rt, o2 = ce.Buffer, a2 = (void 0 !== n ? n : "undefined" != typeof window ? window : "undefined" != typeof self ? self : {}).Uint8Array || function() { + }; + var s2, u2 = $t, l2 = nn.getHighWaterMark, c2 = Vt.codes, d2 = c2.ERR_INVALID_ARG_TYPE, f2 = c2.ERR_METHOD_NOT_IMPLEMENTED, h2 = c2.ERR_MULTIPLE_CALLBACK, p2 = c2.ERR_STREAM_CANNOT_PIPE, m2 = c2.ERR_STREAM_DESTROYED, g2 = c2.ERR_STREAM_NULL_VALUES, v2 = c2.ERR_STREAM_WRITE_AFTER_END, b2 = c2.ERR_UNKNOWN_ENCODING, y2 = u2.errorOrDestroy; + function w2() { + } + function _2(n2, r3, i3) { + t2 = t2 || sn(), n2 = n2 || {}, "boolean" != typeof i3 && (i3 = r3 instanceof t2), this.objectMode = !!n2.objectMode, i3 && (this.objectMode = this.objectMode || !!n2.writableObjectMode), this.highWaterMark = l2(this, n2, "writableHighWaterMark", i3), this.finalCalled = false, this.needDrain = false, this.ending = false, this.ended = false, this.finished = false, this.destroyed = false; + var o3 = false === n2.decodeStrings; + this.decodeStrings = !o3, this.defaultEncoding = n2.defaultEncoding || "utf8", this.length = 0, this.writing = false, this.corked = 0, this.sync = true, this.bufferProcessing = false, this.onwrite = function(e3) { + !function(e4, t3) { + var n3 = e4._writableState, r4 = n3.sync, i4 = n3.writecb; + if ("function" != typeof i4) + throw new h2(); + if (function(e5) { + e5.writing = false, e5.writecb = null, e5.length -= e5.writelen, e5.writelen = 0; + }(n3), t3) + !function(e5, t4, n4, r5, i5) { + --t4.pendingcb, n4 ? (Ee(i5, r5), Ee(A2, e5, t4), e5._writableState.errorEmitted = true, y2(e5, r5)) : (i5(r5), e5._writableState.errorEmitted = true, y2(e5, r5), A2(e5, t4)); + }(e4, n3, r4, t3, i4); + else { + var o4 = C2(n3) || e4.destroyed; + o4 || n3.corked || n3.bufferProcessing || !n3.bufferedRequest || M2(e4, n3), r4 ? Ee(k2, e4, n3, o4, i4) : k2(e4, n3, o4, i4); + } + }(r3, e3); + }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = false, this.errorEmitted = false, this.emitClose = false !== n2.emitClose, this.autoDestroy = !!n2.autoDestroy, this.bufferedRequestCount = 0, this.corkedRequestsFree = new e2(this); + } + function S2(e3) { + var n2 = this instanceof (t2 = t2 || sn()); + if (!n2 && !s2.call(S2, this)) + return new S2(e3); + this._writableState = new _2(e3, this, n2), this.writable = true, e3 && ("function" == typeof e3.write && (this._write = e3.write), "function" == typeof e3.writev && (this._writev = e3.writev), "function" == typeof e3.destroy && (this._destroy = e3.destroy), "function" == typeof e3.final && (this._final = e3.final)), i2.call(this); + } + function E2(e3, t3, n2, r3, i3, o3, a3) { + t3.writelen = r3, t3.writecb = a3, t3.writing = true, t3.sync = true, t3.destroyed ? t3.onwrite(new m2("write")) : n2 ? e3._writev(i3, t3.onwrite) : e3._write(i3, o3, t3.onwrite), t3.sync = false; + } + function k2(e3, t3, n2, r3) { + n2 || function(e4, t4) { + 0 === t4.length && t4.needDrain && (t4.needDrain = false, e4.emit("drain")); + }(e3, t3), t3.pendingcb--, r3(), A2(e3, t3); + } + function M2(t3, n2) { + n2.bufferProcessing = true; + var r3 = n2.bufferedRequest; + if (t3._writev && r3 && r3.next) { + var i3 = n2.bufferedRequestCount, o3 = new Array(i3), a3 = n2.corkedRequestsFree; + a3.entry = r3; + for (var s3 = 0, u3 = true; r3; ) + o3[s3] = r3, r3.isBuf || (u3 = false), r3 = r3.next, s3 += 1; + o3.allBuffers = u3, E2(t3, n2, true, n2.length, o3, "", a3.finish), n2.pendingcb++, n2.lastBufferedRequest = null, a3.next ? (n2.corkedRequestsFree = a3.next, a3.next = null) : n2.corkedRequestsFree = new e2(n2), n2.bufferedRequestCount = 0; + } else { + for (; r3; ) { + var l3 = r3.chunk, c3 = r3.encoding, d3 = r3.callback; + if (E2(t3, n2, false, n2.objectMode ? 1 : l3.length, l3, c3, d3), r3 = r3.next, n2.bufferedRequestCount--, n2.writing) + break; + } + null === r3 && (n2.lastBufferedRequest = null); + } + n2.bufferedRequest = r3, n2.bufferProcessing = false; + } + function C2(e3) { + return e3.ending && 0 === e3.length && null === e3.bufferedRequest && !e3.finished && !e3.writing; + } + function x2(e3, t3) { + e3._final(function(n2) { + t3.pendingcb--, n2 && y2(e3, n2), t3.prefinished = true, e3.emit("prefinish"), A2(e3, t3); + }); + } + function A2(e3, t3) { + var n2 = C2(t3); + if (n2 && (function(e4, t4) { + t4.prefinished || t4.finalCalled || ("function" != typeof e4._final || t4.destroyed ? (t4.prefinished = true, e4.emit("prefinish")) : (t4.pendingcb++, t4.finalCalled = true, Ee(x2, e4, t4))); + }(e3, t3), 0 === t3.pendingcb && (t3.finished = true, e3.emit("finish"), t3.autoDestroy))) { + var r3 = e3._readableState; + (!r3 || r3.autoDestroy && r3.endEmitted) && e3.destroy(); + } + return n2; + } + return Ve(S2, i2), _2.prototype.getBuffer = function() { + for (var e3 = this.bufferedRequest, t3 = []; e3; ) + t3.push(e3), e3 = e3.next; + return t3; + }, function() { + try { + Object.defineProperty(_2.prototype, "buffer", { get: r2.deprecate(function() { + return this.getBuffer(); + }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") }); + } catch (e3) { + } + }(), "function" == typeof Symbol && Symbol.hasInstance && "function" == typeof Function.prototype[Symbol.hasInstance] ? (s2 = Function.prototype[Symbol.hasInstance], Object.defineProperty(S2, Symbol.hasInstance, { value: function(e3) { + return !!s2.call(this, e3) || this === S2 && (e3 && e3._writableState instanceof _2); + } })) : s2 = function(e3) { + return e3 instanceof this; + }, S2.prototype.pipe = function() { + y2(this, new p2()); + }, S2.prototype.write = function(e3, t3, n2) { + var r3, i3 = this._writableState, s3 = false, u3 = !i3.objectMode && (r3 = e3, o2.isBuffer(r3) || r3 instanceof a2); + return u3 && !o2.isBuffer(e3) && (e3 = function(e4) { + return o2.from(e4); + }(e3)), "function" == typeof t3 && (n2 = t3, t3 = null), u3 ? t3 = "buffer" : t3 || (t3 = i3.defaultEncoding), "function" != typeof n2 && (n2 = w2), i3.ending ? function(e4, t4) { + var n3 = new v2(); + y2(e4, n3), Ee(t4, n3); + }(this, n2) : (u3 || function(e4, t4, n3, r4) { + var i4; + return null === n3 ? i4 = new g2() : "string" == typeof n3 || t4.objectMode || (i4 = new d2("chunk", ["string", "Buffer"], n3)), !i4 || (y2(e4, i4), Ee(r4, i4), false); + }(this, i3, e3, n2)) && (i3.pendingcb++, s3 = function(e4, t4, n3, r4, i4, a3) { + if (!n3) { + var s4 = function(e5, t5, n4) { + e5.objectMode || false === e5.decodeStrings || "string" != typeof t5 || (t5 = o2.from(t5, n4)); + return t5; + }(t4, r4, i4); + r4 !== s4 && (n3 = true, i4 = "buffer", r4 = s4); + } + var u4 = t4.objectMode ? 1 : r4.length; + t4.length += u4; + var l3 = t4.length < t4.highWaterMark; + l3 || (t4.needDrain = true); + if (t4.writing || t4.corked) { + var c3 = t4.lastBufferedRequest; + t4.lastBufferedRequest = { chunk: r4, encoding: i4, isBuf: n3, callback: a3, next: null }, c3 ? c3.next = t4.lastBufferedRequest : t4.bufferedRequest = t4.lastBufferedRequest, t4.bufferedRequestCount += 1; + } else + E2(e4, t4, false, u4, r4, i4, a3); + return l3; + }(this, i3, u3, e3, t3, n2)), s3; + }, S2.prototype.cork = function() { + this._writableState.corked++; + }, S2.prototype.uncork = function() { + var e3 = this._writableState; + e3.corked && (e3.corked--, e3.writing || e3.corked || e3.bufferProcessing || !e3.bufferedRequest || M2(this, e3)); + }, S2.prototype.setDefaultEncoding = function(e3) { + if ("string" == typeof e3 && (e3 = e3.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((e3 + "").toLowerCase()) > -1)) + throw new b2(e3); + return this._writableState.defaultEncoding = e3, this; + }, Object.defineProperty(S2.prototype, "writableBuffer", { enumerable: false, get: function() { + return this._writableState && this._writableState.getBuffer(); + } }), Object.defineProperty(S2.prototype, "writableHighWaterMark", { enumerable: false, get: function() { + return this._writableState.highWaterMark; + } }), S2.prototype._write = function(e3, t3, n2) { + n2(new f2("_write()")); + }, S2.prototype._writev = null, S2.prototype.end = function(e3, t3, n2) { + var r3 = this._writableState; + return "function" == typeof e3 ? (n2 = e3, e3 = null, t3 = null) : "function" == typeof t3 && (n2 = t3, t3 = null), null != e3 && this.write(e3, t3), r3.corked && (r3.corked = 1, this.uncork()), r3.ending || function(e4, t4, n3) { + t4.ending = true, A2(e4, t4), n3 && (t4.finished ? Ee(n3) : e4.once("finish", n3)); + t4.ended = true, e4.writable = false; + }(this, r3, n2), this; + }, Object.defineProperty(S2.prototype, "writableLength", { enumerable: false, get: function() { + return this._writableState.length; + } }), Object.defineProperty(S2.prototype, "destroyed", { enumerable: false, get: function() { + return void 0 !== this._writableState && this._writableState.destroyed; + }, set: function(e3) { + this._writableState && (this._writableState.destroyed = e3); + } }), S2.prototype.destroy = u2.destroy, S2.prototype._undestroy = u2.undestroy, S2.prototype._destroy = function(e3, t3) { + t3(e3); + }, Jt; + } + function sn() { + if (tn) + return en; + tn = 1; + var e2 = Object.keys || function(e3) { + var t3 = []; + for (var n3 in e3) + t3.push(n3); + return t3; + }; + en = a2; + var t2 = _n(), n2 = an(); + Ve(a2, t2); + for (var r2 = e2(n2.prototype), i2 = 0; i2 < r2.length; i2++) { + var o2 = r2[i2]; + a2.prototype[o2] || (a2.prototype[o2] = n2.prototype[o2]); + } + function a2(e3) { + if (!(this instanceof a2)) + return new a2(e3); + t2.call(this, e3), n2.call(this, e3), this.allowHalfOpen = true, e3 && (false === e3.readable && (this.readable = false), false === e3.writable && (this.writable = false), false === e3.allowHalfOpen && (this.allowHalfOpen = false, this.once("end", s2))); + } + function s2() { + this._writableState.ended || Ee(u2, this); + } + function u2(e3) { + e3.end(); + } + return Object.defineProperty(a2.prototype, "writableHighWaterMark", { enumerable: false, get: function() { + return this._writableState.highWaterMark; + } }), Object.defineProperty(a2.prototype, "writableBuffer", { enumerable: false, get: function() { + return this._writableState && this._writableState.getBuffer(); + } }), Object.defineProperty(a2.prototype, "writableLength", { enumerable: false, get: function() { + return this._writableState.length; + } }), Object.defineProperty(a2.prototype, "destroyed", { enumerable: false, get: function() { + return void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed && this._writableState.destroyed); + }, set: function(e3) { + void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed = e3, this._writableState.destroyed = e3); + } }), en; + } + var un, ln = {}; + function cn() { + if (un) + return ln; + un = 1; + var e2 = Ue().Buffer, t2 = e2.isEncoding || function(e3) { + switch ((e3 = "" + e3) && e3.toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + case "raw": + return true; + default: + return false; + } + }; + function n2(n3) { + var r3; + switch (this.encoding = function(n4) { + var r4 = function(e3) { + if (!e3) + return "utf8"; + for (var t3; ; ) + switch (e3) { + case "utf8": + case "utf-8": + return "utf8"; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return "utf16le"; + case "latin1": + case "binary": + return "latin1"; + case "base64": + case "ascii": + case "hex": + return e3; + default: + if (t3) + return; + e3 = ("" + e3).toLowerCase(), t3 = true; + } + }(n4); + if ("string" != typeof r4 && (e2.isEncoding === t2 || !t2(n4))) + throw new Error("Unknown encoding: " + n4); + return r4 || n4; + }(n3), this.encoding) { + case "utf16le": + this.text = o2, this.end = a2, r3 = 4; + break; + case "utf8": + this.fillLast = i2, r3 = 4; + break; + case "base64": + this.text = s2, this.end = u2, r3 = 3; + break; + default: + return this.write = l2, void (this.end = c2); + } + this.lastNeed = 0, this.lastTotal = 0, this.lastChar = e2.allocUnsafe(r3); + } + function r2(e3) { + return e3 <= 127 ? 0 : e3 >> 5 == 6 ? 2 : e3 >> 4 == 14 ? 3 : e3 >> 3 == 30 ? 4 : e3 >> 6 == 2 ? -1 : -2; + } + function i2(e3) { + var t3 = this.lastTotal - this.lastNeed, n3 = function(e4, t4, n4) { + if (128 != (192 & t4[0])) + return e4.lastNeed = 0, "�"; + if (e4.lastNeed > 1 && t4.length > 1) { + if (128 != (192 & t4[1])) + return e4.lastNeed = 1, "�"; + if (e4.lastNeed > 2 && t4.length > 2 && 128 != (192 & t4[2])) + return e4.lastNeed = 2, "�"; + } + }(this, e3); + return void 0 !== n3 ? n3 : this.lastNeed <= e3.length ? (e3.copy(this.lastChar, t3, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal)) : (e3.copy(this.lastChar, t3, 0, e3.length), void (this.lastNeed -= e3.length)); + } + function o2(e3, t3) { + if ((e3.length - t3) % 2 == 0) { + var n3 = e3.toString("utf16le", t3); + if (n3) { + var r3 = n3.charCodeAt(n3.length - 1); + if (r3 >= 55296 && r3 <= 56319) + return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = e3[e3.length - 2], this.lastChar[1] = e3[e3.length - 1], n3.slice(0, -1); + } + return n3; + } + return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = e3[e3.length - 1], e3.toString("utf16le", t3, e3.length - 1); + } + function a2(e3) { + var t3 = e3 && e3.length ? this.write(e3) : ""; + if (this.lastNeed) { + var n3 = this.lastTotal - this.lastNeed; + return t3 + this.lastChar.toString("utf16le", 0, n3); + } + return t3; + } + function s2(e3, t3) { + var n3 = (e3.length - t3) % 3; + return 0 === n3 ? e3.toString("base64", t3) : (this.lastNeed = 3 - n3, this.lastTotal = 3, 1 === n3 ? this.lastChar[0] = e3[e3.length - 1] : (this.lastChar[0] = e3[e3.length - 2], this.lastChar[1] = e3[e3.length - 1]), e3.toString("base64", t3, e3.length - n3)); + } + function u2(e3) { + var t3 = e3 && e3.length ? this.write(e3) : ""; + return this.lastNeed ? t3 + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : t3; + } + function l2(e3) { + return e3.toString(this.encoding); + } + function c2(e3) { + return e3 && e3.length ? this.write(e3) : ""; + } + return ln.StringDecoder = n2, n2.prototype.write = function(e3) { + if (0 === e3.length) + return ""; + var t3, n3; + if (this.lastNeed) { + if (void 0 === (t3 = this.fillLast(e3))) + return ""; + n3 = this.lastNeed, this.lastNeed = 0; + } else + n3 = 0; + return n3 < e3.length ? t3 ? t3 + this.text(e3, n3) : this.text(e3, n3) : t3 || ""; + }, n2.prototype.end = function(e3) { + var t3 = e3 && e3.length ? this.write(e3) : ""; + return this.lastNeed ? t3 + "�" : t3; + }, n2.prototype.text = function(e3, t3) { + var n3 = function(e4, t4, n4) { + var i4 = t4.length - 1; + if (i4 < n4) + return 0; + var o3 = r2(t4[i4]); + if (o3 >= 0) + return o3 > 0 && (e4.lastNeed = o3 - 1), o3; + if (--i4 < n4 || -2 === o3) + return 0; + if (o3 = r2(t4[i4]), o3 >= 0) + return o3 > 0 && (e4.lastNeed = o3 - 2), o3; + if (--i4 < n4 || -2 === o3) + return 0; + if (o3 = r2(t4[i4]), o3 >= 0) + return o3 > 0 && (2 === o3 ? o3 = 0 : e4.lastNeed = o3 - 3), o3; + return 0; + }(this, e3, t3); + if (!this.lastNeed) + return e3.toString("utf8", t3); + this.lastTotal = n3; + var i3 = e3.length - (n3 - this.lastNeed); + return e3.copy(this.lastChar, 0, i3), e3.toString("utf8", t3, i3); + }, n2.prototype.fillLast = function(e3) { + if (this.lastNeed <= e3.length) + return e3.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal); + e3.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, e3.length), this.lastNeed -= e3.length; + }, ln; + } + var dn = Vt.codes.ERR_STREAM_PREMATURE_CLOSE; + function fn() { + } + var hn, pn, mn, gn, vn, bn, yn = function e2(t2, n2, r2) { + if ("function" == typeof n2) + return e2(t2, null, n2); + n2 || (n2 = {}), r2 = function(e3) { + var t3 = false; + return function() { + if (!t3) { + t3 = true; + for (var n3 = arguments.length, r3 = new Array(n3), i3 = 0; i3 < n3; i3++) + r3[i3] = arguments[i3]; + e3.apply(this, r3); + } + }; + }(r2 || fn); + var i2 = n2.readable || false !== n2.readable && t2.readable, o2 = n2.writable || false !== n2.writable && t2.writable, a2 = function() { + t2.writable || u2(); + }, s2 = t2._writableState && t2._writableState.finished, u2 = function() { + o2 = false, s2 = true, i2 || r2.call(t2); + }, l2 = t2._readableState && t2._readableState.endEmitted, c2 = function() { + i2 = false, l2 = true, o2 || r2.call(t2); + }, d2 = function(e3) { + r2.call(t2, e3); + }, f2 = function() { + var e3; + return i2 && !l2 ? (t2._readableState && t2._readableState.ended || (e3 = new dn()), r2.call(t2, e3)) : o2 && !s2 ? (t2._writableState && t2._writableState.ended || (e3 = new dn()), r2.call(t2, e3)) : void 0; + }, h2 = function() { + t2.req.on("finish", u2); + }; + return !function(e3) { + return e3.setHeader && "function" == typeof e3.abort; + }(t2) ? o2 && !t2._writableState && (t2.on("end", a2), t2.on("close", a2)) : (t2.on("complete", u2), t2.on("abort", f2), t2.req ? h2() : t2.on("request", h2)), t2.on("end", c2), t2.on("finish", u2), false !== n2.error && t2.on("error", d2), t2.on("close", f2), function() { + t2.removeListener("complete", u2), t2.removeListener("abort", f2), t2.removeListener("request", h2), t2.req && t2.req.removeListener("finish", u2), t2.removeListener("end", a2), t2.removeListener("close", a2), t2.removeListener("finish", u2), t2.removeListener("end", c2), t2.removeListener("error", d2), t2.removeListener("close", f2); + }; + }; + function wn() { + if (pn) + return hn; + var e2; + function t2(e3, t3, n3) { + return (t3 = function(e4) { + var t4 = function(e5, t5) { + if ("object" != typeof e5 || null === e5) + return e5; + var n4 = e5[Symbol.toPrimitive]; + if (void 0 !== n4) { + var r3 = n4.call(e5, t5 || "default"); + if ("object" != typeof r3) + return r3; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === t5 ? String : Number)(e5); + }(e4, "string"); + return "symbol" == typeof t4 ? t4 : String(t4); + }(t3)) in e3 ? Object.defineProperty(e3, t3, { value: n3, enumerable: true, configurable: true, writable: true }) : e3[t3] = n3, e3; + } + pn = 1; + var n2 = yn, r2 = Symbol("lastResolve"), i2 = Symbol("lastReject"), o2 = Symbol("error"), a2 = Symbol("ended"), s2 = Symbol("lastPromise"), u2 = Symbol("handlePromise"), l2 = Symbol("stream"); + function c2(e3, t3) { + return { value: e3, done: t3 }; + } + function d2(e3) { + var t3 = e3[r2]; + if (null !== t3) { + var n3 = e3[l2].read(); + null !== n3 && (e3[s2] = null, e3[r2] = null, e3[i2] = null, t3(c2(n3, false))); + } + } + function f2(e3) { + Ee(d2, e3); + } + var h2 = Object.getPrototypeOf(function() { + }), p2 = Object.setPrototypeOf((t2(e2 = { get stream() { + return this[l2]; + }, next: function() { + var e3 = this, t3 = this[o2]; + if (null !== t3) + return Promise.reject(t3); + if (this[a2]) + return Promise.resolve(c2(void 0, true)); + if (this[l2].destroyed) + return new Promise(function(t4, n4) { + Ee(function() { + e3[o2] ? n4(e3[o2]) : t4(c2(void 0, true)); + }); + }); + var n3, r3 = this[s2]; + if (r3) + n3 = new Promise(function(e4, t4) { + return function(n4, r4) { + e4.then(function() { + t4[a2] ? n4(c2(void 0, true)) : t4[u2](n4, r4); + }, r4); + }; + }(r3, this)); + else { + var i3 = this[l2].read(); + if (null !== i3) + return Promise.resolve(c2(i3, false)); + n3 = new Promise(this[u2]); + } + return this[s2] = n3, n3; + } }, Symbol.asyncIterator, function() { + return this; + }), t2(e2, "return", function() { + var e3 = this; + return new Promise(function(t3, n3) { + e3[l2].destroy(null, function(e4) { + e4 ? n3(e4) : t3(c2(void 0, true)); + }); + }); + }), e2), h2); + return hn = function(e3) { + var d3, h3 = Object.create(p2, (t2(d3 = {}, l2, { value: e3, writable: true }), t2(d3, r2, { value: null, writable: true }), t2(d3, i2, { value: null, writable: true }), t2(d3, o2, { value: null, writable: true }), t2(d3, a2, { value: e3._readableState.endEmitted, writable: true }), t2(d3, u2, { value: function(e4, t3) { + var n3 = h3[l2].read(); + n3 ? (h3[s2] = null, h3[r2] = null, h3[i2] = null, e4(c2(n3, false))) : (h3[r2] = e4, h3[i2] = t3); + }, writable: true }), d3)); + return h3[s2] = null, n2(e3, function(e4) { + if (e4 && "ERR_STREAM_PREMATURE_CLOSE" !== e4.code) { + var t3 = h3[i2]; + return null !== t3 && (h3[s2] = null, h3[r2] = null, h3[i2] = null, t3(e4)), void (h3[o2] = e4); + } + var n3 = h3[r2]; + null !== n3 && (h3[s2] = null, h3[r2] = null, h3[i2] = null, n3(c2(void 0, true))), h3[a2] = true; + }), e3.on("readable", f2.bind(null, h3)), h3; + }, hn; + } + function _n() { + if (bn) + return vn; + var e2; + bn = 1, vn = S2, S2.ReadableState = _2, nt.EventEmitter; + var t2 = function(e3, t3) { + return e3.listeners(t3).length; + }, r2 = rt, i2 = ce.Buffer, o2 = (void 0 !== n ? n : "undefined" != typeof window ? window : "undefined" != typeof self ? self : {}).Uint8Array || function() { + }; + var a2, s2 = Ft; + a2 = s2 && s2.debuglog ? s2.debuglog("stream") : function() { + }; + var u2, l2, c2, d2 = Kt(), f2 = $t, h2 = nn.getHighWaterMark, p2 = Vt.codes, m2 = p2.ERR_INVALID_ARG_TYPE, g2 = p2.ERR_STREAM_PUSH_AFTER_EOF, v2 = p2.ERR_METHOD_NOT_IMPLEMENTED, b2 = p2.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; + Ve(S2, r2); + var y2 = f2.errorOrDestroy, w2 = ["error", "close", "destroy", "pause", "resume"]; + function _2(t3, n2, r3) { + e2 = e2 || sn(), t3 = t3 || {}, "boolean" != typeof r3 && (r3 = n2 instanceof e2), this.objectMode = !!t3.objectMode, r3 && (this.objectMode = this.objectMode || !!t3.readableObjectMode), this.highWaterMark = h2(this, t3, "readableHighWaterMark", r3), this.buffer = new d2(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = false, this.endEmitted = false, this.reading = false, this.sync = true, this.needReadable = false, this.emittedReadable = false, this.readableListening = false, this.resumeScheduled = false, this.paused = true, this.emitClose = false !== t3.emitClose, this.autoDestroy = !!t3.autoDestroy, this.destroyed = false, this.defaultEncoding = t3.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = false, this.decoder = null, this.encoding = null, t3.encoding && (u2 || (u2 = cn().StringDecoder), this.decoder = new u2(t3.encoding), this.encoding = t3.encoding); + } + function S2(t3) { + if (e2 = e2 || sn(), !(this instanceof S2)) + return new S2(t3); + var n2 = this instanceof e2; + this._readableState = new _2(t3, this, n2), this.readable = true, t3 && ("function" == typeof t3.read && (this._read = t3.read), "function" == typeof t3.destroy && (this._destroy = t3.destroy)), r2.call(this); + } + function E2(e3, t3, n2, r3, s3) { + a2("readableAddChunk", t3); + var u3, l3 = e3._readableState; + if (null === t3) + l3.reading = false, function(e4, t4) { + if (a2("onEofChunk"), t4.ended) + return; + if (t4.decoder) { + var n3 = t4.decoder.end(); + n3 && n3.length && (t4.buffer.push(n3), t4.length += t4.objectMode ? 1 : n3.length); + } + t4.ended = true, t4.sync ? x2(e4) : (t4.needReadable = false, t4.emittedReadable || (t4.emittedReadable = true, A2(e4))); + }(e3, l3); + else if (s3 || (u3 = function(e4, t4) { + var n3; + r4 = t4, i2.isBuffer(r4) || r4 instanceof o2 || "string" == typeof t4 || void 0 === t4 || e4.objectMode || (n3 = new m2("chunk", ["string", "Buffer", "Uint8Array"], t4)); + var r4; + return n3; + }(l3, t3)), u3) + y2(e3, u3); + else if (l3.objectMode || t3 && t3.length > 0) + if ("string" == typeof t3 || l3.objectMode || Object.getPrototypeOf(t3) === i2.prototype || (t3 = function(e4) { + return i2.from(e4); + }(t3)), r3) + l3.endEmitted ? y2(e3, new b2()) : k2(e3, l3, t3, true); + else if (l3.ended) + y2(e3, new g2()); + else { + if (l3.destroyed) + return false; + l3.reading = false, l3.decoder && !n2 ? (t3 = l3.decoder.write(t3), l3.objectMode || 0 !== t3.length ? k2(e3, l3, t3, false) : R2(e3, l3)) : k2(e3, l3, t3, false); + } + else + r3 || (l3.reading = false, R2(e3, l3)); + return !l3.ended && (l3.length < l3.highWaterMark || 0 === l3.length); + } + function k2(e3, t3, n2, r3) { + t3.flowing && 0 === t3.length && !t3.sync ? (t3.awaitDrain = 0, e3.emit("data", n2)) : (t3.length += t3.objectMode ? 1 : n2.length, r3 ? t3.buffer.unshift(n2) : t3.buffer.push(n2), t3.needReadable && x2(e3)), R2(e3, t3); + } + Object.defineProperty(S2.prototype, "destroyed", { enumerable: false, get: function() { + return void 0 !== this._readableState && this._readableState.destroyed; + }, set: function(e3) { + this._readableState && (this._readableState.destroyed = e3); + } }), S2.prototype.destroy = f2.destroy, S2.prototype._undestroy = f2.undestroy, S2.prototype._destroy = function(e3, t3) { + t3(e3); + }, S2.prototype.push = function(e3, t3) { + var n2, r3 = this._readableState; + return r3.objectMode ? n2 = true : "string" == typeof e3 && ((t3 = t3 || r3.defaultEncoding) !== r3.encoding && (e3 = i2.from(e3, t3), t3 = ""), n2 = true), E2(this, e3, t3, false, n2); + }, S2.prototype.unshift = function(e3) { + return E2(this, e3, null, true, false); + }, S2.prototype.isPaused = function() { + return false === this._readableState.flowing; + }, S2.prototype.setEncoding = function(e3) { + u2 || (u2 = cn().StringDecoder); + var t3 = new u2(e3); + this._readableState.decoder = t3, this._readableState.encoding = this._readableState.decoder.encoding; + for (var n2 = this._readableState.buffer.head, r3 = ""; null !== n2; ) + r3 += t3.write(n2.data), n2 = n2.next; + return this._readableState.buffer.clear(), "" !== r3 && this._readableState.buffer.push(r3), this._readableState.length = r3.length, this; + }; + var M2 = 1073741824; + function C2(e3, t3) { + return e3 <= 0 || 0 === t3.length && t3.ended ? 0 : t3.objectMode ? 1 : e3 != e3 ? t3.flowing && t3.length ? t3.buffer.head.data.length : t3.length : (e3 > t3.highWaterMark && (t3.highWaterMark = function(e4) { + return e4 >= M2 ? e4 = M2 : (e4--, e4 |= e4 >>> 1, e4 |= e4 >>> 2, e4 |= e4 >>> 4, e4 |= e4 >>> 8, e4 |= e4 >>> 16, e4++), e4; + }(e3)), e3 <= t3.length ? e3 : t3.ended ? t3.length : (t3.needReadable = true, 0)); + } + function x2(e3) { + var t3 = e3._readableState; + a2("emitReadable", t3.needReadable, t3.emittedReadable), t3.needReadable = false, t3.emittedReadable || (a2("emitReadable", t3.flowing), t3.emittedReadable = true, Ee(A2, e3)); + } + function A2(e3) { + var t3 = e3._readableState; + a2("emitReadable_", t3.destroyed, t3.length, t3.ended), t3.destroyed || !t3.length && !t3.ended || (e3.emit("readable"), t3.emittedReadable = false), t3.needReadable = !t3.flowing && !t3.ended && t3.length <= t3.highWaterMark, O2(e3); + } + function R2(e3, t3) { + t3.readingMore || (t3.readingMore = true, Ee(T2, e3, t3)); + } + function T2(e3, t3) { + for (; !t3.reading && !t3.ended && (t3.length < t3.highWaterMark || t3.flowing && 0 === t3.length); ) { + var n2 = t3.length; + if (a2("maybeReadMore read 0"), e3.read(0), n2 === t3.length) + break; + } + t3.readingMore = false; + } + function P2(e3) { + var t3 = e3._readableState; + t3.readableListening = e3.listenerCount("readable") > 0, t3.resumeScheduled && !t3.paused ? t3.flowing = true : e3.listenerCount("data") > 0 && e3.resume(); + } + function L2(e3) { + a2("readable nexttick read 0"), e3.read(0); + } + function I2(e3, t3) { + a2("resume", t3.reading), t3.reading || e3.read(0), t3.resumeScheduled = false, e3.emit("resume"), O2(e3), t3.flowing && !t3.reading && e3.read(0); + } + function O2(e3) { + var t3 = e3._readableState; + for (a2("flow", t3.flowing); t3.flowing && null !== e3.read(); ) + ; + } + function N2(e3, t3) { + return 0 === t3.length ? null : (t3.objectMode ? n2 = t3.buffer.shift() : !e3 || e3 >= t3.length ? (n2 = t3.decoder ? t3.buffer.join("") : 1 === t3.buffer.length ? t3.buffer.first() : t3.buffer.concat(t3.length), t3.buffer.clear()) : n2 = t3.buffer.consume(e3, t3.decoder), n2); + var n2; + } + function D2(e3) { + var t3 = e3._readableState; + a2("endReadable", t3.endEmitted), t3.endEmitted || (t3.ended = true, Ee(j2, t3, e3)); + } + function j2(e3, t3) { + if (a2("endReadableNT", e3.endEmitted, e3.length), !e3.endEmitted && 0 === e3.length && (e3.endEmitted = true, t3.readable = false, t3.emit("end"), e3.autoDestroy)) { + var n2 = t3._writableState; + (!n2 || n2.autoDestroy && n2.finished) && t3.destroy(); + } + } + function B2(e3, t3) { + for (var n2 = 0, r3 = e3.length; n2 < r3; n2++) + if (e3[n2] === t3) + return n2; + return -1; + } + return S2.prototype.read = function(e3) { + a2("read", e3), e3 = parseInt(e3, 10); + var t3 = this._readableState, n2 = e3; + if (0 !== e3 && (t3.emittedReadable = false), 0 === e3 && t3.needReadable && ((0 !== t3.highWaterMark ? t3.length >= t3.highWaterMark : t3.length > 0) || t3.ended)) + return a2("read: emitReadable", t3.length, t3.ended), 0 === t3.length && t3.ended ? D2(this) : x2(this), null; + if (0 === (e3 = C2(e3, t3)) && t3.ended) + return 0 === t3.length && D2(this), null; + var r3, i3 = t3.needReadable; + return a2("need readable", i3), (0 === t3.length || t3.length - e3 < t3.highWaterMark) && a2("length less than watermark", i3 = true), t3.ended || t3.reading ? a2("reading or ended", i3 = false) : i3 && (a2("do read"), t3.reading = true, t3.sync = true, 0 === t3.length && (t3.needReadable = true), this._read(t3.highWaterMark), t3.sync = false, t3.reading || (e3 = C2(n2, t3))), null === (r3 = e3 > 0 ? N2(e3, t3) : null) ? (t3.needReadable = t3.length <= t3.highWaterMark, e3 = 0) : (t3.length -= e3, t3.awaitDrain = 0), 0 === t3.length && (t3.ended || (t3.needReadable = true), n2 !== e3 && t3.ended && D2(this)), null !== r3 && this.emit("data", r3), r3; + }, S2.prototype._read = function(e3) { + y2(this, new v2("_read()")); + }, S2.prototype.pipe = function(e3, n2) { + var r3 = this, i3 = this._readableState; + switch (i3.pipesCount) { + case 0: + i3.pipes = e3; + break; + case 1: + i3.pipes = [i3.pipes, e3]; + break; + default: + i3.pipes.push(e3); + } + i3.pipesCount += 1, a2("pipe count=%d opts=%j", i3.pipesCount, n2); + var o3 = (!n2 || false !== n2.end) && e3 !== je.stdout && e3 !== je.stderr ? u3 : m3; + function s3(t3, n3) { + a2("onunpipe"), t3 === r3 && n3 && false === n3.hasUnpiped && (n3.hasUnpiped = true, a2("cleanup"), e3.removeListener("close", h3), e3.removeListener("finish", p3), e3.removeListener("drain", l3), e3.removeListener("error", f3), e3.removeListener("unpipe", s3), r3.removeListener("end", u3), r3.removeListener("end", m3), r3.removeListener("data", d3), c3 = true, !i3.awaitDrain || e3._writableState && !e3._writableState.needDrain || l3()); + } + function u3() { + a2("onend"), e3.end(); + } + i3.endEmitted ? Ee(o3) : r3.once("end", o3), e3.on("unpipe", s3); + var l3 = function(e4) { + return function() { + var n3 = e4._readableState; + a2("pipeOnDrain", n3.awaitDrain), n3.awaitDrain && n3.awaitDrain--, 0 === n3.awaitDrain && t2(e4, "data") && (n3.flowing = true, O2(e4)); + }; + }(r3); + e3.on("drain", l3); + var c3 = false; + function d3(t3) { + a2("ondata"); + var n3 = e3.write(t3); + a2("dest.write", n3), false === n3 && ((1 === i3.pipesCount && i3.pipes === e3 || i3.pipesCount > 1 && -1 !== B2(i3.pipes, e3)) && !c3 && (a2("false write response, pause", i3.awaitDrain), i3.awaitDrain++), r3.pause()); + } + function f3(n3) { + a2("onerror", n3), m3(), e3.removeListener("error", f3), 0 === t2(e3, "error") && y2(e3, n3); + } + function h3() { + e3.removeListener("finish", p3), m3(); + } + function p3() { + a2("onfinish"), e3.removeListener("close", h3), m3(); + } + function m3() { + a2("unpipe"), r3.unpipe(e3); + } + return r3.on("data", d3), function(e4, t3, n3) { + if ("function" == typeof e4.prependListener) + return e4.prependListener(t3, n3); + e4._events && e4._events[t3] ? Array.isArray(e4._events[t3]) ? e4._events[t3].unshift(n3) : e4._events[t3] = [n3, e4._events[t3]] : e4.on(t3, n3); + }(e3, "error", f3), e3.once("close", h3), e3.once("finish", p3), e3.emit("pipe", r3), i3.flowing || (a2("pipe resume"), r3.resume()), e3; + }, S2.prototype.unpipe = function(e3) { + var t3 = this._readableState, n2 = { hasUnpiped: false }; + if (0 === t3.pipesCount) + return this; + if (1 === t3.pipesCount) + return e3 && e3 !== t3.pipes || (e3 || (e3 = t3.pipes), t3.pipes = null, t3.pipesCount = 0, t3.flowing = false, e3 && e3.emit("unpipe", this, n2)), this; + if (!e3) { + var r3 = t3.pipes, i3 = t3.pipesCount; + t3.pipes = null, t3.pipesCount = 0, t3.flowing = false; + for (var o3 = 0; o3 < i3; o3++) + r3[o3].emit("unpipe", this, { hasUnpiped: false }); + return this; + } + var a3 = B2(t3.pipes, e3); + return -1 === a3 || (t3.pipes.splice(a3, 1), t3.pipesCount -= 1, 1 === t3.pipesCount && (t3.pipes = t3.pipes[0]), e3.emit("unpipe", this, n2)), this; + }, S2.prototype.on = function(e3, t3) { + var n2 = r2.prototype.on.call(this, e3, t3), i3 = this._readableState; + return "data" === e3 ? (i3.readableListening = this.listenerCount("readable") > 0, false !== i3.flowing && this.resume()) : "readable" === e3 && (i3.endEmitted || i3.readableListening || (i3.readableListening = i3.needReadable = true, i3.flowing = false, i3.emittedReadable = false, a2("on readable", i3.length, i3.reading), i3.length ? x2(this) : i3.reading || Ee(L2, this))), n2; + }, S2.prototype.addListener = S2.prototype.on, S2.prototype.removeListener = function(e3, t3) { + var n2 = r2.prototype.removeListener.call(this, e3, t3); + return "readable" === e3 && Ee(P2, this), n2; + }, S2.prototype.removeAllListeners = function(e3) { + var t3 = r2.prototype.removeAllListeners.apply(this, arguments); + return "readable" !== e3 && void 0 !== e3 || Ee(P2, this), t3; + }, S2.prototype.resume = function() { + var e3 = this._readableState; + return e3.flowing || (a2("resume"), e3.flowing = !e3.readableListening, function(e4, t3) { + t3.resumeScheduled || (t3.resumeScheduled = true, Ee(I2, e4, t3)); + }(this, e3)), e3.paused = false, this; + }, S2.prototype.pause = function() { + return a2("call pause flowing=%j", this._readableState.flowing), false !== this._readableState.flowing && (a2("pause"), this._readableState.flowing = false, this.emit("pause")), this._readableState.paused = true, this; + }, S2.prototype.wrap = function(e3) { + var t3 = this, n2 = this._readableState, r3 = false; + for (var i3 in e3.on("end", function() { + if (a2("wrapped end"), n2.decoder && !n2.ended) { + var e4 = n2.decoder.end(); + e4 && e4.length && t3.push(e4); + } + t3.push(null); + }), e3.on("data", function(i4) { + (a2("wrapped data"), n2.decoder && (i4 = n2.decoder.write(i4)), n2.objectMode && null == i4) || (n2.objectMode || i4 && i4.length) && (t3.push(i4) || (r3 = true, e3.pause())); + }), e3) + void 0 === this[i3] && "function" == typeof e3[i3] && (this[i3] = function(t4) { + return function() { + return e3[t4].apply(e3, arguments); + }; + }(i3)); + for (var o3 = 0; o3 < w2.length; o3++) + e3.on(w2[o3], this.emit.bind(this, w2[o3])); + return this._read = function(t4) { + a2("wrapped _read", t4), r3 && (r3 = false, e3.resume()); + }, this; + }, "function" == typeof Symbol && (S2.prototype[Symbol.asyncIterator] = function() { + return void 0 === l2 && (l2 = wn()), l2(this); + }), Object.defineProperty(S2.prototype, "readableHighWaterMark", { enumerable: false, get: function() { + return this._readableState.highWaterMark; + } }), Object.defineProperty(S2.prototype, "readableBuffer", { enumerable: false, get: function() { + return this._readableState && this._readableState.buffer; + } }), Object.defineProperty(S2.prototype, "readableFlowing", { enumerable: false, get: function() { + return this._readableState.flowing; + }, set: function(e3) { + this._readableState && (this._readableState.flowing = e3); + } }), S2._fromList = N2, Object.defineProperty(S2.prototype, "readableLength", { enumerable: false, get: function() { + return this._readableState.length; + } }), "function" == typeof Symbol && (S2.from = function(e3, t3) { + return void 0 === c2 && (c2 = gn ? mn : (gn = 1, mn = function() { + throw new Error("Readable.from is not available in the browser"); + })), c2(S2, e3, t3); + }), vn; + } + var Sn = Tn, En = Vt.codes, kn = En.ERR_METHOD_NOT_IMPLEMENTED, Mn = En.ERR_MULTIPLE_CALLBACK, Cn = En.ERR_TRANSFORM_ALREADY_TRANSFORMING, xn = En.ERR_TRANSFORM_WITH_LENGTH_0, An = sn(); + function Rn(e2, t2) { + var n2 = this._transformState; + n2.transforming = false; + var r2 = n2.writecb; + if (null === r2) + return this.emit("error", new Mn()); + n2.writechunk = null, n2.writecb = null, null != t2 && this.push(t2), r2(e2); + var i2 = this._readableState; + i2.reading = false, (i2.needReadable || i2.length < i2.highWaterMark) && this._read(i2.highWaterMark); + } + function Tn(e2) { + if (!(this instanceof Tn)) + return new Tn(e2); + An.call(this, e2), this._transformState = { afterTransform: Rn.bind(this), needTransform: false, transforming: false, writecb: null, writechunk: null, writeencoding: null }, this._readableState.needReadable = true, this._readableState.sync = false, e2 && ("function" == typeof e2.transform && (this._transform = e2.transform), "function" == typeof e2.flush && (this._flush = e2.flush)), this.on("prefinish", Pn); + } + function Pn() { + var e2 = this; + "function" != typeof this._flush || this._readableState.destroyed ? Ln(this, null, null) : this._flush(function(t2, n2) { + Ln(e2, t2, n2); + }); + } + function Ln(e2, t2, n2) { + if (t2) + return e2.emit("error", t2); + if (null != n2 && e2.push(n2), e2._writableState.length) + throw new xn(); + if (e2._transformState.transforming) + throw new Cn(); + return e2.push(null); + } + Ve(Tn, An), Tn.prototype.push = function(e2, t2) { + return this._transformState.needTransform = false, An.prototype.push.call(this, e2, t2); + }, Tn.prototype._transform = function(e2, t2, n2) { + n2(new kn("_transform()")); + }, Tn.prototype._write = function(e2, t2, n2) { + var r2 = this._transformState; + if (r2.writecb = n2, r2.writechunk = e2, r2.writeencoding = t2, !r2.transforming) { + var i2 = this._readableState; + (r2.needTransform || i2.needReadable || i2.length < i2.highWaterMark) && this._read(i2.highWaterMark); + } + }, Tn.prototype._read = function(e2) { + var t2 = this._transformState; + null === t2.writechunk || t2.transforming ? t2.needTransform = true : (t2.transforming = true, this._transform(t2.writechunk, t2.writeencoding, t2.afterTransform)); + }, Tn.prototype._destroy = function(e2, t2) { + An.prototype._destroy.call(this, e2, function(e3) { + t2(e3); + }); + }; + var In, On = Dn, Nn = Sn; + function Dn(e2) { + if (!(this instanceof Dn)) + return new Dn(e2); + Nn.call(this, e2); + } + Ve(Dn, Nn), Dn.prototype._transform = function(e2, t2, n2) { + n2(null, e2); + }; + var jn = Vt.codes, Bn = jn.ERR_MISSING_ARGS, zn = jn.ERR_STREAM_DESTROYED; + function Un(e2) { + if (e2) + throw e2; + } + function Fn(e2) { + e2(); + } + function Kn(e2, t2) { + return e2.pipe(t2); + } + var qn = function() { + for (var e2 = arguments.length, t2 = new Array(e2), n2 = 0; n2 < e2; n2++) + t2[n2] = arguments[n2]; + var r2, i2 = function(e3) { + return e3.length ? "function" != typeof e3[e3.length - 1] ? Un : e3.pop() : Un; + }(t2); + if (Array.isArray(t2[0]) && (t2 = t2[0]), t2.length < 2) + throw new Bn("streams"); + var o2 = t2.map(function(e3, n3) { + var a2 = n3 < t2.length - 1; + return function(e4, t3, n4, r3) { + r3 = function(e5) { + var t4 = false; + return function() { + t4 || (t4 = true, e5.apply(void 0, arguments)); + }; + }(r3); + var i3 = false; + e4.on("close", function() { + i3 = true; + }), void 0 === In && (In = yn), In(e4, { readable: t3, writable: n4 }, function(e5) { + if (e5) + return r3(e5); + i3 = true, r3(); + }); + var o3 = false; + return function(t4) { + if (!i3 && !o3) + return o3 = true, function(e5) { + return e5.setHeader && "function" == typeof e5.abort; + }(e4) ? e4.abort() : "function" == typeof e4.destroy ? e4.destroy() : void r3(t4 || new zn("pipe")); + }; + }(e3, a2, n3 > 0, function(e4) { + r2 || (r2 = e4), e4 && o2.forEach(Fn), a2 || (o2.forEach(Fn), i2(r2)); + }); + }); + return t2.reduce(Kn); + }; + !function(e2, t2) { + (t2 = e2.exports = _n()).Stream = t2, t2.Readable = t2, t2.Writable = an(), t2.Duplex = sn(), t2.Transform = Sn, t2.PassThrough = On, t2.finished = yn, t2.pipeline = qn; + }(Ye, Ye.exports); + var Hn = Ye.exports, Wn = Ue().Buffer, $n = Hn.Transform; + function Vn(e2) { + $n.call(this), this._block = Wn.allocUnsafe(e2), this._blockSize = e2, this._blockOffset = 0, this._length = [0, 0, 0, 0], this._finalized = false; + } + Ve(Vn, $n), Vn.prototype._transform = function(e2, t2, n2) { + var r2 = null; + try { + this.update(e2, t2); + } catch (e3) { + r2 = e3; + } + n2(r2); + }, Vn.prototype._flush = function(e2) { + var t2 = null; + try { + this.push(this.digest()); + } catch (e3) { + t2 = e3; + } + e2(t2); + }, Vn.prototype.update = function(e2, t2) { + if (function(e3, t3) { + if (!Wn.isBuffer(e3) && "string" != typeof e3) + throw new TypeError(t3 + " must be a string or a buffer"); + }(e2, "Data"), this._finalized) + throw new Error("Digest already called"); + Wn.isBuffer(e2) || (e2 = Wn.from(e2, t2)); + for (var n2 = this._block, r2 = 0; this._blockOffset + e2.length - r2 >= this._blockSize; ) { + for (var i2 = this._blockOffset; i2 < this._blockSize; ) + n2[i2++] = e2[r2++]; + this._update(), this._blockOffset = 0; + } + for (; r2 < e2.length; ) + n2[this._blockOffset++] = e2[r2++]; + for (var o2 = 0, a2 = 8 * e2.length; a2 > 0; ++o2) + this._length[o2] += a2, (a2 = this._length[o2] / 4294967296 | 0) > 0 && (this._length[o2] -= 4294967296 * a2); + return this; + }, Vn.prototype._update = function() { + throw new Error("_update is not implemented"); + }, Vn.prototype.digest = function(e2) { + if (this._finalized) + throw new Error("Digest already called"); + this._finalized = true; + var t2 = this._digest(); + void 0 !== e2 && (t2 = t2.toString(e2)), this._block.fill(0), this._blockOffset = 0; + for (var n2 = 0; n2 < 4; ++n2) + this._length[n2] = 0; + return t2; + }, Vn.prototype._digest = function() { + throw new Error("_digest is not implemented"); + }; + var Yn = Vn, Gn = Ve, Zn = Yn, Qn = Ue().Buffer, Jn = new Array(16); + function Xn() { + Zn.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878; + } + function er(e2, t2) { + return e2 << t2 | e2 >>> 32 - t2; + } + function tr(e2, t2, n2, r2, i2, o2, a2) { + return er(e2 + (t2 & n2 | ~t2 & r2) + i2 + o2 | 0, a2) + t2 | 0; + } + function nr(e2, t2, n2, r2, i2, o2, a2) { + return er(e2 + (t2 & r2 | n2 & ~r2) + i2 + o2 | 0, a2) + t2 | 0; + } + function rr(e2, t2, n2, r2, i2, o2, a2) { + return er(e2 + (t2 ^ n2 ^ r2) + i2 + o2 | 0, a2) + t2 | 0; + } + function ir(e2, t2, n2, r2, i2, o2, a2) { + return er(e2 + (n2 ^ (t2 | ~r2)) + i2 + o2 | 0, a2) + t2 | 0; + } + Gn(Xn, Zn), Xn.prototype._update = function() { + for (var e2 = Jn, t2 = 0; t2 < 16; ++t2) + e2[t2] = this._block.readInt32LE(4 * t2); + var n2 = this._a, r2 = this._b, i2 = this._c, o2 = this._d; + n2 = tr(n2, r2, i2, o2, e2[0], 3614090360, 7), o2 = tr(o2, n2, r2, i2, e2[1], 3905402710, 12), i2 = tr(i2, o2, n2, r2, e2[2], 606105819, 17), r2 = tr(r2, i2, o2, n2, e2[3], 3250441966, 22), n2 = tr(n2, r2, i2, o2, e2[4], 4118548399, 7), o2 = tr(o2, n2, r2, i2, e2[5], 1200080426, 12), i2 = tr(i2, o2, n2, r2, e2[6], 2821735955, 17), r2 = tr(r2, i2, o2, n2, e2[7], 4249261313, 22), n2 = tr(n2, r2, i2, o2, e2[8], 1770035416, 7), o2 = tr(o2, n2, r2, i2, e2[9], 2336552879, 12), i2 = tr(i2, o2, n2, r2, e2[10], 4294925233, 17), r2 = tr(r2, i2, o2, n2, e2[11], 2304563134, 22), n2 = tr(n2, r2, i2, o2, e2[12], 1804603682, 7), o2 = tr(o2, n2, r2, i2, e2[13], 4254626195, 12), i2 = tr(i2, o2, n2, r2, e2[14], 2792965006, 17), n2 = nr(n2, r2 = tr(r2, i2, o2, n2, e2[15], 1236535329, 22), i2, o2, e2[1], 4129170786, 5), o2 = nr(o2, n2, r2, i2, e2[6], 3225465664, 9), i2 = nr(i2, o2, n2, r2, e2[11], 643717713, 14), r2 = nr(r2, i2, o2, n2, e2[0], 3921069994, 20), n2 = nr(n2, r2, i2, o2, e2[5], 3593408605, 5), o2 = nr(o2, n2, r2, i2, e2[10], 38016083, 9), i2 = nr(i2, o2, n2, r2, e2[15], 3634488961, 14), r2 = nr(r2, i2, o2, n2, e2[4], 3889429448, 20), n2 = nr(n2, r2, i2, o2, e2[9], 568446438, 5), o2 = nr(o2, n2, r2, i2, e2[14], 3275163606, 9), i2 = nr(i2, o2, n2, r2, e2[3], 4107603335, 14), r2 = nr(r2, i2, o2, n2, e2[8], 1163531501, 20), n2 = nr(n2, r2, i2, o2, e2[13], 2850285829, 5), o2 = nr(o2, n2, r2, i2, e2[2], 4243563512, 9), i2 = nr(i2, o2, n2, r2, e2[7], 1735328473, 14), n2 = rr(n2, r2 = nr(r2, i2, o2, n2, e2[12], 2368359562, 20), i2, o2, e2[5], 4294588738, 4), o2 = rr(o2, n2, r2, i2, e2[8], 2272392833, 11), i2 = rr(i2, o2, n2, r2, e2[11], 1839030562, 16), r2 = rr(r2, i2, o2, n2, e2[14], 4259657740, 23), n2 = rr(n2, r2, i2, o2, e2[1], 2763975236, 4), o2 = rr(o2, n2, r2, i2, e2[4], 1272893353, 11), i2 = rr(i2, o2, n2, r2, e2[7], 4139469664, 16), r2 = rr(r2, i2, o2, n2, e2[10], 3200236656, 23), n2 = rr(n2, r2, i2, o2, e2[13], 681279174, 4), o2 = rr(o2, n2, r2, i2, e2[0], 3936430074, 11), i2 = rr(i2, o2, n2, r2, e2[3], 3572445317, 16), r2 = rr(r2, i2, o2, n2, e2[6], 76029189, 23), n2 = rr(n2, r2, i2, o2, e2[9], 3654602809, 4), o2 = rr(o2, n2, r2, i2, e2[12], 3873151461, 11), i2 = rr(i2, o2, n2, r2, e2[15], 530742520, 16), n2 = ir(n2, r2 = rr(r2, i2, o2, n2, e2[2], 3299628645, 23), i2, o2, e2[0], 4096336452, 6), o2 = ir(o2, n2, r2, i2, e2[7], 1126891415, 10), i2 = ir(i2, o2, n2, r2, e2[14], 2878612391, 15), r2 = ir(r2, i2, o2, n2, e2[5], 4237533241, 21), n2 = ir(n2, r2, i2, o2, e2[12], 1700485571, 6), o2 = ir(o2, n2, r2, i2, e2[3], 2399980690, 10), i2 = ir(i2, o2, n2, r2, e2[10], 4293915773, 15), r2 = ir(r2, i2, o2, n2, e2[1], 2240044497, 21), n2 = ir(n2, r2, i2, o2, e2[8], 1873313359, 6), o2 = ir(o2, n2, r2, i2, e2[15], 4264355552, 10), i2 = ir(i2, o2, n2, r2, e2[6], 2734768916, 15), r2 = ir(r2, i2, o2, n2, e2[13], 1309151649, 21), n2 = ir(n2, r2, i2, o2, e2[4], 4149444226, 6), o2 = ir(o2, n2, r2, i2, e2[11], 3174756917, 10), i2 = ir(i2, o2, n2, r2, e2[2], 718787259, 15), r2 = ir(r2, i2, o2, n2, e2[9], 3951481745, 21), this._a = this._a + n2 | 0, this._b = this._b + r2 | 0, this._c = this._c + i2 | 0, this._d = this._d + o2 | 0; + }, Xn.prototype._digest = function() { + this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update(); + var e2 = Qn.allocUnsafe(16); + return e2.writeInt32LE(this._a, 0), e2.writeInt32LE(this._b, 4), e2.writeInt32LE(this._c, 8), e2.writeInt32LE(this._d, 12), e2; + }; + var or = Xn, ar = ce.Buffer, sr = Ve, ur = Yn, lr = new Array(16), cr = [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], dr = [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], fr = [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], hr = [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], pr = [0, 1518500249, 1859775393, 2400959708, 2840853838], mr = [1352829926, 1548603684, 1836072691, 2053994217, 0]; + function gr() { + ur.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520; + } + function vr(e2, t2) { + return e2 << t2 | e2 >>> 32 - t2; + } + function br(e2, t2, n2, r2, i2, o2, a2, s2) { + return vr(e2 + (t2 ^ n2 ^ r2) + o2 + a2 | 0, s2) + i2 | 0; + } + function yr(e2, t2, n2, r2, i2, o2, a2, s2) { + return vr(e2 + (t2 & n2 | ~t2 & r2) + o2 + a2 | 0, s2) + i2 | 0; + } + function wr(e2, t2, n2, r2, i2, o2, a2, s2) { + return vr(e2 + ((t2 | ~n2) ^ r2) + o2 + a2 | 0, s2) + i2 | 0; + } + function _r(e2, t2, n2, r2, i2, o2, a2, s2) { + return vr(e2 + (t2 & r2 | n2 & ~r2) + o2 + a2 | 0, s2) + i2 | 0; + } + function Sr(e2, t2, n2, r2, i2, o2, a2, s2) { + return vr(e2 + (t2 ^ (n2 | ~r2)) + o2 + a2 | 0, s2) + i2 | 0; + } + sr(gr, ur), gr.prototype._update = function() { + for (var e2 = lr, t2 = 0; t2 < 16; ++t2) + e2[t2] = this._block.readInt32LE(4 * t2); + for (var n2 = 0 | this._a, r2 = 0 | this._b, i2 = 0 | this._c, o2 = 0 | this._d, a2 = 0 | this._e, s2 = 0 | this._a, u2 = 0 | this._b, l2 = 0 | this._c, c2 = 0 | this._d, d2 = 0 | this._e, f2 = 0; f2 < 80; f2 += 1) { + var h2, p2; + f2 < 16 ? (h2 = br(n2, r2, i2, o2, a2, e2[cr[f2]], pr[0], fr[f2]), p2 = Sr(s2, u2, l2, c2, d2, e2[dr[f2]], mr[0], hr[f2])) : f2 < 32 ? (h2 = yr(n2, r2, i2, o2, a2, e2[cr[f2]], pr[1], fr[f2]), p2 = _r(s2, u2, l2, c2, d2, e2[dr[f2]], mr[1], hr[f2])) : f2 < 48 ? (h2 = wr(n2, r2, i2, o2, a2, e2[cr[f2]], pr[2], fr[f2]), p2 = wr(s2, u2, l2, c2, d2, e2[dr[f2]], mr[2], hr[f2])) : f2 < 64 ? (h2 = _r(n2, r2, i2, o2, a2, e2[cr[f2]], pr[3], fr[f2]), p2 = yr(s2, u2, l2, c2, d2, e2[dr[f2]], mr[3], hr[f2])) : (h2 = Sr(n2, r2, i2, o2, a2, e2[cr[f2]], pr[4], fr[f2]), p2 = br(s2, u2, l2, c2, d2, e2[dr[f2]], mr[4], hr[f2])), n2 = a2, a2 = o2, o2 = vr(i2, 10), i2 = r2, r2 = h2, s2 = d2, d2 = c2, c2 = vr(l2, 10), l2 = u2, u2 = p2; + } + var m2 = this._b + i2 + c2 | 0; + this._b = this._c + o2 + d2 | 0, this._c = this._d + a2 + s2 | 0, this._d = this._e + n2 + u2 | 0, this._e = this._a + r2 + l2 | 0, this._a = m2; + }, gr.prototype._digest = function() { + this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update(); + var e2 = ar.alloc ? ar.alloc(20) : new ar(20); + return e2.writeInt32LE(this._a, 0), e2.writeInt32LE(this._b, 4), e2.writeInt32LE(this._c, 8), e2.writeInt32LE(this._d, 12), e2.writeInt32LE(this._e, 16), e2; + }; + var Er = gr, kr = { exports: {} }, Mr = Ue().Buffer; + function Cr(e2, t2) { + this._block = Mr.alloc(e2), this._finalSize = t2, this._blockSize = e2, this._len = 0; + } + Cr.prototype.update = function(e2, t2) { + "string" == typeof e2 && (t2 = t2 || "utf8", e2 = Mr.from(e2, t2)); + for (var n2 = this._block, r2 = this._blockSize, i2 = e2.length, o2 = this._len, a2 = 0; a2 < i2; ) { + for (var s2 = o2 % r2, u2 = Math.min(i2 - a2, r2 - s2), l2 = 0; l2 < u2; l2++) + n2[s2 + l2] = e2[a2 + l2]; + a2 += u2, (o2 += u2) % r2 == 0 && this._update(n2); + } + return this._len += i2, this; + }, Cr.prototype.digest = function(e2) { + var t2 = this._len % this._blockSize; + this._block[t2] = 128, this._block.fill(0, t2 + 1), t2 >= this._finalSize && (this._update(this._block), this._block.fill(0)); + var n2 = 8 * this._len; + if (n2 <= 4294967295) + this._block.writeUInt32BE(n2, this._blockSize - 4); + else { + var r2 = (4294967295 & n2) >>> 0, i2 = (n2 - r2) / 4294967296; + this._block.writeUInt32BE(i2, this._blockSize - 8), this._block.writeUInt32BE(r2, this._blockSize - 4); + } + this._update(this._block); + var o2 = this._hash(); + return e2 ? o2.toString(e2) : o2; + }, Cr.prototype._update = function() { + throw new Error("_update must be implemented by subclass"); + }; + var xr = Cr, Ar = Ve, Rr = xr, Tr = Ue().Buffer, Pr = [1518500249, 1859775393, -1894007588, -899497514], Lr = new Array(80); + function Ir() { + this.init(), this._w = Lr, Rr.call(this, 64, 56); + } + function Or(e2) { + return e2 << 30 | e2 >>> 2; + } + function Nr(e2, t2, n2, r2) { + return 0 === e2 ? t2 & n2 | ~t2 & r2 : 2 === e2 ? t2 & n2 | t2 & r2 | n2 & r2 : t2 ^ n2 ^ r2; + } + Ar(Ir, Rr), Ir.prototype.init = function() { + return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this; + }, Ir.prototype._update = function(e2) { + for (var t2, n2 = this._w, r2 = 0 | this._a, i2 = 0 | this._b, o2 = 0 | this._c, a2 = 0 | this._d, s2 = 0 | this._e, u2 = 0; u2 < 16; ++u2) + n2[u2] = e2.readInt32BE(4 * u2); + for (; u2 < 80; ++u2) + n2[u2] = n2[u2 - 3] ^ n2[u2 - 8] ^ n2[u2 - 14] ^ n2[u2 - 16]; + for (var l2 = 0; l2 < 80; ++l2) { + var c2 = ~~(l2 / 20), d2 = 0 | ((t2 = r2) << 5 | t2 >>> 27) + Nr(c2, i2, o2, a2) + s2 + n2[l2] + Pr[c2]; + s2 = a2, a2 = o2, o2 = Or(i2), i2 = r2, r2 = d2; + } + this._a = r2 + this._a | 0, this._b = i2 + this._b | 0, this._c = o2 + this._c | 0, this._d = a2 + this._d | 0, this._e = s2 + this._e | 0; + }, Ir.prototype._hash = function() { + var e2 = Tr.allocUnsafe(20); + return e2.writeInt32BE(0 | this._a, 0), e2.writeInt32BE(0 | this._b, 4), e2.writeInt32BE(0 | this._c, 8), e2.writeInt32BE(0 | this._d, 12), e2.writeInt32BE(0 | this._e, 16), e2; + }; + var Dr = Ir, jr = Ve, Br = xr, zr = Ue().Buffer, Ur = [1518500249, 1859775393, -1894007588, -899497514], Fr = new Array(80); + function Kr() { + this.init(), this._w = Fr, Br.call(this, 64, 56); + } + function qr(e2) { + return e2 << 5 | e2 >>> 27; + } + function Hr(e2) { + return e2 << 30 | e2 >>> 2; + } + function Wr(e2, t2, n2, r2) { + return 0 === e2 ? t2 & n2 | ~t2 & r2 : 2 === e2 ? t2 & n2 | t2 & r2 | n2 & r2 : t2 ^ n2 ^ r2; + } + jr(Kr, Br), Kr.prototype.init = function() { + return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this; + }, Kr.prototype._update = function(e2) { + for (var t2, n2 = this._w, r2 = 0 | this._a, i2 = 0 | this._b, o2 = 0 | this._c, a2 = 0 | this._d, s2 = 0 | this._e, u2 = 0; u2 < 16; ++u2) + n2[u2] = e2.readInt32BE(4 * u2); + for (; u2 < 80; ++u2) + n2[u2] = (t2 = n2[u2 - 3] ^ n2[u2 - 8] ^ n2[u2 - 14] ^ n2[u2 - 16]) << 1 | t2 >>> 31; + for (var l2 = 0; l2 < 80; ++l2) { + var c2 = ~~(l2 / 20), d2 = qr(r2) + Wr(c2, i2, o2, a2) + s2 + n2[l2] + Ur[c2] | 0; + s2 = a2, a2 = o2, o2 = Hr(i2), i2 = r2, r2 = d2; + } + this._a = r2 + this._a | 0, this._b = i2 + this._b | 0, this._c = o2 + this._c | 0, this._d = a2 + this._d | 0, this._e = s2 + this._e | 0; + }, Kr.prototype._hash = function() { + var e2 = zr.allocUnsafe(20); + return e2.writeInt32BE(0 | this._a, 0), e2.writeInt32BE(0 | this._b, 4), e2.writeInt32BE(0 | this._c, 8), e2.writeInt32BE(0 | this._d, 12), e2.writeInt32BE(0 | this._e, 16), e2; + }; + var $r = Kr, Vr = Ve, Yr = xr, Gr = Ue().Buffer, Zr = [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], Qr = new Array(64); + function Jr() { + this.init(), this._w = Qr, Yr.call(this, 64, 56); + } + function Xr(e2, t2, n2) { + return n2 ^ e2 & (t2 ^ n2); + } + function ei(e2, t2, n2) { + return e2 & t2 | n2 & (e2 | t2); + } + function ti(e2) { + return (e2 >>> 2 | e2 << 30) ^ (e2 >>> 13 | e2 << 19) ^ (e2 >>> 22 | e2 << 10); + } + function ni(e2) { + return (e2 >>> 6 | e2 << 26) ^ (e2 >>> 11 | e2 << 21) ^ (e2 >>> 25 | e2 << 7); + } + function ri(e2) { + return (e2 >>> 7 | e2 << 25) ^ (e2 >>> 18 | e2 << 14) ^ e2 >>> 3; + } + function ii(e2) { + return (e2 >>> 17 | e2 << 15) ^ (e2 >>> 19 | e2 << 13) ^ e2 >>> 10; + } + Vr(Jr, Yr), Jr.prototype.init = function() { + return this._a = 1779033703, this._b = 3144134277, this._c = 1013904242, this._d = 2773480762, this._e = 1359893119, this._f = 2600822924, this._g = 528734635, this._h = 1541459225, this; + }, Jr.prototype._update = function(e2) { + for (var t2 = this._w, n2 = 0 | this._a, r2 = 0 | this._b, i2 = 0 | this._c, o2 = 0 | this._d, a2 = 0 | this._e, s2 = 0 | this._f, u2 = 0 | this._g, l2 = 0 | this._h, c2 = 0; c2 < 16; ++c2) + t2[c2] = e2.readInt32BE(4 * c2); + for (; c2 < 64; ++c2) + t2[c2] = ii(t2[c2 - 2]) + t2[c2 - 7] + ri(t2[c2 - 15]) + t2[c2 - 16] | 0; + for (var d2 = 0; d2 < 64; ++d2) { + var f2 = l2 + ni(a2) + Xr(a2, s2, u2) + Zr[d2] + t2[d2] | 0, h2 = ti(n2) + ei(n2, r2, i2) | 0; + l2 = u2, u2 = s2, s2 = a2, a2 = o2 + f2 | 0, o2 = i2, i2 = r2, r2 = n2, n2 = f2 + h2 | 0; + } + this._a = n2 + this._a | 0, this._b = r2 + this._b | 0, this._c = i2 + this._c | 0, this._d = o2 + this._d | 0, this._e = a2 + this._e | 0, this._f = s2 + this._f | 0, this._g = u2 + this._g | 0, this._h = l2 + this._h | 0; + }, Jr.prototype._hash = function() { + var e2 = Gr.allocUnsafe(32); + return e2.writeInt32BE(this._a, 0), e2.writeInt32BE(this._b, 4), e2.writeInt32BE(this._c, 8), e2.writeInt32BE(this._d, 12), e2.writeInt32BE(this._e, 16), e2.writeInt32BE(this._f, 20), e2.writeInt32BE(this._g, 24), e2.writeInt32BE(this._h, 28), e2; + }; + var oi = Jr, ai = Ve, si = oi, ui = xr, li = Ue().Buffer, ci = new Array(64); + function di() { + this.init(), this._w = ci, ui.call(this, 64, 56); + } + ai(di, si), di.prototype.init = function() { + return this._a = 3238371032, this._b = 914150663, this._c = 812702999, this._d = 4144912697, this._e = 4290775857, this._f = 1750603025, this._g = 1694076839, this._h = 3204075428, this; + }, di.prototype._hash = function() { + var e2 = li.allocUnsafe(28); + return e2.writeInt32BE(this._a, 0), e2.writeInt32BE(this._b, 4), e2.writeInt32BE(this._c, 8), e2.writeInt32BE(this._d, 12), e2.writeInt32BE(this._e, 16), e2.writeInt32BE(this._f, 20), e2.writeInt32BE(this._g, 24), e2; + }; + var fi = di, hi = Ve, pi = xr, mi = Ue().Buffer, gi = [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], vi = new Array(160); + function bi() { + this.init(), this._w = vi, pi.call(this, 128, 112); + } + function yi(e2, t2, n2) { + return n2 ^ e2 & (t2 ^ n2); + } + function wi(e2, t2, n2) { + return e2 & t2 | n2 & (e2 | t2); + } + function _i(e2, t2) { + return (e2 >>> 28 | t2 << 4) ^ (t2 >>> 2 | e2 << 30) ^ (t2 >>> 7 | e2 << 25); + } + function Si(e2, t2) { + return (e2 >>> 14 | t2 << 18) ^ (e2 >>> 18 | t2 << 14) ^ (t2 >>> 9 | e2 << 23); + } + function Ei(e2, t2) { + return (e2 >>> 1 | t2 << 31) ^ (e2 >>> 8 | t2 << 24) ^ e2 >>> 7; + } + function ki(e2, t2) { + return (e2 >>> 1 | t2 << 31) ^ (e2 >>> 8 | t2 << 24) ^ (e2 >>> 7 | t2 << 25); + } + function Mi(e2, t2) { + return (e2 >>> 19 | t2 << 13) ^ (t2 >>> 29 | e2 << 3) ^ e2 >>> 6; + } + function Ci(e2, t2) { + return (e2 >>> 19 | t2 << 13) ^ (t2 >>> 29 | e2 << 3) ^ (e2 >>> 6 | t2 << 26); + } + function xi(e2, t2) { + return e2 >>> 0 < t2 >>> 0 ? 1 : 0; + } + hi(bi, pi), bi.prototype.init = function() { + return this._ah = 1779033703, this._bh = 3144134277, this._ch = 1013904242, this._dh = 2773480762, this._eh = 1359893119, this._fh = 2600822924, this._gh = 528734635, this._hh = 1541459225, this._al = 4089235720, this._bl = 2227873595, this._cl = 4271175723, this._dl = 1595750129, this._el = 2917565137, this._fl = 725511199, this._gl = 4215389547, this._hl = 327033209, this; + }, bi.prototype._update = function(e2) { + for (var t2 = this._w, n2 = 0 | this._ah, r2 = 0 | this._bh, i2 = 0 | this._ch, o2 = 0 | this._dh, a2 = 0 | this._eh, s2 = 0 | this._fh, u2 = 0 | this._gh, l2 = 0 | this._hh, c2 = 0 | this._al, d2 = 0 | this._bl, f2 = 0 | this._cl, h2 = 0 | this._dl, p2 = 0 | this._el, m2 = 0 | this._fl, g2 = 0 | this._gl, v2 = 0 | this._hl, b2 = 0; b2 < 32; b2 += 2) + t2[b2] = e2.readInt32BE(4 * b2), t2[b2 + 1] = e2.readInt32BE(4 * b2 + 4); + for (; b2 < 160; b2 += 2) { + var y2 = t2[b2 - 30], w2 = t2[b2 - 30 + 1], _2 = Ei(y2, w2), S2 = ki(w2, y2), E2 = Mi(y2 = t2[b2 - 4], w2 = t2[b2 - 4 + 1]), k2 = Ci(w2, y2), M2 = t2[b2 - 14], C2 = t2[b2 - 14 + 1], x2 = t2[b2 - 32], A2 = t2[b2 - 32 + 1], R2 = S2 + C2 | 0, T2 = _2 + M2 + xi(R2, S2) | 0; + T2 = (T2 = T2 + E2 + xi(R2 = R2 + k2 | 0, k2) | 0) + x2 + xi(R2 = R2 + A2 | 0, A2) | 0, t2[b2] = T2, t2[b2 + 1] = R2; + } + for (var P2 = 0; P2 < 160; P2 += 2) { + T2 = t2[P2], R2 = t2[P2 + 1]; + var L2 = wi(n2, r2, i2), I2 = wi(c2, d2, f2), O2 = _i(n2, c2), N2 = _i(c2, n2), D2 = Si(a2, p2), j2 = Si(p2, a2), B2 = gi[P2], z2 = gi[P2 + 1], U2 = yi(a2, s2, u2), F2 = yi(p2, m2, g2), K2 = v2 + j2 | 0, q2 = l2 + D2 + xi(K2, v2) | 0; + q2 = (q2 = (q2 = q2 + U2 + xi(K2 = K2 + F2 | 0, F2) | 0) + B2 + xi(K2 = K2 + z2 | 0, z2) | 0) + T2 + xi(K2 = K2 + R2 | 0, R2) | 0; + var H2 = N2 + I2 | 0, W2 = O2 + L2 + xi(H2, N2) | 0; + l2 = u2, v2 = g2, u2 = s2, g2 = m2, s2 = a2, m2 = p2, a2 = o2 + q2 + xi(p2 = h2 + K2 | 0, h2) | 0, o2 = i2, h2 = f2, i2 = r2, f2 = d2, r2 = n2, d2 = c2, n2 = q2 + W2 + xi(c2 = K2 + H2 | 0, K2) | 0; + } + this._al = this._al + c2 | 0, this._bl = this._bl + d2 | 0, this._cl = this._cl + f2 | 0, this._dl = this._dl + h2 | 0, this._el = this._el + p2 | 0, this._fl = this._fl + m2 | 0, this._gl = this._gl + g2 | 0, this._hl = this._hl + v2 | 0, this._ah = this._ah + n2 + xi(this._al, c2) | 0, this._bh = this._bh + r2 + xi(this._bl, d2) | 0, this._ch = this._ch + i2 + xi(this._cl, f2) | 0, this._dh = this._dh + o2 + xi(this._dl, h2) | 0, this._eh = this._eh + a2 + xi(this._el, p2) | 0, this._fh = this._fh + s2 + xi(this._fl, m2) | 0, this._gh = this._gh + u2 + xi(this._gl, g2) | 0, this._hh = this._hh + l2 + xi(this._hl, v2) | 0; + }, bi.prototype._hash = function() { + var e2 = mi.allocUnsafe(64); + function t2(t3, n2, r2) { + e2.writeInt32BE(t3, r2), e2.writeInt32BE(n2, r2 + 4); + } + return t2(this._ah, this._al, 0), t2(this._bh, this._bl, 8), t2(this._ch, this._cl, 16), t2(this._dh, this._dl, 24), t2(this._eh, this._el, 32), t2(this._fh, this._fl, 40), t2(this._gh, this._gl, 48), t2(this._hh, this._hl, 56), e2; + }; + var Ai = bi, Ri = Ve, Ti = Ai, Pi = xr, Li = Ue().Buffer, Ii = new Array(160); + function Oi() { + this.init(), this._w = Ii, Pi.call(this, 128, 112); + } + Ri(Oi, Ti), Oi.prototype.init = function() { + return this._ah = 3418070365, this._bh = 1654270250, this._ch = 2438529370, this._dh = 355462360, this._eh = 1731405415, this._fh = 2394180231, this._gh = 3675008525, this._hh = 1203062813, this._al = 3238371032, this._bl = 914150663, this._cl = 812702999, this._dl = 4144912697, this._el = 4290775857, this._fl = 1750603025, this._gl = 1694076839, this._hl = 3204075428, this; + }, Oi.prototype._hash = function() { + var e2 = Li.allocUnsafe(48); + function t2(t3, n2, r2) { + e2.writeInt32BE(t3, r2), e2.writeInt32BE(n2, r2 + 4); + } + return t2(this._ah, this._al, 0), t2(this._bh, this._bl, 8), t2(this._ch, this._cl, 16), t2(this._dh, this._dl, 24), t2(this._eh, this._el, 32), t2(this._fh, this._fl, 40), e2; + }; + var Ni = Oi, Di = kr.exports = function(e2) { + e2 = e2.toLowerCase(); + var t2 = Di[e2]; + if (!t2) + throw new Error(e2 + " is not supported (we accept pull requests)"); + return new t2(); + }; + Di.sha = Dr, Di.sha1 = $r, Di.sha224 = fi, Di.sha256 = oi, Di.sha384 = Ni, Di.sha512 = Ai; + var ji = kr.exports; + function Bi() { + this.head = null, this.tail = null, this.length = 0; + } + Bi.prototype.push = function(e2) { + var t2 = { data: e2, next: null }; + this.length > 0 ? this.tail.next = t2 : this.head = t2, this.tail = t2, ++this.length; + }, Bi.prototype.unshift = function(e2) { + var t2 = { data: e2, next: this.head }; + 0 === this.length && (this.tail = t2), this.head = t2, ++this.length; + }, Bi.prototype.shift = function() { + if (0 !== this.length) { + var e2 = this.head.data; + return 1 === this.length ? this.head = this.tail = null : this.head = this.head.next, --this.length, e2; + } + }, Bi.prototype.clear = function() { + this.head = this.tail = null, this.length = 0; + }, Bi.prototype.join = function(e2) { + if (0 === this.length) + return ""; + for (var t2 = this.head, n2 = "" + t2.data; t2 = t2.next; ) + n2 += e2 + t2.data; + return n2; + }, Bi.prototype.concat = function(e2) { + if (0 === this.length) + return _.alloc(0); + if (1 === this.length) + return this.head.data; + for (var t2 = _.allocUnsafe(e2 >>> 0), n2 = this.head, r2 = 0; n2; ) + n2.data.copy(t2, r2), r2 += n2.data.length, n2 = n2.next; + return t2; + }; + var zi = _.isEncoding || function(e2) { + switch (e2 && e2.toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + case "raw": + return true; + default: + return false; + } + }; + function Ui(e2) { + switch (this.encoding = (e2 || "utf8").toLowerCase().replace(/[-_]/, ""), function(e3) { + if (e3 && !zi(e3)) + throw new Error("Unknown encoding: " + e3); + }(e2), this.encoding) { + case "utf8": + this.surrogateSize = 3; + break; + case "ucs2": + case "utf16le": + this.surrogateSize = 2, this.detectIncompleteChar = Ki; + break; + case "base64": + this.surrogateSize = 3, this.detectIncompleteChar = qi; + break; + default: + return void (this.write = Fi); + } + this.charBuffer = new _(6), this.charReceived = 0, this.charLength = 0; + } + function Fi(e2) { + return e2.toString(this.encoding); + } + function Ki(e2) { + this.charReceived = e2.length % 2, this.charLength = this.charReceived ? 2 : 0; + } + function qi(e2) { + this.charReceived = e2.length % 3, this.charLength = this.charReceived ? 3 : 0; + } + Ui.prototype.write = function(e2) { + for (var t2 = ""; this.charLength; ) { + var n2 = e2.length >= this.charLength - this.charReceived ? this.charLength - this.charReceived : e2.length; + if (e2.copy(this.charBuffer, this.charReceived, 0, n2), this.charReceived += n2, this.charReceived < this.charLength) + return ""; + if (e2 = e2.slice(n2, e2.length), !((i2 = (t2 = this.charBuffer.slice(0, this.charLength).toString(this.encoding)).charCodeAt(t2.length - 1)) >= 55296 && i2 <= 56319)) { + if (this.charReceived = this.charLength = 0, 0 === e2.length) + return t2; + break; + } + this.charLength += this.surrogateSize, t2 = ""; + } + this.detectIncompleteChar(e2); + var r2 = e2.length; + this.charLength && (e2.copy(this.charBuffer, 0, e2.length - this.charReceived, r2), r2 -= this.charReceived); + var i2; + r2 = (t2 += e2.toString(this.encoding, 0, r2)).length - 1; + if ((i2 = t2.charCodeAt(r2)) >= 55296 && i2 <= 56319) { + var o2 = this.surrogateSize; + return this.charLength += o2, this.charReceived += o2, this.charBuffer.copy(this.charBuffer, o2, 0, o2), e2.copy(this.charBuffer, 0, 0, o2), t2.substring(0, r2); + } + return t2; + }, Ui.prototype.detectIncompleteChar = function(e2) { + for (var t2 = e2.length >= 3 ? 3 : e2.length; t2 > 0; t2--) { + var n2 = e2[e2.length - t2]; + if (1 == t2 && n2 >> 5 == 6) { + this.charLength = 2; + break; + } + if (t2 <= 2 && n2 >> 4 == 14) { + this.charLength = 3; + break; + } + if (t2 <= 3 && n2 >> 3 == 30) { + this.charLength = 4; + break; + } + } + this.charReceived = t2; + }, Ui.prototype.end = function(e2) { + var t2 = ""; + if (e2 && e2.length && (t2 = this.write(e2)), this.charReceived) { + var n2 = this.charReceived, r2 = this.charBuffer, i2 = this.encoding; + t2 += r2.slice(0, n2).toString(i2); + } + return t2; + }; + var Hi = Object.freeze({ __proto__: null, StringDecoder: Ui }); + Vi.ReadableState = $i; + var Wi = ct("stream"); + function $i(e2, t2) { + e2 = e2 || {}, this.objectMode = !!e2.objectMode, t2 instanceof So && (this.objectMode = this.objectMode || !!e2.readableObjectMode); + var n2 = e2.highWaterMark, r2 = this.objectMode ? 16 : 16384; + this.highWaterMark = n2 || 0 === n2 ? n2 : r2, this.highWaterMark = ~~this.highWaterMark, this.buffer = new Bi(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = false, this.endEmitted = false, this.reading = false, this.sync = true, this.needReadable = false, this.emittedReadable = false, this.readableListening = false, this.resumeScheduled = false, this.defaultEncoding = e2.defaultEncoding || "utf8", this.ranOut = false, this.awaitDrain = 0, this.readingMore = false, this.decoder = null, this.encoding = null, e2.encoding && (this.decoder = new Ui(e2.encoding), this.encoding = e2.encoding); + } + function Vi(e2) { + if (!(this instanceof Vi)) + return new Vi(e2); + this._readableState = new $i(e2, this), this.readable = true, e2 && "function" == typeof e2.read && (this._read = e2.read), Ze.call(this); + } + function Yi(e2, t2, n2, r2, i2) { + var o2 = function(e3, t3) { + var n3 = null; + ie(t3) || "string" == typeof t3 || null == t3 || e3.objectMode || (n3 = new TypeError("Invalid non-string/buffer chunk")); + return n3; + }(t2, n2); + if (o2) + e2.emit("error", o2); + else if (null === n2) + t2.reading = false, function(e3, t3) { + if (t3.ended) + return; + if (t3.decoder) { + var n3 = t3.decoder.end(); + n3 && n3.length && (t3.buffer.push(n3), t3.length += t3.objectMode ? 1 : n3.length); + } + t3.ended = true, Qi(e3); + }(e2, t2); + else if (t2.objectMode || n2 && n2.length > 0) + if (t2.ended && !i2) { + var a2 = new Error("stream.push() after EOF"); + e2.emit("error", a2); + } else if (t2.endEmitted && i2) { + var s2 = new Error("stream.unshift() after end event"); + e2.emit("error", s2); + } else { + var u2; + !t2.decoder || i2 || r2 || (n2 = t2.decoder.write(n2), u2 = !t2.objectMode && 0 === n2.length), i2 || (t2.reading = false), u2 || (t2.flowing && 0 === t2.length && !t2.sync ? (e2.emit("data", n2), e2.read(0)) : (t2.length += t2.objectMode ? 1 : n2.length, i2 ? t2.buffer.unshift(n2) : t2.buffer.push(n2), t2.needReadable && Qi(e2))), function(e3, t3) { + t3.readingMore || (t3.readingMore = true, Ee(Xi, e3, t3)); + }(e2, t2); + } + else + i2 || (t2.reading = false); + return function(e3) { + return !e3.ended && (e3.needReadable || e3.length < e3.highWaterMark || 0 === e3.length); + }(t2); + } + it(Vi, Ze), Vi.prototype.push = function(e2, t2) { + var n2 = this._readableState; + return n2.objectMode || "string" != typeof e2 || (t2 = t2 || n2.defaultEncoding) !== n2.encoding && (e2 = _.from(e2, t2), t2 = ""), Yi(this, n2, e2, t2, false); + }, Vi.prototype.unshift = function(e2) { + return Yi(this, this._readableState, e2, "", true); + }, Vi.prototype.isPaused = function() { + return false === this._readableState.flowing; + }, Vi.prototype.setEncoding = function(e2) { + return this._readableState.decoder = new Ui(e2), this._readableState.encoding = e2, this; + }; + var Gi = 8388608; + function Zi(e2, t2) { + return e2 <= 0 || 0 === t2.length && t2.ended ? 0 : t2.objectMode ? 1 : e2 != e2 ? t2.flowing && t2.length ? t2.buffer.head.data.length : t2.length : (e2 > t2.highWaterMark && (t2.highWaterMark = function(e3) { + return e3 >= Gi ? e3 = Gi : (e3--, e3 |= e3 >>> 1, e3 |= e3 >>> 2, e3 |= e3 >>> 4, e3 |= e3 >>> 8, e3 |= e3 >>> 16, e3++), e3; + }(e2)), e2 <= t2.length ? e2 : t2.ended ? t2.length : (t2.needReadable = true, 0)); + } + function Qi(e2) { + var t2 = e2._readableState; + t2.needReadable = false, t2.emittedReadable || (Wi("emitReadable", t2.flowing), t2.emittedReadable = true, t2.sync ? Ee(Ji, e2) : Ji(e2)); + } + function Ji(e2) { + Wi("emit readable"), e2.emit("readable"), no(e2); + } + function Xi(e2, t2) { + for (var n2 = t2.length; !t2.reading && !t2.flowing && !t2.ended && t2.length < t2.highWaterMark && (Wi("maybeReadMore read 0"), e2.read(0), n2 !== t2.length); ) + n2 = t2.length; + t2.readingMore = false; + } + function eo(e2) { + Wi("readable nexttick read 0"), e2.read(0); + } + function to(e2, t2) { + t2.reading || (Wi("resume read 0"), e2.read(0)), t2.resumeScheduled = false, t2.awaitDrain = 0, e2.emit("resume"), no(e2), t2.flowing && !t2.reading && e2.read(0); + } + function no(e2) { + var t2 = e2._readableState; + for (Wi("flow", t2.flowing); t2.flowing && null !== e2.read(); ) + ; + } + function ro(e2, t2) { + return 0 === t2.length ? null : (t2.objectMode ? n2 = t2.buffer.shift() : !e2 || e2 >= t2.length ? (n2 = t2.decoder ? t2.buffer.join("") : 1 === t2.buffer.length ? t2.buffer.head.data : t2.buffer.concat(t2.length), t2.buffer.clear()) : n2 = function(e3, t3, n3) { + var r2; + e3 < t3.head.data.length ? (r2 = t3.head.data.slice(0, e3), t3.head.data = t3.head.data.slice(e3)) : r2 = e3 === t3.head.data.length ? t3.shift() : n3 ? function(e4, t4) { + var n4 = t4.head, r3 = 1, i2 = n4.data; + e4 -= i2.length; + for (; n4 = n4.next; ) { + var o2 = n4.data, a2 = e4 > o2.length ? o2.length : e4; + if (a2 === o2.length ? i2 += o2 : i2 += o2.slice(0, e4), 0 === (e4 -= a2)) { + a2 === o2.length ? (++r3, n4.next ? t4.head = n4.next : t4.head = t4.tail = null) : (t4.head = n4, n4.data = o2.slice(a2)); + break; + } + ++r3; + } + return t4.length -= r3, i2; + }(e3, t3) : function(e4, t4) { + var n4 = _.allocUnsafe(e4), r3 = t4.head, i2 = 1; + r3.data.copy(n4), e4 -= r3.data.length; + for (; r3 = r3.next; ) { + var o2 = r3.data, a2 = e4 > o2.length ? o2.length : e4; + if (o2.copy(n4, n4.length - e4, 0, a2), 0 === (e4 -= a2)) { + a2 === o2.length ? (++i2, r3.next ? t4.head = r3.next : t4.head = t4.tail = null) : (t4.head = r3, r3.data = o2.slice(a2)); + break; + } + ++i2; + } + return t4.length -= i2, n4; + }(e3, t3); + return r2; + }(e2, t2.buffer, t2.decoder), n2); + var n2; + } + function io(e2) { + var t2 = e2._readableState; + if (t2.length > 0) + throw new Error('"endReadable()" called on non-empty stream'); + t2.endEmitted || (t2.ended = true, Ee(oo, t2, e2)); + } + function oo(e2, t2) { + e2.endEmitted || 0 !== e2.length || (e2.endEmitted = true, t2.readable = false, t2.emit("end")); + } + function ao(e2, t2) { + for (var n2 = 0, r2 = e2.length; n2 < r2; n2++) + if (e2[n2] === t2) + return n2; + return -1; + } + function so() { + } + function uo(e2, t2, n2) { + this.chunk = e2, this.encoding = t2, this.callback = n2, this.next = null; + } + function lo(e2, t2) { + Object.defineProperty(this, "buffer", { get: st(function() { + return this.getBuffer(); + }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.") }), e2 = e2 || {}, this.objectMode = !!e2.objectMode, t2 instanceof So && (this.objectMode = this.objectMode || !!e2.writableObjectMode); + var n2 = e2.highWaterMark, r2 = this.objectMode ? 16 : 16384; + this.highWaterMark = n2 || 0 === n2 ? n2 : r2, this.highWaterMark = ~~this.highWaterMark, this.needDrain = false, this.ending = false, this.ended = false, this.finished = false; + var i2 = false === e2.decodeStrings; + this.decodeStrings = !i2, this.defaultEncoding = e2.defaultEncoding || "utf8", this.length = 0, this.writing = false, this.corked = 0, this.sync = true, this.bufferProcessing = false, this.onwrite = function(e3) { + !function(e4, t3) { + var n3 = e4._writableState, r3 = n3.sync, i3 = n3.writecb; + if (function(e5) { + e5.writing = false, e5.writecb = null, e5.length -= e5.writelen, e5.writelen = 0; + }(n3), t3) + !function(e5, t4, n4, r4, i4) { + --t4.pendingcb, n4 ? Ee(i4, r4) : i4(r4); + e5._writableState.errorEmitted = true, e5.emit("error", r4); + }(e4, n3, r3, t3, i3); + else { + var o2 = mo(n3); + o2 || n3.corked || n3.bufferProcessing || !n3.bufferedRequest || po(e4, n3), r3 ? Ee(ho, e4, n3, o2, i3) : ho(e4, n3, o2, i3); + } + }(t2, e3); + }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = false, this.errorEmitted = false, this.bufferedRequestCount = 0, this.corkedRequestsFree = new bo(this); + } + function co(e2) { + if (!(this instanceof co || this instanceof So)) + return new co(e2); + this._writableState = new lo(e2, this), this.writable = true, e2 && ("function" == typeof e2.write && (this._write = e2.write), "function" == typeof e2.writev && (this._writev = e2.writev)), Ze.call(this); + } + function fo(e2, t2, n2, r2, i2, o2, a2) { + t2.writelen = r2, t2.writecb = a2, t2.writing = true, t2.sync = true, n2 ? e2._writev(i2, t2.onwrite) : e2._write(i2, o2, t2.onwrite), t2.sync = false; + } + function ho(e2, t2, n2, r2) { + n2 || function(e3, t3) { + 0 === t3.length && t3.needDrain && (t3.needDrain = false, e3.emit("drain")); + }(e2, t2), t2.pendingcb--, r2(), vo(e2, t2); + } + function po(e2, t2) { + t2.bufferProcessing = true; + var n2 = t2.bufferedRequest; + if (e2._writev && n2 && n2.next) { + var r2 = t2.bufferedRequestCount, i2 = new Array(r2), o2 = t2.corkedRequestsFree; + o2.entry = n2; + for (var a2 = 0; n2; ) + i2[a2] = n2, n2 = n2.next, a2 += 1; + fo(e2, t2, true, t2.length, i2, "", o2.finish), t2.pendingcb++, t2.lastBufferedRequest = null, o2.next ? (t2.corkedRequestsFree = o2.next, o2.next = null) : t2.corkedRequestsFree = new bo(t2); + } else { + for (; n2; ) { + var s2 = n2.chunk, u2 = n2.encoding, l2 = n2.callback; + if (fo(e2, t2, false, t2.objectMode ? 1 : s2.length, s2, u2, l2), n2 = n2.next, t2.writing) + break; + } + null === n2 && (t2.lastBufferedRequest = null); + } + t2.bufferedRequestCount = 0, t2.bufferedRequest = n2, t2.bufferProcessing = false; + } + function mo(e2) { + return e2.ending && 0 === e2.length && null === e2.bufferedRequest && !e2.finished && !e2.writing; + } + function go(e2, t2) { + t2.prefinished || (t2.prefinished = true, e2.emit("prefinish")); + } + function vo(e2, t2) { + var n2 = mo(t2); + return n2 && (0 === t2.pendingcb ? (go(e2, t2), t2.finished = true, e2.emit("finish")) : go(e2, t2)), n2; + } + function bo(e2) { + var t2 = this; + this.next = null, this.entry = null, this.finish = function(n2) { + var r2 = t2.entry; + for (t2.entry = null; r2; ) { + var i2 = r2.callback; + e2.pendingcb--, i2(n2), r2 = r2.next; + } + e2.corkedRequestsFree ? e2.corkedRequestsFree.next = t2 : e2.corkedRequestsFree = t2; + }; + } + Vi.prototype.read = function(e2) { + Wi("read", e2), e2 = parseInt(e2, 10); + var t2 = this._readableState, n2 = e2; + if (0 !== e2 && (t2.emittedReadable = false), 0 === e2 && t2.needReadable && (t2.length >= t2.highWaterMark || t2.ended)) + return Wi("read: emitReadable", t2.length, t2.ended), 0 === t2.length && t2.ended ? io(this) : Qi(this), null; + if (0 === (e2 = Zi(e2, t2)) && t2.ended) + return 0 === t2.length && io(this), null; + var r2, i2 = t2.needReadable; + return Wi("need readable", i2), (0 === t2.length || t2.length - e2 < t2.highWaterMark) && Wi("length less than watermark", i2 = true), t2.ended || t2.reading ? Wi("reading or ended", i2 = false) : i2 && (Wi("do read"), t2.reading = true, t2.sync = true, 0 === t2.length && (t2.needReadable = true), this._read(t2.highWaterMark), t2.sync = false, t2.reading || (e2 = Zi(n2, t2))), null === (r2 = e2 > 0 ? ro(e2, t2) : null) ? (t2.needReadable = true, e2 = 0) : t2.length -= e2, 0 === t2.length && (t2.ended || (t2.needReadable = true), n2 !== e2 && t2.ended && io(this)), null !== r2 && this.emit("data", r2), r2; + }, Vi.prototype._read = function(e2) { + this.emit("error", new Error("not implemented")); + }, Vi.prototype.pipe = function(e2, t2) { + var n2 = this, r2 = this._readableState; + switch (r2.pipesCount) { + case 0: + r2.pipes = e2; + break; + case 1: + r2.pipes = [r2.pipes, e2]; + break; + default: + r2.pipes.push(e2); + } + r2.pipesCount += 1, Wi("pipe count=%d opts=%j", r2.pipesCount, t2); + var i2 = !t2 || false !== t2.end ? a2 : l2; + function o2(e3) { + Wi("onunpipe"), e3 === n2 && l2(); + } + function a2() { + Wi("onend"), e2.end(); + } + r2.endEmitted ? Ee(i2) : n2.once("end", i2), e2.on("unpipe", o2); + var s2 = function(e3) { + return function() { + var t3 = e3._readableState; + Wi("pipeOnDrain", t3.awaitDrain), t3.awaitDrain && t3.awaitDrain--, 0 === t3.awaitDrain && e3.listeners("data").length && (t3.flowing = true, no(e3)); + }; + }(n2); + e2.on("drain", s2); + var u2 = false; + function l2() { + Wi("cleanup"), e2.removeListener("close", h2), e2.removeListener("finish", p2), e2.removeListener("drain", s2), e2.removeListener("error", f2), e2.removeListener("unpipe", o2), n2.removeListener("end", a2), n2.removeListener("end", l2), n2.removeListener("data", d2), u2 = true, !r2.awaitDrain || e2._writableState && !e2._writableState.needDrain || s2(); + } + var c2 = false; + function d2(t3) { + Wi("ondata"), c2 = false, false !== e2.write(t3) || c2 || ((1 === r2.pipesCount && r2.pipes === e2 || r2.pipesCount > 1 && -1 !== ao(r2.pipes, e2)) && !u2 && (Wi("false write response, pause", n2._readableState.awaitDrain), n2._readableState.awaitDrain++, c2 = true), n2.pause()); + } + function f2(t3) { + var n3; + Wi("onerror", t3), m2(), e2.removeListener("error", f2), 0 === (n3 = "error", e2.listeners(n3).length) && e2.emit("error", t3); + } + function h2() { + e2.removeListener("finish", p2), m2(); + } + function p2() { + Wi("onfinish"), e2.removeListener("close", h2), m2(); + } + function m2() { + Wi("unpipe"), n2.unpipe(e2); + } + return n2.on("data", d2), function(e3, t3, n3) { + if ("function" == typeof e3.prependListener) + return e3.prependListener(t3, n3); + e3._events && e3._events[t3] ? Array.isArray(e3._events[t3]) ? e3._events[t3].unshift(n3) : e3._events[t3] = [n3, e3._events[t3]] : e3.on(t3, n3); + }(e2, "error", f2), e2.once("close", h2), e2.once("finish", p2), e2.emit("pipe", n2), r2.flowing || (Wi("pipe resume"), n2.resume()), e2; + }, Vi.prototype.unpipe = function(e2) { + var t2 = this._readableState; + if (0 === t2.pipesCount) + return this; + if (1 === t2.pipesCount) + return e2 && e2 !== t2.pipes || (e2 || (e2 = t2.pipes), t2.pipes = null, t2.pipesCount = 0, t2.flowing = false, e2 && e2.emit("unpipe", this)), this; + if (!e2) { + var n2 = t2.pipes, r2 = t2.pipesCount; + t2.pipes = null, t2.pipesCount = 0, t2.flowing = false; + for (var i2 = 0; i2 < r2; i2++) + n2[i2].emit("unpipe", this); + return this; + } + var o2 = ao(t2.pipes, e2); + return -1 === o2 || (t2.pipes.splice(o2, 1), t2.pipesCount -= 1, 1 === t2.pipesCount && (t2.pipes = t2.pipes[0]), e2.emit("unpipe", this)), this; + }, Vi.prototype.on = function(e2, t2) { + var n2 = Ze.prototype.on.call(this, e2, t2); + if ("data" === e2) + false !== this._readableState.flowing && this.resume(); + else if ("readable" === e2) { + var r2 = this._readableState; + r2.endEmitted || r2.readableListening || (r2.readableListening = r2.needReadable = true, r2.emittedReadable = false, r2.reading ? r2.length && Qi(this) : Ee(eo, this)); + } + return n2; + }, Vi.prototype.addListener = Vi.prototype.on, Vi.prototype.resume = function() { + var e2 = this._readableState; + return e2.flowing || (Wi("resume"), e2.flowing = true, function(e3, t2) { + t2.resumeScheduled || (t2.resumeScheduled = true, Ee(to, e3, t2)); + }(this, e2)), this; + }, Vi.prototype.pause = function() { + return Wi("call pause flowing=%j", this._readableState.flowing), false !== this._readableState.flowing && (Wi("pause"), this._readableState.flowing = false, this.emit("pause")), this; + }, Vi.prototype.wrap = function(e2) { + var t2 = this._readableState, n2 = false, r2 = this; + for (var i2 in e2.on("end", function() { + if (Wi("wrapped end"), t2.decoder && !t2.ended) { + var e3 = t2.decoder.end(); + e3 && e3.length && r2.push(e3); + } + r2.push(null); + }), e2.on("data", function(i3) { + (Wi("wrapped data"), t2.decoder && (i3 = t2.decoder.write(i3)), t2.objectMode && null == i3) || (t2.objectMode || i3 && i3.length) && (r2.push(i3) || (n2 = true, e2.pause())); + }), e2) + void 0 === this[i2] && "function" == typeof e2[i2] && (this[i2] = function(t3) { + return function() { + return e2[t3].apply(e2, arguments); + }; + }(i2)); + return function(e3, t3) { + for (var n3 = 0, r3 = e3.length; n3 < r3; n3++) + t3(e3[n3], n3); + }(["error", "close", "destroy", "pause", "resume"], function(t3) { + e2.on(t3, r2.emit.bind(r2, t3)); + }), r2._read = function(t3) { + Wi("wrapped _read", t3), n2 && (n2 = false, e2.resume()); + }, r2; + }, Vi._fromList = ro, co.WritableState = lo, it(co, Ze), lo.prototype.getBuffer = function() { + for (var e2 = this.bufferedRequest, t2 = []; e2; ) + t2.push(e2), e2 = e2.next; + return t2; + }, co.prototype.pipe = function() { + this.emit("error", new Error("Cannot pipe, not readable")); + }, co.prototype.write = function(e2, t2, n2) { + var r2 = this._writableState, i2 = false; + return "function" == typeof t2 && (n2 = t2, t2 = null), _.isBuffer(e2) ? t2 = "buffer" : t2 || (t2 = r2.defaultEncoding), "function" != typeof n2 && (n2 = so), r2.ended ? function(e3, t3) { + var n3 = new Error("write after end"); + e3.emit("error", n3), Ee(t3, n3); + }(this, n2) : function(e3, t3, n3, r3) { + var i3 = true, o2 = false; + return null === n3 ? o2 = new TypeError("May not write null values to stream") : _.isBuffer(n3) || "string" == typeof n3 || void 0 === n3 || t3.objectMode || (o2 = new TypeError("Invalid non-string/buffer chunk")), o2 && (e3.emit("error", o2), Ee(r3, o2), i3 = false), i3; + }(this, r2, e2, n2) && (r2.pendingcb++, i2 = function(e3, t3, n3, r3, i3) { + n3 = function(e4, t4, n4) { + e4.objectMode || false === e4.decodeStrings || "string" != typeof t4 || (t4 = _.from(t4, n4)); + return t4; + }(t3, n3, r3), _.isBuffer(n3) && (r3 = "buffer"); + var o2 = t3.objectMode ? 1 : n3.length; + t3.length += o2; + var a2 = t3.length < t3.highWaterMark; + a2 || (t3.needDrain = true); + if (t3.writing || t3.corked) { + var s2 = t3.lastBufferedRequest; + t3.lastBufferedRequest = new uo(n3, r3, i3), s2 ? s2.next = t3.lastBufferedRequest : t3.bufferedRequest = t3.lastBufferedRequest, t3.bufferedRequestCount += 1; + } else + fo(e3, t3, false, o2, n3, r3, i3); + return a2; + }(this, r2, e2, t2, n2)), i2; + }, co.prototype.cork = function() { + this._writableState.corked++; + }, co.prototype.uncork = function() { + var e2 = this._writableState; + e2.corked && (e2.corked--, e2.writing || e2.corked || e2.finished || e2.bufferProcessing || !e2.bufferedRequest || po(this, e2)); + }, co.prototype.setDefaultEncoding = function(e2) { + if ("string" == typeof e2 && (e2 = e2.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((e2 + "").toLowerCase()) > -1)) + throw new TypeError("Unknown encoding: " + e2); + return this._writableState.defaultEncoding = e2, this; + }, co.prototype._write = function(e2, t2, n2) { + n2(new Error("not implemented")); + }, co.prototype._writev = null, co.prototype.end = function(e2, t2, n2) { + var r2 = this._writableState; + "function" == typeof e2 ? (n2 = e2, e2 = null, t2 = null) : "function" == typeof t2 && (n2 = t2, t2 = null), null != e2 && this.write(e2, t2), r2.corked && (r2.corked = 1, this.uncork()), r2.ending || r2.finished || function(e3, t3, n3) { + t3.ending = true, vo(e3, t3), n3 && (t3.finished ? Ee(n3) : e3.once("finish", n3)); + t3.ended = true, e3.writable = false; + }(this, r2, n2); + }, it(So, Vi); + for (var yo = Object.keys(co.prototype), wo = 0; wo < yo.length; wo++) { + var _o = yo[wo]; + So.prototype[_o] || (So.prototype[_o] = co.prototype[_o]); + } + function So(e2) { + if (!(this instanceof So)) + return new So(e2); + Vi.call(this, e2), co.call(this, e2), e2 && false === e2.readable && (this.readable = false), e2 && false === e2.writable && (this.writable = false), this.allowHalfOpen = true, e2 && false === e2.allowHalfOpen && (this.allowHalfOpen = false), this.once("end", Eo); + } + function Eo() { + this.allowHalfOpen || this._writableState.ended || Ee(ko, this); + } + function ko(e2) { + e2.end(); + } + function Mo(e2) { + this.afterTransform = function(t2, n2) { + return function(e3, t3, n3) { + var r2 = e3._transformState; + r2.transforming = false; + var i2 = r2.writecb; + if (!i2) + return e3.emit("error", new Error("no writecb in Transform class")); + r2.writechunk = null, r2.writecb = null, null != n3 && e3.push(n3); + i2(t3); + var o2 = e3._readableState; + o2.reading = false, (o2.needReadable || o2.length < o2.highWaterMark) && e3._read(o2.highWaterMark); + }(e2, t2, n2); + }, this.needTransform = false, this.transforming = false, this.writecb = null, this.writechunk = null, this.writeencoding = null; + } + function Co(e2) { + if (!(this instanceof Co)) + return new Co(e2); + So.call(this, e2), this._transformState = new Mo(this); + var t2 = this; + this._readableState.needReadable = true, this._readableState.sync = false, e2 && ("function" == typeof e2.transform && (this._transform = e2.transform), "function" == typeof e2.flush && (this._flush = e2.flush)), this.once("prefinish", function() { + "function" == typeof this._flush ? this._flush(function(e3) { + xo(t2, e3); + }) : xo(t2); + }); + } + function xo(e2, t2) { + if (t2) + return e2.emit("error", t2); + var n2 = e2._writableState, r2 = e2._transformState; + if (n2.length) + throw new Error("Calling transform done when ws.length != 0"); + if (r2.transforming) + throw new Error("Calling transform done when still transforming"); + return e2.push(null); + } + function Ao(e2) { + if (!(this instanceof Ao)) + return new Ao(e2); + Co.call(this, e2); + } + function Ro() { + Ze.call(this); + } + it(Co, So), Co.prototype.push = function(e2, t2) { + return this._transformState.needTransform = false, So.prototype.push.call(this, e2, t2); + }, Co.prototype._transform = function(e2, t2, n2) { + throw new Error("Not implemented"); + }, Co.prototype._write = function(e2, t2, n2) { + var r2 = this._transformState; + if (r2.writecb = n2, r2.writechunk = e2, r2.writeencoding = t2, !r2.transforming) { + var i2 = this._readableState; + (r2.needTransform || i2.needReadable || i2.length < i2.highWaterMark) && this._read(i2.highWaterMark); + } + }, Co.prototype._read = function(e2) { + var t2 = this._transformState; + null !== t2.writechunk && t2.writecb && !t2.transforming ? (t2.transforming = true, this._transform(t2.writechunk, t2.writeencoding, t2.afterTransform)) : t2.needTransform = true; + }, it(Ao, Co), Ao.prototype._transform = function(e2, t2, n2) { + n2(null, e2); + }, it(Ro, Ze), Ro.Readable = Vi, Ro.Writable = co, Ro.Duplex = So, Ro.Transform = Co, Ro.PassThrough = Ao, Ro.Stream = Ro, Ro.prototype.pipe = function(e2, t2) { + var n2 = this; + function r2(t3) { + e2.writable && false === e2.write(t3) && n2.pause && n2.pause(); + } + function i2() { + n2.readable && n2.resume && n2.resume(); + } + n2.on("data", r2), e2.on("drain", i2), e2._isStdio || t2 && false === t2.end || (n2.on("end", a2), n2.on("close", s2)); + var o2 = false; + function a2() { + o2 || (o2 = true, e2.end()); + } + function s2() { + o2 || (o2 = true, "function" == typeof e2.destroy && e2.destroy()); + } + function u2(e3) { + if (l2(), 0 === Ze.listenerCount(this, "error")) + throw e3; + } + function l2() { + n2.removeListener("data", r2), e2.removeListener("drain", i2), n2.removeListener("end", a2), n2.removeListener("close", s2), n2.removeListener("error", u2), e2.removeListener("error", u2), n2.removeListener("end", l2), n2.removeListener("close", l2), e2.removeListener("close", l2); + } + return n2.on("error", u2), e2.on("error", u2), n2.on("end", l2), n2.on("close", l2), e2.on("close", l2), e2.emit("pipe", n2), e2; + }; + var To = i(Object.freeze({ __proto__: null, Duplex: So, PassThrough: Ao, Readable: Vi, Stream: Ro, Transform: Co, Writable: co, default: Ro })), Po = i(Hi), Lo = Ue().Buffer, Io = To.Transform, Oo = Po.StringDecoder; + function No(e2) { + Io.call(this), this.hashMode = "string" == typeof e2, this.hashMode ? this[e2] = this._finalOrDigest : this.final = this._finalOrDigest, this._final && (this.__final = this._final, this._final = null), this._decoder = null, this._encoding = null; + } + Ve(No, Io), No.prototype.update = function(e2, t2, n2) { + "string" == typeof e2 && (e2 = Lo.from(e2, t2)); + var r2 = this._update(e2); + return this.hashMode ? this : (n2 && (r2 = this._toString(r2, n2)), r2); + }, No.prototype.setAutoPadding = function() { + }, No.prototype.getAuthTag = function() { + throw new Error("trying to get auth tag in unsupported state"); + }, No.prototype.setAuthTag = function() { + throw new Error("trying to set auth tag in unsupported state"); + }, No.prototype.setAAD = function() { + throw new Error("trying to set aad in unsupported state"); + }, No.prototype._transform = function(e2, t2, n2) { + var r2; + try { + this.hashMode ? this._update(e2) : this.push(this._update(e2)); + } catch (e3) { + r2 = e3; + } finally { + n2(r2); + } + }, No.prototype._flush = function(e2) { + var t2; + try { + this.push(this.__final()); + } catch (e3) { + t2 = e3; + } + e2(t2); + }, No.prototype._finalOrDigest = function(e2) { + var t2 = this.__final() || Lo.alloc(0); + return e2 && (t2 = this._toString(t2, e2, true)), t2; + }, No.prototype._toString = function(e2, t2, n2) { + if (this._decoder || (this._decoder = new Oo(t2), this._encoding = t2), this._encoding !== t2) + throw new Error("can't switch encodings"); + var r2 = this._decoder.write(e2); + return n2 && (r2 += this._decoder.end()), r2; + }; + var Do = No, jo = or, Bo = Er, zo = ji, Uo = Do; + function Fo(e2) { + Uo.call(this, "digest"), this._hash = e2; + } + Ve(Fo, Uo), Fo.prototype._update = function(e2) { + this._hash.update(e2); + }, Fo.prototype._final = function() { + return this._hash.digest(); + }; + var Ko = function(e2) { + return "md5" === (e2 = e2.toLowerCase()) ? new jo() : "rmd160" === e2 || "ripemd160" === e2 ? new Bo() : new Fo(zo(e2)); + }, qo = Ve, Ho = Ue().Buffer, Wo = Do, $o = Ho.alloc(128), Vo = 64; + function Yo(e2, t2) { + Wo.call(this, "digest"), "string" == typeof t2 && (t2 = Ho.from(t2)), this._alg = e2, this._key = t2, t2.length > Vo ? t2 = e2(t2) : t2.length < Vo && (t2 = Ho.concat([t2, $o], Vo)); + for (var n2 = this._ipad = Ho.allocUnsafe(Vo), r2 = this._opad = Ho.allocUnsafe(Vo), i2 = 0; i2 < Vo; i2++) + n2[i2] = 54 ^ t2[i2], r2[i2] = 92 ^ t2[i2]; + this._hash = [n2]; + } + qo(Yo, Wo), Yo.prototype._update = function(e2) { + this._hash.push(e2); + }, Yo.prototype._final = function() { + var e2 = this._alg(Ho.concat(this._hash)); + return this._alg(Ho.concat([this._opad, e2])); + }; + var Go = or, Zo = function(e2) { + return new Go().update(e2).digest(); + }, Qo = Ve, Jo = Yo, Xo = Do, ea = Ue().Buffer, ta = Zo, na = Er, ra = ji, ia = ea.alloc(128); + function oa(e2, t2) { + Xo.call(this, "digest"), "string" == typeof t2 && (t2 = ea.from(t2)); + var n2 = "sha512" === e2 || "sha384" === e2 ? 128 : 64; + (this._alg = e2, this._key = t2, t2.length > n2) ? t2 = ("rmd160" === e2 ? new na() : ra(e2)).update(t2).digest() : t2.length < n2 && (t2 = ea.concat([t2, ia], n2)); + for (var r2 = this._ipad = ea.allocUnsafe(n2), i2 = this._opad = ea.allocUnsafe(n2), o2 = 0; o2 < n2; o2++) + r2[o2] = 54 ^ t2[o2], i2[o2] = 92 ^ t2[o2]; + this._hash = "rmd160" === e2 ? new na() : ra(e2), this._hash.update(r2); + } + Qo(oa, Xo), oa.prototype._update = function(e2) { + this._hash.update(e2); + }, oa.prototype._final = function() { + var e2 = this._hash.digest(); + return ("rmd160" === this._alg ? new na() : ra(this._alg)).update(this._opad).update(e2).digest(); + }; + var aa, sa = function(e2, t2) { + return "rmd160" === (e2 = e2.toLowerCase()) || "ripemd160" === e2 ? new oa("rmd160", t2) : "md5" === e2 ? new Jo(ta, t2) : new oa(e2, t2); + }, ua = { sha224WithRSAEncryption: { sign: "rsa", hash: "sha224", id: "302d300d06096086480165030402040500041c" }, "RSA-SHA224": { sign: "ecdsa/rsa", hash: "sha224", id: "302d300d06096086480165030402040500041c" }, sha256WithRSAEncryption: { sign: "rsa", hash: "sha256", id: "3031300d060960864801650304020105000420" }, "RSA-SHA256": { sign: "ecdsa/rsa", hash: "sha256", id: "3031300d060960864801650304020105000420" }, sha384WithRSAEncryption: { sign: "rsa", hash: "sha384", id: "3041300d060960864801650304020205000430" }, "RSA-SHA384": { sign: "ecdsa/rsa", hash: "sha384", id: "3041300d060960864801650304020205000430" }, sha512WithRSAEncryption: { sign: "rsa", hash: "sha512", id: "3051300d060960864801650304020305000440" }, "RSA-SHA512": { sign: "ecdsa/rsa", hash: "sha512", id: "3051300d060960864801650304020305000440" }, "RSA-SHA1": { sign: "rsa", hash: "sha1", id: "3021300906052b0e03021a05000414" }, "ecdsa-with-SHA1": { sign: "ecdsa", hash: "sha1", id: "" }, sha256: { sign: "ecdsa", hash: "sha256", id: "" }, sha224: { sign: "ecdsa", hash: "sha224", id: "" }, sha384: { sign: "ecdsa", hash: "sha384", id: "" }, sha512: { sign: "ecdsa", hash: "sha512", id: "" }, "DSA-SHA": { sign: "dsa", hash: "sha1", id: "" }, "DSA-SHA1": { sign: "dsa", hash: "sha1", id: "" }, DSA: { sign: "dsa", hash: "sha1", id: "" }, "DSA-WITH-SHA224": { sign: "dsa", hash: "sha224", id: "" }, "DSA-SHA224": { sign: "dsa", hash: "sha224", id: "" }, "DSA-WITH-SHA256": { sign: "dsa", hash: "sha256", id: "" }, "DSA-SHA256": { sign: "dsa", hash: "sha256", id: "" }, "DSA-WITH-SHA384": { sign: "dsa", hash: "sha384", id: "" }, "DSA-SHA384": { sign: "dsa", hash: "sha384", id: "" }, "DSA-WITH-SHA512": { sign: "dsa", hash: "sha512", id: "" }, "DSA-SHA512": { sign: "dsa", hash: "sha512", id: "" }, "DSA-RIPEMD160": { sign: "dsa", hash: "rmd160", id: "" }, ripemd160WithRSA: { sign: "rsa", hash: "rmd160", id: "3021300906052b2403020105000414" }, "RSA-RIPEMD160": { sign: "rsa", hash: "rmd160", id: "3021300906052b2403020105000414" }, md5WithRSAEncryption: { sign: "rsa", hash: "md5", id: "3020300c06082a864886f70d020505000410" }, "RSA-MD5": { sign: "rsa", hash: "md5", id: "3020300c06082a864886f70d020505000410" } }, la = ua, ca = {}, da = Math.pow(2, 30) - 1, fa = function(e2, t2) { + if ("number" != typeof e2) + throw new TypeError("Iterations not a number"); + if (e2 < 0) + throw new TypeError("Bad iterations"); + if ("number" != typeof t2) + throw new TypeError("Key length not a number"); + if (t2 < 0 || t2 > da || t2 != t2) + throw new TypeError("Bad key length"); + }; + if (n.process && n.process.browser) + aa = "utf-8"; + else if (n.process && n.process.version) { + aa = parseInt(je.version.split(".")[0].slice(1), 10) >= 6 ? "utf-8" : "binary"; + } else + aa = "utf-8"; + var ha = aa, pa = Ue().Buffer, ma = function(e2, t2, n2) { + if (pa.isBuffer(e2)) + return e2; + if ("string" == typeof e2) + return pa.from(e2, t2); + if (ArrayBuffer.isView(e2)) + return pa.from(e2.buffer); + throw new TypeError(n2 + " must be a string, a Buffer, a typed array or a DataView"); + }, ga = Zo, va = Er, ba = ji, ya = Ue().Buffer, wa = fa, _a = ha, Sa = ma, Ea = ya.alloc(128), ka = { md5: 16, sha1: 20, sha224: 28, sha256: 32, sha384: 48, sha512: 64, rmd160: 20, ripemd160: 20 }; + function Ma(e2, t2, n2) { + var r2 = function(e3) { + function t3(t4) { + return ba(e3).update(t4).digest(); + } + function n3(e4) { + return new va().update(e4).digest(); + } + return "rmd160" === e3 || "ripemd160" === e3 ? n3 : "md5" === e3 ? ga : t3; + }(e2), i2 = "sha512" === e2 || "sha384" === e2 ? 128 : 64; + t2.length > i2 ? t2 = r2(t2) : t2.length < i2 && (t2 = ya.concat([t2, Ea], i2)); + for (var o2 = ya.allocUnsafe(i2 + ka[e2]), a2 = ya.allocUnsafe(i2 + ka[e2]), s2 = 0; s2 < i2; s2++) + o2[s2] = 54 ^ t2[s2], a2[s2] = 92 ^ t2[s2]; + var u2 = ya.allocUnsafe(i2 + n2 + 4); + o2.copy(u2, 0, 0, i2), this.ipad1 = u2, this.ipad2 = o2, this.opad = a2, this.alg = e2, this.blocksize = i2, this.hash = r2, this.size = ka[e2]; + } + Ma.prototype.run = function(e2, t2) { + return e2.copy(t2, this.blocksize), this.hash(t2).copy(this.opad, this.blocksize), this.hash(this.opad); + }; + var Ca, xa, Aa = function(e2, t2, n2, r2, i2) { + wa(n2, r2); + var o2 = new Ma(i2 = i2 || "sha1", e2 = Sa(e2, _a, "Password"), (t2 = Sa(t2, _a, "Salt")).length), a2 = ya.allocUnsafe(r2), s2 = ya.allocUnsafe(t2.length + 4); + t2.copy(s2, 0, 0, t2.length); + for (var u2 = 0, l2 = ka[i2], c2 = Math.ceil(r2 / l2), d2 = 1; d2 <= c2; d2++) { + s2.writeUInt32BE(d2, t2.length); + for (var f2 = o2.run(s2, o2.ipad1), h2 = f2, p2 = 1; p2 < n2; p2++) { + h2 = o2.run(h2, o2.ipad2); + for (var m2 = 0; m2 < l2; m2++) + f2[m2] ^= h2[m2]; + } + f2.copy(a2, u2), u2 += l2; + } + return a2; + }, Ra = Ue().Buffer, Ta = fa, Pa = ha, La = Aa, Ia = ma, Oa = n.crypto && n.crypto.subtle, Na = { sha: "SHA-1", "sha-1": "SHA-1", sha1: "SHA-1", sha256: "SHA-256", "sha-256": "SHA-256", sha384: "SHA-384", "sha-384": "SHA-384", "sha-512": "SHA-512", sha512: "SHA-512" }, Da = []; + function ja() { + return xa || (xa = n.process && n.process.nextTick ? n.process.nextTick : n.queueMicrotask ? n.queueMicrotask : n.setImmediate ? n.setImmediate : n.setTimeout); + } + function Ba(e2, t2, n2, r2, i2) { + return Oa.importKey("raw", e2, { name: "PBKDF2" }, false, ["deriveBits"]).then(function(e3) { + return Oa.deriveBits({ name: "PBKDF2", salt: t2, iterations: n2, hash: { name: i2 } }, e3, r2 << 3); + }).then(function(e3) { + return Ra.from(e3); + }); + } + ca.pbkdf2 = function(e2, t2, r2, i2, o2, a2) { + "function" == typeof o2 && (a2 = o2, o2 = void 0); + var s2 = Na[(o2 = o2 || "sha1").toLowerCase()]; + if (s2 && "function" == typeof n.Promise) { + if (Ta(r2, i2), e2 = Ia(e2, Pa, "Password"), t2 = Ia(t2, Pa, "Salt"), "function" != typeof a2) + throw new Error("No callback provided to pbkdf2"); + !function(e3, t3) { + e3.then(function(e4) { + ja()(function() { + t3(null, e4); + }); + }, function(e4) { + ja()(function() { + t3(e4); + }); + }); + }(function(e3) { + if (n.process && !n.process.browser) + return Promise.resolve(false); + if (!Oa || !Oa.importKey || !Oa.deriveBits) + return Promise.resolve(false); + if (void 0 !== Da[e3]) + return Da[e3]; + var t3 = Ba(Ca = Ca || Ra.alloc(8), Ca, 10, 128, e3).then(function() { + return true; + }).catch(function() { + return false; + }); + return Da[e3] = t3, t3; + }(s2).then(function(n2) { + return n2 ? Ba(e2, t2, r2, i2, s2) : La(e2, t2, r2, i2, o2); + }), a2); + } else + ja()(function() { + var n2; + try { + n2 = La(e2, t2, r2, i2, o2); + } catch (e3) { + return a2(e3); + } + a2(null, n2); + }); + }, ca.pbkdf2Sync = Aa; + var za = {}, Ua = {}, Fa = { readUInt32BE: function(e2, t2) { + return (e2[0 + t2] << 24 | e2[1 + t2] << 16 | e2[2 + t2] << 8 | e2[3 + t2]) >>> 0; + }, writeUInt32BE: function(e2, t2, n2) { + e2[0 + n2] = t2 >>> 24, e2[1 + n2] = t2 >>> 16 & 255, e2[2 + n2] = t2 >>> 8 & 255, e2[3 + n2] = 255 & t2; + }, ip: function(e2, t2, n2, r2) { + for (var i2 = 0, o2 = 0, a2 = 6; a2 >= 0; a2 -= 2) { + for (var s2 = 0; s2 <= 24; s2 += 8) + i2 <<= 1, i2 |= t2 >>> s2 + a2 & 1; + for (s2 = 0; s2 <= 24; s2 += 8) + i2 <<= 1, i2 |= e2 >>> s2 + a2 & 1; + } + for (a2 = 6; a2 >= 0; a2 -= 2) { + for (s2 = 1; s2 <= 25; s2 += 8) + o2 <<= 1, o2 |= t2 >>> s2 + a2 & 1; + for (s2 = 1; s2 <= 25; s2 += 8) + o2 <<= 1, o2 |= e2 >>> s2 + a2 & 1; + } + n2[r2 + 0] = i2 >>> 0, n2[r2 + 1] = o2 >>> 0; + }, rip: function(e2, t2, n2, r2) { + for (var i2 = 0, o2 = 0, a2 = 0; a2 < 4; a2++) + for (var s2 = 24; s2 >= 0; s2 -= 8) + i2 <<= 1, i2 |= t2 >>> s2 + a2 & 1, i2 <<= 1, i2 |= e2 >>> s2 + a2 & 1; + for (a2 = 4; a2 < 8; a2++) + for (s2 = 24; s2 >= 0; s2 -= 8) + o2 <<= 1, o2 |= t2 >>> s2 + a2 & 1, o2 <<= 1, o2 |= e2 >>> s2 + a2 & 1; + n2[r2 + 0] = i2 >>> 0, n2[r2 + 1] = o2 >>> 0; + }, pc1: function(e2, t2, n2, r2) { + for (var i2 = 0, o2 = 0, a2 = 7; a2 >= 5; a2--) { + for (var s2 = 0; s2 <= 24; s2 += 8) + i2 <<= 1, i2 |= t2 >> s2 + a2 & 1; + for (s2 = 0; s2 <= 24; s2 += 8) + i2 <<= 1, i2 |= e2 >> s2 + a2 & 1; + } + for (s2 = 0; s2 <= 24; s2 += 8) + i2 <<= 1, i2 |= t2 >> s2 + a2 & 1; + for (a2 = 1; a2 <= 3; a2++) { + for (s2 = 0; s2 <= 24; s2 += 8) + o2 <<= 1, o2 |= t2 >> s2 + a2 & 1; + for (s2 = 0; s2 <= 24; s2 += 8) + o2 <<= 1, o2 |= e2 >> s2 + a2 & 1; + } + for (s2 = 0; s2 <= 24; s2 += 8) + o2 <<= 1, o2 |= e2 >> s2 + a2 & 1; + n2[r2 + 0] = i2 >>> 0, n2[r2 + 1] = o2 >>> 0; + }, r28shl: function(e2, t2) { + return e2 << t2 & 268435455 | e2 >>> 28 - t2; + } }, Ka = [14, 11, 17, 4, 27, 23, 25, 0, 13, 22, 7, 18, 5, 9, 16, 24, 2, 20, 12, 21, 1, 8, 15, 26, 15, 4, 25, 19, 9, 1, 26, 16, 5, 11, 23, 8, 12, 7, 17, 0, 22, 3, 10, 14, 6, 20, 27, 24]; + Fa.pc2 = function(e2, t2, n2, r2) { + for (var i2 = 0, o2 = 0, a2 = Ka.length >>> 1, s2 = 0; s2 < a2; s2++) + i2 <<= 1, i2 |= e2 >>> Ka[s2] & 1; + for (s2 = a2; s2 < Ka.length; s2++) + o2 <<= 1, o2 |= t2 >>> Ka[s2] & 1; + n2[r2 + 0] = i2 >>> 0, n2[r2 + 1] = o2 >>> 0; + }, Fa.expand = function(e2, t2, n2) { + var r2 = 0, i2 = 0; + r2 = (1 & e2) << 5 | e2 >>> 27; + for (var o2 = 23; o2 >= 15; o2 -= 4) + r2 <<= 6, r2 |= e2 >>> o2 & 63; + for (o2 = 11; o2 >= 3; o2 -= 4) + i2 |= e2 >>> o2 & 63, i2 <<= 6; + i2 |= (31 & e2) << 1 | e2 >>> 31, t2[n2 + 0] = r2 >>> 0, t2[n2 + 1] = i2 >>> 0; + }; + var qa = [14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1, 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8, 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7, 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13, 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14, 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5, 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2, 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9, 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10, 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1, 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7, 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12, 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3, 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9, 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8, 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14, 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1, 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6, 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13, 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3, 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5, 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8, 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10, 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13, 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10, 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6, 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7, 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12, 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4, 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2, 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13, 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11]; + Fa.substitute = function(e2, t2) { + for (var n2 = 0, r2 = 0; r2 < 4; r2++) { + n2 <<= 4, n2 |= qa[64 * r2 + (e2 >>> 18 - 6 * r2 & 63)]; + } + for (r2 = 0; r2 < 4; r2++) { + n2 <<= 4, n2 |= qa[256 + 64 * r2 + (t2 >>> 18 - 6 * r2 & 63)]; + } + return n2 >>> 0; + }; + var Ha = [16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22, 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7]; + Fa.permute = function(e2) { + for (var t2 = 0, n2 = 0; n2 < Ha.length; n2++) + t2 <<= 1, t2 |= e2 >>> Ha[n2] & 1; + return t2 >>> 0; + }, Fa.padSplit = function(e2, t2, n2) { + for (var r2 = e2.toString(2); r2.length < t2; ) + r2 = "0" + r2; + for (var i2 = [], o2 = 0; o2 < t2; o2 += n2) + i2.push(r2.slice(o2, o2 + n2)); + return i2.join(" "); + }; + var Wa = $a; + function $a(e2, t2) { + if (!e2) + throw new Error(t2 || "Assertion failed"); + } + $a.equal = function(e2, t2, n2) { + if (e2 != t2) + throw new Error(n2 || "Assertion failed: " + e2 + " != " + t2); + }; + var Va = Wa; + function Ya(e2) { + this.options = e2, this.type = this.options.type, this.blockSize = 8, this._init(), this.buffer = new Array(this.blockSize), this.bufferOff = 0, this.padding = false !== e2.padding; + } + var Ga = Ya; + Ya.prototype._init = function() { + }, Ya.prototype.update = function(e2) { + return 0 === e2.length ? [] : "decrypt" === this.type ? this._updateDecrypt(e2) : this._updateEncrypt(e2); + }, Ya.prototype._buffer = function(e2, t2) { + for (var n2 = Math.min(this.buffer.length - this.bufferOff, e2.length - t2), r2 = 0; r2 < n2; r2++) + this.buffer[this.bufferOff + r2] = e2[t2 + r2]; + return this.bufferOff += n2, n2; + }, Ya.prototype._flushBuffer = function(e2, t2) { + return this._update(this.buffer, 0, e2, t2), this.bufferOff = 0, this.blockSize; + }, Ya.prototype._updateEncrypt = function(e2) { + var t2 = 0, n2 = 0, r2 = (this.bufferOff + e2.length) / this.blockSize | 0, i2 = new Array(r2 * this.blockSize); + 0 !== this.bufferOff && (t2 += this._buffer(e2, t2), this.bufferOff === this.buffer.length && (n2 += this._flushBuffer(i2, n2))); + for (var o2 = e2.length - (e2.length - t2) % this.blockSize; t2 < o2; t2 += this.blockSize) + this._update(e2, t2, i2, n2), n2 += this.blockSize; + for (; t2 < e2.length; t2++, this.bufferOff++) + this.buffer[this.bufferOff] = e2[t2]; + return i2; + }, Ya.prototype._updateDecrypt = function(e2) { + for (var t2 = 0, n2 = 0, r2 = Math.ceil((this.bufferOff + e2.length) / this.blockSize) - 1, i2 = new Array(r2 * this.blockSize); r2 > 0; r2--) + t2 += this._buffer(e2, t2), n2 += this._flushBuffer(i2, n2); + return t2 += this._buffer(e2, t2), i2; + }, Ya.prototype.final = function(e2) { + var t2, n2; + return e2 && (t2 = this.update(e2)), n2 = "encrypt" === this.type ? this._finalEncrypt() : this._finalDecrypt(), t2 ? t2.concat(n2) : n2; + }, Ya.prototype._pad = function(e2, t2) { + if (0 === t2) + return false; + for (; t2 < e2.length; ) + e2[t2++] = 0; + return true; + }, Ya.prototype._finalEncrypt = function() { + if (!this._pad(this.buffer, this.bufferOff)) + return []; + var e2 = new Array(this.blockSize); + return this._update(this.buffer, 0, e2, 0), e2; + }, Ya.prototype._unpad = function(e2) { + return e2; + }, Ya.prototype._finalDecrypt = function() { + Va.equal(this.bufferOff, this.blockSize, "Not enough data to decrypt"); + var e2 = new Array(this.blockSize); + return this._flushBuffer(e2, 0), this._unpad(e2); + }; + var Za = Wa, Qa = Fa, Ja = Ga; + function Xa() { + this.tmp = new Array(2), this.keys = null; + } + function es(e2) { + Ja.call(this, e2); + var t2 = new Xa(); + this._desState = t2, this.deriveKeys(t2, e2.key); + } + Ve(es, Ja); + var ts = es; + es.create = function(e2) { + return new es(e2); + }; + var ns = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1]; + es.prototype.deriveKeys = function(e2, t2) { + e2.keys = new Array(32), Za.equal(t2.length, this.blockSize, "Invalid key length"); + var n2 = Qa.readUInt32BE(t2, 0), r2 = Qa.readUInt32BE(t2, 4); + Qa.pc1(n2, r2, e2.tmp, 0), n2 = e2.tmp[0], r2 = e2.tmp[1]; + for (var i2 = 0; i2 < e2.keys.length; i2 += 2) { + var o2 = ns[i2 >>> 1]; + n2 = Qa.r28shl(n2, o2), r2 = Qa.r28shl(r2, o2), Qa.pc2(n2, r2, e2.keys, i2); + } + }, es.prototype._update = function(e2, t2, n2, r2) { + var i2 = this._desState, o2 = Qa.readUInt32BE(e2, t2), a2 = Qa.readUInt32BE(e2, t2 + 4); + Qa.ip(o2, a2, i2.tmp, 0), o2 = i2.tmp[0], a2 = i2.tmp[1], "encrypt" === this.type ? this._encrypt(i2, o2, a2, i2.tmp, 0) : this._decrypt(i2, o2, a2, i2.tmp, 0), o2 = i2.tmp[0], a2 = i2.tmp[1], Qa.writeUInt32BE(n2, o2, r2), Qa.writeUInt32BE(n2, a2, r2 + 4); + }, es.prototype._pad = function(e2, t2) { + if (false === this.padding) + return false; + for (var n2 = e2.length - t2, r2 = t2; r2 < e2.length; r2++) + e2[r2] = n2; + return true; + }, es.prototype._unpad = function(e2) { + if (false === this.padding) + return e2; + for (var t2 = e2[e2.length - 1], n2 = e2.length - t2; n2 < e2.length; n2++) + Za.equal(e2[n2], t2); + return e2.slice(0, e2.length - t2); + }, es.prototype._encrypt = function(e2, t2, n2, r2, i2) { + for (var o2 = t2, a2 = n2, s2 = 0; s2 < e2.keys.length; s2 += 2) { + var u2 = e2.keys[s2], l2 = e2.keys[s2 + 1]; + Qa.expand(a2, e2.tmp, 0), u2 ^= e2.tmp[0], l2 ^= e2.tmp[1]; + var c2 = Qa.substitute(u2, l2), d2 = a2; + a2 = (o2 ^ Qa.permute(c2)) >>> 0, o2 = d2; + } + Qa.rip(a2, o2, r2, i2); + }, es.prototype._decrypt = function(e2, t2, n2, r2, i2) { + for (var o2 = n2, a2 = t2, s2 = e2.keys.length - 2; s2 >= 0; s2 -= 2) { + var u2 = e2.keys[s2], l2 = e2.keys[s2 + 1]; + Qa.expand(o2, e2.tmp, 0), u2 ^= e2.tmp[0], l2 ^= e2.tmp[1]; + var c2 = Qa.substitute(u2, l2), d2 = o2; + o2 = (a2 ^ Qa.permute(c2)) >>> 0, a2 = d2; + } + Qa.rip(o2, a2, r2, i2); + }; + var rs = {}, is = Wa, os = Ve, as = {}; + function ss(e2) { + is.equal(e2.length, 8, "Invalid IV length"), this.iv = new Array(8); + for (var t2 = 0; t2 < this.iv.length; t2++) + this.iv[t2] = e2[t2]; + } + rs.instantiate = function(e2) { + function t2(t3) { + e2.call(this, t3), this._cbcInit(); + } + os(t2, e2); + for (var n2 = Object.keys(as), r2 = 0; r2 < n2.length; r2++) { + var i2 = n2[r2]; + t2.prototype[i2] = as[i2]; + } + return t2.create = function(e3) { + return new t2(e3); + }, t2; + }, as._cbcInit = function() { + var e2 = new ss(this.options.iv); + this._cbcState = e2; + }, as._update = function(e2, t2, n2, r2) { + var i2 = this._cbcState, o2 = this.constructor.super_.prototype, a2 = i2.iv; + if ("encrypt" === this.type) { + for (var s2 = 0; s2 < this.blockSize; s2++) + a2[s2] ^= e2[t2 + s2]; + o2._update.call(this, a2, 0, n2, r2); + for (s2 = 0; s2 < this.blockSize; s2++) + a2[s2] = n2[r2 + s2]; + } else { + o2._update.call(this, e2, t2, n2, r2); + for (s2 = 0; s2 < this.blockSize; s2++) + n2[r2 + s2] ^= a2[s2]; + for (s2 = 0; s2 < this.blockSize; s2++) + a2[s2] = e2[t2 + s2]; + } + }; + var us = Wa, ls = Ga, cs = ts; + function ds(e2, t2) { + us.equal(t2.length, 24, "Invalid key length"); + var n2 = t2.slice(0, 8), r2 = t2.slice(8, 16), i2 = t2.slice(16, 24); + this.ciphers = "encrypt" === e2 ? [cs.create({ type: "encrypt", key: n2 }), cs.create({ type: "decrypt", key: r2 }), cs.create({ type: "encrypt", key: i2 })] : [cs.create({ type: "decrypt", key: i2 }), cs.create({ type: "encrypt", key: r2 }), cs.create({ type: "decrypt", key: n2 })]; + } + function fs(e2) { + ls.call(this, e2); + var t2 = new ds(this.type, this.options.key); + this._edeState = t2; + } + Ve(fs, ls); + var hs = fs; + fs.create = function(e2) { + return new fs(e2); + }, fs.prototype._update = function(e2, t2, n2, r2) { + var i2 = this._edeState; + i2.ciphers[0]._update(e2, t2, n2, r2), i2.ciphers[1]._update(n2, r2, n2, r2), i2.ciphers[2]._update(n2, r2, n2, r2); + }, fs.prototype._pad = cs.prototype._pad, fs.prototype._unpad = cs.prototype._unpad, Ua.utils = Fa, Ua.Cipher = Ga, Ua.DES = ts, Ua.CBC = rs, Ua.EDE = hs; + var ps = Do, ms = Ua, gs = Ve, vs = Ue().Buffer, bs = { "des-ede3-cbc": ms.CBC.instantiate(ms.EDE), "des-ede3": ms.EDE, "des-ede-cbc": ms.CBC.instantiate(ms.EDE), "des-ede": ms.EDE, "des-cbc": ms.CBC.instantiate(ms.DES), "des-ecb": ms.DES }; + bs.des = bs["des-cbc"], bs.des3 = bs["des-ede3-cbc"]; + var ys = ws; + function ws(e2) { + ps.call(this); + var t2, n2 = e2.mode.toLowerCase(), r2 = bs[n2]; + t2 = e2.decrypt ? "decrypt" : "encrypt"; + var i2 = e2.key; + vs.isBuffer(i2) || (i2 = vs.from(i2)), "des-ede" !== n2 && "des-ede-cbc" !== n2 || (i2 = vs.concat([i2, i2.slice(0, 8)])); + var o2 = e2.iv; + vs.isBuffer(o2) || (o2 = vs.from(o2)), this._des = r2.create({ key: i2, iv: o2, type: t2 }); + } + gs(ws, ps), ws.prototype._update = function(e2) { + return vs.from(this._des.update(e2)); + }, ws.prototype._final = function() { + return vs.from(this._des.final()); + }; + var _s = {}, Ss = {}, Es = { encrypt: function(e2, t2) { + return e2._cipher.encryptBlock(t2); + }, decrypt: function(e2, t2) { + return e2._cipher.decryptBlock(t2); + } }, ks = {}, Ms = function(e2, t2) { + for (var n2 = Math.min(e2.length, t2.length), r2 = new _(n2), i2 = 0; i2 < n2; ++i2) + r2[i2] = e2[i2] ^ t2[i2]; + return r2; + }, Cs = Ms; + ks.encrypt = function(e2, t2) { + var n2 = Cs(t2, e2._prev); + return e2._prev = e2._cipher.encryptBlock(n2), e2._prev; + }, ks.decrypt = function(e2, t2) { + var n2 = e2._prev; + e2._prev = t2; + var r2 = e2._cipher.decryptBlock(t2); + return Cs(r2, n2); + }; + var xs = {}, As = Ue().Buffer, Rs = Ms; + function Ts(e2, t2, n2) { + var r2 = t2.length, i2 = Rs(t2, e2._cache); + return e2._cache = e2._cache.slice(r2), e2._prev = As.concat([e2._prev, n2 ? t2 : i2]), i2; + } + xs.encrypt = function(e2, t2, n2) { + for (var r2, i2 = As.allocUnsafe(0); t2.length; ) { + if (0 === e2._cache.length && (e2._cache = e2._cipher.encryptBlock(e2._prev), e2._prev = As.allocUnsafe(0)), !(e2._cache.length <= t2.length)) { + i2 = As.concat([i2, Ts(e2, t2, n2)]); + break; + } + r2 = e2._cache.length, i2 = As.concat([i2, Ts(e2, t2.slice(0, r2), n2)]), t2 = t2.slice(r2); + } + return i2; + }; + var Ps = {}, Ls = Ue().Buffer; + function Is(e2, t2, n2) { + var r2 = e2._cipher.encryptBlock(e2._prev)[0] ^ t2; + return e2._prev = Ls.concat([e2._prev.slice(1), Ls.from([n2 ? t2 : r2])]), r2; + } + Ps.encrypt = function(e2, t2, n2) { + for (var r2 = t2.length, i2 = Ls.allocUnsafe(r2), o2 = -1; ++o2 < r2; ) + i2[o2] = Is(e2, t2[o2], n2); + return i2; + }; + var Os = {}, Ns = Ue().Buffer; + function Ds(e2, t2, n2) { + for (var r2, i2, o2 = -1, a2 = 0; ++o2 < 8; ) + r2 = t2 & 1 << 7 - o2 ? 128 : 0, a2 += (128 & (i2 = e2._cipher.encryptBlock(e2._prev)[0] ^ r2)) >> o2 % 8, e2._prev = js(e2._prev, n2 ? r2 : i2); + return a2; + } + function js(e2, t2) { + var n2 = e2.length, r2 = -1, i2 = Ns.allocUnsafe(e2.length); + for (e2 = Ns.concat([e2, Ns.from([t2])]); ++r2 < n2; ) + i2[r2] = e2[r2] << 1 | e2[r2 + 1] >> 7; + return i2; + } + Os.encrypt = function(e2, t2, n2) { + for (var r2 = t2.length, i2 = Ns.allocUnsafe(r2), o2 = -1; ++o2 < r2; ) + i2[o2] = Ds(e2, t2[o2], n2); + return i2; + }; + var Bs = {}, zs = Ms; + function Us(e2) { + return e2._prev = e2._cipher.encryptBlock(e2._prev), e2._prev; + } + Bs.encrypt = function(e2, t2) { + for (; e2._cache.length < t2.length; ) + e2._cache = _.concat([e2._cache, Us(e2)]); + var n2 = e2._cache.slice(0, t2.length); + return e2._cache = e2._cache.slice(t2.length), zs(t2, n2); + }; + var Fs = {}; + var Ks = function(e2) { + for (var t2, n2 = e2.length; n2--; ) { + if (255 !== (t2 = e2.readUInt8(n2))) { + t2++, e2.writeUInt8(t2, n2); + break; + } + e2.writeUInt8(0, n2); + } + }, qs = Ms, Hs = Ue().Buffer, Ws = Ks; + function $s(e2) { + var t2 = e2._cipher.encryptBlockRaw(e2._prev); + return Ws(e2._prev), t2; + } + Fs.encrypt = function(e2, t2) { + var n2 = Math.ceil(t2.length / 16), r2 = e2._cache.length; + e2._cache = Hs.concat([e2._cache, Hs.allocUnsafe(16 * n2)]); + for (var i2 = 0; i2 < n2; i2++) { + var o2 = $s(e2), a2 = r2 + 16 * i2; + e2._cache.writeUInt32BE(o2[0], a2 + 0), e2._cache.writeUInt32BE(o2[1], a2 + 4), e2._cache.writeUInt32BE(o2[2], a2 + 8), e2._cache.writeUInt32BE(o2[3], a2 + 12); + } + var s2 = e2._cache.slice(0, t2.length); + return e2._cache = e2._cache.slice(t2.length), qs(t2, s2); + }; + var Vs = { "aes-128-ecb": { cipher: "AES", key: 128, iv: 0, mode: "ECB", type: "block" }, "aes-192-ecb": { cipher: "AES", key: 192, iv: 0, mode: "ECB", type: "block" }, "aes-256-ecb": { cipher: "AES", key: 256, iv: 0, mode: "ECB", type: "block" }, "aes-128-cbc": { cipher: "AES", key: 128, iv: 16, mode: "CBC", type: "block" }, "aes-192-cbc": { cipher: "AES", key: 192, iv: 16, mode: "CBC", type: "block" }, "aes-256-cbc": { cipher: "AES", key: 256, iv: 16, mode: "CBC", type: "block" }, aes128: { cipher: "AES", key: 128, iv: 16, mode: "CBC", type: "block" }, aes192: { cipher: "AES", key: 192, iv: 16, mode: "CBC", type: "block" }, aes256: { cipher: "AES", key: 256, iv: 16, mode: "CBC", type: "block" }, "aes-128-cfb": { cipher: "AES", key: 128, iv: 16, mode: "CFB", type: "stream" }, "aes-192-cfb": { cipher: "AES", key: 192, iv: 16, mode: "CFB", type: "stream" }, "aes-256-cfb": { cipher: "AES", key: 256, iv: 16, mode: "CFB", type: "stream" }, "aes-128-cfb8": { cipher: "AES", key: 128, iv: 16, mode: "CFB8", type: "stream" }, "aes-192-cfb8": { cipher: "AES", key: 192, iv: 16, mode: "CFB8", type: "stream" }, "aes-256-cfb8": { cipher: "AES", key: 256, iv: 16, mode: "CFB8", type: "stream" }, "aes-128-cfb1": { cipher: "AES", key: 128, iv: 16, mode: "CFB1", type: "stream" }, "aes-192-cfb1": { cipher: "AES", key: 192, iv: 16, mode: "CFB1", type: "stream" }, "aes-256-cfb1": { cipher: "AES", key: 256, iv: 16, mode: "CFB1", type: "stream" }, "aes-128-ofb": { cipher: "AES", key: 128, iv: 16, mode: "OFB", type: "stream" }, "aes-192-ofb": { cipher: "AES", key: 192, iv: 16, mode: "OFB", type: "stream" }, "aes-256-ofb": { cipher: "AES", key: 256, iv: 16, mode: "OFB", type: "stream" }, "aes-128-ctr": { cipher: "AES", key: 128, iv: 16, mode: "CTR", type: "stream" }, "aes-192-ctr": { cipher: "AES", key: 192, iv: 16, mode: "CTR", type: "stream" }, "aes-256-ctr": { cipher: "AES", key: 256, iv: 16, mode: "CTR", type: "stream" }, "aes-128-gcm": { cipher: "AES", key: 128, iv: 12, mode: "GCM", type: "auth" }, "aes-192-gcm": { cipher: "AES", key: 192, iv: 12, mode: "GCM", type: "auth" }, "aes-256-gcm": { cipher: "AES", key: 256, iv: 12, mode: "GCM", type: "auth" } }, Ys = { ECB: Es, CBC: ks, CFB: xs, CFB8: Ps, CFB1: Os, OFB: Bs, CTR: Fs, GCM: Fs }, Gs = Vs; + for (var Zs in Gs) + Gs[Zs].module = Ys[Gs[Zs].mode]; + var Qs = Gs, Js = {}, Xs = Ue().Buffer; + function eu(e2) { + Xs.isBuffer(e2) || (e2 = Xs.from(e2)); + for (var t2 = e2.length / 4 | 0, n2 = new Array(t2), r2 = 0; r2 < t2; r2++) + n2[r2] = e2.readUInt32BE(4 * r2); + return n2; + } + function tu(e2) { + for (; 0 < e2.length; e2++) + e2[0] = 0; + } + function nu(e2, t2, n2, r2, i2) { + for (var o2, a2, s2, u2, l2 = n2[0], c2 = n2[1], d2 = n2[2], f2 = n2[3], h2 = e2[0] ^ t2[0], p2 = e2[1] ^ t2[1], m2 = e2[2] ^ t2[2], g2 = e2[3] ^ t2[3], v2 = 4, b2 = 1; b2 < i2; b2++) + o2 = l2[h2 >>> 24] ^ c2[p2 >>> 16 & 255] ^ d2[m2 >>> 8 & 255] ^ f2[255 & g2] ^ t2[v2++], a2 = l2[p2 >>> 24] ^ c2[m2 >>> 16 & 255] ^ d2[g2 >>> 8 & 255] ^ f2[255 & h2] ^ t2[v2++], s2 = l2[m2 >>> 24] ^ c2[g2 >>> 16 & 255] ^ d2[h2 >>> 8 & 255] ^ f2[255 & p2] ^ t2[v2++], u2 = l2[g2 >>> 24] ^ c2[h2 >>> 16 & 255] ^ d2[p2 >>> 8 & 255] ^ f2[255 & m2] ^ t2[v2++], h2 = o2, p2 = a2, m2 = s2, g2 = u2; + return o2 = (r2[h2 >>> 24] << 24 | r2[p2 >>> 16 & 255] << 16 | r2[m2 >>> 8 & 255] << 8 | r2[255 & g2]) ^ t2[v2++], a2 = (r2[p2 >>> 24] << 24 | r2[m2 >>> 16 & 255] << 16 | r2[g2 >>> 8 & 255] << 8 | r2[255 & h2]) ^ t2[v2++], s2 = (r2[m2 >>> 24] << 24 | r2[g2 >>> 16 & 255] << 16 | r2[h2 >>> 8 & 255] << 8 | r2[255 & p2]) ^ t2[v2++], u2 = (r2[g2 >>> 24] << 24 | r2[h2 >>> 16 & 255] << 16 | r2[p2 >>> 8 & 255] << 8 | r2[255 & m2]) ^ t2[v2++], [o2 >>>= 0, a2 >>>= 0, s2 >>>= 0, u2 >>>= 0]; + } + var ru = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], iu = function() { + for (var e2 = new Array(256), t2 = 0; t2 < 256; t2++) + e2[t2] = t2 < 128 ? t2 << 1 : t2 << 1 ^ 283; + for (var n2 = [], r2 = [], i2 = [[], [], [], []], o2 = [[], [], [], []], a2 = 0, s2 = 0, u2 = 0; u2 < 256; ++u2) { + var l2 = s2 ^ s2 << 1 ^ s2 << 2 ^ s2 << 3 ^ s2 << 4; + l2 = l2 >>> 8 ^ 255 & l2 ^ 99, n2[a2] = l2, r2[l2] = a2; + var c2 = e2[a2], d2 = e2[c2], f2 = e2[d2], h2 = 257 * e2[l2] ^ 16843008 * l2; + i2[0][a2] = h2 << 24 | h2 >>> 8, i2[1][a2] = h2 << 16 | h2 >>> 16, i2[2][a2] = h2 << 8 | h2 >>> 24, i2[3][a2] = h2, h2 = 16843009 * f2 ^ 65537 * d2 ^ 257 * c2 ^ 16843008 * a2, o2[0][l2] = h2 << 24 | h2 >>> 8, o2[1][l2] = h2 << 16 | h2 >>> 16, o2[2][l2] = h2 << 8 | h2 >>> 24, o2[3][l2] = h2, 0 === a2 ? a2 = s2 = 1 : (a2 = c2 ^ e2[e2[e2[f2 ^ c2]]], s2 ^= e2[e2[s2]]); + } + return { SBOX: n2, INV_SBOX: r2, SUB_MIX: i2, INV_SUB_MIX: o2 }; + }(); + function ou(e2) { + this._key = eu(e2), this._reset(); + } + ou.blockSize = 16, ou.keySize = 32, ou.prototype.blockSize = ou.blockSize, ou.prototype.keySize = ou.keySize, ou.prototype._reset = function() { + for (var e2 = this._key, t2 = e2.length, n2 = t2 + 6, r2 = 4 * (n2 + 1), i2 = [], o2 = 0; o2 < t2; o2++) + i2[o2] = e2[o2]; + for (o2 = t2; o2 < r2; o2++) { + var a2 = i2[o2 - 1]; + o2 % t2 == 0 ? (a2 = a2 << 8 | a2 >>> 24, a2 = iu.SBOX[a2 >>> 24] << 24 | iu.SBOX[a2 >>> 16 & 255] << 16 | iu.SBOX[a2 >>> 8 & 255] << 8 | iu.SBOX[255 & a2], a2 ^= ru[o2 / t2 | 0] << 24) : t2 > 6 && o2 % t2 == 4 && (a2 = iu.SBOX[a2 >>> 24] << 24 | iu.SBOX[a2 >>> 16 & 255] << 16 | iu.SBOX[a2 >>> 8 & 255] << 8 | iu.SBOX[255 & a2]), i2[o2] = i2[o2 - t2] ^ a2; + } + for (var s2 = [], u2 = 0; u2 < r2; u2++) { + var l2 = r2 - u2, c2 = i2[l2 - (u2 % 4 ? 0 : 4)]; + s2[u2] = u2 < 4 || l2 <= 4 ? c2 : iu.INV_SUB_MIX[0][iu.SBOX[c2 >>> 24]] ^ iu.INV_SUB_MIX[1][iu.SBOX[c2 >>> 16 & 255]] ^ iu.INV_SUB_MIX[2][iu.SBOX[c2 >>> 8 & 255]] ^ iu.INV_SUB_MIX[3][iu.SBOX[255 & c2]]; + } + this._nRounds = n2, this._keySchedule = i2, this._invKeySchedule = s2; + }, ou.prototype.encryptBlockRaw = function(e2) { + return nu(e2 = eu(e2), this._keySchedule, iu.SUB_MIX, iu.SBOX, this._nRounds); + }, ou.prototype.encryptBlock = function(e2) { + var t2 = this.encryptBlockRaw(e2), n2 = Xs.allocUnsafe(16); + return n2.writeUInt32BE(t2[0], 0), n2.writeUInt32BE(t2[1], 4), n2.writeUInt32BE(t2[2], 8), n2.writeUInt32BE(t2[3], 12), n2; + }, ou.prototype.decryptBlock = function(e2) { + var t2 = (e2 = eu(e2))[1]; + e2[1] = e2[3], e2[3] = t2; + var n2 = nu(e2, this._invKeySchedule, iu.INV_SUB_MIX, iu.INV_SBOX, this._nRounds), r2 = Xs.allocUnsafe(16); + return r2.writeUInt32BE(n2[0], 0), r2.writeUInt32BE(n2[3], 4), r2.writeUInt32BE(n2[2], 8), r2.writeUInt32BE(n2[1], 12), r2; + }, ou.prototype.scrub = function() { + tu(this._keySchedule), tu(this._invKeySchedule), tu(this._key); + }, Js.AES = ou; + var au = Ue().Buffer, su = au.alloc(16, 0); + function uu(e2) { + var t2 = au.allocUnsafe(16); + return t2.writeUInt32BE(e2[0] >>> 0, 0), t2.writeUInt32BE(e2[1] >>> 0, 4), t2.writeUInt32BE(e2[2] >>> 0, 8), t2.writeUInt32BE(e2[3] >>> 0, 12), t2; + } + function lu(e2) { + this.h = e2, this.state = au.alloc(16, 0), this.cache = au.allocUnsafe(0); + } + lu.prototype.ghash = function(e2) { + for (var t2 = -1; ++t2 < e2.length; ) + this.state[t2] ^= e2[t2]; + this._multiply(); + }, lu.prototype._multiply = function() { + for (var e2, t2, n2, r2 = [(e2 = this.h).readUInt32BE(0), e2.readUInt32BE(4), e2.readUInt32BE(8), e2.readUInt32BE(12)], i2 = [0, 0, 0, 0], o2 = -1; ++o2 < 128; ) { + for (0 != (this.state[~~(o2 / 8)] & 1 << 7 - o2 % 8) && (i2[0] ^= r2[0], i2[1] ^= r2[1], i2[2] ^= r2[2], i2[3] ^= r2[3]), n2 = 0 != (1 & r2[3]), t2 = 3; t2 > 0; t2--) + r2[t2] = r2[t2] >>> 1 | (1 & r2[t2 - 1]) << 31; + r2[0] = r2[0] >>> 1, n2 && (r2[0] = r2[0] ^ 225 << 24); + } + this.state = uu(i2); + }, lu.prototype.update = function(e2) { + var t2; + for (this.cache = au.concat([this.cache, e2]); this.cache.length >= 16; ) + t2 = this.cache.slice(0, 16), this.cache = this.cache.slice(16), this.ghash(t2); + }, lu.prototype.final = function(e2, t2) { + return this.cache.length && this.ghash(au.concat([this.cache, su], 16)), this.ghash(uu([0, e2, 0, t2])), this.state; + }; + var cu = lu, du = Js, fu = Ue().Buffer, hu = Do, pu = cu, mu = Ms, gu = Ks; + function vu(e2, t2, n2, r2) { + hu.call(this); + var i2 = fu.alloc(4, 0); + this._cipher = new du.AES(t2); + var o2 = this._cipher.encryptBlock(i2); + this._ghash = new pu(o2), n2 = function(e3, t3, n3) { + if (12 === t3.length) + return e3._finID = fu.concat([t3, fu.from([0, 0, 0, 1])]), fu.concat([t3, fu.from([0, 0, 0, 2])]); + var r3 = new pu(n3), i3 = t3.length, o3 = i3 % 16; + r3.update(t3), o3 && (o3 = 16 - o3, r3.update(fu.alloc(o3, 0))), r3.update(fu.alloc(8, 0)); + var a2 = 8 * i3, s2 = fu.alloc(8); + s2.writeUIntBE(a2, 0, 8), r3.update(s2), e3._finID = r3.state; + var u2 = fu.from(e3._finID); + return gu(u2), u2; + }(this, n2, o2), this._prev = fu.from(n2), this._cache = fu.allocUnsafe(0), this._secCache = fu.allocUnsafe(0), this._decrypt = r2, this._alen = 0, this._len = 0, this._mode = e2, this._authTag = null, this._called = false; + } + Ve(vu, hu), vu.prototype._update = function(e2) { + if (!this._called && this._alen) { + var t2 = 16 - this._alen % 16; + t2 < 16 && (t2 = fu.alloc(t2, 0), this._ghash.update(t2)); + } + this._called = true; + var n2 = this._mode.encrypt(this, e2); + return this._decrypt ? this._ghash.update(e2) : this._ghash.update(n2), this._len += e2.length, n2; + }, vu.prototype._final = function() { + if (this._decrypt && !this._authTag) + throw new Error("Unsupported state or unable to authenticate data"); + var e2 = mu(this._ghash.final(8 * this._alen, 8 * this._len), this._cipher.encryptBlock(this._finID)); + if (this._decrypt && function(e3, t2) { + var n2 = 0; + e3.length !== t2.length && n2++; + for (var r2 = Math.min(e3.length, t2.length), i2 = 0; i2 < r2; ++i2) + n2 += e3[i2] ^ t2[i2]; + return n2; + }(e2, this._authTag)) + throw new Error("Unsupported state or unable to authenticate data"); + this._authTag = e2, this._cipher.scrub(); + }, vu.prototype.getAuthTag = function() { + if (this._decrypt || !fu.isBuffer(this._authTag)) + throw new Error("Attempting to get auth tag in unsupported state"); + return this._authTag; + }, vu.prototype.setAuthTag = function(e2) { + if (!this._decrypt) + throw new Error("Attempting to set auth tag in unsupported state"); + this._authTag = e2; + }, vu.prototype.setAAD = function(e2) { + if (this._called) + throw new Error("Attempting to set AAD in unsupported state"); + this._ghash.update(e2), this._alen += e2.length; + }; + var bu = vu, yu = Js, wu = Ue().Buffer, _u = Do; + function Su(e2, t2, n2, r2) { + _u.call(this), this._cipher = new yu.AES(t2), this._prev = wu.from(n2), this._cache = wu.allocUnsafe(0), this._secCache = wu.allocUnsafe(0), this._decrypt = r2, this._mode = e2; + } + Ve(Su, _u), Su.prototype._update = function(e2) { + return this._mode.encrypt(this, e2, this._decrypt); + }, Su.prototype._final = function() { + this._cipher.scrub(); + }; + var Eu = Su, ku = Ue().Buffer, Mu = or; + var Cu = function(e2, t2, n2, r2) { + if (ku.isBuffer(e2) || (e2 = ku.from(e2, "binary")), t2 && (ku.isBuffer(t2) || (t2 = ku.from(t2, "binary")), 8 !== t2.length)) + throw new RangeError("salt should be Buffer with 8 byte length"); + for (var i2 = n2 / 8, o2 = ku.alloc(i2), a2 = ku.alloc(r2 || 0), s2 = ku.alloc(0); i2 > 0 || r2 > 0; ) { + var u2 = new Mu(); + u2.update(s2), u2.update(e2), t2 && u2.update(t2), s2 = u2.digest(); + var l2 = 0; + if (i2 > 0) { + var c2 = o2.length - i2; + l2 = Math.min(i2, s2.length), s2.copy(o2, c2, 0, l2), i2 -= l2; + } + if (l2 < s2.length && r2 > 0) { + var d2 = a2.length - r2, f2 = Math.min(r2, s2.length - l2); + s2.copy(a2, d2, l2, l2 + f2), r2 -= f2; + } + } + return s2.fill(0), { key: o2, iv: a2 }; + }, xu = Qs, Au = bu, Ru = Ue().Buffer, Tu = Eu, Pu = Do, Lu = Js, Iu = Cu; + function Ou(e2, t2, n2) { + Pu.call(this), this._cache = new Du(), this._cipher = new Lu.AES(t2), this._prev = Ru.from(n2), this._mode = e2, this._autopadding = true; + } + Ve(Ou, Pu), Ou.prototype._update = function(e2) { + var t2, n2; + this._cache.add(e2); + for (var r2 = []; t2 = this._cache.get(); ) + n2 = this._mode.encrypt(this, t2), r2.push(n2); + return Ru.concat(r2); + }; + var Nu = Ru.alloc(16, 16); + function Du() { + this.cache = Ru.allocUnsafe(0); + } + function ju(e2, t2, n2) { + var r2 = xu[e2.toLowerCase()]; + if (!r2) + throw new TypeError("invalid suite type"); + if ("string" == typeof t2 && (t2 = Ru.from(t2)), t2.length !== r2.key / 8) + throw new TypeError("invalid key length " + t2.length); + if ("string" == typeof n2 && (n2 = Ru.from(n2)), "GCM" !== r2.mode && n2.length !== r2.iv) + throw new TypeError("invalid iv length " + n2.length); + return "stream" === r2.type ? new Tu(r2.module, t2, n2) : "auth" === r2.type ? new Au(r2.module, t2, n2) : new Ou(r2.module, t2, n2); + } + Ou.prototype._final = function() { + var e2 = this._cache.flush(); + if (this._autopadding) + return e2 = this._mode.encrypt(this, e2), this._cipher.scrub(), e2; + if (!e2.equals(Nu)) + throw this._cipher.scrub(), new Error("data not multiple of block length"); + }, Ou.prototype.setAutoPadding = function(e2) { + return this._autopadding = !!e2, this; + }, Du.prototype.add = function(e2) { + this.cache = Ru.concat([this.cache, e2]); + }, Du.prototype.get = function() { + if (this.cache.length > 15) { + var e2 = this.cache.slice(0, 16); + return this.cache = this.cache.slice(16), e2; + } + return null; + }, Du.prototype.flush = function() { + for (var e2 = 16 - this.cache.length, t2 = Ru.allocUnsafe(e2), n2 = -1; ++n2 < e2; ) + t2.writeUInt8(e2, n2); + return Ru.concat([this.cache, t2]); + }, Ss.createCipheriv = ju, Ss.createCipher = function(e2, t2) { + var n2 = xu[e2.toLowerCase()]; + if (!n2) + throw new TypeError("invalid suite type"); + var r2 = Iu(t2, false, n2.key, n2.iv); + return ju(e2, r2.key, r2.iv); + }; + var Bu = {}, zu = bu, Uu = Ue().Buffer, Fu = Qs, Ku = Eu, qu = Do, Hu = Js, Wu = Cu; + function $u(e2, t2, n2) { + qu.call(this), this._cache = new Vu(), this._last = void 0, this._cipher = new Hu.AES(t2), this._prev = Uu.from(n2), this._mode = e2, this._autopadding = true; + } + function Vu() { + this.cache = Uu.allocUnsafe(0); + } + function Yu(e2, t2, n2) { + var r2 = Fu[e2.toLowerCase()]; + if (!r2) + throw new TypeError("invalid suite type"); + if ("string" == typeof n2 && (n2 = Uu.from(n2)), "GCM" !== r2.mode && n2.length !== r2.iv) + throw new TypeError("invalid iv length " + n2.length); + if ("string" == typeof t2 && (t2 = Uu.from(t2)), t2.length !== r2.key / 8) + throw new TypeError("invalid key length " + t2.length); + return "stream" === r2.type ? new Ku(r2.module, t2, n2, true) : "auth" === r2.type ? new zu(r2.module, t2, n2, true) : new $u(r2.module, t2, n2); + } + Ve($u, qu), $u.prototype._update = function(e2) { + var t2, n2; + this._cache.add(e2); + for (var r2 = []; t2 = this._cache.get(this._autopadding); ) + n2 = this._mode.decrypt(this, t2), r2.push(n2); + return Uu.concat(r2); + }, $u.prototype._final = function() { + var e2 = this._cache.flush(); + if (this._autopadding) + return function(e3) { + var t2 = e3[15]; + if (t2 < 1 || t2 > 16) + throw new Error("unable to decrypt data"); + var n2 = -1; + for (; ++n2 < t2; ) + if (e3[n2 + (16 - t2)] !== t2) + throw new Error("unable to decrypt data"); + if (16 === t2) + return; + return e3.slice(0, 16 - t2); + }(this._mode.decrypt(this, e2)); + if (e2) + throw new Error("data not multiple of block length"); + }, $u.prototype.setAutoPadding = function(e2) { + return this._autopadding = !!e2, this; + }, Vu.prototype.add = function(e2) { + this.cache = Uu.concat([this.cache, e2]); + }, Vu.prototype.get = function(e2) { + var t2; + if (e2) { + if (this.cache.length > 16) + return t2 = this.cache.slice(0, 16), this.cache = this.cache.slice(16), t2; + } else if (this.cache.length >= 16) + return t2 = this.cache.slice(0, 16), this.cache = this.cache.slice(16), t2; + return null; + }, Vu.prototype.flush = function() { + if (this.cache.length) + return this.cache; + }, Bu.createDecipher = function(e2, t2) { + var n2 = Fu[e2.toLowerCase()]; + if (!n2) + throw new TypeError("invalid suite type"); + var r2 = Wu(t2, false, n2.key, n2.iv); + return Yu(e2, r2.key, r2.iv); + }, Bu.createDecipheriv = Yu; + var Gu = Ss, Zu = Bu, Qu = Vs; + _s.createCipher = _s.Cipher = Gu.createCipher, _s.createCipheriv = _s.Cipheriv = Gu.createCipheriv, _s.createDecipher = _s.Decipher = Zu.createDecipher, _s.createDecipheriv = _s.Decipheriv = Zu.createDecipheriv, _s.listCiphers = _s.getCiphers = function() { + return Object.keys(Qu); + }; + var Ju = {}; + !function(e2) { + e2["des-ecb"] = { key: 8, iv: 0 }, e2["des-cbc"] = e2.des = { key: 8, iv: 8 }, e2["des-ede3-cbc"] = e2.des3 = { key: 24, iv: 8 }, e2["des-ede3"] = { key: 24, iv: 0 }, e2["des-ede-cbc"] = { key: 16, iv: 8 }, e2["des-ede"] = { key: 16, iv: 0 }; + }(Ju); + var Xu = ys, el = _s, tl = Qs, nl = Ju, rl = Cu; + function il(e2, t2, n2) { + if (e2 = e2.toLowerCase(), tl[e2]) + return el.createCipheriv(e2, t2, n2); + if (nl[e2]) + return new Xu({ key: t2, iv: n2, mode: e2 }); + throw new TypeError("invalid suite type"); + } + function ol(e2, t2, n2) { + if (e2 = e2.toLowerCase(), tl[e2]) + return el.createDecipheriv(e2, t2, n2); + if (nl[e2]) + return new Xu({ key: t2, iv: n2, mode: e2, decrypt: true }); + throw new TypeError("invalid suite type"); + } + za.createCipher = za.Cipher = function(e2, t2) { + var n2, r2; + if (e2 = e2.toLowerCase(), tl[e2]) + n2 = tl[e2].key, r2 = tl[e2].iv; + else { + if (!nl[e2]) + throw new TypeError("invalid suite type"); + n2 = 8 * nl[e2].key, r2 = nl[e2].iv; + } + var i2 = rl(t2, false, n2, r2); + return il(e2, i2.key, i2.iv); + }, za.createCipheriv = za.Cipheriv = il, za.createDecipher = za.Decipher = function(e2, t2) { + var n2, r2; + if (e2 = e2.toLowerCase(), tl[e2]) + n2 = tl[e2].key, r2 = tl[e2].iv; + else { + if (!nl[e2]) + throw new TypeError("invalid suite type"); + n2 = 8 * nl[e2].key, r2 = nl[e2].iv; + } + var i2 = rl(t2, false, n2, r2); + return ol(e2, i2.key, i2.iv); + }, za.createDecipheriv = za.Decipheriv = ol, za.listCiphers = za.getCiphers = function() { + return Object.keys(nl).concat(el.getCiphers()); + }; + var al = {}, sl = { exports: {} }; + !function(e2) { + !function(e3, t2) { + function n2(e4, t3) { + if (!e4) + throw new Error(t3 || "Assertion failed"); + } + function r2(e4, t3) { + e4.super_ = t3; + var n3 = function() { + }; + n3.prototype = t3.prototype, e4.prototype = new n3(), e4.prototype.constructor = e4; + } + function i2(e4, t3, n3) { + if (i2.isBN(e4)) + return e4; + this.negative = 0, this.words = null, this.length = 0, this.red = null, null !== e4 && ("le" !== t3 && "be" !== t3 || (n3 = t3, t3 = 10), this._init(e4 || 0, t3 || 10, n3 || "be")); + } + var o2; + "object" == typeof e3 ? e3.exports = i2 : t2.BN = i2, i2.BN = i2, i2.wordSize = 26; + try { + o2 = "undefined" != typeof window && void 0 !== window.Buffer ? window.Buffer : ce.Buffer; + } catch (e4) { + } + function a2(e4, t3) { + var n3 = e4.charCodeAt(t3); + return n3 >= 65 && n3 <= 70 ? n3 - 55 : n3 >= 97 && n3 <= 102 ? n3 - 87 : n3 - 48 & 15; + } + function s2(e4, t3, n3) { + var r3 = a2(e4, n3); + return n3 - 1 >= t3 && (r3 |= a2(e4, n3 - 1) << 4), r3; + } + function u2(e4, t3, n3, r3) { + for (var i3 = 0, o3 = Math.min(e4.length, n3), a3 = t3; a3 < o3; a3++) { + var s3 = e4.charCodeAt(a3) - 48; + i3 *= r3, i3 += s3 >= 49 ? s3 - 49 + 10 : s3 >= 17 ? s3 - 17 + 10 : s3; + } + return i3; + } + i2.isBN = function(e4) { + return e4 instanceof i2 || null !== e4 && "object" == typeof e4 && e4.constructor.wordSize === i2.wordSize && Array.isArray(e4.words); + }, i2.max = function(e4, t3) { + return e4.cmp(t3) > 0 ? e4 : t3; + }, i2.min = function(e4, t3) { + return e4.cmp(t3) < 0 ? e4 : t3; + }, i2.prototype._init = function(e4, t3, r3) { + if ("number" == typeof e4) + return this._initNumber(e4, t3, r3); + if ("object" == typeof e4) + return this._initArray(e4, t3, r3); + "hex" === t3 && (t3 = 16), n2(t3 === (0 | t3) && t3 >= 2 && t3 <= 36); + var i3 = 0; + "-" === (e4 = e4.toString().replace(/\s+/g, ""))[0] && (i3++, this.negative = 1), i3 < e4.length && (16 === t3 ? this._parseHex(e4, i3, r3) : (this._parseBase(e4, t3, i3), "le" === r3 && this._initArray(this.toArray(), t3, r3))); + }, i2.prototype._initNumber = function(e4, t3, r3) { + e4 < 0 && (this.negative = 1, e4 = -e4), e4 < 67108864 ? (this.words = [67108863 & e4], this.length = 1) : e4 < 4503599627370496 ? (this.words = [67108863 & e4, e4 / 67108864 & 67108863], this.length = 2) : (n2(e4 < 9007199254740992), this.words = [67108863 & e4, e4 / 67108864 & 67108863, 1], this.length = 3), "le" === r3 && this._initArray(this.toArray(), t3, r3); + }, i2.prototype._initArray = function(e4, t3, r3) { + if (n2("number" == typeof e4.length), e4.length <= 0) + return this.words = [0], this.length = 1, this; + this.length = Math.ceil(e4.length / 3), this.words = new Array(this.length); + for (var i3 = 0; i3 < this.length; i3++) + this.words[i3] = 0; + var o3, a3, s3 = 0; + if ("be" === r3) + for (i3 = e4.length - 1, o3 = 0; i3 >= 0; i3 -= 3) + a3 = e4[i3] | e4[i3 - 1] << 8 | e4[i3 - 2] << 16, this.words[o3] |= a3 << s3 & 67108863, this.words[o3 + 1] = a3 >>> 26 - s3 & 67108863, (s3 += 24) >= 26 && (s3 -= 26, o3++); + else if ("le" === r3) + for (i3 = 0, o3 = 0; i3 < e4.length; i3 += 3) + a3 = e4[i3] | e4[i3 + 1] << 8 | e4[i3 + 2] << 16, this.words[o3] |= a3 << s3 & 67108863, this.words[o3 + 1] = a3 >>> 26 - s3 & 67108863, (s3 += 24) >= 26 && (s3 -= 26, o3++); + return this.strip(); + }, i2.prototype._parseHex = function(e4, t3, n3) { + this.length = Math.ceil((e4.length - t3) / 6), this.words = new Array(this.length); + for (var r3 = 0; r3 < this.length; r3++) + this.words[r3] = 0; + var i3, o3 = 0, a3 = 0; + if ("be" === n3) + for (r3 = e4.length - 1; r3 >= t3; r3 -= 2) + i3 = s2(e4, t3, r3) << o3, this.words[a3] |= 67108863 & i3, o3 >= 18 ? (o3 -= 18, a3 += 1, this.words[a3] |= i3 >>> 26) : o3 += 8; + else + for (r3 = (e4.length - t3) % 2 == 0 ? t3 + 1 : t3; r3 < e4.length; r3 += 2) + i3 = s2(e4, t3, r3) << o3, this.words[a3] |= 67108863 & i3, o3 >= 18 ? (o3 -= 18, a3 += 1, this.words[a3] |= i3 >>> 26) : o3 += 8; + this.strip(); + }, i2.prototype._parseBase = function(e4, t3, n3) { + this.words = [0], this.length = 1; + for (var r3 = 0, i3 = 1; i3 <= 67108863; i3 *= t3) + r3++; + r3--, i3 = i3 / t3 | 0; + for (var o3 = e4.length - n3, a3 = o3 % r3, s3 = Math.min(o3, o3 - a3) + n3, l3 = 0, c3 = n3; c3 < s3; c3 += r3) + l3 = u2(e4, c3, c3 + r3, t3), this.imuln(i3), this.words[0] + l3 < 67108864 ? this.words[0] += l3 : this._iaddn(l3); + if (0 !== a3) { + var d3 = 1; + for (l3 = u2(e4, c3, e4.length, t3), c3 = 0; c3 < a3; c3++) + d3 *= t3; + this.imuln(d3), this.words[0] + l3 < 67108864 ? this.words[0] += l3 : this._iaddn(l3); + } + this.strip(); + }, i2.prototype.copy = function(e4) { + e4.words = new Array(this.length); + for (var t3 = 0; t3 < this.length; t3++) + e4.words[t3] = this.words[t3]; + e4.length = this.length, e4.negative = this.negative, e4.red = this.red; + }, i2.prototype.clone = function() { + var e4 = new i2(null); + return this.copy(e4), e4; + }, i2.prototype._expand = function(e4) { + for (; this.length < e4; ) + this.words[this.length++] = 0; + return this; + }, i2.prototype.strip = function() { + for (; this.length > 1 && 0 === this.words[this.length - 1]; ) + this.length--; + return this._normSign(); + }, i2.prototype._normSign = function() { + return 1 === this.length && 0 === this.words[0] && (this.negative = 0), this; + }, i2.prototype.inspect = function() { + return (this.red ? ""; + }; + var l2 = ["", "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"], c2 = [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], d2 = [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]; + function f2(e4, t3, n3) { + n3.negative = t3.negative ^ e4.negative; + var r3 = e4.length + t3.length | 0; + n3.length = r3, r3 = r3 - 1 | 0; + var i3 = 0 | e4.words[0], o3 = 0 | t3.words[0], a3 = i3 * o3, s3 = 67108863 & a3, u3 = a3 / 67108864 | 0; + n3.words[0] = s3; + for (var l3 = 1; l3 < r3; l3++) { + for (var c3 = u3 >>> 26, d3 = 67108863 & u3, f3 = Math.min(l3, t3.length - 1), h3 = Math.max(0, l3 - e4.length + 1); h3 <= f3; h3++) { + var p3 = l3 - h3 | 0; + c3 += (a3 = (i3 = 0 | e4.words[p3]) * (o3 = 0 | t3.words[h3]) + d3) / 67108864 | 0, d3 = 67108863 & a3; + } + n3.words[l3] = 0 | d3, u3 = 0 | c3; + } + return 0 !== u3 ? n3.words[l3] = 0 | u3 : n3.length--, n3.strip(); + } + i2.prototype.toString = function(e4, t3) { + var r3; + if (t3 = 0 | t3 || 1, 16 === (e4 = e4 || 10) || "hex" === e4) { + r3 = ""; + for (var i3 = 0, o3 = 0, a3 = 0; a3 < this.length; a3++) { + var s3 = this.words[a3], u3 = (16777215 & (s3 << i3 | o3)).toString(16); + r3 = 0 !== (o3 = s3 >>> 24 - i3 & 16777215) || a3 !== this.length - 1 ? l2[6 - u3.length] + u3 + r3 : u3 + r3, (i3 += 2) >= 26 && (i3 -= 26, a3--); + } + for (0 !== o3 && (r3 = o3.toString(16) + r3); r3.length % t3 != 0; ) + r3 = "0" + r3; + return 0 !== this.negative && (r3 = "-" + r3), r3; + } + if (e4 === (0 | e4) && e4 >= 2 && e4 <= 36) { + var f3 = c2[e4], h3 = d2[e4]; + r3 = ""; + var p3 = this.clone(); + for (p3.negative = 0; !p3.isZero(); ) { + var m3 = p3.modn(h3).toString(e4); + r3 = (p3 = p3.idivn(h3)).isZero() ? m3 + r3 : l2[f3 - m3.length] + m3 + r3; + } + for (this.isZero() && (r3 = "0" + r3); r3.length % t3 != 0; ) + r3 = "0" + r3; + return 0 !== this.negative && (r3 = "-" + r3), r3; + } + n2(false, "Base should be between 2 and 36"); + }, i2.prototype.toNumber = function() { + var e4 = this.words[0]; + return 2 === this.length ? e4 += 67108864 * this.words[1] : 3 === this.length && 1 === this.words[2] ? e4 += 4503599627370496 + 67108864 * this.words[1] : this.length > 2 && n2(false, "Number can only safely store up to 53 bits"), 0 !== this.negative ? -e4 : e4; + }, i2.prototype.toJSON = function() { + return this.toString(16); + }, i2.prototype.toBuffer = function(e4, t3) { + return n2(void 0 !== o2), this.toArrayLike(o2, e4, t3); + }, i2.prototype.toArray = function(e4, t3) { + return this.toArrayLike(Array, e4, t3); + }, i2.prototype.toArrayLike = function(e4, t3, r3) { + var i3 = this.byteLength(), o3 = r3 || Math.max(1, i3); + n2(i3 <= o3, "byte array longer than desired length"), n2(o3 > 0, "Requested array length <= 0"), this.strip(); + var a3, s3, u3 = "le" === t3, l3 = new e4(o3), c3 = this.clone(); + if (u3) { + for (s3 = 0; !c3.isZero(); s3++) + a3 = c3.andln(255), c3.iushrn(8), l3[s3] = a3; + for (; s3 < o3; s3++) + l3[s3] = 0; + } else { + for (s3 = 0; s3 < o3 - i3; s3++) + l3[s3] = 0; + for (s3 = 0; !c3.isZero(); s3++) + a3 = c3.andln(255), c3.iushrn(8), l3[o3 - s3 - 1] = a3; + } + return l3; + }, Math.clz32 ? i2.prototype._countBits = function(e4) { + return 32 - Math.clz32(e4); + } : i2.prototype._countBits = function(e4) { + var t3 = e4, n3 = 0; + return t3 >= 4096 && (n3 += 13, t3 >>>= 13), t3 >= 64 && (n3 += 7, t3 >>>= 7), t3 >= 8 && (n3 += 4, t3 >>>= 4), t3 >= 2 && (n3 += 2, t3 >>>= 2), n3 + t3; + }, i2.prototype._zeroBits = function(e4) { + if (0 === e4) + return 26; + var t3 = e4, n3 = 0; + return 0 == (8191 & t3) && (n3 += 13, t3 >>>= 13), 0 == (127 & t3) && (n3 += 7, t3 >>>= 7), 0 == (15 & t3) && (n3 += 4, t3 >>>= 4), 0 == (3 & t3) && (n3 += 2, t3 >>>= 2), 0 == (1 & t3) && n3++, n3; + }, i2.prototype.bitLength = function() { + var e4 = this.words[this.length - 1], t3 = this._countBits(e4); + return 26 * (this.length - 1) + t3; + }, i2.prototype.zeroBits = function() { + if (this.isZero()) + return 0; + for (var e4 = 0, t3 = 0; t3 < this.length; t3++) { + var n3 = this._zeroBits(this.words[t3]); + if (e4 += n3, 26 !== n3) + break; + } + return e4; + }, i2.prototype.byteLength = function() { + return Math.ceil(this.bitLength() / 8); + }, i2.prototype.toTwos = function(e4) { + return 0 !== this.negative ? this.abs().inotn(e4).iaddn(1) : this.clone(); + }, i2.prototype.fromTwos = function(e4) { + return this.testn(e4 - 1) ? this.notn(e4).iaddn(1).ineg() : this.clone(); + }, i2.prototype.isNeg = function() { + return 0 !== this.negative; + }, i2.prototype.neg = function() { + return this.clone().ineg(); + }, i2.prototype.ineg = function() { + return this.isZero() || (this.negative ^= 1), this; + }, i2.prototype.iuor = function(e4) { + for (; this.length < e4.length; ) + this.words[this.length++] = 0; + for (var t3 = 0; t3 < e4.length; t3++) + this.words[t3] = this.words[t3] | e4.words[t3]; + return this.strip(); + }, i2.prototype.ior = function(e4) { + return n2(0 == (this.negative | e4.negative)), this.iuor(e4); + }, i2.prototype.or = function(e4) { + return this.length > e4.length ? this.clone().ior(e4) : e4.clone().ior(this); + }, i2.prototype.uor = function(e4) { + return this.length > e4.length ? this.clone().iuor(e4) : e4.clone().iuor(this); + }, i2.prototype.iuand = function(e4) { + var t3; + t3 = this.length > e4.length ? e4 : this; + for (var n3 = 0; n3 < t3.length; n3++) + this.words[n3] = this.words[n3] & e4.words[n3]; + return this.length = t3.length, this.strip(); + }, i2.prototype.iand = function(e4) { + return n2(0 == (this.negative | e4.negative)), this.iuand(e4); + }, i2.prototype.and = function(e4) { + return this.length > e4.length ? this.clone().iand(e4) : e4.clone().iand(this); + }, i2.prototype.uand = function(e4) { + return this.length > e4.length ? this.clone().iuand(e4) : e4.clone().iuand(this); + }, i2.prototype.iuxor = function(e4) { + var t3, n3; + this.length > e4.length ? (t3 = this, n3 = e4) : (t3 = e4, n3 = this); + for (var r3 = 0; r3 < n3.length; r3++) + this.words[r3] = t3.words[r3] ^ n3.words[r3]; + if (this !== t3) + for (; r3 < t3.length; r3++) + this.words[r3] = t3.words[r3]; + return this.length = t3.length, this.strip(); + }, i2.prototype.ixor = function(e4) { + return n2(0 == (this.negative | e4.negative)), this.iuxor(e4); + }, i2.prototype.xor = function(e4) { + return this.length > e4.length ? this.clone().ixor(e4) : e4.clone().ixor(this); + }, i2.prototype.uxor = function(e4) { + return this.length > e4.length ? this.clone().iuxor(e4) : e4.clone().iuxor(this); + }, i2.prototype.inotn = function(e4) { + n2("number" == typeof e4 && e4 >= 0); + var t3 = 0 | Math.ceil(e4 / 26), r3 = e4 % 26; + this._expand(t3), r3 > 0 && t3--; + for (var i3 = 0; i3 < t3; i3++) + this.words[i3] = 67108863 & ~this.words[i3]; + return r3 > 0 && (this.words[i3] = ~this.words[i3] & 67108863 >> 26 - r3), this.strip(); + }, i2.prototype.notn = function(e4) { + return this.clone().inotn(e4); + }, i2.prototype.setn = function(e4, t3) { + n2("number" == typeof e4 && e4 >= 0); + var r3 = e4 / 26 | 0, i3 = e4 % 26; + return this._expand(r3 + 1), this.words[r3] = t3 ? this.words[r3] | 1 << i3 : this.words[r3] & ~(1 << i3), this.strip(); + }, i2.prototype.iadd = function(e4) { + var t3, n3, r3; + if (0 !== this.negative && 0 === e4.negative) + return this.negative = 0, t3 = this.isub(e4), this.negative ^= 1, this._normSign(); + if (0 === this.negative && 0 !== e4.negative) + return e4.negative = 0, t3 = this.isub(e4), e4.negative = 1, t3._normSign(); + this.length > e4.length ? (n3 = this, r3 = e4) : (n3 = e4, r3 = this); + for (var i3 = 0, o3 = 0; o3 < r3.length; o3++) + t3 = (0 | n3.words[o3]) + (0 | r3.words[o3]) + i3, this.words[o3] = 67108863 & t3, i3 = t3 >>> 26; + for (; 0 !== i3 && o3 < n3.length; o3++) + t3 = (0 | n3.words[o3]) + i3, this.words[o3] = 67108863 & t3, i3 = t3 >>> 26; + if (this.length = n3.length, 0 !== i3) + this.words[this.length] = i3, this.length++; + else if (n3 !== this) + for (; o3 < n3.length; o3++) + this.words[o3] = n3.words[o3]; + return this; + }, i2.prototype.add = function(e4) { + var t3; + return 0 !== e4.negative && 0 === this.negative ? (e4.negative = 0, t3 = this.sub(e4), e4.negative ^= 1, t3) : 0 === e4.negative && 0 !== this.negative ? (this.negative = 0, t3 = e4.sub(this), this.negative = 1, t3) : this.length > e4.length ? this.clone().iadd(e4) : e4.clone().iadd(this); + }, i2.prototype.isub = function(e4) { + if (0 !== e4.negative) { + e4.negative = 0; + var t3 = this.iadd(e4); + return e4.negative = 1, t3._normSign(); + } + if (0 !== this.negative) + return this.negative = 0, this.iadd(e4), this.negative = 1, this._normSign(); + var n3, r3, i3 = this.cmp(e4); + if (0 === i3) + return this.negative = 0, this.length = 1, this.words[0] = 0, this; + i3 > 0 ? (n3 = this, r3 = e4) : (n3 = e4, r3 = this); + for (var o3 = 0, a3 = 0; a3 < r3.length; a3++) + o3 = (t3 = (0 | n3.words[a3]) - (0 | r3.words[a3]) + o3) >> 26, this.words[a3] = 67108863 & t3; + for (; 0 !== o3 && a3 < n3.length; a3++) + o3 = (t3 = (0 | n3.words[a3]) + o3) >> 26, this.words[a3] = 67108863 & t3; + if (0 === o3 && a3 < n3.length && n3 !== this) + for (; a3 < n3.length; a3++) + this.words[a3] = n3.words[a3]; + return this.length = Math.max(this.length, a3), n3 !== this && (this.negative = 1), this.strip(); + }, i2.prototype.sub = function(e4) { + return this.clone().isub(e4); + }; + var h2 = function(e4, t3, n3) { + var r3, i3, o3, a3 = e4.words, s3 = t3.words, u3 = n3.words, l3 = 0, c3 = 0 | a3[0], d3 = 8191 & c3, f3 = c3 >>> 13, h3 = 0 | a3[1], p3 = 8191 & h3, m3 = h3 >>> 13, g3 = 0 | a3[2], v3 = 8191 & g3, b3 = g3 >>> 13, y3 = 0 | a3[3], w3 = 8191 & y3, _3 = y3 >>> 13, S3 = 0 | a3[4], E3 = 8191 & S3, k2 = S3 >>> 13, M2 = 0 | a3[5], C2 = 8191 & M2, x2 = M2 >>> 13, A2 = 0 | a3[6], R2 = 8191 & A2, T2 = A2 >>> 13, P2 = 0 | a3[7], L2 = 8191 & P2, I2 = P2 >>> 13, O2 = 0 | a3[8], N2 = 8191 & O2, D2 = O2 >>> 13, j2 = 0 | a3[9], B2 = 8191 & j2, z2 = j2 >>> 13, U2 = 0 | s3[0], F2 = 8191 & U2, K2 = U2 >>> 13, q2 = 0 | s3[1], H2 = 8191 & q2, W2 = q2 >>> 13, $2 = 0 | s3[2], V2 = 8191 & $2, Y2 = $2 >>> 13, G2 = 0 | s3[3], Z2 = 8191 & G2, Q2 = G2 >>> 13, J2 = 0 | s3[4], X2 = 8191 & J2, ee2 = J2 >>> 13, te2 = 0 | s3[5], ne2 = 8191 & te2, re2 = te2 >>> 13, ie2 = 0 | s3[6], oe2 = 8191 & ie2, ae2 = ie2 >>> 13, se2 = 0 | s3[7], ue2 = 8191 & se2, le2 = se2 >>> 13, ce2 = 0 | s3[8], de2 = 8191 & ce2, fe2 = ce2 >>> 13, he2 = 0 | s3[9], pe2 = 8191 & he2, me2 = he2 >>> 13; + n3.negative = e4.negative ^ t3.negative, n3.length = 19; + var ge2 = (l3 + (r3 = Math.imul(d3, F2)) | 0) + ((8191 & (i3 = (i3 = Math.imul(d3, K2)) + Math.imul(f3, F2) | 0)) << 13) | 0; + l3 = ((o3 = Math.imul(f3, K2)) + (i3 >>> 13) | 0) + (ge2 >>> 26) | 0, ge2 &= 67108863, r3 = Math.imul(p3, F2), i3 = (i3 = Math.imul(p3, K2)) + Math.imul(m3, F2) | 0, o3 = Math.imul(m3, K2); + var ve2 = (l3 + (r3 = r3 + Math.imul(d3, H2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, W2) | 0) + Math.imul(f3, H2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, W2) | 0) + (i3 >>> 13) | 0) + (ve2 >>> 26) | 0, ve2 &= 67108863, r3 = Math.imul(v3, F2), i3 = (i3 = Math.imul(v3, K2)) + Math.imul(b3, F2) | 0, o3 = Math.imul(b3, K2), r3 = r3 + Math.imul(p3, H2) | 0, i3 = (i3 = i3 + Math.imul(p3, W2) | 0) + Math.imul(m3, H2) | 0, o3 = o3 + Math.imul(m3, W2) | 0; + var be2 = (l3 + (r3 = r3 + Math.imul(d3, V2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, Y2) | 0) + Math.imul(f3, V2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, Y2) | 0) + (i3 >>> 13) | 0) + (be2 >>> 26) | 0, be2 &= 67108863, r3 = Math.imul(w3, F2), i3 = (i3 = Math.imul(w3, K2)) + Math.imul(_3, F2) | 0, o3 = Math.imul(_3, K2), r3 = r3 + Math.imul(v3, H2) | 0, i3 = (i3 = i3 + Math.imul(v3, W2) | 0) + Math.imul(b3, H2) | 0, o3 = o3 + Math.imul(b3, W2) | 0, r3 = r3 + Math.imul(p3, V2) | 0, i3 = (i3 = i3 + Math.imul(p3, Y2) | 0) + Math.imul(m3, V2) | 0, o3 = o3 + Math.imul(m3, Y2) | 0; + var ye2 = (l3 + (r3 = r3 + Math.imul(d3, Z2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, Q2) | 0) + Math.imul(f3, Z2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, Q2) | 0) + (i3 >>> 13) | 0) + (ye2 >>> 26) | 0, ye2 &= 67108863, r3 = Math.imul(E3, F2), i3 = (i3 = Math.imul(E3, K2)) + Math.imul(k2, F2) | 0, o3 = Math.imul(k2, K2), r3 = r3 + Math.imul(w3, H2) | 0, i3 = (i3 = i3 + Math.imul(w3, W2) | 0) + Math.imul(_3, H2) | 0, o3 = o3 + Math.imul(_3, W2) | 0, r3 = r3 + Math.imul(v3, V2) | 0, i3 = (i3 = i3 + Math.imul(v3, Y2) | 0) + Math.imul(b3, V2) | 0, o3 = o3 + Math.imul(b3, Y2) | 0, r3 = r3 + Math.imul(p3, Z2) | 0, i3 = (i3 = i3 + Math.imul(p3, Q2) | 0) + Math.imul(m3, Z2) | 0, o3 = o3 + Math.imul(m3, Q2) | 0; + var we2 = (l3 + (r3 = r3 + Math.imul(d3, X2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, ee2) | 0) + Math.imul(f3, X2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, ee2) | 0) + (i3 >>> 13) | 0) + (we2 >>> 26) | 0, we2 &= 67108863, r3 = Math.imul(C2, F2), i3 = (i3 = Math.imul(C2, K2)) + Math.imul(x2, F2) | 0, o3 = Math.imul(x2, K2), r3 = r3 + Math.imul(E3, H2) | 0, i3 = (i3 = i3 + Math.imul(E3, W2) | 0) + Math.imul(k2, H2) | 0, o3 = o3 + Math.imul(k2, W2) | 0, r3 = r3 + Math.imul(w3, V2) | 0, i3 = (i3 = i3 + Math.imul(w3, Y2) | 0) + Math.imul(_3, V2) | 0, o3 = o3 + Math.imul(_3, Y2) | 0, r3 = r3 + Math.imul(v3, Z2) | 0, i3 = (i3 = i3 + Math.imul(v3, Q2) | 0) + Math.imul(b3, Z2) | 0, o3 = o3 + Math.imul(b3, Q2) | 0, r3 = r3 + Math.imul(p3, X2) | 0, i3 = (i3 = i3 + Math.imul(p3, ee2) | 0) + Math.imul(m3, X2) | 0, o3 = o3 + Math.imul(m3, ee2) | 0; + var _e2 = (l3 + (r3 = r3 + Math.imul(d3, ne2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, re2) | 0) + Math.imul(f3, ne2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, re2) | 0) + (i3 >>> 13) | 0) + (_e2 >>> 26) | 0, _e2 &= 67108863, r3 = Math.imul(R2, F2), i3 = (i3 = Math.imul(R2, K2)) + Math.imul(T2, F2) | 0, o3 = Math.imul(T2, K2), r3 = r3 + Math.imul(C2, H2) | 0, i3 = (i3 = i3 + Math.imul(C2, W2) | 0) + Math.imul(x2, H2) | 0, o3 = o3 + Math.imul(x2, W2) | 0, r3 = r3 + Math.imul(E3, V2) | 0, i3 = (i3 = i3 + Math.imul(E3, Y2) | 0) + Math.imul(k2, V2) | 0, o3 = o3 + Math.imul(k2, Y2) | 0, r3 = r3 + Math.imul(w3, Z2) | 0, i3 = (i3 = i3 + Math.imul(w3, Q2) | 0) + Math.imul(_3, Z2) | 0, o3 = o3 + Math.imul(_3, Q2) | 0, r3 = r3 + Math.imul(v3, X2) | 0, i3 = (i3 = i3 + Math.imul(v3, ee2) | 0) + Math.imul(b3, X2) | 0, o3 = o3 + Math.imul(b3, ee2) | 0, r3 = r3 + Math.imul(p3, ne2) | 0, i3 = (i3 = i3 + Math.imul(p3, re2) | 0) + Math.imul(m3, ne2) | 0, o3 = o3 + Math.imul(m3, re2) | 0; + var Se2 = (l3 + (r3 = r3 + Math.imul(d3, oe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, ae2) | 0) + Math.imul(f3, oe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, ae2) | 0) + (i3 >>> 13) | 0) + (Se2 >>> 26) | 0, Se2 &= 67108863, r3 = Math.imul(L2, F2), i3 = (i3 = Math.imul(L2, K2)) + Math.imul(I2, F2) | 0, o3 = Math.imul(I2, K2), r3 = r3 + Math.imul(R2, H2) | 0, i3 = (i3 = i3 + Math.imul(R2, W2) | 0) + Math.imul(T2, H2) | 0, o3 = o3 + Math.imul(T2, W2) | 0, r3 = r3 + Math.imul(C2, V2) | 0, i3 = (i3 = i3 + Math.imul(C2, Y2) | 0) + Math.imul(x2, V2) | 0, o3 = o3 + Math.imul(x2, Y2) | 0, r3 = r3 + Math.imul(E3, Z2) | 0, i3 = (i3 = i3 + Math.imul(E3, Q2) | 0) + Math.imul(k2, Z2) | 0, o3 = o3 + Math.imul(k2, Q2) | 0, r3 = r3 + Math.imul(w3, X2) | 0, i3 = (i3 = i3 + Math.imul(w3, ee2) | 0) + Math.imul(_3, X2) | 0, o3 = o3 + Math.imul(_3, ee2) | 0, r3 = r3 + Math.imul(v3, ne2) | 0, i3 = (i3 = i3 + Math.imul(v3, re2) | 0) + Math.imul(b3, ne2) | 0, o3 = o3 + Math.imul(b3, re2) | 0, r3 = r3 + Math.imul(p3, oe2) | 0, i3 = (i3 = i3 + Math.imul(p3, ae2) | 0) + Math.imul(m3, oe2) | 0, o3 = o3 + Math.imul(m3, ae2) | 0; + var Ee2 = (l3 + (r3 = r3 + Math.imul(d3, ue2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, le2) | 0) + Math.imul(f3, ue2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, le2) | 0) + (i3 >>> 13) | 0) + (Ee2 >>> 26) | 0, Ee2 &= 67108863, r3 = Math.imul(N2, F2), i3 = (i3 = Math.imul(N2, K2)) + Math.imul(D2, F2) | 0, o3 = Math.imul(D2, K2), r3 = r3 + Math.imul(L2, H2) | 0, i3 = (i3 = i3 + Math.imul(L2, W2) | 0) + Math.imul(I2, H2) | 0, o3 = o3 + Math.imul(I2, W2) | 0, r3 = r3 + Math.imul(R2, V2) | 0, i3 = (i3 = i3 + Math.imul(R2, Y2) | 0) + Math.imul(T2, V2) | 0, o3 = o3 + Math.imul(T2, Y2) | 0, r3 = r3 + Math.imul(C2, Z2) | 0, i3 = (i3 = i3 + Math.imul(C2, Q2) | 0) + Math.imul(x2, Z2) | 0, o3 = o3 + Math.imul(x2, Q2) | 0, r3 = r3 + Math.imul(E3, X2) | 0, i3 = (i3 = i3 + Math.imul(E3, ee2) | 0) + Math.imul(k2, X2) | 0, o3 = o3 + Math.imul(k2, ee2) | 0, r3 = r3 + Math.imul(w3, ne2) | 0, i3 = (i3 = i3 + Math.imul(w3, re2) | 0) + Math.imul(_3, ne2) | 0, o3 = o3 + Math.imul(_3, re2) | 0, r3 = r3 + Math.imul(v3, oe2) | 0, i3 = (i3 = i3 + Math.imul(v3, ae2) | 0) + Math.imul(b3, oe2) | 0, o3 = o3 + Math.imul(b3, ae2) | 0, r3 = r3 + Math.imul(p3, ue2) | 0, i3 = (i3 = i3 + Math.imul(p3, le2) | 0) + Math.imul(m3, ue2) | 0, o3 = o3 + Math.imul(m3, le2) | 0; + var ke2 = (l3 + (r3 = r3 + Math.imul(d3, de2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, fe2) | 0) + Math.imul(f3, de2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, fe2) | 0) + (i3 >>> 13) | 0) + (ke2 >>> 26) | 0, ke2 &= 67108863, r3 = Math.imul(B2, F2), i3 = (i3 = Math.imul(B2, K2)) + Math.imul(z2, F2) | 0, o3 = Math.imul(z2, K2), r3 = r3 + Math.imul(N2, H2) | 0, i3 = (i3 = i3 + Math.imul(N2, W2) | 0) + Math.imul(D2, H2) | 0, o3 = o3 + Math.imul(D2, W2) | 0, r3 = r3 + Math.imul(L2, V2) | 0, i3 = (i3 = i3 + Math.imul(L2, Y2) | 0) + Math.imul(I2, V2) | 0, o3 = o3 + Math.imul(I2, Y2) | 0, r3 = r3 + Math.imul(R2, Z2) | 0, i3 = (i3 = i3 + Math.imul(R2, Q2) | 0) + Math.imul(T2, Z2) | 0, o3 = o3 + Math.imul(T2, Q2) | 0, r3 = r3 + Math.imul(C2, X2) | 0, i3 = (i3 = i3 + Math.imul(C2, ee2) | 0) + Math.imul(x2, X2) | 0, o3 = o3 + Math.imul(x2, ee2) | 0, r3 = r3 + Math.imul(E3, ne2) | 0, i3 = (i3 = i3 + Math.imul(E3, re2) | 0) + Math.imul(k2, ne2) | 0, o3 = o3 + Math.imul(k2, re2) | 0, r3 = r3 + Math.imul(w3, oe2) | 0, i3 = (i3 = i3 + Math.imul(w3, ae2) | 0) + Math.imul(_3, oe2) | 0, o3 = o3 + Math.imul(_3, ae2) | 0, r3 = r3 + Math.imul(v3, ue2) | 0, i3 = (i3 = i3 + Math.imul(v3, le2) | 0) + Math.imul(b3, ue2) | 0, o3 = o3 + Math.imul(b3, le2) | 0, r3 = r3 + Math.imul(p3, de2) | 0, i3 = (i3 = i3 + Math.imul(p3, fe2) | 0) + Math.imul(m3, de2) | 0, o3 = o3 + Math.imul(m3, fe2) | 0; + var Me2 = (l3 + (r3 = r3 + Math.imul(d3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, me2) | 0) + Math.imul(f3, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, me2) | 0) + (i3 >>> 13) | 0) + (Me2 >>> 26) | 0, Me2 &= 67108863, r3 = Math.imul(B2, H2), i3 = (i3 = Math.imul(B2, W2)) + Math.imul(z2, H2) | 0, o3 = Math.imul(z2, W2), r3 = r3 + Math.imul(N2, V2) | 0, i3 = (i3 = i3 + Math.imul(N2, Y2) | 0) + Math.imul(D2, V2) | 0, o3 = o3 + Math.imul(D2, Y2) | 0, r3 = r3 + Math.imul(L2, Z2) | 0, i3 = (i3 = i3 + Math.imul(L2, Q2) | 0) + Math.imul(I2, Z2) | 0, o3 = o3 + Math.imul(I2, Q2) | 0, r3 = r3 + Math.imul(R2, X2) | 0, i3 = (i3 = i3 + Math.imul(R2, ee2) | 0) + Math.imul(T2, X2) | 0, o3 = o3 + Math.imul(T2, ee2) | 0, r3 = r3 + Math.imul(C2, ne2) | 0, i3 = (i3 = i3 + Math.imul(C2, re2) | 0) + Math.imul(x2, ne2) | 0, o3 = o3 + Math.imul(x2, re2) | 0, r3 = r3 + Math.imul(E3, oe2) | 0, i3 = (i3 = i3 + Math.imul(E3, ae2) | 0) + Math.imul(k2, oe2) | 0, o3 = o3 + Math.imul(k2, ae2) | 0, r3 = r3 + Math.imul(w3, ue2) | 0, i3 = (i3 = i3 + Math.imul(w3, le2) | 0) + Math.imul(_3, ue2) | 0, o3 = o3 + Math.imul(_3, le2) | 0, r3 = r3 + Math.imul(v3, de2) | 0, i3 = (i3 = i3 + Math.imul(v3, fe2) | 0) + Math.imul(b3, de2) | 0, o3 = o3 + Math.imul(b3, fe2) | 0; + var Ce2 = (l3 + (r3 = r3 + Math.imul(p3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(p3, me2) | 0) + Math.imul(m3, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(m3, me2) | 0) + (i3 >>> 13) | 0) + (Ce2 >>> 26) | 0, Ce2 &= 67108863, r3 = Math.imul(B2, V2), i3 = (i3 = Math.imul(B2, Y2)) + Math.imul(z2, V2) | 0, o3 = Math.imul(z2, Y2), r3 = r3 + Math.imul(N2, Z2) | 0, i3 = (i3 = i3 + Math.imul(N2, Q2) | 0) + Math.imul(D2, Z2) | 0, o3 = o3 + Math.imul(D2, Q2) | 0, r3 = r3 + Math.imul(L2, X2) | 0, i3 = (i3 = i3 + Math.imul(L2, ee2) | 0) + Math.imul(I2, X2) | 0, o3 = o3 + Math.imul(I2, ee2) | 0, r3 = r3 + Math.imul(R2, ne2) | 0, i3 = (i3 = i3 + Math.imul(R2, re2) | 0) + Math.imul(T2, ne2) | 0, o3 = o3 + Math.imul(T2, re2) | 0, r3 = r3 + Math.imul(C2, oe2) | 0, i3 = (i3 = i3 + Math.imul(C2, ae2) | 0) + Math.imul(x2, oe2) | 0, o3 = o3 + Math.imul(x2, ae2) | 0, r3 = r3 + Math.imul(E3, ue2) | 0, i3 = (i3 = i3 + Math.imul(E3, le2) | 0) + Math.imul(k2, ue2) | 0, o3 = o3 + Math.imul(k2, le2) | 0, r3 = r3 + Math.imul(w3, de2) | 0, i3 = (i3 = i3 + Math.imul(w3, fe2) | 0) + Math.imul(_3, de2) | 0, o3 = o3 + Math.imul(_3, fe2) | 0; + var xe2 = (l3 + (r3 = r3 + Math.imul(v3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(v3, me2) | 0) + Math.imul(b3, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(b3, me2) | 0) + (i3 >>> 13) | 0) + (xe2 >>> 26) | 0, xe2 &= 67108863, r3 = Math.imul(B2, Z2), i3 = (i3 = Math.imul(B2, Q2)) + Math.imul(z2, Z2) | 0, o3 = Math.imul(z2, Q2), r3 = r3 + Math.imul(N2, X2) | 0, i3 = (i3 = i3 + Math.imul(N2, ee2) | 0) + Math.imul(D2, X2) | 0, o3 = o3 + Math.imul(D2, ee2) | 0, r3 = r3 + Math.imul(L2, ne2) | 0, i3 = (i3 = i3 + Math.imul(L2, re2) | 0) + Math.imul(I2, ne2) | 0, o3 = o3 + Math.imul(I2, re2) | 0, r3 = r3 + Math.imul(R2, oe2) | 0, i3 = (i3 = i3 + Math.imul(R2, ae2) | 0) + Math.imul(T2, oe2) | 0, o3 = o3 + Math.imul(T2, ae2) | 0, r3 = r3 + Math.imul(C2, ue2) | 0, i3 = (i3 = i3 + Math.imul(C2, le2) | 0) + Math.imul(x2, ue2) | 0, o3 = o3 + Math.imul(x2, le2) | 0, r3 = r3 + Math.imul(E3, de2) | 0, i3 = (i3 = i3 + Math.imul(E3, fe2) | 0) + Math.imul(k2, de2) | 0, o3 = o3 + Math.imul(k2, fe2) | 0; + var Ae2 = (l3 + (r3 = r3 + Math.imul(w3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(w3, me2) | 0) + Math.imul(_3, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(_3, me2) | 0) + (i3 >>> 13) | 0) + (Ae2 >>> 26) | 0, Ae2 &= 67108863, r3 = Math.imul(B2, X2), i3 = (i3 = Math.imul(B2, ee2)) + Math.imul(z2, X2) | 0, o3 = Math.imul(z2, ee2), r3 = r3 + Math.imul(N2, ne2) | 0, i3 = (i3 = i3 + Math.imul(N2, re2) | 0) + Math.imul(D2, ne2) | 0, o3 = o3 + Math.imul(D2, re2) | 0, r3 = r3 + Math.imul(L2, oe2) | 0, i3 = (i3 = i3 + Math.imul(L2, ae2) | 0) + Math.imul(I2, oe2) | 0, o3 = o3 + Math.imul(I2, ae2) | 0, r3 = r3 + Math.imul(R2, ue2) | 0, i3 = (i3 = i3 + Math.imul(R2, le2) | 0) + Math.imul(T2, ue2) | 0, o3 = o3 + Math.imul(T2, le2) | 0, r3 = r3 + Math.imul(C2, de2) | 0, i3 = (i3 = i3 + Math.imul(C2, fe2) | 0) + Math.imul(x2, de2) | 0, o3 = o3 + Math.imul(x2, fe2) | 0; + var Re2 = (l3 + (r3 = r3 + Math.imul(E3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(E3, me2) | 0) + Math.imul(k2, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(k2, me2) | 0) + (i3 >>> 13) | 0) + (Re2 >>> 26) | 0, Re2 &= 67108863, r3 = Math.imul(B2, ne2), i3 = (i3 = Math.imul(B2, re2)) + Math.imul(z2, ne2) | 0, o3 = Math.imul(z2, re2), r3 = r3 + Math.imul(N2, oe2) | 0, i3 = (i3 = i3 + Math.imul(N2, ae2) | 0) + Math.imul(D2, oe2) | 0, o3 = o3 + Math.imul(D2, ae2) | 0, r3 = r3 + Math.imul(L2, ue2) | 0, i3 = (i3 = i3 + Math.imul(L2, le2) | 0) + Math.imul(I2, ue2) | 0, o3 = o3 + Math.imul(I2, le2) | 0, r3 = r3 + Math.imul(R2, de2) | 0, i3 = (i3 = i3 + Math.imul(R2, fe2) | 0) + Math.imul(T2, de2) | 0, o3 = o3 + Math.imul(T2, fe2) | 0; + var Te2 = (l3 + (r3 = r3 + Math.imul(C2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(C2, me2) | 0) + Math.imul(x2, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(x2, me2) | 0) + (i3 >>> 13) | 0) + (Te2 >>> 26) | 0, Te2 &= 67108863, r3 = Math.imul(B2, oe2), i3 = (i3 = Math.imul(B2, ae2)) + Math.imul(z2, oe2) | 0, o3 = Math.imul(z2, ae2), r3 = r3 + Math.imul(N2, ue2) | 0, i3 = (i3 = i3 + Math.imul(N2, le2) | 0) + Math.imul(D2, ue2) | 0, o3 = o3 + Math.imul(D2, le2) | 0, r3 = r3 + Math.imul(L2, de2) | 0, i3 = (i3 = i3 + Math.imul(L2, fe2) | 0) + Math.imul(I2, de2) | 0, o3 = o3 + Math.imul(I2, fe2) | 0; + var Pe2 = (l3 + (r3 = r3 + Math.imul(R2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(R2, me2) | 0) + Math.imul(T2, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(T2, me2) | 0) + (i3 >>> 13) | 0) + (Pe2 >>> 26) | 0, Pe2 &= 67108863, r3 = Math.imul(B2, ue2), i3 = (i3 = Math.imul(B2, le2)) + Math.imul(z2, ue2) | 0, o3 = Math.imul(z2, le2), r3 = r3 + Math.imul(N2, de2) | 0, i3 = (i3 = i3 + Math.imul(N2, fe2) | 0) + Math.imul(D2, de2) | 0, o3 = o3 + Math.imul(D2, fe2) | 0; + var Le2 = (l3 + (r3 = r3 + Math.imul(L2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(L2, me2) | 0) + Math.imul(I2, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(I2, me2) | 0) + (i3 >>> 13) | 0) + (Le2 >>> 26) | 0, Le2 &= 67108863, r3 = Math.imul(B2, de2), i3 = (i3 = Math.imul(B2, fe2)) + Math.imul(z2, de2) | 0, o3 = Math.imul(z2, fe2); + var Ie2 = (l3 + (r3 = r3 + Math.imul(N2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(N2, me2) | 0) + Math.imul(D2, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(D2, me2) | 0) + (i3 >>> 13) | 0) + (Ie2 >>> 26) | 0, Ie2 &= 67108863; + var Oe2 = (l3 + (r3 = Math.imul(B2, pe2)) | 0) + ((8191 & (i3 = (i3 = Math.imul(B2, me2)) + Math.imul(z2, pe2) | 0)) << 13) | 0; + return l3 = ((o3 = Math.imul(z2, me2)) + (i3 >>> 13) | 0) + (Oe2 >>> 26) | 0, Oe2 &= 67108863, u3[0] = ge2, u3[1] = ve2, u3[2] = be2, u3[3] = ye2, u3[4] = we2, u3[5] = _e2, u3[6] = Se2, u3[7] = Ee2, u3[8] = ke2, u3[9] = Me2, u3[10] = Ce2, u3[11] = xe2, u3[12] = Ae2, u3[13] = Re2, u3[14] = Te2, u3[15] = Pe2, u3[16] = Le2, u3[17] = Ie2, u3[18] = Oe2, 0 !== l3 && (u3[19] = l3, n3.length++), n3; + }; + function p2(e4, t3, n3) { + return new m2().mulp(e4, t3, n3); + } + function m2(e4, t3) { + this.x = e4, this.y = t3; + } + Math.imul || (h2 = f2), i2.prototype.mulTo = function(e4, t3) { + var n3, r3 = this.length + e4.length; + return n3 = 10 === this.length && 10 === e4.length ? h2(this, e4, t3) : r3 < 63 ? f2(this, e4, t3) : r3 < 1024 ? function(e5, t4, n4) { + n4.negative = t4.negative ^ e5.negative, n4.length = e5.length + t4.length; + for (var r4 = 0, i3 = 0, o3 = 0; o3 < n4.length - 1; o3++) { + var a3 = i3; + i3 = 0; + for (var s3 = 67108863 & r4, u3 = Math.min(o3, t4.length - 1), l3 = Math.max(0, o3 - e5.length + 1); l3 <= u3; l3++) { + var c3 = o3 - l3, d3 = (0 | e5.words[c3]) * (0 | t4.words[l3]), f3 = 67108863 & d3; + s3 = 67108863 & (f3 = f3 + s3 | 0), i3 += (a3 = (a3 = a3 + (d3 / 67108864 | 0) | 0) + (f3 >>> 26) | 0) >>> 26, a3 &= 67108863; + } + n4.words[o3] = s3, r4 = a3, a3 = i3; + } + return 0 !== r4 ? n4.words[o3] = r4 : n4.length--, n4.strip(); + }(this, e4, t3) : p2(this, e4, t3), n3; + }, m2.prototype.makeRBT = function(e4) { + for (var t3 = new Array(e4), n3 = i2.prototype._countBits(e4) - 1, r3 = 0; r3 < e4; r3++) + t3[r3] = this.revBin(r3, n3, e4); + return t3; + }, m2.prototype.revBin = function(e4, t3, n3) { + if (0 === e4 || e4 === n3 - 1) + return e4; + for (var r3 = 0, i3 = 0; i3 < t3; i3++) + r3 |= (1 & e4) << t3 - i3 - 1, e4 >>= 1; + return r3; + }, m2.prototype.permute = function(e4, t3, n3, r3, i3, o3) { + for (var a3 = 0; a3 < o3; a3++) + r3[a3] = t3[e4[a3]], i3[a3] = n3[e4[a3]]; + }, m2.prototype.transform = function(e4, t3, n3, r3, i3, o3) { + this.permute(o3, e4, t3, n3, r3, i3); + for (var a3 = 1; a3 < i3; a3 <<= 1) + for (var s3 = a3 << 1, u3 = Math.cos(2 * Math.PI / s3), l3 = Math.sin(2 * Math.PI / s3), c3 = 0; c3 < i3; c3 += s3) + for (var d3 = u3, f3 = l3, h3 = 0; h3 < a3; h3++) { + var p3 = n3[c3 + h3], m3 = r3[c3 + h3], g3 = n3[c3 + h3 + a3], v3 = r3[c3 + h3 + a3], b3 = d3 * g3 - f3 * v3; + v3 = d3 * v3 + f3 * g3, g3 = b3, n3[c3 + h3] = p3 + g3, r3[c3 + h3] = m3 + v3, n3[c3 + h3 + a3] = p3 - g3, r3[c3 + h3 + a3] = m3 - v3, h3 !== s3 && (b3 = u3 * d3 - l3 * f3, f3 = u3 * f3 + l3 * d3, d3 = b3); + } + }, m2.prototype.guessLen13b = function(e4, t3) { + var n3 = 1 | Math.max(t3, e4), r3 = 1 & n3, i3 = 0; + for (n3 = n3 / 2 | 0; n3; n3 >>>= 1) + i3++; + return 1 << i3 + 1 + r3; + }, m2.prototype.conjugate = function(e4, t3, n3) { + if (!(n3 <= 1)) + for (var r3 = 0; r3 < n3 / 2; r3++) { + var i3 = e4[r3]; + e4[r3] = e4[n3 - r3 - 1], e4[n3 - r3 - 1] = i3, i3 = t3[r3], t3[r3] = -t3[n3 - r3 - 1], t3[n3 - r3 - 1] = -i3; + } + }, m2.prototype.normalize13b = function(e4, t3) { + for (var n3 = 0, r3 = 0; r3 < t3 / 2; r3++) { + var i3 = 8192 * Math.round(e4[2 * r3 + 1] / t3) + Math.round(e4[2 * r3] / t3) + n3; + e4[r3] = 67108863 & i3, n3 = i3 < 67108864 ? 0 : i3 / 67108864 | 0; + } + return e4; + }, m2.prototype.convert13b = function(e4, t3, r3, i3) { + for (var o3 = 0, a3 = 0; a3 < t3; a3++) + o3 += 0 | e4[a3], r3[2 * a3] = 8191 & o3, o3 >>>= 13, r3[2 * a3 + 1] = 8191 & o3, o3 >>>= 13; + for (a3 = 2 * t3; a3 < i3; ++a3) + r3[a3] = 0; + n2(0 === o3), n2(0 == (-8192 & o3)); + }, m2.prototype.stub = function(e4) { + for (var t3 = new Array(e4), n3 = 0; n3 < e4; n3++) + t3[n3] = 0; + return t3; + }, m2.prototype.mulp = function(e4, t3, n3) { + var r3 = 2 * this.guessLen13b(e4.length, t3.length), i3 = this.makeRBT(r3), o3 = this.stub(r3), a3 = new Array(r3), s3 = new Array(r3), u3 = new Array(r3), l3 = new Array(r3), c3 = new Array(r3), d3 = new Array(r3), f3 = n3.words; + f3.length = r3, this.convert13b(e4.words, e4.length, a3, r3), this.convert13b(t3.words, t3.length, l3, r3), this.transform(a3, o3, s3, u3, r3, i3), this.transform(l3, o3, c3, d3, r3, i3); + for (var h3 = 0; h3 < r3; h3++) { + var p3 = s3[h3] * c3[h3] - u3[h3] * d3[h3]; + u3[h3] = s3[h3] * d3[h3] + u3[h3] * c3[h3], s3[h3] = p3; + } + return this.conjugate(s3, u3, r3), this.transform(s3, u3, f3, o3, r3, i3), this.conjugate(f3, o3, r3), this.normalize13b(f3, r3), n3.negative = e4.negative ^ t3.negative, n3.length = e4.length + t3.length, n3.strip(); + }, i2.prototype.mul = function(e4) { + var t3 = new i2(null); + return t3.words = new Array(this.length + e4.length), this.mulTo(e4, t3); + }, i2.prototype.mulf = function(e4) { + var t3 = new i2(null); + return t3.words = new Array(this.length + e4.length), p2(this, e4, t3); + }, i2.prototype.imul = function(e4) { + return this.clone().mulTo(e4, this); + }, i2.prototype.imuln = function(e4) { + n2("number" == typeof e4), n2(e4 < 67108864); + for (var t3 = 0, r3 = 0; r3 < this.length; r3++) { + var i3 = (0 | this.words[r3]) * e4, o3 = (67108863 & i3) + (67108863 & t3); + t3 >>= 26, t3 += i3 / 67108864 | 0, t3 += o3 >>> 26, this.words[r3] = 67108863 & o3; + } + return 0 !== t3 && (this.words[r3] = t3, this.length++), this; + }, i2.prototype.muln = function(e4) { + return this.clone().imuln(e4); + }, i2.prototype.sqr = function() { + return this.mul(this); + }, i2.prototype.isqr = function() { + return this.imul(this.clone()); + }, i2.prototype.pow = function(e4) { + var t3 = function(e5) { + for (var t4 = new Array(e5.bitLength()), n4 = 0; n4 < t4.length; n4++) { + var r4 = n4 / 26 | 0, i3 = n4 % 26; + t4[n4] = (e5.words[r4] & 1 << i3) >>> i3; + } + return t4; + }(e4); + if (0 === t3.length) + return new i2(1); + for (var n3 = this, r3 = 0; r3 < t3.length && 0 === t3[r3]; r3++, n3 = n3.sqr()) + ; + if (++r3 < t3.length) + for (var o3 = n3.sqr(); r3 < t3.length; r3++, o3 = o3.sqr()) + 0 !== t3[r3] && (n3 = n3.mul(o3)); + return n3; + }, i2.prototype.iushln = function(e4) { + n2("number" == typeof e4 && e4 >= 0); + var t3, r3 = e4 % 26, i3 = (e4 - r3) / 26, o3 = 67108863 >>> 26 - r3 << 26 - r3; + if (0 !== r3) { + var a3 = 0; + for (t3 = 0; t3 < this.length; t3++) { + var s3 = this.words[t3] & o3, u3 = (0 | this.words[t3]) - s3 << r3; + this.words[t3] = u3 | a3, a3 = s3 >>> 26 - r3; + } + a3 && (this.words[t3] = a3, this.length++); + } + if (0 !== i3) { + for (t3 = this.length - 1; t3 >= 0; t3--) + this.words[t3 + i3] = this.words[t3]; + for (t3 = 0; t3 < i3; t3++) + this.words[t3] = 0; + this.length += i3; + } + return this.strip(); + }, i2.prototype.ishln = function(e4) { + return n2(0 === this.negative), this.iushln(e4); + }, i2.prototype.iushrn = function(e4, t3, r3) { + var i3; + n2("number" == typeof e4 && e4 >= 0), i3 = t3 ? (t3 - t3 % 26) / 26 : 0; + var o3 = e4 % 26, a3 = Math.min((e4 - o3) / 26, this.length), s3 = 67108863 ^ 67108863 >>> o3 << o3, u3 = r3; + if (i3 -= a3, i3 = Math.max(0, i3), u3) { + for (var l3 = 0; l3 < a3; l3++) + u3.words[l3] = this.words[l3]; + u3.length = a3; + } + if (0 === a3) + ; + else if (this.length > a3) + for (this.length -= a3, l3 = 0; l3 < this.length; l3++) + this.words[l3] = this.words[l3 + a3]; + else + this.words[0] = 0, this.length = 1; + var c3 = 0; + for (l3 = this.length - 1; l3 >= 0 && (0 !== c3 || l3 >= i3); l3--) { + var d3 = 0 | this.words[l3]; + this.words[l3] = c3 << 26 - o3 | d3 >>> o3, c3 = d3 & s3; + } + return u3 && 0 !== c3 && (u3.words[u3.length++] = c3), 0 === this.length && (this.words[0] = 0, this.length = 1), this.strip(); + }, i2.prototype.ishrn = function(e4, t3, r3) { + return n2(0 === this.negative), this.iushrn(e4, t3, r3); + }, i2.prototype.shln = function(e4) { + return this.clone().ishln(e4); + }, i2.prototype.ushln = function(e4) { + return this.clone().iushln(e4); + }, i2.prototype.shrn = function(e4) { + return this.clone().ishrn(e4); + }, i2.prototype.ushrn = function(e4) { + return this.clone().iushrn(e4); + }, i2.prototype.testn = function(e4) { + n2("number" == typeof e4 && e4 >= 0); + var t3 = e4 % 26, r3 = (e4 - t3) / 26, i3 = 1 << t3; + return !(this.length <= r3) && !!(this.words[r3] & i3); + }, i2.prototype.imaskn = function(e4) { + n2("number" == typeof e4 && e4 >= 0); + var t3 = e4 % 26, r3 = (e4 - t3) / 26; + if (n2(0 === this.negative, "imaskn works only with positive numbers"), this.length <= r3) + return this; + if (0 !== t3 && r3++, this.length = Math.min(r3, this.length), 0 !== t3) { + var i3 = 67108863 ^ 67108863 >>> t3 << t3; + this.words[this.length - 1] &= i3; + } + return this.strip(); + }, i2.prototype.maskn = function(e4) { + return this.clone().imaskn(e4); + }, i2.prototype.iaddn = function(e4) { + return n2("number" == typeof e4), n2(e4 < 67108864), e4 < 0 ? this.isubn(-e4) : 0 !== this.negative ? 1 === this.length && (0 | this.words[0]) < e4 ? (this.words[0] = e4 - (0 | this.words[0]), this.negative = 0, this) : (this.negative = 0, this.isubn(e4), this.negative = 1, this) : this._iaddn(e4); + }, i2.prototype._iaddn = function(e4) { + this.words[0] += e4; + for (var t3 = 0; t3 < this.length && this.words[t3] >= 67108864; t3++) + this.words[t3] -= 67108864, t3 === this.length - 1 ? this.words[t3 + 1] = 1 : this.words[t3 + 1]++; + return this.length = Math.max(this.length, t3 + 1), this; + }, i2.prototype.isubn = function(e4) { + if (n2("number" == typeof e4), n2(e4 < 67108864), e4 < 0) + return this.iaddn(-e4); + if (0 !== this.negative) + return this.negative = 0, this.iaddn(e4), this.negative = 1, this; + if (this.words[0] -= e4, 1 === this.length && this.words[0] < 0) + this.words[0] = -this.words[0], this.negative = 1; + else + for (var t3 = 0; t3 < this.length && this.words[t3] < 0; t3++) + this.words[t3] += 67108864, this.words[t3 + 1] -= 1; + return this.strip(); + }, i2.prototype.addn = function(e4) { + return this.clone().iaddn(e4); + }, i2.prototype.subn = function(e4) { + return this.clone().isubn(e4); + }, i2.prototype.iabs = function() { + return this.negative = 0, this; + }, i2.prototype.abs = function() { + return this.clone().iabs(); + }, i2.prototype._ishlnsubmul = function(e4, t3, r3) { + var i3, o3, a3 = e4.length + r3; + this._expand(a3); + var s3 = 0; + for (i3 = 0; i3 < e4.length; i3++) { + o3 = (0 | this.words[i3 + r3]) + s3; + var u3 = (0 | e4.words[i3]) * t3; + s3 = ((o3 -= 67108863 & u3) >> 26) - (u3 / 67108864 | 0), this.words[i3 + r3] = 67108863 & o3; + } + for (; i3 < this.length - r3; i3++) + s3 = (o3 = (0 | this.words[i3 + r3]) + s3) >> 26, this.words[i3 + r3] = 67108863 & o3; + if (0 === s3) + return this.strip(); + for (n2(-1 === s3), s3 = 0, i3 = 0; i3 < this.length; i3++) + s3 = (o3 = -(0 | this.words[i3]) + s3) >> 26, this.words[i3] = 67108863 & o3; + return this.negative = 1, this.strip(); + }, i2.prototype._wordDiv = function(e4, t3) { + var n3 = (this.length, e4.length), r3 = this.clone(), o3 = e4, a3 = 0 | o3.words[o3.length - 1]; + 0 !== (n3 = 26 - this._countBits(a3)) && (o3 = o3.ushln(n3), r3.iushln(n3), a3 = 0 | o3.words[o3.length - 1]); + var s3, u3 = r3.length - o3.length; + if ("mod" !== t3) { + (s3 = new i2(null)).length = u3 + 1, s3.words = new Array(s3.length); + for (var l3 = 0; l3 < s3.length; l3++) + s3.words[l3] = 0; + } + var c3 = r3.clone()._ishlnsubmul(o3, 1, u3); + 0 === c3.negative && (r3 = c3, s3 && (s3.words[u3] = 1)); + for (var d3 = u3 - 1; d3 >= 0; d3--) { + var f3 = 67108864 * (0 | r3.words[o3.length + d3]) + (0 | r3.words[o3.length + d3 - 1]); + for (f3 = Math.min(f3 / a3 | 0, 67108863), r3._ishlnsubmul(o3, f3, d3); 0 !== r3.negative; ) + f3--, r3.negative = 0, r3._ishlnsubmul(o3, 1, d3), r3.isZero() || (r3.negative ^= 1); + s3 && (s3.words[d3] = f3); + } + return s3 && s3.strip(), r3.strip(), "div" !== t3 && 0 !== n3 && r3.iushrn(n3), { div: s3 || null, mod: r3 }; + }, i2.prototype.divmod = function(e4, t3, r3) { + return n2(!e4.isZero()), this.isZero() ? { div: new i2(0), mod: new i2(0) } : 0 !== this.negative && 0 === e4.negative ? (s3 = this.neg().divmod(e4, t3), "mod" !== t3 && (o3 = s3.div.neg()), "div" !== t3 && (a3 = s3.mod.neg(), r3 && 0 !== a3.negative && a3.iadd(e4)), { div: o3, mod: a3 }) : 0 === this.negative && 0 !== e4.negative ? (s3 = this.divmod(e4.neg(), t3), "mod" !== t3 && (o3 = s3.div.neg()), { div: o3, mod: s3.mod }) : 0 != (this.negative & e4.negative) ? (s3 = this.neg().divmod(e4.neg(), t3), "div" !== t3 && (a3 = s3.mod.neg(), r3 && 0 !== a3.negative && a3.isub(e4)), { div: s3.div, mod: a3 }) : e4.length > this.length || this.cmp(e4) < 0 ? { div: new i2(0), mod: this } : 1 === e4.length ? "div" === t3 ? { div: this.divn(e4.words[0]), mod: null } : "mod" === t3 ? { div: null, mod: new i2(this.modn(e4.words[0])) } : { div: this.divn(e4.words[0]), mod: new i2(this.modn(e4.words[0])) } : this._wordDiv(e4, t3); + var o3, a3, s3; + }, i2.prototype.div = function(e4) { + return this.divmod(e4, "div", false).div; + }, i2.prototype.mod = function(e4) { + return this.divmod(e4, "mod", false).mod; + }, i2.prototype.umod = function(e4) { + return this.divmod(e4, "mod", true).mod; + }, i2.prototype.divRound = function(e4) { + var t3 = this.divmod(e4); + if (t3.mod.isZero()) + return t3.div; + var n3 = 0 !== t3.div.negative ? t3.mod.isub(e4) : t3.mod, r3 = e4.ushrn(1), i3 = e4.andln(1), o3 = n3.cmp(r3); + return o3 < 0 || 1 === i3 && 0 === o3 ? t3.div : 0 !== t3.div.negative ? t3.div.isubn(1) : t3.div.iaddn(1); + }, i2.prototype.modn = function(e4) { + n2(e4 <= 67108863); + for (var t3 = (1 << 26) % e4, r3 = 0, i3 = this.length - 1; i3 >= 0; i3--) + r3 = (t3 * r3 + (0 | this.words[i3])) % e4; + return r3; + }, i2.prototype.idivn = function(e4) { + n2(e4 <= 67108863); + for (var t3 = 0, r3 = this.length - 1; r3 >= 0; r3--) { + var i3 = (0 | this.words[r3]) + 67108864 * t3; + this.words[r3] = i3 / e4 | 0, t3 = i3 % e4; + } + return this.strip(); + }, i2.prototype.divn = function(e4) { + return this.clone().idivn(e4); + }, i2.prototype.egcd = function(e4) { + n2(0 === e4.negative), n2(!e4.isZero()); + var t3 = this, r3 = e4.clone(); + t3 = 0 !== t3.negative ? t3.umod(e4) : t3.clone(); + for (var o3 = new i2(1), a3 = new i2(0), s3 = new i2(0), u3 = new i2(1), l3 = 0; t3.isEven() && r3.isEven(); ) + t3.iushrn(1), r3.iushrn(1), ++l3; + for (var c3 = r3.clone(), d3 = t3.clone(); !t3.isZero(); ) { + for (var f3 = 0, h3 = 1; 0 == (t3.words[0] & h3) && f3 < 26; ++f3, h3 <<= 1) + ; + if (f3 > 0) + for (t3.iushrn(f3); f3-- > 0; ) + (o3.isOdd() || a3.isOdd()) && (o3.iadd(c3), a3.isub(d3)), o3.iushrn(1), a3.iushrn(1); + for (var p3 = 0, m3 = 1; 0 == (r3.words[0] & m3) && p3 < 26; ++p3, m3 <<= 1) + ; + if (p3 > 0) + for (r3.iushrn(p3); p3-- > 0; ) + (s3.isOdd() || u3.isOdd()) && (s3.iadd(c3), u3.isub(d3)), s3.iushrn(1), u3.iushrn(1); + t3.cmp(r3) >= 0 ? (t3.isub(r3), o3.isub(s3), a3.isub(u3)) : (r3.isub(t3), s3.isub(o3), u3.isub(a3)); + } + return { a: s3, b: u3, gcd: r3.iushln(l3) }; + }, i2.prototype._invmp = function(e4) { + n2(0 === e4.negative), n2(!e4.isZero()); + var t3 = this, r3 = e4.clone(); + t3 = 0 !== t3.negative ? t3.umod(e4) : t3.clone(); + for (var o3, a3 = new i2(1), s3 = new i2(0), u3 = r3.clone(); t3.cmpn(1) > 0 && r3.cmpn(1) > 0; ) { + for (var l3 = 0, c3 = 1; 0 == (t3.words[0] & c3) && l3 < 26; ++l3, c3 <<= 1) + ; + if (l3 > 0) + for (t3.iushrn(l3); l3-- > 0; ) + a3.isOdd() && a3.iadd(u3), a3.iushrn(1); + for (var d3 = 0, f3 = 1; 0 == (r3.words[0] & f3) && d3 < 26; ++d3, f3 <<= 1) + ; + if (d3 > 0) + for (r3.iushrn(d3); d3-- > 0; ) + s3.isOdd() && s3.iadd(u3), s3.iushrn(1); + t3.cmp(r3) >= 0 ? (t3.isub(r3), a3.isub(s3)) : (r3.isub(t3), s3.isub(a3)); + } + return (o3 = 0 === t3.cmpn(1) ? a3 : s3).cmpn(0) < 0 && o3.iadd(e4), o3; + }, i2.prototype.gcd = function(e4) { + if (this.isZero()) + return e4.abs(); + if (e4.isZero()) + return this.abs(); + var t3 = this.clone(), n3 = e4.clone(); + t3.negative = 0, n3.negative = 0; + for (var r3 = 0; t3.isEven() && n3.isEven(); r3++) + t3.iushrn(1), n3.iushrn(1); + for (; ; ) { + for (; t3.isEven(); ) + t3.iushrn(1); + for (; n3.isEven(); ) + n3.iushrn(1); + var i3 = t3.cmp(n3); + if (i3 < 0) { + var o3 = t3; + t3 = n3, n3 = o3; + } else if (0 === i3 || 0 === n3.cmpn(1)) + break; + t3.isub(n3); + } + return n3.iushln(r3); + }, i2.prototype.invm = function(e4) { + return this.egcd(e4).a.umod(e4); + }, i2.prototype.isEven = function() { + return 0 == (1 & this.words[0]); + }, i2.prototype.isOdd = function() { + return 1 == (1 & this.words[0]); + }, i2.prototype.andln = function(e4) { + return this.words[0] & e4; + }, i2.prototype.bincn = function(e4) { + n2("number" == typeof e4); + var t3 = e4 % 26, r3 = (e4 - t3) / 26, i3 = 1 << t3; + if (this.length <= r3) + return this._expand(r3 + 1), this.words[r3] |= i3, this; + for (var o3 = i3, a3 = r3; 0 !== o3 && a3 < this.length; a3++) { + var s3 = 0 | this.words[a3]; + o3 = (s3 += o3) >>> 26, s3 &= 67108863, this.words[a3] = s3; + } + return 0 !== o3 && (this.words[a3] = o3, this.length++), this; + }, i2.prototype.isZero = function() { + return 1 === this.length && 0 === this.words[0]; + }, i2.prototype.cmpn = function(e4) { + var t3, r3 = e4 < 0; + if (0 !== this.negative && !r3) + return -1; + if (0 === this.negative && r3) + return 1; + if (this.strip(), this.length > 1) + t3 = 1; + else { + r3 && (e4 = -e4), n2(e4 <= 67108863, "Number is too big"); + var i3 = 0 | this.words[0]; + t3 = i3 === e4 ? 0 : i3 < e4 ? -1 : 1; + } + return 0 !== this.negative ? 0 | -t3 : t3; + }, i2.prototype.cmp = function(e4) { + if (0 !== this.negative && 0 === e4.negative) + return -1; + if (0 === this.negative && 0 !== e4.negative) + return 1; + var t3 = this.ucmp(e4); + return 0 !== this.negative ? 0 | -t3 : t3; + }, i2.prototype.ucmp = function(e4) { + if (this.length > e4.length) + return 1; + if (this.length < e4.length) + return -1; + for (var t3 = 0, n3 = this.length - 1; n3 >= 0; n3--) { + var r3 = 0 | this.words[n3], i3 = 0 | e4.words[n3]; + if (r3 !== i3) { + r3 < i3 ? t3 = -1 : r3 > i3 && (t3 = 1); + break; + } + } + return t3; + }, i2.prototype.gtn = function(e4) { + return 1 === this.cmpn(e4); + }, i2.prototype.gt = function(e4) { + return 1 === this.cmp(e4); + }, i2.prototype.gten = function(e4) { + return this.cmpn(e4) >= 0; + }, i2.prototype.gte = function(e4) { + return this.cmp(e4) >= 0; + }, i2.prototype.ltn = function(e4) { + return -1 === this.cmpn(e4); + }, i2.prototype.lt = function(e4) { + return -1 === this.cmp(e4); + }, i2.prototype.lten = function(e4) { + return this.cmpn(e4) <= 0; + }, i2.prototype.lte = function(e4) { + return this.cmp(e4) <= 0; + }, i2.prototype.eqn = function(e4) { + return 0 === this.cmpn(e4); + }, i2.prototype.eq = function(e4) { + return 0 === this.cmp(e4); + }, i2.red = function(e4) { + return new S2(e4); + }, i2.prototype.toRed = function(e4) { + return n2(!this.red, "Already a number in reduction context"), n2(0 === this.negative, "red works only with positives"), e4.convertTo(this)._forceRed(e4); + }, i2.prototype.fromRed = function() { + return n2(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this); + }, i2.prototype._forceRed = function(e4) { + return this.red = e4, this; + }, i2.prototype.forceRed = function(e4) { + return n2(!this.red, "Already a number in reduction context"), this._forceRed(e4); + }, i2.prototype.redAdd = function(e4) { + return n2(this.red, "redAdd works only with red numbers"), this.red.add(this, e4); + }, i2.prototype.redIAdd = function(e4) { + return n2(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, e4); + }, i2.prototype.redSub = function(e4) { + return n2(this.red, "redSub works only with red numbers"), this.red.sub(this, e4); + }, i2.prototype.redISub = function(e4) { + return n2(this.red, "redISub works only with red numbers"), this.red.isub(this, e4); + }, i2.prototype.redShl = function(e4) { + return n2(this.red, "redShl works only with red numbers"), this.red.shl(this, e4); + }, i2.prototype.redMul = function(e4) { + return n2(this.red, "redMul works only with red numbers"), this.red._verify2(this, e4), this.red.mul(this, e4); + }, i2.prototype.redIMul = function(e4) { + return n2(this.red, "redMul works only with red numbers"), this.red._verify2(this, e4), this.red.imul(this, e4); + }, i2.prototype.redSqr = function() { + return n2(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this); + }, i2.prototype.redISqr = function() { + return n2(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this); + }, i2.prototype.redSqrt = function() { + return n2(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this); + }, i2.prototype.redInvm = function() { + return n2(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this); + }, i2.prototype.redNeg = function() { + return n2(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this); + }, i2.prototype.redPow = function(e4) { + return n2(this.red && !e4.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, e4); + }; + var g2 = { k256: null, p224: null, p192: null, p25519: null }; + function v2(e4, t3) { + this.name = e4, this.p = new i2(t3, 16), this.n = this.p.bitLength(), this.k = new i2(1).iushln(this.n).isub(this.p), this.tmp = this._tmp(); + } + function b2() { + v2.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + function y2() { + v2.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + function w2() { + v2.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + function _2() { + v2.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + function S2(e4) { + if ("string" == typeof e4) { + var t3 = i2._prime(e4); + this.m = t3.p, this.prime = t3; + } else + n2(e4.gtn(1), "modulus must be greater than 1"), this.m = e4, this.prime = null; + } + function E2(e4) { + S2.call(this, e4), this.shift = this.m.bitLength(), this.shift % 26 != 0 && (this.shift += 26 - this.shift % 26), this.r = new i2(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); + } + v2.prototype._tmp = function() { + var e4 = new i2(null); + return e4.words = new Array(Math.ceil(this.n / 13)), e4; + }, v2.prototype.ireduce = function(e4) { + var t3, n3 = e4; + do { + this.split(n3, this.tmp), t3 = (n3 = (n3 = this.imulK(n3)).iadd(this.tmp)).bitLength(); + } while (t3 > this.n); + var r3 = t3 < this.n ? -1 : n3.ucmp(this.p); + return 0 === r3 ? (n3.words[0] = 0, n3.length = 1) : r3 > 0 ? n3.isub(this.p) : void 0 !== n3.strip ? n3.strip() : n3._strip(), n3; + }, v2.prototype.split = function(e4, t3) { + e4.iushrn(this.n, 0, t3); + }, v2.prototype.imulK = function(e4) { + return e4.imul(this.k); + }, r2(b2, v2), b2.prototype.split = function(e4, t3) { + for (var n3 = 4194303, r3 = Math.min(e4.length, 9), i3 = 0; i3 < r3; i3++) + t3.words[i3] = e4.words[i3]; + if (t3.length = r3, e4.length <= 9) + return e4.words[0] = 0, void (e4.length = 1); + var o3 = e4.words[9]; + for (t3.words[t3.length++] = o3 & n3, i3 = 10; i3 < e4.length; i3++) { + var a3 = 0 | e4.words[i3]; + e4.words[i3 - 10] = (a3 & n3) << 4 | o3 >>> 22, o3 = a3; + } + o3 >>>= 22, e4.words[i3 - 10] = o3, 0 === o3 && e4.length > 10 ? e4.length -= 10 : e4.length -= 9; + }, b2.prototype.imulK = function(e4) { + e4.words[e4.length] = 0, e4.words[e4.length + 1] = 0, e4.length += 2; + for (var t3 = 0, n3 = 0; n3 < e4.length; n3++) { + var r3 = 0 | e4.words[n3]; + t3 += 977 * r3, e4.words[n3] = 67108863 & t3, t3 = 64 * r3 + (t3 / 67108864 | 0); + } + return 0 === e4.words[e4.length - 1] && (e4.length--, 0 === e4.words[e4.length - 1] && e4.length--), e4; + }, r2(y2, v2), r2(w2, v2), r2(_2, v2), _2.prototype.imulK = function(e4) { + for (var t3 = 0, n3 = 0; n3 < e4.length; n3++) { + var r3 = 19 * (0 | e4.words[n3]) + t3, i3 = 67108863 & r3; + r3 >>>= 26, e4.words[n3] = i3, t3 = r3; + } + return 0 !== t3 && (e4.words[e4.length++] = t3), e4; + }, i2._prime = function(e4) { + if (g2[e4]) + return g2[e4]; + var t3; + if ("k256" === e4) + t3 = new b2(); + else if ("p224" === e4) + t3 = new y2(); + else if ("p192" === e4) + t3 = new w2(); + else { + if ("p25519" !== e4) + throw new Error("Unknown prime " + e4); + t3 = new _2(); + } + return g2[e4] = t3, t3; + }, S2.prototype._verify1 = function(e4) { + n2(0 === e4.negative, "red works only with positives"), n2(e4.red, "red works only with red numbers"); + }, S2.prototype._verify2 = function(e4, t3) { + n2(0 == (e4.negative | t3.negative), "red works only with positives"), n2(e4.red && e4.red === t3.red, "red works only with red numbers"); + }, S2.prototype.imod = function(e4) { + return this.prime ? this.prime.ireduce(e4)._forceRed(this) : e4.umod(this.m)._forceRed(this); + }, S2.prototype.neg = function(e4) { + return e4.isZero() ? e4.clone() : this.m.sub(e4)._forceRed(this); + }, S2.prototype.add = function(e4, t3) { + this._verify2(e4, t3); + var n3 = e4.add(t3); + return n3.cmp(this.m) >= 0 && n3.isub(this.m), n3._forceRed(this); + }, S2.prototype.iadd = function(e4, t3) { + this._verify2(e4, t3); + var n3 = e4.iadd(t3); + return n3.cmp(this.m) >= 0 && n3.isub(this.m), n3; + }, S2.prototype.sub = function(e4, t3) { + this._verify2(e4, t3); + var n3 = e4.sub(t3); + return n3.cmpn(0) < 0 && n3.iadd(this.m), n3._forceRed(this); + }, S2.prototype.isub = function(e4, t3) { + this._verify2(e4, t3); + var n3 = e4.isub(t3); + return n3.cmpn(0) < 0 && n3.iadd(this.m), n3; + }, S2.prototype.shl = function(e4, t3) { + return this._verify1(e4), this.imod(e4.ushln(t3)); + }, S2.prototype.imul = function(e4, t3) { + return this._verify2(e4, t3), this.imod(e4.imul(t3)); + }, S2.prototype.mul = function(e4, t3) { + return this._verify2(e4, t3), this.imod(e4.mul(t3)); + }, S2.prototype.isqr = function(e4) { + return this.imul(e4, e4.clone()); + }, S2.prototype.sqr = function(e4) { + return this.mul(e4, e4); + }, S2.prototype.sqrt = function(e4) { + if (e4.isZero()) + return e4.clone(); + var t3 = this.m.andln(3); + if (n2(t3 % 2 == 1), 3 === t3) { + var r3 = this.m.add(new i2(1)).iushrn(2); + return this.pow(e4, r3); + } + for (var o3 = this.m.subn(1), a3 = 0; !o3.isZero() && 0 === o3.andln(1); ) + a3++, o3.iushrn(1); + n2(!o3.isZero()); + var s3 = new i2(1).toRed(this), u3 = s3.redNeg(), l3 = this.m.subn(1).iushrn(1), c3 = this.m.bitLength(); + for (c3 = new i2(2 * c3 * c3).toRed(this); 0 !== this.pow(c3, l3).cmp(u3); ) + c3.redIAdd(u3); + for (var d3 = this.pow(c3, o3), f3 = this.pow(e4, o3.addn(1).iushrn(1)), h3 = this.pow(e4, o3), p3 = a3; 0 !== h3.cmp(s3); ) { + for (var m3 = h3, g3 = 0; 0 !== m3.cmp(s3); g3++) + m3 = m3.redSqr(); + n2(g3 < p3); + var v3 = this.pow(d3, new i2(1).iushln(p3 - g3 - 1)); + f3 = f3.redMul(v3), d3 = v3.redSqr(), h3 = h3.redMul(d3), p3 = g3; + } + return f3; + }, S2.prototype.invm = function(e4) { + var t3 = e4._invmp(this.m); + return 0 !== t3.negative ? (t3.negative = 0, this.imod(t3).redNeg()) : this.imod(t3); + }, S2.prototype.pow = function(e4, t3) { + if (t3.isZero()) + return new i2(1).toRed(this); + if (0 === t3.cmpn(1)) + return e4.clone(); + var n3 = new Array(16); + n3[0] = new i2(1).toRed(this), n3[1] = e4; + for (var r3 = 2; r3 < n3.length; r3++) + n3[r3] = this.mul(n3[r3 - 1], e4); + var o3 = n3[0], a3 = 0, s3 = 0, u3 = t3.bitLength() % 26; + for (0 === u3 && (u3 = 26), r3 = t3.length - 1; r3 >= 0; r3--) { + for (var l3 = t3.words[r3], c3 = u3 - 1; c3 >= 0; c3--) { + var d3 = l3 >> c3 & 1; + o3 !== n3[0] && (o3 = this.sqr(o3)), 0 !== d3 || 0 !== a3 ? (a3 <<= 1, a3 |= d3, (4 === ++s3 || 0 === r3 && 0 === c3) && (o3 = this.mul(o3, n3[a3]), s3 = 0, a3 = 0)) : s3 = 0; + } + u3 = 26; + } + return o3; + }, S2.prototype.convertTo = function(e4) { + var t3 = e4.umod(this.m); + return t3 === e4 ? t3.clone() : t3; + }, S2.prototype.convertFrom = function(e4) { + var t3 = e4.clone(); + return t3.red = null, t3; + }, i2.mont = function(e4) { + return new E2(e4); + }, r2(E2, S2), E2.prototype.convertTo = function(e4) { + return this.imod(e4.ushln(this.shift)); + }, E2.prototype.convertFrom = function(e4) { + var t3 = this.imod(e4.mul(this.rinv)); + return t3.red = null, t3; + }, E2.prototype.imul = function(e4, t3) { + if (e4.isZero() || t3.isZero()) + return e4.words[0] = 0, e4.length = 1, e4; + var n3 = e4.imul(t3), r3 = n3.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), i3 = n3.isub(r3).iushrn(this.shift), o3 = i3; + return i3.cmp(this.m) >= 0 ? o3 = i3.isub(this.m) : i3.cmpn(0) < 0 && (o3 = i3.iadd(this.m)), o3._forceRed(this); + }, E2.prototype.mul = function(e4, t3) { + if (e4.isZero() || t3.isZero()) + return new i2(0)._forceRed(this); + var n3 = e4.mul(t3), r3 = n3.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), o3 = n3.isub(r3).iushrn(this.shift), a3 = o3; + return o3.cmp(this.m) >= 0 ? a3 = o3.isub(this.m) : o3.cmpn(0) < 0 && (a3 = o3.iadd(this.m)), a3._forceRed(this); + }, E2.prototype.invm = function(e4) { + return this.imod(e4._invmp(this.m).mul(this.r2))._forceRed(this); + }; + }(e2, n); + }(sl); + var ul, ll, cl, dl, fl, hl = sl.exports, pl = { exports: {} }; + function ml() { + if (ul) + return pl.exports; + var e2; + function t2(e3) { + this.rand = e3; + } + if (ul = 1, pl.exports = function(n3) { + return e2 || (e2 = new t2(null)), e2.generate(n3); + }, pl.exports.Rand = t2, t2.prototype.generate = function(e3) { + return this._rand(e3); + }, t2.prototype._rand = function(e3) { + if (this.rand.getBytes) + return this.rand.getBytes(e3); + for (var t3 = new Uint8Array(e3), n3 = 0; n3 < t3.length; n3++) + t3[n3] = this.rand.getByte(); + return t3; + }, "object" == typeof self) + self.crypto && self.crypto.getRandomValues ? t2.prototype._rand = function(e3) { + var t3 = new Uint8Array(e3); + return self.crypto.getRandomValues(t3), t3; + } : self.msCrypto && self.msCrypto.getRandomValues ? t2.prototype._rand = function(e3) { + var t3 = new Uint8Array(e3); + return self.msCrypto.getRandomValues(t3), t3; + } : "object" == typeof window && (t2.prototype._rand = function() { + throw new Error("Not implemented yet"); + }); + else + try { + var n2 = zm(); + if ("function" != typeof n2.randomBytes) + throw new Error("Not supported"); + t2.prototype._rand = function(e3) { + return n2.randomBytes(e3); + }; + } catch (e3) { + } + return pl.exports; + } + function gl() { + if (cl) + return ll; + cl = 1; + var e2 = hl, t2 = ml(); + function n2(e3) { + this.rand = e3 || new t2.Rand(); + } + return ll = n2, n2.create = function(e3) { + return new n2(e3); + }, n2.prototype._randbelow = function(t3) { + var n3 = t3.bitLength(), r2 = Math.ceil(n3 / 8); + do { + var i2 = new e2(this.rand.generate(r2)); + } while (i2.cmp(t3) >= 0); + return i2; + }, n2.prototype._randrange = function(e3, t3) { + var n3 = t3.sub(e3); + return e3.add(this._randbelow(n3)); + }, n2.prototype.test = function(t3, n3, r2) { + var i2 = t3.bitLength(), o2 = e2.mont(t3), a2 = new e2(1).toRed(o2); + n3 || (n3 = Math.max(1, i2 / 48 | 0)); + for (var s2 = t3.subn(1), u2 = 0; !s2.testn(u2); u2++) + ; + for (var l2 = t3.shrn(u2), c2 = s2.toRed(o2); n3 > 0; n3--) { + var d2 = this._randrange(new e2(2), s2); + r2 && r2(d2); + var f2 = d2.toRed(o2).redPow(l2); + if (0 !== f2.cmp(a2) && 0 !== f2.cmp(c2)) { + for (var h2 = 1; h2 < u2; h2++) { + if (0 === (f2 = f2.redSqr()).cmp(a2)) + return false; + if (0 === f2.cmp(c2)) + break; + } + if (h2 === u2) + return false; + } + } + return true; + }, n2.prototype.getDivisor = function(t3, n3) { + var r2 = t3.bitLength(), i2 = e2.mont(t3), o2 = new e2(1).toRed(i2); + n3 || (n3 = Math.max(1, r2 / 48 | 0)); + for (var a2 = t3.subn(1), s2 = 0; !a2.testn(s2); s2++) + ; + for (var u2 = t3.shrn(s2), l2 = a2.toRed(i2); n3 > 0; n3--) { + var c2 = this._randrange(new e2(2), a2), d2 = t3.gcd(c2); + if (0 !== d2.cmpn(1)) + return d2; + var f2 = c2.toRed(i2).redPow(u2); + if (0 !== f2.cmp(o2) && 0 !== f2.cmp(l2)) { + for (var h2 = 1; h2 < s2; h2++) { + if (0 === (f2 = f2.redSqr()).cmp(o2)) + return f2.fromRed().subn(1).gcd(t3); + if (0 === f2.cmp(l2)) + break; + } + if (h2 === s2) + return (f2 = f2.redSqr()).fromRed().subn(1).gcd(t3); + } + } + return false; + }, ll; + } + function vl() { + if (fl) + return dl; + fl = 1; + var e2 = We; + dl = m2, m2.simpleSieve = h2, m2.fermatTest = p2; + var t2 = hl, n2 = new t2(24), r2 = new (gl())(), i2 = new t2(1), o2 = new t2(2), a2 = new t2(5); + new t2(16), new t2(8); + var s2 = new t2(10), u2 = new t2(3); + new t2(7); + var l2 = new t2(11), c2 = new t2(4); + new t2(12); + var d2 = null; + function f2() { + if (null !== d2) + return d2; + var e3 = []; + e3[0] = 2; + for (var t3 = 1, n3 = 3; n3 < 1048576; n3 += 2) { + for (var r3 = Math.ceil(Math.sqrt(n3)), i3 = 0; i3 < t3 && e3[i3] <= r3 && n3 % e3[i3] != 0; i3++) + ; + t3 !== i3 && e3[i3] <= r3 || (e3[t3++] = n3); + } + return d2 = e3, e3; + } + function h2(e3) { + for (var t3 = f2(), n3 = 0; n3 < t3.length; n3++) + if (0 === e3.modn(t3[n3])) + return 0 === e3.cmpn(t3[n3]); + return true; + } + function p2(e3) { + var n3 = t2.mont(e3); + return 0 === o2.toRed(n3).redPow(e3.subn(1)).fromRed().cmpn(1); + } + function m2(d3, f3) { + if (d3 < 16) + return new t2(2 === f3 || 5 === f3 ? [140, 123] : [140, 39]); + var m3, g2; + for (f3 = new t2(f3); ; ) { + for (m3 = new t2(e2(Math.ceil(d3 / 8))); m3.bitLength() > d3; ) + m3.ishrn(1); + if (m3.isEven() && m3.iadd(i2), m3.testn(1) || m3.iadd(o2), f3.cmp(o2)) { + if (!f3.cmp(a2)) + for (; m3.mod(s2).cmp(u2); ) + m3.iadd(c2); + } else + for (; m3.mod(n2).cmp(l2); ) + m3.iadd(c2); + if (h2(g2 = m3.shrn(1)) && h2(m3) && p2(g2) && p2(m3) && r2.test(g2) && r2.test(m3)) + return m3; + } + } + return dl; + } + var bl, yl, wl, _l = { modp1: { gen: "02", prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff" }, modp2: { gen: "02", prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff" }, modp5: { gen: "02", prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff" }, modp14: { gen: "02", prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff" }, modp15: { gen: "02", prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff" }, modp16: { gen: "02", prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff" }, modp17: { gen: "02", prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff" }, modp18: { gen: "02", prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff" } }; + function Sl() { + if (yl) + return bl; + yl = 1; + var e2 = hl, t2 = new (gl())(), n2 = new e2(24), r2 = new e2(11), i2 = new e2(10), o2 = new e2(3), a2 = new e2(7), s2 = vl(), u2 = We; + function l2(t3, n3) { + return n3 = n3 || "utf8", ie(t3) || (t3 = new _(t3, n3)), this._pub = new e2(t3), this; + } + function c2(t3, n3) { + return n3 = n3 || "utf8", ie(t3) || (t3 = new _(t3, n3)), this._priv = new e2(t3), this; + } + bl = f2; + var d2 = {}; + function f2(t3, n3, r3) { + this.setGenerator(n3), this.__prime = new e2(t3), this._prime = e2.mont(this.__prime), this._primeLen = t3.length, this._pub = void 0, this._priv = void 0, this._primeCode = void 0, r3 ? (this.setPublicKey = l2, this.setPrivateKey = c2) : this._primeCode = 8; + } + function h2(e3, t3) { + var n3 = new _(e3.toArray()); + return t3 ? n3.toString(t3) : n3; + } + return Object.defineProperty(f2.prototype, "verifyError", { enumerable: true, get: function() { + return "number" != typeof this._primeCode && (this._primeCode = function(e3, u3) { + var l3 = u3.toString("hex"), c3 = [l3, e3.toString(16)].join("_"); + if (c3 in d2) + return d2[c3]; + var f3, h3 = 0; + if (e3.isEven() || !s2.simpleSieve || !s2.fermatTest(e3) || !t2.test(e3)) + return h3 += 1, h3 += "02" === l3 || "05" === l3 ? 8 : 4, d2[c3] = h3, h3; + switch (t2.test(e3.shrn(1)) || (h3 += 2), l3) { + case "02": + e3.mod(n2).cmp(r2) && (h3 += 8); + break; + case "05": + (f3 = e3.mod(i2)).cmp(o2) && f3.cmp(a2) && (h3 += 8); + break; + default: + h3 += 4; + } + return d2[c3] = h3, h3; + }(this.__prime, this.__gen)), this._primeCode; + } }), f2.prototype.generateKeys = function() { + return this._priv || (this._priv = new e2(u2(this._primeLen))), this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed(), this.getPublicKey(); + }, f2.prototype.computeSecret = function(t3) { + var n3 = new _((t3 = (t3 = new e2(t3)).toRed(this._prime)).redPow(this._priv).fromRed().toArray()), r3 = this.getPrime(); + if (n3.length < r3.length) { + var i3 = new _(r3.length - n3.length); + i3.fill(0), n3 = _.concat([i3, n3]); + } + return n3; + }, f2.prototype.getPublicKey = function(e3) { + return h2(this._pub, e3); + }, f2.prototype.getPrivateKey = function(e3) { + return h2(this._priv, e3); + }, f2.prototype.getPrime = function(e3) { + return h2(this.__prime, e3); + }, f2.prototype.getGenerator = function(e3) { + return h2(this._gen, e3); + }, f2.prototype.setGenerator = function(t3, n3) { + return n3 = n3 || "utf8", ie(t3) || (t3 = new _(t3, n3)), this.__gen = t3, this._gen = new e2(t3), this; + }, bl; + } + var El = { exports: {} }, kl = { exports: {} }; + !function(e2) { + !function(e3, t2) { + function n2(e4, t3) { + if (!e4) + throw new Error(t3 || "Assertion failed"); + } + function r2(e4, t3) { + e4.super_ = t3; + var n3 = function() { + }; + n3.prototype = t3.prototype, e4.prototype = new n3(), e4.prototype.constructor = e4; + } + function i2(e4, t3, n3) { + if (i2.isBN(e4)) + return e4; + this.negative = 0, this.words = null, this.length = 0, this.red = null, null !== e4 && ("le" !== t3 && "be" !== t3 || (n3 = t3, t3 = 10), this._init(e4 || 0, t3 || 10, n3 || "be")); + } + var o2; + "object" == typeof e3 ? e3.exports = i2 : t2.BN = i2, i2.BN = i2, i2.wordSize = 26; + try { + o2 = "undefined" != typeof window && void 0 !== window.Buffer ? window.Buffer : ce.Buffer; + } catch (e4) { + } + function a2(e4, t3) { + var r3 = e4.charCodeAt(t3); + return r3 >= 48 && r3 <= 57 ? r3 - 48 : r3 >= 65 && r3 <= 70 ? r3 - 55 : r3 >= 97 && r3 <= 102 ? r3 - 87 : void n2(false, "Invalid character in " + e4); + } + function s2(e4, t3, n3) { + var r3 = a2(e4, n3); + return n3 - 1 >= t3 && (r3 |= a2(e4, n3 - 1) << 4), r3; + } + function u2(e4, t3, r3, i3) { + for (var o3 = 0, a3 = 0, s3 = Math.min(e4.length, r3), u3 = t3; u3 < s3; u3++) { + var l3 = e4.charCodeAt(u3) - 48; + o3 *= i3, a3 = l3 >= 49 ? l3 - 49 + 10 : l3 >= 17 ? l3 - 17 + 10 : l3, n2(l3 >= 0 && a3 < i3, "Invalid character"), o3 += a3; + } + return o3; + } + function l2(e4, t3) { + e4.words = t3.words, e4.length = t3.length, e4.negative = t3.negative, e4.red = t3.red; + } + if (i2.isBN = function(e4) { + return e4 instanceof i2 || null !== e4 && "object" == typeof e4 && e4.constructor.wordSize === i2.wordSize && Array.isArray(e4.words); + }, i2.max = function(e4, t3) { + return e4.cmp(t3) > 0 ? e4 : t3; + }, i2.min = function(e4, t3) { + return e4.cmp(t3) < 0 ? e4 : t3; + }, i2.prototype._init = function(e4, t3, r3) { + if ("number" == typeof e4) + return this._initNumber(e4, t3, r3); + if ("object" == typeof e4) + return this._initArray(e4, t3, r3); + "hex" === t3 && (t3 = 16), n2(t3 === (0 | t3) && t3 >= 2 && t3 <= 36); + var i3 = 0; + "-" === (e4 = e4.toString().replace(/\s+/g, ""))[0] && (i3++, this.negative = 1), i3 < e4.length && (16 === t3 ? this._parseHex(e4, i3, r3) : (this._parseBase(e4, t3, i3), "le" === r3 && this._initArray(this.toArray(), t3, r3))); + }, i2.prototype._initNumber = function(e4, t3, r3) { + e4 < 0 && (this.negative = 1, e4 = -e4), e4 < 67108864 ? (this.words = [67108863 & e4], this.length = 1) : e4 < 4503599627370496 ? (this.words = [67108863 & e4, e4 / 67108864 & 67108863], this.length = 2) : (n2(e4 < 9007199254740992), this.words = [67108863 & e4, e4 / 67108864 & 67108863, 1], this.length = 3), "le" === r3 && this._initArray(this.toArray(), t3, r3); + }, i2.prototype._initArray = function(e4, t3, r3) { + if (n2("number" == typeof e4.length), e4.length <= 0) + return this.words = [0], this.length = 1, this; + this.length = Math.ceil(e4.length / 3), this.words = new Array(this.length); + for (var i3 = 0; i3 < this.length; i3++) + this.words[i3] = 0; + var o3, a3, s3 = 0; + if ("be" === r3) + for (i3 = e4.length - 1, o3 = 0; i3 >= 0; i3 -= 3) + a3 = e4[i3] | e4[i3 - 1] << 8 | e4[i3 - 2] << 16, this.words[o3] |= a3 << s3 & 67108863, this.words[o3 + 1] = a3 >>> 26 - s3 & 67108863, (s3 += 24) >= 26 && (s3 -= 26, o3++); + else if ("le" === r3) + for (i3 = 0, o3 = 0; i3 < e4.length; i3 += 3) + a3 = e4[i3] | e4[i3 + 1] << 8 | e4[i3 + 2] << 16, this.words[o3] |= a3 << s3 & 67108863, this.words[o3 + 1] = a3 >>> 26 - s3 & 67108863, (s3 += 24) >= 26 && (s3 -= 26, o3++); + return this._strip(); + }, i2.prototype._parseHex = function(e4, t3, n3) { + this.length = Math.ceil((e4.length - t3) / 6), this.words = new Array(this.length); + for (var r3 = 0; r3 < this.length; r3++) + this.words[r3] = 0; + var i3, o3 = 0, a3 = 0; + if ("be" === n3) + for (r3 = e4.length - 1; r3 >= t3; r3 -= 2) + i3 = s2(e4, t3, r3) << o3, this.words[a3] |= 67108863 & i3, o3 >= 18 ? (o3 -= 18, a3 += 1, this.words[a3] |= i3 >>> 26) : o3 += 8; + else + for (r3 = (e4.length - t3) % 2 == 0 ? t3 + 1 : t3; r3 < e4.length; r3 += 2) + i3 = s2(e4, t3, r3) << o3, this.words[a3] |= 67108863 & i3, o3 >= 18 ? (o3 -= 18, a3 += 1, this.words[a3] |= i3 >>> 26) : o3 += 8; + this._strip(); + }, i2.prototype._parseBase = function(e4, t3, n3) { + this.words = [0], this.length = 1; + for (var r3 = 0, i3 = 1; i3 <= 67108863; i3 *= t3) + r3++; + r3--, i3 = i3 / t3 | 0; + for (var o3 = e4.length - n3, a3 = o3 % r3, s3 = Math.min(o3, o3 - a3) + n3, l3 = 0, c3 = n3; c3 < s3; c3 += r3) + l3 = u2(e4, c3, c3 + r3, t3), this.imuln(i3), this.words[0] + l3 < 67108864 ? this.words[0] += l3 : this._iaddn(l3); + if (0 !== a3) { + var d3 = 1; + for (l3 = u2(e4, c3, e4.length, t3), c3 = 0; c3 < a3; c3++) + d3 *= t3; + this.imuln(d3), this.words[0] + l3 < 67108864 ? this.words[0] += l3 : this._iaddn(l3); + } + this._strip(); + }, i2.prototype.copy = function(e4) { + e4.words = new Array(this.length); + for (var t3 = 0; t3 < this.length; t3++) + e4.words[t3] = this.words[t3]; + e4.length = this.length, e4.negative = this.negative, e4.red = this.red; + }, i2.prototype._move = function(e4) { + l2(e4, this); + }, i2.prototype.clone = function() { + var e4 = new i2(null); + return this.copy(e4), e4; + }, i2.prototype._expand = function(e4) { + for (; this.length < e4; ) + this.words[this.length++] = 0; + return this; + }, i2.prototype._strip = function() { + for (; this.length > 1 && 0 === this.words[this.length - 1]; ) + this.length--; + return this._normSign(); + }, i2.prototype._normSign = function() { + return 1 === this.length && 0 === this.words[0] && (this.negative = 0), this; + }, "undefined" != typeof Symbol && "function" == typeof Symbol.for) + try { + i2.prototype[Symbol.for("nodejs.util.inspect.custom")] = c2; + } catch (e4) { + i2.prototype.inspect = c2; + } + else + i2.prototype.inspect = c2; + function c2() { + return (this.red ? ""; + } + var d2 = ["", "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"], f2 = [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], h2 = [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]; + i2.prototype.toString = function(e4, t3) { + var r3; + if (t3 = 0 | t3 || 1, 16 === (e4 = e4 || 10) || "hex" === e4) { + r3 = ""; + for (var i3 = 0, o3 = 0, a3 = 0; a3 < this.length; a3++) { + var s3 = this.words[a3], u3 = (16777215 & (s3 << i3 | o3)).toString(16); + o3 = s3 >>> 24 - i3 & 16777215, (i3 += 2) >= 26 && (i3 -= 26, a3--), r3 = 0 !== o3 || a3 !== this.length - 1 ? d2[6 - u3.length] + u3 + r3 : u3 + r3; + } + for (0 !== o3 && (r3 = o3.toString(16) + r3); r3.length % t3 != 0; ) + r3 = "0" + r3; + return 0 !== this.negative && (r3 = "-" + r3), r3; + } + if (e4 === (0 | e4) && e4 >= 2 && e4 <= 36) { + var l3 = f2[e4], c3 = h2[e4]; + r3 = ""; + var p3 = this.clone(); + for (p3.negative = 0; !p3.isZero(); ) { + var m3 = p3.modrn(c3).toString(e4); + r3 = (p3 = p3.idivn(c3)).isZero() ? m3 + r3 : d2[l3 - m3.length] + m3 + r3; + } + for (this.isZero() && (r3 = "0" + r3); r3.length % t3 != 0; ) + r3 = "0" + r3; + return 0 !== this.negative && (r3 = "-" + r3), r3; + } + n2(false, "Base should be between 2 and 36"); + }, i2.prototype.toNumber = function() { + var e4 = this.words[0]; + return 2 === this.length ? e4 += 67108864 * this.words[1] : 3 === this.length && 1 === this.words[2] ? e4 += 4503599627370496 + 67108864 * this.words[1] : this.length > 2 && n2(false, "Number can only safely store up to 53 bits"), 0 !== this.negative ? -e4 : e4; + }, i2.prototype.toJSON = function() { + return this.toString(16, 2); + }, o2 && (i2.prototype.toBuffer = function(e4, t3) { + return this.toArrayLike(o2, e4, t3); + }), i2.prototype.toArray = function(e4, t3) { + return this.toArrayLike(Array, e4, t3); + }; + function p2(e4, t3, n3) { + n3.negative = t3.negative ^ e4.negative; + var r3 = e4.length + t3.length | 0; + n3.length = r3, r3 = r3 - 1 | 0; + var i3 = 0 | e4.words[0], o3 = 0 | t3.words[0], a3 = i3 * o3, s3 = 67108863 & a3, u3 = a3 / 67108864 | 0; + n3.words[0] = s3; + for (var l3 = 1; l3 < r3; l3++) { + for (var c3 = u3 >>> 26, d3 = 67108863 & u3, f3 = Math.min(l3, t3.length - 1), h3 = Math.max(0, l3 - e4.length + 1); h3 <= f3; h3++) { + var p3 = l3 - h3 | 0; + c3 += (a3 = (i3 = 0 | e4.words[p3]) * (o3 = 0 | t3.words[h3]) + d3) / 67108864 | 0, d3 = 67108863 & a3; + } + n3.words[l3] = 0 | d3, u3 = 0 | c3; + } + return 0 !== u3 ? n3.words[l3] = 0 | u3 : n3.length--, n3._strip(); + } + i2.prototype.toArrayLike = function(e4, t3, r3) { + this._strip(); + var i3 = this.byteLength(), o3 = r3 || Math.max(1, i3); + n2(i3 <= o3, "byte array longer than desired length"), n2(o3 > 0, "Requested array length <= 0"); + var a3 = function(e5, t4) { + return e5.allocUnsafe ? e5.allocUnsafe(t4) : new e5(t4); + }(e4, o3); + return this["_toArrayLike" + ("le" === t3 ? "LE" : "BE")](a3, i3), a3; + }, i2.prototype._toArrayLikeLE = function(e4, t3) { + for (var n3 = 0, r3 = 0, i3 = 0, o3 = 0; i3 < this.length; i3++) { + var a3 = this.words[i3] << o3 | r3; + e4[n3++] = 255 & a3, n3 < e4.length && (e4[n3++] = a3 >> 8 & 255), n3 < e4.length && (e4[n3++] = a3 >> 16 & 255), 6 === o3 ? (n3 < e4.length && (e4[n3++] = a3 >> 24 & 255), r3 = 0, o3 = 0) : (r3 = a3 >>> 24, o3 += 2); + } + if (n3 < e4.length) + for (e4[n3++] = r3; n3 < e4.length; ) + e4[n3++] = 0; + }, i2.prototype._toArrayLikeBE = function(e4, t3) { + for (var n3 = e4.length - 1, r3 = 0, i3 = 0, o3 = 0; i3 < this.length; i3++) { + var a3 = this.words[i3] << o3 | r3; + e4[n3--] = 255 & a3, n3 >= 0 && (e4[n3--] = a3 >> 8 & 255), n3 >= 0 && (e4[n3--] = a3 >> 16 & 255), 6 === o3 ? (n3 >= 0 && (e4[n3--] = a3 >> 24 & 255), r3 = 0, o3 = 0) : (r3 = a3 >>> 24, o3 += 2); + } + if (n3 >= 0) + for (e4[n3--] = r3; n3 >= 0; ) + e4[n3--] = 0; + }, Math.clz32 ? i2.prototype._countBits = function(e4) { + return 32 - Math.clz32(e4); + } : i2.prototype._countBits = function(e4) { + var t3 = e4, n3 = 0; + return t3 >= 4096 && (n3 += 13, t3 >>>= 13), t3 >= 64 && (n3 += 7, t3 >>>= 7), t3 >= 8 && (n3 += 4, t3 >>>= 4), t3 >= 2 && (n3 += 2, t3 >>>= 2), n3 + t3; + }, i2.prototype._zeroBits = function(e4) { + if (0 === e4) + return 26; + var t3 = e4, n3 = 0; + return 0 == (8191 & t3) && (n3 += 13, t3 >>>= 13), 0 == (127 & t3) && (n3 += 7, t3 >>>= 7), 0 == (15 & t3) && (n3 += 4, t3 >>>= 4), 0 == (3 & t3) && (n3 += 2, t3 >>>= 2), 0 == (1 & t3) && n3++, n3; + }, i2.prototype.bitLength = function() { + var e4 = this.words[this.length - 1], t3 = this._countBits(e4); + return 26 * (this.length - 1) + t3; + }, i2.prototype.zeroBits = function() { + if (this.isZero()) + return 0; + for (var e4 = 0, t3 = 0; t3 < this.length; t3++) { + var n3 = this._zeroBits(this.words[t3]); + if (e4 += n3, 26 !== n3) + break; + } + return e4; + }, i2.prototype.byteLength = function() { + return Math.ceil(this.bitLength() / 8); + }, i2.prototype.toTwos = function(e4) { + return 0 !== this.negative ? this.abs().inotn(e4).iaddn(1) : this.clone(); + }, i2.prototype.fromTwos = function(e4) { + return this.testn(e4 - 1) ? this.notn(e4).iaddn(1).ineg() : this.clone(); + }, i2.prototype.isNeg = function() { + return 0 !== this.negative; + }, i2.prototype.neg = function() { + return this.clone().ineg(); + }, i2.prototype.ineg = function() { + return this.isZero() || (this.negative ^= 1), this; + }, i2.prototype.iuor = function(e4) { + for (; this.length < e4.length; ) + this.words[this.length++] = 0; + for (var t3 = 0; t3 < e4.length; t3++) + this.words[t3] = this.words[t3] | e4.words[t3]; + return this._strip(); + }, i2.prototype.ior = function(e4) { + return n2(0 == (this.negative | e4.negative)), this.iuor(e4); + }, i2.prototype.or = function(e4) { + return this.length > e4.length ? this.clone().ior(e4) : e4.clone().ior(this); + }, i2.prototype.uor = function(e4) { + return this.length > e4.length ? this.clone().iuor(e4) : e4.clone().iuor(this); + }, i2.prototype.iuand = function(e4) { + var t3; + t3 = this.length > e4.length ? e4 : this; + for (var n3 = 0; n3 < t3.length; n3++) + this.words[n3] = this.words[n3] & e4.words[n3]; + return this.length = t3.length, this._strip(); + }, i2.prototype.iand = function(e4) { + return n2(0 == (this.negative | e4.negative)), this.iuand(e4); + }, i2.prototype.and = function(e4) { + return this.length > e4.length ? this.clone().iand(e4) : e4.clone().iand(this); + }, i2.prototype.uand = function(e4) { + return this.length > e4.length ? this.clone().iuand(e4) : e4.clone().iuand(this); + }, i2.prototype.iuxor = function(e4) { + var t3, n3; + this.length > e4.length ? (t3 = this, n3 = e4) : (t3 = e4, n3 = this); + for (var r3 = 0; r3 < n3.length; r3++) + this.words[r3] = t3.words[r3] ^ n3.words[r3]; + if (this !== t3) + for (; r3 < t3.length; r3++) + this.words[r3] = t3.words[r3]; + return this.length = t3.length, this._strip(); + }, i2.prototype.ixor = function(e4) { + return n2(0 == (this.negative | e4.negative)), this.iuxor(e4); + }, i2.prototype.xor = function(e4) { + return this.length > e4.length ? this.clone().ixor(e4) : e4.clone().ixor(this); + }, i2.prototype.uxor = function(e4) { + return this.length > e4.length ? this.clone().iuxor(e4) : e4.clone().iuxor(this); + }, i2.prototype.inotn = function(e4) { + n2("number" == typeof e4 && e4 >= 0); + var t3 = 0 | Math.ceil(e4 / 26), r3 = e4 % 26; + this._expand(t3), r3 > 0 && t3--; + for (var i3 = 0; i3 < t3; i3++) + this.words[i3] = 67108863 & ~this.words[i3]; + return r3 > 0 && (this.words[i3] = ~this.words[i3] & 67108863 >> 26 - r3), this._strip(); + }, i2.prototype.notn = function(e4) { + return this.clone().inotn(e4); + }, i2.prototype.setn = function(e4, t3) { + n2("number" == typeof e4 && e4 >= 0); + var r3 = e4 / 26 | 0, i3 = e4 % 26; + return this._expand(r3 + 1), this.words[r3] = t3 ? this.words[r3] | 1 << i3 : this.words[r3] & ~(1 << i3), this._strip(); + }, i2.prototype.iadd = function(e4) { + var t3, n3, r3; + if (0 !== this.negative && 0 === e4.negative) + return this.negative = 0, t3 = this.isub(e4), this.negative ^= 1, this._normSign(); + if (0 === this.negative && 0 !== e4.negative) + return e4.negative = 0, t3 = this.isub(e4), e4.negative = 1, t3._normSign(); + this.length > e4.length ? (n3 = this, r3 = e4) : (n3 = e4, r3 = this); + for (var i3 = 0, o3 = 0; o3 < r3.length; o3++) + t3 = (0 | n3.words[o3]) + (0 | r3.words[o3]) + i3, this.words[o3] = 67108863 & t3, i3 = t3 >>> 26; + for (; 0 !== i3 && o3 < n3.length; o3++) + t3 = (0 | n3.words[o3]) + i3, this.words[o3] = 67108863 & t3, i3 = t3 >>> 26; + if (this.length = n3.length, 0 !== i3) + this.words[this.length] = i3, this.length++; + else if (n3 !== this) + for (; o3 < n3.length; o3++) + this.words[o3] = n3.words[o3]; + return this; + }, i2.prototype.add = function(e4) { + var t3; + return 0 !== e4.negative && 0 === this.negative ? (e4.negative = 0, t3 = this.sub(e4), e4.negative ^= 1, t3) : 0 === e4.negative && 0 !== this.negative ? (this.negative = 0, t3 = e4.sub(this), this.negative = 1, t3) : this.length > e4.length ? this.clone().iadd(e4) : e4.clone().iadd(this); + }, i2.prototype.isub = function(e4) { + if (0 !== e4.negative) { + e4.negative = 0; + var t3 = this.iadd(e4); + return e4.negative = 1, t3._normSign(); + } + if (0 !== this.negative) + return this.negative = 0, this.iadd(e4), this.negative = 1, this._normSign(); + var n3, r3, i3 = this.cmp(e4); + if (0 === i3) + return this.negative = 0, this.length = 1, this.words[0] = 0, this; + i3 > 0 ? (n3 = this, r3 = e4) : (n3 = e4, r3 = this); + for (var o3 = 0, a3 = 0; a3 < r3.length; a3++) + o3 = (t3 = (0 | n3.words[a3]) - (0 | r3.words[a3]) + o3) >> 26, this.words[a3] = 67108863 & t3; + for (; 0 !== o3 && a3 < n3.length; a3++) + o3 = (t3 = (0 | n3.words[a3]) + o3) >> 26, this.words[a3] = 67108863 & t3; + if (0 === o3 && a3 < n3.length && n3 !== this) + for (; a3 < n3.length; a3++) + this.words[a3] = n3.words[a3]; + return this.length = Math.max(this.length, a3), n3 !== this && (this.negative = 1), this._strip(); + }, i2.prototype.sub = function(e4) { + return this.clone().isub(e4); + }; + var m2 = function(e4, t3, n3) { + var r3, i3, o3, a3 = e4.words, s3 = t3.words, u3 = n3.words, l3 = 0, c3 = 0 | a3[0], d3 = 8191 & c3, f3 = c3 >>> 13, h3 = 0 | a3[1], p3 = 8191 & h3, m3 = h3 >>> 13, g3 = 0 | a3[2], v3 = 8191 & g3, b3 = g3 >>> 13, y3 = 0 | a3[3], w3 = 8191 & y3, _3 = y3 >>> 13, S3 = 0 | a3[4], E3 = 8191 & S3, k3 = S3 >>> 13, M3 = 0 | a3[5], C2 = 8191 & M3, x2 = M3 >>> 13, A2 = 0 | a3[6], R2 = 8191 & A2, T2 = A2 >>> 13, P2 = 0 | a3[7], L2 = 8191 & P2, I2 = P2 >>> 13, O2 = 0 | a3[8], N2 = 8191 & O2, D2 = O2 >>> 13, j2 = 0 | a3[9], B2 = 8191 & j2, z2 = j2 >>> 13, U2 = 0 | s3[0], F2 = 8191 & U2, K2 = U2 >>> 13, q2 = 0 | s3[1], H2 = 8191 & q2, W2 = q2 >>> 13, $2 = 0 | s3[2], V2 = 8191 & $2, Y2 = $2 >>> 13, G2 = 0 | s3[3], Z2 = 8191 & G2, Q2 = G2 >>> 13, J2 = 0 | s3[4], X2 = 8191 & J2, ee2 = J2 >>> 13, te2 = 0 | s3[5], ne2 = 8191 & te2, re2 = te2 >>> 13, ie2 = 0 | s3[6], oe2 = 8191 & ie2, ae2 = ie2 >>> 13, se2 = 0 | s3[7], ue2 = 8191 & se2, le2 = se2 >>> 13, ce2 = 0 | s3[8], de2 = 8191 & ce2, fe2 = ce2 >>> 13, he2 = 0 | s3[9], pe2 = 8191 & he2, me2 = he2 >>> 13; + n3.negative = e4.negative ^ t3.negative, n3.length = 19; + var ge2 = (l3 + (r3 = Math.imul(d3, F2)) | 0) + ((8191 & (i3 = (i3 = Math.imul(d3, K2)) + Math.imul(f3, F2) | 0)) << 13) | 0; + l3 = ((o3 = Math.imul(f3, K2)) + (i3 >>> 13) | 0) + (ge2 >>> 26) | 0, ge2 &= 67108863, r3 = Math.imul(p3, F2), i3 = (i3 = Math.imul(p3, K2)) + Math.imul(m3, F2) | 0, o3 = Math.imul(m3, K2); + var ve2 = (l3 + (r3 = r3 + Math.imul(d3, H2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, W2) | 0) + Math.imul(f3, H2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, W2) | 0) + (i3 >>> 13) | 0) + (ve2 >>> 26) | 0, ve2 &= 67108863, r3 = Math.imul(v3, F2), i3 = (i3 = Math.imul(v3, K2)) + Math.imul(b3, F2) | 0, o3 = Math.imul(b3, K2), r3 = r3 + Math.imul(p3, H2) | 0, i3 = (i3 = i3 + Math.imul(p3, W2) | 0) + Math.imul(m3, H2) | 0, o3 = o3 + Math.imul(m3, W2) | 0; + var be2 = (l3 + (r3 = r3 + Math.imul(d3, V2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, Y2) | 0) + Math.imul(f3, V2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, Y2) | 0) + (i3 >>> 13) | 0) + (be2 >>> 26) | 0, be2 &= 67108863, r3 = Math.imul(w3, F2), i3 = (i3 = Math.imul(w3, K2)) + Math.imul(_3, F2) | 0, o3 = Math.imul(_3, K2), r3 = r3 + Math.imul(v3, H2) | 0, i3 = (i3 = i3 + Math.imul(v3, W2) | 0) + Math.imul(b3, H2) | 0, o3 = o3 + Math.imul(b3, W2) | 0, r3 = r3 + Math.imul(p3, V2) | 0, i3 = (i3 = i3 + Math.imul(p3, Y2) | 0) + Math.imul(m3, V2) | 0, o3 = o3 + Math.imul(m3, Y2) | 0; + var ye2 = (l3 + (r3 = r3 + Math.imul(d3, Z2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, Q2) | 0) + Math.imul(f3, Z2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, Q2) | 0) + (i3 >>> 13) | 0) + (ye2 >>> 26) | 0, ye2 &= 67108863, r3 = Math.imul(E3, F2), i3 = (i3 = Math.imul(E3, K2)) + Math.imul(k3, F2) | 0, o3 = Math.imul(k3, K2), r3 = r3 + Math.imul(w3, H2) | 0, i3 = (i3 = i3 + Math.imul(w3, W2) | 0) + Math.imul(_3, H2) | 0, o3 = o3 + Math.imul(_3, W2) | 0, r3 = r3 + Math.imul(v3, V2) | 0, i3 = (i3 = i3 + Math.imul(v3, Y2) | 0) + Math.imul(b3, V2) | 0, o3 = o3 + Math.imul(b3, Y2) | 0, r3 = r3 + Math.imul(p3, Z2) | 0, i3 = (i3 = i3 + Math.imul(p3, Q2) | 0) + Math.imul(m3, Z2) | 0, o3 = o3 + Math.imul(m3, Q2) | 0; + var we2 = (l3 + (r3 = r3 + Math.imul(d3, X2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, ee2) | 0) + Math.imul(f3, X2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, ee2) | 0) + (i3 >>> 13) | 0) + (we2 >>> 26) | 0, we2 &= 67108863, r3 = Math.imul(C2, F2), i3 = (i3 = Math.imul(C2, K2)) + Math.imul(x2, F2) | 0, o3 = Math.imul(x2, K2), r3 = r3 + Math.imul(E3, H2) | 0, i3 = (i3 = i3 + Math.imul(E3, W2) | 0) + Math.imul(k3, H2) | 0, o3 = o3 + Math.imul(k3, W2) | 0, r3 = r3 + Math.imul(w3, V2) | 0, i3 = (i3 = i3 + Math.imul(w3, Y2) | 0) + Math.imul(_3, V2) | 0, o3 = o3 + Math.imul(_3, Y2) | 0, r3 = r3 + Math.imul(v3, Z2) | 0, i3 = (i3 = i3 + Math.imul(v3, Q2) | 0) + Math.imul(b3, Z2) | 0, o3 = o3 + Math.imul(b3, Q2) | 0, r3 = r3 + Math.imul(p3, X2) | 0, i3 = (i3 = i3 + Math.imul(p3, ee2) | 0) + Math.imul(m3, X2) | 0, o3 = o3 + Math.imul(m3, ee2) | 0; + var _e2 = (l3 + (r3 = r3 + Math.imul(d3, ne2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, re2) | 0) + Math.imul(f3, ne2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, re2) | 0) + (i3 >>> 13) | 0) + (_e2 >>> 26) | 0, _e2 &= 67108863, r3 = Math.imul(R2, F2), i3 = (i3 = Math.imul(R2, K2)) + Math.imul(T2, F2) | 0, o3 = Math.imul(T2, K2), r3 = r3 + Math.imul(C2, H2) | 0, i3 = (i3 = i3 + Math.imul(C2, W2) | 0) + Math.imul(x2, H2) | 0, o3 = o3 + Math.imul(x2, W2) | 0, r3 = r3 + Math.imul(E3, V2) | 0, i3 = (i3 = i3 + Math.imul(E3, Y2) | 0) + Math.imul(k3, V2) | 0, o3 = o3 + Math.imul(k3, Y2) | 0, r3 = r3 + Math.imul(w3, Z2) | 0, i3 = (i3 = i3 + Math.imul(w3, Q2) | 0) + Math.imul(_3, Z2) | 0, o3 = o3 + Math.imul(_3, Q2) | 0, r3 = r3 + Math.imul(v3, X2) | 0, i3 = (i3 = i3 + Math.imul(v3, ee2) | 0) + Math.imul(b3, X2) | 0, o3 = o3 + Math.imul(b3, ee2) | 0, r3 = r3 + Math.imul(p3, ne2) | 0, i3 = (i3 = i3 + Math.imul(p3, re2) | 0) + Math.imul(m3, ne2) | 0, o3 = o3 + Math.imul(m3, re2) | 0; + var Se2 = (l3 + (r3 = r3 + Math.imul(d3, oe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, ae2) | 0) + Math.imul(f3, oe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, ae2) | 0) + (i3 >>> 13) | 0) + (Se2 >>> 26) | 0, Se2 &= 67108863, r3 = Math.imul(L2, F2), i3 = (i3 = Math.imul(L2, K2)) + Math.imul(I2, F2) | 0, o3 = Math.imul(I2, K2), r3 = r3 + Math.imul(R2, H2) | 0, i3 = (i3 = i3 + Math.imul(R2, W2) | 0) + Math.imul(T2, H2) | 0, o3 = o3 + Math.imul(T2, W2) | 0, r3 = r3 + Math.imul(C2, V2) | 0, i3 = (i3 = i3 + Math.imul(C2, Y2) | 0) + Math.imul(x2, V2) | 0, o3 = o3 + Math.imul(x2, Y2) | 0, r3 = r3 + Math.imul(E3, Z2) | 0, i3 = (i3 = i3 + Math.imul(E3, Q2) | 0) + Math.imul(k3, Z2) | 0, o3 = o3 + Math.imul(k3, Q2) | 0, r3 = r3 + Math.imul(w3, X2) | 0, i3 = (i3 = i3 + Math.imul(w3, ee2) | 0) + Math.imul(_3, X2) | 0, o3 = o3 + Math.imul(_3, ee2) | 0, r3 = r3 + Math.imul(v3, ne2) | 0, i3 = (i3 = i3 + Math.imul(v3, re2) | 0) + Math.imul(b3, ne2) | 0, o3 = o3 + Math.imul(b3, re2) | 0, r3 = r3 + Math.imul(p3, oe2) | 0, i3 = (i3 = i3 + Math.imul(p3, ae2) | 0) + Math.imul(m3, oe2) | 0, o3 = o3 + Math.imul(m3, ae2) | 0; + var Ee2 = (l3 + (r3 = r3 + Math.imul(d3, ue2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, le2) | 0) + Math.imul(f3, ue2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, le2) | 0) + (i3 >>> 13) | 0) + (Ee2 >>> 26) | 0, Ee2 &= 67108863, r3 = Math.imul(N2, F2), i3 = (i3 = Math.imul(N2, K2)) + Math.imul(D2, F2) | 0, o3 = Math.imul(D2, K2), r3 = r3 + Math.imul(L2, H2) | 0, i3 = (i3 = i3 + Math.imul(L2, W2) | 0) + Math.imul(I2, H2) | 0, o3 = o3 + Math.imul(I2, W2) | 0, r3 = r3 + Math.imul(R2, V2) | 0, i3 = (i3 = i3 + Math.imul(R2, Y2) | 0) + Math.imul(T2, V2) | 0, o3 = o3 + Math.imul(T2, Y2) | 0, r3 = r3 + Math.imul(C2, Z2) | 0, i3 = (i3 = i3 + Math.imul(C2, Q2) | 0) + Math.imul(x2, Z2) | 0, o3 = o3 + Math.imul(x2, Q2) | 0, r3 = r3 + Math.imul(E3, X2) | 0, i3 = (i3 = i3 + Math.imul(E3, ee2) | 0) + Math.imul(k3, X2) | 0, o3 = o3 + Math.imul(k3, ee2) | 0, r3 = r3 + Math.imul(w3, ne2) | 0, i3 = (i3 = i3 + Math.imul(w3, re2) | 0) + Math.imul(_3, ne2) | 0, o3 = o3 + Math.imul(_3, re2) | 0, r3 = r3 + Math.imul(v3, oe2) | 0, i3 = (i3 = i3 + Math.imul(v3, ae2) | 0) + Math.imul(b3, oe2) | 0, o3 = o3 + Math.imul(b3, ae2) | 0, r3 = r3 + Math.imul(p3, ue2) | 0, i3 = (i3 = i3 + Math.imul(p3, le2) | 0) + Math.imul(m3, ue2) | 0, o3 = o3 + Math.imul(m3, le2) | 0; + var ke2 = (l3 + (r3 = r3 + Math.imul(d3, de2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, fe2) | 0) + Math.imul(f3, de2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, fe2) | 0) + (i3 >>> 13) | 0) + (ke2 >>> 26) | 0, ke2 &= 67108863, r3 = Math.imul(B2, F2), i3 = (i3 = Math.imul(B2, K2)) + Math.imul(z2, F2) | 0, o3 = Math.imul(z2, K2), r3 = r3 + Math.imul(N2, H2) | 0, i3 = (i3 = i3 + Math.imul(N2, W2) | 0) + Math.imul(D2, H2) | 0, o3 = o3 + Math.imul(D2, W2) | 0, r3 = r3 + Math.imul(L2, V2) | 0, i3 = (i3 = i3 + Math.imul(L2, Y2) | 0) + Math.imul(I2, V2) | 0, o3 = o3 + Math.imul(I2, Y2) | 0, r3 = r3 + Math.imul(R2, Z2) | 0, i3 = (i3 = i3 + Math.imul(R2, Q2) | 0) + Math.imul(T2, Z2) | 0, o3 = o3 + Math.imul(T2, Q2) | 0, r3 = r3 + Math.imul(C2, X2) | 0, i3 = (i3 = i3 + Math.imul(C2, ee2) | 0) + Math.imul(x2, X2) | 0, o3 = o3 + Math.imul(x2, ee2) | 0, r3 = r3 + Math.imul(E3, ne2) | 0, i3 = (i3 = i3 + Math.imul(E3, re2) | 0) + Math.imul(k3, ne2) | 0, o3 = o3 + Math.imul(k3, re2) | 0, r3 = r3 + Math.imul(w3, oe2) | 0, i3 = (i3 = i3 + Math.imul(w3, ae2) | 0) + Math.imul(_3, oe2) | 0, o3 = o3 + Math.imul(_3, ae2) | 0, r3 = r3 + Math.imul(v3, ue2) | 0, i3 = (i3 = i3 + Math.imul(v3, le2) | 0) + Math.imul(b3, ue2) | 0, o3 = o3 + Math.imul(b3, le2) | 0, r3 = r3 + Math.imul(p3, de2) | 0, i3 = (i3 = i3 + Math.imul(p3, fe2) | 0) + Math.imul(m3, de2) | 0, o3 = o3 + Math.imul(m3, fe2) | 0; + var Me2 = (l3 + (r3 = r3 + Math.imul(d3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, me2) | 0) + Math.imul(f3, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, me2) | 0) + (i3 >>> 13) | 0) + (Me2 >>> 26) | 0, Me2 &= 67108863, r3 = Math.imul(B2, H2), i3 = (i3 = Math.imul(B2, W2)) + Math.imul(z2, H2) | 0, o3 = Math.imul(z2, W2), r3 = r3 + Math.imul(N2, V2) | 0, i3 = (i3 = i3 + Math.imul(N2, Y2) | 0) + Math.imul(D2, V2) | 0, o3 = o3 + Math.imul(D2, Y2) | 0, r3 = r3 + Math.imul(L2, Z2) | 0, i3 = (i3 = i3 + Math.imul(L2, Q2) | 0) + Math.imul(I2, Z2) | 0, o3 = o3 + Math.imul(I2, Q2) | 0, r3 = r3 + Math.imul(R2, X2) | 0, i3 = (i3 = i3 + Math.imul(R2, ee2) | 0) + Math.imul(T2, X2) | 0, o3 = o3 + Math.imul(T2, ee2) | 0, r3 = r3 + Math.imul(C2, ne2) | 0, i3 = (i3 = i3 + Math.imul(C2, re2) | 0) + Math.imul(x2, ne2) | 0, o3 = o3 + Math.imul(x2, re2) | 0, r3 = r3 + Math.imul(E3, oe2) | 0, i3 = (i3 = i3 + Math.imul(E3, ae2) | 0) + Math.imul(k3, oe2) | 0, o3 = o3 + Math.imul(k3, ae2) | 0, r3 = r3 + Math.imul(w3, ue2) | 0, i3 = (i3 = i3 + Math.imul(w3, le2) | 0) + Math.imul(_3, ue2) | 0, o3 = o3 + Math.imul(_3, le2) | 0, r3 = r3 + Math.imul(v3, de2) | 0, i3 = (i3 = i3 + Math.imul(v3, fe2) | 0) + Math.imul(b3, de2) | 0, o3 = o3 + Math.imul(b3, fe2) | 0; + var Ce2 = (l3 + (r3 = r3 + Math.imul(p3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(p3, me2) | 0) + Math.imul(m3, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(m3, me2) | 0) + (i3 >>> 13) | 0) + (Ce2 >>> 26) | 0, Ce2 &= 67108863, r3 = Math.imul(B2, V2), i3 = (i3 = Math.imul(B2, Y2)) + Math.imul(z2, V2) | 0, o3 = Math.imul(z2, Y2), r3 = r3 + Math.imul(N2, Z2) | 0, i3 = (i3 = i3 + Math.imul(N2, Q2) | 0) + Math.imul(D2, Z2) | 0, o3 = o3 + Math.imul(D2, Q2) | 0, r3 = r3 + Math.imul(L2, X2) | 0, i3 = (i3 = i3 + Math.imul(L2, ee2) | 0) + Math.imul(I2, X2) | 0, o3 = o3 + Math.imul(I2, ee2) | 0, r3 = r3 + Math.imul(R2, ne2) | 0, i3 = (i3 = i3 + Math.imul(R2, re2) | 0) + Math.imul(T2, ne2) | 0, o3 = o3 + Math.imul(T2, re2) | 0, r3 = r3 + Math.imul(C2, oe2) | 0, i3 = (i3 = i3 + Math.imul(C2, ae2) | 0) + Math.imul(x2, oe2) | 0, o3 = o3 + Math.imul(x2, ae2) | 0, r3 = r3 + Math.imul(E3, ue2) | 0, i3 = (i3 = i3 + Math.imul(E3, le2) | 0) + Math.imul(k3, ue2) | 0, o3 = o3 + Math.imul(k3, le2) | 0, r3 = r3 + Math.imul(w3, de2) | 0, i3 = (i3 = i3 + Math.imul(w3, fe2) | 0) + Math.imul(_3, de2) | 0, o3 = o3 + Math.imul(_3, fe2) | 0; + var xe2 = (l3 + (r3 = r3 + Math.imul(v3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(v3, me2) | 0) + Math.imul(b3, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(b3, me2) | 0) + (i3 >>> 13) | 0) + (xe2 >>> 26) | 0, xe2 &= 67108863, r3 = Math.imul(B2, Z2), i3 = (i3 = Math.imul(B2, Q2)) + Math.imul(z2, Z2) | 0, o3 = Math.imul(z2, Q2), r3 = r3 + Math.imul(N2, X2) | 0, i3 = (i3 = i3 + Math.imul(N2, ee2) | 0) + Math.imul(D2, X2) | 0, o3 = o3 + Math.imul(D2, ee2) | 0, r3 = r3 + Math.imul(L2, ne2) | 0, i3 = (i3 = i3 + Math.imul(L2, re2) | 0) + Math.imul(I2, ne2) | 0, o3 = o3 + Math.imul(I2, re2) | 0, r3 = r3 + Math.imul(R2, oe2) | 0, i3 = (i3 = i3 + Math.imul(R2, ae2) | 0) + Math.imul(T2, oe2) | 0, o3 = o3 + Math.imul(T2, ae2) | 0, r3 = r3 + Math.imul(C2, ue2) | 0, i3 = (i3 = i3 + Math.imul(C2, le2) | 0) + Math.imul(x2, ue2) | 0, o3 = o3 + Math.imul(x2, le2) | 0, r3 = r3 + Math.imul(E3, de2) | 0, i3 = (i3 = i3 + Math.imul(E3, fe2) | 0) + Math.imul(k3, de2) | 0, o3 = o3 + Math.imul(k3, fe2) | 0; + var Ae2 = (l3 + (r3 = r3 + Math.imul(w3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(w3, me2) | 0) + Math.imul(_3, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(_3, me2) | 0) + (i3 >>> 13) | 0) + (Ae2 >>> 26) | 0, Ae2 &= 67108863, r3 = Math.imul(B2, X2), i3 = (i3 = Math.imul(B2, ee2)) + Math.imul(z2, X2) | 0, o3 = Math.imul(z2, ee2), r3 = r3 + Math.imul(N2, ne2) | 0, i3 = (i3 = i3 + Math.imul(N2, re2) | 0) + Math.imul(D2, ne2) | 0, o3 = o3 + Math.imul(D2, re2) | 0, r3 = r3 + Math.imul(L2, oe2) | 0, i3 = (i3 = i3 + Math.imul(L2, ae2) | 0) + Math.imul(I2, oe2) | 0, o3 = o3 + Math.imul(I2, ae2) | 0, r3 = r3 + Math.imul(R2, ue2) | 0, i3 = (i3 = i3 + Math.imul(R2, le2) | 0) + Math.imul(T2, ue2) | 0, o3 = o3 + Math.imul(T2, le2) | 0, r3 = r3 + Math.imul(C2, de2) | 0, i3 = (i3 = i3 + Math.imul(C2, fe2) | 0) + Math.imul(x2, de2) | 0, o3 = o3 + Math.imul(x2, fe2) | 0; + var Re2 = (l3 + (r3 = r3 + Math.imul(E3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(E3, me2) | 0) + Math.imul(k3, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(k3, me2) | 0) + (i3 >>> 13) | 0) + (Re2 >>> 26) | 0, Re2 &= 67108863, r3 = Math.imul(B2, ne2), i3 = (i3 = Math.imul(B2, re2)) + Math.imul(z2, ne2) | 0, o3 = Math.imul(z2, re2), r3 = r3 + Math.imul(N2, oe2) | 0, i3 = (i3 = i3 + Math.imul(N2, ae2) | 0) + Math.imul(D2, oe2) | 0, o3 = o3 + Math.imul(D2, ae2) | 0, r3 = r3 + Math.imul(L2, ue2) | 0, i3 = (i3 = i3 + Math.imul(L2, le2) | 0) + Math.imul(I2, ue2) | 0, o3 = o3 + Math.imul(I2, le2) | 0, r3 = r3 + Math.imul(R2, de2) | 0, i3 = (i3 = i3 + Math.imul(R2, fe2) | 0) + Math.imul(T2, de2) | 0, o3 = o3 + Math.imul(T2, fe2) | 0; + var Te2 = (l3 + (r3 = r3 + Math.imul(C2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(C2, me2) | 0) + Math.imul(x2, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(x2, me2) | 0) + (i3 >>> 13) | 0) + (Te2 >>> 26) | 0, Te2 &= 67108863, r3 = Math.imul(B2, oe2), i3 = (i3 = Math.imul(B2, ae2)) + Math.imul(z2, oe2) | 0, o3 = Math.imul(z2, ae2), r3 = r3 + Math.imul(N2, ue2) | 0, i3 = (i3 = i3 + Math.imul(N2, le2) | 0) + Math.imul(D2, ue2) | 0, o3 = o3 + Math.imul(D2, le2) | 0, r3 = r3 + Math.imul(L2, de2) | 0, i3 = (i3 = i3 + Math.imul(L2, fe2) | 0) + Math.imul(I2, de2) | 0, o3 = o3 + Math.imul(I2, fe2) | 0; + var Pe2 = (l3 + (r3 = r3 + Math.imul(R2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(R2, me2) | 0) + Math.imul(T2, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(T2, me2) | 0) + (i3 >>> 13) | 0) + (Pe2 >>> 26) | 0, Pe2 &= 67108863, r3 = Math.imul(B2, ue2), i3 = (i3 = Math.imul(B2, le2)) + Math.imul(z2, ue2) | 0, o3 = Math.imul(z2, le2), r3 = r3 + Math.imul(N2, de2) | 0, i3 = (i3 = i3 + Math.imul(N2, fe2) | 0) + Math.imul(D2, de2) | 0, o3 = o3 + Math.imul(D2, fe2) | 0; + var Le2 = (l3 + (r3 = r3 + Math.imul(L2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(L2, me2) | 0) + Math.imul(I2, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(I2, me2) | 0) + (i3 >>> 13) | 0) + (Le2 >>> 26) | 0, Le2 &= 67108863, r3 = Math.imul(B2, de2), i3 = (i3 = Math.imul(B2, fe2)) + Math.imul(z2, de2) | 0, o3 = Math.imul(z2, fe2); + var Ie2 = (l3 + (r3 = r3 + Math.imul(N2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(N2, me2) | 0) + Math.imul(D2, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(D2, me2) | 0) + (i3 >>> 13) | 0) + (Ie2 >>> 26) | 0, Ie2 &= 67108863; + var Oe2 = (l3 + (r3 = Math.imul(B2, pe2)) | 0) + ((8191 & (i3 = (i3 = Math.imul(B2, me2)) + Math.imul(z2, pe2) | 0)) << 13) | 0; + return l3 = ((o3 = Math.imul(z2, me2)) + (i3 >>> 13) | 0) + (Oe2 >>> 26) | 0, Oe2 &= 67108863, u3[0] = ge2, u3[1] = ve2, u3[2] = be2, u3[3] = ye2, u3[4] = we2, u3[5] = _e2, u3[6] = Se2, u3[7] = Ee2, u3[8] = ke2, u3[9] = Me2, u3[10] = Ce2, u3[11] = xe2, u3[12] = Ae2, u3[13] = Re2, u3[14] = Te2, u3[15] = Pe2, u3[16] = Le2, u3[17] = Ie2, u3[18] = Oe2, 0 !== l3 && (u3[19] = l3, n3.length++), n3; + }; + function g2(e4, t3, n3) { + n3.negative = t3.negative ^ e4.negative, n3.length = e4.length + t3.length; + for (var r3 = 0, i3 = 0, o3 = 0; o3 < n3.length - 1; o3++) { + var a3 = i3; + i3 = 0; + for (var s3 = 67108863 & r3, u3 = Math.min(o3, t3.length - 1), l3 = Math.max(0, o3 - e4.length + 1); l3 <= u3; l3++) { + var c3 = o3 - l3, d3 = (0 | e4.words[c3]) * (0 | t3.words[l3]), f3 = 67108863 & d3; + s3 = 67108863 & (f3 = f3 + s3 | 0), i3 += (a3 = (a3 = a3 + (d3 / 67108864 | 0) | 0) + (f3 >>> 26) | 0) >>> 26, a3 &= 67108863; + } + n3.words[o3] = s3, r3 = a3, a3 = i3; + } + return 0 !== r3 ? n3.words[o3] = r3 : n3.length--, n3._strip(); + } + function v2(e4, t3, n3) { + return g2(e4, t3, n3); + } + Math.imul || (m2 = p2), i2.prototype.mulTo = function(e4, t3) { + var n3 = this.length + e4.length; + return 10 === this.length && 10 === e4.length ? m2(this, e4, t3) : n3 < 63 ? p2(this, e4, t3) : n3 < 1024 ? g2(this, e4, t3) : v2(this, e4, t3); + }, i2.prototype.mul = function(e4) { + var t3 = new i2(null); + return t3.words = new Array(this.length + e4.length), this.mulTo(e4, t3); + }, i2.prototype.mulf = function(e4) { + var t3 = new i2(null); + return t3.words = new Array(this.length + e4.length), v2(this, e4, t3); + }, i2.prototype.imul = function(e4) { + return this.clone().mulTo(e4, this); + }, i2.prototype.imuln = function(e4) { + var t3 = e4 < 0; + t3 && (e4 = -e4), n2("number" == typeof e4), n2(e4 < 67108864); + for (var r3 = 0, i3 = 0; i3 < this.length; i3++) { + var o3 = (0 | this.words[i3]) * e4, a3 = (67108863 & o3) + (67108863 & r3); + r3 >>= 26, r3 += o3 / 67108864 | 0, r3 += a3 >>> 26, this.words[i3] = 67108863 & a3; + } + return 0 !== r3 && (this.words[i3] = r3, this.length++), t3 ? this.ineg() : this; + }, i2.prototype.muln = function(e4) { + return this.clone().imuln(e4); + }, i2.prototype.sqr = function() { + return this.mul(this); + }, i2.prototype.isqr = function() { + return this.imul(this.clone()); + }, i2.prototype.pow = function(e4) { + var t3 = function(e5) { + for (var t4 = new Array(e5.bitLength()), n4 = 0; n4 < t4.length; n4++) { + var r4 = n4 / 26 | 0, i3 = n4 % 26; + t4[n4] = e5.words[r4] >>> i3 & 1; + } + return t4; + }(e4); + if (0 === t3.length) + return new i2(1); + for (var n3 = this, r3 = 0; r3 < t3.length && 0 === t3[r3]; r3++, n3 = n3.sqr()) + ; + if (++r3 < t3.length) + for (var o3 = n3.sqr(); r3 < t3.length; r3++, o3 = o3.sqr()) + 0 !== t3[r3] && (n3 = n3.mul(o3)); + return n3; + }, i2.prototype.iushln = function(e4) { + n2("number" == typeof e4 && e4 >= 0); + var t3, r3 = e4 % 26, i3 = (e4 - r3) / 26, o3 = 67108863 >>> 26 - r3 << 26 - r3; + if (0 !== r3) { + var a3 = 0; + for (t3 = 0; t3 < this.length; t3++) { + var s3 = this.words[t3] & o3, u3 = (0 | this.words[t3]) - s3 << r3; + this.words[t3] = u3 | a3, a3 = s3 >>> 26 - r3; + } + a3 && (this.words[t3] = a3, this.length++); + } + if (0 !== i3) { + for (t3 = this.length - 1; t3 >= 0; t3--) + this.words[t3 + i3] = this.words[t3]; + for (t3 = 0; t3 < i3; t3++) + this.words[t3] = 0; + this.length += i3; + } + return this._strip(); + }, i2.prototype.ishln = function(e4) { + return n2(0 === this.negative), this.iushln(e4); + }, i2.prototype.iushrn = function(e4, t3, r3) { + var i3; + n2("number" == typeof e4 && e4 >= 0), i3 = t3 ? (t3 - t3 % 26) / 26 : 0; + var o3 = e4 % 26, a3 = Math.min((e4 - o3) / 26, this.length), s3 = 67108863 ^ 67108863 >>> o3 << o3, u3 = r3; + if (i3 -= a3, i3 = Math.max(0, i3), u3) { + for (var l3 = 0; l3 < a3; l3++) + u3.words[l3] = this.words[l3]; + u3.length = a3; + } + if (0 === a3) + ; + else if (this.length > a3) + for (this.length -= a3, l3 = 0; l3 < this.length; l3++) + this.words[l3] = this.words[l3 + a3]; + else + this.words[0] = 0, this.length = 1; + var c3 = 0; + for (l3 = this.length - 1; l3 >= 0 && (0 !== c3 || l3 >= i3); l3--) { + var d3 = 0 | this.words[l3]; + this.words[l3] = c3 << 26 - o3 | d3 >>> o3, c3 = d3 & s3; + } + return u3 && 0 !== c3 && (u3.words[u3.length++] = c3), 0 === this.length && (this.words[0] = 0, this.length = 1), this._strip(); + }, i2.prototype.ishrn = function(e4, t3, r3) { + return n2(0 === this.negative), this.iushrn(e4, t3, r3); + }, i2.prototype.shln = function(e4) { + return this.clone().ishln(e4); + }, i2.prototype.ushln = function(e4) { + return this.clone().iushln(e4); + }, i2.prototype.shrn = function(e4) { + return this.clone().ishrn(e4); + }, i2.prototype.ushrn = function(e4) { + return this.clone().iushrn(e4); + }, i2.prototype.testn = function(e4) { + n2("number" == typeof e4 && e4 >= 0); + var t3 = e4 % 26, r3 = (e4 - t3) / 26, i3 = 1 << t3; + return !(this.length <= r3) && !!(this.words[r3] & i3); + }, i2.prototype.imaskn = function(e4) { + n2("number" == typeof e4 && e4 >= 0); + var t3 = e4 % 26, r3 = (e4 - t3) / 26; + if (n2(0 === this.negative, "imaskn works only with positive numbers"), this.length <= r3) + return this; + if (0 !== t3 && r3++, this.length = Math.min(r3, this.length), 0 !== t3) { + var i3 = 67108863 ^ 67108863 >>> t3 << t3; + this.words[this.length - 1] &= i3; + } + return this._strip(); + }, i2.prototype.maskn = function(e4) { + return this.clone().imaskn(e4); + }, i2.prototype.iaddn = function(e4) { + return n2("number" == typeof e4), n2(e4 < 67108864), e4 < 0 ? this.isubn(-e4) : 0 !== this.negative ? 1 === this.length && (0 | this.words[0]) <= e4 ? (this.words[0] = e4 - (0 | this.words[0]), this.negative = 0, this) : (this.negative = 0, this.isubn(e4), this.negative = 1, this) : this._iaddn(e4); + }, i2.prototype._iaddn = function(e4) { + this.words[0] += e4; + for (var t3 = 0; t3 < this.length && this.words[t3] >= 67108864; t3++) + this.words[t3] -= 67108864, t3 === this.length - 1 ? this.words[t3 + 1] = 1 : this.words[t3 + 1]++; + return this.length = Math.max(this.length, t3 + 1), this; + }, i2.prototype.isubn = function(e4) { + if (n2("number" == typeof e4), n2(e4 < 67108864), e4 < 0) + return this.iaddn(-e4); + if (0 !== this.negative) + return this.negative = 0, this.iaddn(e4), this.negative = 1, this; + if (this.words[0] -= e4, 1 === this.length && this.words[0] < 0) + this.words[0] = -this.words[0], this.negative = 1; + else + for (var t3 = 0; t3 < this.length && this.words[t3] < 0; t3++) + this.words[t3] += 67108864, this.words[t3 + 1] -= 1; + return this._strip(); + }, i2.prototype.addn = function(e4) { + return this.clone().iaddn(e4); + }, i2.prototype.subn = function(e4) { + return this.clone().isubn(e4); + }, i2.prototype.iabs = function() { + return this.negative = 0, this; + }, i2.prototype.abs = function() { + return this.clone().iabs(); + }, i2.prototype._ishlnsubmul = function(e4, t3, r3) { + var i3, o3, a3 = e4.length + r3; + this._expand(a3); + var s3 = 0; + for (i3 = 0; i3 < e4.length; i3++) { + o3 = (0 | this.words[i3 + r3]) + s3; + var u3 = (0 | e4.words[i3]) * t3; + s3 = ((o3 -= 67108863 & u3) >> 26) - (u3 / 67108864 | 0), this.words[i3 + r3] = 67108863 & o3; + } + for (; i3 < this.length - r3; i3++) + s3 = (o3 = (0 | this.words[i3 + r3]) + s3) >> 26, this.words[i3 + r3] = 67108863 & o3; + if (0 === s3) + return this._strip(); + for (n2(-1 === s3), s3 = 0, i3 = 0; i3 < this.length; i3++) + s3 = (o3 = -(0 | this.words[i3]) + s3) >> 26, this.words[i3] = 67108863 & o3; + return this.negative = 1, this._strip(); + }, i2.prototype._wordDiv = function(e4, t3) { + var n3 = (this.length, e4.length), r3 = this.clone(), o3 = e4, a3 = 0 | o3.words[o3.length - 1]; + 0 !== (n3 = 26 - this._countBits(a3)) && (o3 = o3.ushln(n3), r3.iushln(n3), a3 = 0 | o3.words[o3.length - 1]); + var s3, u3 = r3.length - o3.length; + if ("mod" !== t3) { + (s3 = new i2(null)).length = u3 + 1, s3.words = new Array(s3.length); + for (var l3 = 0; l3 < s3.length; l3++) + s3.words[l3] = 0; + } + var c3 = r3.clone()._ishlnsubmul(o3, 1, u3); + 0 === c3.negative && (r3 = c3, s3 && (s3.words[u3] = 1)); + for (var d3 = u3 - 1; d3 >= 0; d3--) { + var f3 = 67108864 * (0 | r3.words[o3.length + d3]) + (0 | r3.words[o3.length + d3 - 1]); + for (f3 = Math.min(f3 / a3 | 0, 67108863), r3._ishlnsubmul(o3, f3, d3); 0 !== r3.negative; ) + f3--, r3.negative = 0, r3._ishlnsubmul(o3, 1, d3), r3.isZero() || (r3.negative ^= 1); + s3 && (s3.words[d3] = f3); + } + return s3 && s3._strip(), r3._strip(), "div" !== t3 && 0 !== n3 && r3.iushrn(n3), { div: s3 || null, mod: r3 }; + }, i2.prototype.divmod = function(e4, t3, r3) { + return n2(!e4.isZero()), this.isZero() ? { div: new i2(0), mod: new i2(0) } : 0 !== this.negative && 0 === e4.negative ? (s3 = this.neg().divmod(e4, t3), "mod" !== t3 && (o3 = s3.div.neg()), "div" !== t3 && (a3 = s3.mod.neg(), r3 && 0 !== a3.negative && a3.iadd(e4)), { div: o3, mod: a3 }) : 0 === this.negative && 0 !== e4.negative ? (s3 = this.divmod(e4.neg(), t3), "mod" !== t3 && (o3 = s3.div.neg()), { div: o3, mod: s3.mod }) : 0 != (this.negative & e4.negative) ? (s3 = this.neg().divmod(e4.neg(), t3), "div" !== t3 && (a3 = s3.mod.neg(), r3 && 0 !== a3.negative && a3.isub(e4)), { div: s3.div, mod: a3 }) : e4.length > this.length || this.cmp(e4) < 0 ? { div: new i2(0), mod: this } : 1 === e4.length ? "div" === t3 ? { div: this.divn(e4.words[0]), mod: null } : "mod" === t3 ? { div: null, mod: new i2(this.modrn(e4.words[0])) } : { div: this.divn(e4.words[0]), mod: new i2(this.modrn(e4.words[0])) } : this._wordDiv(e4, t3); + var o3, a3, s3; + }, i2.prototype.div = function(e4) { + return this.divmod(e4, "div", false).div; + }, i2.prototype.mod = function(e4) { + return this.divmod(e4, "mod", false).mod; + }, i2.prototype.umod = function(e4) { + return this.divmod(e4, "mod", true).mod; + }, i2.prototype.divRound = function(e4) { + var t3 = this.divmod(e4); + if (t3.mod.isZero()) + return t3.div; + var n3 = 0 !== t3.div.negative ? t3.mod.isub(e4) : t3.mod, r3 = e4.ushrn(1), i3 = e4.andln(1), o3 = n3.cmp(r3); + return o3 < 0 || 1 === i3 && 0 === o3 ? t3.div : 0 !== t3.div.negative ? t3.div.isubn(1) : t3.div.iaddn(1); + }, i2.prototype.modrn = function(e4) { + var t3 = e4 < 0; + t3 && (e4 = -e4), n2(e4 <= 67108863); + for (var r3 = (1 << 26) % e4, i3 = 0, o3 = this.length - 1; o3 >= 0; o3--) + i3 = (r3 * i3 + (0 | this.words[o3])) % e4; + return t3 ? -i3 : i3; + }, i2.prototype.modn = function(e4) { + return this.modrn(e4); + }, i2.prototype.idivn = function(e4) { + var t3 = e4 < 0; + t3 && (e4 = -e4), n2(e4 <= 67108863); + for (var r3 = 0, i3 = this.length - 1; i3 >= 0; i3--) { + var o3 = (0 | this.words[i3]) + 67108864 * r3; + this.words[i3] = o3 / e4 | 0, r3 = o3 % e4; + } + return this._strip(), t3 ? this.ineg() : this; + }, i2.prototype.divn = function(e4) { + return this.clone().idivn(e4); + }, i2.prototype.egcd = function(e4) { + n2(0 === e4.negative), n2(!e4.isZero()); + var t3 = this, r3 = e4.clone(); + t3 = 0 !== t3.negative ? t3.umod(e4) : t3.clone(); + for (var o3 = new i2(1), a3 = new i2(0), s3 = new i2(0), u3 = new i2(1), l3 = 0; t3.isEven() && r3.isEven(); ) + t3.iushrn(1), r3.iushrn(1), ++l3; + for (var c3 = r3.clone(), d3 = t3.clone(); !t3.isZero(); ) { + for (var f3 = 0, h3 = 1; 0 == (t3.words[0] & h3) && f3 < 26; ++f3, h3 <<= 1) + ; + if (f3 > 0) + for (t3.iushrn(f3); f3-- > 0; ) + (o3.isOdd() || a3.isOdd()) && (o3.iadd(c3), a3.isub(d3)), o3.iushrn(1), a3.iushrn(1); + for (var p3 = 0, m3 = 1; 0 == (r3.words[0] & m3) && p3 < 26; ++p3, m3 <<= 1) + ; + if (p3 > 0) + for (r3.iushrn(p3); p3-- > 0; ) + (s3.isOdd() || u3.isOdd()) && (s3.iadd(c3), u3.isub(d3)), s3.iushrn(1), u3.iushrn(1); + t3.cmp(r3) >= 0 ? (t3.isub(r3), o3.isub(s3), a3.isub(u3)) : (r3.isub(t3), s3.isub(o3), u3.isub(a3)); + } + return { a: s3, b: u3, gcd: r3.iushln(l3) }; + }, i2.prototype._invmp = function(e4) { + n2(0 === e4.negative), n2(!e4.isZero()); + var t3 = this, r3 = e4.clone(); + t3 = 0 !== t3.negative ? t3.umod(e4) : t3.clone(); + for (var o3, a3 = new i2(1), s3 = new i2(0), u3 = r3.clone(); t3.cmpn(1) > 0 && r3.cmpn(1) > 0; ) { + for (var l3 = 0, c3 = 1; 0 == (t3.words[0] & c3) && l3 < 26; ++l3, c3 <<= 1) + ; + if (l3 > 0) + for (t3.iushrn(l3); l3-- > 0; ) + a3.isOdd() && a3.iadd(u3), a3.iushrn(1); + for (var d3 = 0, f3 = 1; 0 == (r3.words[0] & f3) && d3 < 26; ++d3, f3 <<= 1) + ; + if (d3 > 0) + for (r3.iushrn(d3); d3-- > 0; ) + s3.isOdd() && s3.iadd(u3), s3.iushrn(1); + t3.cmp(r3) >= 0 ? (t3.isub(r3), a3.isub(s3)) : (r3.isub(t3), s3.isub(a3)); + } + return (o3 = 0 === t3.cmpn(1) ? a3 : s3).cmpn(0) < 0 && o3.iadd(e4), o3; + }, i2.prototype.gcd = function(e4) { + if (this.isZero()) + return e4.abs(); + if (e4.isZero()) + return this.abs(); + var t3 = this.clone(), n3 = e4.clone(); + t3.negative = 0, n3.negative = 0; + for (var r3 = 0; t3.isEven() && n3.isEven(); r3++) + t3.iushrn(1), n3.iushrn(1); + for (; ; ) { + for (; t3.isEven(); ) + t3.iushrn(1); + for (; n3.isEven(); ) + n3.iushrn(1); + var i3 = t3.cmp(n3); + if (i3 < 0) { + var o3 = t3; + t3 = n3, n3 = o3; + } else if (0 === i3 || 0 === n3.cmpn(1)) + break; + t3.isub(n3); + } + return n3.iushln(r3); + }, i2.prototype.invm = function(e4) { + return this.egcd(e4).a.umod(e4); + }, i2.prototype.isEven = function() { + return 0 == (1 & this.words[0]); + }, i2.prototype.isOdd = function() { + return 1 == (1 & this.words[0]); + }, i2.prototype.andln = function(e4) { + return this.words[0] & e4; + }, i2.prototype.bincn = function(e4) { + n2("number" == typeof e4); + var t3 = e4 % 26, r3 = (e4 - t3) / 26, i3 = 1 << t3; + if (this.length <= r3) + return this._expand(r3 + 1), this.words[r3] |= i3, this; + for (var o3 = i3, a3 = r3; 0 !== o3 && a3 < this.length; a3++) { + var s3 = 0 | this.words[a3]; + o3 = (s3 += o3) >>> 26, s3 &= 67108863, this.words[a3] = s3; + } + return 0 !== o3 && (this.words[a3] = o3, this.length++), this; + }, i2.prototype.isZero = function() { + return 1 === this.length && 0 === this.words[0]; + }, i2.prototype.cmpn = function(e4) { + var t3, r3 = e4 < 0; + if (0 !== this.negative && !r3) + return -1; + if (0 === this.negative && r3) + return 1; + if (this._strip(), this.length > 1) + t3 = 1; + else { + r3 && (e4 = -e4), n2(e4 <= 67108863, "Number is too big"); + var i3 = 0 | this.words[0]; + t3 = i3 === e4 ? 0 : i3 < e4 ? -1 : 1; + } + return 0 !== this.negative ? 0 | -t3 : t3; + }, i2.prototype.cmp = function(e4) { + if (0 !== this.negative && 0 === e4.negative) + return -1; + if (0 === this.negative && 0 !== e4.negative) + return 1; + var t3 = this.ucmp(e4); + return 0 !== this.negative ? 0 | -t3 : t3; + }, i2.prototype.ucmp = function(e4) { + if (this.length > e4.length) + return 1; + if (this.length < e4.length) + return -1; + for (var t3 = 0, n3 = this.length - 1; n3 >= 0; n3--) { + var r3 = 0 | this.words[n3], i3 = 0 | e4.words[n3]; + if (r3 !== i3) { + r3 < i3 ? t3 = -1 : r3 > i3 && (t3 = 1); + break; + } + } + return t3; + }, i2.prototype.gtn = function(e4) { + return 1 === this.cmpn(e4); + }, i2.prototype.gt = function(e4) { + return 1 === this.cmp(e4); + }, i2.prototype.gten = function(e4) { + return this.cmpn(e4) >= 0; + }, i2.prototype.gte = function(e4) { + return this.cmp(e4) >= 0; + }, i2.prototype.ltn = function(e4) { + return -1 === this.cmpn(e4); + }, i2.prototype.lt = function(e4) { + return -1 === this.cmp(e4); + }, i2.prototype.lten = function(e4) { + return this.cmpn(e4) <= 0; + }, i2.prototype.lte = function(e4) { + return this.cmp(e4) <= 0; + }, i2.prototype.eqn = function(e4) { + return 0 === this.cmpn(e4); + }, i2.prototype.eq = function(e4) { + return 0 === this.cmp(e4); + }, i2.red = function(e4) { + return new k2(e4); + }, i2.prototype.toRed = function(e4) { + return n2(!this.red, "Already a number in reduction context"), n2(0 === this.negative, "red works only with positives"), e4.convertTo(this)._forceRed(e4); + }, i2.prototype.fromRed = function() { + return n2(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this); + }, i2.prototype._forceRed = function(e4) { + return this.red = e4, this; + }, i2.prototype.forceRed = function(e4) { + return n2(!this.red, "Already a number in reduction context"), this._forceRed(e4); + }, i2.prototype.redAdd = function(e4) { + return n2(this.red, "redAdd works only with red numbers"), this.red.add(this, e4); + }, i2.prototype.redIAdd = function(e4) { + return n2(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, e4); + }, i2.prototype.redSub = function(e4) { + return n2(this.red, "redSub works only with red numbers"), this.red.sub(this, e4); + }, i2.prototype.redISub = function(e4) { + return n2(this.red, "redISub works only with red numbers"), this.red.isub(this, e4); + }, i2.prototype.redShl = function(e4) { + return n2(this.red, "redShl works only with red numbers"), this.red.shl(this, e4); + }, i2.prototype.redMul = function(e4) { + return n2(this.red, "redMul works only with red numbers"), this.red._verify2(this, e4), this.red.mul(this, e4); + }, i2.prototype.redIMul = function(e4) { + return n2(this.red, "redMul works only with red numbers"), this.red._verify2(this, e4), this.red.imul(this, e4); + }, i2.prototype.redSqr = function() { + return n2(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this); + }, i2.prototype.redISqr = function() { + return n2(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this); + }, i2.prototype.redSqrt = function() { + return n2(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this); + }, i2.prototype.redInvm = function() { + return n2(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this); + }, i2.prototype.redNeg = function() { + return n2(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this); + }, i2.prototype.redPow = function(e4) { + return n2(this.red && !e4.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, e4); + }; + var b2 = { k256: null, p224: null, p192: null, p25519: null }; + function y2(e4, t3) { + this.name = e4, this.p = new i2(t3, 16), this.n = this.p.bitLength(), this.k = new i2(1).iushln(this.n).isub(this.p), this.tmp = this._tmp(); + } + function w2() { + y2.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + function _2() { + y2.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + function S2() { + y2.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + function E2() { + y2.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + function k2(e4) { + if ("string" == typeof e4) { + var t3 = i2._prime(e4); + this.m = t3.p, this.prime = t3; + } else + n2(e4.gtn(1), "modulus must be greater than 1"), this.m = e4, this.prime = null; + } + function M2(e4) { + k2.call(this, e4), this.shift = this.m.bitLength(), this.shift % 26 != 0 && (this.shift += 26 - this.shift % 26), this.r = new i2(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); + } + y2.prototype._tmp = function() { + var e4 = new i2(null); + return e4.words = new Array(Math.ceil(this.n / 13)), e4; + }, y2.prototype.ireduce = function(e4) { + var t3, n3 = e4; + do { + this.split(n3, this.tmp), t3 = (n3 = (n3 = this.imulK(n3)).iadd(this.tmp)).bitLength(); + } while (t3 > this.n); + var r3 = t3 < this.n ? -1 : n3.ucmp(this.p); + return 0 === r3 ? (n3.words[0] = 0, n3.length = 1) : r3 > 0 ? n3.isub(this.p) : void 0 !== n3.strip ? n3.strip() : n3._strip(), n3; + }, y2.prototype.split = function(e4, t3) { + e4.iushrn(this.n, 0, t3); + }, y2.prototype.imulK = function(e4) { + return e4.imul(this.k); + }, r2(w2, y2), w2.prototype.split = function(e4, t3) { + for (var n3 = 4194303, r3 = Math.min(e4.length, 9), i3 = 0; i3 < r3; i3++) + t3.words[i3] = e4.words[i3]; + if (t3.length = r3, e4.length <= 9) + return e4.words[0] = 0, void (e4.length = 1); + var o3 = e4.words[9]; + for (t3.words[t3.length++] = o3 & n3, i3 = 10; i3 < e4.length; i3++) { + var a3 = 0 | e4.words[i3]; + e4.words[i3 - 10] = (a3 & n3) << 4 | o3 >>> 22, o3 = a3; + } + o3 >>>= 22, e4.words[i3 - 10] = o3, 0 === o3 && e4.length > 10 ? e4.length -= 10 : e4.length -= 9; + }, w2.prototype.imulK = function(e4) { + e4.words[e4.length] = 0, e4.words[e4.length + 1] = 0, e4.length += 2; + for (var t3 = 0, n3 = 0; n3 < e4.length; n3++) { + var r3 = 0 | e4.words[n3]; + t3 += 977 * r3, e4.words[n3] = 67108863 & t3, t3 = 64 * r3 + (t3 / 67108864 | 0); + } + return 0 === e4.words[e4.length - 1] && (e4.length--, 0 === e4.words[e4.length - 1] && e4.length--), e4; + }, r2(_2, y2), r2(S2, y2), r2(E2, y2), E2.prototype.imulK = function(e4) { + for (var t3 = 0, n3 = 0; n3 < e4.length; n3++) { + var r3 = 19 * (0 | e4.words[n3]) + t3, i3 = 67108863 & r3; + r3 >>>= 26, e4.words[n3] = i3, t3 = r3; + } + return 0 !== t3 && (e4.words[e4.length++] = t3), e4; + }, i2._prime = function(e4) { + if (b2[e4]) + return b2[e4]; + var t3; + if ("k256" === e4) + t3 = new w2(); + else if ("p224" === e4) + t3 = new _2(); + else if ("p192" === e4) + t3 = new S2(); + else { + if ("p25519" !== e4) + throw new Error("Unknown prime " + e4); + t3 = new E2(); + } + return b2[e4] = t3, t3; + }, k2.prototype._verify1 = function(e4) { + n2(0 === e4.negative, "red works only with positives"), n2(e4.red, "red works only with red numbers"); + }, k2.prototype._verify2 = function(e4, t3) { + n2(0 == (e4.negative | t3.negative), "red works only with positives"), n2(e4.red && e4.red === t3.red, "red works only with red numbers"); + }, k2.prototype.imod = function(e4) { + return this.prime ? this.prime.ireduce(e4)._forceRed(this) : (l2(e4, e4.umod(this.m)._forceRed(this)), e4); + }, k2.prototype.neg = function(e4) { + return e4.isZero() ? e4.clone() : this.m.sub(e4)._forceRed(this); + }, k2.prototype.add = function(e4, t3) { + this._verify2(e4, t3); + var n3 = e4.add(t3); + return n3.cmp(this.m) >= 0 && n3.isub(this.m), n3._forceRed(this); + }, k2.prototype.iadd = function(e4, t3) { + this._verify2(e4, t3); + var n3 = e4.iadd(t3); + return n3.cmp(this.m) >= 0 && n3.isub(this.m), n3; + }, k2.prototype.sub = function(e4, t3) { + this._verify2(e4, t3); + var n3 = e4.sub(t3); + return n3.cmpn(0) < 0 && n3.iadd(this.m), n3._forceRed(this); + }, k2.prototype.isub = function(e4, t3) { + this._verify2(e4, t3); + var n3 = e4.isub(t3); + return n3.cmpn(0) < 0 && n3.iadd(this.m), n3; + }, k2.prototype.shl = function(e4, t3) { + return this._verify1(e4), this.imod(e4.ushln(t3)); + }, k2.prototype.imul = function(e4, t3) { + return this._verify2(e4, t3), this.imod(e4.imul(t3)); + }, k2.prototype.mul = function(e4, t3) { + return this._verify2(e4, t3), this.imod(e4.mul(t3)); + }, k2.prototype.isqr = function(e4) { + return this.imul(e4, e4.clone()); + }, k2.prototype.sqr = function(e4) { + return this.mul(e4, e4); + }, k2.prototype.sqrt = function(e4) { + if (e4.isZero()) + return e4.clone(); + var t3 = this.m.andln(3); + if (n2(t3 % 2 == 1), 3 === t3) { + var r3 = this.m.add(new i2(1)).iushrn(2); + return this.pow(e4, r3); + } + for (var o3 = this.m.subn(1), a3 = 0; !o3.isZero() && 0 === o3.andln(1); ) + a3++, o3.iushrn(1); + n2(!o3.isZero()); + var s3 = new i2(1).toRed(this), u3 = s3.redNeg(), l3 = this.m.subn(1).iushrn(1), c3 = this.m.bitLength(); + for (c3 = new i2(2 * c3 * c3).toRed(this); 0 !== this.pow(c3, l3).cmp(u3); ) + c3.redIAdd(u3); + for (var d3 = this.pow(c3, o3), f3 = this.pow(e4, o3.addn(1).iushrn(1)), h3 = this.pow(e4, o3), p3 = a3; 0 !== h3.cmp(s3); ) { + for (var m3 = h3, g3 = 0; 0 !== m3.cmp(s3); g3++) + m3 = m3.redSqr(); + n2(g3 < p3); + var v3 = this.pow(d3, new i2(1).iushln(p3 - g3 - 1)); + f3 = f3.redMul(v3), d3 = v3.redSqr(), h3 = h3.redMul(d3), p3 = g3; + } + return f3; + }, k2.prototype.invm = function(e4) { + var t3 = e4._invmp(this.m); + return 0 !== t3.negative ? (t3.negative = 0, this.imod(t3).redNeg()) : this.imod(t3); + }, k2.prototype.pow = function(e4, t3) { + if (t3.isZero()) + return new i2(1).toRed(this); + if (0 === t3.cmpn(1)) + return e4.clone(); + var n3 = new Array(16); + n3[0] = new i2(1).toRed(this), n3[1] = e4; + for (var r3 = 2; r3 < n3.length; r3++) + n3[r3] = this.mul(n3[r3 - 1], e4); + var o3 = n3[0], a3 = 0, s3 = 0, u3 = t3.bitLength() % 26; + for (0 === u3 && (u3 = 26), r3 = t3.length - 1; r3 >= 0; r3--) { + for (var l3 = t3.words[r3], c3 = u3 - 1; c3 >= 0; c3--) { + var d3 = l3 >> c3 & 1; + o3 !== n3[0] && (o3 = this.sqr(o3)), 0 !== d3 || 0 !== a3 ? (a3 <<= 1, a3 |= d3, (4 === ++s3 || 0 === r3 && 0 === c3) && (o3 = this.mul(o3, n3[a3]), s3 = 0, a3 = 0)) : s3 = 0; + } + u3 = 26; + } + return o3; + }, k2.prototype.convertTo = function(e4) { + var t3 = e4.umod(this.m); + return t3 === e4 ? t3.clone() : t3; + }, k2.prototype.convertFrom = function(e4) { + var t3 = e4.clone(); + return t3.red = null, t3; + }, i2.mont = function(e4) { + return new M2(e4); + }, r2(M2, k2), M2.prototype.convertTo = function(e4) { + return this.imod(e4.ushln(this.shift)); + }, M2.prototype.convertFrom = function(e4) { + var t3 = this.imod(e4.mul(this.rinv)); + return t3.red = null, t3; + }, M2.prototype.imul = function(e4, t3) { + if (e4.isZero() || t3.isZero()) + return e4.words[0] = 0, e4.length = 1, e4; + var n3 = e4.imul(t3), r3 = n3.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), i3 = n3.isub(r3).iushrn(this.shift), o3 = i3; + return i3.cmp(this.m) >= 0 ? o3 = i3.isub(this.m) : i3.cmpn(0) < 0 && (o3 = i3.iadd(this.m)), o3._forceRed(this); + }, M2.prototype.mul = function(e4, t3) { + if (e4.isZero() || t3.isZero()) + return new i2(0)._forceRed(this); + var n3 = e4.mul(t3), r3 = n3.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), o3 = n3.isub(r3).iushrn(this.shift), a3 = o3; + return o3.cmp(this.m) >= 0 ? a3 = o3.isub(this.m) : o3.cmpn(0) < 0 && (a3 = o3.iadd(this.m)), a3._forceRed(this); + }, M2.prototype.invm = function(e4) { + return this.imod(e4._invmp(this.m).mul(this.r2))._forceRed(this); + }; + }(e2, n); + }(kl); + var Ml = kl.exports, Cl = We; + function xl(e2) { + var t2, n2 = e2.modulus.byteLength(); + do { + t2 = new Ml(Cl(n2)); + } while (t2.cmp(e2.modulus) >= 0 || !t2.umod(e2.prime1) || !t2.umod(e2.prime2)); + return t2; + } + function Al(e2, t2) { + var n2 = function(e3) { + var t3 = xl(e3); + return { blinder: t3.toRed(Ml.mont(e3.modulus)).redPow(new Ml(e3.publicExponent)).fromRed(), unblinder: t3.invm(e3.modulus) }; + }(t2), r2 = t2.modulus.byteLength(), i2 = new Ml(e2).mul(n2.blinder).umod(t2.modulus), o2 = i2.toRed(Ml.mont(t2.prime1)), a2 = i2.toRed(Ml.mont(t2.prime2)), s2 = t2.coefficient, u2 = t2.prime1, l2 = t2.prime2, c2 = o2.redPow(t2.exponent1).fromRed(), d2 = a2.redPow(t2.exponent2).fromRed(), f2 = c2.isub(d2).imul(s2).umod(u2).imul(l2); + return d2.iadd(f2).imul(n2.unblinder).umod(t2.modulus).toArrayLike(_, "be", r2); + } + Al.getr = xl; + var Rl = Al, Tl = {}, Pl = { name: "elliptic", version: "6.5.4", description: "EC cryptography", main: "lib/elliptic.js", files: ["lib"], scripts: { lint: "eslint lib test", "lint:fix": "npm run lint -- --fix", unit: "istanbul test _mocha --reporter=spec test/index.js", test: "npm run lint && npm run unit", version: "grunt dist && git add dist/" }, repository: { type: "git", url: "git@github.com:indutny/elliptic" }, keywords: ["EC", "Elliptic", "curve", "Cryptography"], author: "Fedor Indutny ", license: "MIT", bugs: { url: "https://github.com/indutny/elliptic/issues" }, homepage: "https://github.com/indutny/elliptic", devDependencies: { brfs: "^2.0.2", coveralls: "^3.1.0", eslint: "^7.6.0", grunt: "^1.2.1", "grunt-browserify": "^5.3.0", "grunt-cli": "^1.3.2", "grunt-contrib-connect": "^3.0.0", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-uglify": "^5.0.0", "grunt-mocha-istanbul": "^5.0.2", "grunt-saucelabs": "^9.0.1", istanbul: "^0.4.5", mocha: "^8.0.1" }, dependencies: { "bn.js": "^4.11.9", brorand: "^1.1.0", "hash.js": "^1.0.0", "hmac-drbg": "^1.0.1", inherits: "^2.0.4", "minimalistic-assert": "^1.0.1", "minimalistic-crypto-utils": "^1.0.1" } }, Ll = {}, Il = {}; + !function(e2) { + var t2 = e2; + function n2(e3) { + return 1 === e3.length ? "0" + e3 : e3; + } + function r2(e3) { + for (var t3 = "", r3 = 0; r3 < e3.length; r3++) + t3 += n2(e3[r3].toString(16)); + return t3; + } + t2.toArray = function(e3, t3) { + if (Array.isArray(e3)) + return e3.slice(); + if (!e3) + return []; + var n3 = []; + if ("string" != typeof e3) { + for (var r3 = 0; r3 < e3.length; r3++) + n3[r3] = 0 | e3[r3]; + return n3; + } + if ("hex" === t3) { + (e3 = e3.replace(/[^a-z0-9]+/gi, "")).length % 2 != 0 && (e3 = "0" + e3); + for (r3 = 0; r3 < e3.length; r3 += 2) + n3.push(parseInt(e3[r3] + e3[r3 + 1], 16)); + } else + for (r3 = 0; r3 < e3.length; r3++) { + var i2 = e3.charCodeAt(r3), o2 = i2 >> 8, a2 = 255 & i2; + o2 ? n3.push(o2, a2) : n3.push(a2); + } + return n3; + }, t2.zero2 = n2, t2.toHex = r2, t2.encode = function(e3, t3) { + return "hex" === t3 ? r2(e3) : e3; + }; + }(Il), function(e2) { + var t2 = e2, n2 = hl, r2 = Wa, i2 = Il; + t2.assert = r2, t2.toArray = i2.toArray, t2.zero2 = i2.zero2, t2.toHex = i2.toHex, t2.encode = i2.encode, t2.getNAF = function(e3, t3, n3) { + var r3 = new Array(Math.max(e3.bitLength(), n3) + 1); + r3.fill(0); + for (var i3 = 1 << t3 + 1, o2 = e3.clone(), a2 = 0; a2 < r3.length; a2++) { + var s2, u2 = o2.andln(i3 - 1); + o2.isOdd() ? (s2 = u2 > (i3 >> 1) - 1 ? (i3 >> 1) - u2 : u2, o2.isubn(s2)) : s2 = 0, r3[a2] = s2, o2.iushrn(1); + } + return r3; + }, t2.getJSF = function(e3, t3) { + var n3 = [[], []]; + e3 = e3.clone(), t3 = t3.clone(); + for (var r3, i3 = 0, o2 = 0; e3.cmpn(-i3) > 0 || t3.cmpn(-o2) > 0; ) { + var a2, s2, u2 = e3.andln(3) + i3 & 3, l2 = t3.andln(3) + o2 & 3; + 3 === u2 && (u2 = -1), 3 === l2 && (l2 = -1), a2 = 0 == (1 & u2) ? 0 : 3 !== (r3 = e3.andln(7) + i3 & 7) && 5 !== r3 || 2 !== l2 ? u2 : -u2, n3[0].push(a2), s2 = 0 == (1 & l2) ? 0 : 3 !== (r3 = t3.andln(7) + o2 & 7) && 5 !== r3 || 2 !== u2 ? l2 : -l2, n3[1].push(s2), 2 * i3 === a2 + 1 && (i3 = 1 - i3), 2 * o2 === s2 + 1 && (o2 = 1 - o2), e3.iushrn(1), t3.iushrn(1); + } + return n3; + }, t2.cachedProperty = function(e3, t3, n3) { + var r3 = "_" + t3; + e3.prototype[t3] = function() { + return void 0 !== this[r3] ? this[r3] : this[r3] = n3.call(this); + }; + }, t2.parseBytes = function(e3) { + return "string" == typeof e3 ? t2.toArray(e3, "hex") : e3; + }, t2.intFromLE = function(e3) { + return new n2(e3, "hex", "le"); + }; + }(Ll); + var Ol = {}, Nl = hl, Dl = Ll, jl = Dl.getNAF, Bl = Dl.getJSF, zl = Dl.assert; + function Ul(e2, t2) { + this.type = e2, this.p = new Nl(t2.p, 16), this.red = t2.prime ? Nl.red(t2.prime) : Nl.mont(this.p), this.zero = new Nl(0).toRed(this.red), this.one = new Nl(1).toRed(this.red), this.two = new Nl(2).toRed(this.red), this.n = t2.n && new Nl(t2.n, 16), this.g = t2.g && this.pointFromJSON(t2.g, t2.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 n2 = this.n && this.p.div(this.n); + !n2 || n2.cmpn(100) > 0 ? this.redN = null : (this._maxwellTrick = true, this.redN = this.n.toRed(this.red)); + } + var Fl = Ul; + function Kl(e2, t2) { + this.curve = e2, this.type = t2, this.precomputed = null; + } + Ul.prototype.point = function() { + throw new Error("Not implemented"); + }, Ul.prototype.validate = function() { + throw new Error("Not implemented"); + }, Ul.prototype._fixedNafMul = function(e2, t2) { + zl(e2.precomputed); + var n2 = e2._getDoubles(), r2 = jl(t2, 1, this._bitLength), i2 = (1 << n2.step + 1) - (n2.step % 2 == 0 ? 2 : 1); + i2 /= 3; + var o2, a2, s2 = []; + for (o2 = 0; o2 < r2.length; o2 += n2.step) { + a2 = 0; + for (var u2 = o2 + n2.step - 1; u2 >= o2; u2--) + a2 = (a2 << 1) + r2[u2]; + s2.push(a2); + } + for (var l2 = this.jpoint(null, null, null), c2 = this.jpoint(null, null, null), d2 = i2; d2 > 0; d2--) { + for (o2 = 0; o2 < s2.length; o2++) + (a2 = s2[o2]) === d2 ? c2 = c2.mixedAdd(n2.points[o2]) : a2 === -d2 && (c2 = c2.mixedAdd(n2.points[o2].neg())); + l2 = l2.add(c2); + } + return l2.toP(); + }, Ul.prototype._wnafMul = function(e2, t2) { + var n2 = 4, r2 = e2._getNAFPoints(n2); + n2 = r2.wnd; + for (var i2 = r2.points, o2 = jl(t2, n2, this._bitLength), a2 = this.jpoint(null, null, null), s2 = o2.length - 1; s2 >= 0; s2--) { + for (var u2 = 0; s2 >= 0 && 0 === o2[s2]; s2--) + u2++; + if (s2 >= 0 && u2++, a2 = a2.dblp(u2), s2 < 0) + break; + var l2 = o2[s2]; + zl(0 !== l2), a2 = "affine" === e2.type ? l2 > 0 ? a2.mixedAdd(i2[l2 - 1 >> 1]) : a2.mixedAdd(i2[-l2 - 1 >> 1].neg()) : l2 > 0 ? a2.add(i2[l2 - 1 >> 1]) : a2.add(i2[-l2 - 1 >> 1].neg()); + } + return "affine" === e2.type ? a2.toP() : a2; + }, Ul.prototype._wnafMulAdd = function(e2, t2, n2, r2, i2) { + var o2, a2, s2, u2 = this._wnafT1, l2 = this._wnafT2, c2 = this._wnafT3, d2 = 0; + for (o2 = 0; o2 < r2; o2++) { + var f2 = (s2 = t2[o2])._getNAFPoints(e2); + u2[o2] = f2.wnd, l2[o2] = f2.points; + } + for (o2 = r2 - 1; o2 >= 1; o2 -= 2) { + var h2 = o2 - 1, p2 = o2; + if (1 === u2[h2] && 1 === u2[p2]) { + var m2 = [t2[h2], null, null, t2[p2]]; + 0 === t2[h2].y.cmp(t2[p2].y) ? (m2[1] = t2[h2].add(t2[p2]), m2[2] = t2[h2].toJ().mixedAdd(t2[p2].neg())) : 0 === t2[h2].y.cmp(t2[p2].y.redNeg()) ? (m2[1] = t2[h2].toJ().mixedAdd(t2[p2]), m2[2] = t2[h2].add(t2[p2].neg())) : (m2[1] = t2[h2].toJ().mixedAdd(t2[p2]), m2[2] = t2[h2].toJ().mixedAdd(t2[p2].neg())); + var g2 = [-3, -1, -5, -7, 0, 7, 5, 1, 3], v2 = Bl(n2[h2], n2[p2]); + for (d2 = Math.max(v2[0].length, d2), c2[h2] = new Array(d2), c2[p2] = new Array(d2), a2 = 0; a2 < d2; a2++) { + var b2 = 0 | v2[0][a2], y2 = 0 | v2[1][a2]; + c2[h2][a2] = g2[3 * (b2 + 1) + (y2 + 1)], c2[p2][a2] = 0, l2[h2] = m2; + } + } else + c2[h2] = jl(n2[h2], u2[h2], this._bitLength), c2[p2] = jl(n2[p2], u2[p2], this._bitLength), d2 = Math.max(c2[h2].length, d2), d2 = Math.max(c2[p2].length, d2); + } + var w2 = this.jpoint(null, null, null), _2 = this._wnafT4; + for (o2 = d2; o2 >= 0; o2--) { + for (var S2 = 0; o2 >= 0; ) { + var E2 = true; + for (a2 = 0; a2 < r2; a2++) + _2[a2] = 0 | c2[a2][o2], 0 !== _2[a2] && (E2 = false); + if (!E2) + break; + S2++, o2--; + } + if (o2 >= 0 && S2++, w2 = w2.dblp(S2), o2 < 0) + break; + for (a2 = 0; a2 < r2; a2++) { + var k2 = _2[a2]; + 0 !== k2 && (k2 > 0 ? s2 = l2[a2][k2 - 1 >> 1] : k2 < 0 && (s2 = l2[a2][-k2 - 1 >> 1].neg()), w2 = "affine" === s2.type ? w2.mixedAdd(s2) : w2.add(s2)); + } + } + for (o2 = 0; o2 < r2; o2++) + l2[o2] = null; + return i2 ? w2 : w2.toP(); + }, Ul.BasePoint = Kl, Kl.prototype.eq = function() { + throw new Error("Not implemented"); + }, Kl.prototype.validate = function() { + return this.curve.validate(this); + }, Ul.prototype.decodePoint = function(e2, t2) { + e2 = Dl.toArray(e2, t2); + var n2 = this.p.byteLength(); + if ((4 === e2[0] || 6 === e2[0] || 7 === e2[0]) && e2.length - 1 == 2 * n2) + return 6 === e2[0] ? zl(e2[e2.length - 1] % 2 == 0) : 7 === e2[0] && zl(e2[e2.length - 1] % 2 == 1), this.point(e2.slice(1, 1 + n2), e2.slice(1 + n2, 1 + 2 * n2)); + if ((2 === e2[0] || 3 === e2[0]) && e2.length - 1 === n2) + return this.pointFromX(e2.slice(1, 1 + n2), 3 === e2[0]); + throw new Error("Unknown point format"); + }, Kl.prototype.encodeCompressed = function(e2) { + return this.encode(e2, true); + }, Kl.prototype._encode = function(e2) { + var t2 = this.curve.p.byteLength(), n2 = this.getX().toArray("be", t2); + return e2 ? [this.getY().isEven() ? 2 : 3].concat(n2) : [4].concat(n2, this.getY().toArray("be", t2)); + }, Kl.prototype.encode = function(e2, t2) { + return Dl.encode(this._encode(t2), e2); + }, Kl.prototype.precompute = function(e2) { + if (this.precomputed) + return this; + var t2 = { doubles: null, naf: null, beta: null }; + return t2.naf = this._getNAFPoints(8), t2.doubles = this._getDoubles(4, e2), t2.beta = this._getBeta(), this.precomputed = t2, this; + }, Kl.prototype._hasDoubles = function(e2) { + if (!this.precomputed) + return false; + var t2 = this.precomputed.doubles; + return !!t2 && t2.points.length >= Math.ceil((e2.bitLength() + 1) / t2.step); + }, Kl.prototype._getDoubles = function(e2, t2) { + if (this.precomputed && this.precomputed.doubles) + return this.precomputed.doubles; + for (var n2 = [this], r2 = this, i2 = 0; i2 < t2; i2 += e2) { + for (var o2 = 0; o2 < e2; o2++) + r2 = r2.dbl(); + n2.push(r2); + } + return { step: e2, points: n2 }; + }, Kl.prototype._getNAFPoints = function(e2) { + if (this.precomputed && this.precomputed.naf) + return this.precomputed.naf; + for (var t2 = [this], n2 = (1 << e2) - 1, r2 = 1 === n2 ? null : this.dbl(), i2 = 1; i2 < n2; i2++) + t2[i2] = t2[i2 - 1].add(r2); + return { wnd: e2, points: t2 }; + }, Kl.prototype._getBeta = function() { + return null; + }, Kl.prototype.dblp = function(e2) { + for (var t2 = this, n2 = 0; n2 < e2; n2++) + t2 = t2.dbl(); + return t2; + }; + var ql = hl, Hl = Ve, Wl = Fl, $l = Ll.assert; + function Vl(e2) { + Wl.call(this, "short", e2), this.a = new ql(e2.a, 16).toRed(this.red), this.b = new ql(e2.b, 16).toRed(this.red), this.tinv = this.two.redInvm(), this.zeroA = 0 === this.a.fromRed().cmpn(0), this.threeA = 0 === this.a.fromRed().sub(this.p).cmpn(-3), this.endo = this._getEndomorphism(e2), this._endoWnafT1 = new Array(4), this._endoWnafT2 = new Array(4); + } + Hl(Vl, Wl); + var Yl = Vl; + function Gl(e2, t2, n2, r2) { + Wl.BasePoint.call(this, e2, "affine"), null === t2 && null === n2 ? (this.x = null, this.y = null, this.inf = true) : (this.x = new ql(t2, 16), this.y = new ql(n2, 16), r2 && (this.x.forceRed(this.curve.red), this.y.forceRed(this.curve.red)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.inf = false); + } + function Zl(e2, t2, n2, r2) { + Wl.BasePoint.call(this, e2, "jacobian"), null === t2 && null === n2 && null === r2 ? (this.x = this.curve.one, this.y = this.curve.one, this.z = new ql(0)) : (this.x = new ql(t2, 16), this.y = new ql(n2, 16), this.z = new ql(r2, 16)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.zOne = this.z === this.curve.one; + } + Vl.prototype._getEndomorphism = function(e2) { + if (this.zeroA && this.g && this.n && 1 === this.p.modn(3)) { + var t2, n2; + if (e2.beta) + t2 = new ql(e2.beta, 16).toRed(this.red); + else { + var r2 = this._getEndoRoots(this.p); + t2 = (t2 = r2[0].cmp(r2[1]) < 0 ? r2[0] : r2[1]).toRed(this.red); + } + if (e2.lambda) + n2 = new ql(e2.lambda, 16); + else { + var i2 = this._getEndoRoots(this.n); + 0 === this.g.mul(i2[0]).x.cmp(this.g.x.redMul(t2)) ? n2 = i2[0] : (n2 = i2[1], $l(0 === this.g.mul(n2).x.cmp(this.g.x.redMul(t2)))); + } + return { beta: t2, lambda: n2, basis: e2.basis ? e2.basis.map(function(e3) { + return { a: new ql(e3.a, 16), b: new ql(e3.b, 16) }; + }) : this._getEndoBasis(n2) }; + } + }, Vl.prototype._getEndoRoots = function(e2) { + var t2 = e2 === this.p ? this.red : ql.mont(e2), n2 = new ql(2).toRed(t2).redInvm(), r2 = n2.redNeg(), i2 = new ql(3).toRed(t2).redNeg().redSqrt().redMul(n2); + return [r2.redAdd(i2).fromRed(), r2.redSub(i2).fromRed()]; + }, Vl.prototype._getEndoBasis = function(e2) { + for (var t2, n2, r2, i2, o2, a2, s2, u2, l2, c2 = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), d2 = e2, f2 = this.n.clone(), h2 = new ql(1), p2 = new ql(0), m2 = new ql(0), g2 = new ql(1), v2 = 0; 0 !== d2.cmpn(0); ) { + var b2 = f2.div(d2); + u2 = f2.sub(b2.mul(d2)), l2 = m2.sub(b2.mul(h2)); + var y2 = g2.sub(b2.mul(p2)); + if (!r2 && u2.cmp(c2) < 0) + t2 = s2.neg(), n2 = h2, r2 = u2.neg(), i2 = l2; + else if (r2 && 2 == ++v2) + break; + s2 = u2, f2 = d2, d2 = u2, m2 = h2, h2 = l2, g2 = p2, p2 = y2; + } + o2 = u2.neg(), a2 = l2; + var w2 = r2.sqr().add(i2.sqr()); + return o2.sqr().add(a2.sqr()).cmp(w2) >= 0 && (o2 = t2, a2 = n2), r2.negative && (r2 = r2.neg(), i2 = i2.neg()), o2.negative && (o2 = o2.neg(), a2 = a2.neg()), [{ a: r2, b: i2 }, { a: o2, b: a2 }]; + }, Vl.prototype._endoSplit = function(e2) { + var t2 = this.endo.basis, n2 = t2[0], r2 = t2[1], i2 = r2.b.mul(e2).divRound(this.n), o2 = n2.b.neg().mul(e2).divRound(this.n), a2 = i2.mul(n2.a), s2 = o2.mul(r2.a), u2 = i2.mul(n2.b), l2 = o2.mul(r2.b); + return { k1: e2.sub(a2).sub(s2), k2: u2.add(l2).neg() }; + }, Vl.prototype.pointFromX = function(e2, t2) { + (e2 = new ql(e2, 16)).red || (e2 = e2.toRed(this.red)); + var n2 = e2.redSqr().redMul(e2).redIAdd(e2.redMul(this.a)).redIAdd(this.b), r2 = n2.redSqrt(); + if (0 !== r2.redSqr().redSub(n2).cmp(this.zero)) + throw new Error("invalid point"); + var i2 = r2.fromRed().isOdd(); + return (t2 && !i2 || !t2 && i2) && (r2 = r2.redNeg()), this.point(e2, r2); + }, Vl.prototype.validate = function(e2) { + if (e2.inf) + return true; + var t2 = e2.x, n2 = e2.y, r2 = this.a.redMul(t2), i2 = t2.redSqr().redMul(t2).redIAdd(r2).redIAdd(this.b); + return 0 === n2.redSqr().redISub(i2).cmpn(0); + }, Vl.prototype._endoWnafMulAdd = function(e2, t2, n2) { + for (var r2 = this._endoWnafT1, i2 = this._endoWnafT2, o2 = 0; o2 < e2.length; o2++) { + var a2 = this._endoSplit(t2[o2]), s2 = e2[o2], u2 = s2._getBeta(); + a2.k1.negative && (a2.k1.ineg(), s2 = s2.neg(true)), a2.k2.negative && (a2.k2.ineg(), u2 = u2.neg(true)), r2[2 * o2] = s2, r2[2 * o2 + 1] = u2, i2[2 * o2] = a2.k1, i2[2 * o2 + 1] = a2.k2; + } + for (var l2 = this._wnafMulAdd(1, r2, i2, 2 * o2, n2), c2 = 0; c2 < 2 * o2; c2++) + r2[c2] = null, i2[c2] = null; + return l2; + }, Hl(Gl, Wl.BasePoint), Vl.prototype.point = function(e2, t2, n2) { + return new Gl(this, e2, t2, n2); + }, Vl.prototype.pointFromJSON = function(e2, t2) { + return Gl.fromJSON(this, e2, t2); + }, Gl.prototype._getBeta = function() { + if (this.curve.endo) { + var e2 = this.precomputed; + if (e2 && e2.beta) + return e2.beta; + var t2 = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); + if (e2) { + var n2 = this.curve, r2 = function(e3) { + return n2.point(e3.x.redMul(n2.endo.beta), e3.y); + }; + e2.beta = t2, t2.precomputed = { beta: null, naf: e2.naf && { wnd: e2.naf.wnd, points: e2.naf.points.map(r2) }, doubles: e2.doubles && { step: e2.doubles.step, points: e2.doubles.points.map(r2) } }; + } + return t2; + } + }, Gl.prototype.toJSON = function() { + return this.precomputed ? [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) } }] : [this.x, this.y]; + }, Gl.fromJSON = function(e2, t2, n2) { + "string" == typeof t2 && (t2 = JSON.parse(t2)); + var r2 = e2.point(t2[0], t2[1], n2); + if (!t2[2]) + return r2; + function i2(t3) { + return e2.point(t3[0], t3[1], n2); + } + var o2 = t2[2]; + return r2.precomputed = { beta: null, doubles: o2.doubles && { step: o2.doubles.step, points: [r2].concat(o2.doubles.points.map(i2)) }, naf: o2.naf && { wnd: o2.naf.wnd, points: [r2].concat(o2.naf.points.map(i2)) } }, r2; + }, Gl.prototype.inspect = function() { + return this.isInfinity() ? "" : ""; + }, Gl.prototype.isInfinity = function() { + return this.inf; + }, Gl.prototype.add = function(e2) { + if (this.inf) + return e2; + if (e2.inf) + return this; + if (this.eq(e2)) + return this.dbl(); + if (this.neg().eq(e2)) + return this.curve.point(null, null); + if (0 === this.x.cmp(e2.x)) + return this.curve.point(null, null); + var t2 = this.y.redSub(e2.y); + 0 !== t2.cmpn(0) && (t2 = t2.redMul(this.x.redSub(e2.x).redInvm())); + var n2 = t2.redSqr().redISub(this.x).redISub(e2.x), r2 = t2.redMul(this.x.redSub(n2)).redISub(this.y); + return this.curve.point(n2, r2); + }, Gl.prototype.dbl = function() { + if (this.inf) + return this; + var e2 = this.y.redAdd(this.y); + if (0 === e2.cmpn(0)) + return this.curve.point(null, null); + var t2 = this.curve.a, n2 = this.x.redSqr(), r2 = e2.redInvm(), i2 = n2.redAdd(n2).redIAdd(n2).redIAdd(t2).redMul(r2), o2 = i2.redSqr().redISub(this.x.redAdd(this.x)), a2 = i2.redMul(this.x.redSub(o2)).redISub(this.y); + return this.curve.point(o2, a2); + }, Gl.prototype.getX = function() { + return this.x.fromRed(); + }, Gl.prototype.getY = function() { + return this.y.fromRed(); + }, Gl.prototype.mul = function(e2) { + return e2 = new ql(e2, 16), this.isInfinity() ? this : this._hasDoubles(e2) ? this.curve._fixedNafMul(this, e2) : this.curve.endo ? this.curve._endoWnafMulAdd([this], [e2]) : this.curve._wnafMul(this, e2); + }, Gl.prototype.mulAdd = function(e2, t2, n2) { + var r2 = [this, t2], i2 = [e2, n2]; + return this.curve.endo ? this.curve._endoWnafMulAdd(r2, i2) : this.curve._wnafMulAdd(1, r2, i2, 2); + }, Gl.prototype.jmulAdd = function(e2, t2, n2) { + var r2 = [this, t2], i2 = [e2, n2]; + return this.curve.endo ? this.curve._endoWnafMulAdd(r2, i2, true) : this.curve._wnafMulAdd(1, r2, i2, 2, true); + }, Gl.prototype.eq = function(e2) { + return this === e2 || this.inf === e2.inf && (this.inf || 0 === this.x.cmp(e2.x) && 0 === this.y.cmp(e2.y)); + }, Gl.prototype.neg = function(e2) { + if (this.inf) + return this; + var t2 = this.curve.point(this.x, this.y.redNeg()); + if (e2 && this.precomputed) { + var n2 = this.precomputed, r2 = function(e3) { + return e3.neg(); + }; + t2.precomputed = { naf: n2.naf && { wnd: n2.naf.wnd, points: n2.naf.points.map(r2) }, doubles: n2.doubles && { step: n2.doubles.step, points: n2.doubles.points.map(r2) } }; + } + return t2; + }, Gl.prototype.toJ = function() { + return this.inf ? this.curve.jpoint(null, null, null) : this.curve.jpoint(this.x, this.y, this.curve.one); + }, Hl(Zl, Wl.BasePoint), Vl.prototype.jpoint = function(e2, t2, n2) { + return new Zl(this, e2, t2, n2); + }, Zl.prototype.toP = function() { + if (this.isInfinity()) + return this.curve.point(null, null); + var e2 = this.z.redInvm(), t2 = e2.redSqr(), n2 = this.x.redMul(t2), r2 = this.y.redMul(t2).redMul(e2); + return this.curve.point(n2, r2); + }, Zl.prototype.neg = function() { + return this.curve.jpoint(this.x, this.y.redNeg(), this.z); + }, Zl.prototype.add = function(e2) { + if (this.isInfinity()) + return e2; + if (e2.isInfinity()) + return this; + var t2 = e2.z.redSqr(), n2 = this.z.redSqr(), r2 = this.x.redMul(t2), i2 = e2.x.redMul(n2), o2 = this.y.redMul(t2.redMul(e2.z)), a2 = e2.y.redMul(n2.redMul(this.z)), s2 = r2.redSub(i2), u2 = o2.redSub(a2); + if (0 === s2.cmpn(0)) + return 0 !== u2.cmpn(0) ? this.curve.jpoint(null, null, null) : this.dbl(); + var l2 = s2.redSqr(), c2 = l2.redMul(s2), d2 = r2.redMul(l2), f2 = u2.redSqr().redIAdd(c2).redISub(d2).redISub(d2), h2 = u2.redMul(d2.redISub(f2)).redISub(o2.redMul(c2)), p2 = this.z.redMul(e2.z).redMul(s2); + return this.curve.jpoint(f2, h2, p2); + }, Zl.prototype.mixedAdd = function(e2) { + if (this.isInfinity()) + return e2.toJ(); + if (e2.isInfinity()) + return this; + var t2 = this.z.redSqr(), n2 = this.x, r2 = e2.x.redMul(t2), i2 = this.y, o2 = e2.y.redMul(t2).redMul(this.z), a2 = n2.redSub(r2), s2 = i2.redSub(o2); + if (0 === a2.cmpn(0)) + return 0 !== s2.cmpn(0) ? this.curve.jpoint(null, null, null) : this.dbl(); + var u2 = a2.redSqr(), l2 = u2.redMul(a2), c2 = n2.redMul(u2), d2 = s2.redSqr().redIAdd(l2).redISub(c2).redISub(c2), f2 = s2.redMul(c2.redISub(d2)).redISub(i2.redMul(l2)), h2 = this.z.redMul(a2); + return this.curve.jpoint(d2, f2, h2); + }, Zl.prototype.dblp = function(e2) { + if (0 === e2) + return this; + if (this.isInfinity()) + return this; + if (!e2) + return this.dbl(); + var t2; + if (this.curve.zeroA || this.curve.threeA) { + var n2 = this; + for (t2 = 0; t2 < e2; t2++) + n2 = n2.dbl(); + return n2; + } + var r2 = this.curve.a, i2 = this.curve.tinv, o2 = this.x, a2 = this.y, s2 = this.z, u2 = s2.redSqr().redSqr(), l2 = a2.redAdd(a2); + for (t2 = 0; t2 < e2; t2++) { + var c2 = o2.redSqr(), d2 = l2.redSqr(), f2 = d2.redSqr(), h2 = c2.redAdd(c2).redIAdd(c2).redIAdd(r2.redMul(u2)), p2 = o2.redMul(d2), m2 = h2.redSqr().redISub(p2.redAdd(p2)), g2 = p2.redISub(m2), v2 = h2.redMul(g2); + v2 = v2.redIAdd(v2).redISub(f2); + var b2 = l2.redMul(s2); + t2 + 1 < e2 && (u2 = u2.redMul(f2)), o2 = m2, s2 = b2, l2 = v2; + } + return this.curve.jpoint(o2, l2.redMul(i2), s2); + }, Zl.prototype.dbl = function() { + return this.isInfinity() ? this : this.curve.zeroA ? this._zeroDbl() : this.curve.threeA ? this._threeDbl() : this._dbl(); + }, Zl.prototype._zeroDbl = function() { + var e2, t2, n2; + if (this.zOne) { + var r2 = this.x.redSqr(), i2 = this.y.redSqr(), o2 = i2.redSqr(), a2 = this.x.redAdd(i2).redSqr().redISub(r2).redISub(o2); + a2 = a2.redIAdd(a2); + var s2 = r2.redAdd(r2).redIAdd(r2), u2 = s2.redSqr().redISub(a2).redISub(a2), l2 = o2.redIAdd(o2); + l2 = (l2 = l2.redIAdd(l2)).redIAdd(l2), e2 = u2, t2 = s2.redMul(a2.redISub(u2)).redISub(l2), n2 = this.y.redAdd(this.y); + } else { + var c2 = this.x.redSqr(), d2 = this.y.redSqr(), f2 = d2.redSqr(), h2 = this.x.redAdd(d2).redSqr().redISub(c2).redISub(f2); + h2 = h2.redIAdd(h2); + var p2 = c2.redAdd(c2).redIAdd(c2), m2 = p2.redSqr(), g2 = f2.redIAdd(f2); + g2 = (g2 = g2.redIAdd(g2)).redIAdd(g2), e2 = m2.redISub(h2).redISub(h2), t2 = p2.redMul(h2.redISub(e2)).redISub(g2), n2 = (n2 = this.y.redMul(this.z)).redIAdd(n2); + } + return this.curve.jpoint(e2, t2, n2); + }, Zl.prototype._threeDbl = function() { + var e2, t2, n2; + if (this.zOne) { + var r2 = this.x.redSqr(), i2 = this.y.redSqr(), o2 = i2.redSqr(), a2 = this.x.redAdd(i2).redSqr().redISub(r2).redISub(o2); + a2 = a2.redIAdd(a2); + var s2 = r2.redAdd(r2).redIAdd(r2).redIAdd(this.curve.a), u2 = s2.redSqr().redISub(a2).redISub(a2); + e2 = u2; + var l2 = o2.redIAdd(o2); + l2 = (l2 = l2.redIAdd(l2)).redIAdd(l2), t2 = s2.redMul(a2.redISub(u2)).redISub(l2), n2 = this.y.redAdd(this.y); + } else { + var c2 = this.z.redSqr(), d2 = this.y.redSqr(), f2 = this.x.redMul(d2), h2 = this.x.redSub(c2).redMul(this.x.redAdd(c2)); + h2 = h2.redAdd(h2).redIAdd(h2); + var p2 = f2.redIAdd(f2), m2 = (p2 = p2.redIAdd(p2)).redAdd(p2); + e2 = h2.redSqr().redISub(m2), n2 = this.y.redAdd(this.z).redSqr().redISub(d2).redISub(c2); + var g2 = d2.redSqr(); + g2 = (g2 = (g2 = g2.redIAdd(g2)).redIAdd(g2)).redIAdd(g2), t2 = h2.redMul(p2.redISub(e2)).redISub(g2); + } + return this.curve.jpoint(e2, t2, n2); + }, Zl.prototype._dbl = function() { + var e2 = this.curve.a, t2 = this.x, n2 = this.y, r2 = this.z, i2 = r2.redSqr().redSqr(), o2 = t2.redSqr(), a2 = n2.redSqr(), s2 = o2.redAdd(o2).redIAdd(o2).redIAdd(e2.redMul(i2)), u2 = t2.redAdd(t2), l2 = (u2 = u2.redIAdd(u2)).redMul(a2), c2 = s2.redSqr().redISub(l2.redAdd(l2)), d2 = l2.redISub(c2), f2 = a2.redSqr(); + f2 = (f2 = (f2 = f2.redIAdd(f2)).redIAdd(f2)).redIAdd(f2); + var h2 = s2.redMul(d2).redISub(f2), p2 = n2.redAdd(n2).redMul(r2); + return this.curve.jpoint(c2, h2, p2); + }, Zl.prototype.trpl = function() { + if (!this.curve.zeroA) + return this.dbl().add(this); + var e2 = this.x.redSqr(), t2 = this.y.redSqr(), n2 = this.z.redSqr(), r2 = t2.redSqr(), i2 = e2.redAdd(e2).redIAdd(e2), o2 = i2.redSqr(), a2 = this.x.redAdd(t2).redSqr().redISub(e2).redISub(r2), s2 = (a2 = (a2 = (a2 = a2.redIAdd(a2)).redAdd(a2).redIAdd(a2)).redISub(o2)).redSqr(), u2 = r2.redIAdd(r2); + u2 = (u2 = (u2 = u2.redIAdd(u2)).redIAdd(u2)).redIAdd(u2); + var l2 = i2.redIAdd(a2).redSqr().redISub(o2).redISub(s2).redISub(u2), c2 = t2.redMul(l2); + c2 = (c2 = c2.redIAdd(c2)).redIAdd(c2); + var d2 = this.x.redMul(s2).redISub(c2); + d2 = (d2 = d2.redIAdd(d2)).redIAdd(d2); + var f2 = this.y.redMul(l2.redMul(u2.redISub(l2)).redISub(a2.redMul(s2))); + f2 = (f2 = (f2 = f2.redIAdd(f2)).redIAdd(f2)).redIAdd(f2); + var h2 = this.z.redAdd(a2).redSqr().redISub(n2).redISub(s2); + return this.curve.jpoint(d2, f2, h2); + }, Zl.prototype.mul = function(e2, t2) { + return e2 = new ql(e2, t2), this.curve._wnafMul(this, e2); + }, Zl.prototype.eq = function(e2) { + if ("affine" === e2.type) + return this.eq(e2.toJ()); + if (this === e2) + return true; + var t2 = this.z.redSqr(), n2 = e2.z.redSqr(); + if (0 !== this.x.redMul(n2).redISub(e2.x.redMul(t2)).cmpn(0)) + return false; + var r2 = t2.redMul(this.z), i2 = n2.redMul(e2.z); + return 0 === this.y.redMul(i2).redISub(e2.y.redMul(r2)).cmpn(0); + }, Zl.prototype.eqXToP = function(e2) { + var t2 = this.z.redSqr(), n2 = e2.toRed(this.curve.red).redMul(t2); + if (0 === this.x.cmp(n2)) + return true; + for (var r2 = e2.clone(), i2 = this.curve.redN.redMul(t2); ; ) { + if (r2.iadd(this.curve.n), r2.cmp(this.curve.p) >= 0) + return false; + if (n2.redIAdd(i2), 0 === this.x.cmp(n2)) + return true; + } + }, Zl.prototype.inspect = function() { + return this.isInfinity() ? "" : ""; + }, Zl.prototype.isInfinity = function() { + return 0 === this.z.cmpn(0); + }; + var Ql = hl, Jl = Ve, Xl = Fl, ec = Ll; + function tc(e2) { + Xl.call(this, "mont", e2), this.a = new Ql(e2.a, 16).toRed(this.red), this.b = new Ql(e2.b, 16).toRed(this.red), this.i4 = new Ql(4).toRed(this.red).redInvm(), this.two = new Ql(2).toRed(this.red), this.a24 = this.i4.redMul(this.a.redAdd(this.two)); + } + Jl(tc, Xl); + var nc = tc; + function rc(e2, t2, n2) { + Xl.BasePoint.call(this, e2, "projective"), null === t2 && null === n2 ? (this.x = this.curve.one, this.z = this.curve.zero) : (this.x = new Ql(t2, 16), this.z = new Ql(n2, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red))); + } + tc.prototype.validate = function(e2) { + var t2 = e2.normalize().x, n2 = t2.redSqr(), r2 = n2.redMul(t2).redAdd(n2.redMul(this.a)).redAdd(t2); + return 0 === r2.redSqrt().redSqr().cmp(r2); + }, Jl(rc, Xl.BasePoint), tc.prototype.decodePoint = function(e2, t2) { + return this.point(ec.toArray(e2, t2), 1); + }, tc.prototype.point = function(e2, t2) { + return new rc(this, e2, t2); + }, tc.prototype.pointFromJSON = function(e2) { + return rc.fromJSON(this, e2); + }, rc.prototype.precompute = function() { + }, rc.prototype._encode = function() { + return this.getX().toArray("be", this.curve.p.byteLength()); + }, rc.fromJSON = function(e2, t2) { + return new rc(e2, t2[0], t2[1] || e2.one); + }, rc.prototype.inspect = function() { + return this.isInfinity() ? "" : ""; + }, rc.prototype.isInfinity = function() { + return 0 === this.z.cmpn(0); + }, rc.prototype.dbl = function() { + var e2 = this.x.redAdd(this.z).redSqr(), t2 = this.x.redSub(this.z).redSqr(), n2 = e2.redSub(t2), r2 = e2.redMul(t2), i2 = n2.redMul(t2.redAdd(this.curve.a24.redMul(n2))); + return this.curve.point(r2, i2); + }, rc.prototype.add = function() { + throw new Error("Not supported on Montgomery curve"); + }, rc.prototype.diffAdd = function(e2, t2) { + var n2 = this.x.redAdd(this.z), r2 = this.x.redSub(this.z), i2 = e2.x.redAdd(e2.z), o2 = e2.x.redSub(e2.z).redMul(n2), a2 = i2.redMul(r2), s2 = t2.z.redMul(o2.redAdd(a2).redSqr()), u2 = t2.x.redMul(o2.redISub(a2).redSqr()); + return this.curve.point(s2, u2); + }, rc.prototype.mul = function(e2) { + for (var t2 = e2.clone(), n2 = this, r2 = this.curve.point(null, null), i2 = []; 0 !== t2.cmpn(0); t2.iushrn(1)) + i2.push(t2.andln(1)); + for (var o2 = i2.length - 1; o2 >= 0; o2--) + 0 === i2[o2] ? (n2 = n2.diffAdd(r2, this), r2 = r2.dbl()) : (r2 = n2.diffAdd(r2, this), n2 = n2.dbl()); + return r2; + }, rc.prototype.mulAdd = function() { + throw new Error("Not supported on Montgomery curve"); + }, rc.prototype.jumlAdd = function() { + throw new Error("Not supported on Montgomery curve"); + }, rc.prototype.eq = function(e2) { + return 0 === this.getX().cmp(e2.getX()); + }, rc.prototype.normalize = function() { + return this.x = this.x.redMul(this.z.redInvm()), this.z = this.curve.one, this; + }, rc.prototype.getX = function() { + return this.normalize(), this.x.fromRed(); + }; + var ic = hl, oc = Ve, ac = Fl, sc = Ll.assert; + function uc(e2) { + this.twisted = 1 != (0 | e2.a), this.mOneA = this.twisted && -1 == (0 | e2.a), this.extended = this.mOneA, ac.call(this, "edwards", e2), this.a = new ic(e2.a, 16).umod(this.red.m), this.a = this.a.toRed(this.red), this.c = new ic(e2.c, 16).toRed(this.red), this.c2 = this.c.redSqr(), this.d = new ic(e2.d, 16).toRed(this.red), this.dd = this.d.redAdd(this.d), sc(!this.twisted || 0 === this.c.fromRed().cmpn(1)), this.oneC = 1 == (0 | e2.c); + } + oc(uc, ac); + var lc = uc; + function cc(e2, t2, n2, r2, i2) { + ac.BasePoint.call(this, e2, "projective"), null === t2 && null === n2 && null === r2 ? (this.x = this.curve.zero, this.y = this.curve.one, this.z = this.curve.one, this.t = this.curve.zero, this.zOne = true) : (this.x = new ic(t2, 16), this.y = new ic(n2, 16), this.z = r2 ? new ic(r2, 16) : this.curve.one, this.t = i2 && new ic(i2, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.t && !this.t.red && (this.t = this.t.toRed(this.curve.red)), this.zOne = this.z === this.curve.one, this.curve.extended && !this.t && (this.t = this.x.redMul(this.y), this.zOne || (this.t = this.t.redMul(this.z.redInvm())))); + } + uc.prototype._mulA = function(e2) { + return this.mOneA ? e2.redNeg() : this.a.redMul(e2); + }, uc.prototype._mulC = function(e2) { + return this.oneC ? e2 : this.c.redMul(e2); + }, uc.prototype.jpoint = function(e2, t2, n2, r2) { + return this.point(e2, t2, n2, r2); + }, uc.prototype.pointFromX = function(e2, t2) { + (e2 = new ic(e2, 16)).red || (e2 = e2.toRed(this.red)); + var n2 = e2.redSqr(), r2 = this.c2.redSub(this.a.redMul(n2)), i2 = this.one.redSub(this.c2.redMul(this.d).redMul(n2)), o2 = r2.redMul(i2.redInvm()), a2 = o2.redSqrt(); + if (0 !== a2.redSqr().redSub(o2).cmp(this.zero)) + throw new Error("invalid point"); + var s2 = a2.fromRed().isOdd(); + return (t2 && !s2 || !t2 && s2) && (a2 = a2.redNeg()), this.point(e2, a2); + }, uc.prototype.pointFromY = function(e2, t2) { + (e2 = new ic(e2, 16)).red || (e2 = e2.toRed(this.red)); + var n2 = e2.redSqr(), r2 = n2.redSub(this.c2), i2 = n2.redMul(this.d).redMul(this.c2).redSub(this.a), o2 = r2.redMul(i2.redInvm()); + if (0 === o2.cmp(this.zero)) { + if (t2) + throw new Error("invalid point"); + return this.point(this.zero, e2); + } + var a2 = o2.redSqrt(); + if (0 !== a2.redSqr().redSub(o2).cmp(this.zero)) + throw new Error("invalid point"); + return a2.fromRed().isOdd() !== t2 && (a2 = a2.redNeg()), this.point(a2, e2); + }, uc.prototype.validate = function(e2) { + if (e2.isInfinity()) + return true; + e2.normalize(); + var t2 = e2.x.redSqr(), n2 = e2.y.redSqr(), r2 = t2.redMul(this.a).redAdd(n2), i2 = this.c2.redMul(this.one.redAdd(this.d.redMul(t2).redMul(n2))); + return 0 === r2.cmp(i2); + }, oc(cc, ac.BasePoint), uc.prototype.pointFromJSON = function(e2) { + return cc.fromJSON(this, e2); + }, uc.prototype.point = function(e2, t2, n2, r2) { + return new cc(this, e2, t2, n2, r2); + }, cc.fromJSON = function(e2, t2) { + return new cc(e2, t2[0], t2[1], t2[2]); + }, cc.prototype.inspect = function() { + return this.isInfinity() ? "" : ""; + }, cc.prototype.isInfinity = function() { + return 0 === this.x.cmpn(0) && (0 === this.y.cmp(this.z) || this.zOne && 0 === this.y.cmp(this.curve.c)); + }, cc.prototype._extDbl = function() { + var e2 = this.x.redSqr(), t2 = this.y.redSqr(), n2 = this.z.redSqr(); + n2 = n2.redIAdd(n2); + var r2 = this.curve._mulA(e2), i2 = this.x.redAdd(this.y).redSqr().redISub(e2).redISub(t2), o2 = r2.redAdd(t2), a2 = o2.redSub(n2), s2 = r2.redSub(t2), u2 = i2.redMul(a2), l2 = o2.redMul(s2), c2 = i2.redMul(s2), d2 = a2.redMul(o2); + return this.curve.point(u2, l2, d2, c2); + }, cc.prototype._projDbl = function() { + var e2, t2, n2, r2, i2, o2, a2 = this.x.redAdd(this.y).redSqr(), s2 = this.x.redSqr(), u2 = this.y.redSqr(); + if (this.curve.twisted) { + var l2 = (r2 = this.curve._mulA(s2)).redAdd(u2); + this.zOne ? (e2 = a2.redSub(s2).redSub(u2).redMul(l2.redSub(this.curve.two)), t2 = l2.redMul(r2.redSub(u2)), n2 = l2.redSqr().redSub(l2).redSub(l2)) : (i2 = this.z.redSqr(), o2 = l2.redSub(i2).redISub(i2), e2 = a2.redSub(s2).redISub(u2).redMul(o2), t2 = l2.redMul(r2.redSub(u2)), n2 = l2.redMul(o2)); + } else + r2 = s2.redAdd(u2), i2 = this.curve._mulC(this.z).redSqr(), o2 = r2.redSub(i2).redSub(i2), e2 = this.curve._mulC(a2.redISub(r2)).redMul(o2), t2 = this.curve._mulC(r2).redMul(s2.redISub(u2)), n2 = r2.redMul(o2); + return this.curve.point(e2, t2, n2); + }, cc.prototype.dbl = function() { + return this.isInfinity() ? this : this.curve.extended ? this._extDbl() : this._projDbl(); + }, cc.prototype._extAdd = function(e2) { + var t2 = this.y.redSub(this.x).redMul(e2.y.redSub(e2.x)), n2 = this.y.redAdd(this.x).redMul(e2.y.redAdd(e2.x)), r2 = this.t.redMul(this.curve.dd).redMul(e2.t), i2 = this.z.redMul(e2.z.redAdd(e2.z)), o2 = n2.redSub(t2), a2 = i2.redSub(r2), s2 = i2.redAdd(r2), u2 = n2.redAdd(t2), l2 = o2.redMul(a2), c2 = s2.redMul(u2), d2 = o2.redMul(u2), f2 = a2.redMul(s2); + return this.curve.point(l2, c2, f2, d2); + }, cc.prototype._projAdd = function(e2) { + var t2, n2, r2 = this.z.redMul(e2.z), i2 = r2.redSqr(), o2 = this.x.redMul(e2.x), a2 = this.y.redMul(e2.y), s2 = this.curve.d.redMul(o2).redMul(a2), u2 = i2.redSub(s2), l2 = i2.redAdd(s2), c2 = this.x.redAdd(this.y).redMul(e2.x.redAdd(e2.y)).redISub(o2).redISub(a2), d2 = r2.redMul(u2).redMul(c2); + return this.curve.twisted ? (t2 = r2.redMul(l2).redMul(a2.redSub(this.curve._mulA(o2))), n2 = u2.redMul(l2)) : (t2 = r2.redMul(l2).redMul(a2.redSub(o2)), n2 = this.curve._mulC(u2).redMul(l2)), this.curve.point(d2, t2, n2); + }, cc.prototype.add = function(e2) { + return this.isInfinity() ? e2 : e2.isInfinity() ? this : this.curve.extended ? this._extAdd(e2) : this._projAdd(e2); + }, cc.prototype.mul = function(e2) { + return this._hasDoubles(e2) ? this.curve._fixedNafMul(this, e2) : this.curve._wnafMul(this, e2); + }, cc.prototype.mulAdd = function(e2, t2, n2) { + return this.curve._wnafMulAdd(1, [this, t2], [e2, n2], 2, false); + }, cc.prototype.jmulAdd = function(e2, t2, n2) { + return this.curve._wnafMulAdd(1, [this, t2], [e2, n2], 2, true); + }, cc.prototype.normalize = function() { + if (this.zOne) + return this; + var e2 = this.z.redInvm(); + return this.x = this.x.redMul(e2), this.y = this.y.redMul(e2), this.t && (this.t = this.t.redMul(e2)), this.z = this.curve.one, this.zOne = true, this; + }, cc.prototype.neg = function() { + return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg()); + }, cc.prototype.getX = function() { + return this.normalize(), this.x.fromRed(); + }, cc.prototype.getY = function() { + return this.normalize(), this.y.fromRed(); + }, cc.prototype.eq = function(e2) { + return this === e2 || 0 === this.getX().cmp(e2.getX()) && 0 === this.getY().cmp(e2.getY()); + }, cc.prototype.eqXToP = function(e2) { + var t2 = e2.toRed(this.curve.red).redMul(this.z); + if (0 === this.x.cmp(t2)) + return true; + for (var n2 = e2.clone(), r2 = this.curve.redN.redMul(this.z); ; ) { + if (n2.iadd(this.curve.n), n2.cmp(this.curve.p) >= 0) + return false; + if (t2.redIAdd(r2), 0 === this.x.cmp(t2)) + return true; + } + }, cc.prototype.toP = cc.prototype.normalize, cc.prototype.mixedAdd = cc.prototype.add, function(e2) { + var t2 = e2; + t2.base = Fl, t2.short = Yl, t2.mont = nc, t2.edwards = lc; + }(Ol); + var dc = {}, fc = {}, hc = {}, pc = Wa, mc = Ve; + function gc(e2, t2) { + return 55296 == (64512 & e2.charCodeAt(t2)) && (!(t2 < 0 || t2 + 1 >= e2.length) && 56320 == (64512 & e2.charCodeAt(t2 + 1))); + } + function vc(e2) { + return (e2 >>> 24 | e2 >>> 8 & 65280 | e2 << 8 & 16711680 | (255 & e2) << 24) >>> 0; + } + function bc(e2) { + return 1 === e2.length ? "0" + e2 : e2; + } + function yc(e2) { + return 7 === e2.length ? "0" + e2 : 6 === e2.length ? "00" + e2 : 5 === e2.length ? "000" + e2 : 4 === e2.length ? "0000" + e2 : 3 === e2.length ? "00000" + e2 : 2 === e2.length ? "000000" + e2 : 1 === e2.length ? "0000000" + e2 : e2; + } + hc.inherits = mc, hc.toArray = function(e2, t2) { + if (Array.isArray(e2)) + return e2.slice(); + if (!e2) + return []; + var n2 = []; + if ("string" == typeof e2) + if (t2) { + if ("hex" === t2) + for ((e2 = e2.replace(/[^a-z0-9]+/gi, "")).length % 2 != 0 && (e2 = "0" + e2), i2 = 0; i2 < e2.length; i2 += 2) + n2.push(parseInt(e2[i2] + e2[i2 + 1], 16)); + } else + for (var r2 = 0, i2 = 0; i2 < e2.length; i2++) { + var o2 = e2.charCodeAt(i2); + o2 < 128 ? n2[r2++] = o2 : o2 < 2048 ? (n2[r2++] = o2 >> 6 | 192, n2[r2++] = 63 & o2 | 128) : gc(e2, i2) ? (o2 = 65536 + ((1023 & o2) << 10) + (1023 & e2.charCodeAt(++i2)), n2[r2++] = o2 >> 18 | 240, n2[r2++] = o2 >> 12 & 63 | 128, n2[r2++] = o2 >> 6 & 63 | 128, n2[r2++] = 63 & o2 | 128) : (n2[r2++] = o2 >> 12 | 224, n2[r2++] = o2 >> 6 & 63 | 128, n2[r2++] = 63 & o2 | 128); + } + else + for (i2 = 0; i2 < e2.length; i2++) + n2[i2] = 0 | e2[i2]; + return n2; + }, hc.toHex = function(e2) { + for (var t2 = "", n2 = 0; n2 < e2.length; n2++) + t2 += bc(e2[n2].toString(16)); + return t2; + }, hc.htonl = vc, hc.toHex32 = function(e2, t2) { + for (var n2 = "", r2 = 0; r2 < e2.length; r2++) { + var i2 = e2[r2]; + "little" === t2 && (i2 = vc(i2)), n2 += yc(i2.toString(16)); + } + return n2; + }, hc.zero2 = bc, hc.zero8 = yc, hc.join32 = function(e2, t2, n2, r2) { + var i2 = n2 - t2; + pc(i2 % 4 == 0); + for (var o2 = new Array(i2 / 4), a2 = 0, s2 = t2; a2 < o2.length; a2++, s2 += 4) { + var u2; + u2 = "big" === r2 ? e2[s2] << 24 | e2[s2 + 1] << 16 | e2[s2 + 2] << 8 | e2[s2 + 3] : e2[s2 + 3] << 24 | e2[s2 + 2] << 16 | e2[s2 + 1] << 8 | e2[s2], o2[a2] = u2 >>> 0; + } + return o2; + }, hc.split32 = function(e2, t2) { + for (var n2 = new Array(4 * e2.length), r2 = 0, i2 = 0; r2 < e2.length; r2++, i2 += 4) { + var o2 = e2[r2]; + "big" === t2 ? (n2[i2] = o2 >>> 24, n2[i2 + 1] = o2 >>> 16 & 255, n2[i2 + 2] = o2 >>> 8 & 255, n2[i2 + 3] = 255 & o2) : (n2[i2 + 3] = o2 >>> 24, n2[i2 + 2] = o2 >>> 16 & 255, n2[i2 + 1] = o2 >>> 8 & 255, n2[i2] = 255 & o2); + } + return n2; + }, hc.rotr32 = function(e2, t2) { + return e2 >>> t2 | e2 << 32 - t2; + }, hc.rotl32 = function(e2, t2) { + return e2 << t2 | e2 >>> 32 - t2; + }, hc.sum32 = function(e2, t2) { + return e2 + t2 >>> 0; + }, hc.sum32_3 = function(e2, t2, n2) { + return e2 + t2 + n2 >>> 0; + }, hc.sum32_4 = function(e2, t2, n2, r2) { + return e2 + t2 + n2 + r2 >>> 0; + }, hc.sum32_5 = function(e2, t2, n2, r2, i2) { + return e2 + t2 + n2 + r2 + i2 >>> 0; + }, hc.sum64 = function(e2, t2, n2, r2) { + var i2 = e2[t2], o2 = r2 + e2[t2 + 1] >>> 0, a2 = (o2 < r2 ? 1 : 0) + n2 + i2; + e2[t2] = a2 >>> 0, e2[t2 + 1] = o2; + }, hc.sum64_hi = function(e2, t2, n2, r2) { + return (t2 + r2 >>> 0 < t2 ? 1 : 0) + e2 + n2 >>> 0; + }, hc.sum64_lo = function(e2, t2, n2, r2) { + return t2 + r2 >>> 0; + }, hc.sum64_4_hi = function(e2, t2, n2, r2, i2, o2, a2, s2) { + var u2 = 0, l2 = t2; + return u2 += (l2 = l2 + r2 >>> 0) < t2 ? 1 : 0, u2 += (l2 = l2 + o2 >>> 0) < o2 ? 1 : 0, e2 + n2 + i2 + a2 + (u2 += (l2 = l2 + s2 >>> 0) < s2 ? 1 : 0) >>> 0; + }, hc.sum64_4_lo = function(e2, t2, n2, r2, i2, o2, a2, s2) { + return t2 + r2 + o2 + s2 >>> 0; + }, hc.sum64_5_hi = function(e2, t2, n2, r2, i2, o2, a2, s2, u2, l2) { + var c2 = 0, d2 = t2; + return c2 += (d2 = d2 + r2 >>> 0) < t2 ? 1 : 0, c2 += (d2 = d2 + o2 >>> 0) < o2 ? 1 : 0, c2 += (d2 = d2 + s2 >>> 0) < s2 ? 1 : 0, e2 + n2 + i2 + a2 + u2 + (c2 += (d2 = d2 + l2 >>> 0) < l2 ? 1 : 0) >>> 0; + }, hc.sum64_5_lo = function(e2, t2, n2, r2, i2, o2, a2, s2, u2, l2) { + return t2 + r2 + o2 + s2 + l2 >>> 0; + }, hc.rotr64_hi = function(e2, t2, n2) { + return (t2 << 32 - n2 | e2 >>> n2) >>> 0; + }, hc.rotr64_lo = function(e2, t2, n2) { + return (e2 << 32 - n2 | t2 >>> n2) >>> 0; + }, hc.shr64_hi = function(e2, t2, n2) { + return e2 >>> n2; + }, hc.shr64_lo = function(e2, t2, n2) { + return (e2 << 32 - n2 | t2 >>> n2) >>> 0; + }; + var wc = {}, _c = hc, Sc = Wa; + function Ec() { + 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; + } + wc.BlockHash = Ec, Ec.prototype.update = function(e2, t2) { + if (e2 = _c.toArray(e2, t2), this.pending ? this.pending = this.pending.concat(e2) : this.pending = e2, this.pendingTotal += e2.length, this.pending.length >= this._delta8) { + var n2 = (e2 = this.pending).length % this._delta8; + this.pending = e2.slice(e2.length - n2, e2.length), 0 === this.pending.length && (this.pending = null), e2 = _c.join32(e2, 0, e2.length - n2, this.endian); + for (var r2 = 0; r2 < e2.length; r2 += this._delta32) + this._update(e2, r2, r2 + this._delta32); + } + return this; + }, Ec.prototype.digest = function(e2) { + return this.update(this._pad()), Sc(null === this.pending), this._digest(e2); + }, Ec.prototype._pad = function() { + var e2 = this.pendingTotal, t2 = this._delta8, n2 = t2 - (e2 + this.padLength) % t2, r2 = new Array(n2 + this.padLength); + r2[0] = 128; + for (var i2 = 1; i2 < n2; i2++) + r2[i2] = 0; + if (e2 <<= 3, "big" === this.endian) { + for (var o2 = 8; o2 < this.padLength; o2++) + r2[i2++] = 0; + r2[i2++] = 0, r2[i2++] = 0, r2[i2++] = 0, r2[i2++] = 0, r2[i2++] = e2 >>> 24 & 255, r2[i2++] = e2 >>> 16 & 255, r2[i2++] = e2 >>> 8 & 255, r2[i2++] = 255 & e2; + } else + for (r2[i2++] = 255 & e2, r2[i2++] = e2 >>> 8 & 255, r2[i2++] = e2 >>> 16 & 255, r2[i2++] = e2 >>> 24 & 255, r2[i2++] = 0, r2[i2++] = 0, r2[i2++] = 0, r2[i2++] = 0, o2 = 8; o2 < this.padLength; o2++) + r2[i2++] = 0; + return r2; + }; + var kc = {}, Mc = {}, Cc = hc.rotr32; + function xc(e2, t2, n2) { + return e2 & t2 ^ ~e2 & n2; + } + function Ac(e2, t2, n2) { + return e2 & t2 ^ e2 & n2 ^ t2 & n2; + } + function Rc(e2, t2, n2) { + return e2 ^ t2 ^ n2; + } + Mc.ft_1 = function(e2, t2, n2, r2) { + return 0 === e2 ? xc(t2, n2, r2) : 1 === e2 || 3 === e2 ? Rc(t2, n2, r2) : 2 === e2 ? Ac(t2, n2, r2) : void 0; + }, Mc.ch32 = xc, Mc.maj32 = Ac, Mc.p32 = Rc, Mc.s0_256 = function(e2) { + return Cc(e2, 2) ^ Cc(e2, 13) ^ Cc(e2, 22); + }, Mc.s1_256 = function(e2) { + return Cc(e2, 6) ^ Cc(e2, 11) ^ Cc(e2, 25); + }, Mc.g0_256 = function(e2) { + return Cc(e2, 7) ^ Cc(e2, 18) ^ e2 >>> 3; + }, Mc.g1_256 = function(e2) { + return Cc(e2, 17) ^ Cc(e2, 19) ^ e2 >>> 10; + }; + var Tc = hc, Pc = wc, Lc = Mc, Ic = Tc.rotl32, Oc = Tc.sum32, Nc = Tc.sum32_5, Dc = Lc.ft_1, jc = Pc.BlockHash, Bc = [1518500249, 1859775393, 2400959708, 3395469782]; + function zc() { + if (!(this instanceof zc)) + return new zc(); + jc.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.W = new Array(80); + } + Tc.inherits(zc, jc); + var Uc = zc; + zc.blockSize = 512, zc.outSize = 160, zc.hmacStrength = 80, zc.padLength = 64, zc.prototype._update = function(e2, t2) { + for (var n2 = this.W, r2 = 0; r2 < 16; r2++) + n2[r2] = e2[t2 + r2]; + for (; r2 < n2.length; r2++) + n2[r2] = Ic(n2[r2 - 3] ^ n2[r2 - 8] ^ n2[r2 - 14] ^ n2[r2 - 16], 1); + var i2 = this.h[0], o2 = this.h[1], a2 = this.h[2], s2 = this.h[3], u2 = this.h[4]; + for (r2 = 0; r2 < n2.length; r2++) { + var l2 = ~~(r2 / 20), c2 = Nc(Ic(i2, 5), Dc(l2, o2, a2, s2), u2, n2[r2], Bc[l2]); + u2 = s2, s2 = a2, a2 = Ic(o2, 30), o2 = i2, i2 = c2; + } + this.h[0] = Oc(this.h[0], i2), this.h[1] = Oc(this.h[1], o2), this.h[2] = Oc(this.h[2], a2), this.h[3] = Oc(this.h[3], s2), this.h[4] = Oc(this.h[4], u2); + }, zc.prototype._digest = function(e2) { + return "hex" === e2 ? Tc.toHex32(this.h, "big") : Tc.split32(this.h, "big"); + }; + var Fc = hc, Kc = wc, qc = Mc, Hc = Wa, Wc = Fc.sum32, $c = Fc.sum32_4, Vc = Fc.sum32_5, Yc = qc.ch32, Gc = qc.maj32, Zc = qc.s0_256, Qc = qc.s1_256, Jc = qc.g0_256, Xc = qc.g1_256, ed = Kc.BlockHash, td = [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 nd() { + if (!(this instanceof nd)) + return new nd(); + ed.call(this), this.h = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225], this.k = td, this.W = new Array(64); + } + Fc.inherits(nd, ed); + var rd = nd; + nd.blockSize = 512, nd.outSize = 256, nd.hmacStrength = 192, nd.padLength = 64, nd.prototype._update = function(e2, t2) { + for (var n2 = this.W, r2 = 0; r2 < 16; r2++) + n2[r2] = e2[t2 + r2]; + for (; r2 < n2.length; r2++) + n2[r2] = $c(Xc(n2[r2 - 2]), n2[r2 - 7], Jc(n2[r2 - 15]), n2[r2 - 16]); + var i2 = this.h[0], o2 = this.h[1], a2 = this.h[2], s2 = this.h[3], u2 = this.h[4], l2 = this.h[5], c2 = this.h[6], d2 = this.h[7]; + for (Hc(this.k.length === n2.length), r2 = 0; r2 < n2.length; r2++) { + var f2 = Vc(d2, Qc(u2), Yc(u2, l2, c2), this.k[r2], n2[r2]), h2 = Wc(Zc(i2), Gc(i2, o2, a2)); + d2 = c2, c2 = l2, l2 = u2, u2 = Wc(s2, f2), s2 = a2, a2 = o2, o2 = i2, i2 = Wc(f2, h2); + } + this.h[0] = Wc(this.h[0], i2), this.h[1] = Wc(this.h[1], o2), this.h[2] = Wc(this.h[2], a2), this.h[3] = Wc(this.h[3], s2), this.h[4] = Wc(this.h[4], u2), this.h[5] = Wc(this.h[5], l2), this.h[6] = Wc(this.h[6], c2), this.h[7] = Wc(this.h[7], d2); + }, nd.prototype._digest = function(e2) { + return "hex" === e2 ? Fc.toHex32(this.h, "big") : Fc.split32(this.h, "big"); + }; + var id = hc, od = rd; + function ad() { + if (!(this instanceof ad)) + return new ad(); + od.call(this), this.h = [3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]; + } + id.inherits(ad, od); + var sd = ad; + ad.blockSize = 512, ad.outSize = 224, ad.hmacStrength = 192, ad.padLength = 64, ad.prototype._digest = function(e2) { + return "hex" === e2 ? id.toHex32(this.h.slice(0, 7), "big") : id.split32(this.h.slice(0, 7), "big"); + }; + var ud = hc, ld = wc, cd = Wa, dd = ud.rotr64_hi, fd = ud.rotr64_lo, hd = ud.shr64_hi, pd = ud.shr64_lo, md = ud.sum64, gd = ud.sum64_hi, vd = ud.sum64_lo, bd = ud.sum64_4_hi, yd = ud.sum64_4_lo, wd = ud.sum64_5_hi, _d = ud.sum64_5_lo, Sd = ld.BlockHash, Ed = [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 kd() { + if (!(this instanceof kd)) + return new kd(); + Sd.call(this), this.h = [1779033703, 4089235720, 3144134277, 2227873595, 1013904242, 4271175723, 2773480762, 1595750129, 1359893119, 2917565137, 2600822924, 725511199, 528734635, 4215389547, 1541459225, 327033209], this.k = Ed, this.W = new Array(160); + } + ud.inherits(kd, Sd); + var Md = kd; + function Cd(e2, t2, n2, r2, i2) { + var o2 = e2 & n2 ^ ~e2 & i2; + return o2 < 0 && (o2 += 4294967296), o2; + } + function xd(e2, t2, n2, r2, i2, o2) { + var a2 = t2 & r2 ^ ~t2 & o2; + return a2 < 0 && (a2 += 4294967296), a2; + } + function Ad(e2, t2, n2, r2, i2) { + var o2 = e2 & n2 ^ e2 & i2 ^ n2 & i2; + return o2 < 0 && (o2 += 4294967296), o2; + } + function Rd(e2, t2, n2, r2, i2, o2) { + var a2 = t2 & r2 ^ t2 & o2 ^ r2 & o2; + return a2 < 0 && (a2 += 4294967296), a2; + } + function Td(e2, t2) { + var n2 = dd(e2, t2, 28) ^ dd(t2, e2, 2) ^ dd(t2, e2, 7); + return n2 < 0 && (n2 += 4294967296), n2; + } + function Pd(e2, t2) { + var n2 = fd(e2, t2, 28) ^ fd(t2, e2, 2) ^ fd(t2, e2, 7); + return n2 < 0 && (n2 += 4294967296), n2; + } + function Ld(e2, t2) { + var n2 = dd(e2, t2, 14) ^ dd(e2, t2, 18) ^ dd(t2, e2, 9); + return n2 < 0 && (n2 += 4294967296), n2; + } + function Id(e2, t2) { + var n2 = fd(e2, t2, 14) ^ fd(e2, t2, 18) ^ fd(t2, e2, 9); + return n2 < 0 && (n2 += 4294967296), n2; + } + function Od(e2, t2) { + var n2 = dd(e2, t2, 1) ^ dd(e2, t2, 8) ^ hd(e2, t2, 7); + return n2 < 0 && (n2 += 4294967296), n2; + } + function Nd(e2, t2) { + var n2 = fd(e2, t2, 1) ^ fd(e2, t2, 8) ^ pd(e2, t2, 7); + return n2 < 0 && (n2 += 4294967296), n2; + } + function Dd(e2, t2) { + var n2 = dd(e2, t2, 19) ^ dd(t2, e2, 29) ^ hd(e2, t2, 6); + return n2 < 0 && (n2 += 4294967296), n2; + } + function jd(e2, t2) { + var n2 = fd(e2, t2, 19) ^ fd(t2, e2, 29) ^ pd(e2, t2, 6); + return n2 < 0 && (n2 += 4294967296), n2; + } + kd.blockSize = 1024, kd.outSize = 512, kd.hmacStrength = 192, kd.padLength = 128, kd.prototype._prepareBlock = function(e2, t2) { + for (var n2 = this.W, r2 = 0; r2 < 32; r2++) + n2[r2] = e2[t2 + r2]; + for (; r2 < n2.length; r2 += 2) { + var i2 = Dd(n2[r2 - 4], n2[r2 - 3]), o2 = jd(n2[r2 - 4], n2[r2 - 3]), a2 = n2[r2 - 14], s2 = n2[r2 - 13], u2 = Od(n2[r2 - 30], n2[r2 - 29]), l2 = Nd(n2[r2 - 30], n2[r2 - 29]), c2 = n2[r2 - 32], d2 = n2[r2 - 31]; + n2[r2] = bd(i2, o2, a2, s2, u2, l2, c2, d2), n2[r2 + 1] = yd(i2, o2, a2, s2, u2, l2, c2, d2); + } + }, kd.prototype._update = function(e2, t2) { + this._prepareBlock(e2, t2); + var n2 = this.W, r2 = this.h[0], i2 = this.h[1], o2 = this.h[2], a2 = this.h[3], s2 = this.h[4], u2 = this.h[5], l2 = this.h[6], c2 = this.h[7], d2 = this.h[8], f2 = this.h[9], h2 = this.h[10], p2 = this.h[11], m2 = this.h[12], g2 = this.h[13], v2 = this.h[14], b2 = this.h[15]; + cd(this.k.length === n2.length); + for (var y2 = 0; y2 < n2.length; y2 += 2) { + var w2 = v2, _2 = b2, S2 = Ld(d2, f2), E2 = Id(d2, f2), k2 = Cd(d2, f2, h2, p2, m2), M2 = xd(d2, f2, h2, p2, m2, g2), C2 = this.k[y2], x2 = this.k[y2 + 1], A2 = n2[y2], R2 = n2[y2 + 1], T2 = wd(w2, _2, S2, E2, k2, M2, C2, x2, A2, R2), P2 = _d(w2, _2, S2, E2, k2, M2, C2, x2, A2, R2); + w2 = Td(r2, i2), _2 = Pd(r2, i2), S2 = Ad(r2, i2, o2, a2, s2), E2 = Rd(r2, i2, o2, a2, s2, u2); + var L2 = gd(w2, _2, S2, E2), I2 = vd(w2, _2, S2, E2); + v2 = m2, b2 = g2, m2 = h2, g2 = p2, h2 = d2, p2 = f2, d2 = gd(l2, c2, T2, P2), f2 = vd(c2, c2, T2, P2), l2 = s2, c2 = u2, s2 = o2, u2 = a2, o2 = r2, a2 = i2, r2 = gd(T2, P2, L2, I2), i2 = vd(T2, P2, L2, I2); + } + md(this.h, 0, r2, i2), md(this.h, 2, o2, a2), md(this.h, 4, s2, u2), md(this.h, 6, l2, c2), md(this.h, 8, d2, f2), md(this.h, 10, h2, p2), md(this.h, 12, m2, g2), md(this.h, 14, v2, b2); + }, kd.prototype._digest = function(e2) { + return "hex" === e2 ? ud.toHex32(this.h, "big") : ud.split32(this.h, "big"); + }; + var Bd = hc, zd = Md; + function Ud() { + if (!(this instanceof Ud)) + return new Ud(); + zd.call(this), this.h = [3418070365, 3238371032, 1654270250, 914150663, 2438529370, 812702999, 355462360, 4144912697, 1731405415, 4290775857, 2394180231, 1750603025, 3675008525, 1694076839, 1203062813, 3204075428]; + } + Bd.inherits(Ud, zd); + var Fd = Ud; + Ud.blockSize = 1024, Ud.outSize = 384, Ud.hmacStrength = 192, Ud.padLength = 128, Ud.prototype._digest = function(e2) { + return "hex" === e2 ? Bd.toHex32(this.h.slice(0, 12), "big") : Bd.split32(this.h.slice(0, 12), "big"); + }, kc.sha1 = Uc, kc.sha224 = sd, kc.sha256 = rd, kc.sha384 = Fd, kc.sha512 = Md; + var Kd = {}, qd = hc, Hd = wc, Wd = qd.rotl32, $d = qd.sum32, Vd = qd.sum32_3, Yd = qd.sum32_4, Gd = Hd.BlockHash; + function Zd() { + if (!(this instanceof Zd)) + return new Zd(); + Gd.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.endian = "little"; + } + function Qd(e2, t2, n2, r2) { + return e2 <= 15 ? t2 ^ n2 ^ r2 : e2 <= 31 ? t2 & n2 | ~t2 & r2 : e2 <= 47 ? (t2 | ~n2) ^ r2 : e2 <= 63 ? t2 & r2 | n2 & ~r2 : t2 ^ (n2 | ~r2); + } + function Jd(e2) { + return e2 <= 15 ? 0 : e2 <= 31 ? 1518500249 : e2 <= 47 ? 1859775393 : e2 <= 63 ? 2400959708 : 2840853838; + } + function Xd(e2) { + return e2 <= 15 ? 1352829926 : e2 <= 31 ? 1548603684 : e2 <= 47 ? 1836072691 : e2 <= 63 ? 2053994217 : 0; + } + qd.inherits(Zd, Gd), Kd.ripemd160 = Zd, Zd.blockSize = 512, Zd.outSize = 160, Zd.hmacStrength = 192, Zd.padLength = 64, Zd.prototype._update = function(e2, t2) { + for (var n2 = this.h[0], r2 = this.h[1], i2 = this.h[2], o2 = this.h[3], a2 = this.h[4], s2 = n2, u2 = r2, l2 = i2, c2 = o2, d2 = a2, f2 = 0; f2 < 80; f2++) { + var h2 = $d(Wd(Yd(n2, Qd(f2, r2, i2, o2), e2[ef[f2] + t2], Jd(f2)), nf[f2]), a2); + n2 = a2, a2 = o2, o2 = Wd(i2, 10), i2 = r2, r2 = h2, h2 = $d(Wd(Yd(s2, Qd(79 - f2, u2, l2, c2), e2[tf[f2] + t2], Xd(f2)), rf[f2]), d2), s2 = d2, d2 = c2, c2 = Wd(l2, 10), l2 = u2, u2 = h2; + } + h2 = Vd(this.h[1], i2, c2), this.h[1] = Vd(this.h[2], o2, d2), this.h[2] = Vd(this.h[3], a2, s2), this.h[3] = Vd(this.h[4], n2, u2), this.h[4] = Vd(this.h[0], r2, l2), this.h[0] = h2; + }, Zd.prototype._digest = function(e2) { + return "hex" === e2 ? qd.toHex32(this.h, "little") : qd.split32(this.h, "little"); + }; + var ef = [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], tf = [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], nf = [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], rf = [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], of = hc, af = Wa; + function sf(e2, t2, n2) { + if (!(this instanceof sf)) + return new sf(e2, t2, n2); + this.Hash = e2, this.blockSize = e2.blockSize / 8, this.outSize = e2.outSize / 8, this.inner = null, this.outer = null, this._init(of.toArray(t2, n2)); + } + var uf, lf, cf = sf; + sf.prototype._init = function(e2) { + e2.length > this.blockSize && (e2 = new this.Hash().update(e2).digest()), af(e2.length <= this.blockSize); + for (var t2 = e2.length; t2 < this.blockSize; t2++) + e2.push(0); + for (t2 = 0; t2 < e2.length; t2++) + e2[t2] ^= 54; + for (this.inner = new this.Hash().update(e2), t2 = 0; t2 < e2.length; t2++) + e2[t2] ^= 106; + this.outer = new this.Hash().update(e2); + }, sf.prototype.update = function(e2, t2) { + return this.inner.update(e2, t2), this; + }, sf.prototype.digest = function(e2) { + return this.outer.update(this.inner.digest()), this.outer.digest(e2); + }, function(e2) { + var t2 = e2; + t2.utils = hc, t2.common = wc, t2.sha = kc, t2.ripemd = Kd, t2.hmac = cf, t2.sha1 = t2.sha.sha1, t2.sha256 = t2.sha.sha256, t2.sha224 = t2.sha.sha224, t2.sha384 = t2.sha.sha384, t2.sha512 = t2.sha.sha512, t2.ripemd160 = t2.ripemd.ripemd160; + }(fc), function(e2) { + var t2, n2 = e2, r2 = fc, i2 = Ol, o2 = Ll.assert; + function a2(e3) { + "short" === e3.type ? this.curve = new i2.short(e3) : "edwards" === e3.type ? this.curve = new i2.edwards(e3) : this.curve = new i2.mont(e3), this.g = this.curve.g, this.n = this.curve.n, this.hash = e3.hash, o2(this.g.validate(), "Invalid curve"), o2(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O"); + } + function s2(e3, t3) { + Object.defineProperty(n2, e3, { configurable: true, enumerable: true, get: function() { + var r3 = new a2(t3); + return Object.defineProperty(n2, e3, { configurable: true, enumerable: true, value: r3 }), r3; + } }); + } + n2.PresetCurve = a2, s2("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: r2.sha256, gRed: false, g: ["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012", "07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"] }), s2("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: r2.sha256, gRed: false, g: ["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21", "bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"] }), s2("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: r2.sha256, gRed: false, g: ["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296", "4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"] }), s2("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: r2.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"] }), s2("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: r2.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"] }), s2("curve25519", { type: "mont", prime: "p25519", p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", a: "76d06", b: "1", n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", hash: r2.sha256, gRed: false, g: ["9"] }), s2("ed25519", { type: "edwards", prime: "p25519", p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", a: "-1", c: "1", d: "52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3", n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", hash: r2.sha256, gRed: false, g: ["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a", "6666666666666666666666666666666666666666666666666666666666666658"] }); + try { + t2 = lf ? uf : (lf = 1, uf = { doubles: { step: 4, points: [["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a", "f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"], ["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", "11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"], ["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739", "d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"], ["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", "4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"], ["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c", "4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"], ["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda", "96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"], ["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa", "5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"], ["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0", "cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"], ["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d", "9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"], ["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d", "e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"], ["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1", "9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"], ["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0", "5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"], ["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047", "10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"], ["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862", "283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"], ["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7", "7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"], ["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd", "56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"], ["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83", "7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"], ["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a", "53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"], ["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8", "bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"], ["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d", "4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"], ["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725", "7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"], ["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754", "4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"], ["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c", "17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"], ["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6", "6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"], ["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39", "c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"], ["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891", "893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"], ["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b", "febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"], ["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03", "2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"], ["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d", "eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"], ["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070", "7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"], ["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4", "e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"], ["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da", "662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"], ["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11", "1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"], ["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e", "efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"], ["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41", "2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"], ["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef", "67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"], ["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8", "db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"], ["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d", "648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"], ["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96", "35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"], ["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd", "ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"], ["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5", "9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"], ["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266", "40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"], ["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71", "34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"], ["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac", "c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"], ["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751", "1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"], ["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e", "493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"], ["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241", "c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"], ["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3", "be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"], ["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f", "4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"], ["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19", "aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"], ["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be", "b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"], ["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9", "6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"], ["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2", "8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"], ["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13", "7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"], ["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c", "ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"], ["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba", "2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"], ["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151", "e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"], ["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073", "d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"], ["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458", "38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"], ["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b", "69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"], ["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366", "d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"], ["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa", "40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"], ["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0", "620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"], ["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787", "7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"], ["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e", "ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]] }, naf: { wnd: 7, points: [["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9", "388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"], ["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4", "d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"], ["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc", "6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"], ["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe", "cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"], ["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb", "d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"], ["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8", "ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"], ["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e", "581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"], ["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34", "4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"], ["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c", "85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"], ["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5", "321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"], ["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f", "2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"], ["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714", "73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"], ["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729", "a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"], ["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db", "2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"], ["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4", "e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"], ["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5", "b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"], ["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479", "2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"], ["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d", "80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"], ["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f", "1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"], ["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb", "d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"], ["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9", "eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"], ["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963", "758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"], ["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74", "958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"], ["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530", "e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"], ["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b", "5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"], ["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247", "cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"], ["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1", "cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"], ["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120", "4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"], ["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435", "91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"], ["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18", "673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"], ["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8", "59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"], ["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb", "3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"], ["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f", "55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"], ["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143", "efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"], ["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba", "e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"], ["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45", "f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"], ["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a", "744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"], ["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e", "c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"], ["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8", "e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"], ["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c", "30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"], ["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519", "e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"], ["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab", "100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"], ["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca", "ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"], ["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf", "8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"], ["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610", "68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"], ["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4", "f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"], ["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c", "d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"], ["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940", "edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"], ["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980", "a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"], ["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3", "66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"], ["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf", "9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"], ["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63", "4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"], ["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448", "fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"], ["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf", "5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"], ["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5", "8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"], ["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6", "8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"], ["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5", "5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"], ["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99", "f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"], ["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51", "f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"], ["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5", "42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"], ["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5", "204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"], ["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997", "4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"], ["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881", "73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"], ["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5", "39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"], ["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66", "d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"], ["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726", "ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"], ["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede", "6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"], ["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94", "60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"], ["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31", "3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"], ["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51", "b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"], ["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252", "ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"], ["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5", "cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"], ["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b", "6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"], ["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4", "322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"], ["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f", "6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"], ["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889", "2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"], ["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246", "b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"], ["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984", "998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"], ["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a", "b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"], ["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030", "bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"], ["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197", "6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"], ["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593", "c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"], ["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef", "21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"], ["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38", "60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"], ["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a", "49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"], ["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111", "5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"], ["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502", "7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"], ["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea", "be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"], ["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26", "8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"], ["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986", "39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"], ["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e", "62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"], ["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4", "25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"], ["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda", "ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"], ["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859", "cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"], ["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f", "f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"], ["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c", "6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"], ["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942", "fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"], ["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a", "1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"], ["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80", "5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"], ["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d", "438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"], ["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1", "cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"], ["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63", "c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"], ["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352", "6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"], ["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193", "ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"], ["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00", "9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"], ["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58", "ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"], ["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7", "d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"], ["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8", "c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"], ["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e", "67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"], ["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d", "cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"], ["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b", "299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"], ["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f", "f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"], ["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6", "462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"], ["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297", "62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"], ["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a", "7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"], ["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c", "ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"], ["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52", "4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"], ["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb", "bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"], ["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065", "bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"], ["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917", "603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"], ["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9", "cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"], ["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3", "553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"], ["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57", "712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"], ["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66", "ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"], ["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8", "9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"], ["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721", "9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"], ["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180", "4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]] } }); + } catch (e3) { + t2 = void 0; + } + s2("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: r2.sha256, beta: "7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee", lambda: "5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72", basis: [{ a: "3086d221a7d46bcde86c90e49284eb15", b: "-e4437ed6010e88286f547fa90abfe4c3" }, { a: "114ca50f7a8e2f3f657c1108d9d44cfd8", b: "3086d221a7d46bcde86c90e49284eb15" }], gRed: false, g: ["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", t2] }); + }(dc); + var df = fc, ff = Il, hf = Wa; + function pf(e2) { + if (!(this instanceof pf)) + return new pf(e2); + this.hash = e2.hash, this.predResist = !!e2.predResist, this.outLen = this.hash.outSize, this.minEntropy = e2.minEntropy || this.hash.hmacStrength, this._reseed = null, this.reseedInterval = null, this.K = null, this.V = null; + var t2 = ff.toArray(e2.entropy, e2.entropyEnc || "hex"), n2 = ff.toArray(e2.nonce, e2.nonceEnc || "hex"), r2 = ff.toArray(e2.pers, e2.persEnc || "hex"); + hf(t2.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._init(t2, n2, r2); + } + var mf = pf; + pf.prototype._init = function(e2, t2, n2) { + var r2 = e2.concat(t2).concat(n2); + 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(r2), this._reseed = 1, this.reseedInterval = 281474976710656; + }, pf.prototype._hmac = function() { + return new df.hmac(this.hash, this.K); + }, pf.prototype._update = function(e2) { + var t2 = this._hmac().update(this.V).update([0]); + e2 && (t2 = t2.update(e2)), this.K = t2.digest(), this.V = this._hmac().update(this.V).digest(), e2 && (this.K = this._hmac().update(this.V).update([1]).update(e2).digest(), this.V = this._hmac().update(this.V).digest()); + }, pf.prototype.reseed = function(e2, t2, n2, r2) { + "string" != typeof t2 && (r2 = n2, n2 = t2, t2 = null), e2 = ff.toArray(e2, t2), n2 = ff.toArray(n2, r2), hf(e2.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._update(e2.concat(n2 || [])), this._reseed = 1; + }, pf.prototype.generate = function(e2, t2, n2, r2) { + if (this._reseed > this.reseedInterval) + throw new Error("Reseed is required"); + "string" != typeof t2 && (r2 = n2, n2 = t2, t2 = null), n2 && (n2 = ff.toArray(n2, r2 || "hex"), this._update(n2)); + for (var i2 = []; i2.length < e2; ) + this.V = this._hmac().update(this.V).digest(), i2 = i2.concat(this.V); + var o2 = i2.slice(0, e2); + return this._update(n2), this._reseed++, ff.encode(o2, t2); + }; + var gf = hl, vf = Ll.assert; + function bf(e2, t2) { + this.ec = e2, this.priv = null, this.pub = null, t2.priv && this._importPrivate(t2.priv, t2.privEnc), t2.pub && this._importPublic(t2.pub, t2.pubEnc); + } + var yf = bf; + bf.fromPublic = function(e2, t2, n2) { + return t2 instanceof bf ? t2 : new bf(e2, { pub: t2, pubEnc: n2 }); + }, bf.fromPrivate = function(e2, t2, n2) { + return t2 instanceof bf ? t2 : new bf(e2, { priv: t2, privEnc: n2 }); + }, bf.prototype.validate = function() { + var e2 = this.getPublic(); + return e2.isInfinity() ? { result: false, reason: "Invalid public key" } : e2.validate() ? e2.mul(this.ec.curve.n).isInfinity() ? { result: true, reason: null } : { result: false, reason: "Public key * N != O" } : { result: false, reason: "Public key is not a point" }; + }, bf.prototype.getPublic = function(e2, t2) { + return "string" == typeof e2 && (t2 = e2, e2 = null), this.pub || (this.pub = this.ec.g.mul(this.priv)), t2 ? this.pub.encode(t2, e2) : this.pub; + }, bf.prototype.getPrivate = function(e2) { + return "hex" === e2 ? this.priv.toString(16, 2) : this.priv; + }, bf.prototype._importPrivate = function(e2, t2) { + this.priv = new gf(e2, t2 || 16), this.priv = this.priv.umod(this.ec.curve.n); + }, bf.prototype._importPublic = function(e2, t2) { + if (e2.x || e2.y) + return "mont" === this.ec.curve.type ? vf(e2.x, "Need x coordinate") : "short" !== this.ec.curve.type && "edwards" !== this.ec.curve.type || vf(e2.x && e2.y, "Need both x and y coordinate"), void (this.pub = this.ec.curve.point(e2.x, e2.y)); + this.pub = this.ec.curve.decodePoint(e2, t2); + }, bf.prototype.derive = function(e2) { + return e2.validate() || vf(e2.validate(), "public point not validated"), e2.mul(this.priv).getX(); + }, bf.prototype.sign = function(e2, t2, n2) { + return this.ec.sign(e2, this, t2, n2); + }, bf.prototype.verify = function(e2, t2) { + return this.ec.verify(e2, t2, this); + }, bf.prototype.inspect = function() { + return ""; + }; + var wf = hl, _f = Ll, Sf = _f.assert; + function Ef(e2, t2) { + if (e2 instanceof Ef) + return e2; + this._importDER(e2, t2) || (Sf(e2.r && e2.s, "Signature without r or s"), this.r = new wf(e2.r, 16), this.s = new wf(e2.s, 16), void 0 === e2.recoveryParam ? this.recoveryParam = null : this.recoveryParam = e2.recoveryParam); + } + var kf, Mf, Cf = Ef; + function xf() { + this.place = 0; + } + function Af(e2, t2) { + var n2 = e2[t2.place++]; + if (!(128 & n2)) + return n2; + var r2 = 15 & n2; + if (0 === r2 || r2 > 4) + return false; + for (var i2 = 0, o2 = 0, a2 = t2.place; o2 < r2; o2++, a2++) + i2 <<= 8, i2 |= e2[a2], i2 >>>= 0; + return !(i2 <= 127) && (t2.place = a2, i2); + } + function Rf(e2) { + for (var t2 = 0, n2 = e2.length - 1; !e2[t2] && !(128 & e2[t2 + 1]) && t2 < n2; ) + t2++; + return 0 === t2 ? e2 : e2.slice(t2); + } + function Tf(e2, t2) { + if (t2 < 128) + e2.push(t2); + else { + var n2 = 1 + (Math.log(t2) / Math.LN2 >>> 3); + for (e2.push(128 | n2); --n2; ) + e2.push(t2 >>> (n2 << 3) & 255); + e2.push(t2); + } + } + Ef.prototype._importDER = function(e2, t2) { + e2 = _f.toArray(e2, t2); + var n2 = new xf(); + if (48 !== e2[n2.place++]) + return false; + var r2 = Af(e2, n2); + if (false === r2) + return false; + if (r2 + n2.place !== e2.length) + return false; + if (2 !== e2[n2.place++]) + return false; + var i2 = Af(e2, n2); + if (false === i2) + return false; + var o2 = e2.slice(n2.place, i2 + n2.place); + if (n2.place += i2, 2 !== e2[n2.place++]) + return false; + var a2 = Af(e2, n2); + if (false === a2) + return false; + if (e2.length !== a2 + n2.place) + return false; + var s2 = e2.slice(n2.place, a2 + n2.place); + if (0 === o2[0]) { + if (!(128 & o2[1])) + return false; + o2 = o2.slice(1); + } + if (0 === s2[0]) { + if (!(128 & s2[1])) + return false; + s2 = s2.slice(1); + } + return this.r = new wf(o2), this.s = new wf(s2), this.recoveryParam = null, true; + }, Ef.prototype.toDER = function(e2) { + var t2 = this.r.toArray(), n2 = this.s.toArray(); + for (128 & t2[0] && (t2 = [0].concat(t2)), 128 & n2[0] && (n2 = [0].concat(n2)), t2 = Rf(t2), n2 = Rf(n2); !(n2[0] || 128 & n2[1]); ) + n2 = n2.slice(1); + var r2 = [2]; + Tf(r2, t2.length), (r2 = r2.concat(t2)).push(2), Tf(r2, n2.length); + var i2 = r2.concat(n2), o2 = [48]; + return Tf(o2, i2.length), o2 = o2.concat(i2), _f.encode(o2, e2); + }; + var Pf = Ll, Lf = Pf.assert, If = Pf.parseBytes, Of = Pf.cachedProperty; + function Nf(e2, t2) { + this.eddsa = e2, this._secret = If(t2.secret), e2.isPoint(t2.pub) ? this._pub = t2.pub : this._pubBytes = If(t2.pub); + } + Nf.fromPublic = function(e2, t2) { + return t2 instanceof Nf ? t2 : new Nf(e2, { pub: t2 }); + }, Nf.fromSecret = function(e2, t2) { + return t2 instanceof Nf ? t2 : new Nf(e2, { secret: t2 }); + }, Nf.prototype.secret = function() { + return this._secret; + }, Of(Nf, "pubBytes", function() { + return this.eddsa.encodePoint(this.pub()); + }), Of(Nf, "pub", function() { + return this._pubBytes ? this.eddsa.decodePoint(this._pubBytes) : this.eddsa.g.mul(this.priv()); + }), Of(Nf, "privBytes", function() { + var e2 = this.eddsa, t2 = this.hash(), n2 = e2.encodingLength - 1, r2 = t2.slice(0, e2.encodingLength); + return r2[0] &= 248, r2[n2] &= 127, r2[n2] |= 64, r2; + }), Of(Nf, "priv", function() { + return this.eddsa.decodeInt(this.privBytes()); + }), Of(Nf, "hash", function() { + return this.eddsa.hash().update(this.secret()).digest(); + }), Of(Nf, "messagePrefix", function() { + return this.hash().slice(this.eddsa.encodingLength); + }), Nf.prototype.sign = function(e2) { + return Lf(this._secret, "KeyPair can only verify"), this.eddsa.sign(e2, this); + }, Nf.prototype.verify = function(e2, t2) { + return this.eddsa.verify(e2, t2, this); + }, Nf.prototype.getSecret = function(e2) { + return Lf(this._secret, "KeyPair is public only"), Pf.encode(this.secret(), e2); + }, Nf.prototype.getPublic = function(e2) { + return Pf.encode(this.pubBytes(), e2); + }; + var Df = Nf, jf = hl, Bf = Ll, zf = Bf.assert, Uf = Bf.cachedProperty, Ff = Bf.parseBytes; + function Kf(e2, t2) { + this.eddsa = e2, "object" != typeof t2 && (t2 = Ff(t2)), Array.isArray(t2) && (t2 = { R: t2.slice(0, e2.encodingLength), S: t2.slice(e2.encodingLength) }), zf(t2.R && t2.S, "Signature without R or S"), e2.isPoint(t2.R) && (this._R = t2.R), t2.S instanceof jf && (this._S = t2.S), this._Rencoded = Array.isArray(t2.R) ? t2.R : t2.Rencoded, this._Sencoded = Array.isArray(t2.S) ? t2.S : t2.Sencoded; + } + Uf(Kf, "S", function() { + return this.eddsa.decodeInt(this.Sencoded()); + }), Uf(Kf, "R", function() { + return this.eddsa.decodePoint(this.Rencoded()); + }), Uf(Kf, "Rencoded", function() { + return this.eddsa.encodePoint(this.R()); + }), Uf(Kf, "Sencoded", function() { + return this.eddsa.encodeInt(this.S()); + }), Kf.prototype.toBytes = function() { + return this.Rencoded().concat(this.Sencoded()); + }, Kf.prototype.toHex = function() { + return Bf.encode(this.toBytes(), "hex").toUpperCase(); + }; + var qf = Kf, Hf = fc, Wf = dc, $f = Ll, Vf = $f.assert, Yf = $f.parseBytes, Gf = Df, Zf = qf; + function Qf(e2) { + if (Vf("ed25519" === e2, "only tested with ed25519 so far"), !(this instanceof Qf)) + return new Qf(e2); + e2 = Wf[e2].curve, this.curve = e2, this.g = e2.g, this.g.precompute(e2.n.bitLength() + 1), this.pointClass = e2.point().constructor, this.encodingLength = Math.ceil(e2.n.bitLength() / 8), this.hash = Hf.sha512; + } + var Jf, Xf = Qf; + function eh() { + return Jf || (Jf = 1, function(e2) { + var t2 = e2; + t2.version = Pl.version, t2.utils = Ll, t2.rand = ml(), t2.curve = Ol, t2.curves = dc, t2.ec = function() { + if (Mf) + return kf; + Mf = 1; + var e3 = hl, t3 = mf, n2 = Ll, r2 = dc, i2 = ml(), o2 = n2.assert, a2 = yf, s2 = Cf; + function u2(e4) { + if (!(this instanceof u2)) + return new u2(e4); + "string" == typeof e4 && (o2(Object.prototype.hasOwnProperty.call(r2, e4), "Unknown curve " + e4), e4 = r2[e4]), e4 instanceof r2.PresetCurve && (e4 = { curve: e4 }), this.curve = e4.curve.curve, this.n = this.curve.n, this.nh = this.n.ushrn(1), this.g = this.curve.g, this.g = e4.curve.g, this.g.precompute(e4.curve.n.bitLength() + 1), this.hash = e4.hash || e4.curve.hash; + } + return kf = u2, u2.prototype.keyPair = function(e4) { + return new a2(this, e4); + }, u2.prototype.keyFromPrivate = function(e4, t4) { + return a2.fromPrivate(this, e4, t4); + }, u2.prototype.keyFromPublic = function(e4, t4) { + return a2.fromPublic(this, e4, t4); + }, u2.prototype.genKeyPair = function(n3) { + n3 || (n3 = {}); + for (var r3 = new t3({ hash: this.hash, pers: n3.pers, persEnc: n3.persEnc || "utf8", entropy: n3.entropy || i2(this.hash.hmacStrength), entropyEnc: n3.entropy && n3.entropyEnc || "utf8", nonce: this.n.toArray() }), o3 = this.n.byteLength(), a3 = this.n.sub(new e3(2)); ; ) { + var s3 = new e3(r3.generate(o3)); + if (!(s3.cmp(a3) > 0)) + return s3.iaddn(1), this.keyFromPrivate(s3); + } + }, u2.prototype._truncateToN = function(e4, t4) { + var n3 = 8 * e4.byteLength() - this.n.bitLength(); + return n3 > 0 && (e4 = e4.ushrn(n3)), !t4 && e4.cmp(this.n) >= 0 ? e4.sub(this.n) : e4; + }, u2.prototype.sign = function(n3, r3, i3, o3) { + "object" == typeof i3 && (o3 = i3, i3 = null), o3 || (o3 = {}), r3 = this.keyFromPrivate(r3, i3), n3 = this._truncateToN(new e3(n3, 16)); + for (var a3 = this.n.byteLength(), u3 = r3.getPrivate().toArray("be", a3), l2 = n3.toArray("be", a3), c2 = new t3({ hash: this.hash, entropy: u3, nonce: l2, pers: o3.pers, persEnc: o3.persEnc || "utf8" }), d2 = this.n.sub(new e3(1)), f2 = 0; ; f2++) { + var h2 = o3.k ? o3.k(f2) : new e3(c2.generate(this.n.byteLength())); + if (!((h2 = this._truncateToN(h2, true)).cmpn(1) <= 0 || h2.cmp(d2) >= 0)) { + var p2 = this.g.mul(h2); + if (!p2.isInfinity()) { + var m2 = p2.getX(), g2 = m2.umod(this.n); + if (0 !== g2.cmpn(0)) { + var v2 = h2.invm(this.n).mul(g2.mul(r3.getPrivate()).iadd(n3)); + if (0 !== (v2 = v2.umod(this.n)).cmpn(0)) { + var b2 = (p2.getY().isOdd() ? 1 : 0) | (0 !== m2.cmp(g2) ? 2 : 0); + return o3.canonical && v2.cmp(this.nh) > 0 && (v2 = this.n.sub(v2), b2 ^= 1), new s2({ r: g2, s: v2, recoveryParam: b2 }); + } + } + } + } + } + }, u2.prototype.verify = function(t4, n3, r3, i3) { + t4 = this._truncateToN(new e3(t4, 16)), r3 = this.keyFromPublic(r3, i3); + var o3 = (n3 = new s2(n3, "hex")).r, a3 = n3.s; + if (o3.cmpn(1) < 0 || o3.cmp(this.n) >= 0) + return false; + if (a3.cmpn(1) < 0 || a3.cmp(this.n) >= 0) + return false; + var u3, l2 = a3.invm(this.n), c2 = l2.mul(t4).umod(this.n), d2 = l2.mul(o3).umod(this.n); + return this.curve._maxwellTrick ? !(u3 = this.g.jmulAdd(c2, r3.getPublic(), d2)).isInfinity() && u3.eqXToP(o3) : !(u3 = this.g.mulAdd(c2, r3.getPublic(), d2)).isInfinity() && 0 === u3.getX().umod(this.n).cmp(o3); + }, u2.prototype.recoverPubKey = function(t4, n3, r3, i3) { + o2((3 & r3) === r3, "The recovery param is more than two bits"), n3 = new s2(n3, i3); + var a3 = this.n, u3 = new e3(t4), l2 = n3.r, c2 = n3.s, d2 = 1 & r3, f2 = r3 >> 1; + if (l2.cmp(this.curve.p.umod(this.curve.n)) >= 0 && f2) + throw new Error("Unable to find sencond key candinate"); + l2 = f2 ? this.curve.pointFromX(l2.add(this.curve.n), d2) : this.curve.pointFromX(l2, d2); + var h2 = n3.r.invm(a3), p2 = a3.sub(u3).mul(h2).umod(a3), m2 = c2.mul(h2).umod(a3); + return this.g.mulAdd(p2, l2, m2); + }, u2.prototype.getKeyRecoveryParam = function(e4, t4, n3, r3) { + if (null !== (t4 = new s2(t4, r3)).recoveryParam) + return t4.recoveryParam; + for (var i3 = 0; i3 < 4; i3++) { + var o3; + try { + o3 = this.recoverPubKey(e4, t4, i3); + } catch (e5) { + continue; + } + if (o3.eq(n3)) + return i3; + } + throw new Error("Unable to find valid recovery factor"); + }, kf; + }(), t2.eddsa = Xf; + }(Tl)), Tl; + } + Qf.prototype.sign = function(e2, t2) { + e2 = Yf(e2); + var n2 = this.keyFromSecret(t2), r2 = this.hashInt(n2.messagePrefix(), e2), i2 = this.g.mul(r2), o2 = this.encodePoint(i2), a2 = this.hashInt(o2, n2.pubBytes(), e2).mul(n2.priv()), s2 = r2.add(a2).umod(this.curve.n); + return this.makeSignature({ R: i2, S: s2, Rencoded: o2 }); + }, Qf.prototype.verify = function(e2, t2, n2) { + e2 = Yf(e2), t2 = this.makeSignature(t2); + var r2 = this.keyFromPublic(n2), i2 = this.hashInt(t2.Rencoded(), r2.pubBytes(), e2), o2 = this.g.mul(t2.S()); + return t2.R().add(r2.pub().mul(i2)).eq(o2); + }, Qf.prototype.hashInt = function() { + for (var e2 = this.hash(), t2 = 0; t2 < arguments.length; t2++) + e2.update(arguments[t2]); + return $f.intFromLE(e2.digest()).umod(this.curve.n); + }, Qf.prototype.keyFromPublic = function(e2) { + return Gf.fromPublic(this, e2); + }, Qf.prototype.keyFromSecret = function(e2) { + return Gf.fromSecret(this, e2); + }, Qf.prototype.makeSignature = function(e2) { + return e2 instanceof Zf ? e2 : new Zf(this, e2); + }, Qf.prototype.encodePoint = function(e2) { + var t2 = e2.getY().toArray("le", this.encodingLength); + return t2[this.encodingLength - 1] |= e2.getX().isOdd() ? 128 : 0, t2; + }, Qf.prototype.decodePoint = function(e2) { + var t2 = (e2 = $f.parseBytes(e2)).length - 1, n2 = e2.slice(0, t2).concat(-129 & e2[t2]), r2 = 0 != (128 & e2[t2]), i2 = $f.intFromLE(n2); + return this.curve.pointFromY(i2, r2); + }, Qf.prototype.encodeInt = function(e2) { + return e2.toArray("le", this.encodingLength); + }, Qf.prototype.decodeInt = function(e2) { + return $f.intFromLE(e2); + }, Qf.prototype.isPoint = function(e2) { + return e2 instanceof this.pointClass; + }; + var th = { exports: {} }; + !function(e2) { + !function(e3, t2) { + function n2(e4, t3) { + if (!e4) + throw new Error(t3 || "Assertion failed"); + } + function r2(e4, t3) { + e4.super_ = t3; + var n3 = function() { + }; + n3.prototype = t3.prototype, e4.prototype = new n3(), e4.prototype.constructor = e4; + } + function i2(e4, t3, n3) { + if (i2.isBN(e4)) + return e4; + this.negative = 0, this.words = null, this.length = 0, this.red = null, null !== e4 && ("le" !== t3 && "be" !== t3 || (n3 = t3, t3 = 10), this._init(e4 || 0, t3 || 10, n3 || "be")); + } + var o2; + "object" == typeof e3 ? e3.exports = i2 : t2.BN = i2, i2.BN = i2, i2.wordSize = 26; + try { + o2 = "undefined" != typeof window && void 0 !== window.Buffer ? window.Buffer : ce.Buffer; + } catch (e4) { + } + function a2(e4, t3) { + var r3 = e4.charCodeAt(t3); + return r3 >= 48 && r3 <= 57 ? r3 - 48 : r3 >= 65 && r3 <= 70 ? r3 - 55 : r3 >= 97 && r3 <= 102 ? r3 - 87 : void n2(false, "Invalid character in " + e4); + } + function s2(e4, t3, n3) { + var r3 = a2(e4, n3); + return n3 - 1 >= t3 && (r3 |= a2(e4, n3 - 1) << 4), r3; + } + function u2(e4, t3, r3, i3) { + for (var o3 = 0, a3 = 0, s3 = Math.min(e4.length, r3), u3 = t3; u3 < s3; u3++) { + var l3 = e4.charCodeAt(u3) - 48; + o3 *= i3, a3 = l3 >= 49 ? l3 - 49 + 10 : l3 >= 17 ? l3 - 17 + 10 : l3, n2(l3 >= 0 && a3 < i3, "Invalid character"), o3 += a3; + } + return o3; + } + function l2(e4, t3) { + e4.words = t3.words, e4.length = t3.length, e4.negative = t3.negative, e4.red = t3.red; + } + if (i2.isBN = function(e4) { + return e4 instanceof i2 || null !== e4 && "object" == typeof e4 && e4.constructor.wordSize === i2.wordSize && Array.isArray(e4.words); + }, i2.max = function(e4, t3) { + return e4.cmp(t3) > 0 ? e4 : t3; + }, i2.min = function(e4, t3) { + return e4.cmp(t3) < 0 ? e4 : t3; + }, i2.prototype._init = function(e4, t3, r3) { + if ("number" == typeof e4) + return this._initNumber(e4, t3, r3); + if ("object" == typeof e4) + return this._initArray(e4, t3, r3); + "hex" === t3 && (t3 = 16), n2(t3 === (0 | t3) && t3 >= 2 && t3 <= 36); + var i3 = 0; + "-" === (e4 = e4.toString().replace(/\s+/g, ""))[0] && (i3++, this.negative = 1), i3 < e4.length && (16 === t3 ? this._parseHex(e4, i3, r3) : (this._parseBase(e4, t3, i3), "le" === r3 && this._initArray(this.toArray(), t3, r3))); + }, i2.prototype._initNumber = function(e4, t3, r3) { + e4 < 0 && (this.negative = 1, e4 = -e4), e4 < 67108864 ? (this.words = [67108863 & e4], this.length = 1) : e4 < 4503599627370496 ? (this.words = [67108863 & e4, e4 / 67108864 & 67108863], this.length = 2) : (n2(e4 < 9007199254740992), this.words = [67108863 & e4, e4 / 67108864 & 67108863, 1], this.length = 3), "le" === r3 && this._initArray(this.toArray(), t3, r3); + }, i2.prototype._initArray = function(e4, t3, r3) { + if (n2("number" == typeof e4.length), e4.length <= 0) + return this.words = [0], this.length = 1, this; + this.length = Math.ceil(e4.length / 3), this.words = new Array(this.length); + for (var i3 = 0; i3 < this.length; i3++) + this.words[i3] = 0; + var o3, a3, s3 = 0; + if ("be" === r3) + for (i3 = e4.length - 1, o3 = 0; i3 >= 0; i3 -= 3) + a3 = e4[i3] | e4[i3 - 1] << 8 | e4[i3 - 2] << 16, this.words[o3] |= a3 << s3 & 67108863, this.words[o3 + 1] = a3 >>> 26 - s3 & 67108863, (s3 += 24) >= 26 && (s3 -= 26, o3++); + else if ("le" === r3) + for (i3 = 0, o3 = 0; i3 < e4.length; i3 += 3) + a3 = e4[i3] | e4[i3 + 1] << 8 | e4[i3 + 2] << 16, this.words[o3] |= a3 << s3 & 67108863, this.words[o3 + 1] = a3 >>> 26 - s3 & 67108863, (s3 += 24) >= 26 && (s3 -= 26, o3++); + return this._strip(); + }, i2.prototype._parseHex = function(e4, t3, n3) { + this.length = Math.ceil((e4.length - t3) / 6), this.words = new Array(this.length); + for (var r3 = 0; r3 < this.length; r3++) + this.words[r3] = 0; + var i3, o3 = 0, a3 = 0; + if ("be" === n3) + for (r3 = e4.length - 1; r3 >= t3; r3 -= 2) + i3 = s2(e4, t3, r3) << o3, this.words[a3] |= 67108863 & i3, o3 >= 18 ? (o3 -= 18, a3 += 1, this.words[a3] |= i3 >>> 26) : o3 += 8; + else + for (r3 = (e4.length - t3) % 2 == 0 ? t3 + 1 : t3; r3 < e4.length; r3 += 2) + i3 = s2(e4, t3, r3) << o3, this.words[a3] |= 67108863 & i3, o3 >= 18 ? (o3 -= 18, a3 += 1, this.words[a3] |= i3 >>> 26) : o3 += 8; + this._strip(); + }, i2.prototype._parseBase = function(e4, t3, n3) { + this.words = [0], this.length = 1; + for (var r3 = 0, i3 = 1; i3 <= 67108863; i3 *= t3) + r3++; + r3--, i3 = i3 / t3 | 0; + for (var o3 = e4.length - n3, a3 = o3 % r3, s3 = Math.min(o3, o3 - a3) + n3, l3 = 0, c3 = n3; c3 < s3; c3 += r3) + l3 = u2(e4, c3, c3 + r3, t3), this.imuln(i3), this.words[0] + l3 < 67108864 ? this.words[0] += l3 : this._iaddn(l3); + if (0 !== a3) { + var d3 = 1; + for (l3 = u2(e4, c3, e4.length, t3), c3 = 0; c3 < a3; c3++) + d3 *= t3; + this.imuln(d3), this.words[0] + l3 < 67108864 ? this.words[0] += l3 : this._iaddn(l3); + } + this._strip(); + }, i2.prototype.copy = function(e4) { + e4.words = new Array(this.length); + for (var t3 = 0; t3 < this.length; t3++) + e4.words[t3] = this.words[t3]; + e4.length = this.length, e4.negative = this.negative, e4.red = this.red; + }, i2.prototype._move = function(e4) { + l2(e4, this); + }, i2.prototype.clone = function() { + var e4 = new i2(null); + return this.copy(e4), e4; + }, i2.prototype._expand = function(e4) { + for (; this.length < e4; ) + this.words[this.length++] = 0; + return this; + }, i2.prototype._strip = function() { + for (; this.length > 1 && 0 === this.words[this.length - 1]; ) + this.length--; + return this._normSign(); + }, i2.prototype._normSign = function() { + return 1 === this.length && 0 === this.words[0] && (this.negative = 0), this; + }, "undefined" != typeof Symbol && "function" == typeof Symbol.for) + try { + i2.prototype[Symbol.for("nodejs.util.inspect.custom")] = c2; + } catch (e4) { + i2.prototype.inspect = c2; + } + else + i2.prototype.inspect = c2; + function c2() { + return (this.red ? ""; + } + var d2 = ["", "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"], f2 = [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], h2 = [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]; + i2.prototype.toString = function(e4, t3) { + var r3; + if (t3 = 0 | t3 || 1, 16 === (e4 = e4 || 10) || "hex" === e4) { + r3 = ""; + for (var i3 = 0, o3 = 0, a3 = 0; a3 < this.length; a3++) { + var s3 = this.words[a3], u3 = (16777215 & (s3 << i3 | o3)).toString(16); + o3 = s3 >>> 24 - i3 & 16777215, (i3 += 2) >= 26 && (i3 -= 26, a3--), r3 = 0 !== o3 || a3 !== this.length - 1 ? d2[6 - u3.length] + u3 + r3 : u3 + r3; + } + for (0 !== o3 && (r3 = o3.toString(16) + r3); r3.length % t3 != 0; ) + r3 = "0" + r3; + return 0 !== this.negative && (r3 = "-" + r3), r3; + } + if (e4 === (0 | e4) && e4 >= 2 && e4 <= 36) { + var l3 = f2[e4], c3 = h2[e4]; + r3 = ""; + var p3 = this.clone(); + for (p3.negative = 0; !p3.isZero(); ) { + var m3 = p3.modrn(c3).toString(e4); + r3 = (p3 = p3.idivn(c3)).isZero() ? m3 + r3 : d2[l3 - m3.length] + m3 + r3; + } + for (this.isZero() && (r3 = "0" + r3); r3.length % t3 != 0; ) + r3 = "0" + r3; + return 0 !== this.negative && (r3 = "-" + r3), r3; + } + n2(false, "Base should be between 2 and 36"); + }, i2.prototype.toNumber = function() { + var e4 = this.words[0]; + return 2 === this.length ? e4 += 67108864 * this.words[1] : 3 === this.length && 1 === this.words[2] ? e4 += 4503599627370496 + 67108864 * this.words[1] : this.length > 2 && n2(false, "Number can only safely store up to 53 bits"), 0 !== this.negative ? -e4 : e4; + }, i2.prototype.toJSON = function() { + return this.toString(16, 2); + }, o2 && (i2.prototype.toBuffer = function(e4, t3) { + return this.toArrayLike(o2, e4, t3); + }), i2.prototype.toArray = function(e4, t3) { + return this.toArrayLike(Array, e4, t3); + }; + function p2(e4, t3, n3) { + n3.negative = t3.negative ^ e4.negative; + var r3 = e4.length + t3.length | 0; + n3.length = r3, r3 = r3 - 1 | 0; + var i3 = 0 | e4.words[0], o3 = 0 | t3.words[0], a3 = i3 * o3, s3 = 67108863 & a3, u3 = a3 / 67108864 | 0; + n3.words[0] = s3; + for (var l3 = 1; l3 < r3; l3++) { + for (var c3 = u3 >>> 26, d3 = 67108863 & u3, f3 = Math.min(l3, t3.length - 1), h3 = Math.max(0, l3 - e4.length + 1); h3 <= f3; h3++) { + var p3 = l3 - h3 | 0; + c3 += (a3 = (i3 = 0 | e4.words[p3]) * (o3 = 0 | t3.words[h3]) + d3) / 67108864 | 0, d3 = 67108863 & a3; + } + n3.words[l3] = 0 | d3, u3 = 0 | c3; + } + return 0 !== u3 ? n3.words[l3] = 0 | u3 : n3.length--, n3._strip(); + } + i2.prototype.toArrayLike = function(e4, t3, r3) { + this._strip(); + var i3 = this.byteLength(), o3 = r3 || Math.max(1, i3); + n2(i3 <= o3, "byte array longer than desired length"), n2(o3 > 0, "Requested array length <= 0"); + var a3 = function(e5, t4) { + return e5.allocUnsafe ? e5.allocUnsafe(t4) : new e5(t4); + }(e4, o3); + return this["_toArrayLike" + ("le" === t3 ? "LE" : "BE")](a3, i3), a3; + }, i2.prototype._toArrayLikeLE = function(e4, t3) { + for (var n3 = 0, r3 = 0, i3 = 0, o3 = 0; i3 < this.length; i3++) { + var a3 = this.words[i3] << o3 | r3; + e4[n3++] = 255 & a3, n3 < e4.length && (e4[n3++] = a3 >> 8 & 255), n3 < e4.length && (e4[n3++] = a3 >> 16 & 255), 6 === o3 ? (n3 < e4.length && (e4[n3++] = a3 >> 24 & 255), r3 = 0, o3 = 0) : (r3 = a3 >>> 24, o3 += 2); + } + if (n3 < e4.length) + for (e4[n3++] = r3; n3 < e4.length; ) + e4[n3++] = 0; + }, i2.prototype._toArrayLikeBE = function(e4, t3) { + for (var n3 = e4.length - 1, r3 = 0, i3 = 0, o3 = 0; i3 < this.length; i3++) { + var a3 = this.words[i3] << o3 | r3; + e4[n3--] = 255 & a3, n3 >= 0 && (e4[n3--] = a3 >> 8 & 255), n3 >= 0 && (e4[n3--] = a3 >> 16 & 255), 6 === o3 ? (n3 >= 0 && (e4[n3--] = a3 >> 24 & 255), r3 = 0, o3 = 0) : (r3 = a3 >>> 24, o3 += 2); + } + if (n3 >= 0) + for (e4[n3--] = r3; n3 >= 0; ) + e4[n3--] = 0; + }, Math.clz32 ? i2.prototype._countBits = function(e4) { + return 32 - Math.clz32(e4); + } : i2.prototype._countBits = function(e4) { + var t3 = e4, n3 = 0; + return t3 >= 4096 && (n3 += 13, t3 >>>= 13), t3 >= 64 && (n3 += 7, t3 >>>= 7), t3 >= 8 && (n3 += 4, t3 >>>= 4), t3 >= 2 && (n3 += 2, t3 >>>= 2), n3 + t3; + }, i2.prototype._zeroBits = function(e4) { + if (0 === e4) + return 26; + var t3 = e4, n3 = 0; + return 0 == (8191 & t3) && (n3 += 13, t3 >>>= 13), 0 == (127 & t3) && (n3 += 7, t3 >>>= 7), 0 == (15 & t3) && (n3 += 4, t3 >>>= 4), 0 == (3 & t3) && (n3 += 2, t3 >>>= 2), 0 == (1 & t3) && n3++, n3; + }, i2.prototype.bitLength = function() { + var e4 = this.words[this.length - 1], t3 = this._countBits(e4); + return 26 * (this.length - 1) + t3; + }, i2.prototype.zeroBits = function() { + if (this.isZero()) + return 0; + for (var e4 = 0, t3 = 0; t3 < this.length; t3++) { + var n3 = this._zeroBits(this.words[t3]); + if (e4 += n3, 26 !== n3) + break; + } + return e4; + }, i2.prototype.byteLength = function() { + return Math.ceil(this.bitLength() / 8); + }, i2.prototype.toTwos = function(e4) { + return 0 !== this.negative ? this.abs().inotn(e4).iaddn(1) : this.clone(); + }, i2.prototype.fromTwos = function(e4) { + return this.testn(e4 - 1) ? this.notn(e4).iaddn(1).ineg() : this.clone(); + }, i2.prototype.isNeg = function() { + return 0 !== this.negative; + }, i2.prototype.neg = function() { + return this.clone().ineg(); + }, i2.prototype.ineg = function() { + return this.isZero() || (this.negative ^= 1), this; + }, i2.prototype.iuor = function(e4) { + for (; this.length < e4.length; ) + this.words[this.length++] = 0; + for (var t3 = 0; t3 < e4.length; t3++) + this.words[t3] = this.words[t3] | e4.words[t3]; + return this._strip(); + }, i2.prototype.ior = function(e4) { + return n2(0 == (this.negative | e4.negative)), this.iuor(e4); + }, i2.prototype.or = function(e4) { + return this.length > e4.length ? this.clone().ior(e4) : e4.clone().ior(this); + }, i2.prototype.uor = function(e4) { + return this.length > e4.length ? this.clone().iuor(e4) : e4.clone().iuor(this); + }, i2.prototype.iuand = function(e4) { + var t3; + t3 = this.length > e4.length ? e4 : this; + for (var n3 = 0; n3 < t3.length; n3++) + this.words[n3] = this.words[n3] & e4.words[n3]; + return this.length = t3.length, this._strip(); + }, i2.prototype.iand = function(e4) { + return n2(0 == (this.negative | e4.negative)), this.iuand(e4); + }, i2.prototype.and = function(e4) { + return this.length > e4.length ? this.clone().iand(e4) : e4.clone().iand(this); + }, i2.prototype.uand = function(e4) { + return this.length > e4.length ? this.clone().iuand(e4) : e4.clone().iuand(this); + }, i2.prototype.iuxor = function(e4) { + var t3, n3; + this.length > e4.length ? (t3 = this, n3 = e4) : (t3 = e4, n3 = this); + for (var r3 = 0; r3 < n3.length; r3++) + this.words[r3] = t3.words[r3] ^ n3.words[r3]; + if (this !== t3) + for (; r3 < t3.length; r3++) + this.words[r3] = t3.words[r3]; + return this.length = t3.length, this._strip(); + }, i2.prototype.ixor = function(e4) { + return n2(0 == (this.negative | e4.negative)), this.iuxor(e4); + }, i2.prototype.xor = function(e4) { + return this.length > e4.length ? this.clone().ixor(e4) : e4.clone().ixor(this); + }, i2.prototype.uxor = function(e4) { + return this.length > e4.length ? this.clone().iuxor(e4) : e4.clone().iuxor(this); + }, i2.prototype.inotn = function(e4) { + n2("number" == typeof e4 && e4 >= 0); + var t3 = 0 | Math.ceil(e4 / 26), r3 = e4 % 26; + this._expand(t3), r3 > 0 && t3--; + for (var i3 = 0; i3 < t3; i3++) + this.words[i3] = 67108863 & ~this.words[i3]; + return r3 > 0 && (this.words[i3] = ~this.words[i3] & 67108863 >> 26 - r3), this._strip(); + }, i2.prototype.notn = function(e4) { + return this.clone().inotn(e4); + }, i2.prototype.setn = function(e4, t3) { + n2("number" == typeof e4 && e4 >= 0); + var r3 = e4 / 26 | 0, i3 = e4 % 26; + return this._expand(r3 + 1), this.words[r3] = t3 ? this.words[r3] | 1 << i3 : this.words[r3] & ~(1 << i3), this._strip(); + }, i2.prototype.iadd = function(e4) { + var t3, n3, r3; + if (0 !== this.negative && 0 === e4.negative) + return this.negative = 0, t3 = this.isub(e4), this.negative ^= 1, this._normSign(); + if (0 === this.negative && 0 !== e4.negative) + return e4.negative = 0, t3 = this.isub(e4), e4.negative = 1, t3._normSign(); + this.length > e4.length ? (n3 = this, r3 = e4) : (n3 = e4, r3 = this); + for (var i3 = 0, o3 = 0; o3 < r3.length; o3++) + t3 = (0 | n3.words[o3]) + (0 | r3.words[o3]) + i3, this.words[o3] = 67108863 & t3, i3 = t3 >>> 26; + for (; 0 !== i3 && o3 < n3.length; o3++) + t3 = (0 | n3.words[o3]) + i3, this.words[o3] = 67108863 & t3, i3 = t3 >>> 26; + if (this.length = n3.length, 0 !== i3) + this.words[this.length] = i3, this.length++; + else if (n3 !== this) + for (; o3 < n3.length; o3++) + this.words[o3] = n3.words[o3]; + return this; + }, i2.prototype.add = function(e4) { + var t3; + return 0 !== e4.negative && 0 === this.negative ? (e4.negative = 0, t3 = this.sub(e4), e4.negative ^= 1, t3) : 0 === e4.negative && 0 !== this.negative ? (this.negative = 0, t3 = e4.sub(this), this.negative = 1, t3) : this.length > e4.length ? this.clone().iadd(e4) : e4.clone().iadd(this); + }, i2.prototype.isub = function(e4) { + if (0 !== e4.negative) { + e4.negative = 0; + var t3 = this.iadd(e4); + return e4.negative = 1, t3._normSign(); + } + if (0 !== this.negative) + return this.negative = 0, this.iadd(e4), this.negative = 1, this._normSign(); + var n3, r3, i3 = this.cmp(e4); + if (0 === i3) + return this.negative = 0, this.length = 1, this.words[0] = 0, this; + i3 > 0 ? (n3 = this, r3 = e4) : (n3 = e4, r3 = this); + for (var o3 = 0, a3 = 0; a3 < r3.length; a3++) + o3 = (t3 = (0 | n3.words[a3]) - (0 | r3.words[a3]) + o3) >> 26, this.words[a3] = 67108863 & t3; + for (; 0 !== o3 && a3 < n3.length; a3++) + o3 = (t3 = (0 | n3.words[a3]) + o3) >> 26, this.words[a3] = 67108863 & t3; + if (0 === o3 && a3 < n3.length && n3 !== this) + for (; a3 < n3.length; a3++) + this.words[a3] = n3.words[a3]; + return this.length = Math.max(this.length, a3), n3 !== this && (this.negative = 1), this._strip(); + }, i2.prototype.sub = function(e4) { + return this.clone().isub(e4); + }; + var m2 = function(e4, t3, n3) { + var r3, i3, o3, a3 = e4.words, s3 = t3.words, u3 = n3.words, l3 = 0, c3 = 0 | a3[0], d3 = 8191 & c3, f3 = c3 >>> 13, h3 = 0 | a3[1], p3 = 8191 & h3, m3 = h3 >>> 13, g3 = 0 | a3[2], v3 = 8191 & g3, b3 = g3 >>> 13, y3 = 0 | a3[3], w3 = 8191 & y3, _3 = y3 >>> 13, S3 = 0 | a3[4], E3 = 8191 & S3, k3 = S3 >>> 13, M3 = 0 | a3[5], C2 = 8191 & M3, x2 = M3 >>> 13, A2 = 0 | a3[6], R2 = 8191 & A2, T2 = A2 >>> 13, P2 = 0 | a3[7], L2 = 8191 & P2, I2 = P2 >>> 13, O2 = 0 | a3[8], N2 = 8191 & O2, D2 = O2 >>> 13, j2 = 0 | a3[9], B2 = 8191 & j2, z2 = j2 >>> 13, U2 = 0 | s3[0], F2 = 8191 & U2, K2 = U2 >>> 13, q2 = 0 | s3[1], H2 = 8191 & q2, W2 = q2 >>> 13, $2 = 0 | s3[2], V2 = 8191 & $2, Y2 = $2 >>> 13, G2 = 0 | s3[3], Z2 = 8191 & G2, Q2 = G2 >>> 13, J2 = 0 | s3[4], X2 = 8191 & J2, ee2 = J2 >>> 13, te2 = 0 | s3[5], ne2 = 8191 & te2, re2 = te2 >>> 13, ie2 = 0 | s3[6], oe2 = 8191 & ie2, ae2 = ie2 >>> 13, se2 = 0 | s3[7], ue2 = 8191 & se2, le2 = se2 >>> 13, ce2 = 0 | s3[8], de2 = 8191 & ce2, fe2 = ce2 >>> 13, he2 = 0 | s3[9], pe2 = 8191 & he2, me2 = he2 >>> 13; + n3.negative = e4.negative ^ t3.negative, n3.length = 19; + var ge2 = (l3 + (r3 = Math.imul(d3, F2)) | 0) + ((8191 & (i3 = (i3 = Math.imul(d3, K2)) + Math.imul(f3, F2) | 0)) << 13) | 0; + l3 = ((o3 = Math.imul(f3, K2)) + (i3 >>> 13) | 0) + (ge2 >>> 26) | 0, ge2 &= 67108863, r3 = Math.imul(p3, F2), i3 = (i3 = Math.imul(p3, K2)) + Math.imul(m3, F2) | 0, o3 = Math.imul(m3, K2); + var ve2 = (l3 + (r3 = r3 + Math.imul(d3, H2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, W2) | 0) + Math.imul(f3, H2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, W2) | 0) + (i3 >>> 13) | 0) + (ve2 >>> 26) | 0, ve2 &= 67108863, r3 = Math.imul(v3, F2), i3 = (i3 = Math.imul(v3, K2)) + Math.imul(b3, F2) | 0, o3 = Math.imul(b3, K2), r3 = r3 + Math.imul(p3, H2) | 0, i3 = (i3 = i3 + Math.imul(p3, W2) | 0) + Math.imul(m3, H2) | 0, o3 = o3 + Math.imul(m3, W2) | 0; + var be2 = (l3 + (r3 = r3 + Math.imul(d3, V2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, Y2) | 0) + Math.imul(f3, V2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, Y2) | 0) + (i3 >>> 13) | 0) + (be2 >>> 26) | 0, be2 &= 67108863, r3 = Math.imul(w3, F2), i3 = (i3 = Math.imul(w3, K2)) + Math.imul(_3, F2) | 0, o3 = Math.imul(_3, K2), r3 = r3 + Math.imul(v3, H2) | 0, i3 = (i3 = i3 + Math.imul(v3, W2) | 0) + Math.imul(b3, H2) | 0, o3 = o3 + Math.imul(b3, W2) | 0, r3 = r3 + Math.imul(p3, V2) | 0, i3 = (i3 = i3 + Math.imul(p3, Y2) | 0) + Math.imul(m3, V2) | 0, o3 = o3 + Math.imul(m3, Y2) | 0; + var ye2 = (l3 + (r3 = r3 + Math.imul(d3, Z2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, Q2) | 0) + Math.imul(f3, Z2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, Q2) | 0) + (i3 >>> 13) | 0) + (ye2 >>> 26) | 0, ye2 &= 67108863, r3 = Math.imul(E3, F2), i3 = (i3 = Math.imul(E3, K2)) + Math.imul(k3, F2) | 0, o3 = Math.imul(k3, K2), r3 = r3 + Math.imul(w3, H2) | 0, i3 = (i3 = i3 + Math.imul(w3, W2) | 0) + Math.imul(_3, H2) | 0, o3 = o3 + Math.imul(_3, W2) | 0, r3 = r3 + Math.imul(v3, V2) | 0, i3 = (i3 = i3 + Math.imul(v3, Y2) | 0) + Math.imul(b3, V2) | 0, o3 = o3 + Math.imul(b3, Y2) | 0, r3 = r3 + Math.imul(p3, Z2) | 0, i3 = (i3 = i3 + Math.imul(p3, Q2) | 0) + Math.imul(m3, Z2) | 0, o3 = o3 + Math.imul(m3, Q2) | 0; + var we2 = (l3 + (r3 = r3 + Math.imul(d3, X2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, ee2) | 0) + Math.imul(f3, X2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, ee2) | 0) + (i3 >>> 13) | 0) + (we2 >>> 26) | 0, we2 &= 67108863, r3 = Math.imul(C2, F2), i3 = (i3 = Math.imul(C2, K2)) + Math.imul(x2, F2) | 0, o3 = Math.imul(x2, K2), r3 = r3 + Math.imul(E3, H2) | 0, i3 = (i3 = i3 + Math.imul(E3, W2) | 0) + Math.imul(k3, H2) | 0, o3 = o3 + Math.imul(k3, W2) | 0, r3 = r3 + Math.imul(w3, V2) | 0, i3 = (i3 = i3 + Math.imul(w3, Y2) | 0) + Math.imul(_3, V2) | 0, o3 = o3 + Math.imul(_3, Y2) | 0, r3 = r3 + Math.imul(v3, Z2) | 0, i3 = (i3 = i3 + Math.imul(v3, Q2) | 0) + Math.imul(b3, Z2) | 0, o3 = o3 + Math.imul(b3, Q2) | 0, r3 = r3 + Math.imul(p3, X2) | 0, i3 = (i3 = i3 + Math.imul(p3, ee2) | 0) + Math.imul(m3, X2) | 0, o3 = o3 + Math.imul(m3, ee2) | 0; + var _e2 = (l3 + (r3 = r3 + Math.imul(d3, ne2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, re2) | 0) + Math.imul(f3, ne2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, re2) | 0) + (i3 >>> 13) | 0) + (_e2 >>> 26) | 0, _e2 &= 67108863, r3 = Math.imul(R2, F2), i3 = (i3 = Math.imul(R2, K2)) + Math.imul(T2, F2) | 0, o3 = Math.imul(T2, K2), r3 = r3 + Math.imul(C2, H2) | 0, i3 = (i3 = i3 + Math.imul(C2, W2) | 0) + Math.imul(x2, H2) | 0, o3 = o3 + Math.imul(x2, W2) | 0, r3 = r3 + Math.imul(E3, V2) | 0, i3 = (i3 = i3 + Math.imul(E3, Y2) | 0) + Math.imul(k3, V2) | 0, o3 = o3 + Math.imul(k3, Y2) | 0, r3 = r3 + Math.imul(w3, Z2) | 0, i3 = (i3 = i3 + Math.imul(w3, Q2) | 0) + Math.imul(_3, Z2) | 0, o3 = o3 + Math.imul(_3, Q2) | 0, r3 = r3 + Math.imul(v3, X2) | 0, i3 = (i3 = i3 + Math.imul(v3, ee2) | 0) + Math.imul(b3, X2) | 0, o3 = o3 + Math.imul(b3, ee2) | 0, r3 = r3 + Math.imul(p3, ne2) | 0, i3 = (i3 = i3 + Math.imul(p3, re2) | 0) + Math.imul(m3, ne2) | 0, o3 = o3 + Math.imul(m3, re2) | 0; + var Se2 = (l3 + (r3 = r3 + Math.imul(d3, oe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, ae2) | 0) + Math.imul(f3, oe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, ae2) | 0) + (i3 >>> 13) | 0) + (Se2 >>> 26) | 0, Se2 &= 67108863, r3 = Math.imul(L2, F2), i3 = (i3 = Math.imul(L2, K2)) + Math.imul(I2, F2) | 0, o3 = Math.imul(I2, K2), r3 = r3 + Math.imul(R2, H2) | 0, i3 = (i3 = i3 + Math.imul(R2, W2) | 0) + Math.imul(T2, H2) | 0, o3 = o3 + Math.imul(T2, W2) | 0, r3 = r3 + Math.imul(C2, V2) | 0, i3 = (i3 = i3 + Math.imul(C2, Y2) | 0) + Math.imul(x2, V2) | 0, o3 = o3 + Math.imul(x2, Y2) | 0, r3 = r3 + Math.imul(E3, Z2) | 0, i3 = (i3 = i3 + Math.imul(E3, Q2) | 0) + Math.imul(k3, Z2) | 0, o3 = o3 + Math.imul(k3, Q2) | 0, r3 = r3 + Math.imul(w3, X2) | 0, i3 = (i3 = i3 + Math.imul(w3, ee2) | 0) + Math.imul(_3, X2) | 0, o3 = o3 + Math.imul(_3, ee2) | 0, r3 = r3 + Math.imul(v3, ne2) | 0, i3 = (i3 = i3 + Math.imul(v3, re2) | 0) + Math.imul(b3, ne2) | 0, o3 = o3 + Math.imul(b3, re2) | 0, r3 = r3 + Math.imul(p3, oe2) | 0, i3 = (i3 = i3 + Math.imul(p3, ae2) | 0) + Math.imul(m3, oe2) | 0, o3 = o3 + Math.imul(m3, ae2) | 0; + var Ee2 = (l3 + (r3 = r3 + Math.imul(d3, ue2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, le2) | 0) + Math.imul(f3, ue2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, le2) | 0) + (i3 >>> 13) | 0) + (Ee2 >>> 26) | 0, Ee2 &= 67108863, r3 = Math.imul(N2, F2), i3 = (i3 = Math.imul(N2, K2)) + Math.imul(D2, F2) | 0, o3 = Math.imul(D2, K2), r3 = r3 + Math.imul(L2, H2) | 0, i3 = (i3 = i3 + Math.imul(L2, W2) | 0) + Math.imul(I2, H2) | 0, o3 = o3 + Math.imul(I2, W2) | 0, r3 = r3 + Math.imul(R2, V2) | 0, i3 = (i3 = i3 + Math.imul(R2, Y2) | 0) + Math.imul(T2, V2) | 0, o3 = o3 + Math.imul(T2, Y2) | 0, r3 = r3 + Math.imul(C2, Z2) | 0, i3 = (i3 = i3 + Math.imul(C2, Q2) | 0) + Math.imul(x2, Z2) | 0, o3 = o3 + Math.imul(x2, Q2) | 0, r3 = r3 + Math.imul(E3, X2) | 0, i3 = (i3 = i3 + Math.imul(E3, ee2) | 0) + Math.imul(k3, X2) | 0, o3 = o3 + Math.imul(k3, ee2) | 0, r3 = r3 + Math.imul(w3, ne2) | 0, i3 = (i3 = i3 + Math.imul(w3, re2) | 0) + Math.imul(_3, ne2) | 0, o3 = o3 + Math.imul(_3, re2) | 0, r3 = r3 + Math.imul(v3, oe2) | 0, i3 = (i3 = i3 + Math.imul(v3, ae2) | 0) + Math.imul(b3, oe2) | 0, o3 = o3 + Math.imul(b3, ae2) | 0, r3 = r3 + Math.imul(p3, ue2) | 0, i3 = (i3 = i3 + Math.imul(p3, le2) | 0) + Math.imul(m3, ue2) | 0, o3 = o3 + Math.imul(m3, le2) | 0; + var ke2 = (l3 + (r3 = r3 + Math.imul(d3, de2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, fe2) | 0) + Math.imul(f3, de2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, fe2) | 0) + (i3 >>> 13) | 0) + (ke2 >>> 26) | 0, ke2 &= 67108863, r3 = Math.imul(B2, F2), i3 = (i3 = Math.imul(B2, K2)) + Math.imul(z2, F2) | 0, o3 = Math.imul(z2, K2), r3 = r3 + Math.imul(N2, H2) | 0, i3 = (i3 = i3 + Math.imul(N2, W2) | 0) + Math.imul(D2, H2) | 0, o3 = o3 + Math.imul(D2, W2) | 0, r3 = r3 + Math.imul(L2, V2) | 0, i3 = (i3 = i3 + Math.imul(L2, Y2) | 0) + Math.imul(I2, V2) | 0, o3 = o3 + Math.imul(I2, Y2) | 0, r3 = r3 + Math.imul(R2, Z2) | 0, i3 = (i3 = i3 + Math.imul(R2, Q2) | 0) + Math.imul(T2, Z2) | 0, o3 = o3 + Math.imul(T2, Q2) | 0, r3 = r3 + Math.imul(C2, X2) | 0, i3 = (i3 = i3 + Math.imul(C2, ee2) | 0) + Math.imul(x2, X2) | 0, o3 = o3 + Math.imul(x2, ee2) | 0, r3 = r3 + Math.imul(E3, ne2) | 0, i3 = (i3 = i3 + Math.imul(E3, re2) | 0) + Math.imul(k3, ne2) | 0, o3 = o3 + Math.imul(k3, re2) | 0, r3 = r3 + Math.imul(w3, oe2) | 0, i3 = (i3 = i3 + Math.imul(w3, ae2) | 0) + Math.imul(_3, oe2) | 0, o3 = o3 + Math.imul(_3, ae2) | 0, r3 = r3 + Math.imul(v3, ue2) | 0, i3 = (i3 = i3 + Math.imul(v3, le2) | 0) + Math.imul(b3, ue2) | 0, o3 = o3 + Math.imul(b3, le2) | 0, r3 = r3 + Math.imul(p3, de2) | 0, i3 = (i3 = i3 + Math.imul(p3, fe2) | 0) + Math.imul(m3, de2) | 0, o3 = o3 + Math.imul(m3, fe2) | 0; + var Me2 = (l3 + (r3 = r3 + Math.imul(d3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, me2) | 0) + Math.imul(f3, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, me2) | 0) + (i3 >>> 13) | 0) + (Me2 >>> 26) | 0, Me2 &= 67108863, r3 = Math.imul(B2, H2), i3 = (i3 = Math.imul(B2, W2)) + Math.imul(z2, H2) | 0, o3 = Math.imul(z2, W2), r3 = r3 + Math.imul(N2, V2) | 0, i3 = (i3 = i3 + Math.imul(N2, Y2) | 0) + Math.imul(D2, V2) | 0, o3 = o3 + Math.imul(D2, Y2) | 0, r3 = r3 + Math.imul(L2, Z2) | 0, i3 = (i3 = i3 + Math.imul(L2, Q2) | 0) + Math.imul(I2, Z2) | 0, o3 = o3 + Math.imul(I2, Q2) | 0, r3 = r3 + Math.imul(R2, X2) | 0, i3 = (i3 = i3 + Math.imul(R2, ee2) | 0) + Math.imul(T2, X2) | 0, o3 = o3 + Math.imul(T2, ee2) | 0, r3 = r3 + Math.imul(C2, ne2) | 0, i3 = (i3 = i3 + Math.imul(C2, re2) | 0) + Math.imul(x2, ne2) | 0, o3 = o3 + Math.imul(x2, re2) | 0, r3 = r3 + Math.imul(E3, oe2) | 0, i3 = (i3 = i3 + Math.imul(E3, ae2) | 0) + Math.imul(k3, oe2) | 0, o3 = o3 + Math.imul(k3, ae2) | 0, r3 = r3 + Math.imul(w3, ue2) | 0, i3 = (i3 = i3 + Math.imul(w3, le2) | 0) + Math.imul(_3, ue2) | 0, o3 = o3 + Math.imul(_3, le2) | 0, r3 = r3 + Math.imul(v3, de2) | 0, i3 = (i3 = i3 + Math.imul(v3, fe2) | 0) + Math.imul(b3, de2) | 0, o3 = o3 + Math.imul(b3, fe2) | 0; + var Ce2 = (l3 + (r3 = r3 + Math.imul(p3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(p3, me2) | 0) + Math.imul(m3, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(m3, me2) | 0) + (i3 >>> 13) | 0) + (Ce2 >>> 26) | 0, Ce2 &= 67108863, r3 = Math.imul(B2, V2), i3 = (i3 = Math.imul(B2, Y2)) + Math.imul(z2, V2) | 0, o3 = Math.imul(z2, Y2), r3 = r3 + Math.imul(N2, Z2) | 0, i3 = (i3 = i3 + Math.imul(N2, Q2) | 0) + Math.imul(D2, Z2) | 0, o3 = o3 + Math.imul(D2, Q2) | 0, r3 = r3 + Math.imul(L2, X2) | 0, i3 = (i3 = i3 + Math.imul(L2, ee2) | 0) + Math.imul(I2, X2) | 0, o3 = o3 + Math.imul(I2, ee2) | 0, r3 = r3 + Math.imul(R2, ne2) | 0, i3 = (i3 = i3 + Math.imul(R2, re2) | 0) + Math.imul(T2, ne2) | 0, o3 = o3 + Math.imul(T2, re2) | 0, r3 = r3 + Math.imul(C2, oe2) | 0, i3 = (i3 = i3 + Math.imul(C2, ae2) | 0) + Math.imul(x2, oe2) | 0, o3 = o3 + Math.imul(x2, ae2) | 0, r3 = r3 + Math.imul(E3, ue2) | 0, i3 = (i3 = i3 + Math.imul(E3, le2) | 0) + Math.imul(k3, ue2) | 0, o3 = o3 + Math.imul(k3, le2) | 0, r3 = r3 + Math.imul(w3, de2) | 0, i3 = (i3 = i3 + Math.imul(w3, fe2) | 0) + Math.imul(_3, de2) | 0, o3 = o3 + Math.imul(_3, fe2) | 0; + var xe2 = (l3 + (r3 = r3 + Math.imul(v3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(v3, me2) | 0) + Math.imul(b3, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(b3, me2) | 0) + (i3 >>> 13) | 0) + (xe2 >>> 26) | 0, xe2 &= 67108863, r3 = Math.imul(B2, Z2), i3 = (i3 = Math.imul(B2, Q2)) + Math.imul(z2, Z2) | 0, o3 = Math.imul(z2, Q2), r3 = r3 + Math.imul(N2, X2) | 0, i3 = (i3 = i3 + Math.imul(N2, ee2) | 0) + Math.imul(D2, X2) | 0, o3 = o3 + Math.imul(D2, ee2) | 0, r3 = r3 + Math.imul(L2, ne2) | 0, i3 = (i3 = i3 + Math.imul(L2, re2) | 0) + Math.imul(I2, ne2) | 0, o3 = o3 + Math.imul(I2, re2) | 0, r3 = r3 + Math.imul(R2, oe2) | 0, i3 = (i3 = i3 + Math.imul(R2, ae2) | 0) + Math.imul(T2, oe2) | 0, o3 = o3 + Math.imul(T2, ae2) | 0, r3 = r3 + Math.imul(C2, ue2) | 0, i3 = (i3 = i3 + Math.imul(C2, le2) | 0) + Math.imul(x2, ue2) | 0, o3 = o3 + Math.imul(x2, le2) | 0, r3 = r3 + Math.imul(E3, de2) | 0, i3 = (i3 = i3 + Math.imul(E3, fe2) | 0) + Math.imul(k3, de2) | 0, o3 = o3 + Math.imul(k3, fe2) | 0; + var Ae2 = (l3 + (r3 = r3 + Math.imul(w3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(w3, me2) | 0) + Math.imul(_3, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(_3, me2) | 0) + (i3 >>> 13) | 0) + (Ae2 >>> 26) | 0, Ae2 &= 67108863, r3 = Math.imul(B2, X2), i3 = (i3 = Math.imul(B2, ee2)) + Math.imul(z2, X2) | 0, o3 = Math.imul(z2, ee2), r3 = r3 + Math.imul(N2, ne2) | 0, i3 = (i3 = i3 + Math.imul(N2, re2) | 0) + Math.imul(D2, ne2) | 0, o3 = o3 + Math.imul(D2, re2) | 0, r3 = r3 + Math.imul(L2, oe2) | 0, i3 = (i3 = i3 + Math.imul(L2, ae2) | 0) + Math.imul(I2, oe2) | 0, o3 = o3 + Math.imul(I2, ae2) | 0, r3 = r3 + Math.imul(R2, ue2) | 0, i3 = (i3 = i3 + Math.imul(R2, le2) | 0) + Math.imul(T2, ue2) | 0, o3 = o3 + Math.imul(T2, le2) | 0, r3 = r3 + Math.imul(C2, de2) | 0, i3 = (i3 = i3 + Math.imul(C2, fe2) | 0) + Math.imul(x2, de2) | 0, o3 = o3 + Math.imul(x2, fe2) | 0; + var Re2 = (l3 + (r3 = r3 + Math.imul(E3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(E3, me2) | 0) + Math.imul(k3, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(k3, me2) | 0) + (i3 >>> 13) | 0) + (Re2 >>> 26) | 0, Re2 &= 67108863, r3 = Math.imul(B2, ne2), i3 = (i3 = Math.imul(B2, re2)) + Math.imul(z2, ne2) | 0, o3 = Math.imul(z2, re2), r3 = r3 + Math.imul(N2, oe2) | 0, i3 = (i3 = i3 + Math.imul(N2, ae2) | 0) + Math.imul(D2, oe2) | 0, o3 = o3 + Math.imul(D2, ae2) | 0, r3 = r3 + Math.imul(L2, ue2) | 0, i3 = (i3 = i3 + Math.imul(L2, le2) | 0) + Math.imul(I2, ue2) | 0, o3 = o3 + Math.imul(I2, le2) | 0, r3 = r3 + Math.imul(R2, de2) | 0, i3 = (i3 = i3 + Math.imul(R2, fe2) | 0) + Math.imul(T2, de2) | 0, o3 = o3 + Math.imul(T2, fe2) | 0; + var Te2 = (l3 + (r3 = r3 + Math.imul(C2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(C2, me2) | 0) + Math.imul(x2, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(x2, me2) | 0) + (i3 >>> 13) | 0) + (Te2 >>> 26) | 0, Te2 &= 67108863, r3 = Math.imul(B2, oe2), i3 = (i3 = Math.imul(B2, ae2)) + Math.imul(z2, oe2) | 0, o3 = Math.imul(z2, ae2), r3 = r3 + Math.imul(N2, ue2) | 0, i3 = (i3 = i3 + Math.imul(N2, le2) | 0) + Math.imul(D2, ue2) | 0, o3 = o3 + Math.imul(D2, le2) | 0, r3 = r3 + Math.imul(L2, de2) | 0, i3 = (i3 = i3 + Math.imul(L2, fe2) | 0) + Math.imul(I2, de2) | 0, o3 = o3 + Math.imul(I2, fe2) | 0; + var Pe2 = (l3 + (r3 = r3 + Math.imul(R2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(R2, me2) | 0) + Math.imul(T2, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(T2, me2) | 0) + (i3 >>> 13) | 0) + (Pe2 >>> 26) | 0, Pe2 &= 67108863, r3 = Math.imul(B2, ue2), i3 = (i3 = Math.imul(B2, le2)) + Math.imul(z2, ue2) | 0, o3 = Math.imul(z2, le2), r3 = r3 + Math.imul(N2, de2) | 0, i3 = (i3 = i3 + Math.imul(N2, fe2) | 0) + Math.imul(D2, de2) | 0, o3 = o3 + Math.imul(D2, fe2) | 0; + var Le2 = (l3 + (r3 = r3 + Math.imul(L2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(L2, me2) | 0) + Math.imul(I2, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(I2, me2) | 0) + (i3 >>> 13) | 0) + (Le2 >>> 26) | 0, Le2 &= 67108863, r3 = Math.imul(B2, de2), i3 = (i3 = Math.imul(B2, fe2)) + Math.imul(z2, de2) | 0, o3 = Math.imul(z2, fe2); + var Ie2 = (l3 + (r3 = r3 + Math.imul(N2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(N2, me2) | 0) + Math.imul(D2, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(D2, me2) | 0) + (i3 >>> 13) | 0) + (Ie2 >>> 26) | 0, Ie2 &= 67108863; + var Oe2 = (l3 + (r3 = Math.imul(B2, pe2)) | 0) + ((8191 & (i3 = (i3 = Math.imul(B2, me2)) + Math.imul(z2, pe2) | 0)) << 13) | 0; + return l3 = ((o3 = Math.imul(z2, me2)) + (i3 >>> 13) | 0) + (Oe2 >>> 26) | 0, Oe2 &= 67108863, u3[0] = ge2, u3[1] = ve2, u3[2] = be2, u3[3] = ye2, u3[4] = we2, u3[5] = _e2, u3[6] = Se2, u3[7] = Ee2, u3[8] = ke2, u3[9] = Me2, u3[10] = Ce2, u3[11] = xe2, u3[12] = Ae2, u3[13] = Re2, u3[14] = Te2, u3[15] = Pe2, u3[16] = Le2, u3[17] = Ie2, u3[18] = Oe2, 0 !== l3 && (u3[19] = l3, n3.length++), n3; + }; + function g2(e4, t3, n3) { + n3.negative = t3.negative ^ e4.negative, n3.length = e4.length + t3.length; + for (var r3 = 0, i3 = 0, o3 = 0; o3 < n3.length - 1; o3++) { + var a3 = i3; + i3 = 0; + for (var s3 = 67108863 & r3, u3 = Math.min(o3, t3.length - 1), l3 = Math.max(0, o3 - e4.length + 1); l3 <= u3; l3++) { + var c3 = o3 - l3, d3 = (0 | e4.words[c3]) * (0 | t3.words[l3]), f3 = 67108863 & d3; + s3 = 67108863 & (f3 = f3 + s3 | 0), i3 += (a3 = (a3 = a3 + (d3 / 67108864 | 0) | 0) + (f3 >>> 26) | 0) >>> 26, a3 &= 67108863; + } + n3.words[o3] = s3, r3 = a3, a3 = i3; + } + return 0 !== r3 ? n3.words[o3] = r3 : n3.length--, n3._strip(); + } + function v2(e4, t3, n3) { + return g2(e4, t3, n3); + } + Math.imul || (m2 = p2), i2.prototype.mulTo = function(e4, t3) { + var n3 = this.length + e4.length; + return 10 === this.length && 10 === e4.length ? m2(this, e4, t3) : n3 < 63 ? p2(this, e4, t3) : n3 < 1024 ? g2(this, e4, t3) : v2(this, e4, t3); + }, i2.prototype.mul = function(e4) { + var t3 = new i2(null); + return t3.words = new Array(this.length + e4.length), this.mulTo(e4, t3); + }, i2.prototype.mulf = function(e4) { + var t3 = new i2(null); + return t3.words = new Array(this.length + e4.length), v2(this, e4, t3); + }, i2.prototype.imul = function(e4) { + return this.clone().mulTo(e4, this); + }, i2.prototype.imuln = function(e4) { + var t3 = e4 < 0; + t3 && (e4 = -e4), n2("number" == typeof e4), n2(e4 < 67108864); + for (var r3 = 0, i3 = 0; i3 < this.length; i3++) { + var o3 = (0 | this.words[i3]) * e4, a3 = (67108863 & o3) + (67108863 & r3); + r3 >>= 26, r3 += o3 / 67108864 | 0, r3 += a3 >>> 26, this.words[i3] = 67108863 & a3; + } + return 0 !== r3 && (this.words[i3] = r3, this.length++), t3 ? this.ineg() : this; + }, i2.prototype.muln = function(e4) { + return this.clone().imuln(e4); + }, i2.prototype.sqr = function() { + return this.mul(this); + }, i2.prototype.isqr = function() { + return this.imul(this.clone()); + }, i2.prototype.pow = function(e4) { + var t3 = function(e5) { + for (var t4 = new Array(e5.bitLength()), n4 = 0; n4 < t4.length; n4++) { + var r4 = n4 / 26 | 0, i3 = n4 % 26; + t4[n4] = e5.words[r4] >>> i3 & 1; + } + return t4; + }(e4); + if (0 === t3.length) + return new i2(1); + for (var n3 = this, r3 = 0; r3 < t3.length && 0 === t3[r3]; r3++, n3 = n3.sqr()) + ; + if (++r3 < t3.length) + for (var o3 = n3.sqr(); r3 < t3.length; r3++, o3 = o3.sqr()) + 0 !== t3[r3] && (n3 = n3.mul(o3)); + return n3; + }, i2.prototype.iushln = function(e4) { + n2("number" == typeof e4 && e4 >= 0); + var t3, r3 = e4 % 26, i3 = (e4 - r3) / 26, o3 = 67108863 >>> 26 - r3 << 26 - r3; + if (0 !== r3) { + var a3 = 0; + for (t3 = 0; t3 < this.length; t3++) { + var s3 = this.words[t3] & o3, u3 = (0 | this.words[t3]) - s3 << r3; + this.words[t3] = u3 | a3, a3 = s3 >>> 26 - r3; + } + a3 && (this.words[t3] = a3, this.length++); + } + if (0 !== i3) { + for (t3 = this.length - 1; t3 >= 0; t3--) + this.words[t3 + i3] = this.words[t3]; + for (t3 = 0; t3 < i3; t3++) + this.words[t3] = 0; + this.length += i3; + } + return this._strip(); + }, i2.prototype.ishln = function(e4) { + return n2(0 === this.negative), this.iushln(e4); + }, i2.prototype.iushrn = function(e4, t3, r3) { + var i3; + n2("number" == typeof e4 && e4 >= 0), i3 = t3 ? (t3 - t3 % 26) / 26 : 0; + var o3 = e4 % 26, a3 = Math.min((e4 - o3) / 26, this.length), s3 = 67108863 ^ 67108863 >>> o3 << o3, u3 = r3; + if (i3 -= a3, i3 = Math.max(0, i3), u3) { + for (var l3 = 0; l3 < a3; l3++) + u3.words[l3] = this.words[l3]; + u3.length = a3; + } + if (0 === a3) + ; + else if (this.length > a3) + for (this.length -= a3, l3 = 0; l3 < this.length; l3++) + this.words[l3] = this.words[l3 + a3]; + else + this.words[0] = 0, this.length = 1; + var c3 = 0; + for (l3 = this.length - 1; l3 >= 0 && (0 !== c3 || l3 >= i3); l3--) { + var d3 = 0 | this.words[l3]; + this.words[l3] = c3 << 26 - o3 | d3 >>> o3, c3 = d3 & s3; + } + return u3 && 0 !== c3 && (u3.words[u3.length++] = c3), 0 === this.length && (this.words[0] = 0, this.length = 1), this._strip(); + }, i2.prototype.ishrn = function(e4, t3, r3) { + return n2(0 === this.negative), this.iushrn(e4, t3, r3); + }, i2.prototype.shln = function(e4) { + return this.clone().ishln(e4); + }, i2.prototype.ushln = function(e4) { + return this.clone().iushln(e4); + }, i2.prototype.shrn = function(e4) { + return this.clone().ishrn(e4); + }, i2.prototype.ushrn = function(e4) { + return this.clone().iushrn(e4); + }, i2.prototype.testn = function(e4) { + n2("number" == typeof e4 && e4 >= 0); + var t3 = e4 % 26, r3 = (e4 - t3) / 26, i3 = 1 << t3; + return !(this.length <= r3) && !!(this.words[r3] & i3); + }, i2.prototype.imaskn = function(e4) { + n2("number" == typeof e4 && e4 >= 0); + var t3 = e4 % 26, r3 = (e4 - t3) / 26; + if (n2(0 === this.negative, "imaskn works only with positive numbers"), this.length <= r3) + return this; + if (0 !== t3 && r3++, this.length = Math.min(r3, this.length), 0 !== t3) { + var i3 = 67108863 ^ 67108863 >>> t3 << t3; + this.words[this.length - 1] &= i3; + } + return this._strip(); + }, i2.prototype.maskn = function(e4) { + return this.clone().imaskn(e4); + }, i2.prototype.iaddn = function(e4) { + return n2("number" == typeof e4), n2(e4 < 67108864), e4 < 0 ? this.isubn(-e4) : 0 !== this.negative ? 1 === this.length && (0 | this.words[0]) <= e4 ? (this.words[0] = e4 - (0 | this.words[0]), this.negative = 0, this) : (this.negative = 0, this.isubn(e4), this.negative = 1, this) : this._iaddn(e4); + }, i2.prototype._iaddn = function(e4) { + this.words[0] += e4; + for (var t3 = 0; t3 < this.length && this.words[t3] >= 67108864; t3++) + this.words[t3] -= 67108864, t3 === this.length - 1 ? this.words[t3 + 1] = 1 : this.words[t3 + 1]++; + return this.length = Math.max(this.length, t3 + 1), this; + }, i2.prototype.isubn = function(e4) { + if (n2("number" == typeof e4), n2(e4 < 67108864), e4 < 0) + return this.iaddn(-e4); + if (0 !== this.negative) + return this.negative = 0, this.iaddn(e4), this.negative = 1, this; + if (this.words[0] -= e4, 1 === this.length && this.words[0] < 0) + this.words[0] = -this.words[0], this.negative = 1; + else + for (var t3 = 0; t3 < this.length && this.words[t3] < 0; t3++) + this.words[t3] += 67108864, this.words[t3 + 1] -= 1; + return this._strip(); + }, i2.prototype.addn = function(e4) { + return this.clone().iaddn(e4); + }, i2.prototype.subn = function(e4) { + return this.clone().isubn(e4); + }, i2.prototype.iabs = function() { + return this.negative = 0, this; + }, i2.prototype.abs = function() { + return this.clone().iabs(); + }, i2.prototype._ishlnsubmul = function(e4, t3, r3) { + var i3, o3, a3 = e4.length + r3; + this._expand(a3); + var s3 = 0; + for (i3 = 0; i3 < e4.length; i3++) { + o3 = (0 | this.words[i3 + r3]) + s3; + var u3 = (0 | e4.words[i3]) * t3; + s3 = ((o3 -= 67108863 & u3) >> 26) - (u3 / 67108864 | 0), this.words[i3 + r3] = 67108863 & o3; + } + for (; i3 < this.length - r3; i3++) + s3 = (o3 = (0 | this.words[i3 + r3]) + s3) >> 26, this.words[i3 + r3] = 67108863 & o3; + if (0 === s3) + return this._strip(); + for (n2(-1 === s3), s3 = 0, i3 = 0; i3 < this.length; i3++) + s3 = (o3 = -(0 | this.words[i3]) + s3) >> 26, this.words[i3] = 67108863 & o3; + return this.negative = 1, this._strip(); + }, i2.prototype._wordDiv = function(e4, t3) { + var n3 = (this.length, e4.length), r3 = this.clone(), o3 = e4, a3 = 0 | o3.words[o3.length - 1]; + 0 !== (n3 = 26 - this._countBits(a3)) && (o3 = o3.ushln(n3), r3.iushln(n3), a3 = 0 | o3.words[o3.length - 1]); + var s3, u3 = r3.length - o3.length; + if ("mod" !== t3) { + (s3 = new i2(null)).length = u3 + 1, s3.words = new Array(s3.length); + for (var l3 = 0; l3 < s3.length; l3++) + s3.words[l3] = 0; + } + var c3 = r3.clone()._ishlnsubmul(o3, 1, u3); + 0 === c3.negative && (r3 = c3, s3 && (s3.words[u3] = 1)); + for (var d3 = u3 - 1; d3 >= 0; d3--) { + var f3 = 67108864 * (0 | r3.words[o3.length + d3]) + (0 | r3.words[o3.length + d3 - 1]); + for (f3 = Math.min(f3 / a3 | 0, 67108863), r3._ishlnsubmul(o3, f3, d3); 0 !== r3.negative; ) + f3--, r3.negative = 0, r3._ishlnsubmul(o3, 1, d3), r3.isZero() || (r3.negative ^= 1); + s3 && (s3.words[d3] = f3); + } + return s3 && s3._strip(), r3._strip(), "div" !== t3 && 0 !== n3 && r3.iushrn(n3), { div: s3 || null, mod: r3 }; + }, i2.prototype.divmod = function(e4, t3, r3) { + return n2(!e4.isZero()), this.isZero() ? { div: new i2(0), mod: new i2(0) } : 0 !== this.negative && 0 === e4.negative ? (s3 = this.neg().divmod(e4, t3), "mod" !== t3 && (o3 = s3.div.neg()), "div" !== t3 && (a3 = s3.mod.neg(), r3 && 0 !== a3.negative && a3.iadd(e4)), { div: o3, mod: a3 }) : 0 === this.negative && 0 !== e4.negative ? (s3 = this.divmod(e4.neg(), t3), "mod" !== t3 && (o3 = s3.div.neg()), { div: o3, mod: s3.mod }) : 0 != (this.negative & e4.negative) ? (s3 = this.neg().divmod(e4.neg(), t3), "div" !== t3 && (a3 = s3.mod.neg(), r3 && 0 !== a3.negative && a3.isub(e4)), { div: s3.div, mod: a3 }) : e4.length > this.length || this.cmp(e4) < 0 ? { div: new i2(0), mod: this } : 1 === e4.length ? "div" === t3 ? { div: this.divn(e4.words[0]), mod: null } : "mod" === t3 ? { div: null, mod: new i2(this.modrn(e4.words[0])) } : { div: this.divn(e4.words[0]), mod: new i2(this.modrn(e4.words[0])) } : this._wordDiv(e4, t3); + var o3, a3, s3; + }, i2.prototype.div = function(e4) { + return this.divmod(e4, "div", false).div; + }, i2.prototype.mod = function(e4) { + return this.divmod(e4, "mod", false).mod; + }, i2.prototype.umod = function(e4) { + return this.divmod(e4, "mod", true).mod; + }, i2.prototype.divRound = function(e4) { + var t3 = this.divmod(e4); + if (t3.mod.isZero()) + return t3.div; + var n3 = 0 !== t3.div.negative ? t3.mod.isub(e4) : t3.mod, r3 = e4.ushrn(1), i3 = e4.andln(1), o3 = n3.cmp(r3); + return o3 < 0 || 1 === i3 && 0 === o3 ? t3.div : 0 !== t3.div.negative ? t3.div.isubn(1) : t3.div.iaddn(1); + }, i2.prototype.modrn = function(e4) { + var t3 = e4 < 0; + t3 && (e4 = -e4), n2(e4 <= 67108863); + for (var r3 = (1 << 26) % e4, i3 = 0, o3 = this.length - 1; o3 >= 0; o3--) + i3 = (r3 * i3 + (0 | this.words[o3])) % e4; + return t3 ? -i3 : i3; + }, i2.prototype.modn = function(e4) { + return this.modrn(e4); + }, i2.prototype.idivn = function(e4) { + var t3 = e4 < 0; + t3 && (e4 = -e4), n2(e4 <= 67108863); + for (var r3 = 0, i3 = this.length - 1; i3 >= 0; i3--) { + var o3 = (0 | this.words[i3]) + 67108864 * r3; + this.words[i3] = o3 / e4 | 0, r3 = o3 % e4; + } + return this._strip(), t3 ? this.ineg() : this; + }, i2.prototype.divn = function(e4) { + return this.clone().idivn(e4); + }, i2.prototype.egcd = function(e4) { + n2(0 === e4.negative), n2(!e4.isZero()); + var t3 = this, r3 = e4.clone(); + t3 = 0 !== t3.negative ? t3.umod(e4) : t3.clone(); + for (var o3 = new i2(1), a3 = new i2(0), s3 = new i2(0), u3 = new i2(1), l3 = 0; t3.isEven() && r3.isEven(); ) + t3.iushrn(1), r3.iushrn(1), ++l3; + for (var c3 = r3.clone(), d3 = t3.clone(); !t3.isZero(); ) { + for (var f3 = 0, h3 = 1; 0 == (t3.words[0] & h3) && f3 < 26; ++f3, h3 <<= 1) + ; + if (f3 > 0) + for (t3.iushrn(f3); f3-- > 0; ) + (o3.isOdd() || a3.isOdd()) && (o3.iadd(c3), a3.isub(d3)), o3.iushrn(1), a3.iushrn(1); + for (var p3 = 0, m3 = 1; 0 == (r3.words[0] & m3) && p3 < 26; ++p3, m3 <<= 1) + ; + if (p3 > 0) + for (r3.iushrn(p3); p3-- > 0; ) + (s3.isOdd() || u3.isOdd()) && (s3.iadd(c3), u3.isub(d3)), s3.iushrn(1), u3.iushrn(1); + t3.cmp(r3) >= 0 ? (t3.isub(r3), o3.isub(s3), a3.isub(u3)) : (r3.isub(t3), s3.isub(o3), u3.isub(a3)); + } + return { a: s3, b: u3, gcd: r3.iushln(l3) }; + }, i2.prototype._invmp = function(e4) { + n2(0 === e4.negative), n2(!e4.isZero()); + var t3 = this, r3 = e4.clone(); + t3 = 0 !== t3.negative ? t3.umod(e4) : t3.clone(); + for (var o3, a3 = new i2(1), s3 = new i2(0), u3 = r3.clone(); t3.cmpn(1) > 0 && r3.cmpn(1) > 0; ) { + for (var l3 = 0, c3 = 1; 0 == (t3.words[0] & c3) && l3 < 26; ++l3, c3 <<= 1) + ; + if (l3 > 0) + for (t3.iushrn(l3); l3-- > 0; ) + a3.isOdd() && a3.iadd(u3), a3.iushrn(1); + for (var d3 = 0, f3 = 1; 0 == (r3.words[0] & f3) && d3 < 26; ++d3, f3 <<= 1) + ; + if (d3 > 0) + for (r3.iushrn(d3); d3-- > 0; ) + s3.isOdd() && s3.iadd(u3), s3.iushrn(1); + t3.cmp(r3) >= 0 ? (t3.isub(r3), a3.isub(s3)) : (r3.isub(t3), s3.isub(a3)); + } + return (o3 = 0 === t3.cmpn(1) ? a3 : s3).cmpn(0) < 0 && o3.iadd(e4), o3; + }, i2.prototype.gcd = function(e4) { + if (this.isZero()) + return e4.abs(); + if (e4.isZero()) + return this.abs(); + var t3 = this.clone(), n3 = e4.clone(); + t3.negative = 0, n3.negative = 0; + for (var r3 = 0; t3.isEven() && n3.isEven(); r3++) + t3.iushrn(1), n3.iushrn(1); + for (; ; ) { + for (; t3.isEven(); ) + t3.iushrn(1); + for (; n3.isEven(); ) + n3.iushrn(1); + var i3 = t3.cmp(n3); + if (i3 < 0) { + var o3 = t3; + t3 = n3, n3 = o3; + } else if (0 === i3 || 0 === n3.cmpn(1)) + break; + t3.isub(n3); + } + return n3.iushln(r3); + }, i2.prototype.invm = function(e4) { + return this.egcd(e4).a.umod(e4); + }, i2.prototype.isEven = function() { + return 0 == (1 & this.words[0]); + }, i2.prototype.isOdd = function() { + return 1 == (1 & this.words[0]); + }, i2.prototype.andln = function(e4) { + return this.words[0] & e4; + }, i2.prototype.bincn = function(e4) { + n2("number" == typeof e4); + var t3 = e4 % 26, r3 = (e4 - t3) / 26, i3 = 1 << t3; + if (this.length <= r3) + return this._expand(r3 + 1), this.words[r3] |= i3, this; + for (var o3 = i3, a3 = r3; 0 !== o3 && a3 < this.length; a3++) { + var s3 = 0 | this.words[a3]; + o3 = (s3 += o3) >>> 26, s3 &= 67108863, this.words[a3] = s3; + } + return 0 !== o3 && (this.words[a3] = o3, this.length++), this; + }, i2.prototype.isZero = function() { + return 1 === this.length && 0 === this.words[0]; + }, i2.prototype.cmpn = function(e4) { + var t3, r3 = e4 < 0; + if (0 !== this.negative && !r3) + return -1; + if (0 === this.negative && r3) + return 1; + if (this._strip(), this.length > 1) + t3 = 1; + else { + r3 && (e4 = -e4), n2(e4 <= 67108863, "Number is too big"); + var i3 = 0 | this.words[0]; + t3 = i3 === e4 ? 0 : i3 < e4 ? -1 : 1; + } + return 0 !== this.negative ? 0 | -t3 : t3; + }, i2.prototype.cmp = function(e4) { + if (0 !== this.negative && 0 === e4.negative) + return -1; + if (0 === this.negative && 0 !== e4.negative) + return 1; + var t3 = this.ucmp(e4); + return 0 !== this.negative ? 0 | -t3 : t3; + }, i2.prototype.ucmp = function(e4) { + if (this.length > e4.length) + return 1; + if (this.length < e4.length) + return -1; + for (var t3 = 0, n3 = this.length - 1; n3 >= 0; n3--) { + var r3 = 0 | this.words[n3], i3 = 0 | e4.words[n3]; + if (r3 !== i3) { + r3 < i3 ? t3 = -1 : r3 > i3 && (t3 = 1); + break; + } + } + return t3; + }, i2.prototype.gtn = function(e4) { + return 1 === this.cmpn(e4); + }, i2.prototype.gt = function(e4) { + return 1 === this.cmp(e4); + }, i2.prototype.gten = function(e4) { + return this.cmpn(e4) >= 0; + }, i2.prototype.gte = function(e4) { + return this.cmp(e4) >= 0; + }, i2.prototype.ltn = function(e4) { + return -1 === this.cmpn(e4); + }, i2.prototype.lt = function(e4) { + return -1 === this.cmp(e4); + }, i2.prototype.lten = function(e4) { + return this.cmpn(e4) <= 0; + }, i2.prototype.lte = function(e4) { + return this.cmp(e4) <= 0; + }, i2.prototype.eqn = function(e4) { + return 0 === this.cmpn(e4); + }, i2.prototype.eq = function(e4) { + return 0 === this.cmp(e4); + }, i2.red = function(e4) { + return new k2(e4); + }, i2.prototype.toRed = function(e4) { + return n2(!this.red, "Already a number in reduction context"), n2(0 === this.negative, "red works only with positives"), e4.convertTo(this)._forceRed(e4); + }, i2.prototype.fromRed = function() { + return n2(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this); + }, i2.prototype._forceRed = function(e4) { + return this.red = e4, this; + }, i2.prototype.forceRed = function(e4) { + return n2(!this.red, "Already a number in reduction context"), this._forceRed(e4); + }, i2.prototype.redAdd = function(e4) { + return n2(this.red, "redAdd works only with red numbers"), this.red.add(this, e4); + }, i2.prototype.redIAdd = function(e4) { + return n2(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, e4); + }, i2.prototype.redSub = function(e4) { + return n2(this.red, "redSub works only with red numbers"), this.red.sub(this, e4); + }, i2.prototype.redISub = function(e4) { + return n2(this.red, "redISub works only with red numbers"), this.red.isub(this, e4); + }, i2.prototype.redShl = function(e4) { + return n2(this.red, "redShl works only with red numbers"), this.red.shl(this, e4); + }, i2.prototype.redMul = function(e4) { + return n2(this.red, "redMul works only with red numbers"), this.red._verify2(this, e4), this.red.mul(this, e4); + }, i2.prototype.redIMul = function(e4) { + return n2(this.red, "redMul works only with red numbers"), this.red._verify2(this, e4), this.red.imul(this, e4); + }, i2.prototype.redSqr = function() { + return n2(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this); + }, i2.prototype.redISqr = function() { + return n2(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this); + }, i2.prototype.redSqrt = function() { + return n2(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this); + }, i2.prototype.redInvm = function() { + return n2(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this); + }, i2.prototype.redNeg = function() { + return n2(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this); + }, i2.prototype.redPow = function(e4) { + return n2(this.red && !e4.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, e4); + }; + var b2 = { k256: null, p224: null, p192: null, p25519: null }; + function y2(e4, t3) { + this.name = e4, this.p = new i2(t3, 16), this.n = this.p.bitLength(), this.k = new i2(1).iushln(this.n).isub(this.p), this.tmp = this._tmp(); + } + function w2() { + y2.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + function _2() { + y2.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + function S2() { + y2.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + function E2() { + y2.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + function k2(e4) { + if ("string" == typeof e4) { + var t3 = i2._prime(e4); + this.m = t3.p, this.prime = t3; + } else + n2(e4.gtn(1), "modulus must be greater than 1"), this.m = e4, this.prime = null; + } + function M2(e4) { + k2.call(this, e4), this.shift = this.m.bitLength(), this.shift % 26 != 0 && (this.shift += 26 - this.shift % 26), this.r = new i2(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); + } + y2.prototype._tmp = function() { + var e4 = new i2(null); + return e4.words = new Array(Math.ceil(this.n / 13)), e4; + }, y2.prototype.ireduce = function(e4) { + var t3, n3 = e4; + do { + this.split(n3, this.tmp), t3 = (n3 = (n3 = this.imulK(n3)).iadd(this.tmp)).bitLength(); + } while (t3 > this.n); + var r3 = t3 < this.n ? -1 : n3.ucmp(this.p); + return 0 === r3 ? (n3.words[0] = 0, n3.length = 1) : r3 > 0 ? n3.isub(this.p) : void 0 !== n3.strip ? n3.strip() : n3._strip(), n3; + }, y2.prototype.split = function(e4, t3) { + e4.iushrn(this.n, 0, t3); + }, y2.prototype.imulK = function(e4) { + return e4.imul(this.k); + }, r2(w2, y2), w2.prototype.split = function(e4, t3) { + for (var n3 = 4194303, r3 = Math.min(e4.length, 9), i3 = 0; i3 < r3; i3++) + t3.words[i3] = e4.words[i3]; + if (t3.length = r3, e4.length <= 9) + return e4.words[0] = 0, void (e4.length = 1); + var o3 = e4.words[9]; + for (t3.words[t3.length++] = o3 & n3, i3 = 10; i3 < e4.length; i3++) { + var a3 = 0 | e4.words[i3]; + e4.words[i3 - 10] = (a3 & n3) << 4 | o3 >>> 22, o3 = a3; + } + o3 >>>= 22, e4.words[i3 - 10] = o3, 0 === o3 && e4.length > 10 ? e4.length -= 10 : e4.length -= 9; + }, w2.prototype.imulK = function(e4) { + e4.words[e4.length] = 0, e4.words[e4.length + 1] = 0, e4.length += 2; + for (var t3 = 0, n3 = 0; n3 < e4.length; n3++) { + var r3 = 0 | e4.words[n3]; + t3 += 977 * r3, e4.words[n3] = 67108863 & t3, t3 = 64 * r3 + (t3 / 67108864 | 0); + } + return 0 === e4.words[e4.length - 1] && (e4.length--, 0 === e4.words[e4.length - 1] && e4.length--), e4; + }, r2(_2, y2), r2(S2, y2), r2(E2, y2), E2.prototype.imulK = function(e4) { + for (var t3 = 0, n3 = 0; n3 < e4.length; n3++) { + var r3 = 19 * (0 | e4.words[n3]) + t3, i3 = 67108863 & r3; + r3 >>>= 26, e4.words[n3] = i3, t3 = r3; + } + return 0 !== t3 && (e4.words[e4.length++] = t3), e4; + }, i2._prime = function(e4) { + if (b2[e4]) + return b2[e4]; + var t3; + if ("k256" === e4) + t3 = new w2(); + else if ("p224" === e4) + t3 = new _2(); + else if ("p192" === e4) + t3 = new S2(); + else { + if ("p25519" !== e4) + throw new Error("Unknown prime " + e4); + t3 = new E2(); + } + return b2[e4] = t3, t3; + }, k2.prototype._verify1 = function(e4) { + n2(0 === e4.negative, "red works only with positives"), n2(e4.red, "red works only with red numbers"); + }, k2.prototype._verify2 = function(e4, t3) { + n2(0 == (e4.negative | t3.negative), "red works only with positives"), n2(e4.red && e4.red === t3.red, "red works only with red numbers"); + }, k2.prototype.imod = function(e4) { + return this.prime ? this.prime.ireduce(e4)._forceRed(this) : (l2(e4, e4.umod(this.m)._forceRed(this)), e4); + }, k2.prototype.neg = function(e4) { + return e4.isZero() ? e4.clone() : this.m.sub(e4)._forceRed(this); + }, k2.prototype.add = function(e4, t3) { + this._verify2(e4, t3); + var n3 = e4.add(t3); + return n3.cmp(this.m) >= 0 && n3.isub(this.m), n3._forceRed(this); + }, k2.prototype.iadd = function(e4, t3) { + this._verify2(e4, t3); + var n3 = e4.iadd(t3); + return n3.cmp(this.m) >= 0 && n3.isub(this.m), n3; + }, k2.prototype.sub = function(e4, t3) { + this._verify2(e4, t3); + var n3 = e4.sub(t3); + return n3.cmpn(0) < 0 && n3.iadd(this.m), n3._forceRed(this); + }, k2.prototype.isub = function(e4, t3) { + this._verify2(e4, t3); + var n3 = e4.isub(t3); + return n3.cmpn(0) < 0 && n3.iadd(this.m), n3; + }, k2.prototype.shl = function(e4, t3) { + return this._verify1(e4), this.imod(e4.ushln(t3)); + }, k2.prototype.imul = function(e4, t3) { + return this._verify2(e4, t3), this.imod(e4.imul(t3)); + }, k2.prototype.mul = function(e4, t3) { + return this._verify2(e4, t3), this.imod(e4.mul(t3)); + }, k2.prototype.isqr = function(e4) { + return this.imul(e4, e4.clone()); + }, k2.prototype.sqr = function(e4) { + return this.mul(e4, e4); + }, k2.prototype.sqrt = function(e4) { + if (e4.isZero()) + return e4.clone(); + var t3 = this.m.andln(3); + if (n2(t3 % 2 == 1), 3 === t3) { + var r3 = this.m.add(new i2(1)).iushrn(2); + return this.pow(e4, r3); + } + for (var o3 = this.m.subn(1), a3 = 0; !o3.isZero() && 0 === o3.andln(1); ) + a3++, o3.iushrn(1); + n2(!o3.isZero()); + var s3 = new i2(1).toRed(this), u3 = s3.redNeg(), l3 = this.m.subn(1).iushrn(1), c3 = this.m.bitLength(); + for (c3 = new i2(2 * c3 * c3).toRed(this); 0 !== this.pow(c3, l3).cmp(u3); ) + c3.redIAdd(u3); + for (var d3 = this.pow(c3, o3), f3 = this.pow(e4, o3.addn(1).iushrn(1)), h3 = this.pow(e4, o3), p3 = a3; 0 !== h3.cmp(s3); ) { + for (var m3 = h3, g3 = 0; 0 !== m3.cmp(s3); g3++) + m3 = m3.redSqr(); + n2(g3 < p3); + var v3 = this.pow(d3, new i2(1).iushln(p3 - g3 - 1)); + f3 = f3.redMul(v3), d3 = v3.redSqr(), h3 = h3.redMul(d3), p3 = g3; + } + return f3; + }, k2.prototype.invm = function(e4) { + var t3 = e4._invmp(this.m); + return 0 !== t3.negative ? (t3.negative = 0, this.imod(t3).redNeg()) : this.imod(t3); + }, k2.prototype.pow = function(e4, t3) { + if (t3.isZero()) + return new i2(1).toRed(this); + if (0 === t3.cmpn(1)) + return e4.clone(); + var n3 = new Array(16); + n3[0] = new i2(1).toRed(this), n3[1] = e4; + for (var r3 = 2; r3 < n3.length; r3++) + n3[r3] = this.mul(n3[r3 - 1], e4); + var o3 = n3[0], a3 = 0, s3 = 0, u3 = t3.bitLength() % 26; + for (0 === u3 && (u3 = 26), r3 = t3.length - 1; r3 >= 0; r3--) { + for (var l3 = t3.words[r3], c3 = u3 - 1; c3 >= 0; c3--) { + var d3 = l3 >> c3 & 1; + o3 !== n3[0] && (o3 = this.sqr(o3)), 0 !== d3 || 0 !== a3 ? (a3 <<= 1, a3 |= d3, (4 === ++s3 || 0 === r3 && 0 === c3) && (o3 = this.mul(o3, n3[a3]), s3 = 0, a3 = 0)) : s3 = 0; + } + u3 = 26; + } + return o3; + }, k2.prototype.convertTo = function(e4) { + var t3 = e4.umod(this.m); + return t3 === e4 ? t3.clone() : t3; + }, k2.prototype.convertFrom = function(e4) { + var t3 = e4.clone(); + return t3.red = null, t3; + }, i2.mont = function(e4) { + return new M2(e4); + }, r2(M2, k2), M2.prototype.convertTo = function(e4) { + return this.imod(e4.ushln(this.shift)); + }, M2.prototype.convertFrom = function(e4) { + var t3 = this.imod(e4.mul(this.rinv)); + return t3.red = null, t3; + }, M2.prototype.imul = function(e4, t3) { + if (e4.isZero() || t3.isZero()) + return e4.words[0] = 0, e4.length = 1, e4; + var n3 = e4.imul(t3), r3 = n3.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), i3 = n3.isub(r3).iushrn(this.shift), o3 = i3; + return i3.cmp(this.m) >= 0 ? o3 = i3.isub(this.m) : i3.cmpn(0) < 0 && (o3 = i3.iadd(this.m)), o3._forceRed(this); + }, M2.prototype.mul = function(e4, t3) { + if (e4.isZero() || t3.isZero()) + return new i2(0)._forceRed(this); + var n3 = e4.mul(t3), r3 = n3.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), o3 = n3.isub(r3).iushrn(this.shift), a3 = o3; + return o3.cmp(this.m) >= 0 ? a3 = o3.isub(this.m) : o3.cmpn(0) < 0 && (a3 = o3.iadd(this.m)), a3._forceRed(this); + }, M2.prototype.invm = function(e4) { + return this.imod(e4._invmp(this.m).mul(this.r2))._forceRed(this); + }; + }(e2, n); + }(th); + var nh, rh = th.exports, ih = {}, oh = {}, ah = {}, sh = {}, uh = ce, lh = uh.Buffer, ch = {}; + for (nh in uh) + uh.hasOwnProperty(nh) && "SlowBuffer" !== nh && "Buffer" !== nh && (ch[nh] = uh[nh]); + var dh = ch.Buffer = {}; + for (nh in lh) + lh.hasOwnProperty(nh) && "allocUnsafe" !== nh && "allocUnsafeSlow" !== nh && (dh[nh] = lh[nh]); + if (ch.Buffer.prototype = lh.prototype, dh.from && dh.from !== Uint8Array.from || (dh.from = function(e2, t2, n2) { + if ("number" == typeof e2) + throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof e2); + if (e2 && void 0 === e2.length) + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e2); + return lh(e2, t2, n2); + }), dh.alloc || (dh.alloc = function(e2, t2, n2) { + if ("number" != typeof e2) + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof e2); + if (e2 < 0 || e2 >= 2 * (1 << 30)) + throw new RangeError('The value "' + e2 + '" is invalid for option "size"'); + var r2 = lh(e2); + return t2 && 0 !== t2.length ? "string" == typeof n2 ? r2.fill(t2, n2) : r2.fill(t2) : r2.fill(0), r2; + }), !ch.kStringMaxLength) + try { + ch.kStringMaxLength = je.binding("buffer").kStringMaxLength; + } catch (a2) { + } + ch.constants || (ch.constants = { MAX_LENGTH: ch.kMaxLength }, ch.kStringMaxLength && (ch.constants.MAX_STRING_LENGTH = ch.kStringMaxLength)); + var fh = ch, hh = {}; + const ph = Ve; + function mh(e2) { + this._reporterState = { obj: null, path: [], options: e2 || {}, errors: [] }; + } + function gh(e2, t2) { + this.path = e2, this.rethrow(t2); + } + hh.Reporter = mh, mh.prototype.isError = function(e2) { + return e2 instanceof gh; + }, mh.prototype.save = function() { + const e2 = this._reporterState; + return { obj: e2.obj, pathLen: e2.path.length }; + }, mh.prototype.restore = function(e2) { + const t2 = this._reporterState; + t2.obj = e2.obj, t2.path = t2.path.slice(0, e2.pathLen); + }, mh.prototype.enterKey = function(e2) { + return this._reporterState.path.push(e2); + }, mh.prototype.exitKey = function(e2) { + const t2 = this._reporterState; + t2.path = t2.path.slice(0, e2 - 1); + }, mh.prototype.leaveKey = function(e2, t2, n2) { + const r2 = this._reporterState; + this.exitKey(e2), null !== r2.obj && (r2.obj[t2] = n2); + }, mh.prototype.path = function() { + return this._reporterState.path.join("/"); + }, mh.prototype.enterObject = function() { + const e2 = this._reporterState, t2 = e2.obj; + return e2.obj = {}, t2; + }, mh.prototype.leaveObject = function(e2) { + const t2 = this._reporterState, n2 = t2.obj; + return t2.obj = e2, n2; + }, mh.prototype.error = function(e2) { + let t2; + const n2 = this._reporterState, r2 = e2 instanceof gh; + if (t2 = r2 ? e2 : new gh(n2.path.map(function(e3) { + return "[" + JSON.stringify(e3) + "]"; + }).join(""), e2.message || e2, e2.stack), !n2.options.partial) + throw t2; + return r2 || n2.errors.push(t2), t2; + }, mh.prototype.wrapResult = function(e2) { + const t2 = this._reporterState; + return t2.options.partial ? { result: this.isError(e2) ? null : e2, errors: t2.errors } : e2; + }, ph(gh, Error), gh.prototype.rethrow = function(e2) { + if (this.message = e2 + " at: " + (this.path || "(shallow)"), Error.captureStackTrace && Error.captureStackTrace(this, gh), !this.stack) + try { + throw new Error(this.message); + } catch (e3) { + this.stack = e3.stack; + } + return this; + }; + var vh = {}; + const bh = Ve, yh = hh.Reporter, wh = fh.Buffer; + function _h(e2, t2) { + yh.call(this, t2), wh.isBuffer(e2) ? (this.base = e2, this.offset = 0, this.length = e2.length) : this.error("Input not Buffer"); + } + function Sh(e2, t2) { + if (Array.isArray(e2)) + this.length = 0, this.value = e2.map(function(e3) { + return Sh.isEncoderBuffer(e3) || (e3 = new Sh(e3, t2)), this.length += e3.length, e3; + }, this); + else if ("number" == typeof e2) { + if (!(0 <= e2 && e2 <= 255)) + return t2.error("non-byte EncoderBuffer value"); + this.value = e2, this.length = 1; + } else if ("string" == typeof e2) + this.value = e2, this.length = wh.byteLength(e2); + else { + if (!wh.isBuffer(e2)) + return t2.error("Unsupported type: " + typeof e2); + this.value = e2, this.length = e2.length; + } + } + bh(_h, yh), vh.DecoderBuffer = _h, _h.isDecoderBuffer = function(e2) { + if (e2 instanceof _h) + return true; + return "object" == typeof e2 && wh.isBuffer(e2.base) && "DecoderBuffer" === e2.constructor.name && "number" == typeof e2.offset && "number" == typeof e2.length && "function" == typeof e2.save && "function" == typeof e2.restore && "function" == typeof e2.isEmpty && "function" == typeof e2.readUInt8 && "function" == typeof e2.skip && "function" == typeof e2.raw; + }, _h.prototype.save = function() { + return { offset: this.offset, reporter: yh.prototype.save.call(this) }; + }, _h.prototype.restore = function(e2) { + const t2 = new _h(this.base); + return t2.offset = e2.offset, t2.length = this.offset, this.offset = e2.offset, yh.prototype.restore.call(this, e2.reporter), t2; + }, _h.prototype.isEmpty = function() { + return this.offset === this.length; + }, _h.prototype.readUInt8 = function(e2) { + return this.offset + 1 <= this.length ? this.base.readUInt8(this.offset++, true) : this.error(e2 || "DecoderBuffer overrun"); + }, _h.prototype.skip = function(e2, t2) { + if (!(this.offset + e2 <= this.length)) + return this.error(t2 || "DecoderBuffer overrun"); + const n2 = new _h(this.base); + return n2._reporterState = this._reporterState, n2.offset = this.offset, n2.length = this.offset + e2, this.offset += e2, n2; + }, _h.prototype.raw = function(e2) { + return this.base.slice(e2 ? e2.offset : this.offset, this.length); + }, vh.EncoderBuffer = Sh, Sh.isEncoderBuffer = function(e2) { + if (e2 instanceof Sh) + return true; + return "object" == typeof e2 && "EncoderBuffer" === e2.constructor.name && "number" == typeof e2.length && "function" == typeof e2.join; + }, Sh.prototype.join = function(e2, t2) { + return e2 || (e2 = wh.alloc(this.length)), t2 || (t2 = 0), 0 === this.length || (Array.isArray(this.value) ? this.value.forEach(function(n2) { + n2.join(e2, t2), t2 += n2.length; + }) : ("number" == typeof this.value ? e2[t2] = this.value : "string" == typeof this.value ? e2.write(this.value, t2) : wh.isBuffer(this.value) && this.value.copy(e2, t2), t2 += this.length)), e2; + }; + const Eh = hh.Reporter, kh = vh.EncoderBuffer, Mh = vh.DecoderBuffer, Ch = Wa, xh = ["seq", "seqof", "set", "setof", "objid", "bool", "gentime", "utctime", "null_", "enum", "int", "objDesc", "bitstr", "bmpstr", "charstr", "genstr", "graphstr", "ia5str", "iso646str", "numstr", "octstr", "printstr", "t61str", "unistr", "utf8str", "videostr"], Ah = ["key", "obj", "use", "optional", "explicit", "implicit", "def", "choice", "any", "contains"].concat(xh); + function Rh(e2, t2, n2) { + const r2 = {}; + this._baseState = r2, r2.name = n2, r2.enc = e2, r2.parent = t2 || null, r2.children = null, r2.tag = null, r2.args = null, r2.reverseArgs = null, r2.choice = null, r2.optional = false, r2.any = false, r2.obj = false, r2.use = null, r2.useDecoder = null, r2.key = null, r2.default = null, r2.explicit = null, r2.implicit = null, r2.contains = null, r2.parent || (r2.children = [], this._wrap()); + } + var Th = Rh; + const Ph = ["enc", "parent", "children", "tag", "args", "reverseArgs", "choice", "optional", "any", "obj", "use", "alteredUse", "key", "default", "explicit", "implicit", "contains"]; + Rh.prototype.clone = function() { + const e2 = this._baseState, t2 = {}; + Ph.forEach(function(n3) { + t2[n3] = e2[n3]; + }); + const n2 = new this.constructor(t2.parent); + return n2._baseState = t2, n2; + }, Rh.prototype._wrap = function() { + const e2 = this._baseState; + Ah.forEach(function(t2) { + this[t2] = function() { + const n2 = new this.constructor(this); + return e2.children.push(n2), n2[t2].apply(n2, arguments); + }; + }, this); + }, Rh.prototype._init = function(e2) { + const t2 = this._baseState; + Ch(null === t2.parent), e2.call(this), t2.children = t2.children.filter(function(e3) { + return e3._baseState.parent === this; + }, this), Ch.equal(t2.children.length, 1, "Root node can have only one child"); + }, Rh.prototype._useArgs = function(e2) { + const t2 = this._baseState, n2 = e2.filter(function(e3) { + return e3 instanceof this.constructor; + }, this); + e2 = e2.filter(function(e3) { + return !(e3 instanceof this.constructor); + }, this), 0 !== n2.length && (Ch(null === t2.children), t2.children = n2, n2.forEach(function(e3) { + e3._baseState.parent = this; + }, this)), 0 !== e2.length && (Ch(null === t2.args), t2.args = e2, t2.reverseArgs = e2.map(function(e3) { + if ("object" != typeof e3 || e3.constructor !== Object) + return e3; + const t3 = {}; + return Object.keys(e3).forEach(function(n3) { + n3 == (0 | n3) && (n3 |= 0); + const r2 = e3[n3]; + t3[r2] = n3; + }), t3; + })); + }, ["_peekTag", "_decodeTag", "_use", "_decodeStr", "_decodeObjid", "_decodeTime", "_decodeNull", "_decodeInt", "_decodeBool", "_decodeList", "_encodeComposite", "_encodeStr", "_encodeObjid", "_encodeTime", "_encodeNull", "_encodeInt", "_encodeBool"].forEach(function(e2) { + Rh.prototype[e2] = function() { + const t2 = this._baseState; + throw new Error(e2 + " not implemented for encoding: " + t2.enc); + }; + }), xh.forEach(function(e2) { + Rh.prototype[e2] = function() { + const t2 = this._baseState, n2 = Array.prototype.slice.call(arguments); + return Ch(null === t2.tag), t2.tag = e2, this._useArgs(n2), this; + }; + }), Rh.prototype.use = function(e2) { + Ch(e2); + const t2 = this._baseState; + return Ch(null === t2.use), t2.use = e2, this; + }, Rh.prototype.optional = function() { + return this._baseState.optional = true, this; + }, Rh.prototype.def = function(e2) { + const t2 = this._baseState; + return Ch(null === t2.default), t2.default = e2, t2.optional = true, this; + }, Rh.prototype.explicit = function(e2) { + const t2 = this._baseState; + return Ch(null === t2.explicit && null === t2.implicit), t2.explicit = e2, this; + }, Rh.prototype.implicit = function(e2) { + const t2 = this._baseState; + return Ch(null === t2.explicit && null === t2.implicit), t2.implicit = e2, this; + }, Rh.prototype.obj = function() { + const e2 = this._baseState, t2 = Array.prototype.slice.call(arguments); + return e2.obj = true, 0 !== t2.length && this._useArgs(t2), this; + }, Rh.prototype.key = function(e2) { + const t2 = this._baseState; + return Ch(null === t2.key), t2.key = e2, this; + }, Rh.prototype.any = function() { + return this._baseState.any = true, this; + }, Rh.prototype.choice = function(e2) { + const t2 = this._baseState; + return Ch(null === t2.choice), t2.choice = e2, this._useArgs(Object.keys(e2).map(function(t3) { + return e2[t3]; + })), this; + }, Rh.prototype.contains = function(e2) { + const t2 = this._baseState; + return Ch(null === t2.use), t2.contains = e2, this; + }, Rh.prototype._decode = function(e2, t2) { + const n2 = this._baseState; + if (null === n2.parent) + return e2.wrapResult(n2.children[0]._decode(e2, t2)); + let r2, i2 = n2.default, o2 = true, a2 = null; + if (null !== n2.key && (a2 = e2.enterKey(n2.key)), n2.optional) { + let r3 = null; + if (null !== n2.explicit ? r3 = n2.explicit : null !== n2.implicit ? r3 = n2.implicit : null !== n2.tag && (r3 = n2.tag), null !== r3 || n2.any) { + if (o2 = this._peekTag(e2, r3, n2.any), e2.isError(o2)) + return o2; + } else { + const r4 = e2.save(); + try { + null === n2.choice ? this._decodeGeneric(n2.tag, e2, t2) : this._decodeChoice(e2, t2), o2 = true; + } catch (e3) { + o2 = false; + } + e2.restore(r4); + } + } + if (n2.obj && o2 && (r2 = e2.enterObject()), o2) { + if (null !== n2.explicit) { + const t3 = this._decodeTag(e2, n2.explicit); + if (e2.isError(t3)) + return t3; + e2 = t3; + } + const r3 = e2.offset; + if (null === n2.use && null === n2.choice) { + let t3; + n2.any && (t3 = e2.save()); + const r4 = this._decodeTag(e2, null !== n2.implicit ? n2.implicit : n2.tag, n2.any); + if (e2.isError(r4)) + return r4; + n2.any ? i2 = e2.raw(t3) : e2 = r4; + } + if (t2 && t2.track && null !== n2.tag && t2.track(e2.path(), r3, e2.length, "tagged"), t2 && t2.track && null !== n2.tag && t2.track(e2.path(), e2.offset, e2.length, "content"), n2.any || (i2 = null === n2.choice ? this._decodeGeneric(n2.tag, e2, t2) : this._decodeChoice(e2, t2)), e2.isError(i2)) + return i2; + if (n2.any || null !== n2.choice || null === n2.children || n2.children.forEach(function(n3) { + n3._decode(e2, t2); + }), n2.contains && ("octstr" === n2.tag || "bitstr" === n2.tag)) { + const r4 = new Mh(i2); + i2 = this._getUse(n2.contains, e2._reporterState.obj)._decode(r4, t2); + } + } + return n2.obj && o2 && (i2 = e2.leaveObject(r2)), null === n2.key || null === i2 && true !== o2 ? null !== a2 && e2.exitKey(a2) : e2.leaveKey(a2, n2.key, i2), i2; + }, Rh.prototype._decodeGeneric = function(e2, t2, n2) { + const r2 = this._baseState; + return "seq" === e2 || "set" === e2 ? null : "seqof" === e2 || "setof" === e2 ? this._decodeList(t2, e2, r2.args[0], n2) : /str$/.test(e2) ? this._decodeStr(t2, e2, n2) : "objid" === e2 && r2.args ? this._decodeObjid(t2, r2.args[0], r2.args[1], n2) : "objid" === e2 ? this._decodeObjid(t2, null, null, n2) : "gentime" === e2 || "utctime" === e2 ? this._decodeTime(t2, e2, n2) : "null_" === e2 ? this._decodeNull(t2, n2) : "bool" === e2 ? this._decodeBool(t2, n2) : "objDesc" === e2 ? this._decodeStr(t2, e2, n2) : "int" === e2 || "enum" === e2 ? this._decodeInt(t2, r2.args && r2.args[0], n2) : null !== r2.use ? this._getUse(r2.use, t2._reporterState.obj)._decode(t2, n2) : t2.error("unknown tag: " + e2); + }, Rh.prototype._getUse = function(e2, t2) { + const n2 = this._baseState; + return n2.useDecoder = this._use(e2, t2), Ch(null === n2.useDecoder._baseState.parent), n2.useDecoder = n2.useDecoder._baseState.children[0], n2.implicit !== n2.useDecoder._baseState.implicit && (n2.useDecoder = n2.useDecoder.clone(), n2.useDecoder._baseState.implicit = n2.implicit), n2.useDecoder; + }, Rh.prototype._decodeChoice = function(e2, t2) { + const n2 = this._baseState; + let r2 = null, i2 = false; + return Object.keys(n2.choice).some(function(o2) { + const a2 = e2.save(), s2 = n2.choice[o2]; + try { + const n3 = s2._decode(e2, t2); + if (e2.isError(n3)) + return false; + r2 = { type: o2, value: n3 }, i2 = true; + } catch (t3) { + return e2.restore(a2), false; + } + return true; + }, this), i2 ? r2 : e2.error("Choice not matched"); + }, Rh.prototype._createEncoderBuffer = function(e2) { + return new kh(e2, this.reporter); + }, Rh.prototype._encode = function(e2, t2, n2) { + const r2 = this._baseState; + if (null !== r2.default && r2.default === e2) + return; + const i2 = this._encodeValue(e2, t2, n2); + return void 0 === i2 || this._skipDefault(i2, t2, n2) ? void 0 : i2; + }, Rh.prototype._encodeValue = function(e2, t2, n2) { + const r2 = this._baseState; + if (null === r2.parent) + return r2.children[0]._encode(e2, t2 || new Eh()); + let i2 = null; + if (this.reporter = t2, r2.optional && void 0 === e2) { + if (null === r2.default) + return; + e2 = r2.default; + } + let o2 = null, a2 = false; + if (r2.any) + i2 = this._createEncoderBuffer(e2); + else if (r2.choice) + i2 = this._encodeChoice(e2, t2); + else if (r2.contains) + o2 = this._getUse(r2.contains, n2)._encode(e2, t2), a2 = true; + else if (r2.children) + o2 = r2.children.map(function(n3) { + if ("null_" === n3._baseState.tag) + return n3._encode(null, t2, e2); + if (null === n3._baseState.key) + return t2.error("Child should have a key"); + const r3 = t2.enterKey(n3._baseState.key); + if ("object" != typeof e2) + return t2.error("Child expected, but input is not object"); + const i3 = n3._encode(e2[n3._baseState.key], t2, e2); + return t2.leaveKey(r3), i3; + }, this).filter(function(e3) { + return e3; + }), o2 = this._createEncoderBuffer(o2); + else if ("seqof" === r2.tag || "setof" === r2.tag) { + if (!r2.args || 1 !== r2.args.length) + return t2.error("Too many args for : " + r2.tag); + if (!Array.isArray(e2)) + return t2.error("seqof/setof, but data is not Array"); + const n3 = this.clone(); + n3._baseState.implicit = null, o2 = this._createEncoderBuffer(e2.map(function(n4) { + const r3 = this._baseState; + return this._getUse(r3.args[0], e2)._encode(n4, t2); + }, n3)); + } else + null !== r2.use ? i2 = this._getUse(r2.use, n2)._encode(e2, t2) : (o2 = this._encodePrimitive(r2.tag, e2), a2 = true); + if (!r2.any && null === r2.choice) { + const e3 = null !== r2.implicit ? r2.implicit : r2.tag, n3 = null === r2.implicit ? "universal" : "context"; + null === e3 ? null === r2.use && t2.error("Tag could be omitted only for .use()") : null === r2.use && (i2 = this._encodeComposite(e3, a2, n3, o2)); + } + return null !== r2.explicit && (i2 = this._encodeComposite(r2.explicit, false, "context", i2)), i2; + }, Rh.prototype._encodeChoice = function(e2, t2) { + const n2 = this._baseState, r2 = n2.choice[e2.type]; + return r2 || Ch(false, e2.type + " not found in " + JSON.stringify(Object.keys(n2.choice))), r2._encode(e2.value, t2); + }, Rh.prototype._encodePrimitive = function(e2, t2) { + const n2 = this._baseState; + if (/str$/.test(e2)) + return this._encodeStr(t2, e2); + if ("objid" === e2 && n2.args) + return this._encodeObjid(t2, n2.reverseArgs[0], n2.args[1]); + if ("objid" === e2) + return this._encodeObjid(t2, null, null); + if ("gentime" === e2 || "utctime" === e2) + return this._encodeTime(t2, e2); + if ("null_" === e2) + return this._encodeNull(); + if ("int" === e2 || "enum" === e2) + return this._encodeInt(t2, n2.args && n2.reverseArgs[0]); + if ("bool" === e2) + return this._encodeBool(t2); + if ("objDesc" === e2) + return this._encodeStr(t2, e2); + throw new Error("Unsupported tag: " + e2); + }, Rh.prototype._isNumstr = function(e2) { + return /^[0-9 ]*$/.test(e2); + }, Rh.prototype._isPrintstr = function(e2) { + return /^[A-Za-z0-9 '()+,-./:=?]*$/.test(e2); + }; + var Lh = {}; + !function(e2) { + function t2(e3) { + const t3 = {}; + return Object.keys(e3).forEach(function(n2) { + (0 | n2) == n2 && (n2 |= 0); + const r2 = e3[n2]; + t3[r2] = n2; + }), t3; + } + e2.tagClass = { 0: "universal", 1: "application", 2: "context", 3: "private" }, e2.tagClassByName = t2(e2.tagClass), e2.tag = { 0: "end", 1: "bool", 2: "int", 3: "bitstr", 4: "octstr", 5: "null_", 6: "objid", 7: "objDesc", 8: "external", 9: "real", 10: "enum", 11: "embed", 12: "utf8str", 13: "relativeOid", 16: "seq", 17: "set", 18: "numstr", 19: "printstr", 20: "t61str", 21: "videostr", 22: "ia5str", 23: "utctime", 24: "gentime", 25: "graphstr", 26: "iso646str", 27: "genstr", 28: "unistr", 29: "charstr", 30: "bmpstr" }, e2.tagByName = t2(e2.tag); + }(Lh); + const Ih = Ve, Oh = fh.Buffer, Nh = Th, Dh = Lh; + function jh(e2) { + this.enc = "der", this.name = e2.name, this.entity = e2, this.tree = new zh(), this.tree._init(e2.body); + } + var Bh = jh; + function zh(e2) { + Nh.call(this, "der", e2); + } + function Uh(e2) { + return e2 < 10 ? "0" + e2 : e2; + } + jh.prototype.encode = function(e2, t2) { + return this.tree._encode(e2, t2).join(); + }, Ih(zh, Nh), zh.prototype._encodeComposite = function(e2, t2, n2, r2) { + const i2 = function(e3, t3, n3, r3) { + let i3; + "seqof" === e3 ? e3 = "seq" : "setof" === e3 && (e3 = "set"); + if (Dh.tagByName.hasOwnProperty(e3)) + i3 = Dh.tagByName[e3]; + else { + if ("number" != typeof e3 || (0 | e3) !== e3) + return r3.error("Unknown tag: " + e3); + i3 = e3; + } + if (i3 >= 31) + return r3.error("Multi-octet tag encoding unsupported"); + t3 || (i3 |= 32); + return i3 |= Dh.tagClassByName[n3 || "universal"] << 6, i3; + }(e2, t2, n2, this.reporter); + if (r2.length < 128) { + const e3 = Oh.alloc(2); + return e3[0] = i2, e3[1] = r2.length, this._createEncoderBuffer([e3, r2]); + } + let o2 = 1; + for (let e3 = r2.length; e3 >= 256; e3 >>= 8) + o2++; + const a2 = Oh.alloc(2 + o2); + a2[0] = i2, a2[1] = 128 | o2; + for (let e3 = 1 + o2, t3 = r2.length; t3 > 0; e3--, t3 >>= 8) + a2[e3] = 255 & t3; + return this._createEncoderBuffer([a2, r2]); + }, zh.prototype._encodeStr = function(e2, t2) { + if ("bitstr" === t2) + return this._createEncoderBuffer([0 | e2.unused, e2.data]); + if ("bmpstr" === t2) { + const t3 = Oh.alloc(2 * e2.length); + for (let n2 = 0; n2 < e2.length; n2++) + t3.writeUInt16BE(e2.charCodeAt(n2), 2 * n2); + return this._createEncoderBuffer(t3); + } + return "numstr" === t2 ? this._isNumstr(e2) ? this._createEncoderBuffer(e2) : this.reporter.error("Encoding of string type: numstr supports only digits and space") : "printstr" === t2 ? this._isPrintstr(e2) ? this._createEncoderBuffer(e2) : this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark") : /str$/.test(t2) || "objDesc" === t2 ? this._createEncoderBuffer(e2) : this.reporter.error("Encoding of string type: " + t2 + " unsupported"); + }, zh.prototype._encodeObjid = function(e2, t2, n2) { + if ("string" == typeof e2) { + if (!t2) + return this.reporter.error("string objid given, but no values map found"); + if (!t2.hasOwnProperty(e2)) + return this.reporter.error("objid not found in values map"); + e2 = t2[e2].split(/[\s.]+/g); + for (let t3 = 0; t3 < e2.length; t3++) + e2[t3] |= 0; + } else if (Array.isArray(e2)) { + e2 = e2.slice(); + for (let t3 = 0; t3 < e2.length; t3++) + e2[t3] |= 0; + } + if (!Array.isArray(e2)) + return this.reporter.error("objid() should be either array or string, got: " + JSON.stringify(e2)); + if (!n2) { + if (e2[1] >= 40) + return this.reporter.error("Second objid identifier OOB"); + e2.splice(0, 2, 40 * e2[0] + e2[1]); + } + let r2 = 0; + for (let t3 = 0; t3 < e2.length; t3++) { + let n3 = e2[t3]; + for (r2++; n3 >= 128; n3 >>= 7) + r2++; + } + const i2 = Oh.alloc(r2); + let o2 = i2.length - 1; + for (let t3 = e2.length - 1; t3 >= 0; t3--) { + let n3 = e2[t3]; + for (i2[o2--] = 127 & n3; (n3 >>= 7) > 0; ) + i2[o2--] = 128 | 127 & n3; + } + return this._createEncoderBuffer(i2); + }, zh.prototype._encodeTime = function(e2, t2) { + let n2; + const r2 = new Date(e2); + return "gentime" === t2 ? n2 = [Uh(r2.getUTCFullYear()), Uh(r2.getUTCMonth() + 1), Uh(r2.getUTCDate()), Uh(r2.getUTCHours()), Uh(r2.getUTCMinutes()), Uh(r2.getUTCSeconds()), "Z"].join("") : "utctime" === t2 ? n2 = [Uh(r2.getUTCFullYear() % 100), Uh(r2.getUTCMonth() + 1), Uh(r2.getUTCDate()), Uh(r2.getUTCHours()), Uh(r2.getUTCMinutes()), Uh(r2.getUTCSeconds()), "Z"].join("") : this.reporter.error("Encoding " + t2 + " time is not supported yet"), this._encodeStr(n2, "octstr"); + }, zh.prototype._encodeNull = function() { + return this._createEncoderBuffer(""); + }, zh.prototype._encodeInt = function(e2, t2) { + if ("string" == typeof e2) { + if (!t2) + return this.reporter.error("String int or enum given, but no values map"); + if (!t2.hasOwnProperty(e2)) + return this.reporter.error("Values map doesn't contain: " + JSON.stringify(e2)); + e2 = t2[e2]; + } + if ("number" != typeof e2 && !Oh.isBuffer(e2)) { + const t3 = e2.toArray(); + !e2.sign && 128 & t3[0] && t3.unshift(0), e2 = Oh.from(t3); + } + if (Oh.isBuffer(e2)) { + let t3 = e2.length; + 0 === e2.length && t3++; + const n3 = Oh.alloc(t3); + return e2.copy(n3), 0 === e2.length && (n3[0] = 0), this._createEncoderBuffer(n3); + } + if (e2 < 128) + return this._createEncoderBuffer(e2); + if (e2 < 256) + return this._createEncoderBuffer([0, e2]); + let n2 = 1; + for (let t3 = e2; t3 >= 256; t3 >>= 8) + n2++; + const r2 = new Array(n2); + for (let t3 = r2.length - 1; t3 >= 0; t3--) + r2[t3] = 255 & e2, e2 >>= 8; + return 128 & r2[0] && r2.unshift(0), this._createEncoderBuffer(Oh.from(r2)); + }, zh.prototype._encodeBool = function(e2) { + return this._createEncoderBuffer(e2 ? 255 : 0); + }, zh.prototype._use = function(e2, t2) { + return "function" == typeof e2 && (e2 = e2(t2)), e2._getEncoder("der").tree; + }, zh.prototype._skipDefault = function(e2, t2, n2) { + const r2 = this._baseState; + let i2; + if (null === r2.default) + return false; + const o2 = e2.join(); + if (void 0 === r2.defaultBuffer && (r2.defaultBuffer = this._encodeValue(r2.default, t2, n2).join()), o2.length !== r2.defaultBuffer.length) + return false; + for (i2 = 0; i2 < o2.length; i2++) + if (o2[i2] !== r2.defaultBuffer[i2]) + return false; + return true; + }; + const Fh = Bh; + function Kh(e2) { + Fh.call(this, e2), this.enc = "pem"; + } + Ve(Kh, Fh); + var qh = Kh; + Kh.prototype.encode = function(e2, t2) { + const n2 = Fh.prototype.encode.call(this, e2).toString("base64"), r2 = ["-----BEGIN " + t2.label + "-----"]; + for (let e3 = 0; e3 < n2.length; e3 += 64) + r2.push(n2.slice(e3, e3 + 64)); + return r2.push("-----END " + t2.label + "-----"), r2.join("\n"); + }, function(e2) { + const t2 = e2; + t2.der = Bh, t2.pem = qh; + }(sh); + var Hh = {}; + const Wh = Ve, $h = hl, Vh = vh.DecoderBuffer, Yh = Th, Gh = Lh; + function Zh(e2) { + this.enc = "der", this.name = e2.name, this.entity = e2, this.tree = new Jh(), this.tree._init(e2.body); + } + var Qh = Zh; + function Jh(e2) { + Yh.call(this, "der", e2); + } + function Xh(e2, t2) { + let n2 = e2.readUInt8(t2); + if (e2.isError(n2)) + return n2; + const r2 = Gh.tagClass[n2 >> 6], i2 = 0 == (32 & n2); + if (31 == (31 & n2)) { + let r3 = n2; + for (n2 = 0; 128 == (128 & r3); ) { + if (r3 = e2.readUInt8(t2), e2.isError(r3)) + return r3; + n2 <<= 7, n2 |= 127 & r3; + } + } else + n2 &= 31; + return { cls: r2, primitive: i2, tag: n2, tagStr: Gh.tag[n2] }; + } + function ep(e2, t2, n2) { + let r2 = e2.readUInt8(n2); + if (e2.isError(r2)) + return r2; + if (!t2 && 128 === r2) + return null; + if (0 == (128 & r2)) + return r2; + const i2 = 127 & r2; + if (i2 > 4) + return e2.error("length octect is too long"); + r2 = 0; + for (let t3 = 0; t3 < i2; t3++) { + r2 <<= 8; + const t4 = e2.readUInt8(n2); + if (e2.isError(t4)) + return t4; + r2 |= t4; + } + return r2; + } + Zh.prototype.decode = function(e2, t2) { + return Vh.isDecoderBuffer(e2) || (e2 = new Vh(e2, t2)), this.tree._decode(e2, t2); + }, Wh(Jh, Yh), Jh.prototype._peekTag = function(e2, t2, n2) { + if (e2.isEmpty()) + return false; + const r2 = e2.save(), i2 = Xh(e2, 'Failed to peek tag: "' + t2 + '"'); + return e2.isError(i2) ? i2 : (e2.restore(r2), i2.tag === t2 || i2.tagStr === t2 || i2.tagStr + "of" === t2 || n2); + }, Jh.prototype._decodeTag = function(e2, t2, n2) { + const r2 = Xh(e2, 'Failed to decode tag of "' + t2 + '"'); + if (e2.isError(r2)) + return r2; + let i2 = ep(e2, r2.primitive, 'Failed to get length of "' + t2 + '"'); + if (e2.isError(i2)) + return i2; + if (!n2 && r2.tag !== t2 && r2.tagStr !== t2 && r2.tagStr + "of" !== t2) + return e2.error('Failed to match tag: "' + t2 + '"'); + if (r2.primitive || null !== i2) + return e2.skip(i2, 'Failed to match body of: "' + t2 + '"'); + const o2 = e2.save(), a2 = this._skipUntilEnd(e2, 'Failed to skip indefinite length body: "' + this.tag + '"'); + return e2.isError(a2) ? a2 : (i2 = e2.offset - o2.offset, e2.restore(o2), e2.skip(i2, 'Failed to match body of: "' + t2 + '"')); + }, Jh.prototype._skipUntilEnd = function(e2, t2) { + for (; ; ) { + const n2 = Xh(e2, t2); + if (e2.isError(n2)) + return n2; + const r2 = ep(e2, n2.primitive, t2); + if (e2.isError(r2)) + return r2; + let i2; + if (i2 = n2.primitive || null !== r2 ? e2.skip(r2) : this._skipUntilEnd(e2, t2), e2.isError(i2)) + return i2; + if ("end" === n2.tagStr) + break; + } + }, Jh.prototype._decodeList = function(e2, t2, n2, r2) { + const i2 = []; + for (; !e2.isEmpty(); ) { + const t3 = this._peekTag(e2, "end"); + if (e2.isError(t3)) + return t3; + const o2 = n2.decode(e2, "der", r2); + if (e2.isError(o2) && t3) + break; + i2.push(o2); + } + return i2; + }, Jh.prototype._decodeStr = function(e2, t2) { + if ("bitstr" === t2) { + const t3 = e2.readUInt8(); + return e2.isError(t3) ? t3 : { unused: t3, data: e2.raw() }; + } + if ("bmpstr" === t2) { + const t3 = e2.raw(); + if (t3.length % 2 == 1) + return e2.error("Decoding of string type: bmpstr length mismatch"); + let n2 = ""; + for (let e3 = 0; e3 < t3.length / 2; e3++) + n2 += String.fromCharCode(t3.readUInt16BE(2 * e3)); + return n2; + } + if ("numstr" === t2) { + const t3 = e2.raw().toString("ascii"); + return this._isNumstr(t3) ? t3 : e2.error("Decoding of string type: numstr unsupported characters"); + } + if ("octstr" === t2) + return e2.raw(); + if ("objDesc" === t2) + return e2.raw(); + if ("printstr" === t2) { + const t3 = e2.raw().toString("ascii"); + return this._isPrintstr(t3) ? t3 : e2.error("Decoding of string type: printstr unsupported characters"); + } + return /str$/.test(t2) ? e2.raw().toString() : e2.error("Decoding of string type: " + t2 + " unsupported"); + }, Jh.prototype._decodeObjid = function(e2, t2, n2) { + let r2; + const i2 = []; + let o2 = 0, a2 = 0; + for (; !e2.isEmpty(); ) + a2 = e2.readUInt8(), o2 <<= 7, o2 |= 127 & a2, 0 == (128 & a2) && (i2.push(o2), o2 = 0); + 128 & a2 && i2.push(o2); + const s2 = i2[0] / 40 | 0, u2 = i2[0] % 40; + if (r2 = n2 ? i2 : [s2, u2].concat(i2.slice(1)), t2) { + let e3 = t2[r2.join(" ")]; + void 0 === e3 && (e3 = t2[r2.join(".")]), void 0 !== e3 && (r2 = e3); + } + return r2; + }, Jh.prototype._decodeTime = function(e2, t2) { + const n2 = e2.raw().toString(); + let r2, i2, o2, a2, s2, u2; + if ("gentime" === t2) + r2 = 0 | n2.slice(0, 4), i2 = 0 | n2.slice(4, 6), o2 = 0 | n2.slice(6, 8), a2 = 0 | n2.slice(8, 10), s2 = 0 | n2.slice(10, 12), u2 = 0 | n2.slice(12, 14); + else { + if ("utctime" !== t2) + return e2.error("Decoding " + t2 + " time is not supported yet"); + r2 = 0 | n2.slice(0, 2), i2 = 0 | n2.slice(2, 4), o2 = 0 | n2.slice(4, 6), a2 = 0 | n2.slice(6, 8), s2 = 0 | n2.slice(8, 10), u2 = 0 | n2.slice(10, 12), r2 = r2 < 70 ? 2e3 + r2 : 1900 + r2; + } + return Date.UTC(r2, i2 - 1, o2, a2, s2, u2, 0); + }, Jh.prototype._decodeNull = function() { + return null; + }, Jh.prototype._decodeBool = function(e2) { + const t2 = e2.readUInt8(); + return e2.isError(t2) ? t2 : 0 !== t2; + }, Jh.prototype._decodeInt = function(e2, t2) { + const n2 = e2.raw(); + let r2 = new $h(n2); + return t2 && (r2 = t2[r2.toString(10)] || r2), r2; + }, Jh.prototype._use = function(e2, t2) { + return "function" == typeof e2 && (e2 = e2(t2)), e2._getDecoder("der").tree; + }; + const tp = Ve, np = fh.Buffer, rp = Qh; + function ip(e2) { + rp.call(this, e2), this.enc = "pem"; + } + tp(ip, rp); + var op = ip; + ip.prototype.decode = function(e2, t2) { + const n2 = e2.toString().split(/[\r\n]+/g), r2 = t2.label.toUpperCase(), i2 = /^-----(BEGIN|END) ([^-]+)-----$/; + let o2 = -1, a2 = -1; + for (let e3 = 0; e3 < n2.length; e3++) { + const t3 = n2[e3].match(i2); + if (null !== t3 && t3[2] === r2) { + if (-1 !== o2) { + if ("END" !== t3[1]) + break; + a2 = e3; + break; + } + if ("BEGIN" !== t3[1]) + break; + o2 = e3; + } + } + if (-1 === o2 || -1 === a2) + throw new Error("PEM section not found for: " + r2); + const s2 = n2.slice(o2 + 1, a2).join(""); + s2.replace(/[^a-z0-9+/=]+/gi, ""); + const u2 = np.from(s2, "base64"); + return rp.prototype.decode.call(this, u2, t2); + }, function(e2) { + const t2 = e2; + t2.der = Qh, t2.pem = op; + }(Hh), function(e2) { + const t2 = sh, n2 = Hh, r2 = Ve; + function i2(e3, t3) { + this.name = e3, this.body = t3, this.decoders = {}, this.encoders = {}; + } + e2.define = function(e3, t3) { + return new i2(e3, t3); + }, i2.prototype._createNamed = function(e3) { + const t3 = this.name; + function n3(e4) { + this._initNamed(e4, t3); + } + return r2(n3, e3), n3.prototype._initNamed = function(t4, n4) { + e3.call(this, t4, n4); + }, new n3(this); + }, i2.prototype._getDecoder = function(e3) { + return e3 = e3 || "der", this.decoders.hasOwnProperty(e3) || (this.decoders[e3] = this._createNamed(n2[e3])), this.decoders[e3]; + }, i2.prototype.decode = function(e3, t3, n3) { + return this._getDecoder(t3).decode(e3, n3); + }, i2.prototype._getEncoder = function(e3) { + return e3 = e3 || "der", this.encoders.hasOwnProperty(e3) || (this.encoders[e3] = this._createNamed(t2[e3])), this.encoders[e3]; + }, i2.prototype.encode = function(e3, t3, n3) { + return this._getEncoder(t3).encode(e3, n3); + }; + }(ah); + var ap = {}; + !function(e2) { + const t2 = e2; + t2.Reporter = hh.Reporter, t2.DecoderBuffer = vh.DecoderBuffer, t2.EncoderBuffer = vh.EncoderBuffer, t2.Node = Th; + }(ap); + var sp = {}; + !function(e2) { + const t2 = e2; + t2._reverse = function(e3) { + const t3 = {}; + return Object.keys(e3).forEach(function(n2) { + (0 | n2) == n2 && (n2 |= 0); + const r2 = e3[n2]; + t3[r2] = n2; + }), t3; + }, t2.der = Lh; + }(sp), function(e2) { + const t2 = e2; + t2.bignum = hl, t2.define = ah.define, t2.base = ap, t2.constants = sp, t2.decoders = Hh, t2.encoders = sh; + }(oh); + var up = oh, lp = up.define("Time", function() { + this.choice({ utcTime: this.utctime(), generalTime: this.gentime() }); + }), cp = up.define("AttributeTypeValue", function() { + this.seq().obj(this.key("type").objid(), this.key("value").any()); + }), dp = up.define("AlgorithmIdentifier", function() { + this.seq().obj(this.key("algorithm").objid(), this.key("parameters").optional(), this.key("curve").objid().optional()); + }), fp = up.define("SubjectPublicKeyInfo", function() { + this.seq().obj(this.key("algorithm").use(dp), this.key("subjectPublicKey").bitstr()); + }), hp = up.define("RelativeDistinguishedName", function() { + this.setof(cp); + }), pp = up.define("RDNSequence", function() { + this.seqof(hp); + }), mp = up.define("Name", function() { + this.choice({ rdnSequence: this.use(pp) }); + }), gp = up.define("Validity", function() { + this.seq().obj(this.key("notBefore").use(lp), this.key("notAfter").use(lp)); + }), vp = up.define("Extension", function() { + this.seq().obj(this.key("extnID").objid(), this.key("critical").bool().def(false), this.key("extnValue").octstr()); + }), bp = up.define("TBSCertificate", function() { + this.seq().obj(this.key("version").explicit(0).int().optional(), this.key("serialNumber").int(), this.key("signature").use(dp), this.key("issuer").use(mp), this.key("validity").use(gp), this.key("subject").use(mp), this.key("subjectPublicKeyInfo").use(fp), this.key("issuerUniqueID").implicit(1).bitstr().optional(), this.key("subjectUniqueID").implicit(2).bitstr().optional(), this.key("extensions").explicit(3).seqof(vp).optional()); + }), yp = up.define("X509Certificate", function() { + this.seq().obj(this.key("tbsCertificate").use(bp), this.key("signatureAlgorithm").use(dp), this.key("signatureValue").bitstr()); + }), wp = oh; + ih.certificate = yp; + var _p = wp.define("RSAPrivateKey", function() { + this.seq().obj(this.key("version").int(), this.key("modulus").int(), this.key("publicExponent").int(), this.key("privateExponent").int(), this.key("prime1").int(), this.key("prime2").int(), this.key("exponent1").int(), this.key("exponent2").int(), this.key("coefficient").int()); + }); + ih.RSAPrivateKey = _p; + var Sp = wp.define("RSAPublicKey", function() { + this.seq().obj(this.key("modulus").int(), this.key("publicExponent").int()); + }); + ih.RSAPublicKey = Sp; + var Ep = wp.define("SubjectPublicKeyInfo", function() { + this.seq().obj(this.key("algorithm").use(kp), this.key("subjectPublicKey").bitstr()); + }); + ih.PublicKey = Ep; + var kp = wp.define("AlgorithmIdentifier", function() { + this.seq().obj(this.key("algorithm").objid(), this.key("none").null_().optional(), this.key("curve").objid().optional(), this.key("params").seq().obj(this.key("p").int(), this.key("q").int(), this.key("g").int()).optional()); + }), Mp = wp.define("PrivateKeyInfo", function() { + this.seq().obj(this.key("version").int(), this.key("algorithm").use(kp), this.key("subjectPrivateKey").octstr()); + }); + ih.PrivateKey = Mp; + var Cp = wp.define("EncryptedPrivateKeyInfo", function() { + this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(), this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(), this.key("kdeparams").seq().obj(this.key("salt").octstr(), this.key("iters").int())), this.key("cipher").seq().obj(this.key("algo").objid(), this.key("iv").octstr()))), this.key("subjectPrivateKey").octstr()); + }); + ih.EncryptedPrivateKey = Cp; + var xp = wp.define("DSAPrivateKey", function() { + this.seq().obj(this.key("version").int(), this.key("p").int(), this.key("q").int(), this.key("g").int(), this.key("pub_key").int(), this.key("priv_key").int()); + }); + ih.DSAPrivateKey = xp, ih.DSAparam = wp.define("DSAparam", function() { + this.int(); + }); + var Ap = wp.define("ECPrivateKey", function() { + this.seq().obj(this.key("version").int(), this.key("privateKey").octstr(), this.key("parameters").optional().explicit(0).use(Rp), this.key("publicKey").optional().explicit(1).bitstr()); + }); + ih.ECPrivateKey = Ap; + var Rp = wp.define("ECParameters", function() { + this.choice({ namedCurve: this.objid() }); + }); + ih.signature = wp.define("signature", function() { + this.seq().obj(this.key("r").int(), this.key("s").int()); + }); + var Tp = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m, Pp = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m, Lp = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m, Ip = Cu, Op = _s, Np = Ue().Buffer, Dp = ih, jp = { "2.16.840.1.101.3.4.1.1": "aes-128-ecb", "2.16.840.1.101.3.4.1.2": "aes-128-cbc", "2.16.840.1.101.3.4.1.3": "aes-128-ofb", "2.16.840.1.101.3.4.1.4": "aes-128-cfb", "2.16.840.1.101.3.4.1.21": "aes-192-ecb", "2.16.840.1.101.3.4.1.22": "aes-192-cbc", "2.16.840.1.101.3.4.1.23": "aes-192-ofb", "2.16.840.1.101.3.4.1.24": "aes-192-cfb", "2.16.840.1.101.3.4.1.41": "aes-256-ecb", "2.16.840.1.101.3.4.1.42": "aes-256-cbc", "2.16.840.1.101.3.4.1.43": "aes-256-ofb", "2.16.840.1.101.3.4.1.44": "aes-256-cfb" }, Bp = function(e2, t2) { + var n2, r2 = e2.toString(), i2 = r2.match(Tp); + if (i2) { + var o2 = "aes" + i2[1], a2 = Np.from(i2[2], "hex"), s2 = Np.from(i2[3].replace(/[\r\n]/g, ""), "base64"), u2 = Ip(t2, a2.slice(0, 8), parseInt(i2[1], 10)).key, l2 = [], c2 = Op.createDecipheriv(o2, u2, a2); + l2.push(c2.update(s2)), l2.push(c2.final()), n2 = Np.concat(l2); + } else { + var d2 = r2.match(Lp); + n2 = Np.from(d2[2].replace(/[\r\n]/g, ""), "base64"); + } + return { tag: r2.match(Pp)[1], data: n2 }; + }, zp = _s, Up = ca, Fp = Ue().Buffer, Kp = qp; + function qp(e2) { + var t2; + "object" != typeof e2 || Fp.isBuffer(e2) || (t2 = e2.passphrase, e2 = e2.key), "string" == typeof e2 && (e2 = Fp.from(e2)); + var n2, r2, i2 = Bp(e2, t2), o2 = i2.tag, a2 = i2.data; + switch (o2) { + case "CERTIFICATE": + r2 = Dp.certificate.decode(a2, "der").tbsCertificate.subjectPublicKeyInfo; + case "PUBLIC KEY": + switch (r2 || (r2 = Dp.PublicKey.decode(a2, "der")), n2 = r2.algorithm.algorithm.join(".")) { + case "1.2.840.113549.1.1.1": + return Dp.RSAPublicKey.decode(r2.subjectPublicKey.data, "der"); + case "1.2.840.10045.2.1": + return r2.subjectPrivateKey = r2.subjectPublicKey, { type: "ec", data: r2 }; + case "1.2.840.10040.4.1": + return r2.algorithm.params.pub_key = Dp.DSAparam.decode(r2.subjectPublicKey.data, "der"), { type: "dsa", data: r2.algorithm.params }; + default: + throw new Error("unknown key id " + n2); + } + case "ENCRYPTED PRIVATE KEY": + a2 = function(e3, t3) { + var n3 = e3.algorithm.decrypt.kde.kdeparams.salt, r3 = parseInt(e3.algorithm.decrypt.kde.kdeparams.iters.toString(), 10), i3 = jp[e3.algorithm.decrypt.cipher.algo.join(".")], o3 = e3.algorithm.decrypt.cipher.iv, a3 = e3.subjectPrivateKey, s2 = parseInt(i3.split("-")[1], 10) / 8, u2 = Up.pbkdf2Sync(t3, n3, r3, s2, "sha1"), l2 = zp.createDecipheriv(i3, u2, o3), c2 = []; + return c2.push(l2.update(a3)), c2.push(l2.final()), Fp.concat(c2); + }(a2 = Dp.EncryptedPrivateKey.decode(a2, "der"), t2); + case "PRIVATE KEY": + switch (n2 = (r2 = Dp.PrivateKey.decode(a2, "der")).algorithm.algorithm.join(".")) { + case "1.2.840.113549.1.1.1": + return Dp.RSAPrivateKey.decode(r2.subjectPrivateKey, "der"); + case "1.2.840.10045.2.1": + return { curve: r2.algorithm.curve, privateKey: Dp.ECPrivateKey.decode(r2.subjectPrivateKey, "der").privateKey }; + case "1.2.840.10040.4.1": + return r2.algorithm.params.priv_key = Dp.DSAparam.decode(r2.subjectPrivateKey, "der"), { type: "dsa", params: r2.algorithm.params }; + default: + throw new Error("unknown key id " + n2); + } + case "RSA PUBLIC KEY": + return Dp.RSAPublicKey.decode(a2, "der"); + case "RSA PRIVATE KEY": + return Dp.RSAPrivateKey.decode(a2, "der"); + case "DSA PRIVATE KEY": + return { type: "dsa", params: Dp.DSAPrivateKey.decode(a2, "der") }; + case "EC PRIVATE KEY": + return { curve: (a2 = Dp.ECPrivateKey.decode(a2, "der")).parameters.value, privateKey: a2.privateKey }; + default: + throw new Error("unknown key type " + o2); + } + } + qp.signature = Dp.signature; + var Hp, Wp, $p, Vp, Yp, Gp, Zp, Qp = { "1.3.132.0.10": "secp256k1", "1.3.132.0.33": "p224", "1.2.840.10045.3.1.1": "p192", "1.2.840.10045.3.1.7": "p256", "1.3.132.0.34": "p384", "1.3.132.0.35": "p521" }; + function Jp() { + if (Hp) + return El.exports; + Hp = 1; + var e2 = Ue().Buffer, t2 = sa, n2 = Rl, r2 = eh().ec, i2 = rh, o2 = Kp, a2 = Qp; + function s2(n3, r3, i3, o3) { + if ((n3 = e2.from(n3.toArray())).length < r3.byteLength()) { + var a3 = e2.alloc(r3.byteLength() - n3.length); + n3 = e2.concat([a3, n3]); + } + var s3 = i3.length, l3 = function(t3, n4) { + t3 = u2(t3, n4), t3 = t3.mod(n4); + var r4 = e2.from(t3.toArray()); + if (r4.length < n4.byteLength()) { + var i4 = e2.alloc(n4.byteLength() - r4.length); + r4 = e2.concat([i4, r4]); + } + return r4; + }(i3, r3), c3 = e2.alloc(s3); + c3.fill(1); + var d2 = e2.alloc(s3); + return d2 = t2(o3, d2).update(c3).update(e2.from([0])).update(n3).update(l3).digest(), c3 = t2(o3, d2).update(c3).digest(), { k: d2 = t2(o3, d2).update(c3).update(e2.from([1])).update(n3).update(l3).digest(), v: c3 = t2(o3, d2).update(c3).digest() }; + } + function u2(e3, t3) { + var n3 = new i2(e3), r3 = (e3.length << 3) - t3.bitLength(); + return r3 > 0 && n3.ishrn(r3), n3; + } + function l2(n3, r3, i3) { + var o3, a3; + do { + for (o3 = e2.alloc(0); 8 * o3.length < n3.bitLength(); ) + r3.v = t2(i3, r3.k).update(r3.v).digest(), o3 = e2.concat([o3, r3.v]); + a3 = u2(o3, n3), r3.k = t2(i3, r3.k).update(r3.v).update(e2.from([0])).digest(), r3.v = t2(i3, r3.k).update(r3.v).digest(); + } while (-1 !== a3.cmp(n3)); + return a3; + } + function c2(e3, t3, n3, r3) { + return e3.toRed(i2.mont(n3)).redPow(t3).fromRed().mod(r3); + } + return El.exports = function(t3, d2, f2, h2, p2) { + var m2 = o2(d2); + if (m2.curve) { + if ("ecdsa" !== h2 && "ecdsa/rsa" !== h2) + throw new Error("wrong private key type"); + return function(t4, n3) { + var i3 = a2[n3.curve.join(".")]; + if (!i3) + throw new Error("unknown curve " + n3.curve.join(".")); + var o3 = new r2(i3), s3 = o3.keyFromPrivate(n3.privateKey), u3 = s3.sign(t4); + return e2.from(u3.toDER()); + }(t3, m2); + } + if ("dsa" === m2.type) { + if ("dsa" !== h2) + throw new Error("wrong private key type"); + return function(t4, n3, r3) { + var o3, a3 = n3.params.priv_key, d3 = n3.params.p, f3 = n3.params.q, h3 = n3.params.g, p3 = new i2(0), m3 = u2(t4, f3).mod(f3), g3 = false, v3 = s2(a3, f3, t4, r3); + for (; false === g3; ) + p3 = c2(h3, o3 = l2(f3, v3, r3), d3, f3), 0 === (g3 = o3.invm(f3).imul(m3.add(a3.mul(p3))).mod(f3)).cmpn(0) && (g3 = false, p3 = new i2(0)); + return function(t5, n4) { + t5 = t5.toArray(), n4 = n4.toArray(), 128 & t5[0] && (t5 = [0].concat(t5)); + 128 & n4[0] && (n4 = [0].concat(n4)); + var r4 = t5.length + n4.length + 4, i3 = [48, r4, 2, t5.length]; + return i3 = i3.concat(t5, [2, n4.length], n4), e2.from(i3); + }(p3, g3); + }(t3, m2, f2); + } + if ("rsa" !== h2 && "ecdsa/rsa" !== h2) + throw new Error("wrong private key type"); + t3 = e2.concat([p2, t3]); + for (var g2 = m2.modulus.byteLength(), v2 = [0, 1]; t3.length + v2.length + 1 < g2; ) + v2.push(255); + v2.push(0); + for (var b2 = -1; ++b2 < t3.length; ) + v2.push(t3[b2]); + return n2(v2, m2); + }, El.exports.getKey = s2, El.exports.makeKey = l2, El.exports; + } + function Xp() { + if ($p) + return Wp; + $p = 1; + var e2 = Ue().Buffer, t2 = rh, n2 = eh().ec, r2 = Kp, i2 = Qp; + function o2(e3, t3) { + if (e3.cmpn(0) <= 0) + throw new Error("invalid sig"); + if (e3.cmp(t3) >= t3) + throw new Error("invalid sig"); + } + return Wp = function(a2, s2, u2, l2, c2) { + var d2 = r2(u2); + if ("ec" === d2.type) { + if ("ecdsa" !== l2 && "ecdsa/rsa" !== l2) + throw new Error("wrong public key type"); + return function(e3, t3, r3) { + var o3 = i2[r3.data.algorithm.curve.join(".")]; + if (!o3) + throw new Error("unknown curve " + r3.data.algorithm.curve.join(".")); + var a3 = new n2(o3), s3 = r3.data.subjectPrivateKey.data; + return a3.verify(t3, e3, s3); + }(a2, s2, d2); + } + if ("dsa" === d2.type) { + if ("dsa" !== l2) + throw new Error("wrong public key type"); + return function(e3, n3, i3) { + var a3 = i3.data.p, s3 = i3.data.q, u3 = i3.data.g, l3 = i3.data.pub_key, c3 = r2.signature.decode(e3, "der"), d3 = c3.s, f3 = c3.r; + o2(d3, s3), o2(f3, s3); + var h3 = t2.mont(a3), p3 = d3.invm(s3), m3 = u3.toRed(h3).redPow(new t2(n3).mul(p3).mod(s3)).fromRed().mul(l3.toRed(h3).redPow(f3.mul(p3).mod(s3)).fromRed()).mod(a3).mod(s3); + return 0 === m3.cmp(f3); + }(a2, s2, d2); + } + if ("rsa" !== l2 && "ecdsa/rsa" !== l2) + throw new Error("wrong public key type"); + s2 = e2.concat([c2, s2]); + for (var f2 = d2.modulus.byteLength(), h2 = [1], p2 = 0; s2.length + h2.length + 2 < f2; ) + h2.push(255), p2++; + h2.push(0); + for (var m2 = -1; ++m2 < s2.length; ) + h2.push(s2[m2]); + h2 = e2.from(h2); + var g2 = t2.mont(d2.modulus); + a2 = (a2 = new t2(a2).toRed(g2)).redPow(new t2(d2.publicExponent)), a2 = e2.from(a2.fromRed().toArray()); + var v2 = p2 < 8 ? 1 : 0; + for (f2 = Math.min(a2.length, h2.length), a2.length !== h2.length && (v2 = 1), m2 = -1; ++m2 < f2; ) + v2 |= a2[m2] ^ h2[m2]; + return 0 === v2; + }, Wp; + } + var em = {}, tm = Ko, nm = Ue().Buffer, rm = function(e2, t2) { + for (var n2, r2 = nm.alloc(0), i2 = 0; r2.length < t2; ) + n2 = im(i2++), r2 = nm.concat([r2, tm("sha1").update(e2).update(n2).digest()]); + return r2.slice(0, t2); + }; + function im(e2) { + var t2 = nm.allocUnsafe(4); + return t2.writeUInt32BE(e2, 0), t2; + } + var om = function(e2, t2) { + for (var n2 = e2.length, r2 = -1; ++r2 < n2; ) + e2[r2] ^= t2[r2]; + return e2; + }, am = hl, sm = Ue().Buffer; + var um = function(e2, t2) { + return sm.from(e2.toRed(am.mont(t2.modulus)).redPow(new am(t2.publicExponent)).fromRed().toArray()); + }, lm = Kp, cm = We, dm = Ko, fm = rm, hm = om, pm = hl, mm = um, gm = Rl, vm = Ue().Buffer, bm = function(e2, t2, n2) { + var r2; + r2 = e2.padding ? e2.padding : n2 ? 1 : 4; + var i2, o2 = lm(e2); + if (4 === r2) + i2 = function(e3, t3) { + var n3 = e3.modulus.byteLength(), r3 = t3.length, i3 = dm("sha1").update(vm.alloc(0)).digest(), o3 = i3.length, a2 = 2 * o3; + if (r3 > n3 - a2 - 2) + throw new Error("message too long"); + var s2 = vm.alloc(n3 - r3 - a2 - 2), u2 = n3 - o3 - 1, l2 = cm(o3), c2 = hm(vm.concat([i3, s2, vm.alloc(1, 1), t3], u2), fm(l2, u2)), d2 = hm(l2, fm(c2, o3)); + return new pm(vm.concat([vm.alloc(1), d2, c2], n3)); + }(o2, t2); + else if (1 === r2) + i2 = function(e3, t3, n3) { + var r3, i3 = t3.length, o3 = e3.modulus.byteLength(); + if (i3 > o3 - 11) + throw new Error("message too long"); + r3 = n3 ? vm.alloc(o3 - i3 - 3, 255) : function(e4) { + var t4, n4 = vm.allocUnsafe(e4), r4 = 0, i4 = cm(2 * e4), o4 = 0; + for (; r4 < e4; ) + o4 === i4.length && (i4 = cm(2 * e4), o4 = 0), (t4 = i4[o4++]) && (n4[r4++] = t4); + return n4; + }(o3 - i3 - 3); + return new pm(vm.concat([vm.from([0, n3 ? 1 : 2]), r3, vm.alloc(1), t3], o3)); + }(o2, t2, n2); + else { + if (3 !== r2) + throw new Error("unknown padding"); + if ((i2 = new pm(t2)).cmp(o2.modulus) >= 0) + throw new Error("data too long for modulus"); + } + return n2 ? gm(i2, o2) : mm(i2, o2); + }; + var ym = Kp, wm = rm, _m = om, Sm = hl, Em = Rl, km = Ko, Mm = um, Cm = Ue().Buffer, xm = function(e2, t2, n2) { + var r2; + r2 = e2.padding ? e2.padding : n2 ? 1 : 4; + var i2, o2 = ym(e2), a2 = o2.modulus.byteLength(); + if (t2.length > a2 || new Sm(t2).cmp(o2.modulus) >= 0) + throw new Error("decryption error"); + i2 = n2 ? Mm(new Sm(t2), o2) : Em(t2, o2); + var s2 = Cm.alloc(a2 - i2.length); + if (i2 = Cm.concat([s2, i2], a2), 4 === r2) + return function(e3, t3) { + var n3 = e3.modulus.byteLength(), r3 = km("sha1").update(Cm.alloc(0)).digest(), i3 = r3.length; + if (0 !== t3[0]) + throw new Error("decryption error"); + var o3 = t3.slice(1, i3 + 1), a3 = t3.slice(i3 + 1), s3 = _m(o3, wm(a3, i3)), u2 = _m(a3, wm(s3, n3 - i3 - 1)); + if (function(e4, t4) { + e4 = Cm.from(e4), t4 = Cm.from(t4); + var n4 = 0, r4 = e4.length; + e4.length !== t4.length && (n4++, r4 = Math.min(e4.length, t4.length)); + var i4 = -1; + for (; ++i4 < r4; ) + n4 += e4[i4] ^ t4[i4]; + return n4; + }(r3, u2.slice(0, i3))) + throw new Error("decryption error"); + var l2 = i3; + for (; 0 === u2[l2]; ) + l2++; + if (1 !== u2[l2++]) + throw new Error("decryption error"); + return u2.slice(l2); + }(o2, i2); + if (1 === r2) + return function(e3, t3, n3) { + var r3 = t3.slice(0, 2), i3 = 2, o3 = 0; + for (; 0 !== t3[i3++]; ) + if (i3 >= t3.length) { + o3++; + break; + } + var a3 = t3.slice(2, i3 - 1); + ("0002" !== r3.toString("hex") && !n3 || "0001" !== r3.toString("hex") && n3) && o3++; + a3.length < 8 && o3++; + if (o3) + throw new Error("decryption error"); + return t3.slice(i3); + }(0, i2, n2); + if (3 === r2) + return i2; + throw new Error("unknown padding"); + }; + !function(e2) { + e2.publicEncrypt = bm, e2.privateDecrypt = xm, e2.privateEncrypt = function(t2, n2) { + return e2.publicEncrypt(t2, n2, true); + }, e2.publicDecrypt = function(t2, n2) { + return e2.privateDecrypt(t2, n2, true); + }; + }(em); + var Am = {}; + function Rm() { + throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11"); + } + var Tm, Pm = Ue(), Lm = Pm.Buffer, Im = Pm.kMaxLength, Om = n.crypto || n.msCrypto, Nm = Math.pow(2, 32) - 1; + function Dm(e2, t2) { + if ("number" != typeof e2 || e2 != e2) + throw new TypeError("offset must be a number"); + if (e2 > Nm || e2 < 0) + throw new TypeError("offset must be a uint32"); + if (e2 > Im || e2 > t2) + throw new RangeError("offset out of range"); + } + function jm(e2, t2, n2) { + if ("number" != typeof e2 || e2 != e2) + throw new TypeError("size must be a number"); + if (e2 > Nm || e2 < 0) + throw new TypeError("size must be a uint32"); + if (e2 + t2 > n2 || e2 > Im) + throw new RangeError("buffer too small"); + } + function Bm(e2, t2, n2, r2) { + var i2 = e2.buffer, o2 = new Uint8Array(i2, t2, n2); + return Om.getRandomValues(o2), r2 ? void Ee(function() { + r2(null, e2); + }) : e2; + } + function zm() { + if (Tm) + return de; + Tm = 1, de.randomBytes = de.rng = de.pseudoRandomBytes = de.prng = We, de.createHash = de.Hash = Ko, de.createHmac = de.Hmac = sa; + var e2 = la, t2 = Object.keys(e2), n2 = ["sha1", "sha224", "sha256", "sha384", "sha512", "md5", "rmd160"].concat(t2); + de.getHashes = function() { + return n2; + }; + var r2 = ca; + de.pbkdf2 = r2.pbkdf2, de.pbkdf2Sync = r2.pbkdf2Sync; + var i2 = za; + de.Cipher = i2.Cipher, de.createCipher = i2.createCipher, de.Cipheriv = i2.Cipheriv, de.createCipheriv = i2.createCipheriv, de.Decipher = i2.Decipher, de.createDecipher = i2.createDecipher, de.Decipheriv = i2.Decipheriv, de.createDecipheriv = i2.createDecipheriv, de.getCiphers = i2.getCiphers, de.listCiphers = i2.listCiphers; + var o2 = function() { + if (wl) + return al; + wl = 1; + var e3 = vl(), t3 = _l, n3 = Sl(), r3 = { binary: true, hex: true, base64: true }; + return al.DiffieHellmanGroup = al.createDiffieHellmanGroup = al.getDiffieHellman = function(e4) { + var r4 = new _(t3[e4].prime, "hex"), i3 = new _(t3[e4].gen, "hex"); + return new n3(r4, i3); + }, al.createDiffieHellman = al.DiffieHellman = function t4(i3, o3, a3, s3) { + return ie(o3) || void 0 === r3[o3] ? t4(i3, "binary", o3, a3) : (o3 = o3 || "binary", s3 = s3 || "binary", ie(a3 = a3 || new _([2])) || (a3 = new _(a3, s3)), "number" == typeof i3 ? new n3(e3(i3, a3), a3, true) : (ie(i3) || (i3 = new _(i3, o3)), new n3(i3, a3, true))); + }, al; + }(); + de.DiffieHellmanGroup = o2.DiffieHellmanGroup, de.createDiffieHellmanGroup = o2.createDiffieHellmanGroup, de.getDiffieHellman = o2.getDiffieHellman, de.createDiffieHellman = o2.createDiffieHellman, de.DiffieHellman = o2.DiffieHellman; + var a2 = function() { + if (Yp) + return Vp; + Yp = 1; + var e3 = Ue().Buffer, t3 = Ko, n3 = Hn, r3 = Ve, i3 = Jp(), o3 = Xp(), a3 = ua; + function s3(e4) { + n3.Writable.call(this); + var r4 = a3[e4]; + if (!r4) + throw new Error("Unknown message digest"); + this._hashType = r4.hash, this._hash = t3(r4.hash), this._tag = r4.id, this._signType = r4.sign; + } + function u3(e4) { + n3.Writable.call(this); + var r4 = a3[e4]; + if (!r4) + throw new Error("Unknown message digest"); + this._hash = t3(r4.hash), this._tag = r4.id, this._signType = r4.sign; + } + function l2(e4) { + return new s3(e4); + } + function c2(e4) { + return new u3(e4); + } + return Object.keys(a3).forEach(function(t4) { + a3[t4].id = e3.from(a3[t4].id, "hex"), a3[t4.toLowerCase()] = a3[t4]; + }), r3(s3, n3.Writable), s3.prototype._write = function(e4, t4, n4) { + this._hash.update(e4), n4(); + }, s3.prototype.update = function(t4, n4) { + return "string" == typeof t4 && (t4 = e3.from(t4, n4)), this._hash.update(t4), this; + }, s3.prototype.sign = function(e4, t4) { + this.end(); + var n4 = this._hash.digest(), r4 = i3(n4, e4, this._hashType, this._signType, this._tag); + return t4 ? r4.toString(t4) : r4; + }, r3(u3, n3.Writable), u3.prototype._write = function(e4, t4, n4) { + this._hash.update(e4), n4(); + }, u3.prototype.update = function(t4, n4) { + return "string" == typeof t4 && (t4 = e3.from(t4, n4)), this._hash.update(t4), this; + }, u3.prototype.verify = function(t4, n4, r4) { + "string" == typeof n4 && (n4 = e3.from(n4, r4)), this.end(); + var i4 = this._hash.digest(); + return o3(n4, i4, t4, this._signType, this._tag); + }, Vp = { Sign: l2, Verify: c2, createSign: l2, createVerify: c2 }; + }(); + de.createSign = a2.createSign, de.Sign = a2.Sign, de.createVerify = a2.createVerify, de.Verify = a2.Verify, de.createECDH = function() { + if (Zp) + return Gp; + Zp = 1; + var e3 = eh(), t3 = hl; + Gp = function(e4) { + return new r3(e4); + }; + var n3 = { secp256k1: { name: "secp256k1", byteLength: 32 }, secp224r1: { name: "p224", byteLength: 28 }, prime256v1: { name: "p256", byteLength: 32 }, prime192v1: { name: "p192", byteLength: 24 }, ed25519: { name: "ed25519", byteLength: 32 }, secp384r1: { name: "p384", byteLength: 48 }, secp521r1: { name: "p521", byteLength: 66 } }; + function r3(t4) { + this.curveType = n3[t4], this.curveType || (this.curveType = { name: t4 }), this.curve = new e3.ec(this.curveType.name), this.keys = void 0; + } + function i3(e4, t4, n4) { + Array.isArray(e4) || (e4 = e4.toArray()); + var r4 = new _(e4); + if (n4 && r4.length < n4) { + var i4 = new _(n4 - r4.length); + i4.fill(0), r4 = _.concat([i4, r4]); + } + return t4 ? r4.toString(t4) : r4; + } + return n3.p224 = n3.secp224r1, n3.p256 = n3.secp256r1 = n3.prime256v1, n3.p192 = n3.secp192r1 = n3.prime192v1, n3.p384 = n3.secp384r1, n3.p521 = n3.secp521r1, r3.prototype.generateKeys = function(e4, t4) { + return this.keys = this.curve.genKeyPair(), this.getPublicKey(e4, t4); + }, r3.prototype.computeSecret = function(e4, t4, n4) { + return t4 = t4 || "utf8", ie(e4) || (e4 = new _(e4, t4)), i3(this.curve.keyFromPublic(e4).getPublic().mul(this.keys.getPrivate()).getX(), n4, this.curveType.byteLength); + }, r3.prototype.getPublicKey = function(e4, t4) { + var n4 = this.keys.getPublic("compressed" === t4, true); + return "hybrid" === t4 && (n4[n4.length - 1] % 2 ? n4[0] = 7 : n4[0] = 6), i3(n4, e4); + }, r3.prototype.getPrivateKey = function(e4) { + return i3(this.keys.getPrivate(), e4); + }, r3.prototype.setPublicKey = function(e4, t4) { + return t4 = t4 || "utf8", ie(e4) || (e4 = new _(e4, t4)), this.keys._importPublic(e4), this; + }, r3.prototype.setPrivateKey = function(e4, n4) { + n4 = n4 || "utf8", ie(e4) || (e4 = new _(e4, n4)); + var r4 = new t3(e4); + return r4 = r4.toString(16), this.keys = this.curve.genKeyPair(), this.keys._importPrivate(r4), this; + }, Gp; + }(); + var s2 = em; + de.publicEncrypt = s2.publicEncrypt, de.privateEncrypt = s2.privateEncrypt, de.publicDecrypt = s2.publicDecrypt, de.privateDecrypt = s2.privateDecrypt; + var u2 = Am; + return de.randomFill = u2.randomFill, de.randomFillSync = u2.randomFillSync, de.createCredentials = function() { + throw new Error(["sorry, createCredentials is not implemented yet", "we accept pull requests", "https://github.com/crypto-browserify/crypto-browserify"].join("\n")); + }, de.constants = { DH_CHECK_P_NOT_SAFE_PRIME: 2, DH_CHECK_P_NOT_PRIME: 1, DH_UNABLE_TO_CHECK_GENERATOR: 4, DH_NOT_SUITABLE_GENERATOR: 8, NPN_ENABLED: 1, ALPN_ENABLED: 1, RSA_PKCS1_PADDING: 1, RSA_SSLV23_PADDING: 2, RSA_NO_PADDING: 3, RSA_PKCS1_OAEP_PADDING: 4, RSA_X931_PADDING: 5, RSA_PKCS1_PSS_PADDING: 6, POINT_CONVERSION_COMPRESSED: 2, POINT_CONVERSION_UNCOMPRESSED: 4, POINT_CONVERSION_HYBRID: 6 }, de; + } + Om && Om.getRandomValues ? (Am.randomFill = function(e2, t2, r2, i2) { + if (!(Lm.isBuffer(e2) || e2 instanceof n.Uint8Array)) + throw new TypeError('"buf" argument must be a Buffer or Uint8Array'); + if ("function" == typeof t2) + i2 = t2, t2 = 0, r2 = e2.length; + else if ("function" == typeof r2) + i2 = r2, r2 = e2.length - t2; + else if ("function" != typeof i2) + throw new TypeError('"cb" argument must be a function'); + return Dm(t2, e2.length), jm(r2, t2, e2.length), Bm(e2, t2, r2, i2); + }, Am.randomFillSync = function(e2, t2, r2) { + void 0 === t2 && (t2 = 0); + if (!(Lm.isBuffer(e2) || e2 instanceof n.Uint8Array)) + throw new TypeError('"buf" argument must be a Buffer or Uint8Array'); + Dm(t2, e2.length), void 0 === r2 && (r2 = e2.length - t2); + return jm(r2, t2, e2.length), Bm(e2, t2, r2); + }) : (Am.randomFill = Rm, Am.randomFillSync = Rm); + const { Buffer: Um } = ce, { createHash: Fm, createHmac: Km } = zm(), qm = {}, Hm = (e2) => { + switch (e2) { + case "sha256": + case "sha3-256": + case "blake2s256": + return 32; + case "sha512": + case "sha3-512": + case "blake2b512": + return 64; + case "sha224": + case "sha3-224": + return 28; + case "sha384": + case "sha3-384": + return 48; + case "sha1": + return 20; + case "md5": + return 16; + default: { + let t2 = qm[e2]; + return void 0 === t2 && (t2 = Fm(e2).digest().length, qm[e2] = t2), t2; + } + } + }, Wm = (e2, t2, n2, r2) => { + const i2 = Um.isBuffer(n2) ? n2 : Um.from(n2), o2 = r2 && r2.length ? Um.from(r2) : Um.alloc(t2, 0); + return Km(e2, o2).update(i2).digest(); + }, $m = (e2, t2, n2, r2, i2) => { + const o2 = Um.isBuffer(i2) ? i2 : Um.from(i2 || ""), a2 = o2.length, s2 = Math.ceil(r2 / t2); + if (s2 > 255) + throw new Error(`OKM length ${r2} is too long for ${e2} hash`); + const u2 = Um.alloc(t2 * s2 + a2 + 1); + for (let r3 = 1, i3 = 0, l2 = 0; r3 <= s2; ++r3) + o2.copy(u2, l2), u2[l2 + a2] = r3, Km(e2, n2).update(u2.slice(i3, l2 + a2 + 1)).digest().copy(u2, l2), i3 = l2, l2 += t2; + return u2.slice(0, r2); + }; + function Vm(e2, t2, { salt: n2 = "", info: r2 = "", hash: i2 = "SHA-256" } = {}) { + i2 = i2.toLowerCase().replace("-", ""); + const o2 = Hm(i2), a2 = Wm(i2, o2, e2, n2); + return $m(i2, o2, a2, t2, r2); + } + Object.defineProperties(Vm, { hash_length: { configurable: false, enumerable: false, writable: false, value: Hm }, extract: { configurable: false, enumerable: false, writable: false, value: Wm }, expand: { configurable: false, enumerable: false, writable: false, value: $m } }); + var Ym = Vm; + const Gm = "Impossible case. Please create issue.", Zm = "The tweak was out of range or the resulted private key is invalid", Qm = "The tweak was out of range or equal to zero", Jm = "Unknow error on context randomization", Xm = "Private Key is invalid", eg = "Public Key could not be parsed", tg = "Public Key serialization error", ng = "The sum of the public keys is not valid", rg = "Signature could not be parsed", ig = "The nonce generation function failed, or the private key was invalid", og = "Public key could not be recover", ag = "Scalar was invalid (zero or overflow)"; + function sg(e2, t2) { + if (!e2) + throw new Error(t2); + } + function ug(e2, t2, n2) { + if (sg(t2 instanceof Uint8Array, `Expected ${e2} to be an Uint8Array`), void 0 !== n2) + if (Array.isArray(n2)) { + const r2 = `Expected ${e2} to be an Uint8Array with length [${n2.join(", ")}]`; + sg(n2.includes(t2.length), r2); + } else { + const r2 = `Expected ${e2} to be an Uint8Array with length ${n2}`; + sg(t2.length === n2, r2); + } + } + function lg(e2) { + sg("Boolean" === dg(e2), "Expected compressed to be a Boolean"); + } + function cg(e2 = (e3) => new Uint8Array(e3), t2) { + return "function" == typeof e2 && (e2 = e2(t2)), ug("output", e2, t2), e2; + } + function dg(e2) { + return Object.prototype.toString.call(e2).slice(8, -1); + } + var fg = {}, hg = "6.5.4", pg = {}, mg = { exports: {} }; + !function(e2) { + !function(e3, t2) { + function n2(e4, t3) { + if (!e4) + throw new Error(t3 || "Assertion failed"); + } + function r2(e4, t3) { + e4.super_ = t3; + var n3 = function() { + }; + n3.prototype = t3.prototype, e4.prototype = new n3(), e4.prototype.constructor = e4; + } + function i2(e4, t3, n3) { + if (i2.isBN(e4)) + return e4; + this.negative = 0, this.words = null, this.length = 0, this.red = null, null !== e4 && ("le" !== t3 && "be" !== t3 || (n3 = t3, t3 = 10), this._init(e4 || 0, t3 || 10, n3 || "be")); + } + var o2; + "object" == typeof e3 ? e3.exports = i2 : t2.BN = i2, i2.BN = i2, i2.wordSize = 26; + try { + o2 = "undefined" != typeof window && void 0 !== window.Buffer ? window.Buffer : ce.Buffer; + } catch (e4) { + } + function a2(e4, t3) { + var n3 = e4.charCodeAt(t3); + return n3 >= 65 && n3 <= 70 ? n3 - 55 : n3 >= 97 && n3 <= 102 ? n3 - 87 : n3 - 48 & 15; + } + function s2(e4, t3, n3) { + var r3 = a2(e4, n3); + return n3 - 1 >= t3 && (r3 |= a2(e4, n3 - 1) << 4), r3; + } + function u2(e4, t3, n3, r3) { + for (var i3 = 0, o3 = Math.min(e4.length, n3), a3 = t3; a3 < o3; a3++) { + var s3 = e4.charCodeAt(a3) - 48; + i3 *= r3, i3 += s3 >= 49 ? s3 - 49 + 10 : s3 >= 17 ? s3 - 17 + 10 : s3; + } + return i3; + } + i2.isBN = function(e4) { + return e4 instanceof i2 || null !== e4 && "object" == typeof e4 && e4.constructor.wordSize === i2.wordSize && Array.isArray(e4.words); + }, i2.max = function(e4, t3) { + return e4.cmp(t3) > 0 ? e4 : t3; + }, i2.min = function(e4, t3) { + return e4.cmp(t3) < 0 ? e4 : t3; + }, i2.prototype._init = function(e4, t3, r3) { + if ("number" == typeof e4) + return this._initNumber(e4, t3, r3); + if ("object" == typeof e4) + return this._initArray(e4, t3, r3); + "hex" === t3 && (t3 = 16), n2(t3 === (0 | t3) && t3 >= 2 && t3 <= 36); + var i3 = 0; + "-" === (e4 = e4.toString().replace(/\s+/g, ""))[0] && (i3++, this.negative = 1), i3 < e4.length && (16 === t3 ? this._parseHex(e4, i3, r3) : (this._parseBase(e4, t3, i3), "le" === r3 && this._initArray(this.toArray(), t3, r3))); + }, i2.prototype._initNumber = function(e4, t3, r3) { + e4 < 0 && (this.negative = 1, e4 = -e4), e4 < 67108864 ? (this.words = [67108863 & e4], this.length = 1) : e4 < 4503599627370496 ? (this.words = [67108863 & e4, e4 / 67108864 & 67108863], this.length = 2) : (n2(e4 < 9007199254740992), this.words = [67108863 & e4, e4 / 67108864 & 67108863, 1], this.length = 3), "le" === r3 && this._initArray(this.toArray(), t3, r3); + }, i2.prototype._initArray = function(e4, t3, r3) { + if (n2("number" == typeof e4.length), e4.length <= 0) + return this.words = [0], this.length = 1, this; + this.length = Math.ceil(e4.length / 3), this.words = new Array(this.length); + for (var i3 = 0; i3 < this.length; i3++) + this.words[i3] = 0; + var o3, a3, s3 = 0; + if ("be" === r3) + for (i3 = e4.length - 1, o3 = 0; i3 >= 0; i3 -= 3) + a3 = e4[i3] | e4[i3 - 1] << 8 | e4[i3 - 2] << 16, this.words[o3] |= a3 << s3 & 67108863, this.words[o3 + 1] = a3 >>> 26 - s3 & 67108863, (s3 += 24) >= 26 && (s3 -= 26, o3++); + else if ("le" === r3) + for (i3 = 0, o3 = 0; i3 < e4.length; i3 += 3) + a3 = e4[i3] | e4[i3 + 1] << 8 | e4[i3 + 2] << 16, this.words[o3] |= a3 << s3 & 67108863, this.words[o3 + 1] = a3 >>> 26 - s3 & 67108863, (s3 += 24) >= 26 && (s3 -= 26, o3++); + return this.strip(); + }, i2.prototype._parseHex = function(e4, t3, n3) { + this.length = Math.ceil((e4.length - t3) / 6), this.words = new Array(this.length); + for (var r3 = 0; r3 < this.length; r3++) + this.words[r3] = 0; + var i3, o3 = 0, a3 = 0; + if ("be" === n3) + for (r3 = e4.length - 1; r3 >= t3; r3 -= 2) + i3 = s2(e4, t3, r3) << o3, this.words[a3] |= 67108863 & i3, o3 >= 18 ? (o3 -= 18, a3 += 1, this.words[a3] |= i3 >>> 26) : o3 += 8; + else + for (r3 = (e4.length - t3) % 2 == 0 ? t3 + 1 : t3; r3 < e4.length; r3 += 2) + i3 = s2(e4, t3, r3) << o3, this.words[a3] |= 67108863 & i3, o3 >= 18 ? (o3 -= 18, a3 += 1, this.words[a3] |= i3 >>> 26) : o3 += 8; + this.strip(); + }, i2.prototype._parseBase = function(e4, t3, n3) { + this.words = [0], this.length = 1; + for (var r3 = 0, i3 = 1; i3 <= 67108863; i3 *= t3) + r3++; + r3--, i3 = i3 / t3 | 0; + for (var o3 = e4.length - n3, a3 = o3 % r3, s3 = Math.min(o3, o3 - a3) + n3, l3 = 0, c3 = n3; c3 < s3; c3 += r3) + l3 = u2(e4, c3, c3 + r3, t3), this.imuln(i3), this.words[0] + l3 < 67108864 ? this.words[0] += l3 : this._iaddn(l3); + if (0 !== a3) { + var d3 = 1; + for (l3 = u2(e4, c3, e4.length, t3), c3 = 0; c3 < a3; c3++) + d3 *= t3; + this.imuln(d3), this.words[0] + l3 < 67108864 ? this.words[0] += l3 : this._iaddn(l3); + } + this.strip(); + }, i2.prototype.copy = function(e4) { + e4.words = new Array(this.length); + for (var t3 = 0; t3 < this.length; t3++) + e4.words[t3] = this.words[t3]; + e4.length = this.length, e4.negative = this.negative, e4.red = this.red; + }, i2.prototype.clone = function() { + var e4 = new i2(null); + return this.copy(e4), e4; + }, i2.prototype._expand = function(e4) { + for (; this.length < e4; ) + this.words[this.length++] = 0; + return this; + }, i2.prototype.strip = function() { + for (; this.length > 1 && 0 === this.words[this.length - 1]; ) + this.length--; + return this._normSign(); + }, i2.prototype._normSign = function() { + return 1 === this.length && 0 === this.words[0] && (this.negative = 0), this; + }, i2.prototype.inspect = function() { + return (this.red ? ""; + }; + var l2 = ["", "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"], c2 = [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], d2 = [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]; + function f2(e4, t3, n3) { + n3.negative = t3.negative ^ e4.negative; + var r3 = e4.length + t3.length | 0; + n3.length = r3, r3 = r3 - 1 | 0; + var i3 = 0 | e4.words[0], o3 = 0 | t3.words[0], a3 = i3 * o3, s3 = 67108863 & a3, u3 = a3 / 67108864 | 0; + n3.words[0] = s3; + for (var l3 = 1; l3 < r3; l3++) { + for (var c3 = u3 >>> 26, d3 = 67108863 & u3, f3 = Math.min(l3, t3.length - 1), h3 = Math.max(0, l3 - e4.length + 1); h3 <= f3; h3++) { + var p3 = l3 - h3 | 0; + c3 += (a3 = (i3 = 0 | e4.words[p3]) * (o3 = 0 | t3.words[h3]) + d3) / 67108864 | 0, d3 = 67108863 & a3; + } + n3.words[l3] = 0 | d3, u3 = 0 | c3; + } + return 0 !== u3 ? n3.words[l3] = 0 | u3 : n3.length--, n3.strip(); + } + i2.prototype.toString = function(e4, t3) { + var r3; + if (t3 = 0 | t3 || 1, 16 === (e4 = e4 || 10) || "hex" === e4) { + r3 = ""; + for (var i3 = 0, o3 = 0, a3 = 0; a3 < this.length; a3++) { + var s3 = this.words[a3], u3 = (16777215 & (s3 << i3 | o3)).toString(16); + r3 = 0 !== (o3 = s3 >>> 24 - i3 & 16777215) || a3 !== this.length - 1 ? l2[6 - u3.length] + u3 + r3 : u3 + r3, (i3 += 2) >= 26 && (i3 -= 26, a3--); + } + for (0 !== o3 && (r3 = o3.toString(16) + r3); r3.length % t3 != 0; ) + r3 = "0" + r3; + return 0 !== this.negative && (r3 = "-" + r3), r3; + } + if (e4 === (0 | e4) && e4 >= 2 && e4 <= 36) { + var f3 = c2[e4], h3 = d2[e4]; + r3 = ""; + var p3 = this.clone(); + for (p3.negative = 0; !p3.isZero(); ) { + var m3 = p3.modn(h3).toString(e4); + r3 = (p3 = p3.idivn(h3)).isZero() ? m3 + r3 : l2[f3 - m3.length] + m3 + r3; + } + for (this.isZero() && (r3 = "0" + r3); r3.length % t3 != 0; ) + r3 = "0" + r3; + return 0 !== this.negative && (r3 = "-" + r3), r3; + } + n2(false, "Base should be between 2 and 36"); + }, i2.prototype.toNumber = function() { + var e4 = this.words[0]; + return 2 === this.length ? e4 += 67108864 * this.words[1] : 3 === this.length && 1 === this.words[2] ? e4 += 4503599627370496 + 67108864 * this.words[1] : this.length > 2 && n2(false, "Number can only safely store up to 53 bits"), 0 !== this.negative ? -e4 : e4; + }, i2.prototype.toJSON = function() { + return this.toString(16); + }, i2.prototype.toBuffer = function(e4, t3) { + return n2(void 0 !== o2), this.toArrayLike(o2, e4, t3); + }, i2.prototype.toArray = function(e4, t3) { + return this.toArrayLike(Array, e4, t3); + }, i2.prototype.toArrayLike = function(e4, t3, r3) { + var i3 = this.byteLength(), o3 = r3 || Math.max(1, i3); + n2(i3 <= o3, "byte array longer than desired length"), n2(o3 > 0, "Requested array length <= 0"), this.strip(); + var a3, s3, u3 = "le" === t3, l3 = new e4(o3), c3 = this.clone(); + if (u3) { + for (s3 = 0; !c3.isZero(); s3++) + a3 = c3.andln(255), c3.iushrn(8), l3[s3] = a3; + for (; s3 < o3; s3++) + l3[s3] = 0; + } else { + for (s3 = 0; s3 < o3 - i3; s3++) + l3[s3] = 0; + for (s3 = 0; !c3.isZero(); s3++) + a3 = c3.andln(255), c3.iushrn(8), l3[o3 - s3 - 1] = a3; + } + return l3; + }, Math.clz32 ? i2.prototype._countBits = function(e4) { + return 32 - Math.clz32(e4); + } : i2.prototype._countBits = function(e4) { + var t3 = e4, n3 = 0; + return t3 >= 4096 && (n3 += 13, t3 >>>= 13), t3 >= 64 && (n3 += 7, t3 >>>= 7), t3 >= 8 && (n3 += 4, t3 >>>= 4), t3 >= 2 && (n3 += 2, t3 >>>= 2), n3 + t3; + }, i2.prototype._zeroBits = function(e4) { + if (0 === e4) + return 26; + var t3 = e4, n3 = 0; + return 0 == (8191 & t3) && (n3 += 13, t3 >>>= 13), 0 == (127 & t3) && (n3 += 7, t3 >>>= 7), 0 == (15 & t3) && (n3 += 4, t3 >>>= 4), 0 == (3 & t3) && (n3 += 2, t3 >>>= 2), 0 == (1 & t3) && n3++, n3; + }, i2.prototype.bitLength = function() { + var e4 = this.words[this.length - 1], t3 = this._countBits(e4); + return 26 * (this.length - 1) + t3; + }, i2.prototype.zeroBits = function() { + if (this.isZero()) + return 0; + for (var e4 = 0, t3 = 0; t3 < this.length; t3++) { + var n3 = this._zeroBits(this.words[t3]); + if (e4 += n3, 26 !== n3) + break; + } + return e4; + }, i2.prototype.byteLength = function() { + return Math.ceil(this.bitLength() / 8); + }, i2.prototype.toTwos = function(e4) { + return 0 !== this.negative ? this.abs().inotn(e4).iaddn(1) : this.clone(); + }, i2.prototype.fromTwos = function(e4) { + return this.testn(e4 - 1) ? this.notn(e4).iaddn(1).ineg() : this.clone(); + }, i2.prototype.isNeg = function() { + return 0 !== this.negative; + }, i2.prototype.neg = function() { + return this.clone().ineg(); + }, i2.prototype.ineg = function() { + return this.isZero() || (this.negative ^= 1), this; + }, i2.prototype.iuor = function(e4) { + for (; this.length < e4.length; ) + this.words[this.length++] = 0; + for (var t3 = 0; t3 < e4.length; t3++) + this.words[t3] = this.words[t3] | e4.words[t3]; + return this.strip(); + }, i2.prototype.ior = function(e4) { + return n2(0 == (this.negative | e4.negative)), this.iuor(e4); + }, i2.prototype.or = function(e4) { + return this.length > e4.length ? this.clone().ior(e4) : e4.clone().ior(this); + }, i2.prototype.uor = function(e4) { + return this.length > e4.length ? this.clone().iuor(e4) : e4.clone().iuor(this); + }, i2.prototype.iuand = function(e4) { + var t3; + t3 = this.length > e4.length ? e4 : this; + for (var n3 = 0; n3 < t3.length; n3++) + this.words[n3] = this.words[n3] & e4.words[n3]; + return this.length = t3.length, this.strip(); + }, i2.prototype.iand = function(e4) { + return n2(0 == (this.negative | e4.negative)), this.iuand(e4); + }, i2.prototype.and = function(e4) { + return this.length > e4.length ? this.clone().iand(e4) : e4.clone().iand(this); + }, i2.prototype.uand = function(e4) { + return this.length > e4.length ? this.clone().iuand(e4) : e4.clone().iuand(this); + }, i2.prototype.iuxor = function(e4) { + var t3, n3; + this.length > e4.length ? (t3 = this, n3 = e4) : (t3 = e4, n3 = this); + for (var r3 = 0; r3 < n3.length; r3++) + this.words[r3] = t3.words[r3] ^ n3.words[r3]; + if (this !== t3) + for (; r3 < t3.length; r3++) + this.words[r3] = t3.words[r3]; + return this.length = t3.length, this.strip(); + }, i2.prototype.ixor = function(e4) { + return n2(0 == (this.negative | e4.negative)), this.iuxor(e4); + }, i2.prototype.xor = function(e4) { + return this.length > e4.length ? this.clone().ixor(e4) : e4.clone().ixor(this); + }, i2.prototype.uxor = function(e4) { + return this.length > e4.length ? this.clone().iuxor(e4) : e4.clone().iuxor(this); + }, i2.prototype.inotn = function(e4) { + n2("number" == typeof e4 && e4 >= 0); + var t3 = 0 | Math.ceil(e4 / 26), r3 = e4 % 26; + this._expand(t3), r3 > 0 && t3--; + for (var i3 = 0; i3 < t3; i3++) + this.words[i3] = 67108863 & ~this.words[i3]; + return r3 > 0 && (this.words[i3] = ~this.words[i3] & 67108863 >> 26 - r3), this.strip(); + }, i2.prototype.notn = function(e4) { + return this.clone().inotn(e4); + }, i2.prototype.setn = function(e4, t3) { + n2("number" == typeof e4 && e4 >= 0); + var r3 = e4 / 26 | 0, i3 = e4 % 26; + return this._expand(r3 + 1), this.words[r3] = t3 ? this.words[r3] | 1 << i3 : this.words[r3] & ~(1 << i3), this.strip(); + }, i2.prototype.iadd = function(e4) { + var t3, n3, r3; + if (0 !== this.negative && 0 === e4.negative) + return this.negative = 0, t3 = this.isub(e4), this.negative ^= 1, this._normSign(); + if (0 === this.negative && 0 !== e4.negative) + return e4.negative = 0, t3 = this.isub(e4), e4.negative = 1, t3._normSign(); + this.length > e4.length ? (n3 = this, r3 = e4) : (n3 = e4, r3 = this); + for (var i3 = 0, o3 = 0; o3 < r3.length; o3++) + t3 = (0 | n3.words[o3]) + (0 | r3.words[o3]) + i3, this.words[o3] = 67108863 & t3, i3 = t3 >>> 26; + for (; 0 !== i3 && o3 < n3.length; o3++) + t3 = (0 | n3.words[o3]) + i3, this.words[o3] = 67108863 & t3, i3 = t3 >>> 26; + if (this.length = n3.length, 0 !== i3) + this.words[this.length] = i3, this.length++; + else if (n3 !== this) + for (; o3 < n3.length; o3++) + this.words[o3] = n3.words[o3]; + return this; + }, i2.prototype.add = function(e4) { + var t3; + return 0 !== e4.negative && 0 === this.negative ? (e4.negative = 0, t3 = this.sub(e4), e4.negative ^= 1, t3) : 0 === e4.negative && 0 !== this.negative ? (this.negative = 0, t3 = e4.sub(this), this.negative = 1, t3) : this.length > e4.length ? this.clone().iadd(e4) : e4.clone().iadd(this); + }, i2.prototype.isub = function(e4) { + if (0 !== e4.negative) { + e4.negative = 0; + var t3 = this.iadd(e4); + return e4.negative = 1, t3._normSign(); + } + if (0 !== this.negative) + return this.negative = 0, this.iadd(e4), this.negative = 1, this._normSign(); + var n3, r3, i3 = this.cmp(e4); + if (0 === i3) + return this.negative = 0, this.length = 1, this.words[0] = 0, this; + i3 > 0 ? (n3 = this, r3 = e4) : (n3 = e4, r3 = this); + for (var o3 = 0, a3 = 0; a3 < r3.length; a3++) + o3 = (t3 = (0 | n3.words[a3]) - (0 | r3.words[a3]) + o3) >> 26, this.words[a3] = 67108863 & t3; + for (; 0 !== o3 && a3 < n3.length; a3++) + o3 = (t3 = (0 | n3.words[a3]) + o3) >> 26, this.words[a3] = 67108863 & t3; + if (0 === o3 && a3 < n3.length && n3 !== this) + for (; a3 < n3.length; a3++) + this.words[a3] = n3.words[a3]; + return this.length = Math.max(this.length, a3), n3 !== this && (this.negative = 1), this.strip(); + }, i2.prototype.sub = function(e4) { + return this.clone().isub(e4); + }; + var h2 = function(e4, t3, n3) { + var r3, i3, o3, a3 = e4.words, s3 = t3.words, u3 = n3.words, l3 = 0, c3 = 0 | a3[0], d3 = 8191 & c3, f3 = c3 >>> 13, h3 = 0 | a3[1], p3 = 8191 & h3, m3 = h3 >>> 13, g3 = 0 | a3[2], v3 = 8191 & g3, b3 = g3 >>> 13, y3 = 0 | a3[3], w3 = 8191 & y3, _3 = y3 >>> 13, S3 = 0 | a3[4], E3 = 8191 & S3, k2 = S3 >>> 13, M2 = 0 | a3[5], C2 = 8191 & M2, x2 = M2 >>> 13, A2 = 0 | a3[6], R2 = 8191 & A2, T2 = A2 >>> 13, P2 = 0 | a3[7], L2 = 8191 & P2, I2 = P2 >>> 13, O2 = 0 | a3[8], N2 = 8191 & O2, D2 = O2 >>> 13, j2 = 0 | a3[9], B2 = 8191 & j2, z2 = j2 >>> 13, U2 = 0 | s3[0], F2 = 8191 & U2, K2 = U2 >>> 13, q2 = 0 | s3[1], H2 = 8191 & q2, W2 = q2 >>> 13, $2 = 0 | s3[2], V2 = 8191 & $2, Y2 = $2 >>> 13, G2 = 0 | s3[3], Z2 = 8191 & G2, Q2 = G2 >>> 13, J2 = 0 | s3[4], X2 = 8191 & J2, ee2 = J2 >>> 13, te2 = 0 | s3[5], ne2 = 8191 & te2, re2 = te2 >>> 13, ie2 = 0 | s3[6], oe2 = 8191 & ie2, ae2 = ie2 >>> 13, se2 = 0 | s3[7], ue2 = 8191 & se2, le2 = se2 >>> 13, ce2 = 0 | s3[8], de2 = 8191 & ce2, fe2 = ce2 >>> 13, he2 = 0 | s3[9], pe2 = 8191 & he2, me2 = he2 >>> 13; + n3.negative = e4.negative ^ t3.negative, n3.length = 19; + var ge2 = (l3 + (r3 = Math.imul(d3, F2)) | 0) + ((8191 & (i3 = (i3 = Math.imul(d3, K2)) + Math.imul(f3, F2) | 0)) << 13) | 0; + l3 = ((o3 = Math.imul(f3, K2)) + (i3 >>> 13) | 0) + (ge2 >>> 26) | 0, ge2 &= 67108863, r3 = Math.imul(p3, F2), i3 = (i3 = Math.imul(p3, K2)) + Math.imul(m3, F2) | 0, o3 = Math.imul(m3, K2); + var ve2 = (l3 + (r3 = r3 + Math.imul(d3, H2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, W2) | 0) + Math.imul(f3, H2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, W2) | 0) + (i3 >>> 13) | 0) + (ve2 >>> 26) | 0, ve2 &= 67108863, r3 = Math.imul(v3, F2), i3 = (i3 = Math.imul(v3, K2)) + Math.imul(b3, F2) | 0, o3 = Math.imul(b3, K2), r3 = r3 + Math.imul(p3, H2) | 0, i3 = (i3 = i3 + Math.imul(p3, W2) | 0) + Math.imul(m3, H2) | 0, o3 = o3 + Math.imul(m3, W2) | 0; + var be2 = (l3 + (r3 = r3 + Math.imul(d3, V2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, Y2) | 0) + Math.imul(f3, V2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, Y2) | 0) + (i3 >>> 13) | 0) + (be2 >>> 26) | 0, be2 &= 67108863, r3 = Math.imul(w3, F2), i3 = (i3 = Math.imul(w3, K2)) + Math.imul(_3, F2) | 0, o3 = Math.imul(_3, K2), r3 = r3 + Math.imul(v3, H2) | 0, i3 = (i3 = i3 + Math.imul(v3, W2) | 0) + Math.imul(b3, H2) | 0, o3 = o3 + Math.imul(b3, W2) | 0, r3 = r3 + Math.imul(p3, V2) | 0, i3 = (i3 = i3 + Math.imul(p3, Y2) | 0) + Math.imul(m3, V2) | 0, o3 = o3 + Math.imul(m3, Y2) | 0; + var ye2 = (l3 + (r3 = r3 + Math.imul(d3, Z2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, Q2) | 0) + Math.imul(f3, Z2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, Q2) | 0) + (i3 >>> 13) | 0) + (ye2 >>> 26) | 0, ye2 &= 67108863, r3 = Math.imul(E3, F2), i3 = (i3 = Math.imul(E3, K2)) + Math.imul(k2, F2) | 0, o3 = Math.imul(k2, K2), r3 = r3 + Math.imul(w3, H2) | 0, i3 = (i3 = i3 + Math.imul(w3, W2) | 0) + Math.imul(_3, H2) | 0, o3 = o3 + Math.imul(_3, W2) | 0, r3 = r3 + Math.imul(v3, V2) | 0, i3 = (i3 = i3 + Math.imul(v3, Y2) | 0) + Math.imul(b3, V2) | 0, o3 = o3 + Math.imul(b3, Y2) | 0, r3 = r3 + Math.imul(p3, Z2) | 0, i3 = (i3 = i3 + Math.imul(p3, Q2) | 0) + Math.imul(m3, Z2) | 0, o3 = o3 + Math.imul(m3, Q2) | 0; + var we2 = (l3 + (r3 = r3 + Math.imul(d3, X2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, ee2) | 0) + Math.imul(f3, X2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, ee2) | 0) + (i3 >>> 13) | 0) + (we2 >>> 26) | 0, we2 &= 67108863, r3 = Math.imul(C2, F2), i3 = (i3 = Math.imul(C2, K2)) + Math.imul(x2, F2) | 0, o3 = Math.imul(x2, K2), r3 = r3 + Math.imul(E3, H2) | 0, i3 = (i3 = i3 + Math.imul(E3, W2) | 0) + Math.imul(k2, H2) | 0, o3 = o3 + Math.imul(k2, W2) | 0, r3 = r3 + Math.imul(w3, V2) | 0, i3 = (i3 = i3 + Math.imul(w3, Y2) | 0) + Math.imul(_3, V2) | 0, o3 = o3 + Math.imul(_3, Y2) | 0, r3 = r3 + Math.imul(v3, Z2) | 0, i3 = (i3 = i3 + Math.imul(v3, Q2) | 0) + Math.imul(b3, Z2) | 0, o3 = o3 + Math.imul(b3, Q2) | 0, r3 = r3 + Math.imul(p3, X2) | 0, i3 = (i3 = i3 + Math.imul(p3, ee2) | 0) + Math.imul(m3, X2) | 0, o3 = o3 + Math.imul(m3, ee2) | 0; + var _e2 = (l3 + (r3 = r3 + Math.imul(d3, ne2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, re2) | 0) + Math.imul(f3, ne2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, re2) | 0) + (i3 >>> 13) | 0) + (_e2 >>> 26) | 0, _e2 &= 67108863, r3 = Math.imul(R2, F2), i3 = (i3 = Math.imul(R2, K2)) + Math.imul(T2, F2) | 0, o3 = Math.imul(T2, K2), r3 = r3 + Math.imul(C2, H2) | 0, i3 = (i3 = i3 + Math.imul(C2, W2) | 0) + Math.imul(x2, H2) | 0, o3 = o3 + Math.imul(x2, W2) | 0, r3 = r3 + Math.imul(E3, V2) | 0, i3 = (i3 = i3 + Math.imul(E3, Y2) | 0) + Math.imul(k2, V2) | 0, o3 = o3 + Math.imul(k2, Y2) | 0, r3 = r3 + Math.imul(w3, Z2) | 0, i3 = (i3 = i3 + Math.imul(w3, Q2) | 0) + Math.imul(_3, Z2) | 0, o3 = o3 + Math.imul(_3, Q2) | 0, r3 = r3 + Math.imul(v3, X2) | 0, i3 = (i3 = i3 + Math.imul(v3, ee2) | 0) + Math.imul(b3, X2) | 0, o3 = o3 + Math.imul(b3, ee2) | 0, r3 = r3 + Math.imul(p3, ne2) | 0, i3 = (i3 = i3 + Math.imul(p3, re2) | 0) + Math.imul(m3, ne2) | 0, o3 = o3 + Math.imul(m3, re2) | 0; + var Se2 = (l3 + (r3 = r3 + Math.imul(d3, oe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, ae2) | 0) + Math.imul(f3, oe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, ae2) | 0) + (i3 >>> 13) | 0) + (Se2 >>> 26) | 0, Se2 &= 67108863, r3 = Math.imul(L2, F2), i3 = (i3 = Math.imul(L2, K2)) + Math.imul(I2, F2) | 0, o3 = Math.imul(I2, K2), r3 = r3 + Math.imul(R2, H2) | 0, i3 = (i3 = i3 + Math.imul(R2, W2) | 0) + Math.imul(T2, H2) | 0, o3 = o3 + Math.imul(T2, W2) | 0, r3 = r3 + Math.imul(C2, V2) | 0, i3 = (i3 = i3 + Math.imul(C2, Y2) | 0) + Math.imul(x2, V2) | 0, o3 = o3 + Math.imul(x2, Y2) | 0, r3 = r3 + Math.imul(E3, Z2) | 0, i3 = (i3 = i3 + Math.imul(E3, Q2) | 0) + Math.imul(k2, Z2) | 0, o3 = o3 + Math.imul(k2, Q2) | 0, r3 = r3 + Math.imul(w3, X2) | 0, i3 = (i3 = i3 + Math.imul(w3, ee2) | 0) + Math.imul(_3, X2) | 0, o3 = o3 + Math.imul(_3, ee2) | 0, r3 = r3 + Math.imul(v3, ne2) | 0, i3 = (i3 = i3 + Math.imul(v3, re2) | 0) + Math.imul(b3, ne2) | 0, o3 = o3 + Math.imul(b3, re2) | 0, r3 = r3 + Math.imul(p3, oe2) | 0, i3 = (i3 = i3 + Math.imul(p3, ae2) | 0) + Math.imul(m3, oe2) | 0, o3 = o3 + Math.imul(m3, ae2) | 0; + var Ee2 = (l3 + (r3 = r3 + Math.imul(d3, ue2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, le2) | 0) + Math.imul(f3, ue2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, le2) | 0) + (i3 >>> 13) | 0) + (Ee2 >>> 26) | 0, Ee2 &= 67108863, r3 = Math.imul(N2, F2), i3 = (i3 = Math.imul(N2, K2)) + Math.imul(D2, F2) | 0, o3 = Math.imul(D2, K2), r3 = r3 + Math.imul(L2, H2) | 0, i3 = (i3 = i3 + Math.imul(L2, W2) | 0) + Math.imul(I2, H2) | 0, o3 = o3 + Math.imul(I2, W2) | 0, r3 = r3 + Math.imul(R2, V2) | 0, i3 = (i3 = i3 + Math.imul(R2, Y2) | 0) + Math.imul(T2, V2) | 0, o3 = o3 + Math.imul(T2, Y2) | 0, r3 = r3 + Math.imul(C2, Z2) | 0, i3 = (i3 = i3 + Math.imul(C2, Q2) | 0) + Math.imul(x2, Z2) | 0, o3 = o3 + Math.imul(x2, Q2) | 0, r3 = r3 + Math.imul(E3, X2) | 0, i3 = (i3 = i3 + Math.imul(E3, ee2) | 0) + Math.imul(k2, X2) | 0, o3 = o3 + Math.imul(k2, ee2) | 0, r3 = r3 + Math.imul(w3, ne2) | 0, i3 = (i3 = i3 + Math.imul(w3, re2) | 0) + Math.imul(_3, ne2) | 0, o3 = o3 + Math.imul(_3, re2) | 0, r3 = r3 + Math.imul(v3, oe2) | 0, i3 = (i3 = i3 + Math.imul(v3, ae2) | 0) + Math.imul(b3, oe2) | 0, o3 = o3 + Math.imul(b3, ae2) | 0, r3 = r3 + Math.imul(p3, ue2) | 0, i3 = (i3 = i3 + Math.imul(p3, le2) | 0) + Math.imul(m3, ue2) | 0, o3 = o3 + Math.imul(m3, le2) | 0; + var ke2 = (l3 + (r3 = r3 + Math.imul(d3, de2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, fe2) | 0) + Math.imul(f3, de2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, fe2) | 0) + (i3 >>> 13) | 0) + (ke2 >>> 26) | 0, ke2 &= 67108863, r3 = Math.imul(B2, F2), i3 = (i3 = Math.imul(B2, K2)) + Math.imul(z2, F2) | 0, o3 = Math.imul(z2, K2), r3 = r3 + Math.imul(N2, H2) | 0, i3 = (i3 = i3 + Math.imul(N2, W2) | 0) + Math.imul(D2, H2) | 0, o3 = o3 + Math.imul(D2, W2) | 0, r3 = r3 + Math.imul(L2, V2) | 0, i3 = (i3 = i3 + Math.imul(L2, Y2) | 0) + Math.imul(I2, V2) | 0, o3 = o3 + Math.imul(I2, Y2) | 0, r3 = r3 + Math.imul(R2, Z2) | 0, i3 = (i3 = i3 + Math.imul(R2, Q2) | 0) + Math.imul(T2, Z2) | 0, o3 = o3 + Math.imul(T2, Q2) | 0, r3 = r3 + Math.imul(C2, X2) | 0, i3 = (i3 = i3 + Math.imul(C2, ee2) | 0) + Math.imul(x2, X2) | 0, o3 = o3 + Math.imul(x2, ee2) | 0, r3 = r3 + Math.imul(E3, ne2) | 0, i3 = (i3 = i3 + Math.imul(E3, re2) | 0) + Math.imul(k2, ne2) | 0, o3 = o3 + Math.imul(k2, re2) | 0, r3 = r3 + Math.imul(w3, oe2) | 0, i3 = (i3 = i3 + Math.imul(w3, ae2) | 0) + Math.imul(_3, oe2) | 0, o3 = o3 + Math.imul(_3, ae2) | 0, r3 = r3 + Math.imul(v3, ue2) | 0, i3 = (i3 = i3 + Math.imul(v3, le2) | 0) + Math.imul(b3, ue2) | 0, o3 = o3 + Math.imul(b3, le2) | 0, r3 = r3 + Math.imul(p3, de2) | 0, i3 = (i3 = i3 + Math.imul(p3, fe2) | 0) + Math.imul(m3, de2) | 0, o3 = o3 + Math.imul(m3, fe2) | 0; + var Me2 = (l3 + (r3 = r3 + Math.imul(d3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, me2) | 0) + Math.imul(f3, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(f3, me2) | 0) + (i3 >>> 13) | 0) + (Me2 >>> 26) | 0, Me2 &= 67108863, r3 = Math.imul(B2, H2), i3 = (i3 = Math.imul(B2, W2)) + Math.imul(z2, H2) | 0, o3 = Math.imul(z2, W2), r3 = r3 + Math.imul(N2, V2) | 0, i3 = (i3 = i3 + Math.imul(N2, Y2) | 0) + Math.imul(D2, V2) | 0, o3 = o3 + Math.imul(D2, Y2) | 0, r3 = r3 + Math.imul(L2, Z2) | 0, i3 = (i3 = i3 + Math.imul(L2, Q2) | 0) + Math.imul(I2, Z2) | 0, o3 = o3 + Math.imul(I2, Q2) | 0, r3 = r3 + Math.imul(R2, X2) | 0, i3 = (i3 = i3 + Math.imul(R2, ee2) | 0) + Math.imul(T2, X2) | 0, o3 = o3 + Math.imul(T2, ee2) | 0, r3 = r3 + Math.imul(C2, ne2) | 0, i3 = (i3 = i3 + Math.imul(C2, re2) | 0) + Math.imul(x2, ne2) | 0, o3 = o3 + Math.imul(x2, re2) | 0, r3 = r3 + Math.imul(E3, oe2) | 0, i3 = (i3 = i3 + Math.imul(E3, ae2) | 0) + Math.imul(k2, oe2) | 0, o3 = o3 + Math.imul(k2, ae2) | 0, r3 = r3 + Math.imul(w3, ue2) | 0, i3 = (i3 = i3 + Math.imul(w3, le2) | 0) + Math.imul(_3, ue2) | 0, o3 = o3 + Math.imul(_3, le2) | 0, r3 = r3 + Math.imul(v3, de2) | 0, i3 = (i3 = i3 + Math.imul(v3, fe2) | 0) + Math.imul(b3, de2) | 0, o3 = o3 + Math.imul(b3, fe2) | 0; + var Ce2 = (l3 + (r3 = r3 + Math.imul(p3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(p3, me2) | 0) + Math.imul(m3, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(m3, me2) | 0) + (i3 >>> 13) | 0) + (Ce2 >>> 26) | 0, Ce2 &= 67108863, r3 = Math.imul(B2, V2), i3 = (i3 = Math.imul(B2, Y2)) + Math.imul(z2, V2) | 0, o3 = Math.imul(z2, Y2), r3 = r3 + Math.imul(N2, Z2) | 0, i3 = (i3 = i3 + Math.imul(N2, Q2) | 0) + Math.imul(D2, Z2) | 0, o3 = o3 + Math.imul(D2, Q2) | 0, r3 = r3 + Math.imul(L2, X2) | 0, i3 = (i3 = i3 + Math.imul(L2, ee2) | 0) + Math.imul(I2, X2) | 0, o3 = o3 + Math.imul(I2, ee2) | 0, r3 = r3 + Math.imul(R2, ne2) | 0, i3 = (i3 = i3 + Math.imul(R2, re2) | 0) + Math.imul(T2, ne2) | 0, o3 = o3 + Math.imul(T2, re2) | 0, r3 = r3 + Math.imul(C2, oe2) | 0, i3 = (i3 = i3 + Math.imul(C2, ae2) | 0) + Math.imul(x2, oe2) | 0, o3 = o3 + Math.imul(x2, ae2) | 0, r3 = r3 + Math.imul(E3, ue2) | 0, i3 = (i3 = i3 + Math.imul(E3, le2) | 0) + Math.imul(k2, ue2) | 0, o3 = o3 + Math.imul(k2, le2) | 0, r3 = r3 + Math.imul(w3, de2) | 0, i3 = (i3 = i3 + Math.imul(w3, fe2) | 0) + Math.imul(_3, de2) | 0, o3 = o3 + Math.imul(_3, fe2) | 0; + var xe2 = (l3 + (r3 = r3 + Math.imul(v3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(v3, me2) | 0) + Math.imul(b3, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(b3, me2) | 0) + (i3 >>> 13) | 0) + (xe2 >>> 26) | 0, xe2 &= 67108863, r3 = Math.imul(B2, Z2), i3 = (i3 = Math.imul(B2, Q2)) + Math.imul(z2, Z2) | 0, o3 = Math.imul(z2, Q2), r3 = r3 + Math.imul(N2, X2) | 0, i3 = (i3 = i3 + Math.imul(N2, ee2) | 0) + Math.imul(D2, X2) | 0, o3 = o3 + Math.imul(D2, ee2) | 0, r3 = r3 + Math.imul(L2, ne2) | 0, i3 = (i3 = i3 + Math.imul(L2, re2) | 0) + Math.imul(I2, ne2) | 0, o3 = o3 + Math.imul(I2, re2) | 0, r3 = r3 + Math.imul(R2, oe2) | 0, i3 = (i3 = i3 + Math.imul(R2, ae2) | 0) + Math.imul(T2, oe2) | 0, o3 = o3 + Math.imul(T2, ae2) | 0, r3 = r3 + Math.imul(C2, ue2) | 0, i3 = (i3 = i3 + Math.imul(C2, le2) | 0) + Math.imul(x2, ue2) | 0, o3 = o3 + Math.imul(x2, le2) | 0, r3 = r3 + Math.imul(E3, de2) | 0, i3 = (i3 = i3 + Math.imul(E3, fe2) | 0) + Math.imul(k2, de2) | 0, o3 = o3 + Math.imul(k2, fe2) | 0; + var Ae2 = (l3 + (r3 = r3 + Math.imul(w3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(w3, me2) | 0) + Math.imul(_3, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(_3, me2) | 0) + (i3 >>> 13) | 0) + (Ae2 >>> 26) | 0, Ae2 &= 67108863, r3 = Math.imul(B2, X2), i3 = (i3 = Math.imul(B2, ee2)) + Math.imul(z2, X2) | 0, o3 = Math.imul(z2, ee2), r3 = r3 + Math.imul(N2, ne2) | 0, i3 = (i3 = i3 + Math.imul(N2, re2) | 0) + Math.imul(D2, ne2) | 0, o3 = o3 + Math.imul(D2, re2) | 0, r3 = r3 + Math.imul(L2, oe2) | 0, i3 = (i3 = i3 + Math.imul(L2, ae2) | 0) + Math.imul(I2, oe2) | 0, o3 = o3 + Math.imul(I2, ae2) | 0, r3 = r3 + Math.imul(R2, ue2) | 0, i3 = (i3 = i3 + Math.imul(R2, le2) | 0) + Math.imul(T2, ue2) | 0, o3 = o3 + Math.imul(T2, le2) | 0, r3 = r3 + Math.imul(C2, de2) | 0, i3 = (i3 = i3 + Math.imul(C2, fe2) | 0) + Math.imul(x2, de2) | 0, o3 = o3 + Math.imul(x2, fe2) | 0; + var Re2 = (l3 + (r3 = r3 + Math.imul(E3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(E3, me2) | 0) + Math.imul(k2, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(k2, me2) | 0) + (i3 >>> 13) | 0) + (Re2 >>> 26) | 0, Re2 &= 67108863, r3 = Math.imul(B2, ne2), i3 = (i3 = Math.imul(B2, re2)) + Math.imul(z2, ne2) | 0, o3 = Math.imul(z2, re2), r3 = r3 + Math.imul(N2, oe2) | 0, i3 = (i3 = i3 + Math.imul(N2, ae2) | 0) + Math.imul(D2, oe2) | 0, o3 = o3 + Math.imul(D2, ae2) | 0, r3 = r3 + Math.imul(L2, ue2) | 0, i3 = (i3 = i3 + Math.imul(L2, le2) | 0) + Math.imul(I2, ue2) | 0, o3 = o3 + Math.imul(I2, le2) | 0, r3 = r3 + Math.imul(R2, de2) | 0, i3 = (i3 = i3 + Math.imul(R2, fe2) | 0) + Math.imul(T2, de2) | 0, o3 = o3 + Math.imul(T2, fe2) | 0; + var Te2 = (l3 + (r3 = r3 + Math.imul(C2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(C2, me2) | 0) + Math.imul(x2, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(x2, me2) | 0) + (i3 >>> 13) | 0) + (Te2 >>> 26) | 0, Te2 &= 67108863, r3 = Math.imul(B2, oe2), i3 = (i3 = Math.imul(B2, ae2)) + Math.imul(z2, oe2) | 0, o3 = Math.imul(z2, ae2), r3 = r3 + Math.imul(N2, ue2) | 0, i3 = (i3 = i3 + Math.imul(N2, le2) | 0) + Math.imul(D2, ue2) | 0, o3 = o3 + Math.imul(D2, le2) | 0, r3 = r3 + Math.imul(L2, de2) | 0, i3 = (i3 = i3 + Math.imul(L2, fe2) | 0) + Math.imul(I2, de2) | 0, o3 = o3 + Math.imul(I2, fe2) | 0; + var Pe2 = (l3 + (r3 = r3 + Math.imul(R2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(R2, me2) | 0) + Math.imul(T2, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(T2, me2) | 0) + (i3 >>> 13) | 0) + (Pe2 >>> 26) | 0, Pe2 &= 67108863, r3 = Math.imul(B2, ue2), i3 = (i3 = Math.imul(B2, le2)) + Math.imul(z2, ue2) | 0, o3 = Math.imul(z2, le2), r3 = r3 + Math.imul(N2, de2) | 0, i3 = (i3 = i3 + Math.imul(N2, fe2) | 0) + Math.imul(D2, de2) | 0, o3 = o3 + Math.imul(D2, fe2) | 0; + var Le2 = (l3 + (r3 = r3 + Math.imul(L2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(L2, me2) | 0) + Math.imul(I2, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(I2, me2) | 0) + (i3 >>> 13) | 0) + (Le2 >>> 26) | 0, Le2 &= 67108863, r3 = Math.imul(B2, de2), i3 = (i3 = Math.imul(B2, fe2)) + Math.imul(z2, de2) | 0, o3 = Math.imul(z2, fe2); + var Ie2 = (l3 + (r3 = r3 + Math.imul(N2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(N2, me2) | 0) + Math.imul(D2, pe2) | 0)) << 13) | 0; + l3 = ((o3 = o3 + Math.imul(D2, me2) | 0) + (i3 >>> 13) | 0) + (Ie2 >>> 26) | 0, Ie2 &= 67108863; + var Oe2 = (l3 + (r3 = Math.imul(B2, pe2)) | 0) + ((8191 & (i3 = (i3 = Math.imul(B2, me2)) + Math.imul(z2, pe2) | 0)) << 13) | 0; + return l3 = ((o3 = Math.imul(z2, me2)) + (i3 >>> 13) | 0) + (Oe2 >>> 26) | 0, Oe2 &= 67108863, u3[0] = ge2, u3[1] = ve2, u3[2] = be2, u3[3] = ye2, u3[4] = we2, u3[5] = _e2, u3[6] = Se2, u3[7] = Ee2, u3[8] = ke2, u3[9] = Me2, u3[10] = Ce2, u3[11] = xe2, u3[12] = Ae2, u3[13] = Re2, u3[14] = Te2, u3[15] = Pe2, u3[16] = Le2, u3[17] = Ie2, u3[18] = Oe2, 0 !== l3 && (u3[19] = l3, n3.length++), n3; + }; + function p2(e4, t3, n3) { + return new m2().mulp(e4, t3, n3); + } + function m2(e4, t3) { + this.x = e4, this.y = t3; + } + Math.imul || (h2 = f2), i2.prototype.mulTo = function(e4, t3) { + var n3, r3 = this.length + e4.length; + return n3 = 10 === this.length && 10 === e4.length ? h2(this, e4, t3) : r3 < 63 ? f2(this, e4, t3) : r3 < 1024 ? function(e5, t4, n4) { + n4.negative = t4.negative ^ e5.negative, n4.length = e5.length + t4.length; + for (var r4 = 0, i3 = 0, o3 = 0; o3 < n4.length - 1; o3++) { + var a3 = i3; + i3 = 0; + for (var s3 = 67108863 & r4, u3 = Math.min(o3, t4.length - 1), l3 = Math.max(0, o3 - e5.length + 1); l3 <= u3; l3++) { + var c3 = o3 - l3, d3 = (0 | e5.words[c3]) * (0 | t4.words[l3]), f3 = 67108863 & d3; + s3 = 67108863 & (f3 = f3 + s3 | 0), i3 += (a3 = (a3 = a3 + (d3 / 67108864 | 0) | 0) + (f3 >>> 26) | 0) >>> 26, a3 &= 67108863; + } + n4.words[o3] = s3, r4 = a3, a3 = i3; + } + return 0 !== r4 ? n4.words[o3] = r4 : n4.length--, n4.strip(); + }(this, e4, t3) : p2(this, e4, t3), n3; + }, m2.prototype.makeRBT = function(e4) { + for (var t3 = new Array(e4), n3 = i2.prototype._countBits(e4) - 1, r3 = 0; r3 < e4; r3++) + t3[r3] = this.revBin(r3, n3, e4); + return t3; + }, m2.prototype.revBin = function(e4, t3, n3) { + if (0 === e4 || e4 === n3 - 1) + return e4; + for (var r3 = 0, i3 = 0; i3 < t3; i3++) + r3 |= (1 & e4) << t3 - i3 - 1, e4 >>= 1; + return r3; + }, m2.prototype.permute = function(e4, t3, n3, r3, i3, o3) { + for (var a3 = 0; a3 < o3; a3++) + r3[a3] = t3[e4[a3]], i3[a3] = n3[e4[a3]]; + }, m2.prototype.transform = function(e4, t3, n3, r3, i3, o3) { + this.permute(o3, e4, t3, n3, r3, i3); + for (var a3 = 1; a3 < i3; a3 <<= 1) + for (var s3 = a3 << 1, u3 = Math.cos(2 * Math.PI / s3), l3 = Math.sin(2 * Math.PI / s3), c3 = 0; c3 < i3; c3 += s3) + for (var d3 = u3, f3 = l3, h3 = 0; h3 < a3; h3++) { + var p3 = n3[c3 + h3], m3 = r3[c3 + h3], g3 = n3[c3 + h3 + a3], v3 = r3[c3 + h3 + a3], b3 = d3 * g3 - f3 * v3; + v3 = d3 * v3 + f3 * g3, g3 = b3, n3[c3 + h3] = p3 + g3, r3[c3 + h3] = m3 + v3, n3[c3 + h3 + a3] = p3 - g3, r3[c3 + h3 + a3] = m3 - v3, h3 !== s3 && (b3 = u3 * d3 - l3 * f3, f3 = u3 * f3 + l3 * d3, d3 = b3); + } + }, m2.prototype.guessLen13b = function(e4, t3) { + var n3 = 1 | Math.max(t3, e4), r3 = 1 & n3, i3 = 0; + for (n3 = n3 / 2 | 0; n3; n3 >>>= 1) + i3++; + return 1 << i3 + 1 + r3; + }, m2.prototype.conjugate = function(e4, t3, n3) { + if (!(n3 <= 1)) + for (var r3 = 0; r3 < n3 / 2; r3++) { + var i3 = e4[r3]; + e4[r3] = e4[n3 - r3 - 1], e4[n3 - r3 - 1] = i3, i3 = t3[r3], t3[r3] = -t3[n3 - r3 - 1], t3[n3 - r3 - 1] = -i3; + } + }, m2.prototype.normalize13b = function(e4, t3) { + for (var n3 = 0, r3 = 0; r3 < t3 / 2; r3++) { + var i3 = 8192 * Math.round(e4[2 * r3 + 1] / t3) + Math.round(e4[2 * r3] / t3) + n3; + e4[r3] = 67108863 & i3, n3 = i3 < 67108864 ? 0 : i3 / 67108864 | 0; + } + return e4; + }, m2.prototype.convert13b = function(e4, t3, r3, i3) { + for (var o3 = 0, a3 = 0; a3 < t3; a3++) + o3 += 0 | e4[a3], r3[2 * a3] = 8191 & o3, o3 >>>= 13, r3[2 * a3 + 1] = 8191 & o3, o3 >>>= 13; + for (a3 = 2 * t3; a3 < i3; ++a3) + r3[a3] = 0; + n2(0 === o3), n2(0 == (-8192 & o3)); + }, m2.prototype.stub = function(e4) { + for (var t3 = new Array(e4), n3 = 0; n3 < e4; n3++) + t3[n3] = 0; + return t3; + }, m2.prototype.mulp = function(e4, t3, n3) { + var r3 = 2 * this.guessLen13b(e4.length, t3.length), i3 = this.makeRBT(r3), o3 = this.stub(r3), a3 = new Array(r3), s3 = new Array(r3), u3 = new Array(r3), l3 = new Array(r3), c3 = new Array(r3), d3 = new Array(r3), f3 = n3.words; + f3.length = r3, this.convert13b(e4.words, e4.length, a3, r3), this.convert13b(t3.words, t3.length, l3, r3), this.transform(a3, o3, s3, u3, r3, i3), this.transform(l3, o3, c3, d3, r3, i3); + for (var h3 = 0; h3 < r3; h3++) { + var p3 = s3[h3] * c3[h3] - u3[h3] * d3[h3]; + u3[h3] = s3[h3] * d3[h3] + u3[h3] * c3[h3], s3[h3] = p3; + } + return this.conjugate(s3, u3, r3), this.transform(s3, u3, f3, o3, r3, i3), this.conjugate(f3, o3, r3), this.normalize13b(f3, r3), n3.negative = e4.negative ^ t3.negative, n3.length = e4.length + t3.length, n3.strip(); + }, i2.prototype.mul = function(e4) { + var t3 = new i2(null); + return t3.words = new Array(this.length + e4.length), this.mulTo(e4, t3); + }, i2.prototype.mulf = function(e4) { + var t3 = new i2(null); + return t3.words = new Array(this.length + e4.length), p2(this, e4, t3); + }, i2.prototype.imul = function(e4) { + return this.clone().mulTo(e4, this); + }, i2.prototype.imuln = function(e4) { + n2("number" == typeof e4), n2(e4 < 67108864); + for (var t3 = 0, r3 = 0; r3 < this.length; r3++) { + var i3 = (0 | this.words[r3]) * e4, o3 = (67108863 & i3) + (67108863 & t3); + t3 >>= 26, t3 += i3 / 67108864 | 0, t3 += o3 >>> 26, this.words[r3] = 67108863 & o3; + } + return 0 !== t3 && (this.words[r3] = t3, this.length++), this; + }, i2.prototype.muln = function(e4) { + return this.clone().imuln(e4); + }, i2.prototype.sqr = function() { + return this.mul(this); + }, i2.prototype.isqr = function() { + return this.imul(this.clone()); + }, i2.prototype.pow = function(e4) { + var t3 = function(e5) { + for (var t4 = new Array(e5.bitLength()), n4 = 0; n4 < t4.length; n4++) { + var r4 = n4 / 26 | 0, i3 = n4 % 26; + t4[n4] = (e5.words[r4] & 1 << i3) >>> i3; + } + return t4; + }(e4); + if (0 === t3.length) + return new i2(1); + for (var n3 = this, r3 = 0; r3 < t3.length && 0 === t3[r3]; r3++, n3 = n3.sqr()) + ; + if (++r3 < t3.length) + for (var o3 = n3.sqr(); r3 < t3.length; r3++, o3 = o3.sqr()) + 0 !== t3[r3] && (n3 = n3.mul(o3)); + return n3; + }, i2.prototype.iushln = function(e4) { + n2("number" == typeof e4 && e4 >= 0); + var t3, r3 = e4 % 26, i3 = (e4 - r3) / 26, o3 = 67108863 >>> 26 - r3 << 26 - r3; + if (0 !== r3) { + var a3 = 0; + for (t3 = 0; t3 < this.length; t3++) { + var s3 = this.words[t3] & o3, u3 = (0 | this.words[t3]) - s3 << r3; + this.words[t3] = u3 | a3, a3 = s3 >>> 26 - r3; + } + a3 && (this.words[t3] = a3, this.length++); + } + if (0 !== i3) { + for (t3 = this.length - 1; t3 >= 0; t3--) + this.words[t3 + i3] = this.words[t3]; + for (t3 = 0; t3 < i3; t3++) + this.words[t3] = 0; + this.length += i3; + } + return this.strip(); + }, i2.prototype.ishln = function(e4) { + return n2(0 === this.negative), this.iushln(e4); + }, i2.prototype.iushrn = function(e4, t3, r3) { + var i3; + n2("number" == typeof e4 && e4 >= 0), i3 = t3 ? (t3 - t3 % 26) / 26 : 0; + var o3 = e4 % 26, a3 = Math.min((e4 - o3) / 26, this.length), s3 = 67108863 ^ 67108863 >>> o3 << o3, u3 = r3; + if (i3 -= a3, i3 = Math.max(0, i3), u3) { + for (var l3 = 0; l3 < a3; l3++) + u3.words[l3] = this.words[l3]; + u3.length = a3; + } + if (0 === a3) + ; + else if (this.length > a3) + for (this.length -= a3, l3 = 0; l3 < this.length; l3++) + this.words[l3] = this.words[l3 + a3]; + else + this.words[0] = 0, this.length = 1; + var c3 = 0; + for (l3 = this.length - 1; l3 >= 0 && (0 !== c3 || l3 >= i3); l3--) { + var d3 = 0 | this.words[l3]; + this.words[l3] = c3 << 26 - o3 | d3 >>> o3, c3 = d3 & s3; + } + return u3 && 0 !== c3 && (u3.words[u3.length++] = c3), 0 === this.length && (this.words[0] = 0, this.length = 1), this.strip(); + }, i2.prototype.ishrn = function(e4, t3, r3) { + return n2(0 === this.negative), this.iushrn(e4, t3, r3); + }, i2.prototype.shln = function(e4) { + return this.clone().ishln(e4); + }, i2.prototype.ushln = function(e4) { + return this.clone().iushln(e4); + }, i2.prototype.shrn = function(e4) { + return this.clone().ishrn(e4); + }, i2.prototype.ushrn = function(e4) { + return this.clone().iushrn(e4); + }, i2.prototype.testn = function(e4) { + n2("number" == typeof e4 && e4 >= 0); + var t3 = e4 % 26, r3 = (e4 - t3) / 26, i3 = 1 << t3; + return !(this.length <= r3) && !!(this.words[r3] & i3); + }, i2.prototype.imaskn = function(e4) { + n2("number" == typeof e4 && e4 >= 0); + var t3 = e4 % 26, r3 = (e4 - t3) / 26; + if (n2(0 === this.negative, "imaskn works only with positive numbers"), this.length <= r3) + return this; + if (0 !== t3 && r3++, this.length = Math.min(r3, this.length), 0 !== t3) { + var i3 = 67108863 ^ 67108863 >>> t3 << t3; + this.words[this.length - 1] &= i3; + } + return this.strip(); + }, i2.prototype.maskn = function(e4) { + return this.clone().imaskn(e4); + }, i2.prototype.iaddn = function(e4) { + return n2("number" == typeof e4), n2(e4 < 67108864), e4 < 0 ? this.isubn(-e4) : 0 !== this.negative ? 1 === this.length && (0 | this.words[0]) < e4 ? (this.words[0] = e4 - (0 | this.words[0]), this.negative = 0, this) : (this.negative = 0, this.isubn(e4), this.negative = 1, this) : this._iaddn(e4); + }, i2.prototype._iaddn = function(e4) { + this.words[0] += e4; + for (var t3 = 0; t3 < this.length && this.words[t3] >= 67108864; t3++) + this.words[t3] -= 67108864, t3 === this.length - 1 ? this.words[t3 + 1] = 1 : this.words[t3 + 1]++; + return this.length = Math.max(this.length, t3 + 1), this; + }, i2.prototype.isubn = function(e4) { + if (n2("number" == typeof e4), n2(e4 < 67108864), e4 < 0) + return this.iaddn(-e4); + if (0 !== this.negative) + return this.negative = 0, this.iaddn(e4), this.negative = 1, this; + if (this.words[0] -= e4, 1 === this.length && this.words[0] < 0) + this.words[0] = -this.words[0], this.negative = 1; + else + for (var t3 = 0; t3 < this.length && this.words[t3] < 0; t3++) + this.words[t3] += 67108864, this.words[t3 + 1] -= 1; + return this.strip(); + }, i2.prototype.addn = function(e4) { + return this.clone().iaddn(e4); + }, i2.prototype.subn = function(e4) { + return this.clone().isubn(e4); + }, i2.prototype.iabs = function() { + return this.negative = 0, this; + }, i2.prototype.abs = function() { + return this.clone().iabs(); + }, i2.prototype._ishlnsubmul = function(e4, t3, r3) { + var i3, o3, a3 = e4.length + r3; + this._expand(a3); + var s3 = 0; + for (i3 = 0; i3 < e4.length; i3++) { + o3 = (0 | this.words[i3 + r3]) + s3; + var u3 = (0 | e4.words[i3]) * t3; + s3 = ((o3 -= 67108863 & u3) >> 26) - (u3 / 67108864 | 0), this.words[i3 + r3] = 67108863 & o3; + } + for (; i3 < this.length - r3; i3++) + s3 = (o3 = (0 | this.words[i3 + r3]) + s3) >> 26, this.words[i3 + r3] = 67108863 & o3; + if (0 === s3) + return this.strip(); + for (n2(-1 === s3), s3 = 0, i3 = 0; i3 < this.length; i3++) + s3 = (o3 = -(0 | this.words[i3]) + s3) >> 26, this.words[i3] = 67108863 & o3; + return this.negative = 1, this.strip(); + }, i2.prototype._wordDiv = function(e4, t3) { + var n3 = (this.length, e4.length), r3 = this.clone(), o3 = e4, a3 = 0 | o3.words[o3.length - 1]; + 0 !== (n3 = 26 - this._countBits(a3)) && (o3 = o3.ushln(n3), r3.iushln(n3), a3 = 0 | o3.words[o3.length - 1]); + var s3, u3 = r3.length - o3.length; + if ("mod" !== t3) { + (s3 = new i2(null)).length = u3 + 1, s3.words = new Array(s3.length); + for (var l3 = 0; l3 < s3.length; l3++) + s3.words[l3] = 0; + } + var c3 = r3.clone()._ishlnsubmul(o3, 1, u3); + 0 === c3.negative && (r3 = c3, s3 && (s3.words[u3] = 1)); + for (var d3 = u3 - 1; d3 >= 0; d3--) { + var f3 = 67108864 * (0 | r3.words[o3.length + d3]) + (0 | r3.words[o3.length + d3 - 1]); + for (f3 = Math.min(f3 / a3 | 0, 67108863), r3._ishlnsubmul(o3, f3, d3); 0 !== r3.negative; ) + f3--, r3.negative = 0, r3._ishlnsubmul(o3, 1, d3), r3.isZero() || (r3.negative ^= 1); + s3 && (s3.words[d3] = f3); + } + return s3 && s3.strip(), r3.strip(), "div" !== t3 && 0 !== n3 && r3.iushrn(n3), { div: s3 || null, mod: r3 }; + }, i2.prototype.divmod = function(e4, t3, r3) { + return n2(!e4.isZero()), this.isZero() ? { div: new i2(0), mod: new i2(0) } : 0 !== this.negative && 0 === e4.negative ? (s3 = this.neg().divmod(e4, t3), "mod" !== t3 && (o3 = s3.div.neg()), "div" !== t3 && (a3 = s3.mod.neg(), r3 && 0 !== a3.negative && a3.iadd(e4)), { div: o3, mod: a3 }) : 0 === this.negative && 0 !== e4.negative ? (s3 = this.divmod(e4.neg(), t3), "mod" !== t3 && (o3 = s3.div.neg()), { div: o3, mod: s3.mod }) : 0 != (this.negative & e4.negative) ? (s3 = this.neg().divmod(e4.neg(), t3), "div" !== t3 && (a3 = s3.mod.neg(), r3 && 0 !== a3.negative && a3.isub(e4)), { div: s3.div, mod: a3 }) : e4.length > this.length || this.cmp(e4) < 0 ? { div: new i2(0), mod: this } : 1 === e4.length ? "div" === t3 ? { div: this.divn(e4.words[0]), mod: null } : "mod" === t3 ? { div: null, mod: new i2(this.modn(e4.words[0])) } : { div: this.divn(e4.words[0]), mod: new i2(this.modn(e4.words[0])) } : this._wordDiv(e4, t3); + var o3, a3, s3; + }, i2.prototype.div = function(e4) { + return this.divmod(e4, "div", false).div; + }, i2.prototype.mod = function(e4) { + return this.divmod(e4, "mod", false).mod; + }, i2.prototype.umod = function(e4) { + return this.divmod(e4, "mod", true).mod; + }, i2.prototype.divRound = function(e4) { + var t3 = this.divmod(e4); + if (t3.mod.isZero()) + return t3.div; + var n3 = 0 !== t3.div.negative ? t3.mod.isub(e4) : t3.mod, r3 = e4.ushrn(1), i3 = e4.andln(1), o3 = n3.cmp(r3); + return o3 < 0 || 1 === i3 && 0 === o3 ? t3.div : 0 !== t3.div.negative ? t3.div.isubn(1) : t3.div.iaddn(1); + }, i2.prototype.modn = function(e4) { + n2(e4 <= 67108863); + for (var t3 = (1 << 26) % e4, r3 = 0, i3 = this.length - 1; i3 >= 0; i3--) + r3 = (t3 * r3 + (0 | this.words[i3])) % e4; + return r3; + }, i2.prototype.idivn = function(e4) { + n2(e4 <= 67108863); + for (var t3 = 0, r3 = this.length - 1; r3 >= 0; r3--) { + var i3 = (0 | this.words[r3]) + 67108864 * t3; + this.words[r3] = i3 / e4 | 0, t3 = i3 % e4; + } + return this.strip(); + }, i2.prototype.divn = function(e4) { + return this.clone().idivn(e4); + }, i2.prototype.egcd = function(e4) { + n2(0 === e4.negative), n2(!e4.isZero()); + var t3 = this, r3 = e4.clone(); + t3 = 0 !== t3.negative ? t3.umod(e4) : t3.clone(); + for (var o3 = new i2(1), a3 = new i2(0), s3 = new i2(0), u3 = new i2(1), l3 = 0; t3.isEven() && r3.isEven(); ) + t3.iushrn(1), r3.iushrn(1), ++l3; + for (var c3 = r3.clone(), d3 = t3.clone(); !t3.isZero(); ) { + for (var f3 = 0, h3 = 1; 0 == (t3.words[0] & h3) && f3 < 26; ++f3, h3 <<= 1) + ; + if (f3 > 0) + for (t3.iushrn(f3); f3-- > 0; ) + (o3.isOdd() || a3.isOdd()) && (o3.iadd(c3), a3.isub(d3)), o3.iushrn(1), a3.iushrn(1); + for (var p3 = 0, m3 = 1; 0 == (r3.words[0] & m3) && p3 < 26; ++p3, m3 <<= 1) + ; + if (p3 > 0) + for (r3.iushrn(p3); p3-- > 0; ) + (s3.isOdd() || u3.isOdd()) && (s3.iadd(c3), u3.isub(d3)), s3.iushrn(1), u3.iushrn(1); + t3.cmp(r3) >= 0 ? (t3.isub(r3), o3.isub(s3), a3.isub(u3)) : (r3.isub(t3), s3.isub(o3), u3.isub(a3)); + } + return { a: s3, b: u3, gcd: r3.iushln(l3) }; + }, i2.prototype._invmp = function(e4) { + n2(0 === e4.negative), n2(!e4.isZero()); + var t3 = this, r3 = e4.clone(); + t3 = 0 !== t3.negative ? t3.umod(e4) : t3.clone(); + for (var o3, a3 = new i2(1), s3 = new i2(0), u3 = r3.clone(); t3.cmpn(1) > 0 && r3.cmpn(1) > 0; ) { + for (var l3 = 0, c3 = 1; 0 == (t3.words[0] & c3) && l3 < 26; ++l3, c3 <<= 1) + ; + if (l3 > 0) + for (t3.iushrn(l3); l3-- > 0; ) + a3.isOdd() && a3.iadd(u3), a3.iushrn(1); + for (var d3 = 0, f3 = 1; 0 == (r3.words[0] & f3) && d3 < 26; ++d3, f3 <<= 1) + ; + if (d3 > 0) + for (r3.iushrn(d3); d3-- > 0; ) + s3.isOdd() && s3.iadd(u3), s3.iushrn(1); + t3.cmp(r3) >= 0 ? (t3.isub(r3), a3.isub(s3)) : (r3.isub(t3), s3.isub(a3)); + } + return (o3 = 0 === t3.cmpn(1) ? a3 : s3).cmpn(0) < 0 && o3.iadd(e4), o3; + }, i2.prototype.gcd = function(e4) { + if (this.isZero()) + return e4.abs(); + if (e4.isZero()) + return this.abs(); + var t3 = this.clone(), n3 = e4.clone(); + t3.negative = 0, n3.negative = 0; + for (var r3 = 0; t3.isEven() && n3.isEven(); r3++) + t3.iushrn(1), n3.iushrn(1); + for (; ; ) { + for (; t3.isEven(); ) + t3.iushrn(1); + for (; n3.isEven(); ) + n3.iushrn(1); + var i3 = t3.cmp(n3); + if (i3 < 0) { + var o3 = t3; + t3 = n3, n3 = o3; + } else if (0 === i3 || 0 === n3.cmpn(1)) + break; + t3.isub(n3); + } + return n3.iushln(r3); + }, i2.prototype.invm = function(e4) { + return this.egcd(e4).a.umod(e4); + }, i2.prototype.isEven = function() { + return 0 == (1 & this.words[0]); + }, i2.prototype.isOdd = function() { + return 1 == (1 & this.words[0]); + }, i2.prototype.andln = function(e4) { + return this.words[0] & e4; + }, i2.prototype.bincn = function(e4) { + n2("number" == typeof e4); + var t3 = e4 % 26, r3 = (e4 - t3) / 26, i3 = 1 << t3; + if (this.length <= r3) + return this._expand(r3 + 1), this.words[r3] |= i3, this; + for (var o3 = i3, a3 = r3; 0 !== o3 && a3 < this.length; a3++) { + var s3 = 0 | this.words[a3]; + o3 = (s3 += o3) >>> 26, s3 &= 67108863, this.words[a3] = s3; + } + return 0 !== o3 && (this.words[a3] = o3, this.length++), this; + }, i2.prototype.isZero = function() { + return 1 === this.length && 0 === this.words[0]; + }, i2.prototype.cmpn = function(e4) { + var t3, r3 = e4 < 0; + if (0 !== this.negative && !r3) + return -1; + if (0 === this.negative && r3) + return 1; + if (this.strip(), this.length > 1) + t3 = 1; + else { + r3 && (e4 = -e4), n2(e4 <= 67108863, "Number is too big"); + var i3 = 0 | this.words[0]; + t3 = i3 === e4 ? 0 : i3 < e4 ? -1 : 1; + } + return 0 !== this.negative ? 0 | -t3 : t3; + }, i2.prototype.cmp = function(e4) { + if (0 !== this.negative && 0 === e4.negative) + return -1; + if (0 === this.negative && 0 !== e4.negative) + return 1; + var t3 = this.ucmp(e4); + return 0 !== this.negative ? 0 | -t3 : t3; + }, i2.prototype.ucmp = function(e4) { + if (this.length > e4.length) + return 1; + if (this.length < e4.length) + return -1; + for (var t3 = 0, n3 = this.length - 1; n3 >= 0; n3--) { + var r3 = 0 | this.words[n3], i3 = 0 | e4.words[n3]; + if (r3 !== i3) { + r3 < i3 ? t3 = -1 : r3 > i3 && (t3 = 1); + break; + } + } + return t3; + }, i2.prototype.gtn = function(e4) { + return 1 === this.cmpn(e4); + }, i2.prototype.gt = function(e4) { + return 1 === this.cmp(e4); + }, i2.prototype.gten = function(e4) { + return this.cmpn(e4) >= 0; + }, i2.prototype.gte = function(e4) { + return this.cmp(e4) >= 0; + }, i2.prototype.ltn = function(e4) { + return -1 === this.cmpn(e4); + }, i2.prototype.lt = function(e4) { + return -1 === this.cmp(e4); + }, i2.prototype.lten = function(e4) { + return this.cmpn(e4) <= 0; + }, i2.prototype.lte = function(e4) { + return this.cmp(e4) <= 0; + }, i2.prototype.eqn = function(e4) { + return 0 === this.cmpn(e4); + }, i2.prototype.eq = function(e4) { + return 0 === this.cmp(e4); + }, i2.red = function(e4) { + return new S2(e4); + }, i2.prototype.toRed = function(e4) { + return n2(!this.red, "Already a number in reduction context"), n2(0 === this.negative, "red works only with positives"), e4.convertTo(this)._forceRed(e4); + }, i2.prototype.fromRed = function() { + return n2(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this); + }, i2.prototype._forceRed = function(e4) { + return this.red = e4, this; + }, i2.prototype.forceRed = function(e4) { + return n2(!this.red, "Already a number in reduction context"), this._forceRed(e4); + }, i2.prototype.redAdd = function(e4) { + return n2(this.red, "redAdd works only with red numbers"), this.red.add(this, e4); + }, i2.prototype.redIAdd = function(e4) { + return n2(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, e4); + }, i2.prototype.redSub = function(e4) { + return n2(this.red, "redSub works only with red numbers"), this.red.sub(this, e4); + }, i2.prototype.redISub = function(e4) { + return n2(this.red, "redISub works only with red numbers"), this.red.isub(this, e4); + }, i2.prototype.redShl = function(e4) { + return n2(this.red, "redShl works only with red numbers"), this.red.shl(this, e4); + }, i2.prototype.redMul = function(e4) { + return n2(this.red, "redMul works only with red numbers"), this.red._verify2(this, e4), this.red.mul(this, e4); + }, i2.prototype.redIMul = function(e4) { + return n2(this.red, "redMul works only with red numbers"), this.red._verify2(this, e4), this.red.imul(this, e4); + }, i2.prototype.redSqr = function() { + return n2(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this); + }, i2.prototype.redISqr = function() { + return n2(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this); + }, i2.prototype.redSqrt = function() { + return n2(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this); + }, i2.prototype.redInvm = function() { + return n2(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this); + }, i2.prototype.redNeg = function() { + return n2(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this); + }, i2.prototype.redPow = function(e4) { + return n2(this.red && !e4.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, e4); + }; + var g2 = { k256: null, p224: null, p192: null, p25519: null }; + function v2(e4, t3) { + this.name = e4, this.p = new i2(t3, 16), this.n = this.p.bitLength(), this.k = new i2(1).iushln(this.n).isub(this.p), this.tmp = this._tmp(); + } + function b2() { + v2.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + function y2() { + v2.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + function w2() { + v2.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + function _2() { + v2.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + function S2(e4) { + if ("string" == typeof e4) { + var t3 = i2._prime(e4); + this.m = t3.p, this.prime = t3; + } else + n2(e4.gtn(1), "modulus must be greater than 1"), this.m = e4, this.prime = null; + } + function E2(e4) { + S2.call(this, e4), this.shift = this.m.bitLength(), this.shift % 26 != 0 && (this.shift += 26 - this.shift % 26), this.r = new i2(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); + } + v2.prototype._tmp = function() { + var e4 = new i2(null); + return e4.words = new Array(Math.ceil(this.n / 13)), e4; + }, v2.prototype.ireduce = function(e4) { + var t3, n3 = e4; + do { + this.split(n3, this.tmp), t3 = (n3 = (n3 = this.imulK(n3)).iadd(this.tmp)).bitLength(); + } while (t3 > this.n); + var r3 = t3 < this.n ? -1 : n3.ucmp(this.p); + return 0 === r3 ? (n3.words[0] = 0, n3.length = 1) : r3 > 0 ? n3.isub(this.p) : void 0 !== n3.strip ? n3.strip() : n3._strip(), n3; + }, v2.prototype.split = function(e4, t3) { + e4.iushrn(this.n, 0, t3); + }, v2.prototype.imulK = function(e4) { + return e4.imul(this.k); + }, r2(b2, v2), b2.prototype.split = function(e4, t3) { + for (var n3 = 4194303, r3 = Math.min(e4.length, 9), i3 = 0; i3 < r3; i3++) + t3.words[i3] = e4.words[i3]; + if (t3.length = r3, e4.length <= 9) + return e4.words[0] = 0, void (e4.length = 1); + var o3 = e4.words[9]; + for (t3.words[t3.length++] = o3 & n3, i3 = 10; i3 < e4.length; i3++) { + var a3 = 0 | e4.words[i3]; + e4.words[i3 - 10] = (a3 & n3) << 4 | o3 >>> 22, o3 = a3; + } + o3 >>>= 22, e4.words[i3 - 10] = o3, 0 === o3 && e4.length > 10 ? e4.length -= 10 : e4.length -= 9; + }, b2.prototype.imulK = function(e4) { + e4.words[e4.length] = 0, e4.words[e4.length + 1] = 0, e4.length += 2; + for (var t3 = 0, n3 = 0; n3 < e4.length; n3++) { + var r3 = 0 | e4.words[n3]; + t3 += 977 * r3, e4.words[n3] = 67108863 & t3, t3 = 64 * r3 + (t3 / 67108864 | 0); + } + return 0 === e4.words[e4.length - 1] && (e4.length--, 0 === e4.words[e4.length - 1] && e4.length--), e4; + }, r2(y2, v2), r2(w2, v2), r2(_2, v2), _2.prototype.imulK = function(e4) { + for (var t3 = 0, n3 = 0; n3 < e4.length; n3++) { + var r3 = 19 * (0 | e4.words[n3]) + t3, i3 = 67108863 & r3; + r3 >>>= 26, e4.words[n3] = i3, t3 = r3; + } + return 0 !== t3 && (e4.words[e4.length++] = t3), e4; + }, i2._prime = function(e4) { + if (g2[e4]) + return g2[e4]; + var t3; + if ("k256" === e4) + t3 = new b2(); + else if ("p224" === e4) + t3 = new y2(); + else if ("p192" === e4) + t3 = new w2(); + else { + if ("p25519" !== e4) + throw new Error("Unknown prime " + e4); + t3 = new _2(); + } + return g2[e4] = t3, t3; + }, S2.prototype._verify1 = function(e4) { + n2(0 === e4.negative, "red works only with positives"), n2(e4.red, "red works only with red numbers"); + }, S2.prototype._verify2 = function(e4, t3) { + n2(0 == (e4.negative | t3.negative), "red works only with positives"), n2(e4.red && e4.red === t3.red, "red works only with red numbers"); + }, S2.prototype.imod = function(e4) { + return this.prime ? this.prime.ireduce(e4)._forceRed(this) : e4.umod(this.m)._forceRed(this); + }, S2.prototype.neg = function(e4) { + return e4.isZero() ? e4.clone() : this.m.sub(e4)._forceRed(this); + }, S2.prototype.add = function(e4, t3) { + this._verify2(e4, t3); + var n3 = e4.add(t3); + return n3.cmp(this.m) >= 0 && n3.isub(this.m), n3._forceRed(this); + }, S2.prototype.iadd = function(e4, t3) { + this._verify2(e4, t3); + var n3 = e4.iadd(t3); + return n3.cmp(this.m) >= 0 && n3.isub(this.m), n3; + }, S2.prototype.sub = function(e4, t3) { + this._verify2(e4, t3); + var n3 = e4.sub(t3); + return n3.cmpn(0) < 0 && n3.iadd(this.m), n3._forceRed(this); + }, S2.prototype.isub = function(e4, t3) { + this._verify2(e4, t3); + var n3 = e4.isub(t3); + return n3.cmpn(0) < 0 && n3.iadd(this.m), n3; + }, S2.prototype.shl = function(e4, t3) { + return this._verify1(e4), this.imod(e4.ushln(t3)); + }, S2.prototype.imul = function(e4, t3) { + return this._verify2(e4, t3), this.imod(e4.imul(t3)); + }, S2.prototype.mul = function(e4, t3) { + return this._verify2(e4, t3), this.imod(e4.mul(t3)); + }, S2.prototype.isqr = function(e4) { + return this.imul(e4, e4.clone()); + }, S2.prototype.sqr = function(e4) { + return this.mul(e4, e4); + }, S2.prototype.sqrt = function(e4) { + if (e4.isZero()) + return e4.clone(); + var t3 = this.m.andln(3); + if (n2(t3 % 2 == 1), 3 === t3) { + var r3 = this.m.add(new i2(1)).iushrn(2); + return this.pow(e4, r3); + } + for (var o3 = this.m.subn(1), a3 = 0; !o3.isZero() && 0 === o3.andln(1); ) + a3++, o3.iushrn(1); + n2(!o3.isZero()); + var s3 = new i2(1).toRed(this), u3 = s3.redNeg(), l3 = this.m.subn(1).iushrn(1), c3 = this.m.bitLength(); + for (c3 = new i2(2 * c3 * c3).toRed(this); 0 !== this.pow(c3, l3).cmp(u3); ) + c3.redIAdd(u3); + for (var d3 = this.pow(c3, o3), f3 = this.pow(e4, o3.addn(1).iushrn(1)), h3 = this.pow(e4, o3), p3 = a3; 0 !== h3.cmp(s3); ) { + for (var m3 = h3, g3 = 0; 0 !== m3.cmp(s3); g3++) + m3 = m3.redSqr(); + n2(g3 < p3); + var v3 = this.pow(d3, new i2(1).iushln(p3 - g3 - 1)); + f3 = f3.redMul(v3), d3 = v3.redSqr(), h3 = h3.redMul(d3), p3 = g3; + } + return f3; + }, S2.prototype.invm = function(e4) { + var t3 = e4._invmp(this.m); + return 0 !== t3.negative ? (t3.negative = 0, this.imod(t3).redNeg()) : this.imod(t3); + }, S2.prototype.pow = function(e4, t3) { + if (t3.isZero()) + return new i2(1).toRed(this); + if (0 === t3.cmpn(1)) + return e4.clone(); + var n3 = new Array(16); + n3[0] = new i2(1).toRed(this), n3[1] = e4; + for (var r3 = 2; r3 < n3.length; r3++) + n3[r3] = this.mul(n3[r3 - 1], e4); + var o3 = n3[0], a3 = 0, s3 = 0, u3 = t3.bitLength() % 26; + for (0 === u3 && (u3 = 26), r3 = t3.length - 1; r3 >= 0; r3--) { + for (var l3 = t3.words[r3], c3 = u3 - 1; c3 >= 0; c3--) { + var d3 = l3 >> c3 & 1; + o3 !== n3[0] && (o3 = this.sqr(o3)), 0 !== d3 || 0 !== a3 ? (a3 <<= 1, a3 |= d3, (4 === ++s3 || 0 === r3 && 0 === c3) && (o3 = this.mul(o3, n3[a3]), s3 = 0, a3 = 0)) : s3 = 0; + } + u3 = 26; + } + return o3; + }, S2.prototype.convertTo = function(e4) { + var t3 = e4.umod(this.m); + return t3 === e4 ? t3.clone() : t3; + }, S2.prototype.convertFrom = function(e4) { + var t3 = e4.clone(); + return t3.red = null, t3; + }, i2.mont = function(e4) { + return new E2(e4); + }, r2(E2, S2), E2.prototype.convertTo = function(e4) { + return this.imod(e4.ushln(this.shift)); + }, E2.prototype.convertFrom = function(e4) { + var t3 = this.imod(e4.mul(this.rinv)); + return t3.red = null, t3; + }, E2.prototype.imul = function(e4, t3) { + if (e4.isZero() || t3.isZero()) + return e4.words[0] = 0, e4.length = 1, e4; + var n3 = e4.imul(t3), r3 = n3.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), i3 = n3.isub(r3).iushrn(this.shift), o3 = i3; + return i3.cmp(this.m) >= 0 ? o3 = i3.isub(this.m) : i3.cmpn(0) < 0 && (o3 = i3.iadd(this.m)), o3._forceRed(this); + }, E2.prototype.mul = function(e4, t3) { + if (e4.isZero() || t3.isZero()) + return new i2(0)._forceRed(this); + var n3 = e4.mul(t3), r3 = n3.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), o3 = n3.isub(r3).iushrn(this.shift), a3 = o3; + return o3.cmp(this.m) >= 0 ? a3 = o3.isub(this.m) : o3.cmpn(0) < 0 && (a3 = o3.iadd(this.m)), a3._forceRed(this); + }, E2.prototype.invm = function(e4) { + return this.imod(e4._invmp(this.m).mul(this.r2))._forceRed(this); + }; + }(e2, n); + }(mg); + var gg = mg.exports, vg = bg; + function bg(e2, t2) { + if (!e2) + throw new Error(t2 || "Assertion failed"); + } + bg.equal = function(e2, t2, n2) { + if (e2 != t2) + throw new Error(n2 || "Assertion failed: " + e2 + " != " + t2); + }; + var yg = {}; + !function(e2) { + var t2 = e2; + function n2(e3) { + return 1 === e3.length ? "0" + e3 : e3; + } + function r2(e3) { + for (var t3 = "", r3 = 0; r3 < e3.length; r3++) + t3 += n2(e3[r3].toString(16)); + return t3; + } + t2.toArray = function(e3, t3) { + if (Array.isArray(e3)) + return e3.slice(); + if (!e3) + return []; + var n3 = []; + if ("string" != typeof e3) { + for (var r3 = 0; r3 < e3.length; r3++) + n3[r3] = 0 | e3[r3]; + return n3; + } + if ("hex" === t3) { + (e3 = e3.replace(/[^a-z0-9]+/gi, "")).length % 2 != 0 && (e3 = "0" + e3); + for (r3 = 0; r3 < e3.length; r3 += 2) + n3.push(parseInt(e3[r3] + e3[r3 + 1], 16)); + } else + for (r3 = 0; r3 < e3.length; r3++) { + var i2 = e3.charCodeAt(r3), o2 = i2 >> 8, a2 = 255 & i2; + o2 ? n3.push(o2, a2) : n3.push(a2); + } + return n3; + }, t2.zero2 = n2, t2.toHex = r2, t2.encode = function(e3, t3) { + return "hex" === t3 ? r2(e3) : e3; + }; + }(yg), function(e2) { + var t2 = e2, n2 = gg, r2 = vg, i2 = yg; + t2.assert = r2, t2.toArray = i2.toArray, t2.zero2 = i2.zero2, t2.toHex = i2.toHex, t2.encode = i2.encode, t2.getNAF = function(e3, t3, n3) { + var r3 = new Array(Math.max(e3.bitLength(), n3) + 1); + r3.fill(0); + for (var i3 = 1 << t3 + 1, o2 = e3.clone(), a2 = 0; a2 < r3.length; a2++) { + var s2, u2 = o2.andln(i3 - 1); + o2.isOdd() ? (s2 = u2 > (i3 >> 1) - 1 ? (i3 >> 1) - u2 : u2, o2.isubn(s2)) : s2 = 0, r3[a2] = s2, o2.iushrn(1); + } + return r3; + }, t2.getJSF = function(e3, t3) { + var n3 = [[], []]; + e3 = e3.clone(), t3 = t3.clone(); + for (var r3, i3 = 0, o2 = 0; e3.cmpn(-i3) > 0 || t3.cmpn(-o2) > 0; ) { + var a2, s2, u2 = e3.andln(3) + i3 & 3, l2 = t3.andln(3) + o2 & 3; + 3 === u2 && (u2 = -1), 3 === l2 && (l2 = -1), a2 = 0 == (1 & u2) ? 0 : 3 !== (r3 = e3.andln(7) + i3 & 7) && 5 !== r3 || 2 !== l2 ? u2 : -u2, n3[0].push(a2), s2 = 0 == (1 & l2) ? 0 : 3 !== (r3 = t3.andln(7) + o2 & 7) && 5 !== r3 || 2 !== u2 ? l2 : -l2, n3[1].push(s2), 2 * i3 === a2 + 1 && (i3 = 1 - i3), 2 * o2 === s2 + 1 && (o2 = 1 - o2), e3.iushrn(1), t3.iushrn(1); + } + return n3; + }, t2.cachedProperty = function(e3, t3, n3) { + var r3 = "_" + t3; + e3.prototype[t3] = function() { + return void 0 !== this[r3] ? this[r3] : this[r3] = n3.call(this); + }; + }, t2.parseBytes = function(e3) { + return "string" == typeof e3 ? t2.toArray(e3, "hex") : e3; + }, t2.intFromLE = function(e3) { + return new n2(e3, "hex", "le"); + }; + }(pg); + var wg, _g = { exports: {} }; + function Sg(e2) { + this.rand = e2; + } + if (_g.exports = function(e2) { + return wg || (wg = new Sg(null)), wg.generate(e2); + }, _g.exports.Rand = Sg, Sg.prototype.generate = function(e2) { + return this._rand(e2); + }, Sg.prototype._rand = function(e2) { + if (this.rand.getBytes) + return this.rand.getBytes(e2); + for (var t2 = new Uint8Array(e2), n2 = 0; n2 < t2.length; n2++) + t2[n2] = this.rand.getByte(); + return t2; + }, "object" == typeof self) + self.crypto && self.crypto.getRandomValues ? Sg.prototype._rand = function(e2) { + var t2 = new Uint8Array(e2); + return self.crypto.getRandomValues(t2), t2; + } : self.msCrypto && self.msCrypto.getRandomValues ? Sg.prototype._rand = function(e2) { + var t2 = new Uint8Array(e2); + return self.msCrypto.getRandomValues(t2), t2; + } : "object" == typeof window && (Sg.prototype._rand = function() { + throw new Error("Not implemented yet"); + }); + else + try { + var Eg = zm(); + if ("function" != typeof Eg.randomBytes) + throw new Error("Not supported"); + Sg.prototype._rand = function(e2) { + return Eg.randomBytes(e2); + }; + } catch (a2) { + } + var kg = _g.exports, Mg = {}, Cg = gg, xg = pg, Ag = xg.getNAF, Rg = xg.getJSF, Tg = xg.assert; + function Pg(e2, t2) { + this.type = e2, this.p = new Cg(t2.p, 16), this.red = t2.prime ? Cg.red(t2.prime) : Cg.mont(this.p), this.zero = new Cg(0).toRed(this.red), this.one = new Cg(1).toRed(this.red), this.two = new Cg(2).toRed(this.red), this.n = t2.n && new Cg(t2.n, 16), this.g = t2.g && this.pointFromJSON(t2.g, t2.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 n2 = this.n && this.p.div(this.n); + !n2 || n2.cmpn(100) > 0 ? this.redN = null : (this._maxwellTrick = true, this.redN = this.n.toRed(this.red)); + } + var Lg = Pg; + function Ig(e2, t2) { + this.curve = e2, this.type = t2, this.precomputed = null; + } + Pg.prototype.point = function() { + throw new Error("Not implemented"); + }, Pg.prototype.validate = function() { + throw new Error("Not implemented"); + }, Pg.prototype._fixedNafMul = function(e2, t2) { + Tg(e2.precomputed); + var n2 = e2._getDoubles(), r2 = Ag(t2, 1, this._bitLength), i2 = (1 << n2.step + 1) - (n2.step % 2 == 0 ? 2 : 1); + i2 /= 3; + var o2, a2, s2 = []; + for (o2 = 0; o2 < r2.length; o2 += n2.step) { + a2 = 0; + for (var u2 = o2 + n2.step - 1; u2 >= o2; u2--) + a2 = (a2 << 1) + r2[u2]; + s2.push(a2); + } + for (var l2 = this.jpoint(null, null, null), c2 = this.jpoint(null, null, null), d2 = i2; d2 > 0; d2--) { + for (o2 = 0; o2 < s2.length; o2++) + (a2 = s2[o2]) === d2 ? c2 = c2.mixedAdd(n2.points[o2]) : a2 === -d2 && (c2 = c2.mixedAdd(n2.points[o2].neg())); + l2 = l2.add(c2); + } + return l2.toP(); + }, Pg.prototype._wnafMul = function(e2, t2) { + var n2 = 4, r2 = e2._getNAFPoints(n2); + n2 = r2.wnd; + for (var i2 = r2.points, o2 = Ag(t2, n2, this._bitLength), a2 = this.jpoint(null, null, null), s2 = o2.length - 1; s2 >= 0; s2--) { + for (var u2 = 0; s2 >= 0 && 0 === o2[s2]; s2--) + u2++; + if (s2 >= 0 && u2++, a2 = a2.dblp(u2), s2 < 0) + break; + var l2 = o2[s2]; + Tg(0 !== l2), a2 = "affine" === e2.type ? l2 > 0 ? a2.mixedAdd(i2[l2 - 1 >> 1]) : a2.mixedAdd(i2[-l2 - 1 >> 1].neg()) : l2 > 0 ? a2.add(i2[l2 - 1 >> 1]) : a2.add(i2[-l2 - 1 >> 1].neg()); + } + return "affine" === e2.type ? a2.toP() : a2; + }, Pg.prototype._wnafMulAdd = function(e2, t2, n2, r2, i2) { + var o2, a2, s2, u2 = this._wnafT1, l2 = this._wnafT2, c2 = this._wnafT3, d2 = 0; + for (o2 = 0; o2 < r2; o2++) { + var f2 = (s2 = t2[o2])._getNAFPoints(e2); + u2[o2] = f2.wnd, l2[o2] = f2.points; + } + for (o2 = r2 - 1; o2 >= 1; o2 -= 2) { + var h2 = o2 - 1, p2 = o2; + if (1 === u2[h2] && 1 === u2[p2]) { + var m2 = [t2[h2], null, null, t2[p2]]; + 0 === t2[h2].y.cmp(t2[p2].y) ? (m2[1] = t2[h2].add(t2[p2]), m2[2] = t2[h2].toJ().mixedAdd(t2[p2].neg())) : 0 === t2[h2].y.cmp(t2[p2].y.redNeg()) ? (m2[1] = t2[h2].toJ().mixedAdd(t2[p2]), m2[2] = t2[h2].add(t2[p2].neg())) : (m2[1] = t2[h2].toJ().mixedAdd(t2[p2]), m2[2] = t2[h2].toJ().mixedAdd(t2[p2].neg())); + var g2 = [-3, -1, -5, -7, 0, 7, 5, 1, 3], v2 = Rg(n2[h2], n2[p2]); + for (d2 = Math.max(v2[0].length, d2), c2[h2] = new Array(d2), c2[p2] = new Array(d2), a2 = 0; a2 < d2; a2++) { + var b2 = 0 | v2[0][a2], y2 = 0 | v2[1][a2]; + c2[h2][a2] = g2[3 * (b2 + 1) + (y2 + 1)], c2[p2][a2] = 0, l2[h2] = m2; + } + } else + c2[h2] = Ag(n2[h2], u2[h2], this._bitLength), c2[p2] = Ag(n2[p2], u2[p2], this._bitLength), d2 = Math.max(c2[h2].length, d2), d2 = Math.max(c2[p2].length, d2); + } + var w2 = this.jpoint(null, null, null), _2 = this._wnafT4; + for (o2 = d2; o2 >= 0; o2--) { + for (var S2 = 0; o2 >= 0; ) { + var E2 = true; + for (a2 = 0; a2 < r2; a2++) + _2[a2] = 0 | c2[a2][o2], 0 !== _2[a2] && (E2 = false); + if (!E2) + break; + S2++, o2--; + } + if (o2 >= 0 && S2++, w2 = w2.dblp(S2), o2 < 0) + break; + for (a2 = 0; a2 < r2; a2++) { + var k2 = _2[a2]; + 0 !== k2 && (k2 > 0 ? s2 = l2[a2][k2 - 1 >> 1] : k2 < 0 && (s2 = l2[a2][-k2 - 1 >> 1].neg()), w2 = "affine" === s2.type ? w2.mixedAdd(s2) : w2.add(s2)); + } + } + for (o2 = 0; o2 < r2; o2++) + l2[o2] = null; + return i2 ? w2 : w2.toP(); + }, Pg.BasePoint = Ig, Ig.prototype.eq = function() { + throw new Error("Not implemented"); + }, Ig.prototype.validate = function() { + return this.curve.validate(this); + }, Pg.prototype.decodePoint = function(e2, t2) { + e2 = xg.toArray(e2, t2); + var n2 = this.p.byteLength(); + if ((4 === e2[0] || 6 === e2[0] || 7 === e2[0]) && e2.length - 1 == 2 * n2) + return 6 === e2[0] ? Tg(e2[e2.length - 1] % 2 == 0) : 7 === e2[0] && Tg(e2[e2.length - 1] % 2 == 1), this.point(e2.slice(1, 1 + n2), e2.slice(1 + n2, 1 + 2 * n2)); + if ((2 === e2[0] || 3 === e2[0]) && e2.length - 1 === n2) + return this.pointFromX(e2.slice(1, 1 + n2), 3 === e2[0]); + throw new Error("Unknown point format"); + }, Ig.prototype.encodeCompressed = function(e2) { + return this.encode(e2, true); + }, Ig.prototype._encode = function(e2) { + var t2 = this.curve.p.byteLength(), n2 = this.getX().toArray("be", t2); + return e2 ? [this.getY().isEven() ? 2 : 3].concat(n2) : [4].concat(n2, this.getY().toArray("be", t2)); + }, Ig.prototype.encode = function(e2, t2) { + return xg.encode(this._encode(t2), e2); + }, Ig.prototype.precompute = function(e2) { + if (this.precomputed) + return this; + var t2 = { doubles: null, naf: null, beta: null }; + return t2.naf = this._getNAFPoints(8), t2.doubles = this._getDoubles(4, e2), t2.beta = this._getBeta(), this.precomputed = t2, this; + }, Ig.prototype._hasDoubles = function(e2) { + if (!this.precomputed) + return false; + var t2 = this.precomputed.doubles; + return !!t2 && t2.points.length >= Math.ceil((e2.bitLength() + 1) / t2.step); + }, Ig.prototype._getDoubles = function(e2, t2) { + if (this.precomputed && this.precomputed.doubles) + return this.precomputed.doubles; + for (var n2 = [this], r2 = this, i2 = 0; i2 < t2; i2 += e2) { + for (var o2 = 0; o2 < e2; o2++) + r2 = r2.dbl(); + n2.push(r2); + } + return { step: e2, points: n2 }; + }, Ig.prototype._getNAFPoints = function(e2) { + if (this.precomputed && this.precomputed.naf) + return this.precomputed.naf; + for (var t2 = [this], n2 = (1 << e2) - 1, r2 = 1 === n2 ? null : this.dbl(), i2 = 1; i2 < n2; i2++) + t2[i2] = t2[i2 - 1].add(r2); + return { wnd: e2, points: t2 }; + }, Ig.prototype._getBeta = function() { + return null; + }, Ig.prototype.dblp = function(e2) { + for (var t2 = this, n2 = 0; n2 < e2; n2++) + t2 = t2.dbl(); + return t2; + }; + var Og = { exports: {} }; + "function" == typeof Object.create ? Og.exports = function(e2, t2) { + t2 && (e2.super_ = t2, e2.prototype = Object.create(t2.prototype, { constructor: { value: e2, enumerable: false, writable: true, configurable: true } })); + } : Og.exports = function(e2, t2) { + if (t2) { + e2.super_ = t2; + var n2 = function() { + }; + n2.prototype = t2.prototype, e2.prototype = new n2(), e2.prototype.constructor = e2; + } + }; + var Ng = Og.exports, Dg = gg, jg = Ng, Bg = Lg, zg = pg.assert; + function Ug(e2) { + Bg.call(this, "short", e2), this.a = new Dg(e2.a, 16).toRed(this.red), this.b = new Dg(e2.b, 16).toRed(this.red), this.tinv = this.two.redInvm(), this.zeroA = 0 === this.a.fromRed().cmpn(0), this.threeA = 0 === this.a.fromRed().sub(this.p).cmpn(-3), this.endo = this._getEndomorphism(e2), this._endoWnafT1 = new Array(4), this._endoWnafT2 = new Array(4); + } + jg(Ug, Bg); + var Fg = Ug; + function Kg(e2, t2, n2, r2) { + Bg.BasePoint.call(this, e2, "affine"), null === t2 && null === n2 ? (this.x = null, this.y = null, this.inf = true) : (this.x = new Dg(t2, 16), this.y = new Dg(n2, 16), r2 && (this.x.forceRed(this.curve.red), this.y.forceRed(this.curve.red)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.inf = false); + } + function qg(e2, t2, n2, r2) { + Bg.BasePoint.call(this, e2, "jacobian"), null === t2 && null === n2 && null === r2 ? (this.x = this.curve.one, this.y = this.curve.one, this.z = new Dg(0)) : (this.x = new Dg(t2, 16), this.y = new Dg(n2, 16), this.z = new Dg(r2, 16)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.zOne = this.z === this.curve.one; + } + Ug.prototype._getEndomorphism = function(e2) { + if (this.zeroA && this.g && this.n && 1 === this.p.modn(3)) { + var t2, n2; + if (e2.beta) + t2 = new Dg(e2.beta, 16).toRed(this.red); + else { + var r2 = this._getEndoRoots(this.p); + t2 = (t2 = r2[0].cmp(r2[1]) < 0 ? r2[0] : r2[1]).toRed(this.red); + } + if (e2.lambda) + n2 = new Dg(e2.lambda, 16); + else { + var i2 = this._getEndoRoots(this.n); + 0 === this.g.mul(i2[0]).x.cmp(this.g.x.redMul(t2)) ? n2 = i2[0] : (n2 = i2[1], zg(0 === this.g.mul(n2).x.cmp(this.g.x.redMul(t2)))); + } + return { beta: t2, lambda: n2, basis: e2.basis ? e2.basis.map(function(e3) { + return { a: new Dg(e3.a, 16), b: new Dg(e3.b, 16) }; + }) : this._getEndoBasis(n2) }; + } + }, Ug.prototype._getEndoRoots = function(e2) { + var t2 = e2 === this.p ? this.red : Dg.mont(e2), n2 = new Dg(2).toRed(t2).redInvm(), r2 = n2.redNeg(), i2 = new Dg(3).toRed(t2).redNeg().redSqrt().redMul(n2); + return [r2.redAdd(i2).fromRed(), r2.redSub(i2).fromRed()]; + }, Ug.prototype._getEndoBasis = function(e2) { + for (var t2, n2, r2, i2, o2, a2, s2, u2, l2, c2 = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), d2 = e2, f2 = this.n.clone(), h2 = new Dg(1), p2 = new Dg(0), m2 = new Dg(0), g2 = new Dg(1), v2 = 0; 0 !== d2.cmpn(0); ) { + var b2 = f2.div(d2); + u2 = f2.sub(b2.mul(d2)), l2 = m2.sub(b2.mul(h2)); + var y2 = g2.sub(b2.mul(p2)); + if (!r2 && u2.cmp(c2) < 0) + t2 = s2.neg(), n2 = h2, r2 = u2.neg(), i2 = l2; + else if (r2 && 2 == ++v2) + break; + s2 = u2, f2 = d2, d2 = u2, m2 = h2, h2 = l2, g2 = p2, p2 = y2; + } + o2 = u2.neg(), a2 = l2; + var w2 = r2.sqr().add(i2.sqr()); + return o2.sqr().add(a2.sqr()).cmp(w2) >= 0 && (o2 = t2, a2 = n2), r2.negative && (r2 = r2.neg(), i2 = i2.neg()), o2.negative && (o2 = o2.neg(), a2 = a2.neg()), [{ a: r2, b: i2 }, { a: o2, b: a2 }]; + }, Ug.prototype._endoSplit = function(e2) { + var t2 = this.endo.basis, n2 = t2[0], r2 = t2[1], i2 = r2.b.mul(e2).divRound(this.n), o2 = n2.b.neg().mul(e2).divRound(this.n), a2 = i2.mul(n2.a), s2 = o2.mul(r2.a), u2 = i2.mul(n2.b), l2 = o2.mul(r2.b); + return { k1: e2.sub(a2).sub(s2), k2: u2.add(l2).neg() }; + }, Ug.prototype.pointFromX = function(e2, t2) { + (e2 = new Dg(e2, 16)).red || (e2 = e2.toRed(this.red)); + var n2 = e2.redSqr().redMul(e2).redIAdd(e2.redMul(this.a)).redIAdd(this.b), r2 = n2.redSqrt(); + if (0 !== r2.redSqr().redSub(n2).cmp(this.zero)) + throw new Error("invalid point"); + var i2 = r2.fromRed().isOdd(); + return (t2 && !i2 || !t2 && i2) && (r2 = r2.redNeg()), this.point(e2, r2); + }, Ug.prototype.validate = function(e2) { + if (e2.inf) + return true; + var t2 = e2.x, n2 = e2.y, r2 = this.a.redMul(t2), i2 = t2.redSqr().redMul(t2).redIAdd(r2).redIAdd(this.b); + return 0 === n2.redSqr().redISub(i2).cmpn(0); + }, Ug.prototype._endoWnafMulAdd = function(e2, t2, n2) { + for (var r2 = this._endoWnafT1, i2 = this._endoWnafT2, o2 = 0; o2 < e2.length; o2++) { + var a2 = this._endoSplit(t2[o2]), s2 = e2[o2], u2 = s2._getBeta(); + a2.k1.negative && (a2.k1.ineg(), s2 = s2.neg(true)), a2.k2.negative && (a2.k2.ineg(), u2 = u2.neg(true)), r2[2 * o2] = s2, r2[2 * o2 + 1] = u2, i2[2 * o2] = a2.k1, i2[2 * o2 + 1] = a2.k2; + } + for (var l2 = this._wnafMulAdd(1, r2, i2, 2 * o2, n2), c2 = 0; c2 < 2 * o2; c2++) + r2[c2] = null, i2[c2] = null; + return l2; + }, jg(Kg, Bg.BasePoint), Ug.prototype.point = function(e2, t2, n2) { + return new Kg(this, e2, t2, n2); + }, Ug.prototype.pointFromJSON = function(e2, t2) { + return Kg.fromJSON(this, e2, t2); + }, Kg.prototype._getBeta = function() { + if (this.curve.endo) { + var e2 = this.precomputed; + if (e2 && e2.beta) + return e2.beta; + var t2 = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); + if (e2) { + var n2 = this.curve, r2 = function(e3) { + return n2.point(e3.x.redMul(n2.endo.beta), e3.y); + }; + e2.beta = t2, t2.precomputed = { beta: null, naf: e2.naf && { wnd: e2.naf.wnd, points: e2.naf.points.map(r2) }, doubles: e2.doubles && { step: e2.doubles.step, points: e2.doubles.points.map(r2) } }; + } + return t2; + } + }, Kg.prototype.toJSON = function() { + return this.precomputed ? [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) } }] : [this.x, this.y]; + }, Kg.fromJSON = function(e2, t2, n2) { + "string" == typeof t2 && (t2 = JSON.parse(t2)); + var r2 = e2.point(t2[0], t2[1], n2); + if (!t2[2]) + return r2; + function i2(t3) { + return e2.point(t3[0], t3[1], n2); + } + var o2 = t2[2]; + return r2.precomputed = { beta: null, doubles: o2.doubles && { step: o2.doubles.step, points: [r2].concat(o2.doubles.points.map(i2)) }, naf: o2.naf && { wnd: o2.naf.wnd, points: [r2].concat(o2.naf.points.map(i2)) } }, r2; + }, Kg.prototype.inspect = function() { + return this.isInfinity() ? "" : ""; + }, Kg.prototype.isInfinity = function() { + return this.inf; + }, Kg.prototype.add = function(e2) { + if (this.inf) + return e2; + if (e2.inf) + return this; + if (this.eq(e2)) + return this.dbl(); + if (this.neg().eq(e2)) + return this.curve.point(null, null); + if (0 === this.x.cmp(e2.x)) + return this.curve.point(null, null); + var t2 = this.y.redSub(e2.y); + 0 !== t2.cmpn(0) && (t2 = t2.redMul(this.x.redSub(e2.x).redInvm())); + var n2 = t2.redSqr().redISub(this.x).redISub(e2.x), r2 = t2.redMul(this.x.redSub(n2)).redISub(this.y); + return this.curve.point(n2, r2); + }, Kg.prototype.dbl = function() { + if (this.inf) + return this; + var e2 = this.y.redAdd(this.y); + if (0 === e2.cmpn(0)) + return this.curve.point(null, null); + var t2 = this.curve.a, n2 = this.x.redSqr(), r2 = e2.redInvm(), i2 = n2.redAdd(n2).redIAdd(n2).redIAdd(t2).redMul(r2), o2 = i2.redSqr().redISub(this.x.redAdd(this.x)), a2 = i2.redMul(this.x.redSub(o2)).redISub(this.y); + return this.curve.point(o2, a2); + }, Kg.prototype.getX = function() { + return this.x.fromRed(); + }, Kg.prototype.getY = function() { + return this.y.fromRed(); + }, Kg.prototype.mul = function(e2) { + return e2 = new Dg(e2, 16), this.isInfinity() ? this : this._hasDoubles(e2) ? this.curve._fixedNafMul(this, e2) : this.curve.endo ? this.curve._endoWnafMulAdd([this], [e2]) : this.curve._wnafMul(this, e2); + }, Kg.prototype.mulAdd = function(e2, t2, n2) { + var r2 = [this, t2], i2 = [e2, n2]; + return this.curve.endo ? this.curve._endoWnafMulAdd(r2, i2) : this.curve._wnafMulAdd(1, r2, i2, 2); + }, Kg.prototype.jmulAdd = function(e2, t2, n2) { + var r2 = [this, t2], i2 = [e2, n2]; + return this.curve.endo ? this.curve._endoWnafMulAdd(r2, i2, true) : this.curve._wnafMulAdd(1, r2, i2, 2, true); + }, Kg.prototype.eq = function(e2) { + return this === e2 || this.inf === e2.inf && (this.inf || 0 === this.x.cmp(e2.x) && 0 === this.y.cmp(e2.y)); + }, Kg.prototype.neg = function(e2) { + if (this.inf) + return this; + var t2 = this.curve.point(this.x, this.y.redNeg()); + if (e2 && this.precomputed) { + var n2 = this.precomputed, r2 = function(e3) { + return e3.neg(); + }; + t2.precomputed = { naf: n2.naf && { wnd: n2.naf.wnd, points: n2.naf.points.map(r2) }, doubles: n2.doubles && { step: n2.doubles.step, points: n2.doubles.points.map(r2) } }; + } + return t2; + }, Kg.prototype.toJ = function() { + return this.inf ? this.curve.jpoint(null, null, null) : this.curve.jpoint(this.x, this.y, this.curve.one); + }, jg(qg, Bg.BasePoint), Ug.prototype.jpoint = function(e2, t2, n2) { + return new qg(this, e2, t2, n2); + }, qg.prototype.toP = function() { + if (this.isInfinity()) + return this.curve.point(null, null); + var e2 = this.z.redInvm(), t2 = e2.redSqr(), n2 = this.x.redMul(t2), r2 = this.y.redMul(t2).redMul(e2); + return this.curve.point(n2, r2); + }, qg.prototype.neg = function() { + return this.curve.jpoint(this.x, this.y.redNeg(), this.z); + }, qg.prototype.add = function(e2) { + if (this.isInfinity()) + return e2; + if (e2.isInfinity()) + return this; + var t2 = e2.z.redSqr(), n2 = this.z.redSqr(), r2 = this.x.redMul(t2), i2 = e2.x.redMul(n2), o2 = this.y.redMul(t2.redMul(e2.z)), a2 = e2.y.redMul(n2.redMul(this.z)), s2 = r2.redSub(i2), u2 = o2.redSub(a2); + if (0 === s2.cmpn(0)) + return 0 !== u2.cmpn(0) ? this.curve.jpoint(null, null, null) : this.dbl(); + var l2 = s2.redSqr(), c2 = l2.redMul(s2), d2 = r2.redMul(l2), f2 = u2.redSqr().redIAdd(c2).redISub(d2).redISub(d2), h2 = u2.redMul(d2.redISub(f2)).redISub(o2.redMul(c2)), p2 = this.z.redMul(e2.z).redMul(s2); + return this.curve.jpoint(f2, h2, p2); + }, qg.prototype.mixedAdd = function(e2) { + if (this.isInfinity()) + return e2.toJ(); + if (e2.isInfinity()) + return this; + var t2 = this.z.redSqr(), n2 = this.x, r2 = e2.x.redMul(t2), i2 = this.y, o2 = e2.y.redMul(t2).redMul(this.z), a2 = n2.redSub(r2), s2 = i2.redSub(o2); + if (0 === a2.cmpn(0)) + return 0 !== s2.cmpn(0) ? this.curve.jpoint(null, null, null) : this.dbl(); + var u2 = a2.redSqr(), l2 = u2.redMul(a2), c2 = n2.redMul(u2), d2 = s2.redSqr().redIAdd(l2).redISub(c2).redISub(c2), f2 = s2.redMul(c2.redISub(d2)).redISub(i2.redMul(l2)), h2 = this.z.redMul(a2); + return this.curve.jpoint(d2, f2, h2); + }, qg.prototype.dblp = function(e2) { + if (0 === e2) + return this; + if (this.isInfinity()) + return this; + if (!e2) + return this.dbl(); + var t2; + if (this.curve.zeroA || this.curve.threeA) { + var n2 = this; + for (t2 = 0; t2 < e2; t2++) + n2 = n2.dbl(); + return n2; + } + var r2 = this.curve.a, i2 = this.curve.tinv, o2 = this.x, a2 = this.y, s2 = this.z, u2 = s2.redSqr().redSqr(), l2 = a2.redAdd(a2); + for (t2 = 0; t2 < e2; t2++) { + var c2 = o2.redSqr(), d2 = l2.redSqr(), f2 = d2.redSqr(), h2 = c2.redAdd(c2).redIAdd(c2).redIAdd(r2.redMul(u2)), p2 = o2.redMul(d2), m2 = h2.redSqr().redISub(p2.redAdd(p2)), g2 = p2.redISub(m2), v2 = h2.redMul(g2); + v2 = v2.redIAdd(v2).redISub(f2); + var b2 = l2.redMul(s2); + t2 + 1 < e2 && (u2 = u2.redMul(f2)), o2 = m2, s2 = b2, l2 = v2; + } + return this.curve.jpoint(o2, l2.redMul(i2), s2); + }, qg.prototype.dbl = function() { + return this.isInfinity() ? this : this.curve.zeroA ? this._zeroDbl() : this.curve.threeA ? this._threeDbl() : this._dbl(); + }, qg.prototype._zeroDbl = function() { + var e2, t2, n2; + if (this.zOne) { + var r2 = this.x.redSqr(), i2 = this.y.redSqr(), o2 = i2.redSqr(), a2 = this.x.redAdd(i2).redSqr().redISub(r2).redISub(o2); + a2 = a2.redIAdd(a2); + var s2 = r2.redAdd(r2).redIAdd(r2), u2 = s2.redSqr().redISub(a2).redISub(a2), l2 = o2.redIAdd(o2); + l2 = (l2 = l2.redIAdd(l2)).redIAdd(l2), e2 = u2, t2 = s2.redMul(a2.redISub(u2)).redISub(l2), n2 = this.y.redAdd(this.y); + } else { + var c2 = this.x.redSqr(), d2 = this.y.redSqr(), f2 = d2.redSqr(), h2 = this.x.redAdd(d2).redSqr().redISub(c2).redISub(f2); + h2 = h2.redIAdd(h2); + var p2 = c2.redAdd(c2).redIAdd(c2), m2 = p2.redSqr(), g2 = f2.redIAdd(f2); + g2 = (g2 = g2.redIAdd(g2)).redIAdd(g2), e2 = m2.redISub(h2).redISub(h2), t2 = p2.redMul(h2.redISub(e2)).redISub(g2), n2 = (n2 = this.y.redMul(this.z)).redIAdd(n2); + } + return this.curve.jpoint(e2, t2, n2); + }, qg.prototype._threeDbl = function() { + var e2, t2, n2; + if (this.zOne) { + var r2 = this.x.redSqr(), i2 = this.y.redSqr(), o2 = i2.redSqr(), a2 = this.x.redAdd(i2).redSqr().redISub(r2).redISub(o2); + a2 = a2.redIAdd(a2); + var s2 = r2.redAdd(r2).redIAdd(r2).redIAdd(this.curve.a), u2 = s2.redSqr().redISub(a2).redISub(a2); + e2 = u2; + var l2 = o2.redIAdd(o2); + l2 = (l2 = l2.redIAdd(l2)).redIAdd(l2), t2 = s2.redMul(a2.redISub(u2)).redISub(l2), n2 = this.y.redAdd(this.y); + } else { + var c2 = this.z.redSqr(), d2 = this.y.redSqr(), f2 = this.x.redMul(d2), h2 = this.x.redSub(c2).redMul(this.x.redAdd(c2)); + h2 = h2.redAdd(h2).redIAdd(h2); + var p2 = f2.redIAdd(f2), m2 = (p2 = p2.redIAdd(p2)).redAdd(p2); + e2 = h2.redSqr().redISub(m2), n2 = this.y.redAdd(this.z).redSqr().redISub(d2).redISub(c2); + var g2 = d2.redSqr(); + g2 = (g2 = (g2 = g2.redIAdd(g2)).redIAdd(g2)).redIAdd(g2), t2 = h2.redMul(p2.redISub(e2)).redISub(g2); + } + return this.curve.jpoint(e2, t2, n2); + }, qg.prototype._dbl = function() { + var e2 = this.curve.a, t2 = this.x, n2 = this.y, r2 = this.z, i2 = r2.redSqr().redSqr(), o2 = t2.redSqr(), a2 = n2.redSqr(), s2 = o2.redAdd(o2).redIAdd(o2).redIAdd(e2.redMul(i2)), u2 = t2.redAdd(t2), l2 = (u2 = u2.redIAdd(u2)).redMul(a2), c2 = s2.redSqr().redISub(l2.redAdd(l2)), d2 = l2.redISub(c2), f2 = a2.redSqr(); + f2 = (f2 = (f2 = f2.redIAdd(f2)).redIAdd(f2)).redIAdd(f2); + var h2 = s2.redMul(d2).redISub(f2), p2 = n2.redAdd(n2).redMul(r2); + return this.curve.jpoint(c2, h2, p2); + }, qg.prototype.trpl = function() { + if (!this.curve.zeroA) + return this.dbl().add(this); + var e2 = this.x.redSqr(), t2 = this.y.redSqr(), n2 = this.z.redSqr(), r2 = t2.redSqr(), i2 = e2.redAdd(e2).redIAdd(e2), o2 = i2.redSqr(), a2 = this.x.redAdd(t2).redSqr().redISub(e2).redISub(r2), s2 = (a2 = (a2 = (a2 = a2.redIAdd(a2)).redAdd(a2).redIAdd(a2)).redISub(o2)).redSqr(), u2 = r2.redIAdd(r2); + u2 = (u2 = (u2 = u2.redIAdd(u2)).redIAdd(u2)).redIAdd(u2); + var l2 = i2.redIAdd(a2).redSqr().redISub(o2).redISub(s2).redISub(u2), c2 = t2.redMul(l2); + c2 = (c2 = c2.redIAdd(c2)).redIAdd(c2); + var d2 = this.x.redMul(s2).redISub(c2); + d2 = (d2 = d2.redIAdd(d2)).redIAdd(d2); + var f2 = this.y.redMul(l2.redMul(u2.redISub(l2)).redISub(a2.redMul(s2))); + f2 = (f2 = (f2 = f2.redIAdd(f2)).redIAdd(f2)).redIAdd(f2); + var h2 = this.z.redAdd(a2).redSqr().redISub(n2).redISub(s2); + return this.curve.jpoint(d2, f2, h2); + }, qg.prototype.mul = function(e2, t2) { + return e2 = new Dg(e2, t2), this.curve._wnafMul(this, e2); + }, qg.prototype.eq = function(e2) { + if ("affine" === e2.type) + return this.eq(e2.toJ()); + if (this === e2) + return true; + var t2 = this.z.redSqr(), n2 = e2.z.redSqr(); + if (0 !== this.x.redMul(n2).redISub(e2.x.redMul(t2)).cmpn(0)) + return false; + var r2 = t2.redMul(this.z), i2 = n2.redMul(e2.z); + return 0 === this.y.redMul(i2).redISub(e2.y.redMul(r2)).cmpn(0); + }, qg.prototype.eqXToP = function(e2) { + var t2 = this.z.redSqr(), n2 = e2.toRed(this.curve.red).redMul(t2); + if (0 === this.x.cmp(n2)) + return true; + for (var r2 = e2.clone(), i2 = this.curve.redN.redMul(t2); ; ) { + if (r2.iadd(this.curve.n), r2.cmp(this.curve.p) >= 0) + return false; + if (n2.redIAdd(i2), 0 === this.x.cmp(n2)) + return true; + } + }, qg.prototype.inspect = function() { + return this.isInfinity() ? "" : ""; + }, qg.prototype.isInfinity = function() { + return 0 === this.z.cmpn(0); + }; + var Hg = gg, Wg = Ng, $g = Lg, Vg = pg; + function Yg(e2) { + $g.call(this, "mont", e2), this.a = new Hg(e2.a, 16).toRed(this.red), this.b = new Hg(e2.b, 16).toRed(this.red), this.i4 = new Hg(4).toRed(this.red).redInvm(), this.two = new Hg(2).toRed(this.red), this.a24 = this.i4.redMul(this.a.redAdd(this.two)); + } + Wg(Yg, $g); + var Gg = Yg; + function Zg(e2, t2, n2) { + $g.BasePoint.call(this, e2, "projective"), null === t2 && null === n2 ? (this.x = this.curve.one, this.z = this.curve.zero) : (this.x = new Hg(t2, 16), this.z = new Hg(n2, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red))); + } + Yg.prototype.validate = function(e2) { + var t2 = e2.normalize().x, n2 = t2.redSqr(), r2 = n2.redMul(t2).redAdd(n2.redMul(this.a)).redAdd(t2); + return 0 === r2.redSqrt().redSqr().cmp(r2); + }, Wg(Zg, $g.BasePoint), Yg.prototype.decodePoint = function(e2, t2) { + return this.point(Vg.toArray(e2, t2), 1); + }, Yg.prototype.point = function(e2, t2) { + return new Zg(this, e2, t2); + }, Yg.prototype.pointFromJSON = function(e2) { + return Zg.fromJSON(this, e2); + }, Zg.prototype.precompute = function() { + }, Zg.prototype._encode = function() { + return this.getX().toArray("be", this.curve.p.byteLength()); + }, Zg.fromJSON = function(e2, t2) { + return new Zg(e2, t2[0], t2[1] || e2.one); + }, Zg.prototype.inspect = function() { + return this.isInfinity() ? "" : ""; + }, Zg.prototype.isInfinity = function() { + return 0 === this.z.cmpn(0); + }, Zg.prototype.dbl = function() { + var e2 = this.x.redAdd(this.z).redSqr(), t2 = this.x.redSub(this.z).redSqr(), n2 = e2.redSub(t2), r2 = e2.redMul(t2), i2 = n2.redMul(t2.redAdd(this.curve.a24.redMul(n2))); + return this.curve.point(r2, i2); + }, Zg.prototype.add = function() { + throw new Error("Not supported on Montgomery curve"); + }, Zg.prototype.diffAdd = function(e2, t2) { + var n2 = this.x.redAdd(this.z), r2 = this.x.redSub(this.z), i2 = e2.x.redAdd(e2.z), o2 = e2.x.redSub(e2.z).redMul(n2), a2 = i2.redMul(r2), s2 = t2.z.redMul(o2.redAdd(a2).redSqr()), u2 = t2.x.redMul(o2.redISub(a2).redSqr()); + return this.curve.point(s2, u2); + }, Zg.prototype.mul = function(e2) { + for (var t2 = e2.clone(), n2 = this, r2 = this.curve.point(null, null), i2 = []; 0 !== t2.cmpn(0); t2.iushrn(1)) + i2.push(t2.andln(1)); + for (var o2 = i2.length - 1; o2 >= 0; o2--) + 0 === i2[o2] ? (n2 = n2.diffAdd(r2, this), r2 = r2.dbl()) : (r2 = n2.diffAdd(r2, this), n2 = n2.dbl()); + return r2; + }, Zg.prototype.mulAdd = function() { + throw new Error("Not supported on Montgomery curve"); + }, Zg.prototype.jumlAdd = function() { + throw new Error("Not supported on Montgomery curve"); + }, Zg.prototype.eq = function(e2) { + return 0 === this.getX().cmp(e2.getX()); + }, Zg.prototype.normalize = function() { + return this.x = this.x.redMul(this.z.redInvm()), this.z = this.curve.one, this; + }, Zg.prototype.getX = function() { + return this.normalize(), this.x.fromRed(); + }; + var Qg = gg, Jg = Ng, Xg = Lg, ev = pg.assert; + function tv(e2) { + this.twisted = 1 != (0 | e2.a), this.mOneA = this.twisted && -1 == (0 | e2.a), this.extended = this.mOneA, Xg.call(this, "edwards", e2), this.a = new Qg(e2.a, 16).umod(this.red.m), this.a = this.a.toRed(this.red), this.c = new Qg(e2.c, 16).toRed(this.red), this.c2 = this.c.redSqr(), this.d = new Qg(e2.d, 16).toRed(this.red), this.dd = this.d.redAdd(this.d), ev(!this.twisted || 0 === this.c.fromRed().cmpn(1)), this.oneC = 1 == (0 | e2.c); + } + Jg(tv, Xg); + var nv = tv; + function rv(e2, t2, n2, r2, i2) { + Xg.BasePoint.call(this, e2, "projective"), null === t2 && null === n2 && null === r2 ? (this.x = this.curve.zero, this.y = this.curve.one, this.z = this.curve.one, this.t = this.curve.zero, this.zOne = true) : (this.x = new Qg(t2, 16), this.y = new Qg(n2, 16), this.z = r2 ? new Qg(r2, 16) : this.curve.one, this.t = i2 && new Qg(i2, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.t && !this.t.red && (this.t = this.t.toRed(this.curve.red)), this.zOne = this.z === this.curve.one, this.curve.extended && !this.t && (this.t = this.x.redMul(this.y), this.zOne || (this.t = this.t.redMul(this.z.redInvm())))); + } + tv.prototype._mulA = function(e2) { + return this.mOneA ? e2.redNeg() : this.a.redMul(e2); + }, tv.prototype._mulC = function(e2) { + return this.oneC ? e2 : this.c.redMul(e2); + }, tv.prototype.jpoint = function(e2, t2, n2, r2) { + return this.point(e2, t2, n2, r2); + }, tv.prototype.pointFromX = function(e2, t2) { + (e2 = new Qg(e2, 16)).red || (e2 = e2.toRed(this.red)); + var n2 = e2.redSqr(), r2 = this.c2.redSub(this.a.redMul(n2)), i2 = this.one.redSub(this.c2.redMul(this.d).redMul(n2)), o2 = r2.redMul(i2.redInvm()), a2 = o2.redSqrt(); + if (0 !== a2.redSqr().redSub(o2).cmp(this.zero)) + throw new Error("invalid point"); + var s2 = a2.fromRed().isOdd(); + return (t2 && !s2 || !t2 && s2) && (a2 = a2.redNeg()), this.point(e2, a2); + }, tv.prototype.pointFromY = function(e2, t2) { + (e2 = new Qg(e2, 16)).red || (e2 = e2.toRed(this.red)); + var n2 = e2.redSqr(), r2 = n2.redSub(this.c2), i2 = n2.redMul(this.d).redMul(this.c2).redSub(this.a), o2 = r2.redMul(i2.redInvm()); + if (0 === o2.cmp(this.zero)) { + if (t2) + throw new Error("invalid point"); + return this.point(this.zero, e2); + } + var a2 = o2.redSqrt(); + if (0 !== a2.redSqr().redSub(o2).cmp(this.zero)) + throw new Error("invalid point"); + return a2.fromRed().isOdd() !== t2 && (a2 = a2.redNeg()), this.point(a2, e2); + }, tv.prototype.validate = function(e2) { + if (e2.isInfinity()) + return true; + e2.normalize(); + var t2 = e2.x.redSqr(), n2 = e2.y.redSqr(), r2 = t2.redMul(this.a).redAdd(n2), i2 = this.c2.redMul(this.one.redAdd(this.d.redMul(t2).redMul(n2))); + return 0 === r2.cmp(i2); + }, Jg(rv, Xg.BasePoint), tv.prototype.pointFromJSON = function(e2) { + return rv.fromJSON(this, e2); + }, tv.prototype.point = function(e2, t2, n2, r2) { + return new rv(this, e2, t2, n2, r2); + }, rv.fromJSON = function(e2, t2) { + return new rv(e2, t2[0], t2[1], t2[2]); + }, rv.prototype.inspect = function() { + return this.isInfinity() ? "" : ""; + }, rv.prototype.isInfinity = function() { + return 0 === this.x.cmpn(0) && (0 === this.y.cmp(this.z) || this.zOne && 0 === this.y.cmp(this.curve.c)); + }, rv.prototype._extDbl = function() { + var e2 = this.x.redSqr(), t2 = this.y.redSqr(), n2 = this.z.redSqr(); + n2 = n2.redIAdd(n2); + var r2 = this.curve._mulA(e2), i2 = this.x.redAdd(this.y).redSqr().redISub(e2).redISub(t2), o2 = r2.redAdd(t2), a2 = o2.redSub(n2), s2 = r2.redSub(t2), u2 = i2.redMul(a2), l2 = o2.redMul(s2), c2 = i2.redMul(s2), d2 = a2.redMul(o2); + return this.curve.point(u2, l2, d2, c2); + }, rv.prototype._projDbl = function() { + var e2, t2, n2, r2, i2, o2, a2 = this.x.redAdd(this.y).redSqr(), s2 = this.x.redSqr(), u2 = this.y.redSqr(); + if (this.curve.twisted) { + var l2 = (r2 = this.curve._mulA(s2)).redAdd(u2); + this.zOne ? (e2 = a2.redSub(s2).redSub(u2).redMul(l2.redSub(this.curve.two)), t2 = l2.redMul(r2.redSub(u2)), n2 = l2.redSqr().redSub(l2).redSub(l2)) : (i2 = this.z.redSqr(), o2 = l2.redSub(i2).redISub(i2), e2 = a2.redSub(s2).redISub(u2).redMul(o2), t2 = l2.redMul(r2.redSub(u2)), n2 = l2.redMul(o2)); + } else + r2 = s2.redAdd(u2), i2 = this.curve._mulC(this.z).redSqr(), o2 = r2.redSub(i2).redSub(i2), e2 = this.curve._mulC(a2.redISub(r2)).redMul(o2), t2 = this.curve._mulC(r2).redMul(s2.redISub(u2)), n2 = r2.redMul(o2); + return this.curve.point(e2, t2, n2); + }, rv.prototype.dbl = function() { + return this.isInfinity() ? this : this.curve.extended ? this._extDbl() : this._projDbl(); + }, rv.prototype._extAdd = function(e2) { + var t2 = this.y.redSub(this.x).redMul(e2.y.redSub(e2.x)), n2 = this.y.redAdd(this.x).redMul(e2.y.redAdd(e2.x)), r2 = this.t.redMul(this.curve.dd).redMul(e2.t), i2 = this.z.redMul(e2.z.redAdd(e2.z)), o2 = n2.redSub(t2), a2 = i2.redSub(r2), s2 = i2.redAdd(r2), u2 = n2.redAdd(t2), l2 = o2.redMul(a2), c2 = s2.redMul(u2), d2 = o2.redMul(u2), f2 = a2.redMul(s2); + return this.curve.point(l2, c2, f2, d2); + }, rv.prototype._projAdd = function(e2) { + var t2, n2, r2 = this.z.redMul(e2.z), i2 = r2.redSqr(), o2 = this.x.redMul(e2.x), a2 = this.y.redMul(e2.y), s2 = this.curve.d.redMul(o2).redMul(a2), u2 = i2.redSub(s2), l2 = i2.redAdd(s2), c2 = this.x.redAdd(this.y).redMul(e2.x.redAdd(e2.y)).redISub(o2).redISub(a2), d2 = r2.redMul(u2).redMul(c2); + return this.curve.twisted ? (t2 = r2.redMul(l2).redMul(a2.redSub(this.curve._mulA(o2))), n2 = u2.redMul(l2)) : (t2 = r2.redMul(l2).redMul(a2.redSub(o2)), n2 = this.curve._mulC(u2).redMul(l2)), this.curve.point(d2, t2, n2); + }, rv.prototype.add = function(e2) { + return this.isInfinity() ? e2 : e2.isInfinity() ? this : this.curve.extended ? this._extAdd(e2) : this._projAdd(e2); + }, rv.prototype.mul = function(e2) { + return this._hasDoubles(e2) ? this.curve._fixedNafMul(this, e2) : this.curve._wnafMul(this, e2); + }, rv.prototype.mulAdd = function(e2, t2, n2) { + return this.curve._wnafMulAdd(1, [this, t2], [e2, n2], 2, false); + }, rv.prototype.jmulAdd = function(e2, t2, n2) { + return this.curve._wnafMulAdd(1, [this, t2], [e2, n2], 2, true); + }, rv.prototype.normalize = function() { + if (this.zOne) + return this; + var e2 = this.z.redInvm(); + return this.x = this.x.redMul(e2), this.y = this.y.redMul(e2), this.t && (this.t = this.t.redMul(e2)), this.z = this.curve.one, this.zOne = true, this; + }, rv.prototype.neg = function() { + return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg()); + }, rv.prototype.getX = function() { + return this.normalize(), this.x.fromRed(); + }, rv.prototype.getY = function() { + return this.normalize(), this.y.fromRed(); + }, rv.prototype.eq = function(e2) { + return this === e2 || 0 === this.getX().cmp(e2.getX()) && 0 === this.getY().cmp(e2.getY()); + }, rv.prototype.eqXToP = function(e2) { + var t2 = e2.toRed(this.curve.red).redMul(this.z); + if (0 === this.x.cmp(t2)) + return true; + for (var n2 = e2.clone(), r2 = this.curve.redN.redMul(this.z); ; ) { + if (n2.iadd(this.curve.n), n2.cmp(this.curve.p) >= 0) + return false; + if (t2.redIAdd(r2), 0 === this.x.cmp(t2)) + return true; + } + }, rv.prototype.toP = rv.prototype.normalize, rv.prototype.mixedAdd = rv.prototype.add, function(e2) { + var t2 = e2; + t2.base = Lg, t2.short = Fg, t2.mont = Gg, t2.edwards = nv; + }(Mg); + var iv = {}, ov = {}, av = {}, sv = vg, uv = Ng; + function lv(e2, t2) { + return 55296 == (64512 & e2.charCodeAt(t2)) && (!(t2 < 0 || t2 + 1 >= e2.length) && 56320 == (64512 & e2.charCodeAt(t2 + 1))); + } + function cv(e2) { + return (e2 >>> 24 | e2 >>> 8 & 65280 | e2 << 8 & 16711680 | (255 & e2) << 24) >>> 0; + } + function dv(e2) { + return 1 === e2.length ? "0" + e2 : e2; + } + function fv(e2) { + return 7 === e2.length ? "0" + e2 : 6 === e2.length ? "00" + e2 : 5 === e2.length ? "000" + e2 : 4 === e2.length ? "0000" + e2 : 3 === e2.length ? "00000" + e2 : 2 === e2.length ? "000000" + e2 : 1 === e2.length ? "0000000" + e2 : e2; + } + av.inherits = uv, av.toArray = function(e2, t2) { + if (Array.isArray(e2)) + return e2.slice(); + if (!e2) + return []; + var n2 = []; + if ("string" == typeof e2) + if (t2) { + if ("hex" === t2) + for ((e2 = e2.replace(/[^a-z0-9]+/gi, "")).length % 2 != 0 && (e2 = "0" + e2), i2 = 0; i2 < e2.length; i2 += 2) + n2.push(parseInt(e2[i2] + e2[i2 + 1], 16)); + } else + for (var r2 = 0, i2 = 0; i2 < e2.length; i2++) { + var o2 = e2.charCodeAt(i2); + o2 < 128 ? n2[r2++] = o2 : o2 < 2048 ? (n2[r2++] = o2 >> 6 | 192, n2[r2++] = 63 & o2 | 128) : lv(e2, i2) ? (o2 = 65536 + ((1023 & o2) << 10) + (1023 & e2.charCodeAt(++i2)), n2[r2++] = o2 >> 18 | 240, n2[r2++] = o2 >> 12 & 63 | 128, n2[r2++] = o2 >> 6 & 63 | 128, n2[r2++] = 63 & o2 | 128) : (n2[r2++] = o2 >> 12 | 224, n2[r2++] = o2 >> 6 & 63 | 128, n2[r2++] = 63 & o2 | 128); + } + else + for (i2 = 0; i2 < e2.length; i2++) + n2[i2] = 0 | e2[i2]; + return n2; + }, av.toHex = function(e2) { + for (var t2 = "", n2 = 0; n2 < e2.length; n2++) + t2 += dv(e2[n2].toString(16)); + return t2; + }, av.htonl = cv, av.toHex32 = function(e2, t2) { + for (var n2 = "", r2 = 0; r2 < e2.length; r2++) { + var i2 = e2[r2]; + "little" === t2 && (i2 = cv(i2)), n2 += fv(i2.toString(16)); + } + return n2; + }, av.zero2 = dv, av.zero8 = fv, av.join32 = function(e2, t2, n2, r2) { + var i2 = n2 - t2; + sv(i2 % 4 == 0); + for (var o2 = new Array(i2 / 4), a2 = 0, s2 = t2; a2 < o2.length; a2++, s2 += 4) { + var u2; + u2 = "big" === r2 ? e2[s2] << 24 | e2[s2 + 1] << 16 | e2[s2 + 2] << 8 | e2[s2 + 3] : e2[s2 + 3] << 24 | e2[s2 + 2] << 16 | e2[s2 + 1] << 8 | e2[s2], o2[a2] = u2 >>> 0; + } + return o2; + }, av.split32 = function(e2, t2) { + for (var n2 = new Array(4 * e2.length), r2 = 0, i2 = 0; r2 < e2.length; r2++, i2 += 4) { + var o2 = e2[r2]; + "big" === t2 ? (n2[i2] = o2 >>> 24, n2[i2 + 1] = o2 >>> 16 & 255, n2[i2 + 2] = o2 >>> 8 & 255, n2[i2 + 3] = 255 & o2) : (n2[i2 + 3] = o2 >>> 24, n2[i2 + 2] = o2 >>> 16 & 255, n2[i2 + 1] = o2 >>> 8 & 255, n2[i2] = 255 & o2); + } + return n2; + }, av.rotr32 = function(e2, t2) { + return e2 >>> t2 | e2 << 32 - t2; + }, av.rotl32 = function(e2, t2) { + return e2 << t2 | e2 >>> 32 - t2; + }, av.sum32 = function(e2, t2) { + return e2 + t2 >>> 0; + }, av.sum32_3 = function(e2, t2, n2) { + return e2 + t2 + n2 >>> 0; + }, av.sum32_4 = function(e2, t2, n2, r2) { + return e2 + t2 + n2 + r2 >>> 0; + }, av.sum32_5 = function(e2, t2, n2, r2, i2) { + return e2 + t2 + n2 + r2 + i2 >>> 0; + }, av.sum64 = function(e2, t2, n2, r2) { + var i2 = e2[t2], o2 = r2 + e2[t2 + 1] >>> 0, a2 = (o2 < r2 ? 1 : 0) + n2 + i2; + e2[t2] = a2 >>> 0, e2[t2 + 1] = o2; + }, av.sum64_hi = function(e2, t2, n2, r2) { + return (t2 + r2 >>> 0 < t2 ? 1 : 0) + e2 + n2 >>> 0; + }, av.sum64_lo = function(e2, t2, n2, r2) { + return t2 + r2 >>> 0; + }, av.sum64_4_hi = function(e2, t2, n2, r2, i2, o2, a2, s2) { + var u2 = 0, l2 = t2; + return u2 += (l2 = l2 + r2 >>> 0) < t2 ? 1 : 0, u2 += (l2 = l2 + o2 >>> 0) < o2 ? 1 : 0, e2 + n2 + i2 + a2 + (u2 += (l2 = l2 + s2 >>> 0) < s2 ? 1 : 0) >>> 0; + }, av.sum64_4_lo = function(e2, t2, n2, r2, i2, o2, a2, s2) { + return t2 + r2 + o2 + s2 >>> 0; + }, av.sum64_5_hi = function(e2, t2, n2, r2, i2, o2, a2, s2, u2, l2) { + var c2 = 0, d2 = t2; + return c2 += (d2 = d2 + r2 >>> 0) < t2 ? 1 : 0, c2 += (d2 = d2 + o2 >>> 0) < o2 ? 1 : 0, c2 += (d2 = d2 + s2 >>> 0) < s2 ? 1 : 0, e2 + n2 + i2 + a2 + u2 + (c2 += (d2 = d2 + l2 >>> 0) < l2 ? 1 : 0) >>> 0; + }, av.sum64_5_lo = function(e2, t2, n2, r2, i2, o2, a2, s2, u2, l2) { + return t2 + r2 + o2 + s2 + l2 >>> 0; + }, av.rotr64_hi = function(e2, t2, n2) { + return (t2 << 32 - n2 | e2 >>> n2) >>> 0; + }, av.rotr64_lo = function(e2, t2, n2) { + return (e2 << 32 - n2 | t2 >>> n2) >>> 0; + }, av.shr64_hi = function(e2, t2, n2) { + return e2 >>> n2; + }, av.shr64_lo = function(e2, t2, n2) { + return (e2 << 32 - n2 | t2 >>> n2) >>> 0; + }; + var hv = {}, pv = av, mv = vg; + function gv() { + 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; + } + hv.BlockHash = gv, gv.prototype.update = function(e2, t2) { + if (e2 = pv.toArray(e2, t2), this.pending ? this.pending = this.pending.concat(e2) : this.pending = e2, this.pendingTotal += e2.length, this.pending.length >= this._delta8) { + var n2 = (e2 = this.pending).length % this._delta8; + this.pending = e2.slice(e2.length - n2, e2.length), 0 === this.pending.length && (this.pending = null), e2 = pv.join32(e2, 0, e2.length - n2, this.endian); + for (var r2 = 0; r2 < e2.length; r2 += this._delta32) + this._update(e2, r2, r2 + this._delta32); + } + return this; + }, gv.prototype.digest = function(e2) { + return this.update(this._pad()), mv(null === this.pending), this._digest(e2); + }, gv.prototype._pad = function() { + var e2 = this.pendingTotal, t2 = this._delta8, n2 = t2 - (e2 + this.padLength) % t2, r2 = new Array(n2 + this.padLength); + r2[0] = 128; + for (var i2 = 1; i2 < n2; i2++) + r2[i2] = 0; + if (e2 <<= 3, "big" === this.endian) { + for (var o2 = 8; o2 < this.padLength; o2++) + r2[i2++] = 0; + r2[i2++] = 0, r2[i2++] = 0, r2[i2++] = 0, r2[i2++] = 0, r2[i2++] = e2 >>> 24 & 255, r2[i2++] = e2 >>> 16 & 255, r2[i2++] = e2 >>> 8 & 255, r2[i2++] = 255 & e2; + } else + for (r2[i2++] = 255 & e2, r2[i2++] = e2 >>> 8 & 255, r2[i2++] = e2 >>> 16 & 255, r2[i2++] = e2 >>> 24 & 255, r2[i2++] = 0, r2[i2++] = 0, r2[i2++] = 0, r2[i2++] = 0, o2 = 8; o2 < this.padLength; o2++) + r2[i2++] = 0; + return r2; + }; + var vv = {}, bv = {}, yv = av.rotr32; + function wv(e2, t2, n2) { + return e2 & t2 ^ ~e2 & n2; + } + function _v(e2, t2, n2) { + return e2 & t2 ^ e2 & n2 ^ t2 & n2; + } + function Sv(e2, t2, n2) { + return e2 ^ t2 ^ n2; + } + bv.ft_1 = function(e2, t2, n2, r2) { + return 0 === e2 ? wv(t2, n2, r2) : 1 === e2 || 3 === e2 ? Sv(t2, n2, r2) : 2 === e2 ? _v(t2, n2, r2) : void 0; + }, bv.ch32 = wv, bv.maj32 = _v, bv.p32 = Sv, bv.s0_256 = function(e2) { + return yv(e2, 2) ^ yv(e2, 13) ^ yv(e2, 22); + }, bv.s1_256 = function(e2) { + return yv(e2, 6) ^ yv(e2, 11) ^ yv(e2, 25); + }, bv.g0_256 = function(e2) { + return yv(e2, 7) ^ yv(e2, 18) ^ e2 >>> 3; + }, bv.g1_256 = function(e2) { + return yv(e2, 17) ^ yv(e2, 19) ^ e2 >>> 10; + }; + var Ev = av, kv = hv, Mv = bv, Cv = Ev.rotl32, xv = Ev.sum32, Av = Ev.sum32_5, Rv = Mv.ft_1, Tv = kv.BlockHash, Pv = [1518500249, 1859775393, 2400959708, 3395469782]; + function Lv() { + if (!(this instanceof Lv)) + return new Lv(); + Tv.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.W = new Array(80); + } + Ev.inherits(Lv, Tv); + var Iv = Lv; + Lv.blockSize = 512, Lv.outSize = 160, Lv.hmacStrength = 80, Lv.padLength = 64, Lv.prototype._update = function(e2, t2) { + for (var n2 = this.W, r2 = 0; r2 < 16; r2++) + n2[r2] = e2[t2 + r2]; + for (; r2 < n2.length; r2++) + n2[r2] = Cv(n2[r2 - 3] ^ n2[r2 - 8] ^ n2[r2 - 14] ^ n2[r2 - 16], 1); + var i2 = this.h[0], o2 = this.h[1], a2 = this.h[2], s2 = this.h[3], u2 = this.h[4]; + for (r2 = 0; r2 < n2.length; r2++) { + var l2 = ~~(r2 / 20), c2 = Av(Cv(i2, 5), Rv(l2, o2, a2, s2), u2, n2[r2], Pv[l2]); + u2 = s2, s2 = a2, a2 = Cv(o2, 30), o2 = i2, i2 = c2; + } + this.h[0] = xv(this.h[0], i2), this.h[1] = xv(this.h[1], o2), this.h[2] = xv(this.h[2], a2), this.h[3] = xv(this.h[3], s2), this.h[4] = xv(this.h[4], u2); + }, Lv.prototype._digest = function(e2) { + return "hex" === e2 ? Ev.toHex32(this.h, "big") : Ev.split32(this.h, "big"); + }; + var Ov = av, Nv = hv, Dv = bv, jv = vg, Bv = Ov.sum32, zv = Ov.sum32_4, Uv = Ov.sum32_5, Fv = Dv.ch32, Kv = Dv.maj32, qv = Dv.s0_256, Hv = Dv.s1_256, Wv = Dv.g0_256, $v = Dv.g1_256, Vv = Nv.BlockHash, Yv = [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 Gv() { + if (!(this instanceof Gv)) + return new Gv(); + Vv.call(this), this.h = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225], this.k = Yv, this.W = new Array(64); + } + Ov.inherits(Gv, Vv); + var Zv = Gv; + Gv.blockSize = 512, Gv.outSize = 256, Gv.hmacStrength = 192, Gv.padLength = 64, Gv.prototype._update = function(e2, t2) { + for (var n2 = this.W, r2 = 0; r2 < 16; r2++) + n2[r2] = e2[t2 + r2]; + for (; r2 < n2.length; r2++) + n2[r2] = zv($v(n2[r2 - 2]), n2[r2 - 7], Wv(n2[r2 - 15]), n2[r2 - 16]); + var i2 = this.h[0], o2 = this.h[1], a2 = this.h[2], s2 = this.h[3], u2 = this.h[4], l2 = this.h[5], c2 = this.h[6], d2 = this.h[7]; + for (jv(this.k.length === n2.length), r2 = 0; r2 < n2.length; r2++) { + var f2 = Uv(d2, Hv(u2), Fv(u2, l2, c2), this.k[r2], n2[r2]), h2 = Bv(qv(i2), Kv(i2, o2, a2)); + d2 = c2, c2 = l2, l2 = u2, u2 = Bv(s2, f2), s2 = a2, a2 = o2, o2 = i2, i2 = Bv(f2, h2); + } + this.h[0] = Bv(this.h[0], i2), this.h[1] = Bv(this.h[1], o2), this.h[2] = Bv(this.h[2], a2), this.h[3] = Bv(this.h[3], s2), this.h[4] = Bv(this.h[4], u2), this.h[5] = Bv(this.h[5], l2), this.h[6] = Bv(this.h[6], c2), this.h[7] = Bv(this.h[7], d2); + }, Gv.prototype._digest = function(e2) { + return "hex" === e2 ? Ov.toHex32(this.h, "big") : Ov.split32(this.h, "big"); + }; + var Qv = av, Jv = Zv; + function Xv() { + if (!(this instanceof Xv)) + return new Xv(); + Jv.call(this), this.h = [3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]; + } + Qv.inherits(Xv, Jv); + var eb = Xv; + Xv.blockSize = 512, Xv.outSize = 224, Xv.hmacStrength = 192, Xv.padLength = 64, Xv.prototype._digest = function(e2) { + return "hex" === e2 ? Qv.toHex32(this.h.slice(0, 7), "big") : Qv.split32(this.h.slice(0, 7), "big"); + }; + var tb = av, nb = hv, rb = vg, ib = tb.rotr64_hi, ob = tb.rotr64_lo, ab = tb.shr64_hi, sb = tb.shr64_lo, ub = tb.sum64, lb = tb.sum64_hi, cb = tb.sum64_lo, db = tb.sum64_4_hi, fb = tb.sum64_4_lo, hb = tb.sum64_5_hi, pb = tb.sum64_5_lo, mb = nb.BlockHash, gb = [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 vb() { + if (!(this instanceof vb)) + return new vb(); + mb.call(this), this.h = [1779033703, 4089235720, 3144134277, 2227873595, 1013904242, 4271175723, 2773480762, 1595750129, 1359893119, 2917565137, 2600822924, 725511199, 528734635, 4215389547, 1541459225, 327033209], this.k = gb, this.W = new Array(160); + } + tb.inherits(vb, mb); + var bb = vb; + function yb(e2, t2, n2, r2, i2) { + var o2 = e2 & n2 ^ ~e2 & i2; + return o2 < 0 && (o2 += 4294967296), o2; + } + function wb(e2, t2, n2, r2, i2, o2) { + var a2 = t2 & r2 ^ ~t2 & o2; + return a2 < 0 && (a2 += 4294967296), a2; + } + function _b(e2, t2, n2, r2, i2) { + var o2 = e2 & n2 ^ e2 & i2 ^ n2 & i2; + return o2 < 0 && (o2 += 4294967296), o2; + } + function Sb(e2, t2, n2, r2, i2, o2) { + var a2 = t2 & r2 ^ t2 & o2 ^ r2 & o2; + return a2 < 0 && (a2 += 4294967296), a2; + } + function Eb(e2, t2) { + var n2 = ib(e2, t2, 28) ^ ib(t2, e2, 2) ^ ib(t2, e2, 7); + return n2 < 0 && (n2 += 4294967296), n2; + } + function kb(e2, t2) { + var n2 = ob(e2, t2, 28) ^ ob(t2, e2, 2) ^ ob(t2, e2, 7); + return n2 < 0 && (n2 += 4294967296), n2; + } + function Mb(e2, t2) { + var n2 = ib(e2, t2, 14) ^ ib(e2, t2, 18) ^ ib(t2, e2, 9); + return n2 < 0 && (n2 += 4294967296), n2; + } + function Cb(e2, t2) { + var n2 = ob(e2, t2, 14) ^ ob(e2, t2, 18) ^ ob(t2, e2, 9); + return n2 < 0 && (n2 += 4294967296), n2; + } + function xb(e2, t2) { + var n2 = ib(e2, t2, 1) ^ ib(e2, t2, 8) ^ ab(e2, t2, 7); + return n2 < 0 && (n2 += 4294967296), n2; + } + function Ab(e2, t2) { + var n2 = ob(e2, t2, 1) ^ ob(e2, t2, 8) ^ sb(e2, t2, 7); + return n2 < 0 && (n2 += 4294967296), n2; + } + function Rb(e2, t2) { + var n2 = ib(e2, t2, 19) ^ ib(t2, e2, 29) ^ ab(e2, t2, 6); + return n2 < 0 && (n2 += 4294967296), n2; + } + function Tb(e2, t2) { + var n2 = ob(e2, t2, 19) ^ ob(t2, e2, 29) ^ sb(e2, t2, 6); + return n2 < 0 && (n2 += 4294967296), n2; + } + vb.blockSize = 1024, vb.outSize = 512, vb.hmacStrength = 192, vb.padLength = 128, vb.prototype._prepareBlock = function(e2, t2) { + for (var n2 = this.W, r2 = 0; r2 < 32; r2++) + n2[r2] = e2[t2 + r2]; + for (; r2 < n2.length; r2 += 2) { + var i2 = Rb(n2[r2 - 4], n2[r2 - 3]), o2 = Tb(n2[r2 - 4], n2[r2 - 3]), a2 = n2[r2 - 14], s2 = n2[r2 - 13], u2 = xb(n2[r2 - 30], n2[r2 - 29]), l2 = Ab(n2[r2 - 30], n2[r2 - 29]), c2 = n2[r2 - 32], d2 = n2[r2 - 31]; + n2[r2] = db(i2, o2, a2, s2, u2, l2, c2, d2), n2[r2 + 1] = fb(i2, o2, a2, s2, u2, l2, c2, d2); + } + }, vb.prototype._update = function(e2, t2) { + this._prepareBlock(e2, t2); + var n2 = this.W, r2 = this.h[0], i2 = this.h[1], o2 = this.h[2], a2 = this.h[3], s2 = this.h[4], u2 = this.h[5], l2 = this.h[6], c2 = this.h[7], d2 = this.h[8], f2 = this.h[9], h2 = this.h[10], p2 = this.h[11], m2 = this.h[12], g2 = this.h[13], v2 = this.h[14], b2 = this.h[15]; + rb(this.k.length === n2.length); + for (var y2 = 0; y2 < n2.length; y2 += 2) { + var w2 = v2, _2 = b2, S2 = Mb(d2, f2), E2 = Cb(d2, f2), k2 = yb(d2, f2, h2, p2, m2), M2 = wb(d2, f2, h2, p2, m2, g2), C2 = this.k[y2], x2 = this.k[y2 + 1], A2 = n2[y2], R2 = n2[y2 + 1], T2 = hb(w2, _2, S2, E2, k2, M2, C2, x2, A2, R2), P2 = pb(w2, _2, S2, E2, k2, M2, C2, x2, A2, R2); + w2 = Eb(r2, i2), _2 = kb(r2, i2), S2 = _b(r2, i2, o2, a2, s2), E2 = Sb(r2, i2, o2, a2, s2, u2); + var L2 = lb(w2, _2, S2, E2), I2 = cb(w2, _2, S2, E2); + v2 = m2, b2 = g2, m2 = h2, g2 = p2, h2 = d2, p2 = f2, d2 = lb(l2, c2, T2, P2), f2 = cb(c2, c2, T2, P2), l2 = s2, c2 = u2, s2 = o2, u2 = a2, o2 = r2, a2 = i2, r2 = lb(T2, P2, L2, I2), i2 = cb(T2, P2, L2, I2); + } + ub(this.h, 0, r2, i2), ub(this.h, 2, o2, a2), ub(this.h, 4, s2, u2), ub(this.h, 6, l2, c2), ub(this.h, 8, d2, f2), ub(this.h, 10, h2, p2), ub(this.h, 12, m2, g2), ub(this.h, 14, v2, b2); + }, vb.prototype._digest = function(e2) { + return "hex" === e2 ? tb.toHex32(this.h, "big") : tb.split32(this.h, "big"); + }; + var Pb = av, Lb = bb; + function Ib() { + if (!(this instanceof Ib)) + return new Ib(); + Lb.call(this), this.h = [3418070365, 3238371032, 1654270250, 914150663, 2438529370, 812702999, 355462360, 4144912697, 1731405415, 4290775857, 2394180231, 1750603025, 3675008525, 1694076839, 1203062813, 3204075428]; + } + Pb.inherits(Ib, Lb); + var Ob = Ib; + Ib.blockSize = 1024, Ib.outSize = 384, Ib.hmacStrength = 192, Ib.padLength = 128, Ib.prototype._digest = function(e2) { + return "hex" === e2 ? Pb.toHex32(this.h.slice(0, 12), "big") : Pb.split32(this.h.slice(0, 12), "big"); + }, vv.sha1 = Iv, vv.sha224 = eb, vv.sha256 = Zv, vv.sha384 = Ob, vv.sha512 = bb; + var Nb = {}, Db = av, jb = hv, Bb = Db.rotl32, zb = Db.sum32, Ub = Db.sum32_3, Fb = Db.sum32_4, Kb = jb.BlockHash; + function qb() { + if (!(this instanceof qb)) + return new qb(); + Kb.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.endian = "little"; + } + function Hb(e2, t2, n2, r2) { + return e2 <= 15 ? t2 ^ n2 ^ r2 : e2 <= 31 ? t2 & n2 | ~t2 & r2 : e2 <= 47 ? (t2 | ~n2) ^ r2 : e2 <= 63 ? t2 & r2 | n2 & ~r2 : t2 ^ (n2 | ~r2); + } + function Wb(e2) { + return e2 <= 15 ? 0 : e2 <= 31 ? 1518500249 : e2 <= 47 ? 1859775393 : e2 <= 63 ? 2400959708 : 2840853838; + } + function $b(e2) { + return e2 <= 15 ? 1352829926 : e2 <= 31 ? 1548603684 : e2 <= 47 ? 1836072691 : e2 <= 63 ? 2053994217 : 0; + } + Db.inherits(qb, Kb), Nb.ripemd160 = qb, qb.blockSize = 512, qb.outSize = 160, qb.hmacStrength = 192, qb.padLength = 64, qb.prototype._update = function(e2, t2) { + for (var n2 = this.h[0], r2 = this.h[1], i2 = this.h[2], o2 = this.h[3], a2 = this.h[4], s2 = n2, u2 = r2, l2 = i2, c2 = o2, d2 = a2, f2 = 0; f2 < 80; f2++) { + var h2 = zb(Bb(Fb(n2, Hb(f2, r2, i2, o2), e2[Vb[f2] + t2], Wb(f2)), Gb[f2]), a2); + n2 = a2, a2 = o2, o2 = Bb(i2, 10), i2 = r2, r2 = h2, h2 = zb(Bb(Fb(s2, Hb(79 - f2, u2, l2, c2), e2[Yb[f2] + t2], $b(f2)), Zb[f2]), d2), s2 = d2, d2 = c2, c2 = Bb(l2, 10), l2 = u2, u2 = h2; + } + h2 = Ub(this.h[1], i2, c2), this.h[1] = Ub(this.h[2], o2, d2), this.h[2] = Ub(this.h[3], a2, s2), this.h[3] = Ub(this.h[4], n2, u2), this.h[4] = Ub(this.h[0], r2, l2), this.h[0] = h2; + }, qb.prototype._digest = function(e2) { + return "hex" === e2 ? Db.toHex32(this.h, "little") : Db.split32(this.h, "little"); + }; + var Vb = [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], Yb = [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], Gb = [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], Zb = [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], Qb = av, Jb = vg; + function Xb(e2, t2, n2) { + if (!(this instanceof Xb)) + return new Xb(e2, t2, n2); + this.Hash = e2, this.blockSize = e2.blockSize / 8, this.outSize = e2.outSize / 8, this.inner = null, this.outer = null, this._init(Qb.toArray(t2, n2)); + } + var ey, ty, ny = Xb; + Xb.prototype._init = function(e2) { + e2.length > this.blockSize && (e2 = new this.Hash().update(e2).digest()), Jb(e2.length <= this.blockSize); + for (var t2 = e2.length; t2 < this.blockSize; t2++) + e2.push(0); + for (t2 = 0; t2 < e2.length; t2++) + e2[t2] ^= 54; + for (this.inner = new this.Hash().update(e2), t2 = 0; t2 < e2.length; t2++) + e2[t2] ^= 106; + this.outer = new this.Hash().update(e2); + }, Xb.prototype.update = function(e2, t2) { + return this.inner.update(e2, t2), this; + }, Xb.prototype.digest = function(e2) { + return this.outer.update(this.inner.digest()), this.outer.digest(e2); + }, function(e2) { + var t2 = e2; + t2.utils = av, t2.common = hv, t2.sha = vv, t2.ripemd = Nb, t2.hmac = ny, t2.sha1 = t2.sha.sha1, t2.sha256 = t2.sha.sha256, t2.sha224 = t2.sha.sha224, t2.sha384 = t2.sha.sha384, t2.sha512 = t2.sha.sha512, t2.ripemd160 = t2.ripemd.ripemd160; + }(ov), function(e2) { + var t2, n2 = e2, r2 = ov, i2 = Mg, o2 = pg.assert; + function a2(e3) { + "short" === e3.type ? this.curve = new i2.short(e3) : "edwards" === e3.type ? this.curve = new i2.edwards(e3) : this.curve = new i2.mont(e3), this.g = this.curve.g, this.n = this.curve.n, this.hash = e3.hash, o2(this.g.validate(), "Invalid curve"), o2(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O"); + } + function s2(e3, t3) { + Object.defineProperty(n2, e3, { configurable: true, enumerable: true, get: function() { + var r3 = new a2(t3); + return Object.defineProperty(n2, e3, { configurable: true, enumerable: true, value: r3 }), r3; + } }); + } + n2.PresetCurve = a2, s2("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: r2.sha256, gRed: false, g: ["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012", "07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"] }), s2("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: r2.sha256, gRed: false, g: ["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21", "bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"] }), s2("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: r2.sha256, gRed: false, g: ["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296", "4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"] }), s2("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: r2.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"] }), s2("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: r2.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"] }), s2("curve25519", { type: "mont", prime: "p25519", p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", a: "76d06", b: "1", n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", hash: r2.sha256, gRed: false, g: ["9"] }), s2("ed25519", { type: "edwards", prime: "p25519", p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", a: "-1", c: "1", d: "52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3", n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", hash: r2.sha256, gRed: false, g: ["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a", "6666666666666666666666666666666666666666666666666666666666666658"] }); + try { + t2 = ty ? ey : (ty = 1, ey = { doubles: { step: 4, points: [["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a", "f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"], ["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", "11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"], ["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739", "d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"], ["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", "4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"], ["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c", "4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"], ["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda", "96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"], ["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa", "5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"], ["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0", "cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"], ["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d", "9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"], ["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d", "e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"], ["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1", "9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"], ["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0", "5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"], ["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047", "10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"], ["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862", "283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"], ["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7", "7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"], ["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd", "56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"], ["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83", "7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"], ["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a", "53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"], ["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8", "bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"], ["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d", "4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"], ["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725", "7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"], ["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754", "4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"], ["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c", "17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"], ["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6", "6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"], ["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39", "c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"], ["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891", "893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"], ["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b", "febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"], ["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03", "2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"], ["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d", "eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"], ["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070", "7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"], ["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4", "e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"], ["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da", "662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"], ["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11", "1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"], ["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e", "efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"], ["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41", "2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"], ["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef", "67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"], ["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8", "db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"], ["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d", "648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"], ["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96", "35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"], ["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd", "ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"], ["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5", "9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"], ["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266", "40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"], ["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71", "34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"], ["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac", "c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"], ["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751", "1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"], ["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e", "493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"], ["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241", "c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"], ["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3", "be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"], ["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f", "4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"], ["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19", "aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"], ["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be", "b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"], ["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9", "6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"], ["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2", "8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"], ["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13", "7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"], ["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c", "ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"], ["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba", "2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"], ["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151", "e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"], ["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073", "d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"], ["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458", "38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"], ["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b", "69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"], ["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366", "d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"], ["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa", "40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"], ["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0", "620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"], ["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787", "7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"], ["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e", "ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]] }, naf: { wnd: 7, points: [["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9", "388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"], ["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4", "d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"], ["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc", "6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"], ["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe", "cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"], ["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb", "d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"], ["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8", "ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"], ["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e", "581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"], ["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34", "4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"], ["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c", "85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"], ["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5", "321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"], ["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f", "2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"], ["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714", "73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"], ["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729", "a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"], ["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db", "2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"], ["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4", "e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"], ["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5", "b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"], ["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479", "2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"], ["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d", "80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"], ["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f", "1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"], ["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb", "d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"], ["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9", "eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"], ["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963", "758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"], ["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74", "958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"], ["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530", "e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"], ["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b", "5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"], ["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247", "cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"], ["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1", "cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"], ["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120", "4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"], ["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435", "91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"], ["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18", "673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"], ["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8", "59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"], ["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb", "3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"], ["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f", "55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"], ["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143", "efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"], ["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba", "e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"], ["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45", "f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"], ["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a", "744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"], ["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e", "c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"], ["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8", "e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"], ["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c", "30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"], ["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519", "e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"], ["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab", "100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"], ["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca", "ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"], ["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf", "8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"], ["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610", "68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"], ["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4", "f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"], ["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c", "d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"], ["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940", "edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"], ["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980", "a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"], ["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3", "66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"], ["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf", "9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"], ["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63", "4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"], ["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448", "fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"], ["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf", "5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"], ["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5", "8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"], ["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6", "8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"], ["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5", "5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"], ["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99", "f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"], ["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51", "f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"], ["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5", "42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"], ["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5", "204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"], ["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997", "4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"], ["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881", "73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"], ["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5", "39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"], ["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66", "d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"], ["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726", "ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"], ["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede", "6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"], ["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94", "60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"], ["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31", "3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"], ["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51", "b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"], ["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252", "ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"], ["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5", "cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"], ["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b", "6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"], ["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4", "322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"], ["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f", "6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"], ["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889", "2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"], ["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246", "b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"], ["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984", "998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"], ["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a", "b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"], ["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030", "bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"], ["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197", "6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"], ["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593", "c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"], ["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef", "21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"], ["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38", "60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"], ["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a", "49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"], ["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111", "5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"], ["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502", "7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"], ["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea", "be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"], ["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26", "8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"], ["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986", "39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"], ["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e", "62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"], ["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4", "25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"], ["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda", "ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"], ["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859", "cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"], ["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f", "f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"], ["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c", "6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"], ["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942", "fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"], ["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a", "1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"], ["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80", "5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"], ["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d", "438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"], ["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1", "cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"], ["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63", "c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"], ["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352", "6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"], ["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193", "ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"], ["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00", "9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"], ["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58", "ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"], ["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7", "d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"], ["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8", "c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"], ["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e", "67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"], ["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d", "cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"], ["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b", "299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"], ["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f", "f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"], ["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6", "462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"], ["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297", "62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"], ["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a", "7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"], ["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c", "ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"], ["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52", "4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"], ["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb", "bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"], ["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065", "bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"], ["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917", "603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"], ["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9", "cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"], ["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3", "553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"], ["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57", "712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"], ["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66", "ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"], ["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8", "9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"], ["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721", "9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"], ["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180", "4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]] } }); + } catch (e3) { + t2 = void 0; + } + s2("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: r2.sha256, beta: "7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee", lambda: "5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72", basis: [{ a: "3086d221a7d46bcde86c90e49284eb15", b: "-e4437ed6010e88286f547fa90abfe4c3" }, { a: "114ca50f7a8e2f3f657c1108d9d44cfd8", b: "3086d221a7d46bcde86c90e49284eb15" }], gRed: false, g: ["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", t2] }); + }(iv); + var ry = ov, iy = yg, oy = vg; + function ay(e2) { + if (!(this instanceof ay)) + return new ay(e2); + this.hash = e2.hash, this.predResist = !!e2.predResist, this.outLen = this.hash.outSize, this.minEntropy = e2.minEntropy || this.hash.hmacStrength, this._reseed = null, this.reseedInterval = null, this.K = null, this.V = null; + var t2 = iy.toArray(e2.entropy, e2.entropyEnc || "hex"), n2 = iy.toArray(e2.nonce, e2.nonceEnc || "hex"), r2 = iy.toArray(e2.pers, e2.persEnc || "hex"); + oy(t2.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._init(t2, n2, r2); + } + var sy = ay; + ay.prototype._init = function(e2, t2, n2) { + var r2 = e2.concat(t2).concat(n2); + 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(r2), this._reseed = 1, this.reseedInterval = 281474976710656; + }, ay.prototype._hmac = function() { + return new ry.hmac(this.hash, this.K); + }, ay.prototype._update = function(e2) { + var t2 = this._hmac().update(this.V).update([0]); + e2 && (t2 = t2.update(e2)), this.K = t2.digest(), this.V = this._hmac().update(this.V).digest(), e2 && (this.K = this._hmac().update(this.V).update([1]).update(e2).digest(), this.V = this._hmac().update(this.V).digest()); + }, ay.prototype.reseed = function(e2, t2, n2, r2) { + "string" != typeof t2 && (r2 = n2, n2 = t2, t2 = null), e2 = iy.toArray(e2, t2), n2 = iy.toArray(n2, r2), oy(e2.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._update(e2.concat(n2 || [])), this._reseed = 1; + }, ay.prototype.generate = function(e2, t2, n2, r2) { + if (this._reseed > this.reseedInterval) + throw new Error("Reseed is required"); + "string" != typeof t2 && (r2 = n2, n2 = t2, t2 = null), n2 && (n2 = iy.toArray(n2, r2 || "hex"), this._update(n2)); + for (var i2 = []; i2.length < e2; ) + this.V = this._hmac().update(this.V).digest(), i2 = i2.concat(this.V); + var o2 = i2.slice(0, e2); + return this._update(n2), this._reseed++, iy.encode(o2, t2); + }; + var uy = gg, ly = pg.assert; + function cy(e2, t2) { + this.ec = e2, this.priv = null, this.pub = null, t2.priv && this._importPrivate(t2.priv, t2.privEnc), t2.pub && this._importPublic(t2.pub, t2.pubEnc); + } + var dy = cy; + cy.fromPublic = function(e2, t2, n2) { + return t2 instanceof cy ? t2 : new cy(e2, { pub: t2, pubEnc: n2 }); + }, cy.fromPrivate = function(e2, t2, n2) { + return t2 instanceof cy ? t2 : new cy(e2, { priv: t2, privEnc: n2 }); + }, cy.prototype.validate = function() { + var e2 = this.getPublic(); + return e2.isInfinity() ? { result: false, reason: "Invalid public key" } : e2.validate() ? e2.mul(this.ec.curve.n).isInfinity() ? { result: true, reason: null } : { result: false, reason: "Public key * N != O" } : { result: false, reason: "Public key is not a point" }; + }, cy.prototype.getPublic = function(e2, t2) { + return "string" == typeof e2 && (t2 = e2, e2 = null), this.pub || (this.pub = this.ec.g.mul(this.priv)), t2 ? this.pub.encode(t2, e2) : this.pub; + }, cy.prototype.getPrivate = function(e2) { + return "hex" === e2 ? this.priv.toString(16, 2) : this.priv; + }, cy.prototype._importPrivate = function(e2, t2) { + this.priv = new uy(e2, t2 || 16), this.priv = this.priv.umod(this.ec.curve.n); + }, cy.prototype._importPublic = function(e2, t2) { + if (e2.x || e2.y) + return "mont" === this.ec.curve.type ? ly(e2.x, "Need x coordinate") : "short" !== this.ec.curve.type && "edwards" !== this.ec.curve.type || ly(e2.x && e2.y, "Need both x and y coordinate"), void (this.pub = this.ec.curve.point(e2.x, e2.y)); + this.pub = this.ec.curve.decodePoint(e2, t2); + }, cy.prototype.derive = function(e2) { + return e2.validate() || ly(e2.validate(), "public point not validated"), e2.mul(this.priv).getX(); + }, cy.prototype.sign = function(e2, t2, n2) { + return this.ec.sign(e2, this, t2, n2); + }, cy.prototype.verify = function(e2, t2) { + return this.ec.verify(e2, t2, this); + }, cy.prototype.inspect = function() { + return ""; + }; + var fy = gg, hy = pg, py = hy.assert; + function my(e2, t2) { + if (e2 instanceof my) + return e2; + this._importDER(e2, t2) || (py(e2.r && e2.s, "Signature without r or s"), this.r = new fy(e2.r, 16), this.s = new fy(e2.s, 16), void 0 === e2.recoveryParam ? this.recoveryParam = null : this.recoveryParam = e2.recoveryParam); + } + var gy = my; + function vy() { + this.place = 0; + } + function by(e2, t2) { + var n2 = e2[t2.place++]; + if (!(128 & n2)) + return n2; + var r2 = 15 & n2; + if (0 === r2 || r2 > 4) + return false; + for (var i2 = 0, o2 = 0, a2 = t2.place; o2 < r2; o2++, a2++) + i2 <<= 8, i2 |= e2[a2], i2 >>>= 0; + return !(i2 <= 127) && (t2.place = a2, i2); + } + function yy(e2) { + for (var t2 = 0, n2 = e2.length - 1; !e2[t2] && !(128 & e2[t2 + 1]) && t2 < n2; ) + t2++; + return 0 === t2 ? e2 : e2.slice(t2); + } + function wy(e2, t2) { + if (t2 < 128) + e2.push(t2); + else { + var n2 = 1 + (Math.log(t2) / Math.LN2 >>> 3); + for (e2.push(128 | n2); --n2; ) + e2.push(t2 >>> (n2 << 3) & 255); + e2.push(t2); + } + } + my.prototype._importDER = function(e2, t2) { + e2 = hy.toArray(e2, t2); + var n2 = new vy(); + if (48 !== e2[n2.place++]) + return false; + var r2 = by(e2, n2); + if (false === r2) + return false; + if (r2 + n2.place !== e2.length) + return false; + if (2 !== e2[n2.place++]) + return false; + var i2 = by(e2, n2); + if (false === i2) + return false; + var o2 = e2.slice(n2.place, i2 + n2.place); + if (n2.place += i2, 2 !== e2[n2.place++]) + return false; + var a2 = by(e2, n2); + if (false === a2) + return false; + if (e2.length !== a2 + n2.place) + return false; + var s2 = e2.slice(n2.place, a2 + n2.place); + if (0 === o2[0]) { + if (!(128 & o2[1])) + return false; + o2 = o2.slice(1); + } + if (0 === s2[0]) { + if (!(128 & s2[1])) + return false; + s2 = s2.slice(1); + } + return this.r = new fy(o2), this.s = new fy(s2), this.recoveryParam = null, true; + }, my.prototype.toDER = function(e2) { + var t2 = this.r.toArray(), n2 = this.s.toArray(); + for (128 & t2[0] && (t2 = [0].concat(t2)), 128 & n2[0] && (n2 = [0].concat(n2)), t2 = yy(t2), n2 = yy(n2); !(n2[0] || 128 & n2[1]); ) + n2 = n2.slice(1); + var r2 = [2]; + wy(r2, t2.length), (r2 = r2.concat(t2)).push(2), wy(r2, n2.length); + var i2 = r2.concat(n2), o2 = [48]; + return wy(o2, i2.length), o2 = o2.concat(i2), hy.encode(o2, e2); + }; + var _y = gg, Sy = sy, Ey = iv, ky = kg, My = pg.assert, Cy = dy, xy = gy; + function Ay(e2) { + if (!(this instanceof Ay)) + return new Ay(e2); + "string" == typeof e2 && (My(Object.prototype.hasOwnProperty.call(Ey, e2), "Unknown curve " + e2), e2 = Ey[e2]), e2 instanceof Ey.PresetCurve && (e2 = { curve: e2 }), this.curve = e2.curve.curve, this.n = this.curve.n, this.nh = this.n.ushrn(1), this.g = this.curve.g, this.g = e2.curve.g, this.g.precompute(e2.curve.n.bitLength() + 1), this.hash = e2.hash || e2.curve.hash; + } + var Ry = Ay; + Ay.prototype.keyPair = function(e2) { + return new Cy(this, e2); + }, Ay.prototype.keyFromPrivate = function(e2, t2) { + return Cy.fromPrivate(this, e2, t2); + }, Ay.prototype.keyFromPublic = function(e2, t2) { + return Cy.fromPublic(this, e2, t2); + }, Ay.prototype.genKeyPair = function(e2) { + e2 || (e2 = {}); + for (var t2 = new Sy({ hash: this.hash, pers: e2.pers, persEnc: e2.persEnc || "utf8", entropy: e2.entropy || ky(this.hash.hmacStrength), entropyEnc: e2.entropy && e2.entropyEnc || "utf8", nonce: this.n.toArray() }), n2 = this.n.byteLength(), r2 = this.n.sub(new _y(2)); ; ) { + var i2 = new _y(t2.generate(n2)); + if (!(i2.cmp(r2) > 0)) + return i2.iaddn(1), this.keyFromPrivate(i2); + } + }, Ay.prototype._truncateToN = function(e2, t2) { + var n2 = 8 * e2.byteLength() - this.n.bitLength(); + return n2 > 0 && (e2 = e2.ushrn(n2)), !t2 && e2.cmp(this.n) >= 0 ? e2.sub(this.n) : e2; + }, Ay.prototype.sign = function(e2, t2, n2, r2) { + "object" == typeof n2 && (r2 = n2, n2 = null), r2 || (r2 = {}), t2 = this.keyFromPrivate(t2, n2), e2 = this._truncateToN(new _y(e2, 16)); + for (var i2 = this.n.byteLength(), o2 = t2.getPrivate().toArray("be", i2), a2 = e2.toArray("be", i2), s2 = new Sy({ hash: this.hash, entropy: o2, nonce: a2, pers: r2.pers, persEnc: r2.persEnc || "utf8" }), u2 = this.n.sub(new _y(1)), l2 = 0; ; l2++) { + var c2 = r2.k ? r2.k(l2) : new _y(s2.generate(this.n.byteLength())); + if (!((c2 = this._truncateToN(c2, true)).cmpn(1) <= 0 || c2.cmp(u2) >= 0)) { + var d2 = this.g.mul(c2); + if (!d2.isInfinity()) { + var f2 = d2.getX(), h2 = f2.umod(this.n); + if (0 !== h2.cmpn(0)) { + var p2 = c2.invm(this.n).mul(h2.mul(t2.getPrivate()).iadd(e2)); + if (0 !== (p2 = p2.umod(this.n)).cmpn(0)) { + var m2 = (d2.getY().isOdd() ? 1 : 0) | (0 !== f2.cmp(h2) ? 2 : 0); + return r2.canonical && p2.cmp(this.nh) > 0 && (p2 = this.n.sub(p2), m2 ^= 1), new xy({ r: h2, s: p2, recoveryParam: m2 }); + } + } + } + } + } + }, Ay.prototype.verify = function(e2, t2, n2, r2) { + e2 = this._truncateToN(new _y(e2, 16)), n2 = this.keyFromPublic(n2, r2); + var i2 = (t2 = new xy(t2, "hex")).r, o2 = t2.s; + if (i2.cmpn(1) < 0 || i2.cmp(this.n) >= 0) + return false; + if (o2.cmpn(1) < 0 || o2.cmp(this.n) >= 0) + return false; + var a2, s2 = o2.invm(this.n), u2 = s2.mul(e2).umod(this.n), l2 = s2.mul(i2).umod(this.n); + return this.curve._maxwellTrick ? !(a2 = this.g.jmulAdd(u2, n2.getPublic(), l2)).isInfinity() && a2.eqXToP(i2) : !(a2 = this.g.mulAdd(u2, n2.getPublic(), l2)).isInfinity() && 0 === a2.getX().umod(this.n).cmp(i2); + }, Ay.prototype.recoverPubKey = function(e2, t2, n2, r2) { + My((3 & n2) === n2, "The recovery param is more than two bits"), t2 = new xy(t2, r2); + var i2 = this.n, o2 = new _y(e2), a2 = t2.r, s2 = t2.s, u2 = 1 & n2, l2 = n2 >> 1; + if (a2.cmp(this.curve.p.umod(this.curve.n)) >= 0 && l2) + throw new Error("Unable to find sencond key candinate"); + a2 = l2 ? this.curve.pointFromX(a2.add(this.curve.n), u2) : this.curve.pointFromX(a2, u2); + var c2 = t2.r.invm(i2), d2 = i2.sub(o2).mul(c2).umod(i2), f2 = s2.mul(c2).umod(i2); + return this.g.mulAdd(d2, a2, f2); + }, Ay.prototype.getKeyRecoveryParam = function(e2, t2, n2, r2) { + if (null !== (t2 = new xy(t2, r2)).recoveryParam) + return t2.recoveryParam; + for (var i2 = 0; i2 < 4; i2++) { + var o2; + try { + o2 = this.recoverPubKey(e2, t2, i2); + } catch (e3) { + continue; + } + if (o2.eq(n2)) + return i2; + } + throw new Error("Unable to find valid recovery factor"); + }; + var Ty = pg, Py = Ty.assert, Ly = Ty.parseBytes, Iy = Ty.cachedProperty; + function Oy(e2, t2) { + this.eddsa = e2, this._secret = Ly(t2.secret), e2.isPoint(t2.pub) ? this._pub = t2.pub : this._pubBytes = Ly(t2.pub); + } + Oy.fromPublic = function(e2, t2) { + return t2 instanceof Oy ? t2 : new Oy(e2, { pub: t2 }); + }, Oy.fromSecret = function(e2, t2) { + return t2 instanceof Oy ? t2 : new Oy(e2, { secret: t2 }); + }, Oy.prototype.secret = function() { + return this._secret; + }, Iy(Oy, "pubBytes", function() { + return this.eddsa.encodePoint(this.pub()); + }), Iy(Oy, "pub", function() { + return this._pubBytes ? this.eddsa.decodePoint(this._pubBytes) : this.eddsa.g.mul(this.priv()); + }), Iy(Oy, "privBytes", function() { + var e2 = this.eddsa, t2 = this.hash(), n2 = e2.encodingLength - 1, r2 = t2.slice(0, e2.encodingLength); + return r2[0] &= 248, r2[n2] &= 127, r2[n2] |= 64, r2; + }), Iy(Oy, "priv", function() { + return this.eddsa.decodeInt(this.privBytes()); + }), Iy(Oy, "hash", function() { + return this.eddsa.hash().update(this.secret()).digest(); + }), Iy(Oy, "messagePrefix", function() { + return this.hash().slice(this.eddsa.encodingLength); + }), Oy.prototype.sign = function(e2) { + return Py(this._secret, "KeyPair can only verify"), this.eddsa.sign(e2, this); + }, Oy.prototype.verify = function(e2, t2) { + return this.eddsa.verify(e2, t2, this); + }, Oy.prototype.getSecret = function(e2) { + return Py(this._secret, "KeyPair is public only"), Ty.encode(this.secret(), e2); + }, Oy.prototype.getPublic = function(e2) { + return Ty.encode(this.pubBytes(), e2); + }; + var Ny = Oy, Dy = gg, jy = pg, By = jy.assert, zy = jy.cachedProperty, Uy = jy.parseBytes; + function Fy(e2, t2) { + this.eddsa = e2, "object" != typeof t2 && (t2 = Uy(t2)), Array.isArray(t2) && (t2 = { R: t2.slice(0, e2.encodingLength), S: t2.slice(e2.encodingLength) }), By(t2.R && t2.S, "Signature without R or S"), e2.isPoint(t2.R) && (this._R = t2.R), t2.S instanceof Dy && (this._S = t2.S), this._Rencoded = Array.isArray(t2.R) ? t2.R : t2.Rencoded, this._Sencoded = Array.isArray(t2.S) ? t2.S : t2.Sencoded; + } + zy(Fy, "S", function() { + return this.eddsa.decodeInt(this.Sencoded()); + }), zy(Fy, "R", function() { + return this.eddsa.decodePoint(this.Rencoded()); + }), zy(Fy, "Rencoded", function() { + return this.eddsa.encodePoint(this.R()); + }), zy(Fy, "Sencoded", function() { + return this.eddsa.encodeInt(this.S()); + }), Fy.prototype.toBytes = function() { + return this.Rencoded().concat(this.Sencoded()); + }, Fy.prototype.toHex = function() { + return jy.encode(this.toBytes(), "hex").toUpperCase(); + }; + var Ky = Fy, qy = ov, Hy = iv, Wy = pg, $y = Wy.assert, Vy = Wy.parseBytes, Yy = Ny, Gy = Ky; + function Zy(e2) { + if ($y("ed25519" === e2, "only tested with ed25519 so far"), !(this instanceof Zy)) + return new Zy(e2); + e2 = Hy[e2].curve, this.curve = e2, this.g = e2.g, this.g.precompute(e2.n.bitLength() + 1), this.pointClass = e2.point().constructor, this.encodingLength = Math.ceil(e2.n.bitLength() / 8), this.hash = qy.sha512; + } + var Qy = Zy; + Zy.prototype.sign = function(e2, t2) { + e2 = Vy(e2); + var n2 = this.keyFromSecret(t2), r2 = this.hashInt(n2.messagePrefix(), e2), i2 = this.g.mul(r2), o2 = this.encodePoint(i2), a2 = this.hashInt(o2, n2.pubBytes(), e2).mul(n2.priv()), s2 = r2.add(a2).umod(this.curve.n); + return this.makeSignature({ R: i2, S: s2, Rencoded: o2 }); + }, Zy.prototype.verify = function(e2, t2, n2) { + e2 = Vy(e2), t2 = this.makeSignature(t2); + var r2 = this.keyFromPublic(n2), i2 = this.hashInt(t2.Rencoded(), r2.pubBytes(), e2), o2 = this.g.mul(t2.S()); + return t2.R().add(r2.pub().mul(i2)).eq(o2); + }, Zy.prototype.hashInt = function() { + for (var e2 = this.hash(), t2 = 0; t2 < arguments.length; t2++) + e2.update(arguments[t2]); + return Wy.intFromLE(e2.digest()).umod(this.curve.n); + }, Zy.prototype.keyFromPublic = function(e2) { + return Yy.fromPublic(this, e2); + }, Zy.prototype.keyFromSecret = function(e2) { + return Yy.fromSecret(this, e2); + }, Zy.prototype.makeSignature = function(e2) { + return e2 instanceof Gy ? e2 : new Gy(this, e2); + }, Zy.prototype.encodePoint = function(e2) { + var t2 = e2.getY().toArray("le", this.encodingLength); + return t2[this.encodingLength - 1] |= e2.getX().isOdd() ? 128 : 0, t2; + }, Zy.prototype.decodePoint = function(e2) { + var t2 = (e2 = Wy.parseBytes(e2)).length - 1, n2 = e2.slice(0, t2).concat(-129 & e2[t2]), r2 = 0 != (128 & e2[t2]), i2 = Wy.intFromLE(n2); + return this.curve.pointFromY(i2, r2); + }, Zy.prototype.encodeInt = function(e2) { + return e2.toArray("le", this.encodingLength); + }, Zy.prototype.decodeInt = function(e2) { + return Wy.intFromLE(e2); + }, Zy.prototype.isPoint = function(e2) { + return e2 instanceof this.pointClass; + }, function(e2) { + var t2 = e2; + t2.version = hg, t2.utils = pg, t2.rand = kg, t2.curve = Mg, t2.curves = iv, t2.ec = Ry, t2.eddsa = Qy; + }(fg); + const Jy = new fg.ec("secp256k1"), Xy = Jy.curve, ew = Xy.n.constructor; + function tw(e2) { + const t2 = e2[0]; + switch (t2) { + case 2: + case 3: + return 33 !== e2.length ? null : function(e3, t3) { + let n2 = new ew(t3); + if (n2.cmp(Xy.p) >= 0) + return null; + n2 = n2.toRed(Xy.red); + let r2 = n2.redSqr().redIMul(n2).redIAdd(Xy.b).redSqrt(); + return 3 === e3 !== r2.isOdd() && (r2 = r2.redNeg()), Jy.keyPair({ pub: { x: n2, y: r2 } }); + }(t2, e2.subarray(1, 33)); + case 4: + case 6: + case 7: + return 65 !== e2.length ? null : function(e3, t3, n2) { + let r2 = new ew(t3), i2 = new ew(n2); + if (r2.cmp(Xy.p) >= 0 || i2.cmp(Xy.p) >= 0) + return null; + if (r2 = r2.toRed(Xy.red), i2 = i2.toRed(Xy.red), (6 === e3 || 7 === e3) && i2.isOdd() !== (7 === e3)) + return null; + const o2 = r2.redSqr().redIMul(r2); + return i2.redSqr().redISub(o2.redIAdd(Xy.b)).isZero() ? Jy.keyPair({ pub: { x: r2, y: i2 } }) : null; + }(t2, e2.subarray(1, 33), e2.subarray(33, 65)); + default: + return null; + } + } + function nw(e2, t2) { + const n2 = t2.encode(null, 33 === e2.length); + for (let t3 = 0; t3 < e2.length; ++t3) + e2[t3] = n2[t3]; + } + var rw = { contextRandomize: () => 0, privateKeyVerify(e2) { + const t2 = new ew(e2); + return t2.cmp(Xy.n) < 0 && !t2.isZero() ? 0 : 1; + }, privateKeyNegate(e2) { + const t2 = new ew(e2), n2 = Xy.n.sub(t2).umod(Xy.n).toArrayLike(Uint8Array, "be", 32); + return e2.set(n2), 0; + }, privateKeyTweakAdd(e2, t2) { + const n2 = new ew(t2); + if (n2.cmp(Xy.n) >= 0) + return 1; + if (n2.iadd(new ew(e2)), n2.cmp(Xy.n) >= 0 && n2.isub(Xy.n), n2.isZero()) + return 1; + const r2 = n2.toArrayLike(Uint8Array, "be", 32); + return e2.set(r2), 0; + }, privateKeyTweakMul(e2, t2) { + let n2 = new ew(t2); + if (n2.cmp(Xy.n) >= 0 || n2.isZero()) + return 1; + n2.imul(new ew(e2)), n2.cmp(Xy.n) >= 0 && (n2 = n2.umod(Xy.n)); + const r2 = n2.toArrayLike(Uint8Array, "be", 32); + return e2.set(r2), 0; + }, publicKeyVerify: (e2) => null === tw(e2) ? 1 : 0, publicKeyCreate(e2, t2) { + const n2 = new ew(t2); + if (n2.cmp(Xy.n) >= 0 || n2.isZero()) + return 1; + return nw(e2, Jy.keyFromPrivate(t2).getPublic()), 0; + }, publicKeyConvert(e2, t2) { + const n2 = tw(t2); + if (null === n2) + return 1; + return nw(e2, n2.getPublic()), 0; + }, publicKeyNegate(e2, t2) { + const n2 = tw(t2); + if (null === n2) + return 1; + const r2 = n2.getPublic(); + return r2.y = r2.y.redNeg(), nw(e2, r2), 0; + }, publicKeyCombine(e2, t2) { + const n2 = new Array(t2.length); + for (let e3 = 0; e3 < t2.length; ++e3) + if (n2[e3] = tw(t2[e3]), null === n2[e3]) + return 1; + let r2 = n2[0].getPublic(); + for (let e3 = 1; e3 < n2.length; ++e3) + r2 = r2.add(n2[e3].pub); + return r2.isInfinity() ? 2 : (nw(e2, r2), 0); + }, publicKeyTweakAdd(e2, t2, n2) { + const r2 = tw(t2); + if (null === r2) + return 1; + if ((n2 = new ew(n2)).cmp(Xy.n) >= 0) + return 2; + const i2 = r2.getPublic().add(Xy.g.mul(n2)); + return i2.isInfinity() ? 2 : (nw(e2, i2), 0); + }, publicKeyTweakMul(e2, t2, n2) { + const r2 = tw(t2); + if (null === r2) + return 1; + if ((n2 = new ew(n2)).cmp(Xy.n) >= 0 || n2.isZero()) + return 2; + return nw(e2, r2.getPublic().mul(n2)), 0; + }, signatureNormalize(e2) { + const t2 = new ew(e2.subarray(0, 32)), n2 = new ew(e2.subarray(32, 64)); + return t2.cmp(Xy.n) >= 0 || n2.cmp(Xy.n) >= 0 ? 1 : (1 === n2.cmp(Jy.nh) && e2.set(Xy.n.sub(n2).toArrayLike(Uint8Array, "be", 32), 32), 0); + }, signatureExport(e2, t2) { + const n2 = t2.subarray(0, 32), r2 = t2.subarray(32, 64); + if (new ew(n2).cmp(Xy.n) >= 0) + return 1; + if (new ew(r2).cmp(Xy.n) >= 0) + return 1; + const { output: i2 } = e2; + let o2 = i2.subarray(4, 37); + o2[0] = 0, o2.set(n2, 1); + let a2 = 33, s2 = 0; + for (; a2 > 1 && 0 === o2[s2] && !(128 & o2[s2 + 1]); --a2, ++s2) + ; + if (o2 = o2.subarray(s2), 128 & o2[0]) + return 1; + if (a2 > 1 && 0 === o2[0] && !(128 & o2[1])) + return 1; + let u2 = i2.subarray(39, 72); + u2[0] = 0, u2.set(r2, 1); + let l2 = 33, c2 = 0; + for (; l2 > 1 && 0 === u2[c2] && !(128 & u2[c2 + 1]); --l2, ++c2) + ; + return u2 = u2.subarray(c2), 128 & u2[0] || l2 > 1 && 0 === u2[0] && !(128 & u2[1]) ? 1 : (e2.outputlen = 6 + a2 + l2, i2[0] = 48, i2[1] = e2.outputlen - 2, i2[2] = 2, i2[3] = o2.length, i2.set(o2, 4), i2[4 + a2] = 2, i2[5 + a2] = u2.length, i2.set(u2, 6 + a2), 0); + }, signatureImport(e2, t2) { + if (t2.length < 8) + return 1; + if (t2.length > 72) + return 1; + if (48 !== t2[0]) + return 1; + if (t2[1] !== t2.length - 2) + return 1; + if (2 !== t2[2]) + return 1; + const n2 = t2[3]; + if (0 === n2) + return 1; + if (5 + n2 >= t2.length) + return 1; + if (2 !== t2[4 + n2]) + return 1; + const r2 = t2[5 + n2]; + if (0 === r2) + return 1; + if (6 + n2 + r2 !== t2.length) + return 1; + if (128 & t2[4]) + return 1; + if (n2 > 1 && 0 === t2[4] && !(128 & t2[5])) + return 1; + if (128 & t2[n2 + 6]) + return 1; + if (r2 > 1 && 0 === t2[n2 + 6] && !(128 & t2[n2 + 7])) + return 1; + let i2 = t2.subarray(4, 4 + n2); + if (33 === i2.length && 0 === i2[0] && (i2 = i2.subarray(1)), i2.length > 32) + return 1; + let o2 = t2.subarray(6 + n2); + if (33 === o2.length && 0 === o2[0] && (o2 = o2.slice(1)), o2.length > 32) + throw new Error("S length is too long"); + let a2 = new ew(i2); + a2.cmp(Xy.n) >= 0 && (a2 = new ew(0)); + let s2 = new ew(t2.subarray(6 + n2)); + return s2.cmp(Xy.n) >= 0 && (s2 = new ew(0)), e2.set(a2.toArrayLike(Uint8Array, "be", 32), 0), e2.set(s2.toArrayLike(Uint8Array, "be", 32), 32), 0; + }, ecdsaSign(e2, t2, n2, r2, i2) { + if (i2) { + const e3 = i2; + i2 = (i3) => { + const o3 = e3(t2, n2, null, r2, i3); + if (!(o3 instanceof Uint8Array && 32 === o3.length)) + throw new Error("This is the way"); + return new ew(o3); + }; + } + const o2 = new ew(n2); + if (o2.cmp(Xy.n) >= 0 || o2.isZero()) + return 1; + let a2; + try { + a2 = Jy.sign(t2, n2, { canonical: true, k: i2, pers: r2 }); + } catch (e3) { + return 1; + } + return e2.signature.set(a2.r.toArrayLike(Uint8Array, "be", 32), 0), e2.signature.set(a2.s.toArrayLike(Uint8Array, "be", 32), 32), e2.recid = a2.recoveryParam, 0; + }, ecdsaVerify(e2, t2, n2) { + const r2 = { r: e2.subarray(0, 32), s: e2.subarray(32, 64) }, i2 = new ew(r2.r), o2 = new ew(r2.s); + if (i2.cmp(Xy.n) >= 0 || o2.cmp(Xy.n) >= 0) + return 1; + if (1 === o2.cmp(Jy.nh) || i2.isZero() || o2.isZero()) + return 3; + const a2 = tw(n2); + if (null === a2) + return 2; + const s2 = a2.getPublic(); + return Jy.verify(t2, r2, s2) ? 0 : 3; + }, ecdsaRecover(e2, t2, n2, r2) { + const i2 = { r: t2.slice(0, 32), s: t2.slice(32, 64) }, o2 = new ew(i2.r), a2 = new ew(i2.s); + if (o2.cmp(Xy.n) >= 0 || a2.cmp(Xy.n) >= 0) + return 1; + if (o2.isZero() || a2.isZero()) + return 2; + let s2; + try { + s2 = Jy.recoverPubKey(r2, i2, n2); + } catch (e3) { + return 2; + } + return nw(e2, s2), 0; + }, ecdh(e2, t2, n2, r2, i2, o2, a2) { + const s2 = tw(t2); + if (null === s2) + return 1; + const u2 = new ew(n2); + if (u2.cmp(Xy.n) >= 0 || u2.isZero()) + return 2; + const l2 = s2.getPublic().mul(u2); + if (void 0 === i2) { + const t3 = l2.encode(null, true), n3 = Jy.hash().update(t3).digest(); + for (let t4 = 0; t4 < 32; ++t4) + e2[t4] = n3[t4]; + } else { + o2 || (o2 = new Uint8Array(32)); + const t3 = l2.getX().toArray("be", 32); + for (let e3 = 0; e3 < 32; ++e3) + o2[e3] = t3[e3]; + a2 || (a2 = new Uint8Array(32)); + const n3 = l2.getY().toArray("be", 32); + for (let e3 = 0; e3 < 32; ++e3) + a2[e3] = n3[e3]; + const s3 = i2(o2, a2, r2); + if (!(s3 instanceof Uint8Array && s3.length === e2.length)) + return 2; + e2.set(s3); + } + return 0; + } }, iw = ((e2) => ({ contextRandomize(t2) { + if (sg(null === t2 || t2 instanceof Uint8Array, "Expected seed to be an Uint8Array or null"), null !== t2 && ug("seed", t2, 32), 1 === e2.contextRandomize(t2)) + throw new Error(Jm); + }, privateKeyVerify: (t2) => (ug("private key", t2, 32), 0 === e2.privateKeyVerify(t2)), privateKeyNegate(t2) { + switch (ug("private key", t2, 32), e2.privateKeyNegate(t2)) { + case 0: + return t2; + case 1: + throw new Error(Gm); + } + }, privateKeyTweakAdd(t2, n2) { + switch (ug("private key", t2, 32), ug("tweak", n2, 32), e2.privateKeyTweakAdd(t2, n2)) { + case 0: + return t2; + case 1: + throw new Error(Zm); + } + }, privateKeyTweakMul(t2, n2) { + switch (ug("private key", t2, 32), ug("tweak", n2, 32), e2.privateKeyTweakMul(t2, n2)) { + case 0: + return t2; + case 1: + throw new Error(Qm); + } + }, publicKeyVerify: (t2) => (ug("public key", t2, [33, 65]), 0 === e2.publicKeyVerify(t2)), publicKeyCreate(t2, n2 = true, r2) { + switch (ug("private key", t2, 32), lg(n2), r2 = cg(r2, n2 ? 33 : 65), e2.publicKeyCreate(r2, t2)) { + case 0: + return r2; + case 1: + throw new Error(Xm); + case 2: + throw new Error(tg); + } + }, publicKeyConvert(t2, n2 = true, r2) { + switch (ug("public key", t2, [33, 65]), lg(n2), r2 = cg(r2, n2 ? 33 : 65), e2.publicKeyConvert(r2, t2)) { + case 0: + return r2; + case 1: + throw new Error(eg); + case 2: + throw new Error(tg); + } + }, publicKeyNegate(t2, n2 = true, r2) { + switch (ug("public key", t2, [33, 65]), lg(n2), r2 = cg(r2, n2 ? 33 : 65), e2.publicKeyNegate(r2, t2)) { + case 0: + return r2; + case 1: + throw new Error(eg); + case 2: + throw new Error(Gm); + case 3: + throw new Error(tg); + } + }, publicKeyCombine(t2, n2 = true, r2) { + sg(Array.isArray(t2), "Expected public keys to be an Array"), sg(t2.length > 0, "Expected public keys array will have more than zero items"); + for (const e3 of t2) + ug("public key", e3, [33, 65]); + switch (lg(n2), r2 = cg(r2, n2 ? 33 : 65), e2.publicKeyCombine(r2, t2)) { + case 0: + return r2; + case 1: + throw new Error(eg); + case 2: + throw new Error(ng); + case 3: + throw new Error(tg); + } + }, publicKeyTweakAdd(t2, n2, r2 = true, i2) { + switch (ug("public key", t2, [33, 65]), ug("tweak", n2, 32), lg(r2), i2 = cg(i2, r2 ? 33 : 65), e2.publicKeyTweakAdd(i2, t2, n2)) { + case 0: + return i2; + case 1: + throw new Error(eg); + case 2: + throw new Error(Zm); + } + }, publicKeyTweakMul(t2, n2, r2 = true, i2) { + switch (ug("public key", t2, [33, 65]), ug("tweak", n2, 32), lg(r2), i2 = cg(i2, r2 ? 33 : 65), e2.publicKeyTweakMul(i2, t2, n2)) { + case 0: + return i2; + case 1: + throw new Error(eg); + case 2: + throw new Error(Qm); + } + }, signatureNormalize(t2) { + switch (ug("signature", t2, 64), e2.signatureNormalize(t2)) { + case 0: + return t2; + case 1: + throw new Error(rg); + } + }, signatureExport(t2, n2) { + ug("signature", t2, 64); + const r2 = { output: n2 = cg(n2, 72), outputlen: 72 }; + switch (e2.signatureExport(r2, t2)) { + case 0: + return n2.slice(0, r2.outputlen); + case 1: + throw new Error(rg); + case 2: + throw new Error(Gm); + } + }, signatureImport(t2, n2) { + switch (ug("signature", t2), n2 = cg(n2, 64), e2.signatureImport(n2, t2)) { + case 0: + return n2; + case 1: + throw new Error(rg); + case 2: + throw new Error(Gm); + } + }, ecdsaSign(t2, n2, r2 = {}, i2) { + ug("message", t2, 32), ug("private key", n2, 32), sg("Object" === dg(r2), "Expected options to be an Object"), void 0 !== r2.data && ug("options.data", r2.data), void 0 !== r2.noncefn && sg("Function" === dg(r2.noncefn), "Expected options.noncefn to be a Function"); + const o2 = { signature: i2 = cg(i2, 64), recid: null }; + switch (e2.ecdsaSign(o2, t2, n2, r2.data, r2.noncefn)) { + case 0: + return o2; + case 1: + throw new Error(ig); + case 2: + throw new Error(Gm); + } + }, ecdsaVerify(t2, n2, r2) { + switch (ug("signature", t2, 64), ug("message", n2, 32), ug("public key", r2, [33, 65]), e2.ecdsaVerify(t2, n2, r2)) { + case 0: + return true; + case 3: + return false; + case 1: + throw new Error(rg); + case 2: + throw new Error(eg); + } + }, ecdsaRecover(t2, n2, r2, i2 = true, o2) { + switch (ug("signature", t2, 64), sg("Number" === dg(n2) && n2 >= 0 && n2 <= 3, "Expected recovery id to be a Number within interval [0, 3]"), ug("message", r2, 32), lg(i2), o2 = cg(o2, i2 ? 33 : 65), e2.ecdsaRecover(o2, t2, n2, r2)) { + case 0: + return o2; + case 1: + throw new Error(rg); + case 2: + throw new Error(og); + case 3: + throw new Error(Gm); + } + }, ecdh(t2, n2, r2 = {}, i2) { + switch (ug("public key", t2, [33, 65]), ug("private key", n2, 32), sg("Object" === dg(r2), "Expected options to be an Object"), void 0 !== r2.data && ug("options.data", r2.data), void 0 !== r2.hashfn ? (sg("Function" === dg(r2.hashfn), "Expected options.hashfn to be a Function"), void 0 !== r2.xbuf && ug("options.xbuf", r2.xbuf, 32), void 0 !== r2.ybuf && ug("options.ybuf", r2.ybuf, 32), ug("output", i2)) : i2 = cg(i2, 32), e2.ecdh(i2, t2, n2, r2.data, r2.hashfn, r2.xbuf, r2.ybuf)) { + case 0: + return i2; + case 1: + throw new Error(eg); + case 2: + throw new Error(ag); + } + } }))(rw), ow = {}, aw = {}; + !function(e2) { + Object.defineProperty(e2, "__esModule", { value: true }), e2.SECRET_KEY_LENGTH = e2.AES_IV_PLUS_TAG_LENGTH = e2.AES_TAG_LENGTH = e2.AES_IV_LENGTH = e2.UNCOMPRESSED_PUBLIC_KEY_SIZE = void 0, e2.UNCOMPRESSED_PUBLIC_KEY_SIZE = 65, e2.AES_IV_LENGTH = 16, e2.AES_TAG_LENGTH = 16, e2.AES_IV_PLUS_TAG_LENGTH = e2.AES_IV_LENGTH + e2.AES_TAG_LENGTH, e2.SECRET_KEY_LENGTH = 32; + }(aw); + var sw = n && n.__importDefault || function(e2) { + return e2 && e2.__esModule ? e2 : { default: e2 }; + }; + Object.defineProperty(ow, "__esModule", { value: true }), ow.aesDecrypt = ow.aesEncrypt = ow.getValidSecret = ow.decodeHex = ow.remove0x = void 0; + var uw = zm(), lw = sw(iw), cw = aw; + function dw(e2) { + return e2.startsWith("0x") || e2.startsWith("0X") ? e2.slice(2) : e2; + } + ow.remove0x = dw, ow.decodeHex = function(e2) { + return _.from(dw(e2), "hex"); + }, ow.getValidSecret = function() { + var e2; + do { + e2 = (0, uw.randomBytes)(cw.SECRET_KEY_LENGTH); + } while (!lw.default.privateKeyVerify(e2)); + return e2; + }, ow.aesEncrypt = function(e2, t2) { + var n2 = (0, uw.randomBytes)(cw.AES_IV_LENGTH), r2 = (0, uw.createCipheriv)("aes-256-gcm", e2, n2), i2 = _.concat([r2.update(t2), r2.final()]), o2 = r2.getAuthTag(); + return _.concat([n2, o2, i2]); + }, ow.aesDecrypt = function(e2, t2) { + var n2 = t2.slice(0, cw.AES_IV_LENGTH), r2 = t2.slice(cw.AES_IV_LENGTH, cw.AES_IV_PLUS_TAG_LENGTH), i2 = t2.slice(cw.AES_IV_PLUS_TAG_LENGTH), o2 = (0, uw.createDecipheriv)("aes-256-gcm", e2, n2); + return o2.setAuthTag(r2), _.concat([o2.update(i2), o2.final()]); + }; + var fw = {}, hw = n && n.__importDefault || function(e2) { + return e2 && e2.__esModule ? e2 : { default: e2 }; + }; + Object.defineProperty(fw, "__esModule", { value: true }); + var pw = hw(Ym), mw = hw(iw), gw = ow, vw = aw, bw = function() { + function e2(e3) { + this.uncompressed = _.from(mw.default.publicKeyConvert(e3, false)), this.compressed = _.from(mw.default.publicKeyConvert(e3, true)); + } + return e2.fromHex = function(t2) { + var n2 = (0, gw.decodeHex)(t2); + if (n2.length === vw.UNCOMPRESSED_PUBLIC_KEY_SIZE - 1) { + var r2 = _.from([4]); + return new e2(_.concat([r2, n2])); + } + return new e2(n2); + }, e2.prototype.toHex = function(e3) { + return void 0 === e3 && (e3 = true), e3 ? this.compressed.toString("hex") : this.uncompressed.toString("hex"); + }, e2.prototype.decapsulate = function(e3) { + var t2 = _.concat([this.uncompressed, e3.multiply(this)]); + return (0, pw.default)(t2, 32, { hash: "SHA-256" }); + }, e2.prototype.equals = function(e3) { + return this.uncompressed.equals(e3.uncompressed); + }, e2; + }(); + fw.default = bw; + var yw = n && n.__importDefault || function(e2) { + return e2 && e2.__esModule ? e2 : { default: e2 }; + }; + Object.defineProperty(le, "__esModule", { value: true }); + var ww = yw(Ym), _w = yw(iw), Sw = ow, Ew = yw(fw), kw = function() { + function e2(e3) { + if (this.secret = e3 || (0, Sw.getValidSecret)(), !_w.default.privateKeyVerify(this.secret)) + throw new Error("Invalid private key"); + this.publicKey = new Ew.default(_.from(_w.default.publicKeyCreate(this.secret))); + } + return e2.fromHex = function(t2) { + return new e2((0, Sw.decodeHex)(t2)); + }, e2.prototype.toHex = function() { + return "0x".concat(this.secret.toString("hex")); + }, e2.prototype.encapsulate = function(e3) { + var t2 = _.concat([this.publicKey.uncompressed, this.multiply(e3)]); + return (0, ww.default)(t2, 32, { hash: "SHA-256" }); + }, e2.prototype.multiply = function(e3) { + return _.from(_w.default.publicKeyTweakMul(e3.compressed, this.secret, false)); + }, e2.prototype.equals = function(e3) { + return this.secret.equals(e3.secret); + }, e2; + }(); + le.default = kw, function(e2) { + var t2 = n && n.__importDefault || function(e3) { + return e3 && e3.__esModule ? e3 : { default: e3 }; + }; + Object.defineProperty(e2, "__esModule", { value: true }), e2.PublicKey = e2.PrivateKey = void 0; + var r2 = le; + Object.defineProperty(e2, "PrivateKey", { enumerable: true, get: function() { + return t2(r2).default; + } }); + var i2 = fw; + Object.defineProperty(e2, "PublicKey", { enumerable: true, get: function() { + return t2(i2).default; + } }); + }(ue), function(e2) { + Object.defineProperty(e2, "__esModule", { value: true }), e2.utils = e2.PublicKey = e2.PrivateKey = e2.decrypt = e2.encrypt = void 0; + var t2 = ue, n2 = ow, r2 = aw; + e2.encrypt = function(e3, r3) { + var i3 = new t2.PrivateKey(), o2 = e3 instanceof _ ? new t2.PublicKey(e3) : t2.PublicKey.fromHex(e3), a2 = i3.encapsulate(o2), s2 = (0, n2.aesEncrypt)(a2, r3); + return _.concat([i3.publicKey.uncompressed, s2]); + }, e2.decrypt = function(e3, i3) { + var o2 = e3 instanceof _ ? new t2.PrivateKey(e3) : t2.PrivateKey.fromHex(e3), a2 = new t2.PublicKey(i3.slice(0, r2.UNCOMPRESSED_PUBLIC_KEY_SIZE)), s2 = i3.slice(r2.UNCOMPRESSED_PUBLIC_KEY_SIZE), u2 = a2.decapsulate(o2); + return (0, n2.aesDecrypt)(u2, s2); + }; + var i2 = ue; + Object.defineProperty(e2, "PrivateKey", { enumerable: true, get: function() { + return i2.PrivateKey; + } }), Object.defineProperty(e2, "PublicKey", { enumerable: true, get: function() { + return i2.PublicKey; + } }), e2.utils = { aesDecrypt: n2.aesDecrypt, aesEncrypt: n2.aesEncrypt, decodeHex: n2.decodeHex, getValidSecret: n2.getValidSecret, remove0x: n2.remove0x }; + }(se); + var Mw = { exports: {} }; + !function(e2, t2) { + !function(t3) { + var n2 = Object.hasOwnProperty, r2 = Array.isArray ? Array.isArray : function(e3) { + return "[object Array]" === Object.prototype.toString.call(e3); + }, i2 = "object" == typeof je && true, o2 = "function" == typeof Symbol, a2 = "object" == typeof Reflect, s2 = "function" == typeof setImmediate ? setImmediate : setTimeout, u2 = o2 ? a2 && "function" == typeof Reflect.ownKeys ? Reflect.ownKeys : function(e3) { + var t4 = Object.getOwnPropertyNames(e3); + return t4.push.apply(t4, Object.getOwnPropertySymbols(e3)), t4; + } : Object.keys; + function l2() { + this._events = {}, this._conf && c2.call(this, this._conf); + } + function c2(e3) { + e3 && (this._conf = e3, e3.delimiter && (this.delimiter = e3.delimiter), e3.maxListeners !== t3 && (this._maxListeners = e3.maxListeners), e3.wildcard && (this.wildcard = e3.wildcard), e3.newListener && (this._newListener = e3.newListener), e3.removeListener && (this._removeListener = e3.removeListener), e3.verboseMemoryLeak && (this.verboseMemoryLeak = e3.verboseMemoryLeak), e3.ignoreErrors && (this.ignoreErrors = e3.ignoreErrors), this.wildcard && (this.listenerTree = {})); + } + function d2(e3, t4) { + var n3 = "(node) warning: possible EventEmitter memory leak detected. " + e3 + " listeners added. Use emitter.setMaxListeners() to increase limit."; + if (this.verboseMemoryLeak && (n3 += " Event name: " + t4 + "."), void 0 !== je && je.emitWarning) { + var r3 = new Error(n3); + r3.name = "MaxListenersExceededWarning", r3.emitter = this, r3.count = e3, je.emitWarning(r3); + } else + console.error(n3), console.trace && console.trace(); + } + var f2 = function(e3, t4, n3) { + var r3 = arguments.length; + switch (r3) { + case 0: + return []; + case 1: + return [e3]; + case 2: + return [e3, t4]; + case 3: + return [e3, t4, n3]; + default: + for (var i3 = new Array(r3); r3--; ) + i3[r3] = arguments[r3]; + return i3; + } + }; + function h2(e3, n3) { + for (var r3 = {}, i3 = e3.length, o3 = n3 ? n3.length : 0, a3 = 0; a3 < i3; a3++) + r3[e3[a3]] = a3 < o3 ? n3[a3] : t3; + return r3; + } + function p2(e3, t4, n3) { + var r3, i3; + if (this._emitter = e3, this._target = t4, this._listeners = {}, this._listenersCount = 0, (n3.on || n3.off) && (r3 = n3.on, i3 = n3.off), t4.addEventListener ? (r3 = t4.addEventListener, i3 = t4.removeEventListener) : t4.addListener ? (r3 = t4.addListener, i3 = t4.removeListener) : t4.on && (r3 = t4.on, i3 = t4.off), !r3 && !i3) + throw Error("target does not implement any known event API"); + if ("function" != typeof r3) + throw TypeError("on method must be a function"); + if ("function" != typeof i3) + throw TypeError("off method must be a function"); + this._on = r3, this._off = i3; + var o3 = e3._observers; + o3 ? o3.push(this) : e3._observers = [this]; + } + function m2(e3, r3, i3, o3) { + var a3 = Object.assign({}, r3); + if (!e3) + return a3; + if ("object" != typeof e3) + throw TypeError("options must be an object"); + var s3, u3, l3, c3 = Object.keys(e3), d3 = c3.length; + function f3(e4) { + throw Error('Invalid "' + s3 + '" option value' + (e4 ? ". Reason: " + e4 : "")); + } + for (var h3 = 0; h3 < d3; h3++) { + if (s3 = c3[h3], !o3 && !n2.call(r3, s3)) + throw Error('Unknown "' + s3 + '" option'); + (u3 = e3[s3]) !== t3 && (l3 = i3[s3], a3[s3] = l3 ? l3(u3, f3) : u3); + } + return a3; + } + function g2(e3, t4) { + return "function" == typeof e3 && e3.hasOwnProperty("prototype") || t4("value must be a constructor"), e3; + } + function v2(e3) { + var t4 = "value must be type of " + e3.join("|"), n3 = e3.length, r3 = e3[0], i3 = e3[1]; + return 1 === n3 ? function(e4, n4) { + if (typeof e4 === r3) + return e4; + n4(t4); + } : 2 === n3 ? function(e4, n4) { + var o3 = typeof e4; + if (o3 === r3 || o3 === i3) + return e4; + n4(t4); + } : function(r4, i4) { + for (var o3 = typeof r4, a3 = n3; a3-- > 0; ) + if (o3 === e3[a3]) + return r4; + i4(t4); + }; + } + Object.assign(p2.prototype, { subscribe: function(e3, t4, n3) { + var r3 = this, i3 = this._target, o3 = this._emitter, a3 = this._listeners, s3 = function() { + var r4 = f2.apply(null, arguments), a4 = { data: r4, name: t4, original: e3 }; + n3 ? false !== n3.call(i3, a4) && o3.emit.apply(o3, [a4.name].concat(r4)) : o3.emit.apply(o3, [t4].concat(r4)); + }; + if (a3[e3]) + throw Error("Event '" + e3 + "' is already listening"); + this._listenersCount++, o3._newListener && o3._removeListener && !r3._onNewListener ? (this._onNewListener = function(n4) { + n4 === t4 && null === a3[e3] && (a3[e3] = s3, r3._on.call(i3, e3, s3)); + }, o3.on("newListener", this._onNewListener), this._onRemoveListener = function(n4) { + n4 === t4 && !o3.hasListeners(n4) && a3[e3] && (a3[e3] = null, r3._off.call(i3, e3, s3)); + }, a3[e3] = null, o3.on("removeListener", this._onRemoveListener)) : (a3[e3] = s3, r3._on.call(i3, e3, s3)); + }, unsubscribe: function(e3) { + var t4, n3, r3, i3 = this, o3 = this._listeners, a3 = this._emitter, s3 = this._off, l3 = this._target; + if (e3 && "string" != typeof e3) + throw TypeError("event must be a string"); + function c3() { + i3._onNewListener && (a3.off("newListener", i3._onNewListener), a3.off("removeListener", i3._onRemoveListener), i3._onNewListener = null, i3._onRemoveListener = null); + var e4 = _2.call(a3, i3); + a3._observers.splice(e4, 1); + } + if (e3) { + if (!(t4 = o3[e3])) + return; + s3.call(l3, e3, t4), delete o3[e3], --this._listenersCount || c3(); + } else { + for (r3 = (n3 = u2(o3)).length; r3-- > 0; ) + e3 = n3[r3], s3.call(l3, e3, o3[e3]); + this._listeners = {}, this._listenersCount = 0, c3(); + } + } }); + var b2 = v2(["function"]), y2 = v2(["object", "function"]); + function w2(e3, t4, n3) { + var r3, i3, o3, a3 = 0, s3 = new e3(function(u3, l3, c3) { + function d3() { + i3 && (i3 = null), a3 && (clearTimeout(a3), a3 = 0); + } + n3 = m2(n3, { timeout: 0, overload: false }, { timeout: function(e4, t5) { + return ("number" != typeof (e4 *= 1) || e4 < 0 || !Number.isFinite(e4)) && t5("timeout must be a positive number"), e4; + } }), r3 = !n3.overload && "function" == typeof e3.prototype.cancel && "function" == typeof c3; + var f3 = function(e4) { + d3(), u3(e4); + }, h3 = function(e4) { + d3(), l3(e4); + }; + r3 ? t4(f3, h3, c3) : (i3 = [function(e4) { + h3(e4 || Error("canceled")); + }], t4(f3, h3, function(e4) { + if (o3) + throw Error("Unable to subscribe on cancel event asynchronously"); + if ("function" != typeof e4) + throw TypeError("onCancel callback must be a function"); + i3.push(e4); + }), o3 = true), n3.timeout > 0 && (a3 = setTimeout(function() { + var e4 = Error("timeout"); + e4.code = "ETIMEDOUT", a3 = 0, s3.cancel(e4), l3(e4); + }, n3.timeout)); + }); + return r3 || (s3.cancel = function(e4) { + if (i3) { + for (var t5 = i3.length, n4 = 1; n4 < t5; n4++) + i3[n4](e4); + i3[0](e4), i3 = null; + } + }), s3; + } + function _2(e3) { + var t4 = this._observers; + if (!t4) + return -1; + for (var n3 = t4.length, r3 = 0; r3 < n3; r3++) + if (t4[r3]._target === e3) + return r3; + return -1; + } + function S2(e3, t4, n3, r3, i3) { + if (!n3) + return null; + if (0 === r3) { + var o3 = typeof t4; + if ("string" === o3) { + var a3, s3, l3 = 0, c3 = 0, d3 = this.delimiter, f3 = d3.length; + if (-1 !== (s3 = t4.indexOf(d3))) { + a3 = new Array(5); + do { + a3[l3++] = t4.slice(c3, s3), c3 = s3 + f3; + } while (-1 !== (s3 = t4.indexOf(d3, c3))); + a3[l3++] = t4.slice(c3), t4 = a3, i3 = l3; + } else + t4 = [t4], i3 = 1; + } else + "object" === o3 ? i3 = t4.length : (t4 = [t4], i3 = 1); + } + var h3, p3, m3, g3, v3, b3, y3, w3 = null, _3 = t4[r3], E3 = t4[r3 + 1]; + if (r3 === i3) + n3._listeners && ("function" == typeof n3._listeners ? (e3 && e3.push(n3._listeners), w3 = [n3]) : (e3 && e3.push.apply(e3, n3._listeners), w3 = [n3])); + else { + if ("*" === _3) { + for (s3 = (b3 = u2(n3)).length; s3-- > 0; ) + "_listeners" !== (h3 = b3[s3]) && (y3 = S2(e3, t4, n3[h3], r3 + 1, i3)) && (w3 ? w3.push.apply(w3, y3) : w3 = y3); + return w3; + } + if ("**" === _3) { + for ((v3 = r3 + 1 === i3 || r3 + 2 === i3 && "*" === E3) && n3._listeners && (w3 = S2(e3, t4, n3, i3, i3)), s3 = (b3 = u2(n3)).length; s3-- > 0; ) + "_listeners" !== (h3 = b3[s3]) && ("*" === h3 || "**" === h3 ? (n3[h3]._listeners && !v3 && (y3 = S2(e3, t4, n3[h3], i3, i3)) && (w3 ? w3.push.apply(w3, y3) : w3 = y3), y3 = S2(e3, t4, n3[h3], r3, i3)) : y3 = S2(e3, t4, n3[h3], h3 === E3 ? r3 + 2 : r3, i3), y3 && (w3 ? w3.push.apply(w3, y3) : w3 = y3)); + return w3; + } + n3[_3] && (w3 = S2(e3, t4, n3[_3], r3 + 1, i3)); + } + if ((p3 = n3["*"]) && S2(e3, t4, p3, r3 + 1, i3), m3 = n3["**"]) + if (r3 < i3) + for (m3._listeners && S2(e3, t4, m3, i3, i3), s3 = (b3 = u2(m3)).length; s3-- > 0; ) + "_listeners" !== (h3 = b3[s3]) && (h3 === E3 ? S2(e3, t4, m3[h3], r3 + 2, i3) : h3 === _3 ? S2(e3, t4, m3[h3], r3 + 1, i3) : ((g3 = {})[h3] = m3[h3], S2(e3, t4, { "**": g3 }, r3 + 1, i3))); + else + m3._listeners ? S2(e3, t4, m3, i3, i3) : m3["*"] && m3["*"]._listeners && S2(e3, t4, m3["*"], i3, i3); + return w3; + } + function E2(e3, t4, n3) { + var r3, i3, o3 = 0, a3 = 0, s3 = this.delimiter, u3 = s3.length; + if ("string" == typeof e3) + if (-1 !== (r3 = e3.indexOf(s3))) { + i3 = new Array(5); + do { + i3[o3++] = e3.slice(a3, r3), a3 = r3 + u3; + } while (-1 !== (r3 = e3.indexOf(s3, a3))); + i3[o3++] = e3.slice(a3); + } else + i3 = [e3], o3 = 1; + else + i3 = e3, o3 = e3.length; + if (o3 > 1) { + for (r3 = 0; r3 + 1 < o3; r3++) + if ("**" === i3[r3] && "**" === i3[r3 + 1]) + return; + } + var l3, c3 = this.listenerTree; + for (r3 = 0; r3 < o3; r3++) + if (c3 = c3[l3 = i3[r3]] || (c3[l3] = {}), r3 === o3 - 1) + return c3._listeners ? ("function" == typeof c3._listeners && (c3._listeners = [c3._listeners]), n3 ? c3._listeners.unshift(t4) : c3._listeners.push(t4), !c3._listeners.warned && this._maxListeners > 0 && c3._listeners.length > this._maxListeners && (c3._listeners.warned = true, d2.call(this, c3._listeners.length, l3))) : c3._listeners = t4, true; + return true; + } + function k2(e3, t4, n3, r3) { + for (var i3, o3, a3, s3, l3 = u2(e3), c3 = l3.length, d3 = e3._listeners; c3-- > 0; ) + i3 = e3[o3 = l3[c3]], a3 = "_listeners" === o3 ? n3 : n3 ? n3.concat(o3) : [o3], s3 = r3 || "symbol" == typeof o3, d3 && t4.push(s3 ? a3 : a3.join(this.delimiter)), "object" == typeof i3 && k2.call(this, i3, t4, a3, s3); + return t4; + } + function M2(e3) { + for (var t4, n3, r3, i3 = u2(e3), o3 = i3.length; o3-- > 0; ) + (t4 = e3[n3 = i3[o3]]) && (r3 = true, "_listeners" === n3 || M2(t4) || delete e3[n3]); + return r3; + } + function C2(e3, t4, n3) { + this.emitter = e3, this.event = t4, this.listener = n3; + } + function x2(e3, n3, r3) { + if (true === r3) + a3 = true; + else if (false === r3) + o3 = true; + else { + if (!r3 || "object" != typeof r3) + throw TypeError("options should be an object or true"); + var o3 = r3.async, a3 = r3.promisify, u3 = r3.nextTick, l3 = r3.objectify; + } + if (o3 || u3 || a3) { + var c3 = n3, d3 = n3._origin || n3; + if (u3 && !i2) + throw Error("process.nextTick is not supported"); + a3 === t3 && (a3 = "AsyncFunction" === n3.constructor.name), n3 = function() { + var e4 = arguments, t4 = this, n4 = this.event; + return a3 ? u3 ? Promise.resolve() : new Promise(function(e5) { + s2(e5); + }).then(function() { + return t4.event = n4, c3.apply(t4, e4); + }) : (u3 ? Ee : s2)(function() { + t4.event = n4, c3.apply(t4, e4); + }); + }, n3._async = true, n3._origin = d3; + } + return [n3, l3 ? new C2(this, e3, n3) : this]; + } + function A2(e3) { + this._events = {}, this._newListener = false, this._removeListener = false, this.verboseMemoryLeak = false, c2.call(this, e3); + } + C2.prototype.off = function() { + return this.emitter.off(this.event, this.listener), this; + }, A2.EventEmitter2 = A2, A2.prototype.listenTo = function(e3, n3, i3) { + if ("object" != typeof e3) + throw TypeError("target musts be an object"); + var o3 = this; + function a3(t4) { + if ("object" != typeof t4) + throw TypeError("events must be an object"); + var n4, r3 = i3.reducers, a4 = _2.call(o3, e3); + n4 = -1 === a4 ? new p2(o3, e3, i3) : o3._observers[a4]; + for (var s3, l3 = u2(t4), c3 = l3.length, d3 = "function" == typeof r3, f3 = 0; f3 < c3; f3++) + s3 = l3[f3], n4.subscribe(s3, t4[s3] || s3, d3 ? r3 : r3 && r3[s3]); + } + return i3 = m2(i3, { on: t3, off: t3, reducers: t3 }, { on: b2, off: b2, reducers: y2 }), r2(n3) ? a3(h2(n3)) : a3("string" == typeof n3 ? h2(n3.split(/\s+/)) : n3), this; + }, A2.prototype.stopListeningTo = function(e3, t4) { + var n3 = this._observers; + if (!n3) + return false; + var r3, i3 = n3.length, o3 = false; + if (e3 && "object" != typeof e3) + throw TypeError("target should be an object"); + for (; i3-- > 0; ) + r3 = n3[i3], e3 && r3._target !== e3 || (r3.unsubscribe(t4), o3 = true); + return o3; + }, A2.prototype.delimiter = ".", A2.prototype.setMaxListeners = function(e3) { + e3 !== t3 && (this._maxListeners = e3, this._conf || (this._conf = {}), this._conf.maxListeners = e3); + }, A2.prototype.getMaxListeners = function() { + return this._maxListeners; + }, A2.prototype.event = "", A2.prototype.once = function(e3, t4, n3) { + return this._once(e3, t4, false, n3); + }, A2.prototype.prependOnceListener = function(e3, t4, n3) { + return this._once(e3, t4, true, n3); + }, A2.prototype._once = function(e3, t4, n3, r3) { + return this._many(e3, 1, t4, n3, r3); + }, A2.prototype.many = function(e3, t4, n3, r3) { + return this._many(e3, t4, n3, false, r3); + }, A2.prototype.prependMany = function(e3, t4, n3, r3) { + return this._many(e3, t4, n3, true, r3); + }, A2.prototype._many = function(e3, t4, n3, r3, i3) { + var o3 = this; + if ("function" != typeof n3) + throw new Error("many only accepts instances of Function"); + function a3() { + return 0 == --t4 && o3.off(e3, a3), n3.apply(this, arguments); + } + return a3._origin = n3, this._on(e3, a3, r3, i3); + }, A2.prototype.emit = function() { + if (!this._events && !this._all) + return false; + this._events || l2.call(this); + var e3, t4, n3, r3, i3, a3, s3 = arguments[0], u3 = this.wildcard; + if ("newListener" === s3 && !this._newListener && !this._events.newListener) + return false; + if (u3 && (e3 = s3, "newListener" !== s3 && "removeListener" !== s3 && "object" == typeof s3)) { + if (n3 = s3.length, o2) { + for (r3 = 0; r3 < n3; r3++) + if ("symbol" == typeof s3[r3]) { + a3 = true; + break; + } + } + a3 || (s3 = s3.join(this.delimiter)); + } + var c3, d3 = arguments.length; + if (this._all && this._all.length) + for (r3 = 0, n3 = (c3 = this._all.slice()).length; r3 < n3; r3++) + switch (this.event = s3, d3) { + case 1: + c3[r3].call(this, s3); + break; + case 2: + c3[r3].call(this, s3, arguments[1]); + break; + case 3: + c3[r3].call(this, s3, arguments[1], arguments[2]); + break; + default: + c3[r3].apply(this, arguments); + } + if (u3) + c3 = [], S2.call(this, c3, e3, this.listenerTree, 0, n3); + else { + if ("function" == typeof (c3 = this._events[s3])) { + switch (this.event = s3, d3) { + case 1: + c3.call(this); + break; + case 2: + c3.call(this, arguments[1]); + break; + case 3: + c3.call(this, arguments[1], arguments[2]); + break; + default: + for (t4 = new Array(d3 - 1), i3 = 1; i3 < d3; i3++) + t4[i3 - 1] = arguments[i3]; + c3.apply(this, t4); + } + return true; + } + c3 && (c3 = c3.slice()); + } + if (c3 && c3.length) { + if (d3 > 3) + for (t4 = new Array(d3 - 1), i3 = 1; i3 < d3; i3++) + t4[i3 - 1] = arguments[i3]; + for (r3 = 0, n3 = c3.length; r3 < n3; r3++) + switch (this.event = s3, d3) { + case 1: + c3[r3].call(this); + break; + case 2: + c3[r3].call(this, arguments[1]); + break; + case 3: + c3[r3].call(this, arguments[1], arguments[2]); + break; + default: + c3[r3].apply(this, t4); + } + return true; + } + if (!this.ignoreErrors && !this._all && "error" === s3) + throw arguments[1] instanceof Error ? arguments[1] : new Error("Uncaught, unspecified 'error' event."); + return !!this._all; + }, A2.prototype.emitAsync = function() { + if (!this._events && !this._all) + return false; + this._events || l2.call(this); + var e3, t4, n3, r3, i3, a3, s3 = arguments[0], u3 = this.wildcard; + if ("newListener" === s3 && !this._newListener && !this._events.newListener) + return Promise.resolve([false]); + if (u3 && (e3 = s3, "newListener" !== s3 && "removeListener" !== s3 && "object" == typeof s3)) { + if (r3 = s3.length, o2) { + for (i3 = 0; i3 < r3; i3++) + if ("symbol" == typeof s3[i3]) { + t4 = true; + break; + } + } + t4 || (s3 = s3.join(this.delimiter)); + } + var c3, d3 = [], f3 = arguments.length; + if (this._all) + for (i3 = 0, r3 = this._all.length; i3 < r3; i3++) + switch (this.event = s3, f3) { + case 1: + d3.push(this._all[i3].call(this, s3)); + break; + case 2: + d3.push(this._all[i3].call(this, s3, arguments[1])); + break; + case 3: + d3.push(this._all[i3].call(this, s3, arguments[1], arguments[2])); + break; + default: + d3.push(this._all[i3].apply(this, arguments)); + } + if (u3 ? (c3 = [], S2.call(this, c3, e3, this.listenerTree, 0)) : c3 = this._events[s3], "function" == typeof c3) + switch (this.event = s3, f3) { + case 1: + d3.push(c3.call(this)); + break; + case 2: + d3.push(c3.call(this, arguments[1])); + break; + case 3: + d3.push(c3.call(this, arguments[1], arguments[2])); + break; + default: + for (n3 = new Array(f3 - 1), a3 = 1; a3 < f3; a3++) + n3[a3 - 1] = arguments[a3]; + d3.push(c3.apply(this, n3)); + } + else if (c3 && c3.length) { + if (c3 = c3.slice(), f3 > 3) + for (n3 = new Array(f3 - 1), a3 = 1; a3 < f3; a3++) + n3[a3 - 1] = arguments[a3]; + for (i3 = 0, r3 = c3.length; i3 < r3; i3++) + switch (this.event = s3, f3) { + case 1: + d3.push(c3[i3].call(this)); + break; + case 2: + d3.push(c3[i3].call(this, arguments[1])); + break; + case 3: + d3.push(c3[i3].call(this, arguments[1], arguments[2])); + break; + default: + d3.push(c3[i3].apply(this, n3)); + } + } else if (!this.ignoreErrors && !this._all && "error" === s3) + return arguments[1] instanceof Error ? Promise.reject(arguments[1]) : Promise.reject("Uncaught, unspecified 'error' event."); + return Promise.all(d3); + }, A2.prototype.on = function(e3, t4, n3) { + return this._on(e3, t4, false, n3); + }, A2.prototype.prependListener = function(e3, t4, n3) { + return this._on(e3, t4, true, n3); + }, A2.prototype.onAny = function(e3) { + return this._onAny(e3, false); + }, A2.prototype.prependAny = function(e3) { + return this._onAny(e3, true); + }, A2.prototype.addListener = A2.prototype.on, A2.prototype._onAny = function(e3, t4) { + if ("function" != typeof e3) + throw new Error("onAny only accepts instances of Function"); + return this._all || (this._all = []), t4 ? this._all.unshift(e3) : this._all.push(e3), this; + }, A2.prototype._on = function(e3, n3, r3, i3) { + if ("function" == typeof e3) + return this._onAny(e3, n3), this; + if ("function" != typeof n3) + throw new Error("on only accepts instances of Function"); + this._events || l2.call(this); + var o3, a3 = this; + return i3 !== t3 && (n3 = (o3 = x2.call(this, e3, n3, i3))[0], a3 = o3[1]), this._newListener && this.emit("newListener", e3, n3), this.wildcard ? (E2.call(this, e3, n3, r3), a3) : (this._events[e3] ? ("function" == typeof this._events[e3] && (this._events[e3] = [this._events[e3]]), r3 ? this._events[e3].unshift(n3) : this._events[e3].push(n3), !this._events[e3].warned && this._maxListeners > 0 && this._events[e3].length > this._maxListeners && (this._events[e3].warned = true, d2.call(this, this._events[e3].length, e3))) : this._events[e3] = n3, a3); + }, A2.prototype.off = function(e3, t4) { + if ("function" != typeof t4) + throw new Error("removeListener only takes instances of Function"); + var n3, i3 = []; + if (this.wildcard) { + var o3 = "string" == typeof e3 ? e3.split(this.delimiter) : e3.slice(); + if (!(i3 = S2.call(this, null, o3, this.listenerTree, 0))) + return this; + } else { + if (!this._events[e3]) + return this; + n3 = this._events[e3], i3.push({ _listeners: n3 }); + } + for (var a3 = 0; a3 < i3.length; a3++) { + var s3 = i3[a3]; + if (n3 = s3._listeners, r2(n3)) { + for (var u3 = -1, l3 = 0, c3 = n3.length; l3 < c3; l3++) + if (n3[l3] === t4 || n3[l3].listener && n3[l3].listener === t4 || n3[l3]._origin && n3[l3]._origin === t4) { + u3 = l3; + break; + } + if (u3 < 0) + continue; + return this.wildcard ? s3._listeners.splice(u3, 1) : this._events[e3].splice(u3, 1), 0 === n3.length && (this.wildcard ? delete s3._listeners : delete this._events[e3]), this._removeListener && this.emit("removeListener", e3, t4), this; + } + (n3 === t4 || n3.listener && n3.listener === t4 || n3._origin && n3._origin === t4) && (this.wildcard ? delete s3._listeners : delete this._events[e3], this._removeListener && this.emit("removeListener", e3, t4)); + } + return this.listenerTree && M2(this.listenerTree), this; + }, A2.prototype.offAny = function(e3) { + var t4, n3 = 0, r3 = 0; + if (e3 && this._all && this._all.length > 0) { + for (n3 = 0, r3 = (t4 = this._all).length; n3 < r3; n3++) + if (e3 === t4[n3]) + return t4.splice(n3, 1), this._removeListener && this.emit("removeListenerAny", e3), this; + } else { + if (t4 = this._all, this._removeListener) + for (n3 = 0, r3 = t4.length; n3 < r3; n3++) + this.emit("removeListenerAny", t4[n3]); + this._all = []; + } + return this; + }, A2.prototype.removeListener = A2.prototype.off, A2.prototype.removeAllListeners = function(e3) { + if (e3 === t3) + return !this._events || l2.call(this), this; + if (this.wildcard) { + var n3, r3 = S2.call(this, null, e3, this.listenerTree, 0); + if (!r3) + return this; + for (n3 = 0; n3 < r3.length; n3++) + r3[n3]._listeners = null; + this.listenerTree && M2(this.listenerTree); + } else + this._events && (this._events[e3] = null); + return this; + }, A2.prototype.listeners = function(e3) { + var n3, r3, i3, o3, a3, s3 = this._events; + if (e3 === t3) { + if (this.wildcard) + throw Error("event name required for wildcard emitter"); + if (!s3) + return []; + for (o3 = (n3 = u2(s3)).length, i3 = []; o3-- > 0; ) + "function" == typeof (r3 = s3[n3[o3]]) ? i3.push(r3) : i3.push.apply(i3, r3); + return i3; + } + if (this.wildcard) { + if (!(a3 = this.listenerTree)) + return []; + var l3 = [], c3 = "string" == typeof e3 ? e3.split(this.delimiter) : e3.slice(); + return S2.call(this, l3, c3, a3, 0), l3; + } + return s3 && (r3 = s3[e3]) ? "function" == typeof r3 ? [r3] : r3 : []; + }, A2.prototype.eventNames = function(e3) { + var t4 = this._events; + return this.wildcard ? k2.call(this, this.listenerTree, [], null, e3) : t4 ? u2(t4) : []; + }, A2.prototype.listenerCount = function(e3) { + return this.listeners(e3).length; + }, A2.prototype.hasListeners = function(e3) { + if (this.wildcard) { + var n3 = [], r3 = "string" == typeof e3 ? e3.split(this.delimiter) : e3.slice(); + return S2.call(this, n3, r3, this.listenerTree, 0), n3.length > 0; + } + var i3 = this._events, o3 = this._all; + return !!(o3 && o3.length || i3 && (e3 === t3 ? u2(i3).length : i3[e3])); + }, A2.prototype.listenersAny = function() { + return this._all ? this._all : []; + }, A2.prototype.waitFor = function(e3, n3) { + var r3 = this, i3 = typeof n3; + return "number" === i3 ? n3 = { timeout: n3 } : "function" === i3 && (n3 = { filter: n3 }), w2((n3 = m2(n3, { timeout: 0, filter: t3, handleError: false, Promise, overload: false }, { filter: b2, Promise: g2 })).Promise, function(t4, i4, o3) { + function a3() { + var o4 = n3.filter; + if (!o4 || o4.apply(r3, arguments)) + if (r3.off(e3, a3), n3.handleError) { + var s3 = arguments[0]; + s3 ? i4(s3) : t4(f2.apply(null, arguments).slice(1)); + } else + t4(f2.apply(null, arguments)); + } + o3(function() { + r3.off(e3, a3); + }), r3._on(e3, a3, false); + }, { timeout: n3.timeout, overload: n3.overload }); + }; + var R2 = A2.prototype; + Object.defineProperties(A2, { defaultMaxListeners: { get: function() { + return R2._maxListeners; + }, set: function(e3) { + if ("number" != typeof e3 || e3 < 0 || Number.isNaN(e3)) + throw TypeError("n must be a non-negative number"); + R2._maxListeners = e3; + }, enumerable: true }, once: { value: function(e3, t4, n3) { + return w2((n3 = m2(n3, { Promise, timeout: 0, overload: false }, { Promise: g2 })).Promise, function(n4, r3, i3) { + var o3; + if ("function" == typeof e3.addEventListener) + return o3 = function() { + n4(f2.apply(null, arguments)); + }, i3(function() { + e3.removeEventListener(t4, o3); + }), void e3.addEventListener(t4, o3, { once: true }); + var a3, s3 = function() { + a3 && e3.removeListener("error", a3), n4(f2.apply(null, arguments)); + }; + "error" !== t4 && (a3 = function(n5) { + e3.removeListener(t4, s3), r3(n5); + }, e3.once("error", a3)), i3(function() { + a3 && e3.removeListener("error", a3), e3.removeListener(t4, s3); + }), e3.once(t4, s3); + }, { timeout: n3.timeout, overload: n3.overload }); + }, writable: true, configurable: true } }), Object.defineProperties(R2, { _maxListeners: { value: 10, writable: true, configurable: true }, _observers: { value: null, writable: true, configurable: true } }), "function" == typeof t3 && t3.amd ? t3(function() { + return A2; + }) : e2.exports = A2; + }(); + }(Mw); + var Cw, xw = Mw.exports, Aw = new Uint8Array(16); + function Rw() { + if (!Cw && !(Cw = "undefined" != typeof crypto && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || "undefined" != typeof msCrypto && "function" == typeof msCrypto.getRandomValues && msCrypto.getRandomValues.bind(msCrypto))) + throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); + return Cw(Aw); + } + var Tw = /^(?:[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 Pw(e2) { + return "string" == typeof e2 && Tw.test(e2); + } + for (var Lw = [], Iw = 0; Iw < 256; ++Iw) + Lw.push((Iw + 256).toString(16).substr(1)); + function Ow(e2, t2, n2) { + var r2 = (e2 = e2 || {}).random || (e2.rng || Rw)(); + if (r2[6] = 15 & r2[6] | 64, r2[8] = 63 & r2[8] | 128, t2) { + n2 = n2 || 0; + for (var i2 = 0; i2 < 16; ++i2) + t2[n2 + i2] = r2[i2]; + return t2; + } + return function(e3) { + var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n3 = (Lw[e3[t3 + 0]] + Lw[e3[t3 + 1]] + Lw[e3[t3 + 2]] + Lw[e3[t3 + 3]] + "-" + Lw[e3[t3 + 4]] + Lw[e3[t3 + 5]] + "-" + Lw[e3[t3 + 6]] + Lw[e3[t3 + 7]] + "-" + Lw[e3[t3 + 8]] + Lw[e3[t3 + 9]] + "-" + Lw[e3[t3 + 10]] + Lw[e3[t3 + 11]] + Lw[e3[t3 + 12]] + Lw[e3[t3 + 13]] + Lw[e3[t3 + 14]] + Lw[e3[t3 + 15]]).toLowerCase(); + if (!Pw(n3)) + throw TypeError("Stringified UUID is invalid"); + return n3; + }(r2); + } + const Nw = /* @__PURE__ */ Object.create(null); + Nw.open = "0", Nw.close = "1", Nw.ping = "2", Nw.pong = "3", Nw.message = "4", Nw.upgrade = "5", Nw.noop = "6"; + const Dw = /* @__PURE__ */ Object.create(null); + Object.keys(Nw).forEach((e2) => { + Dw[Nw[e2]] = e2; + }); + const jw = { type: "error", data: "parser error" }, Bw = "function" == typeof Blob || "undefined" != typeof Blob && "[object BlobConstructor]" === Object.prototype.toString.call(Blob), zw = "function" == typeof ArrayBuffer, Uw = (e2) => "function" == typeof ArrayBuffer.isView ? ArrayBuffer.isView(e2) : e2 && e2.buffer instanceof ArrayBuffer, Fw = ({ type: e2, data: t2 }, n2, r2) => Bw && t2 instanceof Blob ? n2 ? r2(t2) : Kw(t2, r2) : zw && (t2 instanceof ArrayBuffer || Uw(t2)) ? n2 ? r2(t2) : Kw(new Blob([t2]), r2) : r2(Nw[e2] + (t2 || "")), Kw = (e2, t2) => { + const n2 = new FileReader(); + return n2.onload = function() { + const e3 = n2.result.split(",")[1]; + t2("b" + (e3 || "")); + }, n2.readAsDataURL(e2); + }; + function qw(e2) { + return e2 instanceof Uint8Array ? e2 : e2 instanceof ArrayBuffer ? new Uint8Array(e2) : new Uint8Array(e2.buffer, e2.byteOffset, e2.byteLength); + } + let Hw; + function Ww(e2, t2) { + return Bw && e2.data instanceof Blob ? e2.data.arrayBuffer().then(qw).then(t2) : zw && (e2.data instanceof ArrayBuffer || Uw(e2.data)) ? t2(qw(e2.data)) : void Fw(e2, false, (e3) => { + Hw || (Hw = new TextEncoder()), t2(Hw.encode(e3)); + }); + } + const $w = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Vw = "undefined" == typeof Uint8Array ? [] : new Uint8Array(256); + for (let e2 = 0; e2 < 64; e2++) + Vw[$w.charCodeAt(e2)] = e2; + const Yw = "function" == typeof ArrayBuffer, Gw = (e2, t2) => { + if ("string" != typeof e2) + return { type: "message", data: Qw(e2, t2) }; + const n2 = e2.charAt(0); + if ("b" === n2) + return { type: "message", data: Zw(e2.substring(1), t2) }; + return Dw[n2] ? e2.length > 1 ? { type: Dw[n2], data: e2.substring(1) } : { type: Dw[n2] } : jw; + }, Zw = (e2, t2) => { + if (Yw) { + const n2 = ((e3) => { + let t3, n3, r2, i2, o2, a2 = 0.75 * e3.length, s2 = e3.length, u2 = 0; + "=" === e3[e3.length - 1] && (a2--, "=" === e3[e3.length - 2] && a2--); + const l2 = new ArrayBuffer(a2), c2 = new Uint8Array(l2); + for (t3 = 0; t3 < s2; t3 += 4) + n3 = Vw[e3.charCodeAt(t3)], r2 = Vw[e3.charCodeAt(t3 + 1)], i2 = Vw[e3.charCodeAt(t3 + 2)], o2 = Vw[e3.charCodeAt(t3 + 3)], c2[u2++] = n3 << 2 | r2 >> 4, c2[u2++] = (15 & r2) << 4 | i2 >> 2, c2[u2++] = (3 & i2) << 6 | 63 & o2; + return l2; + })(e2); + return Qw(n2, t2); + } + return { base64: true, data: e2 }; + }, Qw = (e2, t2) => "blob" === t2 ? e2 instanceof Blob ? e2 : new Blob([e2]) : e2 instanceof ArrayBuffer ? e2 : e2.buffer, Jw = String.fromCharCode(30); + let Xw; + function e_(e2) { + if (e2) + return function(e3) { + for (var t2 in e_.prototype) + e3[t2] = e_.prototype[t2]; + return e3; + }(e2); + } + e_.prototype.on = e_.prototype.addEventListener = function(e2, t2) { + return this._callbacks = this._callbacks || {}, (this._callbacks["$" + e2] = this._callbacks["$" + e2] || []).push(t2), this; + }, e_.prototype.once = function(e2, t2) { + function n2() { + this.off(e2, n2), t2.apply(this, arguments); + } + return n2.fn = t2, this.on(e2, n2), this; + }, e_.prototype.off = e_.prototype.removeListener = e_.prototype.removeAllListeners = e_.prototype.removeEventListener = function(e2, t2) { + if (this._callbacks = this._callbacks || {}, 0 == arguments.length) + return this._callbacks = {}, this; + var n2, r2 = this._callbacks["$" + e2]; + if (!r2) + return this; + if (1 == arguments.length) + return delete this._callbacks["$" + e2], this; + for (var i2 = 0; i2 < r2.length; i2++) + if ((n2 = r2[i2]) === t2 || n2.fn === t2) { + r2.splice(i2, 1); + break; + } + return 0 === r2.length && delete this._callbacks["$" + e2], this; + }, e_.prototype.emit = function(e2) { + this._callbacks = this._callbacks || {}; + for (var t2 = new Array(arguments.length - 1), n2 = this._callbacks["$" + e2], r2 = 1; r2 < arguments.length; r2++) + t2[r2 - 1] = arguments[r2]; + if (n2) { + r2 = 0; + for (var i2 = (n2 = n2.slice(0)).length; r2 < i2; ++r2) + n2[r2].apply(this, t2); + } + return this; + }, e_.prototype.emitReserved = e_.prototype.emit, e_.prototype.listeners = function(e2) { + return this._callbacks = this._callbacks || {}, this._callbacks["$" + e2] || []; + }, e_.prototype.hasListeners = function(e2) { + return !!this.listeners(e2).length; + }; + const t_ = "undefined" != typeof self ? self : "undefined" != typeof window ? window : Function("return this")(); + function n_(e2, ...t2) { + return t2.reduce((t3, n2) => (e2.hasOwnProperty(n2) && (t3[n2] = e2[n2]), t3), {}); + } + const r_ = t_.setTimeout, i_ = t_.clearTimeout; + function o_(e2, t2) { + t2.useNativeTimers ? (e2.setTimeoutFn = r_.bind(t_), e2.clearTimeoutFn = i_.bind(t_)) : (e2.setTimeoutFn = t_.setTimeout.bind(t_), e2.clearTimeoutFn = t_.clearTimeout.bind(t_)); + } + class a_ extends Error { + constructor(e2, t2, n2) { + super(e2), this.description = t2, this.context = n2, this.type = "TransportError"; + } + } + class s_ extends e_ { + constructor(e2) { + super(), this.writable = false, o_(this, e2), this.opts = e2, this.query = e2.query, this.socket = e2.socket; + } + onError(e2, t2, n2) { + return super.emitReserved("error", new a_(e2, t2, n2)), this; + } + open() { + return this.readyState = "opening", this.doOpen(), this; + } + close() { + return "opening" !== this.readyState && "open" !== this.readyState || (this.doClose(), this.onClose()), this; + } + send(e2) { + "open" === this.readyState && this.write(e2); + } + onOpen() { + this.readyState = "open", this.writable = true, super.emitReserved("open"); + } + onData(e2) { + const t2 = Gw(e2, this.socket.binaryType); + this.onPacket(t2); + } + onPacket(e2) { + super.emitReserved("packet", e2); + } + onClose(e2) { + this.readyState = "closed", super.emitReserved("close", e2); + } + pause(e2) { + } + createUri(e2, t2 = {}) { + return e2 + "://" + this._hostname() + this._port() + this.opts.path + this._query(t2); + } + _hostname() { + const e2 = this.opts.hostname; + return -1 === e2.indexOf(":") ? e2 : "[" + e2 + "]"; + } + _port() { + return this.opts.port && (this.opts.secure && Number(443 !== this.opts.port) || !this.opts.secure && 80 !== Number(this.opts.port)) ? ":" + this.opts.port : ""; + } + _query(e2) { + const t2 = function(e3) { + let t3 = ""; + for (let n2 in e3) + e3.hasOwnProperty(n2) && (t3.length && (t3 += "&"), t3 += encodeURIComponent(n2) + "=" + encodeURIComponent(e3[n2])); + return t3; + }(e2); + return t2.length ? "?" + t2 : ""; + } + } + const u_ = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""), l_ = 64, c_ = {}; + let d_, f_ = 0, h_ = 0; + function p_(e2) { + let t2 = ""; + do { + t2 = u_[e2 % l_] + t2, e2 = Math.floor(e2 / l_); + } while (e2 > 0); + return t2; + } + function m_() { + const e2 = p_(+/* @__PURE__ */ new Date()); + return e2 !== d_ ? (f_ = 0, d_ = e2) : e2 + "." + p_(f_++); + } + for (; h_ < l_; h_++) + c_[u_[h_]] = h_; + let g_ = false; + try { + g_ = "undefined" != typeof XMLHttpRequest && "withCredentials" in new XMLHttpRequest(); + } catch (e2) { + } + const v_ = g_; + function b_(e2) { + const t2 = e2.xdomain; + try { + if ("undefined" != typeof XMLHttpRequest && (!t2 || v_)) + return new XMLHttpRequest(); + } catch (e3) { + } + if (!t2) + try { + return new t_[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP"); + } catch (e3) { + } + } + function y_() { + } + const w_ = null != new b_({ xdomain: false }).responseType; + class __ extends e_ { + constructor(e2, t2) { + super(), o_(this, t2), this.opts = t2, this.method = t2.method || "GET", this.uri = e2, this.data = void 0 !== t2.data ? t2.data : null, this.create(); + } + create() { + var e2; + const t2 = n_(this.opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref"); + t2.xdomain = !!this.opts.xd; + const n2 = this.xhr = new b_(t2); + try { + n2.open(this.method, this.uri, true); + try { + if (this.opts.extraHeaders) { + n2.setDisableHeaderCheck && n2.setDisableHeaderCheck(true); + for (let e3 in this.opts.extraHeaders) + this.opts.extraHeaders.hasOwnProperty(e3) && n2.setRequestHeader(e3, this.opts.extraHeaders[e3]); + } + } catch (e3) { + } + if ("POST" === this.method) + try { + n2.setRequestHeader("Content-type", "text/plain;charset=UTF-8"); + } catch (e3) { + } + try { + n2.setRequestHeader("Accept", "*/*"); + } catch (e3) { + } + null === (e2 = this.opts.cookieJar) || void 0 === e2 || e2.addCookies(n2), "withCredentials" in n2 && (n2.withCredentials = this.opts.withCredentials), this.opts.requestTimeout && (n2.timeout = this.opts.requestTimeout), n2.onreadystatechange = () => { + var e3; + 3 === n2.readyState && (null === (e3 = this.opts.cookieJar) || void 0 === e3 || e3.parseCookies(n2)), 4 === n2.readyState && (200 === n2.status || 1223 === n2.status ? this.onLoad() : this.setTimeoutFn(() => { + this.onError("number" == typeof n2.status ? n2.status : 0); + }, 0)); + }, n2.send(this.data); + } catch (e3) { + return void this.setTimeoutFn(() => { + this.onError(e3); + }, 0); + } + "undefined" != typeof document && (this.index = __.requestsCount++, __.requests[this.index] = this); + } + onError(e2) { + this.emitReserved("error", e2, this.xhr), this.cleanup(true); + } + cleanup(e2) { + if (void 0 !== this.xhr && null !== this.xhr) { + if (this.xhr.onreadystatechange = y_, e2) + try { + this.xhr.abort(); + } catch (e3) { + } + "undefined" != typeof document && delete __.requests[this.index], this.xhr = null; + } + } + onLoad() { + const e2 = this.xhr.responseText; + null !== e2 && (this.emitReserved("data", e2), this.emitReserved("success"), this.cleanup()); + } + abort() { + this.cleanup(); + } + } + if (__.requestsCount = 0, __.requests = {}, "undefined" != typeof document) { + if ("function" == typeof attachEvent) + attachEvent("onunload", S_); + else if ("function" == typeof addEventListener) { + addEventListener("onpagehide" in t_ ? "pagehide" : "unload", S_, false); + } + } + function S_() { + for (let e2 in __.requests) + __.requests.hasOwnProperty(e2) && __.requests[e2].abort(); + } + const E_ = "function" == typeof Promise && "function" == typeof Promise.resolve ? (e2) => Promise.resolve().then(e2) : (e2, t2) => t2(e2, 0), k_ = t_.WebSocket || t_.MozWebSocket, M_ = "undefined" != typeof navigator && "string" == typeof navigator.product && "reactnative" === navigator.product.toLowerCase(); + function C_(e2, t2) { + return "message" === e2.type && "string" != typeof e2.data && t2[0] >= 48 && t2[0] <= 54; + } + const x_ = { websocket: class extends s_ { + constructor(e2) { + super(e2), this.supportsBinary = !e2.forceBase64; + } + get name() { + return "websocket"; + } + doOpen() { + if (!this.check()) + return; + const e2 = this.uri(), t2 = this.opts.protocols, n2 = M_ ? {} : n_(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity"); + this.opts.extraHeaders && (n2.headers = this.opts.extraHeaders); + try { + this.ws = M_ ? new k_(e2, t2, n2) : t2 ? new k_(e2, t2) : new k_(e2); + } catch (e3) { + return this.emitReserved("error", e3); + } + this.ws.binaryType = this.socket.binaryType || "arraybuffer", this.addEventListeners(); + } + addEventListeners() { + this.ws.onopen = () => { + this.opts.autoUnref && this.ws._socket.unref(), this.onOpen(); + }, this.ws.onclose = (e2) => this.onClose({ description: "websocket connection closed", context: e2 }), this.ws.onmessage = (e2) => this.onData(e2.data), this.ws.onerror = (e2) => this.onError("websocket error", e2); + } + write(e2) { + this.writable = false; + for (let t2 = 0; t2 < e2.length; t2++) { + const n2 = e2[t2], r2 = t2 === e2.length - 1; + Fw(n2, this.supportsBinary, (e3) => { + try { + this.ws.send(e3); + } catch (e4) { + } + r2 && E_(() => { + this.writable = true, this.emitReserved("drain"); + }, this.setTimeoutFn); + }); + } + } + doClose() { + void 0 !== this.ws && (this.ws.close(), this.ws = null); + } + uri() { + const e2 = this.opts.secure ? "wss" : "ws", t2 = this.query || {}; + return this.opts.timestampRequests && (t2[this.opts.timestampParam] = m_()), this.supportsBinary || (t2.b64 = 1), this.createUri(e2, t2); + } + check() { + return !!k_; + } + }, webtransport: class extends s_ { + get name() { + return "webtransport"; + } + doOpen() { + "function" == typeof WebTransport && (this.transport = new WebTransport(this.createUri("https"), this.opts.transportOptions[this.name]), this.transport.closed.then(() => { + this.onClose(); + }).catch((e2) => { + this.onError("webtransport error", e2); + }), this.transport.ready.then(() => { + this.transport.createBidirectionalStream().then((e2) => { + const t2 = e2.readable.getReader(); + let n2; + this.writer = e2.writable.getWriter(); + const r2 = () => { + t2.read().then(({ done: e3, value: t3 }) => { + e3 || (n2 || 1 !== t3.byteLength || 54 !== t3[0] ? (this.onPacket(function(e4, t4, n3) { + Xw || (Xw = new TextDecoder()); + const r3 = t4 || e4[0] < 48 || e4[0] > 54; + return Gw(r3 ? e4 : Xw.decode(e4), n3); + }(t3, n2, "arraybuffer")), n2 = false) : n2 = true, r2()); + }).catch((e3) => { + }); + }; + r2(); + const i2 = this.query.sid ? `0{"sid":"${this.query.sid}"}` : "0"; + this.writer.write(new TextEncoder().encode(i2)).then(() => this.onOpen()); + }); + })); + } + write(e2) { + this.writable = false; + for (let t2 = 0; t2 < e2.length; t2++) { + const n2 = e2[t2], r2 = t2 === e2.length - 1; + Ww(n2, (e3) => { + C_(n2, e3) && this.writer.write(Uint8Array.of(54)), this.writer.write(e3).then(() => { + r2 && E_(() => { + this.writable = true, this.emitReserved("drain"); + }, this.setTimeoutFn); + }); + }); + } + } + doClose() { + var e2; + null === (e2 = this.transport) || void 0 === e2 || e2.close(); + } + }, polling: class extends s_ { + constructor(e2) { + if (super(e2), this.polling = false, "undefined" != typeof location) { + const t3 = "https:" === location.protocol; + let n2 = location.port; + n2 || (n2 = t3 ? "443" : "80"), this.xd = "undefined" != typeof location && e2.hostname !== location.hostname || n2 !== e2.port; + } + const t2 = e2 && e2.forceBase64; + this.supportsBinary = w_ && !t2, this.opts.withCredentials && (this.cookieJar = void 0); + } + get name() { + return "polling"; + } + doOpen() { + this.poll(); + } + pause(e2) { + this.readyState = "pausing"; + const t2 = () => { + this.readyState = "paused", e2(); + }; + if (this.polling || !this.writable) { + let e3 = 0; + this.polling && (e3++, this.once("pollComplete", function() { + --e3 || t2(); + })), this.writable || (e3++, this.once("drain", function() { + --e3 || t2(); + })); + } else + t2(); + } + poll() { + this.polling = true, this.doPoll(), this.emitReserved("poll"); + } + onData(e2) { + ((e3, t2) => { + const n2 = e3.split(Jw), r2 = []; + for (let e4 = 0; e4 < n2.length; e4++) { + const i2 = Gw(n2[e4], t2); + if (r2.push(i2), "error" === i2.type) + break; + } + return r2; + })(e2, this.socket.binaryType).forEach((e3) => { + if ("opening" === this.readyState && "open" === e3.type && this.onOpen(), "close" === e3.type) + return this.onClose({ description: "transport closed by the server" }), false; + this.onPacket(e3); + }), "closed" !== this.readyState && (this.polling = false, this.emitReserved("pollComplete"), "open" === this.readyState && this.poll()); + } + doClose() { + const e2 = () => { + this.write([{ type: "close" }]); + }; + "open" === this.readyState ? e2() : this.once("open", e2); + } + write(e2) { + this.writable = false, ((e3, t2) => { + const n2 = e3.length, r2 = new Array(n2); + let i2 = 0; + e3.forEach((e4, o2) => { + Fw(e4, false, (e5) => { + r2[o2] = e5, ++i2 === n2 && t2(r2.join(Jw)); + }); + }); + })(e2, (e3) => { + this.doWrite(e3, () => { + this.writable = true, this.emitReserved("drain"); + }); + }); + } + uri() { + const e2 = this.opts.secure ? "https" : "http", t2 = this.query || {}; + return false !== this.opts.timestampRequests && (t2[this.opts.timestampParam] = m_()), this.supportsBinary || t2.sid || (t2.b64 = 1), this.createUri(e2, t2); + } + request(e2 = {}) { + return Object.assign(e2, { xd: this.xd, cookieJar: this.cookieJar }, this.opts), new __(this.uri(), e2); + } + doWrite(e2, t2) { + const n2 = this.request({ method: "POST", data: e2 }); + n2.on("success", t2), n2.on("error", (e3, t3) => { + this.onError("xhr post error", e3, t3); + }); + } + doPoll() { + const e2 = this.request(); + e2.on("data", this.onData.bind(this)), e2.on("error", (e3, t2) => { + this.onError("xhr poll error", e3, t2); + }), this.pollXhr = e2; + } + } }, A_ = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, R_ = ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"]; + function T_(e2) { + const t2 = e2, n2 = e2.indexOf("["), r2 = e2.indexOf("]"); + -1 != n2 && -1 != r2 && (e2 = e2.substring(0, n2) + e2.substring(n2, r2).replace(/:/g, ";") + e2.substring(r2, e2.length)); + let i2 = A_.exec(e2 || ""), o2 = {}, a2 = 14; + for (; a2--; ) + o2[R_[a2]] = i2[a2] || ""; + return -1 != n2 && -1 != r2 && (o2.source = t2, o2.host = o2.host.substring(1, o2.host.length - 1).replace(/;/g, ":"), o2.authority = o2.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), o2.ipv6uri = true), o2.pathNames = function(e3, t3) { + const n3 = /\/{2,9}/g, r3 = t3.replace(n3, "/").split("/"); + "/" != t3.slice(0, 1) && 0 !== t3.length || r3.splice(0, 1); + "/" == t3.slice(-1) && r3.splice(r3.length - 1, 1); + return r3; + }(0, o2.path), o2.queryKey = function(e3, t3) { + const n3 = {}; + return t3.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function(e4, t4, r3) { + t4 && (n3[t4] = r3); + }), n3; + }(0, o2.query), o2; + } + let P_ = class e2 extends e_ { + constructor(e3, t2 = {}) { + super(), this.writeBuffer = [], e3 && "object" == typeof e3 && (t2 = e3, e3 = null), e3 ? (e3 = T_(e3), t2.hostname = e3.host, t2.secure = "https" === e3.protocol || "wss" === e3.protocol, t2.port = e3.port, e3.query && (t2.query = e3.query)) : t2.host && (t2.hostname = T_(t2.host).host), o_(this, t2), this.secure = null != t2.secure ? t2.secure : "undefined" != typeof location && "https:" === location.protocol, t2.hostname && !t2.port && (t2.port = this.secure ? "443" : "80"), this.hostname = t2.hostname || ("undefined" != typeof location ? location.hostname : "localhost"), this.port = t2.port || ("undefined" != typeof location && location.port ? location.port : this.secure ? "443" : "80"), this.transports = t2.transports || ["polling", "websocket", "webtransport"], this.writeBuffer = [], this.prevBufferLen = 0, this.opts = Object.assign({ path: "/engine.io", agent: false, withCredentials: false, upgrade: true, timestampParam: "t", rememberUpgrade: false, addTrailingSlash: true, rejectUnauthorized: true, perMessageDeflate: { threshold: 1024 }, transportOptions: {}, closeOnBeforeunload: false }, t2), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), "string" == typeof this.opts.query && (this.opts.query = function(e4) { + let t3 = {}, n2 = e4.split("&"); + for (let e5 = 0, r2 = n2.length; e5 < r2; e5++) { + let r3 = n2[e5].split("="); + t3[decodeURIComponent(r3[0])] = decodeURIComponent(r3[1]); + } + return t3; + }(this.opts.query)), this.id = null, this.upgrades = null, this.pingInterval = null, this.pingTimeout = null, this.pingTimeoutTimer = null, "function" == typeof addEventListener && (this.opts.closeOnBeforeunload && (this.beforeunloadEventListener = () => { + this.transport && (this.transport.removeAllListeners(), this.transport.close()); + }, addEventListener("beforeunload", this.beforeunloadEventListener, false)), "localhost" !== this.hostname && (this.offlineEventListener = () => { + this.onClose("transport close", { description: "network connection lost" }); + }, addEventListener("offline", this.offlineEventListener, false))), this.open(); + } + createTransport(e3) { + const t2 = Object.assign({}, this.opts.query); + t2.EIO = 4, t2.transport = e3, this.id && (t2.sid = this.id); + const n2 = Object.assign({}, this.opts, { query: t2, socket: this, hostname: this.hostname, secure: this.secure, port: this.port }, this.opts.transportOptions[e3]); + return new x_[e3](n2); + } + open() { + let t2; + if (this.opts.rememberUpgrade && e2.priorWebsocketSuccess && -1 !== this.transports.indexOf("websocket")) + t2 = "websocket"; + else { + if (0 === this.transports.length) + return void this.setTimeoutFn(() => { + this.emitReserved("error", "No transports available"); + }, 0); + t2 = this.transports[0]; + } + this.readyState = "opening"; + try { + t2 = this.createTransport(t2); + } catch (e3) { + return this.transports.shift(), void this.open(); + } + t2.open(), this.setTransport(t2); + } + setTransport(e3) { + this.transport && this.transport.removeAllListeners(), this.transport = e3, e3.on("drain", this.onDrain.bind(this)).on("packet", this.onPacket.bind(this)).on("error", this.onError.bind(this)).on("close", (e4) => this.onClose("transport close", e4)); + } + probe(t2) { + let n2 = this.createTransport(t2), r2 = false; + e2.priorWebsocketSuccess = false; + const i2 = () => { + r2 || (n2.send([{ type: "ping", data: "probe" }]), n2.once("packet", (t3) => { + if (!r2) + if ("pong" === t3.type && "probe" === t3.data) { + if (this.upgrading = true, this.emitReserved("upgrading", n2), !n2) + return; + e2.priorWebsocketSuccess = "websocket" === n2.name, this.transport.pause(() => { + r2 || "closed" !== this.readyState && (c2(), this.setTransport(n2), n2.send([{ type: "upgrade" }]), this.emitReserved("upgrade", n2), n2 = null, this.upgrading = false, this.flush()); + }); + } else { + const e3 = new Error("probe error"); + e3.transport = n2.name, this.emitReserved("upgradeError", e3); + } + })); + }; + function o2() { + r2 || (r2 = true, c2(), n2.close(), n2 = null); + } + const a2 = (e3) => { + const t3 = new Error("probe error: " + e3); + t3.transport = n2.name, o2(), this.emitReserved("upgradeError", t3); + }; + function s2() { + a2("transport closed"); + } + function u2() { + a2("socket closed"); + } + function l2(e3) { + n2 && e3.name !== n2.name && o2(); + } + const c2 = () => { + n2.removeListener("open", i2), n2.removeListener("error", a2), n2.removeListener("close", s2), this.off("close", u2), this.off("upgrading", l2); + }; + n2.once("open", i2), n2.once("error", a2), n2.once("close", s2), this.once("close", u2), this.once("upgrading", l2), -1 !== this.upgrades.indexOf("webtransport") && "webtransport" !== t2 ? this.setTimeoutFn(() => { + r2 || n2.open(); + }, 200) : n2.open(); + } + onOpen() { + if (this.readyState = "open", e2.priorWebsocketSuccess = "websocket" === this.transport.name, this.emitReserved("open"), this.flush(), "open" === this.readyState && this.opts.upgrade) { + let e3 = 0; + const t2 = this.upgrades.length; + for (; e3 < t2; e3++) + this.probe(this.upgrades[e3]); + } + } + onPacket(e3) { + if ("opening" === this.readyState || "open" === this.readyState || "closing" === this.readyState) + switch (this.emitReserved("packet", e3), this.emitReserved("heartbeat"), e3.type) { + case "open": + this.onHandshake(JSON.parse(e3.data)); + break; + case "ping": + this.resetPingTimeout(), this.sendPacket("pong"), this.emitReserved("ping"), this.emitReserved("pong"); + break; + case "error": + const t2 = new Error("server error"); + t2.code = e3.data, this.onError(t2); + break; + case "message": + this.emitReserved("data", e3.data), this.emitReserved("message", e3.data); + } + } + onHandshake(e3) { + this.emitReserved("handshake", e3), this.id = e3.sid, this.transport.query.sid = e3.sid, this.upgrades = this.filterUpgrades(e3.upgrades), this.pingInterval = e3.pingInterval, this.pingTimeout = e3.pingTimeout, this.maxPayload = e3.maxPayload, this.onOpen(), "closed" !== this.readyState && this.resetPingTimeout(); + } + resetPingTimeout() { + this.clearTimeoutFn(this.pingTimeoutTimer), this.pingTimeoutTimer = this.setTimeoutFn(() => { + this.onClose("ping timeout"); + }, this.pingInterval + this.pingTimeout), this.opts.autoUnref && this.pingTimeoutTimer.unref(); + } + onDrain() { + this.writeBuffer.splice(0, this.prevBufferLen), this.prevBufferLen = 0, 0 === this.writeBuffer.length ? this.emitReserved("drain") : this.flush(); + } + flush() { + if ("closed" !== this.readyState && this.transport.writable && !this.upgrading && this.writeBuffer.length) { + const e3 = this.getWritablePackets(); + this.transport.send(e3), this.prevBufferLen = e3.length, this.emitReserved("flush"); + } + } + getWritablePackets() { + if (!(this.maxPayload && "polling" === this.transport.name && this.writeBuffer.length > 1)) + return this.writeBuffer; + let e3 = 1; + for (let n2 = 0; n2 < this.writeBuffer.length; n2++) { + const r2 = this.writeBuffer[n2].data; + if (r2 && (e3 += "string" == typeof (t2 = r2) ? function(e4) { + let t3 = 0, n3 = 0; + for (let r3 = 0, i2 = e4.length; r3 < i2; r3++) + t3 = e4.charCodeAt(r3), t3 < 128 ? n3 += 1 : t3 < 2048 ? n3 += 2 : t3 < 55296 || t3 >= 57344 ? n3 += 3 : (r3++, n3 += 4); + return n3; + }(t2) : Math.ceil(1.33 * (t2.byteLength || t2.size))), n2 > 0 && e3 > this.maxPayload) + return this.writeBuffer.slice(0, n2); + e3 += 2; + } + var t2; + return this.writeBuffer; + } + write(e3, t2, n2) { + return this.sendPacket("message", e3, t2, n2), this; + } + send(e3, t2, n2) { + return this.sendPacket("message", e3, t2, n2), this; + } + sendPacket(e3, t2, n2, r2) { + if ("function" == typeof t2 && (r2 = t2, t2 = void 0), "function" == typeof n2 && (r2 = n2, n2 = null), "closing" === this.readyState || "closed" === this.readyState) + return; + (n2 = n2 || {}).compress = false !== n2.compress; + const i2 = { type: e3, data: t2, options: n2 }; + this.emitReserved("packetCreate", i2), this.writeBuffer.push(i2), r2 && this.once("flush", r2), this.flush(); + } + close() { + const e3 = () => { + this.onClose("forced close"), this.transport.close(); + }, t2 = () => { + this.off("upgrade", t2), this.off("upgradeError", t2), e3(); + }, n2 = () => { + this.once("upgrade", t2), this.once("upgradeError", t2); + }; + return "opening" !== this.readyState && "open" !== this.readyState || (this.readyState = "closing", this.writeBuffer.length ? this.once("drain", () => { + this.upgrading ? n2() : e3(); + }) : this.upgrading ? n2() : e3()), this; + } + onError(t2) { + e2.priorWebsocketSuccess = false, this.emitReserved("error", t2), this.onClose("transport error", t2); + } + onClose(e3, t2) { + "opening" !== this.readyState && "open" !== this.readyState && "closing" !== this.readyState || (this.clearTimeoutFn(this.pingTimeoutTimer), this.transport.removeAllListeners("close"), this.transport.close(), this.transport.removeAllListeners(), "function" == typeof removeEventListener && (removeEventListener("beforeunload", this.beforeunloadEventListener, false), removeEventListener("offline", this.offlineEventListener, false)), this.readyState = "closed", this.id = null, this.emitReserved("close", e3, t2), this.writeBuffer = [], this.prevBufferLen = 0); + } + filterUpgrades(e3) { + const t2 = []; + let n2 = 0; + const r2 = e3.length; + for (; n2 < r2; n2++) + ~this.transports.indexOf(e3[n2]) && t2.push(e3[n2]); + return t2; + } + }; + P_.protocol = 4; + const L_ = "function" == typeof ArrayBuffer, I_ = (e2) => "function" == typeof ArrayBuffer.isView ? ArrayBuffer.isView(e2) : e2.buffer instanceof ArrayBuffer, O_ = Object.prototype.toString, N_ = "function" == typeof Blob || "undefined" != typeof Blob && "[object BlobConstructor]" === O_.call(Blob), D_ = "function" == typeof File || "undefined" != typeof File && "[object FileConstructor]" === O_.call(File); + function j_(e2) { + return L_ && (e2 instanceof ArrayBuffer || I_(e2)) || N_ && e2 instanceof Blob || D_ && e2 instanceof File; + } + function B_(e2, t2) { + if (!e2 || "object" != typeof e2) + return false; + if (Array.isArray(e2)) { + for (let t3 = 0, n2 = e2.length; t3 < n2; t3++) + if (B_(e2[t3])) + return true; + return false; + } + if (j_(e2)) + return true; + if (e2.toJSON && "function" == typeof e2.toJSON && 1 === arguments.length) + return B_(e2.toJSON(), true); + for (const t3 in e2) + if (Object.prototype.hasOwnProperty.call(e2, t3) && B_(e2[t3])) + return true; + return false; + } + function z_(e2) { + const t2 = [], n2 = e2.data, r2 = e2; + return r2.data = U_(n2, t2), r2.attachments = t2.length, { packet: r2, buffers: t2 }; + } + function U_(e2, t2) { + if (!e2) + return e2; + if (j_(e2)) { + const n2 = { _placeholder: true, num: t2.length }; + return t2.push(e2), n2; + } + if (Array.isArray(e2)) { + const n2 = new Array(e2.length); + for (let r2 = 0; r2 < e2.length; r2++) + n2[r2] = U_(e2[r2], t2); + return n2; + } + if ("object" == typeof e2 && !(e2 instanceof Date)) { + const n2 = {}; + for (const r2 in e2) + Object.prototype.hasOwnProperty.call(e2, r2) && (n2[r2] = U_(e2[r2], t2)); + return n2; + } + return e2; + } + function F_(e2, t2) { + return e2.data = K_(e2.data, t2), delete e2.attachments, e2; + } + function K_(e2, t2) { + if (!e2) + return e2; + if (e2 && true === e2._placeholder) { + if ("number" == typeof e2.num && e2.num >= 0 && e2.num < t2.length) + return t2[e2.num]; + throw new Error("illegal attachments"); + } + if (Array.isArray(e2)) + for (let n2 = 0; n2 < e2.length; n2++) + e2[n2] = K_(e2[n2], t2); + else if ("object" == typeof e2) + for (const n2 in e2) + Object.prototype.hasOwnProperty.call(e2, n2) && (e2[n2] = K_(e2[n2], t2)); + return e2; + } + const q_ = ["connect", "connect_error", "disconnect", "disconnecting", "newListener", "removeListener"]; + var H_; + !function(e2) { + e2[e2.CONNECT = 0] = "CONNECT", e2[e2.DISCONNECT = 1] = "DISCONNECT", e2[e2.EVENT = 2] = "EVENT", e2[e2.ACK = 3] = "ACK", e2[e2.CONNECT_ERROR = 4] = "CONNECT_ERROR", e2[e2.BINARY_EVENT = 5] = "BINARY_EVENT", e2[e2.BINARY_ACK = 6] = "BINARY_ACK"; + }(H_ || (H_ = {})); + function W_(e2) { + return "[object Object]" === Object.prototype.toString.call(e2); + } + class $_ extends e_ { + constructor(e2) { + super(), this.reviver = e2; + } + add(e2) { + let t2; + if ("string" == typeof e2) { + if (this.reconstructor) + throw new Error("got plaintext data when reconstructing a packet"); + t2 = this.decodeString(e2); + const n2 = t2.type === H_.BINARY_EVENT; + n2 || t2.type === H_.BINARY_ACK ? (t2.type = n2 ? H_.EVENT : H_.ACK, this.reconstructor = new V_(t2), 0 === t2.attachments && super.emitReserved("decoded", t2)) : super.emitReserved("decoded", t2); + } else { + if (!j_(e2) && !e2.base64) + throw new Error("Unknown type: " + e2); + if (!this.reconstructor) + throw new Error("got binary data when not reconstructing a packet"); + t2 = this.reconstructor.takeBinaryData(e2), t2 && (this.reconstructor = null, super.emitReserved("decoded", t2)); + } + } + decodeString(e2) { + let t2 = 0; + const n2 = { type: Number(e2.charAt(0)) }; + if (void 0 === H_[n2.type]) + throw new Error("unknown packet type " + n2.type); + if (n2.type === H_.BINARY_EVENT || n2.type === H_.BINARY_ACK) { + const r3 = t2 + 1; + for (; "-" !== e2.charAt(++t2) && t2 != e2.length; ) + ; + const i2 = e2.substring(r3, t2); + if (i2 != Number(i2) || "-" !== e2.charAt(t2)) + throw new Error("Illegal attachments"); + n2.attachments = Number(i2); + } + if ("/" === e2.charAt(t2 + 1)) { + const r3 = t2 + 1; + for (; ++t2; ) { + if ("," === e2.charAt(t2)) + break; + if (t2 === e2.length) + break; + } + n2.nsp = e2.substring(r3, t2); + } else + n2.nsp = "/"; + const r2 = e2.charAt(t2 + 1); + if ("" !== r2 && Number(r2) == r2) { + const r3 = t2 + 1; + for (; ++t2; ) { + const n3 = e2.charAt(t2); + if (null == n3 || Number(n3) != n3) { + --t2; + break; + } + if (t2 === e2.length) + break; + } + n2.id = Number(e2.substring(r3, t2 + 1)); + } + if (e2.charAt(++t2)) { + const r3 = this.tryParse(e2.substr(t2)); + if (!$_.isPayloadValid(n2.type, r3)) + throw new Error("invalid payload"); + n2.data = r3; + } + return n2; + } + tryParse(e2) { + try { + return JSON.parse(e2, this.reviver); + } catch (e3) { + return false; + } + } + static isPayloadValid(e2, t2) { + switch (e2) { + case H_.CONNECT: + return W_(t2); + case H_.DISCONNECT: + return void 0 === t2; + case H_.CONNECT_ERROR: + return "string" == typeof t2 || W_(t2); + case H_.EVENT: + case H_.BINARY_EVENT: + return Array.isArray(t2) && ("number" == typeof t2[0] || "string" == typeof t2[0] && -1 === q_.indexOf(t2[0])); + case H_.ACK: + case H_.BINARY_ACK: + return Array.isArray(t2); + } + } + destroy() { + this.reconstructor && (this.reconstructor.finishedReconstruction(), this.reconstructor = null); + } + } + class V_ { + constructor(e2) { + this.packet = e2, this.buffers = [], this.reconPack = e2; + } + takeBinaryData(e2) { + if (this.buffers.push(e2), this.buffers.length === this.reconPack.attachments) { + const e3 = F_(this.reconPack, this.buffers); + return this.finishedReconstruction(), e3; + } + return null; + } + finishedReconstruction() { + this.reconPack = null, this.buffers = []; + } + } + var Y_ = Object.freeze({ __proto__: null, Decoder: $_, Encoder: class { + constructor(e2) { + this.replacer = e2; + } + encode(e2) { + return e2.type !== H_.EVENT && e2.type !== H_.ACK || !B_(e2) ? [this.encodeAsString(e2)] : this.encodeAsBinary({ type: e2.type === H_.EVENT ? H_.BINARY_EVENT : H_.BINARY_ACK, nsp: e2.nsp, data: e2.data, id: e2.id }); + } + encodeAsString(e2) { + let t2 = "" + e2.type; + return e2.type !== H_.BINARY_EVENT && e2.type !== H_.BINARY_ACK || (t2 += e2.attachments + "-"), e2.nsp && "/" !== e2.nsp && (t2 += e2.nsp + ","), null != e2.id && (t2 += e2.id), null != e2.data && (t2 += JSON.stringify(e2.data, this.replacer)), t2; + } + encodeAsBinary(e2) { + const t2 = z_(e2), n2 = this.encodeAsString(t2.packet), r2 = t2.buffers; + return r2.unshift(n2), r2; + } + }, get PacketType() { + return H_; + }, protocol: 5 }); + function G_(e2, t2, n2) { + return e2.on(t2, n2), function() { + e2.off(t2, n2); + }; + } + const Z_ = Object.freeze({ connect: 1, connect_error: 1, disconnect: 1, disconnecting: 1, newListener: 1, removeListener: 1 }); + class Q_ extends e_ { + constructor(e2, t2, n2) { + super(), this.connected = false, this.recovered = false, this.receiveBuffer = [], this.sendBuffer = [], this._queue = [], this._queueSeq = 0, this.ids = 0, this.acks = {}, this.flags = {}, this.io = e2, this.nsp = t2, n2 && n2.auth && (this.auth = n2.auth), this._opts = Object.assign({}, n2), this.io._autoConnect && this.open(); + } + get disconnected() { + return !this.connected; + } + subEvents() { + if (this.subs) + return; + const e2 = this.io; + this.subs = [G_(e2, "open", this.onopen.bind(this)), G_(e2, "packet", this.onpacket.bind(this)), G_(e2, "error", this.onerror.bind(this)), G_(e2, "close", this.onclose.bind(this))]; + } + get active() { + return !!this.subs; + } + connect() { + return this.connected || (this.subEvents(), this.io._reconnecting || this.io.open(), "open" === this.io._readyState && this.onopen()), this; + } + open() { + return this.connect(); + } + send(...e2) { + return e2.unshift("message"), this.emit.apply(this, e2), this; + } + emit(e2, ...t2) { + if (Z_.hasOwnProperty(e2)) + throw new Error('"' + e2.toString() + '" is a reserved event name'); + if (t2.unshift(e2), this._opts.retries && !this.flags.fromQueue && !this.flags.volatile) + return this._addToQueue(t2), this; + const n2 = { type: H_.EVENT, data: t2, options: {} }; + if (n2.options.compress = false !== this.flags.compress, "function" == typeof t2[t2.length - 1]) { + const e3 = this.ids++, r3 = t2.pop(); + this._registerAckCallback(e3, r3), n2.id = e3; + } + const r2 = this.io.engine && this.io.engine.transport && this.io.engine.transport.writable; + return this.flags.volatile && (!r2 || !this.connected) || (this.connected ? (this.notifyOutgoingListeners(n2), this.packet(n2)) : this.sendBuffer.push(n2)), this.flags = {}, this; + } + _registerAckCallback(e2, t2) { + var n2; + const r2 = null !== (n2 = this.flags.timeout) && void 0 !== n2 ? n2 : this._opts.ackTimeout; + if (void 0 === r2) + return void (this.acks[e2] = t2); + const i2 = this.io.setTimeoutFn(() => { + delete this.acks[e2]; + for (let t3 = 0; t3 < this.sendBuffer.length; t3++) + this.sendBuffer[t3].id === e2 && this.sendBuffer.splice(t3, 1); + t2.call(this, new Error("operation has timed out")); + }, r2); + this.acks[e2] = (...e3) => { + this.io.clearTimeoutFn(i2), t2.apply(this, [null, ...e3]); + }; + } + emitWithAck(e2, ...t2) { + const n2 = void 0 !== this.flags.timeout || void 0 !== this._opts.ackTimeout; + return new Promise((r2, i2) => { + t2.push((e3, t3) => n2 ? e3 ? i2(e3) : r2(t3) : r2(e3)), this.emit(e2, ...t2); + }); + } + _addToQueue(e2) { + let t2; + "function" == typeof e2[e2.length - 1] && (t2 = e2.pop()); + const n2 = { id: this._queueSeq++, tryCount: 0, pending: false, args: e2, flags: Object.assign({ fromQueue: true }, this.flags) }; + e2.push((e3, ...r2) => { + if (n2 !== this._queue[0]) + return; + return null !== e3 ? n2.tryCount > this._opts.retries && (this._queue.shift(), t2 && t2(e3)) : (this._queue.shift(), t2 && t2(null, ...r2)), n2.pending = false, this._drainQueue(); + }), this._queue.push(n2), this._drainQueue(); + } + _drainQueue(e2 = false) { + if (!this.connected || 0 === this._queue.length) + return; + const t2 = this._queue[0]; + t2.pending && !e2 || (t2.pending = true, t2.tryCount++, this.flags = t2.flags, this.emit.apply(this, t2.args)); + } + packet(e2) { + e2.nsp = this.nsp, this.io._packet(e2); + } + onopen() { + "function" == typeof this.auth ? this.auth((e2) => { + this._sendConnectPacket(e2); + }) : this._sendConnectPacket(this.auth); + } + _sendConnectPacket(e2) { + this.packet({ type: H_.CONNECT, data: this._pid ? Object.assign({ pid: this._pid, offset: this._lastOffset }, e2) : e2 }); + } + onerror(e2) { + this.connected || this.emitReserved("connect_error", e2); + } + onclose(e2, t2) { + this.connected = false, delete this.id, this.emitReserved("disconnect", e2, t2); + } + onpacket(e2) { + if (e2.nsp === this.nsp) + switch (e2.type) { + case H_.CONNECT: + e2.data && e2.data.sid ? this.onconnect(e2.data.sid, e2.data.pid) : this.emitReserved("connect_error", new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)")); + break; + case H_.EVENT: + case H_.BINARY_EVENT: + this.onevent(e2); + break; + case H_.ACK: + case H_.BINARY_ACK: + this.onack(e2); + break; + case H_.DISCONNECT: + this.ondisconnect(); + break; + case H_.CONNECT_ERROR: + this.destroy(); + const t2 = new Error(e2.data.message); + t2.data = e2.data.data, this.emitReserved("connect_error", t2); + } + } + onevent(e2) { + const t2 = e2.data || []; + null != e2.id && t2.push(this.ack(e2.id)), this.connected ? this.emitEvent(t2) : this.receiveBuffer.push(Object.freeze(t2)); + } + emitEvent(e2) { + if (this._anyListeners && this._anyListeners.length) { + const t2 = this._anyListeners.slice(); + for (const n2 of t2) + n2.apply(this, e2); + } + super.emit.apply(this, e2), this._pid && e2.length && "string" == typeof e2[e2.length - 1] && (this._lastOffset = e2[e2.length - 1]); + } + ack(e2) { + const t2 = this; + let n2 = false; + return function(...r2) { + n2 || (n2 = true, t2.packet({ type: H_.ACK, id: e2, data: r2 })); + }; + } + onack(e2) { + const t2 = this.acks[e2.id]; + "function" == typeof t2 && (t2.apply(this, e2.data), delete this.acks[e2.id]); + } + onconnect(e2, t2) { + this.id = e2, this.recovered = t2 && this._pid === t2, this._pid = t2, this.connected = true, this.emitBuffered(), this.emitReserved("connect"), this._drainQueue(true); + } + emitBuffered() { + this.receiveBuffer.forEach((e2) => this.emitEvent(e2)), this.receiveBuffer = [], this.sendBuffer.forEach((e2) => { + this.notifyOutgoingListeners(e2), this.packet(e2); + }), this.sendBuffer = []; + } + ondisconnect() { + this.destroy(), this.onclose("io server disconnect"); + } + destroy() { + this.subs && (this.subs.forEach((e2) => e2()), this.subs = void 0), this.io._destroy(this); + } + disconnect() { + return this.connected && this.packet({ type: H_.DISCONNECT }), this.destroy(), this.connected && this.onclose("io client disconnect"), this; + } + close() { + return this.disconnect(); + } + compress(e2) { + return this.flags.compress = e2, this; + } + get volatile() { + return this.flags.volatile = true, this; + } + timeout(e2) { + return this.flags.timeout = e2, this; + } + onAny(e2) { + return this._anyListeners = this._anyListeners || [], this._anyListeners.push(e2), this; + } + prependAny(e2) { + return this._anyListeners = this._anyListeners || [], this._anyListeners.unshift(e2), this; + } + offAny(e2) { + if (!this._anyListeners) + return this; + if (e2) { + const t2 = this._anyListeners; + for (let n2 = 0; n2 < t2.length; n2++) + if (e2 === t2[n2]) + return t2.splice(n2, 1), this; + } else + this._anyListeners = []; + return this; + } + listenersAny() { + return this._anyListeners || []; + } + onAnyOutgoing(e2) { + return this._anyOutgoingListeners = this._anyOutgoingListeners || [], this._anyOutgoingListeners.push(e2), this; + } + prependAnyOutgoing(e2) { + return this._anyOutgoingListeners = this._anyOutgoingListeners || [], this._anyOutgoingListeners.unshift(e2), this; + } + offAnyOutgoing(e2) { + if (!this._anyOutgoingListeners) + return this; + if (e2) { + const t2 = this._anyOutgoingListeners; + for (let n2 = 0; n2 < t2.length; n2++) + if (e2 === t2[n2]) + return t2.splice(n2, 1), this; + } else + this._anyOutgoingListeners = []; + return this; + } + listenersAnyOutgoing() { + return this._anyOutgoingListeners || []; + } + notifyOutgoingListeners(e2) { + if (this._anyOutgoingListeners && this._anyOutgoingListeners.length) { + const t2 = this._anyOutgoingListeners.slice(); + for (const n2 of t2) + n2.apply(this, e2.data); + } + } + } + function J_(e2) { + e2 = e2 || {}, this.ms = e2.min || 100, this.max = e2.max || 1e4, this.factor = e2.factor || 2, this.jitter = e2.jitter > 0 && e2.jitter <= 1 ? e2.jitter : 0, this.attempts = 0; + } + J_.prototype.duration = function() { + var e2 = this.ms * Math.pow(this.factor, this.attempts++); + if (this.jitter) { + var t2 = Math.random(), n2 = Math.floor(t2 * this.jitter * e2); + e2 = 0 == (1 & Math.floor(10 * t2)) ? e2 - n2 : e2 + n2; + } + return 0 | Math.min(e2, this.max); + }, J_.prototype.reset = function() { + this.attempts = 0; + }, J_.prototype.setMin = function(e2) { + this.ms = e2; + }, J_.prototype.setMax = function(e2) { + this.max = e2; + }, J_.prototype.setJitter = function(e2) { + this.jitter = e2; + }; + class X_ extends e_ { + constructor(e2, t2) { + var n2; + super(), this.nsps = {}, this.subs = [], e2 && "object" == typeof e2 && (t2 = e2, e2 = void 0), (t2 = t2 || {}).path = t2.path || "/socket.io", this.opts = t2, o_(this, t2), this.reconnection(false !== t2.reconnection), this.reconnectionAttempts(t2.reconnectionAttempts || 1 / 0), this.reconnectionDelay(t2.reconnectionDelay || 1e3), this.reconnectionDelayMax(t2.reconnectionDelayMax || 5e3), this.randomizationFactor(null !== (n2 = t2.randomizationFactor) && void 0 !== n2 ? n2 : 0.5), this.backoff = new J_({ min: this.reconnectionDelay(), max: this.reconnectionDelayMax(), jitter: this.randomizationFactor() }), this.timeout(null == t2.timeout ? 2e4 : t2.timeout), this._readyState = "closed", this.uri = e2; + const r2 = t2.parser || Y_; + this.encoder = new r2.Encoder(), this.decoder = new r2.Decoder(), this._autoConnect = false !== t2.autoConnect, this._autoConnect && this.open(); + } + reconnection(e2) { + return arguments.length ? (this._reconnection = !!e2, this) : this._reconnection; + } + reconnectionAttempts(e2) { + return void 0 === e2 ? this._reconnectionAttempts : (this._reconnectionAttempts = e2, this); + } + reconnectionDelay(e2) { + var t2; + return void 0 === e2 ? this._reconnectionDelay : (this._reconnectionDelay = e2, null === (t2 = this.backoff) || void 0 === t2 || t2.setMin(e2), this); + } + randomizationFactor(e2) { + var t2; + return void 0 === e2 ? this._randomizationFactor : (this._randomizationFactor = e2, null === (t2 = this.backoff) || void 0 === t2 || t2.setJitter(e2), this); + } + reconnectionDelayMax(e2) { + var t2; + return void 0 === e2 ? this._reconnectionDelayMax : (this._reconnectionDelayMax = e2, null === (t2 = this.backoff) || void 0 === t2 || t2.setMax(e2), this); + } + timeout(e2) { + return arguments.length ? (this._timeout = e2, this) : this._timeout; + } + maybeReconnectOnOpen() { + !this._reconnecting && this._reconnection && 0 === this.backoff.attempts && this.reconnect(); + } + open(e2) { + if (~this._readyState.indexOf("open")) + return this; + this.engine = new P_(this.uri, this.opts); + const t2 = this.engine, n2 = this; + this._readyState = "opening", this.skipReconnect = false; + const r2 = G_(t2, "open", function() { + n2.onopen(), e2 && e2(); + }), i2 = (t3) => { + this.cleanup(), this._readyState = "closed", this.emitReserved("error", t3), e2 ? e2(t3) : this.maybeReconnectOnOpen(); + }, o2 = G_(t2, "error", i2); + if (false !== this._timeout) { + const e3 = this._timeout, n3 = this.setTimeoutFn(() => { + r2(), i2(new Error("timeout")), t2.close(); + }, e3); + this.opts.autoUnref && n3.unref(), this.subs.push(() => { + this.clearTimeoutFn(n3); + }); + } + return this.subs.push(r2), this.subs.push(o2), this; + } + connect(e2) { + return this.open(e2); + } + onopen() { + this.cleanup(), this._readyState = "open", this.emitReserved("open"); + const e2 = this.engine; + this.subs.push(G_(e2, "ping", this.onping.bind(this)), G_(e2, "data", this.ondata.bind(this)), G_(e2, "error", this.onerror.bind(this)), G_(e2, "close", this.onclose.bind(this)), G_(this.decoder, "decoded", this.ondecoded.bind(this))); + } + onping() { + this.emitReserved("ping"); + } + ondata(e2) { + try { + this.decoder.add(e2); + } catch (e3) { + this.onclose("parse error", e3); + } + } + ondecoded(e2) { + E_(() => { + this.emitReserved("packet", e2); + }, this.setTimeoutFn); + } + onerror(e2) { + this.emitReserved("error", e2); + } + socket(e2, t2) { + let n2 = this.nsps[e2]; + return n2 ? this._autoConnect && !n2.active && n2.connect() : (n2 = new Q_(this, e2, t2), this.nsps[e2] = n2), n2; + } + _destroy(e2) { + const t2 = Object.keys(this.nsps); + for (const e3 of t2) { + if (this.nsps[e3].active) + return; + } + this._close(); + } + _packet(e2) { + const t2 = this.encoder.encode(e2); + for (let n2 = 0; n2 < t2.length; n2++) + this.engine.write(t2[n2], e2.options); + } + cleanup() { + this.subs.forEach((e2) => e2()), this.subs.length = 0, this.decoder.destroy(); + } + _close() { + this.skipReconnect = true, this._reconnecting = false, this.onclose("forced close"), this.engine && this.engine.close(); + } + disconnect() { + return this._close(); + } + onclose(e2, t2) { + this.cleanup(), this.backoff.reset(), this._readyState = "closed", this.emitReserved("close", e2, t2), this._reconnection && !this.skipReconnect && this.reconnect(); + } + reconnect() { + if (this._reconnecting || this.skipReconnect) + return this; + const e2 = this; + if (this.backoff.attempts >= this._reconnectionAttempts) + this.backoff.reset(), this.emitReserved("reconnect_failed"), this._reconnecting = false; + else { + const t2 = this.backoff.duration(); + this._reconnecting = true; + const n2 = this.setTimeoutFn(() => { + e2.skipReconnect || (this.emitReserved("reconnect_attempt", e2.backoff.attempts), e2.skipReconnect || e2.open((t3) => { + t3 ? (e2._reconnecting = false, e2.reconnect(), this.emitReserved("reconnect_error", t3)) : e2.onreconnect(); + })); + }, t2); + this.opts.autoUnref && n2.unref(), this.subs.push(() => { + this.clearTimeoutFn(n2); + }); + } + } + onreconnect() { + const e2 = this.backoff.attempts; + this._reconnecting = false, this.backoff.reset(), this.emitReserved("reconnect", e2); + } + } + const eS = {}; + function tS(e2, t2) { + "object" == typeof e2 && (t2 = e2, e2 = void 0); + const n2 = function(e3, t3 = "", n3) { + let r3 = e3; + n3 = n3 || "undefined" != typeof location && location, null == e3 && (e3 = n3.protocol + "//" + n3.host), "string" == typeof e3 && ("/" === e3.charAt(0) && (e3 = "/" === e3.charAt(1) ? n3.protocol + e3 : n3.host + e3), /^(https?|wss?):\/\//.test(e3) || (e3 = void 0 !== n3 ? n3.protocol + "//" + e3 : "https://" + e3), r3 = T_(e3)), r3.port || (/^(http|ws)$/.test(r3.protocol) ? r3.port = "80" : /^(http|ws)s$/.test(r3.protocol) && (r3.port = "443")), r3.path = r3.path || "/"; + const i3 = -1 !== r3.host.indexOf(":") ? "[" + r3.host + "]" : r3.host; + return r3.id = r3.protocol + "://" + i3 + ":" + r3.port + t3, r3.href = r3.protocol + "://" + i3 + (n3 && n3.port === r3.port ? "" : ":" + r3.port), r3; + }(e2, (t2 = t2 || {}).path || "/socket.io"), r2 = n2.source, i2 = n2.id, o2 = n2.path, a2 = eS[i2] && o2 in eS[i2].nsps; + let s2; + return t2.forceNew || t2["force new connection"] || false === t2.multiplex || a2 ? s2 = new X_(r2, t2) : (eS[i2] || (eS[i2] = new X_(r2, t2)), s2 = eS[i2]), n2.query && !t2.query && (t2.query = n2.queryKey), s2.socket(n2.path, t2); + } + function nS(e2, t2, n2, r2) { + return new (n2 || (n2 = Promise))(function(i2, o2) { + function a2(e3) { + try { + u2(r2.next(e3)); + } catch (e4) { + o2(e4); + } + } + function s2(e3) { + try { + u2(r2.throw(e3)); + } catch (e4) { + o2(e4); + } + } + function u2(e3) { + var t3; + e3.done ? i2(e3.value) : (t3 = e3.value, t3 instanceof n2 ? t3 : new n2(function(e4) { + e4(t3); + })).then(a2, s2); + } + u2((r2 = r2.apply(e2, t2 || [])).next()); + }); + } + Object.assign(tS, { Manager: X_, Socket: Q_, io: tS, connect: tS }), "function" == typeof SuppressedError && SuppressedError; + var rS = void 0 !== t ? t : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}; + function iS() { + throw new Error("setTimeout has not been defined"); + } + function oS() { + throw new Error("clearTimeout has not been defined"); + } + var aS = iS, sS = oS; + function uS(e2) { + if (aS === setTimeout) + return setTimeout(e2, 0); + if ((aS === iS || !aS) && setTimeout) + return aS = setTimeout, setTimeout(e2, 0); + try { + return aS(e2, 0); + } catch (t2) { + try { + return aS.call(null, e2, 0); + } catch (t3) { + return aS.call(this, e2, 0); + } + } + } + "function" == typeof rS.setTimeout && (aS = setTimeout), "function" == typeof rS.clearTimeout && (sS = clearTimeout); + var lS, cS = [], dS = false, fS = -1; + function hS() { + dS && lS && (dS = false, lS.length ? cS = lS.concat(cS) : fS = -1, cS.length && pS()); + } + function pS() { + if (!dS) { + var e2 = uS(hS); + dS = true; + for (var t2 = cS.length; t2; ) { + for (lS = cS, cS = []; ++fS < t2; ) + lS && lS[fS].run(); + fS = -1, t2 = cS.length; + } + lS = null, dS = false, function(e3) { + if (sS === clearTimeout) + return clearTimeout(e3); + if ((sS === oS || !sS) && clearTimeout) + return sS = clearTimeout, clearTimeout(e3); + try { + return sS(e3); + } catch (t3) { + try { + return sS.call(null, e3); + } catch (t4) { + return sS.call(this, e3); + } + } + }(e2); + } + } + function mS(e2, t2) { + this.fun = e2, this.array = t2; + } + function gS() { + } + mS.prototype.run = function() { + this.fun.apply(null, this.array); + }; + var vS = gS, bS = gS, yS = gS, wS = gS, _S = gS, SS = gS, ES = gS, kS = rS.performance || {}, MS = kS.now || kS.mozNow || kS.msNow || kS.oNow || kS.webkitNow || function() { + return (/* @__PURE__ */ new Date()).getTime(); + }, CS = /* @__PURE__ */ new Date(), xS = { nextTick: function(e2) { + var t2 = new Array(arguments.length - 1); + if (arguments.length > 1) + for (var n2 = 1; n2 < arguments.length; n2++) + t2[n2 - 1] = arguments[n2]; + cS.push(new mS(e2, t2)), 1 !== cS.length || dS || uS(pS); + }, title: "browser", browser: true, env: {}, argv: [], version: "", versions: {}, on: vS, addListener: bS, once: yS, off: wS, removeListener: _S, removeAllListeners: SS, emit: ES, binding: function(e2) { + throw new Error("process.binding is not supported"); + }, cwd: function() { + return "/"; + }, chdir: function(e2) { + throw new Error("process.chdir is not supported"); + }, umask: function() { + return 0; + }, hrtime: function(e2) { + var t2 = 1e-3 * MS.call(kS), n2 = Math.floor(t2), r2 = Math.floor(t2 % 1 * 1e9); + return e2 && (n2 -= e2[0], (r2 -= e2[1]) < 0 && (n2--, r2 += 1e9)), [n2, r2]; + }, platform: "browser", release: {}, config: {}, uptime: function() { + return (/* @__PURE__ */ new Date() - CS) / 1e3; + } }; + var AS, RS, TS = { exports: {} }; + var PS = function(e2) { + function t2(e3) { + let r3, i2, o2, a2 = null; + function s2(...e4) { + if (!s2.enabled) + return; + const n3 = s2, i3 = Number(/* @__PURE__ */ new Date()), o3 = i3 - (r3 || i3); + n3.diff = o3, n3.prev = r3, n3.curr = i3, r3 = i3, e4[0] = t2.coerce(e4[0]), "string" != typeof e4[0] && e4.unshift("%O"); + let a3 = 0; + e4[0] = e4[0].replace(/%([a-zA-Z%])/g, (r4, i4) => { + if ("%%" === r4) + return "%"; + a3++; + const o4 = t2.formatters[i4]; + if ("function" == typeof o4) { + const t3 = e4[a3]; + r4 = o4.call(n3, t3), e4.splice(a3, 1), a3--; + } + return r4; + }), t2.formatArgs.call(n3, e4), (n3.log || t2.log).apply(n3, e4); + } + return s2.namespace = e3, s2.useColors = t2.useColors(), s2.color = t2.selectColor(e3), s2.extend = n2, s2.destroy = t2.destroy, Object.defineProperty(s2, "enabled", { enumerable: true, configurable: false, get: () => null !== a2 ? a2 : (i2 !== t2.namespaces && (i2 = t2.namespaces, o2 = t2.enabled(e3)), o2), set: (e4) => { + a2 = e4; + } }), "function" == typeof t2.init && t2.init(s2), s2; + } + function n2(e3, n3) { + const r3 = t2(this.namespace + (void 0 === n3 ? ":" : n3) + e3); + return r3.log = this.log, r3; + } + function r2(e3) { + return e3.toString().substring(2, e3.toString().length - 2).replace(/\.\*\?$/, "*"); + } + return t2.debug = t2, t2.default = t2, t2.coerce = function(e3) { + return e3 instanceof Error ? e3.stack || e3.message : e3; + }, t2.disable = function() { + const e3 = [...t2.names.map(r2), ...t2.skips.map(r2).map((e4) => "-" + e4)].join(","); + return t2.enable(""), e3; + }, t2.enable = function(e3) { + let n3; + t2.save(e3), t2.namespaces = e3, t2.names = [], t2.skips = []; + const r3 = ("string" == typeof e3 ? e3 : "").split(/[\s,]+/), i2 = r3.length; + for (n3 = 0; n3 < i2; n3++) + r3[n3] && ("-" === (e3 = r3[n3].replace(/\*/g, ".*?"))[0] ? t2.skips.push(new RegExp("^" + e3.slice(1) + "$")) : t2.names.push(new RegExp("^" + e3 + "$"))); + }, t2.enabled = function(e3) { + if ("*" === e3[e3.length - 1]) + return true; + let n3, r3; + for (n3 = 0, r3 = t2.skips.length; n3 < r3; n3++) + if (t2.skips[n3].test(e3)) + return false; + for (n3 = 0, r3 = t2.names.length; n3 < r3; n3++) + if (t2.names[n3].test(e3)) + return true; + return false; + }, t2.humanize = function() { + if (RS) + return AS; + RS = 1; + var e3 = 1e3, t3 = 60 * e3, n3 = 60 * t3, r3 = 24 * n3; + function i2(e4, t4, n4, r4) { + var i3 = t4 >= 1.5 * n4; + return Math.round(e4 / n4) + " " + r4 + (i3 ? "s" : ""); + } + return AS = function(o2, a2) { + a2 = a2 || {}; + var s2 = typeof o2; + if ("string" === s2 && o2.length > 0) + return function(i3) { + if (!((i3 = String(i3)).length > 100)) { + var o3 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i3); + if (o3) { + var a3 = parseFloat(o3[1]); + switch ((o3[2] || "ms").toLowerCase()) { + case "years": + case "year": + case "yrs": + case "yr": + case "y": + return 315576e5 * a3; + case "weeks": + case "week": + case "w": + return 6048e5 * a3; + case "days": + case "day": + case "d": + return a3 * r3; + case "hours": + case "hour": + case "hrs": + case "hr": + case "h": + return a3 * n3; + case "minutes": + case "minute": + case "mins": + case "min": + case "m": + return a3 * t3; + case "seconds": + case "second": + case "secs": + case "sec": + case "s": + return a3 * e3; + case "milliseconds": + case "millisecond": + case "msecs": + case "msec": + case "ms": + return a3; + default: + return; + } + } + } + }(o2); + if ("number" === s2 && isFinite(o2)) + return a2.long ? function(o3) { + var a3 = Math.abs(o3); + return a3 >= r3 ? i2(o3, a3, r3, "day") : a3 >= n3 ? i2(o3, a3, n3, "hour") : a3 >= t3 ? i2(o3, a3, t3, "minute") : a3 >= e3 ? i2(o3, a3, e3, "second") : o3 + " ms"; + }(o2) : function(i3) { + var o3 = Math.abs(i3); + return o3 >= r3 ? Math.round(i3 / r3) + "d" : o3 >= n3 ? Math.round(i3 / n3) + "h" : o3 >= t3 ? Math.round(i3 / t3) + "m" : o3 >= e3 ? Math.round(i3 / e3) + "s" : i3 + "ms"; + }(o2); + throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(o2)); + }; + }(), t2.destroy = function() { + console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); + }, Object.keys(e2).forEach((n3) => { + t2[n3] = e2[n3]; + }), t2.names = [], t2.skips = [], t2.formatters = {}, t2.selectColor = function(e3) { + let n3 = 0; + for (let t3 = 0; t3 < e3.length; t3++) + n3 = (n3 << 5) - n3 + e3.charCodeAt(t3), n3 |= 0; + return t2.colors[Math.abs(n3) % t2.colors.length]; + }, t2.enable(t2.load()), t2; + }; + !function(e2, t2) { + t2.formatArgs = function(t3) { + if (t3[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + t3[0] + (this.useColors ? "%c " : " ") + "+" + e2.exports.humanize(this.diff), !this.useColors) + return; + const n3 = "color: " + this.color; + t3.splice(1, 0, n3, "color: inherit"); + let r2 = 0, i2 = 0; + t3[0].replace(/%[a-zA-Z%]/g, (e3) => { + "%%" !== e3 && (r2++, "%c" === e3 && (i2 = r2)); + }), t3.splice(i2, 0, n3); + }, t2.save = function(e3) { + try { + e3 ? t2.storage.setItem("debug", e3) : t2.storage.removeItem("debug"); + } catch (e4) { + } + }, t2.load = function() { + let e3; + try { + e3 = t2.storage.getItem("debug"); + } catch (e4) { + } + return !e3 && void 0 !== xS && "env" in xS && (e3 = xS.env.DEBUG), e3; + }, t2.useColors = function() { + return !("undefined" == typeof window || !window.process || "renderer" !== window.process.type && !window.process.__nwjs) || ("undefined" == typeof navigator || !navigator.userAgent || !navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) && ("undefined" != typeof document && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || "undefined" != typeof window && window.console && (window.console.firebug || window.console.exception && window.console.table) || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); + }, t2.storage = function() { + try { + return localStorage; + } catch (e3) { + } + }(), t2.destroy = (() => { + let e3 = false; + return () => { + e3 || (e3 = true, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")); + }; + })(), t2.colors = ["#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33"], t2.log = console.debug || console.log || (() => { + }), e2.exports = PS(t2); + const { formatters: n2 } = e2.exports; + n2.j = function(e3) { + try { + return JSON.stringify(e3); + } catch (e4) { + return "[UnexpectedJSONParseError]: " + e4.message; + } + }; + }(TS, TS.exports); + var LS = function(e2) { + return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2; + }(TS.exports); + const IS = LS("KeyExchange:Layer"), OS = LS("SocketService:Layer"), NS = LS("Ecies:Layer"), DS = LS("RemoteCommunication:Layer"); + IS.color = "##95c44e", OS.color = "#f638d7", NS.color = "#465b9c", DS.color = "#47a2be"; + const jS = { KeyExchange: IS, SocketService: OS, Ecies: NS, RemoteCommunication: DS }; + let BS, zS = [], US = []; + function FS(e2) { + return nS(this, void 0, void 0, function* () { + if (!BS || !e2) + return; + !function() { + const e3 = US; + US = zS, zS = e3; + }(); + const t2 = BS.endsWith("/") ? `${BS}evt` : `${BS}/evt`, n2 = Object.assign({}, e2); + if (delete n2.params, e2.params) + for (const [t3, r3] of Object.entries(e2.params)) + n2[t3] = r3; + const r2 = JSON.stringify(n2); + jS.RemoteCommunication(`[sendBufferedEvents] Sending ${zS.length} analytics events to ${t2}`); + try { + const e3 = yield a(t2, { method: "POST", headers: { Accept: "application/json", "Content-Type": "application/json" }, body: r2 }), n3 = yield e3.text(); + jS.RemoteCommunication(`[sendBufferedEvents] Response: ${n3}`), zS.length = 0; + } catch (e3) { + console.warn("Error sending analytics", e3); + } + }); + } + const KS = (e2, t2) => nS(void 0, void 0, void 0, function* () { + var n2; + BS = t2, n2 = e2, US.push(n2), FS(e2).catch(() => { + }); + }); + var qS = [], HS = [], WS = "undefined" != typeof Uint8Array ? Uint8Array : Array, $S = false; + function VS() { + $S = true; + for (var e2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", t2 = 0; t2 < 64; ++t2) + qS[t2] = e2[t2], HS[e2.charCodeAt(t2)] = t2; + HS["-".charCodeAt(0)] = 62, HS["_".charCodeAt(0)] = 63; + } + function YS(e2, t2, n2) { + for (var r2, i2, o2 = [], a2 = t2; a2 < n2; a2 += 3) + r2 = (e2[a2] << 16) + (e2[a2 + 1] << 8) + e2[a2 + 2], o2.push(qS[(i2 = r2) >> 18 & 63] + qS[i2 >> 12 & 63] + qS[i2 >> 6 & 63] + qS[63 & i2]); + return o2.join(""); + } + function GS(e2) { + var t2; + $S || VS(); + for (var n2 = e2.length, r2 = n2 % 3, i2 = "", o2 = [], a2 = 16383, s2 = 0, u2 = n2 - r2; s2 < u2; s2 += a2) + o2.push(YS(e2, s2, s2 + a2 > u2 ? u2 : s2 + a2)); + return 1 === r2 ? (t2 = e2[n2 - 1], i2 += qS[t2 >> 2], i2 += qS[t2 << 4 & 63], i2 += "==") : 2 === r2 && (t2 = (e2[n2 - 2] << 8) + e2[n2 - 1], i2 += qS[t2 >> 10], i2 += qS[t2 >> 4 & 63], i2 += qS[t2 << 2 & 63], i2 += "="), o2.push(i2), o2.join(""); + } + function ZS(e2, t2, n2, r2, i2) { + var o2, a2, s2 = 8 * i2 - r2 - 1, u2 = (1 << s2) - 1, l2 = u2 >> 1, c2 = -7, d2 = n2 ? i2 - 1 : 0, f2 = n2 ? -1 : 1, h2 = e2[t2 + d2]; + for (d2 += f2, o2 = h2 & (1 << -c2) - 1, h2 >>= -c2, c2 += s2; c2 > 0; o2 = 256 * o2 + e2[t2 + d2], d2 += f2, c2 -= 8) + ; + for (a2 = o2 & (1 << -c2) - 1, o2 >>= -c2, c2 += r2; c2 > 0; a2 = 256 * a2 + e2[t2 + d2], d2 += f2, c2 -= 8) + ; + if (0 === o2) + o2 = 1 - l2; + else { + if (o2 === u2) + return a2 ? NaN : 1 / 0 * (h2 ? -1 : 1); + a2 += Math.pow(2, r2), o2 -= l2; + } + return (h2 ? -1 : 1) * a2 * Math.pow(2, o2 - r2); + } + function QS(e2, t2, n2, r2, i2, o2) { + var a2, s2, u2, l2 = 8 * o2 - i2 - 1, c2 = (1 << l2) - 1, d2 = c2 >> 1, f2 = 23 === i2 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, h2 = r2 ? 0 : o2 - 1, p2 = r2 ? 1 : -1, m2 = t2 < 0 || 0 === t2 && 1 / t2 < 0 ? 1 : 0; + for (t2 = Math.abs(t2), isNaN(t2) || t2 === 1 / 0 ? (s2 = isNaN(t2) ? 1 : 0, a2 = c2) : (a2 = Math.floor(Math.log(t2) / Math.LN2), t2 * (u2 = Math.pow(2, -a2)) < 1 && (a2--, u2 *= 2), (t2 += a2 + d2 >= 1 ? f2 / u2 : f2 * Math.pow(2, 1 - d2)) * u2 >= 2 && (a2++, u2 /= 2), a2 + d2 >= c2 ? (s2 = 0, a2 = c2) : a2 + d2 >= 1 ? (s2 = (t2 * u2 - 1) * Math.pow(2, i2), a2 += d2) : (s2 = t2 * Math.pow(2, d2 - 1) * Math.pow(2, i2), a2 = 0)); i2 >= 8; e2[n2 + h2] = 255 & s2, h2 += p2, s2 /= 256, i2 -= 8) + ; + for (a2 = a2 << i2 | s2, l2 += i2; l2 > 0; e2[n2 + h2] = 255 & a2, h2 += p2, a2 /= 256, l2 -= 8) + ; + e2[n2 + h2 - p2] |= 128 * m2; + } + var JS = {}.toString, XS = Array.isArray || function(e2) { + return "[object Array]" == JS.call(e2); + }; + function eE() { + return nE.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823; + } + function tE(e2, t2) { + if (eE() < t2) + throw new RangeError("Invalid typed array length"); + return nE.TYPED_ARRAY_SUPPORT ? (e2 = new Uint8Array(t2)).__proto__ = nE.prototype : (null === e2 && (e2 = new nE(t2)), e2.length = t2), e2; + } + function nE(e2, t2, n2) { + if (!(nE.TYPED_ARRAY_SUPPORT || this instanceof nE)) + return new nE(e2, t2, n2); + if ("number" == typeof e2) { + if ("string" == typeof t2) + throw new Error("If encoding is specified then the first argument must be a string"); + return oE(this, e2); + } + return rE(this, e2, t2, n2); + } + function rE(e2, t2, n2, r2) { + if ("number" == typeof t2) + throw new TypeError('"value" argument must not be a number'); + return "undefined" != typeof ArrayBuffer && t2 instanceof ArrayBuffer ? function(e3, t3, n3, r3) { + if (t3.byteLength, n3 < 0 || t3.byteLength < n3) + throw new RangeError("'offset' is out of bounds"); + if (t3.byteLength < n3 + (r3 || 0)) + throw new RangeError("'length' is out of bounds"); + return t3 = void 0 === n3 && void 0 === r3 ? new Uint8Array(t3) : void 0 === r3 ? new Uint8Array(t3, n3) : new Uint8Array(t3, n3, r3), nE.TYPED_ARRAY_SUPPORT ? (e3 = t3).__proto__ = nE.prototype : e3 = aE(e3, t3), e3; + }(e2, t2, n2, r2) : "string" == typeof t2 ? function(e3, t3, n3) { + if ("string" == typeof n3 && "" !== n3 || (n3 = "utf8"), !nE.isEncoding(n3)) + throw new TypeError('"encoding" must be a valid string encoding'); + var r3 = 0 | lE(t3, n3), i2 = (e3 = tE(e3, r3)).write(t3, n3); + return i2 !== r3 && (e3 = e3.slice(0, i2)), e3; + }(e2, t2, n2) : function(e3, t3) { + if (uE(t3)) { + var n3 = 0 | sE(t3.length); + return 0 === (e3 = tE(e3, n3)).length || t3.copy(e3, 0, 0, n3), e3; + } + if (t3) { + if ("undefined" != typeof ArrayBuffer && t3.buffer instanceof ArrayBuffer || "length" in t3) + return "number" != typeof t3.length || (r3 = t3.length) != r3 ? tE(e3, 0) : aE(e3, t3); + if ("Buffer" === t3.type && XS(t3.data)) + return aE(e3, t3.data); + } + var r3; + throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object."); + }(e2, t2); + } + function iE(e2) { + if ("number" != typeof e2) + throw new TypeError('"size" argument must be a number'); + if (e2 < 0) + throw new RangeError('"size" argument must not be negative'); + } + function oE(e2, t2) { + if (iE(t2), e2 = tE(e2, t2 < 0 ? 0 : 0 | sE(t2)), !nE.TYPED_ARRAY_SUPPORT) + for (var n2 = 0; n2 < t2; ++n2) + e2[n2] = 0; + return e2; + } + function aE(e2, t2) { + var n2 = t2.length < 0 ? 0 : 0 | sE(t2.length); + e2 = tE(e2, n2); + for (var r2 = 0; r2 < n2; r2 += 1) + e2[r2] = 255 & t2[r2]; + return e2; + } + function sE(e2) { + if (e2 >= eE()) + throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + eE().toString(16) + " bytes"); + return 0 | e2; + } + function uE(e2) { + return !(null == e2 || !e2._isBuffer); + } + function lE(e2, t2) { + if (uE(e2)) + return e2.length; + if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e2) || e2 instanceof ArrayBuffer)) + return e2.byteLength; + "string" != typeof e2 && (e2 = "" + e2); + var n2 = e2.length; + if (0 === n2) + return 0; + for (var r2 = false; ; ) + switch (t2) { + case "ascii": + case "latin1": + case "binary": + return n2; + case "utf8": + case "utf-8": + case void 0: + return DE(e2).length; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return 2 * n2; + case "hex": + return n2 >>> 1; + case "base64": + return jE(e2).length; + default: + if (r2) + return DE(e2).length; + t2 = ("" + t2).toLowerCase(), r2 = true; + } + } + function cE(e2, t2, n2) { + var r2 = false; + if ((void 0 === t2 || t2 < 0) && (t2 = 0), t2 > this.length) + return ""; + if ((void 0 === n2 || n2 > this.length) && (n2 = this.length), n2 <= 0) + return ""; + if ((n2 >>>= 0) <= (t2 >>>= 0)) + return ""; + for (e2 || (e2 = "utf8"); ; ) + switch (e2) { + case "hex": + return ME(this, t2, n2); + case "utf8": + case "utf-8": + return _E(this, t2, n2); + case "ascii": + return EE(this, t2, n2); + case "latin1": + case "binary": + return kE(this, t2, n2); + case "base64": + return wE(this, t2, n2); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return CE(this, t2, n2); + default: + if (r2) + throw new TypeError("Unknown encoding: " + e2); + e2 = (e2 + "").toLowerCase(), r2 = true; + } + } + function dE(e2, t2, n2) { + var r2 = e2[t2]; + e2[t2] = e2[n2], e2[n2] = r2; + } + function fE(e2, t2, n2, r2, i2) { + if (0 === e2.length) + return -1; + if ("string" == typeof n2 ? (r2 = n2, n2 = 0) : n2 > 2147483647 ? n2 = 2147483647 : n2 < -2147483648 && (n2 = -2147483648), n2 = +n2, isNaN(n2) && (n2 = i2 ? 0 : e2.length - 1), n2 < 0 && (n2 = e2.length + n2), n2 >= e2.length) { + if (i2) + return -1; + n2 = e2.length - 1; + } else if (n2 < 0) { + if (!i2) + return -1; + n2 = 0; + } + if ("string" == typeof t2 && (t2 = nE.from(t2, r2)), uE(t2)) + return 0 === t2.length ? -1 : hE(e2, t2, n2, r2, i2); + if ("number" == typeof t2) + return t2 &= 255, nE.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? i2 ? Uint8Array.prototype.indexOf.call(e2, t2, n2) : Uint8Array.prototype.lastIndexOf.call(e2, t2, n2) : hE(e2, [t2], n2, r2, i2); + throw new TypeError("val must be string, number or Buffer"); + } + function hE(e2, t2, n2, r2, i2) { + var o2, a2 = 1, s2 = e2.length, u2 = t2.length; + if (void 0 !== r2 && ("ucs2" === (r2 = String(r2).toLowerCase()) || "ucs-2" === r2 || "utf16le" === r2 || "utf-16le" === r2)) { + if (e2.length < 2 || t2.length < 2) + return -1; + a2 = 2, s2 /= 2, u2 /= 2, n2 /= 2; + } + function l2(e3, t3) { + return 1 === a2 ? e3[t3] : e3.readUInt16BE(t3 * a2); + } + if (i2) { + var c2 = -1; + for (o2 = n2; o2 < s2; o2++) + if (l2(e2, o2) === l2(t2, -1 === c2 ? 0 : o2 - c2)) { + if (-1 === c2 && (c2 = o2), o2 - c2 + 1 === u2) + return c2 * a2; + } else + -1 !== c2 && (o2 -= o2 - c2), c2 = -1; + } else + for (n2 + u2 > s2 && (n2 = s2 - u2), o2 = n2; o2 >= 0; o2--) { + for (var d2 = true, f2 = 0; f2 < u2; f2++) + if (l2(e2, o2 + f2) !== l2(t2, f2)) { + d2 = false; + break; + } + if (d2) + return o2; + } + return -1; + } + function pE(e2, t2, n2, r2) { + n2 = Number(n2) || 0; + var i2 = e2.length - n2; + r2 ? (r2 = Number(r2)) > i2 && (r2 = i2) : r2 = i2; + var o2 = t2.length; + if (o2 % 2 != 0) + throw new TypeError("Invalid hex string"); + r2 > o2 / 2 && (r2 = o2 / 2); + for (var a2 = 0; a2 < r2; ++a2) { + var s2 = parseInt(t2.substr(2 * a2, 2), 16); + if (isNaN(s2)) + return a2; + e2[n2 + a2] = s2; + } + return a2; + } + function mE(e2, t2, n2, r2) { + return BE(DE(t2, e2.length - n2), e2, n2, r2); + } + function gE(e2, t2, n2, r2) { + return BE(function(e3) { + for (var t3 = [], n3 = 0; n3 < e3.length; ++n3) + t3.push(255 & e3.charCodeAt(n3)); + return t3; + }(t2), e2, n2, r2); + } + function vE(e2, t2, n2, r2) { + return gE(e2, t2, n2, r2); + } + function bE(e2, t2, n2, r2) { + return BE(jE(t2), e2, n2, r2); + } + function yE(e2, t2, n2, r2) { + return BE(function(e3, t3) { + for (var n3, r3, i2, o2 = [], a2 = 0; a2 < e3.length && !((t3 -= 2) < 0); ++a2) + r3 = (n3 = e3.charCodeAt(a2)) >> 8, i2 = n3 % 256, o2.push(i2), o2.push(r3); + return o2; + }(t2, e2.length - n2), e2, n2, r2); + } + function wE(e2, t2, n2) { + return 0 === t2 && n2 === e2.length ? GS(e2) : GS(e2.slice(t2, n2)); + } + function _E(e2, t2, n2) { + n2 = Math.min(e2.length, n2); + for (var r2 = [], i2 = t2; i2 < n2; ) { + var o2, a2, s2, u2, l2 = e2[i2], c2 = null, d2 = l2 > 239 ? 4 : l2 > 223 ? 3 : l2 > 191 ? 2 : 1; + if (i2 + d2 <= n2) + switch (d2) { + case 1: + l2 < 128 && (c2 = l2); + break; + case 2: + 128 == (192 & (o2 = e2[i2 + 1])) && (u2 = (31 & l2) << 6 | 63 & o2) > 127 && (c2 = u2); + break; + case 3: + o2 = e2[i2 + 1], a2 = e2[i2 + 2], 128 == (192 & o2) && 128 == (192 & a2) && (u2 = (15 & l2) << 12 | (63 & o2) << 6 | 63 & a2) > 2047 && (u2 < 55296 || u2 > 57343) && (c2 = u2); + break; + case 4: + o2 = e2[i2 + 1], a2 = e2[i2 + 2], s2 = e2[i2 + 3], 128 == (192 & o2) && 128 == (192 & a2) && 128 == (192 & s2) && (u2 = (15 & l2) << 18 | (63 & o2) << 12 | (63 & a2) << 6 | 63 & s2) > 65535 && u2 < 1114112 && (c2 = u2); + } + null === c2 ? (c2 = 65533, d2 = 1) : c2 > 65535 && (c2 -= 65536, r2.push(c2 >>> 10 & 1023 | 55296), c2 = 56320 | 1023 & c2), r2.push(c2), i2 += d2; + } + return function(e3) { + var t3 = e3.length; + if (t3 <= SE) + return String.fromCharCode.apply(String, e3); + for (var n3 = "", r3 = 0; r3 < t3; ) + n3 += String.fromCharCode.apply(String, e3.slice(r3, r3 += SE)); + return n3; + }(r2); + } + nE.TYPED_ARRAY_SUPPORT = void 0 === rS.TYPED_ARRAY_SUPPORT || rS.TYPED_ARRAY_SUPPORT, eE(), nE.poolSize = 8192, nE._augment = function(e2) { + return e2.__proto__ = nE.prototype, e2; + }, nE.from = function(e2, t2, n2) { + return rE(null, e2, t2, n2); + }, nE.TYPED_ARRAY_SUPPORT && (nE.prototype.__proto__ = Uint8Array.prototype, nE.__proto__ = Uint8Array, "undefined" != typeof Symbol && Symbol.species && nE[Symbol.species]), nE.alloc = function(e2, t2, n2) { + return function(e3, t3, n3, r2) { + return iE(t3), t3 <= 0 ? tE(e3, t3) : void 0 !== n3 ? "string" == typeof r2 ? tE(e3, t3).fill(n3, r2) : tE(e3, t3).fill(n3) : tE(e3, t3); + }(null, e2, t2, n2); + }, nE.allocUnsafe = function(e2) { + return oE(null, e2); + }, nE.allocUnsafeSlow = function(e2) { + return oE(null, e2); + }, nE.isBuffer = function(e2) { + return null != e2 && (!!e2._isBuffer || zE(e2) || function(e3) { + return "function" == typeof e3.readFloatLE && "function" == typeof e3.slice && zE(e3.slice(0, 0)); + }(e2)); + }, nE.compare = function(e2, t2) { + if (!uE(e2) || !uE(t2)) + throw new TypeError("Arguments must be Buffers"); + if (e2 === t2) + return 0; + for (var n2 = e2.length, r2 = t2.length, i2 = 0, o2 = Math.min(n2, r2); i2 < o2; ++i2) + if (e2[i2] !== t2[i2]) { + n2 = e2[i2], r2 = t2[i2]; + break; + } + return n2 < r2 ? -1 : r2 < n2 ? 1 : 0; + }, nE.isEncoding = function(e2) { + switch (String(e2).toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "latin1": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return true; + default: + return false; + } + }, nE.concat = function(e2, t2) { + if (!XS(e2)) + throw new TypeError('"list" argument must be an Array of Buffers'); + if (0 === e2.length) + return nE.alloc(0); + var n2; + if (void 0 === t2) + for (t2 = 0, n2 = 0; n2 < e2.length; ++n2) + t2 += e2[n2].length; + var r2 = nE.allocUnsafe(t2), i2 = 0; + for (n2 = 0; n2 < e2.length; ++n2) { + var o2 = e2[n2]; + if (!uE(o2)) + throw new TypeError('"list" argument must be an Array of Buffers'); + o2.copy(r2, i2), i2 += o2.length; + } + return r2; + }, nE.byteLength = lE, nE.prototype._isBuffer = true, nE.prototype.swap16 = function() { + var e2 = this.length; + if (e2 % 2 != 0) + throw new RangeError("Buffer size must be a multiple of 16-bits"); + for (var t2 = 0; t2 < e2; t2 += 2) + dE(this, t2, t2 + 1); + return this; + }, nE.prototype.swap32 = function() { + var e2 = this.length; + if (e2 % 4 != 0) + throw new RangeError("Buffer size must be a multiple of 32-bits"); + for (var t2 = 0; t2 < e2; t2 += 4) + dE(this, t2, t2 + 3), dE(this, t2 + 1, t2 + 2); + return this; + }, nE.prototype.swap64 = function() { + var e2 = this.length; + if (e2 % 8 != 0) + throw new RangeError("Buffer size must be a multiple of 64-bits"); + for (var t2 = 0; t2 < e2; t2 += 8) + dE(this, t2, t2 + 7), dE(this, t2 + 1, t2 + 6), dE(this, t2 + 2, t2 + 5), dE(this, t2 + 3, t2 + 4); + return this; + }, nE.prototype.toString = function() { + var e2 = 0 | this.length; + return 0 === e2 ? "" : 0 === arguments.length ? _E(this, 0, e2) : cE.apply(this, arguments); + }, nE.prototype.equals = function(e2) { + if (!uE(e2)) + throw new TypeError("Argument must be a Buffer"); + return this === e2 || 0 === nE.compare(this, e2); + }, nE.prototype.inspect = function() { + var e2 = ""; + return this.length > 0 && (e2 = this.toString("hex", 0, 50).match(/.{2}/g).join(" "), this.length > 50 && (e2 += " ... ")), ""; + }, nE.prototype.compare = function(e2, t2, n2, r2, i2) { + if (!uE(e2)) + throw new TypeError("Argument must be a Buffer"); + if (void 0 === t2 && (t2 = 0), void 0 === n2 && (n2 = e2 ? e2.length : 0), void 0 === r2 && (r2 = 0), void 0 === i2 && (i2 = this.length), t2 < 0 || n2 > e2.length || r2 < 0 || i2 > this.length) + throw new RangeError("out of range index"); + if (r2 >= i2 && t2 >= n2) + return 0; + if (r2 >= i2) + return -1; + if (t2 >= n2) + return 1; + if (this === e2) + return 0; + for (var o2 = (i2 >>>= 0) - (r2 >>>= 0), a2 = (n2 >>>= 0) - (t2 >>>= 0), s2 = Math.min(o2, a2), u2 = this.slice(r2, i2), l2 = e2.slice(t2, n2), c2 = 0; c2 < s2; ++c2) + if (u2[c2] !== l2[c2]) { + o2 = u2[c2], a2 = l2[c2]; + break; + } + return o2 < a2 ? -1 : a2 < o2 ? 1 : 0; + }, nE.prototype.includes = function(e2, t2, n2) { + return -1 !== this.indexOf(e2, t2, n2); + }, nE.prototype.indexOf = function(e2, t2, n2) { + return fE(this, e2, t2, n2, true); + }, nE.prototype.lastIndexOf = function(e2, t2, n2) { + return fE(this, e2, t2, n2, false); + }, nE.prototype.write = function(e2, t2, n2, r2) { + if (void 0 === t2) + r2 = "utf8", n2 = this.length, t2 = 0; + else if (void 0 === n2 && "string" == typeof t2) + r2 = t2, n2 = this.length, t2 = 0; + else { + if (!isFinite(t2)) + throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); + t2 |= 0, isFinite(n2) ? (n2 |= 0, void 0 === r2 && (r2 = "utf8")) : (r2 = n2, n2 = void 0); + } + var i2 = this.length - t2; + if ((void 0 === n2 || n2 > i2) && (n2 = i2), e2.length > 0 && (n2 < 0 || t2 < 0) || t2 > this.length) + throw new RangeError("Attempt to write outside buffer bounds"); + r2 || (r2 = "utf8"); + for (var o2 = false; ; ) + switch (r2) { + case "hex": + return pE(this, e2, t2, n2); + case "utf8": + case "utf-8": + return mE(this, e2, t2, n2); + case "ascii": + return gE(this, e2, t2, n2); + case "latin1": + case "binary": + return vE(this, e2, t2, n2); + case "base64": + return bE(this, e2, t2, n2); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return yE(this, e2, t2, n2); + default: + if (o2) + throw new TypeError("Unknown encoding: " + r2); + r2 = ("" + r2).toLowerCase(), o2 = true; + } + }, nE.prototype.toJSON = function() { + return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) }; + }; + var SE = 4096; + function EE(e2, t2, n2) { + var r2 = ""; + n2 = Math.min(e2.length, n2); + for (var i2 = t2; i2 < n2; ++i2) + r2 += String.fromCharCode(127 & e2[i2]); + return r2; + } + function kE(e2, t2, n2) { + var r2 = ""; + n2 = Math.min(e2.length, n2); + for (var i2 = t2; i2 < n2; ++i2) + r2 += String.fromCharCode(e2[i2]); + return r2; + } + function ME(e2, t2, n2) { + var r2 = e2.length; + (!t2 || t2 < 0) && (t2 = 0), (!n2 || n2 < 0 || n2 > r2) && (n2 = r2); + for (var i2 = "", o2 = t2; o2 < n2; ++o2) + i2 += NE(e2[o2]); + return i2; + } + function CE(e2, t2, n2) { + for (var r2 = e2.slice(t2, n2), i2 = "", o2 = 0; o2 < r2.length; o2 += 2) + i2 += String.fromCharCode(r2[o2] + 256 * r2[o2 + 1]); + return i2; + } + function xE(e2, t2, n2) { + if (e2 % 1 != 0 || e2 < 0) + throw new RangeError("offset is not uint"); + if (e2 + t2 > n2) + throw new RangeError("Trying to access beyond buffer length"); + } + function AE(e2, t2, n2, r2, i2, o2) { + if (!uE(e2)) + throw new TypeError('"buffer" argument must be a Buffer instance'); + if (t2 > i2 || t2 < o2) + throw new RangeError('"value" argument is out of bounds'); + if (n2 + r2 > e2.length) + throw new RangeError("Index out of range"); + } + function RE(e2, t2, n2, r2) { + t2 < 0 && (t2 = 65535 + t2 + 1); + for (var i2 = 0, o2 = Math.min(e2.length - n2, 2); i2 < o2; ++i2) + e2[n2 + i2] = (t2 & 255 << 8 * (r2 ? i2 : 1 - i2)) >>> 8 * (r2 ? i2 : 1 - i2); + } + function TE(e2, t2, n2, r2) { + t2 < 0 && (t2 = 4294967295 + t2 + 1); + for (var i2 = 0, o2 = Math.min(e2.length - n2, 4); i2 < o2; ++i2) + e2[n2 + i2] = t2 >>> 8 * (r2 ? i2 : 3 - i2) & 255; + } + function PE(e2, t2, n2, r2, i2, o2) { + if (n2 + r2 > e2.length) + throw new RangeError("Index out of range"); + if (n2 < 0) + throw new RangeError("Index out of range"); + } + function LE(e2, t2, n2, r2, i2) { + return i2 || PE(e2, 0, n2, 4), QS(e2, t2, n2, r2, 23, 4), n2 + 4; + } + function IE(e2, t2, n2, r2, i2) { + return i2 || PE(e2, 0, n2, 8), QS(e2, t2, n2, r2, 52, 8), n2 + 8; + } + nE.prototype.slice = function(e2, t2) { + var n2, r2 = this.length; + if ((e2 = ~~e2) < 0 ? (e2 += r2) < 0 && (e2 = 0) : e2 > r2 && (e2 = r2), (t2 = void 0 === t2 ? r2 : ~~t2) < 0 ? (t2 += r2) < 0 && (t2 = 0) : t2 > r2 && (t2 = r2), t2 < e2 && (t2 = e2), nE.TYPED_ARRAY_SUPPORT) + (n2 = this.subarray(e2, t2)).__proto__ = nE.prototype; + else { + var i2 = t2 - e2; + n2 = new nE(i2, void 0); + for (var o2 = 0; o2 < i2; ++o2) + n2[o2] = this[o2 + e2]; + } + return n2; + }, nE.prototype.readUIntLE = function(e2, t2, n2) { + e2 |= 0, t2 |= 0, n2 || xE(e2, t2, this.length); + for (var r2 = this[e2], i2 = 1, o2 = 0; ++o2 < t2 && (i2 *= 256); ) + r2 += this[e2 + o2] * i2; + return r2; + }, nE.prototype.readUIntBE = function(e2, t2, n2) { + e2 |= 0, t2 |= 0, n2 || xE(e2, t2, this.length); + for (var r2 = this[e2 + --t2], i2 = 1; t2 > 0 && (i2 *= 256); ) + r2 += this[e2 + --t2] * i2; + return r2; + }, nE.prototype.readUInt8 = function(e2, t2) { + return t2 || xE(e2, 1, this.length), this[e2]; + }, nE.prototype.readUInt16LE = function(e2, t2) { + return t2 || xE(e2, 2, this.length), this[e2] | this[e2 + 1] << 8; + }, nE.prototype.readUInt16BE = function(e2, t2) { + return t2 || xE(e2, 2, this.length), this[e2] << 8 | this[e2 + 1]; + }, nE.prototype.readUInt32LE = function(e2, t2) { + return t2 || xE(e2, 4, this.length), (this[e2] | this[e2 + 1] << 8 | this[e2 + 2] << 16) + 16777216 * this[e2 + 3]; + }, nE.prototype.readUInt32BE = function(e2, t2) { + return t2 || xE(e2, 4, this.length), 16777216 * this[e2] + (this[e2 + 1] << 16 | this[e2 + 2] << 8 | this[e2 + 3]); + }, nE.prototype.readIntLE = function(e2, t2, n2) { + e2 |= 0, t2 |= 0, n2 || xE(e2, t2, this.length); + for (var r2 = this[e2], i2 = 1, o2 = 0; ++o2 < t2 && (i2 *= 256); ) + r2 += this[e2 + o2] * i2; + return r2 >= (i2 *= 128) && (r2 -= Math.pow(2, 8 * t2)), r2; + }, nE.prototype.readIntBE = function(e2, t2, n2) { + e2 |= 0, t2 |= 0, n2 || xE(e2, t2, this.length); + for (var r2 = t2, i2 = 1, o2 = this[e2 + --r2]; r2 > 0 && (i2 *= 256); ) + o2 += this[e2 + --r2] * i2; + return o2 >= (i2 *= 128) && (o2 -= Math.pow(2, 8 * t2)), o2; + }, nE.prototype.readInt8 = function(e2, t2) { + return t2 || xE(e2, 1, this.length), 128 & this[e2] ? -1 * (255 - this[e2] + 1) : this[e2]; + }, nE.prototype.readInt16LE = function(e2, t2) { + t2 || xE(e2, 2, this.length); + var n2 = this[e2] | this[e2 + 1] << 8; + return 32768 & n2 ? 4294901760 | n2 : n2; + }, nE.prototype.readInt16BE = function(e2, t2) { + t2 || xE(e2, 2, this.length); + var n2 = this[e2 + 1] | this[e2] << 8; + return 32768 & n2 ? 4294901760 | n2 : n2; + }, nE.prototype.readInt32LE = function(e2, t2) { + return t2 || xE(e2, 4, this.length), this[e2] | this[e2 + 1] << 8 | this[e2 + 2] << 16 | this[e2 + 3] << 24; + }, nE.prototype.readInt32BE = function(e2, t2) { + return t2 || xE(e2, 4, this.length), this[e2] << 24 | this[e2 + 1] << 16 | this[e2 + 2] << 8 | this[e2 + 3]; + }, nE.prototype.readFloatLE = function(e2, t2) { + return t2 || xE(e2, 4, this.length), ZS(this, e2, true, 23, 4); + }, nE.prototype.readFloatBE = function(e2, t2) { + return t2 || xE(e2, 4, this.length), ZS(this, e2, false, 23, 4); + }, nE.prototype.readDoubleLE = function(e2, t2) { + return t2 || xE(e2, 8, this.length), ZS(this, e2, true, 52, 8); + }, nE.prototype.readDoubleBE = function(e2, t2) { + return t2 || xE(e2, 8, this.length), ZS(this, e2, false, 52, 8); + }, nE.prototype.writeUIntLE = function(e2, t2, n2, r2) { + e2 = +e2, t2 |= 0, n2 |= 0, r2 || AE(this, e2, t2, n2, Math.pow(2, 8 * n2) - 1, 0); + var i2 = 1, o2 = 0; + for (this[t2] = 255 & e2; ++o2 < n2 && (i2 *= 256); ) + this[t2 + o2] = e2 / i2 & 255; + return t2 + n2; + }, nE.prototype.writeUIntBE = function(e2, t2, n2, r2) { + e2 = +e2, t2 |= 0, n2 |= 0, r2 || AE(this, e2, t2, n2, Math.pow(2, 8 * n2) - 1, 0); + var i2 = n2 - 1, o2 = 1; + for (this[t2 + i2] = 255 & e2; --i2 >= 0 && (o2 *= 256); ) + this[t2 + i2] = e2 / o2 & 255; + return t2 + n2; + }, nE.prototype.writeUInt8 = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || AE(this, e2, t2, 1, 255, 0), nE.TYPED_ARRAY_SUPPORT || (e2 = Math.floor(e2)), this[t2] = 255 & e2, t2 + 1; + }, nE.prototype.writeUInt16LE = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || AE(this, e2, t2, 2, 65535, 0), nE.TYPED_ARRAY_SUPPORT ? (this[t2] = 255 & e2, this[t2 + 1] = e2 >>> 8) : RE(this, e2, t2, true), t2 + 2; + }, nE.prototype.writeUInt16BE = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || AE(this, e2, t2, 2, 65535, 0), nE.TYPED_ARRAY_SUPPORT ? (this[t2] = e2 >>> 8, this[t2 + 1] = 255 & e2) : RE(this, e2, t2, false), t2 + 2; + }, nE.prototype.writeUInt32LE = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || AE(this, e2, t2, 4, 4294967295, 0), nE.TYPED_ARRAY_SUPPORT ? (this[t2 + 3] = e2 >>> 24, this[t2 + 2] = e2 >>> 16, this[t2 + 1] = e2 >>> 8, this[t2] = 255 & e2) : TE(this, e2, t2, true), t2 + 4; + }, nE.prototype.writeUInt32BE = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || AE(this, e2, t2, 4, 4294967295, 0), nE.TYPED_ARRAY_SUPPORT ? (this[t2] = e2 >>> 24, this[t2 + 1] = e2 >>> 16, this[t2 + 2] = e2 >>> 8, this[t2 + 3] = 255 & e2) : TE(this, e2, t2, false), t2 + 4; + }, nE.prototype.writeIntLE = function(e2, t2, n2, r2) { + if (e2 = +e2, t2 |= 0, !r2) { + var i2 = Math.pow(2, 8 * n2 - 1); + AE(this, e2, t2, n2, i2 - 1, -i2); + } + var o2 = 0, a2 = 1, s2 = 0; + for (this[t2] = 255 & e2; ++o2 < n2 && (a2 *= 256); ) + e2 < 0 && 0 === s2 && 0 !== this[t2 + o2 - 1] && (s2 = 1), this[t2 + o2] = (e2 / a2 >> 0) - s2 & 255; + return t2 + n2; + }, nE.prototype.writeIntBE = function(e2, t2, n2, r2) { + if (e2 = +e2, t2 |= 0, !r2) { + var i2 = Math.pow(2, 8 * n2 - 1); + AE(this, e2, t2, n2, i2 - 1, -i2); + } + var o2 = n2 - 1, a2 = 1, s2 = 0; + for (this[t2 + o2] = 255 & e2; --o2 >= 0 && (a2 *= 256); ) + e2 < 0 && 0 === s2 && 0 !== this[t2 + o2 + 1] && (s2 = 1), this[t2 + o2] = (e2 / a2 >> 0) - s2 & 255; + return t2 + n2; + }, nE.prototype.writeInt8 = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || AE(this, e2, t2, 1, 127, -128), nE.TYPED_ARRAY_SUPPORT || (e2 = Math.floor(e2)), e2 < 0 && (e2 = 255 + e2 + 1), this[t2] = 255 & e2, t2 + 1; + }, nE.prototype.writeInt16LE = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || AE(this, e2, t2, 2, 32767, -32768), nE.TYPED_ARRAY_SUPPORT ? (this[t2] = 255 & e2, this[t2 + 1] = e2 >>> 8) : RE(this, e2, t2, true), t2 + 2; + }, nE.prototype.writeInt16BE = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || AE(this, e2, t2, 2, 32767, -32768), nE.TYPED_ARRAY_SUPPORT ? (this[t2] = e2 >>> 8, this[t2 + 1] = 255 & e2) : RE(this, e2, t2, false), t2 + 2; + }, nE.prototype.writeInt32LE = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || AE(this, e2, t2, 4, 2147483647, -2147483648), nE.TYPED_ARRAY_SUPPORT ? (this[t2] = 255 & e2, this[t2 + 1] = e2 >>> 8, this[t2 + 2] = e2 >>> 16, this[t2 + 3] = e2 >>> 24) : TE(this, e2, t2, true), t2 + 4; + }, nE.prototype.writeInt32BE = function(e2, t2, n2) { + return e2 = +e2, t2 |= 0, n2 || AE(this, e2, t2, 4, 2147483647, -2147483648), e2 < 0 && (e2 = 4294967295 + e2 + 1), nE.TYPED_ARRAY_SUPPORT ? (this[t2] = e2 >>> 24, this[t2 + 1] = e2 >>> 16, this[t2 + 2] = e2 >>> 8, this[t2 + 3] = 255 & e2) : TE(this, e2, t2, false), t2 + 4; + }, nE.prototype.writeFloatLE = function(e2, t2, n2) { + return LE(this, e2, t2, true, n2); + }, nE.prototype.writeFloatBE = function(e2, t2, n2) { + return LE(this, e2, t2, false, n2); + }, nE.prototype.writeDoubleLE = function(e2, t2, n2) { + return IE(this, e2, t2, true, n2); + }, nE.prototype.writeDoubleBE = function(e2, t2, n2) { + return IE(this, e2, t2, false, n2); + }, nE.prototype.copy = function(e2, t2, n2, r2) { + if (n2 || (n2 = 0), r2 || 0 === r2 || (r2 = this.length), t2 >= e2.length && (t2 = e2.length), t2 || (t2 = 0), r2 > 0 && r2 < n2 && (r2 = n2), r2 === n2) + return 0; + if (0 === e2.length || 0 === this.length) + return 0; + if (t2 < 0) + throw new RangeError("targetStart out of bounds"); + if (n2 < 0 || n2 >= this.length) + throw new RangeError("sourceStart out of bounds"); + if (r2 < 0) + throw new RangeError("sourceEnd out of bounds"); + r2 > this.length && (r2 = this.length), e2.length - t2 < r2 - n2 && (r2 = e2.length - t2 + n2); + var i2, o2 = r2 - n2; + if (this === e2 && n2 < t2 && t2 < r2) + for (i2 = o2 - 1; i2 >= 0; --i2) + e2[i2 + t2] = this[i2 + n2]; + else if (o2 < 1e3 || !nE.TYPED_ARRAY_SUPPORT) + for (i2 = 0; i2 < o2; ++i2) + e2[i2 + t2] = this[i2 + n2]; + else + Uint8Array.prototype.set.call(e2, this.subarray(n2, n2 + o2), t2); + return o2; + }, nE.prototype.fill = function(e2, t2, n2, r2) { + if ("string" == typeof e2) { + if ("string" == typeof t2 ? (r2 = t2, t2 = 0, n2 = this.length) : "string" == typeof n2 && (r2 = n2, n2 = this.length), 1 === e2.length) { + var i2 = e2.charCodeAt(0); + i2 < 256 && (e2 = i2); + } + if (void 0 !== r2 && "string" != typeof r2) + throw new TypeError("encoding must be a string"); + if ("string" == typeof r2 && !nE.isEncoding(r2)) + throw new TypeError("Unknown encoding: " + r2); + } else + "number" == typeof e2 && (e2 &= 255); + if (t2 < 0 || this.length < t2 || this.length < n2) + throw new RangeError("Out of range index"); + if (n2 <= t2) + return this; + var o2; + if (t2 >>>= 0, n2 = void 0 === n2 ? this.length : n2 >>> 0, e2 || (e2 = 0), "number" == typeof e2) + for (o2 = t2; o2 < n2; ++o2) + this[o2] = e2; + else { + var a2 = uE(e2) ? e2 : DE(new nE(e2, r2).toString()), s2 = a2.length; + for (o2 = 0; o2 < n2 - t2; ++o2) + this[o2 + t2] = a2[o2 % s2]; + } + return this; + }; + var OE = /[^+\/0-9A-Za-z-_]/g; + function NE(e2) { + return e2 < 16 ? "0" + e2.toString(16) : e2.toString(16); + } + function DE(e2, t2) { + var n2; + t2 = t2 || 1 / 0; + for (var r2 = e2.length, i2 = null, o2 = [], a2 = 0; a2 < r2; ++a2) { + if ((n2 = e2.charCodeAt(a2)) > 55295 && n2 < 57344) { + if (!i2) { + if (n2 > 56319) { + (t2 -= 3) > -1 && o2.push(239, 191, 189); + continue; + } + if (a2 + 1 === r2) { + (t2 -= 3) > -1 && o2.push(239, 191, 189); + continue; + } + i2 = n2; + continue; + } + if (n2 < 56320) { + (t2 -= 3) > -1 && o2.push(239, 191, 189), i2 = n2; + continue; + } + n2 = 65536 + (i2 - 55296 << 10 | n2 - 56320); + } else + i2 && (t2 -= 3) > -1 && o2.push(239, 191, 189); + if (i2 = null, n2 < 128) { + if ((t2 -= 1) < 0) + break; + o2.push(n2); + } else if (n2 < 2048) { + if ((t2 -= 2) < 0) + break; + o2.push(n2 >> 6 | 192, 63 & n2 | 128); + } else if (n2 < 65536) { + if ((t2 -= 3) < 0) + break; + o2.push(n2 >> 12 | 224, n2 >> 6 & 63 | 128, 63 & n2 | 128); + } else { + if (!(n2 < 1114112)) + throw new Error("Invalid code point"); + if ((t2 -= 4) < 0) + break; + o2.push(n2 >> 18 | 240, n2 >> 12 & 63 | 128, n2 >> 6 & 63 | 128, 63 & n2 | 128); + } + } + return o2; + } + function jE(e2) { + return function(e3) { + var t2, n2, r2, i2, o2, a2; + $S || VS(); + var s2 = e3.length; + if (s2 % 4 > 0) + throw new Error("Invalid string. Length must be a multiple of 4"); + o2 = "=" === e3[s2 - 2] ? 2 : "=" === e3[s2 - 1] ? 1 : 0, a2 = new WS(3 * s2 / 4 - o2), r2 = o2 > 0 ? s2 - 4 : s2; + var u2 = 0; + for (t2 = 0, n2 = 0; t2 < r2; t2 += 4, n2 += 3) + i2 = HS[e3.charCodeAt(t2)] << 18 | HS[e3.charCodeAt(t2 + 1)] << 12 | HS[e3.charCodeAt(t2 + 2)] << 6 | HS[e3.charCodeAt(t2 + 3)], a2[u2++] = i2 >> 16 & 255, a2[u2++] = i2 >> 8 & 255, a2[u2++] = 255 & i2; + return 2 === o2 ? (i2 = HS[e3.charCodeAt(t2)] << 2 | HS[e3.charCodeAt(t2 + 1)] >> 4, a2[u2++] = 255 & i2) : 1 === o2 && (i2 = HS[e3.charCodeAt(t2)] << 10 | HS[e3.charCodeAt(t2 + 1)] << 4 | HS[e3.charCodeAt(t2 + 2)] >> 2, a2[u2++] = i2 >> 8 & 255, a2[u2++] = 255 & i2), a2; + }(function(e3) { + if ((e3 = function(e4) { + return e4.trim ? e4.trim() : e4.replace(/^\s+|\s+$/g, ""); + }(e3).replace(OE, "")).length < 2) + return ""; + for (; e3.length % 4 != 0; ) + e3 += "="; + return e3; + }(e2)); + } + function BE(e2, t2, n2, r2) { + for (var i2 = 0; i2 < r2 && !(i2 + n2 >= t2.length || i2 >= e2.length); ++i2) + t2[i2 + n2] = e2[i2]; + return i2; + } + function zE(e2) { + return !!e2.constructor && "function" == typeof e2.constructor.isBuffer && e2.constructor.isBuffer(e2); + } + class UE { + constructor(e2) { + this.enabled = true, (null == e2 ? void 0 : e2.debug) && LS.enable("Ecies:Layer"), (null == e2 ? void 0 : e2.privateKey) ? this.ecies = se.PrivateKey.fromHex(e2.privateKey) : this.ecies = new se.PrivateKey(), jS.Ecies("[ECIES constructor()] initialized secret: ", this.ecies.toHex()), jS.Ecies("[ECIES constructor()] initialized public: ", this.ecies.publicKey.toHex()), jS.Ecies("[ECIES constructor()] init with", this); + } + generateECIES() { + this.ecies = new se.PrivateKey(); + } + getPublicKey() { + return this.ecies.publicKey.toHex(); + } + encrypt(e2, t2) { + let n2 = e2; + if (this.enabled) + try { + jS.Ecies("[ECIES: encrypt()] using otherPublicKey", t2); + const r2 = nE.from(e2), i2 = se.encrypt(t2, r2); + n2 = nE.from(i2).toString("base64"); + } catch (n3) { + throw jS.Ecies("[ECIES: encrypt()] error encrypt:", n3), jS.Ecies("[ECIES: encrypt()] private: ", this.ecies.toHex()), jS.Ecies("[ECIES: encrypt()] data: ", e2), jS.Ecies("[ECIES: encrypt()] otherkey: ", t2), n3; + } + return n2; + } + decrypt(e2) { + let t2 = e2; + if (this.enabled) + try { + jS.Ecies("[ECIES: decrypt()] using privateKey", this.ecies.toHex()); + const n2 = nE.from(e2.toString(), "base64"); + t2 = se.decrypt(this.ecies.toHex(), n2).toString(); + } catch (t3) { + throw jS.Ecies("[ECIES: decrypt()] error decrypt", t3), jS.Ecies("[ECIES: decrypt()] private: ", this.ecies.toHex()), jS.Ecies("[ECIES: decrypt()] encryptedData: ", e2), t3; + } + return t2; + } + getKeyInfo() { + return { private: this.ecies.toHex(), public: this.ecies.publicKey.toHex() }; + } + toString() { + jS.Ecies("[ECIES: toString()]", this.getKeyInfo()); + } + } + var FE = { name: "@metamask/sdk-communication-layer", version: "0.30.0", description: "", homepage: "https://github.com/MetaMask/metamask-sdk#readme", bugs: { url: "https://github.com/MetaMask/metamask-sdk/issues" }, repository: { type: "git", url: "https://github.com/MetaMask/metamask-sdk.git", directory: "packages/sdk-communication-layer" }, main: "dist/node/cjs/metamask-sdk-communication-layer.js", unpkg: "dist/browser/umd/metamask-sdk-communication-layer.js", module: "dist/node/es/metamask-sdk-communication-layer.js", browser: "dist/browser/es/metamask-sdk-communication-layer.js", "react-native": "dist/react-native/es/metamask-sdk-communication-layer.js", types: "dist/browser/es/src/index.d.ts", files: ["/dist"], scripts: { build: "rimraf dist && rollup -c --bundleConfigAsCjs", "build:tsc": "tsc", "build:dev": "rimraf dist && NODE_ENV=dev rollup -c --bundleConfigAsCjs", "build:post-tsc": "echo 'N/A'", "build:pre-tsc": "echo 'N/A'", size: "size-limit", clean: "rimraf ./dist", lint: "yarn lint:eslint && yarn lint:misc --check", "lint:changelog": "../../scripts/validate-changelog.sh @metamask/sdk-communication-layer", "lint:eslint": "eslint . --cache --ext js,ts", "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write", "lint:misc": "prettier '**/*.json' '**/*.md' '!CHANGELOG.md' --ignore-path ../../.gitignore", "publish:preview": "yarn npm publish --tag preview", prepack: "../../scripts/prepack.sh", reset: "yarn clean && rimraf ./node_modules/", test: 'jest --testPathIgnorePatterns "/e2e/"', "test:e2e": 'jest --testPathPattern "/e2e/"', "test:coverage": "jest --coverage", "test:ci": 'jest --coverage --passWithNoTests --setupFilesAfterEnv ./jest-preload.js --testPathIgnorePatterns "/e2e/"', "test:dev": "jest", watch: "rollup -c --bundleConfigAsCjs -w" }, dependencies: { bufferutil: "^4.0.8", "date-fns": "^2.29.3", debug: "^4.3.4", "utf-8-validate": "^5.0.2", uuid: "^8.3.2" }, devDependencies: { "@jest/globals": "^29.3.1", "@lavamoat/allow-scripts": "^2.3.1", "@metamask/auto-changelog": "3.1.0", "@metamask/eslint-config": "^6.0.0", "@metamask/eslint-config-nodejs": "^6.0.0", "@metamask/eslint-config-typescript": "^6.0.0", "@rollup/plugin-commonjs": "^25.0.0", "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-node-resolve": "^15.0.2", "@rollup/plugin-terser": "^0.4.1", "@size-limit/preset-big-lib": "^11.0.2", "@types/jest": "^29.2.4", "@types/node": "^20.1.3", "@types/uuid": "^9.0.0", "@typescript-eslint/eslint-plugin": "^4.26.0", "@typescript-eslint/parser": "^4.26.0", "cross-fetch": "^4.0.0", eciesjs: "^0.3.16", eslint: "^7.30.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.23.4", "eslint-plugin-jest": "^24.4.0", "eslint-plugin-jsdoc": "^36.1.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^3.4.0", eventemitter2: "^6.4.7", jest: "^29.3.1", prettier: "^2.3.0", rimraf: "^3.0.2", rollup: "^3.21.7", "rollup-plugin-jscc": "^2.0.0", "rollup-plugin-natives": "^0.7.5", "rollup-plugin-node-builtins": "^2.1.2", "rollup-plugin-node-globals": "^1.4.0", "rollup-plugin-peer-deps-external": "^2.2.4", "rollup-plugin-sizes": "^1.0.6", "rollup-plugin-typescript2": "^0.31.2", "rollup-plugin-visualizer": "^5.9.2", "size-limit": "^11.0.2", "socket.io-client": "^4.5.1", "stream-browserify": "^3.0.0", "ts-jest": "^29.0.3", "ts-node": "^10.9.1", typescript: "^4.3.2" }, peerDependencies: { "cross-fetch": "^4.0.0", eciesjs: "^0.3.16", eventemitter2: "^6.4.7", "readable-stream": "^3.6.2", "socket.io-client": "^4.5.1" }, publishConfig: { access: "public", registry: "https://registry.npmjs.org/" }, lavamoat: { allowScripts: { "@lavamoat/preinstall-always-fail": false, canvas: true, "eciesjs>secp256k1": false, "socket.io-client>engine.io-client>ws>bufferutil": false, "socket.io-client>engine.io-client>ws>utf-8-validate": false, bufferutil: false, "utf-8-validate": false } } }; + const KE = "https://metamask-sdk.api.cx.metamask.io/", qE = ["websocket"], HE = 6048e5, WE = 3e3, $E = { METAMASK_GETPROVIDERSTATE: "metamask_getProviderState", ETH_REQUESTACCOUNTS: "eth_requestAccounts" }; + function VE(e2) { + const { context: t2 } = e2; + jS.RemoteCommunication(`[RemoteCommunication: clean()] context=${t2}`), e2.channelConfig = void 0, e2.ready = false, e2.originatorConnectStarted = false; + } + var YE, GE, ZE; + e.ConnectionStatus = void 0, e.EventType = void 0, e.MessageType = void 0, function(e2) { + e2.DISCONNECTED = "disconnected", e2.WAITING = "waiting", e2.TIMEOUT = "timeout", e2.LINKED = "linked", e2.PAUSED = "paused", e2.TERMINATED = "terminated"; + }(e.ConnectionStatus || (e.ConnectionStatus = {})), function(e2) { + e2.KEY_INFO = "key_info", e2.SERVICE_STATUS = "service_status", e2.PROVIDER_UPDATE = "provider_update", e2.RPC_UPDATE = "rpc_update", e2.KEYS_EXCHANGED = "keys_exchanged", e2.JOIN_CHANNEL = "join_channel", e2.PUBLIC_KEY = "public_key", e2.CHANNEL_CREATED = "channel_created", e2.CLIENTS_CONNECTED = "clients_connected", e2.CLIENTS_DISCONNECTED = "clients_disconnected", e2.CLIENTS_WAITING = "clients_waiting", e2.CLIENTS_READY = "clients_ready", e2.REJECTED = "rejected", e2.WALLET_INIT = "wallet_init", e2.CHANNEL_PERSISTENCE = "channel_persistence", e2.CONFIG = "config", e2.MESSAGE_ACK = "ack", e2.SOCKET_DISCONNECTED = "socket_disconnected", e2.SOCKET_RECONNECT = "socket_reconnect", e2.OTP = "otp", e2.SDK_RPC_CALL = "sdk_rpc_call", e2.AUTHORIZED = "authorized", e2.CONNECTION_STATUS = "connection_status", e2.MESSAGE = "message", e2.TERMINATE = "terminate"; + }(e.EventType || (e.EventType = {})), function(e2) { + e2.KEY_EXCHANGE = "key_exchange"; + }(YE || (YE = {})), function(e2) { + e2.KEY_HANDSHAKE_START = "key_handshake_start", e2.KEY_HANDSHAKE_CHECK = "key_handshake_check", e2.KEY_HANDSHAKE_SYN = "key_handshake_SYN", e2.KEY_HANDSHAKE_SYNACK = "key_handshake_SYNACK", e2.KEY_HANDSHAKE_ACK = "key_handshake_ACK", e2.KEY_HANDSHAKE_WALLET = "key_handshake_wallet", e2.KEY_HANDSHAKE_NONE = "none"; + }(GE || (GE = {})); + class QE extends xw.EventEmitter2 { + constructor({ communicationLayer: e2, otherPublicKey: t2, context: n2, ecies: r2, logging: i2 }) { + super(), this.keysExchanged = false, this.step = GE.KEY_HANDSHAKE_NONE, this.debug = false, this.context = n2, this.communicationLayer = e2, (null == r2 ? void 0 : r2.privateKey) && t2 && (jS.KeyExchange(`[KeyExchange: constructor()] otherPubKey=${t2} set keysExchanged to true!`, r2), this.keysExchanged = true), this.myECIES = new UE(Object.assign(Object.assign({}, r2), { debug: null == i2 ? void 0 : i2.eciesLayer })), this.communicationLayer.state.eciesInstance = this.myECIES, this.myPublicKey = this.myECIES.getPublicKey(), this.debug = true === (null == i2 ? void 0 : i2.keyExchangeLayer), t2 && this.setOtherPublicKey(t2), this.communicationLayer.on(YE.KEY_EXCHANGE, this.onKeyExchangeMessage.bind(this)); + } + onKeyExchangeMessage(t2) { + const { relayPersistence: n2 } = this.communicationLayer.remote.state; + if (jS.KeyExchange(`[KeyExchange: onKeyExchangeMessage()] context=${this.context} keysExchanged=${this.keysExchanged} relayPersistence=${n2}`, t2), n2) + return void jS.KeyExchange("[KeyExchange: onKeyExchangeMessage()] Ignoring key exchange message because relay persistence is activated"); + const { message: r2 } = t2; + this.keysExchanged && jS.KeyExchange(`[KeyExchange: onKeyExchangeMessage()] context=${this.context} received handshake while already exchanged. step=${this.step} otherPubKey=${this.otherPublicKey}`), this.emit(e.EventType.KEY_INFO, r2.type), r2.type === GE.KEY_HANDSHAKE_SYN ? (this.checkStep([GE.KEY_HANDSHAKE_NONE, GE.KEY_HANDSHAKE_ACK]), jS.KeyExchange("[KeyExchange: onKeyExchangeMessage()] KEY_HANDSHAKE_SYN", r2), r2.pubkey && this.setOtherPublicKey(r2.pubkey), this.communicationLayer.sendMessage({ type: GE.KEY_HANDSHAKE_SYNACK, pubkey: this.myPublicKey }).catch((e2) => { + jS.KeyExchange("[KeyExchange: onKeyExchangeMessage()] Error sending KEY_HANDSHAKE_SYNACK", e2); + }), this.setStep(GE.KEY_HANDSHAKE_ACK)) : r2.type === GE.KEY_HANDSHAKE_SYNACK ? (this.checkStep([GE.KEY_HANDSHAKE_SYNACK, GE.KEY_HANDSHAKE_ACK, GE.KEY_HANDSHAKE_NONE]), jS.KeyExchange("[KeyExchange: onKeyExchangeMessage()] KEY_HANDSHAKE_SYNACK"), r2.pubkey && this.setOtherPublicKey(r2.pubkey), this.communicationLayer.sendMessage({ type: GE.KEY_HANDSHAKE_ACK }).catch((e2) => { + jS.KeyExchange("[KeyExchange: onKeyExchangeMessage()] Error sending KEY_HANDSHAKE_ACK", e2); + }), this.keysExchanged = true, this.setStep(GE.KEY_HANDSHAKE_ACK), this.emit(e.EventType.KEYS_EXCHANGED)) : r2.type === GE.KEY_HANDSHAKE_ACK && (jS.KeyExchange("[KeyExchange: onKeyExchangeMessage()] KEY_HANDSHAKE_ACK set keysExchanged to true!"), this.checkStep([GE.KEY_HANDSHAKE_ACK, GE.KEY_HANDSHAKE_NONE]), this.keysExchanged = true, this.setStep(GE.KEY_HANDSHAKE_ACK), this.emit(e.EventType.KEYS_EXCHANGED)); + } + resetKeys(e2) { + this.clean(), this.myECIES = new UE(e2); + } + clean() { + jS.KeyExchange(`[KeyExchange: clean()] context=${this.context} reset handshake state`), this.setStep(GE.KEY_HANDSHAKE_NONE), this.emit(e.EventType.KEY_INFO, this.step), this.keysExchanged = false; + } + start({ isOriginator: e2, force: t2 }) { + const { relayPersistence: n2, protocolVersion: r2 } = this.communicationLayer.remote.state, i2 = r2 >= 2; + if (n2) + return jS.KeyExchange("[KeyExchange: start()] Ignoring key exchange message because relay persistence is activated"), void console.log(`[KeyExchange: start()] relayPersistence=${n2}`); + jS.KeyExchange(`[KeyExchange: start()] context=${this.context} protocolVersion=${r2} isOriginator=${e2} step=${this.step} force=${t2} relayPersistence=${n2} keysExchanged=${this.keysExchanged}`), e2 ? !(this.keysExchanged || this.step !== GE.KEY_HANDSHAKE_NONE && this.step !== GE.KEY_HANDSHAKE_SYNACK) || t2 ? (jS.KeyExchange(`[KeyExchange: start()] context=${this.context} -- start key exchange (force=${t2}) -- step=${this.step}`, this.step), this.clean(), this.setStep(GE.KEY_HANDSHAKE_SYNACK), this.communicationLayer.sendMessage({ type: GE.KEY_HANDSHAKE_SYN, pubkey: this.myPublicKey, v: 2 }).catch((e3) => { + jS.KeyExchange("[KeyExchange: start()] Error sending KEY_HANDSHAKE_SYN", e3); + })) : jS.KeyExchange(`[KeyExchange: start()] context=${this.context} -- key exchange already ${this.keysExchanged ? "done" : "in progress"} -- aborted.`, this.step) : this.keysExchanged && true !== t2 ? jS.KeyExchange("[KeyExchange: start()] don't send KEY_HANDSHAKE_START -- exchange already done.") : i2 ? this.communicationLayer.sendMessage({ type: GE.KEY_HANDSHAKE_SYNACK, pubkey: this.myPublicKey, v: 2 }).catch((e3) => { + jS.KeyExchange("[KeyExchange: start()] Error sending KEY_HANDSHAKE_SYNACK", e3); + }) : (this.communicationLayer.sendMessage({ type: GE.KEY_HANDSHAKE_START }).catch((e3) => { + jS.KeyExchange("[KeyExchange: start()] Error sending KEY_HANDSHAKE_START", e3); + }), this.clean()); + } + setStep(t2) { + this.step = t2, this.emit(e.EventType.KEY_INFO, t2); + } + checkStep(e2) { + e2.length > 0 && -1 === e2.indexOf(this.step.toString()) && console.warn(`[KeyExchange: checkStep()] Wrong Step "${this.step}" not within ${e2}`); + } + setRelayPersistence({ localKey: e2, otherKey: t2 }) { + this.otherPublicKey = t2, this.myECIES = new UE({ privateKey: e2, debug: this.debug }), this.keysExchanged = true; + } + setKeysExchanged(e2) { + this.keysExchanged = e2; + } + areKeysExchanged() { + return this.keysExchanged; + } + getMyPublicKey() { + return this.myPublicKey; + } + getOtherPublicKey() { + return this.otherPublicKey; + } + setOtherPublicKey(e2) { + jS.KeyExchange("[KeyExchange: setOtherPubKey()]", e2), this.otherPublicKey = e2; + } + encryptMessage(e2) { + if (!this.otherPublicKey) + throw new Error("encryptMessage: Keys not exchanged - missing otherPubKey"); + return this.myECIES.encrypt(e2, this.otherPublicKey); + } + decryptMessage(e2) { + if (!this.otherPublicKey) + throw new Error("decryptMessage: Keys not exchanged - missing otherPubKey"); + return this.myECIES.decrypt(e2); + } + getKeyInfo() { + return { ecies: Object.assign(Object.assign({}, this.myECIES.getKeyInfo()), { otherPubKey: this.otherPublicKey }), step: this.step, keysExchanged: this.areKeysExchanged() }; + } + toString() { + const e2 = { keyInfo: this.getKeyInfo(), keysExchanged: this.keysExchanged, step: this.step }; + return JSON.stringify(e2); + } + } + !function(e2) { + e2.TERMINATE = "terminate", e2.ANSWER = "answer", e2.OFFER = "offer", e2.CANDIDATE = "candidate", e2.JSONRPC = "jsonrpc", e2.WALLET_INFO = "wallet_info", e2.WALLET_INIT = "wallet_init", e2.ORIGINATOR_INFO = "originator_info", e2.PAUSE = "pause", e2.OTP = "otp", e2.AUTHORIZED = "authorized", e2.PING = "ping", e2.READY = "ready"; + }(e.MessageType || (e.MessageType = {})), function(e2) { + e2.REQUEST = "sdk_connect_request_started", e2.REQUEST_MOBILE = "sdk_connect_request_started_mobile", e2.RECONNECT = "sdk_reconnect_request_started", e2.CONNECTED = "sdk_connection_established", e2.CONNECTED_MOBILE = "sdk_connection_established_mobile", e2.AUTHORIZED = "sdk_connection_authorized", e2.REJECTED = "sdk_connection_rejected", e2.TERMINATED = "sdk_connection_terminated", e2.DISCONNECTED = "sdk_disconnected", e2.SDK_USE_EXTENSION = "sdk_use_extension", e2.SDK_RPC_REQUEST = "sdk_rpc_request", e2.SDK_RPC_REQUEST_RECEIVED = "sdk_rpc_request_received", e2.SDK_RPC_REQUEST_DONE = "sdk_rpc_request_done", e2.SDK_EXTENSION_UTILIZED = "sdk_extension_utilized", e2.SDK_USE_INAPP_BROWSER = "sdk_use_inapp_browser"; + }(ZE || (ZE = {})); + const JE = (t2, n2, r2) => nS(void 0, void 0, void 0, function* () { + var i2, o2, a2, s2, u2, l2; + const { remote: c2, state: d2 } = t2, { channelId: f2, isOriginator: h2 } = d2; + if ("error_terminated" === n2) + return jS.SocketService(`handleJoinChannelResults: Channel ${f2} terminated`), void t2.emit(e.EventType.TERMINATE); + if (!r2) + return void jS.SocketService(`handleJoinChannelResults: No result for channel ${f2}`); + const { persistence: p2, walletKey: m2, rejected: g2 } = r2; + if (jS.SocketService(`handleJoinChannelResults: Channel ${f2} persistence=${p2} walletKey=${m2} rejected=${g2}`), g2) + return jS.SocketService(`handleJoinChannelResults: Channel ${f2} rejected`), yield t2.remote.disconnect({ terminate: true }), t2.remote.emit(e.EventType.REJECTED, { channelId: f2 }), void t2.remote.emitServiceStatusEvent(); + if (m2 && !(null === (i2 = c2.state.channelConfig) || void 0 === i2 ? void 0 : i2.otherKey)) { + t2.getKeyExchange().setOtherPublicKey(m2), null === (o2 = t2.state.keyExchange) || void 0 === o2 || o2.setKeysExchanged(true), c2.state.ready = true, c2.state.authorized = true, c2.emit(e.EventType.AUTHORIZED); + const { communicationLayer: n3, storageManager: r3 } = c2.state, i3 = Object.assign(Object.assign({}, c2.state.channelConfig), { channelId: null !== (a2 = c2.state.channelId) && void 0 !== a2 ? a2 : "", validUntil: Date.now() + HE, localKey: null == n3 ? void 0 : n3.getKeyInfo().ecies.private, otherKey: m2 }); + t2.sendMessage({ type: GE.KEY_HANDSHAKE_ACK }).catch((e2) => { + console.error(e2); + }), null === (s2 = t2.state.socket) || void 0 === s2 || s2.emit(e.MessageType.PING, { id: f2, clientType: h2 ? "dapp" : "wallet", context: "on_channel_reconnect", message: "" }), yield null == r3 ? void 0 : r3.persistChannelConfig(i3), c2.emitServiceStatusEvent(), c2.setConnectionStatus(e.ConnectionStatus.LINKED); + } + p2 && (t2.emit(e.EventType.CHANNEL_PERSISTENCE), null === (u2 = t2.state.keyExchange) || void 0 === u2 || u2.setKeysExchanged(true), c2.state.ready = true, c2.state.authorized = true, c2.emit(e.EventType.AUTHORIZED), KS(Object.assign(Object.assign({ id: null != f2 ? f2 : "", event: h2 ? ZE.CONNECTED : ZE.CONNECTED_MOBILE }, t2.remote.state.originatorInfo), { sdkVersion: t2.remote.state.sdkVersion, commLayer: t2.state.communicationLayerPreference, commLayerVersion: FE.version, walletVersion: null === (l2 = t2.remote.state.walletInfo) || void 0 === l2 ? void 0 : l2.version }), d2.communicationServerUrl).catch((e2) => { + console.error("Cannot send analytics", e2); + })); + }), XE = (e2) => new Promise((t2) => { + setTimeout(t2, e2); + }), ek = (e2, t2, n2 = 200) => nS(void 0, void 0, void 0, function* () { + let r2; + const i2 = Date.now(); + let o2 = false; + for (; !o2; ) { + if (o2 = Date.now() - i2 > 3e5, r2 = t2[e2], void 0 !== r2.elapsedTime) + return r2; + yield XE(n2); + } + throw new Error(`RPC ${e2} timed out`); + }), tk = (t2) => nS(void 0, void 0, void 0, function* () { + const { state: n2 } = t2, { socket: r2, channelId: i2, context: o2, isOriginator: a2, isReconnecting: s2 } = n2; + if (s2) + return jS.SocketService("[SocketService: reconnectSocket()] Reconnection already in progress, skipping", t2), false; + if (!r2) + return jS.SocketService("[SocketService: reconnectSocket()] socket is not defined", t2), false; + if (!i2) + return false; + const { connected: u2 } = r2; + n2.isReconnecting = true, n2.reconnectionAttempts = 0, jS.SocketService(`[SocketService: reconnectSocket()] connected=${u2} trying to reconnect after socketio disconnection`, t2); + try { + for (; n2.reconnectionAttempts < 3; ) { + if (jS.SocketService(`[SocketService: reconnectSocket()] Attempt ${n2.reconnectionAttempts + 1} of 3`, t2), yield XE(200), r2.connected) + return jS.SocketService("Socket already connected --- ping to retrieve messages"), r2.emit(e.MessageType.PING, { id: i2, clientType: a2 ? "dapp" : "wallet", context: "on_channel_config", message: "" }), true; + n2.resumed = true, r2.connect(), t2.emit(e.EventType.SOCKET_RECONNECT); + try { + if (yield new Promise((n3, s3) => { + r2.emit(e.EventType.JOIN_CHANNEL, { channelId: i2, context: `${o2}connect_again`, clientType: a2 ? "dapp" : "wallet" }, (e2, r3) => nS(void 0, void 0, void 0, function* () { + try { + yield JE(t2, e2, r3), n3(); + } catch (e3) { + s3(e3); + } + })); + }), yield XE(100), r2.connected) + return jS.SocketService(`Reconnection successful on attempt ${n2.reconnectionAttempts + 1}`), true; + } catch (e2) { + jS.SocketService(`Error during reconnection attempt ${n2.reconnectionAttempts + 1}:`, e2); + } + n2.reconnectionAttempts += 1, n2.reconnectionAttempts < 3 && (yield XE(200)); + } + return jS.SocketService("Failed to reconnect after 3 attempts"), false; + } finally { + n2.isReconnecting = false, n2.reconnectionAttempts = 0; + } + }); + function nk(t2, n2) { + var r2; + return nS(this, void 0, void 0, function* () { + const i2 = null === (r2 = t2.state.keyExchange) || void 0 === r2 ? void 0 : r2.encryptMessage(JSON.stringify(n2)), o2 = { id: t2.state.channelId, context: t2.state.context, clientType: t2.state.isOriginator ? "dapp" : "wallet", message: i2, plaintext: t2.state.hasPlaintext ? JSON.stringify(n2) : void 0 }; + return jS.SocketService(`[SocketService: encryptAndSendMessage()] context=${t2.state.context}`, o2), n2.type === e.MessageType.TERMINATE && (t2.state.manualDisconnect = true), new Promise((n3, r3) => { + var i3; + null === (i3 = t2.state.socket) || void 0 === i3 || i3.emit(e.EventType.MESSAGE, o2, (e2, t3) => { + var i4; + e2 && (jS.SocketService(`[SocketService: encryptAndSendMessage()] error=${e2}`), r3(e2)), jS.SocketService("[encryptAndSendMessage] response", t3), n3(null !== (i4 = null == t3 ? void 0 : t3.success) && void 0 !== i4 && i4); + }); + }); + }); + } + var rk; + !function(e2) { + e2.RPC_CHECK = "rpcCheck", e2.SKIPPED_RPC = "skippedRpc"; + }(rk || (rk = {})); + const ik = ["eth_sendTransaction", "eth_signTypedData", "eth_signTransaction", "personal_sign", "wallet_requestPermissions", "wallet_switchEthereumChain", "eth_signTypedData_v3", "eth_signTypedData_v4", "metamask_connectSign", "metamask_connectWith", "metamask_batch"].map((e2) => e2.toLowerCase()); + function ok(t2, n2) { + var r2, i2, o2; + return nS(this, void 0, void 0, function* () { + if (!t2.state.channelId) + throw jS.SocketService("handleSendMessage: no channelId - Create a channel first"), new Error("Create a channel first"); + if (jS.SocketService(`[SocketService: handleSendMessage()] context=${t2.state.context} areKeysExchanged=${null === (r2 = t2.state.keyExchange) || void 0 === r2 ? void 0 : r2.areKeysExchanged()}`, n2), null === (i2 = null == n2 ? void 0 : n2.type) || void 0 === i2 ? void 0 : i2.startsWith("key_handshake")) + return function(t3, n3) { + var r3; + jS.SocketService(`[SocketService: handleKeyHandshake()] context=${t3.state.context}`, n3), null === (r3 = t3.state.socket) || void 0 === r3 || r3.emit(e.EventType.MESSAGE, { id: t3.state.channelId, context: t3.state.context, clientType: t3.state.isOriginator ? "dapp" : "wallet", message: n3 }); + }(t2, n2), true; + !function(e2, t3) { + var n3; + if (!(null === (n3 = e2.state.keyExchange) || void 0 === n3 ? void 0 : n3.areKeysExchanged()) && !e2.remote.state.relayPersistence) + throw jS.SocketService(`[SocketService: validateKeyExchange()] context=${e2.state.context} ERROR keys not exchanged`, t3), console.error("[SocketService: validateKeyExchange()] ERROR keys not exchanged", t3), new Error("Keys not exchanged BBB"); + }(t2, n2), function(t3, n3) { + var r3; + const i3 = null !== (r3 = null == n3 ? void 0 : n3.method) && void 0 !== r3 ? r3 : "", o3 = null == n3 ? void 0 : n3.id; + t3.state.isOriginator && o3 && (t3.state.rpcMethodTracker[o3] = { id: o3, timestamp: Date.now(), method: i3 }, t3.emit(e.EventType.RPC_UPDATE, t3.state.rpcMethodTracker[o3])); + }(t2, n2); + const a2 = yield nk(t2, n2); + return t2.remote.state.analytics && t2.remote.state.isOriginator && n2.method && ik.includes(n2.method.toLowerCase()) && KS({ id: null !== (o2 = t2.remote.state.channelId) && void 0 !== o2 ? o2 : "", event: ZE.SDK_RPC_REQUEST, params: { method: n2.method, from: "mobile" } }, t2.remote.state.communicationServerUrl).catch((e2) => { + console.error("[handleSendMessage] Cannot send analytics", e2); + }), function(t3, n3) { + var r3; + return nS(this, void 0, void 0, function* () { + const i3 = null == n3 ? void 0 : n3.id, o3 = null !== (r3 = null == n3 ? void 0 : n3.method) && void 0 !== r3 ? r3 : ""; + if (t3.state.isOriginator && i3) + try { + const r4 = ek(i3, t3.state.rpcMethodTracker, 200).then((e2) => ({ type: rk.RPC_CHECK, result: e2 })), a3 = (() => nS(this, void 0, void 0, function* () { + const e2 = yield (({ rpcId: e3, instance: t4 }) => nS(void 0, void 0, void 0, function* () { + for (; t4.state.lastRpcId === e3 || void 0 === t4.state.lastRpcId; ) + yield XE(200); + return t4.state.lastRpcId; + }))({ instance: t3, rpcId: i3 }), n4 = yield ek(e2, t3.state.rpcMethodTracker, 200); + return { type: rk.SKIPPED_RPC, result: n4 }; + }))(), s2 = yield Promise.race([r4, a3]); + if (s2.type === rk.RPC_CHECK) { + const e2 = s2.result; + jS.SocketService(`[SocketService:handleRpcReplies()] id=${n3.id} ${o3} ( ${e2.elapsedTime} ms)`, e2.result); + } else { + if (s2.type !== rk.SKIPPED_RPC) + throw new Error(`Error handling RPC replies for ${i3}`); + { + const { result: n4 } = s2; + console.warn(`[SocketService handleRpcReplies()] RPC METHOD HAS BEEN SKIPPED rpcid=${i3} method=${o3}`, n4); + const r5 = Object.assign(Object.assign({}, t3.state.rpcMethodTracker[i3]), { error: new Error("SDK_CONNECTION_ISSUE") }); + t3.emit(e.EventType.RPC_UPDATE, r5); + const a4 = { data: Object.assign(Object.assign({}, r5), { jsonrpc: "2.0" }), name: "metamask-provider" }; + t3.emit(e.EventType.MESSAGE, { message: a4 }); + } + } + } catch (e2) { + throw console.warn(`[SocketService handleRpcReplies()] Error rpcId=${n3.id} ${o3}`, e2), e2; + } + }); + }(t2, n2).catch((e2) => { + console.warn("[handleSendMessage] Error handleRpcReplies", e2); + }), a2; + }); + } + const ak = [{ event: e.EventType.CLIENTS_CONNECTED, handler: function(t2, n2) { + return (r2) => nS(this, void 0, void 0, function* () { + var r3, i2, o2, a2, s2, u2, l2, c2, d2, f2, h2; + const p2 = null !== (i2 = null === (r3 = t2.remote.state.channelConfig) || void 0 === r3 ? void 0 : r3.relayPersistence) && void 0 !== i2 && i2; + if (jS.SocketService(`[SocketService: handleClientsConnected()] context=${t2.state.context} on 'clients_connected-${n2}' relayPersistence=${p2} resumed=${t2.state.resumed} clientsPaused=${t2.state.clientsPaused} keysExchanged=${null === (o2 = t2.state.keyExchange) || void 0 === o2 ? void 0 : o2.areKeysExchanged()} isOriginator=${t2.state.isOriginator}`), t2.emit(e.EventType.CLIENTS_CONNECTED, { isOriginator: t2.state.isOriginator, keysExchanged: null === (a2 = t2.state.keyExchange) || void 0 === a2 ? void 0 : a2.areKeysExchanged(), context: t2.state.context }), t2.state.resumed) + t2.state.isOriginator || (jS.SocketService(`[SocketService: handleClientsConnected()] context=${t2.state.context} 'clients_connected' / keysExchanged=${null === (s2 = t2.state.keyExchange) || void 0 === s2 ? void 0 : s2.areKeysExchanged()} -- backward compatibility`), null === (u2 = t2.state.keyExchange) || void 0 === u2 || u2.start({ isOriginator: null !== (l2 = t2.state.isOriginator) && void 0 !== l2 && l2 })), t2.state.resumed = false; + else if (t2.state.clientsPaused) + jS.SocketService("[SocketService: handleClientsConnected()] 'clients_connected' skip sending originatorInfo on pause"); + else if (!t2.state.isOriginator) { + const e2 = !p2; + jS.SocketService(`[SocketService: handleClientsConnected()] context=${t2.state.context} on 'clients_connected' / keysExchanged=${null === (c2 = t2.state.keyExchange) || void 0 === c2 ? void 0 : c2.areKeysExchanged()} -- force=${e2} -- backward compatibility`), jS.SocketService(`[SocketService: handleClientsConnected()] context=${t2.state.context} on 'clients_connected' / keysExchanged=${null === (d2 = t2.state.keyExchange) || void 0 === d2 ? void 0 : d2.areKeysExchanged()} -- force=${e2} -- backward compatibility`), null === (f2 = t2.state.keyExchange) || void 0 === f2 || f2.start({ isOriginator: null !== (h2 = t2.state.isOriginator) && void 0 !== h2 && h2, force: e2 }); + } + t2.state.clientsConnected = true, t2.state.clientsPaused = false; + }); + } }, { event: e.EventType.CHANNEL_CREATED, handler: function(t2, n2) { + return (r2) => { + jS.SocketService(`[SocketService: handleChannelCreated()] context=${t2.state.context} on 'channel_created-${n2}'`, r2), t2.emit(e.EventType.CHANNEL_CREATED, r2); + }; + } }, { event: e.EventType.CLIENTS_DISCONNECTED, handler: function(t2, n2) { + return () => { + var r2; + t2.state.clientsConnected = false, jS.SocketService(`[SocketService: handlesClientsDisconnected()] context=${t2.state.context} on 'clients_disconnected-${n2}'`), t2.remote.state.relayPersistence ? jS.SocketService(`[SocketService: handlesClientsDisconnected()] context=${t2.state.context} on 'clients_disconnected-${n2}' - relayPersistence enabled, skipping key exchange cleanup.`) : (t2.state.isOriginator && !t2.state.clientsPaused && (null === (r2 = t2.state.keyExchange) || void 0 === r2 || r2.clean()), t2.emit(e.EventType.CLIENTS_DISCONNECTED, n2)); + }; + } }, { event: e.EventType.CONFIG, handler: function(t2, n2) { + return (r2) => nS(this, void 0, void 0, function* () { + var i2, o2, a2; + jS.SocketService(`[SocketService: handleChannelConfig()] update relayPersistence on 'config-${n2}'`, r2); + const { persistence: s2, walletKey: u2 } = r2; + t2.state.isOriginator && t2.remote.state.channelConfig ? (r2.walletKey && !t2.remote.state.channelConfig.otherKey && (jS.SocketService(`Setting wallet key ${u2}`), t2.remote.state.channelConfig.otherKey = u2, t2.getKeyExchange().setOtherPublicKey(r2.walletKey), null === (i2 = t2.state.keyExchange) || void 0 === i2 || i2.setKeysExchanged(true), yield t2.remote.sendMessage({ type: GE.KEY_HANDSHAKE_ACK }), yield t2.remote.sendMessage({ type: e.MessageType.PING }), yield null === (o2 = t2.remote.state.storageManager) || void 0 === o2 ? void 0 : o2.persistChannelConfig(t2.remote.state.channelConfig)), true !== s2 || t2.remote.state.channelConfig.relayPersistence || (jS.SocketService(`Setting relay persistence ${s2}`), t2.remote.state.channelConfig.relayPersistence = s2, t2.remote.state.relayPersistence = true, t2.remote.emit(e.EventType.CHANNEL_PERSISTENCE), t2.remote.state.authorized = true, t2.remote.state.ready = true, t2.remote.emit(e.EventType.AUTHORIZED), yield null === (a2 = t2.remote.state.storageManager) || void 0 === a2 ? void 0 : a2.persistChannelConfig(t2.remote.state.channelConfig))) : t2.state.isOriginator || r2.persistence && (t2.remote.state.relayPersistence = true, t2.remote.emit(e.EventType.CHANNEL_PERSISTENCE)); + }); + } }, { event: e.EventType.MESSAGE, handler: function(t2, n2) { + return (r2) => { + var i2, o2, a2, s2, u2, l2, c2, d2, f2, h2, p2, m2, g2, v2, b2, y2, w2, _2; + const { ackId: S2, message: E2, error: k2 } = r2, M2 = null !== (i2 = t2.remote.state.relayPersistence) && void 0 !== i2 && i2; + if (jS.SocketService(`[SocketService handleMessage()] relayPersistence=${M2} context=${t2.state.context} on 'message' ${n2} keysExchanged=${null === (o2 = t2.state.keyExchange) || void 0 === o2 ? void 0 : o2.areKeysExchanged()}`, r2), k2) + throw jS.SocketService(` + [SocketService handleMessage()] context=${t2.state.context}::on 'message' error=${k2}`), new Error(k2); + const C2 = "string" == typeof E2; + if (!C2 && (null == E2 ? void 0 : E2.type) === GE.KEY_HANDSHAKE_START) + return M2 ? void console.warn("[SocketService handleMessage()] Ignoring key exchange message because relay persistence is activated", E2) : (jS.SocketService(`[SocketService handleMessage()] context=${t2.state.context}::on 'message' received HANDSHAKE_START isOriginator=${t2.state.isOriginator}`, E2), void (null === (a2 = t2.state.keyExchange) || void 0 === a2 || a2.start({ isOriginator: null !== (s2 = t2.state.isOriginator) && void 0 !== s2 && s2, force: true }))); + if (!C2 && (null === (u2 = null == E2 ? void 0 : E2.type) || void 0 === u2 ? void 0 : u2.startsWith("key_handshake"))) + return M2 ? void console.warn("[SocketService handleMessage()] Ignoring key exchange message because relay persistence is activated", E2) : (jS.SocketService(`[SocketService handleMessage()] context=${t2.state.context}::on 'message' emit KEY_EXCHANGE`, E2), void t2.emit(YE.KEY_EXCHANGE, { message: E2, context: t2.state.context })); + if (C2 && !(null === (l2 = t2.state.keyExchange) || void 0 === l2 ? void 0 : l2.areKeysExchanged())) { + let e2 = false; + try { + jS.SocketService(`[SocketService handleMessage()] context=${t2.state.context}::on 'message' trying to decrypt message`), null === (c2 = t2.state.keyExchange) || void 0 === c2 || c2.decryptMessage(E2), e2 = true; + } catch (e3) { + jS.SocketService(`[SocketService handleMessage()] context=${t2.state.context}::on 'message' error`, e3); + } + if (!e2) + return t2.state.isOriginator ? null === (f2 = t2.state.keyExchange) || void 0 === f2 || f2.start({ isOriginator: null !== (h2 = t2.state.isOriginator) && void 0 !== h2 && h2 }) : t2.sendMessage({ type: GE.KEY_HANDSHAKE_START }).catch((e3) => { + console.error(`[SocketService handleMessage()] context=${t2.state.context}::on 'message' error`, e3); + }), void jS.SocketService(`Message ignored because invalid key exchange status. step=${null === (p2 = t2.state.keyExchange) || void 0 === p2 ? void 0 : p2.getKeyInfo().step}`, null === (m2 = t2.state.keyExchange) || void 0 === m2 ? void 0 : m2.getKeyInfo(), E2); + jS.SocketService("Invalid key exchange status detected --- updating it."), null === (d2 = t2.state.keyExchange) || void 0 === d2 || d2.setKeysExchanged(true); + } else if (!C2 && (null == E2 ? void 0 : E2.type)) + return console.warn("[SocketService handleMessage() ::on 'message' received non encrypted unkwown message"), void t2.emit(e.EventType.MESSAGE, E2); + if (!C2) + return console.warn("[SocketService handleMessage() ::on 'message' received unkwown message", E2), void t2.emit(e.EventType.MESSAGE, E2); + const x2 = null === (g2 = t2.state.keyExchange) || void 0 === g2 ? void 0 : g2.decryptMessage(E2), A2 = JSON.parse(null != x2 ? x2 : "{}"); + if (S2 && (null == S2 ? void 0 : S2.length) > 0 && (jS.SocketService(`[SocketService handleMessage()] context=${t2.state.context}::on 'message' ackid=${S2} channelId=${n2}`), null === (v2 = t2.state.socket) || void 0 === v2 || v2.emit(e.EventType.MESSAGE_ACK, { ackId: S2, channelId: n2, clientType: t2.state.isOriginator ? "dapp" : "wallet" })), (null == A2 ? void 0 : A2.type) === e.MessageType.PAUSE ? t2.state.clientsPaused = true : t2.state.clientsPaused = false, t2.state.isOriginator && A2.data) { + const n3 = A2.data, r3 = t2.state.rpcMethodTracker[n3.id]; + if (r3) { + const i3 = Date.now() - r3.timestamp; + jS.SocketService(`[SocketService handleMessage()] context=${t2.state.context}::on 'message' received answer for id=${n3.id} method=${r3.method} responseTime=${i3}`, A2), t2.remote.state.analytics && ik.includes(r3.method.toLowerCase()) && KS(Object.assign(Object.assign({ id: null !== (b2 = t2.remote.state.channelId) && void 0 !== b2 ? b2 : "", event: ZE.SDK_RPC_REQUEST_DONE, sdkVersion: t2.remote.state.sdkVersion, commLayerVersion: FE.version }, t2.remote.state.originatorInfo), { walletVersion: null === (y2 = t2.remote.state.walletInfo) || void 0 === y2 ? void 0 : y2.version, params: { method: r3.method, from: "mobile" } }), t2.remote.state.communicationServerUrl).catch((e2) => { + console.error("Cannot send analytics", e2); + }); + const o3 = Object.assign(Object.assign({}, r3), { result: n3.result, error: n3.error ? { code: null === (w2 = n3.error) || void 0 === w2 ? void 0 : w2.code, message: null === (_2 = n3.error) || void 0 === _2 ? void 0 : _2.message } : void 0, elapsedTime: i3 }); + t2.state.rpcMethodTracker[n3.id] = o3, t2.emit(e.EventType.RPC_UPDATE, o3); + } + } + t2.emit(e.EventType.MESSAGE, { message: A2 }); + }; + } }, { event: e.EventType.REJECTED, handler: function(t2, n2) { + return (r2) => nS(this, void 0, void 0, function* () { + var r3; + t2.state.isOriginator && !t2.remote.state.ready ? (jS.SocketService(`[SocketService: handleChannelRejected()] context=${t2.state.context} channelId=${n2} isOriginator=${t2.state.isOriginator} ready=${t2.remote.state.ready}`, t2.remote.state.originatorInfo), KS(Object.assign(Object.assign({ id: n2, event: ZE.REJECTED }, t2.remote.state.originatorInfo), { sdkVersion: t2.remote.state.sdkVersion, commLayer: t2.state.communicationLayerPreference, commLayerVersion: FE.version, walletVersion: null === (r3 = t2.remote.state.walletInfo) || void 0 === r3 ? void 0 : r3.version }), t2.remote.state.communicationServerUrl).catch((e2) => { + console.error("handleChannelRejected:: Error emitting analytics event", e2); + }), yield t2.remote.disconnect({ terminate: true }), t2.remote.emit(e.EventType.REJECTED, { channelId: n2 }), t2.remote.setConnectionStatus(e.ConnectionStatus.DISCONNECTED)) : jS.SocketService(`[SocketService: handleChannelRejected()] SKIP -- channelId=${n2} isOriginator=${t2.state.isOriginator} ready=${t2.remote.state.ready}`); + }); + } }, { event: "clients_waiting_to_join", handler: function(t2, n2) { + return (r2) => { + jS.SocketService(`[SocketService: handleClientsWaitingToJoin()] context=${t2.state.context} on 'clients_waiting_to_join-${n2}'`, r2), t2.emit(e.EventType.CLIENTS_WAITING, r2); + }; + } }], sk = [{ event: e.EventType.KEY_INFO, handler: function(t2) { + return (n2) => { + jS.SocketService("[SocketService: handleKeyInfo()] on 'KEY_INFO'", n2), t2.emit(e.EventType.KEY_INFO, n2); + }; + } }, { event: e.EventType.KEYS_EXCHANGED, handler: function(t2) { + return () => { + var n2, r2, i2; + jS.SocketService(`[SocketService: handleKeysExchanged()] on 'keys_exchanged' keyschanged=${null === (n2 = t2.state.keyExchange) || void 0 === n2 ? void 0 : n2.areKeysExchanged()}`); + const { channelConfig: o2 } = t2.remote.state; + if (o2) { + const e2 = t2.getKeyExchange().getKeyInfo().ecies; + o2.localKey = e2.private, o2.otherKey = e2.otherPubKey, t2.remote.state.channelConfig = o2, null === (r2 = t2.remote.state.storageManager) || void 0 === r2 || r2.persistChannelConfig(o2).catch((e3) => { + console.error("Error persisting channel config", e3); + }); + } + t2.emit(e.EventType.KEYS_EXCHANGED, { keysExchanged: null === (i2 = t2.state.keyExchange) || void 0 === i2 ? void 0 : i2.areKeysExchanged(), isOriginator: t2.state.isOriginator }); + const a2 = { keyInfo: t2.getKeyInfo() }; + t2.emit(e.EventType.SERVICE_STATUS, a2); + }; + } }]; + function uk(t2, n2) { + jS.SocketService(`[SocketService: setupChannelListener()] context=${t2.state.context} setting socket listeners for channel ${n2}...`); + const { socket: r2 } = t2.state, { keyExchange: i2 } = t2.state; + r2 && t2.state.isOriginator && (t2.state.debug && (null == r2 || r2.io.on("error", (e2) => { + jS.SocketService(`[SocketService: setupChannelListener()] context=${t2.state.context} socket event=error`, e2); + }), null == r2 || r2.io.on("reconnect", (e2) => { + jS.SocketService(`[SocketService: setupChannelListener()] context=${t2.state.context} socket event=reconnect`, e2), tk(t2).catch((e3) => { + }); + }), null == r2 || r2.io.on("reconnect_error", (e2) => { + jS.SocketService(`[SocketService: setupChannelListener()] context=${t2.state.context} socket event=reconnect_error`, e2); + }), null == r2 || r2.io.on("reconnect_failed", () => { + jS.SocketService(`[SocketService: setupChannelListener()] context=${t2.state.context} socket event=reconnect_failed`); + })), null == r2 || r2.on("disconnect", (n3) => (jS.SocketService(`[SocketService: setupChannelListener()] on 'disconnect' -- MetaMaskSDK socket disconnected '${n3}' begin recovery...`), function(t3) { + return (n4) => { + jS.SocketService(`[SocketService: handleDisconnect()] on 'disconnect' manualDisconnect=${t3.state.manualDisconnect}`, n4), t3.state.manualDisconnect || (t3.emit(e.EventType.SOCKET_DISCONNECTED), tk(t3).catch((e2) => { + console.error("SocketService::handleDisconnect Error reconnecting socket", e2); + })); + }; + }(t2)(n3)))), ak.forEach(({ event: e2, handler: i3 }) => { + const o2 = `${e2}-${n2}`; + null == r2 || r2.on(o2, i3(t2, n2)); + }), sk.forEach(({ event: e2, handler: n3 }) => { + null == i2 || i2.on(e2, n3(t2)); + }), t2.state.setupChannelListeners = true; + } + class lk extends xw.EventEmitter2 { + constructor(e2) { + super(), this.state = { clientsConnected: false, clientsPaused: false, manualDisconnect: false, lastRpcId: void 0, rpcMethodTracker: {}, hasPlaintext: false, communicationServerUrl: "", focusListenerAdded: false, removeFocusListener: void 0, isReconnecting: false, reconnectionAttempts: 0 }, this.options = e2; + const { reconnect: t2, communicationLayerPreference: n2, communicationServerUrl: r2, context: i2, remote: o2, logging: a2 } = e2; + this.state.resumed = t2, this.state.context = i2, this.state.isOriginator = o2.state.isOriginator, this.state.communicationLayerPreference = n2, this.state.debug = true === (null == a2 ? void 0 : a2.serviceLayer), this.remote = o2, true === (null == a2 ? void 0 : a2.serviceLayer) && LS.enable("SocketService:Layer"), this.state.communicationServerUrl = r2, this.state.hasPlaintext = this.state.communicationServerUrl !== KE && true === (null == a2 ? void 0 : a2.plaintext), jS.SocketService(`[SocketService: constructor()] Socket IO url: ${this.state.communicationServerUrl}`), this.initSocket(); + } + initSocket() { + var e2; + const { otherPublicKey: t2, ecies: n2, logging: r2 } = this.options, i2 = { autoConnect: false, transports: qE, withCredentials: true }, o2 = this.state.communicationServerUrl; + jS.SocketService(`[SocketService: initSocket()] Socket IO url: ${o2}`), this.state.socket = tS(o2, i2), function(e3) { + if ("undefined" != typeof window && "undefined" != typeof document && (jS.SocketService(`[SocketService: setupSocketFocusListener()] hasFocus=${document.hasFocus()}`, e3), !e3.state.focusListenerAdded)) { + const t3 = () => { + jS.SocketService("Document has focus --- reconnecting socket"), tk(e3).catch((e4) => { + console.error("setupSocketFocusListeners Error reconnecting socket", e4); + }); + }; + window.addEventListener("focus", t3), e3.state.focusListenerAdded = true, e3.state.removeFocusListener = () => { + window.removeEventListener("focus", t3), e3.state.focusListenerAdded = false; + }; + } + }(this); + const a2 = { communicationLayer: this, otherPublicKey: t2, sendPublicKey: false, context: null !== (e2 = this.state.context) && void 0 !== e2 ? e2 : "", ecies: n2, logging: r2 }; + this.state.keyExchange = new QE(a2); + } + resetKeys() { + return jS.SocketService("[SocketService: resetKeys()] Resetting keys."), void (null === (e2 = this.state.keyExchange) || void 0 === e2 || e2.resetKeys()); + var e2; + } + createChannel() { + return nS(this, void 0, void 0, function* () { + return function(t2) { + var n2, r2, i2; + return nS(this, void 0, void 0, function* () { + if (jS.SocketService(`[SocketService: createChannel()] context=${t2.state.context}`), t2.state.socket || t2.initSocket(), null === (n2 = t2.state.socket) || void 0 === n2 ? void 0 : n2.connected) + throw console.error("[SocketService: createChannel()] socket already connected"), new Error("socket already connected"); + null === (r2 = t2.state.socket) || void 0 === r2 || r2.connect(), t2.state.manualDisconnect = false, t2.state.isOriginator = true; + const o2 = Ow(); + t2.state.channelId = o2, uk(t2, o2), yield new Promise((n3, r3) => { + var i3; + null === (i3 = t2.state.socket) || void 0 === i3 || i3.emit(e.EventType.JOIN_CHANNEL, { channelId: o2, context: `${t2.state.context}createChannel`, clientType: "dapp" }, (e2, i4) => nS(this, void 0, void 0, function* () { + try { + yield JE(t2, e2, i4), n3(); + } catch (e3) { + r3(e3); + } + })); + }); + const a2 = null === (i2 = t2.state.keyExchange) || void 0 === i2 ? void 0 : i2.getKeyInfo(); + return { channelId: o2, pubKey: (null == a2 ? void 0 : a2.ecies.public) || "", privKey: (null == a2 ? void 0 : a2.ecies.private) || "" }; + }); + }(this); + }); + } + connectToChannel({ channelId: t2, withKeyExchange: n2 = false, authorized: r2 }) { + return function({ options: t3, instance: n3 }) { + return nS(this, void 0, void 0, function* () { + const { channelId: r3, authorized: i2, withKeyExchange: o2 } = t3, { state: a2, remote: s2 } = n3, { isOriginator: u2 = false, socket: l2, keyExchange: c2 } = a2, { channelConfig: d2 } = s2.state; + if (null == l2 ? void 0 : l2.connected) + throw console.error("[SocketService: connectToChannel()] socket already connected"), new Error("socket already connected"); + if (u2 && (null == d2 ? void 0 : d2.relayPersistence)) { + const { localKey: e2, otherKey: t4 } = d2; + e2 && t4 ? null == c2 || c2.setRelayPersistence({ localKey: e2, otherKey: t4 }) : console.warn("Missing keys in relay persistence", d2); + } + return Object.assign(a2, { manualDisconnect: false, withKeyExchange: o2, isOriginator: u2, channelId: r3 }), null == l2 || l2.connect(), uk(n3, r3), !u2 && i2 && (null == c2 || c2.setKeysExchanged(true), Object.assign(s2.state, { ready: true, authorized: true })), new Promise((t4) => { + var o3; + const s3 = null === (o3 = null == c2 ? void 0 : c2.getKeyInfo()) || void 0 === o3 ? void 0 : o3.ecies.public, d3 = i2 && !u2 ? s3 : void 0; + null == l2 || l2.emit(e.EventType.JOIN_CHANNEL, { channelId: r3, context: `${a2.context}_connectToChannel`, clientType: u2 ? "dapp" : "wallet", publicKey: d3 }, (e2, r4) => nS(this, void 0, void 0, function* () { + yield JE(n3, e2, r4), t4(); + })); + }); + }); + }({ options: { channelId: t2, withKeyExchange: n2, authorized: r2 }, instance: this }); + } + getKeyInfo() { + return this.state.keyExchange.getKeyInfo(); + } + keyCheck() { + var t2, n2; + null === (n2 = (t2 = this).state.socket) || void 0 === n2 || n2.emit(e.EventType.MESSAGE, { id: t2.state.channelId, context: t2.state.context, message: { type: GE.KEY_HANDSHAKE_CHECK, pubkey: t2.getKeyInfo().ecies.otherPubKey } }); + } + getKeyExchange() { + return this.state.keyExchange; + } + sendMessage(e2) { + return nS(this, void 0, void 0, function* () { + return ok(this, e2); + }); + } + ping() { + return function(t2) { + var n2, r2; + return nS(this, void 0, void 0, function* () { + jS.SocketService(`[SocketService: ping()] context=${t2.state.context} originator=${t2.state.isOriginator} keysExchanged=${null === (n2 = t2.state.keyExchange) || void 0 === n2 ? void 0 : n2.areKeysExchanged()}`), null === (r2 = t2.state.socket) || void 0 === r2 || r2.emit(e.MessageType.PING, { id: t2.state.channelId, context: "ping", clientType: t2.remote.state.isOriginator ? "dapp" : "wallet", message: "" }); + }); + }(this); + } + pause() { + return function(t2) { + var n2, r2; + return nS(this, void 0, void 0, function* () { + jS.SocketService(`[SocketService: pause()] context=${t2.state.context}`), t2.state.manualDisconnect = true, (null === (n2 = t2.state.keyExchange) || void 0 === n2 ? void 0 : n2.areKeysExchanged()) && (yield t2.sendMessage({ type: e.MessageType.PAUSE })), null === (r2 = t2.state.socket) || void 0 === r2 || r2.disconnect(); + }); + }(this); + } + isConnected() { + var e2; + return null === (e2 = this.state.socket) || void 0 === e2 ? void 0 : e2.connected; + } + resume() { + return function(t2) { + return nS(this, void 0, void 0, function* () { + const { state: n2, remote: r2 } = t2, { socket: i2, channelId: o2, context: a2, keyExchange: s2, isOriginator: u2 } = n2, { isOriginator: l2 } = r2.state; + if (jS.SocketService(`[SocketService: resume()] channelId=${o2} context=${a2} connected=${null == i2 ? void 0 : i2.connected} manualDisconnect=${n2.manualDisconnect} resumed=${n2.resumed} keysExchanged=${null == s2 ? void 0 : s2.areKeysExchanged()}`), !o2) + throw jS.SocketService("[SocketService: resume()] channelId is not defined"), new Error("ChannelId is not defined"); + (null == i2 ? void 0 : i2.connected) ? (jS.SocketService("[SocketService: resume()] already connected."), i2.emit(e.MessageType.PING, { id: o2, clientType: l2 ? "dapp" : "wallet", context: "on_channel_config", message: "" }), r2.hasRelayPersistence() || (null == s2 ? void 0 : s2.areKeysExchanged()) || (u2 ? yield t2.sendMessage({ type: e.MessageType.READY }) : null == s2 || s2.start({ isOriginator: false }))) : (null == i2 || i2.connect(), jS.SocketService(`[SocketService: resume()] after connecting socket --> connected=${null == i2 ? void 0 : i2.connected}`), null == i2 || i2.emit(e.EventType.JOIN_CHANNEL, { channelId: o2, context: `${a2}_resume`, clientType: l2 ? "dapp" : "wallet" }, (e2, n3) => nS(this, void 0, void 0, function* () { + try { + yield JE(t2, e2, n3); + } catch (e3) { + console.warn("Error reconnecting to channel", e3); + } + }))), n2.manualDisconnect = false, n2.resumed = true; + }); + }(this); + } + getRPCMethodTracker() { + return this.state.rpcMethodTracker; + } + disconnect(e2) { + return function(e3, t2) { + var n2, r2, i2, o2, a2; + jS.SocketService(`[SocketService: disconnect()] context=${e3.state.context}`, t2), (null == t2 ? void 0 : t2.terminate) && (null === (r2 = (n2 = e3.state).removeFocusListener) || void 0 === r2 || r2.call(n2), e3.state.channelId = t2.channelId, null === (i2 = e3.state.socket) || void 0 === i2 || i2.removeAllListeners(), null === (o2 = e3.state.keyExchange) || void 0 === o2 || o2.clean(), e3.remote.state.ready = false, e3.state.socket = void 0, e3.state.rpcMethodTracker = {}), e3.state.manualDisconnect = true, null === (a2 = e3.state.socket) || void 0 === a2 || a2.disconnect(); + }(this, e2); + } + } + var ck; + function dk(t2) { + return () => nS(this, void 0, void 0, function* () { + var n2, r2, i2; + const { state: o2 } = t2; + if (o2.authorized) + return; + yield (() => nS(this, void 0, void 0, function* () { + for (; !o2.walletInfo; ) + yield XE(500); + }))(); + const a2 = "7.3".localeCompare((null === (n2 = o2.walletInfo) || void 0 === n2 ? void 0 : n2.version) || ""); + if (jS.RemoteCommunication(`[RemoteCommunication: handleAuthorizedEvent()] HACK 'authorized' version=${null === (r2 = o2.walletInfo) || void 0 === r2 ? void 0 : r2.version} compareValue=${a2}`), 1 !== a2) + return; + const s2 = o2.platformType === e.PlatformType.MobileWeb || o2.platformType === e.PlatformType.ReactNative || o2.platformType === e.PlatformType.MetaMaskMobileWebview; + jS.RemoteCommunication(`[RemoteCommunication: handleAuthorizedEvent()] HACK 'authorized' platform=${o2.platformType} secure=${s2} channel=${o2.channelId} walletVersion=${null === (i2 = o2.walletInfo) || void 0 === i2 ? void 0 : i2.version}`), s2 && (o2.authorized = true, t2.emit(e.EventType.AUTHORIZED)); + }); + } + function fk(t2) { + return (n2) => { + const { state: r2 } = t2; + jS.RemoteCommunication(`[RemoteCommunication: handleChannelCreatedEvent()] context=${r2.context} on 'channel_created' channelId=${n2}`), t2.emit(e.EventType.CHANNEL_CREATED, n2); + }; + } + function hk(t2, n2) { + return () => { + var r2, i2, o2, a2; + const { state: s2 } = t2; + if (jS.RemoteCommunication(`[RemoteCommunication: handleClientsConnectedEvent()] on 'clients_connected' channel=${s2.channelId} keysExchanged=${null === (i2 = null === (r2 = s2.communicationLayer) || void 0 === r2 ? void 0 : r2.getKeyInfo()) || void 0 === i2 ? void 0 : i2.keysExchanged}`), s2.analytics) { + const e2 = s2.isOriginator ? ZE.REQUEST : ZE.REQUEST_MOBILE; + KS(Object.assign(Object.assign({ id: null !== (o2 = s2.channelId) && void 0 !== o2 ? o2 : "", event: s2.reconnection ? ZE.RECONNECT : e2 }, s2.originatorInfo), { commLayer: n2, sdkVersion: s2.sdkVersion, walletVersion: null === (a2 = s2.walletInfo) || void 0 === a2 ? void 0 : a2.version, commLayerVersion: FE.version }), s2.communicationServerUrl).catch((e3) => { + console.error("Cannot send analytics", e3); + }); + } + s2.clientsConnected = true, s2.originatorInfoSent = false, t2.emit(e.EventType.CLIENTS_CONNECTED); + }; + } + function pk(t2) { + return (n2) => { + const { state: r2 } = t2; + jS.RemoteCommunication(`[RemoteCommunication: handleClientsDisconnectedEvent()] context=${r2.context} on 'clients_disconnected' channelId=${n2}`), r2.relayPersistence || (r2.clientsConnected = false, r2.ready = false, r2.authorized = false), t2.emit(e.EventType.CLIENTS_DISCONNECTED, r2.channelId), t2.setConnectionStatus(e.ConnectionStatus.DISCONNECTED); + }; + } + function mk(t2) { + return (n2) => { + var r2; + const { state: i2 } = t2; + if (jS.RemoteCommunication(`[RemoteCommunication: handleClientsWaitingEvent()] context=${i2.context} on 'clients_waiting' numberUsers=${n2} ready=${i2.ready} autoStarted=${i2.originatorConnectStarted}`), t2.setConnectionStatus(e.ConnectionStatus.WAITING), t2.emit(e.EventType.CLIENTS_WAITING, n2), i2.originatorConnectStarted) { + jS.RemoteCommunication(`[RemoteCommunication: handleClientsWaitingEvent()] on 'clients_waiting' watch autoStarted=${i2.originatorConnectStarted} timeout`, i2.autoConnectOptions); + const n3 = (null === (r2 = i2.autoConnectOptions) || void 0 === r2 ? void 0 : r2.timeout) || 3e3, o2 = setTimeout(() => { + jS.RemoteCommunication(`[RemoteCommunication: handleClientsWaitingEvent()] setTimeout(${n3}) terminate channelConfig`, i2.autoConnectOptions), i2.originatorConnectStarted = false, i2.ready || t2.setConnectionStatus(e.ConnectionStatus.TIMEOUT), clearTimeout(o2); + }, n3); + } + }; + } + function gk(t2, n2) { + return (r2) => { + var i2, o2, a2, s2, u2, l2, c2, d2; + const { state: f2 } = t2; + if (jS.RemoteCommunication(`[RemoteCommunication: handleKeysExchangedEvent()] context=${f2.context} on commLayer.'keys_exchanged' channel=${f2.channelId}`, r2), null === (o2 = null === (i2 = f2.communicationLayer) || void 0 === i2 ? void 0 : i2.getKeyInfo()) || void 0 === o2 ? void 0 : o2.keysExchanged) { + const n3 = Object.assign(Object.assign({}, f2.channelConfig), { channelId: null !== (a2 = f2.channelId) && void 0 !== a2 ? a2 : "", validUntil: (null === (s2 = f2.channelConfig) || void 0 === s2 ? void 0 : s2.validUntil) || HE, localKey: f2.communicationLayer.getKeyInfo().ecies.private, otherKey: f2.communicationLayer.getKeyInfo().ecies.otherPubKey }); + null === (u2 = f2.storageManager) || void 0 === u2 || u2.persistChannelConfig(n3).catch((e2) => { + console.error("Error persisting channel config", e2); + }), t2.setConnectionStatus(e.ConnectionStatus.LINKED); + } + !function(e2, t3) { + var n3, r3, i3, o3, a3, s3, u3, l3; + const { state: c3 } = e2; + jS.RemoteCommunication(`[RemoteCommunication: setLastActiveDate()] channel=${c3.channelId}`, t3); + const d3 = Object.assign(Object.assign({}, c3.channelConfig), { channelId: null !== (n3 = c3.channelId) && void 0 !== n3 ? n3 : "", validUntil: null !== (i3 = null === (r3 = c3.channelConfig) || void 0 === r3 ? void 0 : r3.validUntil) && void 0 !== i3 ? i3 : 0, relayPersistence: c3.relayPersistence, localKey: null === (a3 = null === (o3 = c3.communicationLayer) || void 0 === o3 ? void 0 : o3.state.keyExchange) || void 0 === a3 ? void 0 : a3.getKeyInfo().ecies.private, otherKey: null === (u3 = null === (s3 = c3.communicationLayer) || void 0 === s3 ? void 0 : s3.state.keyExchange) || void 0 === u3 ? void 0 : u3.getKeyInfo().ecies.otherPubKey, lastActive: t3.getTime() }); + null === (l3 = c3.storageManager) || void 0 === l3 || l3.persistChannelConfig(d3); + }(t2, /* @__PURE__ */ new Date()), f2.analytics && f2.channelId && KS(Object.assign(Object.assign({ id: f2.channelId, event: r2.isOriginator ? ZE.CONNECTED : ZE.CONNECTED_MOBILE }, f2.originatorInfo), { sdkVersion: f2.sdkVersion, commLayer: n2, commLayerVersion: FE.version, walletVersion: null === (l2 = f2.walletInfo) || void 0 === l2 ? void 0 : l2.version }), f2.communicationServerUrl).catch((e2) => { + console.error("Cannot send analytics", e2); + }), f2.isOriginator = r2.isOriginator, r2.isOriginator || (null === (c2 = f2.communicationLayer) || void 0 === c2 || c2.sendMessage({ type: e.MessageType.READY }), f2.ready = true, f2.paused = false), r2.isOriginator && !f2.originatorInfoSent && (null === (d2 = f2.communicationLayer) || void 0 === d2 || d2.sendMessage({ type: e.MessageType.ORIGINATOR_INFO, originatorInfo: f2.originatorInfo, originator: f2.originatorInfo }), f2.originatorInfoSent = true); + }; + } + function vk(t2) { + return (n2) => { + let r2 = n2; + n2.message && (r2 = r2.message), function(t3, n3) { + const { state: r3 } = n3; + if (jS.RemoteCommunication(`[RemoteCommunication: onCommunicationLayerMessage()] context=${r3.context} on 'message' typeof=${typeof t3}`, t3), n3.state.ready = true, r3.isOriginator || t3.type !== e.MessageType.ORIGINATOR_INFO) + if (r3.isOriginator && t3.type === e.MessageType.WALLET_INFO) + !function(e2, t4) { + const { state: n4 } = e2; + n4.walletInfo = t4.walletInfo, n4.paused = false; + }(n3, t3); + else { + if (r3.isOriginator && t3.type === e.MessageType.WALLET_INIT) + (function(t4, n4) { + var r4, i2, o2; + return nS(this, void 0, void 0, function* () { + const { state: a2 } = t4; + if (a2.isOriginator) { + const a3 = n4.data || {}; + if ("object" == typeof a3 && "accounts" in a3 && "chainId" in a3 && "walletKey" in a3) + try { + const { channelConfig: n5 } = t4.state; + if (jS.RemoteCommunication("WALLET_INIT: channelConfig", JSON.stringify(n5, null, 2)), n5) { + const e2 = a3.accounts, s2 = a3.chainId, u2 = a3.walletKey; + let l2, c2 = false; + "deeplinkProtocol" in a3 && (c2 = Boolean(a3.deeplinkProtocol), t4.state.deeplinkProtocolAvailable = c2), "walletVersion" in a3 && (l2 = a3.walletVersion), yield null === (r4 = t4.state.storageManager) || void 0 === r4 ? void 0 : r4.persistChannelConfig(Object.assign(Object.assign({}, n5), { otherKey: u2, walletVersion: l2, deeplinkProtocolAvailable: c2, relayPersistence: true })), yield null === (i2 = t4.state.storageManager) || void 0 === i2 ? void 0 : i2.persistAccounts(e2), yield null === (o2 = t4.state.storageManager) || void 0 === o2 ? void 0 : o2.persistChainId(s2); + } + t4.emit(e.EventType.WALLET_INIT, { accounts: a3.accounts, chainId: a3.chainId }); + } catch (e2) { + console.error('RemoteCommunication::on "wallet_init" -- error', e2); + } + else + console.error('RemoteCommunication::on "wallet_init" -- invalid data format', a3); + } + }); + })(n3, t3).catch((e2) => { + jS.RemoteCommunication(`[RemoteCommunication: onCommunicationLayerMessage()] error=${e2}`); + }); + else if (t3.type === e.MessageType.TERMINATE) + (function(t4) { + return nS(this, void 0, void 0, function* () { + const { state: n4 } = t4; + n4.isOriginator && (yield Sk({ options: { terminate: true, sendMessage: false }, instance: t4 }), t4.emit(e.EventType.TERMINATE)); + }); + })(n3).catch((e2) => { + jS.RemoteCommunication(`[RemoteCommunication: onCommunicationLayerMessage()] error=${e2}`); + }); + else if (t3.type === e.MessageType.PAUSE) + !function(t4) { + const { state: n4 } = t4; + n4.paused = true, t4.setConnectionStatus(e.ConnectionStatus.PAUSED); + }(n3); + else if (t3.type === e.MessageType.READY && r3.isOriginator) + !function(t4) { + const { state: n4 } = t4; + t4.setConnectionStatus(e.ConnectionStatus.LINKED); + const r4 = n4.paused; + n4.paused = false, t4.emit(e.EventType.CLIENTS_READY, { isOriginator: n4.isOriginator, walletInfo: n4.walletInfo }), r4 && (n4.authorized = true, t4.emit(e.EventType.AUTHORIZED)); + }(n3); + else { + if (t3.type === e.MessageType.OTP && r3.isOriginator) + return void function(t4, n4) { + var r4; + const { state: i2 } = t4; + t4.emit(e.EventType.OTP, n4.otpAnswer), 1 === "6.6".localeCompare((null === (r4 = i2.walletInfo) || void 0 === r4 ? void 0 : r4.version) || "") && (console.warn("RemoteCommunication::on 'otp' -- backward compatibility <6.6 -- triger eth_requestAccounts"), t4.emit(e.EventType.SDK_RPC_CALL, { method: $E.ETH_REQUESTACCOUNTS, params: [] })); + }(n3, t3); + t3.type === e.MessageType.AUTHORIZED && r3.isOriginator && function(t4) { + const { state: n4 } = t4; + n4.authorized = true, t4.emit(e.EventType.AUTHORIZED); + }(n3); + } + n3.emit(e.EventType.MESSAGE, t3); + } + else + !function(t4, n4) { + var r4; + const { state: i2 } = t4; + null === (r4 = i2.communicationLayer) || void 0 === r4 || r4.sendMessage({ type: e.MessageType.WALLET_INFO, walletInfo: i2.walletInfo }), i2.originatorInfo = n4.originatorInfo || n4.originator, t4.emit(e.EventType.CLIENTS_READY, { isOriginator: i2.isOriginator, originatorInfo: i2.originatorInfo }), i2.paused = false; + }(n3, t3); + }(r2, t2); + }; + } + function bk(e2) { + return () => { + const { state: t2 } = e2; + jS.RemoteCommunication("[RemoteCommunication: handleSocketReconnectEvent()] on 'socket_reconnect' -- reset key exchange status / set ready to false"), t2.ready = false, t2.authorized = false, VE(t2), e2.emitServiceStatusEvent({ context: "socket_reconnect" }); + }; + } + function yk(e2) { + return () => { + const { state: t2 } = e2; + jS.RemoteCommunication("[RemoteCommunication: handleSocketDisconnectedEvent()] on 'socket_Disconnected' set ready to false"), t2.ready = false; + }; + } + function wk(t2) { + return () => nS(this, void 0, void 0, function* () { + var n2, r2, i2, o2, a2, s2, u2; + const { state: l2 } = t2; + jS.RemoteCommunication(`[RemoteCommunication: handleFullPersistenceEvent()] context=${l2.context}`), t2.state.ready = true, t2.state.clientsConnected = true, t2.state.authorized = true, t2.state.relayPersistence = true, null === (n2 = t2.state.communicationLayer) || void 0 === n2 || n2.getKeyExchange().setKeysExchanged(true), t2.emit(e.EventType.KEYS_EXCHANGED, { keysExchanged: true, isOriginator: true }), t2.emit(e.EventType.AUTHORIZED), t2.emit(e.EventType.CLIENTS_READY), t2.emit(e.EventType.CHANNEL_PERSISTENCE); + try { + l2.channelConfig = Object.assign(Object.assign({}, l2.channelConfig), { localKey: null === (r2 = l2.communicationLayer) || void 0 === r2 ? void 0 : r2.getKeyExchange().getKeyInfo().ecies.private, otherKey: null === (i2 = l2.communicationLayer) || void 0 === i2 ? void 0 : i2.getKeyExchange().getOtherPublicKey(), channelId: null !== (o2 = l2.channelId) && void 0 !== o2 ? o2 : "", validUntil: null !== (s2 = null === (a2 = l2.channelConfig) || void 0 === a2 ? void 0 : a2.validUntil) && void 0 !== s2 ? s2 : HE, relayPersistence: true }), yield null === (u2 = l2.storageManager) || void 0 === u2 ? void 0 : u2.persistChannelConfig(l2.channelConfig); + } catch (e2) { + console.error("Error persisting channel config", e2); + } + }); + } + function _k({ communicationLayerPreference: t2, otherPublicKey: n2, reconnect: r2, ecies: i2, communicationServerUrl: o2 = KE, instance: a2 }) { + var s2, u2, l2, c2, d2, f2, h2, p2, m2, g2, v2; + const { state: b2 } = a2; + if (jS.RemoteCommunication("[initCommunicationLayer()] ", JSON.stringify(b2, null, 2)), t2 !== e.CommunicationLayerPreference.SOCKET) + throw new Error("Invalid communication protocol"); + b2.communicationLayer = new lk({ communicationLayerPreference: t2, otherPublicKey: n2, reconnect: r2, transports: b2.transports, communicationServerUrl: o2, context: b2.context, ecies: i2, logging: b2.logging, remote: a2 }); + let y2 = "undefined" != typeof document && document.URL || "", w2 = "undefined" != typeof document && document.title || ""; + (null === (s2 = b2.dappMetadata) || void 0 === s2 ? void 0 : s2.url) && (y2 = b2.dappMetadata.url), (null === (u2 = b2.dappMetadata) || void 0 === u2 ? void 0 : u2.name) && (w2 = b2.dappMetadata.name); + const _2 = null !== (f2 = null !== (c2 = null === (l2 = b2.dappMetadata) || void 0 === l2 ? void 0 : l2.name) && void 0 !== c2 ? c2 : null === (d2 = b2.dappMetadata) || void 0 === d2 ? void 0 : d2.url) && void 0 !== f2 ? f2 : "N/A", S2 = "undefined" != typeof window && void 0 !== window.location && null !== (h2 = window.location.hostname) && void 0 !== h2 ? h2 : _2, E2 = { url: y2, title: w2, source: null === (p2 = b2.dappMetadata) || void 0 === p2 ? void 0 : p2.source, dappId: S2, icon: (null === (m2 = b2.dappMetadata) || void 0 === m2 ? void 0 : m2.iconUrl) || (null === (g2 = b2.dappMetadata) || void 0 === g2 ? void 0 : g2.base64Icon), platform: b2.platformType, apiVersion: FE.version, connector: null === (v2 = b2.dappMetadata) || void 0 === v2 ? void 0 : v2.connector }; + b2.originatorInfo = E2; + const k2 = { [e.EventType.AUTHORIZED]: dk(a2), [e.EventType.MESSAGE]: vk(a2), [e.EventType.CHANNEL_PERSISTENCE]: wk(a2), [e.EventType.CLIENTS_CONNECTED]: hk(a2, t2), [e.EventType.KEYS_EXCHANGED]: gk(a2, t2), [e.EventType.SOCKET_DISCONNECTED]: yk(a2), [e.EventType.SOCKET_RECONNECT]: bk(a2), [e.EventType.CLIENTS_DISCONNECTED]: pk(a2), [e.EventType.KEY_INFO]: () => { + }, [e.EventType.CHANNEL_CREATED]: fk(a2), [e.EventType.CLIENTS_WAITING]: mk(a2), [e.EventType.RPC_UPDATE]: (t3) => { + a2.emit(e.EventType.RPC_UPDATE, t3); + } }; + for (const [e2, t3] of Object.entries(k2)) + try { + b2.communicationLayer.on(e2, t3); + } catch (n3) { + console.error(`Error registering handler for ${e2}:`, n3); + } + } + function Sk({ options: t2, instance: n2 }) { + return nS(this, void 0, void 0, function* () { + const { state: r2 } = n2; + return jS.RemoteCommunication(`[RemoteCommunication: disconnect()] channel=${r2.channelId}`, t2), new Promise((i2, o2) => { + var a2, s2, u2, l2, c2, d2; + (null == t2 ? void 0 : t2.terminate) ? (n2.state.ready && KS({ id: null !== (a2 = n2.state.channelId) && void 0 !== a2 ? a2 : "", event: ZE.TERMINATED }, n2.state.communicationServerUrl).catch((e2) => { + console.error("[handleSendMessage] Cannot send analytics", e2); + }), r2.ready = false, r2.paused = false, null === (s2 = r2.storageManager) || void 0 === s2 || s2.terminate(null !== (u2 = r2.channelId) && void 0 !== u2 ? u2 : ""), n2.state.terminated = true, t2.sendMessage ? (null === (l2 = r2.communicationLayer) || void 0 === l2 ? void 0 : l2.getKeyInfo().keysExchanged) && n2.state.communicationLayer && nk(n2.state.communicationLayer, { type: e.MessageType.TERMINATE }).then(() => { + console.warn("[disconnect] Terminate message sent to the other peer"), i2(true); + }).catch((e2) => { + o2(e2); + }) : i2(true), r2.authorized = false, r2.relayPersistence = false, r2.channelId = Ow(), t2.channelId = r2.channelId, r2.channelConfig = void 0, r2.originatorConnectStarted = false, null === (c2 = r2.communicationLayer) || void 0 === c2 || c2.disconnect(t2), n2.setConnectionStatus(e.ConnectionStatus.TERMINATED)) : (null === (d2 = r2.communicationLayer) || void 0 === d2 || d2.disconnect(t2), n2.setConnectionStatus(e.ConnectionStatus.DISCONNECTED), i2(true)); + }); + }); + } + e.CommunicationLayerPreference = void 0, e.PlatformType = void 0, function(e2) { + e2.SOCKET = "socket"; + }(e.CommunicationLayerPreference || (e.CommunicationLayerPreference = {})), function(e2) { + e2.NonBrowser = "nodejs", e2.MetaMaskMobileWebview = "in-app-browser", e2.DesktopWeb = "web-desktop", e2.MobileWeb = "web-mobile", e2.ReactNative = "react-native"; + }(e.PlatformType || (e.PlatformType = {})); + class Ek extends xw.EventEmitter2 { + constructor(t2) { + super(), this.state = { ready: false, authorized: false, isOriginator: false, terminated: false, protocolVersion: 1, paused: false, deeplinkProtocolAvailable: false, platformType: "metamask-mobile", analytics: false, reconnection: false, originatorInfoSent: false, communicationServerUrl: KE, context: "", persist: false, clientsConnected: false, sessionDuration: HE, originatorConnectStarted: false, debug: false, _connectionStatus: e.ConnectionStatus.DISCONNECTED }, this._options = t2; + const { platformType: n2, communicationLayerPreference: r2, otherPublicKey: i2, reconnect: o2, walletInfo: a2, dappMetadata: s2, protocolVersion: u2, transports: l2, context: c2, relayPersistence: d2, ecies: f2, analytics: h2 = false, storage: p2, sdkVersion: m2, communicationServerUrl: g2 = KE, logging: v2, autoConnect: b2 = { timeout: WE } } = t2; + this.state.otherPublicKey = i2, this.state.dappMetadata = s2, this.state.walletInfo = a2, this.state.transports = l2, this.state.platformType = n2, this.state.analytics = h2, this.state.protocolVersion = null != u2 ? u2 : 1, this.state.isOriginator = !i2, this.state.relayPersistence = d2, this.state.communicationServerUrl = g2, this.state.context = c2, this.state.terminated = false, this.state.sdkVersion = m2, this.setMaxListeners(50), this.setConnectionStatus(e.ConnectionStatus.DISCONNECTED), (null == p2 ? void 0 : p2.duration) && (this.state.sessionDuration = HE), this.state.storageOptions = p2, this.state.autoConnectOptions = b2, this.state.debug = true === (null == v2 ? void 0 : v2.remoteLayer), true === (null == v2 ? void 0 : v2.remoteLayer) && LS.enable("RemoteCommunication:Layer"), true === (null == v2 ? void 0 : v2.serviceLayer) && LS.enable("SocketService:Layer"), true === (null == v2 ? void 0 : v2.eciesLayer) && LS.enable("ECIES:Layer"), true === (null == v2 ? void 0 : v2.keyExchangeLayer) && LS.enable("KeyExchange:Layer"), this.state.logging = v2, (null == p2 ? void 0 : p2.storageManager) && (this.state.storageManager = p2.storageManager), jS.RemoteCommunication(`[RemoteCommunication: constructor()] protocolVersion=${u2} relayPersistence=${d2} isOriginator=${this.state.isOriginator} communicationLayerPreference=${r2} otherPublicKey=${i2} reconnect=${o2}`), this.state.isOriginator || _k({ communicationLayerPreference: r2, otherPublicKey: i2, reconnect: o2, ecies: f2, communicationServerUrl: g2, instance: this }), this.emitServiceStatusEvent({ context: "constructor" }); + } + initFromDappStorage() { + var t2; + return nS(this, void 0, void 0, function* () { + if (this.state.storageManager) { + const n2 = yield this.state.storageManager.getPersistedChannelConfig({}); + n2 && (this.state.channelConfig = n2, this.state.channelId = n2.channelId, this.state.deeplinkProtocolAvailable = null !== (t2 = n2.deeplinkProtocolAvailable) && void 0 !== t2 && t2, n2.relayPersistence && (this.state.authorized = true, this.state.ready = true, this.setConnectionStatus(e.ConnectionStatus.LINKED), yield this.connectToChannel({ channelId: n2.channelId }))); + } + _k({ communicationLayerPreference: e.CommunicationLayerPreference.SOCKET, otherPublicKey: this.state.otherPublicKey, reconnect: this._options.reconnect, ecies: this._options.ecies, communicationServerUrl: this.state.communicationServerUrl, instance: this }); + }); + } + originatorSessionConnect() { + return nS(this, void 0, void 0, function* () { + return yield function(e2) { + var t2; + return nS(this, void 0, void 0, function* () { + const { state: n2 } = e2; + if (!n2.storageManager) + return void jS.RemoteCommunication("[RemoteCommunication: originatorSessionConnect()] no storage manager defined - skip"); + const r2 = yield n2.storageManager.getPersistedChannelConfig({}); + if (jS.RemoteCommunication(`[RemoteCommunication: originatorSessionConnect()] autoStarted=${n2.originatorConnectStarted} channelConfig`, r2), null === (t2 = n2.communicationLayer) || void 0 === t2 ? void 0 : t2.isConnected()) + return jS.RemoteCommunication("[RemoteCommunication: originatorSessionConnect()] socket already connected - skip"), r2; + if (r2) { + if (r2.validUntil > Date.now()) + return n2.channelConfig = r2, n2.originatorConnectStarted = true, n2.channelId = null == r2 ? void 0 : r2.channelId, n2.reconnection = true, r2; + jS.RemoteCommunication("[RemoteCommunication: autoConnect()] Session has expired"); + } + n2.originatorConnectStarted = false; + }); + }(this); + }); + } + generateChannelIdConnect() { + return nS(this, void 0, void 0, function* () { + return function(e2) { + var t2, n2, r2, i2, o2, a2; + return nS(this, void 0, void 0, function* () { + if (!e2.communicationLayer) + throw new Error("communication layer not initialized"); + if (e2.ready) + throw new Error("Channel already connected"); + if (e2.channelId && (null === (t2 = e2.communicationLayer) || void 0 === t2 ? void 0 : t2.isConnected())) + return e2.channelConfig = Object.assign(Object.assign({}, e2.channelConfig), { channelId: e2.channelId, validUntil: Date.now() + e2.sessionDuration }), null === (n2 = e2.storageManager) || void 0 === n2 || n2.persistChannelConfig(e2.channelConfig), { channelId: e2.channelId, privKey: null === (i2 = null === (r2 = e2.communicationLayer) || void 0 === r2 ? void 0 : r2.getKeyInfo()) || void 0 === i2 ? void 0 : i2.ecies.private, pubKey: null === (a2 = null === (o2 = e2.communicationLayer) || void 0 === o2 ? void 0 : o2.getKeyInfo()) || void 0 === a2 ? void 0 : a2.ecies.public }; + jS.RemoteCommunication("[RemoteCommunication: generateChannelId()]"); + const s2 = yield e2.communicationLayer.createChannel(); + jS.RemoteCommunication("[RemoteCommunication: generateChannelId()] channel created", s2); + const u2 = Object.assign(Object.assign({}, e2.channelConfig), { channelId: s2.channelId, localKey: s2.privKey, validUntil: Date.now() + e2.sessionDuration }); + return e2.channelId = s2.channelId, e2.channelConfig = u2, { channelId: e2.channelId, pubKey: s2.pubKey, privKey: s2.privKey }; + }); + }(this.state); + }); + } + clean() { + return VE(this.state); + } + connectToChannel({ channelId: e2, withKeyExchange: t2, authorized: n2 }) { + return function({ channelId: e3, withKeyExchange: t3, authorized: n3, state: r2 }) { + var i2, o2, a2; + return nS(this, void 0, void 0, function* () { + if (!Pw(e3)) + throw jS.RemoteCommunication(`[RemoteCommunication: connectToChannel()] context=${r2.context} invalid channel channelId=${e3}`), new Error(`Invalid channel ${e3}`); + if (jS.RemoteCommunication(`[RemoteCommunication: connectToChannel()] context=${r2.context} channelId=${e3} withKeyExchange=${t3}`), null === (i2 = r2.communicationLayer) || void 0 === i2 ? void 0 : i2.isConnected()) + return void jS.RemoteCommunication(`[RemoteCommunication: connectToChannel()] context=${r2.context} already connected - interrupt connection.`); + r2.channelId = e3, yield null === (o2 = r2.communicationLayer) || void 0 === o2 ? void 0 : o2.connectToChannel({ channelId: e3, authorized: n3, withKeyExchange: t3 }); + const s2 = Object.assign(Object.assign({}, r2.channelConfig), { channelId: e3, validUntil: Date.now() + r2.sessionDuration }); + r2.channelConfig = s2, null === (a2 = r2.storageManager) || void 0 === a2 || a2.persistChannelConfig(s2); + }); + }({ channelId: e2, authorized: n2, withKeyExchange: t2, state: this.state }); + } + sendMessage(t2) { + return function(t3, n2) { + var r2, i2; + return nS(this, void 0, void 0, function* () { + const { state: o2 } = t3; + jS.RemoteCommunication(`[RemoteCommunication: sendMessage()] context=${o2.context} paused=${o2.paused} ready=${o2.ready} relayPersistence=${o2.relayPersistence} authorized=${o2.authorized} socket=${null === (r2 = o2.communicationLayer) || void 0 === r2 ? void 0 : r2.isConnected()} clientsConnected=${o2.clientsConnected} status=${o2._connectionStatus}`, n2), o2.relayPersistence || o2.ready && (null === (i2 = o2.communicationLayer) || void 0 === i2 ? void 0 : i2.isConnected()) && o2.clientsConnected || (jS.RemoteCommunication(`[RemoteCommunication: sendMessage()] context=${o2.context} SKIP message waiting for MM mobile readiness.`), yield new Promise((n3) => { + t3.once(e.EventType.CLIENTS_READY, n3); + }), jS.RemoteCommunication(`[RemoteCommunication: sendMessage()] context=${o2.context} AFTER SKIP / READY -- sending pending message`)); + try { + const r3 = yield function(t4, n3) { + return nS(this, void 0, void 0, function* () { + return new Promise((r4) => { + var i3; + const { state: o3 } = t4; + jS.RemoteCommunication(`[RemoteCommunication: handleAuthorization()] context=${o3.context} ready=${o3.ready} authorized=${o3.authorized} method=${n3.method}`), !o3.isOriginator || o3.authorized || o3.relayPersistence ? null === (i3 = o3.communicationLayer) || void 0 === i3 || i3.sendMessage(n3).then((e2) => { + r4(e2); + }).catch((e2) => { + console.error(`[RemoteCommunication: handleAuthorization()] context=${o3.context} ERROR`, e2), r4(false); + }) : t4.once(e.EventType.AUTHORIZED, () => { + var e2; + jS.RemoteCommunication(`[RemoteCommunication: handleAuthorization()] context=${o3.context} AFTER SKIP / AUTHORIZED -- sending pending message`), null === (e2 = o3.communicationLayer) || void 0 === e2 || e2.sendMessage(n3).then((e3) => { + r4(e3); + }).catch((e3) => { + console.error(`[RemoteCommunication: handleAuthorization()] context=${o3.context} ERROR`, e3), r4(false); + }); + }); + }); + }); + }(t3, n2); + return r3; + } catch (e2) { + throw console.error(`[RemoteCommunication: sendMessage()] context=${o2.context} ERROR`, e2), e2; + } + }); + }(this, t2); + } + testStorage() { + return nS(this, void 0, void 0, function* () { + return function(e2) { + var t2; + return nS(this, void 0, void 0, function* () { + const n2 = yield null === (t2 = e2.storageManager) || void 0 === t2 ? void 0 : t2.getPersistedChannelConfig(); + jS.RemoteCommunication("[RemoteCommunication: testStorage()] res", n2); + }); + }(this.state); + }); + } + hasDeeplinkProtocol() { + return this.state.deeplinkProtocolAvailable; + } + getChannelConfig() { + return this.state.channelConfig; + } + isReady() { + return this.state.ready; + } + isConnected() { + var e2; + return null === (e2 = this.state.communicationLayer) || void 0 === e2 ? void 0 : e2.isConnected(); + } + isAuthorized() { + return this.state.authorized; + } + isPaused() { + return this.state.paused; + } + getCommunicationLayer() { + return this.state.communicationLayer; + } + ping() { + var e2; + return nS(this, void 0, void 0, function* () { + jS.RemoteCommunication(`[RemoteCommunication: ping()] channel=${this.state.channelId}`), yield null === (e2 = this.state.communicationLayer) || void 0 === e2 ? void 0 : e2.ping(); + }); + } + testLogger() { + jS.RemoteCommunication(`testLogger() channel=${this.state.channelId}`), jS.SocketService(`testLogger() channel=${this.state.channelId}`), jS.Ecies(`testLogger() channel=${this.state.channelId}`), jS.KeyExchange(`testLogger() channel=${this.state.channelId}`); + } + keyCheck() { + var e2; + jS.RemoteCommunication(`[RemoteCommunication: keyCheck()] channel=${this.state.channelId}`), null === (e2 = this.state.communicationLayer) || void 0 === e2 || e2.keyCheck(); + } + setConnectionStatus(t2) { + this.state._connectionStatus !== t2 && (this.state._connectionStatus = t2, this.emit(e.EventType.CONNECTION_STATUS, t2), this.emitServiceStatusEvent({ context: "setConnectionStatus" })); + } + emitServiceStatusEvent(t2 = {}) { + this.emit(e.EventType.SERVICE_STATUS, this.getServiceStatus()); + } + getConnectionStatus() { + return this.state._connectionStatus; + } + getServiceStatus() { + return { originatorInfo: this.state.originatorInfo, keyInfo: this.getKeyInfo(), connectionStatus: this.state._connectionStatus, channelConfig: this.state.channelConfig, channelId: this.state.channelId }; + } + getKeyInfo() { + var e2; + return null === (e2 = this.state.communicationLayer) || void 0 === e2 ? void 0 : e2.getKeyInfo(); + } + resetKeys() { + var e2; + null === (e2 = this.state.communicationLayer) || void 0 === e2 || e2.resetKeys(); + } + setOtherPublicKey(e2) { + var t2; + const n2 = null === (t2 = this.state.communicationLayer) || void 0 === t2 ? void 0 : t2.getKeyExchange(); + if (!n2) + throw new Error("KeyExchange is not initialized."); + n2.getOtherPublicKey() !== e2 && n2.setOtherPublicKey(e2); + } + pause() { + var t2; + return nS(this, void 0, void 0, function* () { + jS.RemoteCommunication(`[RemoteCommunication: pause()] channel=${this.state.channelId}`), yield null === (t2 = this.state.communicationLayer) || void 0 === t2 ? void 0 : t2.pause(), this.setConnectionStatus(e.ConnectionStatus.PAUSED); + }); + } + getVersion() { + return FE.version; + } + hasRelayPersistence() { + var e2; + return null !== (e2 = this.state.relayPersistence) && void 0 !== e2 && e2; + } + resume() { + return nS(this, void 0, void 0, function* () { + return function(t2) { + var n2; + return nS(this, void 0, void 0, function* () { + const { state: r2 } = t2; + jS.RemoteCommunication(`[RemoteCommunication: resume()] channel=${r2.channelId}`), yield null === (n2 = r2.communicationLayer) || void 0 === n2 ? void 0 : n2.resume(), t2.setConnectionStatus(e.ConnectionStatus.LINKED); + }); + }(this); + }); + } + encrypt(e2) { + var t2, n2, r2; + const i2 = null === (t2 = this.state.communicationLayer) || void 0 === t2 ? void 0 : t2.getKeyExchange(), o2 = null == i2 ? void 0 : i2.getOtherPublicKey(); + if (!o2) + throw new Error("KeyExchange not completed"); + return null === (r2 = null === (n2 = this.state.communicationLayer) || void 0 === n2 ? void 0 : n2.state.eciesInstance) || void 0 === r2 ? void 0 : r2.encrypt(e2, o2); + } + decrypt(e2) { + var t2, n2, r2; + if (!(null === (t2 = this.state.communicationLayer) || void 0 === t2 ? void 0 : t2.state.eciesInstance)) + throw new Error("ECIES instance is not initialized"); + return null === (r2 = null === (n2 = this.state.communicationLayer) || void 0 === n2 ? void 0 : n2.state.eciesInstance) || void 0 === r2 ? void 0 : r2.decrypt(e2); + } + getChannelId() { + return this.state.channelId; + } + getRPCMethodTracker() { + var e2; + return null === (e2 = this.state.communicationLayer) || void 0 === e2 ? void 0 : e2.getRPCMethodTracker(); + } + reject({ channelId: t2 }) { + return function({ channelId: t3, state: n2 }) { + var r2, i2, o2; + return nS(this, void 0, void 0, function* () { + if (!Pw(t3)) + throw jS.RemoteCommunication(`[RemoteCommunication: connectToChannel()] context=${n2.context} invalid channel channelId=${t3}`), new Error(`Invalid channel ${t3}`); + if (n2.isOriginator) + return void jS.RemoteCommunication(`[RemoteCommunication: reject()] context=${n2.context} isOriginator=${n2.isOriginator} channelId=${t3}`); + const { socket: a2 } = null !== (i2 = null === (r2 = n2.communicationLayer) || void 0 === r2 ? void 0 : r2.state) && void 0 !== i2 ? i2 : {}; + (null == a2 ? void 0 : a2.connected) || (jS.RemoteCommunication(`[RemoteCommunication: reject()] context=${n2.context} socket already connected`), null == a2 || a2.connect()), KS(Object.assign(Object.assign({ id: t3, event: ZE.REJECTED }, n2.originatorInfo), { sdkVersion: n2.sdkVersion, commLayerVersion: FE.version, walletVersion: null === (o2 = n2.walletInfo) || void 0 === o2 ? void 0 : o2.version }), n2.communicationServerUrl).catch((e2) => { + console.error("rejectChannel:: Error emitting analytics event", e2); + }), yield new Promise((r3, i3) => { + null == a2 || a2.emit(e.EventType.REJECTED, { channelId: t3 }, (e2, t4) => { + jS.RemoteCommunication(`[RemoteCommunication: reject()] context=${n2.context} socket=${null == a2 ? void 0 : a2.id}`, { error: e2, response: t4 }), e2 ? i3(e2) : r3(t4); + }); + }); + }); + }({ channelId: t2, state: this.state }); + } + disconnect(e2) { + return nS(this, void 0, void 0, function* () { + return Sk({ options: e2, instance: this }); + }); + } + } + function kk(e2, t2, n2, r2) { + return new (n2 || (n2 = Promise))(function(i2, o2) { + function a2(e3) { + try { + u2(r2.next(e3)); + } catch (e4) { + o2(e4); + } + } + function s2(e3) { + try { + u2(r2.throw(e3)); + } catch (e4) { + o2(e4); + } + } + function u2(e3) { + e3.done ? i2(e3.value) : function(e4) { + return e4 instanceof n2 ? e4 : new n2(function(t3) { + t3(e4); + }); + }(e3.value).then(a2, s2); + } + u2((r2 = r2.apply(e2, t2 || [])).next()); + }); + } + function Mk(e2, t2, n2, r2) { + if ("a" === n2 && !r2) + throw new TypeError("Private accessor was defined without a getter"); + if ("function" == typeof t2 ? e2 !== t2 || !r2 : !t2.has(e2)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return "m" === n2 ? r2 : "a" === n2 ? r2.call(e2) : r2 ? r2.value : t2.get(e2); + } + function Ck(e2, t2, n2, r2, i2) { + if ("m" === r2) + throw new TypeError("Private method is not writable"); + if ("a" === r2 && !i2) + throw new TypeError("Private accessor was defined without a setter"); + if ("function" == typeof t2 ? e2 !== t2 || !i2 : !t2.has(e2)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return "a" === r2 ? i2.call(e2, n2) : i2 ? i2.value = n2 : t2.set(e2, n2), n2; + } + !function(e2) { + e2.RENEW = "renew", e2.LINK = "link"; + }(ck || (ck = {})), "function" == typeof SuppressedError && SuppressedError; + var xk = "ERC721", Ak = "ERC1155", Rk = { errors: { disconnected: () => "MetaMask: Disconnected from chain. Attempting to connect.", permanentlyDisconnected: () => "MetaMask: Disconnected from MetaMask background. Page reload required.", sendSiteMetadata: () => "MetaMask: Failed to send site metadata. This is an internal error, please report this bug.", unsupportedSync: (e2) => `MetaMask: The MetaMask Ethereum provider does not support synchronous methods like ${e2} without a callback parameter.`, invalidDuplexStream: () => "Must provide a Node.js-style duplex stream.", invalidNetworkParams: () => "MetaMask: Received invalid network parameters. Please report this bug.", invalidRequestArgs: () => "Expected a single, non-array, object argument.", invalidRequestMethod: () => "'args.method' must be a non-empty string.", invalidRequestParams: () => "'args.params' must be an object or array if provided.", invalidLoggerObject: () => "'args.logger' must be an object if provided.", invalidLoggerMethod: (e2) => `'args.logger' must include required method '${e2}'.` }, info: { connected: (e2) => `MetaMask: Connected to chain with ID "${e2}".` }, warnings: { chainIdDeprecation: "MetaMask: 'ethereum.chainId' is deprecated and may be removed in the future. Please use the 'eth_chainId' RPC method instead.\nFor more information, see: https://github.com/MetaMask/metamask-improvement-proposals/discussions/23", networkVersionDeprecation: "MetaMask: 'ethereum.networkVersion' is deprecated and may be removed in the future. Please use the 'net_version' RPC method instead.\nFor more information, see: https://github.com/MetaMask/metamask-improvement-proposals/discussions/23", selectedAddressDeprecation: "MetaMask: 'ethereum.selectedAddress' is deprecated and may be removed in the future. Please use the 'eth_accounts' RPC method instead.\nFor more information, see: https://github.com/MetaMask/metamask-improvement-proposals/discussions/23", enableDeprecation: "MetaMask: 'ethereum.enable()' is deprecated and may be removed in the future. Please use the 'eth_requestAccounts' RPC method instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1102", sendDeprecation: "MetaMask: 'ethereum.send(...)' is deprecated and may be removed in the future. Please use 'ethereum.sendAsync(...)' or 'ethereum.request(...)' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193", events: { close: "MetaMask: The event 'close' is deprecated and may be removed in the future. Please use 'disconnect' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#disconnect", data: "MetaMask: The event 'data' is deprecated and will be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message", networkChanged: "MetaMask: The event 'networkChanged' is deprecated and may be removed in the future. Use 'chainChanged' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#chainchanged", notification: "MetaMask: The event 'notification' is deprecated and may be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message" }, rpc: { ethDecryptDeprecation: "MetaMask: The RPC method 'eth_decrypt' is deprecated and may be removed in the future.\nFor more information, see: https://medium.com/metamask/metamask-api-method-deprecation-2b0564a84686", ethGetEncryptionPublicKeyDeprecation: "MetaMask: The RPC method 'eth_getEncryptionPublicKey' is deprecated and may be removed in the future.\nFor more information, see: https://medium.com/metamask/metamask-api-method-deprecation-2b0564a84686", walletWatchAssetNFTExperimental: "MetaMask: The RPC method 'wallet_watchAsset' is experimental for ERC721/ERC1155 assets and may change in the future.\nFor more information, see: https://github.com/MetaMask/metamask-improvement-proposals/blob/main/MIPs/mip-1.md and https://github.com/MetaMask/metamask-improvement-proposals/blob/main/PROCESS-GUIDE.md#proposal-lifecycle" }, experimentalMethods: "MetaMask: 'ethereum._metamask' exposes non-standard, experimental methods. They may be removed or changed without warning." } }, Tk = Rk; + function Pk(e2) { + const t2 = { ethDecryptDeprecation: false, ethGetEncryptionPublicKeyDeprecation: false, walletWatchAssetNFTExperimental: false }; + return (n2, r2, i2) => { + var _a2; + t2.ethDecryptDeprecation || "eth_decrypt" !== n2.method ? t2.ethGetEncryptionPublicKeyDeprecation || "eth_getEncryptionPublicKey" !== n2.method ? !t2.walletWatchAssetNFTExperimental && "wallet_watchAsset" === n2.method && [xk, Ak].includes(((_a2 = n2.params) == null ? void 0 : _a2.type) || "") && (e2.warn(Tk.warnings.rpc.walletWatchAssetNFTExperimental), t2.walletWatchAssetNFTExperimental = true) : (e2.warn(Tk.warnings.rpc.ethGetEncryptionPublicKeyDeprecation), t2.ethGetEncryptionPublicKeyDeprecation = true) : (e2.warn(Tk.warnings.rpc.ethDecryptDeprecation), t2.ethDecryptDeprecation = true), i2(); + }; + } + var Lk = 4294967295, Ik = Math.floor(Math.random() * Lk); + function Ok() { + return (e2, t2, n2, r2) => { + const i2 = e2.id, o2 = Ik = (Ik + 1) % Lk; + e2.id = o2, t2.id = o2, n2((n3) => { + e2.id = i2, t2.id = i2, n3(); + }); + }; + } + var Nk = (e2, t2, n2) => { + if (!t2.has(e2)) + throw TypeError("Cannot " + n2); + }, Dk = (e2, t2, n2) => (Nk(e2, t2, "read from private field"), n2 ? n2.call(e2) : t2.get(e2)), jk = (e2, t2, n2) => { + if (t2.has(e2)) + throw TypeError("Cannot add the same private member more than once"); + t2 instanceof WeakSet ? t2.add(e2) : t2.set(e2, n2); + }, Bk = (e2, t2, n2, r2) => (Nk(e2, t2, "write to private field"), r2 ? r2.call(e2, n2) : t2.set(e2, n2), n2), zk = (e2, t2, n2) => (Nk(e2, t2, "access private method"), n2), Uk = { invalidInput: -32e3, resourceNotFound: -32001, resourceUnavailable: -32002, transactionRejected: -32003, methodNotSupported: -32004, limitExceeded: -32005, parse: -32700, invalidRequest: -32600, methodNotFound: -32601, invalidParams: -32602, internal: -32603 }, Fk = { "-32700": { standard: "JSON RPC 2.0", message: "Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text." }, "-32600": { standard: "JSON RPC 2.0", message: "The JSON sent is not a valid Request object." }, "-32601": { standard: "JSON RPC 2.0", message: "The method does not exist / is not available." }, "-32602": { standard: "JSON RPC 2.0", message: "Invalid method parameter(s)." }, "-32603": { standard: "JSON RPC 2.0", message: "Internal JSON-RPC error." }, "-32000": { standard: "EIP-1474", message: "Invalid input." }, "-32001": { standard: "EIP-1474", message: "Resource not found." }, "-32002": { standard: "EIP-1474", message: "Resource unavailable." }, "-32003": { standard: "EIP-1474", message: "Transaction rejected." }, "-32004": { standard: "EIP-1474", message: "Method not supported." }, "-32005": { standard: "EIP-1474", message: "Request limit exceeded." }, 4001: { standard: "EIP-1193", message: "User rejected the request." }, 4100: { standard: "EIP-1193", message: "The requested account and/or method has not been authorized by the user." }, 4200: { standard: "EIP-1193", message: "The requested method is not supported by this Ethereum provider." }, 4900: { standard: "EIP-1193", message: "The provider is disconnected from all chains." }, 4901: { standard: "EIP-1193", message: "The provider is disconnected from the specified chain." } }; + function Kk(e2) { + return Boolean(e2) && "object" == typeof e2 && !Array.isArray(e2); + } + var qk = (e2, t2) => Object.hasOwnProperty.call(e2, t2); + class Hk extends TypeError { + constructor(e2, t2) { + let n2; + const { message: r2, explanation: i2, ...o2 } = e2, { path: a2 } = e2, s2 = 0 === a2.length ? r2 : `At path: ${a2.join(".")} -- ${r2}`; + super(i2 ?? s2), null != i2 && (this.cause = s2), Object.assign(this, o2), this.name = this.constructor.name, this.failures = () => n2 ?? (n2 = [e2, ...t2()]); + } + } + function Wk(e2) { + return "object" == typeof e2 && null != e2; + } + function $k(e2) { + return "symbol" == typeof e2 ? e2.toString() : "string" == typeof e2 ? JSON.stringify(e2) : `${e2}`; + } + function Vk(e2, t2, n2, r2) { + if (true === e2) + return; + false === e2 ? e2 = {} : "string" == typeof e2 && (e2 = { message: e2 }); + const { path: i2, branch: o2 } = t2, { type: a2 } = n2, { refinement: s2, message: u2 = `Expected a value of type \`${a2}\`${s2 ? ` with refinement \`${s2}\`` : ""}, but received: \`${$k(r2)}\`` } = e2; + return { value: r2, type: a2, refinement: s2, key: i2[i2.length - 1], path: i2, branch: o2, ...e2, message: u2 }; + } + function* Yk(e2, t2, n2, r2) { + (function(e3) { + return Wk(e3) && "function" == typeof e3[Symbol.iterator]; + })(e2) || (e2 = [e2]); + for (const i2 of e2) { + const e3 = Vk(i2, t2, n2, r2); + e3 && (yield e3); + } + } + function* Gk(e2, t2, n2 = {}) { + const { path: r2 = [], branch: i2 = [e2], coerce: o2 = false, mask: a2 = false } = n2, s2 = { path: r2, branch: i2 }; + if (o2 && (e2 = t2.coercer(e2, s2), a2 && "type" !== t2.type && Wk(t2.schema) && Wk(e2) && !Array.isArray(e2))) + for (const n3 in e2) + void 0 === t2.schema[n3] && delete e2[n3]; + let u2 = "valid"; + for (const r3 of t2.validator(e2, s2)) + r3.explanation = n2.message, u2 = "not_valid", yield [r3, void 0]; + for (let [l2, c2, d2] of t2.entries(e2, s2)) { + const t3 = Gk(c2, d2, { path: void 0 === l2 ? r2 : [...r2, l2], branch: void 0 === l2 ? i2 : [...i2, c2], coerce: o2, mask: a2, message: n2.message }); + for (const n3 of t3) + n3[0] ? (u2 = null != n3[0].refinement ? "not_refined" : "not_valid", yield [n3[0], void 0]) : o2 && (c2 = n3[1], void 0 === l2 ? e2 = c2 : e2 instanceof Map ? e2.set(l2, c2) : e2 instanceof Set ? e2.add(c2) : Wk(e2) && (void 0 !== c2 || l2 in e2) && (e2[l2] = c2)); + } + if ("not_valid" !== u2) + for (const r3 of t2.refiner(e2, s2)) + r3.explanation = n2.message, u2 = "not_refined", yield [r3, void 0]; + "valid" === u2 && (yield [void 0, e2]); + } + class Zk { + constructor(e2) { + const { type: t2, schema: n2, validator: r2, refiner: i2, coercer: o2 = (e3) => e3, entries: a2 = function* () { + } } = e2; + this.type = t2, this.schema = n2, this.entries = a2, this.coercer = o2, this.validator = r2 ? (e3, t3) => Yk(r2(e3, t3), t3, this, e3) : () => [], this.refiner = i2 ? (e3, t3) => Yk(i2(e3, t3), t3, this, e3) : () => []; + } + assert(e2, t2) { + return Qk(e2, this, t2); + } + create(e2, t2) { + return Jk(e2, this, t2); + } + is(e2) { + return Xk(e2, this); + } + mask(e2, t2) { + return function(e3, t3, n2) { + const r2 = eM(e3, t3, { coerce: true, mask: true, message: n2 }); + if (r2[0]) + throw r2[0]; + return r2[1]; + }(e2, this, t2); + } + validate(e2, t2 = {}) { + return eM(e2, this, t2); + } + } + function Qk(e2, t2, n2) { + const r2 = eM(e2, t2, { message: n2 }); + if (r2[0]) + throw r2[0]; + } + function Jk(e2, t2, n2) { + const r2 = eM(e2, t2, { coerce: true, message: n2 }); + if (r2[0]) + throw r2[0]; + return r2[1]; + } + function Xk(e2, t2) { + return !eM(e2, t2)[0]; + } + function eM(e2, t2, n2 = {}) { + const r2 = Gk(e2, t2, n2), i2 = function(e3) { + const { done: t3, value: n3 } = e3.next(); + return t3 ? void 0 : n3; + }(r2); + if (i2[0]) { + return [new Hk(i2[0], function* () { + for (const e3 of r2) + e3[0] && (yield e3[0]); + }), void 0]; + } + return [void 0, i2[1]]; + } + function tM(e2, t2) { + return new Zk({ type: e2, schema: null, validator: t2 }); + } + function nM(e2) { + let t2; + return new Zk({ type: "lazy", schema: null, *entries(n2, r2) { + t2 ?? (t2 = e2()), yield* t2.entries(n2, r2); + }, validator: (n2, r2) => (t2 ?? (t2 = e2()), t2.validator(n2, r2)), coercer: (n2, r2) => (t2 ?? (t2 = e2()), t2.coercer(n2, r2)), refiner: (n2, r2) => (t2 ?? (t2 = e2()), t2.refiner(n2, r2)) }); + } + function rM(e2) { + return new Zk({ type: "array", schema: e2, *entries(t2) { + if (e2 && Array.isArray(t2)) + for (const [n2, r2] of t2.entries()) + yield [n2, r2, e2]; + }, coercer: (e3) => Array.isArray(e3) ? e3.slice() : e3, validator: (e3) => Array.isArray(e3) || `Expected an array value, but received: ${$k(e3)}` }); + } + function iM(e2) { + const t2 = $k(e2), n2 = typeof e2; + return new Zk({ type: "literal", schema: "string" === n2 || "number" === n2 || "boolean" === n2 ? e2 : null, validator: (n3) => n3 === e2 || `Expected the literal \`${t2}\`, but received: ${$k(n3)}` }); + } + function oM() { + return tM("number", (e2) => "number" == typeof e2 && !isNaN(e2) || `Expected a number, but received: ${$k(e2)}`); + } + function aM(e2) { + const t2 = e2 ? Object.keys(e2) : [], n2 = tM("never", () => false); + return new Zk({ type: "object", schema: e2 || null, *entries(r2) { + if (e2 && Wk(r2)) { + const i2 = new Set(Object.keys(r2)); + for (const n3 of t2) + i2.delete(n3), yield [n3, r2[n3], e2[n3]]; + for (const e3 of i2) + yield [e3, r2[e3], n2]; + } + }, validator: (e3) => Wk(e3) || `Expected an object, but received: ${$k(e3)}`, coercer: (e3) => Wk(e3) ? { ...e3 } : e3 }); + } + function sM(e2) { + return new Zk({ ...e2, validator: (t2, n2) => void 0 === t2 || e2.validator(t2, n2), refiner: (t2, n2) => void 0 === t2 || e2.refiner(t2, n2) }); + } + function uM(e2, t2) { + return new Zk({ type: "record", schema: null, *entries(n2) { + if (Wk(n2)) + for (const r2 in n2) { + const i2 = n2[r2]; + yield [r2, r2, e2], yield [r2, i2, t2]; + } + }, validator: (e3) => Wk(e3) || `Expected an object, but received: ${$k(e3)}` }); + } + function lM() { + return tM("string", (e2) => "string" == typeof e2 || `Expected a string, but received: ${$k(e2)}`); + } + function cM(e2) { + const t2 = e2.map((e3) => e3.type).join(" | "); + return new Zk({ type: "union", schema: null, coercer(t3) { + for (const n2 of e2) { + const [e3, r2] = n2.validate(t3, { coerce: true }); + if (!e3) + return r2; + } + return t3; + }, validator(n2, r2) { + const i2 = []; + for (const t3 of e2) { + const [...e3] = Gk(n2, t3, r2), [o2] = e3; + if (!o2[0]) + return []; + for (const [t4] of e3) + t4 && i2.push(t4); + } + return [`Expected the value to satisfy a union of \`${t2}\`, but received: ${$k(n2)}`, ...i2]; + } }); + } + function dM(e2) { + return function(e3) { + return function(e4) { + return "object" == typeof e4 && null !== e4 && "message" in e4; + }(e3) && "string" == typeof e3.message ? e3.message : function(e4) { + return null == e4; + }(e3) ? "" : String(e3); + }(e2).replace(/\.$/u, ""); + } + function fM(e2, t2) { + var _a2, _b2; + return n2 = e2, Boolean("string" == typeof ((_b2 = (_a2 = n2 == null ? void 0 : n2.prototype) == null ? void 0 : _a2.constructor) == null ? void 0 : _b2.name)) ? new e2({ message: t2 }) : e2({ message: t2 }); + var n2; + } + var hM = class extends Error { + constructor(e2) { + super(e2.message), this.code = "ERR_ASSERTION"; + } + }; + var pM = (e2) => aM(e2); + function mM({ path: e2, branch: t2 }) { + const n2 = e2[e2.length - 1]; + return qk(t2[t2.length - 2], n2); + } + function gM(e2) { + return new Zk({ ...e2, type: `optional ${e2.type}`, validator: (t2, n2) => !mM(n2) || e2.validator(t2, n2), refiner: (t2, n2) => !mM(n2) || e2.refiner(t2, n2) }); + } + var vM, bM, yM, wM = cM([iM(null), tM("boolean", (e2) => "boolean" == typeof e2), tM("finite number", (e2) => Xk(e2, oM()) && Number.isFinite(e2)), lM(), rM(nM(() => wM)), uM(lM(), nM(() => wM))]), _M = (vM = wM, bM = tM("any", () => true), yM = (e2) => (function(e3, t2, n2 = "Assertion failed", r2 = hM) { + try { + Qk(e3, t2); + } catch (e4) { + throw fM(r2, `${n2}: ${dM(e4)}.`); + } + }(e2, wM), JSON.parse(JSON.stringify(e2, (e3, t2) => { + if ("__proto__" !== e3 && "constructor" !== e3) + return t2; + }))), new Zk({ ...vM, coercer: (e2, t2) => Xk(e2, bM) ? vM.coercer(yM(e2, t2), t2) : vM.coercer(e2, t2) })); + function SM(e2) { + try { + return function(e3) { + Jk(e3, _M); + }(e2), true; + } catch { + return false; + } + } + var EM = iM("2.0"), kM = function(e2) { + return new Zk({ ...e2, validator: (t2, n2) => null === t2 || e2.validator(t2, n2), refiner: (t2, n2) => null === t2 || e2.refiner(t2, n2) }); + }(cM([oM(), lM()])), MM = pM({ code: tM("integer", (e2) => "number" == typeof e2 && !isNaN(e2) && Number.isInteger(e2) || `Expected an integer, but received: ${$k(e2)}`), message: lM(), data: gM(_M), stack: gM(lM()) }), CM = cM([uM(lM(), _M), rM(_M)]), xM = pM({ id: kM, jsonrpc: EM, method: lM(), params: gM(CM) }), AM = pM({ jsonrpc: EM, method: lM(), params: gM(CM) }); + function RM(e2) { + return Xk(e2, xM); + } + function TM(e2) { + return Xk(e2, MM); + } + aM({ id: kM, jsonrpc: EM, result: sM(tM("unknown", () => true)), error: sM(MM) }), cM([pM({ id: kM, jsonrpc: EM, result: _M }), pM({ id: kM, jsonrpc: EM, error: MM })]); + var PM, LM, IM = { exports: {} }; + function OM() { + if (LM) + return PM; + LM = 1; + var e2 = 1e3, t2 = 60 * e2, n2 = 60 * t2, r2 = 24 * n2, i2 = 7 * r2, o2 = 365.25 * r2; + function a2(e3, t3, n3, r3) { + var i3 = t3 >= 1.5 * n3; + return Math.round(e3 / n3) + " " + r3 + (i3 ? "s" : ""); + } + return PM = function(s2, u2) { + u2 = u2 || {}; + var l2 = typeof s2; + if ("string" === l2 && s2.length > 0) + return function(a3) { + if ((a3 = String(a3)).length > 100) + return; + var s3 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(a3); + if (!s3) + return; + var u3 = parseFloat(s3[1]); + switch ((s3[2] || "ms").toLowerCase()) { + case "years": + case "year": + case "yrs": + case "yr": + case "y": + return u3 * o2; + case "weeks": + case "week": + case "w": + return u3 * i2; + case "days": + case "day": + case "d": + return u3 * r2; + case "hours": + case "hour": + case "hrs": + case "hr": + case "h": + return u3 * n2; + case "minutes": + case "minute": + case "mins": + case "min": + case "m": + return u3 * t2; + case "seconds": + case "second": + case "secs": + case "sec": + case "s": + return u3 * e2; + case "milliseconds": + case "millisecond": + case "msecs": + case "msec": + case "ms": + return u3; + default: + return; + } + }(s2); + if ("number" === l2 && isFinite(s2)) + return u2.long ? function(i3) { + var o3 = Math.abs(i3); + if (o3 >= r2) + return a2(i3, o3, r2, "day"); + if (o3 >= n2) + return a2(i3, o3, n2, "hour"); + if (o3 >= t2) + return a2(i3, o3, t2, "minute"); + if (o3 >= e2) + return a2(i3, o3, e2, "second"); + return i3 + " ms"; + }(s2) : function(i3) { + var o3 = Math.abs(i3); + if (o3 >= r2) + return Math.round(i3 / r2) + "d"; + if (o3 >= n2) + return Math.round(i3 / n2) + "h"; + if (o3 >= t2) + return Math.round(i3 / t2) + "m"; + if (o3 >= e2) + return Math.round(i3 / e2) + "s"; + return i3 + "ms"; + }(s2); + throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(s2)); + }; + } + var NM = function(e2) { + function t2(e3) { + let r3, i2, o2, a2 = null; + function s2(...e4) { + if (!s2.enabled) + return; + const n3 = s2, i3 = Number(/* @__PURE__ */ new Date()), o3 = i3 - (r3 || i3); + n3.diff = o3, n3.prev = r3, n3.curr = i3, r3 = i3, e4[0] = t2.coerce(e4[0]), "string" != typeof e4[0] && e4.unshift("%O"); + let a3 = 0; + e4[0] = e4[0].replace(/%([a-zA-Z%])/g, (r4, i4) => { + if ("%%" === r4) + return "%"; + a3++; + const o4 = t2.formatters[i4]; + if ("function" == typeof o4) { + const t3 = e4[a3]; + r4 = o4.call(n3, t3), e4.splice(a3, 1), a3--; + } + return r4; + }), t2.formatArgs.call(n3, e4); + (n3.log || t2.log).apply(n3, e4); + } + return s2.namespace = e3, s2.useColors = t2.useColors(), s2.color = t2.selectColor(e3), s2.extend = n2, s2.destroy = t2.destroy, Object.defineProperty(s2, "enabled", { enumerable: true, configurable: false, get: () => null !== a2 ? a2 : (i2 !== t2.namespaces && (i2 = t2.namespaces, o2 = t2.enabled(e3)), o2), set: (e4) => { + a2 = e4; + } }), "function" == typeof t2.init && t2.init(s2), s2; + } + function n2(e3, n3) { + const r3 = t2(this.namespace + (void 0 === n3 ? ":" : n3) + e3); + return r3.log = this.log, r3; + } + function r2(e3) { + return e3.toString().substring(2, e3.toString().length - 2).replace(/\.\*\?$/, "*"); + } + return t2.debug = t2, t2.default = t2, t2.coerce = function(e3) { + if (e3 instanceof Error) + return e3.stack || e3.message; + return e3; + }, t2.disable = function() { + const e3 = [...t2.names.map(r2), ...t2.skips.map(r2).map((e4) => "-" + e4)].join(","); + return t2.enable(""), e3; + }, t2.enable = function(e3) { + let n3; + t2.save(e3), t2.namespaces = e3, t2.names = [], t2.skips = []; + const r3 = ("string" == typeof e3 ? e3 : "").split(/[\s,]+/), i2 = r3.length; + for (n3 = 0; n3 < i2; n3++) + r3[n3] && ("-" === (e3 = r3[n3].replace(/\*/g, ".*?"))[0] ? t2.skips.push(new RegExp("^" + e3.slice(1) + "$")) : t2.names.push(new RegExp("^" + e3 + "$"))); + }, t2.enabled = function(e3) { + if ("*" === e3[e3.length - 1]) + return true; + let n3, r3; + for (n3 = 0, r3 = t2.skips.length; n3 < r3; n3++) + if (t2.skips[n3].test(e3)) + return false; + for (n3 = 0, r3 = t2.names.length; n3 < r3; n3++) + if (t2.names[n3].test(e3)) + return true; + return false; + }, t2.humanize = OM(), t2.destroy = function() { + console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); + }, Object.keys(e2).forEach((n3) => { + t2[n3] = e2[n3]; + }), t2.names = [], t2.skips = [], t2.formatters = {}, t2.selectColor = function(e3) { + let n3 = 0; + for (let t3 = 0; t3 < e3.length; t3++) + n3 = (n3 << 5) - n3 + e3.charCodeAt(t3), n3 |= 0; + return t2.colors[Math.abs(n3) % t2.colors.length]; + }, t2.enable(t2.load()), t2; + }; + !function(e2, t2) { + t2.formatArgs = function(t3) { + if (t3[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + t3[0] + (this.useColors ? "%c " : " ") + "+" + e2.exports.humanize(this.diff), !this.useColors) + return; + const n3 = "color: " + this.color; + t3.splice(1, 0, n3, "color: inherit"); + let r2 = 0, i2 = 0; + t3[0].replace(/%[a-zA-Z%]/g, (e3) => { + "%%" !== e3 && (r2++, "%c" === e3 && (i2 = r2)); + }), t3.splice(i2, 0, n3); + }, t2.save = function(e3) { + try { + e3 ? t2.storage.setItem("debug", e3) : t2.storage.removeItem("debug"); + } catch (e4) { + } + }, t2.load = function() { + let e3; + try { + e3 = t2.storage.getItem("debug"); + } catch (e4) { + } + !e3 && void 0 !== je && "env" in je && (e3 = je.env.DEBUG); + return e3; + }, t2.useColors = function() { + if ("undefined" != typeof window && window.process && ("renderer" === window.process.type || window.process.__nwjs)) + return true; + if ("undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) + return false; + return "undefined" != typeof document && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || "undefined" != typeof window && window.console && (window.console.firebug || window.console.exception && window.console.table) || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); + }, t2.storage = function() { + try { + return localStorage; + } catch (e3) { + } + }(), t2.destroy = (() => { + let e3 = false; + return () => { + e3 || (e3 = true, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")); + }; + })(), t2.colors = ["#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33"], t2.log = console.debug || console.log || (() => { + }), e2.exports = NM(t2); + const { formatters: n2 } = e2.exports; + n2.j = function(e3) { + try { + return JSON.stringify(e3); + } catch (e4) { + return "[UnexpectedJSONParseError]: " + e4.message; + } + }; + }(IM, IM.exports); + var DM = r(IM.exports), jM = Uk.internal, BM = "Unspecified error message. This is a bug, please report it.", zM = { code: jM, message: FM(jM) }, UM = "Unspecified server error."; + function FM(e2, t2 = BM) { + if (function(e3) { + return Number.isInteger(e3); + }(e2)) { + const t3 = e2.toString(); + if (qk(Fk, t3)) + return Fk[t3].message; + if (function(e3) { + return e3 >= -32099 && e3 <= -32e3; + }(e2)) + return UM; + } + return t2; + } + function KM(e2, { fallbackError: t2 = zM, shouldIncludeStack: n2 = true } = {}) { + if (!TM(t2)) + throw new Error("Must provide fallback error with integer number code and string message."); + const r2 = function(e3, t3) { + if (e3 && "object" == typeof e3 && "serialize" in e3 && "function" == typeof e3.serialize) + return e3.serialize(); + if (TM(e3)) + return e3; + const n3 = qM(e3), r3 = { ...t3, data: { cause: n3 } }; + return r3; + }(e2, t2); + return n2 || delete r2.stack, r2; + } + function qM(e2) { + return Array.isArray(e2) ? e2.map((e3) => SM(e3) ? e3 : Kk(e3) ? HM(e3) : null) : Kk(e2) ? HM(e2) : SM(e2) ? e2 : null; + } + function HM(e2) { + return Object.getOwnPropertyNames(e2).reduce((t2, n2) => { + const r2 = e2[n2]; + return SM(r2) && (t2[n2] = r2), t2; + }, {}); + } + var WM = QM; + QM.default = QM, QM.stable = tC, QM.stableStringify = tC; + var $M = "[...]", VM = "[Circular]", YM = [], GM = []; + function ZM() { + return { depthLimit: Number.MAX_SAFE_INTEGER, edgesLimit: Number.MAX_SAFE_INTEGER }; + } + function QM(e2, t2, n2, r2) { + var i2; + void 0 === r2 && (r2 = ZM()), XM(e2, "", 0, [], void 0, 0, r2); + try { + i2 = 0 === GM.length ? JSON.stringify(e2, t2, n2) : JSON.stringify(e2, rC(t2), n2); + } catch (e3) { + return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]"); + } finally { + for (; 0 !== YM.length; ) { + var o2 = YM.pop(); + 4 === o2.length ? Object.defineProperty(o2[0], o2[1], o2[3]) : o2[0][o2[1]] = o2[2]; + } + } + return i2; + } + function JM(e2, t2, n2, r2) { + var i2 = Object.getOwnPropertyDescriptor(r2, n2); + void 0 !== i2.get ? i2.configurable ? (Object.defineProperty(r2, n2, { value: e2 }), YM.push([r2, n2, t2, i2])) : GM.push([t2, n2, e2]) : (r2[n2] = e2, YM.push([r2, n2, t2])); + } + function XM(e2, t2, n2, r2, i2, o2, a2) { + var s2; + if (o2 += 1, "object" == typeof e2 && null !== e2) { + for (s2 = 0; s2 < r2.length; s2++) + if (r2[s2] === e2) + return void JM(VM, e2, t2, i2); + if (void 0 !== a2.depthLimit && o2 > a2.depthLimit) + return void JM($M, e2, t2, i2); + if (void 0 !== a2.edgesLimit && n2 + 1 > a2.edgesLimit) + return void JM($M, e2, t2, i2); + if (r2.push(e2), Array.isArray(e2)) + for (s2 = 0; s2 < e2.length; s2++) + XM(e2[s2], s2, s2, r2, e2, o2, a2); + else { + var u2 = Object.keys(e2); + for (s2 = 0; s2 < u2.length; s2++) { + var l2 = u2[s2]; + XM(e2[l2], l2, s2, r2, e2, o2, a2); + } + } + r2.pop(); + } + } + function eC(e2, t2) { + return e2 < t2 ? -1 : e2 > t2 ? 1 : 0; + } + function tC(e2, t2, n2, r2) { + void 0 === r2 && (r2 = ZM()); + var i2, o2 = nC(e2, "", 0, [], void 0, 0, r2) || e2; + try { + i2 = 0 === GM.length ? JSON.stringify(o2, t2, n2) : JSON.stringify(o2, rC(t2), n2); + } catch (e3) { + return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]"); + } finally { + for (; 0 !== YM.length; ) { + var a2 = YM.pop(); + 4 === a2.length ? Object.defineProperty(a2[0], a2[1], a2[3]) : a2[0][a2[1]] = a2[2]; + } + } + return i2; + } + function nC(e2, t2, n2, r2, i2, o2, a2) { + var s2; + if (o2 += 1, "object" == typeof e2 && null !== e2) { + for (s2 = 0; s2 < r2.length; s2++) + if (r2[s2] === e2) + return void JM(VM, e2, t2, i2); + try { + if ("function" == typeof e2.toJSON) + return; + } catch (e3) { + return; + } + if (void 0 !== a2.depthLimit && o2 > a2.depthLimit) + return void JM($M, e2, t2, i2); + if (void 0 !== a2.edgesLimit && n2 + 1 > a2.edgesLimit) + return void JM($M, e2, t2, i2); + if (r2.push(e2), Array.isArray(e2)) + for (s2 = 0; s2 < e2.length; s2++) + nC(e2[s2], s2, s2, r2, e2, o2, a2); + else { + var u2 = {}, l2 = Object.keys(e2).sort(eC); + for (s2 = 0; s2 < l2.length; s2++) { + var c2 = l2[s2]; + nC(e2[c2], c2, s2, r2, e2, o2, a2), u2[c2] = e2[c2]; + } + if (void 0 === i2) + return u2; + YM.push([i2, t2, e2]), i2[t2] = u2; + } + r2.pop(); + } + } + function rC(e2) { + return e2 = void 0 !== e2 ? e2 : function(e3, t2) { + return t2; + }, function(t2, n2) { + if (GM.length > 0) + for (var r2 = 0; r2 < GM.length; r2++) { + var i2 = GM[r2]; + if (i2[1] === t2 && i2[0] === n2) { + n2 = i2[2], GM.splice(r2, 1); + break; + } + } + return e2.call(this, t2, n2); + }; + } + var iC = r(WM), oC = class extends Error { + constructor(e2, t2, n2) { + if (!Number.isInteger(e2)) + throw new Error('"code" must be an integer.'); + if (!t2 || "string" != typeof t2) + throw new Error('"message" must be a non-empty string.'); + super(t2), this.code = e2, void 0 !== n2 && (this.data = n2); + } + serialize() { + const e2 = { code: this.code, message: this.message }; + return void 0 !== this.data && (e2.data = this.data, function(e3) { + if ("object" != typeof e3 || null === e3) + return false; + try { + let t2 = e3; + for (; null !== Object.getPrototypeOf(t2); ) + t2 = Object.getPrototypeOf(t2); + return Object.getPrototypeOf(e3) === t2; + } catch (e4) { + return false; + } + }(this.data) && (e2.data.cause = qM(this.data.cause))), this.stack && (e2.stack = this.stack), e2; + } + toString() { + return iC(this.serialize(), aC, 2); + } + }; + function aC(e2, t2) { + if ("[Circular]" !== t2) + return t2; + } + var sC = (e2) => uC(Uk.invalidRequest, e2); + function uC(e2, t2) { + const [n2, r2] = function(e3) { + if (e3) { + if ("string" == typeof e3) + return [e3]; + if ("object" == typeof e3 && !Array.isArray(e3)) { + const { message: t3, data: n3 } = e3; + if (t3 && "string" != typeof t3) + throw new Error("Must specify string message."); + return [t3 ?? void 0, n3]; + } + } + return []; + }(t2); + return new oC(e2, n2 ?? FM(e2), r2); + } + var lC = {}; + Object.defineProperty(lC, "__esModule", { value: true }); + const cC = nt; + function dC(e2, t2, n2) { + try { + Reflect.apply(e2, t2, n2); + } catch (e3) { + setTimeout(() => { + throw e3; + }); + } + } + let fC = class extends cC.EventEmitter { + emit(e2, ...t2) { + let n2 = "error" === e2; + const r2 = this._events; + if (void 0 !== r2) + n2 = n2 && void 0 === r2.error; + else if (!n2) + return false; + if (n2) { + let e3; + if (t2.length > 0 && ([e3] = t2), e3 instanceof Error) + throw e3; + const n3 = new Error("Unhandled error." + (e3 ? ` (${e3.message})` : "")); + throw n3.context = e3, n3; + } + const i2 = r2[e2]; + if (void 0 === i2) + return false; + if ("function" == typeof i2) + dC(i2, this, t2); + else { + const e3 = i2.length, n3 = function(e4) { + const t3 = e4.length, n4 = new Array(t3); + for (let r3 = 0; r3 < t3; r3 += 1) + n4[r3] = e4[r3]; + return n4; + }(i2); + for (let r3 = 0; r3 < e3; r3 += 1) + dC(n3[r3], this, t2); + } + return true; + } + }; + var hC, pC, mC, gC, vC, bC, yC, wC, _C, SC, EC, kC, MC, CC, xC, AC, RC, TC, PC, LC = lC.default = fC, IC = class e2 extends LC { + constructor({ notificationHandler: e3 } = {}) { + super(), jk(this, gC), jk(this, bC), jk(this, wC), jk(this, hC, false), jk(this, pC, void 0), jk(this, mC, void 0), Bk(this, pC, []), Bk(this, mC, e3); + } + destroy() { + Dk(this, pC).forEach((e3) => { + "destroy" in e3 && "function" == typeof e3.destroy && e3.destroy(); + }), Bk(this, pC, []), Bk(this, hC, true); + } + push(e3) { + zk(this, gC, vC).call(this), Dk(this, pC).push(e3); + } + handle(e3, t2) { + if (zk(this, gC, vC).call(this), t2 && "function" != typeof t2) + throw new Error('"callback" must be a function if provided.'); + return Array.isArray(e3) ? t2 ? zk(this, bC, yC).call(this, e3, t2) : zk(this, bC, yC).call(this, e3) : t2 ? zk(this, wC, _C).call(this, e3, t2) : this._promiseHandle(e3); + } + asMiddleware() { + return zk(this, gC, vC).call(this), async (t2, n2, r2, i2) => { + var o2, a2; + try { + const [s2, u2, l2] = await zk(o2 = e2, kC, MC).call(o2, t2, n2, Dk(this, pC)); + return u2 ? (await zk(a2 = e2, AC, RC).call(a2, l2), i2(s2)) : r2(async (t3) => { + var n3; + try { + await zk(n3 = e2, AC, RC).call(n3, l2); + } catch (e3) { + return t3(e3); + } + return t3(); + }); + } catch (e3) { + return i2(e3); + } + }; + } + async _promiseHandle(e3) { + return new Promise((t2, n2) => { + zk(this, wC, _C).call(this, e3, (e4, r2) => { + e4 && void 0 === r2 ? n2(e4) : t2(r2); + }).catch(n2); + }); + } + }; + hC = /* @__PURE__ */ new WeakMap(), pC = /* @__PURE__ */ new WeakMap(), mC = /* @__PURE__ */ new WeakMap(), gC = /* @__PURE__ */ new WeakSet(), vC = function() { + if (Dk(this, hC)) + throw new Error("This engine is destroyed and can no longer be used."); + }, bC = /* @__PURE__ */ new WeakSet(), yC = async function(e2, t2) { + try { + if (0 === e2.length) { + const e3 = [{ id: null, jsonrpc: "2.0", error: new oC(Uk.invalidRequest, "Request batch must contain plain objects. Received an empty array") }]; + return t2 ? t2(null, e3) : e3; + } + const n2 = (await Promise.all(e2.map(this._promiseHandle.bind(this)))).filter((e3) => void 0 !== e3); + return t2 ? t2(null, n2) : n2; + } catch (e3) { + if (t2) + return t2(e3); + throw e3; + } + }, wC = /* @__PURE__ */ new WeakSet(), _C = async function(e2, t2) { + var n2; + if (!e2 || Array.isArray(e2) || "object" != typeof e2) { + const n3 = new oC(Uk.invalidRequest, "Requests must be plain objects. Received: " + typeof e2, { request: e2 }); + return t2(n3, { id: null, jsonrpc: "2.0", error: n3 }); + } + if ("string" != typeof e2.method) { + const n3 = new oC(Uk.invalidRequest, "Must specify a string method. Received: " + typeof e2.method, { request: e2 }); + return Dk(this, mC) && !RM(e2) ? t2(null) : t2(n3, { id: e2.id ?? null, jsonrpc: "2.0", error: n3 }); + } + if (Dk(this, mC) && function(e3) { + return Xk(e3, AM); + }(e2) && !RM(e2)) { + try { + await Dk(this, mC).call(this, e2); + } catch (e3) { + return t2(e3); + } + return t2(null); + } + let r2 = null; + const i2 = { ...e2 }, o2 = { id: i2.id, jsonrpc: i2.jsonrpc }; + try { + await zk(n2 = IC, SC, EC).call(n2, i2, o2, Dk(this, pC)); + } catch (e3) { + r2 = e3; + } + return r2 && (delete o2.result, o2.error || (o2.error = KM(r2))), t2(r2, o2); + }, SC = /* @__PURE__ */ new WeakSet(), EC = async function(e2, t2, n2) { + var r2, i2, o2; + const [a2, s2, u2] = await zk(r2 = IC, kC, MC).call(r2, e2, t2, n2); + if (zk(i2 = IC, TC, PC).call(i2, e2, t2, s2), await zk(o2 = IC, AC, RC).call(o2, u2), a2) + throw a2; + }, kC = /* @__PURE__ */ new WeakSet(), MC = async function(e2, t2, n2) { + var r2; + const i2 = []; + let o2 = null, a2 = false; + for (const s2 of n2) + if ([o2, a2] = await zk(r2 = IC, CC, xC).call(r2, e2, t2, s2, i2), a2) + break; + return [o2, a2, i2.reverse()]; + }, CC = /* @__PURE__ */ new WeakSet(), xC = async function(e2, t2, n2, r2) { + return new Promise((i2) => { + const o2 = (e3) => { + const n3 = e3 || t2.error; + n3 && (t2.error = KM(n3)), i2([n3, true]); + }, a2 = (n3) => { + t2.error ? o2(t2.error) : (n3 && ("function" != typeof n3 && o2(new oC(Uk.internal, `JsonRpcEngine: "next" return handlers must be functions. Received "${typeof n3}" for request: +${NC(e2)}`, { request: e2 })), r2.push(n3)), i2([null, false])); + }; + try { + n2(e2, t2, a2, o2); + } catch (e3) { + o2(e3); + } + }); + }, AC = /* @__PURE__ */ new WeakSet(), RC = async function(e2) { + for (const t2 of e2) + await new Promise((e3, n2) => { + t2((t3) => t3 ? n2(t3) : e3()); + }); + }, TC = /* @__PURE__ */ new WeakSet(), PC = function(e2, t2, n2) { + if (!qk(t2, "result") && !qk(t2, "error")) + throw new oC(Uk.internal, `JsonRpcEngine: Response has no error or result for request: +${NC(e2)}`, { request: e2 }); + if (!n2) + throw new oC(Uk.internal, `JsonRpcEngine: Nothing ended request: +${NC(e2)}`, { request: e2 }); + }, jk(IC, SC), jk(IC, kC), jk(IC, CC), jk(IC, AC), jk(IC, TC); + var OC = IC; + function NC(e2) { + return JSON.stringify(e2, null, 2); + } + var DC = Object.freeze(["eth_subscription"]), jC = (e2 = console) => [Ok(), BC(e2), Pk(e2)]; + function BC(e2) { + return (t2, n2, r2) => { + "string" == typeof t2.method && t2.method || (n2.error = sC({ message: "The request 'method' must be a non-empty string.", data: t2 })), r2((t3) => { + const { error: r3 } = n2; + return r3 ? (e2.error(`MetaMask - RPC Error: ${r3.message}`, r3), t3()) : t3(); + }); + }; + } + var zC = (e2, t2, n2 = true) => (r2, i2) => { + r2 || i2.error ? t2(r2 || i2.error) : !n2 || Array.isArray(i2) ? e2(i2) : e2(i2.result); + }, UC = (e2) => Boolean(e2) && "string" == typeof e2 && e2.startsWith("0x"), FC = () => { + }; + async function KC(e2, t2) { + try { + const t3 = await async function() { + return { name: qC(window), icon: await HC(window) }; + }(); + e2.handle({ jsonrpc: "2.0", id: 1, method: "metamask_sendDomainMetadata", params: t3 }, FC); + } catch (e3) { + t2.error({ message: Tk.errors.sendSiteMetadata(), originalError: e3 }); + } + } + function qC(e2) { + const { document: t2 } = e2, n2 = t2.querySelector('head > meta[property="og:site_name"]'); + if (n2) + return n2.content; + const r2 = t2.querySelector('head > meta[name="title"]'); + return r2 ? r2.content : t2.title && t2.title.length > 0 ? t2.title : window.location.hostname; + } + async function HC(e2) { + const { document: t2 } = e2, n2 = t2.querySelectorAll('head > link[rel~="icon"]'); + for (const e3 of Array.from(n2)) + if (e3 && await WC(e3.href)) + return e3.href; + return null; + } + async function WC(e2) { + return new Promise((t2, n2) => { + try { + const n3 = document.createElement("img"); + n3.onload = () => t2(true), n3.onerror = () => t2(false), n3.src = e2; + } catch (e3) { + n2(e3); + } + }); + } + var $C = (e2, t2, n2) => { + if (!t2.has(e2)) + throw TypeError("Cannot " + n2); + }, VC = (e2, t2, n2) => ($C(e2, t2, "read from private field"), n2 ? n2.call(e2) : t2.get(e2)), YC = (e2, t2, n2) => { + if (t2.has(e2)) + throw TypeError("Cannot add the same private member more than once"); + t2 instanceof WeakSet ? t2.add(e2) : t2.set(e2, n2); + }, GC = (e2, t2, n2, r2) => ($C(e2, t2, "write to private field"), r2 ? r2.call(e2, n2) : t2.set(e2, n2), n2); + function ZC(e2, t2, n2) { + try { + Reflect.apply(e2, t2, n2); + } catch (e3) { + setTimeout(() => { + throw e3; + }); + } + } + class QC extends Ze { + emit(e2, ...t2) { + let n2 = "error" === e2; + const r2 = this._events; + if (void 0 !== r2) + n2 = n2 && void 0 === r2.error; + else if (!n2) + return false; + if (n2) { + let e3; + if (t2.length > 0 && ([e3] = t2), e3 instanceof Error) + throw e3; + const n3 = new Error("Unhandled error." + (e3 ? ` (${e3.message})` : "")); + throw n3.context = e3, n3; + } + const i2 = r2[e2]; + if (void 0 === i2) + return false; + if ("function" == typeof i2) + ZC(i2, this, t2); + else { + const e3 = i2.length, n3 = function(e4) { + const t3 = e4.length, n4 = new Array(t3); + for (let r3 = 0; r3 < t3; r3 += 1) + n4[r3] = e4[r3]; + return n4; + }(i2); + for (let r3 = 0; r3 < e3; r3 += 1) + ZC(n3[r3], this, t2); + } + return true; + } + } + var JC, XC, ex = function e2(t2, n2) { + if (t2 === n2) + return true; + if (t2 && n2 && "object" == typeof t2 && "object" == typeof n2) { + if (t2.constructor !== n2.constructor) + return false; + var r2, i2, o2; + if (Array.isArray(t2)) { + if ((r2 = t2.length) != n2.length) + return false; + for (i2 = r2; 0 != i2--; ) + if (!e2(t2[i2], n2[i2])) + return false; + return true; + } + if (t2.constructor === RegExp) + return t2.source === n2.source && t2.flags === n2.flags; + if (t2.valueOf !== Object.prototype.valueOf) + return t2.valueOf() === n2.valueOf(); + if (t2.toString !== Object.prototype.toString) + return t2.toString() === n2.toString(); + if ((r2 = (o2 = Object.keys(t2)).length) !== Object.keys(n2).length) + return false; + for (i2 = r2; 0 != i2--; ) + if (!Object.prototype.hasOwnProperty.call(n2, o2[i2])) + return false; + for (i2 = r2; 0 != i2--; ) { + var a2 = o2[i2]; + if (!e2(t2[a2], n2[a2])) + return false; + } + return true; + } + return t2 != t2 && n2 != n2; + }, tx = r(ex), nx = class e2 extends QC { + constructor({ logger: t2 = console, maxEventListeners: n2 = 100, rpcMiddleware: r2 = [] } = {}) { + super(), YC(this, JC, void 0), YC(this, XC, void 0), this._log = t2, this.setMaxListeners(n2), this._state = { ...e2._defaultState }, GC(this, XC, null), GC(this, JC, null), this._handleAccountsChanged = this._handleAccountsChanged.bind(this), this._handleConnect = this._handleConnect.bind(this), this._handleChainChanged = this._handleChainChanged.bind(this), this._handleDisconnect = this._handleDisconnect.bind(this), this._handleUnlockStateChanged = this._handleUnlockStateChanged.bind(this), this._rpcRequest = this._rpcRequest.bind(this), this.request = this.request.bind(this); + const i2 = new OC(); + r2.forEach((e3) => i2.push(e3)), this._rpcEngine = i2; + } + get chainId() { + return VC(this, JC); + } + get selectedAddress() { + return VC(this, XC); + } + isConnected() { + return this._state.isConnected; + } + async request(e3) { + if (!e3 || "object" != typeof e3 || Array.isArray(e3)) + throw sC({ message: Tk.errors.invalidRequestArgs(), data: e3 }); + const { method: t2, params: n2 } = e3; + if ("string" != typeof t2 || 0 === t2.length) + throw sC({ message: Tk.errors.invalidRequestMethod(), data: e3 }); + if (void 0 !== n2 && !Array.isArray(n2) && ("object" != typeof n2 || null === n2)) + throw sC({ message: Tk.errors.invalidRequestParams(), data: e3 }); + const r2 = null == n2 ? { method: t2 } : { method: t2, params: n2 }; + return new Promise((e4, t3) => { + this._rpcRequest(r2, zC(e4, t3)); + }); + } + _initializeState(e3) { + if (this._state.initialized) + throw new Error("Provider already initialized."); + if (e3) { + const { accounts: t2, chainId: n2, isUnlocked: r2, networkVersion: i2 } = e3; + this._handleConnect(n2), this._handleChainChanged({ chainId: n2, networkVersion: i2 }), this._handleUnlockStateChanged({ accounts: t2, isUnlocked: r2 }), this._handleAccountsChanged(t2); + } + this._state.initialized = true, this.emit("_initialized"); + } + _rpcRequest(e3, t2) { + let n2 = t2; + return Array.isArray(e3) || (e3.jsonrpc || (e3.jsonrpc = "2.0"), "eth_accounts" !== e3.method && "eth_requestAccounts" !== e3.method || (n2 = (n3, r2) => { + this._handleAccountsChanged(r2.result ?? [], "eth_accounts" === e3.method), t2(n3, r2); + })), this._rpcEngine.handle(e3, n2); + } + _handleConnect(e3) { + this._state.isConnected || (this._state.isConnected = true, this.emit("connect", { chainId: e3 }), this._log.debug(Tk.info.connected(e3))); + } + _handleDisconnect(e3, t2) { + if (this._state.isConnected || !this._state.isPermanentlyDisconnected && !e3) { + let n2; + this._state.isConnected = false, e3 ? (n2 = new oC(1013, t2 ?? Tk.errors.disconnected()), this._log.debug(n2)) : (n2 = new oC(1011, t2 ?? Tk.errors.permanentlyDisconnected()), this._log.error(n2), GC(this, JC, null), this._state.accounts = null, GC(this, XC, null), this._state.isUnlocked = false, this._state.isPermanentlyDisconnected = true), this.emit("disconnect", n2); + } + } + _handleChainChanged({ chainId: e3 } = {}) { + UC(e3) ? (this._handleConnect(e3), e3 !== VC(this, JC) && (GC(this, JC, e3), this._state.initialized && this.emit("chainChanged", VC(this, JC)))) : this._log.error(Tk.errors.invalidNetworkParams(), { chainId: e3 }); + } + _handleAccountsChanged(e3, t2 = false) { + let n2 = e3; + Array.isArray(e3) || (this._log.error("MetaMask: Received invalid accounts parameter. Please report this bug.", e3), n2 = []); + for (const t3 of e3) + if ("string" != typeof t3) { + this._log.error("MetaMask: Received non-string account. Please report this bug.", e3), n2 = []; + break; + } + if (!tx(this._state.accounts, n2) && (t2 && null !== this._state.accounts && this._log.error("MetaMask: 'eth_accounts' unexpectedly updated accounts. Please report this bug.", n2), this._state.accounts = n2, VC(this, XC) !== n2[0] && GC(this, XC, n2[0] || null), this._state.initialized)) { + const e4 = [...n2]; + this.emit("accountsChanged", e4); + } + } + _handleUnlockStateChanged({ accounts: e3, isUnlocked: t2 } = {}) { + "boolean" == typeof t2 ? t2 !== this._state.isUnlocked && (this._state.isUnlocked = t2, this._handleAccountsChanged(e3 ?? [])) : this._log.error("MetaMask: Received invalid isUnlocked parameter. Please report this bug."); + } + }; + JC = /* @__PURE__ */ new WeakMap(), XC = /* @__PURE__ */ new WeakMap(), nx._defaultState = { accounts: null, isConnected: false, isUnlocked: false, initialized: false, isPermanentlyDisconnected: false }; + var rx = nx; + function ix(e2 = {}) { + const t2 = {}, n2 = new Hn.Duplex({ objectMode: true, read: () => { + }, write: function(n3, o2, a2) { + let s2 = null; + try { + !n3.id ? function(n4) { + (e2 == null ? void 0 : e2.retryOnMessage) && n4.method === e2.retryOnMessage && Object.values(t2).forEach(({ req: e3, retryCount: n5 = 0 }) => { + if (!e3.id) + return; + if (n5 >= 3) + throw new Error(`StreamMiddleware - Retry limit exceeded for request id "${e3.id}"`); + const r3 = t2[e3.id]; + r3 && (r3.retryCount = n5 + 1), i2(e3); + }); + r2.emit("notification", n4); + }(n3) : function(e3) { + const { id: n4 } = e3; + if (null === n4) + return; + const r3 = t2[n4]; + if (!r3) + return void console.warn(`StreamMiddleware - Unknown response id "${n4}"`); + delete t2[n4], Object.assign(r3.res, e3), setTimeout(r3.end); + }(n3); + } catch (e3) { + s2 = e3; + } + a2(s2); + } }), r2 = new LC(); + return { events: r2, middleware: (e3, n3, r3, o2) => { + t2[e3.id] = { req: e3, res: n3, next: r3, end: o2 }, i2(e3); + }, stream: n2 }; + function i2(e3) { + n2.push(e3); + } + } + var ox = {}, ax = { exports: {} }, sx = function e2(t2, n2) { + if (t2 && n2) + return e2(t2)(n2); + if ("function" != typeof t2) + throw new TypeError("need wrapper function"); + return Object.keys(t2).forEach(function(e3) { + r2[e3] = t2[e3]; + }), r2; + function r2() { + for (var e3 = new Array(arguments.length), n3 = 0; n3 < e3.length; n3++) + e3[n3] = arguments[n3]; + var r3 = t2.apply(this, e3), i2 = e3[e3.length - 1]; + return "function" == typeof r3 && r3 !== i2 && Object.keys(i2).forEach(function(e4) { + r3[e4] = i2[e4]; + }), r3; + } + }; + var ux = sx; + function lx(e2) { + var t2 = function() { + return t2.called ? t2.value : (t2.called = true, t2.value = e2.apply(this, arguments)); + }; + return t2.called = false, t2; + } + function cx(e2) { + var t2 = function() { + if (t2.called) + throw new Error(t2.onceError); + return t2.called = true, t2.value = e2.apply(this, arguments); + }, n2 = e2.name || "Function wrapped with `once`"; + return t2.onceError = n2 + " shouldn't be called more than once", t2.called = false, t2; + } + ax.exports = ux(lx), ax.exports.strict = ux(cx), lx.proto = lx(function() { + Object.defineProperty(Function.prototype, "once", { value: function() { + return lx(this); + }, configurable: true }), Object.defineProperty(Function.prototype, "onceStrict", { value: function() { + return cx(this); + }, configurable: true }); + }); + var dx = ax.exports, fx = {}; + Object.defineProperty(fx, "__esModule", { value: true }), fx.Substream = void 0; + const hx = Hn; + class px extends hx.Duplex { + constructor({ parent: e2, name: t2 }) { + super({ objectMode: true }), this._parent = e2, this._name = t2; + } + _read() { + } + _write(e2, t2, n2) { + this._parent.push({ name: this._name, data: e2 }), n2(); + } + } + fx.Substream = px; + var mx = n && n.__importDefault || function(e2) { + return e2 && e2.__esModule ? e2 : { default: e2 }; + }; + Object.defineProperty(ox, "__esModule", { value: true }), ox.ObjectMultiplex = void 0; + const gx = Hn, vx = mx(dx), bx = fx, yx = Symbol("IGNORE_SUBSTREAM"); + let wx = class extends gx.Duplex { + constructor(e2 = {}) { + super(Object.assign(Object.assign({}, e2), { objectMode: true })), this._substreams = {}; + } + createStream(e2) { + if (this.destroyed) + throw new Error(`ObjectMultiplex - parent stream for name "${e2}" already destroyed`); + if (this._readableState.ended || this._writableState.ended) + throw new Error(`ObjectMultiplex - parent stream for name "${e2}" already ended`); + if (!e2) + throw new Error("ObjectMultiplex - name must not be empty"); + if (this._substreams[e2]) + throw new Error(`ObjectMultiplex - Substream for name "${e2}" already exists`); + const t2 = new bx.Substream({ parent: this, name: e2 }); + return this._substreams[e2] = t2, function(e3, t3) { + const n2 = (0, vx.default)(t3); + (0, gx.finished)(e3, { readable: false }, n2), (0, gx.finished)(e3, { writable: false }, n2); + }(this, (e3) => t2.destroy(e3 || void 0)), t2; + } + ignoreStream(e2) { + if (!e2) + throw new Error("ObjectMultiplex - name must not be empty"); + if (this._substreams[e2]) + throw new Error(`ObjectMultiplex - Substream for name "${e2}" already exists`); + this._substreams[e2] = yx; + } + _read() { + } + _write(e2, t2, n2) { + const { name: r2, data: i2 } = e2; + if (!r2) + return console.warn(`ObjectMultiplex - malformed chunk without name "${e2}"`), n2(); + const o2 = this._substreams[r2]; + return o2 ? (o2 !== yx && o2.push(i2), n2()) : (console.warn(`ObjectMultiplex - orphaned data for stream "${r2}"`), n2()); + } + }; + ox.ObjectMultiplex = wx; + var _x = r(ox.ObjectMultiplex); + const Sx = (e2) => null !== e2 && "object" == typeof e2 && "function" == typeof e2.pipe; + Sx.writable = (e2) => Sx(e2) && false !== e2.writable && "function" == typeof e2._write && "object" == typeof e2._writableState, Sx.readable = (e2) => Sx(e2) && false !== e2.readable && "function" == typeof e2._read && "object" == typeof e2._readableState, Sx.duplex = (e2) => Sx.writable(e2) && Sx.readable(e2), Sx.transform = (e2) => Sx.duplex(e2) && "function" == typeof e2._transform; + var Ex, kx = Sx, Mx = class extends rx { + constructor(e2, { jsonRpcStreamName: t2, logger: n2 = console, maxEventListeners: r2 = 100, rpcMiddleware: i2 = [] }) { + if (super({ logger: n2, maxEventListeners: r2, rpcMiddleware: i2 }), !kx.duplex(e2)) + throw new Error(Tk.errors.invalidDuplexStream()); + this._handleStreamDisconnect = this._handleStreamDisconnect.bind(this); + const o2 = new _x(); + Hn.pipeline(e2, o2, e2, this._handleStreamDisconnect.bind(this, "MetaMask")), this._jsonRpcConnection = ix({ retryOnMessage: "METAMASK_EXTENSION_CONNECT_CAN_RETRY" }), Hn.pipeline(this._jsonRpcConnection.stream, o2.createStream(t2), this._jsonRpcConnection.stream, this._handleStreamDisconnect.bind(this, "MetaMask RpcProvider")), this._rpcEngine.push(this._jsonRpcConnection.middleware), this._jsonRpcConnection.events.on("notification", (t3) => { + const { method: n3, params: r3 } = t3; + "metamask_accountsChanged" === n3 ? this._handleAccountsChanged(r3) : "metamask_unlockStateChanged" === n3 ? this._handleUnlockStateChanged(r3) : "metamask_chainChanged" === n3 ? this._handleChainChanged(r3) : DC.includes(n3) ? this.emit("message", { type: n3, data: r3 }) : "METAMASK_STREAM_FAILURE" === n3 && e2.destroy(new Error(Tk.errors.permanentlyDisconnected())); + }); + } + async _initializeStateAsync() { + let e2; + try { + e2 = await this.request({ method: "metamask_getProviderState" }); + } catch (e3) { + this._log.error("MetaMask: Failed to get initial state. Please report this bug.", e3); + } + this._initializeState(e2); + } + _handleStreamDisconnect(e2, t2) { + let n2 = `MetaMask: Lost connection to "${e2}".`; + (t2 == null ? void 0 : t2.stack) && (n2 += ` +${t2.stack}`), this._log.warn(n2), this.listenerCount("error") > 0 && this.emit("error", n2), this._handleDisconnect(false, t2 ? t2.message : void 0); + } + _handleChainChanged({ chainId: e2, networkVersion: t2 } = {}) { + UC(e2) && ((e3) => Boolean(e3) && "string" == typeof e3)(t2) ? "loading" === t2 ? this._handleDisconnect(true) : super._handleChainChanged({ chainId: e2 }) : this._log.error(Tk.errors.invalidNetworkParams(), { chainId: e2, networkVersion: t2 }); + } + }, Cx = class extends Mx { + constructor(e2, { jsonRpcStreamName: t2 = "metamask-provider", logger: n2 = console, maxEventListeners: r2 = 100, shouldSendMetadata: i2 } = {}) { + if (super(e2, { jsonRpcStreamName: t2, logger: n2, maxEventListeners: r2, rpcMiddleware: jC(n2) }), this._sentWarnings = { chainId: false, networkVersion: false, selectedAddress: false, enable: false, experimentalMethods: false, send: false, events: { close: false, data: false, networkChanged: false, notification: false } }, YC(this, Ex, void 0), this._initializeStateAsync(), GC(this, Ex, null), this.isMetaMask = true, this._sendSync = this._sendSync.bind(this), this.enable = this.enable.bind(this), this.send = this.send.bind(this), this.sendAsync = this.sendAsync.bind(this), this._warnOfDeprecation = this._warnOfDeprecation.bind(this), this._metamask = this._getExperimentalApi(), this._jsonRpcConnection.events.on("notification", (e3) => { + const { method: t3 } = e3; + DC.includes(t3) && (this.emit("data", e3), this.emit("notification", e3.params.result)); + }), i2) + if ("complete" === document.readyState) + KC(this._rpcEngine, this._log); + else { + const e3 = () => { + KC(this._rpcEngine, this._log), window.removeEventListener("DOMContentLoaded", e3); + }; + window.addEventListener("DOMContentLoaded", e3); + } + } + get chainId() { + return this._sentWarnings.chainId || (this._log.warn(Tk.warnings.chainIdDeprecation), this._sentWarnings.chainId = true), super.chainId; + } + get networkVersion() { + return this._sentWarnings.networkVersion || (this._log.warn(Tk.warnings.networkVersionDeprecation), this._sentWarnings.networkVersion = true), VC(this, Ex); + } + get selectedAddress() { + return this._sentWarnings.selectedAddress || (this._log.warn(Tk.warnings.selectedAddressDeprecation), this._sentWarnings.selectedAddress = true), super.selectedAddress; + } + sendAsync(e2, t2) { + this._rpcRequest(e2, t2); + } + addListener(e2, t2) { + return this._warnOfDeprecation(e2), super.addListener(e2, t2); + } + on(e2, t2) { + return this._warnOfDeprecation(e2), super.on(e2, t2); + } + once(e2, t2) { + return this._warnOfDeprecation(e2), super.once(e2, t2); + } + prependListener(e2, t2) { + return this._warnOfDeprecation(e2), super.prependListener(e2, t2); + } + prependOnceListener(e2, t2) { + return this._warnOfDeprecation(e2), super.prependOnceListener(e2, t2); + } + _handleDisconnect(e2, t2) { + super._handleDisconnect(e2, t2), VC(this, Ex) && !e2 && GC(this, Ex, null); + } + _warnOfDeprecation(e2) { + var _a2; + false === ((_a2 = this._sentWarnings) == null ? void 0 : _a2.events[e2]) && (this._log.warn(Tk.warnings.events[e2]), this._sentWarnings.events[e2] = true); + } + async enable() { + return this._sentWarnings.enable || (this._log.warn(Tk.warnings.enableDeprecation), this._sentWarnings.enable = true), new Promise((e2, t2) => { + try { + this._rpcRequest({ method: "eth_requestAccounts", params: [] }, zC(e2, t2)); + } catch (e3) { + t2(e3); + } + }); + } + send(e2, t2) { + return this._sentWarnings.send || (this._log.warn(Tk.warnings.sendDeprecation), this._sentWarnings.send = true), "string" != typeof e2 || t2 && !Array.isArray(t2) ? e2 && "object" == typeof e2 && "function" == typeof t2 ? this._rpcRequest(e2, t2) : this._sendSync(e2) : new Promise((n2, r2) => { + try { + this._rpcRequest({ method: e2, params: t2 }, zC(n2, r2, false)); + } catch (e3) { + r2(e3); + } + }); + } + _sendSync(e2) { + let t2; + switch (e2.method) { + case "eth_accounts": + t2 = this.selectedAddress ? [this.selectedAddress] : []; + break; + case "eth_coinbase": + t2 = this.selectedAddress ?? null; + break; + case "eth_uninstallFilter": + this._rpcRequest(e2, FC), t2 = true; + break; + case "net_version": + t2 = VC(this, Ex) ?? null; + break; + default: + throw new Error(Tk.errors.unsupportedSync(e2.method)); + } + return { id: e2.id, jsonrpc: e2.jsonrpc, result: t2 }; + } + _getExperimentalApi() { + return new Proxy({ isUnlocked: async () => (this._state.initialized || await new Promise((e2) => { + this.on("_initialized", () => e2()); + }), this._state.isUnlocked), requestBatch: async (e2) => { + if (!Array.isArray(e2)) + throw sC({ message: "Batch requests must be made with an array of request objects.", data: e2 }); + return new Promise((t2, n2) => { + this._rpcRequest(e2, zC(t2, n2)); + }); + } }, { get: (e2, t2, ...n2) => (this._sentWarnings.experimentalMethods || (this._log.warn(Tk.warnings.experimentalMethods), this._sentWarnings.experimentalMethods = true), Reflect.get(e2, t2, ...n2)) }); + } + _handleChainChanged({ chainId: e2, networkVersion: t2 } = {}) { + super._handleChainChanged({ chainId: e2, networkVersion: t2 }), this._state.isConnected && t2 !== VC(this, Ex) && (GC(this, Ex, t2), this._state.initialized && this.emit("networkChanged", VC(this, Ex))); + } + }; + Ex = /* @__PURE__ */ new WeakMap(); + const xx = DM("MM_SDK"); + xx.color = "#FFAC1C"; + var Ax = {}, Rx = {}; + Object.defineProperty(Rx, "__esModule", { value: true }), Rx.EthereumProviderError = Rx.EthereumRpcError = void 0; + const Tx = WM; + class Px extends Error { + constructor(e2, t2, n2) { + if (!Number.isInteger(e2)) + throw new Error('"code" must be an integer.'); + if (!t2 || "string" != typeof t2) + throw new Error('"message" must be a nonempty string.'); + super(t2), this.code = e2, void 0 !== n2 && (this.data = n2); + } + serialize() { + const e2 = { code: this.code, message: this.message }; + return void 0 !== this.data && (e2.data = this.data), this.stack && (e2.stack = this.stack), e2; + } + toString() { + return Tx.default(this.serialize(), Lx, 2); + } + } + Rx.EthereumRpcError = Px; + function Lx(e2, t2) { + if ("[Circular]" !== t2) + return t2; + } + Rx.EthereumProviderError = class extends Px { + constructor(e2, t2, n2) { + if (!function(e3) { + return Number.isInteger(e3) && e3 >= 1e3 && e3 <= 4999; + }(e2)) + throw new Error('"code" must be an integer such that: 1000 <= code <= 4999'); + super(e2, t2, n2); + } + }; + var Ix = {}, Ox = {}; + Object.defineProperty(Ox, "__esModule", { value: true }), Ox.errorValues = Ox.errorCodes = void 0, Ox.errorCodes = { rpc: { invalidInput: -32e3, resourceNotFound: -32001, resourceUnavailable: -32002, transactionRejected: -32003, methodNotSupported: -32004, limitExceeded: -32005, parse: -32700, invalidRequest: -32600, methodNotFound: -32601, invalidParams: -32602, internal: -32603 }, provider: { userRejectedRequest: 4001, unauthorized: 4100, unsupportedMethod: 4200, disconnected: 4900, chainDisconnected: 4901 } }, Ox.errorValues = { "-32700": { standard: "JSON RPC 2.0", message: "Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text." }, "-32600": { standard: "JSON RPC 2.0", message: "The JSON sent is not a valid Request object." }, "-32601": { standard: "JSON RPC 2.0", message: "The method does not exist / is not available." }, "-32602": { standard: "JSON RPC 2.0", message: "Invalid method parameter(s)." }, "-32603": { standard: "JSON RPC 2.0", message: "Internal JSON-RPC error." }, "-32000": { standard: "EIP-1474", message: "Invalid input." }, "-32001": { standard: "EIP-1474", message: "Resource not found." }, "-32002": { standard: "EIP-1474", message: "Resource unavailable." }, "-32003": { standard: "EIP-1474", message: "Transaction rejected." }, "-32004": { standard: "EIP-1474", message: "Method not supported." }, "-32005": { standard: "EIP-1474", message: "Request limit exceeded." }, 4001: { standard: "EIP-1193", message: "User rejected the request." }, 4100: { standard: "EIP-1193", message: "The requested account and/or method has not been authorized by the user." }, 4200: { standard: "EIP-1193", message: "The requested method is not supported by this Ethereum provider." }, 4900: { standard: "EIP-1193", message: "The provider is disconnected from all chains." }, 4901: { standard: "EIP-1193", message: "The provider is disconnected from the specified chain." } }, function(e2) { + Object.defineProperty(e2, "__esModule", { value: true }), e2.serializeError = e2.isValidCode = e2.getMessageFromCode = e2.JSON_RPC_SERVER_ERROR_MESSAGE = void 0; + const t2 = Ox, n2 = Rx, r2 = t2.errorCodes.rpc.internal, i2 = "Unspecified error message. This is a bug, please report it.", o2 = { code: r2, message: a2(r2) }; + function a2(n3, r3 = i2) { + if (Number.isInteger(n3)) { + const r4 = n3.toString(); + if (c2(t2.errorValues, r4)) + return t2.errorValues[r4].message; + if (u2(n3)) + return e2.JSON_RPC_SERVER_ERROR_MESSAGE; + } + return r3; + } + function s2(e3) { + if (!Number.isInteger(e3)) + return false; + const n3 = e3.toString(); + return !!t2.errorValues[n3] || !!u2(e3); + } + function u2(e3) { + return e3 >= -32099 && e3 <= -32e3; + } + function l2(e3) { + return e3 && "object" == typeof e3 && !Array.isArray(e3) ? Object.assign({}, e3) : e3; + } + function c2(e3, t3) { + return Object.prototype.hasOwnProperty.call(e3, t3); + } + e2.JSON_RPC_SERVER_ERROR_MESSAGE = "Unspecified server error.", e2.getMessageFromCode = a2, e2.isValidCode = s2, e2.serializeError = function(e3, { fallbackError: t3 = o2, shouldIncludeStack: r3 = false } = {}) { + var i3, u3; + if (!t3 || !Number.isInteger(t3.code) || "string" != typeof t3.message) + throw new Error("Must provide fallback error with integer number code and string message."); + if (e3 instanceof n2.EthereumRpcError) + return e3.serialize(); + const d2 = {}; + if (e3 && "object" == typeof e3 && !Array.isArray(e3) && c2(e3, "code") && s2(e3.code)) { + const t4 = e3; + d2.code = t4.code, t4.message && "string" == typeof t4.message ? (d2.message = t4.message, c2(t4, "data") && (d2.data = t4.data)) : (d2.message = a2(d2.code), d2.data = { originalError: l2(e3) }); + } else { + d2.code = t3.code; + const n3 = null === (i3 = e3) || void 0 === i3 ? void 0 : i3.message; + d2.message = n3 && "string" == typeof n3 ? n3 : t3.message, d2.data = { originalError: l2(e3) }; + } + const f2 = null === (u3 = e3) || void 0 === u3 ? void 0 : u3.stack; + return r3 && e3 && f2 && "string" == typeof f2 && (d2.stack = f2), d2; + }; + }(Ix); + var Nx = {}; + Object.defineProperty(Nx, "__esModule", { value: true }), Nx.ethErrors = void 0; + const Dx = Rx, jx = Ix, Bx = Ox; + function zx(e2, t2) { + const [n2, r2] = Fx(t2); + return new Dx.EthereumRpcError(e2, n2 || jx.getMessageFromCode(e2), r2); + } + function Ux(e2, t2) { + const [n2, r2] = Fx(t2); + return new Dx.EthereumProviderError(e2, n2 || jx.getMessageFromCode(e2), r2); + } + function Fx(e2) { + if (e2) { + if ("string" == typeof e2) + return [e2]; + if ("object" == typeof e2 && !Array.isArray(e2)) { + const { message: t2, data: n2 } = e2; + if (t2 && "string" != typeof t2) + throw new Error("Must specify string message."); + return [t2 || void 0, n2]; + } + } + return []; + } + Nx.ethErrors = { rpc: { parse: (e2) => zx(Bx.errorCodes.rpc.parse, e2), invalidRequest: (e2) => zx(Bx.errorCodes.rpc.invalidRequest, e2), invalidParams: (e2) => zx(Bx.errorCodes.rpc.invalidParams, e2), methodNotFound: (e2) => zx(Bx.errorCodes.rpc.methodNotFound, e2), internal: (e2) => zx(Bx.errorCodes.rpc.internal, e2), server: (e2) => { + if (!e2 || "object" != typeof e2 || Array.isArray(e2)) + throw new Error("Ethereum RPC Server errors must provide single object argument."); + const { code: t2 } = e2; + if (!Number.isInteger(t2) || t2 > -32005 || t2 < -32099) + throw new Error('"code" must be an integer such that: -32099 <= code <= -32005'); + return zx(t2, e2); + }, invalidInput: (e2) => zx(Bx.errorCodes.rpc.invalidInput, e2), resourceNotFound: (e2) => zx(Bx.errorCodes.rpc.resourceNotFound, e2), resourceUnavailable: (e2) => zx(Bx.errorCodes.rpc.resourceUnavailable, e2), transactionRejected: (e2) => zx(Bx.errorCodes.rpc.transactionRejected, e2), methodNotSupported: (e2) => zx(Bx.errorCodes.rpc.methodNotSupported, e2), limitExceeded: (e2) => zx(Bx.errorCodes.rpc.limitExceeded, e2) }, provider: { userRejectedRequest: (e2) => Ux(Bx.errorCodes.provider.userRejectedRequest, e2), unauthorized: (e2) => Ux(Bx.errorCodes.provider.unauthorized, e2), unsupportedMethod: (e2) => Ux(Bx.errorCodes.provider.unsupportedMethod, e2), disconnected: (e2) => Ux(Bx.errorCodes.provider.disconnected, e2), chainDisconnected: (e2) => Ux(Bx.errorCodes.provider.chainDisconnected, e2), custom: (e2) => { + if (!e2 || "object" != typeof e2 || Array.isArray(e2)) + throw new Error("Ethereum Provider custom errors must provide single object argument."); + const { code: t2, message: n2, data: r2 } = e2; + if (!n2 || "string" != typeof n2) + throw new Error('"message" must be a nonempty string'); + return new Dx.EthereumProviderError(t2, n2, r2); + } } }, function(e2) { + Object.defineProperty(e2, "__esModule", { value: true }), e2.getMessageFromCode = e2.serializeError = e2.EthereumProviderError = e2.EthereumRpcError = e2.ethErrors = e2.errorCodes = void 0; + const t2 = Rx; + Object.defineProperty(e2, "EthereumRpcError", { enumerable: true, get: function() { + return t2.EthereumRpcError; + } }), Object.defineProperty(e2, "EthereumProviderError", { enumerable: true, get: function() { + return t2.EthereumProviderError; + } }); + const n2 = Ix; + Object.defineProperty(e2, "serializeError", { enumerable: true, get: function() { + return n2.serializeError; + } }), Object.defineProperty(e2, "getMessageFromCode", { enumerable: true, get: function() { + return n2.getMessageFromCode; + } }); + const r2 = Nx; + Object.defineProperty(e2, "ethErrors", { enumerable: true, get: function() { + return r2.ethErrors; + } }); + const i2 = Ox; + Object.defineProperty(e2, "errorCodes", { enumerable: true, get: function() { + return i2.errorCodes; + } }); + }(Ax); + const Kx = { METAMASK_GETPROVIDERSTATE: "metamask_getProviderState", METAMASK_CONNECTSIGN: "metamask_connectSign", METAMASK_CONNECTWITH: "metamask_connectWith", METAMASK_OPEN: "metamask_open", METAMASK_BATCH: "metamask_batch", PERSONAL_SIGN: "personal_sign", WALLET_REQUESTPERMISSIONS: "wallet_requestPermissions", WALLET_REVOKEPERMISSIONS: "wallet_revokePermissions", WALLET_GETPERMISSIONS: "wallet_getPermissions", WALLET_WATCHASSET: "wallet_watchAsset", WALLET_ADDETHEREUMCHAIN: "wallet_addEthereumChain", WALLET_SWITCHETHETHEREUMCHAIN: "wallet_switchEthereumChain", ETH_REQUESTACCOUNTS: "eth_requestAccounts", ETH_ACCOUNTS: "eth_accounts", ETH_CHAINID: "eth_chainId", ETH_SENDTRANSACTION: "eth_sendTransaction", ETH_SIGNTYPEDDATA: "eth_signTypedData", ETH_SIGNTYPEDDATA_V3: "eth_signTypedData_v3", ETH_SIGNTYPEDDATA_V4: "eth_signTypedData_v4", ETH_SIGNTRANSACTION: "eth_signTransaction", ETH_SIGN: "eth_sign", PERSONAL_EC_RECOVER: "personal_ecRecover" }, qx = { [Kx.ETH_REQUESTACCOUNTS]: true, [Kx.ETH_SENDTRANSACTION]: true, [Kx.ETH_SIGNTRANSACTION]: true, [Kx.ETH_SIGN]: true, [Kx.PERSONAL_SIGN]: true, [Kx.ETH_ACCOUNTS]: false, [Kx.ETH_CHAINID]: false, [Kx.PERSONAL_SIGN]: true, [Kx.ETH_SIGNTYPEDDATA]: true, [Kx.ETH_SIGNTYPEDDATA_V3]: true, [Kx.ETH_SIGNTYPEDDATA_V4]: true, [Kx.WALLET_REQUESTPERMISSIONS]: true, [Kx.WALLET_GETPERMISSIONS]: true, [Kx.WALLET_WATCHASSET]: true, [Kx.WALLET_ADDETHEREUMCHAIN]: true, [Kx.WALLET_SWITCHETHETHEREUMCHAIN]: true, [Kx.METAMASK_CONNECTSIGN]: true, [Kx.METAMASK_CONNECTWITH]: true, [Kx.PERSONAL_EC_RECOVER]: true, [Kx.METAMASK_BATCH]: true, [Kx.METAMASK_OPEN]: true }, Hx = Object.keys(qx).map((e2) => e2.toLowerCase()), Wx = ["eth_signTypedData", "eth_signTypedData_v3", "eth_signTypedData_v4", "eth_sign"].map((e2) => e2.toLowerCase()), $x = ".sdk-comm", Vx = "providerType", Yx = ".MMSDK_cached_address", Gx = ".MMSDK_cached_chainId", Zx = { CHAIN_CHANGED: "chainChanged", ACCOUNTS_CHANGED: "accountsChanged", DISCONNECT: "disconnect", CONNECT: "connect", CONNECTED: "connected" }; + class Qx { + constructor({ enabled: e2 } = { enabled: false }) { + this.enabled = false, this.enabled = e2; + } + persistChannelConfig(e2) { + return kk(this, void 0, void 0, function* () { + const t2 = JSON.stringify(e2); + xx(`[StorageManagerWeb: persistChannelConfig()] enabled=${this.enabled}`, e2), localStorage.setItem($x, t2); + }); + } + getPersistedChannelConfig() { + return kk(this, void 0, void 0, function* () { + let e2; + try { + if (xx(`[StorageManagerWeb: getPersistedChannelConfig()] enabled=${this.enabled}`), e2 = localStorage.getItem($x), xx("[StorageManagerWeb: getPersistedChannelConfig()]", e2), !e2) + return; + const t2 = JSON.parse(e2); + return xx("[StorageManagerWeb: getPersistedChannelConfig()] channelConfig", t2), t2; + } catch (e3) { + return void console.error("[StorageManagerWeb: getPersistedChannelConfig()] Can't find existing channel config", e3); + } + }); + } + persistAccounts(e2) { + return kk(this, void 0, void 0, function* () { + xx(`[StorageManagerWeb: persistAccounts()] enabled=${this.enabled}`, e2); + const t2 = JSON.stringify(e2); + localStorage.setItem(Yx, t2); + }); + } + getCachedAccounts() { + return kk(this, void 0, void 0, function* () { + try { + const e2 = localStorage.getItem(Yx); + return e2 ? JSON.parse(e2) : []; + } catch (e2) { + throw console.error("[StorageManagerWeb: getCachedAccounts()] Error reading cached accounts", e2), e2; + } + }); + } + persistChainId(e2) { + return kk(this, void 0, void 0, function* () { + xx(`[StorageManagerWeb: persistChainId()] enabled=${this.enabled}`, e2), localStorage.setItem(Gx, e2); + }); + } + getCachedChainId() { + return kk(this, void 0, void 0, function* () { + try { + const e2 = localStorage.getItem(Gx); + return null != e2 ? e2 : void 0; + } catch (e2) { + throw console.error("[StorageManagerWeb: getCachedChainId()] Error reading cached chainId", e2), e2; + } + }); + } + terminate() { + return kk(this, void 0, void 0, function* () { + xx(`[StorageManagerWeb: terminate()] enabled=${this.enabled}`), localStorage.removeItem($x); + }); + } + } + const Jx = (e2) => new Qx(e2); + class Xx extends Cx { + constructor({ connectionStream: e2, shouldSendMetadata: t2, autoRequestAccounts: n2 = false }) { + super(e2, { logger: console, maxEventListeners: 100, shouldSendMetadata: t2 }), this.state = { accounts: null, autoRequestAccounts: false, providerStateRequested: false, chainId: "", networkVersion: "" }, xx(`[SDKProvider: constructor()] autoRequestAccounts=${n2}`), this.state.autoRequestAccounts = n2; + } + forceInitializeState() { + return kk(this, void 0, void 0, function* () { + return xx(`[SDKProvider: forceInitializeState()] autoRequestAccounts=${this.state.autoRequestAccounts}`), this._initializeStateAsync(); + }); + } + _setConnected() { + xx("[SDKProvider: _setConnected()] Setting connected state"), this._state.isConnected = true; + } + getState() { + return this._state; + } + getSDKProviderState() { + return this.state; + } + getSelectedAddress() { + var e2; + const { accounts: t2 } = this._state; + return t2 && 0 !== t2.length ? (null === (e2 = t2[0]) || void 0 === e2 ? void 0 : e2.toLowerCase()) || "" : (xx("[SDKProvider: getSelectedAddress] No accounts found"), null); + } + getChainId() { + return this.state.chainId; + } + getNetworkVersion() { + return this.state.networkVersion; + } + setSDKProviderState(e2) { + this.state = Object.assign(Object.assign({}, this.state), e2); + } + handleAccountsChanged(e2, t2) { + return this._handleAccountsChanged(e2, t2); + } + handleDisconnect({ terminate: e2 = false }) { + !function({ terminate: e3 = false, instance: t2 }) { + const { state: n2 } = t2; + xx(`[SDKProvider: handleDisconnect()] cleaning up provider state terminate=${e3}`, t2), e3 && (t2._state.accounts = null, t2._state.isUnlocked = false, t2._state.isPermanentlyDisconnected = true, t2._state.initialized = false), t2._handleAccountsChanged([]), t2._state.isConnected = false, t2.emit("disconnect", Ax.ethErrors.provider.disconnected()), n2.providerStateRequested = false; + }({ terminate: e2, instance: this }); + } + _initializeStateAsync() { + return kk(this, void 0, void 0, function* () { + return function(e2) { + var t2, n2; + return kk(this, void 0, void 0, function* () { + void 0 === e2.state && (e2.state = { accounts: null, autoRequestAccounts: false, providerStateRequested: false, chainId: "" }); + const { state: r2 } = e2; + let i2; + if (r2.providerStateRequested) + xx("[SDKProvider: initializeStateAsync()] initialization already in progress"); + else { + let o2; + r2.providerStateRequested = true; + let a2 = null, s2 = false, u2 = false; + const l2 = Jx({ enabled: true }); + if (l2) { + const e3 = yield l2.getPersistedChannelConfig({}); + s2 = null !== (t2 = null == e3 ? void 0 : e3.relayPersistence) && void 0 !== t2 && t2, o2 = yield l2.getCachedChainId(); + const n3 = yield l2.getCachedAccounts(); + n3.length > 0 && (a2 = n3[0]); + } + if (xx(`[SDKProvider: initializeStateAsync()] relayPersistence=${s2}`, { relayPersistence: s2, cachedChainId: o2, cachedSelectedAddress: a2 }), s2) + if (o2 && a2) + i2 = { accounts: [a2], chainId: o2, isUnlocked: false }, u2 = true; + else + try { + i2 = yield e2.request({ method: "metamask_getProviderState" }); + } catch (t3) { + return e2._log.error("MetaMask: Failed to get initial state. Please report this bug.", t3), void (r2.providerStateRequested = false); + } + if (0 === (null === (n2 = null == i2 ? void 0 : i2.accounts) || void 0 === n2 ? void 0 : n2.length)) + if (e2.getSelectedAddress()) + i2.accounts = [e2.getSelectedAddress()]; + else { + xx("[SDKProvider: initializeStateAsync()] Fetch accounts remotely."); + const t3 = yield e2.request({ method: "eth_requestAccounts", params: [] }); + i2.accounts = t3; + } + e2._initializeState(i2), r2.providerStateRequested = false, u2 && (e2._state.isConnected = true, e2.emit("connect", { chainId: null == i2 ? void 0 : i2.chainId })); + } + }); + }(this); + }); + } + _initializeState(e2) { + return xx("[SDKProvider: _initializeState()]", e2), function(e3, t2, n2) { + return xx("[SDKProvider: initializeState()] set state._initialized to false"), e3._state.initialized = false, t2(n2); + }(this, super._initializeState.bind(this), e2); + } + _handleChainChanged({ chainId: e2, networkVersion: t2 } = {}) { + this.state.chainId = e2, this.state.networkVersion = t2, function({ instance: e3, chainId: t3, networkVersion: n2, superHandleChainChanged: r2 }) { + xx(`[SDKProvider: handleChainChanged()] chainId=${t3} networkVersion=${n2}`); + let i2 = n2; + n2 || (xx("[SDKProvider: handleChainChanged()] forced network version to prevent provider error"), i2 = "1"), e3._state.isConnected = true, e3.emit("connect", { chainId: t3 }), r2({ chainId: t3, networkVersion: i2 }); + }({ instance: this, chainId: e2, networkVersion: t2, superHandleChainChanged: super._handleChainChanged.bind(this) }); + } + } + var eA = { exports: {} }; + !function(e2, t2) { + !function(t3) { + var n2 = Object.hasOwnProperty, r2 = Array.isArray ? Array.isArray : function(e3) { + return "[object Array]" === Object.prototype.toString.call(e3); + }, i2 = "object" == typeof je && true, o2 = "function" == typeof Symbol, a2 = "object" == typeof Reflect, s2 = "function" == typeof setImmediate ? setImmediate : setTimeout, u2 = o2 ? a2 && "function" == typeof Reflect.ownKeys ? Reflect.ownKeys : function(e3) { + var t4 = Object.getOwnPropertyNames(e3); + return t4.push.apply(t4, Object.getOwnPropertySymbols(e3)), t4; + } : Object.keys; + function l2() { + this._events = {}, this._conf && c2.call(this, this._conf); + } + function c2(e3) { + e3 && (this._conf = e3, e3.delimiter && (this.delimiter = e3.delimiter), e3.maxListeners !== t3 && (this._maxListeners = e3.maxListeners), e3.wildcard && (this.wildcard = e3.wildcard), e3.newListener && (this._newListener = e3.newListener), e3.removeListener && (this._removeListener = e3.removeListener), e3.verboseMemoryLeak && (this.verboseMemoryLeak = e3.verboseMemoryLeak), e3.ignoreErrors && (this.ignoreErrors = e3.ignoreErrors), this.wildcard && (this.listenerTree = {})); + } + function d2(e3, t4) { + var n3 = "(node) warning: possible EventEmitter memory leak detected. " + e3 + " listeners added. Use emitter.setMaxListeners() to increase limit."; + if (this.verboseMemoryLeak && (n3 += " Event name: " + t4 + "."), void 0 !== je && je.emitWarning) { + var r3 = new Error(n3); + r3.name = "MaxListenersExceededWarning", r3.emitter = this, r3.count = e3, je.emitWarning(r3); + } else + console.error(n3), console.trace && console.trace(); + } + var f2 = function(e3, t4, n3) { + var r3 = arguments.length; + switch (r3) { + case 0: + return []; + case 1: + return [e3]; + case 2: + return [e3, t4]; + case 3: + return [e3, t4, n3]; + default: + for (var i3 = new Array(r3); r3--; ) + i3[r3] = arguments[r3]; + return i3; + } + }; + function h2(e3, n3) { + for (var r3 = {}, i3 = e3.length, o3 = n3 ? n3.length : 0, a3 = 0; a3 < i3; a3++) + r3[e3[a3]] = a3 < o3 ? n3[a3] : t3; + return r3; + } + function p2(e3, t4, n3) { + var r3, i3; + if (this._emitter = e3, this._target = t4, this._listeners = {}, this._listenersCount = 0, (n3.on || n3.off) && (r3 = n3.on, i3 = n3.off), t4.addEventListener ? (r3 = t4.addEventListener, i3 = t4.removeEventListener) : t4.addListener ? (r3 = t4.addListener, i3 = t4.removeListener) : t4.on && (r3 = t4.on, i3 = t4.off), !r3 && !i3) + throw Error("target does not implement any known event API"); + if ("function" != typeof r3) + throw TypeError("on method must be a function"); + if ("function" != typeof i3) + throw TypeError("off method must be a function"); + this._on = r3, this._off = i3; + var o3 = e3._observers; + o3 ? o3.push(this) : e3._observers = [this]; + } + function m2(e3, r3, i3, o3) { + var a3 = Object.assign({}, r3); + if (!e3) + return a3; + if ("object" != typeof e3) + throw TypeError("options must be an object"); + var s3, u3, l3, c3 = Object.keys(e3), d3 = c3.length; + function f3(e4) { + throw Error('Invalid "' + s3 + '" option value' + (e4 ? ". Reason: " + e4 : "")); + } + for (var h3 = 0; h3 < d3; h3++) { + if (s3 = c3[h3], !o3 && !n2.call(r3, s3)) + throw Error('Unknown "' + s3 + '" option'); + (u3 = e3[s3]) !== t3 && (l3 = i3[s3], a3[s3] = l3 ? l3(u3, f3) : u3); + } + return a3; + } + function g2(e3, t4) { + return "function" == typeof e3 && e3.hasOwnProperty("prototype") || t4("value must be a constructor"), e3; + } + function v2(e3) { + var t4 = "value must be type of " + e3.join("|"), n3 = e3.length, r3 = e3[0], i3 = e3[1]; + return 1 === n3 ? function(e4, n4) { + if (typeof e4 === r3) + return e4; + n4(t4); + } : 2 === n3 ? function(e4, n4) { + var o3 = typeof e4; + if (o3 === r3 || o3 === i3) + return e4; + n4(t4); + } : function(r4, i4) { + for (var o3 = typeof r4, a3 = n3; a3-- > 0; ) + if (o3 === e3[a3]) + return r4; + i4(t4); + }; + } + Object.assign(p2.prototype, { subscribe: function(e3, t4, n3) { + var r3 = this, i3 = this._target, o3 = this._emitter, a3 = this._listeners, s3 = function() { + var r4 = f2.apply(null, arguments), a4 = { data: r4, name: t4, original: e3 }; + n3 ? false !== n3.call(i3, a4) && o3.emit.apply(o3, [a4.name].concat(r4)) : o3.emit.apply(o3, [t4].concat(r4)); + }; + if (a3[e3]) + throw Error("Event '" + e3 + "' is already listening"); + this._listenersCount++, o3._newListener && o3._removeListener && !r3._onNewListener ? (this._onNewListener = function(n4) { + n4 === t4 && null === a3[e3] && (a3[e3] = s3, r3._on.call(i3, e3, s3)); + }, o3.on("newListener", this._onNewListener), this._onRemoveListener = function(n4) { + n4 === t4 && !o3.hasListeners(n4) && a3[e3] && (a3[e3] = null, r3._off.call(i3, e3, s3)); + }, a3[e3] = null, o3.on("removeListener", this._onRemoveListener)) : (a3[e3] = s3, r3._on.call(i3, e3, s3)); + }, unsubscribe: function(e3) { + var t4, n3, r3, i3 = this, o3 = this._listeners, a3 = this._emitter, s3 = this._off, l3 = this._target; + if (e3 && "string" != typeof e3) + throw TypeError("event must be a string"); + function c3() { + i3._onNewListener && (a3.off("newListener", i3._onNewListener), a3.off("removeListener", i3._onRemoveListener), i3._onNewListener = null, i3._onRemoveListener = null); + var e4 = _2.call(a3, i3); + a3._observers.splice(e4, 1); + } + if (e3) { + if (!(t4 = o3[e3])) + return; + s3.call(l3, e3, t4), delete o3[e3], --this._listenersCount || c3(); + } else { + for (r3 = (n3 = u2(o3)).length; r3-- > 0; ) + e3 = n3[r3], s3.call(l3, e3, o3[e3]); + this._listeners = {}, this._listenersCount = 0, c3(); + } + } }); + var b2 = v2(["function"]), y2 = v2(["object", "function"]); + function w2(e3, t4, n3) { + var r3, i3, o3, a3 = 0, s3 = new e3(function(u3, l3, c3) { + function d3() { + i3 && (i3 = null), a3 && (clearTimeout(a3), a3 = 0); + } + n3 = m2(n3, { timeout: 0, overload: false }, { timeout: function(e4, t5) { + return ("number" != typeof (e4 *= 1) || e4 < 0 || !Number.isFinite(e4)) && t5("timeout must be a positive number"), e4; + } }), r3 = !n3.overload && "function" == typeof e3.prototype.cancel && "function" == typeof c3; + var f3 = function(e4) { + d3(), u3(e4); + }, h3 = function(e4) { + d3(), l3(e4); + }; + r3 ? t4(f3, h3, c3) : (i3 = [function(e4) { + h3(e4 || Error("canceled")); + }], t4(f3, h3, function(e4) { + if (o3) + throw Error("Unable to subscribe on cancel event asynchronously"); + if ("function" != typeof e4) + throw TypeError("onCancel callback must be a function"); + i3.push(e4); + }), o3 = true), n3.timeout > 0 && (a3 = setTimeout(function() { + var e4 = Error("timeout"); + e4.code = "ETIMEDOUT", a3 = 0, s3.cancel(e4), l3(e4); + }, n3.timeout)); + }); + return r3 || (s3.cancel = function(e4) { + if (i3) { + for (var t5 = i3.length, n4 = 1; n4 < t5; n4++) + i3[n4](e4); + i3[0](e4), i3 = null; + } + }), s3; + } + function _2(e3) { + var t4 = this._observers; + if (!t4) + return -1; + for (var n3 = t4.length, r3 = 0; r3 < n3; r3++) + if (t4[r3]._target === e3) + return r3; + return -1; + } + function S2(e3, t4, n3, r3, i3) { + if (!n3) + return null; + if (0 === r3) { + var o3 = typeof t4; + if ("string" === o3) { + var a3, s3, l3 = 0, c3 = 0, d3 = this.delimiter, f3 = d3.length; + if (-1 !== (s3 = t4.indexOf(d3))) { + a3 = new Array(5); + do { + a3[l3++] = t4.slice(c3, s3), c3 = s3 + f3; + } while (-1 !== (s3 = t4.indexOf(d3, c3))); + a3[l3++] = t4.slice(c3), t4 = a3, i3 = l3; + } else + t4 = [t4], i3 = 1; + } else + "object" === o3 ? i3 = t4.length : (t4 = [t4], i3 = 1); + } + var h3, p3, m3, g3, v3, b3, y3, w3 = null, _3 = t4[r3], E3 = t4[r3 + 1]; + if (r3 === i3) + n3._listeners && ("function" == typeof n3._listeners ? (e3 && e3.push(n3._listeners), w3 = [n3]) : (e3 && e3.push.apply(e3, n3._listeners), w3 = [n3])); + else { + if ("*" === _3) { + for (s3 = (b3 = u2(n3)).length; s3-- > 0; ) + "_listeners" !== (h3 = b3[s3]) && (y3 = S2(e3, t4, n3[h3], r3 + 1, i3)) && (w3 ? w3.push.apply(w3, y3) : w3 = y3); + return w3; + } + if ("**" === _3) { + for ((v3 = r3 + 1 === i3 || r3 + 2 === i3 && "*" === E3) && n3._listeners && (w3 = S2(e3, t4, n3, i3, i3)), s3 = (b3 = u2(n3)).length; s3-- > 0; ) + "_listeners" !== (h3 = b3[s3]) && ("*" === h3 || "**" === h3 ? (n3[h3]._listeners && !v3 && (y3 = S2(e3, t4, n3[h3], i3, i3)) && (w3 ? w3.push.apply(w3, y3) : w3 = y3), y3 = S2(e3, t4, n3[h3], r3, i3)) : y3 = S2(e3, t4, n3[h3], h3 === E3 ? r3 + 2 : r3, i3), y3 && (w3 ? w3.push.apply(w3, y3) : w3 = y3)); + return w3; + } + n3[_3] && (w3 = S2(e3, t4, n3[_3], r3 + 1, i3)); + } + if ((p3 = n3["*"]) && S2(e3, t4, p3, r3 + 1, i3), m3 = n3["**"]) + if (r3 < i3) + for (m3._listeners && S2(e3, t4, m3, i3, i3), s3 = (b3 = u2(m3)).length; s3-- > 0; ) + "_listeners" !== (h3 = b3[s3]) && (h3 === E3 ? S2(e3, t4, m3[h3], r3 + 2, i3) : h3 === _3 ? S2(e3, t4, m3[h3], r3 + 1, i3) : ((g3 = {})[h3] = m3[h3], S2(e3, t4, { "**": g3 }, r3 + 1, i3))); + else + m3._listeners ? S2(e3, t4, m3, i3, i3) : m3["*"] && m3["*"]._listeners && S2(e3, t4, m3["*"], i3, i3); + return w3; + } + function E2(e3, t4, n3) { + var r3, i3, o3 = 0, a3 = 0, s3 = this.delimiter, u3 = s3.length; + if ("string" == typeof e3) + if (-1 !== (r3 = e3.indexOf(s3))) { + i3 = new Array(5); + do { + i3[o3++] = e3.slice(a3, r3), a3 = r3 + u3; + } while (-1 !== (r3 = e3.indexOf(s3, a3))); + i3[o3++] = e3.slice(a3); + } else + i3 = [e3], o3 = 1; + else + i3 = e3, o3 = e3.length; + if (o3 > 1) { + for (r3 = 0; r3 + 1 < o3; r3++) + if ("**" === i3[r3] && "**" === i3[r3 + 1]) + return; + } + var l3, c3 = this.listenerTree; + for (r3 = 0; r3 < o3; r3++) + if (c3 = c3[l3 = i3[r3]] || (c3[l3] = {}), r3 === o3 - 1) + return c3._listeners ? ("function" == typeof c3._listeners && (c3._listeners = [c3._listeners]), n3 ? c3._listeners.unshift(t4) : c3._listeners.push(t4), !c3._listeners.warned && this._maxListeners > 0 && c3._listeners.length > this._maxListeners && (c3._listeners.warned = true, d2.call(this, c3._listeners.length, l3))) : c3._listeners = t4, true; + return true; + } + function k2(e3, t4, n3, r3) { + for (var i3, o3, a3, s3, l3 = u2(e3), c3 = l3.length, d3 = e3._listeners; c3-- > 0; ) + i3 = e3[o3 = l3[c3]], a3 = "_listeners" === o3 ? n3 : n3 ? n3.concat(o3) : [o3], s3 = r3 || "symbol" == typeof o3, d3 && t4.push(s3 ? a3 : a3.join(this.delimiter)), "object" == typeof i3 && k2.call(this, i3, t4, a3, s3); + return t4; + } + function M2(e3) { + for (var t4, n3, r3, i3 = u2(e3), o3 = i3.length; o3-- > 0; ) + (t4 = e3[n3 = i3[o3]]) && (r3 = true, "_listeners" === n3 || M2(t4) || delete e3[n3]); + return r3; + } + function C2(e3, t4, n3) { + this.emitter = e3, this.event = t4, this.listener = n3; + } + function x2(e3, n3, r3) { + if (true === r3) + a3 = true; + else if (false === r3) + o3 = true; + else { + if (!r3 || "object" != typeof r3) + throw TypeError("options should be an object or true"); + var o3 = r3.async, a3 = r3.promisify, u3 = r3.nextTick, l3 = r3.objectify; + } + if (o3 || u3 || a3) { + var c3 = n3, d3 = n3._origin || n3; + if (u3 && !i2) + throw Error("process.nextTick is not supported"); + a3 === t3 && (a3 = "AsyncFunction" === n3.constructor.name), n3 = function() { + var e4 = arguments, t4 = this, n4 = this.event; + return a3 ? u3 ? Promise.resolve() : new Promise(function(e5) { + s2(e5); + }).then(function() { + return t4.event = n4, c3.apply(t4, e4); + }) : (u3 ? Ee : s2)(function() { + t4.event = n4, c3.apply(t4, e4); + }); + }, n3._async = true, n3._origin = d3; + } + return [n3, l3 ? new C2(this, e3, n3) : this]; + } + function A2(e3) { + this._events = {}, this._newListener = false, this._removeListener = false, this.verboseMemoryLeak = false, c2.call(this, e3); + } + C2.prototype.off = function() { + return this.emitter.off(this.event, this.listener), this; + }, A2.EventEmitter2 = A2, A2.prototype.listenTo = function(e3, n3, i3) { + if ("object" != typeof e3) + throw TypeError("target musts be an object"); + var o3 = this; + function a3(t4) { + if ("object" != typeof t4) + throw TypeError("events must be an object"); + var n4, r3 = i3.reducers, a4 = _2.call(o3, e3); + n4 = -1 === a4 ? new p2(o3, e3, i3) : o3._observers[a4]; + for (var s3, l3 = u2(t4), c3 = l3.length, d3 = "function" == typeof r3, f3 = 0; f3 < c3; f3++) + s3 = l3[f3], n4.subscribe(s3, t4[s3] || s3, d3 ? r3 : r3 && r3[s3]); + } + return i3 = m2(i3, { on: t3, off: t3, reducers: t3 }, { on: b2, off: b2, reducers: y2 }), r2(n3) ? a3(h2(n3)) : a3("string" == typeof n3 ? h2(n3.split(/\s+/)) : n3), this; + }, A2.prototype.stopListeningTo = function(e3, t4) { + var n3 = this._observers; + if (!n3) + return false; + var r3, i3 = n3.length, o3 = false; + if (e3 && "object" != typeof e3) + throw TypeError("target should be an object"); + for (; i3-- > 0; ) + r3 = n3[i3], e3 && r3._target !== e3 || (r3.unsubscribe(t4), o3 = true); + return o3; + }, A2.prototype.delimiter = ".", A2.prototype.setMaxListeners = function(e3) { + e3 !== t3 && (this._maxListeners = e3, this._conf || (this._conf = {}), this._conf.maxListeners = e3); + }, A2.prototype.getMaxListeners = function() { + return this._maxListeners; + }, A2.prototype.event = "", A2.prototype.once = function(e3, t4, n3) { + return this._once(e3, t4, false, n3); + }, A2.prototype.prependOnceListener = function(e3, t4, n3) { + return this._once(e3, t4, true, n3); + }, A2.prototype._once = function(e3, t4, n3, r3) { + return this._many(e3, 1, t4, n3, r3); + }, A2.prototype.many = function(e3, t4, n3, r3) { + return this._many(e3, t4, n3, false, r3); + }, A2.prototype.prependMany = function(e3, t4, n3, r3) { + return this._many(e3, t4, n3, true, r3); + }, A2.prototype._many = function(e3, t4, n3, r3, i3) { + var o3 = this; + if ("function" != typeof n3) + throw new Error("many only accepts instances of Function"); + function a3() { + return 0 == --t4 && o3.off(e3, a3), n3.apply(this, arguments); + } + return a3._origin = n3, this._on(e3, a3, r3, i3); + }, A2.prototype.emit = function() { + if (!this._events && !this._all) + return false; + this._events || l2.call(this); + var e3, t4, n3, r3, i3, a3, s3 = arguments[0], u3 = this.wildcard; + if ("newListener" === s3 && !this._newListener && !this._events.newListener) + return false; + if (u3 && (e3 = s3, "newListener" !== s3 && "removeListener" !== s3 && "object" == typeof s3)) { + if (n3 = s3.length, o2) { + for (r3 = 0; r3 < n3; r3++) + if ("symbol" == typeof s3[r3]) { + a3 = true; + break; + } + } + a3 || (s3 = s3.join(this.delimiter)); + } + var c3, d3 = arguments.length; + if (this._all && this._all.length) + for (r3 = 0, n3 = (c3 = this._all.slice()).length; r3 < n3; r3++) + switch (this.event = s3, d3) { + case 1: + c3[r3].call(this, s3); + break; + case 2: + c3[r3].call(this, s3, arguments[1]); + break; + case 3: + c3[r3].call(this, s3, arguments[1], arguments[2]); + break; + default: + c3[r3].apply(this, arguments); + } + if (u3) + c3 = [], S2.call(this, c3, e3, this.listenerTree, 0, n3); + else { + if ("function" == typeof (c3 = this._events[s3])) { + switch (this.event = s3, d3) { + case 1: + c3.call(this); + break; + case 2: + c3.call(this, arguments[1]); + break; + case 3: + c3.call(this, arguments[1], arguments[2]); + break; + default: + for (t4 = new Array(d3 - 1), i3 = 1; i3 < d3; i3++) + t4[i3 - 1] = arguments[i3]; + c3.apply(this, t4); + } + return true; + } + c3 && (c3 = c3.slice()); + } + if (c3 && c3.length) { + if (d3 > 3) + for (t4 = new Array(d3 - 1), i3 = 1; i3 < d3; i3++) + t4[i3 - 1] = arguments[i3]; + for (r3 = 0, n3 = c3.length; r3 < n3; r3++) + switch (this.event = s3, d3) { + case 1: + c3[r3].call(this); + break; + case 2: + c3[r3].call(this, arguments[1]); + break; + case 3: + c3[r3].call(this, arguments[1], arguments[2]); + break; + default: + c3[r3].apply(this, t4); + } + return true; + } + if (!this.ignoreErrors && !this._all && "error" === s3) + throw arguments[1] instanceof Error ? arguments[1] : new Error("Uncaught, unspecified 'error' event."); + return !!this._all; + }, A2.prototype.emitAsync = function() { + if (!this._events && !this._all) + return false; + this._events || l2.call(this); + var e3, t4, n3, r3, i3, a3, s3 = arguments[0], u3 = this.wildcard; + if ("newListener" === s3 && !this._newListener && !this._events.newListener) + return Promise.resolve([false]); + if (u3 && (e3 = s3, "newListener" !== s3 && "removeListener" !== s3 && "object" == typeof s3)) { + if (r3 = s3.length, o2) { + for (i3 = 0; i3 < r3; i3++) + if ("symbol" == typeof s3[i3]) { + t4 = true; + break; + } + } + t4 || (s3 = s3.join(this.delimiter)); + } + var c3, d3 = [], f3 = arguments.length; + if (this._all) + for (i3 = 0, r3 = this._all.length; i3 < r3; i3++) + switch (this.event = s3, f3) { + case 1: + d3.push(this._all[i3].call(this, s3)); + break; + case 2: + d3.push(this._all[i3].call(this, s3, arguments[1])); + break; + case 3: + d3.push(this._all[i3].call(this, s3, arguments[1], arguments[2])); + break; + default: + d3.push(this._all[i3].apply(this, arguments)); + } + if (u3 ? (c3 = [], S2.call(this, c3, e3, this.listenerTree, 0)) : c3 = this._events[s3], "function" == typeof c3) + switch (this.event = s3, f3) { + case 1: + d3.push(c3.call(this)); + break; + case 2: + d3.push(c3.call(this, arguments[1])); + break; + case 3: + d3.push(c3.call(this, arguments[1], arguments[2])); + break; + default: + for (n3 = new Array(f3 - 1), a3 = 1; a3 < f3; a3++) + n3[a3 - 1] = arguments[a3]; + d3.push(c3.apply(this, n3)); + } + else if (c3 && c3.length) { + if (c3 = c3.slice(), f3 > 3) + for (n3 = new Array(f3 - 1), a3 = 1; a3 < f3; a3++) + n3[a3 - 1] = arguments[a3]; + for (i3 = 0, r3 = c3.length; i3 < r3; i3++) + switch (this.event = s3, f3) { + case 1: + d3.push(c3[i3].call(this)); + break; + case 2: + d3.push(c3[i3].call(this, arguments[1])); + break; + case 3: + d3.push(c3[i3].call(this, arguments[1], arguments[2])); + break; + default: + d3.push(c3[i3].apply(this, n3)); + } + } else if (!this.ignoreErrors && !this._all && "error" === s3) + return arguments[1] instanceof Error ? Promise.reject(arguments[1]) : Promise.reject("Uncaught, unspecified 'error' event."); + return Promise.all(d3); + }, A2.prototype.on = function(e3, t4, n3) { + return this._on(e3, t4, false, n3); + }, A2.prototype.prependListener = function(e3, t4, n3) { + return this._on(e3, t4, true, n3); + }, A2.prototype.onAny = function(e3) { + return this._onAny(e3, false); + }, A2.prototype.prependAny = function(e3) { + return this._onAny(e3, true); + }, A2.prototype.addListener = A2.prototype.on, A2.prototype._onAny = function(e3, t4) { + if ("function" != typeof e3) + throw new Error("onAny only accepts instances of Function"); + return this._all || (this._all = []), t4 ? this._all.unshift(e3) : this._all.push(e3), this; + }, A2.prototype._on = function(e3, n3, r3, i3) { + if ("function" == typeof e3) + return this._onAny(e3, n3), this; + if ("function" != typeof n3) + throw new Error("on only accepts instances of Function"); + this._events || l2.call(this); + var o3, a3 = this; + return i3 !== t3 && (n3 = (o3 = x2.call(this, e3, n3, i3))[0], a3 = o3[1]), this._newListener && this.emit("newListener", e3, n3), this.wildcard ? (E2.call(this, e3, n3, r3), a3) : (this._events[e3] ? ("function" == typeof this._events[e3] && (this._events[e3] = [this._events[e3]]), r3 ? this._events[e3].unshift(n3) : this._events[e3].push(n3), !this._events[e3].warned && this._maxListeners > 0 && this._events[e3].length > this._maxListeners && (this._events[e3].warned = true, d2.call(this, this._events[e3].length, e3))) : this._events[e3] = n3, a3); + }, A2.prototype.off = function(e3, t4) { + if ("function" != typeof t4) + throw new Error("removeListener only takes instances of Function"); + var n3, i3 = []; + if (this.wildcard) { + var o3 = "string" == typeof e3 ? e3.split(this.delimiter) : e3.slice(); + if (!(i3 = S2.call(this, null, o3, this.listenerTree, 0))) + return this; + } else { + if (!this._events[e3]) + return this; + n3 = this._events[e3], i3.push({ _listeners: n3 }); + } + for (var a3 = 0; a3 < i3.length; a3++) { + var s3 = i3[a3]; + if (n3 = s3._listeners, r2(n3)) { + for (var u3 = -1, l3 = 0, c3 = n3.length; l3 < c3; l3++) + if (n3[l3] === t4 || n3[l3].listener && n3[l3].listener === t4 || n3[l3]._origin && n3[l3]._origin === t4) { + u3 = l3; + break; + } + if (u3 < 0) + continue; + return this.wildcard ? s3._listeners.splice(u3, 1) : this._events[e3].splice(u3, 1), 0 === n3.length && (this.wildcard ? delete s3._listeners : delete this._events[e3]), this._removeListener && this.emit("removeListener", e3, t4), this; + } + (n3 === t4 || n3.listener && n3.listener === t4 || n3._origin && n3._origin === t4) && (this.wildcard ? delete s3._listeners : delete this._events[e3], this._removeListener && this.emit("removeListener", e3, t4)); + } + return this.listenerTree && M2(this.listenerTree), this; + }, A2.prototype.offAny = function(e3) { + var t4, n3 = 0, r3 = 0; + if (e3 && this._all && this._all.length > 0) { + for (n3 = 0, r3 = (t4 = this._all).length; n3 < r3; n3++) + if (e3 === t4[n3]) + return t4.splice(n3, 1), this._removeListener && this.emit("removeListenerAny", e3), this; + } else { + if (t4 = this._all, this._removeListener) + for (n3 = 0, r3 = t4.length; n3 < r3; n3++) + this.emit("removeListenerAny", t4[n3]); + this._all = []; + } + return this; + }, A2.prototype.removeListener = A2.prototype.off, A2.prototype.removeAllListeners = function(e3) { + if (e3 === t3) + return !this._events || l2.call(this), this; + if (this.wildcard) { + var n3, r3 = S2.call(this, null, e3, this.listenerTree, 0); + if (!r3) + return this; + for (n3 = 0; n3 < r3.length; n3++) + r3[n3]._listeners = null; + this.listenerTree && M2(this.listenerTree); + } else + this._events && (this._events[e3] = null); + return this; + }, A2.prototype.listeners = function(e3) { + var n3, r3, i3, o3, a3, s3 = this._events; + if (e3 === t3) { + if (this.wildcard) + throw Error("event name required for wildcard emitter"); + if (!s3) + return []; + for (o3 = (n3 = u2(s3)).length, i3 = []; o3-- > 0; ) + "function" == typeof (r3 = s3[n3[o3]]) ? i3.push(r3) : i3.push.apply(i3, r3); + return i3; + } + if (this.wildcard) { + if (!(a3 = this.listenerTree)) + return []; + var l3 = [], c3 = "string" == typeof e3 ? e3.split(this.delimiter) : e3.slice(); + return S2.call(this, l3, c3, a3, 0), l3; + } + return s3 && (r3 = s3[e3]) ? "function" == typeof r3 ? [r3] : r3 : []; + }, A2.prototype.eventNames = function(e3) { + var t4 = this._events; + return this.wildcard ? k2.call(this, this.listenerTree, [], null, e3) : t4 ? u2(t4) : []; + }, A2.prototype.listenerCount = function(e3) { + return this.listeners(e3).length; + }, A2.prototype.hasListeners = function(e3) { + if (this.wildcard) { + var n3 = [], r3 = "string" == typeof e3 ? e3.split(this.delimiter) : e3.slice(); + return S2.call(this, n3, r3, this.listenerTree, 0), n3.length > 0; + } + var i3 = this._events, o3 = this._all; + return !!(o3 && o3.length || i3 && (e3 === t3 ? u2(i3).length : i3[e3])); + }, A2.prototype.listenersAny = function() { + return this._all ? this._all : []; + }, A2.prototype.waitFor = function(e3, n3) { + var r3 = this, i3 = typeof n3; + return "number" === i3 ? n3 = { timeout: n3 } : "function" === i3 && (n3 = { filter: n3 }), w2((n3 = m2(n3, { timeout: 0, filter: t3, handleError: false, Promise, overload: false }, { filter: b2, Promise: g2 })).Promise, function(t4, i4, o3) { + function a3() { + var o4 = n3.filter; + if (!o4 || o4.apply(r3, arguments)) + if (r3.off(e3, a3), n3.handleError) { + var s3 = arguments[0]; + s3 ? i4(s3) : t4(f2.apply(null, arguments).slice(1)); + } else + t4(f2.apply(null, arguments)); + } + o3(function() { + r3.off(e3, a3); + }), r3._on(e3, a3, false); + }, { timeout: n3.timeout, overload: n3.overload }); + }; + var R2 = A2.prototype; + Object.defineProperties(A2, { defaultMaxListeners: { get: function() { + return R2._maxListeners; + }, set: function(e3) { + if ("number" != typeof e3 || e3 < 0 || Number.isNaN(e3)) + throw TypeError("n must be a non-negative number"); + R2._maxListeners = e3; + }, enumerable: true }, once: { value: function(e3, t4, n3) { + return w2((n3 = m2(n3, { Promise, timeout: 0, overload: false }, { Promise: g2 })).Promise, function(n4, r3, i3) { + var o3; + if ("function" == typeof e3.addEventListener) + return o3 = function() { + n4(f2.apply(null, arguments)); + }, i3(function() { + e3.removeEventListener(t4, o3); + }), void e3.addEventListener(t4, o3, { once: true }); + var a3, s3 = function() { + a3 && e3.removeListener("error", a3), n4(f2.apply(null, arguments)); + }; + "error" !== t4 && (a3 = function(n5) { + e3.removeListener(t4, s3), r3(n5); + }, e3.once("error", a3)), i3(function() { + a3 && e3.removeListener("error", a3), e3.removeListener(t4, s3); + }), e3.once(t4, s3); + }, { timeout: n3.timeout, overload: n3.overload }); + }, writable: true, configurable: true } }), Object.defineProperties(R2, { _maxListeners: { value: 10, writable: true, configurable: true }, _observers: { value: null, writable: true, configurable: true } }), "function" == typeof t3 && t3.amd ? t3(function() { + return A2; + }) : e2.exports = A2; + }(); + }(eA); + var tA = r(eA.exports); + const nA = { type: "logger", log(e2) { + this.output("log", e2); + }, warn(e2) { + this.output("warn", e2); + }, error(e2) { + this.output("error", e2); + }, output(e2, t2) { + console && console[e2] && console[e2].apply(console, t2); + } }; + class rA { + constructor(e2) { + let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + this.init(e2, t2); + } + init(e2) { + let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + this.prefix = t2.prefix || "i18next:", this.logger = e2 || nA, this.options = t2, this.debug = t2.debug; + } + log() { + for (var e2 = arguments.length, t2 = new Array(e2), n2 = 0; n2 < e2; n2++) + t2[n2] = arguments[n2]; + return this.forward(t2, "log", "", true); + } + warn() { + for (var e2 = arguments.length, t2 = new Array(e2), n2 = 0; n2 < e2; n2++) + t2[n2] = arguments[n2]; + return this.forward(t2, "warn", "", true); + } + error() { + for (var e2 = arguments.length, t2 = new Array(e2), n2 = 0; n2 < e2; n2++) + t2[n2] = arguments[n2]; + return this.forward(t2, "error", ""); + } + deprecate() { + for (var e2 = arguments.length, t2 = new Array(e2), n2 = 0; n2 < e2; n2++) + t2[n2] = arguments[n2]; + return this.forward(t2, "warn", "WARNING DEPRECATED: ", true); + } + forward(e2, t2, n2, r2) { + return r2 && !this.debug ? null : ("string" == typeof e2[0] && (e2[0] = `${n2}${this.prefix} ${e2[0]}`), this.logger[t2](e2)); + } + create(e2) { + return new rA(this.logger, { prefix: `${this.prefix}:${e2}:`, ...this.options }); + } + clone(e2) { + return (e2 = e2 || this.options).prefix = e2.prefix || this.prefix, new rA(this.logger, e2); + } + } + var iA = new rA(); + class oA { + constructor() { + this.observers = {}; + } + on(e2, t2) { + return e2.split(" ").forEach((e3) => { + this.observers[e3] || (this.observers[e3] = /* @__PURE__ */ new Map()); + const n2 = this.observers[e3].get(t2) || 0; + this.observers[e3].set(t2, n2 + 1); + }), this; + } + off(e2, t2) { + this.observers[e2] && (t2 ? this.observers[e2].delete(t2) : delete this.observers[e2]); + } + emit(e2) { + for (var t2 = arguments.length, n2 = new Array(t2 > 1 ? t2 - 1 : 0), r2 = 1; r2 < t2; r2++) + n2[r2 - 1] = arguments[r2]; + if (this.observers[e2]) { + Array.from(this.observers[e2].entries()).forEach((e3) => { + let [t3, r3] = e3; + for (let e4 = 0; e4 < r3; e4++) + t3(...n2); + }); + } + if (this.observers["*"]) { + Array.from(this.observers["*"].entries()).forEach((t3) => { + let [r3, i2] = t3; + for (let t4 = 0; t4 < i2; t4++) + r3.apply(r3, [e2, ...n2]); + }); + } + } + } + function aA() { + let e2, t2; + const n2 = new Promise((n3, r2) => { + e2 = n3, t2 = r2; + }); + return n2.resolve = e2, n2.reject = t2, n2; + } + function sA(e2) { + return null == e2 ? "" : "" + e2; + } + const uA = /###/g; + function lA(e2, t2, n2) { + function r2(e3) { + return e3 && e3.indexOf("###") > -1 ? e3.replace(uA, ".") : e3; + } + function i2() { + return !e2 || "string" == typeof e2; + } + const o2 = "string" != typeof t2 ? t2 : t2.split("."); + let a2 = 0; + for (; a2 < o2.length - 1; ) { + if (i2()) + return {}; + const t3 = r2(o2[a2]); + !e2[t3] && n2 && (e2[t3] = new n2()), e2 = Object.prototype.hasOwnProperty.call(e2, t3) ? e2[t3] : {}, ++a2; + } + return i2() ? {} : { obj: e2, k: r2(o2[a2]) }; + } + function cA(e2, t2, n2) { + const { obj: r2, k: i2 } = lA(e2, t2, Object); + if (void 0 !== r2 || 1 === t2.length) + return void (r2[i2] = n2); + let o2 = t2[t2.length - 1], a2 = t2.slice(0, t2.length - 1), s2 = lA(e2, a2, Object); + for (; void 0 === s2.obj && a2.length; ) + o2 = `${a2[a2.length - 1]}.${o2}`, a2 = a2.slice(0, a2.length - 1), s2 = lA(e2, a2, Object), s2 && s2.obj && void 0 !== s2.obj[`${s2.k}.${o2}`] && (s2.obj = void 0); + s2.obj[`${s2.k}.${o2}`] = n2; + } + function dA(e2, t2) { + const { obj: n2, k: r2 } = lA(e2, t2); + if (n2) + return n2[r2]; + } + function fA(e2, t2, n2) { + for (const r2 in t2) + "__proto__" !== r2 && "constructor" !== r2 && (r2 in e2 ? "string" == typeof e2[r2] || e2[r2] instanceof String || "string" == typeof t2[r2] || t2[r2] instanceof String ? n2 && (e2[r2] = t2[r2]) : fA(e2[r2], t2[r2], n2) : e2[r2] = t2[r2]); + return e2; + } + function hA(e2) { + return e2.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); + } + var pA = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "/": "/" }; + function mA(e2) { + return "string" == typeof e2 ? e2.replace(/[&<>"'\/]/g, (e3) => pA[e3]) : e2; + } + const gA = [" ", ",", "?", "!", ";"], vA = new class { + constructor(e2) { + this.capacity = e2, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = []; + } + getRegExp(e2) { + const t2 = this.regExpMap.get(e2); + if (void 0 !== t2) + return t2; + const n2 = new RegExp(e2); + return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e2, n2), this.regExpQueue.push(e2), n2; + } + }(20); + function bA(e2, t2) { + let n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "."; + if (!e2) + return; + if (e2[t2]) + return e2[t2]; + const r2 = t2.split(n2); + let i2 = e2; + for (let e3 = 0; e3 < r2.length; ) { + if (!i2 || "object" != typeof i2) + return; + let t3, o2 = ""; + for (let a2 = e3; a2 < r2.length; ++a2) + if (a2 !== e3 && (o2 += n2), o2 += r2[a2], t3 = i2[o2], void 0 !== t3) { + if (["string", "number", "boolean"].indexOf(typeof t3) > -1 && a2 < r2.length - 1) + continue; + e3 += a2 - e3 + 1; + break; + } + i2 = t3; + } + return i2; + } + function yA(e2) { + return e2 && e2.indexOf("_") > 0 ? e2.replace("_", "-") : e2; + } + class wA extends oA { + constructor(e2) { + let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { ns: ["translation"], defaultNS: "translation" }; + super(), this.data = e2 || {}, this.options = t2, void 0 === this.options.keySeparator && (this.options.keySeparator = "."), void 0 === this.options.ignoreJSONStructure && (this.options.ignoreJSONStructure = true); + } + addNamespaces(e2) { + this.options.ns.indexOf(e2) < 0 && this.options.ns.push(e2); + } + removeNamespaces(e2) { + const t2 = this.options.ns.indexOf(e2); + t2 > -1 && this.options.ns.splice(t2, 1); + } + getResource(e2, t2, n2) { + let r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}; + const i2 = void 0 !== r2.keySeparator ? r2.keySeparator : this.options.keySeparator, o2 = void 0 !== r2.ignoreJSONStructure ? r2.ignoreJSONStructure : this.options.ignoreJSONStructure; + let a2; + e2.indexOf(".") > -1 ? a2 = e2.split(".") : (a2 = [e2, t2], n2 && (Array.isArray(n2) ? a2.push(...n2) : "string" == typeof n2 && i2 ? a2.push(...n2.split(i2)) : a2.push(n2))); + const s2 = dA(this.data, a2); + return !s2 && !t2 && !n2 && e2.indexOf(".") > -1 && (e2 = a2[0], t2 = a2[1], n2 = a2.slice(2).join(".")), s2 || !o2 || "string" != typeof n2 ? s2 : bA(this.data && this.data[e2] && this.data[e2][t2], n2, i2); + } + addResource(e2, t2, n2, r2) { + let i2 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : { silent: false }; + const o2 = void 0 !== i2.keySeparator ? i2.keySeparator : this.options.keySeparator; + let a2 = [e2, t2]; + n2 && (a2 = a2.concat(o2 ? n2.split(o2) : n2)), e2.indexOf(".") > -1 && (a2 = e2.split("."), r2 = t2, t2 = a2[1]), this.addNamespaces(t2), cA(this.data, a2, r2), i2.silent || this.emit("added", e2, t2, n2, r2); + } + addResources(e2, t2, n2) { + let r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : { silent: false }; + for (const r3 in n2) + ("string" == typeof n2[r3] || Array.isArray(n2[r3])) && this.addResource(e2, t2, r3, n2[r3], { silent: true }); + r2.silent || this.emit("added", e2, t2, n2); + } + addResourceBundle(e2, t2, n2, r2, i2) { + let o2 = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : { silent: false, skipCopy: false }, a2 = [e2, t2]; + e2.indexOf(".") > -1 && (a2 = e2.split("."), r2 = n2, n2 = t2, t2 = a2[1]), this.addNamespaces(t2); + let s2 = dA(this.data, a2) || {}; + o2.skipCopy || (n2 = JSON.parse(JSON.stringify(n2))), r2 ? fA(s2, n2, i2) : s2 = { ...s2, ...n2 }, cA(this.data, a2, s2), o2.silent || this.emit("added", e2, t2, n2); + } + removeResourceBundle(e2, t2) { + this.hasResourceBundle(e2, t2) && delete this.data[e2][t2], this.removeNamespaces(t2), this.emit("removed", e2, t2); + } + hasResourceBundle(e2, t2) { + return void 0 !== this.getResource(e2, t2); + } + getResourceBundle(e2, t2) { + return t2 || (t2 = this.options.defaultNS), "v1" === this.options.compatibilityAPI ? { ...this.getResource(e2, t2) } : this.getResource(e2, t2); + } + getDataByLanguage(e2) { + return this.data[e2]; + } + hasLanguageSomeTranslations(e2) { + const t2 = this.getDataByLanguage(e2); + return !!(t2 && Object.keys(t2) || []).find((e3) => t2[e3] && Object.keys(t2[e3]).length > 0); + } + toJSON() { + return this.data; + } + } + var _A = { processors: {}, addPostProcessor(e2) { + this.processors[e2.name] = e2; + }, handle(e2, t2, n2, r2, i2) { + return e2.forEach((e3) => { + this.processors[e3] && (t2 = this.processors[e3].process(t2, n2, r2, i2)); + }), t2; + } }; + const SA = {}; + class EA extends oA { + constructor(e2) { + let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + super(), function(e3, t3, n2) { + e3.forEach((e4) => { + t3[e4] && (n2[e4] = t3[e4]); + }); + }(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e2, this), this.options = t2, void 0 === this.options.keySeparator && (this.options.keySeparator = "."), this.logger = iA.create("translator"); + } + changeLanguage(e2) { + e2 && (this.language = e2); + } + exists(e2) { + let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { interpolation: {} }; + if (null == e2) + return false; + const n2 = this.resolve(e2, t2); + return n2 && void 0 !== n2.res; + } + extractFromKey(e2, t2) { + let n2 = void 0 !== t2.nsSeparator ? t2.nsSeparator : this.options.nsSeparator; + void 0 === n2 && (n2 = ":"); + const r2 = void 0 !== t2.keySeparator ? t2.keySeparator : this.options.keySeparator; + let i2 = t2.ns || this.options.defaultNS || []; + const o2 = n2 && e2.indexOf(n2) > -1, a2 = !(this.options.userDefinedKeySeparator || t2.keySeparator || this.options.userDefinedNsSeparator || t2.nsSeparator || function(e3, t3, n3) { + t3 = t3 || "", n3 = n3 || ""; + const r3 = gA.filter((e4) => t3.indexOf(e4) < 0 && n3.indexOf(e4) < 0); + if (0 === r3.length) + return true; + const i3 = vA.getRegExp(`(${r3.map((e4) => "?" === e4 ? "\\?" : e4).join("|")})`); + let o3 = !i3.test(e3); + if (!o3) { + const t4 = e3.indexOf(n3); + t4 > 0 && !i3.test(e3.substring(0, t4)) && (o3 = true); + } + return o3; + }(e2, n2, r2)); + if (o2 && !a2) { + const t3 = e2.match(this.interpolator.nestingRegexp); + if (t3 && t3.length > 0) + return { key: e2, namespaces: i2 }; + const o3 = e2.split(n2); + (n2 !== r2 || n2 === r2 && this.options.ns.indexOf(o3[0]) > -1) && (i2 = o3.shift()), e2 = o3.join(r2); + } + return "string" == typeof i2 && (i2 = [i2]), { key: e2, namespaces: i2 }; + } + translate(e2, t2, n2) { + if ("object" != typeof t2 && this.options.overloadTranslationOptionHandler && (t2 = this.options.overloadTranslationOptionHandler(arguments)), "object" == typeof t2 && (t2 = { ...t2 }), t2 || (t2 = {}), null == e2) + return ""; + Array.isArray(e2) || (e2 = [String(e2)]); + const r2 = void 0 !== t2.returnDetails ? t2.returnDetails : this.options.returnDetails, i2 = void 0 !== t2.keySeparator ? t2.keySeparator : this.options.keySeparator, { key: o2, namespaces: a2 } = this.extractFromKey(e2[e2.length - 1], t2), s2 = a2[a2.length - 1], u2 = t2.lng || this.language, l2 = t2.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode; + if (u2 && "cimode" === u2.toLowerCase()) { + if (l2) { + const e3 = t2.nsSeparator || this.options.nsSeparator; + return r2 ? { res: `${s2}${e3}${o2}`, usedKey: o2, exactUsedKey: o2, usedLng: u2, usedNS: s2, usedParams: this.getUsedParamsDetails(t2) } : `${s2}${e3}${o2}`; + } + return r2 ? { res: o2, usedKey: o2, exactUsedKey: o2, usedLng: u2, usedNS: s2, usedParams: this.getUsedParamsDetails(t2) } : o2; + } + const c2 = this.resolve(e2, t2); + let d2 = c2 && c2.res; + const f2 = c2 && c2.usedKey || o2, h2 = c2 && c2.exactUsedKey || o2, p2 = Object.prototype.toString.apply(d2), m2 = void 0 !== t2.joinArrays ? t2.joinArrays : this.options.joinArrays, g2 = !this.i18nFormat || this.i18nFormat.handleAsObject; + if (g2 && d2 && ("string" != typeof d2 && "boolean" != typeof d2 && "number" != typeof d2) && ["[object Number]", "[object Function]", "[object RegExp]"].indexOf(p2) < 0 && ("string" != typeof m2 || !Array.isArray(d2))) { + if (!t2.returnObjects && !this.options.returnObjects) { + this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!"); + const e3 = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(f2, d2, { ...t2, ns: a2 }) : `key '${o2} (${this.language})' returned an object instead of string.`; + return r2 ? (c2.res = e3, c2.usedParams = this.getUsedParamsDetails(t2), c2) : e3; + } + if (i2) { + const e3 = Array.isArray(d2), n3 = e3 ? [] : {}, r3 = e3 ? h2 : f2; + for (const e4 in d2) + if (Object.prototype.hasOwnProperty.call(d2, e4)) { + const o3 = `${r3}${i2}${e4}`; + n3[e4] = this.translate(o3, { ...t2, joinArrays: false, ns: a2 }), n3[e4] === o3 && (n3[e4] = d2[e4]); + } + d2 = n3; + } + } else if (g2 && "string" == typeof m2 && Array.isArray(d2)) + d2 = d2.join(m2), d2 && (d2 = this.extendTranslation(d2, e2, t2, n2)); + else { + let r3 = false, a3 = false; + const l3 = void 0 !== t2.count && "string" != typeof t2.count, f3 = EA.hasDefaultValue(t2), h3 = l3 ? this.pluralResolver.getSuffix(u2, t2.count, t2) : "", p3 = t2.ordinal && l3 ? this.pluralResolver.getSuffix(u2, t2.count, { ordinal: false }) : "", m3 = l3 && !t2.ordinal && 0 === t2.count && this.pluralResolver.shouldUseIntlApi(), g3 = m3 && t2[`defaultValue${this.options.pluralSeparator}zero`] || t2[`defaultValue${h3}`] || t2[`defaultValue${p3}`] || t2.defaultValue; + !this.isValidLookup(d2) && f3 && (r3 = true, d2 = g3), this.isValidLookup(d2) || (a3 = true, d2 = o2); + const v2 = (t2.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && a3 ? void 0 : d2, b2 = f3 && g3 !== d2 && this.options.updateMissing; + if (a3 || r3 || b2) { + if (this.logger.log(b2 ? "updateKey" : "missingKey", u2, s2, o2, b2 ? g3 : d2), i2) { + const e4 = this.resolve(o2, { ...t2, keySeparator: false }); + e4 && e4.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format."); + } + let e3 = []; + const n3 = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t2.lng || this.language); + if ("fallback" === this.options.saveMissingTo && n3 && n3[0]) + for (let t3 = 0; t3 < n3.length; t3++) + e3.push(n3[t3]); + else + "all" === this.options.saveMissingTo ? e3 = this.languageUtils.toResolveHierarchy(t2.lng || this.language) : e3.push(t2.lng || this.language); + const r4 = (e4, n4, r5) => { + const i3 = f3 && r5 !== d2 ? r5 : v2; + this.options.missingKeyHandler ? this.options.missingKeyHandler(e4, s2, n4, i3, b2, t2) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(e4, s2, n4, i3, b2, t2), this.emit("missingKey", e4, s2, n4, d2); + }; + this.options.saveMissing && (this.options.saveMissingPlurals && l3 ? e3.forEach((e4) => { + const n4 = this.pluralResolver.getSuffixes(e4, t2); + m3 && t2[`defaultValue${this.options.pluralSeparator}zero`] && n4.indexOf(`${this.options.pluralSeparator}zero`) < 0 && n4.push(`${this.options.pluralSeparator}zero`), n4.forEach((n5) => { + r4([e4], o2 + n5, t2[`defaultValue${n5}`] || g3); + }); + }) : r4(e3, o2, g3)); + } + d2 = this.extendTranslation(d2, e2, t2, c2, n2), a3 && d2 === o2 && this.options.appendNamespaceToMissingKey && (d2 = `${s2}:${o2}`), (a3 || r3) && this.options.parseMissingKeyHandler && (d2 = "v1" !== this.options.compatibilityAPI ? this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${s2}:${o2}` : o2, r3 ? d2 : void 0) : this.options.parseMissingKeyHandler(d2)); + } + return r2 ? (c2.res = d2, c2.usedParams = this.getUsedParamsDetails(t2), c2) : d2; + } + extendTranslation(e2, t2, n2, r2, i2) { + var o2 = this; + if (this.i18nFormat && this.i18nFormat.parse) + e2 = this.i18nFormat.parse(e2, { ...this.options.interpolation.defaultVariables, ...n2 }, n2.lng || this.language || r2.usedLng, r2.usedNS, r2.usedKey, { resolved: r2 }); + else if (!n2.skipInterpolation) { + n2.interpolation && this.interpolator.init({ ...n2, interpolation: { ...this.options.interpolation, ...n2.interpolation } }); + const a3 = "string" == typeof e2 && (n2 && n2.interpolation && void 0 !== n2.interpolation.skipOnVariables ? n2.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables); + let s3; + if (a3) { + const t3 = e2.match(this.interpolator.nestingRegexp); + s3 = t3 && t3.length; + } + let u2 = n2.replace && "string" != typeof n2.replace ? n2.replace : n2; + if (this.options.interpolation.defaultVariables && (u2 = { ...this.options.interpolation.defaultVariables, ...u2 }), e2 = this.interpolator.interpolate(e2, u2, n2.lng || this.language, n2), a3) { + const t3 = e2.match(this.interpolator.nestingRegexp); + s3 < (t3 && t3.length) && (n2.nest = false); + } + !n2.lng && "v1" !== this.options.compatibilityAPI && r2 && r2.res && (n2.lng = r2.usedLng), false !== n2.nest && (e2 = this.interpolator.nest(e2, function() { + for (var e3 = arguments.length, r3 = new Array(e3), a4 = 0; a4 < e3; a4++) + r3[a4] = arguments[a4]; + return i2 && i2[0] === r3[0] && !n2.context ? (o2.logger.warn(`It seems you are nesting recursively key: ${r3[0]} in key: ${t2[0]}`), null) : o2.translate(...r3, t2); + }, n2)), n2.interpolation && this.interpolator.reset(); + } + const a2 = n2.postProcess || this.options.postProcess, s2 = "string" == typeof a2 ? [a2] : a2; + return null != e2 && s2 && s2.length && false !== n2.applyPostProcessor && (e2 = _A.handle(s2, e2, t2, this.options && this.options.postProcessPassResolved ? { i18nResolved: { ...r2, usedParams: this.getUsedParamsDetails(n2) }, ...n2 } : n2, this)), e2; + } + resolve(e2) { + let t2, n2, r2, i2, o2, a2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + return "string" == typeof e2 && (e2 = [e2]), e2.forEach((e3) => { + if (this.isValidLookup(t2)) + return; + const s2 = this.extractFromKey(e3, a2), u2 = s2.key; + n2 = u2; + let l2 = s2.namespaces; + this.options.fallbackNS && (l2 = l2.concat(this.options.fallbackNS)); + const c2 = void 0 !== a2.count && "string" != typeof a2.count, d2 = c2 && !a2.ordinal && 0 === a2.count && this.pluralResolver.shouldUseIntlApi(), f2 = void 0 !== a2.context && ("string" == typeof a2.context || "number" == typeof a2.context) && "" !== a2.context, h2 = a2.lngs ? a2.lngs : this.languageUtils.toResolveHierarchy(a2.lng || this.language, a2.fallbackLng); + l2.forEach((e4) => { + this.isValidLookup(t2) || (o2 = e4, !SA[`${h2[0]}-${e4}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(o2) && (SA[`${h2[0]}-${e4}`] = true, this.logger.warn(`key "${n2}" for languages "${h2.join(", ")}" won't get resolved as namespace "${o2}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), h2.forEach((n3) => { + if (this.isValidLookup(t2)) + return; + i2 = n3; + const o3 = [u2]; + if (this.i18nFormat && this.i18nFormat.addLookupKeys) + this.i18nFormat.addLookupKeys(o3, u2, n3, e4, a2); + else { + let e5; + c2 && (e5 = this.pluralResolver.getSuffix(n3, a2.count, a2)); + const t3 = `${this.options.pluralSeparator}zero`, r3 = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`; + if (c2 && (o3.push(u2 + e5), a2.ordinal && 0 === e5.indexOf(r3) && o3.push(u2 + e5.replace(r3, this.options.pluralSeparator)), d2 && o3.push(u2 + t3)), f2) { + const n4 = `${u2}${this.options.contextSeparator}${a2.context}`; + o3.push(n4), c2 && (o3.push(n4 + e5), a2.ordinal && 0 === e5.indexOf(r3) && o3.push(n4 + e5.replace(r3, this.options.pluralSeparator)), d2 && o3.push(n4 + t3)); + } + } + let s3; + for (; s3 = o3.pop(); ) + this.isValidLookup(t2) || (r2 = s3, t2 = this.getResource(n3, e4, s3, a2)); + })); + }); + }), { res: t2, usedKey: n2, exactUsedKey: r2, usedLng: i2, usedNS: o2 }; + } + isValidLookup(e2) { + return !(void 0 === e2 || !this.options.returnNull && null === e2 || !this.options.returnEmptyString && "" === e2); + } + getResource(e2, t2, n2) { + let r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}; + return this.i18nFormat && this.i18nFormat.getResource ? this.i18nFormat.getResource(e2, t2, n2, r2) : this.resourceStore.getResource(e2, t2, n2, r2); + } + getUsedParamsDetails() { + let e2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + const t2 = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], n2 = e2.replace && "string" != typeof e2.replace; + let r2 = n2 ? e2.replace : e2; + if (n2 && void 0 !== e2.count && (r2.count = e2.count), this.options.interpolation.defaultVariables && (r2 = { ...this.options.interpolation.defaultVariables, ...r2 }), !n2) { + r2 = { ...r2 }; + for (const e3 of t2) + delete r2[e3]; + } + return r2; + } + static hasDefaultValue(e2) { + const t2 = "defaultValue"; + for (const n2 in e2) + if (Object.prototype.hasOwnProperty.call(e2, n2) && t2 === n2.substring(0, 12) && void 0 !== e2[n2]) + return true; + return false; + } + } + function kA(e2) { + return e2.charAt(0).toUpperCase() + e2.slice(1); + } + class MA { + constructor(e2) { + this.options = e2, this.supportedLngs = this.options.supportedLngs || false, this.logger = iA.create("languageUtils"); + } + getScriptPartFromCode(e2) { + if (!(e2 = yA(e2)) || e2.indexOf("-") < 0) + return null; + const t2 = e2.split("-"); + return 2 === t2.length ? null : (t2.pop(), "x" === t2[t2.length - 1].toLowerCase() ? null : this.formatLanguageCode(t2.join("-"))); + } + getLanguagePartFromCode(e2) { + if (!(e2 = yA(e2)) || e2.indexOf("-") < 0) + return e2; + const t2 = e2.split("-"); + return this.formatLanguageCode(t2[0]); + } + formatLanguageCode(e2) { + if ("string" == typeof e2 && e2.indexOf("-") > -1) { + const t2 = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"]; + let n2 = e2.split("-"); + return this.options.lowerCaseLng ? n2 = n2.map((e3) => e3.toLowerCase()) : 2 === n2.length ? (n2[0] = n2[0].toLowerCase(), n2[1] = n2[1].toUpperCase(), t2.indexOf(n2[1].toLowerCase()) > -1 && (n2[1] = kA(n2[1].toLowerCase()))) : 3 === n2.length && (n2[0] = n2[0].toLowerCase(), 2 === n2[1].length && (n2[1] = n2[1].toUpperCase()), "sgn" !== n2[0] && 2 === n2[2].length && (n2[2] = n2[2].toUpperCase()), t2.indexOf(n2[1].toLowerCase()) > -1 && (n2[1] = kA(n2[1].toLowerCase())), t2.indexOf(n2[2].toLowerCase()) > -1 && (n2[2] = kA(n2[2].toLowerCase()))), n2.join("-"); + } + return this.options.cleanCode || this.options.lowerCaseLng ? e2.toLowerCase() : e2; + } + isSupportedCode(e2) { + return ("languageOnly" === this.options.load || this.options.nonExplicitSupportedLngs) && (e2 = this.getLanguagePartFromCode(e2)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e2) > -1; + } + getBestMatchFromCodes(e2) { + if (!e2) + return null; + let t2; + return e2.forEach((e3) => { + if (t2) + return; + const n2 = this.formatLanguageCode(e3); + this.options.supportedLngs && !this.isSupportedCode(n2) || (t2 = n2); + }), !t2 && this.options.supportedLngs && e2.forEach((e3) => { + if (t2) + return; + const n2 = this.getLanguagePartFromCode(e3); + if (this.isSupportedCode(n2)) + return t2 = n2; + t2 = this.options.supportedLngs.find((e4) => e4 === n2 ? e4 : e4.indexOf("-") < 0 && n2.indexOf("-") < 0 ? void 0 : e4.indexOf("-") > 0 && n2.indexOf("-") < 0 && e4.substring(0, e4.indexOf("-")) === n2 || 0 === e4.indexOf(n2) && n2.length > 1 ? e4 : void 0); + }), t2 || (t2 = this.getFallbackCodes(this.options.fallbackLng)[0]), t2; + } + getFallbackCodes(e2, t2) { + if (!e2) + return []; + if ("function" == typeof e2 && (e2 = e2(t2)), "string" == typeof e2 && (e2 = [e2]), Array.isArray(e2)) + return e2; + if (!t2) + return e2.default || []; + let n2 = e2[t2]; + return n2 || (n2 = e2[this.getScriptPartFromCode(t2)]), n2 || (n2 = e2[this.formatLanguageCode(t2)]), n2 || (n2 = e2[this.getLanguagePartFromCode(t2)]), n2 || (n2 = e2.default), n2 || []; + } + toResolveHierarchy(e2, t2) { + const n2 = this.getFallbackCodes(t2 || this.options.fallbackLng || [], e2), r2 = [], i2 = (e3) => { + e3 && (this.isSupportedCode(e3) ? r2.push(e3) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e3}`)); + }; + return "string" == typeof e2 && (e2.indexOf("-") > -1 || e2.indexOf("_") > -1) ? ("languageOnly" !== this.options.load && i2(this.formatLanguageCode(e2)), "languageOnly" !== this.options.load && "currentOnly" !== this.options.load && i2(this.getScriptPartFromCode(e2)), "currentOnly" !== this.options.load && i2(this.getLanguagePartFromCode(e2))) : "string" == typeof e2 && i2(this.formatLanguageCode(e2)), n2.forEach((e3) => { + r2.indexOf(e3) < 0 && i2(this.formatLanguageCode(e3)); + }), r2; + } + } + let CA = [{ lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"], nr: [1, 2], fc: 1 }, { lngs: ["af", "an", "ast", "az", "bg", "bn", "ca", "da", "de", "dev", "el", "en", "eo", "es", "et", "eu", "fi", "fo", "fur", "fy", "gl", "gu", "ha", "hi", "hu", "hy", "ia", "it", "kk", "kn", "ku", "lb", "mai", "ml", "mn", "mr", "nah", "nap", "nb", "ne", "nl", "nn", "no", "nso", "pa", "pap", "pms", "ps", "pt-PT", "rm", "sco", "se", "si", "so", "son", "sq", "sv", "sw", "ta", "te", "tk", "ur", "yo"], nr: [1, 2], fc: 2 }, { lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"], nr: [1], fc: 3 }, { lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"], nr: [1, 2, 5], fc: 4 }, { lngs: ["ar"], nr: [0, 1, 2, 3, 11, 100], fc: 5 }, { lngs: ["cs", "sk"], nr: [1, 2, 5], fc: 6 }, { lngs: ["csb", "pl"], nr: [1, 2, 5], fc: 7 }, { lngs: ["cy"], nr: [1, 2, 3, 8], fc: 8 }, { lngs: ["fr"], nr: [1, 2], fc: 9 }, { lngs: ["ga"], nr: [1, 2, 3, 7, 11], fc: 10 }, { lngs: ["gd"], nr: [1, 2, 3, 20], fc: 11 }, { lngs: ["is"], nr: [1, 2], fc: 12 }, { lngs: ["jv"], nr: [0, 1], fc: 13 }, { lngs: ["kw"], nr: [1, 2, 3, 4], fc: 14 }, { lngs: ["lt"], nr: [1, 2, 10], fc: 15 }, { lngs: ["lv"], nr: [1, 2, 0], fc: 16 }, { lngs: ["mk"], nr: [1, 2], fc: 17 }, { lngs: ["mnk"], nr: [0, 1, 2], fc: 18 }, { lngs: ["mt"], nr: [1, 2, 11, 20], fc: 19 }, { lngs: ["or"], nr: [2, 1], fc: 2 }, { lngs: ["ro"], nr: [1, 2, 20], fc: 20 }, { lngs: ["sl"], nr: [5, 1, 2, 3], fc: 21 }, { lngs: ["he", "iw"], nr: [1, 2, 20, 21], fc: 22 }], xA = { 1: function(e2) { + return Number(e2 > 1); + }, 2: function(e2) { + return Number(1 != e2); + }, 3: function(e2) { + return 0; + }, 4: function(e2) { + return Number(e2 % 10 == 1 && e2 % 100 != 11 ? 0 : e2 % 10 >= 2 && e2 % 10 <= 4 && (e2 % 100 < 10 || e2 % 100 >= 20) ? 1 : 2); + }, 5: function(e2) { + return Number(0 == e2 ? 0 : 1 == e2 ? 1 : 2 == e2 ? 2 : e2 % 100 >= 3 && e2 % 100 <= 10 ? 3 : e2 % 100 >= 11 ? 4 : 5); + }, 6: function(e2) { + return Number(1 == e2 ? 0 : e2 >= 2 && e2 <= 4 ? 1 : 2); + }, 7: function(e2) { + return Number(1 == e2 ? 0 : e2 % 10 >= 2 && e2 % 10 <= 4 && (e2 % 100 < 10 || e2 % 100 >= 20) ? 1 : 2); + }, 8: function(e2) { + return Number(1 == e2 ? 0 : 2 == e2 ? 1 : 8 != e2 && 11 != e2 ? 2 : 3); + }, 9: function(e2) { + return Number(e2 >= 2); + }, 10: function(e2) { + return Number(1 == e2 ? 0 : 2 == e2 ? 1 : e2 < 7 ? 2 : e2 < 11 ? 3 : 4); + }, 11: function(e2) { + return Number(1 == e2 || 11 == e2 ? 0 : 2 == e2 || 12 == e2 ? 1 : e2 > 2 && e2 < 20 ? 2 : 3); + }, 12: function(e2) { + return Number(e2 % 10 != 1 || e2 % 100 == 11); + }, 13: function(e2) { + return Number(0 !== e2); + }, 14: function(e2) { + return Number(1 == e2 ? 0 : 2 == e2 ? 1 : 3 == e2 ? 2 : 3); + }, 15: function(e2) { + return Number(e2 % 10 == 1 && e2 % 100 != 11 ? 0 : e2 % 10 >= 2 && (e2 % 100 < 10 || e2 % 100 >= 20) ? 1 : 2); + }, 16: function(e2) { + return Number(e2 % 10 == 1 && e2 % 100 != 11 ? 0 : 0 !== e2 ? 1 : 2); + }, 17: function(e2) { + return Number(1 == e2 || e2 % 10 == 1 && e2 % 100 != 11 ? 0 : 1); + }, 18: function(e2) { + return Number(0 == e2 ? 0 : 1 == e2 ? 1 : 2); + }, 19: function(e2) { + return Number(1 == e2 ? 0 : 0 == e2 || e2 % 100 > 1 && e2 % 100 < 11 ? 1 : e2 % 100 > 10 && e2 % 100 < 20 ? 2 : 3); + }, 20: function(e2) { + return Number(1 == e2 ? 0 : 0 == e2 || e2 % 100 > 0 && e2 % 100 < 20 ? 1 : 2); + }, 21: function(e2) { + return Number(e2 % 100 == 1 ? 1 : e2 % 100 == 2 ? 2 : e2 % 100 == 3 || e2 % 100 == 4 ? 3 : 0); + }, 22: function(e2) { + return Number(1 == e2 ? 0 : 2 == e2 ? 1 : (e2 < 0 || e2 > 10) && e2 % 10 == 0 ? 2 : 3); + } }; + const AA = ["v1", "v2", "v3"], RA = ["v4"], TA = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 }; + class PA { + constructor(e2) { + let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + this.languageUtils = e2, this.options = t2, this.logger = iA.create("pluralResolver"), this.options.compatibilityJSON && !RA.includes(this.options.compatibilityJSON) || "undefined" != typeof Intl && Intl.PluralRules || (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = function() { + const e3 = {}; + return CA.forEach((t3) => { + t3.lngs.forEach((n2) => { + e3[n2] = { numbers: t3.nr, plurals: xA[t3.fc] }; + }); + }), e3; + }(); + } + addRule(e2, t2) { + this.rules[e2] = t2; + } + getRule(e2) { + let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + if (this.shouldUseIntlApi()) + try { + return new Intl.PluralRules(yA("dev" === e2 ? "en" : e2), { type: t2.ordinal ? "ordinal" : "cardinal" }); + } catch (e3) { + return; + } + return this.rules[e2] || this.rules[this.languageUtils.getLanguagePartFromCode(e2)]; + } + needsPlural(e2) { + let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + const n2 = this.getRule(e2, t2); + return this.shouldUseIntlApi() ? n2 && n2.resolvedOptions().pluralCategories.length > 1 : n2 && n2.numbers.length > 1; + } + getPluralFormsOfKey(e2, t2) { + let n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + return this.getSuffixes(e2, n2).map((e3) => `${t2}${e3}`); + } + getSuffixes(e2) { + let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + const n2 = this.getRule(e2, t2); + return n2 ? this.shouldUseIntlApi() ? n2.resolvedOptions().pluralCategories.sort((e3, t3) => TA[e3] - TA[t3]).map((e3) => `${this.options.prepend}${t2.ordinal ? `ordinal${this.options.prepend}` : ""}${e3}`) : n2.numbers.map((n3) => this.getSuffix(e2, n3, t2)) : []; + } + getSuffix(e2, t2) { + let n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + const r2 = this.getRule(e2, n2); + return r2 ? this.shouldUseIntlApi() ? `${this.options.prepend}${n2.ordinal ? `ordinal${this.options.prepend}` : ""}${r2.select(t2)}` : this.getSuffixRetroCompatible(r2, t2) : (this.logger.warn(`no plural rule found for: ${e2}`), ""); + } + getSuffixRetroCompatible(e2, t2) { + const n2 = e2.noAbs ? e2.plurals(t2) : e2.plurals(Math.abs(t2)); + let r2 = e2.numbers[n2]; + this.options.simplifyPluralSuffix && 2 === e2.numbers.length && 1 === e2.numbers[0] && (2 === r2 ? r2 = "plural" : 1 === r2 && (r2 = "")); + const i2 = () => this.options.prepend && r2.toString() ? this.options.prepend + r2.toString() : r2.toString(); + return "v1" === this.options.compatibilityJSON ? 1 === r2 ? "" : "number" == typeof r2 ? `_plural_${r2.toString()}` : i2() : "v2" === this.options.compatibilityJSON || this.options.simplifyPluralSuffix && 2 === e2.numbers.length && 1 === e2.numbers[0] ? i2() : this.options.prepend && n2.toString() ? this.options.prepend + n2.toString() : n2.toString(); + } + shouldUseIntlApi() { + return !AA.includes(this.options.compatibilityJSON); + } + } + function LA(e2, t2, n2) { + let r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : ".", i2 = !(arguments.length > 4 && void 0 !== arguments[4]) || arguments[4], o2 = function(e3, t3, n3) { + const r3 = dA(e3, n3); + return void 0 !== r3 ? r3 : dA(t3, n3); + }(e2, t2, n2); + return !o2 && i2 && "string" == typeof n2 && (o2 = bA(e2, n2, r2), void 0 === o2 && (o2 = bA(t2, n2, r2))), o2; + } + class IA { + constructor() { + let e2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + this.logger = iA.create("interpolator"), this.options = e2, this.format = e2.interpolation && e2.interpolation.format || ((e3) => e3), this.init(e2); + } + init() { + let e2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + e2.interpolation || (e2.interpolation = { escapeValue: true }); + const { escape: t2, escapeValue: n2, useRawValueToEscape: r2, prefix: i2, prefixEscaped: o2, suffix: a2, suffixEscaped: s2, formatSeparator: u2, unescapeSuffix: l2, unescapePrefix: c2, nestingPrefix: d2, nestingPrefixEscaped: f2, nestingSuffix: h2, nestingSuffixEscaped: p2, nestingOptionsSeparator: m2, maxReplaces: g2, alwaysFormat: v2 } = e2.interpolation; + this.escape = void 0 !== t2 ? t2 : mA, this.escapeValue = void 0 === n2 || n2, this.useRawValueToEscape = void 0 !== r2 && r2, this.prefix = i2 ? hA(i2) : o2 || "{{", this.suffix = a2 ? hA(a2) : s2 || "}}", this.formatSeparator = u2 || ",", this.unescapePrefix = l2 ? "" : c2 || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l2 || "", this.nestingPrefix = d2 ? hA(d2) : f2 || hA("$t("), this.nestingSuffix = h2 ? hA(h2) : p2 || hA(")"), this.nestingOptionsSeparator = m2 || ",", this.maxReplaces = g2 || 1e3, this.alwaysFormat = void 0 !== v2 && v2, this.resetRegExp(); + } + reset() { + this.options && this.init(this.options); + } + resetRegExp() { + const e2 = (e3, t2) => e3 && e3.source === t2 ? (e3.lastIndex = 0, e3) : new RegExp(t2, "g"); + this.regexp = e2(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = e2(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = e2(this.nestingRegexp, `${this.nestingPrefix}(.+?)${this.nestingSuffix}`); + } + interpolate(e2, t2, n2, r2) { + let i2, o2, a2; + const s2 = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}; + function u2(e3) { + return e3.replace(/\$/g, "$$$$"); + } + const l2 = (e3) => { + if (e3.indexOf(this.formatSeparator) < 0) { + const i4 = LA(t2, s2, e3, this.options.keySeparator, this.options.ignoreJSONStructure); + return this.alwaysFormat ? this.format(i4, void 0, n2, { ...r2, ...t2, interpolationkey: e3 }) : i4; + } + const i3 = e3.split(this.formatSeparator), o3 = i3.shift().trim(), a3 = i3.join(this.formatSeparator).trim(); + return this.format(LA(t2, s2, o3, this.options.keySeparator, this.options.ignoreJSONStructure), a3, n2, { ...r2, ...t2, interpolationkey: o3 }); + }; + this.resetRegExp(); + const c2 = r2 && r2.missingInterpolationHandler || this.options.missingInterpolationHandler, d2 = r2 && r2.interpolation && void 0 !== r2.interpolation.skipOnVariables ? r2.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables; + return [{ regex: this.regexpUnescape, safeValue: (e3) => u2(e3) }, { regex: this.regexp, safeValue: (e3) => this.escapeValue ? u2(this.escape(e3)) : u2(e3) }].forEach((t3) => { + for (a2 = 0; i2 = t3.regex.exec(e2); ) { + const n3 = i2[1].trim(); + if (o2 = l2(n3), void 0 === o2) + if ("function" == typeof c2) { + const t4 = c2(e2, i2, r2); + o2 = "string" == typeof t4 ? t4 : ""; + } else if (r2 && Object.prototype.hasOwnProperty.call(r2, n3)) + o2 = ""; + else { + if (d2) { + o2 = i2[0]; + continue; + } + this.logger.warn(`missed to pass in variable ${n3} for interpolating ${e2}`), o2 = ""; + } + else + "string" == typeof o2 || this.useRawValueToEscape || (o2 = sA(o2)); + const s3 = t3.safeValue(o2); + if (e2 = e2.replace(i2[0], s3), d2 ? (t3.regex.lastIndex += o2.length, t3.regex.lastIndex -= i2[0].length) : t3.regex.lastIndex = 0, a2++, a2 >= this.maxReplaces) + break; + } + }), e2; + } + nest(e2, t2) { + let n2, r2, i2, o2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + function a2(e3, t3) { + const n3 = this.nestingOptionsSeparator; + if (e3.indexOf(n3) < 0) + return e3; + const r3 = e3.split(new RegExp(`${n3}[ ]*{`)); + let o3 = `{${r3[1]}`; + e3 = r3[0], o3 = this.interpolate(o3, i2); + const a3 = o3.match(/'/g), s2 = o3.match(/"/g); + (a3 && a3.length % 2 == 0 && !s2 || s2.length % 2 != 0) && (o3 = o3.replace(/'/g, '"')); + try { + i2 = JSON.parse(o3), t3 && (i2 = { ...t3, ...i2 }); + } catch (t4) { + return this.logger.warn(`failed parsing options string in nesting for key ${e3}`, t4), `${e3}${n3}${o3}`; + } + return i2.defaultValue && i2.defaultValue.indexOf(this.prefix) > -1 && delete i2.defaultValue, e3; + } + for (; n2 = this.nestingRegexp.exec(e2); ) { + let s2 = []; + i2 = { ...o2 }, i2 = i2.replace && "string" != typeof i2.replace ? i2.replace : i2, i2.applyPostProcessor = false, delete i2.defaultValue; + let u2 = false; + if (-1 !== n2[0].indexOf(this.formatSeparator) && !/{.*}/.test(n2[1])) { + const e3 = n2[1].split(this.formatSeparator).map((e4) => e4.trim()); + n2[1] = e3.shift(), s2 = e3, u2 = true; + } + if (r2 = t2(a2.call(this, n2[1].trim(), i2), i2), r2 && n2[0] === e2 && "string" != typeof r2) + return r2; + "string" != typeof r2 && (r2 = sA(r2)), r2 || (this.logger.warn(`missed to resolve ${n2[1]} for nesting ${e2}`), r2 = ""), u2 && (r2 = s2.reduce((e3, t3) => this.format(e3, t3, o2.lng, { ...o2, interpolationkey: n2[1].trim() }), r2.trim())), e2 = e2.replace(n2[0], r2), this.regexp.lastIndex = 0; + } + return e2; + } + } + function OA(e2) { + const t2 = {}; + return function(n2, r2, i2) { + const o2 = r2 + JSON.stringify(i2); + let a2 = t2[o2]; + return a2 || (a2 = e2(yA(r2), i2), t2[o2] = a2), a2(n2); + }; + } + class NA { + constructor() { + let e2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + this.logger = iA.create("formatter"), this.options = e2, this.formats = { number: OA((e3, t2) => { + const n2 = new Intl.NumberFormat(e3, { ...t2 }); + return (e4) => n2.format(e4); + }), currency: OA((e3, t2) => { + const n2 = new Intl.NumberFormat(e3, { ...t2, style: "currency" }); + return (e4) => n2.format(e4); + }), datetime: OA((e3, t2) => { + const n2 = new Intl.DateTimeFormat(e3, { ...t2 }); + return (e4) => n2.format(e4); + }), relativetime: OA((e3, t2) => { + const n2 = new Intl.RelativeTimeFormat(e3, { ...t2 }); + return (e4) => n2.format(e4, t2.range || "day"); + }), list: OA((e3, t2) => { + const n2 = new Intl.ListFormat(e3, { ...t2 }); + return (e4) => n2.format(e4); + }) }, this.init(e2); + } + init(e2) { + const t2 = (arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { interpolation: {} }).interpolation; + this.formatSeparator = t2.formatSeparator ? t2.formatSeparator : t2.formatSeparator || ","; + } + add(e2, t2) { + this.formats[e2.toLowerCase().trim()] = t2; + } + addCached(e2, t2) { + this.formats[e2.toLowerCase().trim()] = OA(t2); + } + format(e2, t2, n2) { + let r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}; + const i2 = t2.split(this.formatSeparator).reduce((e3, t3) => { + const { formatName: i3, formatOptions: o2 } = function(e4) { + let t4 = e4.toLowerCase().trim(); + const n3 = {}; + if (e4.indexOf("(") > -1) { + const r3 = e4.split("("); + t4 = r3[0].toLowerCase().trim(); + const i4 = r3[1].substring(0, r3[1].length - 1); + "currency" === t4 && i4.indexOf(":") < 0 ? n3.currency || (n3.currency = i4.trim()) : "relativetime" === t4 && i4.indexOf(":") < 0 ? n3.range || (n3.range = i4.trim()) : i4.split(";").forEach((e5) => { + if (e5) { + const [t5, ...r4] = e5.split(":"), i5 = r4.join(":").trim().replace(/^'+|'+$/g, ""), o3 = t5.trim(); + n3[o3] || (n3[o3] = i5), "false" === i5 && (n3[o3] = false), "true" === i5 && (n3[o3] = true), isNaN(i5) || (n3[o3] = parseInt(i5, 10)); + } + }); + } + return { formatName: t4, formatOptions: n3 }; + }(t3); + if (this.formats[i3]) { + let t4 = e3; + try { + const a2 = r2 && r2.formatParams && r2.formatParams[r2.interpolationkey] || {}, s2 = a2.locale || a2.lng || r2.locale || r2.lng || n2; + t4 = this.formats[i3](e3, s2, { ...o2, ...r2, ...a2 }); + } catch (e4) { + this.logger.warn(e4); + } + return t4; + } + return this.logger.warn(`there was no format function for ${i3}`), e3; + }, e2); + return i2; + } + } + class DA extends oA { + constructor(e2, t2, n2) { + let r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}; + super(), this.backend = e2, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger = iA.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = r2.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = r2.maxRetries >= 0 ? r2.maxRetries : 5, this.retryTimeout = r2.retryTimeout >= 1 ? r2.retryTimeout : 350, this.state = {}, this.queue = [], this.backend && this.backend.init && this.backend.init(n2, r2.backend, r2); + } + queueLoad(e2, t2, n2, r2) { + const i2 = {}, o2 = {}, a2 = {}, s2 = {}; + return e2.forEach((e3) => { + let r3 = true; + t2.forEach((t3) => { + const a3 = `${e3}|${t3}`; + !n2.reload && this.store.hasResourceBundle(e3, t3) ? this.state[a3] = 2 : this.state[a3] < 0 || (1 === this.state[a3] ? void 0 === o2[a3] && (o2[a3] = true) : (this.state[a3] = 1, r3 = false, void 0 === o2[a3] && (o2[a3] = true), void 0 === i2[a3] && (i2[a3] = true), void 0 === s2[t3] && (s2[t3] = true))); + }), r3 || (a2[e3] = true); + }), (Object.keys(i2).length || Object.keys(o2).length) && this.queue.push({ pending: o2, pendingCount: Object.keys(o2).length, loaded: {}, errors: [], callback: r2 }), { toLoad: Object.keys(i2), pending: Object.keys(o2), toLoadLanguages: Object.keys(a2), toLoadNamespaces: Object.keys(s2) }; + } + loaded(e2, t2, n2) { + const r2 = e2.split("|"), i2 = r2[0], o2 = r2[1]; + t2 && this.emit("failedLoading", i2, o2, t2), n2 && this.store.addResourceBundle(i2, o2, n2, void 0, void 0, { skipCopy: true }), this.state[e2] = t2 ? -1 : 2; + const a2 = {}; + this.queue.forEach((n3) => { + !function(e3, t3, n4, r3) { + const { obj: i3, k: o3 } = lA(e3, t3, Object); + i3[o3] = i3[o3] || [], r3 && (i3[o3] = i3[o3].concat(n4)), r3 || i3[o3].push(n4); + }(n3.loaded, [i2], o2), function(e3, t3) { + void 0 !== e3.pending[t3] && (delete e3.pending[t3], e3.pendingCount--); + }(n3, e2), t2 && n3.errors.push(t2), 0 !== n3.pendingCount || n3.done || (Object.keys(n3.loaded).forEach((e3) => { + a2[e3] || (a2[e3] = {}); + const t3 = n3.loaded[e3]; + t3.length && t3.forEach((t4) => { + void 0 === a2[e3][t4] && (a2[e3][t4] = true); + }); + }), n3.done = true, n3.errors.length ? n3.callback(n3.errors) : n3.callback()); + }), this.emit("loaded", a2), this.queue = this.queue.filter((e3) => !e3.done); + } + read(e2, t2, n2) { + let r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, i2 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : this.retryTimeout, o2 = arguments.length > 5 ? arguments[5] : void 0; + if (!e2.length) + return o2(null, {}); + if (this.readingCalls >= this.maxParallelReads) + return void this.waitingReads.push({ lng: e2, ns: t2, fcName: n2, tried: r2, wait: i2, callback: o2 }); + this.readingCalls++; + const a2 = (a3, s3) => { + if (this.readingCalls--, this.waitingReads.length > 0) { + const e3 = this.waitingReads.shift(); + this.read(e3.lng, e3.ns, e3.fcName, e3.tried, e3.wait, e3.callback); + } + a3 && s3 && r2 < this.maxRetries ? setTimeout(() => { + this.read.call(this, e2, t2, n2, r2 + 1, 2 * i2, o2); + }, i2) : o2(a3, s3); + }, s2 = this.backend[n2].bind(this.backend); + if (2 !== s2.length) + return s2(e2, t2, a2); + try { + const n3 = s2(e2, t2); + n3 && "function" == typeof n3.then ? n3.then((e3) => a2(null, e3)).catch(a2) : a2(null, n3); + } catch (e3) { + a2(e3); + } + } + prepareLoading(e2, t2) { + let n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, r2 = arguments.length > 3 ? arguments[3] : void 0; + if (!this.backend) + return this.logger.warn("No backend was added via i18next.use. Will not load resources."), r2 && r2(); + "string" == typeof e2 && (e2 = this.languageUtils.toResolveHierarchy(e2)), "string" == typeof t2 && (t2 = [t2]); + const i2 = this.queueLoad(e2, t2, n2, r2); + if (!i2.toLoad.length) + return i2.pending.length || r2(), null; + i2.toLoad.forEach((e3) => { + this.loadOne(e3); + }); + } + load(e2, t2, n2) { + this.prepareLoading(e2, t2, {}, n2); + } + reload(e2, t2, n2) { + this.prepareLoading(e2, t2, { reload: true }, n2); + } + loadOne(e2) { + let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : ""; + const n2 = e2.split("|"), r2 = n2[0], i2 = n2[1]; + this.read(r2, i2, "read", void 0, void 0, (n3, o2) => { + n3 && this.logger.warn(`${t2}loading namespace ${i2} for language ${r2} failed`, n3), !n3 && o2 && this.logger.log(`${t2}loaded namespace ${i2} for language ${r2}`, o2), this.loaded(e2, n3, o2); + }); + } + saveMissing(e2, t2, n2, r2, i2) { + let o2 = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : {}, a2 = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : () => { + }; + if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(t2)) + this.logger.warn(`did not save key "${n2}" as the namespace "${t2}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"); + else if (null != n2 && "" !== n2) { + if (this.backend && this.backend.create) { + const s2 = { ...o2, isUpdate: i2 }, u2 = this.backend.create.bind(this.backend); + if (u2.length < 6) + try { + let i3; + i3 = 5 === u2.length ? u2(e2, t2, n2, r2, s2) : u2(e2, t2, n2, r2), i3 && "function" == typeof i3.then ? i3.then((e3) => a2(null, e3)).catch(a2) : a2(null, i3); + } catch (e3) { + a2(e3); + } + else + u2(e2, t2, n2, r2, a2, s2); + } + e2 && e2[0] && this.store.addResource(e2[0], t2, n2, r2); + } + } + } + function jA() { + return { debug: false, initImmediate: true, ns: ["translation"], defaultNS: ["translation"], fallbackLng: ["dev"], fallbackNS: false, supportedLngs: false, nonExplicitSupportedLngs: false, load: "all", preload: false, simplifyPluralSuffix: true, keySeparator: ".", nsSeparator: ":", pluralSeparator: "_", contextSeparator: "_", partialBundledLanguages: false, saveMissing: false, updateMissing: false, saveMissingTo: "fallback", saveMissingPlurals: true, missingKeyHandler: false, missingInterpolationHandler: false, postProcess: false, postProcessPassResolved: false, returnNull: false, returnEmptyString: true, returnObjects: false, joinArrays: false, returnedObjectHandler: false, parseMissingKeyHandler: false, appendNamespaceToMissingKey: false, appendNamespaceToCIMode: false, overloadTranslationOptionHandler: function(e2) { + let t2 = {}; + if ("object" == typeof e2[1] && (t2 = e2[1]), "string" == typeof e2[1] && (t2.defaultValue = e2[1]), "string" == typeof e2[2] && (t2.tDescription = e2[2]), "object" == typeof e2[2] || "object" == typeof e2[3]) { + const n2 = e2[3] || e2[2]; + Object.keys(n2).forEach((e3) => { + t2[e3] = n2[e3]; + }); + } + return t2; + }, interpolation: { escapeValue: true, format: (e2) => e2, prefix: "{{", suffix: "}}", formatSeparator: ",", unescapePrefix: "-", nestingPrefix: "$t(", nestingSuffix: ")", nestingOptionsSeparator: ",", maxReplaces: 1e3, skipOnVariables: true } }; + } + function BA(e2) { + return "string" == typeof e2.ns && (e2.ns = [e2.ns]), "string" == typeof e2.fallbackLng && (e2.fallbackLng = [e2.fallbackLng]), "string" == typeof e2.fallbackNS && (e2.fallbackNS = [e2.fallbackNS]), e2.supportedLngs && e2.supportedLngs.indexOf("cimode") < 0 && (e2.supportedLngs = e2.supportedLngs.concat(["cimode"])), e2; + } + function zA() { + } + class UA extends oA { + constructor() { + let e2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t2 = arguments.length > 1 ? arguments[1] : void 0; + var n2; + if (super(), this.options = BA(e2), this.services = {}, this.logger = iA, this.modules = { external: [] }, n2 = this, Object.getOwnPropertyNames(Object.getPrototypeOf(n2)).forEach((e3) => { + "function" == typeof n2[e3] && (n2[e3] = n2[e3].bind(n2)); + }), t2 && !this.isInitialized && !e2.isClone) { + if (!this.options.initImmediate) + return this.init(e2, t2), this; + setTimeout(() => { + this.init(e2, t2); + }, 0); + } + } + init() { + var e2 = this; + let t2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, n2 = arguments.length > 1 ? arguments[1] : void 0; + this.isInitializing = true, "function" == typeof t2 && (n2 = t2, t2 = {}), !t2.defaultNS && false !== t2.defaultNS && t2.ns && ("string" == typeof t2.ns ? t2.defaultNS = t2.ns : t2.ns.indexOf("translation") < 0 && (t2.defaultNS = t2.ns[0])); + const r2 = jA(); + function i2(e3) { + return e3 ? "function" == typeof e3 ? new e3() : e3 : null; + } + if (this.options = { ...r2, ...this.options, ...BA(t2) }, "v1" !== this.options.compatibilityAPI && (this.options.interpolation = { ...r2.interpolation, ...this.options.interpolation }), void 0 !== t2.keySeparator && (this.options.userDefinedKeySeparator = t2.keySeparator), void 0 !== t2.nsSeparator && (this.options.userDefinedNsSeparator = t2.nsSeparator), !this.options.isClone) { + let t3; + this.modules.logger ? iA.init(i2(this.modules.logger), this.options) : iA.init(null, this.options), this.modules.formatter ? t3 = this.modules.formatter : "undefined" != typeof Intl && (t3 = NA); + const n3 = new MA(this.options); + this.store = new wA(this.options.resources, this.options); + const o3 = this.services; + o3.logger = iA, o3.resourceStore = this.store, o3.languageUtils = n3, o3.pluralResolver = new PA(n3, { prepend: this.options.pluralSeparator, compatibilityJSON: this.options.compatibilityJSON, simplifyPluralSuffix: this.options.simplifyPluralSuffix }), !t3 || this.options.interpolation.format && this.options.interpolation.format !== r2.interpolation.format || (o3.formatter = i2(t3), o3.formatter.init(o3, this.options), this.options.interpolation.format = o3.formatter.format.bind(o3.formatter)), o3.interpolator = new IA(this.options), o3.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, o3.backendConnector = new DA(i2(this.modules.backend), o3.resourceStore, o3, this.options), o3.backendConnector.on("*", function(t4) { + for (var n4 = arguments.length, r3 = new Array(n4 > 1 ? n4 - 1 : 0), i3 = 1; i3 < n4; i3++) + r3[i3 - 1] = arguments[i3]; + e2.emit(t4, ...r3); + }), this.modules.languageDetector && (o3.languageDetector = i2(this.modules.languageDetector), o3.languageDetector.init && o3.languageDetector.init(o3, this.options.detection, this.options)), this.modules.i18nFormat && (o3.i18nFormat = i2(this.modules.i18nFormat), o3.i18nFormat.init && o3.i18nFormat.init(this)), this.translator = new EA(this.services, this.options), this.translator.on("*", function(t4) { + for (var n4 = arguments.length, r3 = new Array(n4 > 1 ? n4 - 1 : 0), i3 = 1; i3 < n4; i3++) + r3[i3 - 1] = arguments[i3]; + e2.emit(t4, ...r3); + }), this.modules.external.forEach((e3) => { + e3.init && e3.init(this); + }); + } + if (this.format = this.options.interpolation.format, n2 || (n2 = zA), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) { + const e3 = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng); + e3.length > 0 && "dev" !== e3[0] && (this.options.lng = e3[0]); + } + this.services.languageDetector || this.options.lng || this.logger.warn("init: no languageDetector is used and no lng is defined"); + ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((t3) => { + this[t3] = function() { + return e2.store[t3](...arguments); + }; + }); + ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((t3) => { + this[t3] = function() { + return e2.store[t3](...arguments), e2; + }; + }); + const o2 = aA(), a2 = () => { + const e3 = (e4, t3) => { + this.isInitializing = false, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = true, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), o2.resolve(t3), n2(e4, t3); + }; + if (this.languages && "v1" !== this.options.compatibilityAPI && !this.isInitialized) + return e3(null, this.t.bind(this)); + this.changeLanguage(this.options.lng, e3); + }; + return this.options.resources || !this.options.initImmediate ? a2() : setTimeout(a2, 0), o2; + } + loadResources(e2) { + let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : zA; + const n2 = "string" == typeof e2 ? e2 : this.language; + if ("function" == typeof e2 && (t2 = e2), !this.options.resources || this.options.partialBundledLanguages) { + if (n2 && "cimode" === n2.toLowerCase() && (!this.options.preload || 0 === this.options.preload.length)) + return t2(); + const e3 = [], r2 = (t3) => { + if (!t3) + return; + if ("cimode" === t3) + return; + this.services.languageUtils.toResolveHierarchy(t3).forEach((t4) => { + "cimode" !== t4 && e3.indexOf(t4) < 0 && e3.push(t4); + }); + }; + if (n2) + r2(n2); + else { + this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e4) => r2(e4)); + } + this.options.preload && this.options.preload.forEach((e4) => r2(e4)), this.services.backendConnector.load(e3, this.options.ns, (e4) => { + e4 || this.resolvedLanguage || !this.language || this.setResolvedLanguage(this.language), t2(e4); + }); + } else + t2(null); + } + reloadResources(e2, t2, n2) { + const r2 = aA(); + return e2 || (e2 = this.languages), t2 || (t2 = this.options.ns), n2 || (n2 = zA), this.services.backendConnector.reload(e2, t2, (e3) => { + r2.resolve(), n2(e3); + }), r2; + } + use(e2) { + if (!e2) + throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()"); + if (!e2.type) + throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()"); + return "backend" === e2.type && (this.modules.backend = e2), ("logger" === e2.type || e2.log && e2.warn && e2.error) && (this.modules.logger = e2), "languageDetector" === e2.type && (this.modules.languageDetector = e2), "i18nFormat" === e2.type && (this.modules.i18nFormat = e2), "postProcessor" === e2.type && _A.addPostProcessor(e2), "formatter" === e2.type && (this.modules.formatter = e2), "3rdParty" === e2.type && this.modules.external.push(e2), this; + } + setResolvedLanguage(e2) { + if (e2 && this.languages && !(["cimode", "dev"].indexOf(e2) > -1)) + for (let e3 = 0; e3 < this.languages.length; e3++) { + const t2 = this.languages[e3]; + if (!(["cimode", "dev"].indexOf(t2) > -1) && this.store.hasLanguageSomeTranslations(t2)) { + this.resolvedLanguage = t2; + break; + } + } + } + changeLanguage(e2, t2) { + var n2 = this; + this.isLanguageChangingTo = e2; + const r2 = aA(); + this.emit("languageChanging", e2); + const i2 = (e3) => { + this.language = e3, this.languages = this.services.languageUtils.toResolveHierarchy(e3), this.resolvedLanguage = void 0, this.setResolvedLanguage(e3); + }, o2 = (e3, o3) => { + o3 ? (i2(o3), this.translator.changeLanguage(o3), this.isLanguageChangingTo = void 0, this.emit("languageChanged", o3), this.logger.log("languageChanged", o3)) : this.isLanguageChangingTo = void 0, r2.resolve(function() { + return n2.t(...arguments); + }), t2 && t2(e3, function() { + return n2.t(...arguments); + }); + }, a2 = (t3) => { + e2 || t3 || !this.services.languageDetector || (t3 = []); + const n3 = "string" == typeof t3 ? t3 : this.services.languageUtils.getBestMatchFromCodes(t3); + n3 && (this.language || i2(n3), this.translator.language || this.translator.changeLanguage(n3), this.services.languageDetector && this.services.languageDetector.cacheUserLanguage && this.services.languageDetector.cacheUserLanguage(n3)), this.loadResources(n3, (e3) => { + o2(e3, n3); + }); + }; + return e2 || !this.services.languageDetector || this.services.languageDetector.async ? !e2 && this.services.languageDetector && this.services.languageDetector.async ? 0 === this.services.languageDetector.detect.length ? this.services.languageDetector.detect().then(a2) : this.services.languageDetector.detect(a2) : a2(e2) : a2(this.services.languageDetector.detect()), r2; + } + getFixedT(e2, t2, n2) { + var r2 = this; + const i2 = function(e3, t3) { + let o2; + if ("object" != typeof t3) { + for (var a2 = arguments.length, s2 = new Array(a2 > 2 ? a2 - 2 : 0), u2 = 2; u2 < a2; u2++) + s2[u2 - 2] = arguments[u2]; + o2 = r2.options.overloadTranslationOptionHandler([e3, t3].concat(s2)); + } else + o2 = { ...t3 }; + o2.lng = o2.lng || i2.lng, o2.lngs = o2.lngs || i2.lngs, o2.ns = o2.ns || i2.ns, o2.keyPrefix = o2.keyPrefix || n2 || i2.keyPrefix; + const l2 = r2.options.keySeparator || "."; + let c2; + return c2 = o2.keyPrefix && Array.isArray(e3) ? e3.map((e4) => `${o2.keyPrefix}${l2}${e4}`) : o2.keyPrefix ? `${o2.keyPrefix}${l2}${e3}` : e3, r2.t(c2, o2); + }; + return "string" == typeof e2 ? i2.lng = e2 : i2.lngs = e2, i2.ns = t2, i2.keyPrefix = n2, i2; + } + t() { + return this.translator && this.translator.translate(...arguments); + } + exists() { + return this.translator && this.translator.exists(...arguments); + } + setDefaultNamespace(e2) { + this.options.defaultNS = e2; + } + hasLoadedNamespace(e2) { + let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + if (!this.isInitialized) + return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), false; + if (!this.languages || !this.languages.length) + return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), false; + const n2 = t2.lng || this.resolvedLanguage || this.languages[0], r2 = !!this.options && this.options.fallbackLng, i2 = this.languages[this.languages.length - 1]; + if ("cimode" === n2.toLowerCase()) + return true; + const o2 = (e3, t3) => { + const n3 = this.services.backendConnector.state[`${e3}|${t3}`]; + return -1 === n3 || 2 === n3; + }; + if (t2.precheck) { + const e3 = t2.precheck(this, o2); + if (void 0 !== e3) + return e3; + } + return !!this.hasResourceBundle(n2, e2) || (!(this.services.backendConnector.backend && (!this.options.resources || this.options.partialBundledLanguages)) || !(!o2(n2, e2) || r2 && !o2(i2, e2))); + } + loadNamespaces(e2, t2) { + const n2 = aA(); + return this.options.ns ? ("string" == typeof e2 && (e2 = [e2]), e2.forEach((e3) => { + this.options.ns.indexOf(e3) < 0 && this.options.ns.push(e3); + }), this.loadResources((e3) => { + n2.resolve(), t2 && t2(e3); + }), n2) : (t2 && t2(), Promise.resolve()); + } + loadLanguages(e2, t2) { + const n2 = aA(); + "string" == typeof e2 && (e2 = [e2]); + const r2 = this.options.preload || [], i2 = e2.filter((e3) => r2.indexOf(e3) < 0 && this.services.languageUtils.isSupportedCode(e3)); + return i2.length ? (this.options.preload = r2.concat(i2), this.loadResources((e3) => { + n2.resolve(), t2 && t2(e3); + }), n2) : (t2 && t2(), Promise.resolve()); + } + dir(e2) { + if (e2 || (e2 = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language)), !e2) + return "rtl"; + const t2 = this.services && this.services.languageUtils || new MA(jA()); + return ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"].indexOf(t2.getLanguagePartFromCode(e2)) > -1 || e2.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr"; + } + static createInstance() { + return new UA(arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, arguments.length > 1 ? arguments[1] : void 0); + } + cloneInstance() { + let e2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : zA; + const n2 = e2.forkResourceStore; + n2 && delete e2.forkResourceStore; + const r2 = { ...this.options, ...e2, isClone: true }, i2 = new UA(r2); + void 0 === e2.debug && void 0 === e2.prefix || (i2.logger = i2.logger.clone(e2)); + return ["store", "services", "language"].forEach((e3) => { + i2[e3] = this[e3]; + }), i2.services = { ...this.services }, i2.services.utils = { hasLoadedNamespace: i2.hasLoadedNamespace.bind(i2) }, n2 && (i2.store = new wA(this.store.data, r2), i2.services.resourceStore = i2.store), i2.translator = new EA(i2.services, r2), i2.translator.on("*", function(e3) { + for (var t3 = arguments.length, n3 = new Array(t3 > 1 ? t3 - 1 : 0), r3 = 1; r3 < t3; r3++) + n3[r3 - 1] = arguments[r3]; + i2.emit(e3, ...n3); + }), i2.init(r2, t2), i2.translator.options = r2, i2.translator.backendConnector.services.utils = { hasLoadedNamespace: i2.hasLoadedNamespace.bind(i2) }, i2; + } + toJSON() { + return { options: this.options, store: this.store, language: this.language, languages: this.languages, resolvedLanguage: this.resolvedLanguage }; + } + } + const FA = UA.createInstance(); + FA.createInstance = UA.createInstance; + const KA = FA.createInstance; + FA.dir, FA.init, FA.loadResources, FA.reloadResources, FA.use, FA.changeLanguage, FA.getFixedT, FA.t, FA.exists, FA.setDefaultNamespace, FA.hasLoadedNamespace, FA.loadNamespaces, FA.loadLanguages; + var qA, HA = { name: "@metamask/sdk", version: "0.30.1", description: "", homepage: "https://github.com/MetaMask/metamask-sdk#readme", bugs: { url: "https://github.com/MetaMask/metamask-sdk/issues" }, repository: { type: "git", url: "https://github.com/MetaMask/metamask-sdk", directory: "packages/sdk" }, main: "dist/node/cjs/metamask-sdk.js", unpkg: "dist/browser/umd/metamask-sdk.js", module: "dist/node/es/metamask-sdk.js", browser: "dist/browser/umd/metamask-sdk.js", "react-native": "dist/react-native/es/metamask-sdk.js", types: "dist/browser/es/src/index.d.ts", sideEffects: false, files: ["/dist"], scripts: { build: "rm -rf dist && rollup -c --bundleConfigAsCjs", "build:dev": "rimraf dist && NODE_ENV=dev rollup -c --bundleConfigAsCjs", "build:post-tsc": "echo 'N/A'", "build:pre-tsc": "echo 'N/A'", clean: "rimraf ./dist", size: "node bundle-size && size-limit", lint: "yarn lint:eslint && yarn lint:misc --check", "lint:changelog": "../../scripts/validate-changelog.sh @metamask/sdk", "lint:eslint": "eslint . --cache --ext js,ts", "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write", "lint:misc": "prettier '**/*.json' '**/*.md' '!CHANGELOG.md' --ignore-path ../../.gitignore", prepack: "../../scripts/prepack.sh", "publish:preview": "yarn npm publish --tag preview", reset: "yarn clean && rimraf ./node_modules/", test: 'jest --testPathIgnorePatterns "/e2e/"', "test:coverage": 'jest --coverage --testPathIgnorePatterns "/e2e/"', "test:e2e": 'jest --testPathPattern "/e2e/"', "test:ci": 'jest --coverage --passWithNoTests --setupFilesAfterEnv ./jest-preload.js --testPathIgnorePatterns "/e2e/"', "test:dev": 'jest -c ./jest.config.ts --detectOpenHandles --testPathIgnorePatterns "/e2e/"', watch: "rollup -c -w" }, dependencies: { "@metamask/onboarding": "^1.0.1", "@metamask/providers": "16.1.0", "@metamask/sdk-communication-layer": "workspace:*", "@metamask/sdk-install-modal-web": "workspace:*", bowser: "^2.9.0", "cross-fetch": "^4.0.0", debug: "^4.3.4", eciesjs: "^0.4.8", "eth-rpc-errors": "^4.0.3", eventemitter2: "^6.4.7", i18next: "23.11.5", "i18next-browser-languagedetector": "7.1.0", "obj-multiplex": "^1.0.0", pump: "^3.0.0", "qrcode-terminal-nooctal": "^0.12.1", "react-native-webview": "^11.26.0", "readable-stream": "^3.6.2", "socket.io-client": "^4.5.1", util: "^0.12.4", uuid: "^8.3.2" }, devDependencies: { "@jest/globals": "^29.3.1", "@lavamoat/allow-scripts": "^2.3.1", "@metamask/auto-changelog": "3.1.0", "@metamask/eslint-config": "^6.0.0", "@metamask/eslint-config-nodejs": "^6.0.0", "@metamask/eslint-config-typescript": "^6.0.0", "@react-native-async-storage/async-storage": "^1.19.6", "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-node-resolve": "^15.0.2", "@rollup/plugin-terser": "^0.4.1", "@size-limit/preset-big-lib": "^11.0.2", "@types/dom-screen-wake-lock": "^1.0.2", "@types/node": "^20.1.3", "@types/pump": "^1.1.1", "@types/qrcode-terminal": "^0.12.0", "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^4.26.0", "@typescript-eslint/parser": "^4.26.0", eslint: "^7.30.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.23.4", "eslint-plugin-jest": "^24.4.0", "eslint-plugin-jsdoc": "^36.1.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^3.4.0", jest: "^29.3.1", "jest-environment-jsdom": "^29.3.1", prettier: "^2.3.0", react: "^18.2.0", "react-dom": "18.2.0", rimraf: "^4.4.0", rollup: "^3.21.7", "rollup-plugin-jscc": "^2.0.0", "rollup-plugin-natives": "^0.7.5", "rollup-plugin-node-builtins": "^2.1.2", "rollup-plugin-node-globals": "^1.4.0", "rollup-plugin-polyfill-node": "^0.11.0", "rollup-plugin-sizes": "^1.0.6", "rollup-plugin-typescript2": "^0.31.2", "rollup-plugin-visualizer": "^5.9.2", "size-limit": "^11.0.2", "ts-jest": "^29.0.3", "ts-node": "^10.9.1", tslib: "latest", typescript: "^4.3.2" }, peerDependencies: { react: "^18.2.0", "react-dom": "^18.2.0" }, peerDependenciesMeta: { react: { optional: true }, "react-dom": { optional: true } }, publishConfig: { access: "public", registry: "https://registry.npmjs.org/" }, lavamoat: { allowScripts: { "eciesjs>secp256k1": false, "socket.io-client>engine.io-client>ws>bufferutil": false, "socket.io-client>engine.io-client>ws>utf-8-validate": false, "@metamask/sdk-communication-layer>bufferutil": false, "@metamask/sdk-communication-layer>eciesjs>secp256k1": false, "@metamask/sdk-communication-layer>utf-8-validate": false } } }; + !function(e2) { + e2.INPAGE = "metamask-inpage", e2.CONTENT_SCRIPT = "metamask-contentscript", e2.PROVIDER = "metamask-provider"; + }(qA || (qA = {})); + const WA = "direct", $A = "https://metamask.app.link/connect", VA = "metamask://connect", YA = { NAME: "MetaMask", RDNS: "io.metamask" }, GA = /(?:^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}$)|(?:^0{8}-0{4}-0{4}-0{4}-0{12}$)/u; + const ZA = { Initialized: "initialized", DisplayURI: "display_uri", ProviderUpdate: "provider_update", ConnectWithResponse: "connectWithResponse", ConnectionStatus: "connection_status", ServiceStatus: "service_status" }; + var QA; + e.PROVIDER_UPDATE_TYPE = void 0, (QA = e.PROVIDER_UPDATE_TYPE || (e.PROVIDER_UPDATE_TYPE = {})).TERMINATE = "terminate", QA.EXTENSION = "extension", QA.INITIALIZED = "initialized"; + const JA = "undefined" != typeof window && window.localStorage; + function XA({ instance: e2, msg: t2 }) { + return kk(this, void 0, void 0, function* () { + if (e2._initialized || (xx("[MetaMaskSDK: connectAndSign()] provider not ready -- wait for init()"), yield e2.init()), xx(`[MetaMaskSDK: connectAndSign()] activeProvider=${e2.activeProvider}`), !e2.activeProvider) + throw new Error("SDK state invalid -- undefined provider"); + const n2 = function(e3) { + return /^0x([0-9A-Fa-f]{2})*$/u.test(e3); + }(t2) ? t2 : function(e3) { + let t3; + if ("undefined" != typeof Buffer) + t3 = Buffer.from(e3, "utf8").toString("hex"); + else if ("undefined" != typeof TextEncoder) { + const n3 = new TextEncoder().encode(e3); + t3 = Array.from(n3).map((e4) => e4.toString(16).padStart(2, "0")).join(""); + } else { + if ("object" != typeof commonjsGlobal || !("Buffer" in commonjsGlobal)) + throw new Error("Unable to convert string to hex: No available method."); + t3 = commonjsGlobal.Buffer.from(e3, "utf8").toString("hex"); + } + return `0x${t3}`; + }(t2); + return e2.activeProvider.request({ method: Kx.METAMASK_CONNECTWITH, params: [{ method: Kx.PERSONAL_SIGN, params: [n2] }] }); + }); + } + function eR(t2) { + var n2, r2; + return kk(this, void 0, void 0, function* () { + xx("[MetaMaskSDK: connectWithExtensionProvider()] ", t2), t2.sdkProvider = t2.activeProvider, t2.activeProvider = window.extension, window.ethereum = window.extension; + try { + const e2 = yield null === (n2 = window.extension) || void 0 === n2 ? void 0 : n2.request({ method: "eth_requestAccounts" }); + xx(`[MetaMaskSDK: connectWithExtensionProvider()] accounts=${e2}`); + } catch (e2) { + return void console.warn("[MetaMaskSDK: connectWithExtensionProvider()] can't request accounts error", e2); + } + localStorage.setItem(Vx, "extension"), t2.extensionActive = true, t2.emit(ZA.ProviderUpdate, e.PROVIDER_UPDATE_TYPE.EXTENSION), t2.options.enableAnalytics && (null === (r2 = t2.analytics) || void 0 === r2 || r2.send({ event: ZE.SDK_USE_EXTENSION })); + }); + } + function tR(e2) { + return tR = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e3) { + return typeof e3; + } : function(e3) { + return e3 && "function" == typeof Symbol && e3.constructor === Symbol && e3 !== Symbol.prototype ? "symbol" : typeof e3; + }, tR(e2); + } + function nR(e2) { + var t2 = function(e3, t3) { + if ("object" !== tR(e3) || null === e3) + return e3; + var n2 = e3[Symbol.toPrimitive]; + if (void 0 !== n2) { + var r2 = n2.call(e3, t3 || "default"); + if ("object" !== tR(r2)) + return r2; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === t3 ? String : Number)(e3); + }(e2, "string"); + return "symbol" === tR(t2) ? t2 : String(t2); + } + function rR(e2, t2) { + for (var n2 = 0; n2 < t2.length; n2++) { + var r2 = t2[n2]; + r2.enumerable = r2.enumerable || false, r2.configurable = true, "value" in r2 && (r2.writable = true), Object.defineProperty(e2, nR(r2.key), r2); + } + } + var iR = [], oR = iR.forEach, aR = iR.slice; + var sR = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, uR = function(e2, t2, n2, r2) { + var i2 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : { path: "/", sameSite: "strict" }; + n2 && (i2.expires = /* @__PURE__ */ new Date(), i2.expires.setTime(i2.expires.getTime() + 60 * n2 * 1e3)), r2 && (i2.domain = r2), document.cookie = function(e3, t3, n3) { + var r3 = n3 || {}; + r3.path = r3.path || "/"; + var i3 = encodeURIComponent(t3), o2 = "".concat(e3, "=").concat(i3); + if (r3.maxAge > 0) { + var a2 = r3.maxAge - 0; + if (Number.isNaN(a2)) + throw new Error("maxAge should be a Number"); + o2 += "; Max-Age=".concat(Math.floor(a2)); + } + if (r3.domain) { + if (!sR.test(r3.domain)) + throw new TypeError("option domain is invalid"); + o2 += "; Domain=".concat(r3.domain); + } + if (r3.path) { + if (!sR.test(r3.path)) + throw new TypeError("option path is invalid"); + o2 += "; Path=".concat(r3.path); + } + if (r3.expires) { + if ("function" != typeof r3.expires.toUTCString) + throw new TypeError("option expires is invalid"); + o2 += "; Expires=".concat(r3.expires.toUTCString()); + } + if (r3.httpOnly && (o2 += "; HttpOnly"), r3.secure && (o2 += "; Secure"), r3.sameSite) + switch ("string" == typeof r3.sameSite ? r3.sameSite.toLowerCase() : r3.sameSite) { + case true: + o2 += "; SameSite=Strict"; + break; + case "lax": + o2 += "; SameSite=Lax"; + break; + case "strict": + o2 += "; SameSite=Strict"; + break; + case "none": + o2 += "; SameSite=None"; + break; + default: + throw new TypeError("option sameSite is invalid"); + } + return o2; + }(e2, encodeURIComponent(t2), i2); + }, lR = function(e2) { + for (var t2 = "".concat(e2, "="), n2 = document.cookie.split(";"), r2 = 0; r2 < n2.length; r2++) { + for (var i2 = n2[r2]; " " === i2.charAt(0); ) + i2 = i2.substring(1, i2.length); + if (0 === i2.indexOf(t2)) + return i2.substring(t2.length, i2.length); + } + return null; + }, cR = { name: "cookie", lookup: function(e2) { + var t2; + if (e2.lookupCookie && "undefined" != typeof document) { + var n2 = lR(e2.lookupCookie); + n2 && (t2 = n2); + } + return t2; + }, cacheUserLanguage: function(e2, t2) { + t2.lookupCookie && "undefined" != typeof document && uR(t2.lookupCookie, e2, t2.cookieMinutes, t2.cookieDomain, t2.cookieOptions); + } }, dR = { name: "querystring", lookup: function(e2) { + var t2; + if ("undefined" != typeof window) { + var n2 = window.location.search; + !window.location.search && window.location.hash && window.location.hash.indexOf("?") > -1 && (n2 = window.location.hash.substring(window.location.hash.indexOf("?"))); + for (var r2 = n2.substring(1).split("&"), i2 = 0; i2 < r2.length; i2++) { + var o2 = r2[i2].indexOf("="); + if (o2 > 0) + r2[i2].substring(0, o2) === e2.lookupQuerystring && (t2 = r2[i2].substring(o2 + 1)); + } + } + return t2; + } }, fR = null, hR = function() { + if (null !== fR) + return fR; + try { + fR = "undefined" !== window && null !== window.localStorage; + var e2 = "i18next.translate.boo"; + window.localStorage.setItem(e2, "foo"), window.localStorage.removeItem(e2); + } catch (e3) { + fR = false; + } + return fR; + }, pR = { name: "localStorage", lookup: function(e2) { + var t2; + if (e2.lookupLocalStorage && hR()) { + var n2 = window.localStorage.getItem(e2.lookupLocalStorage); + n2 && (t2 = n2); + } + return t2; + }, cacheUserLanguage: function(e2, t2) { + t2.lookupLocalStorage && hR() && window.localStorage.setItem(t2.lookupLocalStorage, e2); + } }, mR = null, gR = function() { + if (null !== mR) + return mR; + try { + mR = "undefined" !== window && null !== window.sessionStorage; + var e2 = "i18next.translate.boo"; + window.sessionStorage.setItem(e2, "foo"), window.sessionStorage.removeItem(e2); + } catch (e3) { + mR = false; + } + return mR; + }, vR = { name: "sessionStorage", lookup: function(e2) { + var t2; + if (e2.lookupSessionStorage && gR()) { + var n2 = window.sessionStorage.getItem(e2.lookupSessionStorage); + n2 && (t2 = n2); + } + return t2; + }, cacheUserLanguage: function(e2, t2) { + t2.lookupSessionStorage && gR() && window.sessionStorage.setItem(t2.lookupSessionStorage, e2); + } }, bR = { name: "navigator", lookup: function(e2) { + var t2 = []; + if ("undefined" != typeof navigator) { + if (navigator.languages) + for (var n2 = 0; n2 < navigator.languages.length; n2++) + t2.push(navigator.languages[n2]); + navigator.userLanguage && t2.push(navigator.userLanguage), navigator.language && t2.push(navigator.language); + } + return t2.length > 0 ? t2 : void 0; + } }, yR = { name: "htmlTag", lookup: function(e2) { + var t2, n2 = e2.htmlTag || ("undefined" != typeof document ? document.documentElement : null); + return n2 && "function" == typeof n2.getAttribute && (t2 = n2.getAttribute("lang")), t2; + } }, wR = { name: "path", lookup: function(e2) { + var t2; + if ("undefined" != typeof window) { + var n2 = window.location.pathname.match(/\/([a-zA-Z-]*)/g); + if (n2 instanceof Array) + if ("number" == typeof e2.lookupFromPathIndex) { + if ("string" != typeof n2[e2.lookupFromPathIndex]) + return; + t2 = n2[e2.lookupFromPathIndex].replace("/", ""); + } else + t2 = n2[0].replace("/", ""); + } + return t2; + } }, _R = { name: "subdomain", lookup: function(e2) { + var t2 = "number" == typeof e2.lookupFromSubdomainIndex ? e2.lookupFromSubdomainIndex + 1 : 1, n2 = "undefined" != typeof window && window.location && window.location.hostname && window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i); + if (n2) + return n2[t2]; + } }; + var SR = function() { + function e2(t3) { + var n3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + !function(e3, t4) { + if (!(e3 instanceof t4)) + throw new TypeError("Cannot call a class as a function"); + }(this, e2), this.type = "languageDetector", this.detectors = {}, this.init(t3, n3); + } + var t2, n2; + return t2 = e2, n2 = [{ key: "init", value: function(e3) { + var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; + this.services = e3 || { languageUtils: {} }, this.options = function(e4) { + return oR.call(aR.call(arguments, 1), function(t4) { + if (t4) + for (var n4 in t4) + void 0 === e4[n4] && (e4[n4] = t4[n4]); + }), e4; + }(t3, this.options || {}, { order: ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"], lookupQuerystring: "lng", lookupCookie: "i18next", lookupLocalStorage: "i18nextLng", lookupSessionStorage: "i18nextLng", caches: ["localStorage"], excludeCacheFor: ["cimode"], convertDetectedLanguage: function(e4) { + return e4; + } }), "string" == typeof this.options.convertDetectedLanguage && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = function(e4) { + return e4.replace("-", "_"); + }), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = n3, this.addDetector(cR), this.addDetector(dR), this.addDetector(pR), this.addDetector(vR), this.addDetector(bR), this.addDetector(yR), this.addDetector(wR), this.addDetector(_R); + } }, { key: "addDetector", value: function(e3) { + this.detectors[e3.name] = e3; + } }, { key: "detect", value: function(e3) { + var t3 = this; + e3 || (e3 = this.options.order); + var n3 = []; + return e3.forEach(function(e4) { + if (t3.detectors[e4]) { + var r2 = t3.detectors[e4].lookup(t3.options); + r2 && "string" == typeof r2 && (r2 = [r2]), r2 && (n3 = n3.concat(r2)); + } + }), n3 = n3.map(function(e4) { + return t3.options.convertDetectedLanguage(e4); + }), this.services.languageUtils.getBestMatchFromCodes ? n3 : n3.length > 0 ? n3[0] : null; + } }, { key: "cacheUserLanguage", value: function(e3, t3) { + var n3 = this; + t3 || (t3 = this.options.caches), t3 && (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(e3) > -1 || t3.forEach(function(t4) { + n3.detectors[t4] && n3.detectors[t4].cacheUserLanguage(e3, n3.options); + })); + } }], n2 && rR(t2.prototype, n2), Object.defineProperty(t2, "prototype", { writable: false }), e2; + }(); + SR.type = "languageDetector"; + var ER = { DESKTOP: "Desktop", MOBILE: "Mobile", META_MASK_MOBILE_APP: "MetaMask mobile app", SCAN_TO_CONNECT: "Scan to connect and sign with", CONNECT_WITH_EXTENSION: "Connect With MetaMask Extension", INSTALL_MODAL: { TRUSTED_BY_USERS: "Trusted by over 30 million users to buy, store, send and swap crypto securely", LEADING_CRYPTO_WALLET: "The leading crypto wallet & gateway to blockchain apps built on Ethereum Mainnet, Polygon, Optimism, and many other networks", CONTROL_DIGITAL_INTERACTIONS: "Puts you in control of your digital interactions by making power of cryptography more accessible", INSTALL_META_MASK_EXTENSION: "Install MetaMask Extension" }, PENDING_MODAL: { OPEN_META_MASK_SELECT_CODE: "Please open the MetaMask wallet app and select the code on the screen OR disconnect", OPEN_META_MASK_CONTINUE: "Open the MetaMask app to continue with your session.", NUMBER_AFTER_OPEN_NOTICE: "If a number doesn't appear after opening MetaMask, please click disconnect and re-scan the QRCode.", DISCONNECT: "Disconnect" }, SELECT_MODAL: { CRYPTO_TAKE_CONTROL_TEXT: "Take control of your crypto and explore the blockchain with the wallet trusted by over 30 million people worldwide" }, META_MASK_MODAL: { ADDRESS_COPIED: "Address copied to clipboard!", DISCONNECT: "Disconnect", ACTIVE_NETWORK: "Active Network" } }, kR = { DESKTOP: "Escritorio", MOBILE: "Móvil", META_MASK_MOBILE_APP: "Aplicación móvil de MetaMask", SCAN_TO_CONNECT: "Escanear para conectar y firmar con", CONNECT_WITH_EXTENSION: "Conectar con la Extensión de MetaMask", INSTALL_MODAL: { TRUSTED_BY_USERS: "Confiado por más de 30 millones de usuarios para comprar, almacenar, enviar e intercambiar cripto de manera segura", LEADING_CRYPTO_WALLET: "La principal billetera de criptomonedas y pasarela hacia aplicaciones blockchain construidas en Ethereum Mainnet, Polygon, Optimism y muchas otras redes", CONTROL_DIGITAL_INTERACTIONS: "Te da el control de tus interacciones digitales al hacer que el poder de la criptografía sea más accesible", INSTALL_META_MASK_EXTENSION: "Instalar la Extensión de MetaMask" }, PENDING_MODAL: { OPEN_META_MASK_SELECT_CODE: "Por favor, abre la aplicación de billetera MetaMask y selecciona el código en la pantalla O desconecta", OPEN_META_MASK_CONTINUE: "Abre la aplicación de MetaMask para continuar con tu sesión.", NUMBER_AFTER_OPEN_NOTICE: "Si no aparece un número después de abrir MetaMask, por favor haz clic en desconectar y vuelve a escanear el código QR.", DISCONNECT: "Desconectar" }, SELECT_MODAL: { CRYPTO_TAKE_CONTROL_TEXT: "Toma el control de tu cripto y explora la blockchain con la billetera en la que confían más de 30 millones de personas en todo el mundo" }, META_MASK_MODAL: { ADDRESS_COPIED: "¡Dirección copiada al portapapeles!", DISCONNECT: "Desconectar", ACTIVE_NETWORK: "Red activa" } }, MR = { DESKTOP: "Bureau", MOBILE: "Mobile", META_MASK_MOBILE_APP: "Application mobile MetaMask", SCAN_TO_CONNECT: "Scannez pour vous connecter et signer avec", CONNECT_WITH_EXTENSION: "Connectez-vous avec l'extension MetaMask", INSTALL_MODAL: { TRUSTED_BY_USERS: "Fait confiance à plus de 30 millions d'utilisateurs pour acheter, stocker, envoyer et échanger des crypto en toute sécurité", LEADING_CRYPTO_WALLET: "Le portefeuille crypto leader et la passerelle vers des applications blockchain basées sur Ethereum Mainnet, Polygon, Optimism, et de nombreux autres réseaux", CONTROL_DIGITAL_INTERACTIONS: "Vous donne le contrôle de vos interactions numériques en rendant la puissance de la cryptographie plus accessible", INSTALL_META_MASK_EXTENSION: "Installez l'extension MetaMask" }, PENDING_MODAL: { OPEN_META_MASK_SELECT_CODE: "Veuillez ouvrir l'application MetaMask et sélectionnez le code à l'écran OU déconnectez-vous", OPEN_META_MASK_CONTINUE: "Ouvrez l'application MetaMask pour continuer votre session.", NUMBER_AFTER_OPEN_NOTICE: "Si un numéro n'apparaît pas après avoir ouvert MetaMask, veuillez cliquer sur déconnecter et rescanner le QRCode.", DISCONNECT: "Déconnecter" }, SELECT_MODAL: { CRYPTO_TAKE_CONTROL_TEXT: "Prenez le contrôle de votre crypto et explorez la blockchain avec le portefeuille fait confiance par plus de 30 millions de personnes à travers le monde" }, META_MASK_MODAL: { ADDRESS_COPIED: "Adresse copiée dans le presse-papiers!", DISCONNECT: "Déconnecter", ACTIVE_NETWORK: "Réseau actif" } }, CR = { DESKTOP: "שולחן עבודה", MOBILE: "נייד", META_MASK_MOBILE_APP: "אפליקציית מטא מאסק לנייד", SCAN_TO_CONNECT: "סרוק כדי להתחבר ולחתום עם", CONNECT_WITH_EXTENSION: "התחבר עם התוסף של מטא מאסק", INSTALL_MODAL: { TRUSTED_BY_USERS: "מהימנים על ידי למעלה מ-30 מיליון משתמשים לקנות, לאחסן, לשלוח ולהחליף מטבע קריפטוגרפי בבטחה", LEADING_CRYPTO_WALLET: "ארנק הקריפטו המוביל והשער ליישומי בלוקצ'יין המתוכנתים על אתריום, פוליגון, ורשתות רבות נוספות", CONTROL_DIGITAL_INTERACTIONS: "מכניס אותך לשליטה על האינטראקציות הדיגיטליות שלך על ידי הפיכת כוח הקריפטוגרפיה לנגיש יותר", INSTALL_META_MASK_EXTENSION: "התקן את ההרחבה של מטא מאסק" }, PENDING_MODAL: { OPEN_META_MASK_SELECT_CODE: "אנא פתח את אפליקציית ארנק מטא מאסק ובחר את הקוד שמופיע על המסך או התנתק", OPEN_META_MASK_CONTINUE: "פתח את האפליקציה של מטא מאסק כדי להמשיך בפעולה שלך.", NUMBER_AFTER_OPEN_NOTICE: "אם מספר אינו מופיע לאחר פתיחת מטא מאסק, אנא לחץ על התנתקות וסרוק מחדש את ה-QRCode.", DISCONNECT: "התנתק" }, SELECT_MODAL: { CRYPTO_TAKE_CONTROL_TEXT: "קח שליטה על הקריפטו שלך וחקור את הבלוקצ'יין עם הארנק האמין שבשימוש על ידי למעלה מ-30 מיליון אנשים ברחבי העולם" }, META_MASK_MODAL: { ADDRESS_COPIED: "הכתובת הועתקה ללוח!", DISCONNECT: "התנתק", ACTIVE_NETWORK: "רשת פעילה" } }, xR = { DESKTOP: "Desktop", MOBILE: "Mobile", META_MASK_MOBILE_APP: "App mobile MetaMask", SCAN_TO_CONNECT: "Scansiona per connetterti e firmare con", CONNECT_WITH_EXTENSION: "Connettiti con l'estensione MetaMask", INSTALL_MODAL: { TRUSTED_BY_USERS: "Ritenuto affidabile da oltre 30 milioni di utenti per acquistare, conservare, inviare e scambiare cripto in modo sicuro", LEADING_CRYPTO_WALLET: "Il principale portafoglio cripto e gateway per applicazioni blockchain funzionanti su Ethereum Mainnet, Polygon, Optimism e molte altre reti", CONTROL_DIGITAL_INTERACTIONS: "Ti da il controllo delle tue interazioni digitali rendendo piu' accessibile il potere della crittografia", INSTALL_META_MASK_EXTENSION: "Installa l'estensione MetaMask" }, PENDING_MODAL: { OPEN_META_MASK_SELECT_CODE: "Si prega di aprire l'app mobile MetaMask Wallet e selezionare il codice sullo schermo OPPURE scollegarsi", OPEN_META_MASK_CONTINUE: "Apri l'app mobile MetaMask per continuare con la tua sessione.", NUMBER_AFTER_OPEN_NOTICE: "Se, dopo aver aperto MetaMask, non appare alcun numero, si prega di fare clic su disconnetti e ris canzionare il QRCode.", DISCONNECT: "Disconnetti" }, SELECT_MODAL: { CRYPTO_TAKE_CONTROL_TEXT: "Prendi il controllo delle tue cripto e esplora la blockchain con il portafoglio ritenuto affidabile da oltre 30 milioni di persone in tutto il mondo" }, META_MASK_MODAL: { ADDRESS_COPIED: "Indirizzo copiato negli appunti!", DISCONNECT: "Disconnetti", ACTIVE_NETWORK: "Rete attiva" } }, AR = { DESKTOP: "Desktop", MOBILE: "Móvel", META_MASK_MOBILE_APP: "Aplicativo móvel MetaMask", SCAN_TO_CONNECT: "Escanear para conectar e assinar com", CONNECT_WITH_EXTENSION: "Conectar com a extensão MetaMask", INSTALL_MODAL: { TRUSTED_BY_USERS: "Confiado por mais de 30 milhões de usuários para comprar, armazenar, enviar e trocar cripto com segurança", LEADING_CRYPTO_WALLET: "A principal carteira de cripto & portal para aplicativos blockchain construídos em Ethereum Mainnet, Polygon, Optimism, e muitas outras redes", CONTROL_DIGITAL_INTERACTIONS: "Coloca você no controle de suas interações digitais, tornando o poder da criptografia mais acessível", INSTALL_META_MASK_EXTENSION: "Instalar a extensão MetaMask" }, PENDING_MODAL: { OPEN_META_MASK_SELECT_CODE: "Por favor, abra o aplicativo MetaMask e selecione o código na tela OU desconecte", OPEN_META_MASK_CONTINUE: "Abra o aplicativo MetaMask para continuar sua sessão.", NUMBER_AFTER_OPEN_NOTICE: "Se um número não aparecer após abrir o MetaMask, por favor clique em desconectar e re-escaneie o QRCode.", DISCONNECT: "Desconectar" }, SELECT_MODAL: { CRYPTO_TAKE_CONTROL_TEXT: "Assuma o controle de sua cripto e explore a blockchain com a carteira confiada por mais de 30 milhões de pessoas em todo o mundo" }, META_MASK_MODAL: { ADDRESS_COPIED: "Endereço copiado para a área de transferência!", DISCONNECT: "Desconectar", ACTIVE_NETWORK: "Rede ativa" } }, RR = { DESKTOP: "Masaüstü", MOBILE: "Mobil", META_MASK_MOBILE_APP: "MetaMask mobil uygulama", SCAN_TO_CONNECT: "Bağlanmak ve imzalamak için tarayın", CONNECT_WITH_EXTENSION: "MetaMask Eklentisi ile Bağlan", INSTALL_MODAL: { TRUSTED_BY_USERS: "Kriptoyu güvenle satın almak, saklamak, göndermek ve değiştirmek için 30 milyondan fazla kullanıcı tarafından güvenilir", LEADING_CRYPTO_WALLET: "Ethereum Ana Ağı, Polygon, Optimism ve birçok diğer ağda kurulu blockchain uygulamalarına erişim sağlayan öncü kripto cüzdanı", CONTROL_DIGITAL_INTERACTIONS: "Kriptografinin gücünü daha erişilebilir kılarak dijital etkileşimlerinizin kontrolünü size verir", INSTALL_META_MASK_EXTENSION: "MetaMask Eklentisini Yükleyin" }, PENDING_MODAL: { OPEN_META_MASK_SELECT_CODE: "Lütfen MetaMask cüzdan uygulamasını açın ve ekrandaki kodu seçin YA DA bağlantıyı kesin", OPEN_META_MASK_CONTINUE: "Oturumunuzla devam etmek için MetaMask uygulamasını açın.", NUMBER_AFTER_OPEN_NOTICE: "MetaMask'ı açtıktan sonra bir numara görünmezse, lütfen bağlantıyı kesin ve QR Kodunu tekrar tarayın.", DISCONNECT: "Bağlantıyı Kes" }, SELECT_MODAL: { CRYPTO_TAKE_CONTROL_TEXT: "Kriptonuzu kontrol edin ve dünya genelinde 30 milyondan fazla kişi tarafından güvenilen cüzdanla blockchain'i keşfedin" }, META_MASK_MODAL: { ADDRESS_COPIED: "Adres panoya kopyalandı!", DISCONNECT: "Bağlantıyı Kes", ACTIVE_NETWORK: "Aktif Ağ" } }; + function TR(e2) { + let t2; + if ("undefined" != typeof Buffer) + t2 = Buffer.from(e2, "utf8").toString("base64"); + else if ("function" == typeof btoa) + t2 = btoa(encodeURIComponent(e2).replace(/%([0-9A-F]{2})/gu, (e3, t3) => String.fromCharCode(parseInt(t3, 16)))); + else { + if ("object" != typeof commonjsGlobal || !("Buffer" in commonjsGlobal)) + throw new Error("Unable to base64 encode: No available method."); + t2 = commonjsGlobal.Buffer.from(e2, "utf8").toString("base64"); + } + return t2; + } + class PR { + constructor({ shouldSetOnWindow: e2, connectionStream: t2, shouldSendMetadata: n2 = false, shouldShimWeb3: r2, sdkInstance: i2 }) { + const o2 = new Xx({ connectionStream: t2, shouldSendMetadata: n2, shouldSetOnWindow: e2, shouldShimWeb3: r2, autoRequestAccounts: false }), a2 = new Proxy(o2, { deleteProperty: () => true }); + var s2; + this.provider = a2, this.sdkInstance = i2, e2 && "undefined" != typeof window && (s2 = o2, window.ethereum = s2, window.dispatchEvent(new Event("ethereum#initialized"))), r2 && "undefined" != typeof window && function(e3, t3 = console) { + let n3 = false, r3 = false; + if (!window.web3) { + const i3 = "__isMetaMaskShim__"; + let o3 = { currentProvider: e3 }; + Object.defineProperty(o3, i3, { value: true, enumerable: true, configurable: false, writable: false }), o3 = new Proxy(o3, { get: (o4, a3, ...s3) => ("currentProvider" !== a3 || n3 ? "currentProvider" === a3 || a3 === i3 || r3 || (r3 = true, t3.error("MetaMask no longer injects web3. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"), e3.request({ method: "metamask_logWeb3ShimUsage" }).catch((e4) => { + t3.debug("MetaMask: Failed to log web3 shim usage.", e4); + })) : (n3 = true, t3.warn("You are accessing the MetaMask window.web3.currentProvider shim. This property is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3")), Reflect.get(o4, a3, ...s3)), set: (...e4) => (t3.warn("You are accessing the MetaMask window.web3 shim. This object is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"), Reflect.set(...e4)) }), Object.defineProperty(window, "web3", { value: o3, enumerable: false, configurable: true, writable: true }); + } + }(this.provider), this.provider.on("display_uri", (e3) => { + this.sdkInstance.emit(ZA.DisplayURI, e3); + }), this.provider.on("_initialized", () => { + const e3 = { chainId: this.provider.getChainId(), isConnected: this.provider.isConnected(), isMetaMask: this.provider.isMetaMask, selectedAddress: this.provider.getSelectedAddress(), networkVersion: this.provider.getNetworkVersion() }; + this.sdkInstance.emit(ZA.Initialized, e3), xx("[Ethereum: constructor()] provider initialized", e3); + }); + } + static init(e2) { + var t2; + return xx("[Ethereum: init()] Initializing Ethereum service"), this.instance = new PR(e2), null === (t2 = this.instance) || void 0 === t2 ? void 0 : t2.provider; + } + static destroy() { + } + static getInstance() { + var e2; + if (!(null === (e2 = this.instance) || void 0 === e2 ? void 0 : e2.provider)) + throw new Error("Ethereum instance not intiialized - call Ethereum.factory first."); + return this.instance; + } + static getProvider() { + var e2; + if (!(null === (e2 = this.instance) || void 0 === e2 ? void 0 : e2.provider)) + throw new Error("Ethereum instance not intiialized - call Ethereum.factory first."); + return this.instance.provider; + } + } + function LR(e2, t2, n2, r2) { + var i2, o2, a2, s2, u2, l2, c2, d2, f2, h2, p2, m2, g2, v2, b2, y2, w2, S2, E2, k2; + return kk(this, void 0, void 0, function* () { + const n3 = null === (i2 = e2.state.remote) || void 0 === i2 ? void 0 : i2.isReady(), M2 = null === (o2 = e2.state.remote) || void 0 === o2 ? void 0 : o2.isConnected(), C2 = null === (a2 = e2.state.remote) || void 0 === a2 ? void 0 : a2.isPaused(), x2 = PR.getProvider(), A2 = null === (s2 = e2.state.remote) || void 0 === s2 ? void 0 : s2.getChannelId(), R2 = null === (u2 = e2.state.remote) || void 0 === u2 ? void 0 : u2.isAuthorized(), { deeplinkProtocol: T2 } = e2.state, { method: P2, data: L2, triggeredInstaller: I2 } = ((e3) => { + var t3, n4, r3, i3; + let o3; + _.isBuffer(e3) ? (o3 = e3.toJSON(), o3._isBuffer = true) : o3 = e3; + const a3 = null === (t3 = null == o3 ? void 0 : o3.data) || void 0 === t3 ? void 0 : t3.method; + let s3 = false; + return "object" == typeof (null === (n4 = null == o3 ? void 0 : o3.data) || void 0 === n4 ? void 0 : n4.params) && true === (null === (i3 = null === (r3 = null == o3 ? void 0 : o3.data) || void 0 === r3 ? void 0 : r3.params) || void 0 === i3 ? void 0 : i3.__triggeredInstaller) && (s3 = true, o3.data.params = o3.data.params.wrappedParams), { method: a3, data: o3, triggeredInstaller: s3 }; + })(t2); + if (xx(`[RCPMS: write()] method='${P2}' isRemoteReady=${n3} channelId=${A2} isSocketConnected=${M2} isRemotePaused=${C2} providerConnected=${x2.isConnected()}`, t2), !A2) + return P2 !== Kx.METAMASK_GETPROVIDERSTATE && xx(`[RCPMS: write()] ${P2} --> channelId is undefined`), r2(new Error("disconnected")); + xx(`[RCPMS: write()] remote.isPaused()=${null === (l2 = e2.state.remote) || void 0 === l2 ? void 0 : l2.isPaused()} authorized=${R2} ready=${n3} socketConnected=${M2}`, t2); + const O2 = null === (c2 = e2.state.platformManager) || void 0 === c2 ? void 0 : c2.isSecure(), N2 = null !== (f2 = null === (d2 = e2.state.platformManager) || void 0 === d2 ? void 0 : d2.isMobileWeb()) && void 0 !== f2 && f2, D2 = null !== (p2 = null === (h2 = e2.state.remote) || void 0 === h2 ? void 0 : h2.hasDeeplinkProtocol()) && void 0 !== p2 && p2 && N2 && R2; + try { + if (D2 && !I2 || null === (m2 = e2.state.remote) || void 0 === m2 || m2.sendMessage(null == L2 ? void 0 : L2.data).then(() => { + xx(`[RCPMS: _write()] ${P2} sent successfully`); + }).catch((e3) => { + xx("[RCPMS: _write()] error sending message", e3); + }), !O2) + return xx(`[RCPMS: _write()] unsecure platform for method ${P2} -- return callback`), r2(); + if (I2) + return xx("[RCPMS: _write()] prevent deeplink -- installation completed separately."), r2(); + const t3 = null !== (b2 = null === (v2 = null === (g2 = e2.state.remote) || void 0 === g2 ? void 0 : g2.getKeyInfo()) || void 0 === v2 ? void 0 : v2.ecies.public) && void 0 !== b2 ? b2 : ""; + let n4 = encodeURI(`channelId=${A2}&pubkey=${t3}&comm=socket&t=d&v=2`); + if (D2) { + const t4 = JSON.stringify(null == L2 ? void 0 : L2.data), i3 = null === (y2 = e2.state.remote) || void 0 === y2 ? void 0 : y2.encrypt(t4); + if (!i3) + return xx("[RCPMS: _write()] error encrypting message"), r2(new Error("RemoteCommunicationPostMessageStream - disconnected")); + n4 += `&scheme=${T2}&rpc=${TR(i3)}`; + } + if (!(null === (w2 = e2.state.platformManager) || void 0 === w2 ? void 0 : w2.isMetaMaskInstalled())) + return xx("[RCPMS: _write()] prevent deeplink until installation is completed."), r2(); + qx[P2] ? (xx(`[RCPMS: _write()] redirect link for '${P2}' socketConnected=${M2} connect?${n4}`), null === (S2 = e2.state.platformManager) || void 0 === S2 || S2.openDeeplink(`${$A}?${n4}`, `${VA}?${n4}`, "_self")) : (null === (E2 = e2.state.remote) || void 0 === E2 ? void 0 : E2.isPaused()) ? (xx(`[RCPMS: _write()] MM is PAUSED! deeplink with connect! targetMethod=${P2}`), null === (k2 = e2.state.platformManager) || void 0 === k2 || k2.openDeeplink(`${$A}?redirect=true&${n4}`, `${VA}?redirect=true&${n4}`, "_self")) : xx(`[RCPMS: _write()] method ${P2} doesn't need redirect.`); + } catch (e3) { + return xx("[RCPMS: _write()] error sending message", e3), r2(new Error("RemoteCommunicationPostMessageStream - disconnected")); + } + return r2(); + }); + } + class IR extends Hn.Duplex { + constructor({ name: t2, remote: n2, deeplinkProtocol: r2, platformManager: i2 }) { + super({ objectMode: true }), this.state = { _name: null, remote: null, deeplinkProtocol: false, platformManager: null }, this.state._name = t2, this.state.remote = n2, this.state.deeplinkProtocol = r2, this.state.platformManager = i2, this._onMessage = this._onMessage.bind(this), this.state.remote.on(e.EventType.MESSAGE, this._onMessage); + } + _write(e2, t2, n2) { + return kk(this, void 0, void 0, function* () { + return LR(this, e2, 0, n2); + }); + } + _read() { + } + _onMessage(e2) { + return function(e3, t2) { + try { + if (xx("[RCPMS: onMessage()] message", t2), !t2 || "object" != typeof t2) + return; + if ("object" != typeof (null == t2 ? void 0 : t2.data)) + return; + if (!(null == t2 ? void 0 : t2.name)) + return void xx("[RCPMS: onMessage()] ignore message without name", t2); + if ((null == t2 ? void 0 : t2.name) !== qA.PROVIDER) + return void xx(`[RCPMS: onMessage()] ignore message with wrong name message=${t2}`); + if (_.isBuffer(t2)) { + const n2 = _.from(t2); + e3.push(n2); + } else + e3.push(t2); + } catch (e4) { + xx(`[RCPMS: onMessage()] ignore message error err=${e4}`); + } + }(this, e2); + } + start() { + } + } + var OR = { exports: {} }; + !function(e2, t2) { + var r2 = "undefined" != typeof globalThis && globalThis || "undefined" != typeof self && self || void 0 !== n && n, i2 = function() { + function e3() { + this.fetch = false, this.DOMException = r2.DOMException; + } + return e3.prototype = r2, new e3(); + }(); + !function(e3) { + !function(t3) { + var n2 = void 0 !== e3 && e3 || "undefined" != typeof self && self || void 0 !== n2 && n2, r3 = "URLSearchParams" in n2, i3 = "Symbol" in n2 && "iterator" in Symbol, o3 = "FileReader" in n2 && "Blob" in n2 && function() { + try { + return new Blob(), true; + } catch (e4) { + return false; + } + }(), a2 = "FormData" in n2, s2 = "ArrayBuffer" in n2; + if (s2) + var u2 = ["[object Int8Array]", "[object Uint8Array]", "[object Uint8ClampedArray]", "[object Int16Array]", "[object Uint16Array]", "[object Int32Array]", "[object Uint32Array]", "[object Float32Array]", "[object Float64Array]"], l2 = ArrayBuffer.isView || function(e4) { + return e4 && u2.indexOf(Object.prototype.toString.call(e4)) > -1; + }; + function c2(e4) { + if ("string" != typeof e4 && (e4 = String(e4)), /[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e4) || "" === e4) + throw new TypeError('Invalid character in header field name: "' + e4 + '"'); + return e4.toLowerCase(); + } + function d2(e4) { + return "string" != typeof e4 && (e4 = String(e4)), e4; + } + function f2(e4) { + var t4 = { next: function() { + var t5 = e4.shift(); + return { done: void 0 === t5, value: t5 }; + } }; + return i3 && (t4[Symbol.iterator] = function() { + return t4; + }), t4; + } + function h2(e4) { + this.map = {}, e4 instanceof h2 ? e4.forEach(function(e5, t4) { + this.append(t4, e5); + }, this) : Array.isArray(e4) ? e4.forEach(function(e5) { + this.append(e5[0], e5[1]); + }, this) : e4 && Object.getOwnPropertyNames(e4).forEach(function(t4) { + this.append(t4, e4[t4]); + }, this); + } + function p2(e4) { + if (e4.bodyUsed) + return Promise.reject(new TypeError("Already read")); + e4.bodyUsed = true; + } + function m2(e4) { + return new Promise(function(t4, n3) { + e4.onload = function() { + t4(e4.result); + }, e4.onerror = function() { + n3(e4.error); + }; + }); + } + function g2(e4) { + var t4 = new FileReader(), n3 = m2(t4); + return t4.readAsArrayBuffer(e4), n3; + } + function v2(e4) { + if (e4.slice) + return e4.slice(0); + var t4 = new Uint8Array(e4.byteLength); + return t4.set(new Uint8Array(e4)), t4.buffer; + } + function b2() { + return this.bodyUsed = false, this._initBody = function(e4) { + var t4; + this.bodyUsed = this.bodyUsed, this._bodyInit = e4, e4 ? "string" == typeof e4 ? this._bodyText = e4 : o3 && Blob.prototype.isPrototypeOf(e4) ? this._bodyBlob = e4 : a2 && FormData.prototype.isPrototypeOf(e4) ? this._bodyFormData = e4 : r3 && URLSearchParams.prototype.isPrototypeOf(e4) ? this._bodyText = e4.toString() : s2 && o3 && ((t4 = e4) && DataView.prototype.isPrototypeOf(t4)) ? (this._bodyArrayBuffer = v2(e4.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : s2 && (ArrayBuffer.prototype.isPrototypeOf(e4) || l2(e4)) ? this._bodyArrayBuffer = v2(e4) : this._bodyText = e4 = Object.prototype.toString.call(e4) : this._bodyText = "", this.headers.get("content-type") || ("string" == typeof e4 ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : r3 && URLSearchParams.prototype.isPrototypeOf(e4) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8")); + }, o3 && (this.blob = function() { + var e4 = p2(this); + if (e4) + return e4; + if (this._bodyBlob) + return Promise.resolve(this._bodyBlob); + if (this._bodyArrayBuffer) + return Promise.resolve(new Blob([this._bodyArrayBuffer])); + if (this._bodyFormData) + throw new Error("could not read FormData body as blob"); + return Promise.resolve(new Blob([this._bodyText])); + }, this.arrayBuffer = function() { + if (this._bodyArrayBuffer) { + var e4 = p2(this); + return e4 || (ArrayBuffer.isView(this._bodyArrayBuffer) ? Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset, this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength)) : Promise.resolve(this._bodyArrayBuffer)); + } + return this.blob().then(g2); + }), this.text = function() { + var e4, t4, n3, r4 = p2(this); + if (r4) + return r4; + if (this._bodyBlob) + return e4 = this._bodyBlob, t4 = new FileReader(), n3 = m2(t4), t4.readAsText(e4), n3; + if (this._bodyArrayBuffer) + return Promise.resolve(function(e5) { + for (var t5 = new Uint8Array(e5), n4 = new Array(t5.length), r5 = 0; r5 < t5.length; r5++) + n4[r5] = String.fromCharCode(t5[r5]); + return n4.join(""); + }(this._bodyArrayBuffer)); + if (this._bodyFormData) + throw new Error("could not read FormData body as text"); + return Promise.resolve(this._bodyText); + }, a2 && (this.formData = function() { + return this.text().then(_2); + }), this.json = function() { + return this.text().then(JSON.parse); + }, this; + } + h2.prototype.append = function(e4, t4) { + e4 = c2(e4), t4 = d2(t4); + var n3 = this.map[e4]; + this.map[e4] = n3 ? n3 + ", " + t4 : t4; + }, h2.prototype.delete = function(e4) { + delete this.map[c2(e4)]; + }, h2.prototype.get = function(e4) { + return e4 = c2(e4), this.has(e4) ? this.map[e4] : null; + }, h2.prototype.has = function(e4) { + return this.map.hasOwnProperty(c2(e4)); + }, h2.prototype.set = function(e4, t4) { + this.map[c2(e4)] = d2(t4); + }, h2.prototype.forEach = function(e4, t4) { + for (var n3 in this.map) + this.map.hasOwnProperty(n3) && e4.call(t4, this.map[n3], n3, this); + }, h2.prototype.keys = function() { + var e4 = []; + return this.forEach(function(t4, n3) { + e4.push(n3); + }), f2(e4); + }, h2.prototype.values = function() { + var e4 = []; + return this.forEach(function(t4) { + e4.push(t4); + }), f2(e4); + }, h2.prototype.entries = function() { + var e4 = []; + return this.forEach(function(t4, n3) { + e4.push([n3, t4]); + }), f2(e4); + }, i3 && (h2.prototype[Symbol.iterator] = h2.prototype.entries); + var y2 = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"]; + function w2(e4, t4) { + if (!(this instanceof w2)) + throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.'); + var n3 = (t4 = t4 || {}).body; + if (e4 instanceof w2) { + if (e4.bodyUsed) + throw new TypeError("Already read"); + this.url = e4.url, this.credentials = e4.credentials, t4.headers || (this.headers = new h2(e4.headers)), this.method = e4.method, this.mode = e4.mode, this.signal = e4.signal, n3 || null == e4._bodyInit || (n3 = e4._bodyInit, e4.bodyUsed = true); + } else + this.url = String(e4); + if (this.credentials = t4.credentials || this.credentials || "same-origin", !t4.headers && this.headers || (this.headers = new h2(t4.headers)), this.method = function(e5) { + var t5 = e5.toUpperCase(); + return y2.indexOf(t5) > -1 ? t5 : e5; + }(t4.method || this.method || "GET"), this.mode = t4.mode || this.mode || null, this.signal = t4.signal || this.signal, this.referrer = null, ("GET" === this.method || "HEAD" === this.method) && n3) + throw new TypeError("Body not allowed for GET or HEAD requests"); + if (this._initBody(n3), !("GET" !== this.method && "HEAD" !== this.method || "no-store" !== t4.cache && "no-cache" !== t4.cache)) { + var r4 = /([?&])_=[^&]*/; + if (r4.test(this.url)) + this.url = this.url.replace(r4, "$1_=" + (/* @__PURE__ */ new Date()).getTime()); + else { + this.url += (/\?/.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime(); + } + } + } + function _2(e4) { + var t4 = new FormData(); + return e4.trim().split("&").forEach(function(e5) { + if (e5) { + var n3 = e5.split("="), r4 = n3.shift().replace(/\+/g, " "), i4 = n3.join("=").replace(/\+/g, " "); + t4.append(decodeURIComponent(r4), decodeURIComponent(i4)); + } + }), t4; + } + function S2(e4, t4) { + if (!(this instanceof S2)) + throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.'); + t4 || (t4 = {}), this.type = "default", this.status = void 0 === t4.status ? 200 : t4.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = void 0 === t4.statusText ? "" : "" + t4.statusText, this.headers = new h2(t4.headers), this.url = t4.url || "", this._initBody(e4); + } + w2.prototype.clone = function() { + return new w2(this, { body: this._bodyInit }); + }, b2.call(w2.prototype), b2.call(S2.prototype), S2.prototype.clone = function() { + return new S2(this._bodyInit, { status: this.status, statusText: this.statusText, headers: new h2(this.headers), url: this.url }); + }, S2.error = function() { + var e4 = new S2(null, { status: 0, statusText: "" }); + return e4.type = "error", e4; + }; + var E2 = [301, 302, 303, 307, 308]; + S2.redirect = function(e4, t4) { + if (-1 === E2.indexOf(t4)) + throw new RangeError("Invalid status code"); + return new S2(null, { status: t4, headers: { location: e4 } }); + }, t3.DOMException = n2.DOMException; + try { + new t3.DOMException(); + } catch (e4) { + t3.DOMException = function(e5, t4) { + this.message = e5, this.name = t4; + var n3 = Error(e5); + this.stack = n3.stack; + }, t3.DOMException.prototype = Object.create(Error.prototype), t3.DOMException.prototype.constructor = t3.DOMException; + } + function k2(e4, r4) { + return new Promise(function(i4, a3) { + var u3 = new w2(e4, r4); + if (u3.signal && u3.signal.aborted) + return a3(new t3.DOMException("Aborted", "AbortError")); + var l3 = new XMLHttpRequest(); + function c3() { + l3.abort(); + } + l3.onload = function() { + var e5, t4, n3 = { status: l3.status, statusText: l3.statusText, headers: (e5 = l3.getAllResponseHeaders() || "", t4 = new h2(), e5.replace(/\r?\n[\t ]+/g, " ").split("\r").map(function(e6) { + return 0 === e6.indexOf("\n") ? e6.substr(1, e6.length) : e6; + }).forEach(function(e6) { + var n4 = e6.split(":"), r6 = n4.shift().trim(); + if (r6) { + var i5 = n4.join(":").trim(); + t4.append(r6, i5); + } + }), t4) }; + n3.url = "responseURL" in l3 ? l3.responseURL : n3.headers.get("X-Request-URL"); + var r5 = "response" in l3 ? l3.response : l3.responseText; + setTimeout(function() { + i4(new S2(r5, n3)); + }, 0); + }, l3.onerror = function() { + setTimeout(function() { + a3(new TypeError("Network request failed")); + }, 0); + }, l3.ontimeout = function() { + setTimeout(function() { + a3(new TypeError("Network request failed")); + }, 0); + }, l3.onabort = function() { + setTimeout(function() { + a3(new t3.DOMException("Aborted", "AbortError")); + }, 0); + }, l3.open(u3.method, function(e5) { + try { + return "" === e5 && n2.location.href ? n2.location.href : e5; + } catch (t4) { + return e5; + } + }(u3.url), true), "include" === u3.credentials ? l3.withCredentials = true : "omit" === u3.credentials && (l3.withCredentials = false), "responseType" in l3 && (o3 ? l3.responseType = "blob" : s2 && u3.headers.get("Content-Type") && -1 !== u3.headers.get("Content-Type").indexOf("application/octet-stream") && (l3.responseType = "arraybuffer")), !r4 || "object" != typeof r4.headers || r4.headers instanceof h2 ? u3.headers.forEach(function(e5, t4) { + l3.setRequestHeader(t4, e5); + }) : Object.getOwnPropertyNames(r4.headers).forEach(function(e5) { + l3.setRequestHeader(e5, d2(r4.headers[e5])); + }), u3.signal && (u3.signal.addEventListener("abort", c3), l3.onreadystatechange = function() { + 4 === l3.readyState && u3.signal.removeEventListener("abort", c3); + }), l3.send(void 0 === u3._bodyInit ? null : u3._bodyInit); + }); + } + k2.polyfill = true, n2.fetch || (n2.fetch = k2, n2.Headers = h2, n2.Request = w2, n2.Response = S2), t3.Headers = h2, t3.Request = w2, t3.Response = S2, t3.fetch = k2; + }({}); + }(i2), i2.fetch.ponyfill = true, delete i2.fetch.polyfill; + var o2 = r2.fetch ? r2 : i2; + (t2 = o2.fetch).default = o2.fetch, t2.fetch = o2.fetch, t2.Headers = o2.Headers, t2.Request = o2.Request, t2.Response = o2.Response, e2.exports = t2; + }(OR, OR.exports); + var NR = r(OR.exports); + let DR = 1; + const jR = (e2) => new Promise((t2) => { + setTimeout(() => { + t2(true); + }, e2); + }), BR = ({ checkInstallationOnAllCalls: t2 = false, communicationLayerPreference: n2, injectProvider: r2, shouldShimWeb3: i2, platformManager: o2, installer: a2, sdk: s2, remoteConnection: u2, debug: l2 }) => kk(void 0, void 0, void 0, function* () { + var c2, d2; + const f2 = (({ name: e2, remoteConnection: t3 }) => { + if (!t3 || !(null == t3 ? void 0 : t3.getConnector())) + throw new Error("Missing remote connection parameter"); + return new IR({ name: e2, remote: null == t3 ? void 0 : t3.getConnector(), deeplinkProtocol: null == t3 ? void 0 : t3.state.deeplinkProtocol, platformManager: null == t3 ? void 0 : t3.getPlatformManager() }); + })({ name: qA.INPAGE, target: qA.CONTENT_SCRIPT, platformManager: o2, communicationLayerPreference: n2, remoteConnection: u2 }), h2 = o2.getPlatformType(), p2 = s2.options.dappMetadata, m2 = `Sdk/Javascript SdkVersion/${HA.version} Platform/${h2} dApp/${null !== (c2 = p2.url) && void 0 !== c2 ? c2 : p2.name} dAppTitle/${p2.name}`; + let g2 = null, v2 = null; + const b2 = null === (d2 = s2.options.storage) || void 0 === d2 ? void 0 : d2.storageManager; + if (b2) { + try { + const e2 = yield b2.getCachedAccounts(); + e2.length > 0 && (g2 = e2[0]); + } catch (e2) { + console.error(`[initializeMobileProvider] failed to get cached addresses: ${e2}`); + } + try { + const e2 = yield b2.getCachedChainId(); + e2 && (v2 = e2); + } catch (e2) { + console.error(`[initializeMobileProvider] failed to parse cached chainId: ${e2}`); + } + } + xx(`[initializeMobileProvider] cachedAccountAddress: ${g2}, cachedChainId: ${v2}`); + const y2 = !(!r2 || h2 === e.PlatformType.NonBrowser || h2 === e.PlatformType.ReactNative), w2 = PR.init({ shouldSetOnWindow: y2, connectionStream: f2, shouldShimWeb3: i2, sdkInstance: s2 }); + let _2 = false; + const S2 = (e2) => { + console.log(`[initializeMobileProvider] setInitializing: ${e2}`), _2 = e2; + }, E2 = () => _2, k2 = (n3, r3, i3, l3) => kk(void 0, void 0, void 0, function* () { + var c3, d3, f3, h3, p3, y3, w3, k3, M3; + const C3 = PR.getProvider(); + if (_2) { + C3.emit("display_uri", (null == u2 ? void 0 : u2.state.qrcodeLink) || ""), null == u2 || u2.showActiveModal(); + let e2 = E2(); + for (; e2; ) { + const t3 = E2(), n4 = null == u2 ? void 0 : u2.isAuthorized(); + e2 = t3 && !n4, xx(`[initializeMobileProvider: sendRequest()] waiting for initialization to complete - initializing: ${t3} authorized: ${n4}`), yield jR(1e3); + } + return xx("[initializeMobileProvider: sendRequest()] initial method completed -- prevent installation and call provider"), i3(...r3); + } + const x2 = o2.isMetaMaskInstalled(), A2 = null == u2 ? void 0 : u2.isConnected(); + let R2 = null, T2 = null, P2 = null; + if (R2 = null !== (c3 = C3.getSelectedAddress()) && void 0 !== c3 ? c3 : g2, P2 = C3.getChainId() || v2, R2 && b2 && R2 !== g2 && b2.persistAccounts([R2]).catch((e2) => { + console.error(`[initializeMobileProvider] failed to persist account: ${e2}`); + }), P2 && (v2 = P2, b2 && b2.persistChainId(P2).catch((e2) => { + console.error(`[initializeMobileProvider] failed to persist chainId: ${e2}`); + })), xx("[initializeMobileProvider: sendRequest()]", { selectedAddress: R2, chainId: P2 }), l3 && xx(`[initializeMobileProvider: sendRequest()] method=${n3} ongoing=${_2} selectedAddress=${R2} isInstalled=${x2} checkInstallationOnAllCalls=${t2} socketConnected=${A2}`), R2 && n3.toLowerCase() === Kx.ETH_ACCOUNTS.toLowerCase()) + return [R2]; + if (P2 && n3.toLowerCase() === Kx.ETH_CHAINID.toLowerCase()) + return P2; + const L2 = [Kx.ETH_REQUESTACCOUNTS, Kx.WALLET_REQUESTPERMISSIONS, Kx.METAMASK_CONNECTSIGN, Kx.METAMASK_CONNECTWITH], I2 = !qx[n3], O2 = null === (d3 = s2.options.readonlyRPCMap) || void 0 === d3 ? void 0 : d3[P2]; + if (O2 && I2) + try { + const e2 = null === (f3 = null == r3 ? void 0 : r3[0]) || void 0 === f3 ? void 0 : f3.params, t3 = yield (({ rpcEndpoint: e3, method: t4, sdkInfo: n4, params: r4 }) => kk(void 0, void 0, void 0, function* () { + const i4 = JSON.stringify({ jsonrpc: "2.0", method: t4, params: r4, id: (DR += 1, DR) }), o3 = { Accept: "application/json", "Content-Type": "application/json" }; + let a3; + e3.includes("infura") && (o3["Metamask-Sdk-Info"] = n4); + try { + a3 = yield NR(e3, { method: "POST", headers: o3, body: i4 }); + } catch (e4) { + throw e4 instanceof Error ? new Error(`Failed to fetch from RPC: ${e4.message}`) : new Error(`Failed to fetch from RPC: ${e4}`); + } + if (!a3.ok) + throw new Error(`Server responded with a status of ${a3.status}`); + return (yield a3.json()).result; + }))({ rpcEndpoint: O2, sdkInfo: m2, method: n3, params: e2 || [] }); + return l3 && xx(`initializeProvider::ReadOnlyRPCResponse ${t3}`), t3; + } catch (e2) { + console.warn(`[initializeMobileProvider: sendRequest()] method=${n3} readOnlyRPCRequest failed:`, e2); + } + if ((!x2 || x2 && !A2) && n3 !== Kx.METAMASK_GETPROVIDERSTATE) { + const l4 = (null === (h3 = null == r3 ? void 0 : r3[0]) || void 0 === h3 ? void 0 : h3.params) || []; + if (-1 !== L2.indexOf(n3) || t2) { + S2(true); + const t3 = n3 === Kx.METAMASK_CONNECTWITH, o3 = `${Date.now()}`; + try { + yield a2.start({ wait: false, connectWith: t3 ? { method: n3, id: o3, params: l4 } : void 0 }), yield new Promise((t4, n4) => { + (null == u2 ? void 0 : u2.isAuthorized()) && (xx("[initializeMobileProvider: sendRequest()] already authorized"), t4(true)), null == u2 || u2.getConnector().once(e.EventType.AUTHORIZED, () => { + t4(true); + }), s2.once(e.EventType.PROVIDER_UPDATE, (t5) => { + xx(`[initializeMobileProvider: sendRequest()] PROVIDER_UPDATE --- remote provider request interupted type=${t5}`), t5 === e.PROVIDER_UPDATE_TYPE.EXTENSION ? n4(e.EventType.PROVIDER_UPDATE) : n4(new Error("Connection Terminated")); + }); + }); + } catch (t4) { + if (e.PROVIDER_UPDATE_TYPE.EXTENSION === t4) { + if (xx(`[initializeMobileProvider: sendRequest()] extension provider detect: re-create ${n3} on the active provider`), n3.toLowerCase() === Kx.METAMASK_CONNECTSIGN.toLowerCase()) { + const e2 = yield null === (p3 = s2.getProvider()) || void 0 === p3 ? void 0 : p3.request({ method: Kx.ETH_REQUESTACCOUNTS, params: [] }); + if (!e2.length) + throw new Error("SDK state invalid -- undefined accounts"); + const t5 = yield null === (y3 = s2.getProvider()) || void 0 === y3 ? void 0 : y3.request({ method: Kx.PERSONAL_SIGN, params: [l4[0], e2[0]] }); + return s2.emit(ZA.ConnectWithResponse, t5), t5; + } + if (n3.toLowerCase() === Kx.METAMASK_CONNECTWITH.toLowerCase()) { + const [e2] = l4, t5 = yield (({ method: e3, sdk: t6, params: n4 }) => kk(void 0, void 0, void 0, function* () { + var r4, i4, o4, a3; + if (!t6.isExtensionActive()) + throw new Error("SDK state invalid -- extension is not active"); + xx("[MetaMaskProvider: extensionConnectWithOverwrite()] Overwriting request method", e3, n4); + const s3 = yield null === (r4 = t6.getProvider()) || void 0 === r4 ? void 0 : r4.request({ method: Kx.ETH_REQUESTACCOUNTS, params: [] }); + if (!s3.length) + throw new Error("SDK state invalid -- undefined accounts"); + if ((null == e3 ? void 0 : e3.toLowerCase()) === Kx.PERSONAL_SIGN.toLowerCase()) { + const r5 = { method: e3, params: [n4[0], s3[0]] }; + return yield null === (i4 = t6.getProvider()) || void 0 === i4 ? void 0 : i4.request(r5); + } + if ((null == e3 ? void 0 : e3.toLowerCase()) === Kx.ETH_SENDTRANSACTION.toLowerCase()) { + const r5 = { method: e3, params: [Object.assign(Object.assign({}, n4[0]), { from: s3[0] })] }; + return yield null === (o4 = t6.getProvider()) || void 0 === o4 ? void 0 : o4.request(r5); + } + return Wx.includes(e3.toLowerCase()) ? (console.warn(`MetaMaskSDK connectWith method=${e3} -- not handled by the extension -- call separately`), s3) : yield null === (a3 = t6.getProvider()) || void 0 === a3 ? void 0 : a3.request({ method: e3, params: n4 }); + }))({ method: e2.method, sdk: s2, params: e2.params }); + return s2.emit(ZA.ConnectWithResponse, t5), t5; + } + return xx(`[initializeMobileProvider: sendRequest()] sending '${n3}' on active provider`, l4), yield null === (w3 = s2.getProvider()) || void 0 === w3 ? void 0 : w3.request({ method: n3, params: l4 }); + } + if (t4 === e.EventType.REJECTED) + throw null == u2 || u2.closeModal(), null === (k3 = s2.getProvider()) || void 0 === k3 || k3.handleDisconnect({ terminate: false }), Object.assign(new Error("User rejected connection"), { code: 4001 }); + throw xx(`[initializeMobileProvider: sendRequest()] failed to start installer: ${t4}`), t4; + } finally { + S2(false); + } + if (n3 === Kx.ETH_REQUESTACCOUNTS) + return T2 = yield new Promise((e2) => { + const t4 = setInterval(() => { + const { accounts: n4 } = C3.getState(); + n4 && (clearInterval(t4), e2(n4)); + }, 100); + }), xx(`[initializeMobileProvider: sendRequest()] selectedAddress: ${R2} --- SKIP rpc call`), T2; + if (n3 === Kx.METAMASK_CONNECTWITH) + try { + let t4 = 0; + const n4 = 5, r4 = ({ resolve: e2, reject: r5 }) => { + t4 += 1; + const i5 = null == u2 ? void 0 : u2.getConnector().getRPCMethodTracker(), a4 = null == i5 ? void 0 : i5[o3]; + return xx(`TRACKER: update method ${o3}`, a4), (null == a4 ? void 0 : a4.result) ? (xx("[initializeMobileProvider: sendRequest()] found result", a4.result), s2.emit(ZA.ConnectWithResponse, a4.result), void e2(a4.result)) : (null == a4 ? void 0 : a4.error) ? (xx("[initializeMobileProvider: sendRequest()] found error", a4.error), void r5(a4.error)) : t4 >= n4 ? (xx("[initializeMobileProvider: sendRequest()] max message count reached without result"), void r5(new Error("Max message count reached without result"))) : void xx("[initializeMobileProvider: sendRequest()] not found yet, need to wait for next update"); + }; + let i4, a3; + const l5 = yield new Promise((t5, n5) => { + const s3 = null == u2 ? void 0 : u2.getConnector().getRPCMethodTracker(); + xx(`TRACKER: method ${o3}`, s3), (null == s3 ? void 0 : s3[o3].result) ? (xx("[initializeMobileProvider: sendRequest()] found result", null == s3 ? void 0 : s3[o3].result), t5(null == s3 ? void 0 : s3[o3].result)) : (null == s3 ? void 0 : s3[o3].error) && (xx("[initializeMobileProvider: sendRequest()] found error", null == s3 ? void 0 : s3[o3].error), n5(null == s3 ? void 0 : s3[o3].error)), a3 = () => r4({ resolve: t5, reject: n5 }), i4 = null == u2 ? void 0 : u2.getConnector().on(e.EventType.RPC_UPDATE, a3); + }); + return a3 && (null == i4 || i4.off(e.EventType.RPC_UPDATE, a3)), xx("TRACKER: result", l5), l5; + } catch (e2) { + throw xx("[initializeMobileProvider: sendRequest()] error:", e2), e2; + } + r3[0] && "object" == typeof r3[0] && (r3[0].params = { __triggeredInstaller: true, wrappedParams: r3[0].params }); + return i3(...r3); + } + if (o2.isSecure() && qx[n3]) + return i3(...r3); + if (s2.isExtensionActive()) + return xx(`[initializeMobileProvider: sendRequest()] EXTENSION active - redirect request '${n3}' to it`, r3, l4), yield null === (M3 = s2.getProvider()) || void 0 === M3 ? void 0 : M3.request({ method: n3, params: l4 }); + throw xx(`[initializeMobileProvider: sendRequest()] method=${n3} --- skip --- not connected/installed`), new Error("MetaMask is not connected/installed, please call eth_requestAccounts to connect first."); + } + try { + const e2 = yield i3(...r3); + if (xx(`[initializeMobileProvider: sendRequest()] method=${n3} rpcResponse`, e2), n3 === Kx.WALLET_REQUESTPERMISSIONS) { + const t3 = e2.reduce((e3, t4) => { + var n4; + if ("eth_accounts" === t4.parentCapability) { + const r4 = null === (n4 = t4.caveats.find((e4) => "restrictReturnedAccounts" === e4.type)) || void 0 === n4 ? void 0 : n4.value; + r4 && e3.push(...r4); + } + return e3; + }, []); + xx("[initializeMobileProvider: sendRequest()] accountsToPersist:", t3), t3.length > 0 && (C3.handleAccountsChanged(t3, false), null == b2 || b2.persistAccounts(t3)); + } + return e2; + } catch (e2) { + throw console.error("[initializeMobileProvider: sendRequest()] error:", e2), e2; + } + }), { request: M2 } = w2; + w2.request = (...e2) => kk(void 0, void 0, void 0, function* () { + return k2(null == e2 ? void 0 : e2[0].method, e2, M2, l2); + }); + const { send: C2 } = w2; + return w2.send = (...e2) => kk(void 0, void 0, void 0, function* () { + return k2(null == e2 ? void 0 : e2[0], e2, C2, l2); + }), xx("[initializeMobileProvider: sendRequest()] metamaskStream.start()"), f2.start(), w2; + }); + function zR(t2) { + var n2, r2, i2, o2; + return kk(this, void 0, void 0, function* () { + const { options: a2 } = t2, s2 = { communicationLayerPreference: null !== (n2 = a2.communicationLayerPreference) && void 0 !== n2 ? n2 : e.CommunicationLayerPreference.SOCKET, platformManager: t2.platformManager, sdk: t2, checkInstallationOnAllCalls: a2.checkInstallationOnAllCalls, injectProvider: null === (r2 = a2.injectProvider) || void 0 === r2 || r2, shouldShimWeb3: null === (i2 = a2.shouldShimWeb3) || void 0 === i2 || i2, extensionOnly: null === (o2 = a2.extensionOnly) || void 0 === o2 || o2, installer: t2.installer, remoteConnection: t2.remoteConnection, debug: t2.debug }, u2 = yield BR(s2); + t2.activeProvider = u2, function(e2) { + var t3, n3, r3, i3; + null === (n3 = null === (t3 = e2.remoteConnection) || void 0 === t3 ? void 0 : t3.getConnector()) || void 0 === n3 || n3.on(ZA.ConnectionStatus, (t4) => { + e2.emit(ZA.ConnectionStatus, t4); + }), null === (i3 = null === (r3 = e2.remoteConnection) || void 0 === r3 ? void 0 : r3.getConnector()) || void 0 === i3 || i3.on(ZA.ServiceStatus, (t4) => { + e2.emit(ZA.ServiceStatus, t4); + }); + }(t2); + }); + } + var UR, FR, KR; + const qR = "sdk"; + class HR { + constructor({ serverUrl: e2, enabled: t2, originatorInfo: n2 }) { + UR.set(this, KE), FR.set(this, void 0), KR.set(this, void 0), Ck(this, UR, e2, "f"), Ck(this, KR, n2, "f"), Ck(this, FR, null == t2 || t2, "f"); + } + send({ event: e2, params: t2 }) { + if (!Mk(this, FR, "f")) + return; + const n2 = Object.assign(Object.assign({ id: qR, event: e2, sdkVersion: HA.version }, Mk(this, KR, "f")), { params: t2 }); + xx(`[Analytics: send()] event: ${e2}`, n2), KS(n2, Mk(this, UR, "f")).catch((e3) => { + xx(`[Analytics: send()] error: ${e3}`); + }); + } + } + UR = /* @__PURE__ */ new WeakMap(), FR = /* @__PURE__ */ new WeakMap(), KR = /* @__PURE__ */ new WeakMap(); + const WR = () => { + if ("undefined" == typeof document) + return; + let e2; + const t2 = document.getElementsByTagName("link"); + for (let n2 = 0; n2 < t2.length; n2++) + "icon" !== t2[n2].getAttribute("rel") && "shortcut icon" !== t2[n2].getAttribute("rel") || (e2 = t2[n2].getAttribute("href")); + return e2; + }, $R = 163400; + var VR, YR = new Uint8Array(16); + function GR() { + if (!VR && !(VR = "undefined" != typeof crypto && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || "undefined" != typeof msCrypto && "function" == typeof msCrypto.getRandomValues && msCrypto.getRandomValues.bind(msCrypto))) + throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); + return VR(YR); + } + var ZR = /^(?:[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; + for (var QR = [], JR = 0; JR < 256; ++JR) + QR.push((JR + 256).toString(16).substr(1)); + function XR(e2) { + var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n2 = (QR[e2[t2 + 0]] + QR[e2[t2 + 1]] + QR[e2[t2 + 2]] + QR[e2[t2 + 3]] + "-" + QR[e2[t2 + 4]] + QR[e2[t2 + 5]] + "-" + QR[e2[t2 + 6]] + QR[e2[t2 + 7]] + "-" + QR[e2[t2 + 8]] + QR[e2[t2 + 9]] + "-" + QR[e2[t2 + 10]] + QR[e2[t2 + 11]] + QR[e2[t2 + 12]] + QR[e2[t2 + 13]] + QR[e2[t2 + 14]] + QR[e2[t2 + 15]]).toLowerCase(); + if (!function(e3) { + return "string" == typeof e3 && ZR.test(e3); + }(n2)) + throw TypeError("Stringified UUID is invalid"); + return n2; + } + function eT(e2, t2, n2) { + var r2 = (e2 = e2 || {}).random || (e2.rng || GR)(); + if (r2[6] = 15 & r2[6] | 64, r2[8] = 63 & r2[8] | 128, t2) { + n2 = n2 || 0; + for (var i2 = 0; i2 < 16; ++i2) + t2[n2 + i2] = r2[i2]; + return t2; + } + return XR(r2); + } + function tT(t2) { + var n2, r2, i2; + const { dappMetadata: o2 } = t2, a2 = function({ url: e2, name: t3 }) { + var n3; + const r3 = e2 + t3, i3 = TR(r3); + if (!localStorage) + return ""; + let o3 = null !== (n3 = localStorage.getItem(i3)) && void 0 !== n3 ? n3 : ""; + if (!o3) { + o3 = eT(); + try { + localStorage.setItem(i3, o3); + } catch (e3) { + return ""; + } + } + return o3; + }({ url: null !== (n2 = null == o2 ? void 0 : o2.url) && void 0 !== n2 ? n2 : "no_url", name: null !== (r2 = null == o2 ? void 0 : o2.name) && void 0 !== r2 ? r2 : "no_name" }), s2 = null === (i2 = t2.platformManager) || void 0 === i2 ? void 0 : i2.getPlatformType(), u2 = s2 === e.PlatformType.DesktopWeb, l2 = s2 === e.PlatformType.MetaMaskMobileWebview; + let c2 = "N/A"; + return u2 ? c2 = "extension" : l2 && (c2 = "mobile"), { id: a2, from: c2 }; + } + const nT = ({ provider: e2, sdkInstance: t2 }) => { + if ("state" in e2) + throw new Error("INVALID EXTENSION PROVIDER"); + return new Proxy(e2, { get: (n2, r2) => "request" === r2 ? function(e3) { + var r3, i2; + return kk(this, void 0, void 0, function* () { + xx("[wrapExtensionProvider()] Overwriting request method", e3); + const { method: o2, params: a2 } = e3, s2 = Hx.includes(o2.toLowerCase()), { id: u2, from: l2 } = tT(t2); + if (s2 && (null === (r3 = t2.analytics) || void 0 === r3 || r3.send({ event: ZE.SDK_RPC_REQUEST, params: { method: o2, from: l2, id: u2 } })), o2 === Kx.METAMASK_BATCH && Array.isArray(a2)) + return (({ target: e4, args: t3, trackEvent: n3, sdkInstance: r4 }) => kk(void 0, void 0, void 0, function* () { + var i3, o3; + if ("metamask_batch" !== t3.method) + throw new Error("Invalid usage"); + const a3 = [], s3 = null !== (i3 = null == t3 ? void 0 : t3.params) && void 0 !== i3 ? i3 : []; + for (const t4 of s3) { + const n4 = yield null == e4 ? void 0 : e4.request({ method: t4.method, params: t4.params }); + a3.push(n4); + } + const { id: u3, from: l3 } = tT(r4); + return n3 && (null === (o3 = r4.analytics) || void 0 === o3 || o3.send({ event: ZE.SDK_RPC_REQUEST_DONE, params: { method: t3.method, from: l3, id: u3 } })), a3; + }))({ target: n2, args: e3, trackEvent: s2, sdkInstance: t2 }); + if (o2.toLowerCase() === Kx.METAMASK_CONNECTSIGN.toLowerCase() && Array.isArray(a2)) + return (({ target: e4, params: t3 }) => kk(void 0, void 0, void 0, function* () { + const n3 = yield e4.request({ method: Kx.ETH_REQUESTACCOUNTS, params: [] }); + if (!n3.length) + throw new Error("SDK state invalid -- undefined accounts"); + return yield e4.request({ method: Kx.PERSONAL_SIGN, params: [t3[0], n3[0]] }); + }))({ target: n2, params: a2 }); + if (o2.toLowerCase() === Kx.METAMASK_CONNECTWITH.toLowerCase() && Array.isArray(a2)) + return (({ target: e4, params: t3 }) => kk(void 0, void 0, void 0, function* () { + const [n3] = t3, r4 = n3.method, i3 = n3.params, o3 = yield e4.request({ method: Kx.ETH_REQUESTACCOUNTS, params: [] }); + if (!o3.length) + throw new Error("SDK state invalid -- undefined accounts"); + return (null == r4 ? void 0 : r4.toLowerCase()) === Kx.PERSONAL_SIGN.toLowerCase() ? yield e4.request({ method: r4, params: [i3[0], o3[0]] }) : (null == r4 ? void 0 : r4.toLowerCase()) === Kx.ETH_SENDTRANSACTION.toLowerCase() ? yield e4.request({ method: r4, params: [Object.assign(Object.assign({}, i3[0]), { from: o3[0] })] }) : Wx.includes(r4.toLowerCase()) ? (console.warn(`MetaMaskSDK connectWith method=${r4} -- not handled by the extension -- call separately`), o3) : yield e4.request({ method: r4, params: i3 }); + }))({ target: n2, params: a2 }); + let c2; + try { + return c2 = yield n2.request(e3), c2; + } finally { + s2 && (null === (i2 = t2.analytics) || void 0 === i2 || i2.send({ event: ZE.SDK_RPC_REQUEST_DONE, params: { method: o2, from: l2, id: u2 } })); + } + }); + } : "getChainId" === r2 ? function() { + return e2.chainId; + } : "getNetworkVersion" === r2 ? function() { + return e2.networkVersion; + } : "getSelectedAddress" === r2 ? function() { + return e2.selectedAddress; + } : "isConnected" === r2 ? function() { + return e2._state.isConnected; + } : n2[r2] }); + }; + var rT; + function iT({ mustBeMetaMask: e2, sdkInstance: t2 }) { + return kk(this, void 0, void 0, function* () { + if ("undefined" == typeof window) + throw new Error("window not available"); + let n2; + try { + return n2 = yield new Promise((e3, t3) => { + const n3 = setTimeout(() => { + t3(new Error("eip6963RequestProvider timed out")); + }, 500); + window.addEventListener(rT.Announce, (t4) => { + const r2 = t4, { detail: { info: i2, provider: o2 } = {} } = r2, { name: a2, rdns: s2, uuid: u2 } = null != i2 ? i2 : {}; + GA.test(u2) && a2.startsWith(YA.NAME) && s2 === YA.RDNS && (clearTimeout(n3), e3(o2)); + }), window.dispatchEvent(new Event(rT.Request)); + }), nT({ provider: n2, sdkInstance: t2 }); + } catch (n3) { + const { ethereum: r2 } = window; + if (!r2) + throw new Error("Ethereum not found in window object"); + if ("providers" in r2) { + if (Array.isArray(r2.providers)) { + const n4 = e2 ? r2.providers.find((e3) => oT(e3)) : r2.providers[0]; + if (!n4) + throw new Error("No suitable provider found"); + return nT({ provider: n4, sdkInstance: t2 }); + } + } else if (e2 && !oT(r2)) + throw new Error("MetaMask provider not found in Ethereum"); + return nT({ provider: r2, sdkInstance: t2 }); + } + }); + } + function oT(e2) { + if (!e2.isMetaMask) + return false; + if (e2.isBraveWallet && !e2._events && !e2._state) + return false; + const t2 = ["isApexWallet", "isAvalanche", "isBitKeep", "isBlockWallet", "isKuCoinWallet", "isMathWallet", "isOkxWallet", "isOKExWallet", "isOneInchIOSWallet", "isOneInchAndroidWallet", "isOpera", "isPortal", "isRabby", "isTokenPocket", "isTokenary", "isUniswapWallet", "isZerion"]; + for (const n2 of t2) + if (e2[n2]) + return false; + return true; + } + !function(e2) { + e2.Announce = "eip6963:announceProvider", e2.Request = "eip6963:requestProvider"; + }(rT || (rT = {})); + const aT = (e2) => kk(void 0, void 0, void 0, function* () { + const { options: t2 } = e2, { infuraAPIKey: n2 } = t2; + if (!n2) + return; + const r2 = { "0x1": `https://mainnet.infura.io/v3/${n2}`, "0x5": `https://goerli.infura.io/v3/${n2}`, "0x2a": `https://sepolia.infura.io/v3/${n2}`, "0xe708": `https://linea-mainnet.infura.io/v3/${n2}`, "0xe704": `https://linea-goerli.infura.io/v3/${n2}`, "0x89": `https://polygon-mainnet.infura.io/v3/${n2}`, "0x13881": `https://polygon-mumbai.infura.io/v3/${n2}`, "0x45": `https://optimism-mainnet.infura.io/v3/${n2}`, "0x1a4": `https://optimism-goerli.infura.io/v3/${n2}`, "0xa4b1": `https://arbitrum-mainnet.infura.io/v3/${n2}`, "0x66eed": `https://arbitrum-goerli.infura.io/v3/${n2}`, "0x2a15c308d": `https://palm-mainnet.infura.io/v3/${n2}`, "0x2a15c3083": `https://palm-testnet.infura.io/v3/${n2}`, "0xa86a": `https://avalanche-mainnet.infura.io/v3/${n2}`, "0xa869": `https://avalanche-fuji.infura.io/v3/${n2}`, "0x4e454152": `https://aurora-mainnet.infura.io/v3/${n2}`, "0x4e454153": `https://aurora-testnet.infura.io/v3/${n2}`, "0x534e5f4d41494e": `https://starknet-mainnet.infura.io/v3/${n2}`, "0x534e5f474f45524c49": `https://starknet-goerli.infura.io/v3/${n2}`, "0x534e5f474f45524c4932": `https://starknet-goerli2.infura.io/v3/${n2}`, "0xa4ec": `https://celo-mainnet.infura.io/v3/${n2}`, "0xaef3": `https://celo-alfajores.infura.io/v3/${n2}` }; + e2.options.readonlyRPCMap ? e2.options.readonlyRPCMap = Object.assign(Object.assign({}, e2.options.readonlyRPCMap), r2) : e2.options.readonlyRPCMap = r2; + }); + var sT = { exports: {} }; + !function(e2, t2) { + e2.exports = function(e3) { + var t3 = {}; + function n2(r2) { + if (t3[r2]) + return t3[r2].exports; + var i2 = t3[r2] = { i: r2, l: false, exports: {} }; + return e3[r2].call(i2.exports, i2, i2.exports, n2), i2.l = true, i2.exports; + } + return n2.m = e3, n2.c = t3, n2.d = function(e4, t4, r2) { + n2.o(e4, t4) || Object.defineProperty(e4, t4, { enumerable: true, get: r2 }); + }, n2.r = function(e4) { + "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e4, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e4, "__esModule", { value: true }); + }, n2.t = function(e4, t4) { + if (1 & t4 && (e4 = n2(e4)), 8 & t4) + return e4; + if (4 & t4 && "object" == typeof e4 && e4 && e4.__esModule) + return e4; + var r2 = /* @__PURE__ */ Object.create(null); + if (n2.r(r2), Object.defineProperty(r2, "default", { enumerable: true, value: e4 }), 2 & t4 && "string" != typeof e4) + for (var i2 in e4) + n2.d(r2, i2, (function(t5) { + return e4[t5]; + }).bind(null, i2)); + return r2; + }, n2.n = function(e4) { + var t4 = e4 && e4.__esModule ? function() { + return e4.default; + } : function() { + return e4; + }; + return n2.d(t4, "a", t4), t4; + }, n2.o = function(e4, t4) { + return Object.prototype.hasOwnProperty.call(e4, t4); + }, n2.p = "", n2(n2.s = 90); + }({ 17: function(e3, t3, n2) { + t3.__esModule = true, t3.default = void 0; + var r2 = n2(18), i2 = function() { + function e4() { + } + return e4.getFirstMatch = function(e5, t4) { + var n3 = t4.match(e5); + return n3 && n3.length > 0 && n3[1] || ""; + }, e4.getSecondMatch = function(e5, t4) { + var n3 = t4.match(e5); + return n3 && n3.length > 1 && n3[2] || ""; + }, e4.matchAndReturnConst = function(e5, t4, n3) { + if (e5.test(t4)) + return n3; + }, e4.getWindowsVersionName = function(e5) { + switch (e5) { + case "NT": + return "NT"; + case "XP": + case "NT 5.1": + return "XP"; + case "NT 5.0": + return "2000"; + case "NT 5.2": + return "2003"; + case "NT 6.0": + return "Vista"; + case "NT 6.1": + return "7"; + case "NT 6.2": + return "8"; + case "NT 6.3": + return "8.1"; + case "NT 10.0": + return "10"; + default: + return; + } + }, e4.getMacOSVersionName = function(e5) { + var t4 = e5.split(".").splice(0, 2).map(function(e6) { + return parseInt(e6, 10) || 0; + }); + if (t4.push(0), 10 === t4[0]) + switch (t4[1]) { + case 5: + return "Leopard"; + case 6: + return "Snow Leopard"; + case 7: + return "Lion"; + case 8: + return "Mountain Lion"; + case 9: + return "Mavericks"; + case 10: + return "Yosemite"; + case 11: + return "El Capitan"; + case 12: + return "Sierra"; + case 13: + return "High Sierra"; + case 14: + return "Mojave"; + case 15: + return "Catalina"; + default: + return; + } + }, e4.getAndroidVersionName = function(e5) { + var t4 = e5.split(".").splice(0, 2).map(function(e6) { + return parseInt(e6, 10) || 0; + }); + if (t4.push(0), !(1 === t4[0] && t4[1] < 5)) + return 1 === t4[0] && t4[1] < 6 ? "Cupcake" : 1 === t4[0] && t4[1] >= 6 ? "Donut" : 2 === t4[0] && t4[1] < 2 ? "Eclair" : 2 === t4[0] && 2 === t4[1] ? "Froyo" : 2 === t4[0] && t4[1] > 2 ? "Gingerbread" : 3 === t4[0] ? "Honeycomb" : 4 === t4[0] && t4[1] < 1 ? "Ice Cream Sandwich" : 4 === t4[0] && t4[1] < 4 ? "Jelly Bean" : 4 === t4[0] && t4[1] >= 4 ? "KitKat" : 5 === t4[0] ? "Lollipop" : 6 === t4[0] ? "Marshmallow" : 7 === t4[0] ? "Nougat" : 8 === t4[0] ? "Oreo" : 9 === t4[0] ? "Pie" : void 0; + }, e4.getVersionPrecision = function(e5) { + return e5.split(".").length; + }, e4.compareVersions = function(t4, n3, r3) { + void 0 === r3 && (r3 = false); + var i3 = e4.getVersionPrecision(t4), o2 = e4.getVersionPrecision(n3), a2 = Math.max(i3, o2), s2 = 0, u2 = e4.map([t4, n3], function(t5) { + var n4 = a2 - e4.getVersionPrecision(t5), r4 = t5 + new Array(n4 + 1).join(".0"); + return e4.map(r4.split("."), function(e5) { + return new Array(20 - e5.length).join("0") + e5; + }).reverse(); + }); + for (r3 && (s2 = a2 - Math.min(i3, o2)), a2 -= 1; a2 >= s2; ) { + if (u2[0][a2] > u2[1][a2]) + return 1; + if (u2[0][a2] === u2[1][a2]) { + if (a2 === s2) + return 0; + a2 -= 1; + } else if (u2[0][a2] < u2[1][a2]) + return -1; + } + }, e4.map = function(e5, t4) { + var n3, r3 = []; + if (Array.prototype.map) + return Array.prototype.map.call(e5, t4); + for (n3 = 0; n3 < e5.length; n3 += 1) + r3.push(t4(e5[n3])); + return r3; + }, e4.find = function(e5, t4) { + var n3, r3; + if (Array.prototype.find) + return Array.prototype.find.call(e5, t4); + for (n3 = 0, r3 = e5.length; n3 < r3; n3 += 1) { + var i3 = e5[n3]; + if (t4(i3, n3)) + return i3; + } + }, e4.assign = function(e5) { + for (var t4, n3, r3 = e5, i3 = arguments.length, o2 = new Array(i3 > 1 ? i3 - 1 : 0), a2 = 1; a2 < i3; a2++) + o2[a2 - 1] = arguments[a2]; + if (Object.assign) + return Object.assign.apply(Object, [e5].concat(o2)); + var s2 = function() { + var e6 = o2[t4]; + "object" == typeof e6 && null !== e6 && Object.keys(e6).forEach(function(t5) { + r3[t5] = e6[t5]; + }); + }; + for (t4 = 0, n3 = o2.length; t4 < n3; t4 += 1) + s2(); + return e5; + }, e4.getBrowserAlias = function(e5) { + return r2.BROWSER_ALIASES_MAP[e5]; + }, e4.getBrowserTypeByAlias = function(e5) { + return r2.BROWSER_MAP[e5] || ""; + }, e4; + }(); + t3.default = i2, e3.exports = t3.default; + }, 18: function(e3, t3, n2) { + t3.__esModule = true, t3.ENGINE_MAP = t3.OS_MAP = t3.PLATFORMS_MAP = t3.BROWSER_MAP = t3.BROWSER_ALIASES_MAP = void 0, t3.BROWSER_ALIASES_MAP = { "Amazon Silk": "amazon_silk", "Android Browser": "android", Bada: "bada", BlackBerry: "blackberry", Chrome: "chrome", Chromium: "chromium", Electron: "electron", Epiphany: "epiphany", Firefox: "firefox", Focus: "focus", Generic: "generic", "Google Search": "google_search", Googlebot: "googlebot", "Internet Explorer": "ie", "K-Meleon": "k_meleon", Maxthon: "maxthon", "Microsoft Edge": "edge", "MZ Browser": "mz", "NAVER Whale Browser": "naver", Opera: "opera", "Opera Coast": "opera_coast", PhantomJS: "phantomjs", Puffin: "puffin", QupZilla: "qupzilla", QQ: "qq", QQLite: "qqlite", Safari: "safari", Sailfish: "sailfish", "Samsung Internet for Android": "samsung_internet", SeaMonkey: "seamonkey", Sleipnir: "sleipnir", Swing: "swing", Tizen: "tizen", "UC Browser": "uc", Vivaldi: "vivaldi", "WebOS Browser": "webos", WeChat: "wechat", "Yandex Browser": "yandex", Roku: "roku" }, t3.BROWSER_MAP = { amazon_silk: "Amazon Silk", android: "Android Browser", bada: "Bada", blackberry: "BlackBerry", chrome: "Chrome", chromium: "Chromium", electron: "Electron", epiphany: "Epiphany", firefox: "Firefox", focus: "Focus", generic: "Generic", googlebot: "Googlebot", google_search: "Google Search", ie: "Internet Explorer", k_meleon: "K-Meleon", maxthon: "Maxthon", edge: "Microsoft Edge", mz: "MZ Browser", naver: "NAVER Whale Browser", opera: "Opera", opera_coast: "Opera Coast", phantomjs: "PhantomJS", puffin: "Puffin", qupzilla: "QupZilla", qq: "QQ Browser", qqlite: "QQ Browser Lite", safari: "Safari", sailfish: "Sailfish", samsung_internet: "Samsung Internet for Android", seamonkey: "SeaMonkey", sleipnir: "Sleipnir", swing: "Swing", tizen: "Tizen", uc: "UC Browser", vivaldi: "Vivaldi", webos: "WebOS Browser", wechat: "WeChat", yandex: "Yandex Browser" }, t3.PLATFORMS_MAP = { tablet: "tablet", mobile: "mobile", desktop: "desktop", tv: "tv" }, t3.OS_MAP = { WindowsPhone: "Windows Phone", Windows: "Windows", MacOS: "macOS", iOS: "iOS", Android: "Android", WebOS: "WebOS", BlackBerry: "BlackBerry", Bada: "Bada", Tizen: "Tizen", Linux: "Linux", ChromeOS: "Chrome OS", PlayStation4: "PlayStation 4", Roku: "Roku" }, t3.ENGINE_MAP = { EdgeHTML: "EdgeHTML", Blink: "Blink", Trident: "Trident", Presto: "Presto", Gecko: "Gecko", WebKit: "WebKit" }; + }, 90: function(e3, t3, n2) { + t3.__esModule = true, t3.default = void 0; + var r2, i2 = (r2 = n2(91)) && r2.__esModule ? r2 : { default: r2 }, o2 = n2(18); + function a2(e4, t4) { + for (var n3 = 0; n3 < t4.length; n3++) { + var r3 = t4[n3]; + r3.enumerable = r3.enumerable || false, r3.configurable = true, "value" in r3 && (r3.writable = true), Object.defineProperty(e4, r3.key, r3); + } + } + var s2 = function() { + function e4() { + } + var t4, n3, r3; + return e4.getParser = function(e5, t5) { + if (void 0 === t5 && (t5 = false), "string" != typeof e5) + throw new Error("UserAgent should be a string"); + return new i2.default(e5, t5); + }, e4.parse = function(e5) { + return new i2.default(e5).getResult(); + }, t4 = e4, r3 = [{ key: "BROWSER_MAP", get: function() { + return o2.BROWSER_MAP; + } }, { key: "ENGINE_MAP", get: function() { + return o2.ENGINE_MAP; + } }, { key: "OS_MAP", get: function() { + return o2.OS_MAP; + } }, { key: "PLATFORMS_MAP", get: function() { + return o2.PLATFORMS_MAP; + } }], (n3 = null) && a2(t4.prototype, n3), r3 && a2(t4, r3), e4; + }(); + t3.default = s2, e3.exports = t3.default; + }, 91: function(e3, t3, n2) { + t3.__esModule = true, t3.default = void 0; + var r2 = u2(n2(92)), i2 = u2(n2(93)), o2 = u2(n2(94)), a2 = u2(n2(95)), s2 = u2(n2(17)); + function u2(e4) { + return e4 && e4.__esModule ? e4 : { default: e4 }; + } + var l2 = function() { + function e4(e5, t5) { + if (void 0 === t5 && (t5 = false), null == e5 || "" === e5) + throw new Error("UserAgent parameter can't be empty"); + this._ua = e5, this.parsedResult = {}, true !== t5 && this.parse(); + } + var t4 = e4.prototype; + return t4.getUA = function() { + return this._ua; + }, t4.test = function(e5) { + return e5.test(this._ua); + }, t4.parseBrowser = function() { + var e5 = this; + this.parsedResult.browser = {}; + var t5 = s2.default.find(r2.default, function(t6) { + if ("function" == typeof t6.test) + return t6.test(e5); + if (t6.test instanceof Array) + return t6.test.some(function(t7) { + return e5.test(t7); + }); + throw new Error("Browser's test function is not valid"); + }); + return t5 && (this.parsedResult.browser = t5.describe(this.getUA())), this.parsedResult.browser; + }, t4.getBrowser = function() { + return this.parsedResult.browser ? this.parsedResult.browser : this.parseBrowser(); + }, t4.getBrowserName = function(e5) { + return e5 ? String(this.getBrowser().name).toLowerCase() || "" : this.getBrowser().name || ""; + }, t4.getBrowserVersion = function() { + return this.getBrowser().version; + }, t4.getOS = function() { + return this.parsedResult.os ? this.parsedResult.os : this.parseOS(); + }, t4.parseOS = function() { + var e5 = this; + this.parsedResult.os = {}; + var t5 = s2.default.find(i2.default, function(t6) { + if ("function" == typeof t6.test) + return t6.test(e5); + if (t6.test instanceof Array) + return t6.test.some(function(t7) { + return e5.test(t7); + }); + throw new Error("Browser's test function is not valid"); + }); + return t5 && (this.parsedResult.os = t5.describe(this.getUA())), this.parsedResult.os; + }, t4.getOSName = function(e5) { + var t5 = this.getOS().name; + return e5 ? String(t5).toLowerCase() || "" : t5 || ""; + }, t4.getOSVersion = function() { + return this.getOS().version; + }, t4.getPlatform = function() { + return this.parsedResult.platform ? this.parsedResult.platform : this.parsePlatform(); + }, t4.getPlatformType = function(e5) { + void 0 === e5 && (e5 = false); + var t5 = this.getPlatform().type; + return e5 ? String(t5).toLowerCase() || "" : t5 || ""; + }, t4.parsePlatform = function() { + var e5 = this; + this.parsedResult.platform = {}; + var t5 = s2.default.find(o2.default, function(t6) { + if ("function" == typeof t6.test) + return t6.test(e5); + if (t6.test instanceof Array) + return t6.test.some(function(t7) { + return e5.test(t7); + }); + throw new Error("Browser's test function is not valid"); + }); + return t5 && (this.parsedResult.platform = t5.describe(this.getUA())), this.parsedResult.platform; + }, t4.getEngine = function() { + return this.parsedResult.engine ? this.parsedResult.engine : this.parseEngine(); + }, t4.getEngineName = function(e5) { + return e5 ? String(this.getEngine().name).toLowerCase() || "" : this.getEngine().name || ""; + }, t4.parseEngine = function() { + var e5 = this; + this.parsedResult.engine = {}; + var t5 = s2.default.find(a2.default, function(t6) { + if ("function" == typeof t6.test) + return t6.test(e5); + if (t6.test instanceof Array) + return t6.test.some(function(t7) { + return e5.test(t7); + }); + throw new Error("Browser's test function is not valid"); + }); + return t5 && (this.parsedResult.engine = t5.describe(this.getUA())), this.parsedResult.engine; + }, t4.parse = function() { + return this.parseBrowser(), this.parseOS(), this.parsePlatform(), this.parseEngine(), this; + }, t4.getResult = function() { + return s2.default.assign({}, this.parsedResult); + }, t4.satisfies = function(e5) { + var t5 = this, n3 = {}, r3 = 0, i3 = {}, o3 = 0; + if (Object.keys(e5).forEach(function(t6) { + var a4 = e5[t6]; + "string" == typeof a4 ? (i3[t6] = a4, o3 += 1) : "object" == typeof a4 && (n3[t6] = a4, r3 += 1); + }), r3 > 0) { + var a3 = Object.keys(n3), u3 = s2.default.find(a3, function(e6) { + return t5.isOS(e6); + }); + if (u3) { + var l3 = this.satisfies(n3[u3]); + if (void 0 !== l3) + return l3; + } + var c2 = s2.default.find(a3, function(e6) { + return t5.isPlatform(e6); + }); + if (c2) { + var d2 = this.satisfies(n3[c2]); + if (void 0 !== d2) + return d2; + } + } + if (o3 > 0) { + var f2 = Object.keys(i3), h2 = s2.default.find(f2, function(e6) { + return t5.isBrowser(e6, true); + }); + if (void 0 !== h2) + return this.compareVersion(i3[h2]); + } + }, t4.isBrowser = function(e5, t5) { + void 0 === t5 && (t5 = false); + var n3 = this.getBrowserName().toLowerCase(), r3 = e5.toLowerCase(), i3 = s2.default.getBrowserTypeByAlias(r3); + return t5 && i3 && (r3 = i3.toLowerCase()), r3 === n3; + }, t4.compareVersion = function(e5) { + var t5 = [0], n3 = e5, r3 = false, i3 = this.getBrowserVersion(); + if ("string" == typeof i3) + return ">" === e5[0] || "<" === e5[0] ? (n3 = e5.substr(1), "=" === e5[1] ? (r3 = true, n3 = e5.substr(2)) : t5 = [], ">" === e5[0] ? t5.push(1) : t5.push(-1)) : "=" === e5[0] ? n3 = e5.substr(1) : "~" === e5[0] && (r3 = true, n3 = e5.substr(1)), t5.indexOf(s2.default.compareVersions(i3, n3, r3)) > -1; + }, t4.isOS = function(e5) { + return this.getOSName(true) === String(e5).toLowerCase(); + }, t4.isPlatform = function(e5) { + return this.getPlatformType(true) === String(e5).toLowerCase(); + }, t4.isEngine = function(e5) { + return this.getEngineName(true) === String(e5).toLowerCase(); + }, t4.is = function(e5, t5) { + return void 0 === t5 && (t5 = false), this.isBrowser(e5, t5) || this.isOS(e5) || this.isPlatform(e5); + }, t4.some = function(e5) { + var t5 = this; + return void 0 === e5 && (e5 = []), e5.some(function(e6) { + return t5.is(e6); + }); + }, e4; + }(); + t3.default = l2, e3.exports = t3.default; + }, 92: function(e3, t3, n2) { + t3.__esModule = true, t3.default = void 0; + var r2, i2 = (r2 = n2(17)) && r2.__esModule ? r2 : { default: r2 }, o2 = /version\/(\d+(\.?_?\d+)+)/i, a2 = [{ test: [/googlebot/i], describe: function(e4) { + var t4 = { name: "Googlebot" }, n3 = i2.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i, e4) || i2.default.getFirstMatch(o2, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/opera/i], describe: function(e4) { + var t4 = { name: "Opera" }, n3 = i2.default.getFirstMatch(o2, e4) || i2.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/opr\/|opios/i], describe: function(e4) { + var t4 = { name: "Opera" }, n3 = i2.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i, e4) || i2.default.getFirstMatch(o2, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/SamsungBrowser/i], describe: function(e4) { + var t4 = { name: "Samsung Internet for Android" }, n3 = i2.default.getFirstMatch(o2, e4) || i2.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/Whale/i], describe: function(e4) { + var t4 = { name: "NAVER Whale Browser" }, n3 = i2.default.getFirstMatch(o2, e4) || i2.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/MZBrowser/i], describe: function(e4) { + var t4 = { name: "MZ Browser" }, n3 = i2.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i, e4) || i2.default.getFirstMatch(o2, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/focus/i], describe: function(e4) { + var t4 = { name: "Focus" }, n3 = i2.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i, e4) || i2.default.getFirstMatch(o2, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/swing/i], describe: function(e4) { + var t4 = { name: "Swing" }, n3 = i2.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i, e4) || i2.default.getFirstMatch(o2, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/coast/i], describe: function(e4) { + var t4 = { name: "Opera Coast" }, n3 = i2.default.getFirstMatch(o2, e4) || i2.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/opt\/\d+(?:.?_?\d+)+/i], describe: function(e4) { + var t4 = { name: "Opera Touch" }, n3 = i2.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i, e4) || i2.default.getFirstMatch(o2, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/yabrowser/i], describe: function(e4) { + var t4 = { name: "Yandex Browser" }, n3 = i2.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i, e4) || i2.default.getFirstMatch(o2, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/ucbrowser/i], describe: function(e4) { + var t4 = { name: "UC Browser" }, n3 = i2.default.getFirstMatch(o2, e4) || i2.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/Maxthon|mxios/i], describe: function(e4) { + var t4 = { name: "Maxthon" }, n3 = i2.default.getFirstMatch(o2, e4) || i2.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/epiphany/i], describe: function(e4) { + var t4 = { name: "Epiphany" }, n3 = i2.default.getFirstMatch(o2, e4) || i2.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/puffin/i], describe: function(e4) { + var t4 = { name: "Puffin" }, n3 = i2.default.getFirstMatch(o2, e4) || i2.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/sleipnir/i], describe: function(e4) { + var t4 = { name: "Sleipnir" }, n3 = i2.default.getFirstMatch(o2, e4) || i2.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/k-meleon/i], describe: function(e4) { + var t4 = { name: "K-Meleon" }, n3 = i2.default.getFirstMatch(o2, e4) || i2.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/micromessenger/i], describe: function(e4) { + var t4 = { name: "WeChat" }, n3 = i2.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i, e4) || i2.default.getFirstMatch(o2, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/qqbrowser/i], describe: function(e4) { + var t4 = { name: /qqbrowserlite/i.test(e4) ? "QQ Browser Lite" : "QQ Browser" }, n3 = i2.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i, e4) || i2.default.getFirstMatch(o2, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/msie|trident/i], describe: function(e4) { + var t4 = { name: "Internet Explorer" }, n3 = i2.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/\sedg\//i], describe: function(e4) { + var t4 = { name: "Microsoft Edge" }, n3 = i2.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/edg([ea]|ios)/i], describe: function(e4) { + var t4 = { name: "Microsoft Edge" }, n3 = i2.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/vivaldi/i], describe: function(e4) { + var t4 = { name: "Vivaldi" }, n3 = i2.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/seamonkey/i], describe: function(e4) { + var t4 = { name: "SeaMonkey" }, n3 = i2.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/sailfish/i], describe: function(e4) { + var t4 = { name: "Sailfish" }, n3 = i2.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/silk/i], describe: function(e4) { + var t4 = { name: "Amazon Silk" }, n3 = i2.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/phantom/i], describe: function(e4) { + var t4 = { name: "PhantomJS" }, n3 = i2.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/slimerjs/i], describe: function(e4) { + var t4 = { name: "SlimerJS" }, n3 = i2.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/blackberry|\bbb\d+/i, /rim\stablet/i], describe: function(e4) { + var t4 = { name: "BlackBerry" }, n3 = i2.default.getFirstMatch(o2, e4) || i2.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/(web|hpw)[o0]s/i], describe: function(e4) { + var t4 = { name: "WebOS Browser" }, n3 = i2.default.getFirstMatch(o2, e4) || i2.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/bada/i], describe: function(e4) { + var t4 = { name: "Bada" }, n3 = i2.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/tizen/i], describe: function(e4) { + var t4 = { name: "Tizen" }, n3 = i2.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i, e4) || i2.default.getFirstMatch(o2, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/qupzilla/i], describe: function(e4) { + var t4 = { name: "QupZilla" }, n3 = i2.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i, e4) || i2.default.getFirstMatch(o2, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/firefox|iceweasel|fxios/i], describe: function(e4) { + var t4 = { name: "Firefox" }, n3 = i2.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/electron/i], describe: function(e4) { + var t4 = { name: "Electron" }, n3 = i2.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/MiuiBrowser/i], describe: function(e4) { + var t4 = { name: "Miui" }, n3 = i2.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/chromium/i], describe: function(e4) { + var t4 = { name: "Chromium" }, n3 = i2.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i, e4) || i2.default.getFirstMatch(o2, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/chrome|crios|crmo/i], describe: function(e4) { + var t4 = { name: "Chrome" }, n3 = i2.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/GSA/i], describe: function(e4) { + var t4 = { name: "Google Search" }, n3 = i2.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: function(e4) { + var t4 = !e4.test(/like android/i), n3 = e4.test(/android/i); + return t4 && n3; + }, describe: function(e4) { + var t4 = { name: "Android Browser" }, n3 = i2.default.getFirstMatch(o2, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/playstation 4/i], describe: function(e4) { + var t4 = { name: "PlayStation 4" }, n3 = i2.default.getFirstMatch(o2, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/safari|applewebkit/i], describe: function(e4) { + var t4 = { name: "Safari" }, n3 = i2.default.getFirstMatch(o2, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/.*/i], describe: function(e4) { + var t4 = -1 !== e4.search("\\(") ? /^(.*)\/(.*)[ \t]\((.*)/ : /^(.*)\/(.*) /; + return { name: i2.default.getFirstMatch(t4, e4), version: i2.default.getSecondMatch(t4, e4) }; + } }]; + t3.default = a2, e3.exports = t3.default; + }, 93: function(e3, t3, n2) { + t3.__esModule = true, t3.default = void 0; + var r2, i2 = (r2 = n2(17)) && r2.__esModule ? r2 : { default: r2 }, o2 = n2(18), a2 = [{ test: [/Roku\/DVP/], describe: function(e4) { + var t4 = i2.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i, e4); + return { name: o2.OS_MAP.Roku, version: t4 }; + } }, { test: [/windows phone/i], describe: function(e4) { + var t4 = i2.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i, e4); + return { name: o2.OS_MAP.WindowsPhone, version: t4 }; + } }, { test: [/windows /i], describe: function(e4) { + var t4 = i2.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i, e4), n3 = i2.default.getWindowsVersionName(t4); + return { name: o2.OS_MAP.Windows, version: t4, versionName: n3 }; + } }, { test: [/Macintosh(.*?) FxiOS(.*?)\//], describe: function(e4) { + var t4 = { name: o2.OS_MAP.iOS }, n3 = i2.default.getSecondMatch(/(Version\/)(\d[\d.]+)/, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/macintosh/i], describe: function(e4) { + var t4 = i2.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i, e4).replace(/[_\s]/g, "."), n3 = i2.default.getMacOSVersionName(t4), r3 = { name: o2.OS_MAP.MacOS, version: t4 }; + return n3 && (r3.versionName = n3), r3; + } }, { test: [/(ipod|iphone|ipad)/i], describe: function(e4) { + var t4 = i2.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i, e4).replace(/[_\s]/g, "."); + return { name: o2.OS_MAP.iOS, version: t4 }; + } }, { test: function(e4) { + var t4 = !e4.test(/like android/i), n3 = e4.test(/android/i); + return t4 && n3; + }, describe: function(e4) { + var t4 = i2.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i, e4), n3 = i2.default.getAndroidVersionName(t4), r3 = { name: o2.OS_MAP.Android, version: t4 }; + return n3 && (r3.versionName = n3), r3; + } }, { test: [/(web|hpw)[o0]s/i], describe: function(e4) { + var t4 = i2.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i, e4), n3 = { name: o2.OS_MAP.WebOS }; + return t4 && t4.length && (n3.version = t4), n3; + } }, { test: [/blackberry|\bbb\d+/i, /rim\stablet/i], describe: function(e4) { + var t4 = i2.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i, e4) || i2.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i, e4) || i2.default.getFirstMatch(/\bbb(\d+)/i, e4); + return { name: o2.OS_MAP.BlackBerry, version: t4 }; + } }, { test: [/bada/i], describe: function(e4) { + var t4 = i2.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i, e4); + return { name: o2.OS_MAP.Bada, version: t4 }; + } }, { test: [/tizen/i], describe: function(e4) { + var t4 = i2.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i, e4); + return { name: o2.OS_MAP.Tizen, version: t4 }; + } }, { test: [/linux/i], describe: function() { + return { name: o2.OS_MAP.Linux }; + } }, { test: [/CrOS/], describe: function() { + return { name: o2.OS_MAP.ChromeOS }; + } }, { test: [/PlayStation 4/], describe: function(e4) { + var t4 = i2.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i, e4); + return { name: o2.OS_MAP.PlayStation4, version: t4 }; + } }]; + t3.default = a2, e3.exports = t3.default; + }, 94: function(e3, t3, n2) { + t3.__esModule = true, t3.default = void 0; + var r2, i2 = (r2 = n2(17)) && r2.__esModule ? r2 : { default: r2 }, o2 = n2(18), a2 = [{ test: [/googlebot/i], describe: function() { + return { type: "bot", vendor: "Google" }; + } }, { test: [/huawei/i], describe: function(e4) { + var t4 = i2.default.getFirstMatch(/(can-l01)/i, e4) && "Nova", n3 = { type: o2.PLATFORMS_MAP.mobile, vendor: "Huawei" }; + return t4 && (n3.model = t4), n3; + } }, { test: [/nexus\s*(?:7|8|9|10).*/i], describe: function() { + return { type: o2.PLATFORMS_MAP.tablet, vendor: "Nexus" }; + } }, { test: [/ipad/i], describe: function() { + return { type: o2.PLATFORMS_MAP.tablet, vendor: "Apple", model: "iPad" }; + } }, { test: [/Macintosh(.*?) FxiOS(.*?)\//], describe: function() { + return { type: o2.PLATFORMS_MAP.tablet, vendor: "Apple", model: "iPad" }; + } }, { test: [/kftt build/i], describe: function() { + return { type: o2.PLATFORMS_MAP.tablet, vendor: "Amazon", model: "Kindle Fire HD 7" }; + } }, { test: [/silk/i], describe: function() { + return { type: o2.PLATFORMS_MAP.tablet, vendor: "Amazon" }; + } }, { test: [/tablet(?! pc)/i], describe: function() { + return { type: o2.PLATFORMS_MAP.tablet }; + } }, { test: function(e4) { + var t4 = e4.test(/ipod|iphone/i), n3 = e4.test(/like (ipod|iphone)/i); + return t4 && !n3; + }, describe: function(e4) { + var t4 = i2.default.getFirstMatch(/(ipod|iphone)/i, e4); + return { type: o2.PLATFORMS_MAP.mobile, vendor: "Apple", model: t4 }; + } }, { test: [/nexus\s*[0-6].*/i, /galaxy nexus/i], describe: function() { + return { type: o2.PLATFORMS_MAP.mobile, vendor: "Nexus" }; + } }, { test: [/[^-]mobi/i], describe: function() { + return { type: o2.PLATFORMS_MAP.mobile }; + } }, { test: function(e4) { + return "blackberry" === e4.getBrowserName(true); + }, describe: function() { + return { type: o2.PLATFORMS_MAP.mobile, vendor: "BlackBerry" }; + } }, { test: function(e4) { + return "bada" === e4.getBrowserName(true); + }, describe: function() { + return { type: o2.PLATFORMS_MAP.mobile }; + } }, { test: function(e4) { + return "windows phone" === e4.getBrowserName(); + }, describe: function() { + return { type: o2.PLATFORMS_MAP.mobile, vendor: "Microsoft" }; + } }, { test: function(e4) { + var t4 = Number(String(e4.getOSVersion()).split(".")[0]); + return "android" === e4.getOSName(true) && t4 >= 3; + }, describe: function() { + return { type: o2.PLATFORMS_MAP.tablet }; + } }, { test: function(e4) { + return "android" === e4.getOSName(true); + }, describe: function() { + return { type: o2.PLATFORMS_MAP.mobile }; + } }, { test: function(e4) { + return "macos" === e4.getOSName(true); + }, describe: function() { + return { type: o2.PLATFORMS_MAP.desktop, vendor: "Apple" }; + } }, { test: function(e4) { + return "windows" === e4.getOSName(true); + }, describe: function() { + return { type: o2.PLATFORMS_MAP.desktop }; + } }, { test: function(e4) { + return "linux" === e4.getOSName(true); + }, describe: function() { + return { type: o2.PLATFORMS_MAP.desktop }; + } }, { test: function(e4) { + return "playstation 4" === e4.getOSName(true); + }, describe: function() { + return { type: o2.PLATFORMS_MAP.tv }; + } }, { test: function(e4) { + return "roku" === e4.getOSName(true); + }, describe: function() { + return { type: o2.PLATFORMS_MAP.tv }; + } }]; + t3.default = a2, e3.exports = t3.default; + }, 95: function(e3, t3, n2) { + t3.__esModule = true, t3.default = void 0; + var r2, i2 = (r2 = n2(17)) && r2.__esModule ? r2 : { default: r2 }, o2 = n2(18), a2 = [{ test: function(e4) { + return "microsoft edge" === e4.getBrowserName(true); + }, describe: function(e4) { + if (/\sedg\//i.test(e4)) + return { name: o2.ENGINE_MAP.Blink }; + var t4 = i2.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i, e4); + return { name: o2.ENGINE_MAP.EdgeHTML, version: t4 }; + } }, { test: [/trident/i], describe: function(e4) { + var t4 = { name: o2.ENGINE_MAP.Trident }, n3 = i2.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: function(e4) { + return e4.test(/presto/i); + }, describe: function(e4) { + var t4 = { name: o2.ENGINE_MAP.Presto }, n3 = i2.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: function(e4) { + var t4 = e4.test(/gecko/i), n3 = e4.test(/like gecko/i); + return t4 && !n3; + }, describe: function(e4) { + var t4 = { name: o2.ENGINE_MAP.Gecko }, n3 = i2.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }, { test: [/(apple)?webkit\/537\.36/i], describe: function() { + return { name: o2.ENGINE_MAP.Blink }; + } }, { test: [/(apple)?webkit/i], describe: function(e4) { + var t4 = { name: o2.ENGINE_MAP.WebKit }, n3 = i2.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i, e4); + return n3 && (t4.version = n3), t4; + } }]; + t3.default = a2, e3.exports = t3.default; + } }); + }(sT); + var uT = r(sT.exports); + class lT { + constructor({ useDeepLink: e2, preferredOpenLink: t2, debug: n2 = false }) { + this.state = { platformType: void 0, useDeeplink: false, preferredOpenLink: void 0, debug: false }, this.state.platformType = this.getPlatformType(), this.state.useDeeplink = e2, this.state.preferredOpenLink = t2, this.state.debug = n2; + } + openDeeplink(e2, t2, n2) { + return function(e3, t3, n3, r2) { + const { state: i2 } = e3; + xx(`[PlatfformManager: openDeeplink()] universalLink --> ${t3}`), xx(`[PlatfformManager: openDeeplink()] deepLink --> ${n3}`); + try { + if (i2.preferredOpenLink) + return void i2.preferredOpenLink(i2.useDeeplink ? n3 : t3, r2); + if (xx(`[PlatfformManager: openDeeplink()] open link now useDeepLink=${i2.useDeeplink} link=${i2.useDeeplink ? n3 : t3}`), i2.useDeeplink) + "undefined" != typeof window && (window.location.href = n3); + else if ("undefined" != typeof document) { + const e4 = document.createElement("a"); + e4.href = t3, e4.target = "_self", e4.rel = "noreferrer noopener", e4.click(); + } + } catch (e4) { + console.log("[PlatfformManager: openDeeplink()] can't open link", e4); + } + }(this, e2, t2, n2); + } + isReactNative() { + var e2; + return this.isNotBrowser() && "undefined" != typeof window && (null === window || void 0 === window ? void 0 : window.navigator) && "ReactNative" === (null === (e2 = window.navigator) || void 0 === e2 ? void 0 : e2.product); + } + isMetaMaskInstalled() { + return function() { + const e2 = PR.getProvider() || (null === window || void 0 === window ? void 0 : window.ethereum); + return xx(`[PlatfformManager: isMetaMaskInstalled()] isMetaMask=${null == e2 ? void 0 : e2.isMetaMask} isConnected=${null == e2 ? void 0 : e2.isConnected()}`), (null == e2 ? void 0 : e2.isMetaMask) && (null == e2 ? void 0 : e2.isConnected()); + }(); + } + isDesktopWeb() { + return this.isBrowser() && !this.isMobileWeb(); + } + isMobile() { + var e2, t2; + const n2 = uT.parse(window.navigator.userAgent); + return "mobile" === (null === (e2 = null == n2 ? void 0 : n2.platform) || void 0 === e2 ? void 0 : e2.type) || "tablet" === (null === (t2 = null == n2 ? void 0 : n2.platform) || void 0 === t2 ? void 0 : t2.type); + } + isSecure() { + return this.isReactNative() || this.isMobileWeb(); + } + isMetaMaskMobileWebView() { + return "undefined" != typeof window && (Boolean(window.ReactNativeWebView) && Boolean(navigator.userAgent.endsWith("MetaMaskMobile"))); + } + isMobileWeb() { + return this.state.platformType === e.PlatformType.MobileWeb; + } + isNotBrowser() { + var e2; + return "undefined" == typeof window || !(null === window || void 0 === window ? void 0 : window.navigator) || "undefined" != typeof commonjsGlobal && "ReactNative" === (null === (e2 = null === commonjsGlobal || void 0 === commonjsGlobal ? void 0 : commonjsGlobal.navigator) || void 0 === e2 ? void 0 : e2.product) || "ReactNative" === (null === navigator || void 0 === navigator ? void 0 : navigator.product); + } + isNodeJS() { + return this.isNotBrowser() && !this.isReactNative(); + } + isBrowser() { + return !this.isNotBrowser(); + } + isUseDeepLink() { + return this.state.useDeeplink; + } + getPlatformType() { + return function(t2) { + const { state: n2 } = t2; + return n2.platformType ? n2.platformType : t2.isReactNative() ? e.PlatformType.ReactNative : t2.isNotBrowser() ? e.PlatformType.NonBrowser : t2.isMetaMaskMobileWebView() ? e.PlatformType.MetaMaskMobileWebview : t2.isMobile() ? e.PlatformType.MobileWeb : e.PlatformType.DesktopWeb; + }(this); + } + } + const cT = (e2) => kk(void 0, void 0, void 0, function* () { + const { options: t2 } = e2, { readonlyRPCMap: n2 } = t2; + if (n2) + try { + xx("[MetaMaskSDK: setupReadOnlyRPCProviders()] Setting up Readonly RPC Providers", n2), e2.setReadOnlyRPCCalls(true); + } catch (e3) { + throw new Error("Invalid Infura Settings"); + } + }); + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + function dT(e2, t2, n2, r2) { + return new (n2 || (n2 = Promise))(function(i2, o2) { + function a2(e3) { + try { + u2(r2.next(e3)); + } catch (e4) { + o2(e4); + } + } + function s2(e3) { + try { + u2(r2.throw(e3)); + } catch (e4) { + o2(e4); + } + } + function u2(e3) { + e3.done ? i2(e3.value) : function(e4) { + return e4 instanceof n2 ? e4 : new n2(function(t3) { + t3(e4); + }); + }(e3.value).then(a2, s2); + } + u2((r2 = r2.apply(e2, t2 || [])).next()); + }); + } + function fT(e2, t2) { + var n2, r2, i2, o2, a2 = { label: 0, sent: function() { + if (1 & i2[0]) + throw i2[1]; + return i2[1]; + }, trys: [], ops: [] }; + return o2 = { next: s2(0), throw: s2(1), return: s2(2) }, "function" == typeof Symbol && (o2[Symbol.iterator] = function() { + return this; + }), o2; + function s2(o3) { + return function(s3) { + return function(o4) { + if (n2) + throw new TypeError("Generator is already executing."); + for (; a2; ) + try { + if (n2 = 1, r2 && (i2 = 2 & o4[0] ? r2.return : o4[0] ? r2.throw || ((i2 = r2.return) && i2.call(r2), 0) : r2.next) && !(i2 = i2.call(r2, o4[1])).done) + return i2; + switch (r2 = 0, i2 && (o4 = [2 & o4[0], i2.value]), o4[0]) { + case 0: + case 1: + i2 = o4; + break; + case 4: + return a2.label++, { value: o4[1], done: false }; + case 5: + a2.label++, r2 = o4[1], o4 = [0]; + continue; + case 7: + o4 = a2.ops.pop(), a2.trys.pop(); + continue; + default: + if (!(i2 = a2.trys, (i2 = i2.length > 0 && i2[i2.length - 1]) || 6 !== o4[0] && 2 !== o4[0])) { + a2 = 0; + continue; + } + if (3 === o4[0] && (!i2 || o4[1] > i2[0] && o4[1] < i2[3])) { + a2.label = o4[1]; + break; + } + if (6 === o4[0] && a2.label < i2[1]) { + a2.label = i2[1], i2 = o4; + break; + } + if (i2 && a2.label < i2[2]) { + a2.label = i2[2], a2.ops.push(o4); + break; + } + i2[2] && a2.ops.pop(), a2.trys.pop(); + continue; + } + o4 = t2.call(e2, a2); + } catch (e3) { + o4 = [6, e3], r2 = 0; + } finally { + n2 = i2 = 0; + } + if (5 & o4[0]) + throw o4[1]; + return { value: o4[0] ? o4[1] : void 0, done: true }; + }([o3, s3]); + }; + } + } + var hT = "INSTALLED", pT = "NOT_INSTALLED", mT = "REGISTERED", gT = "REGISTERING", vT = "RELOADING", bT = { CHROME: "https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn", FIREFOX: "https://addons.mozilla.org/firefox/addon/ether-metamask/", DEFAULT: "https://metamask.io" }, yT = "REGISTRATION_IN_PROGRESS", wT = "FORWARDER_ID", _T = function() { + function e2(t2) { + var n2 = void 0 === t2 ? {} : t2, r2 = n2.forwarderOrigin, i2 = void 0 === r2 ? "https://fwd.metamask.io" : r2, o2 = n2.forwarderMode, a2 = void 0 === o2 ? e2.FORWARDER_MODE.INJECT : o2; + this.forwarderOrigin = i2, this.forwarderMode = a2, this.state = e2.isMetaMaskInstalled() ? hT : pT; + var s2 = e2._detectBrowser(); + this.downloadUrl = s2 ? bT[s2] : bT.DEFAULT, this._onMessage = this._onMessage.bind(this), this._onMessageFromForwarder = this._onMessageFromForwarder.bind(this), this._openForwarder = this._openForwarder.bind(this), this._openDownloadPage = this._openDownloadPage.bind(this), this.startOnboarding = this.startOnboarding.bind(this), this.stopOnboarding = this.stopOnboarding.bind(this), window.addEventListener("message", this._onMessage), a2 === e2.FORWARDER_MODE.INJECT && "true" === sessionStorage.getItem(yT) && e2._injectForwarder(this.forwarderOrigin); + } + return e2.prototype._onMessage = function(e3) { + if (e3.origin === this.forwarderOrigin) + return "metamask:reload" === e3.data.type ? this._onMessageFromForwarder(e3) : void console.debug("Unknown message from '" + e3.origin + "' with data " + JSON.stringify(e3.data)); + }, e2.prototype._onMessageUnknownStateError = function(e3) { + throw new Error("Unknown state: '" + e3 + "'"); + }, e2.prototype._onMessageFromForwarder = function(t2) { + return dT(this, void 0, void 0, function() { + return fT(this, function(n2) { + switch (n2.label) { + case 0: + switch (this.state) { + case vT: + return [3, 1]; + case pT: + return [3, 2]; + case hT: + return [3, 3]; + case gT: + return [3, 5]; + case mT: + return [3, 6]; + } + return [3, 7]; + case 1: + return console.debug("Ignoring message while reloading"), [3, 8]; + case 2: + return console.debug("Reloading now to register with MetaMask"), this.state = vT, location.reload(), [3, 8]; + case 3: + return console.debug("Registering with MetaMask"), this.state = gT, [4, e2._register()]; + case 4: + return n2.sent(), this.state = mT, t2.source.postMessage({ type: "metamask:registrationCompleted" }, t2.origin), this.stopOnboarding(), [3, 8]; + case 5: + return console.debug("Already registering - ignoring reload message"), [3, 8]; + case 6: + return console.debug("Already registered - ignoring reload message"), [3, 8]; + case 7: + this._onMessageUnknownStateError(this.state), n2.label = 8; + case 8: + return [2]; + } + }); + }); + }, e2.prototype.startOnboarding = function() { + sessionStorage.setItem(yT, "true"), this._openDownloadPage(), this._openForwarder(); + }, e2.prototype.stopOnboarding = function() { + "true" === sessionStorage.getItem(yT) && (this.forwarderMode === e2.FORWARDER_MODE.INJECT && (console.debug("Removing forwarder"), e2._removeForwarder()), sessionStorage.setItem(yT, "false")); + }, e2.prototype._openForwarder = function() { + this.forwarderMode === e2.FORWARDER_MODE.OPEN_TAB ? window.open(this.forwarderOrigin, "_blank") : e2._injectForwarder(this.forwarderOrigin); + }, e2.prototype._openDownloadPage = function() { + window.open(this.downloadUrl, "_blank"); + }, e2.isMetaMaskInstalled = function() { + return Boolean(window.ethereum && window.ethereum.isMetaMask); + }, e2._register = function() { + return window.ethereum.request({ method: "wallet_registerOnboarding" }); + }, e2._injectForwarder = function(e3) { + var t2 = document.body, n2 = document.createElement("iframe"); + n2.setAttribute("height", "0"), n2.setAttribute("width", "0"), n2.setAttribute("style", "display: none;"), n2.setAttribute("src", e3), n2.setAttribute("id", wT), t2.insertBefore(n2, t2.children[0]); + }, e2._removeForwarder = function() { + var e3; + null === (e3 = document.getElementById(wT)) || void 0 === e3 || e3.remove(); + }, e2._detectBrowser = function() { + var e3 = uT.parse(window.navigator.userAgent); + return "Firefox" === e3.browser.name ? "FIREFOX" : ["Chrome", "Chromium"].includes(e3.browser.name || "") ? "CHROME" : null; + }, e2.FORWARDER_MODE = { INJECT: "INJECT", OPEN_TAB: "OPEN_TAB" }, e2; + }(); + function ST(e2, { wait: t2 = false }) { + return kk(this, void 0, void 0, function* () { + return xx(`[MetamaskInstaller: startInstaller()] wait=${t2}`), t2 && (yield jR(1e3)), yield e2.checkInstallation(); + }); + } + class ET { + constructor({ remote: e2, preferDesktop: t2, platformManager: n2, debug: r2 = false }) { + this.state = { isInstalling: false, hasInstalled: false, resendRequest: null, preferDesktop: false, platformManager: null, remote: null, debug: false, connectWith: void 0 }, this.state.remote = e2, this.state.preferDesktop = t2, this.state.platformManager = n2, this.state.debug = r2; + } + startDesktopOnboarding() { + return function() { + return kk(this, void 0, void 0, function* () { + xx("[MetamaskInstaller: startDesktopOnboarding() starting desktop onboarding"), delete window.ethereum, new _T().startOnboarding(); + }); + }(); + } + redirectToProperInstall() { + return kk(this, void 0, void 0, function* () { + return function(t2) { + var n2, r2; + return kk(this, void 0, void 0, function* () { + const { state: i2 } = t2, o2 = null === (n2 = i2.platformManager) || void 0 === n2 ? void 0 : n2.getPlatformType(); + if (xx(`[MetamaskInstaller: redirectToProperInstall()] platform=${o2}`), o2 === e.PlatformType.MetaMaskMobileWebview) + return false; + i2.isInstalling = true; + try { + yield null === (r2 = i2.remote) || void 0 === r2 ? void 0 : r2.startConnection({ connectWith: i2.connectWith }), i2.isInstalling = false, i2.hasInstalled = true; + } catch (e2) { + throw i2.isInstalling = false, e2; + } + return true; + }); + }(this); + }); + } + checkInstallation() { + return kk(this, void 0, void 0, function* () { + return function(e2) { + var t2; + return kk(this, void 0, void 0, function* () { + const { state: n2 } = e2, r2 = null === (t2 = n2.platformManager) || void 0 === t2 ? void 0 : t2.isMetaMaskInstalled(); + return xx(`[MetamaskInstaller: checkInstallation()] isInstalled=${r2}`), !!r2 || (yield e2.redirectToProperInstall()); + }); + }(this); + }); + } + start({ wait: e2 = false, connectWith: t2 }) { + return kk(this, void 0, void 0, function* () { + this.state.connectWith = t2, xx(`[MetaMaskInstaller: start()] wait=${e2}`, t2), yield ST(this, { wait: e2 }); + }); + } + } + var kT, MT = { exports: {} }, CT = { exports: {} }, xT = {}; + function AT() { + if (kT) + return xT; + kT = 1; + var e2 = Symbol.for("react.element"), t2 = Symbol.for("react.portal"), n2 = Symbol.for("react.fragment"), r2 = Symbol.for("react.strict_mode"), i2 = Symbol.for("react.profiler"), o2 = Symbol.for("react.provider"), a2 = Symbol.for("react.context"), s2 = Symbol.for("react.forward_ref"), u2 = Symbol.for("react.suspense"), l2 = Symbol.for("react.memo"), c2 = Symbol.for("react.lazy"), d2 = Symbol.iterator; + var f2 = { isMounted: function() { + return false; + }, enqueueForceUpdate: function() { + }, enqueueReplaceState: function() { + }, enqueueSetState: function() { + } }, h2 = Object.assign, p2 = {}; + function m2(e3, t3, n3) { + this.props = e3, this.context = t3, this.refs = p2, this.updater = n3 || f2; + } + function g2() { + } + function v2(e3, t3, n3) { + this.props = e3, this.context = t3, this.refs = p2, this.updater = n3 || f2; + } + m2.prototype.isReactComponent = {}, m2.prototype.setState = function(e3, t3) { + if ("object" != typeof e3 && "function" != typeof e3 && null != e3) + throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); + this.updater.enqueueSetState(this, e3, t3, "setState"); + }, m2.prototype.forceUpdate = function(e3) { + this.updater.enqueueForceUpdate(this, e3, "forceUpdate"); + }, g2.prototype = m2.prototype; + var b2 = v2.prototype = new g2(); + b2.constructor = v2, h2(b2, m2.prototype), b2.isPureReactComponent = true; + var y2 = Array.isArray, w2 = Object.prototype.hasOwnProperty, _2 = { current: null }, S2 = { key: true, ref: true, __self: true, __source: true }; + function E2(t3, n3, r3) { + var i3, o3 = {}, a3 = null, s3 = null; + if (null != n3) + for (i3 in void 0 !== n3.ref && (s3 = n3.ref), void 0 !== n3.key && (a3 = "" + n3.key), n3) + w2.call(n3, i3) && !S2.hasOwnProperty(i3) && (o3[i3] = n3[i3]); + var u3 = arguments.length - 2; + if (1 === u3) + o3.children = r3; + else if (1 < u3) { + for (var l3 = Array(u3), c3 = 0; c3 < u3; c3++) + l3[c3] = arguments[c3 + 2]; + o3.children = l3; + } + if (t3 && t3.defaultProps) + for (i3 in u3 = t3.defaultProps) + void 0 === o3[i3] && (o3[i3] = u3[i3]); + return { $$typeof: e2, type: t3, key: a3, ref: s3, props: o3, _owner: _2.current }; + } + function k2(t3) { + return "object" == typeof t3 && null !== t3 && t3.$$typeof === e2; + } + var M2 = /\/+/g; + function C2(e3, t3) { + return "object" == typeof e3 && null !== e3 && null != e3.key ? function(e4) { + var t4 = { "=": "=0", ":": "=2" }; + return "$" + e4.replace(/[=:]/g, function(e5) { + return t4[e5]; + }); + }("" + e3.key) : t3.toString(36); + } + function x2(n3, r3, i3, o3, a3) { + var s3 = typeof n3; + "undefined" !== s3 && "boolean" !== s3 || (n3 = null); + var u3 = false; + if (null === n3) + u3 = true; + else + switch (s3) { + case "string": + case "number": + u3 = true; + break; + case "object": + switch (n3.$$typeof) { + case e2: + case t2: + u3 = true; + } + } + if (u3) + return a3 = a3(u3 = n3), n3 = "" === o3 ? "." + C2(u3, 0) : o3, y2(a3) ? (i3 = "", null != n3 && (i3 = n3.replace(M2, "$&/") + "/"), x2(a3, r3, i3, "", function(e3) { + return e3; + })) : null != a3 && (k2(a3) && (a3 = function(t3, n4) { + return { $$typeof: e2, type: t3.type, key: n4, ref: t3.ref, props: t3.props, _owner: t3._owner }; + }(a3, i3 + (!a3.key || u3 && u3.key === a3.key ? "" : ("" + a3.key).replace(M2, "$&/") + "/") + n3)), r3.push(a3)), 1; + if (u3 = 0, o3 = "" === o3 ? "." : o3 + ":", y2(n3)) + for (var l3 = 0; l3 < n3.length; l3++) { + var c3 = o3 + C2(s3 = n3[l3], l3); + u3 += x2(s3, r3, i3, c3, a3); + } + else if (c3 = function(e3) { + return null === e3 || "object" != typeof e3 ? null : "function" == typeof (e3 = d2 && e3[d2] || e3["@@iterator"]) ? e3 : null; + }(n3), "function" == typeof c3) + for (n3 = c3.call(n3), l3 = 0; !(s3 = n3.next()).done; ) + u3 += x2(s3 = s3.value, r3, i3, c3 = o3 + C2(s3, l3++), a3); + else if ("object" === s3) + throw r3 = String(n3), Error("Objects are not valid as a React child (found: " + ("[object Object]" === r3 ? "object with keys {" + Object.keys(n3).join(", ") + "}" : r3) + "). If you meant to render a collection of children, use an array instead."); + return u3; + } + function A2(e3, t3, n3) { + if (null == e3) + return e3; + var r3 = [], i3 = 0; + return x2(e3, r3, "", "", function(e4) { + return t3.call(n3, e4, i3++); + }), r3; + } + function R2(e3) { + if (-1 === e3._status) { + var t3 = e3._result; + (t3 = t3()).then(function(t4) { + 0 !== e3._status && -1 !== e3._status || (e3._status = 1, e3._result = t4); + }, function(t4) { + 0 !== e3._status && -1 !== e3._status || (e3._status = 2, e3._result = t4); + }), -1 === e3._status && (e3._status = 0, e3._result = t3); + } + if (1 === e3._status) + return e3._result.default; + throw e3._result; + } + var T2 = { current: null }, P2 = { transition: null }, L2 = { ReactCurrentDispatcher: T2, ReactCurrentBatchConfig: P2, ReactCurrentOwner: _2 }; + return xT.Children = { map: A2, forEach: function(e3, t3, n3) { + A2(e3, function() { + t3.apply(this, arguments); + }, n3); + }, count: function(e3) { + var t3 = 0; + return A2(e3, function() { + t3++; + }), t3; + }, toArray: function(e3) { + return A2(e3, function(e4) { + return e4; + }) || []; + }, only: function(e3) { + if (!k2(e3)) + throw Error("React.Children.only expected to receive a single React element child."); + return e3; + } }, xT.Component = m2, xT.Fragment = n2, xT.Profiler = i2, xT.PureComponent = v2, xT.StrictMode = r2, xT.Suspense = u2, xT.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = L2, xT.cloneElement = function(t3, n3, r3) { + if (null == t3) + throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + t3 + "."); + var i3 = h2({}, t3.props), o3 = t3.key, a3 = t3.ref, s3 = t3._owner; + if (null != n3) { + if (void 0 !== n3.ref && (a3 = n3.ref, s3 = _2.current), void 0 !== n3.key && (o3 = "" + n3.key), t3.type && t3.type.defaultProps) + var u3 = t3.type.defaultProps; + for (l3 in n3) + w2.call(n3, l3) && !S2.hasOwnProperty(l3) && (i3[l3] = void 0 === n3[l3] && void 0 !== u3 ? u3[l3] : n3[l3]); + } + var l3 = arguments.length - 2; + if (1 === l3) + i3.children = r3; + else if (1 < l3) { + u3 = Array(l3); + for (var c3 = 0; c3 < l3; c3++) + u3[c3] = arguments[c3 + 2]; + i3.children = u3; + } + return { $$typeof: e2, type: t3.type, key: o3, ref: a3, props: i3, _owner: s3 }; + }, xT.createContext = function(e3) { + return (e3 = { $$typeof: a2, _currentValue: e3, _currentValue2: e3, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }).Provider = { $$typeof: o2, _context: e3 }, e3.Consumer = e3; + }, xT.createElement = E2, xT.createFactory = function(e3) { + var t3 = E2.bind(null, e3); + return t3.type = e3, t3; + }, xT.createRef = function() { + return { current: null }; + }, xT.forwardRef = function(e3) { + return { $$typeof: s2, render: e3 }; + }, xT.isValidElement = k2, xT.lazy = function(e3) { + return { $$typeof: c2, _payload: { _status: -1, _result: e3 }, _init: R2 }; + }, xT.memo = function(e3, t3) { + return { $$typeof: l2, type: e3, compare: void 0 === t3 ? null : t3 }; + }, xT.startTransition = function(e3) { + var t3 = P2.transition; + P2.transition = {}; + try { + e3(); + } finally { + P2.transition = t3; + } + }, xT.unstable_act = function() { + throw Error("act(...) is not supported in production builds of React."); + }, xT.useCallback = function(e3, t3) { + return T2.current.useCallback(e3, t3); + }, xT.useContext = function(e3) { + return T2.current.useContext(e3); + }, xT.useDebugValue = function() { + }, xT.useDeferredValue = function(e3) { + return T2.current.useDeferredValue(e3); + }, xT.useEffect = function(e3, t3) { + return T2.current.useEffect(e3, t3); + }, xT.useId = function() { + return T2.current.useId(); + }, xT.useImperativeHandle = function(e3, t3, n3) { + return T2.current.useImperativeHandle(e3, t3, n3); + }, xT.useInsertionEffect = function(e3, t3) { + return T2.current.useInsertionEffect(e3, t3); + }, xT.useLayoutEffect = function(e3, t3) { + return T2.current.useLayoutEffect(e3, t3); + }, xT.useMemo = function(e3, t3) { + return T2.current.useMemo(e3, t3); + }, xT.useReducer = function(e3, t3, n3) { + return T2.current.useReducer(e3, t3, n3); + }, xT.useRef = function(e3) { + return T2.current.useRef(e3); + }, xT.useState = function(e3) { + return T2.current.useState(e3); + }, xT.useSyncExternalStore = function(e3, t3, n3) { + return T2.current.useSyncExternalStore(e3, t3, n3); + }, xT.useTransition = function() { + return T2.current.useTransition(); + }, xT.version = "18.2.0", xT; + } + var RT, TT, PT = { exports: {} }; + function LT() { + return RT || (RT = 1, function(e2, t2) { + "production" !== je.env.NODE_ENV && function() { + "undefined" != typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); + var n2 = Symbol.for("react.element"), r2 = Symbol.for("react.portal"), i2 = Symbol.for("react.fragment"), o2 = Symbol.for("react.strict_mode"), a2 = Symbol.for("react.profiler"), s2 = Symbol.for("react.provider"), u2 = Symbol.for("react.context"), l2 = Symbol.for("react.forward_ref"), c2 = Symbol.for("react.suspense"), d2 = Symbol.for("react.suspense_list"), f2 = Symbol.for("react.memo"), h2 = Symbol.for("react.lazy"), p2 = Symbol.for("react.offscreen"), m2 = Symbol.iterator, g2 = "@@iterator"; + function v2(e3) { + if (null === e3 || "object" != typeof e3) + return null; + var t3 = m2 && e3[m2] || e3[g2]; + return "function" == typeof t3 ? t3 : null; + } + var b2 = { current: null }, y2 = { transition: null }, w2 = { current: null, isBatchingLegacy: false, didScheduleLegacyUpdate: false }, _2 = { current: null }, S2 = {}, E2 = null; + function k2(e3) { + E2 = e3; + } + S2.setExtraStackFrame = function(e3) { + E2 = e3; + }, S2.getCurrentStack = null, S2.getStackAddendum = function() { + var e3 = ""; + E2 && (e3 += E2); + var t3 = S2.getCurrentStack; + return t3 && (e3 += t3() || ""), e3; + }; + var M2 = false, C2 = false, x2 = false, A2 = false, R2 = false, T2 = { ReactCurrentDispatcher: b2, ReactCurrentBatchConfig: y2, ReactCurrentOwner: _2 }; + function P2(e3) { + for (var t3 = arguments.length, n3 = new Array(t3 > 1 ? t3 - 1 : 0), r3 = 1; r3 < t3; r3++) + n3[r3 - 1] = arguments[r3]; + I2("warn", e3, n3); + } + function L2(e3) { + for (var t3 = arguments.length, n3 = new Array(t3 > 1 ? t3 - 1 : 0), r3 = 1; r3 < t3; r3++) + n3[r3 - 1] = arguments[r3]; + I2("error", e3, n3); + } + function I2(e3, t3, n3) { + var r3 = T2.ReactDebugCurrentFrame.getStackAddendum(); + "" !== r3 && (t3 += "%s", n3 = n3.concat([r3])); + var i3 = n3.map(function(e4) { + return String(e4); + }); + i3.unshift("Warning: " + t3), Function.prototype.apply.call(console[e3], console, i3); + } + T2.ReactDebugCurrentFrame = S2, T2.ReactCurrentActQueue = w2; + var O2 = {}; + function N2(e3, t3) { + var n3 = e3.constructor, r3 = n3 && (n3.displayName || n3.name) || "ReactClass", i3 = r3 + "." + t3; + O2[i3] || (L2("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", t3, r3), O2[i3] = true); + } + var D2 = { isMounted: function(e3) { + return false; + }, enqueueForceUpdate: function(e3, t3, n3) { + N2(e3, "forceUpdate"); + }, enqueueReplaceState: function(e3, t3, n3, r3) { + N2(e3, "replaceState"); + }, enqueueSetState: function(e3, t3, n3, r3) { + N2(e3, "setState"); + } }, j2 = Object.assign, B2 = {}; + function z2(e3, t3, n3) { + this.props = e3, this.context = t3, this.refs = B2, this.updater = n3 || D2; + } + Object.freeze(B2), z2.prototype.isReactComponent = {}, z2.prototype.setState = function(e3, t3) { + if ("object" != typeof e3 && "function" != typeof e3 && null != e3) + throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); + this.updater.enqueueSetState(this, e3, t3, "setState"); + }, z2.prototype.forceUpdate = function(e3) { + this.updater.enqueueForceUpdate(this, e3, "forceUpdate"); + }; + var U2 = { isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."], replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."] }, F2 = function(e3, t3) { + Object.defineProperty(z2.prototype, e3, { get: function() { + P2("%s(...) is deprecated in plain JavaScript React classes. %s", t3[0], t3[1]); + } }); + }; + for (var K2 in U2) + U2.hasOwnProperty(K2) && F2(K2, U2[K2]); + function q2() { + } + function H2(e3, t3, n3) { + this.props = e3, this.context = t3, this.refs = B2, this.updater = n3 || D2; + } + q2.prototype = z2.prototype; + var W2 = H2.prototype = new q2(); + W2.constructor = H2, j2(W2, z2.prototype), W2.isPureReactComponent = true; + var $2 = Array.isArray; + function V2(e3) { + return $2(e3); + } + function Y2(e3) { + return "" + e3; + } + function G2(e3) { + if (function(e4) { + try { + return Y2(e4), false; + } catch (e5) { + return true; + } + }(e3)) + return L2("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", function(e4) { + return "function" == typeof Symbol && Symbol.toStringTag && e4[Symbol.toStringTag] || e4.constructor.name || "Object"; + }(e3)), Y2(e3); + } + function Z2(e3) { + return e3.displayName || "Context"; + } + function Q2(e3) { + if (null == e3) + return null; + if ("number" == typeof e3.tag && L2("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), "function" == typeof e3) + return e3.displayName || e3.name || null; + if ("string" == typeof e3) + return e3; + switch (e3) { + case i2: + return "Fragment"; + case r2: + return "Portal"; + case a2: + return "Profiler"; + case o2: + return "StrictMode"; + case c2: + return "Suspense"; + case d2: + return "SuspenseList"; + } + if ("object" == typeof e3) + switch (e3.$$typeof) { + case u2: + return Z2(e3) + ".Consumer"; + case s2: + return Z2(e3._context) + ".Provider"; + case l2: + return function(e4, t4, n4) { + var r3 = e4.displayName; + if (r3) + return r3; + var i3 = t4.displayName || t4.name || ""; + return "" !== i3 ? n4 + "(" + i3 + ")" : n4; + }(e3, e3.render, "ForwardRef"); + case f2: + var t3 = e3.displayName || null; + return null !== t3 ? t3 : Q2(e3.type) || "Memo"; + case h2: + var n3 = e3, p3 = n3._payload, m3 = n3._init; + try { + return Q2(m3(p3)); + } catch (e4) { + return null; + } + } + return null; + } + var J2, X2, ee2, te2 = Object.prototype.hasOwnProperty, ne2 = { key: true, ref: true, __self: true, __source: true }; + function re2(e3) { + if (te2.call(e3, "ref")) { + var t3 = Object.getOwnPropertyDescriptor(e3, "ref").get; + if (t3 && t3.isReactWarning) + return false; + } + return void 0 !== e3.ref; + } + function ie2(e3) { + if (te2.call(e3, "key")) { + var t3 = Object.getOwnPropertyDescriptor(e3, "key").get; + if (t3 && t3.isReactWarning) + return false; + } + return void 0 !== e3.key; + } + ee2 = {}; + var oe2 = function(e3, t3, r3, i3, o3, a3, s3) { + var u3 = { $$typeof: n2, type: e3, key: t3, ref: r3, props: s3, _owner: a3, _store: {} }; + return Object.defineProperty(u3._store, "validated", { configurable: false, enumerable: false, writable: true, value: false }), Object.defineProperty(u3, "_self", { configurable: false, enumerable: false, writable: false, value: i3 }), Object.defineProperty(u3, "_source", { configurable: false, enumerable: false, writable: false, value: o3 }), Object.freeze && (Object.freeze(u3.props), Object.freeze(u3)), u3; + }; + function ae2(e3, t3, n3) { + var r3, i3 = {}, o3 = null, a3 = null, s3 = null, u3 = null; + if (null != t3) + for (r3 in re2(t3) && (a3 = t3.ref, function(e4) { + if ("string" == typeof e4.ref && _2.current && e4.__self && _2.current.stateNode !== e4.__self) { + var t4 = Q2(_2.current.type); + ee2[t4] || (L2('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', t4, e4.ref), ee2[t4] = true); + } + }(t3)), ie2(t3) && (G2(t3.key), o3 = "" + t3.key), s3 = void 0 === t3.__self ? null : t3.__self, u3 = void 0 === t3.__source ? null : t3.__source, t3) + te2.call(t3, r3) && !ne2.hasOwnProperty(r3) && (i3[r3] = t3[r3]); + var l3 = arguments.length - 2; + if (1 === l3) + i3.children = n3; + else if (l3 > 1) { + for (var c3 = Array(l3), d3 = 0; d3 < l3; d3++) + c3[d3] = arguments[d3 + 2]; + Object.freeze && Object.freeze(c3), i3.children = c3; + } + if (e3 && e3.defaultProps) { + var f3 = e3.defaultProps; + for (r3 in f3) + void 0 === i3[r3] && (i3[r3] = f3[r3]); + } + if (o3 || a3) { + var h3 = "function" == typeof e3 ? e3.displayName || e3.name || "Unknown" : e3; + o3 && function(e4, t4) { + var n4 = function() { + J2 || (J2 = true, L2("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t4)); + }; + n4.isReactWarning = true, Object.defineProperty(e4, "key", { get: n4, configurable: true }); + }(i3, h3), a3 && function(e4, t4) { + var n4 = function() { + X2 || (X2 = true, L2("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t4)); + }; + n4.isReactWarning = true, Object.defineProperty(e4, "ref", { get: n4, configurable: true }); + }(i3, h3); + } + return oe2(e3, o3, a3, s3, u3, _2.current, i3); + } + function se2(e3, t3, n3) { + if (null == e3) + throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + e3 + "."); + var r3, i3, o3 = j2({}, e3.props), a3 = e3.key, s3 = e3.ref, u3 = e3._self, l3 = e3._source, c3 = e3._owner; + if (null != t3) + for (r3 in re2(t3) && (s3 = t3.ref, c3 = _2.current), ie2(t3) && (G2(t3.key), a3 = "" + t3.key), e3.type && e3.type.defaultProps && (i3 = e3.type.defaultProps), t3) + te2.call(t3, r3) && !ne2.hasOwnProperty(r3) && (void 0 === t3[r3] && void 0 !== i3 ? o3[r3] = i3[r3] : o3[r3] = t3[r3]); + var d3 = arguments.length - 2; + if (1 === d3) + o3.children = n3; + else if (d3 > 1) { + for (var f3 = Array(d3), h3 = 0; h3 < d3; h3++) + f3[h3] = arguments[h3 + 2]; + o3.children = f3; + } + return oe2(e3.type, a3, s3, u3, l3, c3, o3); + } + function ue2(e3) { + return "object" == typeof e3 && null !== e3 && e3.$$typeof === n2; + } + var le2 = ".", ce2 = ":"; + var de2 = false, fe2 = /\/+/g; + function he2(e3) { + return e3.replace(fe2, "$&/"); + } + function pe2(e3, t3) { + return "object" == typeof e3 && null !== e3 && null != e3.key ? (G2(e3.key), function(e4) { + var t4 = { "=": "=0", ":": "=2" }; + return "$" + e4.replace(/[=:]/g, function(e5) { + return t4[e5]; + }); + }("" + e3.key)) : t3.toString(36); + } + function me2(e3, t3, i3, o3, a3) { + var s3 = typeof e3; + "undefined" !== s3 && "boolean" !== s3 || (e3 = null); + var u3, l3, c3, d3 = false; + if (null === e3) + d3 = true; + else + switch (s3) { + case "string": + case "number": + d3 = true; + break; + case "object": + switch (e3.$$typeof) { + case n2: + case r2: + d3 = true; + } + } + if (d3) { + var f3 = e3, h3 = a3(f3), p3 = "" === o3 ? le2 + pe2(f3, 0) : o3; + if (V2(h3)) { + var m3 = ""; + null != p3 && (m3 = he2(p3) + "/"), me2(h3, t3, m3, "", function(e4) { + return e4; + }); + } else + null != h3 && (ue2(h3) && (!h3.key || f3 && f3.key === h3.key || G2(h3.key), u3 = h3, l3 = i3 + (!h3.key || f3 && f3.key === h3.key ? "" : he2("" + h3.key) + "/") + p3, h3 = oe2(u3.type, l3, u3.ref, u3._self, u3._source, u3._owner, u3.props)), t3.push(h3)); + return 1; + } + var g3 = 0, b3 = "" === o3 ? le2 : o3 + ce2; + if (V2(e3)) + for (var y3 = 0; y3 < e3.length; y3++) + g3 += me2(c3 = e3[y3], t3, i3, b3 + pe2(c3, y3), a3); + else { + var w3 = v2(e3); + if ("function" == typeof w3) { + var _3 = e3; + w3 === _3.entries && (de2 || P2("Using Maps as children is not supported. Use an array of keyed ReactElements instead."), de2 = true); + for (var S3, E3 = w3.call(_3), k3 = 0; !(S3 = E3.next()).done; ) + g3 += me2(c3 = S3.value, t3, i3, b3 + pe2(c3, k3++), a3); + } else if ("object" === s3) { + var M3 = String(e3); + throw new Error("Objects are not valid as a React child (found: " + ("[object Object]" === M3 ? "object with keys {" + Object.keys(e3).join(", ") + "}" : M3) + "). If you meant to render a collection of children, use an array instead."); + } + } + return g3; + } + function ge2(e3, t3, n3) { + if (null == e3) + return e3; + var r3 = [], i3 = 0; + return me2(e3, r3, "", "", function(e4) { + return t3.call(n3, e4, i3++); + }), r3; + } + var ve2, be2 = -1, ye2 = 0, we2 = 1, _e2 = 2; + function Se2(e3) { + if (e3._status === be2) { + var t3 = (0, e3._result)(); + if (t3.then(function(t4) { + if (e3._status === ye2 || e3._status === be2) { + var n4 = e3; + n4._status = we2, n4._result = t4; + } + }, function(t4) { + if (e3._status === ye2 || e3._status === be2) { + var n4 = e3; + n4._status = _e2, n4._result = t4; + } + }), e3._status === be2) { + var n3 = e3; + n3._status = ye2, n3._result = t3; + } + } + if (e3._status === we2) { + var r3 = e3._result; + return void 0 === r3 && L2("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", r3), "default" in r3 || L2("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", r3), r3.default; + } + throw e3._result; + } + function Ee2(e3) { + return "string" == typeof e3 || "function" == typeof e3 || (!!(e3 === i2 || e3 === a2 || R2 || e3 === o2 || e3 === c2 || e3 === d2 || A2 || e3 === p2 || M2 || C2 || x2) || "object" == typeof e3 && null !== e3 && (e3.$$typeof === h2 || e3.$$typeof === f2 || e3.$$typeof === s2 || e3.$$typeof === u2 || e3.$$typeof === l2 || e3.$$typeof === ve2 || void 0 !== e3.getModuleId)); + } + function ke2() { + var e3 = b2.current; + return null === e3 && L2("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."), e3; + } + ve2 = Symbol.for("react.module.reference"); + var Me2, Ce2, xe2, Ae2, Re2, Te2, Pe2, Le2 = 0; + function Ie2() { + } + Ie2.__reactDisabledLog = true; + var Oe2, Ne2 = T2.ReactCurrentDispatcher; + function De2(e3, t3, n3) { + if (void 0 === Oe2) + try { + throw Error(); + } catch (e4) { + var r3 = e4.stack.trim().match(/\n( *(at )?)/); + Oe2 = r3 && r3[1] || ""; + } + return "\n" + Oe2 + e3; + } + var je2, Be2 = false, ze2 = "function" == typeof WeakMap ? WeakMap : Map; + function Ue2(e3, t3) { + if (!e3 || Be2) + return ""; + var n3, r3 = je2.get(e3); + if (void 0 !== r3) + return r3; + Be2 = true; + var i3, o3 = Error.prepareStackTrace; + Error.prepareStackTrace = void 0, i3 = Ne2.current, Ne2.current = null, function() { + if (0 === Le2) { + Me2 = console.log, Ce2 = console.info, xe2 = console.warn, Ae2 = console.error, Re2 = console.group, Te2 = console.groupCollapsed, Pe2 = console.groupEnd; + var e4 = { configurable: true, enumerable: true, value: Ie2, writable: true }; + Object.defineProperties(console, { info: e4, log: e4, warn: e4, error: e4, group: e4, groupCollapsed: e4, groupEnd: e4 }); + } + Le2++; + }(); + try { + if (t3) { + var a3 = function() { + throw Error(); + }; + if (Object.defineProperty(a3.prototype, "props", { set: function() { + throw Error(); + } }), "object" == typeof Reflect && Reflect.construct) { + try { + Reflect.construct(a3, []); + } catch (e4) { + n3 = e4; + } + Reflect.construct(e3, [], a3); + } else { + try { + a3.call(); + } catch (e4) { + n3 = e4; + } + e3.call(a3.prototype); + } + } else { + try { + throw Error(); + } catch (e4) { + n3 = e4; + } + e3(); + } + } catch (t4) { + if (t4 && n3 && "string" == typeof t4.stack) { + for (var s3 = t4.stack.split("\n"), u3 = n3.stack.split("\n"), l3 = s3.length - 1, c3 = u3.length - 1; l3 >= 1 && c3 >= 0 && s3[l3] !== u3[c3]; ) + c3--; + for (; l3 >= 1 && c3 >= 0; l3--, c3--) + if (s3[l3] !== u3[c3]) { + if (1 !== l3 || 1 !== c3) + do { + if (l3--, --c3 < 0 || s3[l3] !== u3[c3]) { + var d3 = "\n" + s3[l3].replace(" at new ", " at "); + return e3.displayName && d3.includes("") && (d3 = d3.replace("", e3.displayName)), "function" == typeof e3 && je2.set(e3, d3), d3; + } + } while (l3 >= 1 && c3 >= 0); + break; + } + } + } finally { + Be2 = false, Ne2.current = i3, function() { + if (0 == --Le2) { + var e4 = { configurable: true, enumerable: true, writable: true }; + Object.defineProperties(console, { log: j2({}, e4, { value: Me2 }), info: j2({}, e4, { value: Ce2 }), warn: j2({}, e4, { value: xe2 }), error: j2({}, e4, { value: Ae2 }), group: j2({}, e4, { value: Re2 }), groupCollapsed: j2({}, e4, { value: Te2 }), groupEnd: j2({}, e4, { value: Pe2 }) }); + } + Le2 < 0 && L2("disabledDepth fell below zero. This is a bug in React. Please file an issue."); + }(), Error.prepareStackTrace = o3; + } + var f3 = e3 ? e3.displayName || e3.name : "", h3 = f3 ? De2(f3) : ""; + return "function" == typeof e3 && je2.set(e3, h3), h3; + } + function Fe2(e3, t3, n3) { + if (null == e3) + return ""; + if ("function" == typeof e3) + return Ue2(e3, function(e4) { + var t4 = e4.prototype; + return !(!t4 || !t4.isReactComponent); + }(e3)); + if ("string" == typeof e3) + return De2(e3); + switch (e3) { + case c2: + return De2("Suspense"); + case d2: + return De2("SuspenseList"); + } + if ("object" == typeof e3) + switch (e3.$$typeof) { + case l2: + return Ue2(e3.render, false); + case f2: + return Fe2(e3.type, t3, n3); + case h2: + var r3 = e3, i3 = r3._payload, o3 = r3._init; + try { + return Fe2(o3(i3), t3, n3); + } catch (e4) { + } + } + return ""; + } + je2 = new ze2(); + var Ke2, qe2 = {}, He2 = T2.ReactDebugCurrentFrame; + function We2(e3) { + if (e3) { + var t3 = e3._owner, n3 = Fe2(e3.type, e3._source, t3 ? t3.type : null); + He2.setExtraStackFrame(n3); + } else + He2.setExtraStackFrame(null); + } + function $e2(e3) { + if (e3) { + var t3 = e3._owner; + k2(Fe2(e3.type, e3._source, t3 ? t3.type : null)); + } else + k2(null); + } + function Ve2() { + if (_2.current) { + var e3 = Q2(_2.current.type); + if (e3) + return "\n\nCheck the render method of `" + e3 + "`."; + } + return ""; + } + Ke2 = false; + var Ye2 = {}; + function Ge2(e3, t3) { + if (e3._store && !e3._store.validated && null == e3.key) { + e3._store.validated = true; + var n3 = function(e4) { + var t4 = Ve2(); + if (!t4) { + var n4 = "string" == typeof e4 ? e4 : e4.displayName || e4.name; + n4 && (t4 = "\n\nCheck the top-level render call using <" + n4 + ">."); + } + return t4; + }(t3); + if (!Ye2[n3]) { + Ye2[n3] = true; + var r3 = ""; + e3 && e3._owner && e3._owner !== _2.current && (r3 = " It was passed a child from " + Q2(e3._owner.type) + "."), $e2(e3), L2('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n3, r3), $e2(null); + } + } + } + function Ze2(e3, t3) { + if ("object" == typeof e3) { + if (V2(e3)) + for (var n3 = 0; n3 < e3.length; n3++) { + var r3 = e3[n3]; + ue2(r3) && Ge2(r3, t3); + } + else if (ue2(e3)) + e3._store && (e3._store.validated = true); + else if (e3) { + var i3 = v2(e3); + if ("function" == typeof i3 && i3 !== e3.entries) + for (var o3, a3 = i3.call(e3); !(o3 = a3.next()).done; ) + ue2(o3.value) && Ge2(o3.value, t3); + } + } + } + function Qe2(e3) { + var t3, n3 = e3.type; + if (null != n3 && "string" != typeof n3) { + if ("function" == typeof n3) + t3 = n3.propTypes; + else { + if ("object" != typeof n3 || n3.$$typeof !== l2 && n3.$$typeof !== f2) + return; + t3 = n3.propTypes; + } + if (t3) { + var r3 = Q2(n3); + !function(e4, t4, n4, r4, i3) { + var o3 = Function.call.bind(te2); + for (var a3 in e4) + if (o3(e4, a3)) { + var s3 = void 0; + try { + if ("function" != typeof e4[a3]) { + var u3 = Error((r4 || "React class") + ": " + n4 + " type `" + a3 + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e4[a3] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); + throw u3.name = "Invariant Violation", u3; + } + s3 = e4[a3](t4, a3, r4, n4, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); + } catch (e5) { + s3 = e5; + } + !s3 || s3 instanceof Error || (We2(i3), L2("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", r4 || "React class", n4, a3, typeof s3), We2(null)), s3 instanceof Error && !(s3.message in qe2) && (qe2[s3.message] = true, We2(i3), L2("Failed %s type: %s", n4, s3.message), We2(null)); + } + }(t3, e3.props, "prop", r3, e3); + } else if (void 0 !== n3.PropTypes && !Ke2) { + Ke2 = true, L2("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Q2(n3) || "Unknown"); + } + "function" != typeof n3.getDefaultProps || n3.getDefaultProps.isReactClassApproved || L2("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); + } + } + function Je2(e3, t3, r3) { + var o3, a3, s3 = Ee2(e3); + if (!s3) { + var u3 = ""; + (void 0 === e3 || "object" == typeof e3 && null !== e3 && 0 === Object.keys(e3).length) && (u3 += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); + var l3, c3 = null != (o3 = t3) && void 0 !== (a3 = o3.__source) ? "\n\nCheck your code at " + a3.fileName.replace(/^.*[\\\/]/, "") + ":" + a3.lineNumber + "." : ""; + u3 += c3 || Ve2(), null === e3 ? l3 = "null" : V2(e3) ? l3 = "array" : void 0 !== e3 && e3.$$typeof === n2 ? (l3 = "<" + (Q2(e3.type) || "Unknown") + " />", u3 = " Did you accidentally export a JSX literal instead of a component?") : l3 = typeof e3, L2("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l3, u3); + } + var d3 = ae2.apply(this, arguments); + if (null == d3) + return d3; + if (s3) + for (var f3 = 2; f3 < arguments.length; f3++) + Ze2(arguments[f3], e3); + return e3 === i2 ? function(e4) { + for (var t4 = Object.keys(e4.props), n3 = 0; n3 < t4.length; n3++) { + var r4 = t4[n3]; + if ("children" !== r4 && "key" !== r4) { + $e2(e4), L2("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", r4), $e2(null); + break; + } + } + null !== e4.ref && ($e2(e4), L2("Invalid attribute `ref` supplied to `React.Fragment`."), $e2(null)); + }(d3) : Qe2(d3), d3; + } + var Xe2 = false; + var et2 = false, tt2 = null; + var nt2 = 0, rt2 = false; + function it2(e3) { + e3 !== nt2 - 1 && L2("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "), nt2 = e3; + } + function ot2(t3, n3, r3) { + var i3 = w2.current; + if (null !== i3) + try { + st2(i3), function(t4) { + if (null === tt2) + try { + var n4 = ("require" + Math.random()).slice(0, 7), r4 = e2 && e2[n4]; + tt2 = r4.call(e2, "timers").setImmediate; + } catch (e3) { + tt2 = function(e4) { + false === et2 && (et2 = true, "undefined" == typeof MessageChannel && L2("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.")); + var t5 = new MessageChannel(); + t5.port1.onmessage = e4, t5.port2.postMessage(void 0); + }; + } + tt2(t4); + }(function() { + 0 === i3.length ? (w2.current = null, n3(t3)) : ot2(t3, n3, r3); + }); + } catch (e3) { + r3(e3); + } + else + n3(t3); + } + var at2 = false; + function st2(e3) { + if (!at2) { + at2 = true; + var t3 = 0; + try { + for (; t3 < e3.length; t3++) { + var n3 = e3[t3]; + do { + n3 = n3(true); + } while (null !== n3); + } + e3.length = 0; + } catch (n4) { + throw e3 = e3.slice(t3 + 1), n4; + } finally { + at2 = false; + } + } + } + var ut2 = Je2, lt2 = function(e3, t3, n3) { + for (var r3 = se2.apply(this, arguments), i3 = 2; i3 < arguments.length; i3++) + Ze2(arguments[i3], r3.type); + return Qe2(r3), r3; + }, ct2 = function(e3) { + var t3 = Je2.bind(null, e3); + return t3.type = e3, Xe2 || (Xe2 = true, P2("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")), Object.defineProperty(t3, "type", { enumerable: false, get: function() { + return P2("Factory.type is deprecated. Access the class directly before passing it to createFactory."), Object.defineProperty(this, "type", { value: e3 }), e3; + } }), t3; + }, dt2 = { map: ge2, forEach: function(e3, t3, n3) { + ge2(e3, function() { + t3.apply(this, arguments); + }, n3); + }, count: function(e3) { + var t3 = 0; + return ge2(e3, function() { + t3++; + }), t3; + }, toArray: function(e3) { + return ge2(e3, function(e4) { + return e4; + }) || []; + }, only: function(e3) { + if (!ue2(e3)) + throw new Error("React.Children.only expected to receive a single React element child."); + return e3; + } }; + t2.Children = dt2, t2.Component = z2, t2.Fragment = i2, t2.Profiler = a2, t2.PureComponent = H2, t2.StrictMode = o2, t2.Suspense = c2, t2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = T2, t2.cloneElement = lt2, t2.createContext = function(e3) { + var t3 = { $$typeof: u2, _currentValue: e3, _currentValue2: e3, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }; + t3.Provider = { $$typeof: s2, _context: t3 }; + var n3 = false, r3 = false, i3 = false, o3 = { $$typeof: u2, _context: t3 }; + return Object.defineProperties(o3, { Provider: { get: function() { + return r3 || (r3 = true, L2("Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")), t3.Provider; + }, set: function(e4) { + t3.Provider = e4; + } }, _currentValue: { get: function() { + return t3._currentValue; + }, set: function(e4) { + t3._currentValue = e4; + } }, _currentValue2: { get: function() { + return t3._currentValue2; + }, set: function(e4) { + t3._currentValue2 = e4; + } }, _threadCount: { get: function() { + return t3._threadCount; + }, set: function(e4) { + t3._threadCount = e4; + } }, Consumer: { get: function() { + return n3 || (n3 = true, L2("Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")), t3.Consumer; + } }, displayName: { get: function() { + return t3.displayName; + }, set: function(e4) { + i3 || (P2("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", e4), i3 = true); + } } }), t3.Consumer = o3, t3._currentRenderer = null, t3._currentRenderer2 = null, t3; + }, t2.createElement = ut2, t2.createFactory = ct2, t2.createRef = function() { + var e3 = { current: null }; + return Object.seal(e3), e3; + }, t2.forwardRef = function(e3) { + null != e3 && e3.$$typeof === f2 ? L2("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).") : "function" != typeof e3 ? L2("forwardRef requires a render function but was given %s.", null === e3 ? "null" : typeof e3) : 0 !== e3.length && 2 !== e3.length && L2("forwardRef render functions accept exactly two parameters: props and ref. %s", 1 === e3.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."), null != e3 && (null == e3.defaultProps && null == e3.propTypes || L2("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?")); + var t3, n3 = { $$typeof: l2, render: e3 }; + return Object.defineProperty(n3, "displayName", { enumerable: false, configurable: true, get: function() { + return t3; + }, set: function(n4) { + t3 = n4, e3.name || e3.displayName || (e3.displayName = n4); + } }), n3; + }, t2.isValidElement = ue2, t2.lazy = function(e3) { + var t3, n3, r3 = { $$typeof: h2, _payload: { _status: be2, _result: e3 }, _init: Se2 }; + return Object.defineProperties(r3, { defaultProps: { configurable: true, get: function() { + return t3; + }, set: function(e4) { + L2("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."), t3 = e4, Object.defineProperty(r3, "defaultProps", { enumerable: true }); + } }, propTypes: { configurable: true, get: function() { + return n3; + }, set: function(e4) { + L2("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."), n3 = e4, Object.defineProperty(r3, "propTypes", { enumerable: true }); + } } }), r3; + }, t2.memo = function(e3, t3) { + Ee2(e3) || L2("memo: The first argument must be a component. Instead received: %s", null === e3 ? "null" : typeof e3); + var n3, r3 = { $$typeof: f2, type: e3, compare: void 0 === t3 ? null : t3 }; + return Object.defineProperty(r3, "displayName", { enumerable: false, configurable: true, get: function() { + return n3; + }, set: function(t4) { + n3 = t4, e3.name || e3.displayName || (e3.displayName = t4); + } }), r3; + }, t2.startTransition = function(e3, t3) { + var n3 = y2.transition; + y2.transition = {}; + var r3 = y2.transition; + y2.transition._updatedFibers = /* @__PURE__ */ new Set(); + try { + e3(); + } finally { + if (y2.transition = n3, null === n3 && r3._updatedFibers) + r3._updatedFibers.size > 10 && P2("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."), r3._updatedFibers.clear(); + } + }, t2.unstable_act = function(e3) { + var t3 = nt2; + nt2++, null === w2.current && (w2.current = []); + var n3, r3 = w2.isBatchingLegacy; + try { + if (w2.isBatchingLegacy = true, n3 = e3(), !r3 && w2.didScheduleLegacyUpdate) { + var i3 = w2.current; + null !== i3 && (w2.didScheduleLegacyUpdate = false, st2(i3)); + } + } catch (e4) { + throw it2(t3), e4; + } finally { + w2.isBatchingLegacy = r3; + } + if (null !== n3 && "object" == typeof n3 && "function" == typeof n3.then) { + var o3 = n3, a3 = false, s3 = { then: function(e4, n4) { + a3 = true, o3.then(function(r4) { + it2(t3), 0 === nt2 ? ot2(r4, e4, n4) : e4(r4); + }, function(e5) { + it2(t3), n4(e5); + }); + } }; + return rt2 || "undefined" == typeof Promise || Promise.resolve().then(function() { + }).then(function() { + a3 || (rt2 = true, L2("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);")); + }), s3; + } + var u3 = n3; + if (it2(t3), 0 === nt2) { + var l3 = w2.current; + return null !== l3 && (st2(l3), w2.current = null), { then: function(e4, t4) { + null === w2.current ? (w2.current = [], ot2(u3, e4, t4)) : e4(u3); + } }; + } + return { then: function(e4, t4) { + e4(u3); + } }; + }, t2.useCallback = function(e3, t3) { + return ke2().useCallback(e3, t3); + }, t2.useContext = function(e3) { + var t3 = ke2(); + if (void 0 !== e3._context) { + var n3 = e3._context; + n3.Consumer === e3 ? L2("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?") : n3.Provider === e3 && L2("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?"); + } + return t3.useContext(e3); + }, t2.useDebugValue = function(e3, t3) { + return ke2().useDebugValue(e3, t3); + }, t2.useDeferredValue = function(e3) { + return ke2().useDeferredValue(e3); + }, t2.useEffect = function(e3, t3) { + return ke2().useEffect(e3, t3); + }, t2.useId = function() { + return ke2().useId(); + }, t2.useImperativeHandle = function(e3, t3, n3) { + return ke2().useImperativeHandle(e3, t3, n3); + }, t2.useInsertionEffect = function(e3, t3) { + return ke2().useInsertionEffect(e3, t3); + }, t2.useLayoutEffect = function(e3, t3) { + return ke2().useLayoutEffect(e3, t3); + }, t2.useMemo = function(e3, t3) { + return ke2().useMemo(e3, t3); + }, t2.useReducer = function(e3, t3, n3) { + return ke2().useReducer(e3, t3, n3); + }, t2.useRef = function(e3) { + return ke2().useRef(e3); + }, t2.useState = function(e3) { + return ke2().useState(e3); + }, t2.useSyncExternalStore = function(e3, t3, n3) { + return ke2().useSyncExternalStore(e3, t3, n3); + }, t2.useTransition = function() { + return ke2().useTransition(); + }, t2.version = "18.2.0", "undefined" != typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); + }(); + }(PT, PT.exports)), PT.exports; + } + function IT() { + return TT || (TT = 1, "production" === je.env.NODE_ENV ? CT.exports = AT() : CT.exports = LT()), CT.exports; + } + PT.exports; + var OT, NT = {}, DT = { exports: {} }, jT = {}, BT = { exports: {} }, zT = {}; + var UT, FT, KT, qT = {}; + function HT() { + return UT || (UT = 1, function(e2) { + "production" !== je.env.NODE_ENV && function() { + "undefined" != typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); + var t2 = false, n2 = false; + function r2(e3, t3) { + var n3 = e3.length; + e3.push(t3), function(e4, t4, n4) { + var r3 = n4; + for (; r3 > 0; ) { + var i3 = r3 - 1 >>> 1, o3 = e4[i3]; + if (!(a2(o3, t4) > 0)) + return; + e4[i3] = t4, e4[r3] = o3, r3 = i3; + } + }(e3, t3, n3); + } + function i2(e3) { + return 0 === e3.length ? null : e3[0]; + } + function o2(e3) { + if (0 === e3.length) + return null; + var t3 = e3[0], n3 = e3.pop(); + return n3 !== t3 && (e3[0] = n3, function(e4, t4, n4) { + var r3 = n4, i3 = e4.length, o3 = i3 >>> 1; + for (; r3 < o3; ) { + var s3 = 2 * (r3 + 1) - 1, u3 = e4[s3], l3 = s3 + 1, c3 = e4[l3]; + if (a2(u3, t4) < 0) + l3 < i3 && a2(c3, u3) < 0 ? (e4[r3] = c3, e4[l3] = t4, r3 = l3) : (e4[r3] = u3, e4[s3] = t4, r3 = s3); + else { + if (!(l3 < i3 && a2(c3, t4) < 0)) + return; + e4[r3] = c3, e4[l3] = t4, r3 = l3; + } + } + }(e3, n3, 0)), t3; + } + function a2(e3, t3) { + var n3 = e3.sortIndex - t3.sortIndex; + return 0 !== n3 ? n3 : e3.id - t3.id; + } + if ("object" == typeof performance && "function" == typeof performance.now) { + var s2 = performance; + e2.unstable_now = function() { + return s2.now(); + }; + } else { + var u2 = Date, l2 = u2.now(); + e2.unstable_now = function() { + return u2.now() - l2; + }; + } + var c2 = [], d2 = [], f2 = 1, h2 = null, p2 = 3, m2 = false, g2 = false, v2 = false, b2 = "function" == typeof setTimeout ? setTimeout : null, y2 = "function" == typeof clearTimeout ? clearTimeout : null, w2 = "undefined" != typeof setImmediate ? setImmediate : null; + function _2(e3) { + for (var t3 = i2(d2); null !== t3; ) { + if (null === t3.callback) + o2(d2); + else { + if (!(t3.startTime <= e3)) + return; + o2(d2), t3.sortIndex = t3.expirationTime, r2(c2, t3); + } + t3 = i2(d2); + } + } + function S2(e3) { + if (v2 = false, _2(e3), !g2) + if (null !== i2(c2)) + g2 = true, O2(E2); + else { + var t3 = i2(d2); + null !== t3 && N2(S2, t3.startTime - e3); + } + } + function E2(r3, a3) { + g2 = false, v2 && (v2 = false, D2()), m2 = true; + var s3 = p2; + try { + if (!n2) + return function(n3, r4) { + var a4 = r4; + _2(a4), h2 = i2(c2); + for (; null !== h2 && !t2 && (!(h2.expirationTime > a4) || n3 && !R2()); ) { + var s4 = h2.callback; + if ("function" == typeof s4) { + h2.callback = null, p2 = h2.priorityLevel; + var u3 = s4(h2.expirationTime <= a4); + a4 = e2.unstable_now(), "function" == typeof u3 ? h2.callback = u3 : h2 === i2(c2) && o2(c2), _2(a4); + } else + o2(c2); + h2 = i2(c2); + } + if (null !== h2) + return true; + var l3 = i2(d2); + return null !== l3 && N2(S2, l3.startTime - a4), false; + }(r3, a3); + } finally { + h2 = null, p2 = s3, m2 = false; + } + } + "undefined" != typeof navigator && void 0 !== navigator.scheduling && void 0 !== navigator.scheduling.isInputPending && navigator.scheduling.isInputPending.bind(navigator.scheduling); + var k2 = false, M2 = null, C2 = -1, x2 = 5, A2 = -1; + function R2() { + return !(e2.unstable_now() - A2 < x2); + } + var T2, P2 = function() { + if (null !== M2) { + var t3 = e2.unstable_now(); + A2 = t3; + var n3 = true; + try { + n3 = M2(true, t3); + } finally { + n3 ? T2() : (k2 = false, M2 = null); + } + } else + k2 = false; + }; + if ("function" == typeof w2) + T2 = function() { + w2(P2); + }; + else if ("undefined" != typeof MessageChannel) { + var L2 = new MessageChannel(), I2 = L2.port2; + L2.port1.onmessage = P2, T2 = function() { + I2.postMessage(null); + }; + } else + T2 = function() { + b2(P2, 0); + }; + function O2(e3) { + M2 = e3, k2 || (k2 = true, T2()); + } + function N2(t3, n3) { + C2 = b2(function() { + t3(e2.unstable_now()); + }, n3); + } + function D2() { + y2(C2), C2 = -1; + } + var j2 = function() { + }; + e2.unstable_IdlePriority = 5, e2.unstable_ImmediatePriority = 1, e2.unstable_LowPriority = 4, e2.unstable_NormalPriority = 3, e2.unstable_Profiling = null, e2.unstable_UserBlockingPriority = 2, e2.unstable_cancelCallback = function(e3) { + e3.callback = null; + }, e2.unstable_continueExecution = function() { + g2 || m2 || (g2 = true, O2(E2)); + }, e2.unstable_forceFrameRate = function(e3) { + e3 < 0 || e3 > 125 ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : x2 = e3 > 0 ? Math.floor(1e3 / e3) : 5; + }, e2.unstable_getCurrentPriorityLevel = function() { + return p2; + }, e2.unstable_getFirstCallbackNode = function() { + return i2(c2); + }, e2.unstable_next = function(e3) { + var t3; + switch (p2) { + case 1: + case 2: + case 3: + t3 = 3; + break; + default: + t3 = p2; + } + var n3 = p2; + p2 = t3; + try { + return e3(); + } finally { + p2 = n3; + } + }, e2.unstable_pauseExecution = function() { + }, e2.unstable_requestPaint = j2, e2.unstable_runWithPriority = function(e3, t3) { + switch (e3) { + case 1: + case 2: + case 3: + case 4: + case 5: + break; + default: + e3 = 3; + } + var n3 = p2; + p2 = e3; + try { + return t3(); + } finally { + p2 = n3; + } + }, e2.unstable_scheduleCallback = function(t3, n3, o3) { + var a3, s3, u3 = e2.unstable_now(); + if ("object" == typeof o3 && null !== o3) { + var l3 = o3.delay; + a3 = "number" == typeof l3 && l3 > 0 ? u3 + l3 : u3; + } else + a3 = u3; + switch (t3) { + case 1: + s3 = -1; + break; + case 2: + s3 = 250; + break; + case 5: + s3 = 1073741823; + break; + case 4: + s3 = 1e4; + break; + default: + s3 = 5e3; + } + var h3 = a3 + s3, p3 = { id: f2++, callback: n3, priorityLevel: t3, startTime: a3, expirationTime: h3, sortIndex: -1 }; + return a3 > u3 ? (p3.sortIndex = a3, r2(d2, p3), null === i2(c2) && p3 === i2(d2) && (v2 ? D2() : v2 = true, N2(S2, a3 - u3))) : (p3.sortIndex = h3, r2(c2, p3), g2 || m2 || (g2 = true, O2(E2))), p3; + }, e2.unstable_shouldYield = R2, e2.unstable_wrapCallback = function(e3) { + var t3 = p2; + return function() { + var n3 = p2; + p2 = t3; + try { + return e3.apply(this, arguments); + } finally { + p2 = n3; + } + }; + }, "undefined" != typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); + }(); + }(qT)), qT; + } + function WT() { + return FT || (FT = 1, "production" === je.env.NODE_ENV ? BT.exports = (OT || (OT = 1, function(e2) { + function t2(e3, t3) { + var n3 = e3.length; + e3.push(t3); + e: + for (; 0 < n3; ) { + var r3 = n3 - 1 >>> 1, o3 = e3[r3]; + if (!(0 < i2(o3, t3))) + break e; + e3[r3] = t3, e3[n3] = o3, n3 = r3; + } + } + function n2(e3) { + return 0 === e3.length ? null : e3[0]; + } + function r2(e3) { + if (0 === e3.length) + return null; + var t3 = e3[0], n3 = e3.pop(); + if (n3 !== t3) { + e3[0] = n3; + e: + for (var r3 = 0, o3 = e3.length, a3 = o3 >>> 1; r3 < a3; ) { + var s3 = 2 * (r3 + 1) - 1, u3 = e3[s3], l3 = s3 + 1, c3 = e3[l3]; + if (0 > i2(u3, n3)) + l3 < o3 && 0 > i2(c3, u3) ? (e3[r3] = c3, e3[l3] = n3, r3 = l3) : (e3[r3] = u3, e3[s3] = n3, r3 = s3); + else { + if (!(l3 < o3 && 0 > i2(c3, n3))) + break e; + e3[r3] = c3, e3[l3] = n3, r3 = l3; + } + } + } + return t3; + } + function i2(e3, t3) { + var n3 = e3.sortIndex - t3.sortIndex; + return 0 !== n3 ? n3 : e3.id - t3.id; + } + if ("object" == typeof performance && "function" == typeof performance.now) { + var o2 = performance; + e2.unstable_now = function() { + return o2.now(); + }; + } else { + var a2 = Date, s2 = a2.now(); + e2.unstable_now = function() { + return a2.now() - s2; + }; + } + var u2 = [], l2 = [], c2 = 1, d2 = null, f2 = 3, h2 = false, p2 = false, m2 = false, g2 = "function" == typeof setTimeout ? setTimeout : null, v2 = "function" == typeof clearTimeout ? clearTimeout : null, b2 = "undefined" != typeof setImmediate ? setImmediate : null; + function y2(e3) { + for (var i3 = n2(l2); null !== i3; ) { + if (null === i3.callback) + r2(l2); + else { + if (!(i3.startTime <= e3)) + break; + r2(l2), i3.sortIndex = i3.expirationTime, t2(u2, i3); + } + i3 = n2(l2); + } + } + function w2(e3) { + if (m2 = false, y2(e3), !p2) + if (null !== n2(u2)) + p2 = true, L2(_2); + else { + var t3 = n2(l2); + null !== t3 && I2(w2, t3.startTime - e3); + } + } + function _2(t3, i3) { + p2 = false, m2 && (m2 = false, v2(M2), M2 = -1), h2 = true; + var o3 = f2; + try { + for (y2(i3), d2 = n2(u2); null !== d2 && (!(d2.expirationTime > i3) || t3 && !A2()); ) { + var a3 = d2.callback; + if ("function" == typeof a3) { + d2.callback = null, f2 = d2.priorityLevel; + var s3 = a3(d2.expirationTime <= i3); + i3 = e2.unstable_now(), "function" == typeof s3 ? d2.callback = s3 : d2 === n2(u2) && r2(u2), y2(i3); + } else + r2(u2); + d2 = n2(u2); + } + if (null !== d2) + var c3 = true; + else { + var g3 = n2(l2); + null !== g3 && I2(w2, g3.startTime - i3), c3 = false; + } + return c3; + } finally { + d2 = null, f2 = o3, h2 = false; + } + } + "undefined" != typeof navigator && void 0 !== navigator.scheduling && void 0 !== navigator.scheduling.isInputPending && navigator.scheduling.isInputPending.bind(navigator.scheduling); + var S2, E2 = false, k2 = null, M2 = -1, C2 = 5, x2 = -1; + function A2() { + return !(e2.unstable_now() - x2 < C2); + } + function R2() { + if (null !== k2) { + var t3 = e2.unstable_now(); + x2 = t3; + var n3 = true; + try { + n3 = k2(true, t3); + } finally { + n3 ? S2() : (E2 = false, k2 = null); + } + } else + E2 = false; + } + if ("function" == typeof b2) + S2 = function() { + b2(R2); + }; + else if ("undefined" != typeof MessageChannel) { + var T2 = new MessageChannel(), P2 = T2.port2; + T2.port1.onmessage = R2, S2 = function() { + P2.postMessage(null); + }; + } else + S2 = function() { + g2(R2, 0); + }; + function L2(e3) { + k2 = e3, E2 || (E2 = true, S2()); + } + function I2(t3, n3) { + M2 = g2(function() { + t3(e2.unstable_now()); + }, n3); + } + e2.unstable_IdlePriority = 5, e2.unstable_ImmediatePriority = 1, e2.unstable_LowPriority = 4, e2.unstable_NormalPriority = 3, e2.unstable_Profiling = null, e2.unstable_UserBlockingPriority = 2, e2.unstable_cancelCallback = function(e3) { + e3.callback = null; + }, e2.unstable_continueExecution = function() { + p2 || h2 || (p2 = true, L2(_2)); + }, e2.unstable_forceFrameRate = function(e3) { + 0 > e3 || 125 < e3 ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : C2 = 0 < e3 ? Math.floor(1e3 / e3) : 5; + }, e2.unstable_getCurrentPriorityLevel = function() { + return f2; + }, e2.unstable_getFirstCallbackNode = function() { + return n2(u2); + }, e2.unstable_next = function(e3) { + switch (f2) { + case 1: + case 2: + case 3: + var t3 = 3; + break; + default: + t3 = f2; + } + var n3 = f2; + f2 = t3; + try { + return e3(); + } finally { + f2 = n3; + } + }, e2.unstable_pauseExecution = function() { + }, e2.unstable_requestPaint = function() { + }, e2.unstable_runWithPriority = function(e3, t3) { + switch (e3) { + case 1: + case 2: + case 3: + case 4: + case 5: + break; + default: + e3 = 3; + } + var n3 = f2; + f2 = e3; + try { + return t3(); + } finally { + f2 = n3; + } + }, e2.unstable_scheduleCallback = function(r3, i3, o3) { + var a3 = e2.unstable_now(); + switch (o3 = "object" == typeof o3 && null !== o3 && "number" == typeof (o3 = o3.delay) && 0 < o3 ? a3 + o3 : a3, r3) { + case 1: + var s3 = -1; + break; + case 2: + s3 = 250; + break; + case 5: + s3 = 1073741823; + break; + case 4: + s3 = 1e4; + break; + default: + s3 = 5e3; + } + return r3 = { id: c2++, callback: i3, priorityLevel: r3, startTime: o3, expirationTime: s3 = o3 + s3, sortIndex: -1 }, o3 > a3 ? (r3.sortIndex = o3, t2(l2, r3), null === n2(u2) && r3 === n2(l2) && (m2 ? (v2(M2), M2 = -1) : m2 = true, I2(w2, o3 - a3))) : (r3.sortIndex = s3, t2(u2, r3), p2 || h2 || (p2 = true, L2(_2))), r3; + }, e2.unstable_shouldYield = A2, e2.unstable_wrapCallback = function(e3) { + var t3 = f2; + return function() { + var n3 = f2; + f2 = t3; + try { + return e3.apply(this, arguments); + } finally { + f2 = n3; + } + }; + }; + }(zT)), zT) : BT.exports = HT()), BT.exports; + } + /** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + function $T() { + if (KT) + return jT; + KT = 1; + var e2 = IT(), t2 = WT(); + function n2(e3) { + for (var t3 = "https://reactjs.org/docs/error-decoder.html?invariant=" + e3, n3 = 1; n3 < arguments.length; n3++) + t3 += "&args[]=" + encodeURIComponent(arguments[n3]); + return "Minified React error #" + e3 + "; visit " + t3 + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; + } + var r2 = /* @__PURE__ */ new Set(), i2 = {}; + function o2(e3, t3) { + a2(e3, t3), a2(e3 + "Capture", t3); + } + function a2(e3, t3) { + for (i2[e3] = t3, e3 = 0; e3 < t3.length; e3++) + r2.add(t3[e3]); + } + var s2 = !("undefined" == typeof window || void 0 === window.document || void 0 === window.document.createElement), u2 = Object.prototype.hasOwnProperty, l2 = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, c2 = {}, d2 = {}; + function f2(e3, t3, n3, r3, i3, o3, a3) { + this.acceptsBooleans = 2 === t3 || 3 === t3 || 4 === t3, this.attributeName = r3, this.attributeNamespace = i3, this.mustUseProperty = n3, this.propertyName = e3, this.type = t3, this.sanitizeURL = o3, this.removeEmptyString = a3; + } + var h2 = {}; + "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e3) { + h2[e3] = new f2(e3, 0, false, e3, null, false, false); + }), [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(e3) { + var t3 = e3[0]; + h2[t3] = new f2(t3, 1, false, e3[1], null, false, false); + }), ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(e3) { + h2[e3] = new f2(e3, 2, false, e3.toLowerCase(), null, false, false); + }), ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(e3) { + h2[e3] = new f2(e3, 2, false, e3, null, false, false); + }), "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e3) { + h2[e3] = new f2(e3, 3, false, e3.toLowerCase(), null, false, false); + }), ["checked", "multiple", "muted", "selected"].forEach(function(e3) { + h2[e3] = new f2(e3, 3, true, e3, null, false, false); + }), ["capture", "download"].forEach(function(e3) { + h2[e3] = new f2(e3, 4, false, e3, null, false, false); + }), ["cols", "rows", "size", "span"].forEach(function(e3) { + h2[e3] = new f2(e3, 6, false, e3, null, false, false); + }), ["rowSpan", "start"].forEach(function(e3) { + h2[e3] = new f2(e3, 5, false, e3.toLowerCase(), null, false, false); + }); + var p2 = /[\-:]([a-z])/g; + function m2(e3) { + return e3[1].toUpperCase(); + } + function g2(e3, t3, n3, r3) { + var i3 = h2.hasOwnProperty(t3) ? h2[t3] : null; + (null !== i3 ? 0 !== i3.type : r3 || !(2 < t3.length) || "o" !== t3[0] && "O" !== t3[0] || "n" !== t3[1] && "N" !== t3[1]) && (function(e4, t4, n4, r4) { + if (null == t4 || function(e5, t5, n5, r5) { + if (null !== n5 && 0 === n5.type) + return false; + switch (typeof t5) { + case "function": + case "symbol": + return true; + case "boolean": + return !r5 && (null !== n5 ? !n5.acceptsBooleans : "data-" !== (e5 = e5.toLowerCase().slice(0, 5)) && "aria-" !== e5); + default: + return false; + } + }(e4, t4, n4, r4)) + return true; + if (r4) + return false; + if (null !== n4) + switch (n4.type) { + case 3: + return !t4; + case 4: + return false === t4; + case 5: + return isNaN(t4); + case 6: + return isNaN(t4) || 1 > t4; + } + return false; + }(t3, n3, i3, r3) && (n3 = null), r3 || null === i3 ? function(e4) { + return !!u2.call(d2, e4) || !u2.call(c2, e4) && (l2.test(e4) ? d2[e4] = true : (c2[e4] = true, false)); + }(t3) && (null === n3 ? e3.removeAttribute(t3) : e3.setAttribute(t3, "" + n3)) : i3.mustUseProperty ? e3[i3.propertyName] = null === n3 ? 3 !== i3.type && "" : n3 : (t3 = i3.attributeName, r3 = i3.attributeNamespace, null === n3 ? e3.removeAttribute(t3) : (n3 = 3 === (i3 = i3.type) || 4 === i3 && true === n3 ? "" : "" + n3, r3 ? e3.setAttributeNS(r3, t3, n3) : e3.setAttribute(t3, n3)))); + } + "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e3) { + var t3 = e3.replace(p2, m2); + h2[t3] = new f2(t3, 1, false, e3, null, false, false); + }), "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e3) { + var t3 = e3.replace(p2, m2); + h2[t3] = new f2(t3, 1, false, e3, "http://www.w3.org/1999/xlink", false, false); + }), ["xml:base", "xml:lang", "xml:space"].forEach(function(e3) { + var t3 = e3.replace(p2, m2); + h2[t3] = new f2(t3, 1, false, e3, "http://www.w3.org/XML/1998/namespace", false, false); + }), ["tabIndex", "crossOrigin"].forEach(function(e3) { + h2[e3] = new f2(e3, 1, false, e3.toLowerCase(), null, false, false); + }), h2.xlinkHref = new f2("xlinkHref", 1, false, "xlink:href", "http://www.w3.org/1999/xlink", true, false), ["src", "href", "action", "formAction"].forEach(function(e3) { + h2[e3] = new f2(e3, 1, false, e3.toLowerCase(), null, true, true); + }); + var v2 = e2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, b2 = Symbol.for("react.element"), y2 = Symbol.for("react.portal"), w2 = Symbol.for("react.fragment"), _2 = Symbol.for("react.strict_mode"), S2 = Symbol.for("react.profiler"), E2 = Symbol.for("react.provider"), k2 = Symbol.for("react.context"), M2 = Symbol.for("react.forward_ref"), C2 = Symbol.for("react.suspense"), x2 = Symbol.for("react.suspense_list"), A2 = Symbol.for("react.memo"), R2 = Symbol.for("react.lazy"), T2 = Symbol.for("react.offscreen"), P2 = Symbol.iterator; + function L2(e3) { + return null === e3 || "object" != typeof e3 ? null : "function" == typeof (e3 = P2 && e3[P2] || e3["@@iterator"]) ? e3 : null; + } + var I2, O2 = Object.assign; + function N2(e3) { + if (void 0 === I2) + try { + throw Error(); + } catch (e4) { + var t3 = e4.stack.trim().match(/\n( *(at )?)/); + I2 = t3 && t3[1] || ""; + } + return "\n" + I2 + e3; + } + var D2 = false; + function j2(e3, t3) { + if (!e3 || D2) + return ""; + D2 = true; + var n3 = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + try { + if (t3) + if (t3 = function() { + throw Error(); + }, Object.defineProperty(t3.prototype, "props", { set: function() { + throw Error(); + } }), "object" == typeof Reflect && Reflect.construct) { + try { + Reflect.construct(t3, []); + } catch (e4) { + var r3 = e4; + } + Reflect.construct(e3, [], t3); + } else { + try { + t3.call(); + } catch (e4) { + r3 = e4; + } + e3.call(t3.prototype); + } + else { + try { + throw Error(); + } catch (e4) { + r3 = e4; + } + e3(); + } + } catch (t4) { + if (t4 && r3 && "string" == typeof t4.stack) { + for (var i3 = t4.stack.split("\n"), o3 = r3.stack.split("\n"), a3 = i3.length - 1, s3 = o3.length - 1; 1 <= a3 && 0 <= s3 && i3[a3] !== o3[s3]; ) + s3--; + for (; 1 <= a3 && 0 <= s3; a3--, s3--) + if (i3[a3] !== o3[s3]) { + if (1 !== a3 || 1 !== s3) + do { + if (a3--, 0 > --s3 || i3[a3] !== o3[s3]) { + var u3 = "\n" + i3[a3].replace(" at new ", " at "); + return e3.displayName && u3.includes("") && (u3 = u3.replace("", e3.displayName)), u3; + } + } while (1 <= a3 && 0 <= s3); + break; + } + } + } finally { + D2 = false, Error.prepareStackTrace = n3; + } + return (e3 = e3 ? e3.displayName || e3.name : "") ? N2(e3) : ""; + } + function B2(e3) { + switch (e3.tag) { + case 5: + return N2(e3.type); + case 16: + return N2("Lazy"); + case 13: + return N2("Suspense"); + case 19: + return N2("SuspenseList"); + case 0: + case 2: + case 15: + return e3 = j2(e3.type, false); + case 11: + return e3 = j2(e3.type.render, false); + case 1: + return e3 = j2(e3.type, true); + default: + return ""; + } + } + function z2(e3) { + if (null == e3) + return null; + if ("function" == typeof e3) + return e3.displayName || e3.name || null; + if ("string" == typeof e3) + return e3; + switch (e3) { + case w2: + return "Fragment"; + case y2: + return "Portal"; + case S2: + return "Profiler"; + case _2: + return "StrictMode"; + case C2: + return "Suspense"; + case x2: + return "SuspenseList"; + } + if ("object" == typeof e3) + switch (e3.$$typeof) { + case k2: + return (e3.displayName || "Context") + ".Consumer"; + case E2: + return (e3._context.displayName || "Context") + ".Provider"; + case M2: + var t3 = e3.render; + return (e3 = e3.displayName) || (e3 = "" !== (e3 = t3.displayName || t3.name || "") ? "ForwardRef(" + e3 + ")" : "ForwardRef"), e3; + case A2: + return null !== (t3 = e3.displayName || null) ? t3 : z2(e3.type) || "Memo"; + case R2: + t3 = e3._payload, e3 = e3._init; + try { + return z2(e3(t3)); + } catch (e4) { + } + } + return null; + } + function U2(e3) { + var t3 = e3.type; + switch (e3.tag) { + case 24: + return "Cache"; + case 9: + return (t3.displayName || "Context") + ".Consumer"; + case 10: + return (t3._context.displayName || "Context") + ".Provider"; + case 18: + return "DehydratedFragment"; + case 11: + return e3 = (e3 = t3.render).displayName || e3.name || "", t3.displayName || ("" !== e3 ? "ForwardRef(" + e3 + ")" : "ForwardRef"); + case 7: + return "Fragment"; + case 5: + return t3; + case 4: + return "Portal"; + case 3: + return "Root"; + case 6: + return "Text"; + case 16: + return z2(t3); + case 8: + return t3 === _2 ? "StrictMode" : "Mode"; + case 22: + return "Offscreen"; + case 12: + return "Profiler"; + case 21: + return "Scope"; + case 13: + return "Suspense"; + case 19: + return "SuspenseList"; + case 25: + return "TracingMarker"; + case 1: + case 0: + case 17: + case 2: + case 14: + case 15: + if ("function" == typeof t3) + return t3.displayName || t3.name || null; + if ("string" == typeof t3) + return t3; + } + return null; + } + function F2(e3) { + switch (typeof e3) { + case "boolean": + case "number": + case "string": + case "undefined": + case "object": + return e3; + default: + return ""; + } + } + function K2(e3) { + var t3 = e3.type; + return (e3 = e3.nodeName) && "input" === e3.toLowerCase() && ("checkbox" === t3 || "radio" === t3); + } + function q2(e3) { + e3._valueTracker || (e3._valueTracker = function(e4) { + var t3 = K2(e4) ? "checked" : "value", n3 = Object.getOwnPropertyDescriptor(e4.constructor.prototype, t3), r3 = "" + e4[t3]; + if (!e4.hasOwnProperty(t3) && void 0 !== n3 && "function" == typeof n3.get && "function" == typeof n3.set) { + var i3 = n3.get, o3 = n3.set; + return Object.defineProperty(e4, t3, { configurable: true, get: function() { + return i3.call(this); + }, set: function(e5) { + r3 = "" + e5, o3.call(this, e5); + } }), Object.defineProperty(e4, t3, { enumerable: n3.enumerable }), { getValue: function() { + return r3; + }, setValue: function(e5) { + r3 = "" + e5; + }, stopTracking: function() { + e4._valueTracker = null, delete e4[t3]; + } }; + } + }(e3)); + } + function H2(e3) { + if (!e3) + return false; + var t3 = e3._valueTracker; + if (!t3) + return true; + var n3 = t3.getValue(), r3 = ""; + return e3 && (r3 = K2(e3) ? e3.checked ? "true" : "false" : e3.value), (e3 = r3) !== n3 && (t3.setValue(e3), true); + } + function W2(e3) { + if (void 0 === (e3 = e3 || ("undefined" != typeof document ? document : void 0))) + return null; + try { + return e3.activeElement || e3.body; + } catch (t3) { + return e3.body; + } + } + function $2(e3, t3) { + var n3 = t3.checked; + return O2({}, t3, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: null != n3 ? n3 : e3._wrapperState.initialChecked }); + } + function V2(e3, t3) { + var n3 = null == t3.defaultValue ? "" : t3.defaultValue, r3 = null != t3.checked ? t3.checked : t3.defaultChecked; + n3 = F2(null != t3.value ? t3.value : n3), e3._wrapperState = { initialChecked: r3, initialValue: n3, controlled: "checkbox" === t3.type || "radio" === t3.type ? null != t3.checked : null != t3.value }; + } + function Y2(e3, t3) { + null != (t3 = t3.checked) && g2(e3, "checked", t3, false); + } + function G2(e3, t3) { + Y2(e3, t3); + var n3 = F2(t3.value), r3 = t3.type; + if (null != n3) + "number" === r3 ? (0 === n3 && "" === e3.value || e3.value != n3) && (e3.value = "" + n3) : e3.value !== "" + n3 && (e3.value = "" + n3); + else if ("submit" === r3 || "reset" === r3) + return void e3.removeAttribute("value"); + t3.hasOwnProperty("value") ? Q2(e3, t3.type, n3) : t3.hasOwnProperty("defaultValue") && Q2(e3, t3.type, F2(t3.defaultValue)), null == t3.checked && null != t3.defaultChecked && (e3.defaultChecked = !!t3.defaultChecked); + } + function Z2(e3, t3, n3) { + if (t3.hasOwnProperty("value") || t3.hasOwnProperty("defaultValue")) { + var r3 = t3.type; + if (!("submit" !== r3 && "reset" !== r3 || void 0 !== t3.value && null !== t3.value)) + return; + t3 = "" + e3._wrapperState.initialValue, n3 || t3 === e3.value || (e3.value = t3), e3.defaultValue = t3; + } + "" !== (n3 = e3.name) && (e3.name = ""), e3.defaultChecked = !!e3._wrapperState.initialChecked, "" !== n3 && (e3.name = n3); + } + function Q2(e3, t3, n3) { + "number" === t3 && W2(e3.ownerDocument) === e3 || (null == n3 ? e3.defaultValue = "" + e3._wrapperState.initialValue : e3.defaultValue !== "" + n3 && (e3.defaultValue = "" + n3)); + } + var J2 = Array.isArray; + function X2(e3, t3, n3, r3) { + if (e3 = e3.options, t3) { + t3 = {}; + for (var i3 = 0; i3 < n3.length; i3++) + t3["$" + n3[i3]] = true; + for (n3 = 0; n3 < e3.length; n3++) + i3 = t3.hasOwnProperty("$" + e3[n3].value), e3[n3].selected !== i3 && (e3[n3].selected = i3), i3 && r3 && (e3[n3].defaultSelected = true); + } else { + for (n3 = "" + F2(n3), t3 = null, i3 = 0; i3 < e3.length; i3++) { + if (e3[i3].value === n3) + return e3[i3].selected = true, void (r3 && (e3[i3].defaultSelected = true)); + null !== t3 || e3[i3].disabled || (t3 = e3[i3]); + } + null !== t3 && (t3.selected = true); + } + } + function ee2(e3, t3) { + if (null != t3.dangerouslySetInnerHTML) + throw Error(n2(91)); + return O2({}, t3, { value: void 0, defaultValue: void 0, children: "" + e3._wrapperState.initialValue }); + } + function te2(e3, t3) { + var r3 = t3.value; + if (null == r3) { + if (r3 = t3.children, t3 = t3.defaultValue, null != r3) { + if (null != t3) + throw Error(n2(92)); + if (J2(r3)) { + if (1 < r3.length) + throw Error(n2(93)); + r3 = r3[0]; + } + t3 = r3; + } + null == t3 && (t3 = ""), r3 = t3; + } + e3._wrapperState = { initialValue: F2(r3) }; + } + function ne2(e3, t3) { + var n3 = F2(t3.value), r3 = F2(t3.defaultValue); + null != n3 && ((n3 = "" + n3) !== e3.value && (e3.value = n3), null == t3.defaultValue && e3.defaultValue !== n3 && (e3.defaultValue = n3)), null != r3 && (e3.defaultValue = "" + r3); + } + function re2(e3) { + var t3 = e3.textContent; + t3 === e3._wrapperState.initialValue && "" !== t3 && null !== t3 && (e3.value = t3); + } + function ie2(e3) { + switch (e3) { + case "svg": + return "http://www.w3.org/2000/svg"; + case "math": + return "http://www.w3.org/1998/Math/MathML"; + default: + return "http://www.w3.org/1999/xhtml"; + } + } + function oe2(e3, t3) { + return null == e3 || "http://www.w3.org/1999/xhtml" === e3 ? ie2(t3) : "http://www.w3.org/2000/svg" === e3 && "foreignObject" === t3 ? "http://www.w3.org/1999/xhtml" : e3; + } + var ae2, se2, ue2 = (se2 = function(e3, t3) { + if ("http://www.w3.org/2000/svg" !== e3.namespaceURI || "innerHTML" in e3) + e3.innerHTML = t3; + else { + for ((ae2 = ae2 || document.createElement("div")).innerHTML = "" + t3.valueOf().toString() + "", t3 = ae2.firstChild; e3.firstChild; ) + e3.removeChild(e3.firstChild); + for (; t3.firstChild; ) + e3.appendChild(t3.firstChild); + } + }, "undefined" != typeof MSApp && MSApp.execUnsafeLocalFunction ? function(e3, t3, n3, r3) { + MSApp.execUnsafeLocalFunction(function() { + return se2(e3, t3); + }); + } : se2); + function le2(e3, t3) { + if (t3) { + var n3 = e3.firstChild; + if (n3 && n3 === e3.lastChild && 3 === n3.nodeType) + return void (n3.nodeValue = t3); + } + e3.textContent = t3; + } + var ce2 = { animationIterationCount: true, aspectRatio: true, borderImageOutset: true, borderImageSlice: true, borderImageWidth: true, boxFlex: true, boxFlexGroup: true, boxOrdinalGroup: true, columnCount: true, columns: true, flex: true, flexGrow: true, flexPositive: true, flexShrink: true, flexNegative: true, flexOrder: true, gridArea: true, gridRow: true, gridRowEnd: true, gridRowSpan: true, gridRowStart: true, gridColumn: true, gridColumnEnd: true, gridColumnSpan: true, gridColumnStart: true, fontWeight: true, lineClamp: true, lineHeight: true, opacity: true, order: true, orphans: true, tabSize: true, widows: true, zIndex: true, zoom: true, fillOpacity: true, floodOpacity: true, stopOpacity: true, strokeDasharray: true, strokeDashoffset: true, strokeMiterlimit: true, strokeOpacity: true, strokeWidth: true }, de2 = ["Webkit", "ms", "Moz", "O"]; + function fe2(e3, t3, n3) { + return null == t3 || "boolean" == typeof t3 || "" === t3 ? "" : n3 || "number" != typeof t3 || 0 === t3 || ce2.hasOwnProperty(e3) && ce2[e3] ? ("" + t3).trim() : t3 + "px"; + } + function he2(e3, t3) { + for (var n3 in e3 = e3.style, t3) + if (t3.hasOwnProperty(n3)) { + var r3 = 0 === n3.indexOf("--"), i3 = fe2(n3, t3[n3], r3); + "float" === n3 && (n3 = "cssFloat"), r3 ? e3.setProperty(n3, i3) : e3[n3] = i3; + } + } + Object.keys(ce2).forEach(function(e3) { + de2.forEach(function(t3) { + t3 = t3 + e3.charAt(0).toUpperCase() + e3.substring(1), ce2[t3] = ce2[e3]; + }); + }); + var pe2 = O2({ menuitem: true }, { area: true, base: true, br: true, col: true, embed: true, hr: true, img: true, input: true, keygen: true, link: true, meta: true, param: true, source: true, track: true, wbr: true }); + function me2(e3, t3) { + if (t3) { + if (pe2[e3] && (null != t3.children || null != t3.dangerouslySetInnerHTML)) + throw Error(n2(137, e3)); + if (null != t3.dangerouslySetInnerHTML) { + if (null != t3.children) + throw Error(n2(60)); + if ("object" != typeof t3.dangerouslySetInnerHTML || !("__html" in t3.dangerouslySetInnerHTML)) + throw Error(n2(61)); + } + if (null != t3.style && "object" != typeof t3.style) + throw Error(n2(62)); + } + } + function ge2(e3, t3) { + if (-1 === e3.indexOf("-")) + return "string" == typeof t3.is; + switch (e3) { + case "annotation-xml": + case "color-profile": + case "font-face": + case "font-face-src": + case "font-face-uri": + case "font-face-format": + case "font-face-name": + case "missing-glyph": + return false; + default: + return true; + } + } + var ve2 = null; + function be2(e3) { + return (e3 = e3.target || e3.srcElement || window).correspondingUseElement && (e3 = e3.correspondingUseElement), 3 === e3.nodeType ? e3.parentNode : e3; + } + var ye2 = null, we2 = null, _e2 = null; + function Se2(e3) { + if (e3 = gi2(e3)) { + if ("function" != typeof ye2) + throw Error(n2(280)); + var t3 = e3.stateNode; + t3 && (t3 = bi2(t3), ye2(e3.stateNode, e3.type, t3)); + } + } + function Ee2(e3) { + we2 ? _e2 ? _e2.push(e3) : _e2 = [e3] : we2 = e3; + } + function ke2() { + if (we2) { + var e3 = we2, t3 = _e2; + if (_e2 = we2 = null, Se2(e3), t3) + for (e3 = 0; e3 < t3.length; e3++) + Se2(t3[e3]); + } + } + function Me2(e3, t3) { + return e3(t3); + } + function Ce2() { + } + var xe2 = false; + function Ae2(e3, t3, n3) { + if (xe2) + return e3(t3, n3); + xe2 = true; + try { + return Me2(e3, t3, n3); + } finally { + xe2 = false, (null !== we2 || null !== _e2) && (Ce2(), ke2()); + } + } + function Re2(e3, t3) { + var r3 = e3.stateNode; + if (null === r3) + return null; + var i3 = bi2(r3); + if (null === i3) + return null; + r3 = i3[t3]; + e: + switch (t3) { + case "onClick": + case "onClickCapture": + case "onDoubleClick": + case "onDoubleClickCapture": + case "onMouseDown": + case "onMouseDownCapture": + case "onMouseMove": + case "onMouseMoveCapture": + case "onMouseUp": + case "onMouseUpCapture": + case "onMouseEnter": + (i3 = !i3.disabled) || (i3 = !("button" === (e3 = e3.type) || "input" === e3 || "select" === e3 || "textarea" === e3)), e3 = !i3; + break e; + default: + e3 = false; + } + if (e3) + return null; + if (r3 && "function" != typeof r3) + throw Error(n2(231, t3, typeof r3)); + return r3; + } + var Te2 = false; + if (s2) + try { + var Pe2 = {}; + Object.defineProperty(Pe2, "passive", { get: function() { + Te2 = true; + } }), window.addEventListener("test", Pe2, Pe2), window.removeEventListener("test", Pe2, Pe2); + } catch (se3) { + Te2 = false; + } + function Le2(e3, t3, n3, r3, i3, o3, a3, s3, u3) { + var l3 = Array.prototype.slice.call(arguments, 3); + try { + t3.apply(n3, l3); + } catch (e4) { + this.onError(e4); + } + } + var Ie2 = false, Oe2 = null, Ne2 = false, De2 = null, je2 = { onError: function(e3) { + Ie2 = true, Oe2 = e3; + } }; + function Be2(e3, t3, n3, r3, i3, o3, a3, s3, u3) { + Ie2 = false, Oe2 = null, Le2.apply(je2, arguments); + } + function ze2(e3) { + var t3 = e3, n3 = e3; + if (e3.alternate) + for (; t3.return; ) + t3 = t3.return; + else { + e3 = t3; + do { + 0 != (4098 & (t3 = e3).flags) && (n3 = t3.return), e3 = t3.return; + } while (e3); + } + return 3 === t3.tag ? n3 : null; + } + function Ue2(e3) { + if (13 === e3.tag) { + var t3 = e3.memoizedState; + if (null === t3 && (null !== (e3 = e3.alternate) && (t3 = e3.memoizedState)), null !== t3) + return t3.dehydrated; + } + return null; + } + function Fe2(e3) { + if (ze2(e3) !== e3) + throw Error(n2(188)); + } + function Ke2(e3) { + return e3 = function(e4) { + var t3 = e4.alternate; + if (!t3) { + if (null === (t3 = ze2(e4))) + throw Error(n2(188)); + return t3 !== e4 ? null : e4; + } + for (var r3 = e4, i3 = t3; ; ) { + var o3 = r3.return; + if (null === o3) + break; + var a3 = o3.alternate; + if (null === a3) { + if (null !== (i3 = o3.return)) { + r3 = i3; + continue; + } + break; + } + if (o3.child === a3.child) { + for (a3 = o3.child; a3; ) { + if (a3 === r3) + return Fe2(o3), e4; + if (a3 === i3) + return Fe2(o3), t3; + a3 = a3.sibling; + } + throw Error(n2(188)); + } + if (r3.return !== i3.return) + r3 = o3, i3 = a3; + else { + for (var s3 = false, u3 = o3.child; u3; ) { + if (u3 === r3) { + s3 = true, r3 = o3, i3 = a3; + break; + } + if (u3 === i3) { + s3 = true, i3 = o3, r3 = a3; + break; + } + u3 = u3.sibling; + } + if (!s3) { + for (u3 = a3.child; u3; ) { + if (u3 === r3) { + s3 = true, r3 = a3, i3 = o3; + break; + } + if (u3 === i3) { + s3 = true, i3 = a3, r3 = o3; + break; + } + u3 = u3.sibling; + } + if (!s3) + throw Error(n2(189)); + } + } + if (r3.alternate !== i3) + throw Error(n2(190)); + } + if (3 !== r3.tag) + throw Error(n2(188)); + return r3.stateNode.current === r3 ? e4 : t3; + }(e3), null !== e3 ? qe2(e3) : null; + } + function qe2(e3) { + if (5 === e3.tag || 6 === e3.tag) + return e3; + for (e3 = e3.child; null !== e3; ) { + var t3 = qe2(e3); + if (null !== t3) + return t3; + e3 = e3.sibling; + } + return null; + } + var He2 = t2.unstable_scheduleCallback, We2 = t2.unstable_cancelCallback, $e2 = t2.unstable_shouldYield, Ve2 = t2.unstable_requestPaint, Ye2 = t2.unstable_now, Ge2 = t2.unstable_getCurrentPriorityLevel, Ze2 = t2.unstable_ImmediatePriority, Qe2 = t2.unstable_UserBlockingPriority, Je2 = t2.unstable_NormalPriority, Xe2 = t2.unstable_LowPriority, et2 = t2.unstable_IdlePriority, tt2 = null, nt2 = null; + var rt2 = Math.clz32 ? Math.clz32 : function(e3) { + return e3 >>>= 0, 0 === e3 ? 32 : 31 - (it2(e3) / ot2 | 0) | 0; + }, it2 = Math.log, ot2 = Math.LN2; + var at2 = 64, st2 = 4194304; + function ut2(e3) { + switch (e3 & -e3) { + case 1: + return 1; + case 2: + return 2; + case 4: + return 4; + case 8: + return 8; + case 16: + return 16; + case 32: + return 32; + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return 4194240 & e3; + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + return 130023424 & e3; + case 134217728: + return 134217728; + case 268435456: + return 268435456; + case 536870912: + return 536870912; + case 1073741824: + return 1073741824; + default: + return e3; + } + } + function lt2(e3, t3) { + var n3 = e3.pendingLanes; + if (0 === n3) + return 0; + var r3 = 0, i3 = e3.suspendedLanes, o3 = e3.pingedLanes, a3 = 268435455 & n3; + if (0 !== a3) { + var s3 = a3 & ~i3; + 0 !== s3 ? r3 = ut2(s3) : 0 !== (o3 &= a3) && (r3 = ut2(o3)); + } else + 0 !== (a3 = n3 & ~i3) ? r3 = ut2(a3) : 0 !== o3 && (r3 = ut2(o3)); + if (0 === r3) + return 0; + if (0 !== t3 && t3 !== r3 && 0 == (t3 & i3) && ((i3 = r3 & -r3) >= (o3 = t3 & -t3) || 16 === i3 && 0 != (4194240 & o3))) + return t3; + if (0 != (4 & r3) && (r3 |= 16 & n3), 0 !== (t3 = e3.entangledLanes)) + for (e3 = e3.entanglements, t3 &= r3; 0 < t3; ) + i3 = 1 << (n3 = 31 - rt2(t3)), r3 |= e3[n3], t3 &= ~i3; + return r3; + } + function ct2(e3, t3) { + switch (e3) { + case 1: + case 2: + case 4: + return t3 + 250; + case 8: + case 16: + case 32: + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return t3 + 5e3; + default: + return -1; + } + } + function dt2(e3) { + return 0 !== (e3 = -1073741825 & e3.pendingLanes) ? e3 : 1073741824 & e3 ? 1073741824 : 0; + } + function ft2() { + var e3 = at2; + return 0 == (4194240 & (at2 <<= 1)) && (at2 = 64), e3; + } + function ht2(e3) { + for (var t3 = [], n3 = 0; 31 > n3; n3++) + t3.push(e3); + return t3; + } + function pt2(e3, t3, n3) { + e3.pendingLanes |= t3, 536870912 !== t3 && (e3.suspendedLanes = 0, e3.pingedLanes = 0), (e3 = e3.eventTimes)[t3 = 31 - rt2(t3)] = n3; + } + function mt2(e3, t3) { + var n3 = e3.entangledLanes |= t3; + for (e3 = e3.entanglements; n3; ) { + var r3 = 31 - rt2(n3), i3 = 1 << r3; + i3 & t3 | e3[r3] & t3 && (e3[r3] |= t3), n3 &= ~i3; + } + } + var gt2 = 0; + function vt2(e3) { + return 1 < (e3 &= -e3) ? 4 < e3 ? 0 != (268435455 & e3) ? 16 : 536870912 : 4 : 1; + } + var bt2, yt2, wt2, _t2, St2, Et2 = false, kt2 = [], Mt2 = null, Ct2 = null, xt2 = null, At2 = /* @__PURE__ */ new Map(), Rt2 = /* @__PURE__ */ new Map(), Tt2 = [], Pt2 = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" "); + function Lt2(e3, t3) { + switch (e3) { + case "focusin": + case "focusout": + Mt2 = null; + break; + case "dragenter": + case "dragleave": + Ct2 = null; + break; + case "mouseover": + case "mouseout": + xt2 = null; + break; + case "pointerover": + case "pointerout": + At2.delete(t3.pointerId); + break; + case "gotpointercapture": + case "lostpointercapture": + Rt2.delete(t3.pointerId); + } + } + function It2(e3, t3, n3, r3, i3, o3) { + return null === e3 || e3.nativeEvent !== o3 ? (e3 = { blockedOn: t3, domEventName: n3, eventSystemFlags: r3, nativeEvent: o3, targetContainers: [i3] }, null !== t3 && (null !== (t3 = gi2(t3)) && yt2(t3)), e3) : (e3.eventSystemFlags |= r3, t3 = e3.targetContainers, null !== i3 && -1 === t3.indexOf(i3) && t3.push(i3), e3); + } + function Ot2(e3) { + var t3 = mi2(e3.target); + if (null !== t3) { + var n3 = ze2(t3); + if (null !== n3) { + if (13 === (t3 = n3.tag)) { + if (null !== (t3 = Ue2(n3))) + return e3.blockedOn = t3, void St2(e3.priority, function() { + wt2(n3); + }); + } else if (3 === t3 && n3.stateNode.current.memoizedState.isDehydrated) + return void (e3.blockedOn = 3 === n3.tag ? n3.stateNode.containerInfo : null); + } + } + e3.blockedOn = null; + } + function Nt2(e3) { + if (null !== e3.blockedOn) + return false; + for (var t3 = e3.targetContainers; 0 < t3.length; ) { + var n3 = $t2(e3.domEventName, e3.eventSystemFlags, t3[0], e3.nativeEvent); + if (null !== n3) + return null !== (t3 = gi2(n3)) && yt2(t3), e3.blockedOn = n3, false; + var r3 = new (n3 = e3.nativeEvent).constructor(n3.type, n3); + ve2 = r3, n3.target.dispatchEvent(r3), ve2 = null, t3.shift(); + } + return true; + } + function Dt2(e3, t3, n3) { + Nt2(e3) && n3.delete(t3); + } + function jt2() { + Et2 = false, null !== Mt2 && Nt2(Mt2) && (Mt2 = null), null !== Ct2 && Nt2(Ct2) && (Ct2 = null), null !== xt2 && Nt2(xt2) && (xt2 = null), At2.forEach(Dt2), Rt2.forEach(Dt2); + } + function Bt2(e3, n3) { + e3.blockedOn === n3 && (e3.blockedOn = null, Et2 || (Et2 = true, t2.unstable_scheduleCallback(t2.unstable_NormalPriority, jt2))); + } + function zt2(e3) { + function t3(t4) { + return Bt2(t4, e3); + } + if (0 < kt2.length) { + Bt2(kt2[0], e3); + for (var n3 = 1; n3 < kt2.length; n3++) { + var r3 = kt2[n3]; + r3.blockedOn === e3 && (r3.blockedOn = null); + } + } + for (null !== Mt2 && Bt2(Mt2, e3), null !== Ct2 && Bt2(Ct2, e3), null !== xt2 && Bt2(xt2, e3), At2.forEach(t3), Rt2.forEach(t3), n3 = 0; n3 < Tt2.length; n3++) + (r3 = Tt2[n3]).blockedOn === e3 && (r3.blockedOn = null); + for (; 0 < Tt2.length && null === (n3 = Tt2[0]).blockedOn; ) + Ot2(n3), null === n3.blockedOn && Tt2.shift(); + } + var Ut2 = v2.ReactCurrentBatchConfig, Ft2 = true; + function Kt2(e3, t3, n3, r3) { + var i3 = gt2, o3 = Ut2.transition; + Ut2.transition = null; + try { + gt2 = 1, Ht2(e3, t3, n3, r3); + } finally { + gt2 = i3, Ut2.transition = o3; + } + } + function qt2(e3, t3, n3, r3) { + var i3 = gt2, o3 = Ut2.transition; + Ut2.transition = null; + try { + gt2 = 4, Ht2(e3, t3, n3, r3); + } finally { + gt2 = i3, Ut2.transition = o3; + } + } + function Ht2(e3, t3, n3, r3) { + if (Ft2) { + var i3 = $t2(e3, t3, n3, r3); + if (null === i3) + Fr2(e3, t3, r3, Wt2, n3), Lt2(e3, r3); + else if (function(e4, t4, n4, r4, i4) { + switch (t4) { + case "focusin": + return Mt2 = It2(Mt2, e4, t4, n4, r4, i4), true; + case "dragenter": + return Ct2 = It2(Ct2, e4, t4, n4, r4, i4), true; + case "mouseover": + return xt2 = It2(xt2, e4, t4, n4, r4, i4), true; + case "pointerover": + var o4 = i4.pointerId; + return At2.set(o4, It2(At2.get(o4) || null, e4, t4, n4, r4, i4)), true; + case "gotpointercapture": + return o4 = i4.pointerId, Rt2.set(o4, It2(Rt2.get(o4) || null, e4, t4, n4, r4, i4)), true; + } + return false; + }(i3, e3, t3, n3, r3)) + r3.stopPropagation(); + else if (Lt2(e3, r3), 4 & t3 && -1 < Pt2.indexOf(e3)) { + for (; null !== i3; ) { + var o3 = gi2(i3); + if (null !== o3 && bt2(o3), null === (o3 = $t2(e3, t3, n3, r3)) && Fr2(e3, t3, r3, Wt2, n3), o3 === i3) + break; + i3 = o3; + } + null !== i3 && r3.stopPropagation(); + } else + Fr2(e3, t3, r3, null, n3); + } + } + var Wt2 = null; + function $t2(e3, t3, n3, r3) { + if (Wt2 = null, null !== (e3 = mi2(e3 = be2(r3)))) + if (null === (t3 = ze2(e3))) + e3 = null; + else if (13 === (n3 = t3.tag)) { + if (null !== (e3 = Ue2(t3))) + return e3; + e3 = null; + } else if (3 === n3) { + if (t3.stateNode.current.memoizedState.isDehydrated) + return 3 === t3.tag ? t3.stateNode.containerInfo : null; + e3 = null; + } else + t3 !== e3 && (e3 = null); + return Wt2 = e3, null; + } + function Vt2(e3) { + switch (e3) { + case "cancel": + case "click": + case "close": + case "contextmenu": + case "copy": + case "cut": + case "auxclick": + case "dblclick": + case "dragend": + case "dragstart": + case "drop": + case "focusin": + case "focusout": + case "input": + case "invalid": + case "keydown": + case "keypress": + case "keyup": + case "mousedown": + case "mouseup": + case "paste": + case "pause": + case "play": + case "pointercancel": + case "pointerdown": + case "pointerup": + case "ratechange": + case "reset": + case "resize": + case "seeked": + case "submit": + case "touchcancel": + case "touchend": + case "touchstart": + case "volumechange": + case "change": + case "selectionchange": + case "textInput": + case "compositionstart": + case "compositionend": + case "compositionupdate": + case "beforeblur": + case "afterblur": + case "beforeinput": + case "blur": + case "fullscreenchange": + case "focus": + case "hashchange": + case "popstate": + case "select": + case "selectstart": + return 1; + case "drag": + case "dragenter": + case "dragexit": + case "dragleave": + case "dragover": + case "mousemove": + case "mouseout": + case "mouseover": + case "pointermove": + case "pointerout": + case "pointerover": + case "scroll": + case "toggle": + case "touchmove": + case "wheel": + case "mouseenter": + case "mouseleave": + case "pointerenter": + case "pointerleave": + return 4; + case "message": + switch (Ge2()) { + case Ze2: + return 1; + case Qe2: + return 4; + case Je2: + case Xe2: + return 16; + case et2: + return 536870912; + default: + return 16; + } + default: + return 16; + } + } + var Yt2 = null, Gt2 = null, Zt2 = null; + function Qt2() { + if (Zt2) + return Zt2; + var e3, t3, n3 = Gt2, r3 = n3.length, i3 = "value" in Yt2 ? Yt2.value : Yt2.textContent, o3 = i3.length; + for (e3 = 0; e3 < r3 && n3[e3] === i3[e3]; e3++) + ; + var a3 = r3 - e3; + for (t3 = 1; t3 <= a3 && n3[r3 - t3] === i3[o3 - t3]; t3++) + ; + return Zt2 = i3.slice(e3, 1 < t3 ? 1 - t3 : void 0); + } + function Jt2(e3) { + var t3 = e3.keyCode; + return "charCode" in e3 ? 0 === (e3 = e3.charCode) && 13 === t3 && (e3 = 13) : e3 = t3, 10 === e3 && (e3 = 13), 32 <= e3 || 13 === e3 ? e3 : 0; + } + function Xt2() { + return true; + } + function en2() { + return false; + } + function tn2(e3) { + function t3(t4, n3, r3, i3, o3) { + for (var a3 in this._reactName = t4, this._targetInst = r3, this.type = n3, this.nativeEvent = i3, this.target = o3, this.currentTarget = null, e3) + e3.hasOwnProperty(a3) && (t4 = e3[a3], this[a3] = t4 ? t4(i3) : i3[a3]); + return this.isDefaultPrevented = (null != i3.defaultPrevented ? i3.defaultPrevented : false === i3.returnValue) ? Xt2 : en2, this.isPropagationStopped = en2, this; + } + return O2(t3.prototype, { preventDefault: function() { + this.defaultPrevented = true; + var e4 = this.nativeEvent; + e4 && (e4.preventDefault ? e4.preventDefault() : "unknown" != typeof e4.returnValue && (e4.returnValue = false), this.isDefaultPrevented = Xt2); + }, stopPropagation: function() { + var e4 = this.nativeEvent; + e4 && (e4.stopPropagation ? e4.stopPropagation() : "unknown" != typeof e4.cancelBubble && (e4.cancelBubble = true), this.isPropagationStopped = Xt2); + }, persist: function() { + }, isPersistent: Xt2 }), t3; + } + var nn2, rn2, on2, an2 = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function(e3) { + return e3.timeStamp || Date.now(); + }, defaultPrevented: 0, isTrusted: 0 }, sn2 = tn2(an2), un2 = O2({}, an2, { view: 0, detail: 0 }), ln2 = tn2(un2), cn2 = O2({}, un2, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: Sn2, button: 0, buttons: 0, relatedTarget: function(e3) { + return void 0 === e3.relatedTarget ? e3.fromElement === e3.srcElement ? e3.toElement : e3.fromElement : e3.relatedTarget; + }, movementX: function(e3) { + return "movementX" in e3 ? e3.movementX : (e3 !== on2 && (on2 && "mousemove" === e3.type ? (nn2 = e3.screenX - on2.screenX, rn2 = e3.screenY - on2.screenY) : rn2 = nn2 = 0, on2 = e3), nn2); + }, movementY: function(e3) { + return "movementY" in e3 ? e3.movementY : rn2; + } }), dn2 = tn2(cn2), fn2 = tn2(O2({}, cn2, { dataTransfer: 0 })), hn2 = tn2(O2({}, un2, { relatedTarget: 0 })), pn2 = tn2(O2({}, an2, { animationName: 0, elapsedTime: 0, pseudoElement: 0 })), mn2 = O2({}, an2, { clipboardData: function(e3) { + return "clipboardData" in e3 ? e3.clipboardData : window.clipboardData; + } }), gn2 = tn2(mn2), vn2 = tn2(O2({}, an2, { data: 0 })), bn2 = { Esc: "Escape", Spacebar: " ", Left: "ArrowLeft", Up: "ArrowUp", Right: "ArrowRight", Down: "ArrowDown", Del: "Delete", Win: "OS", Menu: "ContextMenu", Apps: "ContextMenu", Scroll: "ScrollLock", MozPrintableKey: "Unidentified" }, yn2 = { 8: "Backspace", 9: "Tab", 12: "Clear", 13: "Enter", 16: "Shift", 17: "Control", 18: "Alt", 19: "Pause", 20: "CapsLock", 27: "Escape", 32: " ", 33: "PageUp", 34: "PageDown", 35: "End", 36: "Home", 37: "ArrowLeft", 38: "ArrowUp", 39: "ArrowRight", 40: "ArrowDown", 45: "Insert", 46: "Delete", 112: "F1", 113: "F2", 114: "F3", 115: "F4", 116: "F5", 117: "F6", 118: "F7", 119: "F8", 120: "F9", 121: "F10", 122: "F11", 123: "F12", 144: "NumLock", 145: "ScrollLock", 224: "Meta" }, wn2 = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" }; + function _n2(e3) { + var t3 = this.nativeEvent; + return t3.getModifierState ? t3.getModifierState(e3) : !!(e3 = wn2[e3]) && !!t3[e3]; + } + function Sn2() { + return _n2; + } + var En2 = O2({}, un2, { key: function(e3) { + if (e3.key) { + var t3 = bn2[e3.key] || e3.key; + if ("Unidentified" !== t3) + return t3; + } + return "keypress" === e3.type ? 13 === (e3 = Jt2(e3)) ? "Enter" : String.fromCharCode(e3) : "keydown" === e3.type || "keyup" === e3.type ? yn2[e3.keyCode] || "Unidentified" : ""; + }, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: Sn2, charCode: function(e3) { + return "keypress" === e3.type ? Jt2(e3) : 0; + }, keyCode: function(e3) { + return "keydown" === e3.type || "keyup" === e3.type ? e3.keyCode : 0; + }, which: function(e3) { + return "keypress" === e3.type ? Jt2(e3) : "keydown" === e3.type || "keyup" === e3.type ? e3.keyCode : 0; + } }), kn2 = tn2(En2), Mn2 = tn2(O2({}, cn2, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 })), Cn2 = tn2(O2({}, un2, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: Sn2 })), xn2 = tn2(O2({}, an2, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 })), An2 = O2({}, cn2, { deltaX: function(e3) { + return "deltaX" in e3 ? e3.deltaX : "wheelDeltaX" in e3 ? -e3.wheelDeltaX : 0; + }, deltaY: function(e3) { + return "deltaY" in e3 ? e3.deltaY : "wheelDeltaY" in e3 ? -e3.wheelDeltaY : "wheelDelta" in e3 ? -e3.wheelDelta : 0; + }, deltaZ: 0, deltaMode: 0 }), Rn2 = tn2(An2), Tn2 = [9, 13, 27, 32], Pn2 = s2 && "CompositionEvent" in window, Ln2 = null; + s2 && "documentMode" in document && (Ln2 = document.documentMode); + var In2 = s2 && "TextEvent" in window && !Ln2, On2 = s2 && (!Pn2 || Ln2 && 8 < Ln2 && 11 >= Ln2), Nn2 = String.fromCharCode(32), Dn2 = false; + function jn2(e3, t3) { + switch (e3) { + case "keyup": + return -1 !== Tn2.indexOf(t3.keyCode); + case "keydown": + return 229 !== t3.keyCode; + case "keypress": + case "mousedown": + case "focusout": + return true; + default: + return false; + } + } + function Bn2(e3) { + return "object" == typeof (e3 = e3.detail) && "data" in e3 ? e3.data : null; + } + var zn2 = false; + var Un2 = { color: true, date: true, datetime: true, "datetime-local": true, email: true, month: true, number: true, password: true, range: true, search: true, tel: true, text: true, time: true, url: true, week: true }; + function Fn2(e3) { + var t3 = e3 && e3.nodeName && e3.nodeName.toLowerCase(); + return "input" === t3 ? !!Un2[e3.type] : "textarea" === t3; + } + function Kn2(e3, t3, n3, r3) { + Ee2(r3), 0 < (t3 = qr2(t3, "onChange")).length && (n3 = new sn2("onChange", "change", null, n3, r3), e3.push({ event: n3, listeners: t3 })); + } + var qn2 = null, Hn2 = null; + function Wn2(e3) { + Nr2(e3, 0); + } + function $n2(e3) { + if (H2(vi2(e3))) + return e3; + } + function Vn2(e3, t3) { + if ("change" === e3) + return t3; + } + var Yn2 = false; + if (s2) { + var Gn2; + if (s2) { + var Zn2 = "oninput" in document; + if (!Zn2) { + var Qn2 = document.createElement("div"); + Qn2.setAttribute("oninput", "return;"), Zn2 = "function" == typeof Qn2.oninput; + } + Gn2 = Zn2; + } else + Gn2 = false; + Yn2 = Gn2 && (!document.documentMode || 9 < document.documentMode); + } + function Jn2() { + qn2 && (qn2.detachEvent("onpropertychange", Xn2), Hn2 = qn2 = null); + } + function Xn2(e3) { + if ("value" === e3.propertyName && $n2(Hn2)) { + var t3 = []; + Kn2(t3, Hn2, e3, be2(e3)), Ae2(Wn2, t3); + } + } + function er2(e3, t3, n3) { + "focusin" === e3 ? (Jn2(), Hn2 = n3, (qn2 = t3).attachEvent("onpropertychange", Xn2)) : "focusout" === e3 && Jn2(); + } + function tr2(e3) { + if ("selectionchange" === e3 || "keyup" === e3 || "keydown" === e3) + return $n2(Hn2); + } + function nr2(e3, t3) { + if ("click" === e3) + return $n2(t3); + } + function rr2(e3, t3) { + if ("input" === e3 || "change" === e3) + return $n2(t3); + } + var ir2 = "function" == typeof Object.is ? Object.is : function(e3, t3) { + return e3 === t3 && (0 !== e3 || 1 / e3 == 1 / t3) || e3 != e3 && t3 != t3; + }; + function or2(e3, t3) { + if (ir2(e3, t3)) + return true; + if ("object" != typeof e3 || null === e3 || "object" != typeof t3 || null === t3) + return false; + var n3 = Object.keys(e3), r3 = Object.keys(t3); + if (n3.length !== r3.length) + return false; + for (r3 = 0; r3 < n3.length; r3++) { + var i3 = n3[r3]; + if (!u2.call(t3, i3) || !ir2(e3[i3], t3[i3])) + return false; + } + return true; + } + function ar2(e3) { + for (; e3 && e3.firstChild; ) + e3 = e3.firstChild; + return e3; + } + function sr2(e3, t3) { + var n3, r3 = ar2(e3); + for (e3 = 0; r3; ) { + if (3 === r3.nodeType) { + if (n3 = e3 + r3.textContent.length, e3 <= t3 && n3 >= t3) + return { node: r3, offset: t3 - e3 }; + e3 = n3; + } + e: { + for (; r3; ) { + if (r3.nextSibling) { + r3 = r3.nextSibling; + break e; + } + r3 = r3.parentNode; + } + r3 = void 0; + } + r3 = ar2(r3); + } + } + function ur2(e3, t3) { + return !(!e3 || !t3) && (e3 === t3 || (!e3 || 3 !== e3.nodeType) && (t3 && 3 === t3.nodeType ? ur2(e3, t3.parentNode) : "contains" in e3 ? e3.contains(t3) : !!e3.compareDocumentPosition && !!(16 & e3.compareDocumentPosition(t3)))); + } + function lr2() { + for (var e3 = window, t3 = W2(); t3 instanceof e3.HTMLIFrameElement; ) { + try { + var n3 = "string" == typeof t3.contentWindow.location.href; + } catch (e4) { + n3 = false; + } + if (!n3) + break; + t3 = W2((e3 = t3.contentWindow).document); + } + return t3; + } + function cr2(e3) { + var t3 = e3 && e3.nodeName && e3.nodeName.toLowerCase(); + return t3 && ("input" === t3 && ("text" === e3.type || "search" === e3.type || "tel" === e3.type || "url" === e3.type || "password" === e3.type) || "textarea" === t3 || "true" === e3.contentEditable); + } + function dr2(e3) { + var t3 = lr2(), n3 = e3.focusedElem, r3 = e3.selectionRange; + if (t3 !== n3 && n3 && n3.ownerDocument && ur2(n3.ownerDocument.documentElement, n3)) { + if (null !== r3 && cr2(n3)) { + if (t3 = r3.start, void 0 === (e3 = r3.end) && (e3 = t3), "selectionStart" in n3) + n3.selectionStart = t3, n3.selectionEnd = Math.min(e3, n3.value.length); + else if ((e3 = (t3 = n3.ownerDocument || document) && t3.defaultView || window).getSelection) { + e3 = e3.getSelection(); + var i3 = n3.textContent.length, o3 = Math.min(r3.start, i3); + r3 = void 0 === r3.end ? o3 : Math.min(r3.end, i3), !e3.extend && o3 > r3 && (i3 = r3, r3 = o3, o3 = i3), i3 = sr2(n3, o3); + var a3 = sr2(n3, r3); + i3 && a3 && (1 !== e3.rangeCount || e3.anchorNode !== i3.node || e3.anchorOffset !== i3.offset || e3.focusNode !== a3.node || e3.focusOffset !== a3.offset) && ((t3 = t3.createRange()).setStart(i3.node, i3.offset), e3.removeAllRanges(), o3 > r3 ? (e3.addRange(t3), e3.extend(a3.node, a3.offset)) : (t3.setEnd(a3.node, a3.offset), e3.addRange(t3))); + } + } + for (t3 = [], e3 = n3; e3 = e3.parentNode; ) + 1 === e3.nodeType && t3.push({ element: e3, left: e3.scrollLeft, top: e3.scrollTop }); + for ("function" == typeof n3.focus && n3.focus(), n3 = 0; n3 < t3.length; n3++) + (e3 = t3[n3]).element.scrollLeft = e3.left, e3.element.scrollTop = e3.top; + } + } + var fr2 = s2 && "documentMode" in document && 11 >= document.documentMode, hr2 = null, pr2 = null, mr2 = null, gr2 = false; + function vr2(e3, t3, n3) { + var r3 = n3.window === n3 ? n3.document : 9 === n3.nodeType ? n3 : n3.ownerDocument; + gr2 || null == hr2 || hr2 !== W2(r3) || ("selectionStart" in (r3 = hr2) && cr2(r3) ? r3 = { start: r3.selectionStart, end: r3.selectionEnd } : r3 = { anchorNode: (r3 = (r3.ownerDocument && r3.ownerDocument.defaultView || window).getSelection()).anchorNode, anchorOffset: r3.anchorOffset, focusNode: r3.focusNode, focusOffset: r3.focusOffset }, mr2 && or2(mr2, r3) || (mr2 = r3, 0 < (r3 = qr2(pr2, "onSelect")).length && (t3 = new sn2("onSelect", "select", null, t3, n3), e3.push({ event: t3, listeners: r3 }), t3.target = hr2))); + } + function br2(e3, t3) { + var n3 = {}; + return n3[e3.toLowerCase()] = t3.toLowerCase(), n3["Webkit" + e3] = "webkit" + t3, n3["Moz" + e3] = "moz" + t3, n3; + } + var yr2 = { animationend: br2("Animation", "AnimationEnd"), animationiteration: br2("Animation", "AnimationIteration"), animationstart: br2("Animation", "AnimationStart"), transitionend: br2("Transition", "TransitionEnd") }, wr2 = {}, _r2 = {}; + function Sr2(e3) { + if (wr2[e3]) + return wr2[e3]; + if (!yr2[e3]) + return e3; + var t3, n3 = yr2[e3]; + for (t3 in n3) + if (n3.hasOwnProperty(t3) && t3 in _r2) + return wr2[e3] = n3[t3]; + return e3; + } + s2 && (_r2 = document.createElement("div").style, "AnimationEvent" in window || (delete yr2.animationend.animation, delete yr2.animationiteration.animation, delete yr2.animationstart.animation), "TransitionEvent" in window || delete yr2.transitionend.transition); + var Er2 = Sr2("animationend"), kr2 = Sr2("animationiteration"), Mr2 = Sr2("animationstart"), Cr2 = Sr2("transitionend"), xr2 = /* @__PURE__ */ new Map(), Ar2 = "abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" "); + function Rr2(e3, t3) { + xr2.set(e3, t3), o2(t3, [e3]); + } + for (var Tr2 = 0; Tr2 < Ar2.length; Tr2++) { + var Pr2 = Ar2[Tr2]; + Rr2(Pr2.toLowerCase(), "on" + (Pr2[0].toUpperCase() + Pr2.slice(1))); + } + Rr2(Er2, "onAnimationEnd"), Rr2(kr2, "onAnimationIteration"), Rr2(Mr2, "onAnimationStart"), Rr2("dblclick", "onDoubleClick"), Rr2("focusin", "onFocus"), Rr2("focusout", "onBlur"), Rr2(Cr2, "onTransitionEnd"), a2("onMouseEnter", ["mouseout", "mouseover"]), a2("onMouseLeave", ["mouseout", "mouseover"]), a2("onPointerEnter", ["pointerout", "pointerover"]), a2("onPointerLeave", ["pointerout", "pointerover"]), o2("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" ")), o2("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")), o2("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]), o2("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" ")), o2("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" ")), o2("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" ")); + var Lr2 = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "), Ir2 = new Set("cancel close invalid load scroll toggle".split(" ").concat(Lr2)); + function Or2(e3, t3, r3) { + var i3 = e3.type || "unknown-event"; + e3.currentTarget = r3, function(e4, t4, r4, i4, o3, a3, s3, u3, l3) { + if (Be2.apply(this, arguments), Ie2) { + if (!Ie2) + throw Error(n2(198)); + var c3 = Oe2; + Ie2 = false, Oe2 = null, Ne2 || (Ne2 = true, De2 = c3); + } + }(i3, t3, void 0, e3), e3.currentTarget = null; + } + function Nr2(e3, t3) { + t3 = 0 != (4 & t3); + for (var n3 = 0; n3 < e3.length; n3++) { + var r3 = e3[n3], i3 = r3.event; + r3 = r3.listeners; + e: { + var o3 = void 0; + if (t3) + for (var a3 = r3.length - 1; 0 <= a3; a3--) { + var s3 = r3[a3], u3 = s3.instance, l3 = s3.currentTarget; + if (s3 = s3.listener, u3 !== o3 && i3.isPropagationStopped()) + break e; + Or2(i3, s3, l3), o3 = u3; + } + else + for (a3 = 0; a3 < r3.length; a3++) { + if (u3 = (s3 = r3[a3]).instance, l3 = s3.currentTarget, s3 = s3.listener, u3 !== o3 && i3.isPropagationStopped()) + break e; + Or2(i3, s3, l3), o3 = u3; + } + } + } + if (Ne2) + throw e3 = De2, Ne2 = false, De2 = null, e3; + } + function Dr2(e3, t3) { + var n3 = t3[fi2]; + void 0 === n3 && (n3 = t3[fi2] = /* @__PURE__ */ new Set()); + var r3 = e3 + "__bubble"; + n3.has(r3) || (Ur2(t3, e3, 2, false), n3.add(r3)); + } + function jr2(e3, t3, n3) { + var r3 = 0; + t3 && (r3 |= 4), Ur2(n3, e3, r3, t3); + } + var Br2 = "_reactListening" + Math.random().toString(36).slice(2); + function zr2(e3) { + if (!e3[Br2]) { + e3[Br2] = true, r2.forEach(function(t4) { + "selectionchange" !== t4 && (Ir2.has(t4) || jr2(t4, false, e3), jr2(t4, true, e3)); + }); + var t3 = 9 === e3.nodeType ? e3 : e3.ownerDocument; + null === t3 || t3[Br2] || (t3[Br2] = true, jr2("selectionchange", false, t3)); + } + } + function Ur2(e3, t3, n3, r3) { + switch (Vt2(t3)) { + case 1: + var i3 = Kt2; + break; + case 4: + i3 = qt2; + break; + default: + i3 = Ht2; + } + n3 = i3.bind(null, t3, n3, e3), i3 = void 0, !Te2 || "touchstart" !== t3 && "touchmove" !== t3 && "wheel" !== t3 || (i3 = true), r3 ? void 0 !== i3 ? e3.addEventListener(t3, n3, { capture: true, passive: i3 }) : e3.addEventListener(t3, n3, true) : void 0 !== i3 ? e3.addEventListener(t3, n3, { passive: i3 }) : e3.addEventListener(t3, n3, false); + } + function Fr2(e3, t3, n3, r3, i3) { + var o3 = r3; + if (0 == (1 & t3) && 0 == (2 & t3) && null !== r3) + e: + for (; ; ) { + if (null === r3) + return; + var a3 = r3.tag; + if (3 === a3 || 4 === a3) { + var s3 = r3.stateNode.containerInfo; + if (s3 === i3 || 8 === s3.nodeType && s3.parentNode === i3) + break; + if (4 === a3) + for (a3 = r3.return; null !== a3; ) { + var u3 = a3.tag; + if ((3 === u3 || 4 === u3) && ((u3 = a3.stateNode.containerInfo) === i3 || 8 === u3.nodeType && u3.parentNode === i3)) + return; + a3 = a3.return; + } + for (; null !== s3; ) { + if (null === (a3 = mi2(s3))) + return; + if (5 === (u3 = a3.tag) || 6 === u3) { + r3 = o3 = a3; + continue e; + } + s3 = s3.parentNode; + } + } + r3 = r3.return; + } + Ae2(function() { + var r4 = o3, i4 = be2(n3), a4 = []; + e: { + var s4 = xr2.get(e3); + if (void 0 !== s4) { + var u4 = sn2, l3 = e3; + switch (e3) { + case "keypress": + if (0 === Jt2(n3)) + break e; + case "keydown": + case "keyup": + u4 = kn2; + break; + case "focusin": + l3 = "focus", u4 = hn2; + break; + case "focusout": + l3 = "blur", u4 = hn2; + break; + case "beforeblur": + case "afterblur": + u4 = hn2; + break; + case "click": + if (2 === n3.button) + break e; + case "auxclick": + case "dblclick": + case "mousedown": + case "mousemove": + case "mouseup": + case "mouseout": + case "mouseover": + case "contextmenu": + u4 = dn2; + break; + case "drag": + case "dragend": + case "dragenter": + case "dragexit": + case "dragleave": + case "dragover": + case "dragstart": + case "drop": + u4 = fn2; + break; + case "touchcancel": + case "touchend": + case "touchmove": + case "touchstart": + u4 = Cn2; + break; + case Er2: + case kr2: + case Mr2: + u4 = pn2; + break; + case Cr2: + u4 = xn2; + break; + case "scroll": + u4 = ln2; + break; + case "wheel": + u4 = Rn2; + break; + case "copy": + case "cut": + case "paste": + u4 = gn2; + break; + case "gotpointercapture": + case "lostpointercapture": + case "pointercancel": + case "pointerdown": + case "pointermove": + case "pointerout": + case "pointerover": + case "pointerup": + u4 = Mn2; + } + var c3 = 0 != (4 & t3), d3 = !c3 && "scroll" === e3, f3 = c3 ? null !== s4 ? s4 + "Capture" : null : s4; + c3 = []; + for (var h3, p3 = r4; null !== p3; ) { + var m3 = (h3 = p3).stateNode; + if (5 === h3.tag && null !== m3 && (h3 = m3, null !== f3 && (null != (m3 = Re2(p3, f3)) && c3.push(Kr2(p3, m3, h3)))), d3) + break; + p3 = p3.return; + } + 0 < c3.length && (s4 = new u4(s4, l3, null, n3, i4), a4.push({ event: s4, listeners: c3 })); + } + } + if (0 == (7 & t3)) { + if (u4 = "mouseout" === e3 || "pointerout" === e3, (!(s4 = "mouseover" === e3 || "pointerover" === e3) || n3 === ve2 || !(l3 = n3.relatedTarget || n3.fromElement) || !mi2(l3) && !l3[di2]) && (u4 || s4) && (s4 = i4.window === i4 ? i4 : (s4 = i4.ownerDocument) ? s4.defaultView || s4.parentWindow : window, u4 ? (u4 = r4, null !== (l3 = (l3 = n3.relatedTarget || n3.toElement) ? mi2(l3) : null) && (l3 !== (d3 = ze2(l3)) || 5 !== l3.tag && 6 !== l3.tag) && (l3 = null)) : (u4 = null, l3 = r4), u4 !== l3)) { + if (c3 = dn2, m3 = "onMouseLeave", f3 = "onMouseEnter", p3 = "mouse", "pointerout" !== e3 && "pointerover" !== e3 || (c3 = Mn2, m3 = "onPointerLeave", f3 = "onPointerEnter", p3 = "pointer"), d3 = null == u4 ? s4 : vi2(u4), h3 = null == l3 ? s4 : vi2(l3), (s4 = new c3(m3, p3 + "leave", u4, n3, i4)).target = d3, s4.relatedTarget = h3, m3 = null, mi2(i4) === r4 && ((c3 = new c3(f3, p3 + "enter", l3, n3, i4)).target = h3, c3.relatedTarget = d3, m3 = c3), d3 = m3, u4 && l3) + e: { + for (f3 = l3, p3 = 0, h3 = c3 = u4; h3; h3 = Hr2(h3)) + p3++; + for (h3 = 0, m3 = f3; m3; m3 = Hr2(m3)) + h3++; + for (; 0 < p3 - h3; ) + c3 = Hr2(c3), p3--; + for (; 0 < h3 - p3; ) + f3 = Hr2(f3), h3--; + for (; p3--; ) { + if (c3 === f3 || null !== f3 && c3 === f3.alternate) + break e; + c3 = Hr2(c3), f3 = Hr2(f3); + } + c3 = null; + } + else + c3 = null; + null !== u4 && Wr2(a4, s4, u4, c3, false), null !== l3 && null !== d3 && Wr2(a4, d3, l3, c3, true); + } + if ("select" === (u4 = (s4 = r4 ? vi2(r4) : window).nodeName && s4.nodeName.toLowerCase()) || "input" === u4 && "file" === s4.type) + var g3 = Vn2; + else if (Fn2(s4)) + if (Yn2) + g3 = rr2; + else { + g3 = tr2; + var v3 = er2; + } + else + (u4 = s4.nodeName) && "input" === u4.toLowerCase() && ("checkbox" === s4.type || "radio" === s4.type) && (g3 = nr2); + switch (g3 && (g3 = g3(e3, r4)) ? Kn2(a4, g3, n3, i4) : (v3 && v3(e3, s4, r4), "focusout" === e3 && (v3 = s4._wrapperState) && v3.controlled && "number" === s4.type && Q2(s4, "number", s4.value)), v3 = r4 ? vi2(r4) : window, e3) { + case "focusin": + (Fn2(v3) || "true" === v3.contentEditable) && (hr2 = v3, pr2 = r4, mr2 = null); + break; + case "focusout": + mr2 = pr2 = hr2 = null; + break; + case "mousedown": + gr2 = true; + break; + case "contextmenu": + case "mouseup": + case "dragend": + gr2 = false, vr2(a4, n3, i4); + break; + case "selectionchange": + if (fr2) + break; + case "keydown": + case "keyup": + vr2(a4, n3, i4); + } + var b3; + if (Pn2) + e: { + switch (e3) { + case "compositionstart": + var y3 = "onCompositionStart"; + break e; + case "compositionend": + y3 = "onCompositionEnd"; + break e; + case "compositionupdate": + y3 = "onCompositionUpdate"; + break e; + } + y3 = void 0; + } + else + zn2 ? jn2(e3, n3) && (y3 = "onCompositionEnd") : "keydown" === e3 && 229 === n3.keyCode && (y3 = "onCompositionStart"); + y3 && (On2 && "ko" !== n3.locale && (zn2 || "onCompositionStart" !== y3 ? "onCompositionEnd" === y3 && zn2 && (b3 = Qt2()) : (Gt2 = "value" in (Yt2 = i4) ? Yt2.value : Yt2.textContent, zn2 = true)), 0 < (v3 = qr2(r4, y3)).length && (y3 = new vn2(y3, e3, null, n3, i4), a4.push({ event: y3, listeners: v3 }), b3 ? y3.data = b3 : null !== (b3 = Bn2(n3)) && (y3.data = b3))), (b3 = In2 ? function(e4, t4) { + switch (e4) { + case "compositionend": + return Bn2(t4); + case "keypress": + return 32 !== t4.which ? null : (Dn2 = true, Nn2); + case "textInput": + return (e4 = t4.data) === Nn2 && Dn2 ? null : e4; + default: + return null; + } + }(e3, n3) : function(e4, t4) { + if (zn2) + return "compositionend" === e4 || !Pn2 && jn2(e4, t4) ? (e4 = Qt2(), Zt2 = Gt2 = Yt2 = null, zn2 = false, e4) : null; + switch (e4) { + case "paste": + default: + return null; + case "keypress": + if (!(t4.ctrlKey || t4.altKey || t4.metaKey) || t4.ctrlKey && t4.altKey) { + if (t4.char && 1 < t4.char.length) + return t4.char; + if (t4.which) + return String.fromCharCode(t4.which); + } + return null; + case "compositionend": + return On2 && "ko" !== t4.locale ? null : t4.data; + } + }(e3, n3)) && (0 < (r4 = qr2(r4, "onBeforeInput")).length && (i4 = new vn2("onBeforeInput", "beforeinput", null, n3, i4), a4.push({ event: i4, listeners: r4 }), i4.data = b3)); + } + Nr2(a4, t3); + }); + } + function Kr2(e3, t3, n3) { + return { instance: e3, listener: t3, currentTarget: n3 }; + } + function qr2(e3, t3) { + for (var n3 = t3 + "Capture", r3 = []; null !== e3; ) { + var i3 = e3, o3 = i3.stateNode; + 5 === i3.tag && null !== o3 && (i3 = o3, null != (o3 = Re2(e3, n3)) && r3.unshift(Kr2(e3, o3, i3)), null != (o3 = Re2(e3, t3)) && r3.push(Kr2(e3, o3, i3))), e3 = e3.return; + } + return r3; + } + function Hr2(e3) { + if (null === e3) + return null; + do { + e3 = e3.return; + } while (e3 && 5 !== e3.tag); + return e3 || null; + } + function Wr2(e3, t3, n3, r3, i3) { + for (var o3 = t3._reactName, a3 = []; null !== n3 && n3 !== r3; ) { + var s3 = n3, u3 = s3.alternate, l3 = s3.stateNode; + if (null !== u3 && u3 === r3) + break; + 5 === s3.tag && null !== l3 && (s3 = l3, i3 ? null != (u3 = Re2(n3, o3)) && a3.unshift(Kr2(n3, u3, s3)) : i3 || null != (u3 = Re2(n3, o3)) && a3.push(Kr2(n3, u3, s3))), n3 = n3.return; + } + 0 !== a3.length && e3.push({ event: t3, listeners: a3 }); + } + var $r2 = /\r\n?/g, Vr2 = /\u0000|\uFFFD/g; + function Yr2(e3) { + return ("string" == typeof e3 ? e3 : "" + e3).replace($r2, "\n").replace(Vr2, ""); + } + function Gr2(e3, t3, r3) { + if (t3 = Yr2(t3), Yr2(e3) !== t3 && r3) + throw Error(n2(425)); + } + function Zr2() { + } + var Qr2 = null, Jr2 = null; + function Xr2(e3, t3) { + return "textarea" === e3 || "noscript" === e3 || "string" == typeof t3.children || "number" == typeof t3.children || "object" == typeof t3.dangerouslySetInnerHTML && null !== t3.dangerouslySetInnerHTML && null != t3.dangerouslySetInnerHTML.__html; + } + var ei2 = "function" == typeof setTimeout ? setTimeout : void 0, ti2 = "function" == typeof clearTimeout ? clearTimeout : void 0, ni2 = "function" == typeof Promise ? Promise : void 0, ri2 = "function" == typeof queueMicrotask ? queueMicrotask : void 0 !== ni2 ? function(e3) { + return ni2.resolve(null).then(e3).catch(ii2); + } : ei2; + function ii2(e3) { + setTimeout(function() { + throw e3; + }); + } + function oi2(e3, t3) { + var n3 = t3, r3 = 0; + do { + var i3 = n3.nextSibling; + if (e3.removeChild(n3), i3 && 8 === i3.nodeType) + if ("/$" === (n3 = i3.data)) { + if (0 === r3) + return e3.removeChild(i3), void zt2(t3); + r3--; + } else + "$" !== n3 && "$?" !== n3 && "$!" !== n3 || r3++; + n3 = i3; + } while (n3); + zt2(t3); + } + function ai2(e3) { + for (; null != e3; e3 = e3.nextSibling) { + var t3 = e3.nodeType; + if (1 === t3 || 3 === t3) + break; + if (8 === t3) { + if ("$" === (t3 = e3.data) || "$!" === t3 || "$?" === t3) + break; + if ("/$" === t3) + return null; + } + } + return e3; + } + function si2(e3) { + e3 = e3.previousSibling; + for (var t3 = 0; e3; ) { + if (8 === e3.nodeType) { + var n3 = e3.data; + if ("$" === n3 || "$!" === n3 || "$?" === n3) { + if (0 === t3) + return e3; + t3--; + } else + "/$" === n3 && t3++; + } + e3 = e3.previousSibling; + } + return null; + } + var ui2 = Math.random().toString(36).slice(2), li2 = "__reactFiber$" + ui2, ci2 = "__reactProps$" + ui2, di2 = "__reactContainer$" + ui2, fi2 = "__reactEvents$" + ui2, hi2 = "__reactListeners$" + ui2, pi2 = "__reactHandles$" + ui2; + function mi2(e3) { + var t3 = e3[li2]; + if (t3) + return t3; + for (var n3 = e3.parentNode; n3; ) { + if (t3 = n3[di2] || n3[li2]) { + if (n3 = t3.alternate, null !== t3.child || null !== n3 && null !== n3.child) + for (e3 = si2(e3); null !== e3; ) { + if (n3 = e3[li2]) + return n3; + e3 = si2(e3); + } + return t3; + } + n3 = (e3 = n3).parentNode; + } + return null; + } + function gi2(e3) { + return !(e3 = e3[li2] || e3[di2]) || 5 !== e3.tag && 6 !== e3.tag && 13 !== e3.tag && 3 !== e3.tag ? null : e3; + } + function vi2(e3) { + if (5 === e3.tag || 6 === e3.tag) + return e3.stateNode; + throw Error(n2(33)); + } + function bi2(e3) { + return e3[ci2] || null; + } + var yi2 = [], wi2 = -1; + function _i2(e3) { + return { current: e3 }; + } + function Si2(e3) { + 0 > wi2 || (e3.current = yi2[wi2], yi2[wi2] = null, wi2--); + } + function Ei2(e3, t3) { + wi2++, yi2[wi2] = e3.current, e3.current = t3; + } + var ki2 = {}, Mi2 = _i2(ki2), Ci2 = _i2(false), xi2 = ki2; + function Ai2(e3, t3) { + var n3 = e3.type.contextTypes; + if (!n3) + return ki2; + var r3 = e3.stateNode; + if (r3 && r3.__reactInternalMemoizedUnmaskedChildContext === t3) + return r3.__reactInternalMemoizedMaskedChildContext; + var i3, o3 = {}; + for (i3 in n3) + o3[i3] = t3[i3]; + return r3 && ((e3 = e3.stateNode).__reactInternalMemoizedUnmaskedChildContext = t3, e3.__reactInternalMemoizedMaskedChildContext = o3), o3; + } + function Ri2(e3) { + return null != (e3 = e3.childContextTypes); + } + function Ti2() { + Si2(Ci2), Si2(Mi2); + } + function Pi2(e3, t3, r3) { + if (Mi2.current !== ki2) + throw Error(n2(168)); + Ei2(Mi2, t3), Ei2(Ci2, r3); + } + function Li2(e3, t3, r3) { + var i3 = e3.stateNode; + if (t3 = t3.childContextTypes, "function" != typeof i3.getChildContext) + return r3; + for (var o3 in i3 = i3.getChildContext()) + if (!(o3 in t3)) + throw Error(n2(108, U2(e3) || "Unknown", o3)); + return O2({}, r3, i3); + } + function Ii2(e3) { + return e3 = (e3 = e3.stateNode) && e3.__reactInternalMemoizedMergedChildContext || ki2, xi2 = Mi2.current, Ei2(Mi2, e3), Ei2(Ci2, Ci2.current), true; + } + function Oi2(e3, t3, r3) { + var i3 = e3.stateNode; + if (!i3) + throw Error(n2(169)); + r3 ? (e3 = Li2(e3, t3, xi2), i3.__reactInternalMemoizedMergedChildContext = e3, Si2(Ci2), Si2(Mi2), Ei2(Mi2, e3)) : Si2(Ci2), Ei2(Ci2, r3); + } + var Ni2 = null, Di2 = false, ji2 = false; + function Bi2(e3) { + null === Ni2 ? Ni2 = [e3] : Ni2.push(e3); + } + function zi2() { + if (!ji2 && null !== Ni2) { + ji2 = true; + var e3 = 0, t3 = gt2; + try { + var n3 = Ni2; + for (gt2 = 1; e3 < n3.length; e3++) { + var r3 = n3[e3]; + do { + r3 = r3(true); + } while (null !== r3); + } + Ni2 = null, Di2 = false; + } catch (t4) { + throw null !== Ni2 && (Ni2 = Ni2.slice(e3 + 1)), He2(Ze2, zi2), t4; + } finally { + gt2 = t3, ji2 = false; + } + } + return null; + } + var Ui2 = [], Fi2 = 0, Ki2 = null, qi2 = 0, Hi2 = [], Wi2 = 0, $i2 = null, Vi2 = 1, Yi2 = ""; + function Gi2(e3, t3) { + Ui2[Fi2++] = qi2, Ui2[Fi2++] = Ki2, Ki2 = e3, qi2 = t3; + } + function Zi2(e3, t3, n3) { + Hi2[Wi2++] = Vi2, Hi2[Wi2++] = Yi2, Hi2[Wi2++] = $i2, $i2 = e3; + var r3 = Vi2; + e3 = Yi2; + var i3 = 32 - rt2(r3) - 1; + r3 &= ~(1 << i3), n3 += 1; + var o3 = 32 - rt2(t3) + i3; + if (30 < o3) { + var a3 = i3 - i3 % 5; + o3 = (r3 & (1 << a3) - 1).toString(32), r3 >>= a3, i3 -= a3, Vi2 = 1 << 32 - rt2(t3) + i3 | n3 << i3 | r3, Yi2 = o3 + e3; + } else + Vi2 = 1 << o3 | n3 << i3 | r3, Yi2 = e3; + } + function Qi2(e3) { + null !== e3.return && (Gi2(e3, 1), Zi2(e3, 1, 0)); + } + function Ji2(e3) { + for (; e3 === Ki2; ) + Ki2 = Ui2[--Fi2], Ui2[Fi2] = null, qi2 = Ui2[--Fi2], Ui2[Fi2] = null; + for (; e3 === $i2; ) + $i2 = Hi2[--Wi2], Hi2[Wi2] = null, Yi2 = Hi2[--Wi2], Hi2[Wi2] = null, Vi2 = Hi2[--Wi2], Hi2[Wi2] = null; + } + var Xi2 = null, eo2 = null, to2 = false, no2 = null; + function ro2(e3, t3) { + var n3 = Rl2(5, null, null, 0); + n3.elementType = "DELETED", n3.stateNode = t3, n3.return = e3, null === (t3 = e3.deletions) ? (e3.deletions = [n3], e3.flags |= 16) : t3.push(n3); + } + function io2(e3, t3) { + switch (e3.tag) { + case 5: + var n3 = e3.type; + return null !== (t3 = 1 !== t3.nodeType || n3.toLowerCase() !== t3.nodeName.toLowerCase() ? null : t3) && (e3.stateNode = t3, Xi2 = e3, eo2 = ai2(t3.firstChild), true); + case 6: + return null !== (t3 = "" === e3.pendingProps || 3 !== t3.nodeType ? null : t3) && (e3.stateNode = t3, Xi2 = e3, eo2 = null, true); + case 13: + return null !== (t3 = 8 !== t3.nodeType ? null : t3) && (n3 = null !== $i2 ? { id: Vi2, overflow: Yi2 } : null, e3.memoizedState = { dehydrated: t3, treeContext: n3, retryLane: 1073741824 }, (n3 = Rl2(18, null, null, 0)).stateNode = t3, n3.return = e3, e3.child = n3, Xi2 = e3, eo2 = null, true); + default: + return false; + } + } + function oo2(e3) { + return 0 != (1 & e3.mode) && 0 == (128 & e3.flags); + } + function ao2(e3) { + if (to2) { + var t3 = eo2; + if (t3) { + var r3 = t3; + if (!io2(e3, t3)) { + if (oo2(e3)) + throw Error(n2(418)); + t3 = ai2(r3.nextSibling); + var i3 = Xi2; + t3 && io2(e3, t3) ? ro2(i3, r3) : (e3.flags = -4097 & e3.flags | 2, to2 = false, Xi2 = e3); + } + } else { + if (oo2(e3)) + throw Error(n2(418)); + e3.flags = -4097 & e3.flags | 2, to2 = false, Xi2 = e3; + } + } + } + function so2(e3) { + for (e3 = e3.return; null !== e3 && 5 !== e3.tag && 3 !== e3.tag && 13 !== e3.tag; ) + e3 = e3.return; + Xi2 = e3; + } + function uo2(e3) { + if (e3 !== Xi2) + return false; + if (!to2) + return so2(e3), to2 = true, false; + var t3; + if ((t3 = 3 !== e3.tag) && !(t3 = 5 !== e3.tag) && (t3 = "head" !== (t3 = e3.type) && "body" !== t3 && !Xr2(e3.type, e3.memoizedProps)), t3 && (t3 = eo2)) { + if (oo2(e3)) + throw lo2(), Error(n2(418)); + for (; t3; ) + ro2(e3, t3), t3 = ai2(t3.nextSibling); + } + if (so2(e3), 13 === e3.tag) { + if (!(e3 = null !== (e3 = e3.memoizedState) ? e3.dehydrated : null)) + throw Error(n2(317)); + e: { + for (e3 = e3.nextSibling, t3 = 0; e3; ) { + if (8 === e3.nodeType) { + var r3 = e3.data; + if ("/$" === r3) { + if (0 === t3) { + eo2 = ai2(e3.nextSibling); + break e; + } + t3--; + } else + "$" !== r3 && "$!" !== r3 && "$?" !== r3 || t3++; + } + e3 = e3.nextSibling; + } + eo2 = null; + } + } else + eo2 = Xi2 ? ai2(e3.stateNode.nextSibling) : null; + return true; + } + function lo2() { + for (var e3 = eo2; e3; ) + e3 = ai2(e3.nextSibling); + } + function co2() { + eo2 = Xi2 = null, to2 = false; + } + function fo2(e3) { + null === no2 ? no2 = [e3] : no2.push(e3); + } + var ho2 = v2.ReactCurrentBatchConfig; + function po2(e3, t3) { + if (e3 && e3.defaultProps) { + for (var n3 in t3 = O2({}, t3), e3 = e3.defaultProps) + void 0 === t3[n3] && (t3[n3] = e3[n3]); + return t3; + } + return t3; + } + var mo2 = _i2(null), go2 = null, vo2 = null, bo2 = null; + function yo2() { + bo2 = vo2 = go2 = null; + } + function wo2(e3) { + var t3 = mo2.current; + Si2(mo2), e3._currentValue = t3; + } + function _o2(e3, t3, n3) { + for (; null !== e3; ) { + var r3 = e3.alternate; + if ((e3.childLanes & t3) !== t3 ? (e3.childLanes |= t3, null !== r3 && (r3.childLanes |= t3)) : null !== r3 && (r3.childLanes & t3) !== t3 && (r3.childLanes |= t3), e3 === n3) + break; + e3 = e3.return; + } + } + function So2(e3, t3) { + go2 = e3, bo2 = vo2 = null, null !== (e3 = e3.dependencies) && null !== e3.firstContext && (0 != (e3.lanes & t3) && (vs2 = true), e3.firstContext = null); + } + function Eo2(e3) { + var t3 = e3._currentValue; + if (bo2 !== e3) + if (e3 = { context: e3, memoizedValue: t3, next: null }, null === vo2) { + if (null === go2) + throw Error(n2(308)); + vo2 = e3, go2.dependencies = { lanes: 0, firstContext: e3 }; + } else + vo2 = vo2.next = e3; + return t3; + } + var ko2 = null; + function Mo2(e3) { + null === ko2 ? ko2 = [e3] : ko2.push(e3); + } + function Co2(e3, t3, n3, r3) { + var i3 = t3.interleaved; + return null === i3 ? (n3.next = n3, Mo2(t3)) : (n3.next = i3.next, i3.next = n3), t3.interleaved = n3, xo2(e3, r3); + } + function xo2(e3, t3) { + e3.lanes |= t3; + var n3 = e3.alternate; + for (null !== n3 && (n3.lanes |= t3), n3 = e3, e3 = e3.return; null !== e3; ) + e3.childLanes |= t3, null !== (n3 = e3.alternate) && (n3.childLanes |= t3), n3 = e3, e3 = e3.return; + return 3 === n3.tag ? n3.stateNode : null; + } + var Ao2 = false; + function Ro2(e3) { + e3.updateQueue = { baseState: e3.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: 0 }, effects: null }; + } + function To2(e3, t3) { + e3 = e3.updateQueue, t3.updateQueue === e3 && (t3.updateQueue = { baseState: e3.baseState, firstBaseUpdate: e3.firstBaseUpdate, lastBaseUpdate: e3.lastBaseUpdate, shared: e3.shared, effects: e3.effects }); + } + function Po2(e3, t3) { + return { eventTime: e3, lane: t3, tag: 0, payload: null, callback: null, next: null }; + } + function Lo2(e3, t3, n3) { + var r3 = e3.updateQueue; + if (null === r3) + return null; + if (r3 = r3.shared, 0 != (2 & Cu2)) { + var i3 = r3.pending; + return null === i3 ? t3.next = t3 : (t3.next = i3.next, i3.next = t3), r3.pending = t3, xo2(e3, n3); + } + return null === (i3 = r3.interleaved) ? (t3.next = t3, Mo2(r3)) : (t3.next = i3.next, i3.next = t3), r3.interleaved = t3, xo2(e3, n3); + } + function Io2(e3, t3, n3) { + if (null !== (t3 = t3.updateQueue) && (t3 = t3.shared, 0 != (4194240 & n3))) { + var r3 = t3.lanes; + n3 |= r3 &= e3.pendingLanes, t3.lanes = n3, mt2(e3, n3); + } + } + function Oo2(e3, t3) { + var n3 = e3.updateQueue, r3 = e3.alternate; + if (null !== r3 && n3 === (r3 = r3.updateQueue)) { + var i3 = null, o3 = null; + if (null !== (n3 = n3.firstBaseUpdate)) { + do { + var a3 = { eventTime: n3.eventTime, lane: n3.lane, tag: n3.tag, payload: n3.payload, callback: n3.callback, next: null }; + null === o3 ? i3 = o3 = a3 : o3 = o3.next = a3, n3 = n3.next; + } while (null !== n3); + null === o3 ? i3 = o3 = t3 : o3 = o3.next = t3; + } else + i3 = o3 = t3; + return n3 = { baseState: r3.baseState, firstBaseUpdate: i3, lastBaseUpdate: o3, shared: r3.shared, effects: r3.effects }, void (e3.updateQueue = n3); + } + null === (e3 = n3.lastBaseUpdate) ? n3.firstBaseUpdate = t3 : e3.next = t3, n3.lastBaseUpdate = t3; + } + function No2(e3, t3, n3, r3) { + var i3 = e3.updateQueue; + Ao2 = false; + var o3 = i3.firstBaseUpdate, a3 = i3.lastBaseUpdate, s3 = i3.shared.pending; + if (null !== s3) { + i3.shared.pending = null; + var u3 = s3, l3 = u3.next; + u3.next = null, null === a3 ? o3 = l3 : a3.next = l3, a3 = u3; + var c3 = e3.alternate; + null !== c3 && ((s3 = (c3 = c3.updateQueue).lastBaseUpdate) !== a3 && (null === s3 ? c3.firstBaseUpdate = l3 : s3.next = l3, c3.lastBaseUpdate = u3)); + } + if (null !== o3) { + var d3 = i3.baseState; + for (a3 = 0, c3 = l3 = u3 = null, s3 = o3; ; ) { + var f3 = s3.lane, h3 = s3.eventTime; + if ((r3 & f3) === f3) { + null !== c3 && (c3 = c3.next = { eventTime: h3, lane: 0, tag: s3.tag, payload: s3.payload, callback: s3.callback, next: null }); + e: { + var p3 = e3, m3 = s3; + switch (f3 = t3, h3 = n3, m3.tag) { + case 1: + if ("function" == typeof (p3 = m3.payload)) { + d3 = p3.call(h3, d3, f3); + break e; + } + d3 = p3; + break e; + case 3: + p3.flags = -65537 & p3.flags | 128; + case 0: + if (null == (f3 = "function" == typeof (p3 = m3.payload) ? p3.call(h3, d3, f3) : p3)) + break e; + d3 = O2({}, d3, f3); + break e; + case 2: + Ao2 = true; + } + } + null !== s3.callback && 0 !== s3.lane && (e3.flags |= 64, null === (f3 = i3.effects) ? i3.effects = [s3] : f3.push(s3)); + } else + h3 = { eventTime: h3, lane: f3, tag: s3.tag, payload: s3.payload, callback: s3.callback, next: null }, null === c3 ? (l3 = c3 = h3, u3 = d3) : c3 = c3.next = h3, a3 |= f3; + if (null === (s3 = s3.next)) { + if (null === (s3 = i3.shared.pending)) + break; + s3 = (f3 = s3).next, f3.next = null, i3.lastBaseUpdate = f3, i3.shared.pending = null; + } + } + if (null === c3 && (u3 = d3), i3.baseState = u3, i3.firstBaseUpdate = l3, i3.lastBaseUpdate = c3, null !== (t3 = i3.shared.interleaved)) { + i3 = t3; + do { + a3 |= i3.lane, i3 = i3.next; + } while (i3 !== t3); + } else + null === o3 && (i3.shared.lanes = 0); + Ou2 |= a3, e3.lanes = a3, e3.memoizedState = d3; + } + } + function Do2(e3, t3, r3) { + if (e3 = t3.effects, t3.effects = null, null !== e3) + for (t3 = 0; t3 < e3.length; t3++) { + var i3 = e3[t3], o3 = i3.callback; + if (null !== o3) { + if (i3.callback = null, i3 = r3, "function" != typeof o3) + throw Error(n2(191, o3)); + o3.call(i3); + } + } + } + var jo2 = new e2.Component().refs; + function Bo2(e3, t3, n3, r3) { + n3 = null == (n3 = n3(r3, t3 = e3.memoizedState)) ? t3 : O2({}, t3, n3), e3.memoizedState = n3, 0 === e3.lanes && (e3.updateQueue.baseState = n3); + } + var zo2 = { isMounted: function(e3) { + return !!(e3 = e3._reactInternals) && ze2(e3) === e3; + }, enqueueSetState: function(e3, t3, n3) { + e3 = e3._reactInternals; + var r3 = Ju2(), i3 = Xu2(e3), o3 = Po2(r3, i3); + o3.payload = t3, null != n3 && (o3.callback = n3), null !== (t3 = Lo2(e3, o3, i3)) && (el2(t3, e3, i3, r3), Io2(t3, e3, i3)); + }, enqueueReplaceState: function(e3, t3, n3) { + e3 = e3._reactInternals; + var r3 = Ju2(), i3 = Xu2(e3), o3 = Po2(r3, i3); + o3.tag = 1, o3.payload = t3, null != n3 && (o3.callback = n3), null !== (t3 = Lo2(e3, o3, i3)) && (el2(t3, e3, i3, r3), Io2(t3, e3, i3)); + }, enqueueForceUpdate: function(e3, t3) { + e3 = e3._reactInternals; + var n3 = Ju2(), r3 = Xu2(e3), i3 = Po2(n3, r3); + i3.tag = 2, null != t3 && (i3.callback = t3), null !== (t3 = Lo2(e3, i3, r3)) && (el2(t3, e3, r3, n3), Io2(t3, e3, r3)); + } }; + function Uo2(e3, t3, n3, r3, i3, o3, a3) { + return "function" == typeof (e3 = e3.stateNode).shouldComponentUpdate ? e3.shouldComponentUpdate(r3, o3, a3) : !t3.prototype || !t3.prototype.isPureReactComponent || (!or2(n3, r3) || !or2(i3, o3)); + } + function Fo2(e3, t3, n3) { + var r3 = false, i3 = ki2, o3 = t3.contextType; + return "object" == typeof o3 && null !== o3 ? o3 = Eo2(o3) : (i3 = Ri2(t3) ? xi2 : Mi2.current, o3 = (r3 = null != (r3 = t3.contextTypes)) ? Ai2(e3, i3) : ki2), t3 = new t3(n3, o3), e3.memoizedState = null !== t3.state && void 0 !== t3.state ? t3.state : null, t3.updater = zo2, e3.stateNode = t3, t3._reactInternals = e3, r3 && ((e3 = e3.stateNode).__reactInternalMemoizedUnmaskedChildContext = i3, e3.__reactInternalMemoizedMaskedChildContext = o3), t3; + } + function Ko2(e3, t3, n3, r3) { + e3 = t3.state, "function" == typeof t3.componentWillReceiveProps && t3.componentWillReceiveProps(n3, r3), "function" == typeof t3.UNSAFE_componentWillReceiveProps && t3.UNSAFE_componentWillReceiveProps(n3, r3), t3.state !== e3 && zo2.enqueueReplaceState(t3, t3.state, null); + } + function qo2(e3, t3, n3, r3) { + var i3 = e3.stateNode; + i3.props = n3, i3.state = e3.memoizedState, i3.refs = jo2, Ro2(e3); + var o3 = t3.contextType; + "object" == typeof o3 && null !== o3 ? i3.context = Eo2(o3) : (o3 = Ri2(t3) ? xi2 : Mi2.current, i3.context = Ai2(e3, o3)), i3.state = e3.memoizedState, "function" == typeof (o3 = t3.getDerivedStateFromProps) && (Bo2(e3, t3, o3, n3), i3.state = e3.memoizedState), "function" == typeof t3.getDerivedStateFromProps || "function" == typeof i3.getSnapshotBeforeUpdate || "function" != typeof i3.UNSAFE_componentWillMount && "function" != typeof i3.componentWillMount || (t3 = i3.state, "function" == typeof i3.componentWillMount && i3.componentWillMount(), "function" == typeof i3.UNSAFE_componentWillMount && i3.UNSAFE_componentWillMount(), t3 !== i3.state && zo2.enqueueReplaceState(i3, i3.state, null), No2(e3, n3, i3, r3), i3.state = e3.memoizedState), "function" == typeof i3.componentDidMount && (e3.flags |= 4194308); + } + function Ho2(e3, t3, r3) { + if (null !== (e3 = r3.ref) && "function" != typeof e3 && "object" != typeof e3) { + if (r3._owner) { + if (r3 = r3._owner) { + if (1 !== r3.tag) + throw Error(n2(309)); + var i3 = r3.stateNode; + } + if (!i3) + throw Error(n2(147, e3)); + var o3 = i3, a3 = "" + e3; + return null !== t3 && null !== t3.ref && "function" == typeof t3.ref && t3.ref._stringRef === a3 ? t3.ref : (t3 = function(e4) { + var t4 = o3.refs; + t4 === jo2 && (t4 = o3.refs = {}), null === e4 ? delete t4[a3] : t4[a3] = e4; + }, t3._stringRef = a3, t3); + } + if ("string" != typeof e3) + throw Error(n2(284)); + if (!r3._owner) + throw Error(n2(290, e3)); + } + return e3; + } + function Wo2(e3, t3) { + throw e3 = Object.prototype.toString.call(t3), Error(n2(31, "[object Object]" === e3 ? "object with keys {" + Object.keys(t3).join(", ") + "}" : e3)); + } + function $o2(e3) { + return (0, e3._init)(e3._payload); + } + function Vo2(e3) { + function t3(t4, n3) { + if (e3) { + var r4 = t4.deletions; + null === r4 ? (t4.deletions = [n3], t4.flags |= 16) : r4.push(n3); + } + } + function r3(n3, r4) { + if (!e3) + return null; + for (; null !== r4; ) + t3(n3, r4), r4 = r4.sibling; + return null; + } + function i3(e4, t4) { + for (e4 = /* @__PURE__ */ new Map(); null !== t4; ) + null !== t4.key ? e4.set(t4.key, t4) : e4.set(t4.index, t4), t4 = t4.sibling; + return e4; + } + function o3(e4, t4) { + return (e4 = Pl2(e4, t4)).index = 0, e4.sibling = null, e4; + } + function a3(t4, n3, r4) { + return t4.index = r4, e3 ? null !== (r4 = t4.alternate) ? (r4 = r4.index) < n3 ? (t4.flags |= 2, n3) : r4 : (t4.flags |= 2, n3) : (t4.flags |= 1048576, n3); + } + function s3(t4) { + return e3 && null === t4.alternate && (t4.flags |= 2), t4; + } + function u3(e4, t4, n3, r4) { + return null === t4 || 6 !== t4.tag ? ((t4 = Nl2(n3, e4.mode, r4)).return = e4, t4) : ((t4 = o3(t4, n3)).return = e4, t4); + } + function l3(e4, t4, n3, r4) { + var i4 = n3.type; + return i4 === w2 ? d3(e4, t4, n3.props.children, r4, n3.key) : null !== t4 && (t4.elementType === i4 || "object" == typeof i4 && null !== i4 && i4.$$typeof === R2 && $o2(i4) === t4.type) ? ((r4 = o3(t4, n3.props)).ref = Ho2(e4, t4, n3), r4.return = e4, r4) : ((r4 = Ll2(n3.type, n3.key, n3.props, null, e4.mode, r4)).ref = Ho2(e4, t4, n3), r4.return = e4, r4); + } + function c3(e4, t4, n3, r4) { + return null === t4 || 4 !== t4.tag || t4.stateNode.containerInfo !== n3.containerInfo || t4.stateNode.implementation !== n3.implementation ? ((t4 = Dl2(n3, e4.mode, r4)).return = e4, t4) : ((t4 = o3(t4, n3.children || [])).return = e4, t4); + } + function d3(e4, t4, n3, r4, i4) { + return null === t4 || 7 !== t4.tag ? ((t4 = Il2(n3, e4.mode, r4, i4)).return = e4, t4) : ((t4 = o3(t4, n3)).return = e4, t4); + } + function f3(e4, t4, n3) { + if ("string" == typeof t4 && "" !== t4 || "number" == typeof t4) + return (t4 = Nl2("" + t4, e4.mode, n3)).return = e4, t4; + if ("object" == typeof t4 && null !== t4) { + switch (t4.$$typeof) { + case b2: + return (n3 = Ll2(t4.type, t4.key, t4.props, null, e4.mode, n3)).ref = Ho2(e4, null, t4), n3.return = e4, n3; + case y2: + return (t4 = Dl2(t4, e4.mode, n3)).return = e4, t4; + case R2: + return f3(e4, (0, t4._init)(t4._payload), n3); + } + if (J2(t4) || L2(t4)) + return (t4 = Il2(t4, e4.mode, n3, null)).return = e4, t4; + Wo2(e4, t4); + } + return null; + } + function h3(e4, t4, n3, r4) { + var i4 = null !== t4 ? t4.key : null; + if ("string" == typeof n3 && "" !== n3 || "number" == typeof n3) + return null !== i4 ? null : u3(e4, t4, "" + n3, r4); + if ("object" == typeof n3 && null !== n3) { + switch (n3.$$typeof) { + case b2: + return n3.key === i4 ? l3(e4, t4, n3, r4) : null; + case y2: + return n3.key === i4 ? c3(e4, t4, n3, r4) : null; + case R2: + return h3(e4, t4, (i4 = n3._init)(n3._payload), r4); + } + if (J2(n3) || L2(n3)) + return null !== i4 ? null : d3(e4, t4, n3, r4, null); + Wo2(e4, n3); + } + return null; + } + function p3(e4, t4, n3, r4, i4) { + if ("string" == typeof r4 && "" !== r4 || "number" == typeof r4) + return u3(t4, e4 = e4.get(n3) || null, "" + r4, i4); + if ("object" == typeof r4 && null !== r4) { + switch (r4.$$typeof) { + case b2: + return l3(t4, e4 = e4.get(null === r4.key ? n3 : r4.key) || null, r4, i4); + case y2: + return c3(t4, e4 = e4.get(null === r4.key ? n3 : r4.key) || null, r4, i4); + case R2: + return p3(e4, t4, n3, (0, r4._init)(r4._payload), i4); + } + if (J2(r4) || L2(r4)) + return d3(t4, e4 = e4.get(n3) || null, r4, i4, null); + Wo2(t4, r4); + } + return null; + } + function m3(n3, o4, s4, u4) { + for (var l4 = null, c4 = null, d4 = o4, m4 = o4 = 0, g4 = null; null !== d4 && m4 < s4.length; m4++) { + d4.index > m4 ? (g4 = d4, d4 = null) : g4 = d4.sibling; + var v3 = h3(n3, d4, s4[m4], u4); + if (null === v3) { + null === d4 && (d4 = g4); + break; + } + e3 && d4 && null === v3.alternate && t3(n3, d4), o4 = a3(v3, o4, m4), null === c4 ? l4 = v3 : c4.sibling = v3, c4 = v3, d4 = g4; + } + if (m4 === s4.length) + return r3(n3, d4), to2 && Gi2(n3, m4), l4; + if (null === d4) { + for (; m4 < s4.length; m4++) + null !== (d4 = f3(n3, s4[m4], u4)) && (o4 = a3(d4, o4, m4), null === c4 ? l4 = d4 : c4.sibling = d4, c4 = d4); + return to2 && Gi2(n3, m4), l4; + } + for (d4 = i3(n3, d4); m4 < s4.length; m4++) + null !== (g4 = p3(d4, n3, m4, s4[m4], u4)) && (e3 && null !== g4.alternate && d4.delete(null === g4.key ? m4 : g4.key), o4 = a3(g4, o4, m4), null === c4 ? l4 = g4 : c4.sibling = g4, c4 = g4); + return e3 && d4.forEach(function(e4) { + return t3(n3, e4); + }), to2 && Gi2(n3, m4), l4; + } + function g3(o4, s4, u4, l4) { + var c4 = L2(u4); + if ("function" != typeof c4) + throw Error(n2(150)); + if (null == (u4 = c4.call(u4))) + throw Error(n2(151)); + for (var d4 = c4 = null, m4 = s4, g4 = s4 = 0, v3 = null, b3 = u4.next(); null !== m4 && !b3.done; g4++, b3 = u4.next()) { + m4.index > g4 ? (v3 = m4, m4 = null) : v3 = m4.sibling; + var y3 = h3(o4, m4, b3.value, l4); + if (null === y3) { + null === m4 && (m4 = v3); + break; + } + e3 && m4 && null === y3.alternate && t3(o4, m4), s4 = a3(y3, s4, g4), null === d4 ? c4 = y3 : d4.sibling = y3, d4 = y3, m4 = v3; + } + if (b3.done) + return r3(o4, m4), to2 && Gi2(o4, g4), c4; + if (null === m4) { + for (; !b3.done; g4++, b3 = u4.next()) + null !== (b3 = f3(o4, b3.value, l4)) && (s4 = a3(b3, s4, g4), null === d4 ? c4 = b3 : d4.sibling = b3, d4 = b3); + return to2 && Gi2(o4, g4), c4; + } + for (m4 = i3(o4, m4); !b3.done; g4++, b3 = u4.next()) + null !== (b3 = p3(m4, o4, g4, b3.value, l4)) && (e3 && null !== b3.alternate && m4.delete(null === b3.key ? g4 : b3.key), s4 = a3(b3, s4, g4), null === d4 ? c4 = b3 : d4.sibling = b3, d4 = b3); + return e3 && m4.forEach(function(e4) { + return t3(o4, e4); + }), to2 && Gi2(o4, g4), c4; + } + return function e4(n3, i4, a4, u4) { + if ("object" == typeof a4 && null !== a4 && a4.type === w2 && null === a4.key && (a4 = a4.props.children), "object" == typeof a4 && null !== a4) { + switch (a4.$$typeof) { + case b2: + e: { + for (var l4 = a4.key, c4 = i4; null !== c4; ) { + if (c4.key === l4) { + if ((l4 = a4.type) === w2) { + if (7 === c4.tag) { + r3(n3, c4.sibling), (i4 = o3(c4, a4.props.children)).return = n3, n3 = i4; + break e; + } + } else if (c4.elementType === l4 || "object" == typeof l4 && null !== l4 && l4.$$typeof === R2 && $o2(l4) === c4.type) { + r3(n3, c4.sibling), (i4 = o3(c4, a4.props)).ref = Ho2(n3, c4, a4), i4.return = n3, n3 = i4; + break e; + } + r3(n3, c4); + break; + } + t3(n3, c4), c4 = c4.sibling; + } + a4.type === w2 ? ((i4 = Il2(a4.props.children, n3.mode, u4, a4.key)).return = n3, n3 = i4) : ((u4 = Ll2(a4.type, a4.key, a4.props, null, n3.mode, u4)).ref = Ho2(n3, i4, a4), u4.return = n3, n3 = u4); + } + return s3(n3); + case y2: + e: { + for (c4 = a4.key; null !== i4; ) { + if (i4.key === c4) { + if (4 === i4.tag && i4.stateNode.containerInfo === a4.containerInfo && i4.stateNode.implementation === a4.implementation) { + r3(n3, i4.sibling), (i4 = o3(i4, a4.children || [])).return = n3, n3 = i4; + break e; + } + r3(n3, i4); + break; + } + t3(n3, i4), i4 = i4.sibling; + } + (i4 = Dl2(a4, n3.mode, u4)).return = n3, n3 = i4; + } + return s3(n3); + case R2: + return e4(n3, i4, (c4 = a4._init)(a4._payload), u4); + } + if (J2(a4)) + return m3(n3, i4, a4, u4); + if (L2(a4)) + return g3(n3, i4, a4, u4); + Wo2(n3, a4); + } + return "string" == typeof a4 && "" !== a4 || "number" == typeof a4 ? (a4 = "" + a4, null !== i4 && 6 === i4.tag ? (r3(n3, i4.sibling), (i4 = o3(i4, a4)).return = n3, n3 = i4) : (r3(n3, i4), (i4 = Nl2(a4, n3.mode, u4)).return = n3, n3 = i4), s3(n3)) : r3(n3, i4); + }; + } + var Yo2 = Vo2(true), Go2 = Vo2(false), Zo2 = {}, Qo2 = _i2(Zo2), Jo2 = _i2(Zo2), Xo2 = _i2(Zo2); + function ea2(e3) { + if (e3 === Zo2) + throw Error(n2(174)); + return e3; + } + function ta2(e3, t3) { + switch (Ei2(Xo2, t3), Ei2(Jo2, e3), Ei2(Qo2, Zo2), e3 = t3.nodeType) { + case 9: + case 11: + t3 = (t3 = t3.documentElement) ? t3.namespaceURI : oe2(null, ""); + break; + default: + t3 = oe2(t3 = (e3 = 8 === e3 ? t3.parentNode : t3).namespaceURI || null, e3 = e3.tagName); + } + Si2(Qo2), Ei2(Qo2, t3); + } + function na2() { + Si2(Qo2), Si2(Jo2), Si2(Xo2); + } + function ra2(e3) { + ea2(Xo2.current); + var t3 = ea2(Qo2.current), n3 = oe2(t3, e3.type); + t3 !== n3 && (Ei2(Jo2, e3), Ei2(Qo2, n3)); + } + function ia2(e3) { + Jo2.current === e3 && (Si2(Qo2), Si2(Jo2)); + } + var oa2 = _i2(0); + function aa2(e3) { + for (var t3 = e3; null !== t3; ) { + if (13 === t3.tag) { + var n3 = t3.memoizedState; + if (null !== n3 && (null === (n3 = n3.dehydrated) || "$?" === n3.data || "$!" === n3.data)) + return t3; + } else if (19 === t3.tag && void 0 !== t3.memoizedProps.revealOrder) { + if (0 != (128 & t3.flags)) + return t3; + } else if (null !== t3.child) { + t3.child.return = t3, t3 = t3.child; + continue; + } + if (t3 === e3) + break; + for (; null === t3.sibling; ) { + if (null === t3.return || t3.return === e3) + return null; + t3 = t3.return; + } + t3.sibling.return = t3.return, t3 = t3.sibling; + } + return null; + } + var sa2 = []; + function ua2() { + for (var e3 = 0; e3 < sa2.length; e3++) + sa2[e3]._workInProgressVersionPrimary = null; + sa2.length = 0; + } + var la2 = v2.ReactCurrentDispatcher, ca2 = v2.ReactCurrentBatchConfig, da2 = 0, fa2 = null, ha2 = null, pa2 = null, ma2 = false, ga2 = false, va2 = 0, ba2 = 0; + function ya2() { + throw Error(n2(321)); + } + function wa2(e3, t3) { + if (null === t3) + return false; + for (var n3 = 0; n3 < t3.length && n3 < e3.length; n3++) + if (!ir2(e3[n3], t3[n3])) + return false; + return true; + } + function _a2(e3, t3, r3, i3, o3, a3) { + if (da2 = a3, fa2 = t3, t3.memoizedState = null, t3.updateQueue = null, t3.lanes = 0, la2.current = null === e3 || null === e3.memoizedState ? is2 : os2, e3 = r3(i3, o3), ga2) { + a3 = 0; + do { + if (ga2 = false, va2 = 0, 25 <= a3) + throw Error(n2(301)); + a3 += 1, pa2 = ha2 = null, t3.updateQueue = null, la2.current = as2, e3 = r3(i3, o3); + } while (ga2); + } + if (la2.current = rs2, t3 = null !== ha2 && null !== ha2.next, da2 = 0, pa2 = ha2 = fa2 = null, ma2 = false, t3) + throw Error(n2(300)); + return e3; + } + function Sa2() { + var e3 = 0 !== va2; + return va2 = 0, e3; + } + function Ea2() { + var e3 = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null }; + return null === pa2 ? fa2.memoizedState = pa2 = e3 : pa2 = pa2.next = e3, pa2; + } + function ka2() { + if (null === ha2) { + var e3 = fa2.alternate; + e3 = null !== e3 ? e3.memoizedState : null; + } else + e3 = ha2.next; + var t3 = null === pa2 ? fa2.memoizedState : pa2.next; + if (null !== t3) + pa2 = t3, ha2 = e3; + else { + if (null === e3) + throw Error(n2(310)); + e3 = { memoizedState: (ha2 = e3).memoizedState, baseState: ha2.baseState, baseQueue: ha2.baseQueue, queue: ha2.queue, next: null }, null === pa2 ? fa2.memoizedState = pa2 = e3 : pa2 = pa2.next = e3; + } + return pa2; + } + function Ma2(e3, t3) { + return "function" == typeof t3 ? t3(e3) : t3; + } + function Ca2(e3) { + var t3 = ka2(), r3 = t3.queue; + if (null === r3) + throw Error(n2(311)); + r3.lastRenderedReducer = e3; + var i3 = ha2, o3 = i3.baseQueue, a3 = r3.pending; + if (null !== a3) { + if (null !== o3) { + var s3 = o3.next; + o3.next = a3.next, a3.next = s3; + } + i3.baseQueue = o3 = a3, r3.pending = null; + } + if (null !== o3) { + a3 = o3.next, i3 = i3.baseState; + var u3 = s3 = null, l3 = null, c3 = a3; + do { + var d3 = c3.lane; + if ((da2 & d3) === d3) + null !== l3 && (l3 = l3.next = { lane: 0, action: c3.action, hasEagerState: c3.hasEagerState, eagerState: c3.eagerState, next: null }), i3 = c3.hasEagerState ? c3.eagerState : e3(i3, c3.action); + else { + var f3 = { lane: d3, action: c3.action, hasEagerState: c3.hasEagerState, eagerState: c3.eagerState, next: null }; + null === l3 ? (u3 = l3 = f3, s3 = i3) : l3 = l3.next = f3, fa2.lanes |= d3, Ou2 |= d3; + } + c3 = c3.next; + } while (null !== c3 && c3 !== a3); + null === l3 ? s3 = i3 : l3.next = u3, ir2(i3, t3.memoizedState) || (vs2 = true), t3.memoizedState = i3, t3.baseState = s3, t3.baseQueue = l3, r3.lastRenderedState = i3; + } + if (null !== (e3 = r3.interleaved)) { + o3 = e3; + do { + a3 = o3.lane, fa2.lanes |= a3, Ou2 |= a3, o3 = o3.next; + } while (o3 !== e3); + } else + null === o3 && (r3.lanes = 0); + return [t3.memoizedState, r3.dispatch]; + } + function xa2(e3) { + var t3 = ka2(), r3 = t3.queue; + if (null === r3) + throw Error(n2(311)); + r3.lastRenderedReducer = e3; + var i3 = r3.dispatch, o3 = r3.pending, a3 = t3.memoizedState; + if (null !== o3) { + r3.pending = null; + var s3 = o3 = o3.next; + do { + a3 = e3(a3, s3.action), s3 = s3.next; + } while (s3 !== o3); + ir2(a3, t3.memoizedState) || (vs2 = true), t3.memoizedState = a3, null === t3.baseQueue && (t3.baseState = a3), r3.lastRenderedState = a3; + } + return [a3, i3]; + } + function Aa2() { + } + function Ra2(e3, t3) { + var r3 = fa2, i3 = ka2(), o3 = t3(), a3 = !ir2(i3.memoizedState, o3); + if (a3 && (i3.memoizedState = o3, vs2 = true), i3 = i3.queue, Fa2(La2.bind(null, r3, i3, e3), [e3]), i3.getSnapshot !== t3 || a3 || null !== pa2 && 1 & pa2.memoizedState.tag) { + if (r3.flags |= 2048, Da2(9, Pa2.bind(null, r3, i3, o3, t3), void 0, null), null === xu2) + throw Error(n2(349)); + 0 != (30 & da2) || Ta2(r3, t3, o3); + } + return o3; + } + function Ta2(e3, t3, n3) { + e3.flags |= 16384, e3 = { getSnapshot: t3, value: n3 }, null === (t3 = fa2.updateQueue) ? (t3 = { lastEffect: null, stores: null }, fa2.updateQueue = t3, t3.stores = [e3]) : null === (n3 = t3.stores) ? t3.stores = [e3] : n3.push(e3); + } + function Pa2(e3, t3, n3, r3) { + t3.value = n3, t3.getSnapshot = r3, Ia2(t3) && Oa2(e3); + } + function La2(e3, t3, n3) { + return n3(function() { + Ia2(t3) && Oa2(e3); + }); + } + function Ia2(e3) { + var t3 = e3.getSnapshot; + e3 = e3.value; + try { + var n3 = t3(); + return !ir2(e3, n3); + } catch (e4) { + return true; + } + } + function Oa2(e3) { + var t3 = xo2(e3, 1); + null !== t3 && el2(t3, e3, 1, -1); + } + function Na2(e3) { + var t3 = Ea2(); + return "function" == typeof e3 && (e3 = e3()), t3.memoizedState = t3.baseState = e3, e3 = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: Ma2, lastRenderedState: e3 }, t3.queue = e3, e3 = e3.dispatch = Xa2.bind(null, fa2, e3), [t3.memoizedState, e3]; + } + function Da2(e3, t3, n3, r3) { + return e3 = { tag: e3, create: t3, destroy: n3, deps: r3, next: null }, null === (t3 = fa2.updateQueue) ? (t3 = { lastEffect: null, stores: null }, fa2.updateQueue = t3, t3.lastEffect = e3.next = e3) : null === (n3 = t3.lastEffect) ? t3.lastEffect = e3.next = e3 : (r3 = n3.next, n3.next = e3, e3.next = r3, t3.lastEffect = e3), e3; + } + function ja2() { + return ka2().memoizedState; + } + function Ba2(e3, t3, n3, r3) { + var i3 = Ea2(); + fa2.flags |= e3, i3.memoizedState = Da2(1 | t3, n3, void 0, void 0 === r3 ? null : r3); + } + function za2(e3, t3, n3, r3) { + var i3 = ka2(); + r3 = void 0 === r3 ? null : r3; + var o3 = void 0; + if (null !== ha2) { + var a3 = ha2.memoizedState; + if (o3 = a3.destroy, null !== r3 && wa2(r3, a3.deps)) + return void (i3.memoizedState = Da2(t3, n3, o3, r3)); + } + fa2.flags |= e3, i3.memoizedState = Da2(1 | t3, n3, o3, r3); + } + function Ua2(e3, t3) { + return Ba2(8390656, 8, e3, t3); + } + function Fa2(e3, t3) { + return za2(2048, 8, e3, t3); + } + function Ka2(e3, t3) { + return za2(4, 2, e3, t3); + } + function qa2(e3, t3) { + return za2(4, 4, e3, t3); + } + function Ha2(e3, t3) { + return "function" == typeof t3 ? (e3 = e3(), t3(e3), function() { + t3(null); + }) : null != t3 ? (e3 = e3(), t3.current = e3, function() { + t3.current = null; + }) : void 0; + } + function Wa2(e3, t3, n3) { + return n3 = null != n3 ? n3.concat([e3]) : null, za2(4, 4, Ha2.bind(null, t3, e3), n3); + } + function $a2() { + } + function Va2(e3, t3) { + var n3 = ka2(); + t3 = void 0 === t3 ? null : t3; + var r3 = n3.memoizedState; + return null !== r3 && null !== t3 && wa2(t3, r3[1]) ? r3[0] : (n3.memoizedState = [e3, t3], e3); + } + function Ya2(e3, t3) { + var n3 = ka2(); + t3 = void 0 === t3 ? null : t3; + var r3 = n3.memoizedState; + return null !== r3 && null !== t3 && wa2(t3, r3[1]) ? r3[0] : (e3 = e3(), n3.memoizedState = [e3, t3], e3); + } + function Ga2(e3, t3, n3) { + return 0 == (21 & da2) ? (e3.baseState && (e3.baseState = false, vs2 = true), e3.memoizedState = n3) : (ir2(n3, t3) || (n3 = ft2(), fa2.lanes |= n3, Ou2 |= n3, e3.baseState = true), t3); + } + function Za2(e3, t3) { + var n3 = gt2; + gt2 = 0 !== n3 && 4 > n3 ? n3 : 4, e3(true); + var r3 = ca2.transition; + ca2.transition = {}; + try { + e3(false), t3(); + } finally { + gt2 = n3, ca2.transition = r3; + } + } + function Qa2() { + return ka2().memoizedState; + } + function Ja2(e3, t3, n3) { + var r3 = Xu2(e3); + if (n3 = { lane: r3, action: n3, hasEagerState: false, eagerState: null, next: null }, es2(e3)) + ts2(t3, n3); + else if (null !== (n3 = Co2(e3, t3, n3, r3))) { + el2(n3, e3, r3, Ju2()), ns2(n3, t3, r3); + } + } + function Xa2(e3, t3, n3) { + var r3 = Xu2(e3), i3 = { lane: r3, action: n3, hasEagerState: false, eagerState: null, next: null }; + if (es2(e3)) + ts2(t3, i3); + else { + var o3 = e3.alternate; + if (0 === e3.lanes && (null === o3 || 0 === o3.lanes) && null !== (o3 = t3.lastRenderedReducer)) + try { + var a3 = t3.lastRenderedState, s3 = o3(a3, n3); + if (i3.hasEagerState = true, i3.eagerState = s3, ir2(s3, a3)) { + var u3 = t3.interleaved; + return null === u3 ? (i3.next = i3, Mo2(t3)) : (i3.next = u3.next, u3.next = i3), void (t3.interleaved = i3); + } + } catch (e4) { + } + null !== (n3 = Co2(e3, t3, i3, r3)) && (el2(n3, e3, r3, i3 = Ju2()), ns2(n3, t3, r3)); + } + } + function es2(e3) { + var t3 = e3.alternate; + return e3 === fa2 || null !== t3 && t3 === fa2; + } + function ts2(e3, t3) { + ga2 = ma2 = true; + var n3 = e3.pending; + null === n3 ? t3.next = t3 : (t3.next = n3.next, n3.next = t3), e3.pending = t3; + } + function ns2(e3, t3, n3) { + if (0 != (4194240 & n3)) { + var r3 = t3.lanes; + n3 |= r3 &= e3.pendingLanes, t3.lanes = n3, mt2(e3, n3); + } + } + var rs2 = { readContext: Eo2, useCallback: ya2, useContext: ya2, useEffect: ya2, useImperativeHandle: ya2, useInsertionEffect: ya2, useLayoutEffect: ya2, useMemo: ya2, useReducer: ya2, useRef: ya2, useState: ya2, useDebugValue: ya2, useDeferredValue: ya2, useTransition: ya2, useMutableSource: ya2, useSyncExternalStore: ya2, useId: ya2, unstable_isNewReconciler: false }, is2 = { readContext: Eo2, useCallback: function(e3, t3) { + return Ea2().memoizedState = [e3, void 0 === t3 ? null : t3], e3; + }, useContext: Eo2, useEffect: Ua2, useImperativeHandle: function(e3, t3, n3) { + return n3 = null != n3 ? n3.concat([e3]) : null, Ba2(4194308, 4, Ha2.bind(null, t3, e3), n3); + }, useLayoutEffect: function(e3, t3) { + return Ba2(4194308, 4, e3, t3); + }, useInsertionEffect: function(e3, t3) { + return Ba2(4, 2, e3, t3); + }, useMemo: function(e3, t3) { + var n3 = Ea2(); + return t3 = void 0 === t3 ? null : t3, e3 = e3(), n3.memoizedState = [e3, t3], e3; + }, useReducer: function(e3, t3, n3) { + var r3 = Ea2(); + return t3 = void 0 !== n3 ? n3(t3) : t3, r3.memoizedState = r3.baseState = t3, e3 = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: e3, lastRenderedState: t3 }, r3.queue = e3, e3 = e3.dispatch = Ja2.bind(null, fa2, e3), [r3.memoizedState, e3]; + }, useRef: function(e3) { + return e3 = { current: e3 }, Ea2().memoizedState = e3; + }, useState: Na2, useDebugValue: $a2, useDeferredValue: function(e3) { + return Ea2().memoizedState = e3; + }, useTransition: function() { + var e3 = Na2(false), t3 = e3[0]; + return e3 = Za2.bind(null, e3[1]), Ea2().memoizedState = e3, [t3, e3]; + }, useMutableSource: function() { + }, useSyncExternalStore: function(e3, t3, r3) { + var i3 = fa2, o3 = Ea2(); + if (to2) { + if (void 0 === r3) + throw Error(n2(407)); + r3 = r3(); + } else { + if (r3 = t3(), null === xu2) + throw Error(n2(349)); + 0 != (30 & da2) || Ta2(i3, t3, r3); + } + o3.memoizedState = r3; + var a3 = { value: r3, getSnapshot: t3 }; + return o3.queue = a3, Ua2(La2.bind(null, i3, a3, e3), [e3]), i3.flags |= 2048, Da2(9, Pa2.bind(null, i3, a3, r3, t3), void 0, null), r3; + }, useId: function() { + var e3 = Ea2(), t3 = xu2.identifierPrefix; + if (to2) { + var n3 = Yi2; + t3 = ":" + t3 + "R" + (n3 = (Vi2 & ~(1 << 32 - rt2(Vi2) - 1)).toString(32) + n3), 0 < (n3 = va2++) && (t3 += "H" + n3.toString(32)), t3 += ":"; + } else + t3 = ":" + t3 + "r" + (n3 = ba2++).toString(32) + ":"; + return e3.memoizedState = t3; + }, unstable_isNewReconciler: false }, os2 = { readContext: Eo2, useCallback: Va2, useContext: Eo2, useEffect: Fa2, useImperativeHandle: Wa2, useInsertionEffect: Ka2, useLayoutEffect: qa2, useMemo: Ya2, useReducer: Ca2, useRef: ja2, useState: function() { + return Ca2(Ma2); + }, useDebugValue: $a2, useDeferredValue: function(e3) { + return Ga2(ka2(), ha2.memoizedState, e3); + }, useTransition: function() { + return [Ca2(Ma2)[0], ka2().memoizedState]; + }, useMutableSource: Aa2, useSyncExternalStore: Ra2, useId: Qa2, unstable_isNewReconciler: false }, as2 = { readContext: Eo2, useCallback: Va2, useContext: Eo2, useEffect: Fa2, useImperativeHandle: Wa2, useInsertionEffect: Ka2, useLayoutEffect: qa2, useMemo: Ya2, useReducer: xa2, useRef: ja2, useState: function() { + return xa2(Ma2); + }, useDebugValue: $a2, useDeferredValue: function(e3) { + var t3 = ka2(); + return null === ha2 ? t3.memoizedState = e3 : Ga2(t3, ha2.memoizedState, e3); + }, useTransition: function() { + return [xa2(Ma2)[0], ka2().memoizedState]; + }, useMutableSource: Aa2, useSyncExternalStore: Ra2, useId: Qa2, unstable_isNewReconciler: false }; + function ss2(e3, t3) { + try { + var n3 = "", r3 = t3; + do { + n3 += B2(r3), r3 = r3.return; + } while (r3); + var i3 = n3; + } catch (e4) { + i3 = "\nError generating stack: " + e4.message + "\n" + e4.stack; + } + return { value: e3, source: t3, stack: i3, digest: null }; + } + function us2(e3, t3, n3) { + return { value: e3, source: null, stack: null != n3 ? n3 : null, digest: null != t3 ? t3 : null }; + } + function ls2(e3, t3) { + try { + console.error(t3.value); + } catch (e4) { + setTimeout(function() { + throw e4; + }); + } + } + var cs2 = "function" == typeof WeakMap ? WeakMap : Map; + function ds2(e3, t3, n3) { + (n3 = Po2(-1, n3)).tag = 3, n3.payload = { element: null }; + var r3 = t3.value; + return n3.callback = function() { + Ku2 || (Ku2 = true, qu2 = r3), ls2(0, t3); + }, n3; + } + function fs2(e3, t3, n3) { + (n3 = Po2(-1, n3)).tag = 3; + var r3 = e3.type.getDerivedStateFromError; + if ("function" == typeof r3) { + var i3 = t3.value; + n3.payload = function() { + return r3(i3); + }, n3.callback = function() { + ls2(0, t3); + }; + } + var o3 = e3.stateNode; + return null !== o3 && "function" == typeof o3.componentDidCatch && (n3.callback = function() { + ls2(0, t3), "function" != typeof r3 && (null === Hu2 ? Hu2 = /* @__PURE__ */ new Set([this]) : Hu2.add(this)); + var e4 = t3.stack; + this.componentDidCatch(t3.value, { componentStack: null !== e4 ? e4 : "" }); + }), n3; + } + function hs2(e3, t3, n3) { + var r3 = e3.pingCache; + if (null === r3) { + r3 = e3.pingCache = new cs2(); + var i3 = /* @__PURE__ */ new Set(); + r3.set(t3, i3); + } else + void 0 === (i3 = r3.get(t3)) && (i3 = /* @__PURE__ */ new Set(), r3.set(t3, i3)); + i3.has(n3) || (i3.add(n3), e3 = El2.bind(null, e3, t3, n3), t3.then(e3, e3)); + } + function ps2(e3) { + do { + var t3; + if ((t3 = 13 === e3.tag) && (t3 = null === (t3 = e3.memoizedState) || null !== t3.dehydrated), t3) + return e3; + e3 = e3.return; + } while (null !== e3); + return null; + } + function ms2(e3, t3, n3, r3, i3) { + return 0 == (1 & e3.mode) ? (e3 === t3 ? e3.flags |= 65536 : (e3.flags |= 128, n3.flags |= 131072, n3.flags &= -52805, 1 === n3.tag && (null === n3.alternate ? n3.tag = 17 : ((t3 = Po2(-1, 1)).tag = 2, Lo2(n3, t3, 1))), n3.lanes |= 1), e3) : (e3.flags |= 65536, e3.lanes = i3, e3); + } + var gs2 = v2.ReactCurrentOwner, vs2 = false; + function bs2(e3, t3, n3, r3) { + t3.child = null === e3 ? Go2(t3, null, n3, r3) : Yo2(t3, e3.child, n3, r3); + } + function ys2(e3, t3, n3, r3, i3) { + n3 = n3.render; + var o3 = t3.ref; + return So2(t3, i3), r3 = _a2(e3, t3, n3, r3, o3, i3), n3 = Sa2(), null === e3 || vs2 ? (to2 && n3 && Qi2(t3), t3.flags |= 1, bs2(e3, t3, r3, i3), t3.child) : (t3.updateQueue = e3.updateQueue, t3.flags &= -2053, e3.lanes &= ~i3, Ks2(e3, t3, i3)); + } + function ws2(e3, t3, n3, r3, i3) { + if (null === e3) { + var o3 = n3.type; + return "function" != typeof o3 || Tl2(o3) || void 0 !== o3.defaultProps || null !== n3.compare || void 0 !== n3.defaultProps ? ((e3 = Ll2(n3.type, null, r3, t3, t3.mode, i3)).ref = t3.ref, e3.return = t3, t3.child = e3) : (t3.tag = 15, t3.type = o3, _s2(e3, t3, o3, r3, i3)); + } + if (o3 = e3.child, 0 == (e3.lanes & i3)) { + var a3 = o3.memoizedProps; + if ((n3 = null !== (n3 = n3.compare) ? n3 : or2)(a3, r3) && e3.ref === t3.ref) + return Ks2(e3, t3, i3); + } + return t3.flags |= 1, (e3 = Pl2(o3, r3)).ref = t3.ref, e3.return = t3, t3.child = e3; + } + function _s2(e3, t3, n3, r3, i3) { + if (null !== e3) { + var o3 = e3.memoizedProps; + if (or2(o3, r3) && e3.ref === t3.ref) { + if (vs2 = false, t3.pendingProps = r3 = o3, 0 == (e3.lanes & i3)) + return t3.lanes = e3.lanes, Ks2(e3, t3, i3); + 0 != (131072 & e3.flags) && (vs2 = true); + } + } + return ks2(e3, t3, n3, r3, i3); + } + function Ss2(e3, t3, n3) { + var r3 = t3.pendingProps, i3 = r3.children, o3 = null !== e3 ? e3.memoizedState : null; + if ("hidden" === r3.mode) + if (0 == (1 & t3.mode)) + t3.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, Ei2(Pu2, Tu2), Tu2 |= n3; + else { + if (0 == (1073741824 & n3)) + return e3 = null !== o3 ? o3.baseLanes | n3 : n3, t3.lanes = t3.childLanes = 1073741824, t3.memoizedState = { baseLanes: e3, cachePool: null, transitions: null }, t3.updateQueue = null, Ei2(Pu2, Tu2), Tu2 |= e3, null; + t3.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, r3 = null !== o3 ? o3.baseLanes : n3, Ei2(Pu2, Tu2), Tu2 |= r3; + } + else + null !== o3 ? (r3 = o3.baseLanes | n3, t3.memoizedState = null) : r3 = n3, Ei2(Pu2, Tu2), Tu2 |= r3; + return bs2(e3, t3, i3, n3), t3.child; + } + function Es2(e3, t3) { + var n3 = t3.ref; + (null === e3 && null !== n3 || null !== e3 && e3.ref !== n3) && (t3.flags |= 512, t3.flags |= 2097152); + } + function ks2(e3, t3, n3, r3, i3) { + var o3 = Ri2(n3) ? xi2 : Mi2.current; + return o3 = Ai2(t3, o3), So2(t3, i3), n3 = _a2(e3, t3, n3, r3, o3, i3), r3 = Sa2(), null === e3 || vs2 ? (to2 && r3 && Qi2(t3), t3.flags |= 1, bs2(e3, t3, n3, i3), t3.child) : (t3.updateQueue = e3.updateQueue, t3.flags &= -2053, e3.lanes &= ~i3, Ks2(e3, t3, i3)); + } + function Ms2(e3, t3, n3, r3, i3) { + if (Ri2(n3)) { + var o3 = true; + Ii2(t3); + } else + o3 = false; + if (So2(t3, i3), null === t3.stateNode) + Fs2(e3, t3), Fo2(t3, n3, r3), qo2(t3, n3, r3, i3), r3 = true; + else if (null === e3) { + var a3 = t3.stateNode, s3 = t3.memoizedProps; + a3.props = s3; + var u3 = a3.context, l3 = n3.contextType; + "object" == typeof l3 && null !== l3 ? l3 = Eo2(l3) : l3 = Ai2(t3, l3 = Ri2(n3) ? xi2 : Mi2.current); + var c3 = n3.getDerivedStateFromProps, d3 = "function" == typeof c3 || "function" == typeof a3.getSnapshotBeforeUpdate; + d3 || "function" != typeof a3.UNSAFE_componentWillReceiveProps && "function" != typeof a3.componentWillReceiveProps || (s3 !== r3 || u3 !== l3) && Ko2(t3, a3, r3, l3), Ao2 = false; + var f3 = t3.memoizedState; + a3.state = f3, No2(t3, r3, a3, i3), u3 = t3.memoizedState, s3 !== r3 || f3 !== u3 || Ci2.current || Ao2 ? ("function" == typeof c3 && (Bo2(t3, n3, c3, r3), u3 = t3.memoizedState), (s3 = Ao2 || Uo2(t3, n3, s3, r3, f3, u3, l3)) ? (d3 || "function" != typeof a3.UNSAFE_componentWillMount && "function" != typeof a3.componentWillMount || ("function" == typeof a3.componentWillMount && a3.componentWillMount(), "function" == typeof a3.UNSAFE_componentWillMount && a3.UNSAFE_componentWillMount()), "function" == typeof a3.componentDidMount && (t3.flags |= 4194308)) : ("function" == typeof a3.componentDidMount && (t3.flags |= 4194308), t3.memoizedProps = r3, t3.memoizedState = u3), a3.props = r3, a3.state = u3, a3.context = l3, r3 = s3) : ("function" == typeof a3.componentDidMount && (t3.flags |= 4194308), r3 = false); + } else { + a3 = t3.stateNode, To2(e3, t3), s3 = t3.memoizedProps, l3 = t3.type === t3.elementType ? s3 : po2(t3.type, s3), a3.props = l3, d3 = t3.pendingProps, f3 = a3.context, "object" == typeof (u3 = n3.contextType) && null !== u3 ? u3 = Eo2(u3) : u3 = Ai2(t3, u3 = Ri2(n3) ? xi2 : Mi2.current); + var h3 = n3.getDerivedStateFromProps; + (c3 = "function" == typeof h3 || "function" == typeof a3.getSnapshotBeforeUpdate) || "function" != typeof a3.UNSAFE_componentWillReceiveProps && "function" != typeof a3.componentWillReceiveProps || (s3 !== d3 || f3 !== u3) && Ko2(t3, a3, r3, u3), Ao2 = false, f3 = t3.memoizedState, a3.state = f3, No2(t3, r3, a3, i3); + var p3 = t3.memoizedState; + s3 !== d3 || f3 !== p3 || Ci2.current || Ao2 ? ("function" == typeof h3 && (Bo2(t3, n3, h3, r3), p3 = t3.memoizedState), (l3 = Ao2 || Uo2(t3, n3, l3, r3, f3, p3, u3) || false) ? (c3 || "function" != typeof a3.UNSAFE_componentWillUpdate && "function" != typeof a3.componentWillUpdate || ("function" == typeof a3.componentWillUpdate && a3.componentWillUpdate(r3, p3, u3), "function" == typeof a3.UNSAFE_componentWillUpdate && a3.UNSAFE_componentWillUpdate(r3, p3, u3)), "function" == typeof a3.componentDidUpdate && (t3.flags |= 4), "function" == typeof a3.getSnapshotBeforeUpdate && (t3.flags |= 1024)) : ("function" != typeof a3.componentDidUpdate || s3 === e3.memoizedProps && f3 === e3.memoizedState || (t3.flags |= 4), "function" != typeof a3.getSnapshotBeforeUpdate || s3 === e3.memoizedProps && f3 === e3.memoizedState || (t3.flags |= 1024), t3.memoizedProps = r3, t3.memoizedState = p3), a3.props = r3, a3.state = p3, a3.context = u3, r3 = l3) : ("function" != typeof a3.componentDidUpdate || s3 === e3.memoizedProps && f3 === e3.memoizedState || (t3.flags |= 4), "function" != typeof a3.getSnapshotBeforeUpdate || s3 === e3.memoizedProps && f3 === e3.memoizedState || (t3.flags |= 1024), r3 = false); + } + return Cs2(e3, t3, n3, r3, o3, i3); + } + function Cs2(e3, t3, n3, r3, i3, o3) { + Es2(e3, t3); + var a3 = 0 != (128 & t3.flags); + if (!r3 && !a3) + return i3 && Oi2(t3, n3, false), Ks2(e3, t3, o3); + r3 = t3.stateNode, gs2.current = t3; + var s3 = a3 && "function" != typeof n3.getDerivedStateFromError ? null : r3.render(); + return t3.flags |= 1, null !== e3 && a3 ? (t3.child = Yo2(t3, e3.child, null, o3), t3.child = Yo2(t3, null, s3, o3)) : bs2(e3, t3, s3, o3), t3.memoizedState = r3.state, i3 && Oi2(t3, n3, true), t3.child; + } + function xs2(e3) { + var t3 = e3.stateNode; + t3.pendingContext ? Pi2(0, t3.pendingContext, t3.pendingContext !== t3.context) : t3.context && Pi2(0, t3.context, false), ta2(e3, t3.containerInfo); + } + function As2(e3, t3, n3, r3, i3) { + return co2(), fo2(i3), t3.flags |= 256, bs2(e3, t3, n3, r3), t3.child; + } + var Rs2, Ts2, Ps2, Ls2, Is2 = { dehydrated: null, treeContext: null, retryLane: 0 }; + function Os2(e3) { + return { baseLanes: e3, cachePool: null, transitions: null }; + } + function Ns2(e3, t3, r3) { + var i3, o3 = t3.pendingProps, a3 = oa2.current, s3 = false, u3 = 0 != (128 & t3.flags); + if ((i3 = u3) || (i3 = (null === e3 || null !== e3.memoizedState) && 0 != (2 & a3)), i3 ? (s3 = true, t3.flags &= -129) : null !== e3 && null === e3.memoizedState || (a3 |= 1), Ei2(oa2, 1 & a3), null === e3) + return ao2(t3), null !== (e3 = t3.memoizedState) && null !== (e3 = e3.dehydrated) ? (0 == (1 & t3.mode) ? t3.lanes = 1 : "$!" === e3.data ? t3.lanes = 8 : t3.lanes = 1073741824, null) : (u3 = o3.children, e3 = o3.fallback, s3 ? (o3 = t3.mode, s3 = t3.child, u3 = { mode: "hidden", children: u3 }, 0 == (1 & o3) && null !== s3 ? (s3.childLanes = 0, s3.pendingProps = u3) : s3 = Ol2(u3, o3, 0, null), e3 = Il2(e3, o3, r3, null), s3.return = t3, e3.return = t3, s3.sibling = e3, t3.child = s3, t3.child.memoizedState = Os2(r3), t3.memoizedState = Is2, e3) : Ds2(t3, u3)); + if (null !== (a3 = e3.memoizedState) && null !== (i3 = a3.dehydrated)) + return function(e4, t4, r4, i4, o4, a4, s4) { + if (r4) + return 256 & t4.flags ? (t4.flags &= -257, js2(e4, t4, s4, i4 = us2(Error(n2(422))))) : null !== t4.memoizedState ? (t4.child = e4.child, t4.flags |= 128, null) : (a4 = i4.fallback, o4 = t4.mode, i4 = Ol2({ mode: "visible", children: i4.children }, o4, 0, null), (a4 = Il2(a4, o4, s4, null)).flags |= 2, i4.return = t4, a4.return = t4, i4.sibling = a4, t4.child = i4, 0 != (1 & t4.mode) && Yo2(t4, e4.child, null, s4), t4.child.memoizedState = Os2(s4), t4.memoizedState = Is2, a4); + if (0 == (1 & t4.mode)) + return js2(e4, t4, s4, null); + if ("$!" === o4.data) { + if (i4 = o4.nextSibling && o4.nextSibling.dataset) + var u4 = i4.dgst; + return i4 = u4, js2(e4, t4, s4, i4 = us2(a4 = Error(n2(419)), i4, void 0)); + } + if (u4 = 0 != (s4 & e4.childLanes), vs2 || u4) { + if (null !== (i4 = xu2)) { + switch (s4 & -s4) { + case 4: + o4 = 2; + break; + case 16: + o4 = 8; + break; + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + o4 = 32; + break; + case 536870912: + o4 = 268435456; + break; + default: + o4 = 0; + } + 0 !== (o4 = 0 != (o4 & (i4.suspendedLanes | s4)) ? 0 : o4) && o4 !== a4.retryLane && (a4.retryLane = o4, xo2(e4, o4), el2(i4, e4, o4, -1)); + } + return hl2(), js2(e4, t4, s4, i4 = us2(Error(n2(421)))); + } + return "$?" === o4.data ? (t4.flags |= 128, t4.child = e4.child, t4 = Ml2.bind(null, e4), o4._reactRetry = t4, null) : (e4 = a4.treeContext, eo2 = ai2(o4.nextSibling), Xi2 = t4, to2 = true, no2 = null, null !== e4 && (Hi2[Wi2++] = Vi2, Hi2[Wi2++] = Yi2, Hi2[Wi2++] = $i2, Vi2 = e4.id, Yi2 = e4.overflow, $i2 = t4), t4 = Ds2(t4, i4.children), t4.flags |= 4096, t4); + }(e3, t3, u3, o3, i3, a3, r3); + if (s3) { + s3 = o3.fallback, u3 = t3.mode, i3 = (a3 = e3.child).sibling; + var l3 = { mode: "hidden", children: o3.children }; + return 0 == (1 & u3) && t3.child !== a3 ? ((o3 = t3.child).childLanes = 0, o3.pendingProps = l3, t3.deletions = null) : (o3 = Pl2(a3, l3)).subtreeFlags = 14680064 & a3.subtreeFlags, null !== i3 ? s3 = Pl2(i3, s3) : (s3 = Il2(s3, u3, r3, null)).flags |= 2, s3.return = t3, o3.return = t3, o3.sibling = s3, t3.child = o3, o3 = s3, s3 = t3.child, u3 = null === (u3 = e3.child.memoizedState) ? Os2(r3) : { baseLanes: u3.baseLanes | r3, cachePool: null, transitions: u3.transitions }, s3.memoizedState = u3, s3.childLanes = e3.childLanes & ~r3, t3.memoizedState = Is2, o3; + } + return e3 = (s3 = e3.child).sibling, o3 = Pl2(s3, { mode: "visible", children: o3.children }), 0 == (1 & t3.mode) && (o3.lanes = r3), o3.return = t3, o3.sibling = null, null !== e3 && (null === (r3 = t3.deletions) ? (t3.deletions = [e3], t3.flags |= 16) : r3.push(e3)), t3.child = o3, t3.memoizedState = null, o3; + } + function Ds2(e3, t3) { + return (t3 = Ol2({ mode: "visible", children: t3 }, e3.mode, 0, null)).return = e3, e3.child = t3; + } + function js2(e3, t3, n3, r3) { + return null !== r3 && fo2(r3), Yo2(t3, e3.child, null, n3), (e3 = Ds2(t3, t3.pendingProps.children)).flags |= 2, t3.memoizedState = null, e3; + } + function Bs2(e3, t3, n3) { + e3.lanes |= t3; + var r3 = e3.alternate; + null !== r3 && (r3.lanes |= t3), _o2(e3.return, t3, n3); + } + function zs2(e3, t3, n3, r3, i3) { + var o3 = e3.memoizedState; + null === o3 ? e3.memoizedState = { isBackwards: t3, rendering: null, renderingStartTime: 0, last: r3, tail: n3, tailMode: i3 } : (o3.isBackwards = t3, o3.rendering = null, o3.renderingStartTime = 0, o3.last = r3, o3.tail = n3, o3.tailMode = i3); + } + function Us2(e3, t3, n3) { + var r3 = t3.pendingProps, i3 = r3.revealOrder, o3 = r3.tail; + if (bs2(e3, t3, r3.children, n3), 0 != (2 & (r3 = oa2.current))) + r3 = 1 & r3 | 2, t3.flags |= 128; + else { + if (null !== e3 && 0 != (128 & e3.flags)) + e: + for (e3 = t3.child; null !== e3; ) { + if (13 === e3.tag) + null !== e3.memoizedState && Bs2(e3, n3, t3); + else if (19 === e3.tag) + Bs2(e3, n3, t3); + else if (null !== e3.child) { + e3.child.return = e3, e3 = e3.child; + continue; + } + if (e3 === t3) + break e; + for (; null === e3.sibling; ) { + if (null === e3.return || e3.return === t3) + break e; + e3 = e3.return; + } + e3.sibling.return = e3.return, e3 = e3.sibling; + } + r3 &= 1; + } + if (Ei2(oa2, r3), 0 == (1 & t3.mode)) + t3.memoizedState = null; + else + switch (i3) { + case "forwards": + for (n3 = t3.child, i3 = null; null !== n3; ) + null !== (e3 = n3.alternate) && null === aa2(e3) && (i3 = n3), n3 = n3.sibling; + null === (n3 = i3) ? (i3 = t3.child, t3.child = null) : (i3 = n3.sibling, n3.sibling = null), zs2(t3, false, i3, n3, o3); + break; + case "backwards": + for (n3 = null, i3 = t3.child, t3.child = null; null !== i3; ) { + if (null !== (e3 = i3.alternate) && null === aa2(e3)) { + t3.child = i3; + break; + } + e3 = i3.sibling, i3.sibling = n3, n3 = i3, i3 = e3; + } + zs2(t3, true, n3, null, o3); + break; + case "together": + zs2(t3, false, null, null, void 0); + break; + default: + t3.memoizedState = null; + } + return t3.child; + } + function Fs2(e3, t3) { + 0 == (1 & t3.mode) && null !== e3 && (e3.alternate = null, t3.alternate = null, t3.flags |= 2); + } + function Ks2(e3, t3, r3) { + if (null !== e3 && (t3.dependencies = e3.dependencies), Ou2 |= t3.lanes, 0 == (r3 & t3.childLanes)) + return null; + if (null !== e3 && t3.child !== e3.child) + throw Error(n2(153)); + if (null !== t3.child) { + for (r3 = Pl2(e3 = t3.child, e3.pendingProps), t3.child = r3, r3.return = t3; null !== e3.sibling; ) + e3 = e3.sibling, (r3 = r3.sibling = Pl2(e3, e3.pendingProps)).return = t3; + r3.sibling = null; + } + return t3.child; + } + function qs2(e3, t3) { + if (!to2) + switch (e3.tailMode) { + case "hidden": + t3 = e3.tail; + for (var n3 = null; null !== t3; ) + null !== t3.alternate && (n3 = t3), t3 = t3.sibling; + null === n3 ? e3.tail = null : n3.sibling = null; + break; + case "collapsed": + n3 = e3.tail; + for (var r3 = null; null !== n3; ) + null !== n3.alternate && (r3 = n3), n3 = n3.sibling; + null === r3 ? t3 || null === e3.tail ? e3.tail = null : e3.tail.sibling = null : r3.sibling = null; + } + } + function Hs2(e3) { + var t3 = null !== e3.alternate && e3.alternate.child === e3.child, n3 = 0, r3 = 0; + if (t3) + for (var i3 = e3.child; null !== i3; ) + n3 |= i3.lanes | i3.childLanes, r3 |= 14680064 & i3.subtreeFlags, r3 |= 14680064 & i3.flags, i3.return = e3, i3 = i3.sibling; + else + for (i3 = e3.child; null !== i3; ) + n3 |= i3.lanes | i3.childLanes, r3 |= i3.subtreeFlags, r3 |= i3.flags, i3.return = e3, i3 = i3.sibling; + return e3.subtreeFlags |= r3, e3.childLanes = n3, t3; + } + function Ws2(e3, t3, r3) { + var o3 = t3.pendingProps; + switch (Ji2(t3), t3.tag) { + case 2: + case 16: + case 15: + case 0: + case 11: + case 7: + case 8: + case 12: + case 9: + case 14: + return Hs2(t3), null; + case 1: + case 17: + return Ri2(t3.type) && Ti2(), Hs2(t3), null; + case 3: + return o3 = t3.stateNode, na2(), Si2(Ci2), Si2(Mi2), ua2(), o3.pendingContext && (o3.context = o3.pendingContext, o3.pendingContext = null), null !== e3 && null !== e3.child || (uo2(t3) ? t3.flags |= 4 : null === e3 || e3.memoizedState.isDehydrated && 0 == (256 & t3.flags) || (t3.flags |= 1024, null !== no2 && (il2(no2), no2 = null))), Ts2(e3, t3), Hs2(t3), null; + case 5: + ia2(t3); + var a3 = ea2(Xo2.current); + if (r3 = t3.type, null !== e3 && null != t3.stateNode) + Ps2(e3, t3, r3, o3, a3), e3.ref !== t3.ref && (t3.flags |= 512, t3.flags |= 2097152); + else { + if (!o3) { + if (null === t3.stateNode) + throw Error(n2(166)); + return Hs2(t3), null; + } + if (e3 = ea2(Qo2.current), uo2(t3)) { + o3 = t3.stateNode, r3 = t3.type; + var s3 = t3.memoizedProps; + switch (o3[li2] = t3, o3[ci2] = s3, e3 = 0 != (1 & t3.mode), r3) { + case "dialog": + Dr2("cancel", o3), Dr2("close", o3); + break; + case "iframe": + case "object": + case "embed": + Dr2("load", o3); + break; + case "video": + case "audio": + for (a3 = 0; a3 < Lr2.length; a3++) + Dr2(Lr2[a3], o3); + break; + case "source": + Dr2("error", o3); + break; + case "img": + case "image": + case "link": + Dr2("error", o3), Dr2("load", o3); + break; + case "details": + Dr2("toggle", o3); + break; + case "input": + V2(o3, s3), Dr2("invalid", o3); + break; + case "select": + o3._wrapperState = { wasMultiple: !!s3.multiple }, Dr2("invalid", o3); + break; + case "textarea": + te2(o3, s3), Dr2("invalid", o3); + } + for (var u3 in me2(r3, s3), a3 = null, s3) + if (s3.hasOwnProperty(u3)) { + var l3 = s3[u3]; + "children" === u3 ? "string" == typeof l3 ? o3.textContent !== l3 && (true !== s3.suppressHydrationWarning && Gr2(o3.textContent, l3, e3), a3 = ["children", l3]) : "number" == typeof l3 && o3.textContent !== "" + l3 && (true !== s3.suppressHydrationWarning && Gr2(o3.textContent, l3, e3), a3 = ["children", "" + l3]) : i2.hasOwnProperty(u3) && null != l3 && "onScroll" === u3 && Dr2("scroll", o3); + } + switch (r3) { + case "input": + q2(o3), Z2(o3, s3, true); + break; + case "textarea": + q2(o3), re2(o3); + break; + case "select": + case "option": + break; + default: + "function" == typeof s3.onClick && (o3.onclick = Zr2); + } + o3 = a3, t3.updateQueue = o3, null !== o3 && (t3.flags |= 4); + } else { + u3 = 9 === a3.nodeType ? a3 : a3.ownerDocument, "http://www.w3.org/1999/xhtml" === e3 && (e3 = ie2(r3)), "http://www.w3.org/1999/xhtml" === e3 ? "script" === r3 ? ((e3 = u3.createElement("div")).innerHTML = " +