@chainrails/react 0.4.1 → 0.4.2
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/PaymentModal/index.d.ts.map +1 -1
- package/dist/chainrails-sdk.es.js +904 -887
- package/dist/chainrails-sdk.es.mjs +904 -887
- package/dist/chainrails-sdk.umd.js +11 -11
- package/dist/hooks/usePaymentModal.d.ts +6 -2
- package/dist/hooks/usePaymentModal.d.ts.map +1 -1
- package/dist/hooks/usePaymentSession.d.ts +6 -2
- package/dist/hooks/usePaymentSession.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -522,7 +522,7 @@ const Ma = (t) => {
|
|
|
522
522
|
POLYGON: "POLYGON_MAINNET",
|
|
523
523
|
STARKNET: "STARKNET_MAINNET",
|
|
524
524
|
STARKNET_TESTNET: "STARKNET_TESTNET"
|
|
525
|
-
},
|
|
525
|
+
}, oI = {
|
|
526
526
|
ARBITRUM: "ARBITRUM",
|
|
527
527
|
ARBITRUM_TESTNET: "ARBITRUM_TESTNET",
|
|
528
528
|
AVALANCHE: "AVALANCHE",
|
|
@@ -1697,7 +1697,7 @@ let rm = class {
|
|
|
1697
1697
|
return Ve().post("modal/sessions", { json: s }).json().then((i) => ({ ...i, amount: s.amount }));
|
|
1698
1698
|
}
|
|
1699
1699
|
};
|
|
1700
|
-
const
|
|
1700
|
+
const bI = {
|
|
1701
1701
|
router: new im(),
|
|
1702
1702
|
quotes: new sm(),
|
|
1703
1703
|
intents: new rm(),
|
|
@@ -3035,10 +3035,10 @@ function Og(t, e, { length: n, staticPosition: r }) {
|
|
|
3035
3035
|
const I = [];
|
|
3036
3036
|
for (let N = 0; N < m; ++N) {
|
|
3037
3037
|
t.setPosition(d + (g ? N * 32 : S));
|
|
3038
|
-
const [
|
|
3038
|
+
const [F, M] = Or(t, e, {
|
|
3039
3039
|
staticPosition: d
|
|
3040
3040
|
});
|
|
3041
|
-
S += M, I.push(
|
|
3041
|
+
S += M, I.push(F);
|
|
3042
3042
|
}
|
|
3043
3043
|
return t.setPosition(r + 32), [I, 32];
|
|
3044
3044
|
}
|
|
@@ -3530,7 +3530,7 @@ class sy extends de {
|
|
|
3530
3530
|
const [N] = I;
|
|
3531
3531
|
d = qg[N];
|
|
3532
3532
|
} else {
|
|
3533
|
-
const N = g ? Mr(g, { includeName: !0 }) : void 0,
|
|
3533
|
+
const N = g ? Mr(g, { includeName: !0 }) : void 0, F = g && I ? hf({
|
|
3534
3534
|
abiItem: g,
|
|
3535
3535
|
args: I,
|
|
3536
3536
|
includeFunctionName: !1,
|
|
@@ -3538,7 +3538,7 @@ class sy extends de {
|
|
|
3538
3538
|
}) : void 0;
|
|
3539
3539
|
a = [
|
|
3540
3540
|
N ? `Error: ${N}` : "",
|
|
3541
|
-
|
|
3541
|
+
F && F !== "()" ? ` ${[...Array(S?.length ?? 0).keys()].map(() => " ").join("")}${F}` : ""
|
|
3542
3542
|
];
|
|
3543
3543
|
}
|
|
3544
3544
|
} catch (g) {
|
|
@@ -4099,7 +4099,7 @@ class cy extends Ht {
|
|
|
4099
4099
|
}
|
|
4100
4100
|
const uy = 3;
|
|
4101
4101
|
function dy(t, { abi: e, address: n, args: r, docsPath: s, functionName: i, sender: o }) {
|
|
4102
|
-
const a = t instanceof oy ? t : t instanceof de ? t.walk((
|
|
4102
|
+
const a = t instanceof oy ? t : t instanceof de ? t.walk((F) => "data" in F) || t.walk() : {}, { code: d, data: m, details: g, message: S, shortMessage: I } = a, N = t instanceof Ac ? new iy({ functionName: i }) : [uy, or.code].includes(d) && (m || g || S || I) || d === Lr.code && g === "execution reverted" && m ? new sy({
|
|
4103
4103
|
abi: e,
|
|
4104
4104
|
data: typeof m == "object" ? m.data : m,
|
|
4105
4105
|
functionName: i,
|
|
@@ -4597,8 +4597,8 @@ async function wy({ hash: t, signature: e }) {
|
|
|
4597
4597
|
const n = Vn(t) ? t : La(t), { secp256k1: r } = await Promise.resolve().then(() => O1);
|
|
4598
4598
|
return `0x${(() => {
|
|
4599
4599
|
if (typeof e == "object" && "r" in e && "s" in e) {
|
|
4600
|
-
const { r: m, s: g, v: S, yParity: I } = e, N = Number(I ?? S),
|
|
4601
|
-
return new r.Signature(Br(m), Br(g)).addRecoveryBit(
|
|
4600
|
+
const { r: m, s: g, v: S, yParity: I } = e, N = Number(I ?? S), F = ud(N);
|
|
4601
|
+
return new r.Signature(Br(m), Br(g)).addRecoveryBit(F);
|
|
4602
4602
|
}
|
|
4603
4603
|
const o = Vn(e) ? e : La(e);
|
|
4604
4604
|
if (wt(o) !== 65)
|
|
@@ -5093,8 +5093,8 @@ class $y extends Mf {
|
|
|
5093
5093
|
for (let S = 0; S < 16; S++, n += 4)
|
|
5094
5094
|
Cn[S] = e.getUint32(n, !1);
|
|
5095
5095
|
for (let S = 16; S < 64; S++) {
|
|
5096
|
-
const I = Cn[S - 15], N = Cn[S - 2],
|
|
5097
|
-
Cn[S] = M + Cn[S - 7] +
|
|
5096
|
+
const I = Cn[S - 15], N = Cn[S - 2], F = cn(I, 7) ^ cn(I, 18) ^ I >>> 3, M = cn(N, 17) ^ cn(N, 19) ^ N >>> 10;
|
|
5097
|
+
Cn[S] = M + Cn[S - 7] + F + Cn[S - 16] | 0;
|
|
5098
5098
|
}
|
|
5099
5099
|
let { A: r, B: s, C: i, D: o, E: a, F: d, G: m, H: g } = this;
|
|
5100
5100
|
for (let S = 0; S < 64; S++) {
|
|
@@ -5198,28 +5198,28 @@ class Vy extends Mf {
|
|
|
5198
5198
|
}
|
|
5199
5199
|
// prettier-ignore
|
|
5200
5200
|
get() {
|
|
5201
|
-
const { Ah: e, Al: n, Bh: r, Bl: s, Ch: i, Cl: o, Dh: a, Dl: d, Eh: m, El: g, Fh: S, Fl: I, Gh: N, Gl:
|
|
5202
|
-
return [e, n, r, s, i, o, a, d, m, g, S, I, N,
|
|
5201
|
+
const { Ah: e, Al: n, Bh: r, Bl: s, Ch: i, Cl: o, Dh: a, Dl: d, Eh: m, El: g, Fh: S, Fl: I, Gh: N, Gl: F, Hh: M, Hl: k } = this;
|
|
5202
|
+
return [e, n, r, s, i, o, a, d, m, g, S, I, N, F, M, k];
|
|
5203
5203
|
}
|
|
5204
5204
|
// prettier-ignore
|
|
5205
|
-
set(e, n, r, s, i, o, a, d, m, g, S, I, N,
|
|
5206
|
-
this.Ah = e | 0, this.Al = n | 0, this.Bh = r | 0, this.Bl = s | 0, this.Ch = i | 0, this.Cl = o | 0, this.Dh = a | 0, this.Dl = d | 0, this.Eh = m | 0, this.El = g | 0, this.Fh = S | 0, this.Fl = I | 0, this.Gh = N | 0, this.Gl =
|
|
5205
|
+
set(e, n, r, s, i, o, a, d, m, g, S, I, N, F, M, k) {
|
|
5206
|
+
this.Ah = e | 0, this.Al = n | 0, this.Bh = r | 0, this.Bl = s | 0, this.Ch = i | 0, this.Cl = o | 0, this.Dh = a | 0, this.Dl = d | 0, this.Eh = m | 0, this.El = g | 0, this.Fh = S | 0, this.Fl = I | 0, this.Gh = N | 0, this.Gl = F | 0, this.Hh = M | 0, this.Hl = k | 0;
|
|
5207
5207
|
}
|
|
5208
5208
|
process(e, n) {
|
|
5209
|
-
for (let
|
|
5210
|
-
Mn[
|
|
5211
|
-
for (let
|
|
5212
|
-
const U = Mn[
|
|
5213
|
-
Mn[
|
|
5209
|
+
for (let z = 0; z < 16; z++, n += 4)
|
|
5210
|
+
Mn[z] = e.getUint32(n), Bn[z] = e.getUint32(n += 4);
|
|
5211
|
+
for (let z = 16; z < 80; z++) {
|
|
5212
|
+
const U = Mn[z - 15] | 0, j = Bn[z - 15] | 0, J = br(U, j, 1) ^ br(U, j, 8) ^ Ju(U, j, 7), ne = _r(U, j, 1) ^ _r(U, j, 8) ^ Xu(U, j, 7), te = Mn[z - 2] | 0, V = Bn[z - 2] | 0, C = br(te, V, 19) ^ ii(te, V, 61) ^ Ju(te, V, 6), L = _r(te, V, 19) ^ oi(te, V, 61) ^ Xu(te, V, 6), G = $m(ne, L, Bn[z - 7], Bn[z - 16]), w = zm(G, J, C, Mn[z - 7], Mn[z - 16]);
|
|
5213
|
+
Mn[z] = w | 0, Bn[z] = G | 0;
|
|
5214
5214
|
}
|
|
5215
|
-
let { Ah: r, Al: s, Bh: i, Bl: o, Ch: a, Cl: d, Dh: m, Dl: g, Eh: S, El: I, Fh: N, Fl:
|
|
5216
|
-
for (let
|
|
5217
|
-
const U = br(S, I, 14) ^ br(S, I, 18) ^ ii(S, I, 41),
|
|
5218
|
-
K = M | 0, Y = k | 0, M = N | 0, k =
|
|
5219
|
-
const p = Pm(C,
|
|
5220
|
-
r = Fm(p,
|
|
5215
|
+
let { Ah: r, Al: s, Bh: i, Bl: o, Ch: a, Cl: d, Dh: m, Dl: g, Eh: S, El: I, Fh: N, Fl: F, Gh: M, Gl: k, Hh: K, Hl: Y } = this;
|
|
5216
|
+
for (let z = 0; z < 80; z++) {
|
|
5217
|
+
const U = br(S, I, 14) ^ br(S, I, 18) ^ ii(S, I, 41), j = _r(S, I, 14) ^ _r(S, I, 18) ^ oi(S, I, 41), J = S & N ^ ~S & M, ne = I & F ^ ~I & k, te = jm(Y, j, ne, jy[z], Bn[z]), V = Vm(te, K, U, J, zy[z], Mn[z]), C = te | 0, L = br(r, s, 28) ^ ii(r, s, 34) ^ ii(r, s, 39), G = _r(r, s, 28) ^ oi(r, s, 34) ^ oi(r, s, 39), w = r & i ^ r & a ^ i & a, c = s & o ^ s & d ^ o & d;
|
|
5218
|
+
K = M | 0, Y = k | 0, M = N | 0, k = F | 0, N = S | 0, F = I | 0, { h: S, l: I } = yn(m | 0, g | 0, V | 0, C | 0), m = a | 0, g = d | 0, a = i | 0, d = o | 0, i = r | 0, o = s | 0;
|
|
5219
|
+
const p = Pm(C, G, c);
|
|
5220
|
+
r = Fm(p, V, L, w), s = p | 0;
|
|
5221
5221
|
}
|
|
5222
|
-
({ h: r, l: s } = yn(this.Ah | 0, this.Al | 0, r | 0, s | 0)), { h: i, l: o } = yn(this.Bh | 0, this.Bl | 0, i | 0, o | 0), { h: a, l: d } = yn(this.Ch | 0, this.Cl | 0, a | 0, d | 0), { h: m, l: g } = yn(this.Dh | 0, this.Dl | 0, m | 0, g | 0), { h: S, l: I } = yn(this.Eh | 0, this.El | 0, S | 0, I | 0), { h: N, l:
|
|
5222
|
+
({ h: r, l: s } = yn(this.Ah | 0, this.Al | 0, r | 0, s | 0)), { h: i, l: o } = yn(this.Bh | 0, this.Bl | 0, i | 0, o | 0), { h: a, l: d } = yn(this.Ch | 0, this.Cl | 0, a | 0, d | 0), { h: m, l: g } = yn(this.Dh | 0, this.Dl | 0, m | 0, g | 0), { h: S, l: I } = yn(this.Eh | 0, this.El | 0, S | 0, I | 0), { h: N, l: F } = yn(this.Fh | 0, this.Fl | 0, N | 0, F | 0), { h: M, l: k } = yn(this.Gh | 0, this.Gl | 0, M | 0, k | 0), { h: K, l: Y } = yn(this.Hh | 0, this.Hl | 0, K | 0, Y | 0), this.set(r, s, i, o, a, d, m, g, S, I, N, F, M, k, K, Y);
|
|
5223
5223
|
}
|
|
5224
5224
|
roundClean() {
|
|
5225
5225
|
Hn(Mn, Bn);
|
|
@@ -5328,20 +5328,20 @@ async function Hc(t) {
|
|
|
5328
5328
|
return sr(e);
|
|
5329
5329
|
}
|
|
5330
5330
|
async function Qy(t, e) {
|
|
5331
|
-
const { account: n = t.account, accessList: r, authorizationList: s, chain: i = t.chain, blobVersionedHashes: o, blobs: a, data: d, gas: m, gasPrice: g, maxFeePerBlobGas: S, maxFeePerGas: I, maxPriorityFeePerGas: N, nonce:
|
|
5332
|
-
if (!n || !M || typeof
|
|
5333
|
-
return
|
|
5334
|
-
const te = In(n),
|
|
5331
|
+
const { account: n = t.account, accessList: r, authorizationList: s, chain: i = t.chain, blobVersionedHashes: o, blobs: a, data: d, gas: m, gasPrice: g, maxFeePerBlobGas: S, maxFeePerGas: I, maxPriorityFeePerGas: N, nonce: F, nonceManager: M, to: k, type: K, value: Y, ...z } = e, U = await (async () => {
|
|
5332
|
+
if (!n || !M || typeof F < "u")
|
|
5333
|
+
return F;
|
|
5334
|
+
const te = In(n), V = i ? i.id : await kt(t, Hc, "getChainId")({});
|
|
5335
5335
|
return await M.consume({
|
|
5336
5336
|
address: te.address,
|
|
5337
|
-
chainId:
|
|
5337
|
+
chainId: V,
|
|
5338
5338
|
client: t
|
|
5339
5339
|
});
|
|
5340
5340
|
})();
|
|
5341
5341
|
ho(e);
|
|
5342
|
-
const
|
|
5342
|
+
const j = i?.formatters?.transactionRequest?.format, ne = (j || zc)({
|
|
5343
5343
|
// Pick out extra data that might exist on the chain's transaction request type.
|
|
5344
|
-
...$c(
|
|
5344
|
+
...$c(z, { format: j }),
|
|
5345
5345
|
account: n ? In(n) : void 0,
|
|
5346
5346
|
accessList: r,
|
|
5347
5347
|
authorizationList: s,
|
|
@@ -5364,7 +5364,7 @@ async function Qy(t, e) {
|
|
|
5364
5364
|
params: [ne]
|
|
5365
5365
|
}), C = (i?.formatters?.transaction?.format || If)(te.tx);
|
|
5366
5366
|
delete C.blockHash, delete C.blockNumber, delete C.r, delete C.s, delete C.transactionIndex, delete C.v, delete C.yParity, C.data = C.input, C.gas && (C.gas = e.gas ?? C.gas), C.gasPrice && (C.gasPrice = e.gasPrice ?? C.gasPrice), C.maxFeePerBlobGas && (C.maxFeePerBlobGas = e.maxFeePerBlobGas ?? C.maxFeePerBlobGas), C.maxFeePerGas && (C.maxFeePerGas = e.maxFeePerGas ?? C.maxFeePerGas), C.maxPriorityFeePerGas && (C.maxPriorityFeePerGas = e.maxPriorityFeePerGas ?? C.maxPriorityFeePerGas), C.nonce && (C.nonce = e.nonce ?? C.nonce);
|
|
5367
|
-
const
|
|
5367
|
+
const L = await (async () => {
|
|
5368
5368
|
if (typeof i?.fees?.baseFeeMultiplier == "function") {
|
|
5369
5369
|
const p = await kt(t, Ns, "getBlock")({});
|
|
5370
5370
|
return i.fees.baseFeeMultiplier({
|
|
@@ -5375,9 +5375,9 @@ async function Qy(t, e) {
|
|
|
5375
5375
|
}
|
|
5376
5376
|
return i?.fees?.baseFeeMultiplier ?? 1.2;
|
|
5377
5377
|
})();
|
|
5378
|
-
if (
|
|
5378
|
+
if (L < 1)
|
|
5379
5379
|
throw new Tf();
|
|
5380
|
-
const w = 10 ** (
|
|
5380
|
+
const w = 10 ** (L.toString().split(".")[1]?.length ?? 0), c = (p) => p * BigInt(Math.ceil(L * w)) / BigInt(w);
|
|
5381
5381
|
return C.maxFeePerGas && !e.maxFeePerGas && (C.maxFeePerGas = c(C.maxFeePerGas)), C.gasPrice && !e.gasPrice && (C.gasPrice = c(C.gasPrice)), {
|
|
5382
5382
|
raw: te.raw,
|
|
5383
5383
|
transaction: {
|
|
@@ -5432,24 +5432,24 @@ async function Ff(t, e) {
|
|
|
5432
5432
|
a?.fn && a.runAt?.includes("beforeFillTransaction") && (n = await a.fn({ ...n, chain: s }, {
|
|
5433
5433
|
phase: "beforeFillTransaction"
|
|
5434
5434
|
}), S ??= n.nonce);
|
|
5435
|
-
const N = ((o.includes("blobVersionedHashes") || o.includes("sidecars")) && n.kzg && n.blobs || ta.get(t.uid) === !1 || !["fees", "gas"].some((
|
|
5436
|
-
const { chainId:
|
|
5435
|
+
const N = ((o.includes("blobVersionedHashes") || o.includes("sidecars")) && n.kzg && n.blobs || ta.get(t.uid) === !1 || !["fees", "gas"].some((j) => o.includes(j)) ? !1 : !!(o.includes("chainId") && typeof n.chainId != "number" || o.includes("nonce") && typeof S != "number" || o.includes("fees") && typeof n.gasPrice != "bigint" && (typeof n.maxFeePerGas != "bigint" || typeof n.maxPriorityFeePerGas != "bigint") || o.includes("gas") && typeof n.gas != "bigint")) ? await kt(t, Qy, "fillTransaction")({ ...n, nonce: S }).then((U) => {
|
|
5436
|
+
const { chainId: j, from: J, gas: ne, gasPrice: te, nonce: V, maxFeePerBlobGas: C, maxFeePerGas: L, maxPriorityFeePerGas: G, type: w, ...c } = U.transaction;
|
|
5437
5437
|
return ta.set(t.uid, !0), {
|
|
5438
5438
|
...n,
|
|
5439
5439
|
...J ? { from: J } : {},
|
|
5440
5440
|
...w ? { type: w } : {},
|
|
5441
|
-
...typeof
|
|
5441
|
+
...typeof j < "u" ? { chainId: j } : {},
|
|
5442
5442
|
...typeof ne < "u" ? { gas: ne } : {},
|
|
5443
5443
|
...typeof te < "u" ? { gasPrice: te } : {},
|
|
5444
|
-
...typeof
|
|
5444
|
+
...typeof V < "u" ? { nonce: V } : {},
|
|
5445
5445
|
...typeof C < "u" ? { maxFeePerBlobGas: C } : {},
|
|
5446
|
-
...typeof
|
|
5447
|
-
...typeof
|
|
5446
|
+
...typeof L < "u" ? { maxFeePerGas: L } : {},
|
|
5447
|
+
...typeof G < "u" ? { maxPriorityFeePerGas: G } : {},
|
|
5448
5448
|
..."nonceKey" in c && typeof c.nonceKey < "u" ? { nonceKey: c.nonceKey } : {}
|
|
5449
5449
|
};
|
|
5450
5450
|
}).catch((U) => {
|
|
5451
|
-
const
|
|
5452
|
-
return
|
|
5451
|
+
const j = U;
|
|
5452
|
+
return j.name !== "TransactionExecutionError" || j.walk?.((ne) => {
|
|
5453
5453
|
const te = ne;
|
|
5454
5454
|
return te.name === "MethodNotFoundRpcError" || te.name === "MethodNotSupportedRpcError";
|
|
5455
5455
|
}) && ta.set(t.uid, !1), n;
|
|
@@ -5459,31 +5459,31 @@ async function Ff(t, e) {
|
|
|
5459
5459
|
...g ? { from: g?.address } : {},
|
|
5460
5460
|
...S ? { nonce: S } : {}
|
|
5461
5461
|
};
|
|
5462
|
-
const { blobs:
|
|
5462
|
+
const { blobs: F, gas: M, kzg: k, type: K } = n;
|
|
5463
5463
|
a?.fn && a.runAt?.includes("beforeFillParameters") && (n = await a.fn({ ...n, chain: s }, {
|
|
5464
5464
|
phase: "beforeFillParameters"
|
|
5465
5465
|
}));
|
|
5466
5466
|
let Y;
|
|
5467
|
-
async function
|
|
5467
|
+
async function z() {
|
|
5468
5468
|
return Y || (Y = await kt(t, Ns, "getBlock")({ blockTag: "latest" }), Y);
|
|
5469
5469
|
}
|
|
5470
5470
|
if (o.includes("nonce") && typeof S > "u" && g && !i && (n.nonce = await kt(t, Uy, "getTransactionCount")({
|
|
5471
5471
|
address: g.address,
|
|
5472
5472
|
blockTag: "pending"
|
|
5473
|
-
})), (o.includes("blobVersionedHashes") || o.includes("sidecars")) &&
|
|
5474
|
-
const U = Nf({ blobs:
|
|
5473
|
+
})), (o.includes("blobVersionedHashes") || o.includes("sidecars")) && F && k) {
|
|
5474
|
+
const U = Nf({ blobs: F, kzg: k });
|
|
5475
5475
|
if (o.includes("blobVersionedHashes")) {
|
|
5476
|
-
const
|
|
5476
|
+
const j = Ky({
|
|
5477
5477
|
commitments: U,
|
|
5478
5478
|
to: "hex"
|
|
5479
5479
|
});
|
|
5480
|
-
n.blobVersionedHashes =
|
|
5480
|
+
n.blobVersionedHashes = j;
|
|
5481
5481
|
}
|
|
5482
5482
|
if (o.includes("sidecars")) {
|
|
5483
|
-
const
|
|
5484
|
-
blobs:
|
|
5483
|
+
const j = Cf({ blobs: F, commitments: U, kzg: k }), J = Jy({
|
|
5484
|
+
blobs: F,
|
|
5485
5485
|
commitments: U,
|
|
5486
|
-
proofs:
|
|
5486
|
+
proofs: j,
|
|
5487
5487
|
to: "hex"
|
|
5488
5488
|
});
|
|
5489
5489
|
n.sidecars = J;
|
|
@@ -5494,12 +5494,12 @@ async function Ff(t, e) {
|
|
|
5494
5494
|
n.type = Xy(n);
|
|
5495
5495
|
} catch {
|
|
5496
5496
|
let U = hd.get(t.uid);
|
|
5497
|
-
typeof U > "u" && (U = typeof (await
|
|
5497
|
+
typeof U > "u" && (U = typeof (await z())?.baseFeePerGas == "bigint", hd.set(t.uid, U)), n.type = U ? "eip1559" : "legacy";
|
|
5498
5498
|
}
|
|
5499
5499
|
if (o.includes("fees"))
|
|
5500
5500
|
if (n.type !== "legacy" && n.type !== "eip2930") {
|
|
5501
5501
|
if (typeof n.maxFeePerGas > "u" || typeof n.maxPriorityFeePerGas > "u") {
|
|
5502
|
-
const U = await
|
|
5502
|
+
const U = await z(), { maxFeePerGas: j, maxPriorityFeePerGas: J } = await dd(t, {
|
|
5503
5503
|
block: U,
|
|
5504
5504
|
chain: s,
|
|
5505
5505
|
request: n
|
|
@@ -5508,19 +5508,19 @@ async function Ff(t, e) {
|
|
|
5508
5508
|
throw new Oy({
|
|
5509
5509
|
maxPriorityFeePerGas: J
|
|
5510
5510
|
});
|
|
5511
|
-
n.maxPriorityFeePerGas = J, n.maxFeePerGas =
|
|
5511
|
+
n.maxPriorityFeePerGas = J, n.maxFeePerGas = j;
|
|
5512
5512
|
}
|
|
5513
5513
|
} else {
|
|
5514
5514
|
if (typeof n.maxFeePerGas < "u" || typeof n.maxPriorityFeePerGas < "u")
|
|
5515
5515
|
throw new jc();
|
|
5516
5516
|
if (typeof n.gasPrice > "u") {
|
|
5517
|
-
const U = await
|
|
5517
|
+
const U = await z(), { gasPrice: j } = await dd(t, {
|
|
5518
5518
|
block: U,
|
|
5519
5519
|
chain: s,
|
|
5520
5520
|
request: n,
|
|
5521
5521
|
type: "legacy"
|
|
5522
5522
|
});
|
|
5523
|
-
n.gasPrice =
|
|
5523
|
+
n.gasPrice = j;
|
|
5524
5524
|
}
|
|
5525
5525
|
}
|
|
5526
5526
|
return o.includes("gas") && typeof M > "u" && (n.gas = await kt(t, e1, "estimateGas")({
|
|
@@ -5548,16 +5548,16 @@ async function e1(t, e) {
|
|
|
5548
5548
|
}).catch(() => {
|
|
5549
5549
|
throw new de("`to` is required. Could not infer from `authorizationList`");
|
|
5550
5550
|
});
|
|
5551
|
-
})(), { accessList: a, authorizationList: d, blobs: m, blobVersionedHashes: g, blockNumber: S, blockTag: I, data: N, gas:
|
|
5551
|
+
})(), { accessList: a, authorizationList: d, blobs: m, blobVersionedHashes: g, blockNumber: S, blockTag: I, data: N, gas: F, gasPrice: M, maxFeePerBlobGas: k, maxFeePerGas: K, maxPriorityFeePerGas: Y, nonce: z, value: U, stateOverride: j, ...J } = r ? await Ff(t, {
|
|
5552
5552
|
...e,
|
|
5553
5553
|
parameters: i,
|
|
5554
5554
|
to: o
|
|
5555
5555
|
}) : e;
|
|
5556
|
-
if (
|
|
5557
|
-
return
|
|
5558
|
-
const te = (typeof S == "bigint" ? ke(S) : void 0) || I,
|
|
5556
|
+
if (F && e.gas !== F)
|
|
5557
|
+
return F;
|
|
5558
|
+
const te = (typeof S == "bigint" ? ke(S) : void 0) || I, V = by(j);
|
|
5559
5559
|
ho(e);
|
|
5560
|
-
const C = t.chain?.formatters?.transactionRequest?.format,
|
|
5560
|
+
const C = t.chain?.formatters?.transactionRequest?.format, G = (C || zc)({
|
|
5561
5561
|
// Pick out extra data that might exist on the chain's transaction request type.
|
|
5562
5562
|
...$c(J, { format: C }),
|
|
5563
5563
|
account: s,
|
|
@@ -5570,17 +5570,17 @@ async function e1(t, e) {
|
|
|
5570
5570
|
maxFeePerBlobGas: k,
|
|
5571
5571
|
maxFeePerGas: K,
|
|
5572
5572
|
maxPriorityFeePerGas: Y,
|
|
5573
|
-
nonce:
|
|
5573
|
+
nonce: z,
|
|
5574
5574
|
to: o,
|
|
5575
5575
|
value: U
|
|
5576
5576
|
}, "estimateGas");
|
|
5577
5577
|
return BigInt(await t.request({
|
|
5578
5578
|
method: "eth_estimateGas",
|
|
5579
|
-
params:
|
|
5580
|
-
|
|
5579
|
+
params: V ? [
|
|
5580
|
+
G,
|
|
5581
5581
|
te ?? t.experimental_blockTag ?? "latest",
|
|
5582
|
-
|
|
5583
|
-
] : te ? [
|
|
5582
|
+
V
|
|
5583
|
+
] : te ? [G, te] : [G]
|
|
5584
5584
|
}));
|
|
5585
5585
|
} catch (o) {
|
|
5586
5586
|
throw Iy(o, {
|
|
@@ -5852,12 +5852,12 @@ function u1(t) {
|
|
|
5852
5852
|
for (; !d.eql(I, d.ONE); ) {
|
|
5853
5853
|
if (d.is0(I))
|
|
5854
5854
|
return d.ZERO;
|
|
5855
|
-
let
|
|
5855
|
+
let F = 1, M = d.sqr(I);
|
|
5856
5856
|
for (; !d.eql(M, d.ONE); )
|
|
5857
|
-
if (
|
|
5857
|
+
if (F++, M = d.sqr(M), F === g)
|
|
5858
5858
|
throw new Error("Cannot find square root");
|
|
5859
|
-
const k = At << BigInt(g -
|
|
5860
|
-
g =
|
|
5859
|
+
const k = At << BigInt(g - F - 1), K = d.pow(S, k);
|
|
5860
|
+
g = F, S = d.sqr(K), I = d.mul(I, S), N = d.mul(N, K);
|
|
5861
5861
|
}
|
|
5862
5862
|
return N;
|
|
5863
5863
|
};
|
|
@@ -6078,8 +6078,8 @@ function Jf(t, e) {
|
|
|
6078
6078
|
let i = t.ZERO, o = t.BASE;
|
|
6079
6079
|
const a = ra(n, e);
|
|
6080
6080
|
for (let d = 0; d < a.windows; d++) {
|
|
6081
|
-
const { nextN: m, offset: g, isZero: S, isNeg: I, isNegF: N, offsetF:
|
|
6082
|
-
s = m, S ? o = o.add(na(N, r[
|
|
6081
|
+
const { nextN: m, offset: g, isZero: S, isNeg: I, isNegF: N, offsetF: F } = gd(s, d, a);
|
|
6082
|
+
s = m, S ? o = o.add(na(N, r[F])) : i = i.add(na(I, r[g]));
|
|
6083
6083
|
}
|
|
6084
6084
|
return { p: i, f: o };
|
|
6085
6085
|
},
|
|
@@ -6138,10 +6138,10 @@ function Xf(t, e, n, r) {
|
|
|
6138
6138
|
const k = r[M], K = Number(k >> BigInt(N) & m);
|
|
6139
6139
|
g[K] = g[K].add(n[M]);
|
|
6140
6140
|
}
|
|
6141
|
-
let
|
|
6141
|
+
let F = o;
|
|
6142
6142
|
for (let M = g.length - 1, k = o; M > 0; M--)
|
|
6143
|
-
k = k.add(g[M]),
|
|
6144
|
-
if (I = I.add(
|
|
6143
|
+
k = k.add(g[M]), F = F.add(k);
|
|
6144
|
+
if (I = I.add(F), N !== 0)
|
|
6145
6145
|
for (let M = 0; M < d; M++)
|
|
6146
6146
|
I = I.double();
|
|
6147
6147
|
}
|
|
@@ -6289,95 +6289,95 @@ const Rn = BigInt(0), Et = BigInt(1);
|
|
|
6289
6289
|
BigInt(2);
|
|
6290
6290
|
const aa = BigInt(3), E1 = BigInt(4);
|
|
6291
6291
|
function w1(t) {
|
|
6292
|
-
const e = b1(t), { Fp: n } = e, r = Js(e.n, e.nBitLength), s = e.toBytes || ((
|
|
6292
|
+
const e = b1(t), { Fp: n } = e, r = Js(e.n, e.nBitLength), s = e.toBytes || ((z, U, j) => {
|
|
6293
6293
|
const J = U.toAffine();
|
|
6294
6294
|
return $r(Uint8Array.from([4]), n.toBytes(J.x), n.toBytes(J.y));
|
|
6295
|
-
}), i = e.fromBytes || ((
|
|
6296
|
-
const U =
|
|
6297
|
-
return { x:
|
|
6295
|
+
}), i = e.fromBytes || ((z) => {
|
|
6296
|
+
const U = z.subarray(1), j = n.fromBytes(U.subarray(0, n.BYTES)), J = n.fromBytes(U.subarray(n.BYTES, 2 * n.BYTES));
|
|
6297
|
+
return { x: j, y: J };
|
|
6298
6298
|
});
|
|
6299
|
-
function o(
|
|
6300
|
-
const { a: U, b:
|
|
6301
|
-
return n.add(n.add(ne, n.mul(
|
|
6299
|
+
function o(z) {
|
|
6300
|
+
const { a: U, b: j } = e, J = n.sqr(z), ne = n.mul(J, z);
|
|
6301
|
+
return n.add(n.add(ne, n.mul(z, U)), j);
|
|
6302
6302
|
}
|
|
6303
|
-
function a(
|
|
6304
|
-
const
|
|
6305
|
-
return n.eql(
|
|
6303
|
+
function a(z, U) {
|
|
6304
|
+
const j = n.sqr(U), J = o(z);
|
|
6305
|
+
return n.eql(j, J);
|
|
6306
6306
|
}
|
|
6307
6307
|
if (!a(e.Gx, e.Gy))
|
|
6308
6308
|
throw new Error("bad curve params: generator point");
|
|
6309
6309
|
const d = n.mul(n.pow(e.a, aa), E1), m = n.mul(n.sqr(e.b), BigInt(27));
|
|
6310
6310
|
if (n.is0(n.add(d, m)))
|
|
6311
6311
|
throw new Error("bad curve params: a or b");
|
|
6312
|
-
function g(
|
|
6313
|
-
return Pc(
|
|
6312
|
+
function g(z) {
|
|
6313
|
+
return Pc(z, Et, e.n);
|
|
6314
6314
|
}
|
|
6315
|
-
function S(
|
|
6316
|
-
const { allowedPrivateKeyLengths: U, nByteLength:
|
|
6317
|
-
if (U && typeof
|
|
6318
|
-
if (Ws(
|
|
6315
|
+
function S(z) {
|
|
6316
|
+
const { allowedPrivateKeyLengths: U, nByteLength: j, wrapPrivateKey: J, n: ne } = e;
|
|
6317
|
+
if (U && typeof z != "bigint") {
|
|
6318
|
+
if (Ws(z) && (z = Fr(z)), typeof z != "string" || !U.includes(z.length))
|
|
6319
6319
|
throw new Error("invalid private key");
|
|
6320
|
-
|
|
6320
|
+
z = z.padStart(j * 2, "0");
|
|
6321
6321
|
}
|
|
6322
6322
|
let te;
|
|
6323
6323
|
try {
|
|
6324
|
-
te = typeof
|
|
6324
|
+
te = typeof z == "bigint" ? z : nr(Xe("private key", z, j));
|
|
6325
6325
|
} catch {
|
|
6326
|
-
throw new Error("invalid private key, expected hex or " +
|
|
6326
|
+
throw new Error("invalid private key, expected hex or " + j + " bytes, got " + typeof z);
|
|
6327
6327
|
}
|
|
6328
6328
|
return J && (te = He(te, ne)), tn("private key", te, Et, ne), te;
|
|
6329
6329
|
}
|
|
6330
|
-
function I(
|
|
6331
|
-
if (!(
|
|
6330
|
+
function I(z) {
|
|
6331
|
+
if (!(z instanceof M))
|
|
6332
6332
|
throw new Error("ProjectivePoint expected");
|
|
6333
6333
|
}
|
|
6334
|
-
const N = Ti((
|
|
6335
|
-
const { px:
|
|
6334
|
+
const N = Ti((z, U) => {
|
|
6335
|
+
const { px: j, py: J, pz: ne } = z;
|
|
6336
6336
|
if (n.eql(ne, n.ONE))
|
|
6337
|
-
return { x:
|
|
6338
|
-
const te =
|
|
6337
|
+
return { x: j, y: J };
|
|
6338
|
+
const te = z.is0();
|
|
6339
6339
|
U == null && (U = te ? n.ONE : n.inv(ne));
|
|
6340
|
-
const
|
|
6340
|
+
const V = n.mul(j, U), C = n.mul(J, U), L = n.mul(ne, U);
|
|
6341
6341
|
if (te)
|
|
6342
6342
|
return { x: n.ZERO, y: n.ZERO };
|
|
6343
|
-
if (!n.eql(
|
|
6343
|
+
if (!n.eql(L, n.ONE))
|
|
6344
6344
|
throw new Error("invZ was invalid");
|
|
6345
|
-
return { x:
|
|
6346
|
-
}),
|
|
6347
|
-
if (
|
|
6348
|
-
if (e.allowInfinityPoint && !n.is0(
|
|
6345
|
+
return { x: V, y: C };
|
|
6346
|
+
}), F = Ti((z) => {
|
|
6347
|
+
if (z.is0()) {
|
|
6348
|
+
if (e.allowInfinityPoint && !n.is0(z.py))
|
|
6349
6349
|
return;
|
|
6350
6350
|
throw new Error("bad point: ZERO");
|
|
6351
6351
|
}
|
|
6352
|
-
const { x: U, y:
|
|
6353
|
-
if (!n.isValid(U) || !n.isValid(
|
|
6352
|
+
const { x: U, y: j } = z.toAffine();
|
|
6353
|
+
if (!n.isValid(U) || !n.isValid(j))
|
|
6354
6354
|
throw new Error("bad point: x or y not FE");
|
|
6355
|
-
if (!a(U,
|
|
6355
|
+
if (!a(U, j))
|
|
6356
6356
|
throw new Error("bad point: equation left != right");
|
|
6357
|
-
if (!
|
|
6357
|
+
if (!z.isTorsionFree())
|
|
6358
6358
|
throw new Error("bad point: not in prime-order subgroup");
|
|
6359
6359
|
return !0;
|
|
6360
6360
|
});
|
|
6361
6361
|
class M {
|
|
6362
|
-
constructor(U,
|
|
6362
|
+
constructor(U, j, J) {
|
|
6363
6363
|
if (U == null || !n.isValid(U))
|
|
6364
6364
|
throw new Error("x required");
|
|
6365
|
-
if (
|
|
6365
|
+
if (j == null || !n.isValid(j) || n.is0(j))
|
|
6366
6366
|
throw new Error("y required");
|
|
6367
6367
|
if (J == null || !n.isValid(J))
|
|
6368
6368
|
throw new Error("z required");
|
|
6369
|
-
this.px = U, this.py =
|
|
6369
|
+
this.px = U, this.py = j, this.pz = J, Object.freeze(this);
|
|
6370
6370
|
}
|
|
6371
6371
|
// Does not validate if the point is on-curve.
|
|
6372
6372
|
// Use fromHex instead, or call assertValidity() later.
|
|
6373
6373
|
static fromAffine(U) {
|
|
6374
|
-
const { x:
|
|
6375
|
-
if (!U || !n.isValid(
|
|
6374
|
+
const { x: j, y: J } = U || {};
|
|
6375
|
+
if (!U || !n.isValid(j) || !n.isValid(J))
|
|
6376
6376
|
throw new Error("invalid affine point");
|
|
6377
6377
|
if (U instanceof M)
|
|
6378
6378
|
throw new Error("projective point not allowed");
|
|
6379
6379
|
const ne = (te) => n.eql(te, n.ZERO);
|
|
6380
|
-
return ne(
|
|
6380
|
+
return ne(j) && ne(J) ? M.ZERO : new M(j, J, n.ONE);
|
|
6381
6381
|
}
|
|
6382
6382
|
get x() {
|
|
6383
6383
|
return this.toAffine().x;
|
|
@@ -6392,24 +6392,24 @@ function w1(t) {
|
|
|
6392
6392
|
* Optimization: converts a list of projective points to a list of identical points with Z=1.
|
|
6393
6393
|
*/
|
|
6394
6394
|
static normalizeZ(U) {
|
|
6395
|
-
const
|
|
6396
|
-
return U.map((J, ne) => J.toAffine(
|
|
6395
|
+
const j = Gc(n, U.map((J) => J.pz));
|
|
6396
|
+
return U.map((J, ne) => J.toAffine(j[ne])).map(M.fromAffine);
|
|
6397
6397
|
}
|
|
6398
6398
|
/**
|
|
6399
6399
|
* Converts hash string or Uint8Array to Point.
|
|
6400
6400
|
* @param hex short/long ECDSA hex
|
|
6401
6401
|
*/
|
|
6402
6402
|
static fromHex(U) {
|
|
6403
|
-
const
|
|
6404
|
-
return
|
|
6403
|
+
const j = M.fromAffine(i(Xe("pointHex", U)));
|
|
6404
|
+
return j.assertValidity(), j;
|
|
6405
6405
|
}
|
|
6406
6406
|
// Multiplies generator point by privateKey.
|
|
6407
6407
|
static fromPrivateKey(U) {
|
|
6408
6408
|
return M.BASE.multiply(S(U));
|
|
6409
6409
|
}
|
|
6410
6410
|
// Multiscalar Multiplication
|
|
6411
|
-
static msm(U,
|
|
6412
|
-
return Xf(M, r, U,
|
|
6411
|
+
static msm(U, j) {
|
|
6412
|
+
return Xf(M, r, U, j);
|
|
6413
6413
|
}
|
|
6414
6414
|
// "Private method", don't use it directly
|
|
6415
6415
|
_setWindowSize(U) {
|
|
@@ -6417,7 +6417,7 @@ function w1(t) {
|
|
|
6417
6417
|
}
|
|
6418
6418
|
// A point on curve is valid if it conforms to equation.
|
|
6419
6419
|
assertValidity() {
|
|
6420
|
-
|
|
6420
|
+
F(this);
|
|
6421
6421
|
}
|
|
6422
6422
|
hasEvenY() {
|
|
6423
6423
|
const { y: U } = this.toAffine();
|
|
@@ -6430,8 +6430,8 @@ function w1(t) {
|
|
|
6430
6430
|
*/
|
|
6431
6431
|
equals(U) {
|
|
6432
6432
|
I(U);
|
|
6433
|
-
const { px:
|
|
6434
|
-
return
|
|
6433
|
+
const { px: j, py: J, pz: ne } = this, { px: te, py: V, pz: C } = U, L = n.eql(n.mul(j, C), n.mul(te, ne)), G = n.eql(n.mul(J, C), n.mul(V, ne));
|
|
6434
|
+
return L && G;
|
|
6435
6435
|
}
|
|
6436
6436
|
/**
|
|
6437
6437
|
* Flips point to one corresponding to (x, -y) in Affine coordinates.
|
|
@@ -6444,9 +6444,9 @@ function w1(t) {
|
|
|
6444
6444
|
// https://eprint.iacr.org/2015/1060, algorithm 3
|
|
6445
6445
|
// Cost: 8M + 3S + 3*a + 2*b3 + 15add.
|
|
6446
6446
|
double() {
|
|
6447
|
-
const { a: U, b:
|
|
6448
|
-
let C = n.ZERO,
|
|
6449
|
-
return y = n.add(y, y),
|
|
6447
|
+
const { a: U, b: j } = e, J = n.mul(j, aa), { px: ne, py: te, pz: V } = this;
|
|
6448
|
+
let C = n.ZERO, L = n.ZERO, G = n.ZERO, w = n.mul(ne, ne), c = n.mul(te, te), p = n.mul(V, V), y = n.mul(ne, te);
|
|
6449
|
+
return y = n.add(y, y), G = n.mul(ne, V), G = n.add(G, G), C = n.mul(U, G), L = n.mul(J, p), L = n.add(C, L), C = n.sub(c, L), L = n.add(c, L), L = n.mul(C, L), C = n.mul(y, C), G = n.mul(J, G), p = n.mul(U, p), y = n.sub(w, p), y = n.mul(U, y), y = n.add(y, G), G = n.add(w, w), w = n.add(G, w), w = n.add(w, p), w = n.mul(w, y), L = n.add(L, w), p = n.mul(te, V), p = n.add(p, p), w = n.mul(p, y), C = n.sub(C, w), G = n.mul(p, c), G = n.add(G, G), G = n.add(G, G), new M(C, L, G);
|
|
6450
6450
|
}
|
|
6451
6451
|
// Renes-Costello-Batina exception-free addition formula.
|
|
6452
6452
|
// There is 30% faster Jacobian formula, but it is not complete.
|
|
@@ -6454,13 +6454,13 @@ function w1(t) {
|
|
|
6454
6454
|
// Cost: 12M + 0S + 3*a + 3*b3 + 23add.
|
|
6455
6455
|
add(U) {
|
|
6456
6456
|
I(U);
|
|
6457
|
-
const { px:
|
|
6458
|
-
let
|
|
6457
|
+
const { px: j, py: J, pz: ne } = this, { px: te, py: V, pz: C } = U;
|
|
6458
|
+
let L = n.ZERO, G = n.ZERO, w = n.ZERO;
|
|
6459
6459
|
const c = e.a, p = n.mul(e.b, aa);
|
|
6460
|
-
let y = n.mul(
|
|
6461
|
-
R = n.mul(R, O), O = n.add(y, A), R = n.sub(R, O), O = n.add(
|
|
6460
|
+
let y = n.mul(j, te), A = n.mul(J, V), v = n.mul(ne, C), R = n.add(j, J), O = n.add(te, V);
|
|
6461
|
+
R = n.mul(R, O), O = n.add(y, A), R = n.sub(R, O), O = n.add(j, ne);
|
|
6462
6462
|
let _ = n.add(te, C);
|
|
6463
|
-
return O = n.mul(O, _), _ = n.add(y, v), O = n.sub(O, _), _ = n.add(J, ne),
|
|
6463
|
+
return O = n.mul(O, _), _ = n.add(y, v), O = n.sub(O, _), _ = n.add(J, ne), L = n.add(V, C), _ = n.mul(_, L), L = n.add(A, v), _ = n.sub(_, L), w = n.mul(c, O), L = n.mul(p, v), w = n.add(L, w), L = n.sub(A, w), w = n.add(A, w), G = n.mul(L, w), A = n.add(y, y), A = n.add(A, y), v = n.mul(c, v), O = n.mul(p, O), A = n.add(A, v), v = n.sub(y, v), v = n.mul(c, v), O = n.add(O, v), y = n.mul(A, O), G = n.add(G, y), y = n.mul(_, O), L = n.mul(R, L), L = n.sub(L, y), y = n.mul(R, A), w = n.mul(_, w), w = n.add(w, y), new M(L, G, w);
|
|
6464
6464
|
}
|
|
6465
6465
|
subtract(U) {
|
|
6466
6466
|
return this.add(U.negate());
|
|
@@ -6477,19 +6477,19 @@ function w1(t) {
|
|
|
6477
6477
|
* an exposed private key e.g. sig verification, which works over *public* keys.
|
|
6478
6478
|
*/
|
|
6479
6479
|
multiplyUnsafe(U) {
|
|
6480
|
-
const { endo:
|
|
6480
|
+
const { endo: j, n: J } = e;
|
|
6481
6481
|
tn("scalar", U, Rn, J);
|
|
6482
6482
|
const ne = M.ZERO;
|
|
6483
6483
|
if (U === Rn)
|
|
6484
6484
|
return ne;
|
|
6485
6485
|
if (this.is0() || U === Et)
|
|
6486
6486
|
return this;
|
|
6487
|
-
if (!
|
|
6487
|
+
if (!j || Y.hasPrecomputes(this))
|
|
6488
6488
|
return Y.wNAFCachedUnsafe(this, U, M.normalizeZ);
|
|
6489
|
-
let { k1neg: te, k1:
|
|
6490
|
-
for (;
|
|
6491
|
-
|
|
6492
|
-
return te && (
|
|
6489
|
+
let { k1neg: te, k1: V, k2neg: C, k2: L } = j.splitScalar(U), G = ne, w = ne, c = this;
|
|
6490
|
+
for (; V > Rn || L > Rn; )
|
|
6491
|
+
V & Et && (G = G.add(c)), L & Et && (w = w.add(c)), c = c.double(), V >>= Et, L >>= Et;
|
|
6492
|
+
return te && (G = G.negate()), C && (w = w.negate()), w = new M(n.mul(w.px, j.beta), w.py, w.pz), G.add(w);
|
|
6493
6493
|
}
|
|
6494
6494
|
/**
|
|
6495
6495
|
* Constant time multiplication.
|
|
@@ -6501,16 +6501,16 @@ function w1(t) {
|
|
|
6501
6501
|
* @returns New point
|
|
6502
6502
|
*/
|
|
6503
6503
|
multiply(U) {
|
|
6504
|
-
const { endo:
|
|
6504
|
+
const { endo: j, n: J } = e;
|
|
6505
6505
|
tn("scalar", U, Et, J);
|
|
6506
6506
|
let ne, te;
|
|
6507
|
-
if (
|
|
6508
|
-
const { k1neg:
|
|
6509
|
-
let { p: w, f: c } = this.wNAF(C), { p, f: y } = this.wNAF(
|
|
6510
|
-
w = Y.constTimeNegate(
|
|
6507
|
+
if (j) {
|
|
6508
|
+
const { k1neg: V, k1: C, k2neg: L, k2: G } = j.splitScalar(U);
|
|
6509
|
+
let { p: w, f: c } = this.wNAF(C), { p, f: y } = this.wNAF(G);
|
|
6510
|
+
w = Y.constTimeNegate(V, w), p = Y.constTimeNegate(L, p), p = new M(n.mul(p.px, j.beta), p.py, p.pz), ne = w.add(p), te = c.add(y);
|
|
6511
6511
|
} else {
|
|
6512
|
-
const { p:
|
|
6513
|
-
ne =
|
|
6512
|
+
const { p: V, f: C } = this.wNAF(U);
|
|
6513
|
+
ne = V, te = C;
|
|
6514
6514
|
}
|
|
6515
6515
|
return M.normalizeZ([ne, te])[0];
|
|
6516
6516
|
}
|
|
@@ -6520,9 +6520,9 @@ function w1(t) {
|
|
|
6520
6520
|
* The trick could be useful if both P and Q are not G (not in our case).
|
|
6521
6521
|
* @returns non-zero affine point
|
|
6522
6522
|
*/
|
|
6523
|
-
multiplyAndAddUnsafe(U,
|
|
6524
|
-
const ne = M.BASE, te = (C,
|
|
6525
|
-
return
|
|
6523
|
+
multiplyAndAddUnsafe(U, j, J) {
|
|
6524
|
+
const ne = M.BASE, te = (C, L) => L === Rn || L === Et || !C.equals(ne) ? C.multiplyUnsafe(L) : C.multiply(L), V = te(this, j).add(te(U, J));
|
|
6525
|
+
return V.is0() ? void 0 : V;
|
|
6526
6526
|
}
|
|
6527
6527
|
// Converts Projective point to affine (x, y) coordinates.
|
|
6528
6528
|
// Can accept precomputed Z^-1 - for example, from invertBatch.
|
|
@@ -6531,16 +6531,16 @@ function w1(t) {
|
|
|
6531
6531
|
return N(this, U);
|
|
6532
6532
|
}
|
|
6533
6533
|
isTorsionFree() {
|
|
6534
|
-
const { h: U, isTorsionFree:
|
|
6534
|
+
const { h: U, isTorsionFree: j } = e;
|
|
6535
6535
|
if (U === Et)
|
|
6536
6536
|
return !0;
|
|
6537
|
-
if (
|
|
6538
|
-
return
|
|
6537
|
+
if (j)
|
|
6538
|
+
return j(M, this);
|
|
6539
6539
|
throw new Error("isTorsionFree() has not been declared for the elliptic curve");
|
|
6540
6540
|
}
|
|
6541
6541
|
clearCofactor() {
|
|
6542
|
-
const { h: U, clearCofactor:
|
|
6543
|
-
return U === Et ? this :
|
|
6542
|
+
const { h: U, clearCofactor: j } = e;
|
|
6543
|
+
return U === Et ? this : j ? j(M, this) : this.multiplyUnsafe(e.h);
|
|
6544
6544
|
}
|
|
6545
6545
|
toRawBytes(U = !0) {
|
|
6546
6546
|
return zn("isCompressed", U), this.assertValidity(), s(M, this, U);
|
|
@@ -6610,12 +6610,12 @@ function R1(t) {
|
|
|
6610
6610
|
}
|
|
6611
6611
|
}
|
|
6612
6612
|
});
|
|
6613
|
-
function
|
|
6613
|
+
function F(p) {
|
|
6614
6614
|
const y = r >> Et;
|
|
6615
6615
|
return p > y;
|
|
6616
6616
|
}
|
|
6617
6617
|
function M(p) {
|
|
6618
|
-
return
|
|
6618
|
+
return F(p) ? d(-p) : p;
|
|
6619
6619
|
}
|
|
6620
6620
|
const k = (p, y, A) => nr(p.slice(y, A));
|
|
6621
6621
|
class K {
|
|
@@ -6649,14 +6649,14 @@ function R1(t) {
|
|
|
6649
6649
|
const _ = R === 2 || R === 3 ? A + e.n : A;
|
|
6650
6650
|
if (_ >= n.ORDER)
|
|
6651
6651
|
throw new Error("recovery id 2 or 3 invalid");
|
|
6652
|
-
const u = (R & 1) === 0 ? "02" : "03", l = g.fromHex(u + oa(_, n.BYTES)), E = m(_), T = d(-O * E),
|
|
6652
|
+
const u = (R & 1) === 0 ? "02" : "03", l = g.fromHex(u + oa(_, n.BYTES)), E = m(_), T = d(-O * E), P = d(v * E), W = g.BASE.multiplyAndAddUnsafe(l, T, P);
|
|
6653
6653
|
if (!W)
|
|
6654
6654
|
throw new Error("point at infinify");
|
|
6655
6655
|
return W.assertValidity(), W;
|
|
6656
6656
|
}
|
|
6657
6657
|
// Signatures should be low-s, to prevent malleability.
|
|
6658
6658
|
hasHighS() {
|
|
6659
|
-
return
|
|
6659
|
+
return F(this.s);
|
|
6660
6660
|
}
|
|
6661
6661
|
normalizeS() {
|
|
6662
6662
|
return this.hasHighS() ? new K(this.r, d(-this.s), this.recovery) : this;
|
|
@@ -6706,7 +6706,7 @@ function R1(t) {
|
|
|
6706
6706
|
return y._setWindowSize(p), y.multiply(BigInt(3)), y;
|
|
6707
6707
|
}
|
|
6708
6708
|
};
|
|
6709
|
-
function
|
|
6709
|
+
function z(p, y = !0) {
|
|
6710
6710
|
return g.fromPrivateKey(p).toRawBytes(y);
|
|
6711
6711
|
}
|
|
6712
6712
|
function U(p) {
|
|
@@ -6718,7 +6718,7 @@ function R1(t) {
|
|
|
6718
6718
|
if (!(e.allowedPrivateKeyLengths || s === R))
|
|
6719
6719
|
return A === R || A === O;
|
|
6720
6720
|
}
|
|
6721
|
-
function
|
|
6721
|
+
function j(p, y, A = !0) {
|
|
6722
6722
|
if (U(p) === !0)
|
|
6723
6723
|
throw new Error("first arg must be private key");
|
|
6724
6724
|
if (U(y) === !1)
|
|
@@ -6733,21 +6733,21 @@ function R1(t) {
|
|
|
6733
6733
|
}, ne = e.bits2int_modN || function(p) {
|
|
6734
6734
|
return d(J(p));
|
|
6735
6735
|
}, te = fo(i);
|
|
6736
|
-
function
|
|
6736
|
+
function V(p) {
|
|
6737
6737
|
return tn("num < 2^" + i, p, Rn, te), Zs(p, s);
|
|
6738
6738
|
}
|
|
6739
|
-
function C(p, y, A =
|
|
6739
|
+
function C(p, y, A = L) {
|
|
6740
6740
|
if (["recovered", "canonical"].some((ae) => ae in A))
|
|
6741
6741
|
throw new Error("sign() legacy options not supported");
|
|
6742
6742
|
const { hash: v, randomBytes: R } = e;
|
|
6743
6743
|
let { lowS: O, prehash: _, extraEntropy: u } = A;
|
|
6744
6744
|
O == null && (O = !0), p = Xe("msgHash", p), yd(A), _ && (p = Xe("prehashed msgHash", v(p)));
|
|
6745
|
-
const l = ne(p), E = S(y), T = [
|
|
6745
|
+
const l = ne(p), E = S(y), T = [V(E), V(l)];
|
|
6746
6746
|
if (u != null && u !== !1) {
|
|
6747
6747
|
const ae = u === !0 ? R(n.BYTES) : u;
|
|
6748
6748
|
T.push(Xe("extraEntropy", ae));
|
|
6749
6749
|
}
|
|
6750
|
-
const
|
|
6750
|
+
const P = $r(...T), W = l;
|
|
6751
6751
|
function se(ae) {
|
|
6752
6752
|
const Me = J(ae);
|
|
6753
6753
|
if (!N(Me))
|
|
@@ -6759,17 +6759,17 @@ function R1(t) {
|
|
|
6759
6759
|
if (Re === Rn)
|
|
6760
6760
|
return;
|
|
6761
6761
|
let Oe = (we.x === De ? 0 : 2) | Number(we.y & Et), an = Re;
|
|
6762
|
-
return O &&
|
|
6762
|
+
return O && F(Re) && (an = M(Re), Oe ^= 1), new K(De, an, Oe);
|
|
6763
6763
|
}
|
|
6764
|
-
return { seed:
|
|
6764
|
+
return { seed: P, k2sig: se };
|
|
6765
6765
|
}
|
|
6766
|
-
const
|
|
6767
|
-
function w(p, y, A =
|
|
6766
|
+
const L = { lowS: e.lowS, prehash: !1 }, G = { lowS: e.lowS, prehash: !1 };
|
|
6767
|
+
function w(p, y, A = L) {
|
|
6768
6768
|
const { seed: v, k2sig: R } = C(p, y, A), O = e;
|
|
6769
6769
|
return hy(O.hash.outputLen, O.nByteLength, O.hmac)(v, R);
|
|
6770
6770
|
}
|
|
6771
6771
|
g.BASE._setWindowSize(8);
|
|
6772
|
-
function c(p, y, A, v =
|
|
6772
|
+
function c(p, y, A, v = G) {
|
|
6773
6773
|
const R = p;
|
|
6774
6774
|
y = Xe("msgHash", y), A = Xe("publicKey", A);
|
|
6775
6775
|
const { lowS: O, prehash: _, format: u } = v;
|
|
@@ -6780,7 +6780,7 @@ function R1(t) {
|
|
|
6780
6780
|
const l = typeof R == "string" || Ws(R), E = !l && !u && typeof R == "object" && R !== null && typeof R.r == "bigint" && typeof R.s == "bigint";
|
|
6781
6781
|
if (!l && !E)
|
|
6782
6782
|
throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");
|
|
6783
|
-
let T,
|
|
6783
|
+
let T, P;
|
|
6784
6784
|
try {
|
|
6785
6785
|
if (E && (T = new K(R.r, R.s)), l) {
|
|
6786
6786
|
try {
|
|
@@ -6791,20 +6791,20 @@ function R1(t) {
|
|
|
6791
6791
|
}
|
|
6792
6792
|
!T && u !== "der" && (T = K.fromCompact(R));
|
|
6793
6793
|
}
|
|
6794
|
-
|
|
6794
|
+
P = g.fromHex(A);
|
|
6795
6795
|
} catch {
|
|
6796
6796
|
return !1;
|
|
6797
6797
|
}
|
|
6798
6798
|
if (!T || O && T.hasHighS())
|
|
6799
6799
|
return !1;
|
|
6800
6800
|
_ && (y = e.hash(y));
|
|
6801
|
-
const { r: W, s: se } = T, ae = ne(y), Me = m(se), ve = d(ae * Me), we = d(W * Me), De = g.BASE.multiplyAndAddUnsafe(
|
|
6801
|
+
const { r: W, s: se } = T, ae = ne(y), Me = m(se), ve = d(ae * Me), we = d(W * Me), De = g.BASE.multiplyAndAddUnsafe(P, ve, we)?.toAffine();
|
|
6802
6802
|
return De ? d(De.x) === W : !1;
|
|
6803
6803
|
}
|
|
6804
6804
|
return {
|
|
6805
6805
|
CURVE: e,
|
|
6806
|
-
getPublicKey:
|
|
6807
|
-
getSharedSecret:
|
|
6806
|
+
getPublicKey: z,
|
|
6807
|
+
getSharedSecret: j,
|
|
6808
6808
|
sign: w,
|
|
6809
6809
|
verify: c,
|
|
6810
6810
|
ProjectivePoint: g,
|
|
@@ -6827,7 +6827,7 @@ function S1(t, e) {
|
|
|
6827
6827
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
6828
6828
|
const Qf = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"), bd = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"), x1 = BigInt(0), T1 = BigInt(1), Qa = BigInt(2), _d = (t, e) => (t + e / Qa) / e;
|
|
6829
6829
|
function I1(t) {
|
|
6830
|
-
const e = Qf, n = BigInt(3), r = BigInt(6), s = BigInt(11), i = BigInt(22), o = BigInt(23), a = BigInt(44), d = BigInt(88), m = t * t * t % e, g = m * m * t % e, S = Ze(g, n, e) * g % e, I = Ze(S, n, e) * g % e, N = Ze(I, Qa, e) * m % e,
|
|
6830
|
+
const e = Qf, n = BigInt(3), r = BigInt(6), s = BigInt(11), i = BigInt(22), o = BigInt(23), a = BigInt(44), d = BigInt(88), m = t * t * t % e, g = m * m * t % e, S = Ze(g, n, e) * g % e, I = Ze(S, n, e) * g % e, N = Ze(I, Qa, e) * m % e, F = Ze(N, s, e) * N % e, M = Ze(F, i, e) * F % e, k = Ze(M, a, e) * M % e, K = Ze(k, d, e) * k % e, Y = Ze(K, a, e) * M % e, z = Ze(Y, n, e) * g % e, U = Ze(z, o, e) * F % e, j = Ze(U, r, e) * m % e, J = Ze(j, Qa, e);
|
|
6831
6831
|
if (!ec.eql(ec.sqr(J), t))
|
|
6832
6832
|
throw new Error("Cannot find square root");
|
|
6833
6833
|
return J;
|
|
@@ -6888,7 +6888,7 @@ async function N1(t, { serializedTransaction: e }) {
|
|
|
6888
6888
|
}
|
|
6889
6889
|
const ua = new Ks(128);
|
|
6890
6890
|
async function th(t, e) {
|
|
6891
|
-
const { account: n = t.account, chain: r = t.chain, accessList: s, authorizationList: i, blobs: o, data: a, gas: d, gasPrice: m, maxFeePerBlobGas: g, maxFeePerGas: S, maxPriorityFeePerGas: I, nonce: N, type:
|
|
6891
|
+
const { account: n = t.account, chain: r = t.chain, accessList: s, authorizationList: i, blobs: o, data: a, gas: d, gasPrice: m, maxFeePerBlobGas: g, maxFeePerGas: S, maxPriorityFeePerGas: I, nonce: N, type: F, value: M, ...k } = e;
|
|
6892
6892
|
if (typeof n > "u")
|
|
6893
6893
|
throw new eh({
|
|
6894
6894
|
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
@@ -6907,9 +6907,9 @@ async function th(t, e) {
|
|
|
6907
6907
|
});
|
|
6908
6908
|
})();
|
|
6909
6909
|
if (K?.type === "json-rpc" || K === null) {
|
|
6910
|
-
let
|
|
6911
|
-
r !== null && (
|
|
6912
|
-
currentChainId:
|
|
6910
|
+
let z;
|
|
6911
|
+
r !== null && (z = await kt(t, Hc, "getChainId")({}), o1({
|
|
6912
|
+
currentChainId: z,
|
|
6913
6913
|
chain: r
|
|
6914
6914
|
}));
|
|
6915
6915
|
const U = t.chain?.formatters?.transactionRequest?.format, J = (U || zc)({
|
|
@@ -6919,7 +6919,7 @@ async function th(t, e) {
|
|
|
6919
6919
|
account: K,
|
|
6920
6920
|
authorizationList: i,
|
|
6921
6921
|
blobs: o,
|
|
6922
|
-
chainId:
|
|
6922
|
+
chainId: z,
|
|
6923
6923
|
data: a,
|
|
6924
6924
|
gas: d,
|
|
6925
6925
|
gasPrice: m,
|
|
@@ -6928,7 +6928,7 @@ async function th(t, e) {
|
|
|
6928
6928
|
maxPriorityFeePerGas: I,
|
|
6929
6929
|
nonce: N,
|
|
6930
6930
|
to: Y,
|
|
6931
|
-
type:
|
|
6931
|
+
type: F,
|
|
6932
6932
|
value: M
|
|
6933
6933
|
}, "sendTransaction"), ne = ua.get(t.uid), te = ne ? "wallet_sendTransaction" : "eth_sendTransaction";
|
|
6934
6934
|
try {
|
|
@@ -6936,23 +6936,23 @@ async function th(t, e) {
|
|
|
6936
6936
|
method: te,
|
|
6937
6937
|
params: [J]
|
|
6938
6938
|
}, { retryCount: 0 });
|
|
6939
|
-
} catch (
|
|
6939
|
+
} catch (V) {
|
|
6940
6940
|
if (ne === !1)
|
|
6941
|
-
throw
|
|
6942
|
-
const C =
|
|
6941
|
+
throw V;
|
|
6942
|
+
const C = V;
|
|
6943
6943
|
if (C.name === "InvalidInputRpcError" || C.name === "InvalidParamsRpcError" || C.name === "MethodNotFoundRpcError" || C.name === "MethodNotSupportedRpcError")
|
|
6944
6944
|
return await t.request({
|
|
6945
6945
|
method: "wallet_sendTransaction",
|
|
6946
6946
|
params: [J]
|
|
6947
|
-
}, { retryCount: 0 }).then((
|
|
6948
|
-
const
|
|
6949
|
-
throw
|
|
6947
|
+
}, { retryCount: 0 }).then((L) => (ua.set(t.uid, !0), L)).catch((L) => {
|
|
6948
|
+
const G = L;
|
|
6949
|
+
throw G.name === "MethodNotFoundRpcError" || G.name === "MethodNotSupportedRpcError" ? (ua.set(t.uid, !1), C) : G;
|
|
6950
6950
|
});
|
|
6951
6951
|
throw C;
|
|
6952
6952
|
}
|
|
6953
6953
|
}
|
|
6954
6954
|
if (K?.type === "local") {
|
|
6955
|
-
const
|
|
6955
|
+
const z = await kt(t, Ff, "prepareTransactionRequest")({
|
|
6956
6956
|
account: K,
|
|
6957
6957
|
accessList: s,
|
|
6958
6958
|
authorizationList: i,
|
|
@@ -6967,15 +6967,15 @@ async function th(t, e) {
|
|
|
6967
6967
|
nonce: N,
|
|
6968
6968
|
nonceManager: K.nonceManager,
|
|
6969
6969
|
parameters: [...Pf, "sidecars"],
|
|
6970
|
-
type:
|
|
6970
|
+
type: F,
|
|
6971
6971
|
value: M,
|
|
6972
6972
|
...k,
|
|
6973
6973
|
to: Y
|
|
6974
|
-
}), U = r?.serializers?.transaction,
|
|
6974
|
+
}), U = r?.serializers?.transaction, j = await K.signTransaction(z, {
|
|
6975
6975
|
serializer: U
|
|
6976
6976
|
});
|
|
6977
6977
|
return await kt(t, N1, "sendRawTransaction")({
|
|
6978
|
-
serializedTransaction:
|
|
6978
|
+
serializedTransaction: j
|
|
6979
6979
|
});
|
|
6980
6980
|
}
|
|
6981
6981
|
throw K?.type === "smart" ? new ca({
|
|
@@ -7006,14 +7006,14 @@ async function Ni(t, e) {
|
|
|
7006
7006
|
throw new eh({
|
|
7007
7007
|
docsPath: "/docs/contract/writeContract"
|
|
7008
7008
|
});
|
|
7009
|
-
const N = a ? In(a) : null,
|
|
7009
|
+
const N = a ? In(a) : null, F = Vg({
|
|
7010
7010
|
abi: o,
|
|
7011
7011
|
args: m,
|
|
7012
7012
|
functionName: S
|
|
7013
7013
|
});
|
|
7014
7014
|
try {
|
|
7015
7015
|
return await kt(n, r, s)({
|
|
7016
|
-
data: `${
|
|
7016
|
+
data: `${F}${g ? g.replace("0x", "") : ""}`,
|
|
7017
7017
|
to: d,
|
|
7018
7018
|
account: N,
|
|
7019
7019
|
...I
|
|
@@ -7210,7 +7210,7 @@ function oh(t = 11) {
|
|
|
7210
7210
|
return di.substring(ui, ui++ + t);
|
|
7211
7211
|
}
|
|
7212
7212
|
function F1(t) {
|
|
7213
|
-
const { batch: e, chain: n, ccipRead: r, key: s = "base", name: i = "Base Client", type: o = "base" } = t, a = t.experimental_blockTag ?? (typeof n?.experimental_preconfirmationTime == "number" ? "pending" : void 0), d = n?.blockTime ?? 12e3, m = Math.min(Math.max(Math.floor(d / 2), 500), 4e3), g = t.pollingInterval ?? m, S = t.cacheTime ?? g, I = t.account ? In(t.account) : void 0, { config: N, request:
|
|
7213
|
+
const { batch: e, chain: n, ccipRead: r, key: s = "base", name: i = "Base Client", type: o = "base" } = t, a = t.experimental_blockTag ?? (typeof n?.experimental_preconfirmationTime == "number" ? "pending" : void 0), d = n?.blockTime ?? 12e3, m = Math.min(Math.max(Math.floor(d / 2), 500), 4e3), g = t.pollingInterval ?? m, S = t.cacheTime ?? g, I = t.account ? In(t.account) : void 0, { config: N, request: F, value: M } = t.transport({
|
|
7214
7214
|
account: I,
|
|
7215
7215
|
chain: n,
|
|
7216
7216
|
pollingInterval: g
|
|
@@ -7223,18 +7223,18 @@ function F1(t) {
|
|
|
7223
7223
|
key: s,
|
|
7224
7224
|
name: i,
|
|
7225
7225
|
pollingInterval: g,
|
|
7226
|
-
request:
|
|
7226
|
+
request: F,
|
|
7227
7227
|
transport: k,
|
|
7228
7228
|
type: o,
|
|
7229
7229
|
uid: oh(),
|
|
7230
7230
|
...a ? { experimental_blockTag: a } : {}
|
|
7231
7231
|
};
|
|
7232
|
-
function Y(
|
|
7232
|
+
function Y(z) {
|
|
7233
7233
|
return (U) => {
|
|
7234
|
-
const
|
|
7234
|
+
const j = U(z);
|
|
7235
7235
|
for (const ne in K)
|
|
7236
|
-
delete
|
|
7237
|
-
const J = { ...
|
|
7236
|
+
delete j[ne];
|
|
7237
|
+
const J = { ...z, ...j };
|
|
7238
7238
|
return Object.assign(J, { extend: Y(J) });
|
|
7239
7239
|
};
|
|
7240
7240
|
}
|
|
@@ -7490,8 +7490,8 @@ function W1() {
|
|
|
7490
7490
|
function i(d, m, g, S, I) {
|
|
7491
7491
|
if (typeof g != "function")
|
|
7492
7492
|
throw new TypeError("The listener must be a function");
|
|
7493
|
-
var N = new s(g, S || d, I),
|
|
7494
|
-
return d._events[
|
|
7493
|
+
var N = new s(g, S || d, I), F = n ? n + m : m;
|
|
7494
|
+
return d._events[F] ? d._events[F].fn ? d._events[F] = [d._events[F], N] : d._events[F].push(N) : (d._events[F] = N, d._eventsCount++), d;
|
|
7495
7495
|
}
|
|
7496
7496
|
function o(d, m) {
|
|
7497
7497
|
--d._eventsCount === 0 ? d._events = new r() : delete d._events[m];
|
|
@@ -7509,16 +7509,16 @@ function W1() {
|
|
|
7509
7509
|
var g = n ? n + m : m, S = this._events[g];
|
|
7510
7510
|
if (!S) return [];
|
|
7511
7511
|
if (S.fn) return [S.fn];
|
|
7512
|
-
for (var I = 0, N = S.length,
|
|
7513
|
-
|
|
7514
|
-
return
|
|
7512
|
+
for (var I = 0, N = S.length, F = new Array(N); I < N; I++)
|
|
7513
|
+
F[I] = S[I].fn;
|
|
7514
|
+
return F;
|
|
7515
7515
|
}, a.prototype.listenerCount = function(m) {
|
|
7516
7516
|
var g = n ? n + m : m, S = this._events[g];
|
|
7517
7517
|
return S ? S.fn ? 1 : S.length : 0;
|
|
7518
|
-
}, a.prototype.emit = function(m, g, S, I, N,
|
|
7518
|
+
}, a.prototype.emit = function(m, g, S, I, N, F) {
|
|
7519
7519
|
var M = n ? n + m : m;
|
|
7520
7520
|
if (!this._events[M]) return !1;
|
|
7521
|
-
var k = this._events[M], K = arguments.length, Y,
|
|
7521
|
+
var k = this._events[M], K = arguments.length, Y, z;
|
|
7522
7522
|
if (k.fn) {
|
|
7523
7523
|
switch (k.once && this.removeListener(m, k.fn, void 0, !0), K) {
|
|
7524
7524
|
case 1:
|
|
@@ -7532,31 +7532,31 @@ function W1() {
|
|
|
7532
7532
|
case 5:
|
|
7533
7533
|
return k.fn.call(k.context, g, S, I, N), !0;
|
|
7534
7534
|
case 6:
|
|
7535
|
-
return k.fn.call(k.context, g, S, I, N,
|
|
7535
|
+
return k.fn.call(k.context, g, S, I, N, F), !0;
|
|
7536
7536
|
}
|
|
7537
|
-
for (
|
|
7538
|
-
Y[
|
|
7537
|
+
for (z = 1, Y = new Array(K - 1); z < K; z++)
|
|
7538
|
+
Y[z - 1] = arguments[z];
|
|
7539
7539
|
k.fn.apply(k.context, Y);
|
|
7540
7540
|
} else {
|
|
7541
|
-
var U = k.length,
|
|
7542
|
-
for (
|
|
7543
|
-
switch (k[
|
|
7541
|
+
var U = k.length, j;
|
|
7542
|
+
for (z = 0; z < U; z++)
|
|
7543
|
+
switch (k[z].once && this.removeListener(m, k[z].fn, void 0, !0), K) {
|
|
7544
7544
|
case 1:
|
|
7545
|
-
k[
|
|
7545
|
+
k[z].fn.call(k[z].context);
|
|
7546
7546
|
break;
|
|
7547
7547
|
case 2:
|
|
7548
|
-
k[
|
|
7548
|
+
k[z].fn.call(k[z].context, g);
|
|
7549
7549
|
break;
|
|
7550
7550
|
case 3:
|
|
7551
|
-
k[
|
|
7551
|
+
k[z].fn.call(k[z].context, g, S);
|
|
7552
7552
|
break;
|
|
7553
7553
|
case 4:
|
|
7554
|
-
k[
|
|
7554
|
+
k[z].fn.call(k[z].context, g, S, I);
|
|
7555
7555
|
break;
|
|
7556
7556
|
default:
|
|
7557
|
-
if (!Y) for (
|
|
7558
|
-
Y[
|
|
7559
|
-
k[
|
|
7557
|
+
if (!Y) for (j = 1, Y = new Array(K - 1); j < K; j++)
|
|
7558
|
+
Y[j - 1] = arguments[j];
|
|
7559
|
+
k[z].fn.apply(k[z].context, Y);
|
|
7560
7560
|
}
|
|
7561
7561
|
}
|
|
7562
7562
|
return !0;
|
|
@@ -7569,12 +7569,12 @@ function W1() {
|
|
|
7569
7569
|
if (!this._events[N]) return this;
|
|
7570
7570
|
if (!g)
|
|
7571
7571
|
return o(this, N), this;
|
|
7572
|
-
var
|
|
7573
|
-
if (
|
|
7574
|
-
|
|
7572
|
+
var F = this._events[N];
|
|
7573
|
+
if (F.fn)
|
|
7574
|
+
F.fn === g && (!I || F.once) && (!S || F.context === S) && o(this, N);
|
|
7575
7575
|
else {
|
|
7576
|
-
for (var M = 0, k = [], K =
|
|
7577
|
-
(
|
|
7576
|
+
for (var M = 0, k = [], K = F.length; M < K; M++)
|
|
7577
|
+
(F[M].fn !== g || I && !F[M].once || S && F[M].context !== S) && k.push(F[M]);
|
|
7578
7578
|
k.length ? this._events[N] = k.length === 1 ? k[0] : k : o(this, N);
|
|
7579
7579
|
}
|
|
7580
7580
|
return this;
|
|
@@ -10547,42 +10547,42 @@ function o_() {
|
|
|
10547
10547
|
t[s] = r[s], e[r.charCodeAt(s)] = s;
|
|
10548
10548
|
e[45] = 62, e[95] = 63;
|
|
10549
10549
|
function o(N) {
|
|
10550
|
-
var
|
|
10551
|
-
if (
|
|
10550
|
+
var F = N.length;
|
|
10551
|
+
if (F % 4 > 0)
|
|
10552
10552
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
10553
10553
|
var M = N.indexOf("=");
|
|
10554
|
-
M === -1 && (M =
|
|
10555
|
-
var k = M ===
|
|
10554
|
+
M === -1 && (M = F);
|
|
10555
|
+
var k = M === F ? 0 : 4 - M % 4;
|
|
10556
10556
|
return [M, k];
|
|
10557
10557
|
}
|
|
10558
10558
|
function a(N) {
|
|
10559
|
-
var
|
|
10559
|
+
var F = o(N), M = F[0], k = F[1];
|
|
10560
10560
|
return (M + k) * 3 / 4 - k;
|
|
10561
10561
|
}
|
|
10562
|
-
function d(N,
|
|
10563
|
-
return (
|
|
10562
|
+
function d(N, F, M) {
|
|
10563
|
+
return (F + M) * 3 / 4 - M;
|
|
10564
10564
|
}
|
|
10565
10565
|
function m(N) {
|
|
10566
|
-
var
|
|
10567
|
-
for (
|
|
10568
|
-
|
|
10569
|
-
return K === 2 && (
|
|
10566
|
+
var F, M = o(N), k = M[0], K = M[1], Y = new n(d(N, k, K)), z = 0, U = K > 0 ? k - 4 : k, j;
|
|
10567
|
+
for (j = 0; j < U; j += 4)
|
|
10568
|
+
F = e[N.charCodeAt(j)] << 18 | e[N.charCodeAt(j + 1)] << 12 | e[N.charCodeAt(j + 2)] << 6 | e[N.charCodeAt(j + 3)], Y[z++] = F >> 16 & 255, Y[z++] = F >> 8 & 255, Y[z++] = F & 255;
|
|
10569
|
+
return K === 2 && (F = e[N.charCodeAt(j)] << 2 | e[N.charCodeAt(j + 1)] >> 4, Y[z++] = F & 255), K === 1 && (F = e[N.charCodeAt(j)] << 10 | e[N.charCodeAt(j + 1)] << 4 | e[N.charCodeAt(j + 2)] >> 2, Y[z++] = F >> 8 & 255, Y[z++] = F & 255), Y;
|
|
10570
10570
|
}
|
|
10571
10571
|
function g(N) {
|
|
10572
10572
|
return t[N >> 18 & 63] + t[N >> 12 & 63] + t[N >> 6 & 63] + t[N & 63];
|
|
10573
10573
|
}
|
|
10574
|
-
function S(N,
|
|
10575
|
-
for (var k, K = [], Y =
|
|
10574
|
+
function S(N, F, M) {
|
|
10575
|
+
for (var k, K = [], Y = F; Y < M; Y += 3)
|
|
10576
10576
|
k = (N[Y] << 16 & 16711680) + (N[Y + 1] << 8 & 65280) + (N[Y + 2] & 255), K.push(g(k));
|
|
10577
10577
|
return K.join("");
|
|
10578
10578
|
}
|
|
10579
10579
|
function I(N) {
|
|
10580
|
-
for (var
|
|
10581
|
-
K.push(S(N,
|
|
10582
|
-
return k === 1 ? (
|
|
10583
|
-
t[
|
|
10584
|
-
)) : k === 2 && (
|
|
10585
|
-
t[
|
|
10580
|
+
for (var F, M = N.length, k = M % 3, K = [], Y = 16383, z = 0, U = M - k; z < U; z += Y)
|
|
10581
|
+
K.push(S(N, z, z + Y > U ? U : z + Y));
|
|
10582
|
+
return k === 1 ? (F = N[M - 1], K.push(
|
|
10583
|
+
t[F >> 2] + t[F << 4 & 63] + "=="
|
|
10584
|
+
)) : k === 2 && (F = (N[M - 2] << 8) + N[M - 1], K.push(
|
|
10585
|
+
t[F >> 10] + t[F >> 4 & 63] + t[F << 2 & 63] + "="
|
|
10586
10586
|
)), K.join("");
|
|
10587
10587
|
}
|
|
10588
10588
|
return ts;
|
|
@@ -10606,12 +10606,12 @@ function a_() {
|
|
|
10606
10606
|
}
|
|
10607
10607
|
return (N ? -1 : 1) * o * Math.pow(2, i - r);
|
|
10608
10608
|
}, li.write = function(t, e, n, r, s, i) {
|
|
10609
|
-
var o, a, d, m = i * 8 - s - 1, g = (1 << m) - 1, S = g >> 1, I = s === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, N = r ? 0 : i - 1,
|
|
10610
|
-
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (a = isNaN(e) ? 1 : 0, o = g) : (o = Math.floor(Math.log(e) / Math.LN2), e * (d = Math.pow(2, -o)) < 1 && (o--, d *= 2), o + S >= 1 ? e += I / d : e += I * Math.pow(2, 1 - S), e * d >= 2 && (o++, d /= 2), o + S >= g ? (a = 0, o = g) : o + S >= 1 ? (a = (e * d - 1) * Math.pow(2, s), o = o + S) : (a = e * Math.pow(2, S - 1) * Math.pow(2, s), o = 0)); s >= 8; t[n + N] = a & 255, N +=
|
|
10609
|
+
var o, a, d, m = i * 8 - s - 1, g = (1 << m) - 1, S = g >> 1, I = s === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, N = r ? 0 : i - 1, F = r ? 1 : -1, M = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
|
|
10610
|
+
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (a = isNaN(e) ? 1 : 0, o = g) : (o = Math.floor(Math.log(e) / Math.LN2), e * (d = Math.pow(2, -o)) < 1 && (o--, d *= 2), o + S >= 1 ? e += I / d : e += I * Math.pow(2, 1 - S), e * d >= 2 && (o++, d /= 2), o + S >= g ? (a = 0, o = g) : o + S >= 1 ? (a = (e * d - 1) * Math.pow(2, s), o = o + S) : (a = e * Math.pow(2, S - 1) * Math.pow(2, s), o = 0)); s >= 8; t[n + N] = a & 255, N += F, a /= 256, s -= 8)
|
|
10611
10611
|
;
|
|
10612
|
-
for (o = o << s | a, m += s; m > 0; t[n + N] = o & 255, N +=
|
|
10612
|
+
for (o = o << s | a, m += s; m > 0; t[n + N] = o & 255, N += F, o /= 256, m -= 8)
|
|
10613
10613
|
;
|
|
10614
|
-
t[n + N -
|
|
10614
|
+
t[n + N - F] |= M * 128;
|
|
10615
10615
|
}), li;
|
|
10616
10616
|
}
|
|
10617
10617
|
/*!
|
|
@@ -10673,7 +10673,7 @@ function tu() {
|
|
|
10673
10673
|
if (typeof b == "string")
|
|
10674
10674
|
return I(b, f);
|
|
10675
10675
|
if (ArrayBuffer.isView(b))
|
|
10676
|
-
return
|
|
10676
|
+
return F(b);
|
|
10677
10677
|
if (b == null)
|
|
10678
10678
|
throw new TypeError(
|
|
10679
10679
|
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof b
|
|
@@ -10687,8 +10687,8 @@ function tu() {
|
|
|
10687
10687
|
const x = b.valueOf && b.valueOf();
|
|
10688
10688
|
if (x != null && x !== b)
|
|
10689
10689
|
return a.from(x, f, h);
|
|
10690
|
-
const
|
|
10691
|
-
if (
|
|
10690
|
+
const D = k(b);
|
|
10691
|
+
if (D) return D;
|
|
10692
10692
|
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof b[Symbol.toPrimitive] == "function")
|
|
10693
10693
|
return a.from(b[Symbol.toPrimitive]("string"), f, h);
|
|
10694
10694
|
throw new TypeError(
|
|
@@ -10721,10 +10721,10 @@ function tu() {
|
|
|
10721
10721
|
function I(b, f) {
|
|
10722
10722
|
if ((typeof f != "string" || f === "") && (f = "utf8"), !a.isEncoding(f))
|
|
10723
10723
|
throw new TypeError("Unknown encoding: " + f);
|
|
10724
|
-
const h =
|
|
10724
|
+
const h = z(b, f) | 0;
|
|
10725
10725
|
let x = o(h);
|
|
10726
|
-
const
|
|
10727
|
-
return
|
|
10726
|
+
const D = x.write(b, f);
|
|
10727
|
+
return D !== h && (x = x.slice(0, D)), x;
|
|
10728
10728
|
}
|
|
10729
10729
|
function N(b) {
|
|
10730
10730
|
const f = b.length < 0 ? 0 : K(b.length) | 0, h = o(f);
|
|
@@ -10732,7 +10732,7 @@ function tu() {
|
|
|
10732
10732
|
h[x] = b[x] & 255;
|
|
10733
10733
|
return h;
|
|
10734
10734
|
}
|
|
10735
|
-
function
|
|
10735
|
+
function F(b) {
|
|
10736
10736
|
if (qt(b, Uint8Array)) {
|
|
10737
10737
|
const f = new Uint8Array(b);
|
|
10738
10738
|
return M(f.buffer, f.byteOffset, f.byteLength);
|
|
@@ -10773,13 +10773,13 @@ function tu() {
|
|
|
10773
10773
|
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
|
|
10774
10774
|
);
|
|
10775
10775
|
if (f === h) return 0;
|
|
10776
|
-
let x = f.length,
|
|
10777
|
-
for (let $ = 0, Z = Math.min(x,
|
|
10776
|
+
let x = f.length, D = h.length;
|
|
10777
|
+
for (let $ = 0, Z = Math.min(x, D); $ < Z; ++$)
|
|
10778
10778
|
if (f[$] !== h[$]) {
|
|
10779
|
-
x = f[$],
|
|
10779
|
+
x = f[$], D = h[$];
|
|
10780
10780
|
break;
|
|
10781
10781
|
}
|
|
10782
|
-
return x <
|
|
10782
|
+
return x < D ? -1 : D < x ? 1 : 0;
|
|
10783
10783
|
}, a.isEncoding = function(f) {
|
|
10784
10784
|
switch (String(f).toLowerCase()) {
|
|
10785
10785
|
case "hex":
|
|
@@ -10806,25 +10806,25 @@ function tu() {
|
|
|
10806
10806
|
if (h === void 0)
|
|
10807
10807
|
for (h = 0, x = 0; x < f.length; ++x)
|
|
10808
10808
|
h += f[x].length;
|
|
10809
|
-
const
|
|
10809
|
+
const D = a.allocUnsafe(h);
|
|
10810
10810
|
let $ = 0;
|
|
10811
10811
|
for (x = 0; x < f.length; ++x) {
|
|
10812
10812
|
let Z = f[x];
|
|
10813
10813
|
if (qt(Z, Uint8Array))
|
|
10814
|
-
$ + Z.length >
|
|
10815
|
-
|
|
10814
|
+
$ + Z.length > D.length ? (a.isBuffer(Z) || (Z = a.from(Z)), Z.copy(D, $)) : Uint8Array.prototype.set.call(
|
|
10815
|
+
D,
|
|
10816
10816
|
Z,
|
|
10817
10817
|
$
|
|
10818
10818
|
);
|
|
10819
10819
|
else if (a.isBuffer(Z))
|
|
10820
|
-
Z.copy(
|
|
10820
|
+
Z.copy(D, $);
|
|
10821
10821
|
else
|
|
10822
10822
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
10823
10823
|
$ += Z.length;
|
|
10824
10824
|
}
|
|
10825
|
-
return
|
|
10825
|
+
return D;
|
|
10826
10826
|
};
|
|
10827
|
-
function
|
|
10827
|
+
function z(b, f) {
|
|
10828
10828
|
if (a.isBuffer(b))
|
|
10829
10829
|
return b.length;
|
|
10830
10830
|
if (ArrayBuffer.isView(b) || qt(b, ArrayBuffer))
|
|
@@ -10835,7 +10835,7 @@ function tu() {
|
|
|
10835
10835
|
);
|
|
10836
10836
|
const h = b.length, x = arguments.length > 2 && arguments[2] === !0;
|
|
10837
10837
|
if (!x && h === 0) return 0;
|
|
10838
|
-
let
|
|
10838
|
+
let D = !1;
|
|
10839
10839
|
for (; ; )
|
|
10840
10840
|
switch (f) {
|
|
10841
10841
|
case "ascii":
|
|
@@ -10855,12 +10855,12 @@ function tu() {
|
|
|
10855
10855
|
case "base64":
|
|
10856
10856
|
return Fe(b).length;
|
|
10857
10857
|
default:
|
|
10858
|
-
if (
|
|
10858
|
+
if (D)
|
|
10859
10859
|
return x ? -1 : Ue(b).length;
|
|
10860
|
-
f = ("" + f).toLowerCase(),
|
|
10860
|
+
f = ("" + f).toLowerCase(), D = !0;
|
|
10861
10861
|
}
|
|
10862
10862
|
}
|
|
10863
|
-
a.byteLength =
|
|
10863
|
+
a.byteLength = z;
|
|
10864
10864
|
function U(b, f, h) {
|
|
10865
10865
|
let x = !1;
|
|
10866
10866
|
if ((f === void 0 || f < 0) && (f = 0), f > this.length || ((h === void 0 || h > this.length) && (h = this.length), h <= 0) || (h >>>= 0, f >>>= 0, h <= f))
|
|
@@ -10890,7 +10890,7 @@ function tu() {
|
|
|
10890
10890
|
}
|
|
10891
10891
|
}
|
|
10892
10892
|
a.prototype._isBuffer = !0;
|
|
10893
|
-
function
|
|
10893
|
+
function j(b, f, h) {
|
|
10894
10894
|
const x = b[f];
|
|
10895
10895
|
b[f] = b[h], b[h] = x;
|
|
10896
10896
|
}
|
|
@@ -10899,21 +10899,21 @@ function tu() {
|
|
|
10899
10899
|
if (f % 2 !== 0)
|
|
10900
10900
|
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
10901
10901
|
for (let h = 0; h < f; h += 2)
|
|
10902
|
-
|
|
10902
|
+
j(this, h, h + 1);
|
|
10903
10903
|
return this;
|
|
10904
10904
|
}, a.prototype.swap32 = function() {
|
|
10905
10905
|
const f = this.length;
|
|
10906
10906
|
if (f % 4 !== 0)
|
|
10907
10907
|
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
10908
10908
|
for (let h = 0; h < f; h += 4)
|
|
10909
|
-
|
|
10909
|
+
j(this, h, h + 3), j(this, h + 1, h + 2);
|
|
10910
10910
|
return this;
|
|
10911
10911
|
}, a.prototype.swap64 = function() {
|
|
10912
10912
|
const f = this.length;
|
|
10913
10913
|
if (f % 8 !== 0)
|
|
10914
10914
|
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
10915
10915
|
for (let h = 0; h < f; h += 8)
|
|
10916
|
-
|
|
10916
|
+
j(this, h, h + 7), j(this, h + 1, h + 6), j(this, h + 2, h + 5), j(this, h + 3, h + 4);
|
|
10917
10917
|
return this;
|
|
10918
10918
|
}, a.prototype.toString = function() {
|
|
10919
10919
|
const f = this.length;
|
|
@@ -10925,22 +10925,22 @@ function tu() {
|
|
|
10925
10925
|
let f = "";
|
|
10926
10926
|
const h = t.INSPECT_MAX_BYTES;
|
|
10927
10927
|
return f = this.toString("hex", 0, h).replace(/(.{2})/g, "$1 ").trim(), this.length > h && (f += " ... "), "<Buffer " + f + ">";
|
|
10928
|
-
}, r && (a.prototype[r] = a.prototype.inspect), a.prototype.compare = function(f, h, x,
|
|
10928
|
+
}, r && (a.prototype[r] = a.prototype.inspect), a.prototype.compare = function(f, h, x, D, $) {
|
|
10929
10929
|
if (qt(f, Uint8Array) && (f = a.from(f, f.offset, f.byteLength)), !a.isBuffer(f))
|
|
10930
10930
|
throw new TypeError(
|
|
10931
10931
|
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof f
|
|
10932
10932
|
);
|
|
10933
|
-
if (h === void 0 && (h = 0), x === void 0 && (x = f ? f.length : 0),
|
|
10933
|
+
if (h === void 0 && (h = 0), x === void 0 && (x = f ? f.length : 0), D === void 0 && (D = 0), $ === void 0 && ($ = this.length), h < 0 || x > f.length || D < 0 || $ > this.length)
|
|
10934
10934
|
throw new RangeError("out of range index");
|
|
10935
|
-
if (
|
|
10935
|
+
if (D >= $ && h >= x)
|
|
10936
10936
|
return 0;
|
|
10937
|
-
if (
|
|
10937
|
+
if (D >= $)
|
|
10938
10938
|
return -1;
|
|
10939
10939
|
if (h >= x)
|
|
10940
10940
|
return 1;
|
|
10941
|
-
if (h >>>= 0, x >>>= 0,
|
|
10942
|
-
let Z = $ -
|
|
10943
|
-
const be = Math.min(Z, Ae), ge = this.slice(
|
|
10941
|
+
if (h >>>= 0, x >>>= 0, D >>>= 0, $ >>>= 0, this === f) return 0;
|
|
10942
|
+
let Z = $ - D, Ae = x - h;
|
|
10943
|
+
const be = Math.min(Z, Ae), ge = this.slice(D, $), $e = f.slice(h, x);
|
|
10944
10944
|
for (let pe = 0; pe < be; ++pe)
|
|
10945
10945
|
if (ge[pe] !== $e[pe]) {
|
|
10946
10946
|
Z = ge[pe], Ae = $e[pe];
|
|
@@ -10948,21 +10948,21 @@ function tu() {
|
|
|
10948
10948
|
}
|
|
10949
10949
|
return Z < Ae ? -1 : Ae < Z ? 1 : 0;
|
|
10950
10950
|
};
|
|
10951
|
-
function J(b, f, h, x,
|
|
10951
|
+
function J(b, f, h, x, D) {
|
|
10952
10952
|
if (b.length === 0) return -1;
|
|
10953
|
-
if (typeof h == "string" ? (x = h, h = 0) : h > 2147483647 ? h = 2147483647 : h < -2147483648 && (h = -2147483648), h = +h, je(h) && (h =
|
|
10954
|
-
if (
|
|
10953
|
+
if (typeof h == "string" ? (x = h, h = 0) : h > 2147483647 ? h = 2147483647 : h < -2147483648 && (h = -2147483648), h = +h, je(h) && (h = D ? 0 : b.length - 1), h < 0 && (h = b.length + h), h >= b.length) {
|
|
10954
|
+
if (D) return -1;
|
|
10955
10955
|
h = b.length - 1;
|
|
10956
10956
|
} else if (h < 0)
|
|
10957
|
-
if (
|
|
10957
|
+
if (D) h = 0;
|
|
10958
10958
|
else return -1;
|
|
10959
10959
|
if (typeof f == "string" && (f = a.from(f, x)), a.isBuffer(f))
|
|
10960
|
-
return f.length === 0 ? -1 : ne(b, f, h, x,
|
|
10960
|
+
return f.length === 0 ? -1 : ne(b, f, h, x, D);
|
|
10961
10961
|
if (typeof f == "number")
|
|
10962
|
-
return f = f & 255, typeof Uint8Array.prototype.indexOf == "function" ?
|
|
10962
|
+
return f = f & 255, typeof Uint8Array.prototype.indexOf == "function" ? D ? Uint8Array.prototype.indexOf.call(b, f, h) : Uint8Array.prototype.lastIndexOf.call(b, f, h) : ne(b, [f], h, x, D);
|
|
10963
10963
|
throw new TypeError("val must be string, number or Buffer");
|
|
10964
10964
|
}
|
|
10965
|
-
function ne(b, f, h, x,
|
|
10965
|
+
function ne(b, f, h, x, D) {
|
|
10966
10966
|
let $ = 1, Z = b.length, Ae = f.length;
|
|
10967
10967
|
if (x !== void 0 && (x = String(x).toLowerCase(), x === "ucs2" || x === "ucs-2" || x === "utf16le" || x === "utf-16le")) {
|
|
10968
10968
|
if (b.length < 2 || f.length < 2)
|
|
@@ -10973,7 +10973,7 @@ function tu() {
|
|
|
10973
10973
|
return $ === 1 ? $e[pe] : $e.readUInt16BE(pe * $);
|
|
10974
10974
|
}
|
|
10975
10975
|
let ge;
|
|
10976
|
-
if (
|
|
10976
|
+
if (D) {
|
|
10977
10977
|
let $e = -1;
|
|
10978
10978
|
for (ge = h; ge < Z; ge++)
|
|
10979
10979
|
if (be(b, ge) === be(f, $e === -1 ? 0 : ge - $e)) {
|
|
@@ -11001,8 +11001,8 @@ function tu() {
|
|
|
11001
11001
|
};
|
|
11002
11002
|
function te(b, f, h, x) {
|
|
11003
11003
|
h = Number(h) || 0;
|
|
11004
|
-
const
|
|
11005
|
-
x ? (x = Number(x), x >
|
|
11004
|
+
const D = b.length - h;
|
|
11005
|
+
x ? (x = Number(x), x > D && (x = D)) : x = D;
|
|
11006
11006
|
const $ = f.length;
|
|
11007
11007
|
x > $ / 2 && (x = $ / 2);
|
|
11008
11008
|
let Z;
|
|
@@ -11013,25 +11013,25 @@ function tu() {
|
|
|
11013
11013
|
}
|
|
11014
11014
|
return Z;
|
|
11015
11015
|
}
|
|
11016
|
-
function
|
|
11016
|
+
function V(b, f, h, x) {
|
|
11017
11017
|
return Le(Ue(f, b.length - h), b, h, x);
|
|
11018
11018
|
}
|
|
11019
11019
|
function C(b, f, h, x) {
|
|
11020
11020
|
return Le(ze(f), b, h, x);
|
|
11021
11021
|
}
|
|
11022
|
-
function
|
|
11022
|
+
function L(b, f, h, x) {
|
|
11023
11023
|
return Le(Fe(f), b, h, x);
|
|
11024
11024
|
}
|
|
11025
|
-
function
|
|
11025
|
+
function G(b, f, h, x) {
|
|
11026
11026
|
return Le(yr(f, b.length - h), b, h, x);
|
|
11027
11027
|
}
|
|
11028
|
-
a.prototype.write = function(f, h, x,
|
|
11028
|
+
a.prototype.write = function(f, h, x, D) {
|
|
11029
11029
|
if (h === void 0)
|
|
11030
|
-
|
|
11030
|
+
D = "utf8", x = this.length, h = 0;
|
|
11031
11031
|
else if (x === void 0 && typeof h == "string")
|
|
11032
|
-
|
|
11032
|
+
D = h, x = this.length, h = 0;
|
|
11033
11033
|
else if (isFinite(h))
|
|
11034
|
-
h = h >>> 0, isFinite(x) ? (x = x >>> 0,
|
|
11034
|
+
h = h >>> 0, isFinite(x) ? (x = x >>> 0, D === void 0 && (D = "utf8")) : (D = x, x = void 0);
|
|
11035
11035
|
else
|
|
11036
11036
|
throw new Error(
|
|
11037
11037
|
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
|
|
@@ -11039,29 +11039,29 @@ function tu() {
|
|
|
11039
11039
|
const $ = this.length - h;
|
|
11040
11040
|
if ((x === void 0 || x > $) && (x = $), f.length > 0 && (x < 0 || h < 0) || h > this.length)
|
|
11041
11041
|
throw new RangeError("Attempt to write outside buffer bounds");
|
|
11042
|
-
|
|
11042
|
+
D || (D = "utf8");
|
|
11043
11043
|
let Z = !1;
|
|
11044
11044
|
for (; ; )
|
|
11045
|
-
switch (
|
|
11045
|
+
switch (D) {
|
|
11046
11046
|
case "hex":
|
|
11047
11047
|
return te(this, f, h, x);
|
|
11048
11048
|
case "utf8":
|
|
11049
11049
|
case "utf-8":
|
|
11050
|
-
return
|
|
11050
|
+
return V(this, f, h, x);
|
|
11051
11051
|
case "ascii":
|
|
11052
11052
|
case "latin1":
|
|
11053
11053
|
case "binary":
|
|
11054
11054
|
return C(this, f, h, x);
|
|
11055
11055
|
case "base64":
|
|
11056
|
-
return
|
|
11056
|
+
return L(this, f, h, x);
|
|
11057
11057
|
case "ucs2":
|
|
11058
11058
|
case "ucs-2":
|
|
11059
11059
|
case "utf16le":
|
|
11060
11060
|
case "utf-16le":
|
|
11061
|
-
return
|
|
11061
|
+
return G(this, f, h, x);
|
|
11062
11062
|
default:
|
|
11063
|
-
if (Z) throw new TypeError("Unknown encoding: " +
|
|
11064
|
-
|
|
11063
|
+
if (Z) throw new TypeError("Unknown encoding: " + D);
|
|
11064
|
+
D = ("" + D).toLowerCase(), Z = !0;
|
|
11065
11065
|
}
|
|
11066
11066
|
}, a.prototype.toJSON = function() {
|
|
11067
11067
|
return {
|
|
@@ -11075,27 +11075,27 @@ function tu() {
|
|
|
11075
11075
|
function c(b, f, h) {
|
|
11076
11076
|
h = Math.min(b.length, h);
|
|
11077
11077
|
const x = [];
|
|
11078
|
-
let
|
|
11079
|
-
for (;
|
|
11080
|
-
const $ = b[
|
|
11078
|
+
let D = f;
|
|
11079
|
+
for (; D < h; ) {
|
|
11080
|
+
const $ = b[D];
|
|
11081
11081
|
let Z = null, Ae = $ > 239 ? 4 : $ > 223 ? 3 : $ > 191 ? 2 : 1;
|
|
11082
|
-
if (
|
|
11082
|
+
if (D + Ae <= h) {
|
|
11083
11083
|
let be, ge, $e, pe;
|
|
11084
11084
|
switch (Ae) {
|
|
11085
11085
|
case 1:
|
|
11086
11086
|
$ < 128 && (Z = $);
|
|
11087
11087
|
break;
|
|
11088
11088
|
case 2:
|
|
11089
|
-
be = b[
|
|
11089
|
+
be = b[D + 1], (be & 192) === 128 && (pe = ($ & 31) << 6 | be & 63, pe > 127 && (Z = pe));
|
|
11090
11090
|
break;
|
|
11091
11091
|
case 3:
|
|
11092
|
-
be = b[
|
|
11092
|
+
be = b[D + 1], ge = b[D + 2], (be & 192) === 128 && (ge & 192) === 128 && (pe = ($ & 15) << 12 | (be & 63) << 6 | ge & 63, pe > 2047 && (pe < 55296 || pe > 57343) && (Z = pe));
|
|
11093
11093
|
break;
|
|
11094
11094
|
case 4:
|
|
11095
|
-
be = b[
|
|
11095
|
+
be = b[D + 1], ge = b[D + 2], $e = b[D + 3], (be & 192) === 128 && (ge & 192) === 128 && ($e & 192) === 128 && (pe = ($ & 15) << 18 | (be & 63) << 12 | (ge & 63) << 6 | $e & 63, pe > 65535 && pe < 1114112 && (Z = pe));
|
|
11096
11096
|
}
|
|
11097
11097
|
}
|
|
11098
|
-
Z === null ? (Z = 65533, Ae = 1) : Z > 65535 && (Z -= 65536, x.push(Z >>> 10 & 1023 | 55296), Z = 56320 | Z & 1023), x.push(Z),
|
|
11098
|
+
Z === null ? (Z = 65533, Ae = 1) : Z > 65535 && (Z -= 65536, x.push(Z >>> 10 & 1023 | 55296), Z = 56320 | Z & 1023), x.push(Z), D += Ae;
|
|
11099
11099
|
}
|
|
11100
11100
|
return y(x);
|
|
11101
11101
|
}
|
|
@@ -11115,37 +11115,37 @@ function tu() {
|
|
|
11115
11115
|
function A(b, f, h) {
|
|
11116
11116
|
let x = "";
|
|
11117
11117
|
h = Math.min(b.length, h);
|
|
11118
|
-
for (let
|
|
11119
|
-
x += String.fromCharCode(b[
|
|
11118
|
+
for (let D = f; D < h; ++D)
|
|
11119
|
+
x += String.fromCharCode(b[D] & 127);
|
|
11120
11120
|
return x;
|
|
11121
11121
|
}
|
|
11122
11122
|
function v(b, f, h) {
|
|
11123
11123
|
let x = "";
|
|
11124
11124
|
h = Math.min(b.length, h);
|
|
11125
|
-
for (let
|
|
11126
|
-
x += String.fromCharCode(b[
|
|
11125
|
+
for (let D = f; D < h; ++D)
|
|
11126
|
+
x += String.fromCharCode(b[D]);
|
|
11127
11127
|
return x;
|
|
11128
11128
|
}
|
|
11129
11129
|
function R(b, f, h) {
|
|
11130
11130
|
const x = b.length;
|
|
11131
11131
|
(!f || f < 0) && (f = 0), (!h || h < 0 || h > x) && (h = x);
|
|
11132
|
-
let
|
|
11132
|
+
let D = "";
|
|
11133
11133
|
for (let $ = f; $ < h; ++$)
|
|
11134
|
-
|
|
11135
|
-
return
|
|
11134
|
+
D += qe[b[$]];
|
|
11135
|
+
return D;
|
|
11136
11136
|
}
|
|
11137
11137
|
function O(b, f, h) {
|
|
11138
11138
|
const x = b.slice(f, h);
|
|
11139
|
-
let
|
|
11139
|
+
let D = "";
|
|
11140
11140
|
for (let $ = 0; $ < x.length - 1; $ += 2)
|
|
11141
|
-
|
|
11142
|
-
return
|
|
11141
|
+
D += String.fromCharCode(x[$] + x[$ + 1] * 256);
|
|
11142
|
+
return D;
|
|
11143
11143
|
}
|
|
11144
11144
|
a.prototype.slice = function(f, h) {
|
|
11145
11145
|
const x = this.length;
|
|
11146
11146
|
f = ~~f, h = h === void 0 ? x : ~~h, f < 0 ? (f += x, f < 0 && (f = 0)) : f > x && (f = x), h < 0 ? (h += x, h < 0 && (h = 0)) : h > x && (h = x), h < f && (h = f);
|
|
11147
|
-
const
|
|
11148
|
-
return Object.setPrototypeOf(
|
|
11147
|
+
const D = this.subarray(f, h);
|
|
11148
|
+
return Object.setPrototypeOf(D, a.prototype), D;
|
|
11149
11149
|
};
|
|
11150
11150
|
function _(b, f, h) {
|
|
11151
11151
|
if (b % 1 !== 0 || b < 0) throw new RangeError("offset is not uint");
|
|
@@ -11153,16 +11153,16 @@ function tu() {
|
|
|
11153
11153
|
}
|
|
11154
11154
|
a.prototype.readUintLE = a.prototype.readUIntLE = function(f, h, x) {
|
|
11155
11155
|
f = f >>> 0, h = h >>> 0, x || _(f, h, this.length);
|
|
11156
|
-
let
|
|
11156
|
+
let D = this[f], $ = 1, Z = 0;
|
|
11157
11157
|
for (; ++Z < h && ($ *= 256); )
|
|
11158
|
-
|
|
11159
|
-
return
|
|
11158
|
+
D += this[f + Z] * $;
|
|
11159
|
+
return D;
|
|
11160
11160
|
}, a.prototype.readUintBE = a.prototype.readUIntBE = function(f, h, x) {
|
|
11161
11161
|
f = f >>> 0, h = h >>> 0, x || _(f, h, this.length);
|
|
11162
|
-
let
|
|
11162
|
+
let D = this[f + --h], $ = 1;
|
|
11163
11163
|
for (; h > 0 && ($ *= 256); )
|
|
11164
|
-
|
|
11165
|
-
return
|
|
11164
|
+
D += this[f + --h] * $;
|
|
11165
|
+
return D;
|
|
11166
11166
|
}, a.prototype.readUint8 = a.prototype.readUInt8 = function(f, h) {
|
|
11167
11167
|
return f = f >>> 0, h || _(f, 1, this.length), this[f];
|
|
11168
11168
|
}, a.prototype.readUint16LE = a.prototype.readUInt16LE = function(f, h) {
|
|
@@ -11177,25 +11177,25 @@ function tu() {
|
|
|
11177
11177
|
f = f >>> 0, De(f, "offset");
|
|
11178
11178
|
const h = this[f], x = this[f + 7];
|
|
11179
11179
|
(h === void 0 || x === void 0) && Re(f, this.length - 8);
|
|
11180
|
-
const
|
|
11181
|
-
return BigInt(
|
|
11180
|
+
const D = h + this[++f] * 2 ** 8 + this[++f] * 2 ** 16 + this[++f] * 2 ** 24, $ = this[++f] + this[++f] * 2 ** 8 + this[++f] * 2 ** 16 + x * 2 ** 24;
|
|
11181
|
+
return BigInt(D) + (BigInt($) << BigInt(32));
|
|
11182
11182
|
}), a.prototype.readBigUInt64BE = en(function(f) {
|
|
11183
11183
|
f = f >>> 0, De(f, "offset");
|
|
11184
11184
|
const h = this[f], x = this[f + 7];
|
|
11185
11185
|
(h === void 0 || x === void 0) && Re(f, this.length - 8);
|
|
11186
|
-
const
|
|
11187
|
-
return (BigInt(
|
|
11186
|
+
const D = h * 2 ** 24 + this[++f] * 2 ** 16 + this[++f] * 2 ** 8 + this[++f], $ = this[++f] * 2 ** 24 + this[++f] * 2 ** 16 + this[++f] * 2 ** 8 + x;
|
|
11187
|
+
return (BigInt(D) << BigInt(32)) + BigInt($);
|
|
11188
11188
|
}), a.prototype.readIntLE = function(f, h, x) {
|
|
11189
11189
|
f = f >>> 0, h = h >>> 0, x || _(f, h, this.length);
|
|
11190
|
-
let
|
|
11190
|
+
let D = this[f], $ = 1, Z = 0;
|
|
11191
11191
|
for (; ++Z < h && ($ *= 256); )
|
|
11192
|
-
|
|
11193
|
-
return $ *= 128,
|
|
11192
|
+
D += this[f + Z] * $;
|
|
11193
|
+
return $ *= 128, D >= $ && (D -= Math.pow(2, 8 * h)), D;
|
|
11194
11194
|
}, a.prototype.readIntBE = function(f, h, x) {
|
|
11195
11195
|
f = f >>> 0, h = h >>> 0, x || _(f, h, this.length);
|
|
11196
|
-
let
|
|
11197
|
-
for (;
|
|
11198
|
-
Z += this[f + --
|
|
11196
|
+
let D = h, $ = 1, Z = this[f + --D];
|
|
11197
|
+
for (; D > 0 && ($ *= 256); )
|
|
11198
|
+
Z += this[f + --D] * $;
|
|
11199
11199
|
return $ *= 128, Z >= $ && (Z -= Math.pow(2, 8 * h)), Z;
|
|
11200
11200
|
}, a.prototype.readInt8 = function(f, h) {
|
|
11201
11201
|
return f = f >>> 0, h || _(f, 1, this.length), this[f] & 128 ? (255 - this[f] + 1) * -1 : this[f];
|
|
@@ -11215,15 +11215,15 @@ function tu() {
|
|
|
11215
11215
|
f = f >>> 0, De(f, "offset");
|
|
11216
11216
|
const h = this[f], x = this[f + 7];
|
|
11217
11217
|
(h === void 0 || x === void 0) && Re(f, this.length - 8);
|
|
11218
|
-
const
|
|
11219
|
-
return (BigInt(
|
|
11218
|
+
const D = this[f + 4] + this[f + 5] * 2 ** 8 + this[f + 6] * 2 ** 16 + (x << 24);
|
|
11219
|
+
return (BigInt(D) << BigInt(32)) + BigInt(h + this[++f] * 2 ** 8 + this[++f] * 2 ** 16 + this[++f] * 2 ** 24);
|
|
11220
11220
|
}), a.prototype.readBigInt64BE = en(function(f) {
|
|
11221
11221
|
f = f >>> 0, De(f, "offset");
|
|
11222
11222
|
const h = this[f], x = this[f + 7];
|
|
11223
11223
|
(h === void 0 || x === void 0) && Re(f, this.length - 8);
|
|
11224
|
-
const
|
|
11224
|
+
const D = (h << 24) + // Overflow
|
|
11225
11225
|
this[++f] * 2 ** 16 + this[++f] * 2 ** 8 + this[++f];
|
|
11226
|
-
return (BigInt(
|
|
11226
|
+
return (BigInt(D) << BigInt(32)) + BigInt(this[++f] * 2 ** 24 + this[++f] * 2 ** 16 + this[++f] * 2 ** 8 + x);
|
|
11227
11227
|
}), a.prototype.readFloatLE = function(f, h) {
|
|
11228
11228
|
return f = f >>> 0, h || _(f, 4, this.length), n.read(this, f, !0, 23, 4);
|
|
11229
11229
|
}, a.prototype.readFloatBE = function(f, h) {
|
|
@@ -11233,13 +11233,13 @@ function tu() {
|
|
|
11233
11233
|
}, a.prototype.readDoubleBE = function(f, h) {
|
|
11234
11234
|
return f = f >>> 0, h || _(f, 8, this.length), n.read(this, f, !1, 52, 8);
|
|
11235
11235
|
};
|
|
11236
|
-
function u(b, f, h, x,
|
|
11236
|
+
function u(b, f, h, x, D, $) {
|
|
11237
11237
|
if (!a.isBuffer(b)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
11238
|
-
if (f >
|
|
11238
|
+
if (f > D || f < $) throw new RangeError('"value" argument is out of bounds');
|
|
11239
11239
|
if (h + x > b.length) throw new RangeError("Index out of range");
|
|
11240
11240
|
}
|
|
11241
|
-
a.prototype.writeUintLE = a.prototype.writeUIntLE = function(f, h, x,
|
|
11242
|
-
if (f = +f, h = h >>> 0, x = x >>> 0, !
|
|
11241
|
+
a.prototype.writeUintLE = a.prototype.writeUIntLE = function(f, h, x, D) {
|
|
11242
|
+
if (f = +f, h = h >>> 0, x = x >>> 0, !D) {
|
|
11243
11243
|
const Ae = Math.pow(2, 8 * x) - 1;
|
|
11244
11244
|
u(this, f, h, x, Ae, 0);
|
|
11245
11245
|
}
|
|
@@ -11247,8 +11247,8 @@ function tu() {
|
|
|
11247
11247
|
for (this[h] = f & 255; ++Z < x && ($ *= 256); )
|
|
11248
11248
|
this[h + Z] = f / $ & 255;
|
|
11249
11249
|
return h + x;
|
|
11250
|
-
}, a.prototype.writeUintBE = a.prototype.writeUIntBE = function(f, h, x,
|
|
11251
|
-
if (f = +f, h = h >>> 0, x = x >>> 0, !
|
|
11250
|
+
}, a.prototype.writeUintBE = a.prototype.writeUIntBE = function(f, h, x, D) {
|
|
11251
|
+
if (f = +f, h = h >>> 0, x = x >>> 0, !D) {
|
|
11252
11252
|
const Ae = Math.pow(2, 8 * x) - 1;
|
|
11253
11253
|
u(this, f, h, x, Ae, 0);
|
|
11254
11254
|
}
|
|
@@ -11267,15 +11267,15 @@ function tu() {
|
|
|
11267
11267
|
}, a.prototype.writeUint32BE = a.prototype.writeUInt32BE = function(f, h, x) {
|
|
11268
11268
|
return f = +f, h = h >>> 0, x || u(this, f, h, 4, 4294967295, 0), this[h] = f >>> 24, this[h + 1] = f >>> 16, this[h + 2] = f >>> 8, this[h + 3] = f & 255, h + 4;
|
|
11269
11269
|
};
|
|
11270
|
-
function l(b, f, h, x,
|
|
11271
|
-
we(f, x,
|
|
11270
|
+
function l(b, f, h, x, D) {
|
|
11271
|
+
we(f, x, D, b, h, 7);
|
|
11272
11272
|
let $ = Number(f & BigInt(4294967295));
|
|
11273
11273
|
b[h++] = $, $ = $ >> 8, b[h++] = $, $ = $ >> 8, b[h++] = $, $ = $ >> 8, b[h++] = $;
|
|
11274
11274
|
let Z = Number(f >> BigInt(32) & BigInt(4294967295));
|
|
11275
11275
|
return b[h++] = Z, Z = Z >> 8, b[h++] = Z, Z = Z >> 8, b[h++] = Z, Z = Z >> 8, b[h++] = Z, h;
|
|
11276
11276
|
}
|
|
11277
|
-
function E(b, f, h, x,
|
|
11278
|
-
we(f, x,
|
|
11277
|
+
function E(b, f, h, x, D) {
|
|
11278
|
+
we(f, x, D, b, h, 7);
|
|
11279
11279
|
let $ = Number(f & BigInt(4294967295));
|
|
11280
11280
|
b[h + 7] = $, $ = $ >> 8, b[h + 6] = $, $ = $ >> 8, b[h + 5] = $, $ = $ >> 8, b[h + 4] = $;
|
|
11281
11281
|
let Z = Number(f >> BigInt(32) & BigInt(4294967295));
|
|
@@ -11285,8 +11285,8 @@ function tu() {
|
|
|
11285
11285
|
return l(this, f, h, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
11286
11286
|
}), a.prototype.writeBigUInt64BE = en(function(f, h = 0) {
|
|
11287
11287
|
return E(this, f, h, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
11288
|
-
}), a.prototype.writeIntLE = function(f, h, x,
|
|
11289
|
-
if (f = +f, h = h >>> 0, !
|
|
11288
|
+
}), a.prototype.writeIntLE = function(f, h, x, D) {
|
|
11289
|
+
if (f = +f, h = h >>> 0, !D) {
|
|
11290
11290
|
const be = Math.pow(2, 8 * x - 1);
|
|
11291
11291
|
u(this, f, h, x, be - 1, -be);
|
|
11292
11292
|
}
|
|
@@ -11294,8 +11294,8 @@ function tu() {
|
|
|
11294
11294
|
for (this[h] = f & 255; ++$ < x && (Z *= 256); )
|
|
11295
11295
|
f < 0 && Ae === 0 && this[h + $ - 1] !== 0 && (Ae = 1), this[h + $] = (f / Z >> 0) - Ae & 255;
|
|
11296
11296
|
return h + x;
|
|
11297
|
-
}, a.prototype.writeIntBE = function(f, h, x,
|
|
11298
|
-
if (f = +f, h = h >>> 0, !
|
|
11297
|
+
}, a.prototype.writeIntBE = function(f, h, x, D) {
|
|
11298
|
+
if (f = +f, h = h >>> 0, !D) {
|
|
11299
11299
|
const be = Math.pow(2, 8 * x - 1);
|
|
11300
11300
|
u(this, f, h, x, be - 1, -be);
|
|
11301
11301
|
}
|
|
@@ -11318,48 +11318,48 @@ function tu() {
|
|
|
11318
11318
|
}), a.prototype.writeBigInt64BE = en(function(f, h = 0) {
|
|
11319
11319
|
return E(this, f, h, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
11320
11320
|
});
|
|
11321
|
-
function T(b, f, h, x,
|
|
11321
|
+
function T(b, f, h, x, D, $) {
|
|
11322
11322
|
if (h + x > b.length) throw new RangeError("Index out of range");
|
|
11323
11323
|
if (h < 0) throw new RangeError("Index out of range");
|
|
11324
11324
|
}
|
|
11325
|
-
function
|
|
11326
|
-
return f = +f, h = h >>> 0,
|
|
11325
|
+
function P(b, f, h, x, D) {
|
|
11326
|
+
return f = +f, h = h >>> 0, D || T(b, f, h, 4), n.write(b, f, h, x, 23, 4), h + 4;
|
|
11327
11327
|
}
|
|
11328
11328
|
a.prototype.writeFloatLE = function(f, h, x) {
|
|
11329
|
-
return
|
|
11329
|
+
return P(this, f, h, !0, x);
|
|
11330
11330
|
}, a.prototype.writeFloatBE = function(f, h, x) {
|
|
11331
|
-
return
|
|
11331
|
+
return P(this, f, h, !1, x);
|
|
11332
11332
|
};
|
|
11333
|
-
function W(b, f, h, x,
|
|
11334
|
-
return f = +f, h = h >>> 0,
|
|
11333
|
+
function W(b, f, h, x, D) {
|
|
11334
|
+
return f = +f, h = h >>> 0, D || T(b, f, h, 8), n.write(b, f, h, x, 52, 8), h + 8;
|
|
11335
11335
|
}
|
|
11336
11336
|
a.prototype.writeDoubleLE = function(f, h, x) {
|
|
11337
11337
|
return W(this, f, h, !0, x);
|
|
11338
11338
|
}, a.prototype.writeDoubleBE = function(f, h, x) {
|
|
11339
11339
|
return W(this, f, h, !1, x);
|
|
11340
|
-
}, a.prototype.copy = function(f, h, x,
|
|
11340
|
+
}, a.prototype.copy = function(f, h, x, D) {
|
|
11341
11341
|
if (!a.isBuffer(f)) throw new TypeError("argument should be a Buffer");
|
|
11342
|
-
if (x || (x = 0), !
|
|
11342
|
+
if (x || (x = 0), !D && D !== 0 && (D = this.length), h >= f.length && (h = f.length), h || (h = 0), D > 0 && D < x && (D = x), D === x || f.length === 0 || this.length === 0) return 0;
|
|
11343
11343
|
if (h < 0)
|
|
11344
11344
|
throw new RangeError("targetStart out of bounds");
|
|
11345
11345
|
if (x < 0 || x >= this.length) throw new RangeError("Index out of range");
|
|
11346
|
-
if (
|
|
11347
|
-
|
|
11348
|
-
const $ =
|
|
11349
|
-
return this === f && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(h, x,
|
|
11346
|
+
if (D < 0) throw new RangeError("sourceEnd out of bounds");
|
|
11347
|
+
D > this.length && (D = this.length), f.length - h < D - x && (D = f.length - h + x);
|
|
11348
|
+
const $ = D - x;
|
|
11349
|
+
return this === f && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(h, x, D) : Uint8Array.prototype.set.call(
|
|
11350
11350
|
f,
|
|
11351
|
-
this.subarray(x,
|
|
11351
|
+
this.subarray(x, D),
|
|
11352
11352
|
h
|
|
11353
11353
|
), $;
|
|
11354
|
-
}, a.prototype.fill = function(f, h, x,
|
|
11354
|
+
}, a.prototype.fill = function(f, h, x, D) {
|
|
11355
11355
|
if (typeof f == "string") {
|
|
11356
|
-
if (typeof h == "string" ? (
|
|
11356
|
+
if (typeof h == "string" ? (D = h, h = 0, x = this.length) : typeof x == "string" && (D = x, x = this.length), D !== void 0 && typeof D != "string")
|
|
11357
11357
|
throw new TypeError("encoding must be a string");
|
|
11358
|
-
if (typeof
|
|
11359
|
-
throw new TypeError("Unknown encoding: " +
|
|
11358
|
+
if (typeof D == "string" && !a.isEncoding(D))
|
|
11359
|
+
throw new TypeError("Unknown encoding: " + D);
|
|
11360
11360
|
if (f.length === 1) {
|
|
11361
11361
|
const Z = f.charCodeAt(0);
|
|
11362
|
-
(
|
|
11362
|
+
(D === "utf8" && Z < 128 || D === "latin1") && (f = Z);
|
|
11363
11363
|
}
|
|
11364
11364
|
} else typeof f == "number" ? f = f & 255 : typeof f == "boolean" && (f = Number(f));
|
|
11365
11365
|
if (h < 0 || this.length < h || this.length < x)
|
|
@@ -11372,7 +11372,7 @@ function tu() {
|
|
|
11372
11372
|
for ($ = h; $ < x; ++$)
|
|
11373
11373
|
this[$] = f;
|
|
11374
11374
|
else {
|
|
11375
|
-
const Z = a.isBuffer(f) ? f : a.from(f,
|
|
11375
|
+
const Z = a.isBuffer(f) ? f : a.from(f, D), Ae = Z.length;
|
|
11376
11376
|
if (Ae === 0)
|
|
11377
11377
|
throw new TypeError('The value "' + f + '" is invalid for argument "value"');
|
|
11378
11378
|
for ($ = 0; $ < x - h; ++$)
|
|
@@ -11393,11 +11393,11 @@ function tu() {
|
|
|
11393
11393
|
get code() {
|
|
11394
11394
|
return b;
|
|
11395
11395
|
}
|
|
11396
|
-
set code(
|
|
11396
|
+
set code(D) {
|
|
11397
11397
|
Object.defineProperty(this, "code", {
|
|
11398
11398
|
configurable: !0,
|
|
11399
11399
|
enumerable: !0,
|
|
11400
|
-
value:
|
|
11400
|
+
value: D,
|
|
11401
11401
|
writable: !0
|
|
11402
11402
|
});
|
|
11403
11403
|
}
|
|
@@ -11421,8 +11421,8 @@ function tu() {
|
|
|
11421
11421
|
), ae(
|
|
11422
11422
|
"ERR_OUT_OF_RANGE",
|
|
11423
11423
|
function(b, f, h) {
|
|
11424
|
-
let x = `The value of "${b}" is out of range.`,
|
|
11425
|
-
return Number.isInteger(h) && Math.abs(h) > 2 ** 32 ?
|
|
11424
|
+
let x = `The value of "${b}" is out of range.`, D = h;
|
|
11425
|
+
return Number.isInteger(h) && Math.abs(h) > 2 ** 32 ? D = Me(String(h)) : typeof h == "bigint" && (D = String(h), (h > BigInt(2) ** BigInt(32) || h < -(BigInt(2) ** BigInt(32))) && (D = Me(D)), D += "n"), x += ` It must be ${f}. Received ${D}`, x;
|
|
11426
11426
|
},
|
|
11427
11427
|
RangeError
|
|
11428
11428
|
);
|
|
@@ -11436,13 +11436,13 @@ function tu() {
|
|
|
11436
11436
|
function ve(b, f, h) {
|
|
11437
11437
|
De(f, "offset"), (b[f] === void 0 || b[f + h] === void 0) && Re(f, b.length - (h + 1));
|
|
11438
11438
|
}
|
|
11439
|
-
function we(b, f, h, x,
|
|
11439
|
+
function we(b, f, h, x, D, $) {
|
|
11440
11440
|
if (b > h || b < f) {
|
|
11441
11441
|
const Z = typeof f == "bigint" ? "n" : "";
|
|
11442
11442
|
let Ae;
|
|
11443
11443
|
throw f === 0 || f === BigInt(0) ? Ae = `>= 0${Z} and < 2${Z} ** ${($ + 1) * 8}${Z}` : Ae = `>= -(2${Z} ** ${($ + 1) * 8 - 1}${Z}) and < 2 ** ${($ + 1) * 8 - 1}${Z}`, new se.ERR_OUT_OF_RANGE("value", Ae, b);
|
|
11444
11444
|
}
|
|
11445
|
-
ve(x,
|
|
11445
|
+
ve(x, D, $);
|
|
11446
11446
|
}
|
|
11447
11447
|
function De(b, f) {
|
|
11448
11448
|
if (typeof b != "number")
|
|
@@ -11466,11 +11466,11 @@ function tu() {
|
|
|
11466
11466
|
f = f || 1 / 0;
|
|
11467
11467
|
let h;
|
|
11468
11468
|
const x = b.length;
|
|
11469
|
-
let
|
|
11469
|
+
let D = null;
|
|
11470
11470
|
const $ = [];
|
|
11471
11471
|
for (let Z = 0; Z < x; ++Z) {
|
|
11472
11472
|
if (h = b.charCodeAt(Z), h > 55295 && h < 57344) {
|
|
11473
|
-
if (!
|
|
11473
|
+
if (!D) {
|
|
11474
11474
|
if (h > 56319) {
|
|
11475
11475
|
(f -= 3) > -1 && $.push(239, 191, 189);
|
|
11476
11476
|
continue;
|
|
@@ -11478,16 +11478,16 @@ function tu() {
|
|
|
11478
11478
|
(f -= 3) > -1 && $.push(239, 191, 189);
|
|
11479
11479
|
continue;
|
|
11480
11480
|
}
|
|
11481
|
-
|
|
11481
|
+
D = h;
|
|
11482
11482
|
continue;
|
|
11483
11483
|
}
|
|
11484
11484
|
if (h < 56320) {
|
|
11485
|
-
(f -= 3) > -1 && $.push(239, 191, 189),
|
|
11485
|
+
(f -= 3) > -1 && $.push(239, 191, 189), D = h;
|
|
11486
11486
|
continue;
|
|
11487
11487
|
}
|
|
11488
|
-
h = (
|
|
11489
|
-
} else
|
|
11490
|
-
if (
|
|
11488
|
+
h = (D - 55296 << 10 | h - 56320) + 65536;
|
|
11489
|
+
} else D && (f -= 3) > -1 && $.push(239, 191, 189);
|
|
11490
|
+
if (D = null, h < 128) {
|
|
11491
11491
|
if ((f -= 1) < 0) break;
|
|
11492
11492
|
$.push(h);
|
|
11493
11493
|
} else if (h < 2048) {
|
|
@@ -11523,20 +11523,20 @@ function tu() {
|
|
|
11523
11523
|
return f;
|
|
11524
11524
|
}
|
|
11525
11525
|
function yr(b, f) {
|
|
11526
|
-
let h, x,
|
|
11526
|
+
let h, x, D;
|
|
11527
11527
|
const $ = [];
|
|
11528
11528
|
for (let Z = 0; Z < b.length && !((f -= 2) < 0); ++Z)
|
|
11529
|
-
h = b.charCodeAt(Z), x = h >> 8,
|
|
11529
|
+
h = b.charCodeAt(Z), x = h >> 8, D = h % 256, $.push(D), $.push(x);
|
|
11530
11530
|
return $;
|
|
11531
11531
|
}
|
|
11532
11532
|
function Fe(b) {
|
|
11533
11533
|
return e.toByteArray(an(b));
|
|
11534
11534
|
}
|
|
11535
11535
|
function Le(b, f, h, x) {
|
|
11536
|
-
let
|
|
11537
|
-
for (
|
|
11538
|
-
f[
|
|
11539
|
-
return
|
|
11536
|
+
let D;
|
|
11537
|
+
for (D = 0; D < x && !(D + h >= f.length || D >= b.length); ++D)
|
|
11538
|
+
f[D + h] = b[D];
|
|
11539
|
+
return D;
|
|
11540
11540
|
}
|
|
11541
11541
|
function qt(b, f) {
|
|
11542
11542
|
return b instanceof f || b != null && b.constructor != null && b.constructor.name != null && b.constructor.name === f.name;
|
|
@@ -11548,8 +11548,8 @@ function tu() {
|
|
|
11548
11548
|
const b = "0123456789abcdef", f = new Array(256);
|
|
11549
11549
|
for (let h = 0; h < 16; ++h) {
|
|
11550
11550
|
const x = h * 16;
|
|
11551
|
-
for (let
|
|
11552
|
-
f[x +
|
|
11551
|
+
for (let D = 0; D < 16; ++D)
|
|
11552
|
+
f[x + D] = b[h] + b[D];
|
|
11553
11553
|
}
|
|
11554
11554
|
return f;
|
|
11555
11555
|
})();
|
|
@@ -11592,7 +11592,7 @@ function l_(t) {
|
|
|
11592
11592
|
} catch {
|
|
11593
11593
|
return { isValid: !1, value: un };
|
|
11594
11594
|
}
|
|
11595
|
-
}),
|
|
11595
|
+
}), F = e.adjustScalarBytes || ((v) => v), M = e.domain || ((v, R, O) => {
|
|
11596
11596
|
if (zn("phflag", O), R.length || O)
|
|
11597
11597
|
throw new Error("Contexts/pre-hash are not supported");
|
|
11598
11598
|
return v;
|
|
@@ -11608,17 +11608,17 @@ function l_(t) {
|
|
|
11608
11608
|
const Y = Ti((v, R) => {
|
|
11609
11609
|
const { ex: O, ey: _, ez: u } = v, l = v.is0();
|
|
11610
11610
|
R == null && (R = l ? c_ : n.inv(u));
|
|
11611
|
-
const E = g(O * R), T = g(_ * R),
|
|
11611
|
+
const E = g(O * R), T = g(_ * R), P = g(u * R);
|
|
11612
11612
|
if (l)
|
|
11613
11613
|
return { x: un, y: Lt };
|
|
11614
|
-
if (
|
|
11614
|
+
if (P !== Lt)
|
|
11615
11615
|
throw new Error("invZ was invalid");
|
|
11616
11616
|
return { x: E, y: T };
|
|
11617
|
-
}),
|
|
11617
|
+
}), z = Ti((v) => {
|
|
11618
11618
|
const { a: R, d: O } = e;
|
|
11619
11619
|
if (v.is0())
|
|
11620
11620
|
throw new Error("bad point: ZERO");
|
|
11621
|
-
const { ex: _, ey: u, ez: l, et: E } = v, T = g(_ * _),
|
|
11621
|
+
const { ex: _, ey: u, ez: l, et: E } = v, T = g(_ * _), P = g(u * u), W = g(l * l), se = g(W * W), ae = g(T * R), Me = g(W * g(ae + P)), ve = g(se + g(O * g(T * P)));
|
|
11622
11622
|
if (Me !== ve)
|
|
11623
11623
|
throw new Error("bad point: equation left != right (1)");
|
|
11624
11624
|
const we = g(_ * u), De = g(l * E);
|
|
@@ -11657,13 +11657,13 @@ function l_(t) {
|
|
|
11657
11657
|
// Not required for fromHex(), which always creates valid points.
|
|
11658
11658
|
// Could be useful for fromAffine().
|
|
11659
11659
|
assertValidity() {
|
|
11660
|
-
|
|
11660
|
+
z(this);
|
|
11661
11661
|
}
|
|
11662
11662
|
// Compare one point to another.
|
|
11663
11663
|
equals(R) {
|
|
11664
11664
|
K(R);
|
|
11665
|
-
const { ex: O, ey: _, ez: u } = this, { ex: l, ey: E, ez: T } = R,
|
|
11666
|
-
return
|
|
11665
|
+
const { ex: O, ey: _, ez: u } = this, { ex: l, ey: E, ez: T } = R, P = g(O * T), W = g(l * u), se = g(_ * T), ae = g(E * u);
|
|
11666
|
+
return P === W && se === ae;
|
|
11667
11667
|
}
|
|
11668
11668
|
is0() {
|
|
11669
11669
|
return this.equals(U.ZERO);
|
|
@@ -11675,7 +11675,7 @@ function l_(t) {
|
|
|
11675
11675
|
// https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd
|
|
11676
11676
|
// Cost: 4M + 4S + 1*a + 6add + 1*2.
|
|
11677
11677
|
double() {
|
|
11678
|
-
const { a: R } = e, { ex: O, ey: _, ez: u } = this, l = g(O * O), E = g(_ * _), T = g(Ud * g(u * u)),
|
|
11678
|
+
const { a: R } = e, { ex: O, ey: _, ez: u } = this, l = g(O * O), E = g(_ * _), T = g(Ud * g(u * u)), P = g(R * l), W = O + _, se = g(g(W * W) - l - E), ae = P + E, Me = ae - T, ve = P - E, we = g(se * Me), De = g(ae * ve), Re = g(se * ve), Oe = g(Me * ae);
|
|
11679
11679
|
return new U(we, De, Oe, Re);
|
|
11680
11680
|
}
|
|
11681
11681
|
// Fast algo for adding 2 Extended Points.
|
|
@@ -11683,7 +11683,7 @@ function l_(t) {
|
|
|
11683
11683
|
// Cost: 9M + 1*a + 1*d + 7add.
|
|
11684
11684
|
add(R) {
|
|
11685
11685
|
K(R);
|
|
11686
|
-
const { a: O, d: _ } = e, { ex: u, ey: l, ez: E, et: T } = this, { ex:
|
|
11686
|
+
const { a: O, d: _ } = e, { ex: u, ey: l, ez: E, et: T } = this, { ex: P, ey: W, ez: se, et: ae } = R, Me = g(u * P), ve = g(l * W), we = g(T * _ * ae), De = g(E * se), Re = g((u + l) * (P + W) - Me - ve), Oe = De - we, an = De + we, Ue = g(ve - O * Me), ze = g(Re * Oe), yr = g(an * Ue), Fe = g(Re * Ue), Le = g(Oe * an);
|
|
11687
11687
|
return new U(ze, yr, Le, Fe);
|
|
11688
11688
|
}
|
|
11689
11689
|
subtract(R) {
|
|
@@ -11736,20 +11736,20 @@ function l_(t) {
|
|
|
11736
11736
|
R = Xe("pointHex", R, l), zn("zip215", O);
|
|
11737
11737
|
const E = R.slice(), T = R[l - 1];
|
|
11738
11738
|
E[l - 1] = T & -129;
|
|
11739
|
-
const
|
|
11740
|
-
tn("pointHex.y",
|
|
11741
|
-
const se = g(
|
|
11739
|
+
const P = os(E), W = O ? m : n.ORDER;
|
|
11740
|
+
tn("pointHex.y", P, un, W);
|
|
11741
|
+
const se = g(P * P), ae = g(se - Lt), Me = g(_ * se - u);
|
|
11742
11742
|
let { isValid: ve, value: we } = N(ae, Me);
|
|
11743
11743
|
if (!ve)
|
|
11744
11744
|
throw new Error("Point.fromHex: invalid y coordinate");
|
|
11745
11745
|
const De = (we & Lt) === Lt, Re = (T & 128) !== 0;
|
|
11746
11746
|
if (!O && we === un && Re)
|
|
11747
11747
|
throw new Error("Point.fromHex: x=0 and x_0=1");
|
|
11748
|
-
return Re !== De && (we = g(-we)), U.fromAffine({ x: we, y:
|
|
11748
|
+
return Re !== De && (we = g(-we)), U.fromAffine({ x: we, y: P });
|
|
11749
11749
|
}
|
|
11750
11750
|
static fromPrivateKey(R) {
|
|
11751
11751
|
const { scalar: O } = C(R);
|
|
11752
|
-
return
|
|
11752
|
+
return j.multiply(O);
|
|
11753
11753
|
}
|
|
11754
11754
|
toRawBytes() {
|
|
11755
11755
|
const { x: R, y: O } = this.toAffine(), _ = xi(O, n.BYTES);
|
|
@@ -11760,33 +11760,33 @@ function l_(t) {
|
|
|
11760
11760
|
}
|
|
11761
11761
|
}
|
|
11762
11762
|
U.BASE = new U(e.Gx, e.Gy, Lt, g(e.Gx * e.Gy)), U.ZERO = new U(un, Lt, Lt, un);
|
|
11763
|
-
const { BASE:
|
|
11763
|
+
const { BASE: j, ZERO: J } = U, ne = Jf(U, a * 8);
|
|
11764
11764
|
function te(v) {
|
|
11765
11765
|
return He(v, r);
|
|
11766
11766
|
}
|
|
11767
|
-
function
|
|
11767
|
+
function V(v) {
|
|
11768
11768
|
return te(os(v));
|
|
11769
11769
|
}
|
|
11770
11770
|
function C(v) {
|
|
11771
11771
|
const R = n.BYTES;
|
|
11772
11772
|
v = Xe("private key", v, R);
|
|
11773
|
-
const O = Xe("hashed private key", i(v), 2 * R), _ =
|
|
11773
|
+
const O = Xe("hashed private key", i(v), 2 * R), _ = F(O.slice(0, R)), u = O.slice(R, 2 * R), l = V(_);
|
|
11774
11774
|
return { head: _, prefix: u, scalar: l };
|
|
11775
11775
|
}
|
|
11776
|
-
function
|
|
11777
|
-
const { head: R, prefix: O, scalar: _ } = C(v), u =
|
|
11776
|
+
function L(v) {
|
|
11777
|
+
const { head: R, prefix: O, scalar: _ } = C(v), u = j.multiply(_), l = u.toRawBytes();
|
|
11778
11778
|
return { head: R, prefix: O, scalar: _, point: u, pointBytes: l };
|
|
11779
11779
|
}
|
|
11780
|
-
function
|
|
11781
|
-
return
|
|
11780
|
+
function G(v) {
|
|
11781
|
+
return L(v).pointBytes;
|
|
11782
11782
|
}
|
|
11783
11783
|
function w(v = Uint8Array.of(), ...R) {
|
|
11784
11784
|
const O = $r(...R);
|
|
11785
|
-
return
|
|
11785
|
+
return V(i(M(O, Xe("context", v), !!s)));
|
|
11786
11786
|
}
|
|
11787
11787
|
function c(v, R, O = {}) {
|
|
11788
11788
|
v = Xe("message", v), s && (v = s(v));
|
|
11789
|
-
const { prefix: _, scalar: u, pointBytes: l } =
|
|
11789
|
+
const { prefix: _, scalar: u, pointBytes: l } = L(R), E = w(O.context, _, v), T = j.multiply(E).toRawBytes(), P = w(O.context, T, l, v), W = te(E + P * u);
|
|
11790
11790
|
tn("signature.s", W, un, r);
|
|
11791
11791
|
const se = $r(T, xi(W, n.BYTES));
|
|
11792
11792
|
return Xe("result", se, n.BYTES * 2);
|
|
@@ -11796,25 +11796,25 @@ function l_(t) {
|
|
|
11796
11796
|
const { context: u, zip215: l } = _, E = n.BYTES;
|
|
11797
11797
|
v = Xe("signature", v, 2 * E), R = Xe("message", R), O = Xe("publicKey", O, E), l !== void 0 && zn("zip215", l), s && (R = s(R));
|
|
11798
11798
|
const T = os(v.slice(E, 2 * E));
|
|
11799
|
-
let
|
|
11799
|
+
let P, W, se;
|
|
11800
11800
|
try {
|
|
11801
|
-
|
|
11801
|
+
P = U.fromHex(O, l), W = U.fromHex(v.slice(0, E), l), se = j.multiplyUnsafe(T);
|
|
11802
11802
|
} catch {
|
|
11803
11803
|
return !1;
|
|
11804
11804
|
}
|
|
11805
|
-
if (!l &&
|
|
11805
|
+
if (!l && P.isSmallOrder())
|
|
11806
11806
|
return !1;
|
|
11807
|
-
const ae = w(u, W.toRawBytes(),
|
|
11808
|
-
return W.add(
|
|
11807
|
+
const ae = w(u, W.toRawBytes(), P.toRawBytes(), R);
|
|
11808
|
+
return W.add(P.multiplyUnsafe(ae)).subtract(se).clearCofactor().equals(U.ZERO);
|
|
11809
11809
|
}
|
|
11810
|
-
return
|
|
11810
|
+
return j._setWindowSize(8), {
|
|
11811
11811
|
CURVE: e,
|
|
11812
|
-
getPublicKey:
|
|
11812
|
+
getPublicKey: G,
|
|
11813
11813
|
sign: c,
|
|
11814
11814
|
verify: y,
|
|
11815
11815
|
ExtendedPoint: U,
|
|
11816
11816
|
utils: {
|
|
11817
|
-
getExtendedPublicKey:
|
|
11817
|
+
getExtendedPublicKey: L,
|
|
11818
11818
|
/** ed25519 priv keys are uniform 32b. No need to check for modulo bias, like in secp256k1. */
|
|
11819
11819
|
randomPrivateKey: () => o(n.BYTES),
|
|
11820
11820
|
/**
|
|
@@ -11836,7 +11836,7 @@ const f_ = BigInt(1), Dd = BigInt(2);
|
|
|
11836
11836
|
BigInt(3);
|
|
11837
11837
|
const h_ = BigInt(5), p_ = BigInt(8);
|
|
11838
11838
|
function m_(t) {
|
|
11839
|
-
const e = BigInt(10), n = BigInt(20), r = BigInt(40), s = BigInt(80), i = nu, a = t * t % i * t % i, d = Ze(a, Dd, i) * a % i, m = Ze(d, f_, i) * t % i, g = Ze(m, h_, i) * m % i, S = Ze(g, e, i) * g % i, I = Ze(S, n, i) * S % i, N = Ze(I, r, i) * I % i,
|
|
11839
|
+
const e = BigInt(10), n = BigInt(20), r = BigInt(40), s = BigInt(80), i = nu, a = t * t % i * t % i, d = Ze(a, Dd, i) * a % i, m = Ze(d, f_, i) * t % i, g = Ze(m, h_, i) * m % i, S = Ze(g, e, i) * g % i, I = Ze(S, n, i) * S % i, N = Ze(I, r, i) * I % i, F = Ze(N, s, i) * N % i, M = Ze(F, s, i) * N % i, k = Ze(M, e, i) * g % i;
|
|
11840
11840
|
return { pow_p_5_8: Ze(k, Dd, i) * t % i, b2: a };
|
|
11841
11841
|
}
|
|
11842
11842
|
function g_(t) {
|
|
@@ -12085,7 +12085,7 @@ function _h() {
|
|
|
12085
12085
|
5,
|
|
12086
12086
|
5,
|
|
12087
12087
|
5
|
|
12088
|
-
],
|
|
12088
|
+
], F = [
|
|
12089
12089
|
0,
|
|
12090
12090
|
0,
|
|
12091
12091
|
33554432,
|
|
@@ -12138,7 +12138,7 @@ function _h() {
|
|
|
12138
12138
|
return this.negative !== 0 && (y = "-" + y), y;
|
|
12139
12139
|
}
|
|
12140
12140
|
if (c === (c | 0) && c >= 2 && c <= 36) {
|
|
12141
|
-
var u = N[c], l =
|
|
12141
|
+
var u = N[c], l = F[c];
|
|
12142
12142
|
y = "";
|
|
12143
12143
|
var E = this.clone();
|
|
12144
12144
|
for (E.negative = 0; !E.isZero(); ) {
|
|
@@ -12327,35 +12327,35 @@ function _h() {
|
|
|
12327
12327
|
var A = w.words[0] | 0, v = c.words[0] | 0, R = A * v, O = R & 67108863, _ = R / 67108864 | 0;
|
|
12328
12328
|
p.words[0] = O;
|
|
12329
12329
|
for (var u = 1; u < y; u++) {
|
|
12330
|
-
for (var l = _ >>> 26, E = _ & 67108863, T = Math.min(u, c.length - 1),
|
|
12331
|
-
var W = u -
|
|
12332
|
-
A = w.words[W] | 0, v = c.words[
|
|
12330
|
+
for (var l = _ >>> 26, E = _ & 67108863, T = Math.min(u, c.length - 1), P = Math.max(0, u - w.length + 1); P <= T; P++) {
|
|
12331
|
+
var W = u - P | 0;
|
|
12332
|
+
A = w.words[W] | 0, v = c.words[P] | 0, R = A * v + E, l += R / 67108864 | 0, E = R & 67108863;
|
|
12333
12333
|
}
|
|
12334
12334
|
p.words[u] = E | 0, _ = l | 0;
|
|
12335
12335
|
}
|
|
12336
12336
|
return _ !== 0 ? p.words[u] = _ | 0 : p.length--, p._strip();
|
|
12337
12337
|
}
|
|
12338
12338
|
var Y = function(c, p, y) {
|
|
12339
|
-
var A = c.words, v = p.words, R = y.words, O = 0, _, u, l, E = A[0] | 0, T = E & 8191,
|
|
12340
|
-
y.negative = c.negative ^ p.negative, y.length = 19, _ = Math.imul(T, be), u = Math.imul(T, ge), u = u + Math.imul(
|
|
12339
|
+
var A = c.words, v = p.words, R = y.words, O = 0, _, u, l, E = A[0] | 0, T = E & 8191, P = E >>> 13, W = A[1] | 0, se = W & 8191, ae = W >>> 13, Me = A[2] | 0, ve = Me & 8191, we = Me >>> 13, De = A[3] | 0, Re = De & 8191, Oe = De >>> 13, an = A[4] | 0, Ue = an & 8191, ze = an >>> 13, yr = A[5] | 0, Fe = yr & 8191, Le = yr >>> 13, qt = A[6] | 0, je = qt & 8191, qe = qt >>> 13, en = A[7] | 0, Ke = en & 8191, b = en >>> 13, f = A[8] | 0, h = f & 8191, x = f >>> 13, D = A[9] | 0, $ = D & 8191, Z = D >>> 13, Ae = v[0] | 0, be = Ae & 8191, ge = Ae >>> 13, $e = v[1] | 0, pe = $e & 8191, Qe = $e >>> 13, Tu = v[2] | 0, et = Tu & 8191, tt = Tu >>> 13, Iu = v[3] | 0, nt = Iu & 8191, rt = Iu >>> 13, Ou = v[4] | 0, st = Ou & 8191, it = Ou >>> 13, Nu = v[5] | 0, ot = Nu & 8191, at = Nu >>> 13, Cu = v[6] | 0, ct = Cu & 8191, ut = Cu >>> 13, Mu = v[7] | 0, dt = Mu & 8191, lt = Mu >>> 13, Bu = v[8] | 0, ft = Bu & 8191, ht = Bu >>> 13, ku = v[9] | 0, pt = ku & 8191, mt = ku >>> 13;
|
|
12340
|
+
y.negative = c.negative ^ p.negative, y.length = 19, _ = Math.imul(T, be), u = Math.imul(T, ge), u = u + Math.imul(P, be) | 0, l = Math.imul(P, ge);
|
|
12341
12341
|
var Ao = (O + _ | 0) + ((u & 8191) << 13) | 0;
|
|
12342
|
-
O = (l + (u >>> 13) | 0) + (Ao >>> 26) | 0, Ao &= 67108863, _ = Math.imul(se, be), u = Math.imul(se, ge), u = u + Math.imul(ae, be) | 0, l = Math.imul(ae, ge), _ = _ + Math.imul(T, pe) | 0, u = u + Math.imul(T, Qe) | 0, u = u + Math.imul(
|
|
12342
|
+
O = (l + (u >>> 13) | 0) + (Ao >>> 26) | 0, Ao &= 67108863, _ = Math.imul(se, be), u = Math.imul(se, ge), u = u + Math.imul(ae, be) | 0, l = Math.imul(ae, ge), _ = _ + Math.imul(T, pe) | 0, u = u + Math.imul(T, Qe) | 0, u = u + Math.imul(P, pe) | 0, l = l + Math.imul(P, Qe) | 0;
|
|
12343
12343
|
var So = (O + _ | 0) + ((u & 8191) << 13) | 0;
|
|
12344
|
-
O = (l + (u >>> 13) | 0) + (So >>> 26) | 0, So &= 67108863, _ = Math.imul(ve, be), u = Math.imul(ve, ge), u = u + Math.imul(we, be) | 0, l = Math.imul(we, ge), _ = _ + Math.imul(se, pe) | 0, u = u + Math.imul(se, Qe) | 0, u = u + Math.imul(ae, pe) | 0, l = l + Math.imul(ae, Qe) | 0, _ = _ + Math.imul(T, et) | 0, u = u + Math.imul(T, tt) | 0, u = u + Math.imul(
|
|
12344
|
+
O = (l + (u >>> 13) | 0) + (So >>> 26) | 0, So &= 67108863, _ = Math.imul(ve, be), u = Math.imul(ve, ge), u = u + Math.imul(we, be) | 0, l = Math.imul(we, ge), _ = _ + Math.imul(se, pe) | 0, u = u + Math.imul(se, Qe) | 0, u = u + Math.imul(ae, pe) | 0, l = l + Math.imul(ae, Qe) | 0, _ = _ + Math.imul(T, et) | 0, u = u + Math.imul(T, tt) | 0, u = u + Math.imul(P, et) | 0, l = l + Math.imul(P, tt) | 0;
|
|
12345
12345
|
var xo = (O + _ | 0) + ((u & 8191) << 13) | 0;
|
|
12346
|
-
O = (l + (u >>> 13) | 0) + (xo >>> 26) | 0, xo &= 67108863, _ = Math.imul(Re, be), u = Math.imul(Re, ge), u = u + Math.imul(Oe, be) | 0, l = Math.imul(Oe, ge), _ = _ + Math.imul(ve, pe) | 0, u = u + Math.imul(ve, Qe) | 0, u = u + Math.imul(we, pe) | 0, l = l + Math.imul(we, Qe) | 0, _ = _ + Math.imul(se, et) | 0, u = u + Math.imul(se, tt) | 0, u = u + Math.imul(ae, et) | 0, l = l + Math.imul(ae, tt) | 0, _ = _ + Math.imul(T, nt) | 0, u = u + Math.imul(T, rt) | 0, u = u + Math.imul(
|
|
12346
|
+
O = (l + (u >>> 13) | 0) + (xo >>> 26) | 0, xo &= 67108863, _ = Math.imul(Re, be), u = Math.imul(Re, ge), u = u + Math.imul(Oe, be) | 0, l = Math.imul(Oe, ge), _ = _ + Math.imul(ve, pe) | 0, u = u + Math.imul(ve, Qe) | 0, u = u + Math.imul(we, pe) | 0, l = l + Math.imul(we, Qe) | 0, _ = _ + Math.imul(se, et) | 0, u = u + Math.imul(se, tt) | 0, u = u + Math.imul(ae, et) | 0, l = l + Math.imul(ae, tt) | 0, _ = _ + Math.imul(T, nt) | 0, u = u + Math.imul(T, rt) | 0, u = u + Math.imul(P, nt) | 0, l = l + Math.imul(P, rt) | 0;
|
|
12347
12347
|
var To = (O + _ | 0) + ((u & 8191) << 13) | 0;
|
|
12348
|
-
O = (l + (u >>> 13) | 0) + (To >>> 26) | 0, To &= 67108863, _ = Math.imul(Ue, be), u = Math.imul(Ue, ge), u = u + Math.imul(ze, be) | 0, l = Math.imul(ze, ge), _ = _ + Math.imul(Re, pe) | 0, u = u + Math.imul(Re, Qe) | 0, u = u + Math.imul(Oe, pe) | 0, l = l + Math.imul(Oe, Qe) | 0, _ = _ + Math.imul(ve, et) | 0, u = u + Math.imul(ve, tt) | 0, u = u + Math.imul(we, et) | 0, l = l + Math.imul(we, tt) | 0, _ = _ + Math.imul(se, nt) | 0, u = u + Math.imul(se, rt) | 0, u = u + Math.imul(ae, nt) | 0, l = l + Math.imul(ae, rt) | 0, _ = _ + Math.imul(T, st) | 0, u = u + Math.imul(T, it) | 0, u = u + Math.imul(
|
|
12348
|
+
O = (l + (u >>> 13) | 0) + (To >>> 26) | 0, To &= 67108863, _ = Math.imul(Ue, be), u = Math.imul(Ue, ge), u = u + Math.imul(ze, be) | 0, l = Math.imul(ze, ge), _ = _ + Math.imul(Re, pe) | 0, u = u + Math.imul(Re, Qe) | 0, u = u + Math.imul(Oe, pe) | 0, l = l + Math.imul(Oe, Qe) | 0, _ = _ + Math.imul(ve, et) | 0, u = u + Math.imul(ve, tt) | 0, u = u + Math.imul(we, et) | 0, l = l + Math.imul(we, tt) | 0, _ = _ + Math.imul(se, nt) | 0, u = u + Math.imul(se, rt) | 0, u = u + Math.imul(ae, nt) | 0, l = l + Math.imul(ae, rt) | 0, _ = _ + Math.imul(T, st) | 0, u = u + Math.imul(T, it) | 0, u = u + Math.imul(P, st) | 0, l = l + Math.imul(P, it) | 0;
|
|
12349
12349
|
var Io = (O + _ | 0) + ((u & 8191) << 13) | 0;
|
|
12350
|
-
O = (l + (u >>> 13) | 0) + (Io >>> 26) | 0, Io &= 67108863, _ = Math.imul(Fe, be), u = Math.imul(Fe, ge), u = u + Math.imul(Le, be) | 0, l = Math.imul(Le, ge), _ = _ + Math.imul(Ue, pe) | 0, u = u + Math.imul(Ue, Qe) | 0, u = u + Math.imul(ze, pe) | 0, l = l + Math.imul(ze, Qe) | 0, _ = _ + Math.imul(Re, et) | 0, u = u + Math.imul(Re, tt) | 0, u = u + Math.imul(Oe, et) | 0, l = l + Math.imul(Oe, tt) | 0, _ = _ + Math.imul(ve, nt) | 0, u = u + Math.imul(ve, rt) | 0, u = u + Math.imul(we, nt) | 0, l = l + Math.imul(we, rt) | 0, _ = _ + Math.imul(se, st) | 0, u = u + Math.imul(se, it) | 0, u = u + Math.imul(ae, st) | 0, l = l + Math.imul(ae, it) | 0, _ = _ + Math.imul(T, ot) | 0, u = u + Math.imul(T, at) | 0, u = u + Math.imul(
|
|
12350
|
+
O = (l + (u >>> 13) | 0) + (Io >>> 26) | 0, Io &= 67108863, _ = Math.imul(Fe, be), u = Math.imul(Fe, ge), u = u + Math.imul(Le, be) | 0, l = Math.imul(Le, ge), _ = _ + Math.imul(Ue, pe) | 0, u = u + Math.imul(Ue, Qe) | 0, u = u + Math.imul(ze, pe) | 0, l = l + Math.imul(ze, Qe) | 0, _ = _ + Math.imul(Re, et) | 0, u = u + Math.imul(Re, tt) | 0, u = u + Math.imul(Oe, et) | 0, l = l + Math.imul(Oe, tt) | 0, _ = _ + Math.imul(ve, nt) | 0, u = u + Math.imul(ve, rt) | 0, u = u + Math.imul(we, nt) | 0, l = l + Math.imul(we, rt) | 0, _ = _ + Math.imul(se, st) | 0, u = u + Math.imul(se, it) | 0, u = u + Math.imul(ae, st) | 0, l = l + Math.imul(ae, it) | 0, _ = _ + Math.imul(T, ot) | 0, u = u + Math.imul(T, at) | 0, u = u + Math.imul(P, ot) | 0, l = l + Math.imul(P, at) | 0;
|
|
12351
12351
|
var Oo = (O + _ | 0) + ((u & 8191) << 13) | 0;
|
|
12352
|
-
O = (l + (u >>> 13) | 0) + (Oo >>> 26) | 0, Oo &= 67108863, _ = Math.imul(je, be), u = Math.imul(je, ge), u = u + Math.imul(qe, be) | 0, l = Math.imul(qe, ge), _ = _ + Math.imul(Fe, pe) | 0, u = u + Math.imul(Fe, Qe) | 0, u = u + Math.imul(Le, pe) | 0, l = l + Math.imul(Le, Qe) | 0, _ = _ + Math.imul(Ue, et) | 0, u = u + Math.imul(Ue, tt) | 0, u = u + Math.imul(ze, et) | 0, l = l + Math.imul(ze, tt) | 0, _ = _ + Math.imul(Re, nt) | 0, u = u + Math.imul(Re, rt) | 0, u = u + Math.imul(Oe, nt) | 0, l = l + Math.imul(Oe, rt) | 0, _ = _ + Math.imul(ve, st) | 0, u = u + Math.imul(ve, it) | 0, u = u + Math.imul(we, st) | 0, l = l + Math.imul(we, it) | 0, _ = _ + Math.imul(se, ot) | 0, u = u + Math.imul(se, at) | 0, u = u + Math.imul(ae, ot) | 0, l = l + Math.imul(ae, at) | 0, _ = _ + Math.imul(T, ct) | 0, u = u + Math.imul(T, ut) | 0, u = u + Math.imul(
|
|
12352
|
+
O = (l + (u >>> 13) | 0) + (Oo >>> 26) | 0, Oo &= 67108863, _ = Math.imul(je, be), u = Math.imul(je, ge), u = u + Math.imul(qe, be) | 0, l = Math.imul(qe, ge), _ = _ + Math.imul(Fe, pe) | 0, u = u + Math.imul(Fe, Qe) | 0, u = u + Math.imul(Le, pe) | 0, l = l + Math.imul(Le, Qe) | 0, _ = _ + Math.imul(Ue, et) | 0, u = u + Math.imul(Ue, tt) | 0, u = u + Math.imul(ze, et) | 0, l = l + Math.imul(ze, tt) | 0, _ = _ + Math.imul(Re, nt) | 0, u = u + Math.imul(Re, rt) | 0, u = u + Math.imul(Oe, nt) | 0, l = l + Math.imul(Oe, rt) | 0, _ = _ + Math.imul(ve, st) | 0, u = u + Math.imul(ve, it) | 0, u = u + Math.imul(we, st) | 0, l = l + Math.imul(we, it) | 0, _ = _ + Math.imul(se, ot) | 0, u = u + Math.imul(se, at) | 0, u = u + Math.imul(ae, ot) | 0, l = l + Math.imul(ae, at) | 0, _ = _ + Math.imul(T, ct) | 0, u = u + Math.imul(T, ut) | 0, u = u + Math.imul(P, ct) | 0, l = l + Math.imul(P, ut) | 0;
|
|
12353
12353
|
var No = (O + _ | 0) + ((u & 8191) << 13) | 0;
|
|
12354
|
-
O = (l + (u >>> 13) | 0) + (No >>> 26) | 0, No &= 67108863, _ = Math.imul(Ke, be), u = Math.imul(Ke, ge), u = u + Math.imul(b, be) | 0, l = Math.imul(b, ge), _ = _ + Math.imul(je, pe) | 0, u = u + Math.imul(je, Qe) | 0, u = u + Math.imul(qe, pe) | 0, l = l + Math.imul(qe, Qe) | 0, _ = _ + Math.imul(Fe, et) | 0, u = u + Math.imul(Fe, tt) | 0, u = u + Math.imul(Le, et) | 0, l = l + Math.imul(Le, tt) | 0, _ = _ + Math.imul(Ue, nt) | 0, u = u + Math.imul(Ue, rt) | 0, u = u + Math.imul(ze, nt) | 0, l = l + Math.imul(ze, rt) | 0, _ = _ + Math.imul(Re, st) | 0, u = u + Math.imul(Re, it) | 0, u = u + Math.imul(Oe, st) | 0, l = l + Math.imul(Oe, it) | 0, _ = _ + Math.imul(ve, ot) | 0, u = u + Math.imul(ve, at) | 0, u = u + Math.imul(we, ot) | 0, l = l + Math.imul(we, at) | 0, _ = _ + Math.imul(se, ct) | 0, u = u + Math.imul(se, ut) | 0, u = u + Math.imul(ae, ct) | 0, l = l + Math.imul(ae, ut) | 0, _ = _ + Math.imul(T, dt) | 0, u = u + Math.imul(T, lt) | 0, u = u + Math.imul(
|
|
12354
|
+
O = (l + (u >>> 13) | 0) + (No >>> 26) | 0, No &= 67108863, _ = Math.imul(Ke, be), u = Math.imul(Ke, ge), u = u + Math.imul(b, be) | 0, l = Math.imul(b, ge), _ = _ + Math.imul(je, pe) | 0, u = u + Math.imul(je, Qe) | 0, u = u + Math.imul(qe, pe) | 0, l = l + Math.imul(qe, Qe) | 0, _ = _ + Math.imul(Fe, et) | 0, u = u + Math.imul(Fe, tt) | 0, u = u + Math.imul(Le, et) | 0, l = l + Math.imul(Le, tt) | 0, _ = _ + Math.imul(Ue, nt) | 0, u = u + Math.imul(Ue, rt) | 0, u = u + Math.imul(ze, nt) | 0, l = l + Math.imul(ze, rt) | 0, _ = _ + Math.imul(Re, st) | 0, u = u + Math.imul(Re, it) | 0, u = u + Math.imul(Oe, st) | 0, l = l + Math.imul(Oe, it) | 0, _ = _ + Math.imul(ve, ot) | 0, u = u + Math.imul(ve, at) | 0, u = u + Math.imul(we, ot) | 0, l = l + Math.imul(we, at) | 0, _ = _ + Math.imul(se, ct) | 0, u = u + Math.imul(se, ut) | 0, u = u + Math.imul(ae, ct) | 0, l = l + Math.imul(ae, ut) | 0, _ = _ + Math.imul(T, dt) | 0, u = u + Math.imul(T, lt) | 0, u = u + Math.imul(P, dt) | 0, l = l + Math.imul(P, lt) | 0;
|
|
12355
12355
|
var Co = (O + _ | 0) + ((u & 8191) << 13) | 0;
|
|
12356
|
-
O = (l + (u >>> 13) | 0) + (Co >>> 26) | 0, Co &= 67108863, _ = Math.imul(h, be), u = Math.imul(h, ge), u = u + Math.imul(x, be) | 0, l = Math.imul(x, ge), _ = _ + Math.imul(Ke, pe) | 0, u = u + Math.imul(Ke, Qe) | 0, u = u + Math.imul(b, pe) | 0, l = l + Math.imul(b, Qe) | 0, _ = _ + Math.imul(je, et) | 0, u = u + Math.imul(je, tt) | 0, u = u + Math.imul(qe, et) | 0, l = l + Math.imul(qe, tt) | 0, _ = _ + Math.imul(Fe, nt) | 0, u = u + Math.imul(Fe, rt) | 0, u = u + Math.imul(Le, nt) | 0, l = l + Math.imul(Le, rt) | 0, _ = _ + Math.imul(Ue, st) | 0, u = u + Math.imul(Ue, it) | 0, u = u + Math.imul(ze, st) | 0, l = l + Math.imul(ze, it) | 0, _ = _ + Math.imul(Re, ot) | 0, u = u + Math.imul(Re, at) | 0, u = u + Math.imul(Oe, ot) | 0, l = l + Math.imul(Oe, at) | 0, _ = _ + Math.imul(ve, ct) | 0, u = u + Math.imul(ve, ut) | 0, u = u + Math.imul(we, ct) | 0, l = l + Math.imul(we, ut) | 0, _ = _ + Math.imul(se, dt) | 0, u = u + Math.imul(se, lt) | 0, u = u + Math.imul(ae, dt) | 0, l = l + Math.imul(ae, lt) | 0, _ = _ + Math.imul(T, ft) | 0, u = u + Math.imul(T, ht) | 0, u = u + Math.imul(
|
|
12356
|
+
O = (l + (u >>> 13) | 0) + (Co >>> 26) | 0, Co &= 67108863, _ = Math.imul(h, be), u = Math.imul(h, ge), u = u + Math.imul(x, be) | 0, l = Math.imul(x, ge), _ = _ + Math.imul(Ke, pe) | 0, u = u + Math.imul(Ke, Qe) | 0, u = u + Math.imul(b, pe) | 0, l = l + Math.imul(b, Qe) | 0, _ = _ + Math.imul(je, et) | 0, u = u + Math.imul(je, tt) | 0, u = u + Math.imul(qe, et) | 0, l = l + Math.imul(qe, tt) | 0, _ = _ + Math.imul(Fe, nt) | 0, u = u + Math.imul(Fe, rt) | 0, u = u + Math.imul(Le, nt) | 0, l = l + Math.imul(Le, rt) | 0, _ = _ + Math.imul(Ue, st) | 0, u = u + Math.imul(Ue, it) | 0, u = u + Math.imul(ze, st) | 0, l = l + Math.imul(ze, it) | 0, _ = _ + Math.imul(Re, ot) | 0, u = u + Math.imul(Re, at) | 0, u = u + Math.imul(Oe, ot) | 0, l = l + Math.imul(Oe, at) | 0, _ = _ + Math.imul(ve, ct) | 0, u = u + Math.imul(ve, ut) | 0, u = u + Math.imul(we, ct) | 0, l = l + Math.imul(we, ut) | 0, _ = _ + Math.imul(se, dt) | 0, u = u + Math.imul(se, lt) | 0, u = u + Math.imul(ae, dt) | 0, l = l + Math.imul(ae, lt) | 0, _ = _ + Math.imul(T, ft) | 0, u = u + Math.imul(T, ht) | 0, u = u + Math.imul(P, ft) | 0, l = l + Math.imul(P, ht) | 0;
|
|
12357
12357
|
var Mo = (O + _ | 0) + ((u & 8191) << 13) | 0;
|
|
12358
|
-
O = (l + (u >>> 13) | 0) + (Mo >>> 26) | 0, Mo &= 67108863, _ = Math.imul($, be), u = Math.imul($, ge), u = u + Math.imul(Z, be) | 0, l = Math.imul(Z, ge), _ = _ + Math.imul(h, pe) | 0, u = u + Math.imul(h, Qe) | 0, u = u + Math.imul(x, pe) | 0, l = l + Math.imul(x, Qe) | 0, _ = _ + Math.imul(Ke, et) | 0, u = u + Math.imul(Ke, tt) | 0, u = u + Math.imul(b, et) | 0, l = l + Math.imul(b, tt) | 0, _ = _ + Math.imul(je, nt) | 0, u = u + Math.imul(je, rt) | 0, u = u + Math.imul(qe, nt) | 0, l = l + Math.imul(qe, rt) | 0, _ = _ + Math.imul(Fe, st) | 0, u = u + Math.imul(Fe, it) | 0, u = u + Math.imul(Le, st) | 0, l = l + Math.imul(Le, it) | 0, _ = _ + Math.imul(Ue, ot) | 0, u = u + Math.imul(Ue, at) | 0, u = u + Math.imul(ze, ot) | 0, l = l + Math.imul(ze, at) | 0, _ = _ + Math.imul(Re, ct) | 0, u = u + Math.imul(Re, ut) | 0, u = u + Math.imul(Oe, ct) | 0, l = l + Math.imul(Oe, ut) | 0, _ = _ + Math.imul(ve, dt) | 0, u = u + Math.imul(ve, lt) | 0, u = u + Math.imul(we, dt) | 0, l = l + Math.imul(we, lt) | 0, _ = _ + Math.imul(se, ft) | 0, u = u + Math.imul(se, ht) | 0, u = u + Math.imul(ae, ft) | 0, l = l + Math.imul(ae, ht) | 0, _ = _ + Math.imul(T, pt) | 0, u = u + Math.imul(T, mt) | 0, u = u + Math.imul(
|
|
12358
|
+
O = (l + (u >>> 13) | 0) + (Mo >>> 26) | 0, Mo &= 67108863, _ = Math.imul($, be), u = Math.imul($, ge), u = u + Math.imul(Z, be) | 0, l = Math.imul(Z, ge), _ = _ + Math.imul(h, pe) | 0, u = u + Math.imul(h, Qe) | 0, u = u + Math.imul(x, pe) | 0, l = l + Math.imul(x, Qe) | 0, _ = _ + Math.imul(Ke, et) | 0, u = u + Math.imul(Ke, tt) | 0, u = u + Math.imul(b, et) | 0, l = l + Math.imul(b, tt) | 0, _ = _ + Math.imul(je, nt) | 0, u = u + Math.imul(je, rt) | 0, u = u + Math.imul(qe, nt) | 0, l = l + Math.imul(qe, rt) | 0, _ = _ + Math.imul(Fe, st) | 0, u = u + Math.imul(Fe, it) | 0, u = u + Math.imul(Le, st) | 0, l = l + Math.imul(Le, it) | 0, _ = _ + Math.imul(Ue, ot) | 0, u = u + Math.imul(Ue, at) | 0, u = u + Math.imul(ze, ot) | 0, l = l + Math.imul(ze, at) | 0, _ = _ + Math.imul(Re, ct) | 0, u = u + Math.imul(Re, ut) | 0, u = u + Math.imul(Oe, ct) | 0, l = l + Math.imul(Oe, ut) | 0, _ = _ + Math.imul(ve, dt) | 0, u = u + Math.imul(ve, lt) | 0, u = u + Math.imul(we, dt) | 0, l = l + Math.imul(we, lt) | 0, _ = _ + Math.imul(se, ft) | 0, u = u + Math.imul(se, ht) | 0, u = u + Math.imul(ae, ft) | 0, l = l + Math.imul(ae, ht) | 0, _ = _ + Math.imul(T, pt) | 0, u = u + Math.imul(T, mt) | 0, u = u + Math.imul(P, pt) | 0, l = l + Math.imul(P, mt) | 0;
|
|
12359
12359
|
var Bo = (O + _ | 0) + ((u & 8191) << 13) | 0;
|
|
12360
12360
|
O = (l + (u >>> 13) | 0) + (Bo >>> 26) | 0, Bo &= 67108863, _ = Math.imul($, pe), u = Math.imul($, Qe), u = u + Math.imul(Z, pe) | 0, l = Math.imul(Z, Qe), _ = _ + Math.imul(h, et) | 0, u = u + Math.imul(h, tt) | 0, u = u + Math.imul(x, et) | 0, l = l + Math.imul(x, tt) | 0, _ = _ + Math.imul(Ke, nt) | 0, u = u + Math.imul(Ke, rt) | 0, u = u + Math.imul(b, nt) | 0, l = l + Math.imul(b, rt) | 0, _ = _ + Math.imul(je, st) | 0, u = u + Math.imul(je, it) | 0, u = u + Math.imul(qe, st) | 0, l = l + Math.imul(qe, it) | 0, _ = _ + Math.imul(Fe, ot) | 0, u = u + Math.imul(Fe, at) | 0, u = u + Math.imul(Le, ot) | 0, l = l + Math.imul(Le, at) | 0, _ = _ + Math.imul(Ue, ct) | 0, u = u + Math.imul(Ue, ut) | 0, u = u + Math.imul(ze, ct) | 0, l = l + Math.imul(ze, ut) | 0, _ = _ + Math.imul(Re, dt) | 0, u = u + Math.imul(Re, lt) | 0, u = u + Math.imul(Oe, dt) | 0, l = l + Math.imul(Oe, lt) | 0, _ = _ + Math.imul(ve, ft) | 0, u = u + Math.imul(ve, ht) | 0, u = u + Math.imul(we, ft) | 0, l = l + Math.imul(we, ht) | 0, _ = _ + Math.imul(se, pt) | 0, u = u + Math.imul(se, mt) | 0, u = u + Math.imul(ae, pt) | 0, l = l + Math.imul(ae, mt) | 0;
|
|
12361
12361
|
var ko = (O + _ | 0) + ((u & 8191) << 13) | 0;
|
|
@@ -12378,25 +12378,25 @@ function _h() {
|
|
|
12378
12378
|
return O = (l + (u >>> 13) | 0) + (jo >>> 26) | 0, jo &= 67108863, R[0] = Ao, R[1] = So, R[2] = xo, R[3] = To, R[4] = Io, R[5] = Oo, R[6] = No, R[7] = Co, R[8] = Mo, R[9] = Bo, R[10] = ko, R[11] = Uo, R[12] = Lo, R[13] = Do, R[14] = Po, R[15] = Fo, R[16] = $o, R[17] = zo, R[18] = jo, O !== 0 && (R[19] = O, y.length++), y;
|
|
12379
12379
|
};
|
|
12380
12380
|
Math.imul || (Y = K);
|
|
12381
|
-
function
|
|
12381
|
+
function z(w, c, p) {
|
|
12382
12382
|
p.negative = c.negative ^ w.negative, p.length = w.length + c.length;
|
|
12383
12383
|
for (var y = 0, A = 0, v = 0; v < p.length - 1; v++) {
|
|
12384
12384
|
var R = A;
|
|
12385
12385
|
A = 0;
|
|
12386
12386
|
for (var O = y & 67108863, _ = Math.min(v, c.length - 1), u = Math.max(0, v - w.length + 1); u <= _; u++) {
|
|
12387
|
-
var l = v - u, E = w.words[l] | 0, T = c.words[u] | 0,
|
|
12388
|
-
R = R + (
|
|
12387
|
+
var l = v - u, E = w.words[l] | 0, T = c.words[u] | 0, P = E * T, W = P & 67108863;
|
|
12388
|
+
R = R + (P / 67108864 | 0) | 0, W = W + O | 0, O = W & 67108863, R = R + (W >>> 26) | 0, A += R >>> 26, R &= 67108863;
|
|
12389
12389
|
}
|
|
12390
12390
|
p.words[v] = O, y = R, R = A;
|
|
12391
12391
|
}
|
|
12392
12392
|
return y !== 0 ? p.words[v] = y : p.length--, p._strip();
|
|
12393
12393
|
}
|
|
12394
12394
|
function U(w, c, p) {
|
|
12395
|
-
return
|
|
12395
|
+
return z(w, c, p);
|
|
12396
12396
|
}
|
|
12397
12397
|
i.prototype.mulTo = function(c, p) {
|
|
12398
12398
|
var y, A = this.length + c.length;
|
|
12399
|
-
return this.length === 10 && c.length === 10 ? y = Y(this, c, p) : A < 63 ? y = K(this, c, p) : A < 1024 ? y =
|
|
12399
|
+
return this.length === 10 && c.length === 10 ? y = Y(this, c, p) : A < 63 ? y = K(this, c, p) : A < 1024 ? y = z(this, c, p) : y = U(this, c, p), y;
|
|
12400
12400
|
}, i.prototype.mul = function(c) {
|
|
12401
12401
|
var p = new i(null);
|
|
12402
12402
|
return p.words = new Array(this.length + c.length), this.mulTo(c, p);
|
|
@@ -12550,10 +12550,10 @@ function _h() {
|
|
|
12550
12550
|
var E = A.clone()._ishlnsubmul(v, 1, _);
|
|
12551
12551
|
E.negative === 0 && (A = E, u && (u.words[_] = 1));
|
|
12552
12552
|
for (var T = _ - 1; T >= 0; T--) {
|
|
12553
|
-
var
|
|
12554
|
-
for (
|
|
12555
|
-
|
|
12556
|
-
u && (u.words[T] =
|
|
12553
|
+
var P = (A.words[v.length + T] | 0) * 67108864 + (A.words[v.length + T - 1] | 0);
|
|
12554
|
+
for (P = Math.min(P / R | 0, 67108863), A._ishlnsubmul(v, P, T); A.negative !== 0; )
|
|
12555
|
+
P--, A.negative = 0, A._ishlnsubmul(v, 1, T), A.isZero() || (A.negative ^= 1);
|
|
12556
|
+
u && (u.words[T] = P);
|
|
12557
12557
|
}
|
|
12558
12558
|
return u && u._strip(), A._strip(), p !== "div" && y !== 0 && A.iushrn(y), {
|
|
12559
12559
|
div: u || null,
|
|
@@ -12628,9 +12628,9 @@ function _h() {
|
|
|
12628
12628
|
if (E > 0)
|
|
12629
12629
|
for (p.iushrn(E); E-- > 0; )
|
|
12630
12630
|
(A.isOdd() || v.isOdd()) && (A.iadd(u), v.isub(l)), A.iushrn(1), v.iushrn(1);
|
|
12631
|
-
for (var
|
|
12632
|
-
if (
|
|
12633
|
-
for (y.iushrn(
|
|
12631
|
+
for (var P = 0, W = 1; (y.words[0] & W) === 0 && P < 26; ++P, W <<= 1) ;
|
|
12632
|
+
if (P > 0)
|
|
12633
|
+
for (y.iushrn(P); P-- > 0; )
|
|
12634
12634
|
(R.isOdd() || O.isOdd()) && (R.iadd(u), O.isub(l)), R.iushrn(1), O.iushrn(1);
|
|
12635
12635
|
p.cmp(y) >= 0 ? (p.isub(y), A.isub(R), v.isub(O)) : (y.isub(p), R.isub(A), O.isub(v));
|
|
12636
12636
|
}
|
|
@@ -12748,7 +12748,7 @@ function _h() {
|
|
|
12748
12748
|
}, i.prototype.eq = function(c) {
|
|
12749
12749
|
return this.cmp(c) === 0;
|
|
12750
12750
|
}, i.red = function(c) {
|
|
12751
|
-
return new
|
|
12751
|
+
return new L(c);
|
|
12752
12752
|
}, i.prototype.toRed = function(c) {
|
|
12753
12753
|
return r(!this.red, "Already a number in reduction context"), r(this.negative === 0, "red works only with positives"), c.convertTo(this)._forceRed(c);
|
|
12754
12754
|
}, i.prototype.fromRed = function() {
|
|
@@ -12784,7 +12784,7 @@ function _h() {
|
|
|
12784
12784
|
}, i.prototype.redPow = function(c) {
|
|
12785
12785
|
return r(this.red && !c.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, c);
|
|
12786
12786
|
};
|
|
12787
|
-
var
|
|
12787
|
+
var j = {
|
|
12788
12788
|
k256: null,
|
|
12789
12789
|
p224: null,
|
|
12790
12790
|
p192: null,
|
|
@@ -12844,14 +12844,14 @@ function _h() {
|
|
|
12844
12844
|
);
|
|
12845
12845
|
}
|
|
12846
12846
|
s(te, J);
|
|
12847
|
-
function
|
|
12847
|
+
function V() {
|
|
12848
12848
|
J.call(
|
|
12849
12849
|
this,
|
|
12850
12850
|
"p192",
|
|
12851
12851
|
"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"
|
|
12852
12852
|
);
|
|
12853
12853
|
}
|
|
12854
|
-
s(
|
|
12854
|
+
s(V, J);
|
|
12855
12855
|
function C() {
|
|
12856
12856
|
J.call(
|
|
12857
12857
|
this,
|
|
@@ -12866,65 +12866,65 @@ function _h() {
|
|
|
12866
12866
|
}
|
|
12867
12867
|
return p !== 0 && (c.words[c.length++] = p), c;
|
|
12868
12868
|
}, i._prime = function(c) {
|
|
12869
|
-
if (
|
|
12869
|
+
if (j[c]) return j[c];
|
|
12870
12870
|
var p;
|
|
12871
12871
|
if (c === "k256")
|
|
12872
12872
|
p = new ne();
|
|
12873
12873
|
else if (c === "p224")
|
|
12874
12874
|
p = new te();
|
|
12875
12875
|
else if (c === "p192")
|
|
12876
|
-
p = new
|
|
12876
|
+
p = new V();
|
|
12877
12877
|
else if (c === "p25519")
|
|
12878
12878
|
p = new C();
|
|
12879
12879
|
else
|
|
12880
12880
|
throw new Error("Unknown prime " + c);
|
|
12881
|
-
return
|
|
12881
|
+
return j[c] = p, p;
|
|
12882
12882
|
};
|
|
12883
|
-
function
|
|
12883
|
+
function L(w) {
|
|
12884
12884
|
if (typeof w == "string") {
|
|
12885
12885
|
var c = i._prime(w);
|
|
12886
12886
|
this.m = c.p, this.prime = c;
|
|
12887
12887
|
} else
|
|
12888
12888
|
r(w.gtn(1), "modulus must be greater than 1"), this.m = w, this.prime = null;
|
|
12889
12889
|
}
|
|
12890
|
-
|
|
12890
|
+
L.prototype._verify1 = function(c) {
|
|
12891
12891
|
r(c.negative === 0, "red works only with positives"), r(c.red, "red works only with red numbers");
|
|
12892
|
-
},
|
|
12892
|
+
}, L.prototype._verify2 = function(c, p) {
|
|
12893
12893
|
r((c.negative | p.negative) === 0, "red works only with positives"), r(
|
|
12894
12894
|
c.red && c.red === p.red,
|
|
12895
12895
|
"red works only with red numbers"
|
|
12896
12896
|
);
|
|
12897
|
-
},
|
|
12897
|
+
}, L.prototype.imod = function(c) {
|
|
12898
12898
|
return this.prime ? this.prime.ireduce(c)._forceRed(this) : (g(c, c.umod(this.m)._forceRed(this)), c);
|
|
12899
|
-
},
|
|
12899
|
+
}, L.prototype.neg = function(c) {
|
|
12900
12900
|
return c.isZero() ? c.clone() : this.m.sub(c)._forceRed(this);
|
|
12901
|
-
},
|
|
12901
|
+
}, L.prototype.add = function(c, p) {
|
|
12902
12902
|
this._verify2(c, p);
|
|
12903
12903
|
var y = c.add(p);
|
|
12904
12904
|
return y.cmp(this.m) >= 0 && y.isub(this.m), y._forceRed(this);
|
|
12905
|
-
},
|
|
12905
|
+
}, L.prototype.iadd = function(c, p) {
|
|
12906
12906
|
this._verify2(c, p);
|
|
12907
12907
|
var y = c.iadd(p);
|
|
12908
12908
|
return y.cmp(this.m) >= 0 && y.isub(this.m), y;
|
|
12909
|
-
},
|
|
12909
|
+
}, L.prototype.sub = function(c, p) {
|
|
12910
12910
|
this._verify2(c, p);
|
|
12911
12911
|
var y = c.sub(p);
|
|
12912
12912
|
return y.cmpn(0) < 0 && y.iadd(this.m), y._forceRed(this);
|
|
12913
|
-
},
|
|
12913
|
+
}, L.prototype.isub = function(c, p) {
|
|
12914
12914
|
this._verify2(c, p);
|
|
12915
12915
|
var y = c.isub(p);
|
|
12916
12916
|
return y.cmpn(0) < 0 && y.iadd(this.m), y;
|
|
12917
|
-
},
|
|
12917
|
+
}, L.prototype.shl = function(c, p) {
|
|
12918
12918
|
return this._verify1(c), this.imod(c.ushln(p));
|
|
12919
|
-
},
|
|
12919
|
+
}, L.prototype.imul = function(c, p) {
|
|
12920
12920
|
return this._verify2(c, p), this.imod(c.imul(p));
|
|
12921
|
-
},
|
|
12921
|
+
}, L.prototype.mul = function(c, p) {
|
|
12922
12922
|
return this._verify2(c, p), this.imod(c.mul(p));
|
|
12923
|
-
},
|
|
12923
|
+
}, L.prototype.isqr = function(c) {
|
|
12924
12924
|
return this.imul(c, c.clone());
|
|
12925
|
-
},
|
|
12925
|
+
}, L.prototype.sqr = function(c) {
|
|
12926
12926
|
return this.mul(c, c);
|
|
12927
|
-
},
|
|
12927
|
+
}, L.prototype.sqrt = function(c) {
|
|
12928
12928
|
if (c.isZero()) return c.clone();
|
|
12929
12929
|
var p = this.m.andln(3);
|
|
12930
12930
|
if (r(p % 2 === 1), p === 3) {
|
|
@@ -12937,18 +12937,18 @@ function _h() {
|
|
|
12937
12937
|
var R = new i(1).toRed(this), O = R.redNeg(), _ = this.m.subn(1).iushrn(1), u = this.m.bitLength();
|
|
12938
12938
|
for (u = new i(2 * u * u).toRed(this); this.pow(u, _).cmp(O) !== 0; )
|
|
12939
12939
|
u.redIAdd(O);
|
|
12940
|
-
for (var l = this.pow(u, A), E = this.pow(c, A.addn(1).iushrn(1)), T = this.pow(c, A),
|
|
12940
|
+
for (var l = this.pow(u, A), E = this.pow(c, A.addn(1).iushrn(1)), T = this.pow(c, A), P = v; T.cmp(R) !== 0; ) {
|
|
12941
12941
|
for (var W = T, se = 0; W.cmp(R) !== 0; se++)
|
|
12942
12942
|
W = W.redSqr();
|
|
12943
|
-
r(se <
|
|
12944
|
-
var ae = this.pow(l, new i(1).iushln(
|
|
12945
|
-
E = E.redMul(ae), l = ae.redSqr(), T = T.redMul(l),
|
|
12943
|
+
r(se < P);
|
|
12944
|
+
var ae = this.pow(l, new i(1).iushln(P - se - 1));
|
|
12945
|
+
E = E.redMul(ae), l = ae.redSqr(), T = T.redMul(l), P = se;
|
|
12946
12946
|
}
|
|
12947
12947
|
return E;
|
|
12948
|
-
},
|
|
12948
|
+
}, L.prototype.invm = function(c) {
|
|
12949
12949
|
var p = c._invmp(this.m);
|
|
12950
12950
|
return p.negative !== 0 ? (p.negative = 0, this.imod(p).redNeg()) : this.imod(p);
|
|
12951
|
-
},
|
|
12951
|
+
}, L.prototype.pow = function(c, p) {
|
|
12952
12952
|
if (p.isZero()) return new i(1).toRed(this);
|
|
12953
12953
|
if (p.cmpn(1) === 0) return c.clone();
|
|
12954
12954
|
var y = 4, A = new Array(1 << y);
|
|
@@ -12968,33 +12968,33 @@ function _h() {
|
|
|
12968
12968
|
u = 26;
|
|
12969
12969
|
}
|
|
12970
12970
|
return R;
|
|
12971
|
-
},
|
|
12971
|
+
}, L.prototype.convertTo = function(c) {
|
|
12972
12972
|
var p = c.umod(this.m);
|
|
12973
12973
|
return p === c ? p.clone() : p;
|
|
12974
|
-
},
|
|
12974
|
+
}, L.prototype.convertFrom = function(c) {
|
|
12975
12975
|
var p = c.clone();
|
|
12976
12976
|
return p.red = null, p;
|
|
12977
12977
|
}, i.mont = function(c) {
|
|
12978
|
-
return new
|
|
12978
|
+
return new G(c);
|
|
12979
12979
|
};
|
|
12980
|
-
function
|
|
12981
|
-
|
|
12980
|
+
function G(w) {
|
|
12981
|
+
L.call(this, w), this.shift = this.m.bitLength(), this.shift % 26 !== 0 && (this.shift += 26 - this.shift % 26), this.r = new i(1).iushln(this.shift), this.r2 = this.imod(this.r.sqr()), this.rinv = this.r._invmp(this.m), this.minv = this.rinv.mul(this.r).isubn(1).div(this.m), this.minv = this.minv.umod(this.r), this.minv = this.r.sub(this.minv);
|
|
12982
12982
|
}
|
|
12983
|
-
s(
|
|
12983
|
+
s(G, L), G.prototype.convertTo = function(c) {
|
|
12984
12984
|
return this.imod(c.ushln(this.shift));
|
|
12985
|
-
},
|
|
12985
|
+
}, G.prototype.convertFrom = function(c) {
|
|
12986
12986
|
var p = this.imod(c.mul(this.rinv));
|
|
12987
12987
|
return p.red = null, p;
|
|
12988
|
-
},
|
|
12988
|
+
}, G.prototype.imul = function(c, p) {
|
|
12989
12989
|
if (c.isZero() || p.isZero())
|
|
12990
12990
|
return c.words[0] = 0, c.length = 1, c;
|
|
12991
12991
|
var y = c.imul(p), A = y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), v = y.isub(A).iushrn(this.shift), R = v;
|
|
12992
12992
|
return v.cmp(this.m) >= 0 ? R = v.isub(this.m) : v.cmpn(0) < 0 && (R = v.iadd(this.m)), R._forceRed(this);
|
|
12993
|
-
},
|
|
12993
|
+
}, G.prototype.mul = function(c, p) {
|
|
12994
12994
|
if (c.isZero() || p.isZero()) return new i(0)._forceRed(this);
|
|
12995
12995
|
var y = c.mul(p), A = y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), v = y.isub(A).iushrn(this.shift), R = v;
|
|
12996
12996
|
return v.cmp(this.m) >= 0 ? R = v.isub(this.m) : v.cmpn(0) < 0 && (R = v.iadd(this.m)), R._forceRed(this);
|
|
12997
|
-
},
|
|
12997
|
+
}, G.prototype.invm = function(c) {
|
|
12998
12998
|
var p = this.imod(c._invmp(this.m).mul(this.r2));
|
|
12999
12999
|
return p._forceRed(this);
|
|
13000
13000
|
};
|
|
@@ -13059,19 +13059,19 @@ function S_() {
|
|
|
13059
13059
|
throw new TypeError("Expected Buffer");
|
|
13060
13060
|
if (M.length === 0)
|
|
13061
13061
|
return "";
|
|
13062
|
-
for (var k = 0, K = 0, Y = 0,
|
|
13062
|
+
for (var k = 0, K = 0, Y = 0, z = M.length; Y !== z && M[Y] === 0; )
|
|
13063
13063
|
Y++, k++;
|
|
13064
|
-
for (var U = (
|
|
13064
|
+
for (var U = (z - Y) * S + 1 >>> 0, j = new Uint8Array(U); Y !== z; ) {
|
|
13065
13065
|
for (var J = M[Y], ne = 0, te = U - 1; (J !== 0 || ne < K) && te !== -1; te--, ne++)
|
|
13066
|
-
J += 256 *
|
|
13066
|
+
J += 256 * j[te] >>> 0, j[te] = J % d >>> 0, J = J / d >>> 0;
|
|
13067
13067
|
if (J !== 0)
|
|
13068
13068
|
throw new Error("Non-zero carry");
|
|
13069
13069
|
K = ne, Y++;
|
|
13070
13070
|
}
|
|
13071
|
-
for (var
|
|
13072
|
-
|
|
13073
|
-
for (var C = m.repeat(k);
|
|
13074
|
-
C += n.charAt(V
|
|
13071
|
+
for (var V = U - K; V !== U && j[V] === 0; )
|
|
13072
|
+
V++;
|
|
13073
|
+
for (var C = m.repeat(k); V < U; ++V)
|
|
13074
|
+
C += n.charAt(j[V]);
|
|
13075
13075
|
return C;
|
|
13076
13076
|
}
|
|
13077
13077
|
function N(M) {
|
|
@@ -13081,28 +13081,28 @@ function S_() {
|
|
|
13081
13081
|
return t.alloc(0);
|
|
13082
13082
|
for (var k = 0, K = 0, Y = 0; M[k] === m; )
|
|
13083
13083
|
K++, k++;
|
|
13084
|
-
for (var
|
|
13085
|
-
var
|
|
13086
|
-
if (
|
|
13084
|
+
for (var z = (M.length - k) * g + 1 >>> 0, U = new Uint8Array(z); k < M.length; ) {
|
|
13085
|
+
var j = M.charCodeAt(k);
|
|
13086
|
+
if (j > 255)
|
|
13087
13087
|
return;
|
|
13088
|
-
var J = r[
|
|
13088
|
+
var J = r[j];
|
|
13089
13089
|
if (J === 255)
|
|
13090
13090
|
return;
|
|
13091
|
-
for (var ne = 0, te =
|
|
13091
|
+
for (var ne = 0, te = z - 1; (J !== 0 || ne < Y) && te !== -1; te--, ne++)
|
|
13092
13092
|
J += d * U[te] >>> 0, U[te] = J % 256 >>> 0, J = J / 256 >>> 0;
|
|
13093
13093
|
if (J !== 0)
|
|
13094
13094
|
throw new Error("Non-zero carry");
|
|
13095
13095
|
Y = ne, k++;
|
|
13096
13096
|
}
|
|
13097
|
-
for (var
|
|
13098
|
-
|
|
13099
|
-
var C = t.allocUnsafe(K + (
|
|
13097
|
+
for (var V = z - Y; V !== z && U[V] === 0; )
|
|
13098
|
+
V++;
|
|
13099
|
+
var C = t.allocUnsafe(K + (z - V));
|
|
13100
13100
|
C.fill(0, 0, K);
|
|
13101
|
-
for (var
|
|
13102
|
-
C[
|
|
13101
|
+
for (var L = K; V !== z; )
|
|
13102
|
+
C[L++] = U[V++];
|
|
13103
13103
|
return C;
|
|
13104
13104
|
}
|
|
13105
|
-
function
|
|
13105
|
+
function F(M) {
|
|
13106
13106
|
var k = N(M);
|
|
13107
13107
|
if (k)
|
|
13108
13108
|
return k;
|
|
@@ -13111,7 +13111,7 @@ function S_() {
|
|
|
13111
13111
|
return {
|
|
13112
13112
|
encode: I,
|
|
13113
13113
|
decodeUnsafe: N,
|
|
13114
|
-
decode:
|
|
13114
|
+
decode: F
|
|
13115
13115
|
};
|
|
13116
13116
|
}
|
|
13117
13117
|
return pa = e, pa;
|
|
@@ -13356,37 +13356,37 @@ var Hd;
|
|
|
13356
13356
|
function B_() {
|
|
13357
13357
|
if (Hd) return Be;
|
|
13358
13358
|
Hd = 1;
|
|
13359
|
-
var t = Be && Be.__createBinding || (Object.create ? (function(
|
|
13360
|
-
|
|
13361
|
-
return C[
|
|
13359
|
+
var t = Be && Be.__createBinding || (Object.create ? (function(V, C, L, G) {
|
|
13360
|
+
G === void 0 && (G = L), Object.defineProperty(V, G, { enumerable: !0, get: function() {
|
|
13361
|
+
return C[L];
|
|
13362
13362
|
} });
|
|
13363
|
-
}) : (function(
|
|
13364
|
-
|
|
13365
|
-
})), e = Be && Be.__setModuleDefault || (Object.create ? (function(
|
|
13366
|
-
Object.defineProperty(
|
|
13367
|
-
}) : function(
|
|
13368
|
-
|
|
13369
|
-
}), n = Be && Be.__decorate || function(
|
|
13370
|
-
var w = arguments.length, c = w < 3 ? C :
|
|
13371
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") c = Reflect.decorate(
|
|
13372
|
-
else for (var y =
|
|
13373
|
-
return w > 3 && c && Object.defineProperty(C,
|
|
13374
|
-
}, r = Be && Be.__importStar || function(
|
|
13375
|
-
if (
|
|
13363
|
+
}) : (function(V, C, L, G) {
|
|
13364
|
+
G === void 0 && (G = L), V[G] = C[L];
|
|
13365
|
+
})), e = Be && Be.__setModuleDefault || (Object.create ? (function(V, C) {
|
|
13366
|
+
Object.defineProperty(V, "default", { enumerable: !0, value: C });
|
|
13367
|
+
}) : function(V, C) {
|
|
13368
|
+
V.default = C;
|
|
13369
|
+
}), n = Be && Be.__decorate || function(V, C, L, G) {
|
|
13370
|
+
var w = arguments.length, c = w < 3 ? C : G === null ? G = Object.getOwnPropertyDescriptor(C, L) : G, p;
|
|
13371
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") c = Reflect.decorate(V, C, L, G);
|
|
13372
|
+
else for (var y = V.length - 1; y >= 0; y--) (p = V[y]) && (c = (w < 3 ? p(c) : w > 3 ? p(C, L, c) : p(C, L)) || c);
|
|
13373
|
+
return w > 3 && c && Object.defineProperty(C, L, c), c;
|
|
13374
|
+
}, r = Be && Be.__importStar || function(V) {
|
|
13375
|
+
if (V && V.__esModule) return V;
|
|
13376
13376
|
var C = {};
|
|
13377
|
-
if (
|
|
13378
|
-
return e(C,
|
|
13379
|
-
}, s = Be && Be.__importDefault || function(
|
|
13380
|
-
return
|
|
13377
|
+
if (V != null) for (var L in V) L !== "default" && Object.hasOwnProperty.call(V, L) && t(C, V, L);
|
|
13378
|
+
return e(C, V), C;
|
|
13379
|
+
}, s = Be && Be.__importDefault || function(V) {
|
|
13380
|
+
return V && V.__esModule ? V : { default: V };
|
|
13381
13381
|
};
|
|
13382
13382
|
Object.defineProperty(Be, "__esModule", { value: !0 }), Be.deserializeUnchecked = Be.deserialize = Be.serialize = Be.BinaryReader = Be.BinaryWriter = Be.BorshError = Be.baseDecode = Be.baseEncode = void 0;
|
|
13383
13383
|
const i = s(_h()), o = s(Eh()), a = r(M_), d = typeof TextDecoder != "function" ? a.TextDecoder : TextDecoder, m = new d("utf-8", { fatal: !0 });
|
|
13384
|
-
function g(
|
|
13385
|
-
return typeof
|
|
13384
|
+
function g(V) {
|
|
13385
|
+
return typeof V == "string" && (V = Buffer.from(V, "utf8")), o.default.encode(Buffer.from(V));
|
|
13386
13386
|
}
|
|
13387
13387
|
Be.baseEncode = g;
|
|
13388
|
-
function S(
|
|
13389
|
-
return Buffer.from(o.default.decode(
|
|
13388
|
+
function S(V) {
|
|
13389
|
+
return Buffer.from(o.default.decode(V));
|
|
13390
13390
|
}
|
|
13391
13391
|
Be.baseDecode = S;
|
|
13392
13392
|
const I = 1024;
|
|
@@ -13399,7 +13399,7 @@ function B_() {
|
|
|
13399
13399
|
}
|
|
13400
13400
|
}
|
|
13401
13401
|
Be.BorshError = N;
|
|
13402
|
-
class
|
|
13402
|
+
class F {
|
|
13403
13403
|
constructor() {
|
|
13404
13404
|
this.buf = Buffer.alloc(I), this.length = 0;
|
|
13405
13405
|
}
|
|
@@ -13436,27 +13436,27 @@ function B_() {
|
|
|
13436
13436
|
}
|
|
13437
13437
|
writeString(C) {
|
|
13438
13438
|
this.maybeResize();
|
|
13439
|
-
const
|
|
13440
|
-
this.writeU32(
|
|
13439
|
+
const L = Buffer.from(C, "utf8");
|
|
13440
|
+
this.writeU32(L.length), this.writeBuffer(L);
|
|
13441
13441
|
}
|
|
13442
13442
|
writeFixedArray(C) {
|
|
13443
13443
|
this.writeBuffer(Buffer.from(C));
|
|
13444
13444
|
}
|
|
13445
|
-
writeArray(C,
|
|
13445
|
+
writeArray(C, L) {
|
|
13446
13446
|
this.maybeResize(), this.writeU32(C.length);
|
|
13447
|
-
for (const
|
|
13448
|
-
this.maybeResize(),
|
|
13447
|
+
for (const G of C)
|
|
13448
|
+
this.maybeResize(), L(G);
|
|
13449
13449
|
}
|
|
13450
13450
|
toArray() {
|
|
13451
13451
|
return this.buf.subarray(0, this.length);
|
|
13452
13452
|
}
|
|
13453
13453
|
}
|
|
13454
|
-
Be.BinaryWriter =
|
|
13455
|
-
function M(
|
|
13456
|
-
const
|
|
13457
|
-
|
|
13454
|
+
Be.BinaryWriter = F;
|
|
13455
|
+
function M(V, C, L) {
|
|
13456
|
+
const G = L.value;
|
|
13457
|
+
L.value = function(...w) {
|
|
13458
13458
|
try {
|
|
13459
|
-
return
|
|
13459
|
+
return G.apply(this, w);
|
|
13460
13460
|
} catch (c) {
|
|
13461
13461
|
if (c instanceof RangeError) {
|
|
13462
13462
|
const p = c.code;
|
|
@@ -13502,25 +13502,25 @@ function B_() {
|
|
|
13502
13502
|
readBuffer(C) {
|
|
13503
13503
|
if (this.offset + C > this.buf.length)
|
|
13504
13504
|
throw new N(`Expected buffer length ${C} isn't within bounds`);
|
|
13505
|
-
const
|
|
13506
|
-
return this.offset += C,
|
|
13505
|
+
const L = this.buf.slice(this.offset, this.offset + C);
|
|
13506
|
+
return this.offset += C, L;
|
|
13507
13507
|
}
|
|
13508
13508
|
readString() {
|
|
13509
|
-
const C = this.readU32(),
|
|
13509
|
+
const C = this.readU32(), L = this.readBuffer(C);
|
|
13510
13510
|
try {
|
|
13511
|
-
return m.decode(
|
|
13512
|
-
} catch (
|
|
13513
|
-
throw new N(`Error decoding UTF-8 string: ${
|
|
13511
|
+
return m.decode(L);
|
|
13512
|
+
} catch (G) {
|
|
13513
|
+
throw new N(`Error decoding UTF-8 string: ${G}`);
|
|
13514
13514
|
}
|
|
13515
13515
|
}
|
|
13516
13516
|
readFixedArray(C) {
|
|
13517
13517
|
return new Uint8Array(this.readBuffer(C));
|
|
13518
13518
|
}
|
|
13519
13519
|
readArray(C) {
|
|
13520
|
-
const
|
|
13521
|
-
for (let w = 0; w <
|
|
13522
|
-
|
|
13523
|
-
return
|
|
13520
|
+
const L = this.readU32(), G = Array();
|
|
13521
|
+
for (let w = 0; w < L; ++w)
|
|
13522
|
+
G.push(C());
|
|
13523
|
+
return G;
|
|
13524
13524
|
}
|
|
13525
13525
|
}
|
|
13526
13526
|
n([
|
|
@@ -13544,156 +13544,156 @@ function B_() {
|
|
|
13544
13544
|
], k.prototype, "readFixedArray", null), n([
|
|
13545
13545
|
M
|
|
13546
13546
|
], k.prototype, "readArray", null), Be.BinaryReader = k;
|
|
13547
|
-
function K(
|
|
13548
|
-
return
|
|
13547
|
+
function K(V) {
|
|
13548
|
+
return V.charAt(0).toUpperCase() + V.slice(1);
|
|
13549
13549
|
}
|
|
13550
|
-
function Y(
|
|
13550
|
+
function Y(V, C, L, G, w) {
|
|
13551
13551
|
try {
|
|
13552
|
-
if (typeof
|
|
13553
|
-
w[`write${K(
|
|
13554
|
-
else if (
|
|
13555
|
-
if (typeof
|
|
13556
|
-
if (
|
|
13557
|
-
throw new N(`Expecting byte array of length ${
|
|
13558
|
-
w.writeFixedArray(
|
|
13559
|
-
} else if (
|
|
13560
|
-
if (
|
|
13561
|
-
throw new N(`Expecting byte array of length ${
|
|
13562
|
-
for (let c = 0; c <
|
|
13563
|
-
Y(
|
|
13552
|
+
if (typeof G == "string")
|
|
13553
|
+
w[`write${K(G)}`](L);
|
|
13554
|
+
else if (G instanceof Array)
|
|
13555
|
+
if (typeof G[0] == "number") {
|
|
13556
|
+
if (L.length !== G[0])
|
|
13557
|
+
throw new N(`Expecting byte array of length ${G[0]}, but got ${L.length} bytes`);
|
|
13558
|
+
w.writeFixedArray(L);
|
|
13559
|
+
} else if (G.length === 2 && typeof G[1] == "number") {
|
|
13560
|
+
if (L.length !== G[1])
|
|
13561
|
+
throw new N(`Expecting byte array of length ${G[1]}, but got ${L.length} bytes`);
|
|
13562
|
+
for (let c = 0; c < G[1]; c++)
|
|
13563
|
+
Y(V, null, L[c], G[0], w);
|
|
13564
13564
|
} else
|
|
13565
|
-
w.writeArray(
|
|
13566
|
-
Y(
|
|
13565
|
+
w.writeArray(L, (c) => {
|
|
13566
|
+
Y(V, C, c, G[0], w);
|
|
13567
13567
|
});
|
|
13568
|
-
else if (
|
|
13569
|
-
switch (
|
|
13568
|
+
else if (G.kind !== void 0)
|
|
13569
|
+
switch (G.kind) {
|
|
13570
13570
|
case "option": {
|
|
13571
|
-
|
|
13571
|
+
L == null ? w.writeU8(0) : (w.writeU8(1), Y(V, C, L, G.type, w));
|
|
13572
13572
|
break;
|
|
13573
13573
|
}
|
|
13574
13574
|
case "map": {
|
|
13575
|
-
w.writeU32(
|
|
13576
|
-
Y(
|
|
13575
|
+
w.writeU32(L.size), L.forEach((c, p) => {
|
|
13576
|
+
Y(V, C, p, G.key, w), Y(V, C, c, G.value, w);
|
|
13577
13577
|
});
|
|
13578
13578
|
break;
|
|
13579
13579
|
}
|
|
13580
13580
|
default:
|
|
13581
|
-
throw new N(`FieldType ${
|
|
13581
|
+
throw new N(`FieldType ${G} unrecognized`);
|
|
13582
13582
|
}
|
|
13583
13583
|
else
|
|
13584
|
-
|
|
13584
|
+
z(V, L, w);
|
|
13585
13585
|
} catch (c) {
|
|
13586
13586
|
throw c instanceof N && c.addToFieldPath(C), c;
|
|
13587
13587
|
}
|
|
13588
13588
|
}
|
|
13589
|
-
function
|
|
13589
|
+
function z(V, C, L) {
|
|
13590
13590
|
if (typeof C.borshSerialize == "function") {
|
|
13591
|
-
C.borshSerialize(
|
|
13591
|
+
C.borshSerialize(L);
|
|
13592
13592
|
return;
|
|
13593
13593
|
}
|
|
13594
|
-
const
|
|
13595
|
-
if (!
|
|
13594
|
+
const G = V.get(C.constructor);
|
|
13595
|
+
if (!G)
|
|
13596
13596
|
throw new N(`Class ${C.constructor.name} is missing in schema`);
|
|
13597
|
-
if (
|
|
13598
|
-
|
|
13599
|
-
Y(
|
|
13597
|
+
if (G.kind === "struct")
|
|
13598
|
+
G.fields.map(([w, c]) => {
|
|
13599
|
+
Y(V, w, C[w], c, L);
|
|
13600
13600
|
});
|
|
13601
|
-
else if (
|
|
13602
|
-
const w = C[
|
|
13603
|
-
for (let c = 0; c <
|
|
13604
|
-
const [p, y] =
|
|
13601
|
+
else if (G.kind === "enum") {
|
|
13602
|
+
const w = C[G.field];
|
|
13603
|
+
for (let c = 0; c < G.values.length; ++c) {
|
|
13604
|
+
const [p, y] = G.values[c];
|
|
13605
13605
|
if (p === w) {
|
|
13606
|
-
|
|
13606
|
+
L.writeU8(c), Y(V, p, C[p], y, L);
|
|
13607
13607
|
break;
|
|
13608
13608
|
}
|
|
13609
13609
|
}
|
|
13610
13610
|
} else
|
|
13611
|
-
throw new N(`Unexpected schema kind: ${
|
|
13611
|
+
throw new N(`Unexpected schema kind: ${G.kind} for ${C.constructor.name}`);
|
|
13612
13612
|
}
|
|
13613
|
-
function U(
|
|
13614
|
-
const
|
|
13615
|
-
return
|
|
13613
|
+
function U(V, C, L = F) {
|
|
13614
|
+
const G = new L();
|
|
13615
|
+
return z(V, C, G), G.toArray();
|
|
13616
13616
|
}
|
|
13617
13617
|
Be.serialize = U;
|
|
13618
|
-
function V
|
|
13618
|
+
function j(V, C, L, G) {
|
|
13619
13619
|
try {
|
|
13620
|
-
if (typeof
|
|
13621
|
-
return
|
|
13622
|
-
if (
|
|
13623
|
-
if (typeof
|
|
13624
|
-
return
|
|
13625
|
-
if (typeof
|
|
13620
|
+
if (typeof L == "string")
|
|
13621
|
+
return G[`read${K(L)}`]();
|
|
13622
|
+
if (L instanceof Array) {
|
|
13623
|
+
if (typeof L[0] == "number")
|
|
13624
|
+
return G.readFixedArray(L[0]);
|
|
13625
|
+
if (typeof L[1] == "number") {
|
|
13626
13626
|
const w = [];
|
|
13627
|
-
for (let c = 0; c <
|
|
13628
|
-
w.push(V
|
|
13627
|
+
for (let c = 0; c < L[1]; c++)
|
|
13628
|
+
w.push(j(V, null, L[0], G));
|
|
13629
13629
|
return w;
|
|
13630
13630
|
} else
|
|
13631
|
-
return
|
|
13631
|
+
return G.readArray(() => j(V, C, L[0], G));
|
|
13632
13632
|
}
|
|
13633
|
-
if (
|
|
13634
|
-
return
|
|
13635
|
-
if (
|
|
13633
|
+
if (L.kind === "option")
|
|
13634
|
+
return G.readU8() ? j(V, C, L.type, G) : void 0;
|
|
13635
|
+
if (L.kind === "map") {
|
|
13636
13636
|
let w = /* @__PURE__ */ new Map();
|
|
13637
|
-
const c =
|
|
13637
|
+
const c = G.readU32();
|
|
13638
13638
|
for (let p = 0; p < c; p++) {
|
|
13639
|
-
const y = V
|
|
13639
|
+
const y = j(V, C, L.key, G), A = j(V, C, L.value, G);
|
|
13640
13640
|
w.set(y, A);
|
|
13641
13641
|
}
|
|
13642
13642
|
return w;
|
|
13643
13643
|
}
|
|
13644
|
-
return J(
|
|
13644
|
+
return J(V, L, G);
|
|
13645
13645
|
} catch (w) {
|
|
13646
13646
|
throw w instanceof N && w.addToFieldPath(C), w;
|
|
13647
13647
|
}
|
|
13648
13648
|
}
|
|
13649
|
-
function J(
|
|
13649
|
+
function J(V, C, L) {
|
|
13650
13650
|
if (typeof C.borshDeserialize == "function")
|
|
13651
|
-
return C.borshDeserialize(
|
|
13652
|
-
const
|
|
13653
|
-
if (!
|
|
13651
|
+
return C.borshDeserialize(L);
|
|
13652
|
+
const G = V.get(C);
|
|
13653
|
+
if (!G)
|
|
13654
13654
|
throw new N(`Class ${C.name} is missing in schema`);
|
|
13655
|
-
if (
|
|
13655
|
+
if (G.kind === "struct") {
|
|
13656
13656
|
const w = {};
|
|
13657
|
-
for (const [c, p] of
|
|
13658
|
-
w[c] = V
|
|
13657
|
+
for (const [c, p] of V.get(C).fields)
|
|
13658
|
+
w[c] = j(V, c, p, L);
|
|
13659
13659
|
return new C(w);
|
|
13660
13660
|
}
|
|
13661
|
-
if (
|
|
13662
|
-
const w =
|
|
13663
|
-
if (w >=
|
|
13661
|
+
if (G.kind === "enum") {
|
|
13662
|
+
const w = L.readU8();
|
|
13663
|
+
if (w >= G.values.length)
|
|
13664
13664
|
throw new N(`Enum index: ${w} is out of range`);
|
|
13665
|
-
const [c, p] =
|
|
13665
|
+
const [c, p] = G.values[w], y = j(V, c, p, L);
|
|
13666
13666
|
return new C({ [c]: y });
|
|
13667
13667
|
}
|
|
13668
|
-
throw new N(`Unexpected schema kind: ${
|
|
13668
|
+
throw new N(`Unexpected schema kind: ${G.kind} for ${C.constructor.name}`);
|
|
13669
13669
|
}
|
|
13670
|
-
function ne(
|
|
13671
|
-
const w = new
|
|
13672
|
-
if (w.offset <
|
|
13673
|
-
throw new N(`Unexpected ${
|
|
13670
|
+
function ne(V, C, L, G = k) {
|
|
13671
|
+
const w = new G(L), c = J(V, C, w);
|
|
13672
|
+
if (w.offset < L.length)
|
|
13673
|
+
throw new N(`Unexpected ${L.length - w.offset} bytes after deserialized data`);
|
|
13674
13674
|
return c;
|
|
13675
13675
|
}
|
|
13676
13676
|
Be.deserialize = ne;
|
|
13677
|
-
function te(
|
|
13678
|
-
const w = new
|
|
13679
|
-
return J(
|
|
13677
|
+
function te(V, C, L, G = k) {
|
|
13678
|
+
const w = new G(L);
|
|
13679
|
+
return J(V, C, w);
|
|
13680
13680
|
}
|
|
13681
13681
|
return Be.deserializeUnchecked = te, Be;
|
|
13682
13682
|
}
|
|
13683
|
-
var ya = B_(),
|
|
13683
|
+
var ya = B_(), q = {}, Gd;
|
|
13684
13684
|
function k_() {
|
|
13685
|
-
if (Gd) return
|
|
13686
|
-
Gd = 1, Object.defineProperty(
|
|
13685
|
+
if (Gd) return q;
|
|
13686
|
+
Gd = 1, Object.defineProperty(q, "__esModule", { value: !0 }), q.s16 = q.s8 = q.nu64be = q.u48be = q.u40be = q.u32be = q.u24be = q.u16be = q.nu64 = q.u48 = q.u40 = q.u32 = q.u24 = q.u16 = q.u8 = q.offset = q.greedy = q.Constant = q.UTF8 = q.CString = q.Blob = q.Boolean = q.BitField = q.BitStructure = q.VariantLayout = q.Union = q.UnionLayoutDiscriminator = q.UnionDiscriminator = q.Structure = q.Sequence = q.DoubleBE = q.Double = q.FloatBE = q.Float = q.NearInt64BE = q.NearInt64 = q.NearUInt64BE = q.NearUInt64 = q.IntBE = q.Int = q.UIntBE = q.UInt = q.OffsetLayout = q.GreedyCount = q.ExternalLayout = q.bindConstructorLayout = q.nameWithProperty = q.Layout = q.uint8ArrayToBuffer = q.checkUint8Array = void 0, q.constant = q.utf8 = q.cstr = q.blob = q.unionLayoutDiscriminator = q.union = q.seq = q.bits = q.struct = q.f64be = q.f64 = q.f32be = q.f32 = q.ns64be = q.s48be = q.s40be = q.s32be = q.s24be = q.s16be = q.ns64 = q.s48 = q.s40 = q.s32 = q.s24 = void 0;
|
|
13687
13687
|
const t = tu();
|
|
13688
13688
|
function e(u) {
|
|
13689
13689
|
if (!(u instanceof Uint8Array))
|
|
13690
13690
|
throw new TypeError("b must be a Uint8Array");
|
|
13691
13691
|
}
|
|
13692
|
-
|
|
13692
|
+
q.checkUint8Array = e;
|
|
13693
13693
|
function n(u) {
|
|
13694
13694
|
return e(u), t.Buffer.from(u.buffer, u.byteOffset, u.length);
|
|
13695
13695
|
}
|
|
13696
|
-
|
|
13696
|
+
q.uint8ArrayToBuffer = n;
|
|
13697
13697
|
let r = class {
|
|
13698
13698
|
constructor(l, E) {
|
|
13699
13699
|
if (!Number.isInteger(l))
|
|
@@ -13782,11 +13782,11 @@ function k_() {
|
|
|
13782
13782
|
fromArray(l) {
|
|
13783
13783
|
}
|
|
13784
13784
|
};
|
|
13785
|
-
|
|
13785
|
+
q.Layout = r;
|
|
13786
13786
|
function s(u, l) {
|
|
13787
13787
|
return l.property ? u + "[" + l.property + "]" : u;
|
|
13788
13788
|
}
|
|
13789
|
-
|
|
13789
|
+
q.nameWithProperty = s;
|
|
13790
13790
|
function i(u, l) {
|
|
13791
13791
|
if (typeof u != "function")
|
|
13792
13792
|
throw new TypeError("Class must be constructor");
|
|
@@ -13808,7 +13808,7 @@ function k_() {
|
|
|
13808
13808
|
writable: !0
|
|
13809
13809
|
});
|
|
13810
13810
|
}
|
|
13811
|
-
|
|
13811
|
+
q.bindConstructorLayout = i;
|
|
13812
13812
|
class o extends r {
|
|
13813
13813
|
/**
|
|
13814
13814
|
* Return `true` iff the external layout decodes to an unsigned
|
|
@@ -13825,7 +13825,7 @@ function k_() {
|
|
|
13825
13825
|
throw new Error("ExternalLayout is abstract");
|
|
13826
13826
|
}
|
|
13827
13827
|
}
|
|
13828
|
-
|
|
13828
|
+
q.ExternalLayout = o;
|
|
13829
13829
|
class a extends o {
|
|
13830
13830
|
constructor(l = 1, E) {
|
|
13831
13831
|
if (!Number.isInteger(l) || 0 >= l)
|
|
@@ -13847,7 +13847,7 @@ function k_() {
|
|
|
13847
13847
|
return 0;
|
|
13848
13848
|
}
|
|
13849
13849
|
}
|
|
13850
|
-
|
|
13850
|
+
q.GreedyCount = a;
|
|
13851
13851
|
class d extends o {
|
|
13852
13852
|
constructor(l, E = 0, T) {
|
|
13853
13853
|
if (!(l instanceof r))
|
|
@@ -13869,7 +13869,7 @@ function k_() {
|
|
|
13869
13869
|
return this.layout.encode(l, E, T + this.offset);
|
|
13870
13870
|
}
|
|
13871
13871
|
}
|
|
13872
|
-
|
|
13872
|
+
q.OffsetLayout = d;
|
|
13873
13873
|
class m extends r {
|
|
13874
13874
|
constructor(l, E) {
|
|
13875
13875
|
if (super(l, E), 6 < this.span)
|
|
@@ -13884,7 +13884,7 @@ function k_() {
|
|
|
13884
13884
|
return n(E).writeUIntLE(l, T, this.span), this.span;
|
|
13885
13885
|
}
|
|
13886
13886
|
}
|
|
13887
|
-
|
|
13887
|
+
q.UInt = m;
|
|
13888
13888
|
class g extends r {
|
|
13889
13889
|
constructor(l, E) {
|
|
13890
13890
|
if (super(l, E), 6 < this.span)
|
|
@@ -13899,7 +13899,7 @@ function k_() {
|
|
|
13899
13899
|
return n(E).writeUIntBE(l, T, this.span), this.span;
|
|
13900
13900
|
}
|
|
13901
13901
|
}
|
|
13902
|
-
|
|
13902
|
+
q.UIntBE = g;
|
|
13903
13903
|
class S extends r {
|
|
13904
13904
|
constructor(l, E) {
|
|
13905
13905
|
if (super(l, E), 6 < this.span)
|
|
@@ -13914,7 +13914,7 @@ function k_() {
|
|
|
13914
13914
|
return n(E).writeIntLE(l, T, this.span), this.span;
|
|
13915
13915
|
}
|
|
13916
13916
|
}
|
|
13917
|
-
|
|
13917
|
+
q.Int = S;
|
|
13918
13918
|
class I extends r {
|
|
13919
13919
|
constructor(l, E) {
|
|
13920
13920
|
if (super(l, E), 6 < this.span)
|
|
@@ -13929,9 +13929,9 @@ function k_() {
|
|
|
13929
13929
|
return n(E).writeIntBE(l, T, this.span), this.span;
|
|
13930
13930
|
}
|
|
13931
13931
|
}
|
|
13932
|
-
|
|
13932
|
+
q.IntBE = I;
|
|
13933
13933
|
const N = Math.pow(2, 32);
|
|
13934
|
-
function
|
|
13934
|
+
function F(u) {
|
|
13935
13935
|
const l = Math.floor(u / N), E = u - l * N;
|
|
13936
13936
|
return { hi32: l, lo32: E };
|
|
13937
13937
|
}
|
|
@@ -13944,64 +13944,64 @@ function k_() {
|
|
|
13944
13944
|
}
|
|
13945
13945
|
/** @override */
|
|
13946
13946
|
decode(l, E = 0) {
|
|
13947
|
-
const T = n(l),
|
|
13948
|
-
return M(W,
|
|
13947
|
+
const T = n(l), P = T.readUInt32LE(E), W = T.readUInt32LE(E + 4);
|
|
13948
|
+
return M(W, P);
|
|
13949
13949
|
}
|
|
13950
13950
|
/** @override */
|
|
13951
13951
|
encode(l, E, T = 0) {
|
|
13952
|
-
const
|
|
13953
|
-
return W.writeUInt32LE(
|
|
13952
|
+
const P = F(l), W = n(E);
|
|
13953
|
+
return W.writeUInt32LE(P.lo32, T), W.writeUInt32LE(P.hi32, T + 4), 8;
|
|
13954
13954
|
}
|
|
13955
13955
|
}
|
|
13956
|
-
|
|
13956
|
+
q.NearUInt64 = k;
|
|
13957
13957
|
class K extends r {
|
|
13958
13958
|
constructor(l) {
|
|
13959
13959
|
super(8, l);
|
|
13960
13960
|
}
|
|
13961
13961
|
/** @override */
|
|
13962
13962
|
decode(l, E = 0) {
|
|
13963
|
-
const T = n(l),
|
|
13964
|
-
return M(
|
|
13963
|
+
const T = n(l), P = T.readUInt32BE(E), W = T.readUInt32BE(E + 4);
|
|
13964
|
+
return M(P, W);
|
|
13965
13965
|
}
|
|
13966
13966
|
/** @override */
|
|
13967
13967
|
encode(l, E, T = 0) {
|
|
13968
|
-
const
|
|
13969
|
-
return W.writeUInt32BE(
|
|
13968
|
+
const P = F(l), W = n(E);
|
|
13969
|
+
return W.writeUInt32BE(P.hi32, T), W.writeUInt32BE(P.lo32, T + 4), 8;
|
|
13970
13970
|
}
|
|
13971
13971
|
}
|
|
13972
|
-
|
|
13972
|
+
q.NearUInt64BE = K;
|
|
13973
13973
|
class Y extends r {
|
|
13974
13974
|
constructor(l) {
|
|
13975
13975
|
super(8, l);
|
|
13976
13976
|
}
|
|
13977
13977
|
/** @override */
|
|
13978
13978
|
decode(l, E = 0) {
|
|
13979
|
-
const T = n(l),
|
|
13980
|
-
return M(W,
|
|
13979
|
+
const T = n(l), P = T.readUInt32LE(E), W = T.readInt32LE(E + 4);
|
|
13980
|
+
return M(W, P);
|
|
13981
13981
|
}
|
|
13982
13982
|
/** @override */
|
|
13983
13983
|
encode(l, E, T = 0) {
|
|
13984
|
-
const
|
|
13985
|
-
return W.writeUInt32LE(
|
|
13984
|
+
const P = F(l), W = n(E);
|
|
13985
|
+
return W.writeUInt32LE(P.lo32, T), W.writeInt32LE(P.hi32, T + 4), 8;
|
|
13986
13986
|
}
|
|
13987
13987
|
}
|
|
13988
|
-
|
|
13989
|
-
class
|
|
13988
|
+
q.NearInt64 = Y;
|
|
13989
|
+
class z extends r {
|
|
13990
13990
|
constructor(l) {
|
|
13991
13991
|
super(8, l);
|
|
13992
13992
|
}
|
|
13993
13993
|
/** @override */
|
|
13994
13994
|
decode(l, E = 0) {
|
|
13995
|
-
const T = n(l),
|
|
13996
|
-
return M(
|
|
13995
|
+
const T = n(l), P = T.readInt32BE(E), W = T.readUInt32BE(E + 4);
|
|
13996
|
+
return M(P, W);
|
|
13997
13997
|
}
|
|
13998
13998
|
/** @override */
|
|
13999
13999
|
encode(l, E, T = 0) {
|
|
14000
|
-
const
|
|
14001
|
-
return W.writeInt32BE(
|
|
14000
|
+
const P = F(l), W = n(E);
|
|
14001
|
+
return W.writeInt32BE(P.hi32, T), W.writeUInt32BE(P.lo32, T + 4), 8;
|
|
14002
14002
|
}
|
|
14003
14003
|
}
|
|
14004
|
-
|
|
14004
|
+
q.NearInt64BE = z;
|
|
14005
14005
|
class U extends r {
|
|
14006
14006
|
constructor(l) {
|
|
14007
14007
|
super(4, l);
|
|
@@ -14015,8 +14015,8 @@ function k_() {
|
|
|
14015
14015
|
return n(E).writeFloatLE(l, T), 4;
|
|
14016
14016
|
}
|
|
14017
14017
|
}
|
|
14018
|
-
|
|
14019
|
-
class
|
|
14018
|
+
q.Float = U;
|
|
14019
|
+
class j extends r {
|
|
14020
14020
|
constructor(l) {
|
|
14021
14021
|
super(4, l);
|
|
14022
14022
|
}
|
|
@@ -14029,7 +14029,7 @@ function k_() {
|
|
|
14029
14029
|
return n(E).writeFloatBE(l, T), 4;
|
|
14030
14030
|
}
|
|
14031
14031
|
}
|
|
14032
|
-
|
|
14032
|
+
q.FloatBE = j;
|
|
14033
14033
|
class J extends r {
|
|
14034
14034
|
constructor(l) {
|
|
14035
14035
|
super(8, l);
|
|
@@ -14043,7 +14043,7 @@ function k_() {
|
|
|
14043
14043
|
return n(E).writeDoubleLE(l, T), 8;
|
|
14044
14044
|
}
|
|
14045
14045
|
}
|
|
14046
|
-
|
|
14046
|
+
q.Double = J;
|
|
14047
14047
|
class ne extends r {
|
|
14048
14048
|
constructor(l) {
|
|
14049
14049
|
super(8, l);
|
|
@@ -14057,26 +14057,26 @@ function k_() {
|
|
|
14057
14057
|
return n(E).writeDoubleBE(l, T), 8;
|
|
14058
14058
|
}
|
|
14059
14059
|
}
|
|
14060
|
-
|
|
14060
|
+
q.DoubleBE = ne;
|
|
14061
14061
|
class te extends r {
|
|
14062
14062
|
constructor(l, E, T) {
|
|
14063
14063
|
if (!(l instanceof r))
|
|
14064
14064
|
throw new TypeError("elementLayout must be a Layout");
|
|
14065
14065
|
if (!(E instanceof o && E.isCount() || Number.isInteger(E) && 0 <= E))
|
|
14066
14066
|
throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");
|
|
14067
|
-
let
|
|
14068
|
-
!(E instanceof o) && 0 < l.span && (
|
|
14067
|
+
let P = -1;
|
|
14068
|
+
!(E instanceof o) && 0 < l.span && (P = E * l.span), super(P, T), this.elementLayout = l, this.count = E;
|
|
14069
14069
|
}
|
|
14070
14070
|
/** @override */
|
|
14071
14071
|
getSpan(l, E = 0) {
|
|
14072
14072
|
if (0 <= this.span)
|
|
14073
14073
|
return this.span;
|
|
14074
|
-
let T = 0,
|
|
14075
|
-
if (
|
|
14076
|
-
T =
|
|
14074
|
+
let T = 0, P = this.count;
|
|
14075
|
+
if (P instanceof o && (P = P.decode(l, E)), 0 < this.elementLayout.span)
|
|
14076
|
+
T = P * this.elementLayout.span;
|
|
14077
14077
|
else {
|
|
14078
14078
|
let W = 0;
|
|
14079
|
-
for (; W <
|
|
14079
|
+
for (; W < P; )
|
|
14080
14080
|
T += this.elementLayout.getSpan(l, E + T), ++W;
|
|
14081
14081
|
}
|
|
14082
14082
|
return T;
|
|
@@ -14084,9 +14084,9 @@ function k_() {
|
|
|
14084
14084
|
/** @override */
|
|
14085
14085
|
decode(l, E = 0) {
|
|
14086
14086
|
const T = [];
|
|
14087
|
-
let
|
|
14088
|
-
for (W instanceof o && (W = W.decode(l, E));
|
|
14089
|
-
T.push(this.elementLayout.decode(l, E)), E += this.elementLayout.getSpan(l, E),
|
|
14087
|
+
let P = 0, W = this.count;
|
|
14088
|
+
for (W instanceof o && (W = W.decode(l, E)); P < W; )
|
|
14089
|
+
T.push(this.elementLayout.decode(l, E)), E += this.elementLayout.getSpan(l, E), P += 1;
|
|
14090
14090
|
return T;
|
|
14091
14091
|
}
|
|
14092
14092
|
/** Implement {@link Layout#encode|encode} for {@link Sequence}.
|
|
@@ -14100,12 +14100,12 @@ function k_() {
|
|
|
14100
14100
|
* ExternalLayout} then the length of `src` will be encoded as the
|
|
14101
14101
|
* count after `src` is encoded. */
|
|
14102
14102
|
encode(l, E, T = 0) {
|
|
14103
|
-
const
|
|
14103
|
+
const P = this.elementLayout, W = l.reduce((se, ae) => se + P.encode(ae, E, T + se), 0);
|
|
14104
14104
|
return this.count instanceof o && this.count.encode(l.length, E, T), W;
|
|
14105
14105
|
}
|
|
14106
14106
|
}
|
|
14107
|
-
|
|
14108
|
-
class
|
|
14107
|
+
q.Sequence = te;
|
|
14108
|
+
class V extends r {
|
|
14109
14109
|
constructor(l, E, T) {
|
|
14110
14110
|
if (!(Array.isArray(l) && l.reduce((W, se) => W && se instanceof r, !0)))
|
|
14111
14111
|
throw new TypeError("fields must be array of Layout instances");
|
|
@@ -14113,12 +14113,12 @@ function k_() {
|
|
|
14113
14113
|
for (const W of l)
|
|
14114
14114
|
if (0 > W.span && W.property === void 0)
|
|
14115
14115
|
throw new Error("fields cannot contain unnamed variable-length layout");
|
|
14116
|
-
let
|
|
14116
|
+
let P = -1;
|
|
14117
14117
|
try {
|
|
14118
|
-
|
|
14118
|
+
P = l.reduce((W, se) => W + se.getSpan(), 0);
|
|
14119
14119
|
} catch {
|
|
14120
14120
|
}
|
|
14121
|
-
super(
|
|
14121
|
+
super(P, E), this.fields = l, this.decodePrefixes = !!T;
|
|
14122
14122
|
}
|
|
14123
14123
|
/** @override */
|
|
14124
14124
|
getSpan(l, E = 0) {
|
|
@@ -14126,9 +14126,9 @@ function k_() {
|
|
|
14126
14126
|
return this.span;
|
|
14127
14127
|
let T = 0;
|
|
14128
14128
|
try {
|
|
14129
|
-
T = this.fields.reduce((
|
|
14129
|
+
T = this.fields.reduce((P, W) => {
|
|
14130
14130
|
const se = W.getSpan(l, E);
|
|
14131
|
-
return E += se,
|
|
14131
|
+
return E += se, P + se;
|
|
14132
14132
|
}, 0);
|
|
14133
14133
|
} catch {
|
|
14134
14134
|
throw new RangeError("indeterminate span");
|
|
@@ -14139,8 +14139,8 @@ function k_() {
|
|
|
14139
14139
|
decode(l, E = 0) {
|
|
14140
14140
|
e(l);
|
|
14141
14141
|
const T = this.makeDestinationObject();
|
|
14142
|
-
for (const
|
|
14143
|
-
if (
|
|
14142
|
+
for (const P of this.fields)
|
|
14143
|
+
if (P.property !== void 0 && (T[P.property] = P.decode(l, E)), E += P.getSpan(l, E), this.decodePrefixes && l.length === E)
|
|
14144
14144
|
break;
|
|
14145
14145
|
return T;
|
|
14146
14146
|
}
|
|
@@ -14150,7 +14150,7 @@ function k_() {
|
|
|
14150
14150
|
* Layout#property|property} the corresponding region of the buffer is
|
|
14151
14151
|
* left unmodified. */
|
|
14152
14152
|
encode(l, E, T = 0) {
|
|
14153
|
-
const
|
|
14153
|
+
const P = T;
|
|
14154
14154
|
let W = 0, se = 0;
|
|
14155
14155
|
for (const ae of this.fields) {
|
|
14156
14156
|
let Me = ae.span;
|
|
@@ -14160,7 +14160,7 @@ function k_() {
|
|
|
14160
14160
|
}
|
|
14161
14161
|
W = T, T += Me;
|
|
14162
14162
|
}
|
|
14163
|
-
return W + se -
|
|
14163
|
+
return W + se - P;
|
|
14164
14164
|
}
|
|
14165
14165
|
/** @override */
|
|
14166
14166
|
fromArray(l) {
|
|
@@ -14206,7 +14206,7 @@ function k_() {
|
|
|
14206
14206
|
}
|
|
14207
14207
|
}
|
|
14208
14208
|
}
|
|
14209
|
-
|
|
14209
|
+
q.Structure = V;
|
|
14210
14210
|
class C {
|
|
14211
14211
|
constructor(l) {
|
|
14212
14212
|
this.property = l;
|
|
@@ -14226,8 +14226,8 @@ function k_() {
|
|
|
14226
14226
|
throw new Error("UnionDiscriminator is abstract");
|
|
14227
14227
|
}
|
|
14228
14228
|
}
|
|
14229
|
-
|
|
14230
|
-
class
|
|
14229
|
+
q.UnionDiscriminator = C;
|
|
14230
|
+
class L extends C {
|
|
14231
14231
|
constructor(l, E) {
|
|
14232
14232
|
if (!(l instanceof o && l.isCount()))
|
|
14233
14233
|
throw new TypeError("layout must be an unsigned integer ExternalLayout");
|
|
@@ -14242,16 +14242,16 @@ function k_() {
|
|
|
14242
14242
|
return this.layout.encode(l, E, T);
|
|
14243
14243
|
}
|
|
14244
14244
|
}
|
|
14245
|
-
|
|
14246
|
-
class
|
|
14245
|
+
q.UnionLayoutDiscriminator = L;
|
|
14246
|
+
class G extends r {
|
|
14247
14247
|
constructor(l, E, T) {
|
|
14248
|
-
let
|
|
14248
|
+
let P;
|
|
14249
14249
|
if (l instanceof m || l instanceof g)
|
|
14250
|
-
|
|
14250
|
+
P = new L(new d(l));
|
|
14251
14251
|
else if (l instanceof o && l.isCount())
|
|
14252
|
-
|
|
14252
|
+
P = new L(l);
|
|
14253
14253
|
else if (l instanceof C)
|
|
14254
|
-
|
|
14254
|
+
P = l;
|
|
14255
14255
|
else
|
|
14256
14256
|
throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");
|
|
14257
14257
|
if (E === void 0 && (E = null), !(E === null || E instanceof r))
|
|
@@ -14262,7 +14262,7 @@ function k_() {
|
|
|
14262
14262
|
E.property === void 0 && (E = E.replicate("content"));
|
|
14263
14263
|
}
|
|
14264
14264
|
let W = -1;
|
|
14265
|
-
E && (W = E.span, 0 <= W && (l instanceof m || l instanceof g) && (W +=
|
|
14265
|
+
E && (W = E.span, 0 <= W && (l instanceof m || l instanceof g) && (W += P.layout.span)), super(W, T), this.discriminator = P, this.usesPrefixDiscriminator = l instanceof m || l instanceof g, this.defaultLayout = E, this.registry = {};
|
|
14266
14266
|
let se = this.defaultGetSourceVariant.bind(this);
|
|
14267
14267
|
this.getSourceVariant = function(ae) {
|
|
14268
14268
|
return se(ae);
|
|
@@ -14331,11 +14331,11 @@ function k_() {
|
|
|
14331
14331
|
* layout} is used to decode the content. */
|
|
14332
14332
|
decode(l, E = 0) {
|
|
14333
14333
|
let T;
|
|
14334
|
-
const
|
|
14334
|
+
const P = this.discriminator, W = P.decode(l, E), se = this.registry[W];
|
|
14335
14335
|
if (se === void 0) {
|
|
14336
14336
|
const ae = this.defaultLayout;
|
|
14337
14337
|
let Me = 0;
|
|
14338
|
-
this.usesPrefixDiscriminator && (Me =
|
|
14338
|
+
this.usesPrefixDiscriminator && (Me = P.layout.span), T = this.makeDestinationObject(), T[P.property] = W, T[ae.property] = ae.decode(l, E + Me);
|
|
14339
14339
|
} else
|
|
14340
14340
|
T = se.decode(l, E);
|
|
14341
14341
|
return T;
|
|
@@ -14347,13 +14347,13 @@ function k_() {
|
|
|
14347
14347
|
* use the appropriate variant-specific {@link VariantLayout#encode}
|
|
14348
14348
|
* method. */
|
|
14349
14349
|
encode(l, E, T = 0) {
|
|
14350
|
-
const
|
|
14351
|
-
if (
|
|
14350
|
+
const P = this.getSourceVariant(l);
|
|
14351
|
+
if (P === void 0) {
|
|
14352
14352
|
const W = this.discriminator, se = this.defaultLayout;
|
|
14353
14353
|
let ae = 0;
|
|
14354
14354
|
return this.usesPrefixDiscriminator && (ae = W.layout.span), W.encode(l[W.property], E, T), ae + se.encode(l[se.property], E, T + ae);
|
|
14355
14355
|
}
|
|
14356
|
-
return
|
|
14356
|
+
return P.encode(l, E, T);
|
|
14357
14357
|
}
|
|
14358
14358
|
/** Register a new variant structure within a union. The newly
|
|
14359
14359
|
* created variant is returned.
|
|
@@ -14369,8 +14369,8 @@ function k_() {
|
|
|
14369
14369
|
*
|
|
14370
14370
|
* @return {VariantLayout} */
|
|
14371
14371
|
addVariant(l, E, T) {
|
|
14372
|
-
const
|
|
14373
|
-
return this.registry[l] =
|
|
14372
|
+
const P = new w(this, l, E, T);
|
|
14373
|
+
return this.registry[l] = P, P;
|
|
14374
14374
|
}
|
|
14375
14375
|
/**
|
|
14376
14376
|
* Get the layout associated with a registered variant.
|
|
@@ -14391,23 +14391,23 @@ function k_() {
|
|
|
14391
14391
|
return l instanceof Uint8Array ? T = this.discriminator.decode(l, E) : T = l, this.registry[T];
|
|
14392
14392
|
}
|
|
14393
14393
|
}
|
|
14394
|
-
|
|
14394
|
+
q.Union = G;
|
|
14395
14395
|
class w extends r {
|
|
14396
|
-
constructor(l, E, T,
|
|
14397
|
-
if (!(l instanceof
|
|
14396
|
+
constructor(l, E, T, P) {
|
|
14397
|
+
if (!(l instanceof G))
|
|
14398
14398
|
throw new TypeError("union must be a Union");
|
|
14399
14399
|
if (!Number.isInteger(E) || 0 > E)
|
|
14400
14400
|
throw new TypeError("variant must be a (non-negative) integer");
|
|
14401
|
-
if (typeof T == "string" &&
|
|
14401
|
+
if (typeof T == "string" && P === void 0 && (P = T, T = null), T) {
|
|
14402
14402
|
if (!(T instanceof r))
|
|
14403
14403
|
throw new TypeError("layout must be a Layout");
|
|
14404
14404
|
if (l.defaultLayout !== null && 0 <= T.span && T.span > l.defaultLayout.span)
|
|
14405
14405
|
throw new Error("variant span exceeds span of containing union");
|
|
14406
|
-
if (typeof
|
|
14406
|
+
if (typeof P != "string")
|
|
14407
14407
|
throw new TypeError("variant must have a String property");
|
|
14408
14408
|
}
|
|
14409
14409
|
let W = l.span;
|
|
14410
|
-
0 > l.span && (W = T ? T.span : 0, 0 <= W && l.usesPrefixDiscriminator && (W += l.discriminator.layout.span)), super(W,
|
|
14410
|
+
0 > l.span && (W = T ? T.span : 0, 0 <= W && l.usesPrefixDiscriminator && (W += l.discriminator.layout.span)), super(W, P), this.union = l, this.variant = E, this.layout = T || null;
|
|
14411
14411
|
}
|
|
14412
14412
|
/** @override */
|
|
14413
14413
|
getSpan(l, E = 0) {
|
|
@@ -14415,25 +14415,25 @@ function k_() {
|
|
|
14415
14415
|
return this.span;
|
|
14416
14416
|
let T = 0;
|
|
14417
14417
|
this.union.usesPrefixDiscriminator && (T = this.union.discriminator.layout.span);
|
|
14418
|
-
let
|
|
14419
|
-
return this.layout && (
|
|
14418
|
+
let P = 0;
|
|
14419
|
+
return this.layout && (P = this.layout.getSpan(l, E + T)), T + P;
|
|
14420
14420
|
}
|
|
14421
14421
|
/** @override */
|
|
14422
14422
|
decode(l, E = 0) {
|
|
14423
14423
|
const T = this.makeDestinationObject();
|
|
14424
14424
|
if (this !== this.union.getVariant(l, E))
|
|
14425
14425
|
throw new Error("variant mismatch");
|
|
14426
|
-
let
|
|
14427
|
-
return this.union.usesPrefixDiscriminator && (
|
|
14426
|
+
let P = 0;
|
|
14427
|
+
return this.union.usesPrefixDiscriminator && (P = this.union.discriminator.layout.span), this.layout ? T[this.property] = this.layout.decode(l, E + P) : this.property ? T[this.property] = !0 : this.union.usesPrefixDiscriminator && (T[this.union.discriminator.property] = this.variant), T;
|
|
14428
14428
|
}
|
|
14429
14429
|
/** @override */
|
|
14430
14430
|
encode(l, E, T = 0) {
|
|
14431
|
-
let
|
|
14432
|
-
if (this.union.usesPrefixDiscriminator && (
|
|
14431
|
+
let P = 0;
|
|
14432
|
+
if (this.union.usesPrefixDiscriminator && (P = this.union.discriminator.layout.span), this.layout && !Object.prototype.hasOwnProperty.call(l, this.property))
|
|
14433
14433
|
throw new TypeError("variant lacks property " + this.property);
|
|
14434
14434
|
this.union.discriminator.encode(this.variant, E, T);
|
|
14435
|
-
let W =
|
|
14436
|
-
if (this.layout && (this.layout.encode(l[this.property], E, T +
|
|
14435
|
+
let W = P;
|
|
14436
|
+
if (this.layout && (this.layout.encode(l[this.property], E, T + P), W += this.layout.getSpan(E, T + P), 0 <= this.union.span && W > this.union.span))
|
|
14437
14437
|
throw new Error("encoded variant overruns containing union");
|
|
14438
14438
|
return W;
|
|
14439
14439
|
}
|
|
@@ -14444,7 +14444,7 @@ function k_() {
|
|
|
14444
14444
|
return this.layout.fromArray(l);
|
|
14445
14445
|
}
|
|
14446
14446
|
}
|
|
14447
|
-
|
|
14447
|
+
q.VariantLayout = w;
|
|
14448
14448
|
function c(u) {
|
|
14449
14449
|
return 0 > u && (u += 4294967296), u;
|
|
14450
14450
|
}
|
|
@@ -14455,17 +14455,17 @@ function k_() {
|
|
|
14455
14455
|
if (typeof E == "string" && T === void 0 && (T = E, E = !1), 4 < l.span)
|
|
14456
14456
|
throw new RangeError("word cannot exceed 32 bits");
|
|
14457
14457
|
super(l.span, T), this.word = l, this.msb = !!E, this.fields = [];
|
|
14458
|
-
let
|
|
14458
|
+
let P = 0;
|
|
14459
14459
|
this._packedSetValue = function(W) {
|
|
14460
|
-
return
|
|
14460
|
+
return P = c(W), this;
|
|
14461
14461
|
}, this._packedGetValue = function() {
|
|
14462
|
-
return
|
|
14462
|
+
return P;
|
|
14463
14463
|
};
|
|
14464
14464
|
}
|
|
14465
14465
|
/** @override */
|
|
14466
14466
|
decode(l, E = 0) {
|
|
14467
|
-
const T = this.makeDestinationObject(),
|
|
14468
|
-
this._packedSetValue(
|
|
14467
|
+
const T = this.makeDestinationObject(), P = this.word.decode(l, E);
|
|
14468
|
+
this._packedSetValue(P);
|
|
14469
14469
|
for (const W of this.fields)
|
|
14470
14470
|
W.property !== void 0 && (T[W.property] = W.decode(l));
|
|
14471
14471
|
return T;
|
|
@@ -14476,8 +14476,8 @@ function k_() {
|
|
|
14476
14476
|
* Layout#property|property} the corresponding region of the packed
|
|
14477
14477
|
* value is left unmodified. Unused bits are also left unmodified. */
|
|
14478
14478
|
encode(l, E, T = 0) {
|
|
14479
|
-
const
|
|
14480
|
-
this._packedSetValue(
|
|
14479
|
+
const P = this.word.decode(E, T);
|
|
14480
|
+
this._packedSetValue(P);
|
|
14481
14481
|
for (const W of this.fields)
|
|
14482
14482
|
if (W.property !== void 0) {
|
|
14483
14483
|
const se = l[W.property];
|
|
@@ -14527,17 +14527,17 @@ function k_() {
|
|
|
14527
14527
|
return E;
|
|
14528
14528
|
}
|
|
14529
14529
|
}
|
|
14530
|
-
|
|
14530
|
+
q.BitStructure = p;
|
|
14531
14531
|
class y {
|
|
14532
14532
|
constructor(l, E, T) {
|
|
14533
14533
|
if (!(l instanceof p))
|
|
14534
14534
|
throw new TypeError("container must be a BitStructure");
|
|
14535
14535
|
if (!Number.isInteger(E) || 0 >= E)
|
|
14536
14536
|
throw new TypeError("bits must be positive integer");
|
|
14537
|
-
const
|
|
14538
|
-
if (E + W >
|
|
14539
|
-
throw new Error("bits too long for span remainder (" + (
|
|
14540
|
-
this.container = l, this.bits = E, this.valueMask = (1 << E) - 1, E === 32 && (this.valueMask = 4294967295), this.start = W, this.container.msb && (this.start =
|
|
14537
|
+
const P = 8 * l.span, W = l.fields.reduce((se, ae) => se + ae.bits, 0);
|
|
14538
|
+
if (E + W > P)
|
|
14539
|
+
throw new Error("bits too long for span remainder (" + (P - W) + " of " + P + " remain)");
|
|
14540
|
+
this.container = l, this.bits = E, this.valueMask = (1 << E) - 1, E === 32 && (this.valueMask = 4294967295), this.start = W, this.container.msb && (this.start = P - W - E), this.wordMask = c(this.valueMask << this.start), this.property = T;
|
|
14541
14541
|
}
|
|
14542
14542
|
/** Store a value into the corresponding subsequence of the containing
|
|
14543
14543
|
* bit field. */
|
|
@@ -14557,7 +14557,7 @@ function k_() {
|
|
|
14557
14557
|
this.container._packedSetValue(c(E & ~this.wordMask) | T);
|
|
14558
14558
|
}
|
|
14559
14559
|
}
|
|
14560
|
-
|
|
14560
|
+
q.BitField = y;
|
|
14561
14561
|
class A extends y {
|
|
14562
14562
|
constructor(l, E) {
|
|
14563
14563
|
super(l, 1, E);
|
|
@@ -14573,7 +14573,7 @@ function k_() {
|
|
|
14573
14573
|
typeof l == "boolean" && (l = +l), super.encode(l);
|
|
14574
14574
|
}
|
|
14575
14575
|
}
|
|
14576
|
-
|
|
14576
|
+
q.Boolean = A;
|
|
14577
14577
|
class v extends r {
|
|
14578
14578
|
constructor(l, E) {
|
|
14579
14579
|
if (!(l instanceof o && l.isCount() || Number.isInteger(l) && 0 <= l))
|
|
@@ -14597,16 +14597,16 @@ function k_() {
|
|
|
14597
14597
|
* ExternalLayout} then the length of `src` will be encoded as the
|
|
14598
14598
|
* count after `src` is encoded. */
|
|
14599
14599
|
encode(l, E, T) {
|
|
14600
|
-
let
|
|
14601
|
-
if (this.length instanceof o && (
|
|
14602
|
-
throw new TypeError(s("Blob.encode", this) + " requires (length " +
|
|
14603
|
-
if (T +
|
|
14600
|
+
let P = this.length;
|
|
14601
|
+
if (this.length instanceof o && (P = l.length), !(l instanceof Uint8Array && P === l.length))
|
|
14602
|
+
throw new TypeError(s("Blob.encode", this) + " requires (length " + P + ") Uint8Array as src");
|
|
14603
|
+
if (T + P > E.length)
|
|
14604
14604
|
throw new RangeError("encoding overruns Uint8Array");
|
|
14605
14605
|
const W = n(l);
|
|
14606
|
-
return n(E).write(W.toString("hex"), T,
|
|
14606
|
+
return n(E).write(W.toString("hex"), T, P, "hex"), this.length instanceof o && this.length.encode(P, E, T), P;
|
|
14607
14607
|
}
|
|
14608
14608
|
}
|
|
14609
|
-
|
|
14609
|
+
q.Blob = v;
|
|
14610
14610
|
class R extends r {
|
|
14611
14611
|
constructor(l) {
|
|
14612
14612
|
super(-1, l);
|
|
@@ -14627,14 +14627,14 @@ function k_() {
|
|
|
14627
14627
|
/** @override */
|
|
14628
14628
|
encode(l, E, T = 0) {
|
|
14629
14629
|
typeof l != "string" && (l = String(l));
|
|
14630
|
-
const
|
|
14630
|
+
const P = t.Buffer.from(l, "utf8"), W = P.length;
|
|
14631
14631
|
if (T + W > E.length)
|
|
14632
14632
|
throw new RangeError("encoding overruns Buffer");
|
|
14633
14633
|
const se = n(E);
|
|
14634
|
-
return
|
|
14634
|
+
return P.copy(se, T), se[T + W] = 0, W + 1;
|
|
14635
14635
|
}
|
|
14636
14636
|
}
|
|
14637
|
-
|
|
14637
|
+
q.CString = R;
|
|
14638
14638
|
class O extends r {
|
|
14639
14639
|
constructor(l, E) {
|
|
14640
14640
|
if (typeof l == "string" && E === void 0 && (E = l, l = void 0), l === void 0)
|
|
@@ -14657,15 +14657,15 @@ function k_() {
|
|
|
14657
14657
|
/** @override */
|
|
14658
14658
|
encode(l, E, T = 0) {
|
|
14659
14659
|
typeof l != "string" && (l = String(l));
|
|
14660
|
-
const
|
|
14660
|
+
const P = t.Buffer.from(l, "utf8"), W = P.length;
|
|
14661
14661
|
if (0 <= this.maxSpan && this.maxSpan < W)
|
|
14662
14662
|
throw new RangeError("text length exceeds maxSpan");
|
|
14663
14663
|
if (T + W > E.length)
|
|
14664
14664
|
throw new RangeError("encoding overruns Buffer");
|
|
14665
|
-
return
|
|
14665
|
+
return P.copy(n(E), T), W;
|
|
14666
14666
|
}
|
|
14667
14667
|
}
|
|
14668
|
-
|
|
14668
|
+
q.UTF8 = O;
|
|
14669
14669
|
class _ extends r {
|
|
14670
14670
|
constructor(l, E) {
|
|
14671
14671
|
super(0, E), this.value = l;
|
|
@@ -14679,7 +14679,7 @@ function k_() {
|
|
|
14679
14679
|
return 0;
|
|
14680
14680
|
}
|
|
14681
14681
|
}
|
|
14682
|
-
return
|
|
14682
|
+
return q.Constant = _, q.greedy = ((u, l) => new a(u, l)), q.offset = ((u, l, E) => new d(u, l, E)), q.u8 = ((u) => new m(1, u)), q.u16 = ((u) => new m(2, u)), q.u24 = ((u) => new m(3, u)), q.u32 = ((u) => new m(4, u)), q.u40 = ((u) => new m(5, u)), q.u48 = ((u) => new m(6, u)), q.nu64 = ((u) => new k(u)), q.u16be = ((u) => new g(2, u)), q.u24be = ((u) => new g(3, u)), q.u32be = ((u) => new g(4, u)), q.u40be = ((u) => new g(5, u)), q.u48be = ((u) => new g(6, u)), q.nu64be = ((u) => new K(u)), q.s8 = ((u) => new S(1, u)), q.s16 = ((u) => new S(2, u)), q.s24 = ((u) => new S(3, u)), q.s32 = ((u) => new S(4, u)), q.s40 = ((u) => new S(5, u)), q.s48 = ((u) => new S(6, u)), q.ns64 = ((u) => new Y(u)), q.s16be = ((u) => new I(2, u)), q.s24be = ((u) => new I(3, u)), q.s32be = ((u) => new I(4, u)), q.s40be = ((u) => new I(5, u)), q.s48be = ((u) => new I(6, u)), q.ns64be = ((u) => new z(u)), q.f32 = ((u) => new U(u)), q.f32be = ((u) => new j(u)), q.f64 = ((u) => new J(u)), q.f64be = ((u) => new ne(u)), q.struct = ((u, l, E) => new V(u, l, E)), q.bits = ((u, l, E) => new p(u, l, E)), q.seq = ((u, l, E) => new te(u, l, E)), q.union = ((u, l, E) => new G(u, l, E)), q.unionLayoutDiscriminator = ((u, l) => new L(u, l)), q.blob = ((u, l) => new v(u, l)), q.cstr = ((u) => new R(u)), q.utf8 = ((u, l) => new O(u, l)), q.constant = ((u, l) => new _(u, l)), q;
|
|
14683
14683
|
}
|
|
14684
14684
|
var B = k_(), U_ = 1, L_ = 2, D_ = 3, P_ = 4, F_ = 5, $_ = 6, z_ = 7, j_ = 8, V_ = 9, H_ = 10, G_ = -32700, q_ = -32603, K_ = -32602, W_ = -32601, Z_ = -32600, Y_ = -32016, J_ = -32015, X_ = -32014, Q_ = -32013, eE = -32012, tE = -32011, nE = -32010, rE = -32009, sE = -32008, iE = -32007, oE = -32006, aE = -32005, cE = -32004, uE = -32003, dE = -32002, lE = -32001, fE = 28e5, hE = 2800001, pE = 2800002, mE = 2800003, gE = 2800004, yE = 2800005, bE = 2800006, _E = 2800007, EE = 2800008, wE = 2800009, vE = 2800010, RE = 2800011, AE = 323e4, SE = 32300001, xE = 3230002, TE = 3230003, IE = 3230004, OE = 361e4, NE = 3610001, CE = 3610002, ME = 3610003, BE = 3610004, kE = 3610005, UE = 3610006, LE = 3610007, DE = 3611e3, PE = 3704e3, FE = 3704001, $E = 3704002, zE = 3704003, jE = 3704004, VE = 4128e3, HE = 4128001, GE = 4128002, qE = 4615e3, KE = 4615001, WE = 4615002, ZE = 4615003, YE = 4615004, JE = 4615005, XE = 4615006, QE = 4615007, ew = 4615008, tw = 4615009, nw = 4615010, rw = 4615011, sw = 4615012, iw = 4615013, ow = 4615014, aw = 4615015, cw = 4615016, uw = 4615017, dw = 4615018, lw = 4615019, fw = 4615020, hw = 4615021, pw = 4615022, mw = 4615023, gw = 4615024, yw = 4615025, bw = 4615026, _w = 4615027, Ew = 4615028, ww = 4615029, vw = 4615030, Rw = 4615031, Aw = 4615032, Sw = 4615033, xw = 4615034, Tw = 4615035, Iw = 4615036, Ow = 4615037, Nw = 4615038, Cw = 4615039, Mw = 4615040, Bw = 4615041, kw = 4615042, Uw = 4615043, Lw = 4615044, Dw = 4615045, Pw = 4615046, Fw = 4615047, $w = 4615048, zw = 4615049, jw = 4615050, Vw = 4615051, Hw = 4615052, Gw = 4615053, qw = 4615054, Kw = 5508e3, Ww = 5508001, Zw = 5508002, Yw = 5508003, Jw = 5508004, Xw = 5508005, Qw = 5508006, ev = 5508007, tv = 5508008, nv = 5508009, rv = 5508010, sv = 5508011, iv = 5663e3, ov = 5663001, av = 5663002, cv = 5663003, uv = 5663004, dv = 5663005, lv = 5663006, fv = 5663007, hv = 5663008, pv = 5663009, mv = 5663010, gv = 5663011, yv = 5663012, bv = 5663013, _v = 5663014, Ev = 5663015, wv = 5663016, vv = 5663017, Rv = 5663018, Av = 5663019, Sv = 5663020, xv = 705e4, Tv = 7050001, Iv = 7050002, Ov = 7050003, Nv = 7050004, Cv = 7050005, Mv = 7050006, Bv = 7050007, kv = 7050008, Uv = 7050009, Lv = 7050010, Dv = 7050011, Pv = 7050012, Fv = 7050013, $v = 7050014, zv = 7050015, jv = 7050016, Vv = 7050017, Hv = 7050018, Gv = 7050019, qv = 7050020, Kv = 7050021, Wv = 7050022, Zv = 7050023, Yv = 7050024, Jv = 7050025, Xv = 7050026, Qv = 7050027, eR = 7050028, tR = 7050029, nR = 7050030, rR = 7050031, sR = 7050032, iR = 7050033, oR = 7050034, aR = 7050035, cR = 7050036, wh = 8078e3, vh = 8078001, uR = 8078002, dR = 8078003, Rh = 8078004, Ah = 8078005, Sh = 8078006, lR = 8078007, fR = 8078008, hR = 8078009, pR = 8078010, xh = 8078011, mR = 8078012, gR = 8078013, yR = 8078014, bR = 8078015, _R = 8078016, ER = 8078017, wR = 8078018, vR = 8078019, RR = 8078020, AR = 8078021, SR = 8078022, xR = 81e5, TR = 8100001, IR = 8100002, OR = 8100003, NR = 819e4, CR = 8190001, MR = 8190002, BR = 8190003, kR = 8190004, UR = 99e5, LR = 9900001, DR = 9900002, PR = 9900003, FR = 9900004;
|
|
14685
14685
|
function Th(t) {
|
|
@@ -15621,13 +15621,13 @@ function xA(t) {
|
|
|
15621
15621
|
for (var S = 0; S < o; ++S) {
|
|
15622
15622
|
for (var I = new Uint32Array(80), N = 0; N < 16; ++N)
|
|
15623
15623
|
I[N] = a[S][N];
|
|
15624
|
-
for (var
|
|
15625
|
-
I[
|
|
15626
|
-
for (var M = n[0], k = n[1], K = n[2], Y = n[3],
|
|
15627
|
-
var
|
|
15628
|
-
|
|
15624
|
+
for (var F = 16; F < 80; ++F)
|
|
15625
|
+
I[F] = va(I[F - 3] ^ I[F - 8] ^ I[F - 14] ^ I[F - 16], 1);
|
|
15626
|
+
for (var M = n[0], k = n[1], K = n[2], Y = n[3], z = n[4], U = 0; U < 80; ++U) {
|
|
15627
|
+
var j = Math.floor(U / 20), J = va(M, 5) + SA(j, k, K, Y) + z + e[j] + I[U] >>> 0;
|
|
15628
|
+
z = Y, Y = K, K = va(k, 30) >>> 0, k = M, M = J;
|
|
15629
15629
|
}
|
|
15630
|
-
n[0] = n[0] + M >>> 0, n[1] = n[1] + k >>> 0, n[2] = n[2] + K >>> 0, n[3] = n[3] + Y >>> 0, n[4] = n[4] +
|
|
15630
|
+
n[0] = n[0] + M >>> 0, n[1] = n[1] + k >>> 0, n[2] = n[2] + K >>> 0, n[3] = n[3] + Y >>> 0, n[4] = n[4] + z >>> 0;
|
|
15631
15631
|
}
|
|
15632
15632
|
return [n[0] >> 24 & 255, n[0] >> 16 & 255, n[0] >> 8 & 255, n[0] & 255, n[1] >> 24 & 255, n[1] >> 16 & 255, n[1] >> 8 & 255, n[1] & 255, n[2] >> 24 & 255, n[2] >> 16 & 255, n[2] >> 8 & 255, n[2] & 255, n[3] >> 24 & 255, n[3] >> 16 & 255, n[3] >> 8 & 255, n[3] & 255, n[4] >> 24 & 255, n[4] >> 16 & 255, n[4] >> 8 & 255, n[4] & 255];
|
|
15633
15633
|
}
|
|
@@ -16162,16 +16162,16 @@ class Hr {
|
|
|
16162
16162
|
const {
|
|
16163
16163
|
accounts: I,
|
|
16164
16164
|
programIdIndex: N
|
|
16165
|
-
} = S,
|
|
16165
|
+
} = S, F = Array.from(Ft.decode(S.data));
|
|
16166
16166
|
let M = [];
|
|
16167
16167
|
Wt(M, I.length);
|
|
16168
16168
|
let k = [];
|
|
16169
|
-
return Wt(k,
|
|
16169
|
+
return Wt(k, F.length), {
|
|
16170
16170
|
programIdIndex: N,
|
|
16171
16171
|
keyIndicesCount: Te.Buffer.from(M),
|
|
16172
16172
|
keyIndices: I,
|
|
16173
16173
|
dataLength: Te.Buffer.from(k),
|
|
16174
|
-
data:
|
|
16174
|
+
data: F
|
|
16175
16175
|
};
|
|
16176
16176
|
});
|
|
16177
16177
|
let s = [];
|
|
@@ -16212,7 +16212,7 @@ class Hr {
|
|
|
16212
16212
|
const d = Zt(n, 0, jn), m = Kt(n);
|
|
16213
16213
|
let g = [];
|
|
16214
16214
|
for (let I = 0; I < m; I++) {
|
|
16215
|
-
const N = Sn(n),
|
|
16215
|
+
const N = Sn(n), F = Kt(n), M = Zt(n, 0, F), k = Kt(n), K = Zt(n, 0, k), Y = Ft.encode(Te.Buffer.from(K));
|
|
16216
16216
|
g.push({
|
|
16217
16217
|
programIdIndex: N,
|
|
16218
16218
|
accounts: M,
|
|
@@ -16305,9 +16305,9 @@ class Zi {
|
|
|
16305
16305
|
if (S !== void 0) {
|
|
16306
16306
|
const [I, {
|
|
16307
16307
|
writable: N,
|
|
16308
|
-
readonly:
|
|
16308
|
+
readonly: F
|
|
16309
16309
|
}] = S;
|
|
16310
|
-
r.push(I), s.writable.push(...N), s.readonly.push(...
|
|
16310
|
+
r.push(I), s.writable.push(...N), s.readonly.push(...F);
|
|
16311
16311
|
}
|
|
16312
16312
|
}
|
|
16313
16313
|
const [o, a] = n.getMessageComponents(), m = new Wi(a, s).compileInstructions(e.instructions);
|
|
@@ -16388,24 +16388,24 @@ class Zi {
|
|
|
16388
16388
|
numReadonlySignedAccounts: Sn(n),
|
|
16389
16389
|
numReadonlyUnsignedAccounts: Sn(n)
|
|
16390
16390
|
}, a = [], d = Kt(n);
|
|
16391
|
-
for (let
|
|
16391
|
+
for (let F = 0; F < d; F++)
|
|
16392
16392
|
a.push(new Ee(Zt(n, 0, jn)));
|
|
16393
16393
|
const m = Ft.encode(Zt(n, 0, jn)), g = Kt(n), S = [];
|
|
16394
|
-
for (let
|
|
16395
|
-
const M = Sn(n), k = Kt(n), K = Zt(n, 0, k), Y = Kt(n),
|
|
16394
|
+
for (let F = 0; F < g; F++) {
|
|
16395
|
+
const M = Sn(n), k = Kt(n), K = Zt(n, 0, k), Y = Kt(n), z = new Uint8Array(Zt(n, 0, Y));
|
|
16396
16396
|
S.push({
|
|
16397
16397
|
programIdIndex: M,
|
|
16398
16398
|
accountKeyIndexes: K,
|
|
16399
|
-
data:
|
|
16399
|
+
data: z
|
|
16400
16400
|
});
|
|
16401
16401
|
}
|
|
16402
16402
|
const I = Kt(n), N = [];
|
|
16403
|
-
for (let
|
|
16404
|
-
const M = new Ee(Zt(n, 0, jn)), k = Kt(n), K = Zt(n, 0, k), Y = Kt(n),
|
|
16403
|
+
for (let F = 0; F < I; F++) {
|
|
16404
|
+
const M = new Ee(Zt(n, 0, jn)), k = Kt(n), K = Zt(n, 0, k), Y = Kt(n), z = Zt(n, 0, Y);
|
|
16405
16405
|
N.push({
|
|
16406
16406
|
accountKey: M,
|
|
16407
16407
|
writableIndexes: K,
|
|
16408
|
-
readonlyIndexes:
|
|
16408
|
+
readonlyIndexes: z
|
|
16409
16409
|
});
|
|
16410
16410
|
}
|
|
16411
16411
|
return new Zi({
|
|
@@ -16607,7 +16607,7 @@ class Yi {
|
|
|
16607
16607
|
}) => {
|
|
16608
16608
|
k ? (S.push(M.toString()), d += 1, K || (m += 1)) : (I.push(M.toString()), K || (g += 1));
|
|
16609
16609
|
});
|
|
16610
|
-
const N = S.concat(I),
|
|
16610
|
+
const N = S.concat(I), F = n.map((M) => {
|
|
16611
16611
|
const {
|
|
16612
16612
|
data: k,
|
|
16613
16613
|
programId: K
|
|
@@ -16618,7 +16618,7 @@ class Yi {
|
|
|
16618
16618
|
data: Ft.encode(k)
|
|
16619
16619
|
};
|
|
16620
16620
|
});
|
|
16621
|
-
return
|
|
16621
|
+
return F.forEach((M) => {
|
|
16622
16622
|
bt(M.programIdIndex >= 0), M.accounts.forEach((k) => bt(k >= 0));
|
|
16623
16623
|
}), new Hr({
|
|
16624
16624
|
header: {
|
|
@@ -16628,7 +16628,7 @@ class Yi {
|
|
|
16628
16628
|
},
|
|
16629
16629
|
accountKeys: N,
|
|
16630
16630
|
recentBlockhash: e,
|
|
16631
|
-
instructions:
|
|
16631
|
+
instructions: F
|
|
16632
16632
|
});
|
|
16633
16633
|
}
|
|
16634
16634
|
/**
|
|
@@ -20329,9 +20329,19 @@ const Q = {
|
|
|
20329
20329
|
...Vx,
|
|
20330
20330
|
tokens: _t[xe.STARKNET_TESTNET]
|
|
20331
20331
|
}
|
|
20332
|
-
};
|
|
20333
|
-
|
|
20334
|
-
|
|
20332
|
+
}, OT = new Set(Object.values(xe));
|
|
20333
|
+
function NT(t) {
|
|
20334
|
+
if (CT(t))
|
|
20335
|
+
return t;
|
|
20336
|
+
const e = xe[t];
|
|
20337
|
+
if (!e)
|
|
20338
|
+
throw new Error(`Invalid chain: ${t}. Chain must be a valid chain alias or internal chain value from Chains.`);
|
|
20339
|
+
return e;
|
|
20340
|
+
}
|
|
20341
|
+
function CT(t) {
|
|
20342
|
+
return OT.has(t);
|
|
20343
|
+
}
|
|
20344
|
+
async function MT(t, e, n) {
|
|
20335
20345
|
if (!n || !e)
|
|
20336
20346
|
throw new Error("Wagmi config not found");
|
|
20337
20347
|
const r = await P1(e, {
|
|
@@ -20349,7 +20359,7 @@ async function OT(t, e, n) {
|
|
|
20349
20359
|
});
|
|
20350
20360
|
}
|
|
20351
20361
|
}
|
|
20352
|
-
async function
|
|
20362
|
+
async function BT(t, e, n) {
|
|
20353
20363
|
if (!n || !e)
|
|
20354
20364
|
throw new Error("Wagmi config not found");
|
|
20355
20365
|
await j1(e);
|
|
@@ -20363,7 +20373,7 @@ async function NT(t, e, n) {
|
|
|
20363
20373
|
t.current?.contentWindow?.postMessage(r, s);
|
|
20364
20374
|
});
|
|
20365
20375
|
}
|
|
20366
|
-
async function
|
|
20376
|
+
async function kT(t, e, n, r, s) {
|
|
20367
20377
|
if (!n || !e)
|
|
20368
20378
|
throw new Error("Wagmi config not found");
|
|
20369
20379
|
let i = null;
|
|
@@ -20392,13 +20402,13 @@ async function CT(t, e, n, r, s) {
|
|
|
20392
20402
|
}
|
|
20393
20403
|
return i;
|
|
20394
20404
|
}
|
|
20395
|
-
async function
|
|
20405
|
+
async function UT(t) {
|
|
20396
20406
|
if (!t)
|
|
20397
20407
|
throw new Error("Wagmi config not found");
|
|
20398
20408
|
const e = new Set(V1(t).map((r) => r.id));
|
|
20399
20409
|
return Object.entries(IT).filter(([, r]) => !e.has(r.chainId)).map(([r]) => r);
|
|
20400
20410
|
}
|
|
20401
|
-
function
|
|
20411
|
+
function LT() {
|
|
20402
20412
|
return /* @__PURE__ */ is("div", {
|
|
20403
20413
|
role: "status",
|
|
20404
20414
|
className: "payment-modal-loader",
|
|
@@ -20418,8 +20428,8 @@ function BT() {
|
|
|
20418
20428
|
})
|
|
20419
20429
|
});
|
|
20420
20430
|
}
|
|
20421
|
-
const
|
|
20422
|
-
function
|
|
20431
|
+
const DT = ["light", "dark", "system"], gi = "https://app.chainrails.io", yi = "https://chainrails-frontend-git-staging-horus-labs.vercel.app";
|
|
20432
|
+
function TI(t) {
|
|
20423
20433
|
const {
|
|
20424
20434
|
amount: e,
|
|
20425
20435
|
styles: n,
|
|
@@ -20434,7 +20444,7 @@ function AI(t) {
|
|
|
20434
20444
|
sessionToken: S,
|
|
20435
20445
|
farcasterMiniApp: I,
|
|
20436
20446
|
wagmiConfig: N
|
|
20437
|
-
} = t, [
|
|
20447
|
+
} = t, [F, M] = Fn(0), [k, K] = Fn(""), [Y, z] = Fn(null), U = gc(null);
|
|
20438
20448
|
Xn.config({
|
|
20439
20449
|
api_key: "",
|
|
20440
20450
|
// @ts-expect-error
|
|
@@ -20443,19 +20453,19 @@ function AI(t) {
|
|
|
20443
20453
|
K(Xn.getPayModalUrl(e));
|
|
20444
20454
|
}, [e]), Jn(() => {
|
|
20445
20455
|
const J = n?.theme;
|
|
20446
|
-
if (!J ||
|
|
20447
|
-
|
|
20456
|
+
if (!J || DT.includes(J)) {
|
|
20457
|
+
z(null);
|
|
20448
20458
|
return;
|
|
20449
20459
|
}
|
|
20450
20460
|
let ne = !1;
|
|
20451
20461
|
return (async () => {
|
|
20452
20462
|
try {
|
|
20453
|
-
const
|
|
20463
|
+
const V = Xn.getBaseUrl(), C = await fetch(`${V}/themes/${J}`);
|
|
20454
20464
|
if (!C.ok) return;
|
|
20455
|
-
const
|
|
20456
|
-
!ne &&
|
|
20457
|
-
} catch (
|
|
20458
|
-
console.error("Failed to fetch theme:",
|
|
20465
|
+
const L = await C.json();
|
|
20466
|
+
!ne && L.status === "approved" && L.cssContent && z(L.cssContent);
|
|
20467
|
+
} catch (V) {
|
|
20468
|
+
console.error("Failed to fetch theme:", V);
|
|
20459
20469
|
}
|
|
20460
20470
|
})(), () => {
|
|
20461
20471
|
ne = !0;
|
|
@@ -20464,37 +20474,44 @@ function AI(t) {
|
|
|
20464
20474
|
const J = document.body.style.overflow;
|
|
20465
20475
|
s ? (document.body.style.overflow = "hidden", document.body.style.overflow = "hidden") : document.body.style.overflow = J || "";
|
|
20466
20476
|
const ne = async (te) => {
|
|
20467
|
-
if (te.data === ln.CLOSED && (a(), d?.()), te
|
|
20477
|
+
if (te.data === ln.CLOSED && (a(), d?.()), te?.data?.type === ln.COMPLETED) {
|
|
20478
|
+
window.setTimeout(a, 2e3);
|
|
20479
|
+
const L = te?.data?.transactionHash ? {
|
|
20480
|
+
transactionHash: te.data.transactionHash
|
|
20481
|
+
} : void 0;
|
|
20482
|
+
m?.(L);
|
|
20483
|
+
}
|
|
20484
|
+
if (te.data === ln.REQUEST_FARCASTER_CONNECT)
|
|
20468
20485
|
try {
|
|
20469
|
-
await
|
|
20470
|
-
} catch (
|
|
20471
|
-
console.error(
|
|
20486
|
+
await MT(U, N, I);
|
|
20487
|
+
} catch (L) {
|
|
20488
|
+
console.error(L);
|
|
20472
20489
|
}
|
|
20473
20490
|
if (te.data === ln.REQUEST_FARCASTER_DISCONNECT)
|
|
20474
20491
|
try {
|
|
20475
|
-
await
|
|
20476
|
-
} catch (
|
|
20477
|
-
console.error(
|
|
20492
|
+
await BT(U, N, I);
|
|
20493
|
+
} catch (L) {
|
|
20494
|
+
console.error(L);
|
|
20478
20495
|
}
|
|
20479
|
-
const
|
|
20480
|
-
if (
|
|
20496
|
+
const C = te.data;
|
|
20497
|
+
if (C?.type === ln.REQUEST_FARCASTER_SEND_TRANSACTION && typeof C.requestId == "string" && C.params)
|
|
20481
20498
|
try {
|
|
20482
|
-
const
|
|
20483
|
-
|
|
20499
|
+
const L = await kT(C.params, N, I, U.current, C.requestId);
|
|
20500
|
+
L ? [gi, yi].forEach((G) => {
|
|
20484
20501
|
U.current?.contentWindow?.postMessage({
|
|
20485
20502
|
type: ln.FARCASTER_SEND_TRANSACTION_RESULT,
|
|
20486
|
-
requestId:
|
|
20487
|
-
hash:
|
|
20488
|
-
},
|
|
20489
|
-
}) : [gi, yi].forEach((
|
|
20503
|
+
requestId: C.requestId,
|
|
20504
|
+
hash: L
|
|
20505
|
+
}, G);
|
|
20506
|
+
}) : [gi, yi].forEach((G) => {
|
|
20490
20507
|
U.current?.contentWindow?.postMessage({
|
|
20491
20508
|
type: ln.FARCASTER_SEND_TRANSACTION_RESULT,
|
|
20492
|
-
requestId:
|
|
20509
|
+
requestId: C.requestId,
|
|
20493
20510
|
error: "sendTransaction not configured or returned no hash"
|
|
20494
|
-
},
|
|
20511
|
+
}, G);
|
|
20495
20512
|
});
|
|
20496
|
-
} catch (
|
|
20497
|
-
console.log(
|
|
20513
|
+
} catch (L) {
|
|
20514
|
+
console.log(L);
|
|
20498
20515
|
}
|
|
20499
20516
|
};
|
|
20500
20517
|
return window.addEventListener("message", ne), () => {
|
|
@@ -20503,15 +20520,15 @@ function AI(t) {
|
|
|
20503
20520
|
}, [s, d, m, a, I, N]), Jn(() => {
|
|
20504
20521
|
if (!S) return;
|
|
20505
20522
|
const J = t.css || Y || void 0, ne = async () => {
|
|
20506
|
-
const
|
|
20523
|
+
const V = await g0.isInMiniApp(), C = V ? await UT(N) : [], G = [...r?.map(NT) || [], ...C];
|
|
20507
20524
|
return {
|
|
20508
20525
|
type: "session",
|
|
20509
20526
|
session_token: S,
|
|
20510
20527
|
environment: Xn.getEnv() || Ec.PRODUCTION,
|
|
20511
20528
|
styles: n,
|
|
20512
20529
|
props: {
|
|
20513
|
-
excludeChains:
|
|
20514
|
-
isFarcasterMiniApp:
|
|
20530
|
+
excludeChains: G.join(","),
|
|
20531
|
+
isFarcasterMiniApp: V
|
|
20515
20532
|
},
|
|
20516
20533
|
...J ? {
|
|
20517
20534
|
css: J
|
|
@@ -20519,43 +20536,43 @@ function AI(t) {
|
|
|
20519
20536
|
};
|
|
20520
20537
|
};
|
|
20521
20538
|
let te = !1;
|
|
20522
|
-
return ne().then((
|
|
20539
|
+
return ne().then((V) => {
|
|
20523
20540
|
te || ([gi, yi].forEach((C) => {
|
|
20524
|
-
U.current?.contentWindow?.postMessage(
|
|
20541
|
+
U.current?.contentWindow?.postMessage(V, C);
|
|
20525
20542
|
}), window.setTimeout(() => {
|
|
20526
20543
|
te || [gi, yi].forEach((C) => {
|
|
20527
|
-
U.current?.contentWindow?.postMessage(
|
|
20544
|
+
U.current?.contentWindow?.postMessage(V, C);
|
|
20528
20545
|
});
|
|
20529
20546
|
}, 1e3));
|
|
20530
20547
|
}), () => {
|
|
20531
20548
|
te = !0;
|
|
20532
20549
|
};
|
|
20533
|
-
}, [S,
|
|
20534
|
-
function
|
|
20550
|
+
}, [S, F, s, n, Y]);
|
|
20551
|
+
function j() {
|
|
20535
20552
|
M(Math.random());
|
|
20536
20553
|
}
|
|
20537
20554
|
return /* @__PURE__ */ El("div", {
|
|
20538
|
-
className: um("payment-modal-wrapper",
|
|
20539
|
-
children: [(
|
|
20555
|
+
className: um("payment-modal-wrapper", F === 0 || i ? "loading" : "not-loading", s ? "open" : "closed"),
|
|
20556
|
+
children: [(F === 0 || i) && /* @__PURE__ */ is(LT, {}), /* @__PURE__ */ is("iframe", {
|
|
20540
20557
|
allow: "clipboard-read *; clipboard-write *",
|
|
20541
20558
|
src: k || void 0,
|
|
20542
|
-
onLoad:
|
|
20543
|
-
className: `payment-modal ${
|
|
20559
|
+
onLoad: j,
|
|
20560
|
+
className: `payment-modal ${F === 0 || i ? "invisible" : "visible"}`,
|
|
20544
20561
|
"data-id": e,
|
|
20545
20562
|
ref: U
|
|
20546
20563
|
}, e)]
|
|
20547
20564
|
});
|
|
20548
20565
|
}
|
|
20549
|
-
const
|
|
20550
|
-
let
|
|
20551
|
-
const pc = Object.getPrototypeOf, mc = /* @__PURE__ */ new WeakMap(), B0 = (t) => t && (mc.has(t) ? mc.get(t) : pc(t) === Object.prototype || pc(t) === Array.prototype), no = (t) => typeof t == "object" && t !== null,
|
|
20566
|
+
const PT = Symbol(), Eu = Symbol(), ss = "a", N0 = "f", ml = "p", C0 = "c", M0 = "t", wu = "h", as = "w", vu = "o", Ru = "k";
|
|
20567
|
+
let FT = (t, e) => new Proxy(t, e);
|
|
20568
|
+
const pc = Object.getPrototypeOf, mc = /* @__PURE__ */ new WeakMap(), B0 = (t) => t && (mc.has(t) ? mc.get(t) : pc(t) === Object.prototype || pc(t) === Array.prototype), no = (t) => typeof t == "object" && t !== null, $T = (t) => Object.values(Object.getOwnPropertyDescriptors(t)).some((e) => !e.configurable && !e.writable), zT = (t) => {
|
|
20552
20569
|
if (Array.isArray(t))
|
|
20553
20570
|
return Array.from(t);
|
|
20554
20571
|
const e = Object.getOwnPropertyDescriptors(t);
|
|
20555
20572
|
return Object.values(e).forEach((n) => {
|
|
20556
20573
|
n.configurable = !0;
|
|
20557
20574
|
}), Object.create(pc(t), e);
|
|
20558
|
-
},
|
|
20575
|
+
}, jT = (t, e) => {
|
|
20559
20576
|
const n = {
|
|
20560
20577
|
[N0]: e
|
|
20561
20578
|
};
|
|
@@ -20577,7 +20594,7 @@ const pc = Object.getPrototypeOf, mc = /* @__PURE__ */ new WeakMap(), B0 = (t) =
|
|
|
20577
20594
|
return d === Eu ? t : (s(Ru, d), k0(Reflect.get(a, d), n[ss], n[C0], n[M0]));
|
|
20578
20595
|
},
|
|
20579
20596
|
has(a, d) {
|
|
20580
|
-
return d ===
|
|
20597
|
+
return d === PT ? (i(), !0) : (s(wu, d), Reflect.has(a, d));
|
|
20581
20598
|
},
|
|
20582
20599
|
getOwnPropertyDescriptor(a, d) {
|
|
20583
20600
|
return s(vu, d), Reflect.getOwnPropertyDescriptor(a, d);
|
|
@@ -20597,12 +20614,12 @@ const pc = Object.getPrototypeOf, mc = /* @__PURE__ */ new WeakMap(), B0 = (t) =
|
|
|
20597
20614
|
let s = r && r.get(t);
|
|
20598
20615
|
if (!s) {
|
|
20599
20616
|
const d = Au(t);
|
|
20600
|
-
|
|
20617
|
+
$T(d) ? s = [d, zT(d)] : s = [d], r?.set(t, s);
|
|
20601
20618
|
}
|
|
20602
20619
|
const [i, o] = s;
|
|
20603
20620
|
let a = n && n.get(i);
|
|
20604
|
-
return (!a || a[1][N0] !== !!o) && (a =
|
|
20605
|
-
},
|
|
20621
|
+
return (!a || a[1][N0] !== !!o) && (a = jT(i, !!o), a[1][ml] = FT(o || i, a[0]), n && n.set(i, a)), a[1][ss] = e, a[1][C0] = n, a[1][M0] = r, a[1][ml];
|
|
20622
|
+
}, VT = (t, e) => {
|
|
20606
20623
|
const n = Reflect.ownKeys(t), r = Reflect.ownKeys(e);
|
|
20607
20624
|
return n.length !== r.length || n.some((s, i) => s !== r[i]);
|
|
20608
20625
|
}, U0 = (t, e, n, r, s = Object.is) => {
|
|
@@ -20623,7 +20640,7 @@ const pc = Object.getPrototypeOf, mc = /* @__PURE__ */ new WeakMap(), B0 = (t) =
|
|
|
20623
20640
|
if (o = Reflect.has(t, a) !== Reflect.has(e, a), o)
|
|
20624
20641
|
return o;
|
|
20625
20642
|
if (i[as] === !0) {
|
|
20626
|
-
if (o =
|
|
20643
|
+
if (o = VT(t, e), o)
|
|
20627
20644
|
return o;
|
|
20628
20645
|
} else
|
|
20629
20646
|
for (const a of i[vu] || []) {
|
|
@@ -20637,9 +20654,9 @@ const pc = Object.getPrototypeOf, mc = /* @__PURE__ */ new WeakMap(), B0 = (t) =
|
|
|
20637
20654
|
if (o === null)
|
|
20638
20655
|
throw new Error("invalid used");
|
|
20639
20656
|
return o;
|
|
20640
|
-
},
|
|
20657
|
+
}, HT = (t) => B0(t) && t[Eu] || null, gl = (t, e = !0) => {
|
|
20641
20658
|
mc.set(t, e);
|
|
20642
|
-
},
|
|
20659
|
+
}, GT = (t, e, n) => {
|
|
20643
20660
|
const r = [], s = /* @__PURE__ */ new WeakSet(), i = (o, a) => {
|
|
20644
20661
|
var d, m, g;
|
|
20645
20662
|
if (s.has(o))
|
|
@@ -20664,7 +20681,7 @@ const pc = Object.getPrototypeOf, mc = /* @__PURE__ */ new WeakMap(), B0 = (t) =
|
|
|
20664
20681
|
} else a && r.push(a);
|
|
20665
20682
|
};
|
|
20666
20683
|
return i(t), r;
|
|
20667
|
-
}, ro = {}, Su = (t) => typeof t == "object" && t !== null,
|
|
20684
|
+
}, ro = {}, Su = (t) => typeof t == "object" && t !== null, qT = (t) => Su(t) && !xu.has(t) && (Array.isArray(t) || !(Symbol.iterator in t)) && !(t instanceof WeakMap) && !(t instanceof WeakSet) && !(t instanceof Error) && !(t instanceof Number) && !(t instanceof Date) && !(t instanceof String) && !(t instanceof RegExp) && !(t instanceof ArrayBuffer) && !(t instanceof Promise), L0 = (t, e) => {
|
|
20668
20685
|
const n = yl.get(t);
|
|
20669
20686
|
if (n?.[0] === e)
|
|
20670
20687
|
return n[1];
|
|
@@ -20692,7 +20709,7 @@ const pc = Object.getPrototypeOf, mc = /* @__PURE__ */ new WeakMap(), B0 = (t) =
|
|
|
20692
20709
|
}
|
|
20693
20710
|
Object.defineProperty(r, s, a);
|
|
20694
20711
|
}), Object.preventExtensions(r);
|
|
20695
|
-
},
|
|
20712
|
+
}, KT = (t, e, n, r) => ({
|
|
20696
20713
|
deleteProperty(s, i) {
|
|
20697
20714
|
const o = Reflect.get(s, i);
|
|
20698
20715
|
n(i);
|
|
@@ -20703,12 +20720,12 @@ const pc = Object.getPrototypeOf, mc = /* @__PURE__ */ new WeakMap(), B0 = (t) =
|
|
|
20703
20720
|
const d = !t() && Reflect.has(s, i), m = Reflect.get(s, i, a);
|
|
20704
20721
|
if (d && (bl(m, o) || so.has(o) && bl(m, so.get(o))))
|
|
20705
20722
|
return !0;
|
|
20706
|
-
n(i), Su(o) && (o =
|
|
20707
|
-
const g = !lr.has(o) &&
|
|
20723
|
+
n(i), Su(o) && (o = HT(o) || o);
|
|
20724
|
+
const g = !lr.has(o) && ZT(o) ? D0(o) : o;
|
|
20708
20725
|
return e(i, g), Reflect.set(s, i, g, a), r(["set", [i], o, m]), !0;
|
|
20709
20726
|
}
|
|
20710
20727
|
}), lr = /* @__PURE__ */ new WeakMap(), xu = /* @__PURE__ */ new WeakSet(), yl = /* @__PURE__ */ new WeakMap(), Oa = [1], so = /* @__PURE__ */ new WeakMap();
|
|
20711
|
-
let bl = Object.is,
|
|
20728
|
+
let bl = Object.is, WT = (t, e) => new Proxy(t, e), ZT = qT, YT = L0, JT = KT;
|
|
20712
20729
|
function D0(t = {}) {
|
|
20713
20730
|
if (!Su(t))
|
|
20714
20731
|
throw new Error("object required");
|
|
@@ -20724,16 +20741,16 @@ function D0(t = {}) {
|
|
|
20724
20741
|
const Y = K[1](k);
|
|
20725
20742
|
Y > n && (n = Y);
|
|
20726
20743
|
})), n), a = (k) => (K, Y) => {
|
|
20727
|
-
const
|
|
20728
|
-
|
|
20744
|
+
const z = [...K];
|
|
20745
|
+
z[1] = [k, ...z[1]], s(z, Y);
|
|
20729
20746
|
}, d = /* @__PURE__ */ new Map(), m = (k, K) => {
|
|
20730
20747
|
const Y = !xu.has(K) && lr.get(K);
|
|
20731
20748
|
if (Y) {
|
|
20732
20749
|
if ((ro ? "production" : void 0) !== "production" && d.has(k))
|
|
20733
20750
|
throw new Error("prop listener already exists");
|
|
20734
20751
|
if (r.size) {
|
|
20735
|
-
const
|
|
20736
|
-
d.set(k, [Y,
|
|
20752
|
+
const z = Y[2](a(k));
|
|
20753
|
+
d.set(k, [Y, z]);
|
|
20737
20754
|
} else
|
|
20738
20755
|
d.set(k, [Y]);
|
|
20739
20756
|
}
|
|
@@ -20741,34 +20758,34 @@ function D0(t = {}) {
|
|
|
20741
20758
|
var K;
|
|
20742
20759
|
const Y = d.get(k);
|
|
20743
20760
|
Y && (d.delete(k), (K = Y[1]) == null || K.call(Y));
|
|
20744
|
-
}, S = (k) => (r.add(k), r.size === 1 && d.forEach(([Y,
|
|
20745
|
-
if ((ro ? "production" : void 0) !== "production" &&
|
|
20761
|
+
}, S = (k) => (r.add(k), r.size === 1 && d.forEach(([Y, z], U) => {
|
|
20762
|
+
if ((ro ? "production" : void 0) !== "production" && z)
|
|
20746
20763
|
throw new Error("remove already exists");
|
|
20747
|
-
const
|
|
20748
|
-
d.set(U, [Y,
|
|
20764
|
+
const j = Y[2](a(U));
|
|
20765
|
+
d.set(U, [Y, j]);
|
|
20749
20766
|
}), () => {
|
|
20750
|
-
r.delete(k), r.size === 0 && d.forEach(([Y,
|
|
20751
|
-
|
|
20767
|
+
r.delete(k), r.size === 0 && d.forEach(([Y, z], U) => {
|
|
20768
|
+
z && (z(), d.set(U, [Y]));
|
|
20752
20769
|
});
|
|
20753
20770
|
});
|
|
20754
20771
|
let I = !0;
|
|
20755
|
-
const N =
|
|
20772
|
+
const N = JT(
|
|
20756
20773
|
() => I,
|
|
20757
20774
|
m,
|
|
20758
20775
|
g,
|
|
20759
20776
|
s
|
|
20760
|
-
),
|
|
20761
|
-
so.set(t,
|
|
20777
|
+
), F = WT(t, N);
|
|
20778
|
+
so.set(t, F);
|
|
20762
20779
|
const M = [t, o, S];
|
|
20763
|
-
return lr.set(
|
|
20780
|
+
return lr.set(F, M), Reflect.ownKeys(t).forEach((k) => {
|
|
20764
20781
|
const K = Object.getOwnPropertyDescriptor(
|
|
20765
20782
|
t,
|
|
20766
20783
|
k
|
|
20767
20784
|
);
|
|
20768
|
-
"value" in K && K.writable && (
|
|
20769
|
-
}), I = !1,
|
|
20785
|
+
"value" in K && K.writable && (F[k] = t[k]);
|
|
20786
|
+
}), I = !1, F;
|
|
20770
20787
|
}
|
|
20771
|
-
function
|
|
20788
|
+
function XT(t, e, n) {
|
|
20772
20789
|
const r = lr.get(t);
|
|
20773
20790
|
(ro ? "production" : void 0) !== "production" && !r && console.warn("Please use proxy object");
|
|
20774
20791
|
let s;
|
|
@@ -20787,15 +20804,15 @@ function _l(t) {
|
|
|
20787
20804
|
const e = lr.get(t);
|
|
20788
20805
|
(ro ? "production" : void 0) !== "production" && !e && console.warn("Please use proxy object");
|
|
20789
20806
|
const [n, r] = e;
|
|
20790
|
-
return
|
|
20807
|
+
return YT(n, r());
|
|
20791
20808
|
}
|
|
20792
|
-
const
|
|
20809
|
+
const QT = {}, eI = (t, e) => {
|
|
20793
20810
|
const n = gc(void 0);
|
|
20794
20811
|
Jn(() => {
|
|
20795
|
-
n.current =
|
|
20812
|
+
n.current = GT(t, e);
|
|
20796
20813
|
}), z0(n.current);
|
|
20797
|
-
},
|
|
20798
|
-
function
|
|
20814
|
+
}, tI = eI, nI = /* @__PURE__ */ new WeakMap();
|
|
20815
|
+
function rI(t, e) {
|
|
20799
20816
|
const r = Uu(
|
|
20800
20817
|
() => t && /* @__PURE__ */ new WeakMap(),
|
|
20801
20818
|
[t]
|
|
@@ -20804,7 +20821,7 @@ function eI(t, e) {
|
|
|
20804
20821
|
const o = P0(
|
|
20805
20822
|
F0(
|
|
20806
20823
|
(d) => {
|
|
20807
|
-
const m =
|
|
20824
|
+
const m = XT(t, d);
|
|
20808
20825
|
return d(), m;
|
|
20809
20826
|
},
|
|
20810
20827
|
[t, void 0]
|
|
@@ -20827,23 +20844,23 @@ function eI(t, e) {
|
|
|
20827
20844
|
);
|
|
20828
20845
|
i = !1, $0(() => {
|
|
20829
20846
|
s.current = o;
|
|
20830
|
-
}), (
|
|
20847
|
+
}), (QT ? "production" : void 0) !== "production" && tI(o, r);
|
|
20831
20848
|
const a = Uu(() => /* @__PURE__ */ new WeakMap(), []);
|
|
20832
|
-
return k0(o, r, a,
|
|
20849
|
+
return k0(o, r, a, nI);
|
|
20833
20850
|
}
|
|
20834
20851
|
const kn = D0({
|
|
20835
20852
|
data: null,
|
|
20836
20853
|
isPending: !1,
|
|
20837
20854
|
error: null
|
|
20838
20855
|
});
|
|
20839
|
-
function
|
|
20856
|
+
function II({
|
|
20840
20857
|
session_url: t,
|
|
20841
20858
|
onCancel: e,
|
|
20842
20859
|
onSuccess: n,
|
|
20843
20860
|
farcasterMiniApp: r,
|
|
20844
20861
|
wagmiConfig: s
|
|
20845
20862
|
}) {
|
|
20846
|
-
const i =
|
|
20863
|
+
const i = rI(kn), [o, a] = Fn(!1), [d, m] = Fn(Date.now()), g = i?.data?.sessionToken, S = i?.data?.amount;
|
|
20847
20864
|
function I() {
|
|
20848
20865
|
g || window.setTimeout(() => {
|
|
20849
20866
|
g && a(!0);
|
|
@@ -20852,7 +20869,7 @@ function SI({
|
|
|
20852
20869
|
function N() {
|
|
20853
20870
|
a(!1);
|
|
20854
20871
|
}
|
|
20855
|
-
const
|
|
20872
|
+
const F = () => {
|
|
20856
20873
|
const M = Date.now();
|
|
20857
20874
|
kn.isPending = !0, kn.error = null, kn.data = null, fetch(t, {
|
|
20858
20875
|
headers: {
|
|
@@ -20861,11 +20878,11 @@ function SI({
|
|
|
20861
20878
|
}).then((k) => k.json()).then((k) => {
|
|
20862
20879
|
M < d || (kn.data = k, kn.isPending = !1, m(M));
|
|
20863
20880
|
}).catch((k) => {
|
|
20864
|
-
M < d || (kn.error = k?.toString(), kn.isPending = !1, m(M), setInterval(
|
|
20881
|
+
M < d || (kn.error = k?.toString(), kn.isPending = !1, m(M), setInterval(F, 5e3));
|
|
20865
20882
|
});
|
|
20866
20883
|
};
|
|
20867
20884
|
return Jn(() => {
|
|
20868
|
-
|
|
20885
|
+
F();
|
|
20869
20886
|
}, [t]), {
|
|
20870
20887
|
sessionToken: g,
|
|
20871
20888
|
amount: S,
|
|
@@ -20875,14 +20892,14 @@ function SI({
|
|
|
20875
20892
|
close: N,
|
|
20876
20893
|
isPending: i.isPending,
|
|
20877
20894
|
error: i.error,
|
|
20878
|
-
refetch:
|
|
20895
|
+
refetch: F,
|
|
20879
20896
|
onSuccess: n,
|
|
20880
20897
|
onCancel: e,
|
|
20881
20898
|
farcasterMiniApp: r,
|
|
20882
20899
|
wagmiConfig: s
|
|
20883
20900
|
};
|
|
20884
20901
|
}
|
|
20885
|
-
function
|
|
20902
|
+
function OI({
|
|
20886
20903
|
sessionToken: t,
|
|
20887
20904
|
amount: e,
|
|
20888
20905
|
onCancel: n,
|
|
@@ -20905,7 +20922,7 @@ function xI({
|
|
|
20905
20922
|
d && a(!0);
|
|
20906
20923
|
}, 200), a(!0);
|
|
20907
20924
|
}
|
|
20908
|
-
function
|
|
20925
|
+
function F() {
|
|
20909
20926
|
a(!1);
|
|
20910
20927
|
}
|
|
20911
20928
|
return {
|
|
@@ -20914,7 +20931,7 @@ function xI({
|
|
|
20914
20931
|
amount: g,
|
|
20915
20932
|
isOpen: o,
|
|
20916
20933
|
open: N,
|
|
20917
|
-
close:
|
|
20934
|
+
close: F,
|
|
20918
20935
|
onSuccess: r,
|
|
20919
20936
|
onCancel: n,
|
|
20920
20937
|
farcasterMiniApp: s,
|
|
@@ -20924,11 +20941,11 @@ function xI({
|
|
|
20924
20941
|
export {
|
|
20925
20942
|
X as AmountSymbols,
|
|
20926
20943
|
Xn as Chainrails,
|
|
20927
|
-
|
|
20928
|
-
|
|
20929
|
-
|
|
20930
|
-
|
|
20944
|
+
oI as Chains,
|
|
20945
|
+
TI as PaymentModal,
|
|
20946
|
+
oI as chains,
|
|
20947
|
+
bI as crapi,
|
|
20931
20948
|
X as tokens,
|
|
20932
|
-
|
|
20933
|
-
|
|
20949
|
+
OI as usePaymentModal,
|
|
20950
|
+
II as usePaymentSession
|
|
20934
20951
|
};
|