@wormhole-foundation/wormhole-connect 2.5.0-beta.12-development → 2.5.0-beta.13-development
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{aptos-r6k7eJCM.js → aptos-Cutllx5i.js} +2 -2
- package/dist/assets/{ccip-DoYNnipC.js → ccip-C6cz5NqJ.js} +1 -1
- package/dist/assets/events-MYC_Tkdh.js +1 -0
- package/dist/assets/{evm-C5Ivowrf.js → evm-DzwJdvcV.js} +2 -2
- package/dist/assets/{evm-DSNDNefN.js → evm-LJDXipdh.js} +3 -3
- package/dist/assets/{index-DQWOpudg.js → index-BECoIARf.js} +1 -1
- package/dist/assets/{index-TjYk9nid.js → index-BO5vFz_J.js} +1 -1
- package/dist/assets/{index-BtCNeMnf.js → index-BVJL1orJ.js} +1 -1
- package/dist/assets/{index-CuW_tQti.js → index-BwNyYZxM.js} +1 -1
- package/dist/assets/{index-CLAfmegc.js → index-C6UKJUdm.js} +1 -1
- package/dist/assets/{index-CKNeANkQ.js → index-CJZzjIow.js} +1 -1
- package/dist/assets/{index-CItGJ_dO.js → index-CSiH4dly.js} +1 -1
- package/dist/assets/{index-CrZXNnmG.js → index-CqEHg303.js} +1 -1
- package/dist/assets/{index-BQQC6_X5.js → index-D3R8fZfr.js} +1 -1
- package/dist/assets/{index-DPi-hS0A.js → index-Ds_BlDdN.js} +2 -2
- package/dist/assets/{index-7lgoK4KP.js → index-DwJjUFus.js} +1 -1
- package/dist/assets/{index-mE5izIg0.js → index-Dxpp9NXJ.js} +1 -1
- package/dist/assets/{index-XgkrTsoW.js → index-EvC_Tjca.js} +1 -1
- package/dist/assets/{index-BiBNC4RU.js → index-RZp63Yuv.js} +1 -1
- package/dist/assets/{index-CD-O7bSQ.js → index-iiAA6CTH.js} +1 -1
- package/dist/assets/{index-Cts3aOUg.js → index-m7pOREIu.js} +1 -1
- package/dist/assets/{index-Cefdj6j_.js → index-wwvQRwKh.js} +1 -1
- package/dist/assets/{index.es-e2znZrg8.js → index.es-C9O0OD76.js} +6 -6
- package/dist/assets/solana-B0Eox3vZ.js +2 -0
- package/dist/assets/{solana-DCCw_nmt.js → solana-BGWrrBcM.js} +2 -2
- package/dist/assets/solanaEmbed.esm-C9Mwa0DJ.js +37 -0
- package/dist/assets/{sui-CqkItMnZ.js → sui-COEHPNCD.js} +2 -2
- package/dist/assets/{tokens-BSV7gluG.js → tokens-CzZADlQh.js} +1 -1
- package/dist/main.js +53 -53
- package/dist/src/views/v2/Bridge/AssetPicker/TokenList.d.ts.map +1 -1
- package/lib/{aptos-CijhgPBM.js → aptos-BVPA8gYF.js} +2 -2
- package/lib/{aptos-BbnXFQGN.mjs → aptos-CIiuTO2J.mjs} +5 -5
- package/lib/{aptos-DzfZBrTF.mjs → aptos-Yk9QyTBh.mjs} +2 -2
- package/lib/{aptos-D1SySWBC.js → aptos-c2KbBxBV.js} +1 -1
- package/lib/{base64-DBxZBPtw.mjs → base64-BPqtma3e.mjs} +1 -1
- package/lib/{base64-DEMA23u6.js → base64-qNM1fRyt.js} +1 -1
- package/lib/{ccip-CyaNGYUS.mjs → ccip-BpeVK7Rl.mjs} +1 -1
- package/lib/{ccip-CF-Fa_0D.js → ccip-CPVLRLJJ.js} +1 -1
- package/lib/{chunk-IMTC3J2M-DJKrnCnv.js → chunk-IMTC3J2M-0BfyFPJr.js} +1 -1
- package/lib/{chunk-IMTC3J2M-B1LO60dt.mjs → chunk-IMTC3J2M-DvhfvP9K.mjs} +3 -3
- package/lib/{evm-Bh3OeZT6.js → evm-Ch6FuPzQ.js} +3 -3
- package/lib/{evm-DgChslXT.js → evm-CpQDS8wo.js} +2 -2
- package/lib/{evm-D54FcncX.mjs → evm-CsZx_4af.mjs} +6 -6
- package/lib/{evm-CY0tHZuu.mjs → evm-CySh4z_X.mjs} +5 -5
- package/lib/{index-DklLbrzY.mjs → index-1-1sQdBk.mjs} +3 -3
- package/lib/{index-Bd8n2Ncl.js → index-B2M8k2mN.js} +1 -1
- package/lib/{index-CMoVuDNY.mjs → index-B30laWIo.mjs} +3 -3
- package/lib/{index-BfVz9SIt.mjs → index-BP4yso2j.mjs} +2 -2
- package/lib/{index-CWQ2BLtV.js → index-BWZuYfMC.js} +1 -1
- package/lib/{index-CouIZIJD.mjs → index-BbFiSzuk.mjs} +1 -1
- package/lib/{index-BDO3Dr98.js → index-Bedqoe9t.js} +1 -1
- package/lib/{index-B76PoU6s.js → index-BjGepByq.js} +1 -1
- package/lib/{index-I3lFNjSk.js → index-BkLX6PzJ.js} +1 -1
- package/lib/{index-DoWRumoO.js → index-Bmist010.js} +1 -1
- package/lib/{index-Cq7M8x7W.mjs → index-BnKTj6SV.mjs} +1 -1
- package/lib/{index-gpbKRo8X.js → index-BqNdjBH5.js} +1 -1
- package/lib/{index-D8jRPXi_.mjs → index-Buu5BXLA.mjs} +1 -1
- package/lib/{index-Cmvk7AV6.mjs → index-C07HWBow.mjs} +1 -1
- package/lib/{index-C0LkRL9c.mjs → index-C3HS7tO4.mjs} +1 -1
- package/lib/{index-DJtvv--F.mjs → index-CBYLO1Hi.mjs} +2 -2
- package/lib/{index-7G2WHUOg.js → index-CJ19MHxd.js} +1 -1
- package/lib/{index-DCUIbYnw.js → index-CRY69UXK.js} +1 -1
- package/lib/{index-YyCbbSjt.mjs → index-CTShjNeL.mjs} +1 -1
- package/lib/{index-C5a4Ffru.mjs → index-CZWtHdVf.mjs} +2 -2
- package/lib/{index-Cx54Ub8m.js → index-ChB0PxtF.js} +1 -1
- package/lib/{index-D9lOHYis.mjs → index-CjxniqZI.mjs} +2 -2
- package/lib/{index-DE20fRvb.js → index-ClASHgjc.js} +1 -1
- package/lib/{index-DlAhw069.mjs → index-CqmLptlA.mjs} +2 -2
- package/lib/{index-DgrS-KqY.mjs → index-CrthlBzj.mjs} +1 -1
- package/lib/{index-B-KHe4hu.mjs → index-D4pCpPV2.mjs} +2 -2
- package/lib/{index-BzicjZP6.mjs → index-D5VvgHZZ.mjs} +4 -4
- package/lib/{index-h8S34vMi.js → index-D7FFeuCp.js} +3 -3
- package/lib/{index-CFhRN8Tj.js → index-D9cOG77k.js} +1 -1
- package/lib/{index-BrZB1GhQ.mjs → index-DGkJ3qwd.mjs} +17 -13
- package/lib/{index-DpAX5NRl.mjs → index-DHmbSwZ3.mjs} +2 -2
- package/lib/{index-B4r8Myj4.js → index-DQ6o865z.js} +1 -1
- package/lib/{index-Tr8qb4P3.js → index-DQ8AFS8n.js} +1 -1
- package/lib/{index-___kb-9z.js → index-DXupFi-y.js} +1 -1
- package/lib/{index-CVviH-_H.mjs → index-DaWhsQ7Y.mjs} +1 -1
- package/lib/{index-DA4fIndF.js → index-DmC8NhAc.js} +1 -1
- package/lib/{index-B5Jvr433.js → index-Dq2CQibu.js} +1 -1
- package/lib/{index-D8SSPI4d.js → index-DxDcsE8H.js} +1 -1
- package/lib/{index-jrlNs6XL.js → index-DyChKZrY.js} +1 -1
- package/lib/{index-CUIU0LlE.mjs → index-Ed6QnBz-.mjs} +1 -1
- package/lib/{index-DdDQuvdx.mjs → index-IrWII0fq.mjs} +1 -1
- package/lib/{index-DkPmK5pk.js → index-RsyQYt06.js} +1 -1
- package/lib/{index-DL-GgNtw.mjs → index-Y3i2299b.mjs} +1 -1
- package/lib/{index-B-fRe2Sl.js → index-kZzOULzm.js} +1 -1
- package/lib/{index-CTlMq5hW.mjs → index-o1TnI99x.mjs} +2 -2
- package/lib/{index-GEYUlTc-.mjs → index-tmft32Jl.mjs} +2 -2
- package/lib/{index-CHBkchdb.js → index-uIOnTFy9.js} +1 -1
- package/lib/{index-Deiudcgq.js → index-vp64iOpv.js} +1 -1
- package/lib/{index.es-AsYk4Uvv.mjs → index.es-BDUZQPx-.mjs} +5 -5
- package/lib/{index.es-D8hF5XP0.js → index.es-ComZGqCi.js} +2 -2
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{signer-DaWMkQF1.js → signer-B39OryLd.js} +1 -1
- package/lib/{signer-7WIJn5sK.mjs → signer-DDNkLWHh.mjs} +1 -1
- package/lib/{solana-DRSvSfVY.mjs → solana-B-7bMXQC.mjs} +4 -4
- package/lib/{solana-MB7hVWUW.js → solana-CTMFD8wN.js} +1 -1
- package/lib/solana-D2DaJnor.mjs +17 -0
- package/lib/solana-D4aC7zHK.js +1 -0
- package/lib/{solanaEmbed.esm-C1Zh8qUa.mjs → solanaEmbed.esm-CRy-qWYD.mjs} +2 -2
- package/lib/{solanaEmbed.esm-BixVJUPy.js → solanaEmbed.esm-OJaX_G6S.js} +1 -1
- package/lib/src/views/v2/Bridge/AssetPicker/TokenList.d.ts.map +1 -1
- package/lib/{sui-UkjRySQh.js → sui-COgXxdtI.js} +1 -1
- package/lib/{sui-DoOVhYz5.js → sui-DuISROp3.js} +1 -1
- package/lib/{sui-8vWUEEQ9.mjs → sui-rVS-XQDK.mjs} +1 -1
- package/lib/{sui-Du5eMx4Q.mjs → sui-xD9tYMxq.mjs} +5 -5
- package/lib/{tokens-BeoubMFr.mjs → tokens-BP3fRZDM.mjs} +2 -2
- package/lib/{tokens-BKsPRVEi.js → tokens-CZV3Ccde.js} +1 -1
- package/package.json +1 -1
- package/dist/assets/solana-BNhbIgt5.js +0 -2
- package/dist/assets/solanaEmbed.esm-D6aTKNPa.js +0 -37
- package/lib/solana-BesnnoRK.js +0 -1
- package/lib/solana-CPqOguy0.mjs +0 -17
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-DmC8NhAc.js"),ko=require("./dijkstra-CtFxn7S9.js"),Mo=require("./index-D7FFeuCp.js");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -10155,7 +10155,7 @@ const MAINNET_TOKENS = [
|
|
|
10155
10155
|
index: 0,
|
|
10156
10156
|
keys: ["0x13947Bd48b18E53fdAeEe77F3473391aC727C638"]
|
|
10157
10157
|
}
|
|
10158
|
-
}, WORMSCAN = "https://wormholescan.io/#/", CONNECT_VERSION = "2.5.0-beta.
|
|
10158
|
+
}, WORMSCAN = "https://wormholescan.io/#/", CONNECT_VERSION = "2.5.0-beta.13-development", CONNECT_GIT_HASH = "554bf7456e47cc87cb9a8e99c01488fea6bd3a3e", CHAIN_ORDER = [
|
|
10159
10159
|
"Ethereum",
|
|
10160
10160
|
"Solana",
|
|
10161
10161
|
"Arbitrum",
|
|
@@ -74896,7 +74896,7 @@ async function wormhole(t, e, l) {
|
|
|
74896
74896
|
const d = (await loadPlatforms(e)).map((h) => h.Platform);
|
|
74897
74897
|
return new Wormhole(t, d, l);
|
|
74898
74898
|
}
|
|
74899
|
-
const evm = async () => (await import("./evm-
|
|
74899
|
+
const evm = async () => (await import("./evm-CsZx_4af.mjs")).default, solana$1 = async () => (await import("./solana-D2DaJnor.mjs")).default, aptos$1 = async () => (await import("./aptos-CIiuTO2J.mjs").then((t) => t.a)).default, sui = async () => (await import("./sui-xD9tYMxq.mjs")).default;
|
|
74900
74900
|
class SuiUnsignedTransaction {
|
|
74901
74901
|
constructor(e, l, d, h, u = !1) {
|
|
74902
74902
|
ye(this, "transaction");
|
|
@@ -78386,7 +78386,7 @@ class TokenCache extends TokenMapping {
|
|
|
78386
78386
|
const l = await getWormholeContextV2(), d = l.getChain(e.chain), h = await d.getDecimals(e.address), u = await fetchTokenMetadata(e);
|
|
78387
78387
|
let p = ((I = u == null ? void 0 : u.symbol) == null ? void 0 : I.toUpperCase()) || "", m = (u == null ? void 0 : u.name) || "", y = ((E = u == null ? void 0 : u.image) == null ? void 0 : E.large) || null;
|
|
78388
78388
|
if (!p) {
|
|
78389
|
-
const { getTokenMetadataFromRpc: k } = await import("./tokens-
|
|
78389
|
+
const { getTokenMetadataFromRpc: k } = await import("./tokens-BP3fRZDM.mjs"), N = await k(e);
|
|
78390
78390
|
N && (console.info("Got metadata from RPC", N), p = N.symbol, m = N.name, y = N.icon);
|
|
78391
78391
|
}
|
|
78392
78392
|
let x;
|
|
@@ -79188,7 +79188,7 @@ ye(wn, "_platform", _platform$2);
|
|
|
79188
79188
|
let EvmPlatform = wn;
|
|
79189
79189
|
class SolanaChain extends ChainContext {
|
|
79190
79190
|
async getTokenAccount(e, l) {
|
|
79191
|
-
const { getAssociatedTokenAddress: d } = await import("./index-
|
|
79191
|
+
const { getAssociatedTokenAddress: d } = await import("./index-CqmLptlA.mjs"), h = new SolanaAddress(l).unwrap(), u = new SolanaAddress(e).unwrap(), p = await d(h, u);
|
|
79192
79192
|
return {
|
|
79193
79193
|
chain: this.chain,
|
|
79194
79194
|
address: new SolanaAddress(p.toString())
|
|
@@ -81070,24 +81070,24 @@ const walletConnection = {
|
|
|
81070
81070
|
if (!u)
|
|
81071
81071
|
throw new Error("wallet is undefined");
|
|
81072
81072
|
if (h.context === Context.ETH)
|
|
81073
|
-
return await (await import("./evm-
|
|
81073
|
+
return await (await import("./evm-CySh4z_X.mjs").then((y) => y.k)).signAndSendTransaction(
|
|
81074
81074
|
e,
|
|
81075
81075
|
u,
|
|
81076
81076
|
t
|
|
81077
81077
|
);
|
|
81078
81078
|
if (h.context === Context.SOLANA)
|
|
81079
|
-
return await (await import("./solana-
|
|
81079
|
+
return await (await import("./solana-B-7bMXQC.mjs")).signAndSendTransaction(
|
|
81080
81080
|
e,
|
|
81081
81081
|
u,
|
|
81082
81082
|
d
|
|
81083
81083
|
);
|
|
81084
81084
|
if (h.context === Context.SUI)
|
|
81085
|
-
return (await (await import("./sui-
|
|
81085
|
+
return (await (await import("./sui-rVS-XQDK.mjs")).signAndSendTransaction(
|
|
81086
81086
|
e,
|
|
81087
81087
|
u
|
|
81088
81088
|
)).id;
|
|
81089
81089
|
if (h.context === Context.APTOS)
|
|
81090
|
-
return (await (await import("./aptos-
|
|
81090
|
+
return (await (await import("./aptos-Yk9QyTBh.mjs")).signAndSendTransaction(
|
|
81091
81091
|
e,
|
|
81092
81092
|
u
|
|
81093
81093
|
)).id;
|
|
@@ -81107,16 +81107,16 @@ const walletConnection = {
|
|
|
81107
81107
|
if (t === void 0)
|
|
81108
81108
|
return [];
|
|
81109
81109
|
if (t.context === Context.ETH) {
|
|
81110
|
-
const e = await import("./evm-
|
|
81110
|
+
const e = await import("./evm-CySh4z_X.mjs").then((l) => l.k);
|
|
81111
81111
|
return Object.values(mapWallets(e.getWallets(), Context.ETH));
|
|
81112
81112
|
} else if (t.context === Context.SOLANA) {
|
|
81113
|
-
const l = (await import("./solana-
|
|
81113
|
+
const l = (await import("./solana-B-7bMXQC.mjs")).fetchOptions();
|
|
81114
81114
|
return Object.values(mapWallets(l, Context.SOLANA));
|
|
81115
81115
|
} else if (t.context === Context.SUI) {
|
|
81116
|
-
const l = await (await import("./sui-
|
|
81116
|
+
const l = await (await import("./sui-rVS-XQDK.mjs")).fetchOptions();
|
|
81117
81117
|
return Object.values(mapWallets(l, Context.SUI));
|
|
81118
81118
|
} else if (t.context === Context.APTOS) {
|
|
81119
|
-
const l = (await import("./aptos-
|
|
81119
|
+
const l = (await import("./aptos-Yk9QyTBh.mjs")).fetchOptions();
|
|
81120
81120
|
return Object.values(mapWallets(l, Context.APTOS));
|
|
81121
81121
|
}
|
|
81122
81122
|
return [];
|
|
@@ -136141,7 +136141,11 @@ const useStyles$h = makeStyles()((t) => ({
|
|
|
136141
136141
|
(Q) => G.has(Q.address.toString())
|
|
136142
136142
|
);
|
|
136143
136143
|
}
|
|
136144
|
-
return config$1.isTokenSupportedHandler && (W = W.filter(config$1.isTokenSupportedHandler)), W
|
|
136144
|
+
return config$1.isTokenSupportedHandler && (W = W.filter(config$1.isTokenSupportedHandler)), t.isSource && (W = W.filter((G) => {
|
|
136145
|
+
var Q;
|
|
136146
|
+
const Y = (Q = w[tokenKey(G)]) == null ? void 0 : Q.balance;
|
|
136147
|
+
return Y && units(Y) > 0;
|
|
136148
|
+
})), W;
|
|
136145
136149
|
}, [
|
|
136146
136150
|
t.selectedChainConfig.sdkName,
|
|
136147
136151
|
t.selectedChainConfig.key,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var M = Object.defineProperty;
|
|
2
2
|
var _ = (p, e, t) => e in p ? M(p, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[e] = t;
|
|
3
3
|
var u = (p, e, t) => _(p, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { bJ as D, am as C, ap as T, bK as S, bd as I, ak as s, bL as z, bM as G, a6 as B, a9 as F, bN as f, bO as h, bP as H, bQ as g, bR as j, i as y, bS as J, x as K, bT as Y, bU as X, bV as Z, bW as tt, ab as et } from "./index-
|
|
5
|
-
import { EvmTokenBridge as nt } from "./index-
|
|
4
|
+
import { bJ as D, am as C, ap as T, bK as S, bd as I, ak as s, bL as z, bM as G, a6 as B, a9 as F, bN as f, bO as h, bP as H, bQ as g, bR as j, i as y, bS as J, x as K, bT as Y, bU as X, bV as Z, bW as tt, ab as et } from "./index-DGkJ3qwd.mjs";
|
|
5
|
+
import { EvmTokenBridge as nt } from "./index-CrthlBzj.mjs";
|
|
6
6
|
const v = new D([
|
|
7
7
|
"function start((bytes32,address,address,address,address,address,uint256,uint256,uint256,uint256)) returns (address,uint16,uint64)",
|
|
8
8
|
"function receiveMessageAndSwap(bytes)"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const W=require("./index-h8S34vMi.js"),j="logger/5.8.0";let F=!1,k=!1;const U={debug:1,default:2,info:2,warning:3,error:4,off:5};let G=U.default,O=null;function Q(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const L=Q();var D;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(D||(D={}));var E;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(E||(E={}));const B="0123456789abcdef";class o{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();U[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(G>U[n])&&console.log.apply(console,e)}debug(...t){this._log(o.levels.DEBUG,t)}info(...t){this._log(o.levels.INFO,t)}warn(...t){this._log(o.levels.WARNING,t)}makeError(t,e,n){if(k)return this.makeError("censored error",e,{});e||(e=o.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(g=>{const p=n[g];try{if(p instanceof Uint8Array){let S="";for(let I=0;I<p.length;I++)S+=B[p[I]>>4],S+=B[p[I]&15];i.push(g+"=Uint8Array(0x"+S+")")}else i.push(g+"="+JSON.stringify(p))}catch{i.push(g+"="+JSON.stringify(n[g].toString()))}}),i.push(`code=${e}`),i.push(`version=${this.version}`);const N=t;let m="";switch(e){case E.NUMERIC_FAULT:{m="NUMERIC_FAULT";const g=t;switch(g){case"overflow":case"underflow":case"division-by-zero":m+="-"+g;break;case"negative-power":case"negative-width":m+="-unsupported";break;case"unbound-bitwise-result":m+="-unbound-result";break}break}case E.CALL_EXCEPTION:case E.INSUFFICIENT_FUNDS:case E.MISSING_NEW:case E.NONCE_EXPIRED:case E.REPLACEMENT_UNDERPRICED:case E.TRANSACTION_REPLACED:case E.UNPREDICTABLE_GAS_LIMIT:m=e;break}m&&(t+=" [ See: https://links.ethers.org/v5-errors-"+m+" ]"),i.length&&(t+=" ("+i.join(", ")+")");const b=new Error(t);return b.reason=N,b.code=e,Object.keys(n).forEach(function(g){b[g]=n[g]}),b}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,o.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,i){t||this.throwError(e,n,i)}assertArgument(t,e,n,i){t||this.throwArgumentError(e,n,i)}checkNormalize(t){L&&this.throwError("platform missing String.prototype.normalize",o.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:L})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,o.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,o.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,o.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,o.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",o.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",o.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",o.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return O||(O=new o(j)),O}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",o.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),F){if(!t)return;this.globalLogger().throwError("error censorship permanent",o.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}k=!!t,F=!!e}static setLogLevel(t){const e=U[t.toLowerCase()];if(e==null){o.globalLogger().warn("invalid log level - "+t);return}G=e}static from(t){return new o(t)}}o.errors=E;o.levels=D;const Y="bytes/5.8.0",f=new o(Y);function V(r){return!!r.toHexString}function y(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return y(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function rr(r){return l(r)&&!(r.length%2)||P(r)}function z(r){return typeof r=="number"&&r==r&&r%1===0}function P(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!z(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!z(e)||e<0||e>=256)return!1}return!0}function A(r,t){if(t||(t={}),typeof r=="number"){f.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),y(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),V(r)&&(r=r.toHexString()),l(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0"+e:t.hexPad==="right"?e+="0":f.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let i=0;i<e.length;i+=2)n.push(parseInt(e.substring(i,i+2),16));return y(new Uint8Array(n))}return P(r)?y(new Uint8Array(r)):f.throwArgumentError("invalid arrayify value","value",r)}function tr(r){const t=r.map(i=>A(i)),e=t.reduce((i,N)=>i+N.length,0),n=new Uint8Array(e);return t.reduce((i,N)=>(n.set(N,i),i+N.length),0),y(n)}function er(r,t){r=A(r),r.length>t&&f.throwArgumentError("value out of range","value",arguments[0]);const e=new Uint8Array(t);return e.set(r,t-r.length),y(e)}function l(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||t&&r.length!==2+2*t)}const d="0123456789abcdef";function c(r,t){if(t||(t={}),typeof r=="number"){f.checkSafeUint53(r,"invalid hexlify value");let e="";for(;r;)e=d[r&15]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),V(r))return r.toHexString();if(l(r))return r.length%2&&(t.hexPad==="left"?r="0x0"+r.substring(2):t.hexPad==="right"?r+="0":f.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(P(r)){let e="0x";for(let n=0;n<r.length;n++){let i=r[n];e+=d[(i&240)>>4]+d[i&15]}return e}return f.throwArgumentError("invalid hexlify value","value",r)}function nr(r){if(typeof r!="string")r=c(r);else if(!l(r)||r.length%2)return null;return(r.length-2)/2}function ir(r,t,e){return typeof r!="string"?r=c(r):(!l(r)||r.length%2)&&f.throwArgumentError("invalid hexData","value",r),t=2+2*t,e!=null?"0x"+r.substring(t,2+2*e):"0x"+r.substring(t)}function sr(r){let t="0x";return r.forEach(e=>{t+=c(e).substring(2)}),t}function _(r,t){for(typeof r!="string"?r=c(r):l(r)||f.throwArgumentError("invalid hex string","value",r),r.length>2*t+2&&f.throwArgumentError("value out of range","value",arguments[1]);r.length<2*t+2;)r="0x0"+r.substring(2);return r}function or(r){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(rr(r)){let e=A(r);e.length===64?(t.v=27+(e[32]>>7),e[32]&=127,t.r=c(e.slice(0,32)),t.s=c(e.slice(32,64))):e.length===65?(t.r=c(e.slice(0,32)),t.s=c(e.slice(32,64)),t.v=e[64]):f.throwArgumentError("invalid signature string","signature",r),t.v<27&&(t.v===0||t.v===1?t.v+=27:f.throwArgumentError("signature invalid v byte","signature",r)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(e[32]|=128),t._vs=c(e.slice(32,64))}else{if(t.r=r.r,t.s=r.s,t.v=r.v,t.recoveryParam=r.recoveryParam,t._vs=r._vs,t._vs!=null){const i=er(A(t._vs),32);t._vs=c(i);const N=i[0]>=128?1:0;t.recoveryParam==null?t.recoveryParam=N:t.recoveryParam!==N&&f.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),i[0]&=127;const m=c(i);t.s==null?t.s=m:t.s!==m&&f.throwArgumentError("signature v mismatch _vs","signature",r)}if(t.recoveryParam==null)t.v==null?f.throwArgumentError("signature missing v and recoveryParam","signature",r):t.v===0||t.v===1?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(t.v==null)t.v=27+t.recoveryParam;else{const i=t.v===0||t.v===1?t.v:1-t.v%2;t.recoveryParam!==i&&f.throwArgumentError("signature recoveryParam mismatch v","signature",r)}t.r==null||!l(t.r)?f.throwArgumentError("signature missing or invalid r","signature",r):t.r=_(t.r,32),t.s==null||!l(t.s)?f.throwArgumentError("signature missing or invalid s","signature",r):t.s=_(t.s,32);const e=A(t.s);e[0]>=128&&f.throwArgumentError("signature s out of range","signature",r),t.recoveryParam&&(e[0]|=128);const n=c(e);t._vs&&(l(t._vs)||f.throwArgumentError("signature invalid _vs","signature",r),t._vs=_(t._vs,32)),t._vs==null?t._vs=n:t._vs!==n&&f.throwArgumentError("signature _vs mismatch v and s","signature",r)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}const fr="bignumber/5.7.0";var T=W.BN.BN;const w=new o(fr),C={},ur=9007199254740991;let $=!1;class h{constructor(t,e){t!==C&&w.throwError("cannot call constructor directly; use BigNumber.from",o.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return u(s(this).fromTwos(t))}toTwos(t){return u(s(this).toTwos(t))}abs(){return this._hex[0]==="-"?h.from(this._hex.substring(1)):this}add(t){return u(s(this).add(s(t)))}sub(t){return u(s(this).sub(s(t)))}div(t){return h.from(t).isZero()&&a("division-by-zero","div"),u(s(this).div(s(t)))}mul(t){return u(s(this).mul(s(t)))}mod(t){const e=s(t);return e.isNeg()&&a("division-by-zero","mod"),u(s(this).umod(e))}pow(t){const e=s(t);return e.isNeg()&&a("negative-power","pow"),u(s(this).pow(e))}and(t){const e=s(t);return(this.isNegative()||e.isNeg())&&a("unbound-bitwise-result","and"),u(s(this).and(e))}or(t){const e=s(t);return(this.isNegative()||e.isNeg())&&a("unbound-bitwise-result","or"),u(s(this).or(e))}xor(t){const e=s(t);return(this.isNegative()||e.isNeg())&&a("unbound-bitwise-result","xor"),u(s(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&a("negative-width","mask"),u(s(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&a("negative-width","shl"),u(s(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&a("negative-width","shr"),u(s(this).shrn(t))}eq(t){return s(this).eq(s(t))}lt(t){return s(this).lt(s(t))}lte(t){return s(this).lte(s(t))}gt(t){return s(this).gt(s(t))}gte(t){return s(this).gte(s(t))}isNegative(){return this._hex[0]==="-"}isZero(){return s(this).isZero()}toNumber(){try{return s(this).toNumber()}catch{a("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return w.throwError("this platform does not support BigInt",o.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?$||($=!0,w.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?w.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",o.errors.UNEXPECTED_ARGUMENT,{}):w.throwError("BigNumber.toString does not accept parameters",o.errors.UNEXPECTED_ARGUMENT,{})),s(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof h)return t;if(typeof t=="string")return t.match(/^-?0x[0-9a-f]+$/i)?new h(C,R(t)):t.match(/^-?[0-9]+$/)?new h(C,R(new T(t))):w.throwArgumentError("invalid BigNumber string","value",t);if(typeof t=="number")return t%1&&a("underflow","BigNumber.from",t),(t>=ur||t<=-9007199254740991)&&a("overflow","BigNumber.from",t),h.from(String(t));const e=t;if(typeof e=="bigint")return h.from(e.toString());if(P(e))return h.from(c(e));if(e)if(e.toHexString){const n=e.toHexString();if(typeof n=="string")return h.from(n)}else{let n=e._hex;if(n==null&&e.type==="BigNumber"&&(n=e.hex),typeof n=="string"&&(l(n)||n[0]==="-"&&l(n.substring(1))))return h.from(n)}return w.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}}function R(r){if(typeof r!="string")return R(r.toString(16));if(r[0]==="-")return r=r.substring(1),r[0]==="-"&&w.throwArgumentError("invalid hex","value",r),r=R(r),r==="0x00"?r:"-"+r;if(r.substring(0,2)!=="0x"&&(r="0x"+r),r==="0x")return"0x00";for(r.length%2&&(r="0x0"+r.substring(2));r.length>4&&r.substring(0,4)==="0x00";)r="0x"+r.substring(4);return r}function u(r){return h.from(R(r))}function s(r){const t=h.from(r).toHexString();return t[0]==="-"?new T("-"+t.substring(3),16):new T(t.substring(2),16)}function a(r,t,e){const n={fault:r,operation:t};return e!=null&&(n.value=e),w.throwError(r,o.errors.NUMERIC_FAULT,n)}function hr(r){return new T(r,36).toString(16)}const cr="properties/5.7.0",K=new o(cr);function J(r,t,e){Object.defineProperty(r,t,{enumerable:!0,value:e,writable:!1})}function lr(r,t){for(let e=0;e<32;e++){if(r[t])return r[t];if(!r.prototype||typeof r.prototype!="object")break;r=Object.getPrototypeOf(r.prototype).constructor}return null}const ar={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function Z(r){if(r==null||ar[typeof r])return!0;if(Array.isArray(r)||typeof r=="object"){if(!Object.isFrozen(r))return!1;const t=Object.keys(r);for(let e=0;e<t.length;e++){let n=null;try{n=r[t[e]]}catch{continue}if(!Z(n))return!1}return!0}return K.throwArgumentError(`Cannot deepCopy ${typeof r}`,"object",r)}function gr(r){if(Z(r))return r;if(Array.isArray(r))return Object.freeze(r.map(t=>M(t)));if(typeof r=="object"){const t={};for(const e in r){const n=r[e];n!==void 0&&J(t,e,M(n))}return t}return K.throwArgumentError(`Cannot deepCopy ${typeof r}`,"object",r)}function M(r){return gr(r)}class Er{constructor(t){for(const e in t)this[e]=M(t[e])}}function q(r){return"0x"+W.sha3.keccak_256(A(r))}const mr="address/5.7.0",x=new o(mr);function H(r){l(r,20)||x.throwArgumentError("invalid address","address",r),r=r.toLowerCase();const t=r.substring(2).split(""),e=new Uint8Array(40);for(let i=0;i<40;i++)e[i]=t[i].charCodeAt(0);const n=A(q(e));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(n[i>>1]&15)>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}const Nr=9007199254740991;function wr(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}const v={};for(let r=0;r<10;r++)v[String(r)]=String(r);for(let r=0;r<26;r++)v[String.fromCharCode(65+r)]=String(10+r);const X=Math.floor(wr(Nr));function Ar(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let t=r.split("").map(n=>v[n]).join("");for(;t.length>=X;){let n=t.substring(0,X);t=parseInt(n,10)%97+t.substring(n.length)}let e=String(98-parseInt(t,10)%97);for(;e.length<2;)e="0"+e;return e}function yr(r){let t=null;if(typeof r!="string"&&x.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),t=H(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==r&&x.throwArgumentError("bad address checksum","address",r);else if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(r.substring(2,4)!==Ar(r)&&x.throwArgumentError("bad icap checksum","address",r),t=hr(r.substring(4));t.length<40;)t="0"+t;t=H("0x"+t)}else x.throwArgumentError("invalid address","address",r);return t}exports.BigNumber=h;exports.Description=Er;exports.Logger=o;exports.arrayify=A;exports.concat=tr;exports.defineReadOnly=J;exports.getAddress=yr;exports.getStatic=lr;exports.hexConcat=sr;exports.hexDataLength=nr;exports.hexDataSlice=ir;exports.hexZeroPad=_;exports.hexlify=c;exports.isHexString=l;exports.keccak256=q;exports.splitSignature=or;
|
|
1
|
+
"use strict";const W=require("./index-D7FFeuCp.js"),j="logger/5.8.0";let F=!1,k=!1;const U={debug:1,default:2,info:2,warning:3,error:4,off:5};let G=U.default,O=null;function Q(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const L=Q();var D;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(D||(D={}));var E;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(E||(E={}));const B="0123456789abcdef";class o{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();U[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(G>U[n])&&console.log.apply(console,e)}debug(...t){this._log(o.levels.DEBUG,t)}info(...t){this._log(o.levels.INFO,t)}warn(...t){this._log(o.levels.WARNING,t)}makeError(t,e,n){if(k)return this.makeError("censored error",e,{});e||(e=o.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(g=>{const p=n[g];try{if(p instanceof Uint8Array){let S="";for(let I=0;I<p.length;I++)S+=B[p[I]>>4],S+=B[p[I]&15];i.push(g+"=Uint8Array(0x"+S+")")}else i.push(g+"="+JSON.stringify(p))}catch{i.push(g+"="+JSON.stringify(n[g].toString()))}}),i.push(`code=${e}`),i.push(`version=${this.version}`);const N=t;let m="";switch(e){case E.NUMERIC_FAULT:{m="NUMERIC_FAULT";const g=t;switch(g){case"overflow":case"underflow":case"division-by-zero":m+="-"+g;break;case"negative-power":case"negative-width":m+="-unsupported";break;case"unbound-bitwise-result":m+="-unbound-result";break}break}case E.CALL_EXCEPTION:case E.INSUFFICIENT_FUNDS:case E.MISSING_NEW:case E.NONCE_EXPIRED:case E.REPLACEMENT_UNDERPRICED:case E.TRANSACTION_REPLACED:case E.UNPREDICTABLE_GAS_LIMIT:m=e;break}m&&(t+=" [ See: https://links.ethers.org/v5-errors-"+m+" ]"),i.length&&(t+=" ("+i.join(", ")+")");const b=new Error(t);return b.reason=N,b.code=e,Object.keys(n).forEach(function(g){b[g]=n[g]}),b}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,o.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,i){t||this.throwError(e,n,i)}assertArgument(t,e,n,i){t||this.throwArgumentError(e,n,i)}checkNormalize(t){L&&this.throwError("platform missing String.prototype.normalize",o.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:L})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,o.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,o.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,o.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,o.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",o.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",o.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",o.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return O||(O=new o(j)),O}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",o.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),F){if(!t)return;this.globalLogger().throwError("error censorship permanent",o.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}k=!!t,F=!!e}static setLogLevel(t){const e=U[t.toLowerCase()];if(e==null){o.globalLogger().warn("invalid log level - "+t);return}G=e}static from(t){return new o(t)}}o.errors=E;o.levels=D;const Y="bytes/5.8.0",f=new o(Y);function V(r){return!!r.toHexString}function y(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return y(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function rr(r){return l(r)&&!(r.length%2)||P(r)}function z(r){return typeof r=="number"&&r==r&&r%1===0}function P(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!z(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!z(e)||e<0||e>=256)return!1}return!0}function A(r,t){if(t||(t={}),typeof r=="number"){f.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),y(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),V(r)&&(r=r.toHexString()),l(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0"+e:t.hexPad==="right"?e+="0":f.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let i=0;i<e.length;i+=2)n.push(parseInt(e.substring(i,i+2),16));return y(new Uint8Array(n))}return P(r)?y(new Uint8Array(r)):f.throwArgumentError("invalid arrayify value","value",r)}function tr(r){const t=r.map(i=>A(i)),e=t.reduce((i,N)=>i+N.length,0),n=new Uint8Array(e);return t.reduce((i,N)=>(n.set(N,i),i+N.length),0),y(n)}function er(r,t){r=A(r),r.length>t&&f.throwArgumentError("value out of range","value",arguments[0]);const e=new Uint8Array(t);return e.set(r,t-r.length),y(e)}function l(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||t&&r.length!==2+2*t)}const d="0123456789abcdef";function c(r,t){if(t||(t={}),typeof r=="number"){f.checkSafeUint53(r,"invalid hexlify value");let e="";for(;r;)e=d[r&15]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),V(r))return r.toHexString();if(l(r))return r.length%2&&(t.hexPad==="left"?r="0x0"+r.substring(2):t.hexPad==="right"?r+="0":f.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(P(r)){let e="0x";for(let n=0;n<r.length;n++){let i=r[n];e+=d[(i&240)>>4]+d[i&15]}return e}return f.throwArgumentError("invalid hexlify value","value",r)}function nr(r){if(typeof r!="string")r=c(r);else if(!l(r)||r.length%2)return null;return(r.length-2)/2}function ir(r,t,e){return typeof r!="string"?r=c(r):(!l(r)||r.length%2)&&f.throwArgumentError("invalid hexData","value",r),t=2+2*t,e!=null?"0x"+r.substring(t,2+2*e):"0x"+r.substring(t)}function sr(r){let t="0x";return r.forEach(e=>{t+=c(e).substring(2)}),t}function _(r,t){for(typeof r!="string"?r=c(r):l(r)||f.throwArgumentError("invalid hex string","value",r),r.length>2*t+2&&f.throwArgumentError("value out of range","value",arguments[1]);r.length<2*t+2;)r="0x0"+r.substring(2);return r}function or(r){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(rr(r)){let e=A(r);e.length===64?(t.v=27+(e[32]>>7),e[32]&=127,t.r=c(e.slice(0,32)),t.s=c(e.slice(32,64))):e.length===65?(t.r=c(e.slice(0,32)),t.s=c(e.slice(32,64)),t.v=e[64]):f.throwArgumentError("invalid signature string","signature",r),t.v<27&&(t.v===0||t.v===1?t.v+=27:f.throwArgumentError("signature invalid v byte","signature",r)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(e[32]|=128),t._vs=c(e.slice(32,64))}else{if(t.r=r.r,t.s=r.s,t.v=r.v,t.recoveryParam=r.recoveryParam,t._vs=r._vs,t._vs!=null){const i=er(A(t._vs),32);t._vs=c(i);const N=i[0]>=128?1:0;t.recoveryParam==null?t.recoveryParam=N:t.recoveryParam!==N&&f.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),i[0]&=127;const m=c(i);t.s==null?t.s=m:t.s!==m&&f.throwArgumentError("signature v mismatch _vs","signature",r)}if(t.recoveryParam==null)t.v==null?f.throwArgumentError("signature missing v and recoveryParam","signature",r):t.v===0||t.v===1?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(t.v==null)t.v=27+t.recoveryParam;else{const i=t.v===0||t.v===1?t.v:1-t.v%2;t.recoveryParam!==i&&f.throwArgumentError("signature recoveryParam mismatch v","signature",r)}t.r==null||!l(t.r)?f.throwArgumentError("signature missing or invalid r","signature",r):t.r=_(t.r,32),t.s==null||!l(t.s)?f.throwArgumentError("signature missing or invalid s","signature",r):t.s=_(t.s,32);const e=A(t.s);e[0]>=128&&f.throwArgumentError("signature s out of range","signature",r),t.recoveryParam&&(e[0]|=128);const n=c(e);t._vs&&(l(t._vs)||f.throwArgumentError("signature invalid _vs","signature",r),t._vs=_(t._vs,32)),t._vs==null?t._vs=n:t._vs!==n&&f.throwArgumentError("signature _vs mismatch v and s","signature",r)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}const fr="bignumber/5.7.0";var T=W.BN.BN;const w=new o(fr),C={},ur=9007199254740991;let $=!1;class h{constructor(t,e){t!==C&&w.throwError("cannot call constructor directly; use BigNumber.from",o.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return u(s(this).fromTwos(t))}toTwos(t){return u(s(this).toTwos(t))}abs(){return this._hex[0]==="-"?h.from(this._hex.substring(1)):this}add(t){return u(s(this).add(s(t)))}sub(t){return u(s(this).sub(s(t)))}div(t){return h.from(t).isZero()&&a("division-by-zero","div"),u(s(this).div(s(t)))}mul(t){return u(s(this).mul(s(t)))}mod(t){const e=s(t);return e.isNeg()&&a("division-by-zero","mod"),u(s(this).umod(e))}pow(t){const e=s(t);return e.isNeg()&&a("negative-power","pow"),u(s(this).pow(e))}and(t){const e=s(t);return(this.isNegative()||e.isNeg())&&a("unbound-bitwise-result","and"),u(s(this).and(e))}or(t){const e=s(t);return(this.isNegative()||e.isNeg())&&a("unbound-bitwise-result","or"),u(s(this).or(e))}xor(t){const e=s(t);return(this.isNegative()||e.isNeg())&&a("unbound-bitwise-result","xor"),u(s(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&a("negative-width","mask"),u(s(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&a("negative-width","shl"),u(s(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&a("negative-width","shr"),u(s(this).shrn(t))}eq(t){return s(this).eq(s(t))}lt(t){return s(this).lt(s(t))}lte(t){return s(this).lte(s(t))}gt(t){return s(this).gt(s(t))}gte(t){return s(this).gte(s(t))}isNegative(){return this._hex[0]==="-"}isZero(){return s(this).isZero()}toNumber(){try{return s(this).toNumber()}catch{a("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return w.throwError("this platform does not support BigInt",o.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?$||($=!0,w.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?w.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",o.errors.UNEXPECTED_ARGUMENT,{}):w.throwError("BigNumber.toString does not accept parameters",o.errors.UNEXPECTED_ARGUMENT,{})),s(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof h)return t;if(typeof t=="string")return t.match(/^-?0x[0-9a-f]+$/i)?new h(C,R(t)):t.match(/^-?[0-9]+$/)?new h(C,R(new T(t))):w.throwArgumentError("invalid BigNumber string","value",t);if(typeof t=="number")return t%1&&a("underflow","BigNumber.from",t),(t>=ur||t<=-9007199254740991)&&a("overflow","BigNumber.from",t),h.from(String(t));const e=t;if(typeof e=="bigint")return h.from(e.toString());if(P(e))return h.from(c(e));if(e)if(e.toHexString){const n=e.toHexString();if(typeof n=="string")return h.from(n)}else{let n=e._hex;if(n==null&&e.type==="BigNumber"&&(n=e.hex),typeof n=="string"&&(l(n)||n[0]==="-"&&l(n.substring(1))))return h.from(n)}return w.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}}function R(r){if(typeof r!="string")return R(r.toString(16));if(r[0]==="-")return r=r.substring(1),r[0]==="-"&&w.throwArgumentError("invalid hex","value",r),r=R(r),r==="0x00"?r:"-"+r;if(r.substring(0,2)!=="0x"&&(r="0x"+r),r==="0x")return"0x00";for(r.length%2&&(r="0x0"+r.substring(2));r.length>4&&r.substring(0,4)==="0x00";)r="0x"+r.substring(4);return r}function u(r){return h.from(R(r))}function s(r){const t=h.from(r).toHexString();return t[0]==="-"?new T("-"+t.substring(3),16):new T(t.substring(2),16)}function a(r,t,e){const n={fault:r,operation:t};return e!=null&&(n.value=e),w.throwError(r,o.errors.NUMERIC_FAULT,n)}function hr(r){return new T(r,36).toString(16)}const cr="properties/5.7.0",K=new o(cr);function J(r,t,e){Object.defineProperty(r,t,{enumerable:!0,value:e,writable:!1})}function lr(r,t){for(let e=0;e<32;e++){if(r[t])return r[t];if(!r.prototype||typeof r.prototype!="object")break;r=Object.getPrototypeOf(r.prototype).constructor}return null}const ar={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function Z(r){if(r==null||ar[typeof r])return!0;if(Array.isArray(r)||typeof r=="object"){if(!Object.isFrozen(r))return!1;const t=Object.keys(r);for(let e=0;e<t.length;e++){let n=null;try{n=r[t[e]]}catch{continue}if(!Z(n))return!1}return!0}return K.throwArgumentError(`Cannot deepCopy ${typeof r}`,"object",r)}function gr(r){if(Z(r))return r;if(Array.isArray(r))return Object.freeze(r.map(t=>M(t)));if(typeof r=="object"){const t={};for(const e in r){const n=r[e];n!==void 0&&J(t,e,M(n))}return t}return K.throwArgumentError(`Cannot deepCopy ${typeof r}`,"object",r)}function M(r){return gr(r)}class Er{constructor(t){for(const e in t)this[e]=M(t[e])}}function q(r){return"0x"+W.sha3.keccak_256(A(r))}const mr="address/5.7.0",x=new o(mr);function H(r){l(r,20)||x.throwArgumentError("invalid address","address",r),r=r.toLowerCase();const t=r.substring(2).split(""),e=new Uint8Array(40);for(let i=0;i<40;i++)e[i]=t[i].charCodeAt(0);const n=A(q(e));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(n[i>>1]&15)>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}const Nr=9007199254740991;function wr(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}const v={};for(let r=0;r<10;r++)v[String(r)]=String(r);for(let r=0;r<26;r++)v[String.fromCharCode(65+r)]=String(10+r);const X=Math.floor(wr(Nr));function Ar(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let t=r.split("").map(n=>v[n]).join("");for(;t.length>=X;){let n=t.substring(0,X);t=parseInt(n,10)%97+t.substring(n.length)}let e=String(98-parseInt(t,10)%97);for(;e.length<2;)e="0"+e;return e}function yr(r){let t=null;if(typeof r!="string"&&x.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),t=H(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==r&&x.throwArgumentError("bad address checksum","address",r);else if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(r.substring(2,4)!==Ar(r)&&x.throwArgumentError("bad icap checksum","address",r),t=hr(r.substring(4));t.length<40;)t="0"+t;t=H("0x"+t)}else x.throwArgumentError("invalid address","address",r);return t}exports.BigNumber=h;exports.Description=Er;exports.Logger=o;exports.arrayify=A;exports.concat=tr;exports.defineReadOnly=J;exports.getAddress=yr;exports.getStatic=lr;exports.hexConcat=sr;exports.hexDataLength=nr;exports.hexDataSlice=ir;exports.hexZeroPad=_;exports.hexlify=c;exports.isHexString=l;exports.keccak256=q;exports.splitSignature=or;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./index-h8S34vMi.js"),pl=require("./dijkstra-CtFxn7S9.js"),P=require("./index-7G2WHUOg.js"),_=require("./index-CHBkchdb.js"),W=require("./index-B4r8Myj4.js");let gl=class extends _.r{constructor(e){super(e),this.events=new E.eventsExports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(_.formatJsonRpcRequest(e.method,e.params||[],e.id||_.getBigIntRpcId().toString()),t)}async requestStrict(e,t){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(s){n(s)}this.events.on(`${e.id}`,s=>{_.isJsonRpcError(s)?n(s.error):i(s.result)});try{await this.connection.send(e,t)}catch(s){n(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),_.isJsonRpcResponse(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};var yl=function(){var r=document.getSelection();if(!r.rangeCount)return function(){};for(var e=document.activeElement,t=[],i=0;i<r.rangeCount;i++)t.push(r.getRangeAt(i));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null;break}return r.removeAllRanges(),function(){r.type==="Caret"&&r.removeAllRanges(),r.rangeCount||t.forEach(function(n){r.addRange(n)}),e&&e.focus()}},ml=yl,Ln={"text/plain":"Text","text/html":"Url",default:"Text"},vl="Copy to clipboard: #{key}, Enter";function wl(r){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return r.replace(/#{\s*key\s*}/g,e)}function _l(r,e){var t,i,n,s,o,a,c=!1;e||(e={}),t=e.debug||!1;try{n=ml(),s=document.createRange(),o=document.getSelection(),a=document.createElement("span"),a.textContent=r,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",function(u){if(u.stopPropagation(),e.format)if(u.preventDefault(),typeof u.clipboardData>"u"){t&&console.warn("unable to use e.clipboardData"),t&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=Ln[e.format]||Ln.default;window.clipboardData.setData(h,r)}else u.clipboardData.clearData(),u.clipboardData.setData(e.format,r);e.onCopy&&(u.preventDefault(),e.onCopy(u.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");c=!0}catch(u){t&&console.error("unable to copy using execCommand: ",u),t&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",r),e.onCopy&&e.onCopy(window.clipboardData),c=!0}catch(h){t&&console.error("unable to copy using clipboardData: ",h),t&&console.error("falling back to prompt"),i=wl("message"in e?e.message:vl),window.prompt(i,r)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),n()}return c}var bl=_l,El={}.toString,tn=Array.isArray||function(r){return El.call(r)=="[object Array]"},Sl=E.requireElliptic(),rn={},Q={};Object.defineProperty(Q,"__esModule",{value:!0});var $o=Q.getLocalStorage=Ko=Q.getLocalStorageOrThrow=zo=Q.getCrypto=jo=Q.getCryptoOrThrow=Uo=Q.getLocation=Bo=Q.getLocationOrThrow=qo=Q.getNavigator=Fo=Q.getNavigatorOrThrow=Do=Q.getDocument=Lo=Q.getDocumentOrThrow=Mo=Q.getFromWindowOrThrow=ko=Q.getFromWindow=void 0;function vt(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}var ko=Q.getFromWindow=vt;function Ft(r){const e=vt(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}var Mo=Q.getFromWindowOrThrow=Ft;function Il(){return Ft("document")}var Lo=Q.getDocumentOrThrow=Il;function xl(){return vt("document")}var Do=Q.getDocument=xl;function Pl(){return Ft("navigator")}var Fo=Q.getNavigatorOrThrow=Pl;function Al(){return vt("navigator")}var qo=Q.getNavigator=Al;function Rl(){return Ft("location")}var Bo=Q.getLocationOrThrow=Rl;function Nl(){return vt("location")}var Uo=Q.getLocation=Nl;function Tl(){return Ft("crypto")}var jo=Q.getCryptoOrThrow=Tl;function Cl(){return vt("crypto")}var zo=Q.getCrypto=Cl;function Ol(){return Ft("localStorage")}var Ko=Q.getLocalStorageOrThrow=Ol;function $l(){return vt("localStorage")}$o=Q.getLocalStorage=$l;Object.defineProperty(rn,"__esModule",{value:!0});var Vo=rn.getWindowMetadata=void 0;const Dn=Q;function kl(){let r,e;try{r=Dn.getDocumentOrThrow(),e=Dn.getLocationOrThrow()}catch{return null}function t(){const h=r.getElementsByTagName("link"),p=[];for(let d=0;d<h.length;d++){const f=h[d],g=f.getAttribute("rel");if(g&&g.toLowerCase().indexOf("icon")>-1){const y=f.getAttribute("href");if(y)if(y.toLowerCase().indexOf("https:")===-1&&y.toLowerCase().indexOf("http:")===-1&&y.indexOf("//")!==0){let m=e.protocol+"//"+e.host;if(y.indexOf("/")===0)m+=y;else{const v=e.pathname.split("/");v.pop();const b=v.join("/");m+=b+"/"+y}p.push(m)}else if(y.indexOf("//")===0){const m=e.protocol+y;p.push(m)}else p.push(y)}}return p}function i(...h){const p=r.getElementsByTagName("meta");for(let d=0;d<p.length;d++){const f=p[d],g=["itemprop","property","name"].map(y=>f.getAttribute(y)).filter(y=>y?h.includes(y):!1);if(g.length&&g){const y=f.getAttribute("content");if(y)return y}}return""}function n(){let h=i("name","og:site_name","og:title","twitter:title");return h||(h=r.title),h}function s(){return i("description","og:description","twitter:description","keywords")}const o=n(),a=s(),c=e.origin,l=t();return{description:a,url:c,icons:l,name:o}}Vo=rn.getWindowMetadata=kl;var Ml=function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),n=0,e=0;e<t;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i},Ll=function(){function r(e,t,i){this.name=e,this.version=t,this.os=i,this.type="browser"}return r}(),Dl=function(){function r(e){this.version=e,this.type="node",this.name="node",this.os=E.dist.process.platform}return r}(),Fl=function(){function r(e,t,i,n){this.name=e,this.version=t,this.os=i,this.bot=n,this.type="bot-device"}return r}(),ql=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),Bl=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),Ul=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,jl=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Fn=3,zl=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",Ul]],qn=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function Kl(r){return r?Bn(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Bl:typeof navigator<"u"?Bn(navigator.userAgent):Hl()}function Vl(r){return r!==""&&zl.reduce(function(e,t){var i=t[0],n=t[1];if(e)return e;var s=n.exec(r);return!!s&&[i,s]},!1)}function Bn(r){var e=Vl(r);if(!e)return null;var t=e[0],i=e[1];if(t==="searchbot")return new ql;var n=i[1]&&i[1].split(/[._]/).slice(0,3);n?n.length<Fn&&(n=Ml(n,Jl(Fn-n.length))):n=[];var s=n.join("."),o=Wl(r),a=jl.exec(r);return a&&a[1]?new Fl(t,s,o,a[1]):new Ll(t,s,o)}function Wl(r){for(var e=0,t=qn.length;e<t;e++){var i=qn[e],n=i[0],s=i[1],o=s.exec(r);if(o)return n}return null}function Hl(){var r=typeof E.dist.process<"u"&&E.dist.process.version;return r?new Dl(E.dist.process.version.slice(1)):null}function Jl(r){for(var e=[],t=0;t<r;t++)e.push("0");return e}function nn(r){return Kl(r)}function Kr(){const r=nn();return r&&r.os?r.os:void 0}function Wo(){const r=Kr();return r?r.toLowerCase().includes("android"):!1}function Ho(){const r=Kr();return r?r.toLowerCase().includes("ios")||r.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}function Gl(){return Kr()?Wo()||Ho():!1}function Jo(){const r=nn();return r&&r.name?r.name.toLowerCase()==="node":!1}function Yl(){return!Jo()&&!!Go()}const Ql=ko,Xl=Mo,Zl=Lo,eu=Do,tu=Fo,Go=qo,ru=Bo,iu=Uo,nu=jo,su=zo,ou=Ko,Vr=$o;function au(){return Vo()}function cu(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return JSON.parse(r)}catch{return r}}function lu(r){return typeof r=="string"?r:JSON.stringify(r)}const Yo=cu,Qo=lu;function Xo(r,e){const t=Qo(e),i=Vr();i&&i.setItem(r,t)}function uu(r){let e=null,t=null;const i=Vr();return i&&(t=i.getItem(r)),e=t&&Yo(t),e}function hu(r){const e=Vr();e&&e.removeItem(r)}const Zo="WALLETCONNECT_DEEPLINK_CHOICE";function du(r,e){const t=encodeURIComponent(r);return e.universalLink?`${e.universalLink}/wc?uri=${t}`:e.deepLink?`${e.deepLink}${e.deepLink.endsWith(":")?"//":"/"}wc?uri=${t}`:""}function fu(r){const e=r.href.split("?")[0];Xo(Zo,Object.assign(Object.assign({},r),{href:e}))}function ea(r,e){return r.filter(t=>t.name.toLowerCase().includes(e.toLowerCase()))[0]}function pu(r,e){let t=r;return e&&(t=e.map(i=>ea(r,i)).filter(Boolean)),t}const ta="https://registry.walletconnect.com";function gu(){return ta+"/api/v2/wallets"}function yu(){return ta+"/api/v2/dapps"}function ra(r,e="mobile"){var t;return{name:r.name||"",shortName:r.metadata.shortName||"",color:r.metadata.colors.primary||"",logo:(t=r.image_url.sm)!==null&&t!==void 0?t:"",universalLink:r[e].universal||"",deepLink:r[e].native||""}}function mu(r,e="mobile"){return Object.values(r).filter(t=>!!t[e].universal||!!t[e].native).map(t=>ra(t,e))}const vu=Object.freeze(Object.defineProperty({__proto__:null,detectEnv:nn,detectOS:Kr,formatIOSMobile:du,formatMobileRegistry:mu,formatMobileRegistryEntry:ra,getClientMeta:au,getCrypto:su,getCryptoOrThrow:nu,getDappRegistryUrl:yu,getDocument:eu,getDocumentOrThrow:Zl,getFromWindow:Ql,getFromWindowOrThrow:Xl,getLocal:uu,getLocalStorage:Vr,getLocalStorageOrThrow:ou,getLocation:iu,getLocationOrThrow:ru,getMobileLinkRegistry:pu,getMobileRegistryEntry:ea,getNavigator:Go,getNavigatorOrThrow:tu,getWalletRegistryUrl:gu,isAndroid:Wo,isBrowser:Yl,isIOS:Ho,isMobile:Gl,isNode:Jo,mobileLinkChoiceKey:Zo,removeLocal:hu,safeJsonParse:Yo,safeJsonStringify:Qo,saveMobileLinkInfo:fu,setLocal:Xo},Symbol.toStringTag,{value:"Module"})),wu=E.getAugmentedNamespace(vu);var ur={},_u=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},ia={},at={},bu=tn;function Eu(){try{var r=new Uint8Array(1);return r.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},r.foo()===42}catch{return!1}}j.TYPED_ARRAY_SUPPORT=Eu();var Un=j.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function j(r,e,t){return!j.TYPED_ARRAY_SUPPORT&&!(this instanceof j)?new j(r,e,t):typeof r=="number"?na(this,r):Nu(this,r,e,t)}j.TYPED_ARRAY_SUPPORT&&(j.prototype.__proto__=Uint8Array.prototype,j.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&j[Symbol.species]===j&&Object.defineProperty(j,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}));function sn(r){if(r>=Un)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Un.toString(16)+" bytes");return r|0}function Su(r){return r!==r}function Nt(r,e){var t;return j.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=j.prototype):(t=r,t===null&&(t=new j(e)),t.length=e),t}function na(r,e){var t=Nt(r,e<0?0:sn(e)|0);if(!j.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)t[i]=0;return t}function Iu(r,e){var t=oa(e)|0,i=Nt(r,t),n=i.write(e);return n!==t&&(i=i.slice(0,n)),i}function Oi(r,e){for(var t=e.length<0?0:sn(e.length)|0,i=Nt(r,t),n=0;n<t;n+=1)i[n]=e[n]&255;return i}function xu(r,e,t,i){if(t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(i||0))throw new RangeError("'length' is out of bounds");var n;return t===void 0&&i===void 0?n=new Uint8Array(e):i===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,i),j.TYPED_ARRAY_SUPPORT?n.__proto__=j.prototype:n=Oi(r,n),n}function Pu(r,e){if(j.isBuffer(e)){var t=sn(e.length)|0,i=Nt(r,t);return i.length===0||e.copy(i,0,0,t),i}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Su(e.length)?Nt(r,0):Oi(r,e);if(e.type==="Buffer"&&Array.isArray(e.data))return Oi(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function sa(r,e){e=e||1/0;for(var t,i=r.length,n=null,s=[],o=0;o<i;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!n){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}function oa(r){if(j.isBuffer(r))return r.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var e=r.length;return e===0?0:sa(r).length}function Au(r,e,t,i){for(var n=0;n<i&&!(n+t>=e.length||n>=r.length);++n)e[n+t]=r[n];return n}function Ru(r,e,t,i){return Au(sa(e,r.length-t),r,t,i)}function Nu(r,e,t,i){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?xu(r,e,t,i):typeof e=="string"?Iu(r,e):Pu(r,e)}j.prototype.write=function(e,t,i){t===void 0?(i=this.length,t=0):i===void 0&&typeof t=="string"?(i=this.length,t=0):isFinite(t)&&(t=t|0,isFinite(i)?i=i|0:i=void 0);var n=this.length-t;if((i===void 0||i>n)&&(i=n),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");return Ru(this,e,t,i)};j.prototype.slice=function(e,t){var i=this.length;e=~~e,t=t===void 0?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);var n;if(j.TYPED_ARRAY_SUPPORT)n=this.subarray(e,t),n.__proto__=j.prototype;else{var s=t-e;n=new j(s,void 0);for(var o=0;o<s;++o)n[o]=this[o+e]}return n};j.prototype.copy=function(e,t,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var s=n-i,o;if(this===e&&i<t&&t<n)for(o=s-1;o>=0;--o)e[o+t]=this[o+i];else if(s<1e3||!j.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+t]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+s),t);return s};j.prototype.fill=function(e,t,i){if(typeof e=="string"){if(typeof t=="string"?(t=0,i=this.length):typeof i=="string"&&(i=this.length),e.length===1){var n=e.charCodeAt(0);n<256&&(e=n)}}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);var s;if(typeof e=="number")for(s=t;s<i;++s)this[s]=e;else{var o=j.isBuffer(e)?e:new j(e),a=o.length;for(s=0;s<i-t;++s)this[s+t]=o[s%a]}return this};j.concat=function(e,t){if(!bu(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return Nt(null,0);var i;if(t===void 0)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=na(null,t),s=0;for(i=0;i<e.length;++i){var o=e[i];if(!j.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,s),s+=o.length}return n};j.byteLength=oa;j.prototype._isBuffer=!0;j.isBuffer=function(e){return!!(e!=null&&e._isBuffer)};at.alloc=function(r){var e=new j(r);return e.fill(0),e};at.from=function(r){return new j(r)};var _e={},on,Tu=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];_e.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};_e.getSymbolTotalCodewords=function(e){return Tu[e]};_e.getBCHDigit=function(r){for(var e=0;r!==0;)e++,r>>>=1;return e};_e.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');on=e};_e.isKanjiModeEnabled=function(){return typeof on<"u"};_e.toSJIS=function(e){return on(e)};var Wr={};(function(r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2};function e(t){if(typeof t!="string")throw new Error("Param is not a string");var i=t.toLowerCase();switch(i){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+t)}}r.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},r.from=function(i,n){if(r.isValid(i))return i;try{return e(i)}catch{return n}}})(Wr);function aa(){this.buffer=[],this.length=0}aa.prototype={get:function(r){var e=Math.floor(r/8);return(this.buffer[e]>>>7-r%8&1)===1},put:function(r,e){for(var t=0;t<e;t++)this.putBit((r>>>e-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),r&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Cu=aa,jn=at;function hr(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=jn.alloc(r*r),this.reservedBit=jn.alloc(r*r)}hr.prototype.set=function(r,e,t,i){var n=r*this.size+e;this.data[n]=t,i&&(this.reservedBit[n]=!0)};hr.prototype.get=function(r,e){return this.data[r*this.size+e]};hr.prototype.xor=function(r,e,t){this.data[r*this.size+e]^=t};hr.prototype.isReserved=function(r,e){return this.reservedBit[r*this.size+e]};var Ou=hr,ca={};(function(r){var e=_e.getSymbolSize;r.getRowColCoords=function(i){if(i===1)return[];for(var n=Math.floor(i/7)+2,s=e(i),o=s===145?26:Math.ceil((s-13)/(2*n-2))*2,a=[s-7],c=1;c<n-1;c++)a[c]=a[c-1]-o;return a.push(6),a.reverse()},r.getPositions=function(i){for(var n=[],s=r.getRowColCoords(i),o=s.length,a=0;a<o;a++)for(var c=0;c<o;c++)a===0&&c===0||a===0&&c===o-1||a===o-1&&c===0||n.push([s[a],s[c]]);return n}})(ca);var la={},$u=_e.getSymbolSize,zn=7;la.getPositions=function(e){var t=$u(e);return[[0,0],[t-zn,0],[0,t-zn]]};var ua={};(function(r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var e={N1:3,N2:3,N3:40,N4:10};r.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},r.from=function(n){return r.isValid(n)?parseInt(n,10):void 0},r.getPenaltyN1=function(n){for(var s=n.size,o=0,a=0,c=0,l=null,u=null,h=0;h<s;h++){a=c=0,l=u=null;for(var p=0;p<s;p++){var d=n.get(h,p);d===l?a++:(a>=5&&(o+=e.N1+(a-5)),l=d,a=1),d=n.get(p,h),d===u?c++:(c>=5&&(o+=e.N1+(c-5)),u=d,c=1)}a>=5&&(o+=e.N1+(a-5)),c>=5&&(o+=e.N1+(c-5))}return o},r.getPenaltyN2=function(n){for(var s=n.size,o=0,a=0;a<s-1;a++)for(var c=0;c<s-1;c++){var l=n.get(a,c)+n.get(a,c+1)+n.get(a+1,c)+n.get(a+1,c+1);(l===4||l===0)&&o++}return o*e.N2},r.getPenaltyN3=function(n){for(var s=n.size,o=0,a=0,c=0,l=0;l<s;l++){a=c=0;for(var u=0;u<s;u++)a=a<<1&2047|n.get(l,u),u>=10&&(a===1488||a===93)&&o++,c=c<<1&2047|n.get(u,l),u>=10&&(c===1488||c===93)&&o++}return o*e.N3},r.getPenaltyN4=function(n){for(var s=0,o=n.data.length,a=0;a<o;a++)s+=n.data[a];var c=Math.abs(Math.ceil(s*100/o/5)-10);return c*e.N4};function t(i,n,s){switch(i){case r.Patterns.PATTERN000:return(n+s)%2===0;case r.Patterns.PATTERN001:return n%2===0;case r.Patterns.PATTERN010:return s%3===0;case r.Patterns.PATTERN011:return(n+s)%3===0;case r.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2===0;case r.Patterns.PATTERN101:return n*s%2+n*s%3===0;case r.Patterns.PATTERN110:return(n*s%2+n*s%3)%2===0;case r.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}r.applyMask=function(n,s){for(var o=s.size,a=0;a<o;a++)for(var c=0;c<o;c++)s.isReserved(c,a)||s.xor(c,a,t(n,c,a))},r.getBestMask=function(n,s){for(var o=Object.keys(r.Patterns).length,a=0,c=1/0,l=0;l<o;l++){s(l),r.applyMask(l,n);var u=r.getPenaltyN1(n)+r.getPenaltyN2(n)+r.getPenaltyN3(n)+r.getPenaltyN4(n);r.applyMask(l,n),u<c&&(c=u,a=l)}return a}})(ua);var Hr={},tt=Wr,wr=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],_r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Hr.getBlocksCount=function(e,t){switch(t){case tt.L:return wr[(e-1)*4+0];case tt.M:return wr[(e-1)*4+1];case tt.Q:return wr[(e-1)*4+2];case tt.H:return wr[(e-1)*4+3];default:return}};Hr.getTotalCodewordsCount=function(e,t){switch(t){case tt.L:return _r[(e-1)*4+0];case tt.M:return _r[(e-1)*4+1];case tt.Q:return _r[(e-1)*4+2];case tt.H:return _r[(e-1)*4+3];default:return}};var ha={},Jr={},da=at,Zt=da.alloc(512),Or=da.alloc(256);(function(){for(var e=1,t=0;t<255;t++)Zt[t]=e,Or[e]=t,e<<=1,e&256&&(e^=285);for(t=255;t<512;t++)Zt[t]=Zt[t-255]})();Jr.log=function(e){if(e<1)throw new Error("log("+e+")");return Or[e]};Jr.exp=function(e){return Zt[e]};Jr.mul=function(e,t){return e===0||t===0?0:Zt[Or[e]+Or[t]]};(function(r){var e=at,t=Jr;r.mul=function(n,s){for(var o=e.alloc(n.length+s.length-1),a=0;a<n.length;a++)for(var c=0;c<s.length;c++)o[a+c]^=t.mul(n[a],s[c]);return o},r.mod=function(n,s){for(var o=e.from(n);o.length-s.length>=0;){for(var a=o[0],c=0;c<s.length;c++)o[c]^=t.mul(s[c],a);for(var l=0;l<o.length&&o[l]===0;)l++;o=o.slice(l)}return o},r.generateECPolynomial=function(n){for(var s=e.from([1]),o=0;o<n;o++)s=r.mul(s,[1,t.exp(o)]);return s}})(ha);var Kn=at,fa=ha,ku=E.bufferPolyfill.Buffer;function an(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}an.prototype.initialize=function(e){this.degree=e,this.genPoly=fa.generateECPolynomial(this.degree)};an.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");var t=Kn.alloc(this.degree),i=ku.concat([e,t],e.length+this.degree),n=fa.mod(i,this.genPoly),s=this.degree-n.length;if(s>0){var o=Kn.alloc(this.degree);return n.copy(o,s),o}return n};var Mu=an,pa={},ct={},cn={};cn.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var je={},ga="[0-9]+",Lu="[A-Z $%*+\\-./:]+",nr="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";nr=nr.replace(/u/g,"\\u");var Du="(?:(?![A-Z0-9 $%*+\\-./:]|"+nr+`)(?:.|[\r
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./index-D7FFeuCp.js"),pl=require("./dijkstra-CtFxn7S9.js"),P=require("./index-CJ19MHxd.js"),_=require("./index-uIOnTFy9.js"),W=require("./index-DQ6o865z.js");let gl=class extends _.r{constructor(e){super(e),this.events=new E.eventsExports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(_.formatJsonRpcRequest(e.method,e.params||[],e.id||_.getBigIntRpcId().toString()),t)}async requestStrict(e,t){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(s){n(s)}this.events.on(`${e.id}`,s=>{_.isJsonRpcError(s)?n(s.error):i(s.result)});try{await this.connection.send(e,t)}catch(s){n(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),_.isJsonRpcResponse(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};var yl=function(){var r=document.getSelection();if(!r.rangeCount)return function(){};for(var e=document.activeElement,t=[],i=0;i<r.rangeCount;i++)t.push(r.getRangeAt(i));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null;break}return r.removeAllRanges(),function(){r.type==="Caret"&&r.removeAllRanges(),r.rangeCount||t.forEach(function(n){r.addRange(n)}),e&&e.focus()}},ml=yl,Ln={"text/plain":"Text","text/html":"Url",default:"Text"},vl="Copy to clipboard: #{key}, Enter";function wl(r){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return r.replace(/#{\s*key\s*}/g,e)}function _l(r,e){var t,i,n,s,o,a,c=!1;e||(e={}),t=e.debug||!1;try{n=ml(),s=document.createRange(),o=document.getSelection(),a=document.createElement("span"),a.textContent=r,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",function(u){if(u.stopPropagation(),e.format)if(u.preventDefault(),typeof u.clipboardData>"u"){t&&console.warn("unable to use e.clipboardData"),t&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=Ln[e.format]||Ln.default;window.clipboardData.setData(h,r)}else u.clipboardData.clearData(),u.clipboardData.setData(e.format,r);e.onCopy&&(u.preventDefault(),e.onCopy(u.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");c=!0}catch(u){t&&console.error("unable to copy using execCommand: ",u),t&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",r),e.onCopy&&e.onCopy(window.clipboardData),c=!0}catch(h){t&&console.error("unable to copy using clipboardData: ",h),t&&console.error("falling back to prompt"),i=wl("message"in e?e.message:vl),window.prompt(i,r)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),n()}return c}var bl=_l,El={}.toString,tn=Array.isArray||function(r){return El.call(r)=="[object Array]"},Sl=E.requireElliptic(),rn={},Q={};Object.defineProperty(Q,"__esModule",{value:!0});var $o=Q.getLocalStorage=Ko=Q.getLocalStorageOrThrow=zo=Q.getCrypto=jo=Q.getCryptoOrThrow=Uo=Q.getLocation=Bo=Q.getLocationOrThrow=qo=Q.getNavigator=Fo=Q.getNavigatorOrThrow=Do=Q.getDocument=Lo=Q.getDocumentOrThrow=Mo=Q.getFromWindowOrThrow=ko=Q.getFromWindow=void 0;function vt(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}var ko=Q.getFromWindow=vt;function Ft(r){const e=vt(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}var Mo=Q.getFromWindowOrThrow=Ft;function Il(){return Ft("document")}var Lo=Q.getDocumentOrThrow=Il;function xl(){return vt("document")}var Do=Q.getDocument=xl;function Pl(){return Ft("navigator")}var Fo=Q.getNavigatorOrThrow=Pl;function Al(){return vt("navigator")}var qo=Q.getNavigator=Al;function Rl(){return Ft("location")}var Bo=Q.getLocationOrThrow=Rl;function Nl(){return vt("location")}var Uo=Q.getLocation=Nl;function Tl(){return Ft("crypto")}var jo=Q.getCryptoOrThrow=Tl;function Cl(){return vt("crypto")}var zo=Q.getCrypto=Cl;function Ol(){return Ft("localStorage")}var Ko=Q.getLocalStorageOrThrow=Ol;function $l(){return vt("localStorage")}$o=Q.getLocalStorage=$l;Object.defineProperty(rn,"__esModule",{value:!0});var Vo=rn.getWindowMetadata=void 0;const Dn=Q;function kl(){let r,e;try{r=Dn.getDocumentOrThrow(),e=Dn.getLocationOrThrow()}catch{return null}function t(){const h=r.getElementsByTagName("link"),p=[];for(let d=0;d<h.length;d++){const f=h[d],g=f.getAttribute("rel");if(g&&g.toLowerCase().indexOf("icon")>-1){const y=f.getAttribute("href");if(y)if(y.toLowerCase().indexOf("https:")===-1&&y.toLowerCase().indexOf("http:")===-1&&y.indexOf("//")!==0){let m=e.protocol+"//"+e.host;if(y.indexOf("/")===0)m+=y;else{const v=e.pathname.split("/");v.pop();const b=v.join("/");m+=b+"/"+y}p.push(m)}else if(y.indexOf("//")===0){const m=e.protocol+y;p.push(m)}else p.push(y)}}return p}function i(...h){const p=r.getElementsByTagName("meta");for(let d=0;d<p.length;d++){const f=p[d],g=["itemprop","property","name"].map(y=>f.getAttribute(y)).filter(y=>y?h.includes(y):!1);if(g.length&&g){const y=f.getAttribute("content");if(y)return y}}return""}function n(){let h=i("name","og:site_name","og:title","twitter:title");return h||(h=r.title),h}function s(){return i("description","og:description","twitter:description","keywords")}const o=n(),a=s(),c=e.origin,l=t();return{description:a,url:c,icons:l,name:o}}Vo=rn.getWindowMetadata=kl;var Ml=function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),n=0,e=0;e<t;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i},Ll=function(){function r(e,t,i){this.name=e,this.version=t,this.os=i,this.type="browser"}return r}(),Dl=function(){function r(e){this.version=e,this.type="node",this.name="node",this.os=E.dist.process.platform}return r}(),Fl=function(){function r(e,t,i,n){this.name=e,this.version=t,this.os=i,this.bot=n,this.type="bot-device"}return r}(),ql=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),Bl=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),Ul=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,jl=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Fn=3,zl=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",Ul]],qn=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function Kl(r){return r?Bn(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Bl:typeof navigator<"u"?Bn(navigator.userAgent):Hl()}function Vl(r){return r!==""&&zl.reduce(function(e,t){var i=t[0],n=t[1];if(e)return e;var s=n.exec(r);return!!s&&[i,s]},!1)}function Bn(r){var e=Vl(r);if(!e)return null;var t=e[0],i=e[1];if(t==="searchbot")return new ql;var n=i[1]&&i[1].split(/[._]/).slice(0,3);n?n.length<Fn&&(n=Ml(n,Jl(Fn-n.length))):n=[];var s=n.join("."),o=Wl(r),a=jl.exec(r);return a&&a[1]?new Fl(t,s,o,a[1]):new Ll(t,s,o)}function Wl(r){for(var e=0,t=qn.length;e<t;e++){var i=qn[e],n=i[0],s=i[1],o=s.exec(r);if(o)return n}return null}function Hl(){var r=typeof E.dist.process<"u"&&E.dist.process.version;return r?new Dl(E.dist.process.version.slice(1)):null}function Jl(r){for(var e=[],t=0;t<r;t++)e.push("0");return e}function nn(r){return Kl(r)}function Kr(){const r=nn();return r&&r.os?r.os:void 0}function Wo(){const r=Kr();return r?r.toLowerCase().includes("android"):!1}function Ho(){const r=Kr();return r?r.toLowerCase().includes("ios")||r.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}function Gl(){return Kr()?Wo()||Ho():!1}function Jo(){const r=nn();return r&&r.name?r.name.toLowerCase()==="node":!1}function Yl(){return!Jo()&&!!Go()}const Ql=ko,Xl=Mo,Zl=Lo,eu=Do,tu=Fo,Go=qo,ru=Bo,iu=Uo,nu=jo,su=zo,ou=Ko,Vr=$o;function au(){return Vo()}function cu(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return JSON.parse(r)}catch{return r}}function lu(r){return typeof r=="string"?r:JSON.stringify(r)}const Yo=cu,Qo=lu;function Xo(r,e){const t=Qo(e),i=Vr();i&&i.setItem(r,t)}function uu(r){let e=null,t=null;const i=Vr();return i&&(t=i.getItem(r)),e=t&&Yo(t),e}function hu(r){const e=Vr();e&&e.removeItem(r)}const Zo="WALLETCONNECT_DEEPLINK_CHOICE";function du(r,e){const t=encodeURIComponent(r);return e.universalLink?`${e.universalLink}/wc?uri=${t}`:e.deepLink?`${e.deepLink}${e.deepLink.endsWith(":")?"//":"/"}wc?uri=${t}`:""}function fu(r){const e=r.href.split("?")[0];Xo(Zo,Object.assign(Object.assign({},r),{href:e}))}function ea(r,e){return r.filter(t=>t.name.toLowerCase().includes(e.toLowerCase()))[0]}function pu(r,e){let t=r;return e&&(t=e.map(i=>ea(r,i)).filter(Boolean)),t}const ta="https://registry.walletconnect.com";function gu(){return ta+"/api/v2/wallets"}function yu(){return ta+"/api/v2/dapps"}function ra(r,e="mobile"){var t;return{name:r.name||"",shortName:r.metadata.shortName||"",color:r.metadata.colors.primary||"",logo:(t=r.image_url.sm)!==null&&t!==void 0?t:"",universalLink:r[e].universal||"",deepLink:r[e].native||""}}function mu(r,e="mobile"){return Object.values(r).filter(t=>!!t[e].universal||!!t[e].native).map(t=>ra(t,e))}const vu=Object.freeze(Object.defineProperty({__proto__:null,detectEnv:nn,detectOS:Kr,formatIOSMobile:du,formatMobileRegistry:mu,formatMobileRegistryEntry:ra,getClientMeta:au,getCrypto:su,getCryptoOrThrow:nu,getDappRegistryUrl:yu,getDocument:eu,getDocumentOrThrow:Zl,getFromWindow:Ql,getFromWindowOrThrow:Xl,getLocal:uu,getLocalStorage:Vr,getLocalStorageOrThrow:ou,getLocation:iu,getLocationOrThrow:ru,getMobileLinkRegistry:pu,getMobileRegistryEntry:ea,getNavigator:Go,getNavigatorOrThrow:tu,getWalletRegistryUrl:gu,isAndroid:Wo,isBrowser:Yl,isIOS:Ho,isMobile:Gl,isNode:Jo,mobileLinkChoiceKey:Zo,removeLocal:hu,safeJsonParse:Yo,safeJsonStringify:Qo,saveMobileLinkInfo:fu,setLocal:Xo},Symbol.toStringTag,{value:"Module"})),wu=E.getAugmentedNamespace(vu);var ur={},_u=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},ia={},at={},bu=tn;function Eu(){try{var r=new Uint8Array(1);return r.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},r.foo()===42}catch{return!1}}j.TYPED_ARRAY_SUPPORT=Eu();var Un=j.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function j(r,e,t){return!j.TYPED_ARRAY_SUPPORT&&!(this instanceof j)?new j(r,e,t):typeof r=="number"?na(this,r):Nu(this,r,e,t)}j.TYPED_ARRAY_SUPPORT&&(j.prototype.__proto__=Uint8Array.prototype,j.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&j[Symbol.species]===j&&Object.defineProperty(j,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}));function sn(r){if(r>=Un)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Un.toString(16)+" bytes");return r|0}function Su(r){return r!==r}function Nt(r,e){var t;return j.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=j.prototype):(t=r,t===null&&(t=new j(e)),t.length=e),t}function na(r,e){var t=Nt(r,e<0?0:sn(e)|0);if(!j.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)t[i]=0;return t}function Iu(r,e){var t=oa(e)|0,i=Nt(r,t),n=i.write(e);return n!==t&&(i=i.slice(0,n)),i}function Oi(r,e){for(var t=e.length<0?0:sn(e.length)|0,i=Nt(r,t),n=0;n<t;n+=1)i[n]=e[n]&255;return i}function xu(r,e,t,i){if(t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(i||0))throw new RangeError("'length' is out of bounds");var n;return t===void 0&&i===void 0?n=new Uint8Array(e):i===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,i),j.TYPED_ARRAY_SUPPORT?n.__proto__=j.prototype:n=Oi(r,n),n}function Pu(r,e){if(j.isBuffer(e)){var t=sn(e.length)|0,i=Nt(r,t);return i.length===0||e.copy(i,0,0,t),i}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Su(e.length)?Nt(r,0):Oi(r,e);if(e.type==="Buffer"&&Array.isArray(e.data))return Oi(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function sa(r,e){e=e||1/0;for(var t,i=r.length,n=null,s=[],o=0;o<i;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!n){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}function oa(r){if(j.isBuffer(r))return r.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var e=r.length;return e===0?0:sa(r).length}function Au(r,e,t,i){for(var n=0;n<i&&!(n+t>=e.length||n>=r.length);++n)e[n+t]=r[n];return n}function Ru(r,e,t,i){return Au(sa(e,r.length-t),r,t,i)}function Nu(r,e,t,i){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?xu(r,e,t,i):typeof e=="string"?Iu(r,e):Pu(r,e)}j.prototype.write=function(e,t,i){t===void 0?(i=this.length,t=0):i===void 0&&typeof t=="string"?(i=this.length,t=0):isFinite(t)&&(t=t|0,isFinite(i)?i=i|0:i=void 0);var n=this.length-t;if((i===void 0||i>n)&&(i=n),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");return Ru(this,e,t,i)};j.prototype.slice=function(e,t){var i=this.length;e=~~e,t=t===void 0?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);var n;if(j.TYPED_ARRAY_SUPPORT)n=this.subarray(e,t),n.__proto__=j.prototype;else{var s=t-e;n=new j(s,void 0);for(var o=0;o<s;++o)n[o]=this[o+e]}return n};j.prototype.copy=function(e,t,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var s=n-i,o;if(this===e&&i<t&&t<n)for(o=s-1;o>=0;--o)e[o+t]=this[o+i];else if(s<1e3||!j.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+t]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+s),t);return s};j.prototype.fill=function(e,t,i){if(typeof e=="string"){if(typeof t=="string"?(t=0,i=this.length):typeof i=="string"&&(i=this.length),e.length===1){var n=e.charCodeAt(0);n<256&&(e=n)}}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);var s;if(typeof e=="number")for(s=t;s<i;++s)this[s]=e;else{var o=j.isBuffer(e)?e:new j(e),a=o.length;for(s=0;s<i-t;++s)this[s+t]=o[s%a]}return this};j.concat=function(e,t){if(!bu(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return Nt(null,0);var i;if(t===void 0)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=na(null,t),s=0;for(i=0;i<e.length;++i){var o=e[i];if(!j.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,s),s+=o.length}return n};j.byteLength=oa;j.prototype._isBuffer=!0;j.isBuffer=function(e){return!!(e!=null&&e._isBuffer)};at.alloc=function(r){var e=new j(r);return e.fill(0),e};at.from=function(r){return new j(r)};var _e={},on,Tu=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];_e.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};_e.getSymbolTotalCodewords=function(e){return Tu[e]};_e.getBCHDigit=function(r){for(var e=0;r!==0;)e++,r>>>=1;return e};_e.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');on=e};_e.isKanjiModeEnabled=function(){return typeof on<"u"};_e.toSJIS=function(e){return on(e)};var Wr={};(function(r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2};function e(t){if(typeof t!="string")throw new Error("Param is not a string");var i=t.toLowerCase();switch(i){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+t)}}r.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},r.from=function(i,n){if(r.isValid(i))return i;try{return e(i)}catch{return n}}})(Wr);function aa(){this.buffer=[],this.length=0}aa.prototype={get:function(r){var e=Math.floor(r/8);return(this.buffer[e]>>>7-r%8&1)===1},put:function(r,e){for(var t=0;t<e;t++)this.putBit((r>>>e-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),r&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Cu=aa,jn=at;function hr(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=jn.alloc(r*r),this.reservedBit=jn.alloc(r*r)}hr.prototype.set=function(r,e,t,i){var n=r*this.size+e;this.data[n]=t,i&&(this.reservedBit[n]=!0)};hr.prototype.get=function(r,e){return this.data[r*this.size+e]};hr.prototype.xor=function(r,e,t){this.data[r*this.size+e]^=t};hr.prototype.isReserved=function(r,e){return this.reservedBit[r*this.size+e]};var Ou=hr,ca={};(function(r){var e=_e.getSymbolSize;r.getRowColCoords=function(i){if(i===1)return[];for(var n=Math.floor(i/7)+2,s=e(i),o=s===145?26:Math.ceil((s-13)/(2*n-2))*2,a=[s-7],c=1;c<n-1;c++)a[c]=a[c-1]-o;return a.push(6),a.reverse()},r.getPositions=function(i){for(var n=[],s=r.getRowColCoords(i),o=s.length,a=0;a<o;a++)for(var c=0;c<o;c++)a===0&&c===0||a===0&&c===o-1||a===o-1&&c===0||n.push([s[a],s[c]]);return n}})(ca);var la={},$u=_e.getSymbolSize,zn=7;la.getPositions=function(e){var t=$u(e);return[[0,0],[t-zn,0],[0,t-zn]]};var ua={};(function(r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var e={N1:3,N2:3,N3:40,N4:10};r.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},r.from=function(n){return r.isValid(n)?parseInt(n,10):void 0},r.getPenaltyN1=function(n){for(var s=n.size,o=0,a=0,c=0,l=null,u=null,h=0;h<s;h++){a=c=0,l=u=null;for(var p=0;p<s;p++){var d=n.get(h,p);d===l?a++:(a>=5&&(o+=e.N1+(a-5)),l=d,a=1),d=n.get(p,h),d===u?c++:(c>=5&&(o+=e.N1+(c-5)),u=d,c=1)}a>=5&&(o+=e.N1+(a-5)),c>=5&&(o+=e.N1+(c-5))}return o},r.getPenaltyN2=function(n){for(var s=n.size,o=0,a=0;a<s-1;a++)for(var c=0;c<s-1;c++){var l=n.get(a,c)+n.get(a,c+1)+n.get(a+1,c)+n.get(a+1,c+1);(l===4||l===0)&&o++}return o*e.N2},r.getPenaltyN3=function(n){for(var s=n.size,o=0,a=0,c=0,l=0;l<s;l++){a=c=0;for(var u=0;u<s;u++)a=a<<1&2047|n.get(l,u),u>=10&&(a===1488||a===93)&&o++,c=c<<1&2047|n.get(u,l),u>=10&&(c===1488||c===93)&&o++}return o*e.N3},r.getPenaltyN4=function(n){for(var s=0,o=n.data.length,a=0;a<o;a++)s+=n.data[a];var c=Math.abs(Math.ceil(s*100/o/5)-10);return c*e.N4};function t(i,n,s){switch(i){case r.Patterns.PATTERN000:return(n+s)%2===0;case r.Patterns.PATTERN001:return n%2===0;case r.Patterns.PATTERN010:return s%3===0;case r.Patterns.PATTERN011:return(n+s)%3===0;case r.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2===0;case r.Patterns.PATTERN101:return n*s%2+n*s%3===0;case r.Patterns.PATTERN110:return(n*s%2+n*s%3)%2===0;case r.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}r.applyMask=function(n,s){for(var o=s.size,a=0;a<o;a++)for(var c=0;c<o;c++)s.isReserved(c,a)||s.xor(c,a,t(n,c,a))},r.getBestMask=function(n,s){for(var o=Object.keys(r.Patterns).length,a=0,c=1/0,l=0;l<o;l++){s(l),r.applyMask(l,n);var u=r.getPenaltyN1(n)+r.getPenaltyN2(n)+r.getPenaltyN3(n)+r.getPenaltyN4(n);r.applyMask(l,n),u<c&&(c=u,a=l)}return a}})(ua);var Hr={},tt=Wr,wr=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],_r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Hr.getBlocksCount=function(e,t){switch(t){case tt.L:return wr[(e-1)*4+0];case tt.M:return wr[(e-1)*4+1];case tt.Q:return wr[(e-1)*4+2];case tt.H:return wr[(e-1)*4+3];default:return}};Hr.getTotalCodewordsCount=function(e,t){switch(t){case tt.L:return _r[(e-1)*4+0];case tt.M:return _r[(e-1)*4+1];case tt.Q:return _r[(e-1)*4+2];case tt.H:return _r[(e-1)*4+3];default:return}};var ha={},Jr={},da=at,Zt=da.alloc(512),Or=da.alloc(256);(function(){for(var e=1,t=0;t<255;t++)Zt[t]=e,Or[e]=t,e<<=1,e&256&&(e^=285);for(t=255;t<512;t++)Zt[t]=Zt[t-255]})();Jr.log=function(e){if(e<1)throw new Error("log("+e+")");return Or[e]};Jr.exp=function(e){return Zt[e]};Jr.mul=function(e,t){return e===0||t===0?0:Zt[Or[e]+Or[t]]};(function(r){var e=at,t=Jr;r.mul=function(n,s){for(var o=e.alloc(n.length+s.length-1),a=0;a<n.length;a++)for(var c=0;c<s.length;c++)o[a+c]^=t.mul(n[a],s[c]);return o},r.mod=function(n,s){for(var o=e.from(n);o.length-s.length>=0;){for(var a=o[0],c=0;c<s.length;c++)o[c]^=t.mul(s[c],a);for(var l=0;l<o.length&&o[l]===0;)l++;o=o.slice(l)}return o},r.generateECPolynomial=function(n){for(var s=e.from([1]),o=0;o<n;o++)s=r.mul(s,[1,t.exp(o)]);return s}})(ha);var Kn=at,fa=ha,ku=E.bufferPolyfill.Buffer;function an(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}an.prototype.initialize=function(e){this.degree=e,this.genPoly=fa.generateECPolynomial(this.degree)};an.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");var t=Kn.alloc(this.degree),i=ku.concat([e,t],e.length+this.degree),n=fa.mod(i,this.genPoly),s=this.degree-n.length;if(s>0){var o=Kn.alloc(this.degree);return n.copy(o,s),o}return n};var Mu=an,pa={},ct={},cn={};cn.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var je={},ga="[0-9]+",Lu="[A-Z $%*+\\-./:]+",nr="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";nr=nr.replace(/u/g,"\\u");var Du="(?:(?![A-Z0-9 $%*+\\-./:]|"+nr+`)(?:.|[\r
|
|
2
2
|
]))+`;je.KANJI=new RegExp(nr,"g");je.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");je.BYTE=new RegExp(Du,"g");je.NUMERIC=new RegExp(ga,"g");je.ALPHANUMERIC=new RegExp(Lu,"g");var Fu=new RegExp("^"+nr+"$"),qu=new RegExp("^"+ga+"$"),Bu=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");je.testKanji=function(e){return Fu.test(e)};je.testNumeric=function(e){return qu.test(e)};je.testAlphanumeric=function(e){return Bu.test(e)};(function(r){var e=cn,t=je;r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(s,o){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?s.ccBits[0]:o<27?s.ccBits[1]:s.ccBits[2]},r.getBestModeForData=function(s){return t.testNumeric(s)?r.NUMERIC:t.testAlphanumeric(s)?r.ALPHANUMERIC:t.testKanji(s)?r.KANJI:r.BYTE},r.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},r.isValid=function(s){return s&&s.bit&&s.ccBits};function i(n){if(typeof n!="string")throw new Error("Param is not a string");var s=n.toLowerCase();switch(s){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+n)}}r.from=function(s,o){if(r.isValid(s))return s;try{return i(s)}catch{return o}}})(ct);(function(r){var e=_e,t=Hr,i=Wr,n=ct,s=cn,o=tn,a=7973,c=e.getBCHDigit(a);function l(d,f,g){for(var y=1;y<=40;y++)if(f<=r.getCapacity(y,g,d))return y}function u(d,f){return n.getCharCountIndicator(d,f)+4}function h(d,f){var g=0;return d.forEach(function(y){var m=u(y.mode,f);g+=m+y.getBitsLength()}),g}function p(d,f){for(var g=1;g<=40;g++){var y=h(d,g);if(y<=r.getCapacity(g,f,n.MIXED))return g}}r.from=function(f,g){return s.isValid(f)?parseInt(f,10):g},r.getCapacity=function(f,g,y){if(!s.isValid(f))throw new Error("Invalid QR Code version");typeof y>"u"&&(y=n.BYTE);var m=e.getSymbolTotalCodewords(f),v=t.getTotalCodewordsCount(f,g),b=(m-v)*8;if(y===n.MIXED)return b;var w=b-u(y,f);switch(y){case n.NUMERIC:return Math.floor(w/10*3);case n.ALPHANUMERIC:return Math.floor(w/11*2);case n.KANJI:return Math.floor(w/13);case n.BYTE:default:return Math.floor(w/8)}},r.getBestVersionForData=function(f,g){var y,m=i.from(g,i.M);if(o(f)){if(f.length>1)return p(f,m);if(f.length===0)return 1;y=f[0]}else y=f;return l(y.mode,y.getLength(),m)},r.getEncodedBits=function(f){if(!s.isValid(f)||f<7)throw new Error("Invalid QR Code version");for(var g=f<<12;e.getBCHDigit(g)-c>=0;)g^=a<<e.getBCHDigit(g)-c;return f<<12|g}})(pa);var ya={},$i=_e,ma=1335,Uu=21522,Vn=$i.getBCHDigit(ma);ya.getEncodedBits=function(e,t){for(var i=e.bit<<3|t,n=i<<10;$i.getBCHDigit(n)-Vn>=0;)n^=ma<<$i.getBCHDigit(n)-Vn;return(i<<10|n)^Uu};var va={},ju=ct;function Tt(r){this.mode=ju.NUMERIC,this.data=r.toString()}Tt.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};Tt.prototype.getLength=function(){return this.data.length};Tt.prototype.getBitsLength=function(){return Tt.getBitsLength(this.data.length)};Tt.prototype.write=function(e){var t,i,n;for(t=0;t+3<=this.data.length;t+=3)i=this.data.substr(t,3),n=parseInt(i,10),e.put(n,10);var s=this.data.length-t;s>0&&(i=this.data.substr(t),n=parseInt(i,10),e.put(n,s*3+1))};var zu=Tt,Ku=ct,ui=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Ct(r){this.mode=Ku.ALPHANUMERIC,this.data=r}Ct.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};Ct.prototype.getLength=function(){return this.data.length};Ct.prototype.getBitsLength=function(){return Ct.getBitsLength(this.data.length)};Ct.prototype.write=function(e){var t;for(t=0;t+2<=this.data.length;t+=2){var i=ui.indexOf(this.data[t])*45;i+=ui.indexOf(this.data[t+1]),e.put(i,11)}this.data.length%2&&e.put(ui.indexOf(this.data[t]),6)};var Vu=Ct,Wu=at,Hu=ct;function Ot(r){this.mode=Hu.BYTE,this.data=Wu.from(r)}Ot.getBitsLength=function(e){return e*8};Ot.prototype.getLength=function(){return this.data.length};Ot.prototype.getBitsLength=function(){return Ot.getBitsLength(this.data.length)};Ot.prototype.write=function(r){for(var e=0,t=this.data.length;e<t;e++)r.put(this.data[e],8)};var Ju=Ot,Gu=ct,Yu=_e;function $t(r){this.mode=Gu.KANJI,this.data=r}$t.getBitsLength=function(e){return e*13};$t.prototype.getLength=function(){return this.data.length};$t.prototype.getBitsLength=function(){return $t.getBitsLength(this.data.length)};$t.prototype.write=function(r){var e;for(e=0;e<this.data.length;e++){var t=Yu.toSJIS(this.data[e]);if(t>=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
|
|
3
3
|
Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),r.put(t,13)}};var Qu=$t;(function(r){var e=ct,t=zu,i=Vu,n=Ju,s=Qu,o=je,a=_e,c=pl.dijkstraExports;function l(m){return unescape(encodeURIComponent(m)).length}function u(m,v,b){for(var w=[],S;(S=m.exec(b))!==null;)w.push({data:S[0],index:S.index,mode:v,length:S[0].length});return w}function h(m){var v=u(o.NUMERIC,e.NUMERIC,m),b=u(o.ALPHANUMERIC,e.ALPHANUMERIC,m),w,S;a.isKanjiModeEnabled()?(w=u(o.BYTE,e.BYTE,m),S=u(o.KANJI,e.KANJI,m)):(w=u(o.BYTE_KANJI,e.BYTE,m),S=[]);var I=v.concat(b,w,S);return I.sort(function(x,A){return x.index-A.index}).map(function(x){return{data:x.data,mode:x.mode,length:x.length}})}function p(m,v){switch(v){case e.NUMERIC:return t.getBitsLength(m);case e.ALPHANUMERIC:return i.getBitsLength(m);case e.KANJI:return s.getBitsLength(m);case e.BYTE:return n.getBitsLength(m)}}function d(m){return m.reduce(function(v,b){var w=v.length-1>=0?v[v.length-1]:null;return w&&w.mode===b.mode?(v[v.length-1].data+=b.data,v):(v.push(b),v)},[])}function f(m){for(var v=[],b=0;b<m.length;b++){var w=m[b];switch(w.mode){case e.NUMERIC:v.push([w,{data:w.data,mode:e.ALPHANUMERIC,length:w.length},{data:w.data,mode:e.BYTE,length:w.length}]);break;case e.ALPHANUMERIC:v.push([w,{data:w.data,mode:e.BYTE,length:w.length}]);break;case e.KANJI:v.push([w,{data:w.data,mode:e.BYTE,length:l(w.data)}]);break;case e.BYTE:v.push([{data:w.data,mode:e.BYTE,length:l(w.data)}])}}return v}function g(m,v){for(var b={},w={start:{}},S=["start"],I=0;I<m.length;I++){for(var x=m[I],A=[],C=0;C<x.length;C++){var O=x[C],$=""+I+C;A.push($),b[$]={node:O,lastCount:0},w[$]={};for(var D=0;D<S.length;D++){var k=S[D];b[k]&&b[k].node.mode===O.mode?(w[k][$]=p(b[k].lastCount+O.length,O.mode)-p(b[k].lastCount,O.mode),b[k].lastCount+=O.length):(b[k]&&(b[k].lastCount=O.length),w[k][$]=p(O.length,O.mode)+4+e.getCharCountIndicator(O.mode,v))}}S=A}for(D=0;D<S.length;D++)w[S[D]].end=0;return{map:w,table:b}}function y(m,v){var b,w=e.getBestModeForData(m);if(b=e.from(v,w),b!==e.BYTE&&b.bit<w.bit)throw new Error('"'+m+'" cannot be encoded with mode '+e.toString(b)+`.
|
|
4
4
|
Suggested mode is: `+e.toString(w));switch(b===e.KANJI&&!a.isKanjiModeEnabled()&&(b=e.BYTE),b){case e.NUMERIC:return new t(m);case e.ALPHANUMERIC:return new i(m);case e.KANJI:return new s(m);case e.BYTE:return new n(m)}}r.fromArray=function(v){return v.reduce(function(b,w){return typeof w=="string"?b.push(y(w,null)):w.data&&b.push(y(w.data,w.mode)),b},[])},r.fromString=function(v,b){for(var w=h(v,a.isKanjiModeEnabled()),S=f(w),I=g(S,b),x=c.find_path(I.map,"start","end"),A=[],C=1;C<x.length-1;C++)A.push(I.table[x[C]].node);return r.fromArray(d(A))},r.rawSplit=function(v){return r.fromArray(h(v,a.isKanjiModeEnabled()))}})(va);var Wn=at,Gr=_e,hi=Wr,Xu=Cu,Zu=Ou,eh=ca,th=la,ki=ua,Mi=Hr,rh=Mu,$r=pa,ih=ya,nh=ct,di=va,sh=tn;function oh(r,e){for(var t=r.size,i=th.getPositions(e),n=0;n<i.length;n++)for(var s=i[n][0],o=i[n][1],a=-1;a<=7;a++)if(!(s+a<=-1||t<=s+a))for(var c=-1;c<=7;c++)o+c<=-1||t<=o+c||(a>=0&&a<=6&&(c===0||c===6)||c>=0&&c<=6&&(a===0||a===6)||a>=2&&a<=4&&c>=2&&c<=4?r.set(s+a,o+c,!0,!0):r.set(s+a,o+c,!1,!0))}function ah(r){for(var e=r.size,t=8;t<e-8;t++){var i=t%2===0;r.set(t,6,i,!0),r.set(6,t,i,!0)}}function ch(r,e){for(var t=eh.getPositions(e),i=0;i<t.length;i++)for(var n=t[i][0],s=t[i][1],o=-2;o<=2;o++)for(var a=-2;a<=2;a++)o===-2||o===2||a===-2||a===2||o===0&&a===0?r.set(n+o,s+a,!0,!0):r.set(n+o,s+a,!1,!0)}function lh(r,e){for(var t=r.size,i=$r.getEncodedBits(e),n,s,o,a=0;a<18;a++)n=Math.floor(a/3),s=a%3+t-8-3,o=(i>>a&1)===1,r.set(n,s,o,!0),r.set(s,n,o,!0)}function fi(r,e,t){var i=r.size,n=ih.getEncodedBits(e,t),s,o;for(s=0;s<15;s++)o=(n>>s&1)===1,s<6?r.set(s,8,o,!0):s<8?r.set(s+1,8,o,!0):r.set(i-15+s,8,o,!0),s<8?r.set(8,i-s-1,o,!0):s<9?r.set(8,15-s-1+1,o,!0):r.set(8,15-s-1,o,!0);r.set(i-8,8,1,!0)}function uh(r,e){for(var t=r.size,i=-1,n=t-1,s=7,o=0,a=t-1;a>0;a-=2)for(a===6&&a--;;){for(var c=0;c<2;c++)if(!r.isReserved(n,a-c)){var l=!1;o<e.length&&(l=(e[o]>>>s&1)===1),r.set(n,a-c,l),s--,s===-1&&(o++,s=7)}if(n+=i,n<0||t<=n){n-=i,i=-i;break}}}function hh(r,e,t){var i=new Xu;t.forEach(function(l){i.put(l.mode.bit,4),i.put(l.getLength(),nh.getCharCountIndicator(l.mode,r)),l.write(i)});var n=Gr.getSymbolTotalCodewords(r),s=Mi.getTotalCodewordsCount(r,e),o=(n-s)*8;for(i.getLengthInBits()+4<=o&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);for(var a=(o-i.getLengthInBits())/8,c=0;c<a;c++)i.put(c%2?17:236,8);return dh(i,r,e)}function dh(r,e,t){for(var i=Gr.getSymbolTotalCodewords(e),n=Mi.getTotalCodewordsCount(e,t),s=i-n,o=Mi.getBlocksCount(e,t),a=i%o,c=o-a,l=Math.floor(i/o),u=Math.floor(s/o),h=u+1,p=l-u,d=new rh(p),f=0,g=new Array(o),y=new Array(o),m=0,v=Wn.from(r.buffer),b=0;b<o;b++){var w=b<c?u:h;g[b]=v.slice(f,f+w),y[b]=d.encode(g[b]),f+=w,m=Math.max(m,w)}var S=Wn.alloc(i),I=0,x,A;for(x=0;x<m;x++)for(A=0;A<o;A++)x<g[A].length&&(S[I++]=g[A][x]);for(x=0;x<p;x++)for(A=0;A<o;A++)S[I++]=y[A][x];return S}function fh(r,e,t,i){var n;if(sh(r))n=di.fromArray(r);else if(typeof r=="string"){var s=e;if(!s){var o=di.rawSplit(r);s=$r.getBestVersionForData(o,t)}n=di.fromString(r,s||40)}else throw new Error("Invalid data");var a=$r.getBestVersionForData(n,t);if(!a)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=a;else if(e<a)throw new Error(`
|