@chainrails/react 0.4.4 → 0.4.5
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 +1121 -1116
- package/dist/chainrails-sdk.es.mjs +1121 -1116
- package/dist/chainrails-sdk.umd.js +8 -8
- package/package.json +1 -1
|
@@ -3037,10 +3037,10 @@ function Ag(t, e, { length: n, staticPosition: r }) {
|
|
|
3037
3037
|
const O = [];
|
|
3038
3038
|
for (let N = 0; N < m; ++N) {
|
|
3039
3039
|
t.setPosition(d + (g ? N * 32 : x));
|
|
3040
|
-
const [F,
|
|
3040
|
+
const [F, M] = Tr(t, e, {
|
|
3041
3041
|
staticPosition: d
|
|
3042
3042
|
});
|
|
3043
|
-
x +=
|
|
3043
|
+
x += M, O.push(F);
|
|
3044
3044
|
}
|
|
3045
3045
|
return t.setPosition(r + 32), [O, 32];
|
|
3046
3046
|
}
|
|
@@ -5095,13 +5095,13 @@ class Ly extends Of {
|
|
|
5095
5095
|
for (let x = 0; x < 16; x++, n += 4)
|
|
5096
5096
|
Mn[x] = e.getUint32(n, !1);
|
|
5097
5097
|
for (let x = 16; x < 64; x++) {
|
|
5098
|
-
const O = Mn[x - 15], N = Mn[x - 2], F = on(O, 7) ^ on(O, 18) ^ O >>> 3,
|
|
5099
|
-
Mn[x] =
|
|
5098
|
+
const O = Mn[x - 15], N = Mn[x - 2], F = on(O, 7) ^ on(O, 18) ^ O >>> 3, M = on(N, 17) ^ on(N, 19) ^ N >>> 10;
|
|
5099
|
+
Mn[x] = M + Mn[x - 7] + F + Mn[x - 16] | 0;
|
|
5100
5100
|
}
|
|
5101
5101
|
let { A: r, B: s, C: i, D: o, E: a, F: d, G: m, H: g } = this;
|
|
5102
5102
|
for (let x = 0; x < 64; x++) {
|
|
5103
|
-
const O = on(a, 6) ^ on(a, 11) ^ on(a, 25), N = g + O + My(a, d, m) + ky[x] + Mn[x] | 0,
|
|
5104
|
-
g = m, m = d, d = a, a = o + N | 0, o = i, i = s, s = r, r = N +
|
|
5103
|
+
const O = on(a, 6) ^ on(a, 11) ^ on(a, 25), N = g + O + My(a, d, m) + ky[x] + Mn[x] | 0, M = (on(r, 2) ^ on(r, 13) ^ on(r, 22)) + By(r, s, i) | 0;
|
|
5104
|
+
g = m, m = d, d = a, a = o + N | 0, o = i, i = s, s = r, r = N + M | 0;
|
|
5105
5105
|
}
|
|
5106
5106
|
r = r + this.A | 0, s = s + this.B | 0, i = i + this.C | 0, o = o + this.D | 0, a = a + this.E | 0, d = d + this.F | 0, m = m + this.G | 0, g = g + this.H | 0, this.set(r, s, i, o, a, d, m, g);
|
|
5107
5107
|
}
|
|
@@ -5200,28 +5200,28 @@ class Dy extends Of {
|
|
|
5200
5200
|
}
|
|
5201
5201
|
// prettier-ignore
|
|
5202
5202
|
get() {
|
|
5203
|
-
const { Ah: e, Al: n, Bh: r, Bl: s, Ch: i, Cl: o, Dh: a, Dl: d, Eh: m, El: g, Fh: x, Fl: O, Gh: N, Gl: F, Hh:
|
|
5204
|
-
return [e, n, r, s, i, o, a, d, m, g, x, O, N, F,
|
|
5203
|
+
const { Ah: e, Al: n, Bh: r, Bl: s, Ch: i, Cl: o, Dh: a, Dl: d, Eh: m, El: g, Fh: x, Fl: O, Gh: N, Gl: F, Hh: M, Hl: k } = this;
|
|
5204
|
+
return [e, n, r, s, i, o, a, d, m, g, x, O, N, F, M, k];
|
|
5205
5205
|
}
|
|
5206
5206
|
// prettier-ignore
|
|
5207
|
-
set(e, n, r, s, i, o, a, d, m, g, x, O, N, F,
|
|
5208
|
-
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 = x | 0, this.Fl = O | 0, this.Gh = N | 0, this.Gl = F | 0, this.Hh =
|
|
5207
|
+
set(e, n, r, s, i, o, a, d, m, g, x, O, N, F, M, k) {
|
|
5208
|
+
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 = x | 0, this.Fl = O | 0, this.Gh = N | 0, this.Gl = F | 0, this.Hh = M | 0, this.Hl = k | 0;
|
|
5209
5209
|
}
|
|
5210
5210
|
process(e, n) {
|
|
5211
5211
|
for (let V = 0; V < 16; V++, n += 4)
|
|
5212
5212
|
Bn[V] = e.getUint32(n), kn[V] = e.getUint32(n += 4);
|
|
5213
5213
|
for (let V = 16; V < 80; V++) {
|
|
5214
|
-
const L = Bn[V - 15] | 0, z = kn[V - 15] | 0, J = gr(L, z, 1) ^ gr(L, z, 8) ^ Wu(L, z, 7), te = yr(L, z, 1) ^ yr(L, z, 8) ^ Zu(L, z, 7), ne = Bn[V - 2] | 0, q = kn[V - 2] | 0,
|
|
5214
|
+
const L = Bn[V - 15] | 0, z = kn[V - 15] | 0, J = gr(L, z, 1) ^ gr(L, z, 8) ^ Wu(L, z, 7), te = yr(L, z, 1) ^ yr(L, z, 8) ^ Zu(L, z, 7), ne = Bn[V - 2] | 0, q = kn[V - 2] | 0, C = gr(ne, q, 19) ^ ni(ne, q, 61) ^ Wu(ne, q, 6), P = yr(ne, q, 19) ^ ri(ne, q, 61) ^ Zu(ne, q, 6), j = Lm(te, P, kn[V - 7], kn[V - 16]), E = Pm(j, J, C, Bn[V - 7], Bn[V - 16]);
|
|
5215
5215
|
Bn[V] = E | 0, kn[V] = j | 0;
|
|
5216
5216
|
}
|
|
5217
|
-
let { Ah: r, Al: s, Bh: i, Bl: o, Ch: a, Cl: d, Dh: m, Dl: g, Eh: x, El: O, Fh: N, Fl: F, Gh:
|
|
5217
|
+
let { Ah: r, Al: s, Bh: i, Bl: o, Ch: a, Cl: d, Dh: m, Dl: g, Eh: x, El: O, Fh: N, Fl: F, Gh: M, Gl: k, Hh: K, Hl: Y } = this;
|
|
5218
5218
|
for (let V = 0; V < 80; V++) {
|
|
5219
|
-
const L = gr(x, O, 14) ^ gr(x, O, 18) ^ ni(x, O, 41), z = yr(x, O, 14) ^ yr(x, O, 18) ^ ri(x, O, 41), J = x & N ^ ~x &
|
|
5220
|
-
K =
|
|
5221
|
-
const
|
|
5222
|
-
r = km(
|
|
5219
|
+
const L = gr(x, O, 14) ^ gr(x, O, 18) ^ ni(x, O, 41), z = yr(x, O, 14) ^ yr(x, O, 18) ^ ri(x, O, 41), J = x & N ^ ~x & M, te = O & F ^ ~O & k, ne = Um(Y, z, te, Uy[V], kn[V]), q = Dm(ne, K, L, J, Py[V], Bn[V]), C = ne | 0, P = gr(r, s, 28) ^ ni(r, s, 34) ^ ni(r, s, 39), j = yr(r, s, 28) ^ ri(r, s, 34) ^ ri(r, s, 39), E = r & i ^ r & a ^ i & a, c = s & o ^ s & d ^ o & d;
|
|
5220
|
+
K = M | 0, Y = k | 0, M = N | 0, k = F | 0, N = x | 0, F = O | 0, { h: x, l: O } = gn(m | 0, g | 0, q | 0, C | 0), m = a | 0, g = d | 0, a = i | 0, d = o | 0, i = r | 0, o = s | 0;
|
|
5221
|
+
const h = Bm(C, j, c);
|
|
5222
|
+
r = km(h, q, P, E), s = h | 0;
|
|
5223
5223
|
}
|
|
5224
|
-
({ h: r, l: s } = gn(this.Ah | 0, this.Al | 0, r | 0, s | 0)), { h: i, l: o } = gn(this.Bh | 0, this.Bl | 0, i | 0, o | 0), { h: a, l: d } = gn(this.Ch | 0, this.Cl | 0, a | 0, d | 0), { h: m, l: g } = gn(this.Dh | 0, this.Dl | 0, m | 0, g | 0), { h: x, l: O } = gn(this.Eh | 0, this.El | 0, x | 0, O | 0), { h: N, l: F } = gn(this.Fh | 0, this.Fl | 0, N | 0, F | 0), { h:
|
|
5224
|
+
({ h: r, l: s } = gn(this.Ah | 0, this.Al | 0, r | 0, s | 0)), { h: i, l: o } = gn(this.Bh | 0, this.Bl | 0, i | 0, o | 0), { h: a, l: d } = gn(this.Ch | 0, this.Cl | 0, a | 0, d | 0), { h: m, l: g } = gn(this.Dh | 0, this.Dl | 0, m | 0, g | 0), { h: x, l: O } = gn(this.Eh | 0, this.El | 0, x | 0, O | 0), { h: N, l: F } = gn(this.Fh | 0, this.Fl | 0, N | 0, F | 0), { h: M, l: k } = gn(this.Gh | 0, this.Gl | 0, M | 0, k | 0), { h: K, l: Y } = gn(this.Hh | 0, this.Hl | 0, K | 0, Y | 0), this.set(r, s, i, o, a, d, m, g, x, O, N, F, M, k, K, Y);
|
|
5225
5225
|
}
|
|
5226
5226
|
roundClean() {
|
|
5227
5227
|
Gn(Bn, kn);
|
|
@@ -5330,11 +5330,11 @@ async function zc(t) {
|
|
|
5330
5330
|
return nr(e);
|
|
5331
5331
|
}
|
|
5332
5332
|
async function Wy(t, e) {
|
|
5333
|
-
const { account: n = t.account, accessList: r, authorizationList: s, chain: i = t.chain, blobVersionedHashes: o, blobs: a, data: d, gas: m, gasPrice: g, maxFeePerBlobGas: x, maxFeePerGas: O, maxPriorityFeePerGas: N, nonce: F, nonceManager:
|
|
5334
|
-
if (!n || !
|
|
5333
|
+
const { account: n = t.account, accessList: r, authorizationList: s, chain: i = t.chain, blobVersionedHashes: o, blobs: a, data: d, gas: m, gasPrice: g, maxFeePerBlobGas: x, maxFeePerGas: O, maxPriorityFeePerGas: N, nonce: F, nonceManager: M, to: k, type: K, value: Y, ...V } = e, L = await (async () => {
|
|
5334
|
+
if (!n || !M || typeof F < "u")
|
|
5335
5335
|
return F;
|
|
5336
5336
|
const ne = In(n), q = i ? i.id : await Ct(t, zc, "getChainId")({});
|
|
5337
|
-
return await
|
|
5337
|
+
return await M.consume({
|
|
5338
5338
|
address: ne.address,
|
|
5339
5339
|
chainId: q,
|
|
5340
5340
|
client: t
|
|
@@ -5364,13 +5364,13 @@ async function Wy(t, e) {
|
|
|
5364
5364
|
const ne = await t.request({
|
|
5365
5365
|
method: "eth_fillTransaction",
|
|
5366
5366
|
params: [te]
|
|
5367
|
-
}),
|
|
5368
|
-
delete
|
|
5367
|
+
}), C = (i?.formatters?.transaction?.format || Af)(ne.tx);
|
|
5368
|
+
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);
|
|
5369
5369
|
const P = await (async () => {
|
|
5370
5370
|
if (typeof i?.fees?.baseFeeMultiplier == "function") {
|
|
5371
|
-
const
|
|
5371
|
+
const h = await Ct(t, Ts, "getBlock")({});
|
|
5372
5372
|
return i.fees.baseFeeMultiplier({
|
|
5373
|
-
block:
|
|
5373
|
+
block: h,
|
|
5374
5374
|
client: t,
|
|
5375
5375
|
request: e
|
|
5376
5376
|
});
|
|
@@ -5379,12 +5379,12 @@ async function Wy(t, e) {
|
|
|
5379
5379
|
})();
|
|
5380
5380
|
if (P < 1)
|
|
5381
5381
|
throw new Rf();
|
|
5382
|
-
const E = 10 ** (P.toString().split(".")[1]?.length ?? 0), c = (
|
|
5383
|
-
return
|
|
5382
|
+
const E = 10 ** (P.toString().split(".")[1]?.length ?? 0), c = (h) => h * BigInt(Math.ceil(P * E)) / BigInt(E);
|
|
5383
|
+
return C.maxFeePerGas && !e.maxFeePerGas && (C.maxFeePerGas = c(C.maxFeePerGas)), C.gasPrice && !e.gasPrice && (C.gasPrice = c(C.gasPrice)), {
|
|
5384
5384
|
raw: ne.raw,
|
|
5385
5385
|
transaction: {
|
|
5386
5386
|
from: te.from,
|
|
5387
|
-
...
|
|
5387
|
+
...C
|
|
5388
5388
|
}
|
|
5389
5389
|
};
|
|
5390
5390
|
} catch (ne) {
|
|
@@ -5435,7 +5435,7 @@ async function Lf(t, e) {
|
|
|
5435
5435
|
phase: "beforeFillTransaction"
|
|
5436
5436
|
}), x ??= n.nonce);
|
|
5437
5437
|
const N = ((o.includes("blobVersionedHashes") || o.includes("sidecars")) && n.kzg && n.blobs || ea.get(t.uid) === !1 || !["fees", "gas"].some((z) => o.includes(z)) ? !1 : !!(o.includes("chainId") && typeof n.chainId != "number" || o.includes("nonce") && typeof x != "number" || o.includes("fees") && typeof n.gasPrice != "bigint" && (typeof n.maxFeePerGas != "bigint" || typeof n.maxPriorityFeePerGas != "bigint") || o.includes("gas") && typeof n.gas != "bigint")) ? await Ct(t, Wy, "fillTransaction")({ ...n, nonce: x }).then((L) => {
|
|
5438
|
-
const { chainId: z, from: J, gas: te, gasPrice: ne, nonce: q, maxFeePerBlobGas:
|
|
5438
|
+
const { chainId: z, from: J, gas: te, gasPrice: ne, nonce: q, maxFeePerBlobGas: C, maxFeePerGas: P, maxPriorityFeePerGas: j, type: E, ...c } = L.transaction;
|
|
5439
5439
|
return ea.set(t.uid, !0), {
|
|
5440
5440
|
...n,
|
|
5441
5441
|
...J ? { from: J } : {},
|
|
@@ -5444,7 +5444,7 @@ async function Lf(t, e) {
|
|
|
5444
5444
|
...typeof te < "u" ? { gas: te } : {},
|
|
5445
5445
|
...typeof ne < "u" ? { gasPrice: ne } : {},
|
|
5446
5446
|
...typeof q < "u" ? { nonce: q } : {},
|
|
5447
|
-
...typeof
|
|
5447
|
+
...typeof C < "u" ? { maxFeePerBlobGas: C } : {},
|
|
5448
5448
|
...typeof P < "u" ? { maxFeePerGas: P } : {},
|
|
5449
5449
|
...typeof j < "u" ? { maxPriorityFeePerGas: j } : {},
|
|
5450
5450
|
..."nonceKey" in c && typeof c.nonceKey < "u" ? { nonceKey: c.nonceKey } : {}
|
|
@@ -5461,7 +5461,7 @@ async function Lf(t, e) {
|
|
|
5461
5461
|
...g ? { from: g?.address } : {},
|
|
5462
5462
|
...x ? { nonce: x } : {}
|
|
5463
5463
|
};
|
|
5464
|
-
const { blobs: F, gas:
|
|
5464
|
+
const { blobs: F, gas: M, kzg: k, type: K } = n;
|
|
5465
5465
|
a?.fn && a.runAt?.includes("beforeFillParameters") && (n = await a.fn({ ...n, chain: s }, {
|
|
5466
5466
|
phase: "beforeFillParameters"
|
|
5467
5467
|
}));
|
|
@@ -5525,7 +5525,7 @@ async function Lf(t, e) {
|
|
|
5525
5525
|
n.gasPrice = z;
|
|
5526
5526
|
}
|
|
5527
5527
|
}
|
|
5528
|
-
return o.includes("gas") && typeof
|
|
5528
|
+
return o.includes("gas") && typeof M > "u" && (n.gas = await Ct(t, Zy, "estimateGas")({
|
|
5529
5529
|
...n,
|
|
5530
5530
|
account: g,
|
|
5531
5531
|
prepare: g?.type === "local" ? [] : ["blobVersionedHashes"]
|
|
@@ -5550,7 +5550,7 @@ async function Zy(t, e) {
|
|
|
5550
5550
|
}).catch(() => {
|
|
5551
5551
|
throw new ue("`to` is required. Could not infer from `authorizationList`");
|
|
5552
5552
|
});
|
|
5553
|
-
})(), { accessList: a, authorizationList: d, blobs: m, blobVersionedHashes: g, blockNumber: x, blockTag: O, data: N, gas: F, gasPrice:
|
|
5553
|
+
})(), { accessList: a, authorizationList: d, blobs: m, blobVersionedHashes: g, blockNumber: x, blockTag: O, data: N, gas: F, gasPrice: M, maxFeePerBlobGas: k, maxFeePerGas: K, maxPriorityFeePerGas: Y, nonce: V, value: L, stateOverride: z, ...J } = r ? await Lf(t, {
|
|
5554
5554
|
...e,
|
|
5555
5555
|
parameters: i,
|
|
5556
5556
|
to: o
|
|
@@ -5559,16 +5559,16 @@ async function Zy(t, e) {
|
|
|
5559
5559
|
return F;
|
|
5560
5560
|
const ne = (typeof x == "bigint" ? Be(x) : void 0) || O, q = hy(z);
|
|
5561
5561
|
lo(e);
|
|
5562
|
-
const
|
|
5562
|
+
const C = t.chain?.formatters?.transactionRequest?.format, j = (C || Dc)({
|
|
5563
5563
|
// Pick out extra data that might exist on the chain's transaction request type.
|
|
5564
|
-
...Uc(J, { format:
|
|
5564
|
+
...Uc(J, { format: C }),
|
|
5565
5565
|
account: s,
|
|
5566
5566
|
accessList: a,
|
|
5567
5567
|
authorizationList: d,
|
|
5568
5568
|
blobs: m,
|
|
5569
5569
|
blobVersionedHashes: g,
|
|
5570
5570
|
data: N,
|
|
5571
|
-
gasPrice:
|
|
5571
|
+
gasPrice: M,
|
|
5572
5572
|
maxFeePerBlobGas: k,
|
|
5573
5573
|
maxFeePerGas: K,
|
|
5574
5574
|
maxPriorityFeePerGas: Y,
|
|
@@ -5854,9 +5854,9 @@ function s1(t) {
|
|
|
5854
5854
|
for (; !d.eql(O, d.ONE); ) {
|
|
5855
5855
|
if (d.is0(O))
|
|
5856
5856
|
return d.ZERO;
|
|
5857
|
-
let F = 1,
|
|
5858
|
-
for (; !d.eql(
|
|
5859
|
-
if (F++,
|
|
5857
|
+
let F = 1, M = d.sqr(O);
|
|
5858
|
+
for (; !d.eql(M, d.ONE); )
|
|
5859
|
+
if (F++, M = d.sqr(M), F === g)
|
|
5860
5860
|
throw new Error("Cannot find square root");
|
|
5861
5861
|
const k = wt << BigInt(g - F - 1), K = d.pow(x, k);
|
|
5862
5862
|
g = F, x = d.sqr(K), O = d.mul(O, x), N = d.mul(N, K);
|
|
@@ -6136,15 +6136,15 @@ function Wf(t, e, n, r) {
|
|
|
6136
6136
|
let O = o;
|
|
6137
6137
|
for (let N = x; N >= 0; N -= d) {
|
|
6138
6138
|
g.fill(o);
|
|
6139
|
-
for (let
|
|
6140
|
-
const k = r[
|
|
6141
|
-
g[K] = g[K].add(n[
|
|
6139
|
+
for (let M = 0; M < i; M++) {
|
|
6140
|
+
const k = r[M], K = Number(k >> BigInt(N) & m);
|
|
6141
|
+
g[K] = g[K].add(n[M]);
|
|
6142
6142
|
}
|
|
6143
6143
|
let F = o;
|
|
6144
|
-
for (let
|
|
6145
|
-
k = k.add(g[
|
|
6144
|
+
for (let M = g.length - 1, k = o; M > 0; M--)
|
|
6145
|
+
k = k.add(g[M]), F = F.add(k);
|
|
6146
6146
|
if (O = O.add(F), N !== 0)
|
|
6147
|
-
for (let
|
|
6147
|
+
for (let M = 0; M < d; M++)
|
|
6148
6148
|
O = O.double();
|
|
6149
6149
|
}
|
|
6150
6150
|
return O;
|
|
@@ -6330,7 +6330,7 @@ function g1(t) {
|
|
|
6330
6330
|
return J && (ne = Ve(ne, te)), Qt("private key", ne, yt, te), ne;
|
|
6331
6331
|
}
|
|
6332
6332
|
function O(V) {
|
|
6333
|
-
if (!(V instanceof
|
|
6333
|
+
if (!(V instanceof M))
|
|
6334
6334
|
throw new Error("ProjectivePoint expected");
|
|
6335
6335
|
}
|
|
6336
6336
|
const N = xi((V, L) => {
|
|
@@ -6339,12 +6339,12 @@ function g1(t) {
|
|
|
6339
6339
|
return { x: z, y: J };
|
|
6340
6340
|
const ne = V.is0();
|
|
6341
6341
|
L == null && (L = ne ? n.ONE : n.inv(te));
|
|
6342
|
-
const q = n.mul(z, L),
|
|
6342
|
+
const q = n.mul(z, L), C = n.mul(J, L), P = n.mul(te, L);
|
|
6343
6343
|
if (ne)
|
|
6344
6344
|
return { x: n.ZERO, y: n.ZERO };
|
|
6345
6345
|
if (!n.eql(P, n.ONE))
|
|
6346
6346
|
throw new Error("invZ was invalid");
|
|
6347
|
-
return { x: q, y:
|
|
6347
|
+
return { x: q, y: C };
|
|
6348
6348
|
}), F = xi((V) => {
|
|
6349
6349
|
if (V.is0()) {
|
|
6350
6350
|
if (e.allowInfinityPoint && !n.is0(V.py))
|
|
@@ -6360,7 +6360,7 @@ function g1(t) {
|
|
|
6360
6360
|
throw new Error("bad point: not in prime-order subgroup");
|
|
6361
6361
|
return !0;
|
|
6362
6362
|
});
|
|
6363
|
-
class
|
|
6363
|
+
class M {
|
|
6364
6364
|
constructor(L, z, J) {
|
|
6365
6365
|
if (L == null || !n.isValid(L))
|
|
6366
6366
|
throw new Error("x required");
|
|
@@ -6376,10 +6376,10 @@ function g1(t) {
|
|
|
6376
6376
|
const { x: z, y: J } = L || {};
|
|
6377
6377
|
if (!L || !n.isValid(z) || !n.isValid(J))
|
|
6378
6378
|
throw new Error("invalid affine point");
|
|
6379
|
-
if (L instanceof
|
|
6379
|
+
if (L instanceof M)
|
|
6380
6380
|
throw new Error("projective point not allowed");
|
|
6381
6381
|
const te = (ne) => n.eql(ne, n.ZERO);
|
|
6382
|
-
return te(z) && te(J) ?
|
|
6382
|
+
return te(z) && te(J) ? M.ZERO : new M(z, J, n.ONE);
|
|
6383
6383
|
}
|
|
6384
6384
|
get x() {
|
|
6385
6385
|
return this.toAffine().x;
|
|
@@ -6395,23 +6395,23 @@ function g1(t) {
|
|
|
6395
6395
|
*/
|
|
6396
6396
|
static normalizeZ(L) {
|
|
6397
6397
|
const z = jc(n, L.map((J) => J.pz));
|
|
6398
|
-
return L.map((J, te) => J.toAffine(z[te])).map(
|
|
6398
|
+
return L.map((J, te) => J.toAffine(z[te])).map(M.fromAffine);
|
|
6399
6399
|
}
|
|
6400
6400
|
/**
|
|
6401
6401
|
* Converts hash string or Uint8Array to Point.
|
|
6402
6402
|
* @param hex short/long ECDSA hex
|
|
6403
6403
|
*/
|
|
6404
6404
|
static fromHex(L) {
|
|
6405
|
-
const z =
|
|
6405
|
+
const z = M.fromAffine(i(Ye("pointHex", L)));
|
|
6406
6406
|
return z.assertValidity(), z;
|
|
6407
6407
|
}
|
|
6408
6408
|
// Multiplies generator point by privateKey.
|
|
6409
6409
|
static fromPrivateKey(L) {
|
|
6410
|
-
return
|
|
6410
|
+
return M.BASE.multiply(x(L));
|
|
6411
6411
|
}
|
|
6412
6412
|
// Multiscalar Multiplication
|
|
6413
6413
|
static msm(L, z) {
|
|
6414
|
-
return Wf(
|
|
6414
|
+
return Wf(M, r, L, z);
|
|
6415
6415
|
}
|
|
6416
6416
|
// "Private method", don't use it directly
|
|
6417
6417
|
_setWindowSize(L) {
|
|
@@ -6432,14 +6432,14 @@ function g1(t) {
|
|
|
6432
6432
|
*/
|
|
6433
6433
|
equals(L) {
|
|
6434
6434
|
O(L);
|
|
6435
|
-
const { px: z, py: J, pz: te } = this, { px: ne, py: q, pz:
|
|
6435
|
+
const { px: z, py: J, pz: te } = this, { px: ne, py: q, pz: C } = L, P = n.eql(n.mul(z, C), n.mul(ne, te)), j = n.eql(n.mul(J, C), n.mul(q, te));
|
|
6436
6436
|
return P && j;
|
|
6437
6437
|
}
|
|
6438
6438
|
/**
|
|
6439
6439
|
* Flips point to one corresponding to (x, -y) in Affine coordinates.
|
|
6440
6440
|
*/
|
|
6441
6441
|
negate() {
|
|
6442
|
-
return new
|
|
6442
|
+
return new M(this.px, n.neg(this.py), this.pz);
|
|
6443
6443
|
}
|
|
6444
6444
|
// Renes-Costello-Batina exception-free doubling formula.
|
|
6445
6445
|
// There is 30% faster Jacobian formula, but it is not complete.
|
|
@@ -6447,8 +6447,8 @@ function g1(t) {
|
|
|
6447
6447
|
// Cost: 8M + 3S + 3*a + 2*b3 + 15add.
|
|
6448
6448
|
double() {
|
|
6449
6449
|
const { a: L, b: z } = e, J = n.mul(z, oa), { px: te, py: ne, pz: q } = this;
|
|
6450
|
-
let
|
|
6451
|
-
return y = n.add(y, y), j = n.mul(te, q), j = n.add(j, j),
|
|
6450
|
+
let C = n.ZERO, P = n.ZERO, j = n.ZERO, E = n.mul(te, te), c = n.mul(ne, ne), h = n.mul(q, q), y = n.mul(te, ne);
|
|
6451
|
+
return y = n.add(y, y), j = n.mul(te, q), j = n.add(j, j), C = n.mul(L, j), P = n.mul(J, h), P = n.add(C, P), C = n.sub(c, P), P = n.add(c, P), P = n.mul(C, P), C = n.mul(y, C), j = n.mul(J, j), h = n.mul(L, h), y = n.sub(E, h), y = n.mul(L, y), y = n.add(y, j), j = n.add(E, E), E = n.add(j, E), E = n.add(E, h), E = n.mul(E, y), P = n.add(P, E), h = n.mul(ne, q), h = n.add(h, h), E = n.mul(h, y), C = n.sub(C, E), j = n.mul(h, c), j = n.add(j, j), j = n.add(j, j), new M(C, P, j);
|
|
6452
6452
|
}
|
|
6453
6453
|
// Renes-Costello-Batina exception-free addition formula.
|
|
6454
6454
|
// There is 30% faster Jacobian formula, but it is not complete.
|
|
@@ -6456,22 +6456,22 @@ function g1(t) {
|
|
|
6456
6456
|
// Cost: 12M + 0S + 3*a + 3*b3 + 23add.
|
|
6457
6457
|
add(L) {
|
|
6458
6458
|
O(L);
|
|
6459
|
-
const { px: z, py: J, pz: te } = this, { px: ne, py: q, pz:
|
|
6459
|
+
const { px: z, py: J, pz: te } = this, { px: ne, py: q, pz: C } = L;
|
|
6460
6460
|
let P = n.ZERO, j = n.ZERO, E = n.ZERO;
|
|
6461
|
-
const c = e.a,
|
|
6462
|
-
let y = n.mul(z, ne), A = n.mul(J, q), v = n.mul(te,
|
|
6461
|
+
const c = e.a, h = n.mul(e.b, oa);
|
|
6462
|
+
let y = n.mul(z, ne), A = n.mul(J, q), v = n.mul(te, C), R = n.add(z, J), I = n.add(ne, q);
|
|
6463
6463
|
R = n.mul(R, I), I = n.add(y, A), R = n.sub(R, I), I = n.add(z, te);
|
|
6464
|
-
let b = n.add(ne,
|
|
6465
|
-
return I = n.mul(I, b), b = n.add(y, v), I = n.sub(I, b), b = n.add(J, te), P = n.add(q,
|
|
6464
|
+
let b = n.add(ne, C);
|
|
6465
|
+
return I = n.mul(I, b), b = n.add(y, v), I = n.sub(I, b), b = n.add(J, te), P = n.add(q, C), b = n.mul(b, P), P = n.add(A, v), b = n.sub(b, P), E = n.mul(c, I), P = n.mul(h, v), E = n.add(P, E), P = n.sub(A, E), E = n.add(A, E), j = n.mul(P, E), A = n.add(y, y), A = n.add(A, y), v = n.mul(c, v), I = n.mul(h, I), A = n.add(A, v), v = n.sub(y, v), v = n.mul(c, v), I = n.add(I, v), y = n.mul(A, I), j = n.add(j, y), y = n.mul(b, I), P = n.mul(R, P), P = n.sub(P, y), y = n.mul(R, A), E = n.mul(b, E), E = n.add(E, y), new M(P, j, E);
|
|
6466
6466
|
}
|
|
6467
6467
|
subtract(L) {
|
|
6468
6468
|
return this.add(L.negate());
|
|
6469
6469
|
}
|
|
6470
6470
|
is0() {
|
|
6471
|
-
return this.equals(
|
|
6471
|
+
return this.equals(M.ZERO);
|
|
6472
6472
|
}
|
|
6473
6473
|
wNAF(L) {
|
|
6474
|
-
return Y.wNAFCached(this, L,
|
|
6474
|
+
return Y.wNAFCached(this, L, M.normalizeZ);
|
|
6475
6475
|
}
|
|
6476
6476
|
/**
|
|
6477
6477
|
* Non-constant-time multiplication. Uses double-and-add algorithm.
|
|
@@ -6481,17 +6481,17 @@ function g1(t) {
|
|
|
6481
6481
|
multiplyUnsafe(L) {
|
|
6482
6482
|
const { endo: z, n: J } = e;
|
|
6483
6483
|
Qt("scalar", L, Rn, J);
|
|
6484
|
-
const te =
|
|
6484
|
+
const te = M.ZERO;
|
|
6485
6485
|
if (L === Rn)
|
|
6486
6486
|
return te;
|
|
6487
6487
|
if (this.is0() || L === yt)
|
|
6488
6488
|
return this;
|
|
6489
6489
|
if (!z || Y.hasPrecomputes(this))
|
|
6490
|
-
return Y.wNAFCachedUnsafe(this, L,
|
|
6491
|
-
let { k1neg: ne, k1: q, k2neg:
|
|
6490
|
+
return Y.wNAFCachedUnsafe(this, L, M.normalizeZ);
|
|
6491
|
+
let { k1neg: ne, k1: q, k2neg: C, k2: P } = z.splitScalar(L), j = te, E = te, c = this;
|
|
6492
6492
|
for (; q > Rn || P > Rn; )
|
|
6493
6493
|
q & yt && (j = j.add(c)), P & yt && (E = E.add(c)), c = c.double(), q >>= yt, P >>= yt;
|
|
6494
|
-
return ne && (j = j.negate()),
|
|
6494
|
+
return ne && (j = j.negate()), C && (E = E.negate()), E = new M(n.mul(E.px, z.beta), E.py, E.pz), j.add(E);
|
|
6495
6495
|
}
|
|
6496
6496
|
/**
|
|
6497
6497
|
* Constant time multiplication.
|
|
@@ -6507,14 +6507,14 @@ function g1(t) {
|
|
|
6507
6507
|
Qt("scalar", L, yt, J);
|
|
6508
6508
|
let te, ne;
|
|
6509
6509
|
if (z) {
|
|
6510
|
-
const { k1neg: q, k1:
|
|
6511
|
-
let { p: E, f: c } = this.wNAF(
|
|
6512
|
-
E = Y.constTimeNegate(q, E),
|
|
6510
|
+
const { k1neg: q, k1: C, k2neg: P, k2: j } = z.splitScalar(L);
|
|
6511
|
+
let { p: E, f: c } = this.wNAF(C), { p: h, f: y } = this.wNAF(j);
|
|
6512
|
+
E = Y.constTimeNegate(q, E), h = Y.constTimeNegate(P, h), h = new M(n.mul(h.px, z.beta), h.py, h.pz), te = E.add(h), ne = c.add(y);
|
|
6513
6513
|
} else {
|
|
6514
|
-
const { p: q, f:
|
|
6515
|
-
te = q, ne =
|
|
6514
|
+
const { p: q, f: C } = this.wNAF(L);
|
|
6515
|
+
te = q, ne = C;
|
|
6516
6516
|
}
|
|
6517
|
-
return
|
|
6517
|
+
return M.normalizeZ([te, ne])[0];
|
|
6518
6518
|
}
|
|
6519
6519
|
/**
|
|
6520
6520
|
* Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly.
|
|
@@ -6523,7 +6523,7 @@ function g1(t) {
|
|
|
6523
6523
|
* @returns non-zero affine point
|
|
6524
6524
|
*/
|
|
6525
6525
|
multiplyAndAddUnsafe(L, z, J) {
|
|
6526
|
-
const te =
|
|
6526
|
+
const te = M.BASE, ne = (C, P) => P === Rn || P === yt || !C.equals(te) ? C.multiplyUnsafe(P) : C.multiply(P), q = ne(this, z).add(ne(L, J));
|
|
6527
6527
|
return q.is0() ? void 0 : q;
|
|
6528
6528
|
}
|
|
6529
6529
|
// Converts Projective point to affine (x, y) coordinates.
|
|
@@ -6537,25 +6537,25 @@ function g1(t) {
|
|
|
6537
6537
|
if (L === yt)
|
|
6538
6538
|
return !0;
|
|
6539
6539
|
if (z)
|
|
6540
|
-
return z(
|
|
6540
|
+
return z(M, this);
|
|
6541
6541
|
throw new Error("isTorsionFree() has not been declared for the elliptic curve");
|
|
6542
6542
|
}
|
|
6543
6543
|
clearCofactor() {
|
|
6544
6544
|
const { h: L, clearCofactor: z } = e;
|
|
6545
|
-
return L === yt ? this : z ? z(
|
|
6545
|
+
return L === yt ? this : z ? z(M, this) : this.multiplyUnsafe(e.h);
|
|
6546
6546
|
}
|
|
6547
6547
|
toRawBytes(L = !0) {
|
|
6548
|
-
return zn("isCompressed", L), this.assertValidity(), s(
|
|
6548
|
+
return zn("isCompressed", L), this.assertValidity(), s(M, this, L);
|
|
6549
6549
|
}
|
|
6550
6550
|
toHex(L = !0) {
|
|
6551
6551
|
return zn("isCompressed", L), Ur(this.toRawBytes(L));
|
|
6552
6552
|
}
|
|
6553
6553
|
}
|
|
6554
|
-
|
|
6555
|
-
const { endo: k, nBitLength: K } = e, Y = Kf(
|
|
6554
|
+
M.BASE = new M(e.Gx, e.Gy, n.ONE), M.ZERO = new M(n.ZERO, n.ONE, n.ZERO);
|
|
6555
|
+
const { endo: k, nBitLength: K } = e, Y = Kf(M, k ? Math.ceil(K / 2) : K);
|
|
6556
6556
|
return {
|
|
6557
6557
|
CURVE: e,
|
|
6558
|
-
ProjectivePoint:
|
|
6558
|
+
ProjectivePoint: M,
|
|
6559
6559
|
normPrivateKeyToScalar: x,
|
|
6560
6560
|
weierstrassEquation: o,
|
|
6561
6561
|
isWithinCurveOrder: g
|
|
@@ -6575,20 +6575,20 @@ function y1(t) {
|
|
|
6575
6575
|
}
|
|
6576
6576
|
function _1(t) {
|
|
6577
6577
|
const e = y1(t), { Fp: n, n: r, nByteLength: s, nBitLength: i } = e, o = n.BYTES + 1, a = 2 * n.BYTES + 1;
|
|
6578
|
-
function d(
|
|
6579
|
-
return Ve(
|
|
6578
|
+
function d(h) {
|
|
6579
|
+
return Ve(h, r);
|
|
6580
6580
|
}
|
|
6581
|
-
function m(
|
|
6582
|
-
return Ya(
|
|
6581
|
+
function m(h) {
|
|
6582
|
+
return Ya(h, r);
|
|
6583
6583
|
}
|
|
6584
6584
|
const { ProjectivePoint: g, normPrivateKeyToScalar: x, weierstrassEquation: O, isWithinCurveOrder: N } = g1({
|
|
6585
6585
|
...e,
|
|
6586
|
-
toBytes(
|
|
6586
|
+
toBytes(h, y, A) {
|
|
6587
6587
|
const v = y.toAffine(), R = n.toBytes(v.x), I = Dr;
|
|
6588
6588
|
return zn("isCompressed", A), A ? I(Uint8Array.from([y.hasEvenY() ? 2 : 3]), R) : I(Uint8Array.from([4]), R, n.toBytes(v.y));
|
|
6589
6589
|
},
|
|
6590
|
-
fromBytes(
|
|
6591
|
-
const y =
|
|
6590
|
+
fromBytes(h) {
|
|
6591
|
+
const y = h.length, A = h[0], v = h.subarray(1);
|
|
6592
6592
|
if (y === o && (A === 2 || A === 3)) {
|
|
6593
6593
|
const R = er(v);
|
|
6594
6594
|
if (!Lc(R, yt, n.ORDER))
|
|
@@ -6612,14 +6612,14 @@ function _1(t) {
|
|
|
6612
6612
|
}
|
|
6613
6613
|
}
|
|
6614
6614
|
});
|
|
6615
|
-
function F(
|
|
6615
|
+
function F(h) {
|
|
6616
6616
|
const y = r >> yt;
|
|
6617
|
-
return
|
|
6617
|
+
return h > y;
|
|
6618
6618
|
}
|
|
6619
|
-
function
|
|
6620
|
-
return F(
|
|
6619
|
+
function M(h) {
|
|
6620
|
+
return F(h) ? d(-h) : h;
|
|
6621
6621
|
}
|
|
6622
|
-
const k = (
|
|
6622
|
+
const k = (h, y, A) => er(h.slice(y, A));
|
|
6623
6623
|
class K {
|
|
6624
6624
|
constructor(y, A, v) {
|
|
6625
6625
|
Qt("r", y, yt, r), Qt("s", A, yt, r), this.r = y, this.s = A, v != null && (this.recovery = v), Object.freeze(this);
|
|
@@ -6680,9 +6680,9 @@ function _1(t) {
|
|
|
6680
6680
|
}
|
|
6681
6681
|
}
|
|
6682
6682
|
const Y = {
|
|
6683
|
-
isValidPrivateKey(
|
|
6683
|
+
isValidPrivateKey(h) {
|
|
6684
6684
|
try {
|
|
6685
|
-
return x(
|
|
6685
|
+
return x(h), !0;
|
|
6686
6686
|
} catch {
|
|
6687
6687
|
return !1;
|
|
6688
6688
|
}
|
|
@@ -6693,8 +6693,8 @@ function _1(t) {
|
|
|
6693
6693
|
* (groupLen + ceil(groupLen / 2)) with modulo bias being negligible.
|
|
6694
6694
|
*/
|
|
6695
6695
|
randomPrivateKey: () => {
|
|
6696
|
-
const
|
|
6697
|
-
return d1(e.randomBytes(
|
|
6696
|
+
const h = Gf(e.n);
|
|
6697
|
+
return d1(e.randomBytes(h), e.n);
|
|
6698
6698
|
},
|
|
6699
6699
|
/**
|
|
6700
6700
|
* Creates precompute table for an arbitrary EC point. Makes point "cached".
|
|
@@ -6704,47 +6704,47 @@ function _1(t) {
|
|
|
6704
6704
|
* const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey));
|
|
6705
6705
|
* fast.multiply(privKey); // much faster ECDH now
|
|
6706
6706
|
*/
|
|
6707
|
-
precompute(
|
|
6708
|
-
return y._setWindowSize(
|
|
6707
|
+
precompute(h = 8, y = g.BASE) {
|
|
6708
|
+
return y._setWindowSize(h), y.multiply(BigInt(3)), y;
|
|
6709
6709
|
}
|
|
6710
6710
|
};
|
|
6711
|
-
function V(
|
|
6712
|
-
return g.fromPrivateKey(
|
|
6711
|
+
function V(h, y = !0) {
|
|
6712
|
+
return g.fromPrivateKey(h).toRawBytes(y);
|
|
6713
6713
|
}
|
|
6714
|
-
function L(
|
|
6715
|
-
if (typeof
|
|
6714
|
+
function L(h) {
|
|
6715
|
+
if (typeof h == "bigint")
|
|
6716
6716
|
return !1;
|
|
6717
|
-
if (
|
|
6717
|
+
if (h instanceof g)
|
|
6718
6718
|
return !0;
|
|
6719
|
-
const A = Ye("key",
|
|
6719
|
+
const A = Ye("key", h).length, v = n.BYTES, R = v + 1, I = 2 * v + 1;
|
|
6720
6720
|
if (!(e.allowedPrivateKeyLengths || s === R))
|
|
6721
6721
|
return A === R || A === I;
|
|
6722
6722
|
}
|
|
6723
|
-
function z(
|
|
6724
|
-
if (L(
|
|
6723
|
+
function z(h, y, A = !0) {
|
|
6724
|
+
if (L(h) === !0)
|
|
6725
6725
|
throw new Error("first arg must be private key");
|
|
6726
6726
|
if (L(y) === !1)
|
|
6727
6727
|
throw new Error("second arg must be public key");
|
|
6728
|
-
return g.fromHex(y).multiply(x(
|
|
6728
|
+
return g.fromHex(y).multiply(x(h)).toRawBytes(A);
|
|
6729
6729
|
}
|
|
6730
|
-
const J = e.bits2int || function(
|
|
6731
|
-
if (
|
|
6730
|
+
const J = e.bits2int || function(h) {
|
|
6731
|
+
if (h.length > 8192)
|
|
6732
6732
|
throw new Error("input is too large");
|
|
6733
|
-
const y = er(
|
|
6733
|
+
const y = er(h), A = h.length * 8 - i;
|
|
6734
6734
|
return A > 0 ? y >> BigInt(A) : y;
|
|
6735
|
-
}, te = e.bits2int_modN || function(
|
|
6736
|
-
return d(J(
|
|
6735
|
+
}, te = e.bits2int_modN || function(h) {
|
|
6736
|
+
return d(J(h));
|
|
6737
6737
|
}, ne = uo(i);
|
|
6738
|
-
function q(
|
|
6739
|
-
return Qt("num < 2^" + i,
|
|
6738
|
+
function q(h) {
|
|
6739
|
+
return Qt("num < 2^" + i, h, Rn, ne), qs(h, s);
|
|
6740
6740
|
}
|
|
6741
|
-
function
|
|
6741
|
+
function C(h, y, A = P) {
|
|
6742
6742
|
if (["recovered", "canonical"].some((oe) => oe in A))
|
|
6743
6743
|
throw new Error("sign() legacy options not supported");
|
|
6744
6744
|
const { hash: v, randomBytes: R } = e;
|
|
6745
6745
|
let { lowS: I, prehash: b, extraEntropy: u } = A;
|
|
6746
|
-
I == null && (I = !0),
|
|
6747
|
-
const l = te(
|
|
6746
|
+
I == null && (I = !0), h = Ye("msgHash", h), pd(A), b && (h = Ye("prehashed msgHash", v(h)));
|
|
6747
|
+
const l = te(h), w = x(y), T = [q(w), q(l)];
|
|
6748
6748
|
if (u != null && u !== !1) {
|
|
6749
6749
|
const oe = u === !0 ? R(n.BYTES) : u;
|
|
6750
6750
|
T.push(Ye("extraEntropy", oe));
|
|
@@ -6761,18 +6761,18 @@ function _1(t) {
|
|
|
6761
6761
|
if (ve === Rn)
|
|
6762
6762
|
return;
|
|
6763
6763
|
let Te = (we.x === Pe ? 0 : 2) | Number(we.y & yt), sn = ve;
|
|
6764
|
-
return I && F(ve) && (sn =
|
|
6764
|
+
return I && F(ve) && (sn = M(ve), Te ^= 1), new K(Pe, sn, Te);
|
|
6765
6765
|
}
|
|
6766
6766
|
return { seed: D, k2sig: re };
|
|
6767
6767
|
}
|
|
6768
6768
|
const P = { lowS: e.lowS, prehash: !1 }, j = { lowS: e.lowS, prehash: !1 };
|
|
6769
|
-
function E(
|
|
6770
|
-
const { seed: v, k2sig: R } =
|
|
6769
|
+
function E(h, y, A = P) {
|
|
6770
|
+
const { seed: v, k2sig: R } = C(h, y, A), I = e;
|
|
6771
6771
|
return cy(I.hash.outputLen, I.nByteLength, I.hmac)(v, R);
|
|
6772
6772
|
}
|
|
6773
6773
|
g.BASE._setWindowSize(8);
|
|
6774
|
-
function c(
|
|
6775
|
-
const R =
|
|
6774
|
+
function c(h, y, A, v = j) {
|
|
6775
|
+
const R = h;
|
|
6776
6776
|
y = Ye("msgHash", y), A = Ye("publicKey", A);
|
|
6777
6777
|
const { lowS: I, prehash: b, format: u } = v;
|
|
6778
6778
|
if (pd(v), "strict" in v)
|
|
@@ -6829,7 +6829,7 @@ function w1(t, e) {
|
|
|
6829
6829
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
6830
6830
|
const Zf = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"), md = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"), E1 = BigInt(0), v1 = BigInt(1), Xa = BigInt(2), gd = (t, e) => (t + e / Xa) / e;
|
|
6831
6831
|
function R1(t) {
|
|
6832
|
-
const e = Zf, 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, x = Ke(g, n, e) * g % e, O = Ke(x, n, e) * g % e, N = Ke(O, Xa, e) * m % e, F = Ke(N, s, e) * N % e,
|
|
6832
|
+
const e = Zf, 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, x = Ke(g, n, e) * g % e, O = Ke(x, n, e) * g % e, N = Ke(O, Xa, e) * m % e, F = Ke(N, s, e) * N % e, M = Ke(F, i, e) * F % e, k = Ke(M, a, e) * M % e, K = Ke(k, d, e) * k % e, Y = Ke(K, a, e) * M % e, V = Ke(Y, n, e) * g % e, L = Ke(V, o, e) * F % e, z = Ke(L, r, e) * m % e, J = Ke(z, Xa, e);
|
|
6833
6833
|
if (!Qa.eql(Qa.sqr(J), t))
|
|
6834
6834
|
throw new Error("Cannot find square root");
|
|
6835
6835
|
return J;
|
|
@@ -6890,7 +6890,7 @@ async function x1(t, { serializedTransaction: e }) {
|
|
|
6890
6890
|
}
|
|
6891
6891
|
const ca = new Gs(128);
|
|
6892
6892
|
async function Jf(t, e) {
|
|
6893
|
-
const { account: n = t.account, chain: r = t.chain, accessList: s, authorizationList: i, blobs: o, data: a, gas: d, gasPrice: m, maxFeePerBlobGas: g, maxFeePerGas: x, maxPriorityFeePerGas: O, nonce: N, type: F, value:
|
|
6893
|
+
const { account: n = t.account, chain: r = t.chain, accessList: s, authorizationList: i, blobs: o, data: a, gas: d, gasPrice: m, maxFeePerBlobGas: g, maxFeePerGas: x, maxPriorityFeePerGas: O, nonce: N, type: F, value: M, ...k } = e;
|
|
6894
6894
|
if (typeof n > "u")
|
|
6895
6895
|
throw new Yf({
|
|
6896
6896
|
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
@@ -6931,7 +6931,7 @@ async function Jf(t, e) {
|
|
|
6931
6931
|
nonce: N,
|
|
6932
6932
|
to: Y,
|
|
6933
6933
|
type: F,
|
|
6934
|
-
value:
|
|
6934
|
+
value: M
|
|
6935
6935
|
}, "sendTransaction"), te = ca.get(t.uid), ne = te ? "wallet_sendTransaction" : "eth_sendTransaction";
|
|
6936
6936
|
try {
|
|
6937
6937
|
return await t.request({
|
|
@@ -6941,16 +6941,16 @@ async function Jf(t, e) {
|
|
|
6941
6941
|
} catch (q) {
|
|
6942
6942
|
if (te === !1)
|
|
6943
6943
|
throw q;
|
|
6944
|
-
const
|
|
6945
|
-
if (
|
|
6944
|
+
const C = q;
|
|
6945
|
+
if (C.name === "InvalidInputRpcError" || C.name === "InvalidParamsRpcError" || C.name === "MethodNotFoundRpcError" || C.name === "MethodNotSupportedRpcError")
|
|
6946
6946
|
return await t.request({
|
|
6947
6947
|
method: "wallet_sendTransaction",
|
|
6948
6948
|
params: [J]
|
|
6949
6949
|
}, { retryCount: 0 }).then((P) => (ca.set(t.uid, !0), P)).catch((P) => {
|
|
6950
6950
|
const j = P;
|
|
6951
|
-
throw j.name === "MethodNotFoundRpcError" || j.name === "MethodNotSupportedRpcError" ? (ca.set(t.uid, !1),
|
|
6951
|
+
throw j.name === "MethodNotFoundRpcError" || j.name === "MethodNotSupportedRpcError" ? (ca.set(t.uid, !1), C) : j;
|
|
6952
6952
|
});
|
|
6953
|
-
throw
|
|
6953
|
+
throw C;
|
|
6954
6954
|
}
|
|
6955
6955
|
}
|
|
6956
6956
|
if (K?.type === "local") {
|
|
@@ -6970,7 +6970,7 @@ async function Jf(t, e) {
|
|
|
6970
6970
|
nonceManager: K.nonceManager,
|
|
6971
6971
|
parameters: [...kf, "sidecars"],
|
|
6972
6972
|
type: F,
|
|
6973
|
-
value:
|
|
6973
|
+
value: M,
|
|
6974
6974
|
...k,
|
|
6975
6975
|
to: Y
|
|
6976
6976
|
}), L = r?.serializers?.transaction, z = await K.signTransaction(V, {
|
|
@@ -7020,8 +7020,8 @@ async function Oi(t, e) {
|
|
|
7020
7020
|
account: N,
|
|
7021
7021
|
...O
|
|
7022
7022
|
});
|
|
7023
|
-
} catch (
|
|
7024
|
-
throw iy(
|
|
7023
|
+
} catch (M) {
|
|
7024
|
+
throw iy(M, {
|
|
7025
7025
|
abi: o,
|
|
7026
7026
|
address: d,
|
|
7027
7027
|
args: m,
|
|
@@ -7212,11 +7212,11 @@ function nh(t = 11) {
|
|
|
7212
7212
|
return ai.substring(oi, oi++ + t);
|
|
7213
7213
|
}
|
|
7214
7214
|
function k1(t) {
|
|
7215
|
-
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, x = t.cacheTime ?? g, O = t.account ? In(t.account) : void 0, { config: N, request: F, value:
|
|
7215
|
+
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, x = t.cacheTime ?? g, O = t.account ? In(t.account) : void 0, { config: N, request: F, value: M } = t.transport({
|
|
7216
7216
|
account: O,
|
|
7217
7217
|
chain: n,
|
|
7218
7218
|
pollingInterval: g
|
|
7219
|
-
}), k = { ...N, ...
|
|
7219
|
+
}), k = { ...N, ...M }, K = {
|
|
7220
7220
|
account: O,
|
|
7221
7221
|
batch: e,
|
|
7222
7222
|
cacheTime: x,
|
|
@@ -7479,9 +7479,9 @@ function j1() {
|
|
|
7479
7479
|
var g = n ? n + m : m, x = this._events[g];
|
|
7480
7480
|
return x ? x.fn ? 1 : x.length : 0;
|
|
7481
7481
|
}, a.prototype.emit = function(m, g, x, O, N, F) {
|
|
7482
|
-
var
|
|
7483
|
-
if (!this._events[
|
|
7484
|
-
var k = this._events[
|
|
7482
|
+
var M = n ? n + m : m;
|
|
7483
|
+
if (!this._events[M]) return !1;
|
|
7484
|
+
var k = this._events[M], K = arguments.length, Y, V;
|
|
7485
7485
|
if (k.fn) {
|
|
7486
7486
|
switch (k.once && this.removeListener(m, k.fn, void 0, !0), K) {
|
|
7487
7487
|
case 1:
|
|
@@ -7536,8 +7536,8 @@ function j1() {
|
|
|
7536
7536
|
if (F.fn)
|
|
7537
7537
|
F.fn === g && (!O || F.once) && (!x || F.context === x) && o(this, N);
|
|
7538
7538
|
else {
|
|
7539
|
-
for (var
|
|
7540
|
-
(F[
|
|
7539
|
+
for (var M = 0, k = [], K = F.length; M < K; M++)
|
|
7540
|
+
(F[M].fn !== g || O && !F[M].once || x && F[M].context !== x) && k.push(F[M]);
|
|
7541
7541
|
k.length ? this._events[N] = k.length === 1 ? k[0] : k : o(this, N);
|
|
7542
7542
|
}
|
|
7543
7543
|
return this;
|
|
@@ -10513,20 +10513,20 @@ function eb() {
|
|
|
10513
10513
|
var F = N.length;
|
|
10514
10514
|
if (F % 4 > 0)
|
|
10515
10515
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
10516
|
-
var
|
|
10517
|
-
|
|
10518
|
-
var k =
|
|
10519
|
-
return [
|
|
10516
|
+
var M = N.indexOf("=");
|
|
10517
|
+
M === -1 && (M = F);
|
|
10518
|
+
var k = M === F ? 0 : 4 - M % 4;
|
|
10519
|
+
return [M, k];
|
|
10520
10520
|
}
|
|
10521
10521
|
function a(N) {
|
|
10522
|
-
var F = o(N),
|
|
10523
|
-
return (
|
|
10522
|
+
var F = o(N), M = F[0], k = F[1];
|
|
10523
|
+
return (M + k) * 3 / 4 - k;
|
|
10524
10524
|
}
|
|
10525
|
-
function d(N, F,
|
|
10526
|
-
return (F +
|
|
10525
|
+
function d(N, F, M) {
|
|
10526
|
+
return (F + M) * 3 / 4 - M;
|
|
10527
10527
|
}
|
|
10528
10528
|
function m(N) {
|
|
10529
|
-
var F,
|
|
10529
|
+
var F, M = o(N), k = M[0], K = M[1], Y = new n(d(N, k, K)), V = 0, L = K > 0 ? k - 4 : k, z;
|
|
10530
10530
|
for (z = 0; z < L; z += 4)
|
|
10531
10531
|
F = e[N.charCodeAt(z)] << 18 | e[N.charCodeAt(z + 1)] << 12 | e[N.charCodeAt(z + 2)] << 6 | e[N.charCodeAt(z + 3)], Y[V++] = F >> 16 & 255, Y[V++] = F >> 8 & 255, Y[V++] = F & 255;
|
|
10532
10532
|
return K === 2 && (F = e[N.charCodeAt(z)] << 2 | e[N.charCodeAt(z + 1)] >> 4, Y[V++] = F & 255), K === 1 && (F = e[N.charCodeAt(z)] << 10 | e[N.charCodeAt(z + 1)] << 4 | e[N.charCodeAt(z + 2)] >> 2, Y[V++] = F >> 8 & 255, Y[V++] = F & 255), Y;
|
|
@@ -10534,17 +10534,17 @@ function eb() {
|
|
|
10534
10534
|
function g(N) {
|
|
10535
10535
|
return t[N >> 18 & 63] + t[N >> 12 & 63] + t[N >> 6 & 63] + t[N & 63];
|
|
10536
10536
|
}
|
|
10537
|
-
function x(N, F,
|
|
10538
|
-
for (var k, K = [], Y = F; Y <
|
|
10537
|
+
function x(N, F, M) {
|
|
10538
|
+
for (var k, K = [], Y = F; Y < M; Y += 3)
|
|
10539
10539
|
k = (N[Y] << 16 & 16711680) + (N[Y + 1] << 8 & 65280) + (N[Y + 2] & 255), K.push(g(k));
|
|
10540
10540
|
return K.join("");
|
|
10541
10541
|
}
|
|
10542
10542
|
function O(N) {
|
|
10543
|
-
for (var F,
|
|
10543
|
+
for (var F, M = N.length, k = M % 3, K = [], Y = 16383, V = 0, L = M - k; V < L; V += Y)
|
|
10544
10544
|
K.push(x(N, V, V + Y > L ? L : V + Y));
|
|
10545
|
-
return k === 1 ? (F = N[
|
|
10545
|
+
return k === 1 ? (F = N[M - 1], K.push(
|
|
10546
10546
|
t[F >> 2] + t[F << 4 & 63] + "=="
|
|
10547
|
-
)) : k === 2 && (F = (N[
|
|
10547
|
+
)) : k === 2 && (F = (N[M - 2] << 8) + N[M - 1], K.push(
|
|
10548
10548
|
t[F >> 10] + t[F >> 4 & 63] + t[F << 2 & 63] + "="
|
|
10549
10549
|
)), K.join("");
|
|
10550
10550
|
}
|
|
@@ -10569,12 +10569,12 @@ function tb() {
|
|
|
10569
10569
|
}
|
|
10570
10570
|
return (N ? -1 : 1) * o * Math.pow(2, i - r);
|
|
10571
10571
|
}, ci.write = function(t, e, n, r, s, i) {
|
|
10572
|
-
var o, a, d, m = i * 8 - s - 1, g = (1 << m) - 1, x = g >> 1, O = s === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, N = r ? 0 : i - 1, F = r ? 1 : -1,
|
|
10572
|
+
var o, a, d, m = i * 8 - s - 1, g = (1 << m) - 1, x = g >> 1, O = 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;
|
|
10573
10573
|
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 + x >= 1 ? e += O / d : e += O * Math.pow(2, 1 - x), e * d >= 2 && (o++, d /= 2), o + x >= g ? (a = 0, o = g) : o + x >= 1 ? (a = (e * d - 1) * Math.pow(2, s), o = o + x) : (a = e * Math.pow(2, x - 1) * Math.pow(2, s), o = 0)); s >= 8; t[n + N] = a & 255, N += F, a /= 256, s -= 8)
|
|
10574
10574
|
;
|
|
10575
10575
|
for (o = o << s | a, m += s; m > 0; t[n + N] = o & 255, N += F, o /= 256, m -= 8)
|
|
10576
10576
|
;
|
|
10577
|
-
t[n + N - F] |=
|
|
10577
|
+
t[n + N - F] |= M * 128;
|
|
10578
10578
|
}), ci;
|
|
10579
10579
|
}
|
|
10580
10580
|
/*!
|
|
@@ -10621,7 +10621,7 @@ function Xc() {
|
|
|
10621
10621
|
const f = new Uint8Array(_);
|
|
10622
10622
|
return Object.setPrototypeOf(f, a.prototype), f;
|
|
10623
10623
|
}
|
|
10624
|
-
function a(_, f,
|
|
10624
|
+
function a(_, f, p) {
|
|
10625
10625
|
if (typeof _ == "number") {
|
|
10626
10626
|
if (typeof f == "string")
|
|
10627
10627
|
throw new TypeError(
|
|
@@ -10629,10 +10629,10 @@ function Xc() {
|
|
|
10629
10629
|
);
|
|
10630
10630
|
return x(_);
|
|
10631
10631
|
}
|
|
10632
|
-
return d(_, f,
|
|
10632
|
+
return d(_, f, p);
|
|
10633
10633
|
}
|
|
10634
10634
|
a.poolSize = 8192;
|
|
10635
|
-
function d(_, f,
|
|
10635
|
+
function d(_, f, p) {
|
|
10636
10636
|
if (typeof _ == "string")
|
|
10637
10637
|
return O(_, f);
|
|
10638
10638
|
if (ArrayBuffer.isView(_))
|
|
@@ -10642,24 +10642,24 @@ function Xc() {
|
|
|
10642
10642
|
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof _
|
|
10643
10643
|
);
|
|
10644
10644
|
if (Vt(_, ArrayBuffer) || _ && Vt(_.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (Vt(_, SharedArrayBuffer) || _ && Vt(_.buffer, SharedArrayBuffer)))
|
|
10645
|
-
return
|
|
10645
|
+
return M(_, f, p);
|
|
10646
10646
|
if (typeof _ == "number")
|
|
10647
10647
|
throw new TypeError(
|
|
10648
10648
|
'The "value" argument must not be of type number. Received type number'
|
|
10649
10649
|
);
|
|
10650
10650
|
const S = _.valueOf && _.valueOf();
|
|
10651
10651
|
if (S != null && S !== _)
|
|
10652
|
-
return a.from(S, f,
|
|
10652
|
+
return a.from(S, f, p);
|
|
10653
10653
|
const U = k(_);
|
|
10654
10654
|
if (U) return U;
|
|
10655
10655
|
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof _[Symbol.toPrimitive] == "function")
|
|
10656
|
-
return a.from(_[Symbol.toPrimitive]("string"), f,
|
|
10656
|
+
return a.from(_[Symbol.toPrimitive]("string"), f, p);
|
|
10657
10657
|
throw new TypeError(
|
|
10658
10658
|
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof _
|
|
10659
10659
|
);
|
|
10660
10660
|
}
|
|
10661
|
-
a.from = function(_, f,
|
|
10662
|
-
return d(_, f,
|
|
10661
|
+
a.from = function(_, f, p) {
|
|
10662
|
+
return d(_, f, p);
|
|
10663
10663
|
}, Object.setPrototypeOf(a.prototype, Uint8Array.prototype), Object.setPrototypeOf(a, Uint8Array);
|
|
10664
10664
|
function m(_) {
|
|
10665
10665
|
if (typeof _ != "number")
|
|
@@ -10667,11 +10667,11 @@ function Xc() {
|
|
|
10667
10667
|
if (_ < 0)
|
|
10668
10668
|
throw new RangeError('The value "' + _ + '" is invalid for option "size"');
|
|
10669
10669
|
}
|
|
10670
|
-
function g(_, f,
|
|
10671
|
-
return m(_), _ <= 0 ? o(_) : f !== void 0 ? typeof
|
|
10670
|
+
function g(_, f, p) {
|
|
10671
|
+
return m(_), _ <= 0 ? o(_) : f !== void 0 ? typeof p == "string" ? o(_).fill(f, p) : o(_).fill(f) : o(_);
|
|
10672
10672
|
}
|
|
10673
|
-
a.alloc = function(_, f,
|
|
10674
|
-
return g(_, f,
|
|
10673
|
+
a.alloc = function(_, f, p) {
|
|
10674
|
+
return g(_, f, p);
|
|
10675
10675
|
};
|
|
10676
10676
|
function x(_) {
|
|
10677
10677
|
return m(_), o(_ < 0 ? 0 : K(_) | 0);
|
|
@@ -10684,36 +10684,36 @@ function Xc() {
|
|
|
10684
10684
|
function O(_, f) {
|
|
10685
10685
|
if ((typeof f != "string" || f === "") && (f = "utf8"), !a.isEncoding(f))
|
|
10686
10686
|
throw new TypeError("Unknown encoding: " + f);
|
|
10687
|
-
const
|
|
10688
|
-
let S = o(
|
|
10687
|
+
const p = V(_, f) | 0;
|
|
10688
|
+
let S = o(p);
|
|
10689
10689
|
const U = S.write(_, f);
|
|
10690
|
-
return U !==
|
|
10690
|
+
return U !== p && (S = S.slice(0, U)), S;
|
|
10691
10691
|
}
|
|
10692
10692
|
function N(_) {
|
|
10693
|
-
const f = _.length < 0 ? 0 : K(_.length) | 0,
|
|
10693
|
+
const f = _.length < 0 ? 0 : K(_.length) | 0, p = o(f);
|
|
10694
10694
|
for (let S = 0; S < f; S += 1)
|
|
10695
|
-
|
|
10696
|
-
return
|
|
10695
|
+
p[S] = _[S] & 255;
|
|
10696
|
+
return p;
|
|
10697
10697
|
}
|
|
10698
10698
|
function F(_) {
|
|
10699
10699
|
if (Vt(_, Uint8Array)) {
|
|
10700
10700
|
const f = new Uint8Array(_);
|
|
10701
|
-
return
|
|
10701
|
+
return M(f.buffer, f.byteOffset, f.byteLength);
|
|
10702
10702
|
}
|
|
10703
10703
|
return N(_);
|
|
10704
10704
|
}
|
|
10705
|
-
function
|
|
10705
|
+
function M(_, f, p) {
|
|
10706
10706
|
if (f < 0 || _.byteLength < f)
|
|
10707
10707
|
throw new RangeError('"offset" is outside of buffer bounds');
|
|
10708
|
-
if (_.byteLength < f + (
|
|
10708
|
+
if (_.byteLength < f + (p || 0))
|
|
10709
10709
|
throw new RangeError('"length" is outside of buffer bounds');
|
|
10710
10710
|
let S;
|
|
10711
|
-
return f === void 0 &&
|
|
10711
|
+
return f === void 0 && p === void 0 ? S = new Uint8Array(_) : p === void 0 ? S = new Uint8Array(_, f) : S = new Uint8Array(_, f, p), Object.setPrototypeOf(S, a.prototype), S;
|
|
10712
10712
|
}
|
|
10713
10713
|
function k(_) {
|
|
10714
10714
|
if (a.isBuffer(_)) {
|
|
10715
|
-
const f = K(_.length) | 0,
|
|
10716
|
-
return
|
|
10715
|
+
const f = K(_.length) | 0, p = o(f);
|
|
10716
|
+
return p.length === 0 || _.copy(p, 0, 0, f), p;
|
|
10717
10717
|
}
|
|
10718
10718
|
if (_.length !== void 0)
|
|
10719
10719
|
return typeof _.length != "number" || ze(_.length) ? o(0) : N(_);
|
|
@@ -10730,16 +10730,16 @@ function Xc() {
|
|
|
10730
10730
|
}
|
|
10731
10731
|
a.isBuffer = function(f) {
|
|
10732
10732
|
return f != null && f._isBuffer === !0 && f !== a.prototype;
|
|
10733
|
-
}, a.compare = function(f,
|
|
10734
|
-
if (Vt(f, Uint8Array) && (f = a.from(f, f.offset, f.byteLength)), Vt(
|
|
10733
|
+
}, a.compare = function(f, p) {
|
|
10734
|
+
if (Vt(f, Uint8Array) && (f = a.from(f, f.offset, f.byteLength)), Vt(p, Uint8Array) && (p = a.from(p, p.offset, p.byteLength)), !a.isBuffer(f) || !a.isBuffer(p))
|
|
10735
10735
|
throw new TypeError(
|
|
10736
10736
|
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
|
|
10737
10737
|
);
|
|
10738
|
-
if (f ===
|
|
10739
|
-
let S = f.length, U =
|
|
10738
|
+
if (f === p) return 0;
|
|
10739
|
+
let S = f.length, U = p.length;
|
|
10740
10740
|
for (let $ = 0, Z = Math.min(S, U); $ < Z; ++$)
|
|
10741
|
-
if (f[$] !==
|
|
10742
|
-
S = f[$], U =
|
|
10741
|
+
if (f[$] !== p[$]) {
|
|
10742
|
+
S = f[$], U = p[$];
|
|
10743
10743
|
break;
|
|
10744
10744
|
}
|
|
10745
10745
|
return S < U ? -1 : U < S ? 1 : 0;
|
|
@@ -10760,16 +10760,16 @@ function Xc() {
|
|
|
10760
10760
|
default:
|
|
10761
10761
|
return !1;
|
|
10762
10762
|
}
|
|
10763
|
-
}, a.concat = function(f,
|
|
10763
|
+
}, a.concat = function(f, p) {
|
|
10764
10764
|
if (!Array.isArray(f))
|
|
10765
10765
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
10766
10766
|
if (f.length === 0)
|
|
10767
10767
|
return a.alloc(0);
|
|
10768
10768
|
let S;
|
|
10769
|
-
if (
|
|
10770
|
-
for (
|
|
10771
|
-
|
|
10772
|
-
const U = a.allocUnsafe(
|
|
10769
|
+
if (p === void 0)
|
|
10770
|
+
for (p = 0, S = 0; S < f.length; ++S)
|
|
10771
|
+
p += f[S].length;
|
|
10772
|
+
const U = a.allocUnsafe(p);
|
|
10773
10773
|
let $ = 0;
|
|
10774
10774
|
for (S = 0; S < f.length; ++S) {
|
|
10775
10775
|
let Z = f[S];
|
|
@@ -10796,15 +10796,15 @@ function Xc() {
|
|
|
10796
10796
|
throw new TypeError(
|
|
10797
10797
|
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof _
|
|
10798
10798
|
);
|
|
10799
|
-
const
|
|
10800
|
-
if (!S &&
|
|
10799
|
+
const p = _.length, S = arguments.length > 2 && arguments[2] === !0;
|
|
10800
|
+
if (!S && p === 0) return 0;
|
|
10801
10801
|
let U = !1;
|
|
10802
10802
|
for (; ; )
|
|
10803
10803
|
switch (f) {
|
|
10804
10804
|
case "ascii":
|
|
10805
10805
|
case "latin1":
|
|
10806
10806
|
case "binary":
|
|
10807
|
-
return
|
|
10807
|
+
return p;
|
|
10808
10808
|
case "utf8":
|
|
10809
10809
|
case "utf-8":
|
|
10810
10810
|
return ke(_).length;
|
|
@@ -10812,9 +10812,9 @@ function Xc() {
|
|
|
10812
10812
|
case "ucs-2":
|
|
10813
10813
|
case "utf16le":
|
|
10814
10814
|
case "utf-16le":
|
|
10815
|
-
return
|
|
10815
|
+
return p * 2;
|
|
10816
10816
|
case "hex":
|
|
10817
|
-
return
|
|
10817
|
+
return p >>> 1;
|
|
10818
10818
|
case "base64":
|
|
10819
10819
|
return De(_).length;
|
|
10820
10820
|
default:
|
|
@@ -10824,59 +10824,59 @@ function Xc() {
|
|
|
10824
10824
|
}
|
|
10825
10825
|
}
|
|
10826
10826
|
a.byteLength = V;
|
|
10827
|
-
function L(_, f,
|
|
10827
|
+
function L(_, f, p) {
|
|
10828
10828
|
let S = !1;
|
|
10829
|
-
if ((f === void 0 || f < 0) && (f = 0), f > this.length || ((
|
|
10829
|
+
if ((f === void 0 || f < 0) && (f = 0), f > this.length || ((p === void 0 || p > this.length) && (p = this.length), p <= 0) || (p >>>= 0, f >>>= 0, p <= f))
|
|
10830
10830
|
return "";
|
|
10831
10831
|
for (_ || (_ = "utf8"); ; )
|
|
10832
10832
|
switch (_) {
|
|
10833
10833
|
case "hex":
|
|
10834
|
-
return R(this, f,
|
|
10834
|
+
return R(this, f, p);
|
|
10835
10835
|
case "utf8":
|
|
10836
10836
|
case "utf-8":
|
|
10837
|
-
return c(this, f,
|
|
10837
|
+
return c(this, f, p);
|
|
10838
10838
|
case "ascii":
|
|
10839
|
-
return A(this, f,
|
|
10839
|
+
return A(this, f, p);
|
|
10840
10840
|
case "latin1":
|
|
10841
10841
|
case "binary":
|
|
10842
|
-
return v(this, f,
|
|
10842
|
+
return v(this, f, p);
|
|
10843
10843
|
case "base64":
|
|
10844
|
-
return E(this, f,
|
|
10844
|
+
return E(this, f, p);
|
|
10845
10845
|
case "ucs2":
|
|
10846
10846
|
case "ucs-2":
|
|
10847
10847
|
case "utf16le":
|
|
10848
10848
|
case "utf-16le":
|
|
10849
|
-
return I(this, f,
|
|
10849
|
+
return I(this, f, p);
|
|
10850
10850
|
default:
|
|
10851
10851
|
if (S) throw new TypeError("Unknown encoding: " + _);
|
|
10852
10852
|
_ = (_ + "").toLowerCase(), S = !0;
|
|
10853
10853
|
}
|
|
10854
10854
|
}
|
|
10855
10855
|
a.prototype._isBuffer = !0;
|
|
10856
|
-
function z(_, f,
|
|
10856
|
+
function z(_, f, p) {
|
|
10857
10857
|
const S = _[f];
|
|
10858
|
-
_[f] = _[
|
|
10858
|
+
_[f] = _[p], _[p] = S;
|
|
10859
10859
|
}
|
|
10860
10860
|
a.prototype.swap16 = function() {
|
|
10861
10861
|
const f = this.length;
|
|
10862
10862
|
if (f % 2 !== 0)
|
|
10863
10863
|
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
10864
|
-
for (let
|
|
10865
|
-
z(this,
|
|
10864
|
+
for (let p = 0; p < f; p += 2)
|
|
10865
|
+
z(this, p, p + 1);
|
|
10866
10866
|
return this;
|
|
10867
10867
|
}, a.prototype.swap32 = function() {
|
|
10868
10868
|
const f = this.length;
|
|
10869
10869
|
if (f % 4 !== 0)
|
|
10870
10870
|
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
10871
|
-
for (let
|
|
10872
|
-
z(this,
|
|
10871
|
+
for (let p = 0; p < f; p += 4)
|
|
10872
|
+
z(this, p, p + 3), z(this, p + 1, p + 2);
|
|
10873
10873
|
return this;
|
|
10874
10874
|
}, a.prototype.swap64 = function() {
|
|
10875
10875
|
const f = this.length;
|
|
10876
10876
|
if (f % 8 !== 0)
|
|
10877
10877
|
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
10878
|
-
for (let
|
|
10879
|
-
z(this,
|
|
10878
|
+
for (let p = 0; p < f; p += 8)
|
|
10879
|
+
z(this, p, p + 7), z(this, p + 1, p + 6), z(this, p + 2, p + 5), z(this, p + 3, p + 4);
|
|
10880
10880
|
return this;
|
|
10881
10881
|
}, a.prototype.toString = function() {
|
|
10882
10882
|
const f = this.length;
|
|
@@ -10886,24 +10886,24 @@ function Xc() {
|
|
|
10886
10886
|
return this === f ? !0 : a.compare(this, f) === 0;
|
|
10887
10887
|
}, a.prototype.inspect = function() {
|
|
10888
10888
|
let f = "";
|
|
10889
|
-
const
|
|
10890
|
-
return f = this.toString("hex", 0,
|
|
10891
|
-
}, r && (a.prototype[r] = a.prototype.inspect), a.prototype.compare = function(f,
|
|
10889
|
+
const p = t.INSPECT_MAX_BYTES;
|
|
10890
|
+
return f = this.toString("hex", 0, p).replace(/(.{2})/g, "$1 ").trim(), this.length > p && (f += " ... "), "<Buffer " + f + ">";
|
|
10891
|
+
}, r && (a.prototype[r] = a.prototype.inspect), a.prototype.compare = function(f, p, S, U, $) {
|
|
10892
10892
|
if (Vt(f, Uint8Array) && (f = a.from(f, f.offset, f.byteLength)), !a.isBuffer(f))
|
|
10893
10893
|
throw new TypeError(
|
|
10894
10894
|
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof f
|
|
10895
10895
|
);
|
|
10896
|
-
if (
|
|
10896
|
+
if (p === void 0 && (p = 0), S === void 0 && (S = f ? f.length : 0), U === void 0 && (U = 0), $ === void 0 && ($ = this.length), p < 0 || S > f.length || U < 0 || $ > this.length)
|
|
10897
10897
|
throw new RangeError("out of range index");
|
|
10898
|
-
if (U >= $ &&
|
|
10898
|
+
if (U >= $ && p >= S)
|
|
10899
10899
|
return 0;
|
|
10900
10900
|
if (U >= $)
|
|
10901
10901
|
return -1;
|
|
10902
|
-
if (
|
|
10902
|
+
if (p >= S)
|
|
10903
10903
|
return 1;
|
|
10904
|
-
if (
|
|
10905
|
-
let Z = $ - U, Re = S -
|
|
10906
|
-
const ye = Math.min(Z, Re), me = this.slice(U, $), Fe = f.slice(
|
|
10904
|
+
if (p >>>= 0, S >>>= 0, U >>>= 0, $ >>>= 0, this === f) return 0;
|
|
10905
|
+
let Z = $ - U, Re = S - p;
|
|
10906
|
+
const ye = Math.min(Z, Re), me = this.slice(U, $), Fe = f.slice(p, S);
|
|
10907
10907
|
for (let he = 0; he < ye; ++he)
|
|
10908
10908
|
if (me[he] !== Fe[he]) {
|
|
10909
10909
|
Z = me[he], Re = Fe[he];
|
|
@@ -10911,26 +10911,26 @@ function Xc() {
|
|
|
10911
10911
|
}
|
|
10912
10912
|
return Z < Re ? -1 : Re < Z ? 1 : 0;
|
|
10913
10913
|
};
|
|
10914
|
-
function J(_, f,
|
|
10914
|
+
function J(_, f, p, S, U) {
|
|
10915
10915
|
if (_.length === 0) return -1;
|
|
10916
|
-
if (typeof
|
|
10916
|
+
if (typeof p == "string" ? (S = p, p = 0) : p > 2147483647 ? p = 2147483647 : p < -2147483648 && (p = -2147483648), p = +p, ze(p) && (p = U ? 0 : _.length - 1), p < 0 && (p = _.length + p), p >= _.length) {
|
|
10917
10917
|
if (U) return -1;
|
|
10918
|
-
|
|
10919
|
-
} else if (
|
|
10920
|
-
if (U)
|
|
10918
|
+
p = _.length - 1;
|
|
10919
|
+
} else if (p < 0)
|
|
10920
|
+
if (U) p = 0;
|
|
10921
10921
|
else return -1;
|
|
10922
10922
|
if (typeof f == "string" && (f = a.from(f, S)), a.isBuffer(f))
|
|
10923
|
-
return f.length === 0 ? -1 : te(_, f,
|
|
10923
|
+
return f.length === 0 ? -1 : te(_, f, p, S, U);
|
|
10924
10924
|
if (typeof f == "number")
|
|
10925
|
-
return f = f & 255, typeof Uint8Array.prototype.indexOf == "function" ? U ? Uint8Array.prototype.indexOf.call(_, f,
|
|
10925
|
+
return f = f & 255, typeof Uint8Array.prototype.indexOf == "function" ? U ? Uint8Array.prototype.indexOf.call(_, f, p) : Uint8Array.prototype.lastIndexOf.call(_, f, p) : te(_, [f], p, S, U);
|
|
10926
10926
|
throw new TypeError("val must be string, number or Buffer");
|
|
10927
10927
|
}
|
|
10928
|
-
function te(_, f,
|
|
10928
|
+
function te(_, f, p, S, U) {
|
|
10929
10929
|
let $ = 1, Z = _.length, Re = f.length;
|
|
10930
10930
|
if (S !== void 0 && (S = String(S).toLowerCase(), S === "ucs2" || S === "ucs-2" || S === "utf16le" || S === "utf-16le")) {
|
|
10931
10931
|
if (_.length < 2 || f.length < 2)
|
|
10932
10932
|
return -1;
|
|
10933
|
-
$ = 2, Z /= 2, Re /= 2,
|
|
10933
|
+
$ = 2, Z /= 2, Re /= 2, p /= 2;
|
|
10934
10934
|
}
|
|
10935
10935
|
function ye(Fe, he) {
|
|
10936
10936
|
return $ === 1 ? Fe[he] : Fe.readUInt16BE(he * $);
|
|
@@ -10938,13 +10938,13 @@ function Xc() {
|
|
|
10938
10938
|
let me;
|
|
10939
10939
|
if (U) {
|
|
10940
10940
|
let Fe = -1;
|
|
10941
|
-
for (me =
|
|
10941
|
+
for (me = p; me < Z; me++)
|
|
10942
10942
|
if (ye(_, me) === ye(f, Fe === -1 ? 0 : me - Fe)) {
|
|
10943
10943
|
if (Fe === -1 && (Fe = me), me - Fe + 1 === Re) return Fe * $;
|
|
10944
10944
|
} else
|
|
10945
10945
|
Fe !== -1 && (me -= me - Fe), Fe = -1;
|
|
10946
10946
|
} else
|
|
10947
|
-
for (
|
|
10947
|
+
for (p + Re > Z && (p = Z - Re), me = p; me >= 0; me--) {
|
|
10948
10948
|
let Fe = !0;
|
|
10949
10949
|
for (let he = 0; he < Re; he++)
|
|
10950
10950
|
if (ye(_, me + he) !== ye(f, he)) {
|
|
@@ -10955,16 +10955,16 @@ function Xc() {
|
|
|
10955
10955
|
}
|
|
10956
10956
|
return -1;
|
|
10957
10957
|
}
|
|
10958
|
-
a.prototype.includes = function(f,
|
|
10959
|
-
return this.indexOf(f,
|
|
10960
|
-
}, a.prototype.indexOf = function(f,
|
|
10961
|
-
return J(this, f,
|
|
10962
|
-
}, a.prototype.lastIndexOf = function(f,
|
|
10963
|
-
return J(this, f,
|
|
10958
|
+
a.prototype.includes = function(f, p, S) {
|
|
10959
|
+
return this.indexOf(f, p, S) !== -1;
|
|
10960
|
+
}, a.prototype.indexOf = function(f, p, S) {
|
|
10961
|
+
return J(this, f, p, S, !0);
|
|
10962
|
+
}, a.prototype.lastIndexOf = function(f, p, S) {
|
|
10963
|
+
return J(this, f, p, S, !1);
|
|
10964
10964
|
};
|
|
10965
|
-
function ne(_, f,
|
|
10966
|
-
|
|
10967
|
-
const U = _.length -
|
|
10965
|
+
function ne(_, f, p, S) {
|
|
10966
|
+
p = Number(p) || 0;
|
|
10967
|
+
const U = _.length - p;
|
|
10968
10968
|
S ? (S = Number(S), S > U && (S = U)) : S = U;
|
|
10969
10969
|
const $ = f.length;
|
|
10970
10970
|
S > $ / 2 && (S = $ / 2);
|
|
@@ -10972,56 +10972,56 @@ function Xc() {
|
|
|
10972
10972
|
for (Z = 0; Z < S; ++Z) {
|
|
10973
10973
|
const Re = parseInt(f.substr(Z * 2, 2), 16);
|
|
10974
10974
|
if (ze(Re)) return Z;
|
|
10975
|
-
_[
|
|
10975
|
+
_[p + Z] = Re;
|
|
10976
10976
|
}
|
|
10977
10977
|
return Z;
|
|
10978
10978
|
}
|
|
10979
|
-
function q(_, f,
|
|
10980
|
-
return Le(ke(f, _.length -
|
|
10979
|
+
function q(_, f, p, S) {
|
|
10980
|
+
return Le(ke(f, _.length - p), _, p, S);
|
|
10981
10981
|
}
|
|
10982
|
-
function
|
|
10983
|
-
return Le($e(f), _,
|
|
10982
|
+
function C(_, f, p, S) {
|
|
10983
|
+
return Le($e(f), _, p, S);
|
|
10984
10984
|
}
|
|
10985
|
-
function P(_, f,
|
|
10986
|
-
return Le(De(f), _,
|
|
10985
|
+
function P(_, f, p, S) {
|
|
10986
|
+
return Le(De(f), _, p, S);
|
|
10987
10987
|
}
|
|
10988
|
-
function j(_, f,
|
|
10989
|
-
return Le(mr(f, _.length -
|
|
10988
|
+
function j(_, f, p, S) {
|
|
10989
|
+
return Le(mr(f, _.length - p), _, p, S);
|
|
10990
10990
|
}
|
|
10991
|
-
a.prototype.write = function(f,
|
|
10992
|
-
if (
|
|
10993
|
-
U = "utf8", S = this.length,
|
|
10994
|
-
else if (S === void 0 && typeof
|
|
10995
|
-
U =
|
|
10996
|
-
else if (isFinite(
|
|
10997
|
-
|
|
10991
|
+
a.prototype.write = function(f, p, S, U) {
|
|
10992
|
+
if (p === void 0)
|
|
10993
|
+
U = "utf8", S = this.length, p = 0;
|
|
10994
|
+
else if (S === void 0 && typeof p == "string")
|
|
10995
|
+
U = p, S = this.length, p = 0;
|
|
10996
|
+
else if (isFinite(p))
|
|
10997
|
+
p = p >>> 0, isFinite(S) ? (S = S >>> 0, U === void 0 && (U = "utf8")) : (U = S, S = void 0);
|
|
10998
10998
|
else
|
|
10999
10999
|
throw new Error(
|
|
11000
11000
|
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
|
|
11001
11001
|
);
|
|
11002
|
-
const $ = this.length -
|
|
11003
|
-
if ((S === void 0 || S > $) && (S = $), f.length > 0 && (S < 0 ||
|
|
11002
|
+
const $ = this.length - p;
|
|
11003
|
+
if ((S === void 0 || S > $) && (S = $), f.length > 0 && (S < 0 || p < 0) || p > this.length)
|
|
11004
11004
|
throw new RangeError("Attempt to write outside buffer bounds");
|
|
11005
11005
|
U || (U = "utf8");
|
|
11006
11006
|
let Z = !1;
|
|
11007
11007
|
for (; ; )
|
|
11008
11008
|
switch (U) {
|
|
11009
11009
|
case "hex":
|
|
11010
|
-
return ne(this, f,
|
|
11010
|
+
return ne(this, f, p, S);
|
|
11011
11011
|
case "utf8":
|
|
11012
11012
|
case "utf-8":
|
|
11013
|
-
return q(this, f,
|
|
11013
|
+
return q(this, f, p, S);
|
|
11014
11014
|
case "ascii":
|
|
11015
11015
|
case "latin1":
|
|
11016
11016
|
case "binary":
|
|
11017
|
-
return
|
|
11017
|
+
return C(this, f, p, S);
|
|
11018
11018
|
case "base64":
|
|
11019
|
-
return P(this, f,
|
|
11019
|
+
return P(this, f, p, S);
|
|
11020
11020
|
case "ucs2":
|
|
11021
11021
|
case "ucs-2":
|
|
11022
11022
|
case "utf16le":
|
|
11023
11023
|
case "utf-16le":
|
|
11024
|
-
return j(this, f,
|
|
11024
|
+
return j(this, f, p, S);
|
|
11025
11025
|
default:
|
|
11026
11026
|
if (Z) throw new TypeError("Unknown encoding: " + U);
|
|
11027
11027
|
U = ("" + U).toLowerCase(), Z = !0;
|
|
@@ -11032,17 +11032,17 @@ function Xc() {
|
|
|
11032
11032
|
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
11033
11033
|
};
|
|
11034
11034
|
};
|
|
11035
|
-
function E(_, f,
|
|
11036
|
-
return f === 0 &&
|
|
11035
|
+
function E(_, f, p) {
|
|
11036
|
+
return f === 0 && p === _.length ? e.fromByteArray(_) : e.fromByteArray(_.slice(f, p));
|
|
11037
11037
|
}
|
|
11038
|
-
function c(_, f,
|
|
11039
|
-
|
|
11038
|
+
function c(_, f, p) {
|
|
11039
|
+
p = Math.min(_.length, p);
|
|
11040
11040
|
const S = [];
|
|
11041
11041
|
let U = f;
|
|
11042
|
-
for (; U <
|
|
11042
|
+
for (; U < p; ) {
|
|
11043
11043
|
const $ = _[U];
|
|
11044
11044
|
let Z = null, Re = $ > 239 ? 4 : $ > 223 ? 3 : $ > 191 ? 2 : 1;
|
|
11045
|
-
if (U + Re <=
|
|
11045
|
+
if (U + Re <= p) {
|
|
11046
11046
|
let ye, me, Fe, he;
|
|
11047
11047
|
switch (Re) {
|
|
11048
11048
|
case 1:
|
|
@@ -11062,261 +11062,261 @@ function Xc() {
|
|
|
11062
11062
|
}
|
|
11063
11063
|
return y(S);
|
|
11064
11064
|
}
|
|
11065
|
-
const
|
|
11065
|
+
const h = 4096;
|
|
11066
11066
|
function y(_) {
|
|
11067
11067
|
const f = _.length;
|
|
11068
|
-
if (f <=
|
|
11068
|
+
if (f <= h)
|
|
11069
11069
|
return String.fromCharCode.apply(String, _);
|
|
11070
|
-
let
|
|
11070
|
+
let p = "", S = 0;
|
|
11071
11071
|
for (; S < f; )
|
|
11072
|
-
|
|
11072
|
+
p += String.fromCharCode.apply(
|
|
11073
11073
|
String,
|
|
11074
|
-
_.slice(S, S +=
|
|
11074
|
+
_.slice(S, S += h)
|
|
11075
11075
|
);
|
|
11076
|
-
return
|
|
11076
|
+
return p;
|
|
11077
11077
|
}
|
|
11078
|
-
function A(_, f,
|
|
11078
|
+
function A(_, f, p) {
|
|
11079
11079
|
let S = "";
|
|
11080
|
-
|
|
11081
|
-
for (let U = f; U <
|
|
11080
|
+
p = Math.min(_.length, p);
|
|
11081
|
+
for (let U = f; U < p; ++U)
|
|
11082
11082
|
S += String.fromCharCode(_[U] & 127);
|
|
11083
11083
|
return S;
|
|
11084
11084
|
}
|
|
11085
|
-
function v(_, f,
|
|
11085
|
+
function v(_, f, p) {
|
|
11086
11086
|
let S = "";
|
|
11087
|
-
|
|
11088
|
-
for (let U = f; U <
|
|
11087
|
+
p = Math.min(_.length, p);
|
|
11088
|
+
for (let U = f; U < p; ++U)
|
|
11089
11089
|
S += String.fromCharCode(_[U]);
|
|
11090
11090
|
return S;
|
|
11091
11091
|
}
|
|
11092
|
-
function R(_, f,
|
|
11092
|
+
function R(_, f, p) {
|
|
11093
11093
|
const S = _.length;
|
|
11094
|
-
(!f || f < 0) && (f = 0), (!
|
|
11094
|
+
(!f || f < 0) && (f = 0), (!p || p < 0 || p > S) && (p = S);
|
|
11095
11095
|
let U = "";
|
|
11096
|
-
for (let $ = f; $ <
|
|
11096
|
+
for (let $ = f; $ < p; ++$)
|
|
11097
11097
|
U += He[_[$]];
|
|
11098
11098
|
return U;
|
|
11099
11099
|
}
|
|
11100
|
-
function I(_, f,
|
|
11101
|
-
const S = _.slice(f,
|
|
11100
|
+
function I(_, f, p) {
|
|
11101
|
+
const S = _.slice(f, p);
|
|
11102
11102
|
let U = "";
|
|
11103
11103
|
for (let $ = 0; $ < S.length - 1; $ += 2)
|
|
11104
11104
|
U += String.fromCharCode(S[$] + S[$ + 1] * 256);
|
|
11105
11105
|
return U;
|
|
11106
11106
|
}
|
|
11107
|
-
a.prototype.slice = function(f,
|
|
11107
|
+
a.prototype.slice = function(f, p) {
|
|
11108
11108
|
const S = this.length;
|
|
11109
|
-
f = ~~f,
|
|
11110
|
-
const U = this.subarray(f,
|
|
11109
|
+
f = ~~f, p = p === void 0 ? S : ~~p, f < 0 ? (f += S, f < 0 && (f = 0)) : f > S && (f = S), p < 0 ? (p += S, p < 0 && (p = 0)) : p > S && (p = S), p < f && (p = f);
|
|
11110
|
+
const U = this.subarray(f, p);
|
|
11111
11111
|
return Object.setPrototypeOf(U, a.prototype), U;
|
|
11112
11112
|
};
|
|
11113
|
-
function b(_, f,
|
|
11113
|
+
function b(_, f, p) {
|
|
11114
11114
|
if (_ % 1 !== 0 || _ < 0) throw new RangeError("offset is not uint");
|
|
11115
|
-
if (_ + f >
|
|
11115
|
+
if (_ + f > p) throw new RangeError("Trying to access beyond buffer length");
|
|
11116
11116
|
}
|
|
11117
|
-
a.prototype.readUintLE = a.prototype.readUIntLE = function(f,
|
|
11118
|
-
f = f >>> 0,
|
|
11117
|
+
a.prototype.readUintLE = a.prototype.readUIntLE = function(f, p, S) {
|
|
11118
|
+
f = f >>> 0, p = p >>> 0, S || b(f, p, this.length);
|
|
11119
11119
|
let U = this[f], $ = 1, Z = 0;
|
|
11120
|
-
for (; ++Z <
|
|
11120
|
+
for (; ++Z < p && ($ *= 256); )
|
|
11121
11121
|
U += this[f + Z] * $;
|
|
11122
11122
|
return U;
|
|
11123
|
-
}, a.prototype.readUintBE = a.prototype.readUIntBE = function(f,
|
|
11124
|
-
f = f >>> 0,
|
|
11125
|
-
let U = this[f + --
|
|
11126
|
-
for (;
|
|
11127
|
-
U += this[f + --
|
|
11123
|
+
}, a.prototype.readUintBE = a.prototype.readUIntBE = function(f, p, S) {
|
|
11124
|
+
f = f >>> 0, p = p >>> 0, S || b(f, p, this.length);
|
|
11125
|
+
let U = this[f + --p], $ = 1;
|
|
11126
|
+
for (; p > 0 && ($ *= 256); )
|
|
11127
|
+
U += this[f + --p] * $;
|
|
11128
11128
|
return U;
|
|
11129
|
-
}, a.prototype.readUint8 = a.prototype.readUInt8 = function(f,
|
|
11130
|
-
return f = f >>> 0,
|
|
11131
|
-
}, a.prototype.readUint16LE = a.prototype.readUInt16LE = function(f,
|
|
11132
|
-
return f = f >>> 0,
|
|
11133
|
-
}, a.prototype.readUint16BE = a.prototype.readUInt16BE = function(f,
|
|
11134
|
-
return f = f >>> 0,
|
|
11135
|
-
}, a.prototype.readUint32LE = a.prototype.readUInt32LE = function(f,
|
|
11136
|
-
return f = f >>> 0,
|
|
11137
|
-
}, a.prototype.readUint32BE = a.prototype.readUInt32BE = function(f,
|
|
11138
|
-
return f = f >>> 0,
|
|
11129
|
+
}, a.prototype.readUint8 = a.prototype.readUInt8 = function(f, p) {
|
|
11130
|
+
return f = f >>> 0, p || b(f, 1, this.length), this[f];
|
|
11131
|
+
}, a.prototype.readUint16LE = a.prototype.readUInt16LE = function(f, p) {
|
|
11132
|
+
return f = f >>> 0, p || b(f, 2, this.length), this[f] | this[f + 1] << 8;
|
|
11133
|
+
}, a.prototype.readUint16BE = a.prototype.readUInt16BE = function(f, p) {
|
|
11134
|
+
return f = f >>> 0, p || b(f, 2, this.length), this[f] << 8 | this[f + 1];
|
|
11135
|
+
}, a.prototype.readUint32LE = a.prototype.readUInt32LE = function(f, p) {
|
|
11136
|
+
return f = f >>> 0, p || b(f, 4, this.length), (this[f] | this[f + 1] << 8 | this[f + 2] << 16) + this[f + 3] * 16777216;
|
|
11137
|
+
}, a.prototype.readUint32BE = a.prototype.readUInt32BE = function(f, p) {
|
|
11138
|
+
return f = f >>> 0, p || b(f, 4, this.length), this[f] * 16777216 + (this[f + 1] << 16 | this[f + 2] << 8 | this[f + 3]);
|
|
11139
11139
|
}, a.prototype.readBigUInt64LE = Jt(function(f) {
|
|
11140
11140
|
f = f >>> 0, Pe(f, "offset");
|
|
11141
|
-
const
|
|
11142
|
-
(
|
|
11143
|
-
const U =
|
|
11141
|
+
const p = this[f], S = this[f + 7];
|
|
11142
|
+
(p === void 0 || S === void 0) && ve(f, this.length - 8);
|
|
11143
|
+
const U = p + this[++f] * 2 ** 8 + this[++f] * 2 ** 16 + this[++f] * 2 ** 24, $ = this[++f] + this[++f] * 2 ** 8 + this[++f] * 2 ** 16 + S * 2 ** 24;
|
|
11144
11144
|
return BigInt(U) + (BigInt($) << BigInt(32));
|
|
11145
11145
|
}), a.prototype.readBigUInt64BE = Jt(function(f) {
|
|
11146
11146
|
f = f >>> 0, Pe(f, "offset");
|
|
11147
|
-
const
|
|
11148
|
-
(
|
|
11149
|
-
const U =
|
|
11147
|
+
const p = this[f], S = this[f + 7];
|
|
11148
|
+
(p === void 0 || S === void 0) && ve(f, this.length - 8);
|
|
11149
|
+
const U = p * 2 ** 24 + this[++f] * 2 ** 16 + this[++f] * 2 ** 8 + this[++f], $ = this[++f] * 2 ** 24 + this[++f] * 2 ** 16 + this[++f] * 2 ** 8 + S;
|
|
11150
11150
|
return (BigInt(U) << BigInt(32)) + BigInt($);
|
|
11151
|
-
}), a.prototype.readIntLE = function(f,
|
|
11152
|
-
f = f >>> 0,
|
|
11151
|
+
}), a.prototype.readIntLE = function(f, p, S) {
|
|
11152
|
+
f = f >>> 0, p = p >>> 0, S || b(f, p, this.length);
|
|
11153
11153
|
let U = this[f], $ = 1, Z = 0;
|
|
11154
|
-
for (; ++Z <
|
|
11154
|
+
for (; ++Z < p && ($ *= 256); )
|
|
11155
11155
|
U += this[f + Z] * $;
|
|
11156
|
-
return $ *= 128, U >= $ && (U -= Math.pow(2, 8 *
|
|
11157
|
-
}, a.prototype.readIntBE = function(f,
|
|
11158
|
-
f = f >>> 0,
|
|
11159
|
-
let U =
|
|
11156
|
+
return $ *= 128, U >= $ && (U -= Math.pow(2, 8 * p)), U;
|
|
11157
|
+
}, a.prototype.readIntBE = function(f, p, S) {
|
|
11158
|
+
f = f >>> 0, p = p >>> 0, S || b(f, p, this.length);
|
|
11159
|
+
let U = p, $ = 1, Z = this[f + --U];
|
|
11160
11160
|
for (; U > 0 && ($ *= 256); )
|
|
11161
11161
|
Z += this[f + --U] * $;
|
|
11162
|
-
return $ *= 128, Z >= $ && (Z -= Math.pow(2, 8 *
|
|
11163
|
-
}, a.prototype.readInt8 = function(f,
|
|
11164
|
-
return f = f >>> 0,
|
|
11165
|
-
}, a.prototype.readInt16LE = function(f,
|
|
11166
|
-
f = f >>> 0,
|
|
11162
|
+
return $ *= 128, Z >= $ && (Z -= Math.pow(2, 8 * p)), Z;
|
|
11163
|
+
}, a.prototype.readInt8 = function(f, p) {
|
|
11164
|
+
return f = f >>> 0, p || b(f, 1, this.length), this[f] & 128 ? (255 - this[f] + 1) * -1 : this[f];
|
|
11165
|
+
}, a.prototype.readInt16LE = function(f, p) {
|
|
11166
|
+
f = f >>> 0, p || b(f, 2, this.length);
|
|
11167
11167
|
const S = this[f] | this[f + 1] << 8;
|
|
11168
11168
|
return S & 32768 ? S | 4294901760 : S;
|
|
11169
|
-
}, a.prototype.readInt16BE = function(f,
|
|
11170
|
-
f = f >>> 0,
|
|
11169
|
+
}, a.prototype.readInt16BE = function(f, p) {
|
|
11170
|
+
f = f >>> 0, p || b(f, 2, this.length);
|
|
11171
11171
|
const S = this[f + 1] | this[f] << 8;
|
|
11172
11172
|
return S & 32768 ? S | 4294901760 : S;
|
|
11173
|
-
}, a.prototype.readInt32LE = function(f,
|
|
11174
|
-
return f = f >>> 0,
|
|
11175
|
-
}, a.prototype.readInt32BE = function(f,
|
|
11176
|
-
return f = f >>> 0,
|
|
11173
|
+
}, a.prototype.readInt32LE = function(f, p) {
|
|
11174
|
+
return f = f >>> 0, p || b(f, 4, this.length), this[f] | this[f + 1] << 8 | this[f + 2] << 16 | this[f + 3] << 24;
|
|
11175
|
+
}, a.prototype.readInt32BE = function(f, p) {
|
|
11176
|
+
return f = f >>> 0, p || b(f, 4, this.length), this[f] << 24 | this[f + 1] << 16 | this[f + 2] << 8 | this[f + 3];
|
|
11177
11177
|
}, a.prototype.readBigInt64LE = Jt(function(f) {
|
|
11178
11178
|
f = f >>> 0, Pe(f, "offset");
|
|
11179
|
-
const
|
|
11180
|
-
(
|
|
11179
|
+
const p = this[f], S = this[f + 7];
|
|
11180
|
+
(p === void 0 || S === void 0) && ve(f, this.length - 8);
|
|
11181
11181
|
const U = this[f + 4] + this[f + 5] * 2 ** 8 + this[f + 6] * 2 ** 16 + (S << 24);
|
|
11182
|
-
return (BigInt(U) << BigInt(32)) + BigInt(
|
|
11182
|
+
return (BigInt(U) << BigInt(32)) + BigInt(p + this[++f] * 2 ** 8 + this[++f] * 2 ** 16 + this[++f] * 2 ** 24);
|
|
11183
11183
|
}), a.prototype.readBigInt64BE = Jt(function(f) {
|
|
11184
11184
|
f = f >>> 0, Pe(f, "offset");
|
|
11185
|
-
const
|
|
11186
|
-
(
|
|
11187
|
-
const U = (
|
|
11185
|
+
const p = this[f], S = this[f + 7];
|
|
11186
|
+
(p === void 0 || S === void 0) && ve(f, this.length - 8);
|
|
11187
|
+
const U = (p << 24) + // Overflow
|
|
11188
11188
|
this[++f] * 2 ** 16 + this[++f] * 2 ** 8 + this[++f];
|
|
11189
11189
|
return (BigInt(U) << BigInt(32)) + BigInt(this[++f] * 2 ** 24 + this[++f] * 2 ** 16 + this[++f] * 2 ** 8 + S);
|
|
11190
|
-
}), a.prototype.readFloatLE = function(f,
|
|
11191
|
-
return f = f >>> 0,
|
|
11192
|
-
}, a.prototype.readFloatBE = function(f,
|
|
11193
|
-
return f = f >>> 0,
|
|
11194
|
-
}, a.prototype.readDoubleLE = function(f,
|
|
11195
|
-
return f = f >>> 0,
|
|
11196
|
-
}, a.prototype.readDoubleBE = function(f,
|
|
11197
|
-
return f = f >>> 0,
|
|
11190
|
+
}), a.prototype.readFloatLE = function(f, p) {
|
|
11191
|
+
return f = f >>> 0, p || b(f, 4, this.length), n.read(this, f, !0, 23, 4);
|
|
11192
|
+
}, a.prototype.readFloatBE = function(f, p) {
|
|
11193
|
+
return f = f >>> 0, p || b(f, 4, this.length), n.read(this, f, !1, 23, 4);
|
|
11194
|
+
}, a.prototype.readDoubleLE = function(f, p) {
|
|
11195
|
+
return f = f >>> 0, p || b(f, 8, this.length), n.read(this, f, !0, 52, 8);
|
|
11196
|
+
}, a.prototype.readDoubleBE = function(f, p) {
|
|
11197
|
+
return f = f >>> 0, p || b(f, 8, this.length), n.read(this, f, !1, 52, 8);
|
|
11198
11198
|
};
|
|
11199
|
-
function u(_, f,
|
|
11199
|
+
function u(_, f, p, S, U, $) {
|
|
11200
11200
|
if (!a.isBuffer(_)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
11201
11201
|
if (f > U || f < $) throw new RangeError('"value" argument is out of bounds');
|
|
11202
|
-
if (
|
|
11202
|
+
if (p + S > _.length) throw new RangeError("Index out of range");
|
|
11203
11203
|
}
|
|
11204
|
-
a.prototype.writeUintLE = a.prototype.writeUIntLE = function(f,
|
|
11205
|
-
if (f = +f,
|
|
11204
|
+
a.prototype.writeUintLE = a.prototype.writeUIntLE = function(f, p, S, U) {
|
|
11205
|
+
if (f = +f, p = p >>> 0, S = S >>> 0, !U) {
|
|
11206
11206
|
const Re = Math.pow(2, 8 * S) - 1;
|
|
11207
|
-
u(this, f,
|
|
11207
|
+
u(this, f, p, S, Re, 0);
|
|
11208
11208
|
}
|
|
11209
11209
|
let $ = 1, Z = 0;
|
|
11210
|
-
for (this[
|
|
11211
|
-
this[
|
|
11212
|
-
return
|
|
11213
|
-
}, a.prototype.writeUintBE = a.prototype.writeUIntBE = function(f,
|
|
11214
|
-
if (f = +f,
|
|
11210
|
+
for (this[p] = f & 255; ++Z < S && ($ *= 256); )
|
|
11211
|
+
this[p + Z] = f / $ & 255;
|
|
11212
|
+
return p + S;
|
|
11213
|
+
}, a.prototype.writeUintBE = a.prototype.writeUIntBE = function(f, p, S, U) {
|
|
11214
|
+
if (f = +f, p = p >>> 0, S = S >>> 0, !U) {
|
|
11215
11215
|
const Re = Math.pow(2, 8 * S) - 1;
|
|
11216
|
-
u(this, f,
|
|
11216
|
+
u(this, f, p, S, Re, 0);
|
|
11217
11217
|
}
|
|
11218
11218
|
let $ = S - 1, Z = 1;
|
|
11219
|
-
for (this[
|
|
11220
|
-
this[
|
|
11221
|
-
return
|
|
11222
|
-
}, a.prototype.writeUint8 = a.prototype.writeUInt8 = function(f,
|
|
11223
|
-
return f = +f,
|
|
11224
|
-
}, a.prototype.writeUint16LE = a.prototype.writeUInt16LE = function(f,
|
|
11225
|
-
return f = +f,
|
|
11226
|
-
}, a.prototype.writeUint16BE = a.prototype.writeUInt16BE = function(f,
|
|
11227
|
-
return f = +f,
|
|
11228
|
-
}, a.prototype.writeUint32LE = a.prototype.writeUInt32LE = function(f,
|
|
11229
|
-
return f = +f,
|
|
11230
|
-
}, a.prototype.writeUint32BE = a.prototype.writeUInt32BE = function(f,
|
|
11231
|
-
return f = +f,
|
|
11219
|
+
for (this[p + $] = f & 255; --$ >= 0 && (Z *= 256); )
|
|
11220
|
+
this[p + $] = f / Z & 255;
|
|
11221
|
+
return p + S;
|
|
11222
|
+
}, a.prototype.writeUint8 = a.prototype.writeUInt8 = function(f, p, S) {
|
|
11223
|
+
return f = +f, p = p >>> 0, S || u(this, f, p, 1, 255, 0), this[p] = f & 255, p + 1;
|
|
11224
|
+
}, a.prototype.writeUint16LE = a.prototype.writeUInt16LE = function(f, p, S) {
|
|
11225
|
+
return f = +f, p = p >>> 0, S || u(this, f, p, 2, 65535, 0), this[p] = f & 255, this[p + 1] = f >>> 8, p + 2;
|
|
11226
|
+
}, a.prototype.writeUint16BE = a.prototype.writeUInt16BE = function(f, p, S) {
|
|
11227
|
+
return f = +f, p = p >>> 0, S || u(this, f, p, 2, 65535, 0), this[p] = f >>> 8, this[p + 1] = f & 255, p + 2;
|
|
11228
|
+
}, a.prototype.writeUint32LE = a.prototype.writeUInt32LE = function(f, p, S) {
|
|
11229
|
+
return f = +f, p = p >>> 0, S || u(this, f, p, 4, 4294967295, 0), this[p + 3] = f >>> 24, this[p + 2] = f >>> 16, this[p + 1] = f >>> 8, this[p] = f & 255, p + 4;
|
|
11230
|
+
}, a.prototype.writeUint32BE = a.prototype.writeUInt32BE = function(f, p, S) {
|
|
11231
|
+
return f = +f, p = p >>> 0, S || u(this, f, p, 4, 4294967295, 0), this[p] = f >>> 24, this[p + 1] = f >>> 16, this[p + 2] = f >>> 8, this[p + 3] = f & 255, p + 4;
|
|
11232
11232
|
};
|
|
11233
|
-
function l(_, f,
|
|
11234
|
-
we(f, S, U, _,
|
|
11233
|
+
function l(_, f, p, S, U) {
|
|
11234
|
+
we(f, S, U, _, p, 7);
|
|
11235
11235
|
let $ = Number(f & BigInt(4294967295));
|
|
11236
|
-
_[
|
|
11236
|
+
_[p++] = $, $ = $ >> 8, _[p++] = $, $ = $ >> 8, _[p++] = $, $ = $ >> 8, _[p++] = $;
|
|
11237
11237
|
let Z = Number(f >> BigInt(32) & BigInt(4294967295));
|
|
11238
|
-
return _[
|
|
11238
|
+
return _[p++] = Z, Z = Z >> 8, _[p++] = Z, Z = Z >> 8, _[p++] = Z, Z = Z >> 8, _[p++] = Z, p;
|
|
11239
11239
|
}
|
|
11240
|
-
function w(_, f,
|
|
11241
|
-
we(f, S, U, _,
|
|
11240
|
+
function w(_, f, p, S, U) {
|
|
11241
|
+
we(f, S, U, _, p, 7);
|
|
11242
11242
|
let $ = Number(f & BigInt(4294967295));
|
|
11243
|
-
_[
|
|
11243
|
+
_[p + 7] = $, $ = $ >> 8, _[p + 6] = $, $ = $ >> 8, _[p + 5] = $, $ = $ >> 8, _[p + 4] = $;
|
|
11244
11244
|
let Z = Number(f >> BigInt(32) & BigInt(4294967295));
|
|
11245
|
-
return _[
|
|
11246
|
-
}
|
|
11247
|
-
a.prototype.writeBigUInt64LE = Jt(function(f,
|
|
11248
|
-
return l(this, f,
|
|
11249
|
-
}), a.prototype.writeBigUInt64BE = Jt(function(f,
|
|
11250
|
-
return w(this, f,
|
|
11251
|
-
}), a.prototype.writeIntLE = function(f,
|
|
11252
|
-
if (f = +f,
|
|
11245
|
+
return _[p + 3] = Z, Z = Z >> 8, _[p + 2] = Z, Z = Z >> 8, _[p + 1] = Z, Z = Z >> 8, _[p] = Z, p + 8;
|
|
11246
|
+
}
|
|
11247
|
+
a.prototype.writeBigUInt64LE = Jt(function(f, p = 0) {
|
|
11248
|
+
return l(this, f, p, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
11249
|
+
}), a.prototype.writeBigUInt64BE = Jt(function(f, p = 0) {
|
|
11250
|
+
return w(this, f, p, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
11251
|
+
}), a.prototype.writeIntLE = function(f, p, S, U) {
|
|
11252
|
+
if (f = +f, p = p >>> 0, !U) {
|
|
11253
11253
|
const ye = Math.pow(2, 8 * S - 1);
|
|
11254
|
-
u(this, f,
|
|
11254
|
+
u(this, f, p, S, ye - 1, -ye);
|
|
11255
11255
|
}
|
|
11256
11256
|
let $ = 0, Z = 1, Re = 0;
|
|
11257
|
-
for (this[
|
|
11258
|
-
f < 0 && Re === 0 && this[
|
|
11259
|
-
return
|
|
11260
|
-
}, a.prototype.writeIntBE = function(f,
|
|
11261
|
-
if (f = +f,
|
|
11257
|
+
for (this[p] = f & 255; ++$ < S && (Z *= 256); )
|
|
11258
|
+
f < 0 && Re === 0 && this[p + $ - 1] !== 0 && (Re = 1), this[p + $] = (f / Z >> 0) - Re & 255;
|
|
11259
|
+
return p + S;
|
|
11260
|
+
}, a.prototype.writeIntBE = function(f, p, S, U) {
|
|
11261
|
+
if (f = +f, p = p >>> 0, !U) {
|
|
11262
11262
|
const ye = Math.pow(2, 8 * S - 1);
|
|
11263
|
-
u(this, f,
|
|
11263
|
+
u(this, f, p, S, ye - 1, -ye);
|
|
11264
11264
|
}
|
|
11265
11265
|
let $ = S - 1, Z = 1, Re = 0;
|
|
11266
|
-
for (this[
|
|
11267
|
-
f < 0 && Re === 0 && this[
|
|
11268
|
-
return
|
|
11269
|
-
}, a.prototype.writeInt8 = function(f,
|
|
11270
|
-
return f = +f,
|
|
11271
|
-
}, a.prototype.writeInt16LE = function(f,
|
|
11272
|
-
return f = +f,
|
|
11273
|
-
}, a.prototype.writeInt16BE = function(f,
|
|
11274
|
-
return f = +f,
|
|
11275
|
-
}, a.prototype.writeInt32LE = function(f,
|
|
11276
|
-
return f = +f,
|
|
11277
|
-
}, a.prototype.writeInt32BE = function(f,
|
|
11278
|
-
return f = +f,
|
|
11279
|
-
}, a.prototype.writeBigInt64LE = Jt(function(f,
|
|
11280
|
-
return l(this, f,
|
|
11281
|
-
}), a.prototype.writeBigInt64BE = Jt(function(f,
|
|
11282
|
-
return w(this, f,
|
|
11266
|
+
for (this[p + $] = f & 255; --$ >= 0 && (Z *= 256); )
|
|
11267
|
+
f < 0 && Re === 0 && this[p + $ + 1] !== 0 && (Re = 1), this[p + $] = (f / Z >> 0) - Re & 255;
|
|
11268
|
+
return p + S;
|
|
11269
|
+
}, a.prototype.writeInt8 = function(f, p, S) {
|
|
11270
|
+
return f = +f, p = p >>> 0, S || u(this, f, p, 1, 127, -128), f < 0 && (f = 255 + f + 1), this[p] = f & 255, p + 1;
|
|
11271
|
+
}, a.prototype.writeInt16LE = function(f, p, S) {
|
|
11272
|
+
return f = +f, p = p >>> 0, S || u(this, f, p, 2, 32767, -32768), this[p] = f & 255, this[p + 1] = f >>> 8, p + 2;
|
|
11273
|
+
}, a.prototype.writeInt16BE = function(f, p, S) {
|
|
11274
|
+
return f = +f, p = p >>> 0, S || u(this, f, p, 2, 32767, -32768), this[p] = f >>> 8, this[p + 1] = f & 255, p + 2;
|
|
11275
|
+
}, a.prototype.writeInt32LE = function(f, p, S) {
|
|
11276
|
+
return f = +f, p = p >>> 0, S || u(this, f, p, 4, 2147483647, -2147483648), this[p] = f & 255, this[p + 1] = f >>> 8, this[p + 2] = f >>> 16, this[p + 3] = f >>> 24, p + 4;
|
|
11277
|
+
}, a.prototype.writeInt32BE = function(f, p, S) {
|
|
11278
|
+
return f = +f, p = p >>> 0, S || u(this, f, p, 4, 2147483647, -2147483648), f < 0 && (f = 4294967295 + f + 1), this[p] = f >>> 24, this[p + 1] = f >>> 16, this[p + 2] = f >>> 8, this[p + 3] = f & 255, p + 4;
|
|
11279
|
+
}, a.prototype.writeBigInt64LE = Jt(function(f, p = 0) {
|
|
11280
|
+
return l(this, f, p, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
11281
|
+
}), a.prototype.writeBigInt64BE = Jt(function(f, p = 0) {
|
|
11282
|
+
return w(this, f, p, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
11283
11283
|
});
|
|
11284
|
-
function T(_, f,
|
|
11285
|
-
if (
|
|
11286
|
-
if (
|
|
11284
|
+
function T(_, f, p, S, U, $) {
|
|
11285
|
+
if (p + S > _.length) throw new RangeError("Index out of range");
|
|
11286
|
+
if (p < 0) throw new RangeError("Index out of range");
|
|
11287
11287
|
}
|
|
11288
|
-
function D(_, f,
|
|
11289
|
-
return f = +f,
|
|
11288
|
+
function D(_, f, p, S, U) {
|
|
11289
|
+
return f = +f, p = p >>> 0, U || T(_, f, p, 4), n.write(_, f, p, S, 23, 4), p + 4;
|
|
11290
11290
|
}
|
|
11291
|
-
a.prototype.writeFloatLE = function(f,
|
|
11292
|
-
return D(this, f,
|
|
11293
|
-
}, a.prototype.writeFloatBE = function(f,
|
|
11294
|
-
return D(this, f,
|
|
11291
|
+
a.prototype.writeFloatLE = function(f, p, S) {
|
|
11292
|
+
return D(this, f, p, !0, S);
|
|
11293
|
+
}, a.prototype.writeFloatBE = function(f, p, S) {
|
|
11294
|
+
return D(this, f, p, !1, S);
|
|
11295
11295
|
};
|
|
11296
|
-
function W(_, f,
|
|
11297
|
-
return f = +f,
|
|
11298
|
-
}
|
|
11299
|
-
a.prototype.writeDoubleLE = function(f,
|
|
11300
|
-
return W(this, f,
|
|
11301
|
-
}, a.prototype.writeDoubleBE = function(f,
|
|
11302
|
-
return W(this, f,
|
|
11303
|
-
}, a.prototype.copy = function(f,
|
|
11296
|
+
function W(_, f, p, S, U) {
|
|
11297
|
+
return f = +f, p = p >>> 0, U || T(_, f, p, 8), n.write(_, f, p, S, 52, 8), p + 8;
|
|
11298
|
+
}
|
|
11299
|
+
a.prototype.writeDoubleLE = function(f, p, S) {
|
|
11300
|
+
return W(this, f, p, !0, S);
|
|
11301
|
+
}, a.prototype.writeDoubleBE = function(f, p, S) {
|
|
11302
|
+
return W(this, f, p, !1, S);
|
|
11303
|
+
}, a.prototype.copy = function(f, p, S, U) {
|
|
11304
11304
|
if (!a.isBuffer(f)) throw new TypeError("argument should be a Buffer");
|
|
11305
|
-
if (S || (S = 0), !U && U !== 0 && (U = this.length),
|
|
11306
|
-
if (
|
|
11305
|
+
if (S || (S = 0), !U && U !== 0 && (U = this.length), p >= f.length && (p = f.length), p || (p = 0), U > 0 && U < S && (U = S), U === S || f.length === 0 || this.length === 0) return 0;
|
|
11306
|
+
if (p < 0)
|
|
11307
11307
|
throw new RangeError("targetStart out of bounds");
|
|
11308
11308
|
if (S < 0 || S >= this.length) throw new RangeError("Index out of range");
|
|
11309
11309
|
if (U < 0) throw new RangeError("sourceEnd out of bounds");
|
|
11310
|
-
U > this.length && (U = this.length), f.length -
|
|
11310
|
+
U > this.length && (U = this.length), f.length - p < U - S && (U = f.length - p + S);
|
|
11311
11311
|
const $ = U - S;
|
|
11312
|
-
return this === f && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(
|
|
11312
|
+
return this === f && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(p, S, U) : Uint8Array.prototype.set.call(
|
|
11313
11313
|
f,
|
|
11314
11314
|
this.subarray(S, U),
|
|
11315
|
-
|
|
11315
|
+
p
|
|
11316
11316
|
), $;
|
|
11317
|
-
}, a.prototype.fill = function(f,
|
|
11317
|
+
}, a.prototype.fill = function(f, p, S, U) {
|
|
11318
11318
|
if (typeof f == "string") {
|
|
11319
|
-
if (typeof
|
|
11319
|
+
if (typeof p == "string" ? (U = p, p = 0, S = this.length) : typeof S == "string" && (U = S, S = this.length), U !== void 0 && typeof U != "string")
|
|
11320
11320
|
throw new TypeError("encoding must be a string");
|
|
11321
11321
|
if (typeof U == "string" && !a.isEncoding(U))
|
|
11322
11322
|
throw new TypeError("Unknown encoding: " + U);
|
|
@@ -11325,27 +11325,27 @@ function Xc() {
|
|
|
11325
11325
|
(U === "utf8" && Z < 128 || U === "latin1") && (f = Z);
|
|
11326
11326
|
}
|
|
11327
11327
|
} else typeof f == "number" ? f = f & 255 : typeof f == "boolean" && (f = Number(f));
|
|
11328
|
-
if (
|
|
11328
|
+
if (p < 0 || this.length < p || this.length < S)
|
|
11329
11329
|
throw new RangeError("Out of range index");
|
|
11330
|
-
if (S <=
|
|
11330
|
+
if (S <= p)
|
|
11331
11331
|
return this;
|
|
11332
|
-
|
|
11332
|
+
p = p >>> 0, S = S === void 0 ? this.length : S >>> 0, f || (f = 0);
|
|
11333
11333
|
let $;
|
|
11334
11334
|
if (typeof f == "number")
|
|
11335
|
-
for ($ =
|
|
11335
|
+
for ($ = p; $ < S; ++$)
|
|
11336
11336
|
this[$] = f;
|
|
11337
11337
|
else {
|
|
11338
11338
|
const Z = a.isBuffer(f) ? f : a.from(f, U), Re = Z.length;
|
|
11339
11339
|
if (Re === 0)
|
|
11340
11340
|
throw new TypeError('The value "' + f + '" is invalid for argument "value"');
|
|
11341
|
-
for ($ = 0; $ < S -
|
|
11342
|
-
this[$ +
|
|
11341
|
+
for ($ = 0; $ < S - p; ++$)
|
|
11342
|
+
this[$ + p] = Z[$ % Re];
|
|
11343
11343
|
}
|
|
11344
11344
|
return this;
|
|
11345
11345
|
};
|
|
11346
11346
|
const re = {};
|
|
11347
|
-
function oe(_, f,
|
|
11348
|
-
re[_] = class extends
|
|
11347
|
+
function oe(_, f, p) {
|
|
11348
|
+
re[_] = class extends p {
|
|
11349
11349
|
constructor() {
|
|
11350
11350
|
super(), Object.defineProperty(this, "message", {
|
|
11351
11351
|
value: f.apply(this, arguments),
|
|
@@ -11383,24 +11383,24 @@ function Xc() {
|
|
|
11383
11383
|
TypeError
|
|
11384
11384
|
), oe(
|
|
11385
11385
|
"ERR_OUT_OF_RANGE",
|
|
11386
|
-
function(_, f,
|
|
11387
|
-
let S = `The value of "${_}" is out of range.`, U =
|
|
11388
|
-
return Number.isInteger(
|
|
11386
|
+
function(_, f, p) {
|
|
11387
|
+
let S = `The value of "${_}" is out of range.`, U = p;
|
|
11388
|
+
return Number.isInteger(p) && Math.abs(p) > 2 ** 32 ? U = Ne(String(p)) : typeof p == "bigint" && (U = String(p), (p > BigInt(2) ** BigInt(32) || p < -(BigInt(2) ** BigInt(32))) && (U = Ne(U)), U += "n"), S += ` It must be ${f}. Received ${U}`, S;
|
|
11389
11389
|
},
|
|
11390
11390
|
RangeError
|
|
11391
11391
|
);
|
|
11392
11392
|
function Ne(_) {
|
|
11393
|
-
let f = "",
|
|
11393
|
+
let f = "", p = _.length;
|
|
11394
11394
|
const S = _[0] === "-" ? 1 : 0;
|
|
11395
|
-
for (;
|
|
11396
|
-
f = `_${_.slice(
|
|
11397
|
-
return `${_.slice(0,
|
|
11395
|
+
for (; p >= S + 4; p -= 3)
|
|
11396
|
+
f = `_${_.slice(p - 3, p)}${f}`;
|
|
11397
|
+
return `${_.slice(0, p)}${f}`;
|
|
11398
11398
|
}
|
|
11399
|
-
function Ee(_, f,
|
|
11400
|
-
Pe(f, "offset"), (_[f] === void 0 || _[f +
|
|
11399
|
+
function Ee(_, f, p) {
|
|
11400
|
+
Pe(f, "offset"), (_[f] === void 0 || _[f + p] === void 0) && ve(f, _.length - (p + 1));
|
|
11401
11401
|
}
|
|
11402
|
-
function we(_, f,
|
|
11403
|
-
if (_ >
|
|
11402
|
+
function we(_, f, p, S, U, $) {
|
|
11403
|
+
if (_ > p || _ < f) {
|
|
11404
11404
|
const Z = typeof f == "bigint" ? "n" : "";
|
|
11405
11405
|
let Re;
|
|
11406
11406
|
throw f === 0 || f === BigInt(0) ? Re = `>= 0${Z} and < 2${Z} ** ${($ + 1) * 8}${Z}` : Re = `>= -(2${Z} ** ${($ + 1) * 8 - 1}${Z}) and < 2 ** ${($ + 1) * 8 - 1}${Z}`, new re.ERR_OUT_OF_RANGE("value", Re, _);
|
|
@@ -11411,8 +11411,8 @@ function Xc() {
|
|
|
11411
11411
|
if (typeof _ != "number")
|
|
11412
11412
|
throw new re.ERR_INVALID_ARG_TYPE(f, "number", _);
|
|
11413
11413
|
}
|
|
11414
|
-
function ve(_, f,
|
|
11415
|
-
throw Math.floor(_) !== _ ? (Pe(_,
|
|
11414
|
+
function ve(_, f, p) {
|
|
11415
|
+
throw Math.floor(_) !== _ ? (Pe(_, p), new re.ERR_OUT_OF_RANGE("offset", "an integer", _)) : f < 0 ? new re.ERR_BUFFER_OUT_OF_BOUNDS() : new re.ERR_OUT_OF_RANGE(
|
|
11416
11416
|
"offset",
|
|
11417
11417
|
`>= 0 and <= ${f}`,
|
|
11418
11418
|
_
|
|
@@ -11427,52 +11427,52 @@ function Xc() {
|
|
|
11427
11427
|
}
|
|
11428
11428
|
function ke(_, f) {
|
|
11429
11429
|
f = f || 1 / 0;
|
|
11430
|
-
let
|
|
11430
|
+
let p;
|
|
11431
11431
|
const S = _.length;
|
|
11432
11432
|
let U = null;
|
|
11433
11433
|
const $ = [];
|
|
11434
11434
|
for (let Z = 0; Z < S; ++Z) {
|
|
11435
|
-
if (
|
|
11435
|
+
if (p = _.charCodeAt(Z), p > 55295 && p < 57344) {
|
|
11436
11436
|
if (!U) {
|
|
11437
|
-
if (
|
|
11437
|
+
if (p > 56319) {
|
|
11438
11438
|
(f -= 3) > -1 && $.push(239, 191, 189);
|
|
11439
11439
|
continue;
|
|
11440
11440
|
} else if (Z + 1 === S) {
|
|
11441
11441
|
(f -= 3) > -1 && $.push(239, 191, 189);
|
|
11442
11442
|
continue;
|
|
11443
11443
|
}
|
|
11444
|
-
U =
|
|
11444
|
+
U = p;
|
|
11445
11445
|
continue;
|
|
11446
11446
|
}
|
|
11447
|
-
if (
|
|
11448
|
-
(f -= 3) > -1 && $.push(239, 191, 189), U =
|
|
11447
|
+
if (p < 56320) {
|
|
11448
|
+
(f -= 3) > -1 && $.push(239, 191, 189), U = p;
|
|
11449
11449
|
continue;
|
|
11450
11450
|
}
|
|
11451
|
-
|
|
11451
|
+
p = (U - 55296 << 10 | p - 56320) + 65536;
|
|
11452
11452
|
} else U && (f -= 3) > -1 && $.push(239, 191, 189);
|
|
11453
|
-
if (U = null,
|
|
11453
|
+
if (U = null, p < 128) {
|
|
11454
11454
|
if ((f -= 1) < 0) break;
|
|
11455
|
-
$.push(
|
|
11456
|
-
} else if (
|
|
11455
|
+
$.push(p);
|
|
11456
|
+
} else if (p < 2048) {
|
|
11457
11457
|
if ((f -= 2) < 0) break;
|
|
11458
11458
|
$.push(
|
|
11459
|
-
|
|
11460
|
-
|
|
11459
|
+
p >> 6 | 192,
|
|
11460
|
+
p & 63 | 128
|
|
11461
11461
|
);
|
|
11462
|
-
} else if (
|
|
11462
|
+
} else if (p < 65536) {
|
|
11463
11463
|
if ((f -= 3) < 0) break;
|
|
11464
11464
|
$.push(
|
|
11465
|
-
|
|
11466
|
-
|
|
11467
|
-
|
|
11465
|
+
p >> 12 | 224,
|
|
11466
|
+
p >> 6 & 63 | 128,
|
|
11467
|
+
p & 63 | 128
|
|
11468
11468
|
);
|
|
11469
|
-
} else if (
|
|
11469
|
+
} else if (p < 1114112) {
|
|
11470
11470
|
if ((f -= 4) < 0) break;
|
|
11471
11471
|
$.push(
|
|
11472
|
-
|
|
11473
|
-
|
|
11474
|
-
|
|
11475
|
-
|
|
11472
|
+
p >> 18 | 240,
|
|
11473
|
+
p >> 12 & 63 | 128,
|
|
11474
|
+
p >> 6 & 63 | 128,
|
|
11475
|
+
p & 63 | 128
|
|
11476
11476
|
);
|
|
11477
11477
|
} else
|
|
11478
11478
|
throw new Error("Invalid code point");
|
|
@@ -11481,24 +11481,24 @@ function Xc() {
|
|
|
11481
11481
|
}
|
|
11482
11482
|
function $e(_) {
|
|
11483
11483
|
const f = [];
|
|
11484
|
-
for (let
|
|
11485
|
-
f.push(_.charCodeAt(
|
|
11484
|
+
for (let p = 0; p < _.length; ++p)
|
|
11485
|
+
f.push(_.charCodeAt(p) & 255);
|
|
11486
11486
|
return f;
|
|
11487
11487
|
}
|
|
11488
11488
|
function mr(_, f) {
|
|
11489
|
-
let
|
|
11489
|
+
let p, S, U;
|
|
11490
11490
|
const $ = [];
|
|
11491
11491
|
for (let Z = 0; Z < _.length && !((f -= 2) < 0); ++Z)
|
|
11492
|
-
|
|
11492
|
+
p = _.charCodeAt(Z), S = p >> 8, U = p % 256, $.push(U), $.push(S);
|
|
11493
11493
|
return $;
|
|
11494
11494
|
}
|
|
11495
11495
|
function De(_) {
|
|
11496
11496
|
return e.toByteArray(sn(_));
|
|
11497
11497
|
}
|
|
11498
|
-
function Le(_, f,
|
|
11498
|
+
function Le(_, f, p, S) {
|
|
11499
11499
|
let U;
|
|
11500
|
-
for (U = 0; U < S && !(U +
|
|
11501
|
-
f[U +
|
|
11500
|
+
for (U = 0; U < S && !(U + p >= f.length || U >= _.length); ++U)
|
|
11501
|
+
f[U + p] = _[U];
|
|
11502
11502
|
return U;
|
|
11503
11503
|
}
|
|
11504
11504
|
function Vt(_, f) {
|
|
@@ -11509,10 +11509,10 @@ function Xc() {
|
|
|
11509
11509
|
}
|
|
11510
11510
|
const He = (function() {
|
|
11511
11511
|
const _ = "0123456789abcdef", f = new Array(256);
|
|
11512
|
-
for (let
|
|
11513
|
-
const S =
|
|
11512
|
+
for (let p = 0; p < 16; ++p) {
|
|
11513
|
+
const S = p * 16;
|
|
11514
11514
|
for (let U = 0; U < 16; ++U)
|
|
11515
|
-
f[S + U] = _[
|
|
11515
|
+
f[S + U] = _[p] + _[U];
|
|
11516
11516
|
}
|
|
11517
11517
|
return f;
|
|
11518
11518
|
})();
|
|
@@ -11555,7 +11555,7 @@ function ib(t) {
|
|
|
11555
11555
|
} catch {
|
|
11556
11556
|
return { isValid: !1, value: an };
|
|
11557
11557
|
}
|
|
11558
|
-
}), F = e.adjustScalarBytes || ((v) => v),
|
|
11558
|
+
}), F = e.adjustScalarBytes || ((v) => v), M = e.domain || ((v, R, I) => {
|
|
11559
11559
|
if (zn("phflag", I), R.length || I)
|
|
11560
11560
|
throw new Error("Contexts/pre-hash are not supported");
|
|
11561
11561
|
return v;
|
|
@@ -11711,7 +11711,7 @@ function ib(t) {
|
|
|
11711
11711
|
return ve !== Pe && (we = g(-we)), L.fromAffine({ x: we, y: D });
|
|
11712
11712
|
}
|
|
11713
11713
|
static fromPrivateKey(R) {
|
|
11714
|
-
const { scalar: I } =
|
|
11714
|
+
const { scalar: I } = C(R);
|
|
11715
11715
|
return z.multiply(I);
|
|
11716
11716
|
}
|
|
11717
11717
|
toRawBytes() {
|
|
@@ -11730,14 +11730,14 @@ function ib(t) {
|
|
|
11730
11730
|
function q(v) {
|
|
11731
11731
|
return ne(rs(v));
|
|
11732
11732
|
}
|
|
11733
|
-
function
|
|
11733
|
+
function C(v) {
|
|
11734
11734
|
const R = n.BYTES;
|
|
11735
11735
|
v = Ye("private key", v, R);
|
|
11736
11736
|
const I = Ye("hashed private key", i(v), 2 * R), b = F(I.slice(0, R)), u = I.slice(R, 2 * R), l = q(b);
|
|
11737
11737
|
return { head: b, prefix: u, scalar: l };
|
|
11738
11738
|
}
|
|
11739
11739
|
function P(v) {
|
|
11740
|
-
const { head: R, prefix: I, scalar: b } =
|
|
11740
|
+
const { head: R, prefix: I, scalar: b } = C(v), u = z.multiply(b), l = u.toRawBytes();
|
|
11741
11741
|
return { head: R, prefix: I, scalar: b, point: u, pointBytes: l };
|
|
11742
11742
|
}
|
|
11743
11743
|
function j(v) {
|
|
@@ -11745,7 +11745,7 @@ function ib(t) {
|
|
|
11745
11745
|
}
|
|
11746
11746
|
function E(v = Uint8Array.of(), ...R) {
|
|
11747
11747
|
const I = Dr(...R);
|
|
11748
|
-
return q(i(
|
|
11748
|
+
return q(i(M(I, Ye("context", v), !!s)));
|
|
11749
11749
|
}
|
|
11750
11750
|
function c(v, R, I = {}) {
|
|
11751
11751
|
v = Ye("message", v), s && (v = s(v));
|
|
@@ -11754,8 +11754,8 @@ function ib(t) {
|
|
|
11754
11754
|
const re = Dr(T, Ai(W, n.BYTES));
|
|
11755
11755
|
return Ye("result", re, n.BYTES * 2);
|
|
11756
11756
|
}
|
|
11757
|
-
const
|
|
11758
|
-
function y(v, R, I, b =
|
|
11757
|
+
const h = rb;
|
|
11758
|
+
function y(v, R, I, b = h) {
|
|
11759
11759
|
const { context: u, zip215: l } = b, w = n.BYTES;
|
|
11760
11760
|
v = Ye("signature", v, 2 * w), R = Ye("message", R), I = Ye("publicKey", I, w), l !== void 0 && zn("zip215", l), s && (R = s(R));
|
|
11761
11761
|
const T = rs(v.slice(w, 2 * w));
|
|
@@ -11799,7 +11799,7 @@ const ob = BigInt(1), kd = BigInt(2);
|
|
|
11799
11799
|
BigInt(3);
|
|
11800
11800
|
const ab = BigInt(5), cb = BigInt(8);
|
|
11801
11801
|
function ub(t) {
|
|
11802
|
-
const e = BigInt(10), n = BigInt(20), r = BigInt(40), s = BigInt(80), i = Qc, a = t * t % i * t % i, d = Ke(a, kd, i) * a % i, m = Ke(d, ob, i) * t % i, g = Ke(m, ab, i) * m % i, x = Ke(g, e, i) * g % i, O = Ke(x, n, i) * x % i, N = Ke(O, r, i) * O % i, F = Ke(N, s, i) * N % i,
|
|
11802
|
+
const e = BigInt(10), n = BigInt(20), r = BigInt(40), s = BigInt(80), i = Qc, a = t * t % i * t % i, d = Ke(a, kd, i) * a % i, m = Ke(d, ob, i) * t % i, g = Ke(m, ab, i) * m % i, x = Ke(g, e, i) * g % i, O = Ke(x, n, i) * x % i, N = Ke(O, r, i) * O % i, F = Ke(N, s, i) * N % i, M = Ke(F, s, i) * N % i, k = Ke(M, e, i) * g % i;
|
|
11803
11803
|
return { pow_p_5_8: Ke(k, kd, i) * t % i, b2: a };
|
|
11804
11804
|
}
|
|
11805
11805
|
function db(t) {
|
|
@@ -11845,14 +11845,14 @@ function mh() {
|
|
|
11845
11845
|
}
|
|
11846
11846
|
function s(E, c) {
|
|
11847
11847
|
E.super_ = c;
|
|
11848
|
-
var
|
|
11848
|
+
var h = function() {
|
|
11849
11849
|
};
|
|
11850
|
-
|
|
11850
|
+
h.prototype = c.prototype, E.prototype = new h(), E.prototype.constructor = E;
|
|
11851
11851
|
}
|
|
11852
|
-
function i(E, c,
|
|
11852
|
+
function i(E, c, h) {
|
|
11853
11853
|
if (i.isBN(E))
|
|
11854
11854
|
return E;
|
|
11855
|
-
this.negative = 0, this.words = null, this.length = 0, this.red = null, E !== null && ((c === "le" || c === "be") && (
|
|
11855
|
+
this.negative = 0, this.words = null, this.length = 0, this.red = null, E !== null && ((c === "le" || c === "be") && (h = c, c = 10), this._init(E || 0, c || 10, h || "be"));
|
|
11856
11856
|
}
|
|
11857
11857
|
typeof e == "object" ? e.exports = i : n.BN = i, i.BN = i, i.wordSize = 26;
|
|
11858
11858
|
var o;
|
|
@@ -11862,19 +11862,19 @@ function mh() {
|
|
|
11862
11862
|
}
|
|
11863
11863
|
i.isBN = function(c) {
|
|
11864
11864
|
return c instanceof i ? !0 : c !== null && typeof c == "object" && c.constructor.wordSize === i.wordSize && Array.isArray(c.words);
|
|
11865
|
-
}, i.max = function(c,
|
|
11866
|
-
return c.cmp(
|
|
11867
|
-
}, i.min = function(c,
|
|
11868
|
-
return c.cmp(
|
|
11869
|
-
}, i.prototype._init = function(c,
|
|
11865
|
+
}, i.max = function(c, h) {
|
|
11866
|
+
return c.cmp(h) > 0 ? c : h;
|
|
11867
|
+
}, i.min = function(c, h) {
|
|
11868
|
+
return c.cmp(h) < 0 ? c : h;
|
|
11869
|
+
}, i.prototype._init = function(c, h, y) {
|
|
11870
11870
|
if (typeof c == "number")
|
|
11871
|
-
return this._initNumber(c,
|
|
11871
|
+
return this._initNumber(c, h, y);
|
|
11872
11872
|
if (typeof c == "object")
|
|
11873
|
-
return this._initArray(c,
|
|
11874
|
-
|
|
11873
|
+
return this._initArray(c, h, y);
|
|
11874
|
+
h === "hex" && (h = 16), r(h === (h | 0) && h >= 2 && h <= 36), c = c.toString().replace(/\s+/g, "");
|
|
11875
11875
|
var A = 0;
|
|
11876
|
-
c[0] === "-" && (A++, this.negative = 1), A < c.length && (
|
|
11877
|
-
}, i.prototype._initNumber = function(c,
|
|
11876
|
+
c[0] === "-" && (A++, this.negative = 1), A < c.length && (h === 16 ? this._parseHex(c, A, y) : (this._parseBase(c, h, A), y === "le" && this._initArray(this.toArray(), h, y)));
|
|
11877
|
+
}, i.prototype._initNumber = function(c, h, y) {
|
|
11878
11878
|
c < 0 && (this.negative = 1, c = -c), c < 67108864 ? (this.words = [c & 67108863], this.length = 1) : c < 4503599627370496 ? (this.words = [
|
|
11879
11879
|
c & 67108863,
|
|
11880
11880
|
c / 67108864 & 67108863
|
|
@@ -11882,8 +11882,8 @@ function mh() {
|
|
|
11882
11882
|
c & 67108863,
|
|
11883
11883
|
c / 67108864 & 67108863,
|
|
11884
11884
|
1
|
|
11885
|
-
], this.length = 3), y === "le" && this._initArray(this.toArray(),
|
|
11886
|
-
}, i.prototype._initArray = function(c,
|
|
11885
|
+
], this.length = 3), y === "le" && this._initArray(this.toArray(), h, y);
|
|
11886
|
+
}, i.prototype._initArray = function(c, h, y) {
|
|
11887
11887
|
if (r(typeof c.length == "number"), c.length <= 0)
|
|
11888
11888
|
return this.words = [0], this.length = 1, this;
|
|
11889
11889
|
this.length = Math.ceil(c.length / 3), this.words = new Array(this.length);
|
|
@@ -11899,59 +11899,59 @@ function mh() {
|
|
|
11899
11899
|
return this._strip();
|
|
11900
11900
|
};
|
|
11901
11901
|
function a(E, c) {
|
|
11902
|
-
var
|
|
11903
|
-
if (
|
|
11904
|
-
return
|
|
11905
|
-
if (
|
|
11906
|
-
return
|
|
11907
|
-
if (
|
|
11908
|
-
return
|
|
11902
|
+
var h = E.charCodeAt(c);
|
|
11903
|
+
if (h >= 48 && h <= 57)
|
|
11904
|
+
return h - 48;
|
|
11905
|
+
if (h >= 65 && h <= 70)
|
|
11906
|
+
return h - 55;
|
|
11907
|
+
if (h >= 97 && h <= 102)
|
|
11908
|
+
return h - 87;
|
|
11909
11909
|
r(!1, "Invalid character in " + E);
|
|
11910
11910
|
}
|
|
11911
|
-
function d(E, c,
|
|
11912
|
-
var y = a(E,
|
|
11913
|
-
return
|
|
11911
|
+
function d(E, c, h) {
|
|
11912
|
+
var y = a(E, h);
|
|
11913
|
+
return h - 1 >= c && (y |= a(E, h - 1) << 4), y;
|
|
11914
11914
|
}
|
|
11915
|
-
i.prototype._parseHex = function(c,
|
|
11916
|
-
this.length = Math.ceil((c.length -
|
|
11915
|
+
i.prototype._parseHex = function(c, h, y) {
|
|
11916
|
+
this.length = Math.ceil((c.length - h) / 6), this.words = new Array(this.length);
|
|
11917
11917
|
for (var A = 0; A < this.length; A++)
|
|
11918
11918
|
this.words[A] = 0;
|
|
11919
11919
|
var v = 0, R = 0, I;
|
|
11920
11920
|
if (y === "be")
|
|
11921
|
-
for (A = c.length - 1; A >=
|
|
11922
|
-
I = d(c,
|
|
11921
|
+
for (A = c.length - 1; A >= h; A -= 2)
|
|
11922
|
+
I = d(c, h, A) << v, this.words[R] |= I & 67108863, v >= 18 ? (v -= 18, R += 1, this.words[R] |= I >>> 26) : v += 8;
|
|
11923
11923
|
else {
|
|
11924
|
-
var b = c.length -
|
|
11925
|
-
for (A = b % 2 === 0 ?
|
|
11926
|
-
I = d(c,
|
|
11924
|
+
var b = c.length - h;
|
|
11925
|
+
for (A = b % 2 === 0 ? h + 1 : h; A < c.length; A += 2)
|
|
11926
|
+
I = d(c, h, A) << v, this.words[R] |= I & 67108863, v >= 18 ? (v -= 18, R += 1, this.words[R] |= I >>> 26) : v += 8;
|
|
11927
11927
|
}
|
|
11928
11928
|
this._strip();
|
|
11929
11929
|
};
|
|
11930
|
-
function m(E, c,
|
|
11931
|
-
for (var A = 0, v = 0, R = Math.min(E.length,
|
|
11930
|
+
function m(E, c, h, y) {
|
|
11931
|
+
for (var A = 0, v = 0, R = Math.min(E.length, h), I = c; I < R; I++) {
|
|
11932
11932
|
var b = E.charCodeAt(I) - 48;
|
|
11933
11933
|
A *= y, b >= 49 ? v = b - 49 + 10 : b >= 17 ? v = b - 17 + 10 : v = b, r(b >= 0 && v < y, "Invalid character"), A += v;
|
|
11934
11934
|
}
|
|
11935
11935
|
return A;
|
|
11936
11936
|
}
|
|
11937
|
-
i.prototype._parseBase = function(c,
|
|
11937
|
+
i.prototype._parseBase = function(c, h, y) {
|
|
11938
11938
|
this.words = [0], this.length = 1;
|
|
11939
|
-
for (var A = 0, v = 1; v <= 67108863; v *=
|
|
11939
|
+
for (var A = 0, v = 1; v <= 67108863; v *= h)
|
|
11940
11940
|
A++;
|
|
11941
|
-
A--, v = v /
|
|
11941
|
+
A--, v = v / h | 0;
|
|
11942
11942
|
for (var R = c.length - y, I = R % A, b = Math.min(R, R - I) + y, u = 0, l = y; l < b; l += A)
|
|
11943
|
-
u = m(c, l, l + A,
|
|
11943
|
+
u = m(c, l, l + A, h), this.imuln(v), this.words[0] + u < 67108864 ? this.words[0] += u : this._iaddn(u);
|
|
11944
11944
|
if (I !== 0) {
|
|
11945
11945
|
var w = 1;
|
|
11946
|
-
for (u = m(c, l, c.length,
|
|
11947
|
-
w *=
|
|
11946
|
+
for (u = m(c, l, c.length, h), l = 0; l < I; l++)
|
|
11947
|
+
w *= h;
|
|
11948
11948
|
this.imuln(w), this.words[0] + u < 67108864 ? this.words[0] += u : this._iaddn(u);
|
|
11949
11949
|
}
|
|
11950
11950
|
this._strip();
|
|
11951
11951
|
}, i.prototype.copy = function(c) {
|
|
11952
11952
|
c.words = new Array(this.length);
|
|
11953
|
-
for (var
|
|
11954
|
-
c.words[
|
|
11953
|
+
for (var h = 0; h < this.length; h++)
|
|
11954
|
+
c.words[h] = this.words[h];
|
|
11955
11955
|
c.length = this.length, c.negative = this.negative, c.red = this.red;
|
|
11956
11956
|
};
|
|
11957
11957
|
function g(E, c) {
|
|
@@ -12087,8 +12087,8 @@ function mh() {
|
|
|
12087
12087
|
52521875,
|
|
12088
12088
|
60466176
|
|
12089
12089
|
];
|
|
12090
|
-
i.prototype.toString = function(c,
|
|
12091
|
-
c = c || 10,
|
|
12090
|
+
i.prototype.toString = function(c, h) {
|
|
12091
|
+
c = c || 10, h = h | 0 || 1;
|
|
12092
12092
|
var y;
|
|
12093
12093
|
if (c === 16 || c === "hex") {
|
|
12094
12094
|
y = "";
|
|
@@ -12096,7 +12096,7 @@ function mh() {
|
|
|
12096
12096
|
var I = this.words[R], b = ((I << A | v) & 16777215).toString(16);
|
|
12097
12097
|
v = I >>> 24 - A & 16777215, A += 2, A >= 26 && (A -= 26, R--), v !== 0 || R !== this.length - 1 ? y = O[6 - b.length] + b + y : y = b + y;
|
|
12098
12098
|
}
|
|
12099
|
-
for (v !== 0 && (y = v.toString(16) + y); y.length %
|
|
12099
|
+
for (v !== 0 && (y = v.toString(16) + y); y.length % h !== 0; )
|
|
12100
12100
|
y = "0" + y;
|
|
12101
12101
|
return this.negative !== 0 && (y = "-" + y), y;
|
|
12102
12102
|
}
|
|
@@ -12108,7 +12108,7 @@ function mh() {
|
|
|
12108
12108
|
var T = w.modrn(l).toString(c);
|
|
12109
12109
|
w = w.idivn(l), w.isZero() ? y = T + y : y = O[u - T.length] + T + y;
|
|
12110
12110
|
}
|
|
12111
|
-
for (this.isZero() && (y = "0" + y); y.length %
|
|
12111
|
+
for (this.isZero() && (y = "0" + y); y.length % h !== 0; )
|
|
12112
12112
|
y = "0" + y;
|
|
12113
12113
|
return this.negative !== 0 && (y = "-" + y), y;
|
|
12114
12114
|
}
|
|
@@ -12118,21 +12118,21 @@ function mh() {
|
|
|
12118
12118
|
return this.length === 2 ? c += this.words[1] * 67108864 : this.length === 3 && this.words[2] === 1 ? c += 4503599627370496 + this.words[1] * 67108864 : this.length > 2 && r(!1, "Number can only safely store up to 53 bits"), this.negative !== 0 ? -c : c;
|
|
12119
12119
|
}, i.prototype.toJSON = function() {
|
|
12120
12120
|
return this.toString(16, 2);
|
|
12121
|
-
}, o && (i.prototype.toBuffer = function(c,
|
|
12122
|
-
return this.toArrayLike(o, c,
|
|
12123
|
-
}), i.prototype.toArray = function(c,
|
|
12124
|
-
return this.toArrayLike(Array, c,
|
|
12121
|
+
}, o && (i.prototype.toBuffer = function(c, h) {
|
|
12122
|
+
return this.toArrayLike(o, c, h);
|
|
12123
|
+
}), i.prototype.toArray = function(c, h) {
|
|
12124
|
+
return this.toArrayLike(Array, c, h);
|
|
12125
12125
|
};
|
|
12126
|
-
var
|
|
12127
|
-
return c.allocUnsafe ? c.allocUnsafe(
|
|
12126
|
+
var M = function(c, h) {
|
|
12127
|
+
return c.allocUnsafe ? c.allocUnsafe(h) : new c(h);
|
|
12128
12128
|
};
|
|
12129
|
-
i.prototype.toArrayLike = function(c,
|
|
12129
|
+
i.prototype.toArrayLike = function(c, h, y) {
|
|
12130
12130
|
this._strip();
|
|
12131
12131
|
var A = this.byteLength(), v = y || Math.max(1, A);
|
|
12132
12132
|
r(A <= v, "byte array longer than desired length"), r(v > 0, "Requested array length <= 0");
|
|
12133
|
-
var R =
|
|
12133
|
+
var R = M(c, v), I = h === "le" ? "LE" : "BE";
|
|
12134
12134
|
return this["_toArrayLike" + I](R, A), R;
|
|
12135
|
-
}, i.prototype._toArrayLikeLE = function(c,
|
|
12135
|
+
}, i.prototype._toArrayLikeLE = function(c, h) {
|
|
12136
12136
|
for (var y = 0, A = 0, v = 0, R = 0; v < this.length; v++) {
|
|
12137
12137
|
var I = this.words[v] << R | A;
|
|
12138
12138
|
c[y++] = I & 255, y < c.length && (c[y++] = I >> 8 & 255), y < c.length && (c[y++] = I >> 16 & 255), R === 6 ? (y < c.length && (c[y++] = I >> 24 & 255), A = 0, R = 0) : (A = I >>> 24, R += 2);
|
|
@@ -12140,7 +12140,7 @@ function mh() {
|
|
|
12140
12140
|
if (y < c.length)
|
|
12141
12141
|
for (c[y++] = A; y < c.length; )
|
|
12142
12142
|
c[y++] = 0;
|
|
12143
|
-
}, i.prototype._toArrayLikeBE = function(c,
|
|
12143
|
+
}, i.prototype._toArrayLikeBE = function(c, h) {
|
|
12144
12144
|
for (var y = c.length - 1, A = 0, v = 0, R = 0; v < this.length; v++) {
|
|
12145
12145
|
var I = this.words[v] << R | A;
|
|
12146
12146
|
c[y--] = I & 255, y >= 0 && (c[y--] = I >> 8 & 255), y >= 0 && (c[y--] = I >> 16 & 255), R === 6 ? (y >= 0 && (c[y--] = I >> 24 & 255), A = 0, R = 0) : (A = I >>> 24, R += 2);
|
|
@@ -12151,27 +12151,27 @@ function mh() {
|
|
|
12151
12151
|
}, Math.clz32 ? i.prototype._countBits = function(c) {
|
|
12152
12152
|
return 32 - Math.clz32(c);
|
|
12153
12153
|
} : i.prototype._countBits = function(c) {
|
|
12154
|
-
var
|
|
12155
|
-
return
|
|
12154
|
+
var h = c, y = 0;
|
|
12155
|
+
return h >= 4096 && (y += 13, h >>>= 13), h >= 64 && (y += 7, h >>>= 7), h >= 8 && (y += 4, h >>>= 4), h >= 2 && (y += 2, h >>>= 2), y + h;
|
|
12156
12156
|
}, i.prototype._zeroBits = function(c) {
|
|
12157
12157
|
if (c === 0) return 26;
|
|
12158
|
-
var
|
|
12159
|
-
return (
|
|
12158
|
+
var h = c, y = 0;
|
|
12159
|
+
return (h & 8191) === 0 && (y += 13, h >>>= 13), (h & 127) === 0 && (y += 7, h >>>= 7), (h & 15) === 0 && (y += 4, h >>>= 4), (h & 3) === 0 && (y += 2, h >>>= 2), (h & 1) === 0 && y++, y;
|
|
12160
12160
|
}, i.prototype.bitLength = function() {
|
|
12161
|
-
var c = this.words[this.length - 1],
|
|
12162
|
-
return (this.length - 1) * 26 +
|
|
12161
|
+
var c = this.words[this.length - 1], h = this._countBits(c);
|
|
12162
|
+
return (this.length - 1) * 26 + h;
|
|
12163
12163
|
};
|
|
12164
12164
|
function k(E) {
|
|
12165
|
-
for (var c = new Array(E.bitLength()),
|
|
12166
|
-
var y =
|
|
12167
|
-
c[
|
|
12165
|
+
for (var c = new Array(E.bitLength()), h = 0; h < c.length; h++) {
|
|
12166
|
+
var y = h / 26 | 0, A = h % 26;
|
|
12167
|
+
c[h] = E.words[y] >>> A & 1;
|
|
12168
12168
|
}
|
|
12169
12169
|
return c;
|
|
12170
12170
|
}
|
|
12171
12171
|
i.prototype.zeroBits = function() {
|
|
12172
12172
|
if (this.isZero()) return 0;
|
|
12173
|
-
for (var c = 0,
|
|
12174
|
-
var y = this._zeroBits(this.words[
|
|
12173
|
+
for (var c = 0, h = 0; h < this.length; h++) {
|
|
12174
|
+
var y = this._zeroBits(this.words[h]);
|
|
12175
12175
|
if (c += y, y !== 26) break;
|
|
12176
12176
|
}
|
|
12177
12177
|
return c;
|
|
@@ -12190,8 +12190,8 @@ function mh() {
|
|
|
12190
12190
|
}, i.prototype.iuor = function(c) {
|
|
12191
12191
|
for (; this.length < c.length; )
|
|
12192
12192
|
this.words[this.length++] = 0;
|
|
12193
|
-
for (var
|
|
12194
|
-
this.words[
|
|
12193
|
+
for (var h = 0; h < c.length; h++)
|
|
12194
|
+
this.words[h] = this.words[h] | c.words[h];
|
|
12195
12195
|
return this._strip();
|
|
12196
12196
|
}, i.prototype.ior = function(c) {
|
|
12197
12197
|
return r((this.negative | c.negative) === 0), this.iuor(c);
|
|
@@ -12200,11 +12200,11 @@ function mh() {
|
|
|
12200
12200
|
}, i.prototype.uor = function(c) {
|
|
12201
12201
|
return this.length > c.length ? this.clone().iuor(c) : c.clone().iuor(this);
|
|
12202
12202
|
}, i.prototype.iuand = function(c) {
|
|
12203
|
-
var
|
|
12204
|
-
this.length > c.length ?
|
|
12205
|
-
for (var y = 0; y <
|
|
12203
|
+
var h;
|
|
12204
|
+
this.length > c.length ? h = c : h = this;
|
|
12205
|
+
for (var y = 0; y < h.length; y++)
|
|
12206
12206
|
this.words[y] = this.words[y] & c.words[y];
|
|
12207
|
-
return this.length =
|
|
12207
|
+
return this.length = h.length, this._strip();
|
|
12208
12208
|
}, i.prototype.iand = function(c) {
|
|
12209
12209
|
return r((this.negative | c.negative) === 0), this.iuand(c);
|
|
12210
12210
|
}, i.prototype.and = function(c) {
|
|
@@ -12212,14 +12212,14 @@ function mh() {
|
|
|
12212
12212
|
}, i.prototype.uand = function(c) {
|
|
12213
12213
|
return this.length > c.length ? this.clone().iuand(c) : c.clone().iuand(this);
|
|
12214
12214
|
}, i.prototype.iuxor = function(c) {
|
|
12215
|
-
var
|
|
12216
|
-
this.length > c.length ? (
|
|
12215
|
+
var h, y;
|
|
12216
|
+
this.length > c.length ? (h = this, y = c) : (h = c, y = this);
|
|
12217
12217
|
for (var A = 0; A < y.length; A++)
|
|
12218
|
-
this.words[A] =
|
|
12219
|
-
if (this !==
|
|
12220
|
-
for (; A <
|
|
12221
|
-
this.words[A] =
|
|
12222
|
-
return this.length =
|
|
12218
|
+
this.words[A] = h.words[A] ^ y.words[A];
|
|
12219
|
+
if (this !== h)
|
|
12220
|
+
for (; A < h.length; A++)
|
|
12221
|
+
this.words[A] = h.words[A];
|
|
12222
|
+
return this.length = h.length, this._strip();
|
|
12223
12223
|
}, i.prototype.ixor = function(c) {
|
|
12224
12224
|
return r((this.negative | c.negative) === 0), this.iuxor(c);
|
|
12225
12225
|
}, i.prototype.xor = function(c) {
|
|
@@ -12228,29 +12228,29 @@ function mh() {
|
|
|
12228
12228
|
return this.length > c.length ? this.clone().iuxor(c) : c.clone().iuxor(this);
|
|
12229
12229
|
}, i.prototype.inotn = function(c) {
|
|
12230
12230
|
r(typeof c == "number" && c >= 0);
|
|
12231
|
-
var
|
|
12232
|
-
this._expand(
|
|
12233
|
-
for (var A = 0; A <
|
|
12231
|
+
var h = Math.ceil(c / 26) | 0, y = c % 26;
|
|
12232
|
+
this._expand(h), y > 0 && h--;
|
|
12233
|
+
for (var A = 0; A < h; A++)
|
|
12234
12234
|
this.words[A] = ~this.words[A] & 67108863;
|
|
12235
12235
|
return y > 0 && (this.words[A] = ~this.words[A] & 67108863 >> 26 - y), this._strip();
|
|
12236
12236
|
}, i.prototype.notn = function(c) {
|
|
12237
12237
|
return this.clone().inotn(c);
|
|
12238
|
-
}, i.prototype.setn = function(c,
|
|
12238
|
+
}, i.prototype.setn = function(c, h) {
|
|
12239
12239
|
r(typeof c == "number" && c >= 0);
|
|
12240
12240
|
var y = c / 26 | 0, A = c % 26;
|
|
12241
|
-
return this._expand(y + 1),
|
|
12241
|
+
return this._expand(y + 1), h ? this.words[y] = this.words[y] | 1 << A : this.words[y] = this.words[y] & ~(1 << A), this._strip();
|
|
12242
12242
|
}, i.prototype.iadd = function(c) {
|
|
12243
|
-
var
|
|
12243
|
+
var h;
|
|
12244
12244
|
if (this.negative !== 0 && c.negative === 0)
|
|
12245
|
-
return this.negative = 0,
|
|
12245
|
+
return this.negative = 0, h = this.isub(c), this.negative ^= 1, this._normSign();
|
|
12246
12246
|
if (this.negative === 0 && c.negative !== 0)
|
|
12247
|
-
return c.negative = 0,
|
|
12247
|
+
return c.negative = 0, h = this.isub(c), c.negative = 1, h._normSign();
|
|
12248
12248
|
var y, A;
|
|
12249
12249
|
this.length > c.length ? (y = this, A = c) : (y = c, A = this);
|
|
12250
12250
|
for (var v = 0, R = 0; R < A.length; R++)
|
|
12251
|
-
|
|
12251
|
+
h = (y.words[R] | 0) + (A.words[R] | 0) + v, this.words[R] = h & 67108863, v = h >>> 26;
|
|
12252
12252
|
for (; v !== 0 && R < y.length; R++)
|
|
12253
|
-
|
|
12253
|
+
h = (y.words[R] | 0) + v, this.words[R] = h & 67108863, v = h >>> 26;
|
|
12254
12254
|
if (this.length = y.length, v !== 0)
|
|
12255
12255
|
this.words[this.length] = v, this.length++;
|
|
12256
12256
|
else if (y !== this)
|
|
@@ -12258,13 +12258,13 @@ function mh() {
|
|
|
12258
12258
|
this.words[R] = y.words[R];
|
|
12259
12259
|
return this;
|
|
12260
12260
|
}, i.prototype.add = function(c) {
|
|
12261
|
-
var
|
|
12262
|
-
return c.negative !== 0 && this.negative === 0 ? (c.negative = 0,
|
|
12261
|
+
var h;
|
|
12262
|
+
return c.negative !== 0 && this.negative === 0 ? (c.negative = 0, h = this.sub(c), c.negative ^= 1, h) : c.negative === 0 && this.negative !== 0 ? (this.negative = 0, h = c.sub(this), this.negative = 1, h) : this.length > c.length ? this.clone().iadd(c) : c.clone().iadd(this);
|
|
12263
12263
|
}, i.prototype.isub = function(c) {
|
|
12264
12264
|
if (c.negative !== 0) {
|
|
12265
12265
|
c.negative = 0;
|
|
12266
|
-
var
|
|
12267
|
-
return c.negative = 1,
|
|
12266
|
+
var h = this.iadd(c);
|
|
12267
|
+
return c.negative = 1, h._normSign();
|
|
12268
12268
|
} else if (this.negative !== 0)
|
|
12269
12269
|
return this.negative = 0, this.iadd(c), this.negative = 1, this._normSign();
|
|
12270
12270
|
var y = this.cmp(c);
|
|
@@ -12273,9 +12273,9 @@ function mh() {
|
|
|
12273
12273
|
var A, v;
|
|
12274
12274
|
y > 0 ? (A = this, v = c) : (A = c, v = this);
|
|
12275
12275
|
for (var R = 0, I = 0; I < v.length; I++)
|
|
12276
|
-
|
|
12276
|
+
h = (A.words[I] | 0) - (v.words[I] | 0) + R, R = h >> 26, this.words[I] = h & 67108863;
|
|
12277
12277
|
for (; R !== 0 && I < A.length; I++)
|
|
12278
|
-
|
|
12278
|
+
h = (A.words[I] | 0) + R, R = h >> 26, this.words[I] = h & 67108863;
|
|
12279
12279
|
if (R === 0 && I < A.length && A !== this)
|
|
12280
12280
|
for (; I < A.length; I++)
|
|
12281
12281
|
this.words[I] = A.words[I];
|
|
@@ -12283,24 +12283,24 @@ function mh() {
|
|
|
12283
12283
|
}, i.prototype.sub = function(c) {
|
|
12284
12284
|
return this.clone().isub(c);
|
|
12285
12285
|
};
|
|
12286
|
-
function K(E, c,
|
|
12287
|
-
|
|
12286
|
+
function K(E, c, h) {
|
|
12287
|
+
h.negative = c.negative ^ E.negative;
|
|
12288
12288
|
var y = E.length + c.length | 0;
|
|
12289
|
-
|
|
12289
|
+
h.length = y, y = y - 1 | 0;
|
|
12290
12290
|
var A = E.words[0] | 0, v = c.words[0] | 0, R = A * v, I = R & 67108863, b = R / 67108864 | 0;
|
|
12291
|
-
|
|
12291
|
+
h.words[0] = I;
|
|
12292
12292
|
for (var u = 1; u < y; u++) {
|
|
12293
12293
|
for (var l = b >>> 26, w = b & 67108863, T = Math.min(u, c.length - 1), D = Math.max(0, u - E.length + 1); D <= T; D++) {
|
|
12294
12294
|
var W = u - D | 0;
|
|
12295
12295
|
A = E.words[W] | 0, v = c.words[D] | 0, R = A * v + w, l += R / 67108864 | 0, w = R & 67108863;
|
|
12296
12296
|
}
|
|
12297
|
-
|
|
12297
|
+
h.words[u] = w | 0, b = l | 0;
|
|
12298
12298
|
}
|
|
12299
|
-
return b !== 0 ?
|
|
12299
|
+
return b !== 0 ? h.words[u] = b | 0 : h.length--, h._strip();
|
|
12300
12300
|
}
|
|
12301
|
-
var Y = function(c,
|
|
12302
|
-
var A = c.words, v =
|
|
12303
|
-
y.negative = c.negative ^
|
|
12301
|
+
var Y = function(c, h, y) {
|
|
12302
|
+
var A = c.words, v = h.words, R = y.words, I = 0, b, u, l, w = A[0] | 0, T = w & 8191, D = w >>> 13, W = A[1] | 0, re = W & 8191, oe = W >>> 13, Ne = A[2] | 0, Ee = Ne & 8191, we = Ne >>> 13, Pe = A[3] | 0, ve = Pe & 8191, Te = Pe >>> 13, sn = A[4] | 0, ke = sn & 8191, $e = sn >>> 13, mr = A[5] | 0, De = mr & 8191, Le = mr >>> 13, Vt = A[6] | 0, ze = Vt & 8191, He = Vt >>> 13, Jt = A[7] | 0, qe = Jt & 8191, _ = Jt >>> 13, f = A[8] | 0, p = f & 8191, S = f >>> 13, U = A[9] | 0, $ = U & 8191, Z = U >>> 13, Re = v[0] | 0, ye = Re & 8191, me = Re >>> 13, Fe = v[1] | 0, he = Fe & 8191, Je = Fe >>> 13, Au = v[2] | 0, Xe = Au & 8191, Qe = Au >>> 13, xu = v[3] | 0, et = xu & 8191, tt = xu >>> 13, Su = v[4] | 0, nt = Su & 8191, rt = Su >>> 13, Tu = v[5] | 0, st = Tu & 8191, it = Tu >>> 13, Ou = v[6] | 0, ot = Ou & 8191, at = Ou >>> 13, Iu = v[7] | 0, ct = Iu & 8191, ut = Iu >>> 13, Nu = v[8] | 0, dt = Nu & 8191, lt = Nu >>> 13, Cu = v[9] | 0, ft = Cu & 8191, ht = Cu >>> 13;
|
|
12303
|
+
y.negative = c.negative ^ h.negative, y.length = 19, b = Math.imul(T, ye), u = Math.imul(T, me), u = u + Math.imul(D, ye) | 0, l = Math.imul(D, me);
|
|
12304
12304
|
var vo = (I + b | 0) + ((u & 8191) << 13) | 0;
|
|
12305
12305
|
I = (l + (u >>> 13) | 0) + (vo >>> 26) | 0, vo &= 67108863, b = Math.imul(re, ye), u = Math.imul(re, me), u = u + Math.imul(oe, ye) | 0, l = Math.imul(oe, me), b = b + Math.imul(T, he) | 0, u = u + Math.imul(T, Je) | 0, u = u + Math.imul(D, he) | 0, l = l + Math.imul(D, Je) | 0;
|
|
12306
12306
|
var Ro = (I + b | 0) + ((u & 8191) << 13) | 0;
|
|
@@ -12316,66 +12316,66 @@ function mh() {
|
|
|
12316
12316
|
var Oo = (I + b | 0) + ((u & 8191) << 13) | 0;
|
|
12317
12317
|
I = (l + (u >>> 13) | 0) + (Oo >>> 26) | 0, Oo &= 67108863, b = Math.imul(qe, ye), u = Math.imul(qe, me), u = u + Math.imul(_, ye) | 0, l = Math.imul(_, me), b = b + Math.imul(ze, he) | 0, u = u + Math.imul(ze, Je) | 0, u = u + Math.imul(He, he) | 0, l = l + Math.imul(He, Je) | 0, b = b + Math.imul(De, Xe) | 0, u = u + Math.imul(De, Qe) | 0, u = u + Math.imul(Le, Xe) | 0, l = l + Math.imul(Le, Qe) | 0, b = b + Math.imul(ke, et) | 0, u = u + Math.imul(ke, tt) | 0, u = u + Math.imul($e, et) | 0, l = l + Math.imul($e, tt) | 0, b = b + Math.imul(ve, nt) | 0, u = u + Math.imul(ve, rt) | 0, u = u + Math.imul(Te, nt) | 0, l = l + Math.imul(Te, rt) | 0, b = b + Math.imul(Ee, st) | 0, u = u + Math.imul(Ee, it) | 0, u = u + Math.imul(we, st) | 0, l = l + Math.imul(we, it) | 0, b = b + 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, b = b + Math.imul(T, ct) | 0, u = u + Math.imul(T, ut) | 0, u = u + Math.imul(D, ct) | 0, l = l + Math.imul(D, ut) | 0;
|
|
12318
12318
|
var Io = (I + b | 0) + ((u & 8191) << 13) | 0;
|
|
12319
|
-
I = (l + (u >>> 13) | 0) + (Io >>> 26) | 0, Io &= 67108863, b = Math.imul(
|
|
12319
|
+
I = (l + (u >>> 13) | 0) + (Io >>> 26) | 0, Io &= 67108863, b = Math.imul(p, ye), u = Math.imul(p, me), u = u + Math.imul(S, ye) | 0, l = Math.imul(S, me), b = b + Math.imul(qe, he) | 0, u = u + Math.imul(qe, Je) | 0, u = u + Math.imul(_, he) | 0, l = l + Math.imul(_, Je) | 0, b = b + Math.imul(ze, Xe) | 0, u = u + Math.imul(ze, Qe) | 0, u = u + Math.imul(He, Xe) | 0, l = l + Math.imul(He, Qe) | 0, b = b + Math.imul(De, et) | 0, u = u + Math.imul(De, tt) | 0, u = u + Math.imul(Le, et) | 0, l = l + Math.imul(Le, tt) | 0, b = b + Math.imul(ke, nt) | 0, u = u + Math.imul(ke, rt) | 0, u = u + Math.imul($e, nt) | 0, l = l + Math.imul($e, rt) | 0, b = b + Math.imul(ve, st) | 0, u = u + Math.imul(ve, it) | 0, u = u + Math.imul(Te, st) | 0, l = l + Math.imul(Te, it) | 0, b = b + Math.imul(Ee, ot) | 0, u = u + Math.imul(Ee, at) | 0, u = u + Math.imul(we, ot) | 0, l = l + Math.imul(we, at) | 0, b = b + 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, b = b + Math.imul(T, dt) | 0, u = u + Math.imul(T, lt) | 0, u = u + Math.imul(D, dt) | 0, l = l + Math.imul(D, lt) | 0;
|
|
12320
12320
|
var No = (I + b | 0) + ((u & 8191) << 13) | 0;
|
|
12321
|
-
I = (l + (u >>> 13) | 0) + (No >>> 26) | 0, No &= 67108863, b = Math.imul($, ye), u = Math.imul($, me), u = u + Math.imul(Z, ye) | 0, l = Math.imul(Z, me), b = b + Math.imul(
|
|
12321
|
+
I = (l + (u >>> 13) | 0) + (No >>> 26) | 0, No &= 67108863, b = Math.imul($, ye), u = Math.imul($, me), u = u + Math.imul(Z, ye) | 0, l = Math.imul(Z, me), b = b + Math.imul(p, he) | 0, u = u + Math.imul(p, Je) | 0, u = u + Math.imul(S, he) | 0, l = l + Math.imul(S, Je) | 0, b = b + Math.imul(qe, Xe) | 0, u = u + Math.imul(qe, Qe) | 0, u = u + Math.imul(_, Xe) | 0, l = l + Math.imul(_, Qe) | 0, b = b + Math.imul(ze, et) | 0, u = u + Math.imul(ze, tt) | 0, u = u + Math.imul(He, et) | 0, l = l + Math.imul(He, tt) | 0, b = b + Math.imul(De, nt) | 0, u = u + Math.imul(De, rt) | 0, u = u + Math.imul(Le, nt) | 0, l = l + Math.imul(Le, rt) | 0, b = b + Math.imul(ke, st) | 0, u = u + Math.imul(ke, it) | 0, u = u + Math.imul($e, st) | 0, l = l + Math.imul($e, it) | 0, b = b + Math.imul(ve, ot) | 0, u = u + Math.imul(ve, at) | 0, u = u + Math.imul(Te, ot) | 0, l = l + Math.imul(Te, at) | 0, b = b + Math.imul(Ee, ct) | 0, u = u + Math.imul(Ee, ut) | 0, u = u + Math.imul(we, ct) | 0, l = l + Math.imul(we, ut) | 0, b = b + 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, b = b + Math.imul(T, ft) | 0, u = u + Math.imul(T, ht) | 0, u = u + Math.imul(D, ft) | 0, l = l + Math.imul(D, ht) | 0;
|
|
12322
12322
|
var Co = (I + b | 0) + ((u & 8191) << 13) | 0;
|
|
12323
|
-
I = (l + (u >>> 13) | 0) + (Co >>> 26) | 0, Co &= 67108863, b = Math.imul($, he), u = Math.imul($, Je), u = u + Math.imul(Z, he) | 0, l = Math.imul(Z, Je), b = b + Math.imul(
|
|
12323
|
+
I = (l + (u >>> 13) | 0) + (Co >>> 26) | 0, Co &= 67108863, b = Math.imul($, he), u = Math.imul($, Je), u = u + Math.imul(Z, he) | 0, l = Math.imul(Z, Je), b = b + Math.imul(p, Xe) | 0, u = u + Math.imul(p, Qe) | 0, u = u + Math.imul(S, Xe) | 0, l = l + Math.imul(S, Qe) | 0, b = b + Math.imul(qe, et) | 0, u = u + Math.imul(qe, tt) | 0, u = u + Math.imul(_, et) | 0, l = l + Math.imul(_, tt) | 0, b = b + Math.imul(ze, nt) | 0, u = u + Math.imul(ze, rt) | 0, u = u + Math.imul(He, nt) | 0, l = l + Math.imul(He, rt) | 0, b = b + Math.imul(De, st) | 0, u = u + Math.imul(De, it) | 0, u = u + Math.imul(Le, st) | 0, l = l + Math.imul(Le, it) | 0, b = b + Math.imul(ke, ot) | 0, u = u + Math.imul(ke, at) | 0, u = u + Math.imul($e, ot) | 0, l = l + Math.imul($e, at) | 0, b = b + Math.imul(ve, ct) | 0, u = u + Math.imul(ve, ut) | 0, u = u + Math.imul(Te, ct) | 0, l = l + Math.imul(Te, ut) | 0, b = b + Math.imul(Ee, dt) | 0, u = u + Math.imul(Ee, lt) | 0, u = u + Math.imul(we, dt) | 0, l = l + Math.imul(we, lt) | 0, b = b + Math.imul(re, ft) | 0, u = u + Math.imul(re, ht) | 0, u = u + Math.imul(oe, ft) | 0, l = l + Math.imul(oe, ht) | 0;
|
|
12324
12324
|
var Mo = (I + b | 0) + ((u & 8191) << 13) | 0;
|
|
12325
|
-
I = (l + (u >>> 13) | 0) + (Mo >>> 26) | 0, Mo &= 67108863, b = Math.imul($, Xe), u = Math.imul($, Qe), u = u + Math.imul(Z, Xe) | 0, l = Math.imul(Z, Qe), b = b + Math.imul(
|
|
12325
|
+
I = (l + (u >>> 13) | 0) + (Mo >>> 26) | 0, Mo &= 67108863, b = Math.imul($, Xe), u = Math.imul($, Qe), u = u + Math.imul(Z, Xe) | 0, l = Math.imul(Z, Qe), b = b + Math.imul(p, et) | 0, u = u + Math.imul(p, tt) | 0, u = u + Math.imul(S, et) | 0, l = l + Math.imul(S, tt) | 0, b = b + Math.imul(qe, nt) | 0, u = u + Math.imul(qe, rt) | 0, u = u + Math.imul(_, nt) | 0, l = l + Math.imul(_, rt) | 0, b = b + Math.imul(ze, st) | 0, u = u + Math.imul(ze, it) | 0, u = u + Math.imul(He, st) | 0, l = l + Math.imul(He, it) | 0, b = b + Math.imul(De, ot) | 0, u = u + Math.imul(De, at) | 0, u = u + Math.imul(Le, ot) | 0, l = l + Math.imul(Le, at) | 0, b = b + Math.imul(ke, ct) | 0, u = u + Math.imul(ke, ut) | 0, u = u + Math.imul($e, ct) | 0, l = l + Math.imul($e, ut) | 0, b = b + Math.imul(ve, dt) | 0, u = u + Math.imul(ve, lt) | 0, u = u + Math.imul(Te, dt) | 0, l = l + Math.imul(Te, lt) | 0, b = b + Math.imul(Ee, ft) | 0, u = u + Math.imul(Ee, ht) | 0, u = u + Math.imul(we, ft) | 0, l = l + Math.imul(we, ht) | 0;
|
|
12326
12326
|
var Bo = (I + b | 0) + ((u & 8191) << 13) | 0;
|
|
12327
|
-
I = (l + (u >>> 13) | 0) + (Bo >>> 26) | 0, Bo &= 67108863, b = Math.imul($, et), u = Math.imul($, tt), u = u + Math.imul(Z, et) | 0, l = Math.imul(Z, tt), b = b + Math.imul(
|
|
12327
|
+
I = (l + (u >>> 13) | 0) + (Bo >>> 26) | 0, Bo &= 67108863, b = Math.imul($, et), u = Math.imul($, tt), u = u + Math.imul(Z, et) | 0, l = Math.imul(Z, tt), b = b + Math.imul(p, nt) | 0, u = u + Math.imul(p, rt) | 0, u = u + Math.imul(S, nt) | 0, l = l + Math.imul(S, rt) | 0, b = b + Math.imul(qe, st) | 0, u = u + Math.imul(qe, it) | 0, u = u + Math.imul(_, st) | 0, l = l + Math.imul(_, it) | 0, b = b + Math.imul(ze, ot) | 0, u = u + Math.imul(ze, at) | 0, u = u + Math.imul(He, ot) | 0, l = l + Math.imul(He, at) | 0, b = b + Math.imul(De, ct) | 0, u = u + Math.imul(De, ut) | 0, u = u + Math.imul(Le, ct) | 0, l = l + Math.imul(Le, ut) | 0, b = b + Math.imul(ke, dt) | 0, u = u + Math.imul(ke, lt) | 0, u = u + Math.imul($e, dt) | 0, l = l + Math.imul($e, lt) | 0, b = b + Math.imul(ve, ft) | 0, u = u + Math.imul(ve, ht) | 0, u = u + Math.imul(Te, ft) | 0, l = l + Math.imul(Te, ht) | 0;
|
|
12328
12328
|
var ko = (I + b | 0) + ((u & 8191) << 13) | 0;
|
|
12329
|
-
I = (l + (u >>> 13) | 0) + (ko >>> 26) | 0, ko &= 67108863, b = Math.imul($, nt), u = Math.imul($, rt), u = u + Math.imul(Z, nt) | 0, l = Math.imul(Z, rt), b = b + Math.imul(
|
|
12329
|
+
I = (l + (u >>> 13) | 0) + (ko >>> 26) | 0, ko &= 67108863, b = Math.imul($, nt), u = Math.imul($, rt), u = u + Math.imul(Z, nt) | 0, l = Math.imul(Z, rt), b = b + Math.imul(p, st) | 0, u = u + Math.imul(p, it) | 0, u = u + Math.imul(S, st) | 0, l = l + Math.imul(S, it) | 0, b = b + Math.imul(qe, ot) | 0, u = u + Math.imul(qe, at) | 0, u = u + Math.imul(_, ot) | 0, l = l + Math.imul(_, at) | 0, b = b + Math.imul(ze, ct) | 0, u = u + Math.imul(ze, ut) | 0, u = u + Math.imul(He, ct) | 0, l = l + Math.imul(He, ut) | 0, b = b + Math.imul(De, dt) | 0, u = u + Math.imul(De, lt) | 0, u = u + Math.imul(Le, dt) | 0, l = l + Math.imul(Le, lt) | 0, b = b + Math.imul(ke, ft) | 0, u = u + Math.imul(ke, ht) | 0, u = u + Math.imul($e, ft) | 0, l = l + Math.imul($e, ht) | 0;
|
|
12330
12330
|
var Lo = (I + b | 0) + ((u & 8191) << 13) | 0;
|
|
12331
|
-
I = (l + (u >>> 13) | 0) + (Lo >>> 26) | 0, Lo &= 67108863, b = Math.imul($, st), u = Math.imul($, it), u = u + Math.imul(Z, st) | 0, l = Math.imul(Z, it), b = b + Math.imul(
|
|
12331
|
+
I = (l + (u >>> 13) | 0) + (Lo >>> 26) | 0, Lo &= 67108863, b = Math.imul($, st), u = Math.imul($, it), u = u + Math.imul(Z, st) | 0, l = Math.imul(Z, it), b = b + Math.imul(p, ot) | 0, u = u + Math.imul(p, at) | 0, u = u + Math.imul(S, ot) | 0, l = l + Math.imul(S, at) | 0, b = b + Math.imul(qe, ct) | 0, u = u + Math.imul(qe, ut) | 0, u = u + Math.imul(_, ct) | 0, l = l + Math.imul(_, ut) | 0, b = b + Math.imul(ze, dt) | 0, u = u + Math.imul(ze, lt) | 0, u = u + Math.imul(He, dt) | 0, l = l + Math.imul(He, lt) | 0, b = b + Math.imul(De, ft) | 0, u = u + Math.imul(De, ht) | 0, u = u + Math.imul(Le, ft) | 0, l = l + Math.imul(Le, ht) | 0;
|
|
12332
12332
|
var Po = (I + b | 0) + ((u & 8191) << 13) | 0;
|
|
12333
|
-
I = (l + (u >>> 13) | 0) + (Po >>> 26) | 0, Po &= 67108863, b = Math.imul($, ot), u = Math.imul($, at), u = u + Math.imul(Z, ot) | 0, l = Math.imul(Z, at), b = b + Math.imul(
|
|
12333
|
+
I = (l + (u >>> 13) | 0) + (Po >>> 26) | 0, Po &= 67108863, b = Math.imul($, ot), u = Math.imul($, at), u = u + Math.imul(Z, ot) | 0, l = Math.imul(Z, at), b = b + Math.imul(p, ct) | 0, u = u + Math.imul(p, ut) | 0, u = u + Math.imul(S, ct) | 0, l = l + Math.imul(S, ut) | 0, b = b + Math.imul(qe, dt) | 0, u = u + Math.imul(qe, lt) | 0, u = u + Math.imul(_, dt) | 0, l = l + Math.imul(_, lt) | 0, b = b + Math.imul(ze, ft) | 0, u = u + Math.imul(ze, ht) | 0, u = u + Math.imul(He, ft) | 0, l = l + Math.imul(He, ht) | 0;
|
|
12334
12334
|
var Uo = (I + b | 0) + ((u & 8191) << 13) | 0;
|
|
12335
|
-
I = (l + (u >>> 13) | 0) + (Uo >>> 26) | 0, Uo &= 67108863, b = Math.imul($, ct), u = Math.imul($, ut), u = u + Math.imul(Z, ct) | 0, l = Math.imul(Z, ut), b = b + Math.imul(
|
|
12335
|
+
I = (l + (u >>> 13) | 0) + (Uo >>> 26) | 0, Uo &= 67108863, b = Math.imul($, ct), u = Math.imul($, ut), u = u + Math.imul(Z, ct) | 0, l = Math.imul(Z, ut), b = b + Math.imul(p, dt) | 0, u = u + Math.imul(p, lt) | 0, u = u + Math.imul(S, dt) | 0, l = l + Math.imul(S, lt) | 0, b = b + Math.imul(qe, ft) | 0, u = u + Math.imul(qe, ht) | 0, u = u + Math.imul(_, ft) | 0, l = l + Math.imul(_, ht) | 0;
|
|
12336
12336
|
var Do = (I + b | 0) + ((u & 8191) << 13) | 0;
|
|
12337
|
-
I = (l + (u >>> 13) | 0) + (Do >>> 26) | 0, Do &= 67108863, b = Math.imul($, dt), u = Math.imul($, lt), u = u + Math.imul(Z, dt) | 0, l = Math.imul(Z, lt), b = b + Math.imul(
|
|
12337
|
+
I = (l + (u >>> 13) | 0) + (Do >>> 26) | 0, Do &= 67108863, b = Math.imul($, dt), u = Math.imul($, lt), u = u + Math.imul(Z, dt) | 0, l = Math.imul(Z, lt), b = b + Math.imul(p, ft) | 0, u = u + Math.imul(p, ht) | 0, u = u + Math.imul(S, ft) | 0, l = l + Math.imul(S, ht) | 0;
|
|
12338
12338
|
var Fo = (I + b | 0) + ((u & 8191) << 13) | 0;
|
|
12339
12339
|
I = (l + (u >>> 13) | 0) + (Fo >>> 26) | 0, Fo &= 67108863, b = Math.imul($, ft), u = Math.imul($, ht), u = u + Math.imul(Z, ft) | 0, l = Math.imul(Z, ht);
|
|
12340
12340
|
var $o = (I + b | 0) + ((u & 8191) << 13) | 0;
|
|
12341
12341
|
return I = (l + (u >>> 13) | 0) + ($o >>> 26) | 0, $o &= 67108863, R[0] = vo, R[1] = Ro, R[2] = Ao, R[3] = xo, R[4] = So, R[5] = To, R[6] = Oo, R[7] = Io, R[8] = No, R[9] = Co, R[10] = Mo, R[11] = Bo, R[12] = ko, R[13] = Lo, R[14] = Po, R[15] = Uo, R[16] = Do, R[17] = Fo, R[18] = $o, I !== 0 && (R[19] = I, y.length++), y;
|
|
12342
12342
|
};
|
|
12343
12343
|
Math.imul || (Y = K);
|
|
12344
|
-
function V(E, c,
|
|
12345
|
-
|
|
12346
|
-
for (var y = 0, A = 0, v = 0; v <
|
|
12344
|
+
function V(E, c, h) {
|
|
12345
|
+
h.negative = c.negative ^ E.negative, h.length = E.length + c.length;
|
|
12346
|
+
for (var y = 0, A = 0, v = 0; v < h.length - 1; v++) {
|
|
12347
12347
|
var R = A;
|
|
12348
12348
|
A = 0;
|
|
12349
12349
|
for (var I = y & 67108863, b = Math.min(v, c.length - 1), u = Math.max(0, v - E.length + 1); u <= b; u++) {
|
|
12350
12350
|
var l = v - u, w = E.words[l] | 0, T = c.words[u] | 0, D = w * T, W = D & 67108863;
|
|
12351
12351
|
R = R + (D / 67108864 | 0) | 0, W = W + I | 0, I = W & 67108863, R = R + (W >>> 26) | 0, A += R >>> 26, R &= 67108863;
|
|
12352
12352
|
}
|
|
12353
|
-
|
|
12353
|
+
h.words[v] = I, y = R, R = A;
|
|
12354
12354
|
}
|
|
12355
|
-
return y !== 0 ?
|
|
12355
|
+
return y !== 0 ? h.words[v] = y : h.length--, h._strip();
|
|
12356
12356
|
}
|
|
12357
|
-
function L(E, c,
|
|
12358
|
-
return V(E, c,
|
|
12357
|
+
function L(E, c, h) {
|
|
12358
|
+
return V(E, c, h);
|
|
12359
12359
|
}
|
|
12360
|
-
i.prototype.mulTo = function(c,
|
|
12360
|
+
i.prototype.mulTo = function(c, h) {
|
|
12361
12361
|
var y, A = this.length + c.length;
|
|
12362
|
-
return this.length === 10 && c.length === 10 ? y = Y(this, c,
|
|
12362
|
+
return this.length === 10 && c.length === 10 ? y = Y(this, c, h) : A < 63 ? y = K(this, c, h) : A < 1024 ? y = V(this, c, h) : y = L(this, c, h), y;
|
|
12363
12363
|
}, i.prototype.mul = function(c) {
|
|
12364
|
-
var
|
|
12365
|
-
return
|
|
12364
|
+
var h = new i(null);
|
|
12365
|
+
return h.words = new Array(this.length + c.length), this.mulTo(c, h);
|
|
12366
12366
|
}, i.prototype.mulf = function(c) {
|
|
12367
|
-
var
|
|
12368
|
-
return
|
|
12367
|
+
var h = new i(null);
|
|
12368
|
+
return h.words = new Array(this.length + c.length), L(this, c, h);
|
|
12369
12369
|
}, i.prototype.imul = function(c) {
|
|
12370
12370
|
return this.clone().mulTo(c, this);
|
|
12371
12371
|
}, i.prototype.imuln = function(c) {
|
|
12372
|
-
var
|
|
12373
|
-
|
|
12372
|
+
var h = c < 0;
|
|
12373
|
+
h && (c = -c), r(typeof c == "number"), r(c < 67108864);
|
|
12374
12374
|
for (var y = 0, A = 0; A < this.length; A++) {
|
|
12375
12375
|
var v = (this.words[A] | 0) * c, R = (v & 67108863) + (y & 67108863);
|
|
12376
12376
|
y >>= 26, y += v / 67108864 | 0, y += R >>> 26, this.words[A] = R & 67108863;
|
|
12377
12377
|
}
|
|
12378
|
-
return y !== 0 && (this.words[A] = y, this.length++), this.length = c === 0 ? 1 : this.length,
|
|
12378
|
+
return y !== 0 && (this.words[A] = y, this.length++), this.length = c === 0 ? 1 : this.length, h ? this.ineg() : this;
|
|
12379
12379
|
}, i.prototype.muln = function(c) {
|
|
12380
12380
|
return this.clone().imuln(c);
|
|
12381
12381
|
}, i.prototype.sqr = function() {
|
|
@@ -12383,22 +12383,22 @@ function mh() {
|
|
|
12383
12383
|
}, i.prototype.isqr = function() {
|
|
12384
12384
|
return this.imul(this.clone());
|
|
12385
12385
|
}, i.prototype.pow = function(c) {
|
|
12386
|
-
var
|
|
12387
|
-
if (
|
|
12388
|
-
for (var y = this, A = 0; A <
|
|
12386
|
+
var h = k(c);
|
|
12387
|
+
if (h.length === 0) return new i(1);
|
|
12388
|
+
for (var y = this, A = 0; A < h.length && h[A] === 0; A++, y = y.sqr())
|
|
12389
12389
|
;
|
|
12390
|
-
if (++A <
|
|
12391
|
-
for (var v = y.sqr(); A <
|
|
12392
|
-
|
|
12390
|
+
if (++A < h.length)
|
|
12391
|
+
for (var v = y.sqr(); A < h.length; A++, v = v.sqr())
|
|
12392
|
+
h[A] !== 0 && (y = y.mul(v));
|
|
12393
12393
|
return y;
|
|
12394
12394
|
}, i.prototype.iushln = function(c) {
|
|
12395
12395
|
r(typeof c == "number" && c >= 0);
|
|
12396
|
-
var
|
|
12397
|
-
if (
|
|
12396
|
+
var h = c % 26, y = (c - h) / 26, A = 67108863 >>> 26 - h << 26 - h, v;
|
|
12397
|
+
if (h !== 0) {
|
|
12398
12398
|
var R = 0;
|
|
12399
12399
|
for (v = 0; v < this.length; v++) {
|
|
12400
|
-
var I = this.words[v] & A, b = (this.words[v] | 0) - I <<
|
|
12401
|
-
this.words[v] = b | R, R = I >>> 26 -
|
|
12400
|
+
var I = this.words[v] & A, b = (this.words[v] | 0) - I << h;
|
|
12401
|
+
this.words[v] = b | R, R = I >>> 26 - h;
|
|
12402
12402
|
}
|
|
12403
12403
|
R && (this.words[v] = R, this.length++);
|
|
12404
12404
|
}
|
|
@@ -12412,10 +12412,10 @@ function mh() {
|
|
|
12412
12412
|
return this._strip();
|
|
12413
12413
|
}, i.prototype.ishln = function(c) {
|
|
12414
12414
|
return r(this.negative === 0), this.iushln(c);
|
|
12415
|
-
}, i.prototype.iushrn = function(c,
|
|
12415
|
+
}, i.prototype.iushrn = function(c, h, y) {
|
|
12416
12416
|
r(typeof c == "number" && c >= 0);
|
|
12417
12417
|
var A;
|
|
12418
|
-
|
|
12418
|
+
h ? A = (h - h % 26) / 26 : A = 0;
|
|
12419
12419
|
var v = c % 26, R = Math.min((c - v) / 26, this.length), I = 67108863 ^ 67108863 >>> v << v, b = y;
|
|
12420
12420
|
if (A -= R, A = Math.max(0, A), b) {
|
|
12421
12421
|
for (var u = 0; u < R; u++)
|
|
@@ -12433,8 +12433,8 @@ function mh() {
|
|
|
12433
12433
|
this.words[u] = l << 26 - v | w >>> v, l = w & I;
|
|
12434
12434
|
}
|
|
12435
12435
|
return b && l !== 0 && (b.words[b.length++] = l), this.length === 0 && (this.words[0] = 0, this.length = 1), this._strip();
|
|
12436
|
-
}, i.prototype.ishrn = function(c,
|
|
12437
|
-
return r(this.negative === 0), this.iushrn(c,
|
|
12436
|
+
}, i.prototype.ishrn = function(c, h, y) {
|
|
12437
|
+
return r(this.negative === 0), this.iushrn(c, h, y);
|
|
12438
12438
|
}, i.prototype.shln = function(c) {
|
|
12439
12439
|
return this.clone().ishln(c);
|
|
12440
12440
|
}, i.prototype.ushln = function(c) {
|
|
@@ -12445,17 +12445,17 @@ function mh() {
|
|
|
12445
12445
|
return this.clone().iushrn(c);
|
|
12446
12446
|
}, i.prototype.testn = function(c) {
|
|
12447
12447
|
r(typeof c == "number" && c >= 0);
|
|
12448
|
-
var
|
|
12448
|
+
var h = c % 26, y = (c - h) / 26, A = 1 << h;
|
|
12449
12449
|
if (this.length <= y) return !1;
|
|
12450
12450
|
var v = this.words[y];
|
|
12451
12451
|
return !!(v & A);
|
|
12452
12452
|
}, i.prototype.imaskn = function(c) {
|
|
12453
12453
|
r(typeof c == "number" && c >= 0);
|
|
12454
|
-
var
|
|
12454
|
+
var h = c % 26, y = (c - h) / 26;
|
|
12455
12455
|
if (r(this.negative === 0, "imaskn works only with positive numbers"), this.length <= y)
|
|
12456
12456
|
return this;
|
|
12457
|
-
if (
|
|
12458
|
-
var A = 67108863 ^ 67108863 >>>
|
|
12457
|
+
if (h !== 0 && y++, this.length = Math.min(y, this.length), h !== 0) {
|
|
12458
|
+
var A = 67108863 ^ 67108863 >>> h << h;
|
|
12459
12459
|
this.words[this.length - 1] &= A;
|
|
12460
12460
|
}
|
|
12461
12461
|
return this.length === 0 && (this.words[0] = 0, this.length = 1), this._strip();
|
|
@@ -12465,9 +12465,9 @@ function mh() {
|
|
|
12465
12465
|
return r(typeof c == "number"), r(c < 67108864), c < 0 ? this.isubn(-c) : this.negative !== 0 ? this.length === 1 && (this.words[0] | 0) <= c ? (this.words[0] = c - (this.words[0] | 0), this.negative = 0, this) : (this.negative = 0, this.isubn(c), this.negative = 1, this) : this._iaddn(c);
|
|
12466
12466
|
}, i.prototype._iaddn = function(c) {
|
|
12467
12467
|
this.words[0] += c;
|
|
12468
|
-
for (var
|
|
12469
|
-
this.words[
|
|
12470
|
-
return this.length = Math.max(this.length,
|
|
12468
|
+
for (var h = 0; h < this.length && this.words[h] >= 67108864; h++)
|
|
12469
|
+
this.words[h] -= 67108864, h === this.length - 1 ? this.words[h + 1] = 1 : this.words[h + 1]++;
|
|
12470
|
+
return this.length = Math.max(this.length, h + 1), this;
|
|
12471
12471
|
}, i.prototype.isubn = function(c) {
|
|
12472
12472
|
if (r(typeof c == "number"), r(c < 67108864), c < 0) return this.iaddn(-c);
|
|
12473
12473
|
if (this.negative !== 0)
|
|
@@ -12475,8 +12475,8 @@ function mh() {
|
|
|
12475
12475
|
if (this.words[0] -= c, this.length === 1 && this.words[0] < 0)
|
|
12476
12476
|
this.words[0] = -this.words[0], this.negative = 1;
|
|
12477
12477
|
else
|
|
12478
|
-
for (var
|
|
12479
|
-
this.words[
|
|
12478
|
+
for (var h = 0; h < this.length && this.words[h] < 0; h++)
|
|
12479
|
+
this.words[h] += 67108864, this.words[h + 1] -= 1;
|
|
12480
12480
|
return this._strip();
|
|
12481
12481
|
}, i.prototype.addn = function(c) {
|
|
12482
12482
|
return this.clone().iaddn(c);
|
|
@@ -12486,13 +12486,13 @@ function mh() {
|
|
|
12486
12486
|
return this.negative = 0, this;
|
|
12487
12487
|
}, i.prototype.abs = function() {
|
|
12488
12488
|
return this.clone().iabs();
|
|
12489
|
-
}, i.prototype._ishlnsubmul = function(c,
|
|
12489
|
+
}, i.prototype._ishlnsubmul = function(c, h, y) {
|
|
12490
12490
|
var A = c.length + y, v;
|
|
12491
12491
|
this._expand(A);
|
|
12492
12492
|
var R, I = 0;
|
|
12493
12493
|
for (v = 0; v < c.length; v++) {
|
|
12494
12494
|
R = (this.words[v + y] | 0) + I;
|
|
12495
|
-
var b = (c.words[v] | 0) *
|
|
12495
|
+
var b = (c.words[v] | 0) * h;
|
|
12496
12496
|
R -= b & 67108863, I = (R >> 26) - (b / 67108864 | 0), this.words[v + y] = R & 67108863;
|
|
12497
12497
|
}
|
|
12498
12498
|
for (; v < this.length - y; v++)
|
|
@@ -12501,11 +12501,11 @@ function mh() {
|
|
|
12501
12501
|
for (r(I === -1), I = 0, v = 0; v < this.length; v++)
|
|
12502
12502
|
R = -(this.words[v] | 0) + I, I = R >> 26, this.words[v] = R & 67108863;
|
|
12503
12503
|
return this.negative = 1, this._strip();
|
|
12504
|
-
}, i.prototype._wordDiv = function(c,
|
|
12504
|
+
}, i.prototype._wordDiv = function(c, h) {
|
|
12505
12505
|
var y = this.length - c.length, A = this.clone(), v = c, R = v.words[v.length - 1] | 0, I = this._countBits(R);
|
|
12506
12506
|
y = 26 - I, y !== 0 && (v = v.ushln(y), A.iushln(y), R = v.words[v.length - 1] | 0);
|
|
12507
12507
|
var b = A.length - v.length, u;
|
|
12508
|
-
if (
|
|
12508
|
+
if (h !== "mod") {
|
|
12509
12509
|
u = new i(null), u.length = b + 1, u.words = new Array(u.length);
|
|
12510
12510
|
for (var l = 0; l < u.length; l++)
|
|
12511
12511
|
u.words[l] = 0;
|
|
@@ -12518,39 +12518,39 @@ function mh() {
|
|
|
12518
12518
|
D--, A.negative = 0, A._ishlnsubmul(v, 1, T), A.isZero() || (A.negative ^= 1);
|
|
12519
12519
|
u && (u.words[T] = D);
|
|
12520
12520
|
}
|
|
12521
|
-
return u && u._strip(), A._strip(),
|
|
12521
|
+
return u && u._strip(), A._strip(), h !== "div" && y !== 0 && A.iushrn(y), {
|
|
12522
12522
|
div: u || null,
|
|
12523
12523
|
mod: A
|
|
12524
12524
|
};
|
|
12525
|
-
}, i.prototype.divmod = function(c,
|
|
12525
|
+
}, i.prototype.divmod = function(c, h, y) {
|
|
12526
12526
|
if (r(!c.isZero()), this.isZero())
|
|
12527
12527
|
return {
|
|
12528
12528
|
div: new i(0),
|
|
12529
12529
|
mod: new i(0)
|
|
12530
12530
|
};
|
|
12531
12531
|
var A, v, R;
|
|
12532
|
-
return this.negative !== 0 && c.negative === 0 ? (R = this.neg().divmod(c,
|
|
12532
|
+
return this.negative !== 0 && c.negative === 0 ? (R = this.neg().divmod(c, h), h !== "mod" && (A = R.div.neg()), h !== "div" && (v = R.mod.neg(), y && v.negative !== 0 && v.iadd(c)), {
|
|
12533
12533
|
div: A,
|
|
12534
12534
|
mod: v
|
|
12535
|
-
}) : this.negative === 0 && c.negative !== 0 ? (R = this.divmod(c.neg(),
|
|
12535
|
+
}) : this.negative === 0 && c.negative !== 0 ? (R = this.divmod(c.neg(), h), h !== "mod" && (A = R.div.neg()), {
|
|
12536
12536
|
div: A,
|
|
12537
12537
|
mod: R.mod
|
|
12538
|
-
}) : (this.negative & c.negative) !== 0 ? (R = this.neg().divmod(c.neg(),
|
|
12538
|
+
}) : (this.negative & c.negative) !== 0 ? (R = this.neg().divmod(c.neg(), h), h !== "div" && (v = R.mod.neg(), y && v.negative !== 0 && v.isub(c)), {
|
|
12539
12539
|
div: R.div,
|
|
12540
12540
|
mod: v
|
|
12541
12541
|
}) : c.length > this.length || this.cmp(c) < 0 ? {
|
|
12542
12542
|
div: new i(0),
|
|
12543
12543
|
mod: this
|
|
12544
|
-
} : c.length === 1 ?
|
|
12544
|
+
} : c.length === 1 ? h === "div" ? {
|
|
12545
12545
|
div: this.divn(c.words[0]),
|
|
12546
12546
|
mod: null
|
|
12547
|
-
} :
|
|
12547
|
+
} : h === "mod" ? {
|
|
12548
12548
|
div: null,
|
|
12549
12549
|
mod: new i(this.modrn(c.words[0]))
|
|
12550
12550
|
} : {
|
|
12551
12551
|
div: this.divn(c.words[0]),
|
|
12552
12552
|
mod: new i(this.modrn(c.words[0]))
|
|
12553
|
-
} : this._wordDiv(c,
|
|
12553
|
+
} : this._wordDiv(c, h);
|
|
12554
12554
|
}, i.prototype.div = function(c) {
|
|
12555
12555
|
return this.divmod(c, "div", !1).div;
|
|
12556
12556
|
}, i.prototype.mod = function(c) {
|
|
@@ -12558,44 +12558,44 @@ function mh() {
|
|
|
12558
12558
|
}, i.prototype.umod = function(c) {
|
|
12559
12559
|
return this.divmod(c, "mod", !0).mod;
|
|
12560
12560
|
}, i.prototype.divRound = function(c) {
|
|
12561
|
-
var
|
|
12562
|
-
if (
|
|
12563
|
-
var y =
|
|
12564
|
-
return R < 0 || v === 1 && R === 0 ?
|
|
12561
|
+
var h = this.divmod(c);
|
|
12562
|
+
if (h.mod.isZero()) return h.div;
|
|
12563
|
+
var y = h.div.negative !== 0 ? h.mod.isub(c) : h.mod, A = c.ushrn(1), v = c.andln(1), R = y.cmp(A);
|
|
12564
|
+
return R < 0 || v === 1 && R === 0 ? h.div : h.div.negative !== 0 ? h.div.isubn(1) : h.div.iaddn(1);
|
|
12565
12565
|
}, i.prototype.modrn = function(c) {
|
|
12566
|
-
var
|
|
12567
|
-
|
|
12566
|
+
var h = c < 0;
|
|
12567
|
+
h && (c = -c), r(c <= 67108863);
|
|
12568
12568
|
for (var y = (1 << 26) % c, A = 0, v = this.length - 1; v >= 0; v--)
|
|
12569
12569
|
A = (y * A + (this.words[v] | 0)) % c;
|
|
12570
|
-
return
|
|
12570
|
+
return h ? -A : A;
|
|
12571
12571
|
}, i.prototype.modn = function(c) {
|
|
12572
12572
|
return this.modrn(c);
|
|
12573
12573
|
}, i.prototype.idivn = function(c) {
|
|
12574
|
-
var
|
|
12575
|
-
|
|
12574
|
+
var h = c < 0;
|
|
12575
|
+
h && (c = -c), r(c <= 67108863);
|
|
12576
12576
|
for (var y = 0, A = this.length - 1; A >= 0; A--) {
|
|
12577
12577
|
var v = (this.words[A] | 0) + y * 67108864;
|
|
12578
12578
|
this.words[A] = v / c | 0, y = v % c;
|
|
12579
12579
|
}
|
|
12580
|
-
return this._strip(),
|
|
12580
|
+
return this._strip(), h ? this.ineg() : this;
|
|
12581
12581
|
}, i.prototype.divn = function(c) {
|
|
12582
12582
|
return this.clone().idivn(c);
|
|
12583
12583
|
}, i.prototype.egcd = function(c) {
|
|
12584
12584
|
r(c.negative === 0), r(!c.isZero());
|
|
12585
|
-
var
|
|
12586
|
-
|
|
12587
|
-
for (var A = new i(1), v = new i(0), R = new i(0), I = new i(1), b = 0;
|
|
12588
|
-
|
|
12589
|
-
for (var u = y.clone(), l =
|
|
12590
|
-
for (var w = 0, T = 1; (
|
|
12585
|
+
var h = this, y = c.clone();
|
|
12586
|
+
h.negative !== 0 ? h = h.umod(c) : h = h.clone();
|
|
12587
|
+
for (var A = new i(1), v = new i(0), R = new i(0), I = new i(1), b = 0; h.isEven() && y.isEven(); )
|
|
12588
|
+
h.iushrn(1), y.iushrn(1), ++b;
|
|
12589
|
+
for (var u = y.clone(), l = h.clone(); !h.isZero(); ) {
|
|
12590
|
+
for (var w = 0, T = 1; (h.words[0] & T) === 0 && w < 26; ++w, T <<= 1) ;
|
|
12591
12591
|
if (w > 0)
|
|
12592
|
-
for (
|
|
12592
|
+
for (h.iushrn(w); w-- > 0; )
|
|
12593
12593
|
(A.isOdd() || v.isOdd()) && (A.iadd(u), v.isub(l)), A.iushrn(1), v.iushrn(1);
|
|
12594
12594
|
for (var D = 0, W = 1; (y.words[0] & W) === 0 && D < 26; ++D, W <<= 1) ;
|
|
12595
12595
|
if (D > 0)
|
|
12596
12596
|
for (y.iushrn(D); D-- > 0; )
|
|
12597
12597
|
(R.isOdd() || I.isOdd()) && (R.iadd(u), I.isub(l)), R.iushrn(1), I.iushrn(1);
|
|
12598
|
-
|
|
12598
|
+
h.cmp(y) >= 0 ? (h.isub(y), A.isub(R), v.isub(I)) : (y.isub(h), R.isub(A), I.isub(v));
|
|
12599
12599
|
}
|
|
12600
12600
|
return {
|
|
12601
12601
|
a: R,
|
|
@@ -12604,40 +12604,40 @@ function mh() {
|
|
|
12604
12604
|
};
|
|
12605
12605
|
}, i.prototype._invmp = function(c) {
|
|
12606
12606
|
r(c.negative === 0), r(!c.isZero());
|
|
12607
|
-
var
|
|
12608
|
-
|
|
12609
|
-
for (var A = new i(1), v = new i(0), R = y.clone();
|
|
12610
|
-
for (var I = 0, b = 1; (
|
|
12607
|
+
var h = this, y = c.clone();
|
|
12608
|
+
h.negative !== 0 ? h = h.umod(c) : h = h.clone();
|
|
12609
|
+
for (var A = new i(1), v = new i(0), R = y.clone(); h.cmpn(1) > 0 && y.cmpn(1) > 0; ) {
|
|
12610
|
+
for (var I = 0, b = 1; (h.words[0] & b) === 0 && I < 26; ++I, b <<= 1) ;
|
|
12611
12611
|
if (I > 0)
|
|
12612
|
-
for (
|
|
12612
|
+
for (h.iushrn(I); I-- > 0; )
|
|
12613
12613
|
A.isOdd() && A.iadd(R), A.iushrn(1);
|
|
12614
12614
|
for (var u = 0, l = 1; (y.words[0] & l) === 0 && u < 26; ++u, l <<= 1) ;
|
|
12615
12615
|
if (u > 0)
|
|
12616
12616
|
for (y.iushrn(u); u-- > 0; )
|
|
12617
12617
|
v.isOdd() && v.iadd(R), v.iushrn(1);
|
|
12618
|
-
|
|
12618
|
+
h.cmp(y) >= 0 ? (h.isub(y), A.isub(v)) : (y.isub(h), v.isub(A));
|
|
12619
12619
|
}
|
|
12620
12620
|
var w;
|
|
12621
|
-
return
|
|
12621
|
+
return h.cmpn(1) === 0 ? w = A : w = v, w.cmpn(0) < 0 && w.iadd(c), w;
|
|
12622
12622
|
}, i.prototype.gcd = function(c) {
|
|
12623
12623
|
if (this.isZero()) return c.abs();
|
|
12624
12624
|
if (c.isZero()) return this.abs();
|
|
12625
|
-
var
|
|
12626
|
-
|
|
12627
|
-
for (var A = 0;
|
|
12628
|
-
|
|
12625
|
+
var h = this.clone(), y = c.clone();
|
|
12626
|
+
h.negative = 0, y.negative = 0;
|
|
12627
|
+
for (var A = 0; h.isEven() && y.isEven(); A++)
|
|
12628
|
+
h.iushrn(1), y.iushrn(1);
|
|
12629
12629
|
do {
|
|
12630
|
-
for (;
|
|
12631
|
-
|
|
12630
|
+
for (; h.isEven(); )
|
|
12631
|
+
h.iushrn(1);
|
|
12632
12632
|
for (; y.isEven(); )
|
|
12633
12633
|
y.iushrn(1);
|
|
12634
|
-
var v =
|
|
12634
|
+
var v = h.cmp(y);
|
|
12635
12635
|
if (v < 0) {
|
|
12636
|
-
var R =
|
|
12637
|
-
|
|
12636
|
+
var R = h;
|
|
12637
|
+
h = y, y = R;
|
|
12638
12638
|
} else if (v === 0 || y.cmpn(1) === 0)
|
|
12639
12639
|
break;
|
|
12640
|
-
|
|
12640
|
+
h.isub(y);
|
|
12641
12641
|
} while (!0);
|
|
12642
12642
|
return y.iushln(A);
|
|
12643
12643
|
}, i.prototype.invm = function(c) {
|
|
@@ -12650,7 +12650,7 @@ function mh() {
|
|
|
12650
12650
|
return this.words[0] & c;
|
|
12651
12651
|
}, i.prototype.bincn = function(c) {
|
|
12652
12652
|
r(typeof c == "number");
|
|
12653
|
-
var
|
|
12653
|
+
var h = c % 26, y = (c - h) / 26, A = 1 << h;
|
|
12654
12654
|
if (this.length <= y)
|
|
12655
12655
|
return this._expand(y + 1), this.words[y] |= A, this;
|
|
12656
12656
|
for (var v = A, R = y; v !== 0 && R < this.length; R++) {
|
|
@@ -12661,15 +12661,15 @@ function mh() {
|
|
|
12661
12661
|
}, i.prototype.isZero = function() {
|
|
12662
12662
|
return this.length === 1 && this.words[0] === 0;
|
|
12663
12663
|
}, i.prototype.cmpn = function(c) {
|
|
12664
|
-
var
|
|
12665
|
-
if (this.negative !== 0 && !
|
|
12666
|
-
if (this.negative === 0 &&
|
|
12664
|
+
var h = c < 0;
|
|
12665
|
+
if (this.negative !== 0 && !h) return -1;
|
|
12666
|
+
if (this.negative === 0 && h) return 1;
|
|
12667
12667
|
this._strip();
|
|
12668
12668
|
var y;
|
|
12669
12669
|
if (this.length > 1)
|
|
12670
12670
|
y = 1;
|
|
12671
12671
|
else {
|
|
12672
|
-
|
|
12672
|
+
h && (c = -c), r(c <= 67108863, "Number is too big");
|
|
12673
12673
|
var A = this.words[0] | 0;
|
|
12674
12674
|
y = A === c ? 0 : A < c ? -1 : 1;
|
|
12675
12675
|
}
|
|
@@ -12677,19 +12677,19 @@ function mh() {
|
|
|
12677
12677
|
}, i.prototype.cmp = function(c) {
|
|
12678
12678
|
if (this.negative !== 0 && c.negative === 0) return -1;
|
|
12679
12679
|
if (this.negative === 0 && c.negative !== 0) return 1;
|
|
12680
|
-
var
|
|
12681
|
-
return this.negative !== 0 ? -
|
|
12680
|
+
var h = this.ucmp(c);
|
|
12681
|
+
return this.negative !== 0 ? -h | 0 : h;
|
|
12682
12682
|
}, i.prototype.ucmp = function(c) {
|
|
12683
12683
|
if (this.length > c.length) return 1;
|
|
12684
12684
|
if (this.length < c.length) return -1;
|
|
12685
|
-
for (var
|
|
12685
|
+
for (var h = 0, y = this.length - 1; y >= 0; y--) {
|
|
12686
12686
|
var A = this.words[y] | 0, v = c.words[y] | 0;
|
|
12687
12687
|
if (A !== v) {
|
|
12688
|
-
A < v ?
|
|
12688
|
+
A < v ? h = -1 : A > v && (h = 1);
|
|
12689
12689
|
break;
|
|
12690
12690
|
}
|
|
12691
12691
|
}
|
|
12692
|
-
return
|
|
12692
|
+
return h;
|
|
12693
12693
|
}, i.prototype.gtn = function(c) {
|
|
12694
12694
|
return this.cmpn(c) === 1;
|
|
12695
12695
|
}, i.prototype.gt = function(c) {
|
|
@@ -12760,14 +12760,14 @@ function mh() {
|
|
|
12760
12760
|
var c = new i(null);
|
|
12761
12761
|
return c.words = new Array(Math.ceil(this.n / 13)), c;
|
|
12762
12762
|
}, J.prototype.ireduce = function(c) {
|
|
12763
|
-
var
|
|
12763
|
+
var h = c, y;
|
|
12764
12764
|
do
|
|
12765
|
-
this.split(
|
|
12765
|
+
this.split(h, this.tmp), h = this.imulK(h), h = h.iadd(this.tmp), y = h.bitLength();
|
|
12766
12766
|
while (y > this.n);
|
|
12767
|
-
var A = y < this.n ? -1 :
|
|
12768
|
-
return A === 0 ? (
|
|
12769
|
-
}, J.prototype.split = function(c,
|
|
12770
|
-
c.iushrn(this.n, 0,
|
|
12767
|
+
var A = y < this.n ? -1 : h.ucmp(this.p);
|
|
12768
|
+
return A === 0 ? (h.words[0] = 0, h.length = 1) : A > 0 ? h.isub(this.p) : h.strip !== void 0 ? h.strip() : h._strip(), h;
|
|
12769
|
+
}, J.prototype.split = function(c, h) {
|
|
12770
|
+
c.iushrn(this.n, 0, h);
|
|
12771
12771
|
}, J.prototype.imulK = function(c) {
|
|
12772
12772
|
return c.imul(this.k);
|
|
12773
12773
|
};
|
|
@@ -12778,24 +12778,24 @@ function mh() {
|
|
|
12778
12778
|
"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"
|
|
12779
12779
|
);
|
|
12780
12780
|
}
|
|
12781
|
-
s(te, J), te.prototype.split = function(c,
|
|
12781
|
+
s(te, J), te.prototype.split = function(c, h) {
|
|
12782
12782
|
for (var y = 4194303, A = Math.min(c.length, 9), v = 0; v < A; v++)
|
|
12783
|
-
|
|
12784
|
-
if (
|
|
12783
|
+
h.words[v] = c.words[v];
|
|
12784
|
+
if (h.length = A, c.length <= 9) {
|
|
12785
12785
|
c.words[0] = 0, c.length = 1;
|
|
12786
12786
|
return;
|
|
12787
12787
|
}
|
|
12788
12788
|
var R = c.words[9];
|
|
12789
|
-
for (
|
|
12789
|
+
for (h.words[h.length++] = R & y, v = 10; v < c.length; v++) {
|
|
12790
12790
|
var I = c.words[v] | 0;
|
|
12791
12791
|
c.words[v - 10] = (I & y) << 4 | R >>> 22, R = I;
|
|
12792
12792
|
}
|
|
12793
12793
|
R >>>= 22, c.words[v - 10] = R, R === 0 && c.length > 10 ? c.length -= 10 : c.length -= 9;
|
|
12794
12794
|
}, te.prototype.imulK = function(c) {
|
|
12795
12795
|
c.words[c.length] = 0, c.words[c.length + 1] = 0, c.length += 2;
|
|
12796
|
-
for (var
|
|
12796
|
+
for (var h = 0, y = 0; y < c.length; y++) {
|
|
12797
12797
|
var A = c.words[y] | 0;
|
|
12798
|
-
|
|
12798
|
+
h += A * 977, c.words[y] = h & 67108863, h = A * 64 + (h / 67108864 | 0);
|
|
12799
12799
|
}
|
|
12800
12800
|
return c.words[c.length - 1] === 0 && (c.length--, c.words[c.length - 1] === 0 && c.length--), c;
|
|
12801
12801
|
};
|
|
@@ -12815,33 +12815,33 @@ function mh() {
|
|
|
12815
12815
|
);
|
|
12816
12816
|
}
|
|
12817
12817
|
s(q, J);
|
|
12818
|
-
function
|
|
12818
|
+
function C() {
|
|
12819
12819
|
J.call(
|
|
12820
12820
|
this,
|
|
12821
12821
|
"25519",
|
|
12822
12822
|
"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"
|
|
12823
12823
|
);
|
|
12824
12824
|
}
|
|
12825
|
-
s(
|
|
12826
|
-
for (var
|
|
12827
|
-
var A = (c.words[y] | 0) * 19 +
|
|
12828
|
-
A >>>= 26, c.words[y] = v,
|
|
12825
|
+
s(C, J), C.prototype.imulK = function(c) {
|
|
12826
|
+
for (var h = 0, y = 0; y < c.length; y++) {
|
|
12827
|
+
var A = (c.words[y] | 0) * 19 + h, v = A & 67108863;
|
|
12828
|
+
A >>>= 26, c.words[y] = v, h = A;
|
|
12829
12829
|
}
|
|
12830
|
-
return
|
|
12830
|
+
return h !== 0 && (c.words[c.length++] = h), c;
|
|
12831
12831
|
}, i._prime = function(c) {
|
|
12832
12832
|
if (z[c]) return z[c];
|
|
12833
|
-
var
|
|
12833
|
+
var h;
|
|
12834
12834
|
if (c === "k256")
|
|
12835
|
-
|
|
12835
|
+
h = new te();
|
|
12836
12836
|
else if (c === "p224")
|
|
12837
|
-
|
|
12837
|
+
h = new ne();
|
|
12838
12838
|
else if (c === "p192")
|
|
12839
|
-
|
|
12839
|
+
h = new q();
|
|
12840
12840
|
else if (c === "p25519")
|
|
12841
|
-
|
|
12841
|
+
h = new C();
|
|
12842
12842
|
else
|
|
12843
12843
|
throw new Error("Unknown prime " + c);
|
|
12844
|
-
return z[c] =
|
|
12844
|
+
return z[c] = h, h;
|
|
12845
12845
|
};
|
|
12846
12846
|
function P(E) {
|
|
12847
12847
|
if (typeof E == "string") {
|
|
@@ -12852,45 +12852,45 @@ function mh() {
|
|
|
12852
12852
|
}
|
|
12853
12853
|
P.prototype._verify1 = function(c) {
|
|
12854
12854
|
r(c.negative === 0, "red works only with positives"), r(c.red, "red works only with red numbers");
|
|
12855
|
-
}, P.prototype._verify2 = function(c,
|
|
12856
|
-
r((c.negative |
|
|
12857
|
-
c.red && c.red ===
|
|
12855
|
+
}, P.prototype._verify2 = function(c, h) {
|
|
12856
|
+
r((c.negative | h.negative) === 0, "red works only with positives"), r(
|
|
12857
|
+
c.red && c.red === h.red,
|
|
12858
12858
|
"red works only with red numbers"
|
|
12859
12859
|
);
|
|
12860
12860
|
}, P.prototype.imod = function(c) {
|
|
12861
12861
|
return this.prime ? this.prime.ireduce(c)._forceRed(this) : (g(c, c.umod(this.m)._forceRed(this)), c);
|
|
12862
12862
|
}, P.prototype.neg = function(c) {
|
|
12863
12863
|
return c.isZero() ? c.clone() : this.m.sub(c)._forceRed(this);
|
|
12864
|
-
}, P.prototype.add = function(c,
|
|
12865
|
-
this._verify2(c,
|
|
12866
|
-
var y = c.add(
|
|
12864
|
+
}, P.prototype.add = function(c, h) {
|
|
12865
|
+
this._verify2(c, h);
|
|
12866
|
+
var y = c.add(h);
|
|
12867
12867
|
return y.cmp(this.m) >= 0 && y.isub(this.m), y._forceRed(this);
|
|
12868
|
-
}, P.prototype.iadd = function(c,
|
|
12869
|
-
this._verify2(c,
|
|
12870
|
-
var y = c.iadd(
|
|
12868
|
+
}, P.prototype.iadd = function(c, h) {
|
|
12869
|
+
this._verify2(c, h);
|
|
12870
|
+
var y = c.iadd(h);
|
|
12871
12871
|
return y.cmp(this.m) >= 0 && y.isub(this.m), y;
|
|
12872
|
-
}, P.prototype.sub = function(c,
|
|
12873
|
-
this._verify2(c,
|
|
12874
|
-
var y = c.sub(
|
|
12872
|
+
}, P.prototype.sub = function(c, h) {
|
|
12873
|
+
this._verify2(c, h);
|
|
12874
|
+
var y = c.sub(h);
|
|
12875
12875
|
return y.cmpn(0) < 0 && y.iadd(this.m), y._forceRed(this);
|
|
12876
|
-
}, P.prototype.isub = function(c,
|
|
12877
|
-
this._verify2(c,
|
|
12878
|
-
var y = c.isub(
|
|
12876
|
+
}, P.prototype.isub = function(c, h) {
|
|
12877
|
+
this._verify2(c, h);
|
|
12878
|
+
var y = c.isub(h);
|
|
12879
12879
|
return y.cmpn(0) < 0 && y.iadd(this.m), y;
|
|
12880
|
-
}, P.prototype.shl = function(c,
|
|
12881
|
-
return this._verify1(c), this.imod(c.ushln(
|
|
12882
|
-
}, P.prototype.imul = function(c,
|
|
12883
|
-
return this._verify2(c,
|
|
12884
|
-
}, P.prototype.mul = function(c,
|
|
12885
|
-
return this._verify2(c,
|
|
12880
|
+
}, P.prototype.shl = function(c, h) {
|
|
12881
|
+
return this._verify1(c), this.imod(c.ushln(h));
|
|
12882
|
+
}, P.prototype.imul = function(c, h) {
|
|
12883
|
+
return this._verify2(c, h), this.imod(c.imul(h));
|
|
12884
|
+
}, P.prototype.mul = function(c, h) {
|
|
12885
|
+
return this._verify2(c, h), this.imod(c.mul(h));
|
|
12886
12886
|
}, P.prototype.isqr = function(c) {
|
|
12887
12887
|
return this.imul(c, c.clone());
|
|
12888
12888
|
}, P.prototype.sqr = function(c) {
|
|
12889
12889
|
return this.mul(c, c);
|
|
12890
12890
|
}, P.prototype.sqrt = function(c) {
|
|
12891
12891
|
if (c.isZero()) return c.clone();
|
|
12892
|
-
var
|
|
12893
|
-
if (r(
|
|
12892
|
+
var h = this.m.andln(3);
|
|
12893
|
+
if (r(h % 2 === 1), h === 3) {
|
|
12894
12894
|
var y = this.m.add(new i(1)).iushrn(2);
|
|
12895
12895
|
return this.pow(c, y);
|
|
12896
12896
|
}
|
|
@@ -12909,18 +12909,18 @@ function mh() {
|
|
|
12909
12909
|
}
|
|
12910
12910
|
return w;
|
|
12911
12911
|
}, P.prototype.invm = function(c) {
|
|
12912
|
-
var
|
|
12913
|
-
return
|
|
12914
|
-
}, P.prototype.pow = function(c,
|
|
12915
|
-
if (
|
|
12916
|
-
if (
|
|
12912
|
+
var h = c._invmp(this.m);
|
|
12913
|
+
return h.negative !== 0 ? (h.negative = 0, this.imod(h).redNeg()) : this.imod(h);
|
|
12914
|
+
}, P.prototype.pow = function(c, h) {
|
|
12915
|
+
if (h.isZero()) return new i(1).toRed(this);
|
|
12916
|
+
if (h.cmpn(1) === 0) return c.clone();
|
|
12917
12917
|
var y = 4, A = new Array(1 << y);
|
|
12918
12918
|
A[0] = new i(1).toRed(this), A[1] = c;
|
|
12919
12919
|
for (var v = 2; v < A.length; v++)
|
|
12920
12920
|
A[v] = this.mul(A[v - 1], c);
|
|
12921
|
-
var R = A[0], I = 0, b = 0, u =
|
|
12922
|
-
for (u === 0 && (u = 26), v =
|
|
12923
|
-
for (var l =
|
|
12921
|
+
var R = A[0], I = 0, b = 0, u = h.bitLength() % 26;
|
|
12922
|
+
for (u === 0 && (u = 26), v = h.length - 1; v >= 0; v--) {
|
|
12923
|
+
for (var l = h.words[v], w = u - 1; w >= 0; w--) {
|
|
12924
12924
|
var T = l >> w & 1;
|
|
12925
12925
|
if (R !== A[0] && (R = this.sqr(R)), T === 0 && I === 0) {
|
|
12926
12926
|
b = 0;
|
|
@@ -12932,11 +12932,11 @@ function mh() {
|
|
|
12932
12932
|
}
|
|
12933
12933
|
return R;
|
|
12934
12934
|
}, P.prototype.convertTo = function(c) {
|
|
12935
|
-
var
|
|
12936
|
-
return
|
|
12935
|
+
var h = c.umod(this.m);
|
|
12936
|
+
return h === c ? h.clone() : h;
|
|
12937
12937
|
}, P.prototype.convertFrom = function(c) {
|
|
12938
|
-
var
|
|
12939
|
-
return
|
|
12938
|
+
var h = c.clone();
|
|
12939
|
+
return h.red = null, h;
|
|
12940
12940
|
}, i.mont = function(c) {
|
|
12941
12941
|
return new j(c);
|
|
12942
12942
|
};
|
|
@@ -12946,20 +12946,20 @@ function mh() {
|
|
|
12946
12946
|
s(j, P), j.prototype.convertTo = function(c) {
|
|
12947
12947
|
return this.imod(c.ushln(this.shift));
|
|
12948
12948
|
}, j.prototype.convertFrom = function(c) {
|
|
12949
|
-
var
|
|
12950
|
-
return
|
|
12951
|
-
}, j.prototype.imul = function(c,
|
|
12952
|
-
if (c.isZero() ||
|
|
12949
|
+
var h = this.imod(c.mul(this.rinv));
|
|
12950
|
+
return h.red = null, h;
|
|
12951
|
+
}, j.prototype.imul = function(c, h) {
|
|
12952
|
+
if (c.isZero() || h.isZero())
|
|
12953
12953
|
return c.words[0] = 0, c.length = 1, c;
|
|
12954
|
-
var y = c.imul(
|
|
12954
|
+
var y = c.imul(h), A = y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), v = y.isub(A).iushrn(this.shift), R = v;
|
|
12955
12955
|
return v.cmp(this.m) >= 0 ? R = v.isub(this.m) : v.cmpn(0) < 0 && (R = v.iadd(this.m)), R._forceRed(this);
|
|
12956
|
-
}, j.prototype.mul = function(c,
|
|
12957
|
-
if (c.isZero() ||
|
|
12958
|
-
var y = c.mul(
|
|
12956
|
+
}, j.prototype.mul = function(c, h) {
|
|
12957
|
+
if (c.isZero() || h.isZero()) return new i(0)._forceRed(this);
|
|
12958
|
+
var y = c.mul(h), A = y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), v = y.isub(A).iushrn(this.shift), R = v;
|
|
12959
12959
|
return v.cmp(this.m) >= 0 ? R = v.isub(this.m) : v.cmpn(0) < 0 && (R = v.iadd(this.m)), R._forceRed(this);
|
|
12960
12960
|
}, j.prototype.invm = function(c) {
|
|
12961
|
-
var
|
|
12962
|
-
return
|
|
12961
|
+
var h = this.imod(c._invmp(this.m).mul(this.r2));
|
|
12962
|
+
return h._forceRed(this);
|
|
12963
12963
|
};
|
|
12964
12964
|
})(t, gb);
|
|
12965
12965
|
})(yi)), yi.exports;
|
|
@@ -13017,15 +13017,15 @@ function bb() {
|
|
|
13017
13017
|
r[a] = i;
|
|
13018
13018
|
}
|
|
13019
13019
|
var d = n.length, m = n.charAt(0), g = Math.log(d) / Math.log(256), x = Math.log(256) / Math.log(d);
|
|
13020
|
-
function O(
|
|
13021
|
-
if ((Array.isArray(
|
|
13020
|
+
function O(M) {
|
|
13021
|
+
if ((Array.isArray(M) || M instanceof Uint8Array) && (M = t.from(M)), !t.isBuffer(M))
|
|
13022
13022
|
throw new TypeError("Expected Buffer");
|
|
13023
|
-
if (
|
|
13023
|
+
if (M.length === 0)
|
|
13024
13024
|
return "";
|
|
13025
|
-
for (var k = 0, K = 0, Y = 0, V =
|
|
13025
|
+
for (var k = 0, K = 0, Y = 0, V = M.length; Y !== V && M[Y] === 0; )
|
|
13026
13026
|
Y++, k++;
|
|
13027
13027
|
for (var L = (V - Y) * x + 1 >>> 0, z = new Uint8Array(L); Y !== V; ) {
|
|
13028
|
-
for (var J =
|
|
13028
|
+
for (var J = M[Y], te = 0, ne = L - 1; (J !== 0 || te < K) && ne !== -1; ne--, te++)
|
|
13029
13029
|
J += 256 * z[ne] >>> 0, z[ne] = J % d >>> 0, J = J / d >>> 0;
|
|
13030
13030
|
if (J !== 0)
|
|
13031
13031
|
throw new Error("Non-zero carry");
|
|
@@ -13033,19 +13033,19 @@ function bb() {
|
|
|
13033
13033
|
}
|
|
13034
13034
|
for (var q = L - K; q !== L && z[q] === 0; )
|
|
13035
13035
|
q++;
|
|
13036
|
-
for (var
|
|
13037
|
-
|
|
13038
|
-
return
|
|
13036
|
+
for (var C = m.repeat(k); q < L; ++q)
|
|
13037
|
+
C += n.charAt(z[q]);
|
|
13038
|
+
return C;
|
|
13039
13039
|
}
|
|
13040
|
-
function N(
|
|
13041
|
-
if (typeof
|
|
13040
|
+
function N(M) {
|
|
13041
|
+
if (typeof M != "string")
|
|
13042
13042
|
throw new TypeError("Expected String");
|
|
13043
|
-
if (
|
|
13043
|
+
if (M.length === 0)
|
|
13044
13044
|
return t.alloc(0);
|
|
13045
|
-
for (var k = 0, K = 0, Y = 0;
|
|
13045
|
+
for (var k = 0, K = 0, Y = 0; M[k] === m; )
|
|
13046
13046
|
K++, k++;
|
|
13047
|
-
for (var V = (
|
|
13048
|
-
var z =
|
|
13047
|
+
for (var V = (M.length - k) * g + 1 >>> 0, L = new Uint8Array(V); k < M.length; ) {
|
|
13048
|
+
var z = M.charCodeAt(k);
|
|
13049
13049
|
if (z > 255)
|
|
13050
13050
|
return;
|
|
13051
13051
|
var J = r[z];
|
|
@@ -13059,14 +13059,14 @@ function bb() {
|
|
|
13059
13059
|
}
|
|
13060
13060
|
for (var q = V - Y; q !== V && L[q] === 0; )
|
|
13061
13061
|
q++;
|
|
13062
|
-
var
|
|
13063
|
-
|
|
13062
|
+
var C = t.allocUnsafe(K + (V - q));
|
|
13063
|
+
C.fill(0, 0, K);
|
|
13064
13064
|
for (var P = K; q !== V; )
|
|
13065
|
-
|
|
13066
|
-
return
|
|
13065
|
+
C[P++] = L[q++];
|
|
13066
|
+
return C;
|
|
13067
13067
|
}
|
|
13068
|
-
function F(
|
|
13069
|
-
var k = N(
|
|
13068
|
+
function F(M) {
|
|
13069
|
+
var k = N(M);
|
|
13070
13070
|
if (k)
|
|
13071
13071
|
return k;
|
|
13072
13072
|
throw new Error("Non-base" + d + " character");
|
|
@@ -13319,26 +13319,26 @@ var zd;
|
|
|
13319
13319
|
function Tb() {
|
|
13320
13320
|
if (zd) return Ce;
|
|
13321
13321
|
zd = 1;
|
|
13322
|
-
var t = Ce && Ce.__createBinding || (Object.create ? (function(q,
|
|
13322
|
+
var t = Ce && Ce.__createBinding || (Object.create ? (function(q, C, P, j) {
|
|
13323
13323
|
j === void 0 && (j = P), Object.defineProperty(q, j, { enumerable: !0, get: function() {
|
|
13324
|
-
return
|
|
13324
|
+
return C[P];
|
|
13325
13325
|
} });
|
|
13326
|
-
}) : (function(q,
|
|
13327
|
-
j === void 0 && (j = P), q[j] =
|
|
13328
|
-
})), e = Ce && Ce.__setModuleDefault || (Object.create ? (function(q,
|
|
13329
|
-
Object.defineProperty(q, "default", { enumerable: !0, value:
|
|
13330
|
-
}) : function(q,
|
|
13331
|
-
q.default =
|
|
13332
|
-
}), n = Ce && Ce.__decorate || function(q,
|
|
13333
|
-
var E = arguments.length, c = E < 3 ?
|
|
13334
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") c = Reflect.decorate(q,
|
|
13335
|
-
else for (var y = q.length - 1; y >= 0; y--) (
|
|
13336
|
-
return E > 3 && c && Object.defineProperty(
|
|
13326
|
+
}) : (function(q, C, P, j) {
|
|
13327
|
+
j === void 0 && (j = P), q[j] = C[P];
|
|
13328
|
+
})), e = Ce && Ce.__setModuleDefault || (Object.create ? (function(q, C) {
|
|
13329
|
+
Object.defineProperty(q, "default", { enumerable: !0, value: C });
|
|
13330
|
+
}) : function(q, C) {
|
|
13331
|
+
q.default = C;
|
|
13332
|
+
}), n = Ce && Ce.__decorate || function(q, C, P, j) {
|
|
13333
|
+
var E = arguments.length, c = E < 3 ? C : j === null ? j = Object.getOwnPropertyDescriptor(C, P) : j, h;
|
|
13334
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") c = Reflect.decorate(q, C, P, j);
|
|
13335
|
+
else for (var y = q.length - 1; y >= 0; y--) (h = q[y]) && (c = (E < 3 ? h(c) : E > 3 ? h(C, P, c) : h(C, P)) || c);
|
|
13336
|
+
return E > 3 && c && Object.defineProperty(C, P, c), c;
|
|
13337
13337
|
}, r = Ce && Ce.__importStar || function(q) {
|
|
13338
13338
|
if (q && q.__esModule) return q;
|
|
13339
|
-
var
|
|
13340
|
-
if (q != null) for (var P in q) P !== "default" && Object.hasOwnProperty.call(q, P) && t(
|
|
13341
|
-
return e(
|
|
13339
|
+
var C = {};
|
|
13340
|
+
if (q != null) for (var P in q) P !== "default" && Object.hasOwnProperty.call(q, P) && t(C, q, P);
|
|
13341
|
+
return e(C, q), C;
|
|
13342
13342
|
}, s = Ce && Ce.__importDefault || function(q) {
|
|
13343
13343
|
return q && q.__esModule ? q : { default: q };
|
|
13344
13344
|
};
|
|
@@ -13354,11 +13354,11 @@ function Tb() {
|
|
|
13354
13354
|
Ce.baseDecode = x;
|
|
13355
13355
|
const O = 1024;
|
|
13356
13356
|
class N extends Error {
|
|
13357
|
-
constructor(
|
|
13358
|
-
super(
|
|
13357
|
+
constructor(C) {
|
|
13358
|
+
super(C), this.fieldPath = [], this.originalMessage = C;
|
|
13359
13359
|
}
|
|
13360
|
-
addToFieldPath(
|
|
13361
|
-
this.fieldPath.splice(0, 0,
|
|
13360
|
+
addToFieldPath(C) {
|
|
13361
|
+
this.fieldPath.splice(0, 0, C), this.message = this.originalMessage + ": " + this.fieldPath.join(".");
|
|
13362
13362
|
}
|
|
13363
13363
|
}
|
|
13364
13364
|
Ce.BorshError = N;
|
|
@@ -13369,45 +13369,45 @@ function Tb() {
|
|
|
13369
13369
|
maybeResize() {
|
|
13370
13370
|
this.buf.length < 16 + this.length && (this.buf = Buffer.concat([this.buf, Buffer.alloc(O)]));
|
|
13371
13371
|
}
|
|
13372
|
-
writeU8(
|
|
13373
|
-
this.maybeResize(), this.buf.writeUInt8(
|
|
13372
|
+
writeU8(C) {
|
|
13373
|
+
this.maybeResize(), this.buf.writeUInt8(C, this.length), this.length += 1;
|
|
13374
13374
|
}
|
|
13375
|
-
writeU16(
|
|
13376
|
-
this.maybeResize(), this.buf.writeUInt16LE(
|
|
13375
|
+
writeU16(C) {
|
|
13376
|
+
this.maybeResize(), this.buf.writeUInt16LE(C, this.length), this.length += 2;
|
|
13377
13377
|
}
|
|
13378
|
-
writeU32(
|
|
13379
|
-
this.maybeResize(), this.buf.writeUInt32LE(
|
|
13378
|
+
writeU32(C) {
|
|
13379
|
+
this.maybeResize(), this.buf.writeUInt32LE(C, this.length), this.length += 4;
|
|
13380
13380
|
}
|
|
13381
|
-
writeU64(
|
|
13382
|
-
this.maybeResize(), this.writeBuffer(Buffer.from(new i.default(
|
|
13381
|
+
writeU64(C) {
|
|
13382
|
+
this.maybeResize(), this.writeBuffer(Buffer.from(new i.default(C).toArray("le", 8)));
|
|
13383
13383
|
}
|
|
13384
|
-
writeU128(
|
|
13385
|
-
this.maybeResize(), this.writeBuffer(Buffer.from(new i.default(
|
|
13384
|
+
writeU128(C) {
|
|
13385
|
+
this.maybeResize(), this.writeBuffer(Buffer.from(new i.default(C).toArray("le", 16)));
|
|
13386
13386
|
}
|
|
13387
|
-
writeU256(
|
|
13388
|
-
this.maybeResize(), this.writeBuffer(Buffer.from(new i.default(
|
|
13387
|
+
writeU256(C) {
|
|
13388
|
+
this.maybeResize(), this.writeBuffer(Buffer.from(new i.default(C).toArray("le", 32)));
|
|
13389
13389
|
}
|
|
13390
|
-
writeU512(
|
|
13391
|
-
this.maybeResize(), this.writeBuffer(Buffer.from(new i.default(
|
|
13390
|
+
writeU512(C) {
|
|
13391
|
+
this.maybeResize(), this.writeBuffer(Buffer.from(new i.default(C).toArray("le", 64)));
|
|
13392
13392
|
}
|
|
13393
|
-
writeBuffer(
|
|
13393
|
+
writeBuffer(C) {
|
|
13394
13394
|
this.buf = Buffer.concat([
|
|
13395
13395
|
Buffer.from(this.buf.subarray(0, this.length)),
|
|
13396
|
-
|
|
13396
|
+
C,
|
|
13397
13397
|
Buffer.alloc(O)
|
|
13398
|
-
]), this.length +=
|
|
13398
|
+
]), this.length += C.length;
|
|
13399
13399
|
}
|
|
13400
|
-
writeString(
|
|
13400
|
+
writeString(C) {
|
|
13401
13401
|
this.maybeResize();
|
|
13402
|
-
const P = Buffer.from(
|
|
13402
|
+
const P = Buffer.from(C, "utf8");
|
|
13403
13403
|
this.writeU32(P.length), this.writeBuffer(P);
|
|
13404
13404
|
}
|
|
13405
|
-
writeFixedArray(
|
|
13406
|
-
this.writeBuffer(Buffer.from(
|
|
13405
|
+
writeFixedArray(C) {
|
|
13406
|
+
this.writeBuffer(Buffer.from(C));
|
|
13407
13407
|
}
|
|
13408
|
-
writeArray(
|
|
13409
|
-
this.maybeResize(), this.writeU32(
|
|
13410
|
-
for (const j of
|
|
13408
|
+
writeArray(C, P) {
|
|
13409
|
+
this.maybeResize(), this.writeU32(C.length);
|
|
13410
|
+
for (const j of C)
|
|
13411
13411
|
this.maybeResize(), P(j);
|
|
13412
13412
|
}
|
|
13413
13413
|
toArray() {
|
|
@@ -13415,15 +13415,15 @@ function Tb() {
|
|
|
13415
13415
|
}
|
|
13416
13416
|
}
|
|
13417
13417
|
Ce.BinaryWriter = F;
|
|
13418
|
-
function
|
|
13418
|
+
function M(q, C, P) {
|
|
13419
13419
|
const j = P.value;
|
|
13420
13420
|
P.value = function(...E) {
|
|
13421
13421
|
try {
|
|
13422
13422
|
return j.apply(this, E);
|
|
13423
13423
|
} catch (c) {
|
|
13424
13424
|
if (c instanceof RangeError) {
|
|
13425
|
-
const
|
|
13426
|
-
if (["ERR_BUFFER_OUT_OF_BOUNDS", "ERR_OUT_OF_RANGE"].indexOf(
|
|
13425
|
+
const h = c.code;
|
|
13426
|
+
if (["ERR_BUFFER_OUT_OF_BOUNDS", "ERR_OUT_OF_RANGE"].indexOf(h) >= 0)
|
|
13427
13427
|
throw new N("Reached the end of buffer when deserializing");
|
|
13428
13428
|
}
|
|
13429
13429
|
throw c;
|
|
@@ -13431,86 +13431,86 @@ function Tb() {
|
|
|
13431
13431
|
};
|
|
13432
13432
|
}
|
|
13433
13433
|
class k {
|
|
13434
|
-
constructor(
|
|
13435
|
-
this.buf =
|
|
13434
|
+
constructor(C) {
|
|
13435
|
+
this.buf = C, this.offset = 0;
|
|
13436
13436
|
}
|
|
13437
13437
|
readU8() {
|
|
13438
|
-
const
|
|
13439
|
-
return this.offset += 1,
|
|
13438
|
+
const C = this.buf.readUInt8(this.offset);
|
|
13439
|
+
return this.offset += 1, C;
|
|
13440
13440
|
}
|
|
13441
13441
|
readU16() {
|
|
13442
|
-
const
|
|
13443
|
-
return this.offset += 2,
|
|
13442
|
+
const C = this.buf.readUInt16LE(this.offset);
|
|
13443
|
+
return this.offset += 2, C;
|
|
13444
13444
|
}
|
|
13445
13445
|
readU32() {
|
|
13446
|
-
const
|
|
13447
|
-
return this.offset += 4,
|
|
13446
|
+
const C = this.buf.readUInt32LE(this.offset);
|
|
13447
|
+
return this.offset += 4, C;
|
|
13448
13448
|
}
|
|
13449
13449
|
readU64() {
|
|
13450
|
-
const
|
|
13451
|
-
return new i.default(
|
|
13450
|
+
const C = this.readBuffer(8);
|
|
13451
|
+
return new i.default(C, "le");
|
|
13452
13452
|
}
|
|
13453
13453
|
readU128() {
|
|
13454
|
-
const
|
|
13455
|
-
return new i.default(
|
|
13454
|
+
const C = this.readBuffer(16);
|
|
13455
|
+
return new i.default(C, "le");
|
|
13456
13456
|
}
|
|
13457
13457
|
readU256() {
|
|
13458
|
-
const
|
|
13459
|
-
return new i.default(
|
|
13458
|
+
const C = this.readBuffer(32);
|
|
13459
|
+
return new i.default(C, "le");
|
|
13460
13460
|
}
|
|
13461
13461
|
readU512() {
|
|
13462
|
-
const
|
|
13463
|
-
return new i.default(
|
|
13462
|
+
const C = this.readBuffer(64);
|
|
13463
|
+
return new i.default(C, "le");
|
|
13464
13464
|
}
|
|
13465
|
-
readBuffer(
|
|
13466
|
-
if (this.offset +
|
|
13467
|
-
throw new N(`Expected buffer length ${
|
|
13468
|
-
const P = this.buf.slice(this.offset, this.offset +
|
|
13469
|
-
return this.offset +=
|
|
13465
|
+
readBuffer(C) {
|
|
13466
|
+
if (this.offset + C > this.buf.length)
|
|
13467
|
+
throw new N(`Expected buffer length ${C} isn't within bounds`);
|
|
13468
|
+
const P = this.buf.slice(this.offset, this.offset + C);
|
|
13469
|
+
return this.offset += C, P;
|
|
13470
13470
|
}
|
|
13471
13471
|
readString() {
|
|
13472
|
-
const
|
|
13472
|
+
const C = this.readU32(), P = this.readBuffer(C);
|
|
13473
13473
|
try {
|
|
13474
13474
|
return m.decode(P);
|
|
13475
13475
|
} catch (j) {
|
|
13476
13476
|
throw new N(`Error decoding UTF-8 string: ${j}`);
|
|
13477
13477
|
}
|
|
13478
13478
|
}
|
|
13479
|
-
readFixedArray(
|
|
13480
|
-
return new Uint8Array(this.readBuffer(
|
|
13479
|
+
readFixedArray(C) {
|
|
13480
|
+
return new Uint8Array(this.readBuffer(C));
|
|
13481
13481
|
}
|
|
13482
|
-
readArray(
|
|
13482
|
+
readArray(C) {
|
|
13483
13483
|
const P = this.readU32(), j = Array();
|
|
13484
13484
|
for (let E = 0; E < P; ++E)
|
|
13485
|
-
j.push(
|
|
13485
|
+
j.push(C());
|
|
13486
13486
|
return j;
|
|
13487
13487
|
}
|
|
13488
13488
|
}
|
|
13489
13489
|
n([
|
|
13490
|
-
|
|
13490
|
+
M
|
|
13491
13491
|
], k.prototype, "readU8", null), n([
|
|
13492
|
-
|
|
13492
|
+
M
|
|
13493
13493
|
], k.prototype, "readU16", null), n([
|
|
13494
|
-
|
|
13494
|
+
M
|
|
13495
13495
|
], k.prototype, "readU32", null), n([
|
|
13496
|
-
|
|
13496
|
+
M
|
|
13497
13497
|
], k.prototype, "readU64", null), n([
|
|
13498
|
-
|
|
13498
|
+
M
|
|
13499
13499
|
], k.prototype, "readU128", null), n([
|
|
13500
|
-
|
|
13500
|
+
M
|
|
13501
13501
|
], k.prototype, "readU256", null), n([
|
|
13502
|
-
|
|
13502
|
+
M
|
|
13503
13503
|
], k.prototype, "readU512", null), n([
|
|
13504
|
-
|
|
13504
|
+
M
|
|
13505
13505
|
], k.prototype, "readString", null), n([
|
|
13506
|
-
|
|
13506
|
+
M
|
|
13507
13507
|
], k.prototype, "readFixedArray", null), n([
|
|
13508
|
-
|
|
13508
|
+
M
|
|
13509
13509
|
], k.prototype, "readArray", null), Ce.BinaryReader = k;
|
|
13510
13510
|
function K(q) {
|
|
13511
13511
|
return q.charAt(0).toUpperCase() + q.slice(1);
|
|
13512
13512
|
}
|
|
13513
|
-
function Y(q,
|
|
13513
|
+
function Y(q, C, P, j, E) {
|
|
13514
13514
|
try {
|
|
13515
13515
|
if (typeof j == "string")
|
|
13516
13516
|
E[`write${K(j)}`](P);
|
|
@@ -13526,17 +13526,17 @@ function Tb() {
|
|
|
13526
13526
|
Y(q, null, P[c], j[0], E);
|
|
13527
13527
|
} else
|
|
13528
13528
|
E.writeArray(P, (c) => {
|
|
13529
|
-
Y(q,
|
|
13529
|
+
Y(q, C, c, j[0], E);
|
|
13530
13530
|
});
|
|
13531
13531
|
else if (j.kind !== void 0)
|
|
13532
13532
|
switch (j.kind) {
|
|
13533
13533
|
case "option": {
|
|
13534
|
-
P == null ? E.writeU8(0) : (E.writeU8(1), Y(q,
|
|
13534
|
+
P == null ? E.writeU8(0) : (E.writeU8(1), Y(q, C, P, j.type, E));
|
|
13535
13535
|
break;
|
|
13536
13536
|
}
|
|
13537
13537
|
case "map": {
|
|
13538
|
-
E.writeU32(P.size), P.forEach((c,
|
|
13539
|
-
Y(q,
|
|
13538
|
+
E.writeU32(P.size), P.forEach((c, h) => {
|
|
13539
|
+
Y(q, C, h, j.key, E), Y(q, C, c, j.value, E);
|
|
13540
13540
|
});
|
|
13541
13541
|
break;
|
|
13542
13542
|
}
|
|
@@ -13546,39 +13546,39 @@ function Tb() {
|
|
|
13546
13546
|
else
|
|
13547
13547
|
V(q, P, E);
|
|
13548
13548
|
} catch (c) {
|
|
13549
|
-
throw c instanceof N && c.addToFieldPath(
|
|
13549
|
+
throw c instanceof N && c.addToFieldPath(C), c;
|
|
13550
13550
|
}
|
|
13551
13551
|
}
|
|
13552
|
-
function V(q,
|
|
13553
|
-
if (typeof
|
|
13554
|
-
|
|
13552
|
+
function V(q, C, P) {
|
|
13553
|
+
if (typeof C.borshSerialize == "function") {
|
|
13554
|
+
C.borshSerialize(P);
|
|
13555
13555
|
return;
|
|
13556
13556
|
}
|
|
13557
|
-
const j = q.get(
|
|
13557
|
+
const j = q.get(C.constructor);
|
|
13558
13558
|
if (!j)
|
|
13559
|
-
throw new N(`Class ${
|
|
13559
|
+
throw new N(`Class ${C.constructor.name} is missing in schema`);
|
|
13560
13560
|
if (j.kind === "struct")
|
|
13561
13561
|
j.fields.map(([E, c]) => {
|
|
13562
|
-
Y(q, E,
|
|
13562
|
+
Y(q, E, C[E], c, P);
|
|
13563
13563
|
});
|
|
13564
13564
|
else if (j.kind === "enum") {
|
|
13565
|
-
const E =
|
|
13565
|
+
const E = C[j.field];
|
|
13566
13566
|
for (let c = 0; c < j.values.length; ++c) {
|
|
13567
|
-
const [
|
|
13568
|
-
if (
|
|
13569
|
-
P.writeU8(c), Y(q,
|
|
13567
|
+
const [h, y] = j.values[c];
|
|
13568
|
+
if (h === E) {
|
|
13569
|
+
P.writeU8(c), Y(q, h, C[h], y, P);
|
|
13570
13570
|
break;
|
|
13571
13571
|
}
|
|
13572
13572
|
}
|
|
13573
13573
|
} else
|
|
13574
|
-
throw new N(`Unexpected schema kind: ${j.kind} for ${
|
|
13574
|
+
throw new N(`Unexpected schema kind: ${j.kind} for ${C.constructor.name}`);
|
|
13575
13575
|
}
|
|
13576
|
-
function L(q,
|
|
13576
|
+
function L(q, C, P = F) {
|
|
13577
13577
|
const j = new P();
|
|
13578
|
-
return V(q,
|
|
13578
|
+
return V(q, C, j), j.toArray();
|
|
13579
13579
|
}
|
|
13580
13580
|
Ce.serialize = L;
|
|
13581
|
-
function z(q,
|
|
13581
|
+
function z(q, C, P, j) {
|
|
13582
13582
|
try {
|
|
13583
13583
|
if (typeof P == "string")
|
|
13584
13584
|
return j[`read${K(P)}`]();
|
|
@@ -13591,55 +13591,55 @@ function Tb() {
|
|
|
13591
13591
|
E.push(z(q, null, P[0], j));
|
|
13592
13592
|
return E;
|
|
13593
13593
|
} else
|
|
13594
|
-
return j.readArray(() => z(q,
|
|
13594
|
+
return j.readArray(() => z(q, C, P[0], j));
|
|
13595
13595
|
}
|
|
13596
13596
|
if (P.kind === "option")
|
|
13597
|
-
return j.readU8() ? z(q,
|
|
13597
|
+
return j.readU8() ? z(q, C, P.type, j) : void 0;
|
|
13598
13598
|
if (P.kind === "map") {
|
|
13599
13599
|
let E = /* @__PURE__ */ new Map();
|
|
13600
13600
|
const c = j.readU32();
|
|
13601
|
-
for (let
|
|
13602
|
-
const y = z(q,
|
|
13601
|
+
for (let h = 0; h < c; h++) {
|
|
13602
|
+
const y = z(q, C, P.key, j), A = z(q, C, P.value, j);
|
|
13603
13603
|
E.set(y, A);
|
|
13604
13604
|
}
|
|
13605
13605
|
return E;
|
|
13606
13606
|
}
|
|
13607
13607
|
return J(q, P, j);
|
|
13608
13608
|
} catch (E) {
|
|
13609
|
-
throw E instanceof N && E.addToFieldPath(
|
|
13609
|
+
throw E instanceof N && E.addToFieldPath(C), E;
|
|
13610
13610
|
}
|
|
13611
13611
|
}
|
|
13612
|
-
function J(q,
|
|
13613
|
-
if (typeof
|
|
13614
|
-
return
|
|
13615
|
-
const j = q.get(
|
|
13612
|
+
function J(q, C, P) {
|
|
13613
|
+
if (typeof C.borshDeserialize == "function")
|
|
13614
|
+
return C.borshDeserialize(P);
|
|
13615
|
+
const j = q.get(C);
|
|
13616
13616
|
if (!j)
|
|
13617
|
-
throw new N(`Class ${
|
|
13617
|
+
throw new N(`Class ${C.name} is missing in schema`);
|
|
13618
13618
|
if (j.kind === "struct") {
|
|
13619
13619
|
const E = {};
|
|
13620
|
-
for (const [c,
|
|
13621
|
-
E[c] = z(q, c,
|
|
13622
|
-
return new
|
|
13620
|
+
for (const [c, h] of q.get(C).fields)
|
|
13621
|
+
E[c] = z(q, c, h, P);
|
|
13622
|
+
return new C(E);
|
|
13623
13623
|
}
|
|
13624
13624
|
if (j.kind === "enum") {
|
|
13625
13625
|
const E = P.readU8();
|
|
13626
13626
|
if (E >= j.values.length)
|
|
13627
13627
|
throw new N(`Enum index: ${E} is out of range`);
|
|
13628
|
-
const [c,
|
|
13629
|
-
return new
|
|
13628
|
+
const [c, h] = j.values[E], y = z(q, c, h, P);
|
|
13629
|
+
return new C({ [c]: y });
|
|
13630
13630
|
}
|
|
13631
|
-
throw new N(`Unexpected schema kind: ${j.kind} for ${
|
|
13631
|
+
throw new N(`Unexpected schema kind: ${j.kind} for ${C.constructor.name}`);
|
|
13632
13632
|
}
|
|
13633
|
-
function te(q,
|
|
13634
|
-
const E = new j(P), c = J(q,
|
|
13633
|
+
function te(q, C, P, j = k) {
|
|
13634
|
+
const E = new j(P), c = J(q, C, E);
|
|
13635
13635
|
if (E.offset < P.length)
|
|
13636
13636
|
throw new N(`Unexpected ${P.length - E.offset} bytes after deserialized data`);
|
|
13637
13637
|
return c;
|
|
13638
13638
|
}
|
|
13639
13639
|
Ce.deserialize = te;
|
|
13640
|
-
function ne(q,
|
|
13640
|
+
function ne(q, C, P, j = k) {
|
|
13641
13641
|
const E = new j(P);
|
|
13642
|
-
return J(q,
|
|
13642
|
+
return J(q, C, E);
|
|
13643
13643
|
}
|
|
13644
13644
|
return Ce.deserializeUnchecked = ne, Ce;
|
|
13645
13645
|
}
|
|
@@ -13898,7 +13898,7 @@ function Ob() {
|
|
|
13898
13898
|
const l = Math.floor(u / N), w = u - l * N;
|
|
13899
13899
|
return { hi32: l, lo32: w };
|
|
13900
13900
|
}
|
|
13901
|
-
function
|
|
13901
|
+
function M(u, l) {
|
|
13902
13902
|
return u * N + l;
|
|
13903
13903
|
}
|
|
13904
13904
|
class k extends r {
|
|
@@ -13908,7 +13908,7 @@ function Ob() {
|
|
|
13908
13908
|
/** @override */
|
|
13909
13909
|
decode(l, w = 0) {
|
|
13910
13910
|
const T = n(l), D = T.readUInt32LE(w), W = T.readUInt32LE(w + 4);
|
|
13911
|
-
return
|
|
13911
|
+
return M(W, D);
|
|
13912
13912
|
}
|
|
13913
13913
|
/** @override */
|
|
13914
13914
|
encode(l, w, T = 0) {
|
|
@@ -13924,7 +13924,7 @@ function Ob() {
|
|
|
13924
13924
|
/** @override */
|
|
13925
13925
|
decode(l, w = 0) {
|
|
13926
13926
|
const T = n(l), D = T.readUInt32BE(w), W = T.readUInt32BE(w + 4);
|
|
13927
|
-
return
|
|
13927
|
+
return M(D, W);
|
|
13928
13928
|
}
|
|
13929
13929
|
/** @override */
|
|
13930
13930
|
encode(l, w, T = 0) {
|
|
@@ -13940,7 +13940,7 @@ function Ob() {
|
|
|
13940
13940
|
/** @override */
|
|
13941
13941
|
decode(l, w = 0) {
|
|
13942
13942
|
const T = n(l), D = T.readUInt32LE(w), W = T.readInt32LE(w + 4);
|
|
13943
|
-
return
|
|
13943
|
+
return M(W, D);
|
|
13944
13944
|
}
|
|
13945
13945
|
/** @override */
|
|
13946
13946
|
encode(l, w, T = 0) {
|
|
@@ -13956,7 +13956,7 @@ function Ob() {
|
|
|
13956
13956
|
/** @override */
|
|
13957
13957
|
decode(l, w = 0) {
|
|
13958
13958
|
const T = n(l), D = T.readInt32BE(w), W = T.readUInt32BE(w + 4);
|
|
13959
|
-
return
|
|
13959
|
+
return M(D, W);
|
|
13960
13960
|
}
|
|
13961
13961
|
/** @override */
|
|
13962
13962
|
encode(l, w, T = 0) {
|
|
@@ -14170,7 +14170,7 @@ function Ob() {
|
|
|
14170
14170
|
}
|
|
14171
14171
|
}
|
|
14172
14172
|
H.Structure = q;
|
|
14173
|
-
class
|
|
14173
|
+
class C {
|
|
14174
14174
|
constructor(l) {
|
|
14175
14175
|
this.property = l;
|
|
14176
14176
|
}
|
|
@@ -14189,8 +14189,8 @@ function Ob() {
|
|
|
14189
14189
|
throw new Error("UnionDiscriminator is abstract");
|
|
14190
14190
|
}
|
|
14191
14191
|
}
|
|
14192
|
-
H.UnionDiscriminator =
|
|
14193
|
-
class P extends
|
|
14192
|
+
H.UnionDiscriminator = C;
|
|
14193
|
+
class P extends C {
|
|
14194
14194
|
constructor(l, w) {
|
|
14195
14195
|
if (!(l instanceof o && l.isCount()))
|
|
14196
14196
|
throw new TypeError("layout must be an unsigned integer ExternalLayout");
|
|
@@ -14213,7 +14213,7 @@ function Ob() {
|
|
|
14213
14213
|
D = new P(new d(l));
|
|
14214
14214
|
else if (l instanceof o && l.isCount())
|
|
14215
14215
|
D = new P(l);
|
|
14216
|
-
else if (l instanceof
|
|
14216
|
+
else if (l instanceof C)
|
|
14217
14217
|
D = l;
|
|
14218
14218
|
else
|
|
14219
14219
|
throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");
|
|
@@ -14411,7 +14411,7 @@ function Ob() {
|
|
|
14411
14411
|
function c(u) {
|
|
14412
14412
|
return 0 > u && (u += 4294967296), u;
|
|
14413
14413
|
}
|
|
14414
|
-
class
|
|
14414
|
+
class h extends r {
|
|
14415
14415
|
constructor(l, w, T) {
|
|
14416
14416
|
if (!(l instanceof m || l instanceof g))
|
|
14417
14417
|
throw new TypeError("word must be a UInt or UIntBE layout");
|
|
@@ -14490,10 +14490,10 @@ function Ob() {
|
|
|
14490
14490
|
return w;
|
|
14491
14491
|
}
|
|
14492
14492
|
}
|
|
14493
|
-
H.BitStructure =
|
|
14493
|
+
H.BitStructure = h;
|
|
14494
14494
|
class y {
|
|
14495
14495
|
constructor(l, w, T) {
|
|
14496
|
-
if (!(l instanceof
|
|
14496
|
+
if (!(l instanceof h))
|
|
14497
14497
|
throw new TypeError("container must be a BitStructure");
|
|
14498
14498
|
if (!Number.isInteger(w) || 0 >= w)
|
|
14499
14499
|
throw new TypeError("bits must be positive integer");
|
|
@@ -14642,9 +14642,9 @@ function Ob() {
|
|
|
14642
14642
|
return 0;
|
|
14643
14643
|
}
|
|
14644
14644
|
}
|
|
14645
|
-
return H.Constant = b, H.greedy = ((u, l) => new a(u, l)), H.offset = ((u, l, w) => new d(u, l, w)), H.u8 = ((u) => new m(1, u)), H.u16 = ((u) => new m(2, u)), H.u24 = ((u) => new m(3, u)), H.u32 = ((u) => new m(4, u)), H.u40 = ((u) => new m(5, u)), H.u48 = ((u) => new m(6, u)), H.nu64 = ((u) => new k(u)), H.u16be = ((u) => new g(2, u)), H.u24be = ((u) => new g(3, u)), H.u32be = ((u) => new g(4, u)), H.u40be = ((u) => new g(5, u)), H.u48be = ((u) => new g(6, u)), H.nu64be = ((u) => new K(u)), H.s8 = ((u) => new x(1, u)), H.s16 = ((u) => new x(2, u)), H.s24 = ((u) => new x(3, u)), H.s32 = ((u) => new x(4, u)), H.s40 = ((u) => new x(5, u)), H.s48 = ((u) => new x(6, u)), H.ns64 = ((u) => new Y(u)), H.s16be = ((u) => new O(2, u)), H.s24be = ((u) => new O(3, u)), H.s32be = ((u) => new O(4, u)), H.s40be = ((u) => new O(5, u)), H.s48be = ((u) => new O(6, u)), H.ns64be = ((u) => new V(u)), H.f32 = ((u) => new L(u)), H.f32be = ((u) => new z(u)), H.f64 = ((u) => new J(u)), H.f64be = ((u) => new te(u)), H.struct = ((u, l, w) => new q(u, l, w)), H.bits = ((u, l, w) => new
|
|
14645
|
+
return H.Constant = b, H.greedy = ((u, l) => new a(u, l)), H.offset = ((u, l, w) => new d(u, l, w)), H.u8 = ((u) => new m(1, u)), H.u16 = ((u) => new m(2, u)), H.u24 = ((u) => new m(3, u)), H.u32 = ((u) => new m(4, u)), H.u40 = ((u) => new m(5, u)), H.u48 = ((u) => new m(6, u)), H.nu64 = ((u) => new k(u)), H.u16be = ((u) => new g(2, u)), H.u24be = ((u) => new g(3, u)), H.u32be = ((u) => new g(4, u)), H.u40be = ((u) => new g(5, u)), H.u48be = ((u) => new g(6, u)), H.nu64be = ((u) => new K(u)), H.s8 = ((u) => new x(1, u)), H.s16 = ((u) => new x(2, u)), H.s24 = ((u) => new x(3, u)), H.s32 = ((u) => new x(4, u)), H.s40 = ((u) => new x(5, u)), H.s48 = ((u) => new x(6, u)), H.ns64 = ((u) => new Y(u)), H.s16be = ((u) => new O(2, u)), H.s24be = ((u) => new O(3, u)), H.s32be = ((u) => new O(4, u)), H.s40be = ((u) => new O(5, u)), H.s48be = ((u) => new O(6, u)), H.ns64be = ((u) => new V(u)), H.f32 = ((u) => new L(u)), H.f32be = ((u) => new z(u)), H.f64 = ((u) => new J(u)), H.f64be = ((u) => new te(u)), H.struct = ((u, l, w) => new q(u, l, w)), H.bits = ((u, l, w) => new h(u, l, w)), H.seq = ((u, l, w) => new ne(u, l, w)), H.union = ((u, l, w) => new j(u, l, w)), H.unionLayoutDiscriminator = ((u, l) => new P(u, l)), H.blob = ((u, l) => new v(u, l)), H.cstr = ((u) => new R(u)), H.utf8 = ((u, l) => new I(u, l)), H.constant = ((u, l) => new b(u, l)), H;
|
|
14646
14646
|
}
|
|
14647
|
-
var
|
|
14647
|
+
var B = Ob(), Ib = 1, Nb = 2, Cb = 3, Mb = 4, Bb = 5, kb = 6, Lb = 7, Pb = 8, Ub = 9, Db = 10, Fb = -32700, $b = -32603, zb = -32602, jb = -32601, Vb = -32600, Gb = -32016, Hb = -32015, qb = -32014, Kb = -32013, Wb = -32012, Zb = -32011, Yb = -32010, Jb = -32009, Xb = -32008, Qb = -32007, ew = -32006, tw = -32005, nw = -32004, rw = -32003, sw = -32002, iw = -32001, ow = 28e5, aw = 2800001, cw = 2800002, uw = 2800003, dw = 2800004, lw = 2800005, fw = 2800006, hw = 2800007, pw = 2800008, mw = 2800009, gw = 2800010, yw = 2800011, _w = 323e4, bw = 32300001, ww = 3230002, Ew = 3230003, vw = 3230004, Rw = 361e4, Aw = 3610001, xw = 3610002, Sw = 3610003, Tw = 3610004, Ow = 3610005, Iw = 3610006, Nw = 3610007, Cw = 3611e3, Mw = 3704e3, Bw = 3704001, kw = 3704002, Lw = 3704003, Pw = 3704004, Uw = 4128e3, Dw = 4128001, Fw = 4128002, $w = 4615e3, zw = 4615001, jw = 4615002, Vw = 4615003, Gw = 4615004, Hw = 4615005, qw = 4615006, Kw = 4615007, Ww = 4615008, Zw = 4615009, Yw = 4615010, Jw = 4615011, Xw = 4615012, Qw = 4615013, eE = 4615014, tE = 4615015, nE = 4615016, rE = 4615017, sE = 4615018, iE = 4615019, oE = 4615020, aE = 4615021, cE = 4615022, uE = 4615023, dE = 4615024, lE = 4615025, fE = 4615026, hE = 4615027, pE = 4615028, mE = 4615029, gE = 4615030, yE = 4615031, _E = 4615032, bE = 4615033, wE = 4615034, EE = 4615035, vE = 4615036, RE = 4615037, AE = 4615038, xE = 4615039, SE = 4615040, TE = 4615041, OE = 4615042, IE = 4615043, NE = 4615044, CE = 4615045, ME = 4615046, BE = 4615047, kE = 4615048, LE = 4615049, PE = 4615050, UE = 4615051, DE = 4615052, FE = 4615053, $E = 4615054, zE = 5508e3, jE = 5508001, VE = 5508002, GE = 5508003, HE = 5508004, qE = 5508005, KE = 5508006, WE = 5508007, ZE = 5508008, YE = 5508009, JE = 5508010, XE = 5508011, QE = 5663e3, ev = 5663001, tv = 5663002, nv = 5663003, rv = 5663004, sv = 5663005, iv = 5663006, ov = 5663007, av = 5663008, cv = 5663009, uv = 5663010, dv = 5663011, lv = 5663012, fv = 5663013, hv = 5663014, pv = 5663015, mv = 5663016, gv = 5663017, yv = 5663018, _v = 5663019, bv = 5663020, wv = 705e4, Ev = 7050001, vv = 7050002, Rv = 7050003, Av = 7050004, xv = 7050005, Sv = 7050006, Tv = 7050007, Ov = 7050008, Iv = 7050009, Nv = 7050010, Cv = 7050011, Mv = 7050012, Bv = 7050013, kv = 7050014, Lv = 7050015, Pv = 7050016, Uv = 7050017, Dv = 7050018, Fv = 7050019, $v = 7050020, zv = 7050021, jv = 7050022, Vv = 7050023, Gv = 7050024, Hv = 7050025, qv = 7050026, Kv = 7050027, Wv = 7050028, Zv = 7050029, Yv = 7050030, Jv = 7050031, Xv = 7050032, Qv = 7050033, eR = 7050034, tR = 7050035, nR = 7050036, yh = 8078e3, _h = 8078001, rR = 8078002, sR = 8078003, bh = 8078004, wh = 8078005, Eh = 8078006, iR = 8078007, oR = 8078008, aR = 8078009, cR = 8078010, vh = 8078011, uR = 8078012, dR = 8078013, lR = 8078014, fR = 8078015, hR = 8078016, pR = 8078017, mR = 8078018, gR = 8078019, yR = 8078020, _R = 8078021, bR = 8078022, wR = 81e5, ER = 8100001, vR = 8100002, RR = 8100003, AR = 819e4, xR = 8190001, SR = 8190002, TR = 8190003, OR = 8190004, IR = 99e5, NR = 9900001, CR = 9900002, MR = 9900003, BR = 9900004;
|
|
14648
14648
|
function Rh(t) {
|
|
14649
14649
|
return Array.isArray(t) ? "%5B" + t.map(Rh).join(
|
|
14650
14650
|
"%2C%20"
|
|
@@ -15586,11 +15586,11 @@ function wA(t) {
|
|
|
15586
15586
|
O[N] = a[x][N];
|
|
15587
15587
|
for (var F = 16; F < 80; ++F)
|
|
15588
15588
|
O[F] = wa(O[F - 3] ^ O[F - 8] ^ O[F - 14] ^ O[F - 16], 1);
|
|
15589
|
-
for (var
|
|
15590
|
-
var z = Math.floor(L / 20), J = wa(
|
|
15591
|
-
V = Y, Y = K, K = wa(k, 30) >>> 0, k =
|
|
15589
|
+
for (var M = n[0], k = n[1], K = n[2], Y = n[3], V = n[4], L = 0; L < 80; ++L) {
|
|
15590
|
+
var z = Math.floor(L / 20), J = wa(M, 5) + bA(z, k, K, Y) + V + e[z] + O[L] >>> 0;
|
|
15591
|
+
V = Y, Y = K, K = wa(k, 30) >>> 0, k = M, M = J;
|
|
15592
15592
|
}
|
|
15593
|
-
n[0] = n[0] +
|
|
15593
|
+
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] + V >>> 0;
|
|
15594
15594
|
}
|
|
15595
15595
|
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];
|
|
15596
15596
|
}
|
|
@@ -15951,15 +15951,15 @@ class qi {
|
|
|
15951
15951
|
}));
|
|
15952
15952
|
}
|
|
15953
15953
|
}
|
|
15954
|
-
const Se = (t = "publicKey") =>
|
|
15955
|
-
const e =
|
|
15954
|
+
const Se = (t = "publicKey") => B.blob(32, t), CA = (t = "signature") => B.blob(64, t), Sr = (t = "string") => {
|
|
15955
|
+
const e = B.struct([B.u32("length"), B.u32("lengthPadding"), B.blob(B.offset(B.u32(), -8), "chars")], t), n = e.decode.bind(e), r = e.encode.bind(e), s = e;
|
|
15956
15956
|
return s.decode = (i, o) => n(i, o).chars.toString(), s.encode = (i, o, a) => {
|
|
15957
15957
|
const d = {
|
|
15958
15958
|
chars: xe.Buffer.from(i, "utf8")
|
|
15959
15959
|
};
|
|
15960
15960
|
return r(d, o, a);
|
|
15961
|
-
}, s.alloc = (i) =>
|
|
15962
|
-
}, MA = (t = "authorized") =>
|
|
15961
|
+
}, s.alloc = (i) => B.u32().span + B.u32().span + xe.Buffer.from(i, "utf8").length, s;
|
|
15962
|
+
}, MA = (t = "authorized") => B.struct([Se("staker"), Se("withdrawer")], t), BA = (t = "lockup") => B.struct([B.ns64("unixTimestamp"), B.ns64("epoch"), Se("custodian")], t), kA = (t = "voteInit") => B.struct([Se("nodePubkey"), Se("authorizedVoter"), Se("authorizedWithdrawer"), B.u8("commission")], t), LA = (t = "voteAuthorizeWithSeedArgs") => B.struct([B.u32("voteAuthorizationType"), Se("currentAuthorityDerivedKeyOwnerPubkey"), Sr("currentAuthorityDerivedKeySeed"), Se("newAuthorized")], t);
|
|
15963
15963
|
function Gt(t) {
|
|
15964
15964
|
let e = 0, n = 0;
|
|
15965
15965
|
for (; ; ) {
|
|
@@ -16126,12 +16126,12 @@ class jr {
|
|
|
16126
16126
|
accounts: O,
|
|
16127
16127
|
programIdIndex: N
|
|
16128
16128
|
} = x, F = Array.from(Pt.decode(x.data));
|
|
16129
|
-
let
|
|
16130
|
-
Ht(
|
|
16129
|
+
let M = [];
|
|
16130
|
+
Ht(M, O.length);
|
|
16131
16131
|
let k = [];
|
|
16132
16132
|
return Ht(k, F.length), {
|
|
16133
16133
|
programIdIndex: N,
|
|
16134
|
-
keyIndicesCount: xe.Buffer.from(
|
|
16134
|
+
keyIndicesCount: xe.Buffer.from(M),
|
|
16135
16135
|
keyIndices: O,
|
|
16136
16136
|
dataLength: xe.Buffer.from(k),
|
|
16137
16137
|
data: F
|
|
@@ -16143,10 +16143,10 @@ class jr {
|
|
|
16143
16143
|
xe.Buffer.from(s).copy(i);
|
|
16144
16144
|
let o = s.length;
|
|
16145
16145
|
r.forEach((x) => {
|
|
16146
|
-
const N =
|
|
16146
|
+
const N = B.struct([B.u8("programIdIndex"), B.blob(x.keyIndicesCount.length, "keyIndicesCount"), B.seq(B.u8("keyIndex"), x.keyIndices.length, "keyIndices"), B.blob(x.dataLength.length, "dataLength"), B.seq(B.u8("userdatum"), x.data.length, "data")]).encode(x, i, o);
|
|
16147
16147
|
o += N;
|
|
16148
16148
|
}), i = i.slice(0, o);
|
|
16149
|
-
const a =
|
|
16149
|
+
const a = B.struct([B.blob(1, "numRequiredSignatures"), B.blob(1, "numReadonlySignedAccounts"), B.blob(1, "numReadonlyUnsignedAccounts"), B.blob(n.length, "keyCount"), B.seq(Se("key"), e, "keys"), Se("recentBlockhash")]), d = {
|
|
16150
16150
|
numRequiredSignatures: xe.Buffer.from([this.header.numRequiredSignatures]),
|
|
16151
16151
|
numReadonlySignedAccounts: xe.Buffer.from([this.header.numReadonlySignedAccounts]),
|
|
16152
16152
|
numReadonlyUnsignedAccounts: xe.Buffer.from([this.header.numReadonlyUnsignedAccounts]),
|
|
@@ -16175,10 +16175,10 @@ class jr {
|
|
|
16175
16175
|
const d = qt(n, 0, jn), m = Gt(n);
|
|
16176
16176
|
let g = [];
|
|
16177
16177
|
for (let O = 0; O < m; O++) {
|
|
16178
|
-
const N = xn(n), F = Gt(n),
|
|
16178
|
+
const N = xn(n), F = Gt(n), M = qt(n, 0, F), k = Gt(n), K = qt(n, 0, k), Y = Pt.encode(xe.Buffer.from(K));
|
|
16179
16179
|
g.push({
|
|
16180
16180
|
programIdIndex: N,
|
|
16181
|
-
accounts:
|
|
16181
|
+
accounts: M,
|
|
16182
16182
|
data: Y
|
|
16183
16183
|
});
|
|
16184
16184
|
}
|
|
@@ -16289,7 +16289,7 @@ class Ki {
|
|
|
16289
16289
|
Ht(r, this.compiledInstructions.length);
|
|
16290
16290
|
const s = this.serializeAddressTableLookups(), i = Array();
|
|
16291
16291
|
Ht(i, this.addressTableLookups.length);
|
|
16292
|
-
const o =
|
|
16292
|
+
const o = B.struct([B.u8("prefix"), B.struct([B.u8("numRequiredSignatures"), B.u8("numReadonlySignedAccounts"), B.u8("numReadonlyUnsignedAccounts")], "header"), B.blob(e.length, "staticAccountKeysLength"), B.seq(Se(), this.staticAccountKeys.length, "staticAccountKeys"), Se("recentBlockhash"), B.blob(r.length, "instructionsLength"), B.blob(n.length, "serializedInstructions"), B.blob(i.length, "addressTableLookupsLength"), B.blob(s.length, "serializedAddressTableLookups")]), a = new Uint8Array(Ir), m = o.encode({
|
|
16293
16293
|
prefix: 128,
|
|
16294
16294
|
header: this.header,
|
|
16295
16295
|
staticAccountKeysLength: new Uint8Array(e),
|
|
@@ -16310,7 +16310,7 @@ class Ki {
|
|
|
16310
16310
|
Ht(s, r.accountKeyIndexes.length);
|
|
16311
16311
|
const i = Array();
|
|
16312
16312
|
Ht(i, r.data.length);
|
|
16313
|
-
const o =
|
|
16313
|
+
const o = B.struct([B.u8("programIdIndex"), B.blob(s.length, "encodedAccountKeyIndexesLength"), B.seq(B.u8(), r.accountKeyIndexes.length, "accountKeyIndexes"), B.blob(i.length, "encodedDataLength"), B.blob(r.data.length, "data")]);
|
|
16314
16314
|
e += o.encode({
|
|
16315
16315
|
programIdIndex: r.programIdIndex,
|
|
16316
16316
|
encodedAccountKeyIndexesLength: new Uint8Array(s),
|
|
@@ -16329,7 +16329,7 @@ class Ki {
|
|
|
16329
16329
|
Ht(s, r.writableIndexes.length);
|
|
16330
16330
|
const i = Array();
|
|
16331
16331
|
Ht(i, r.readonlyIndexes.length);
|
|
16332
|
-
const o =
|
|
16332
|
+
const o = B.struct([Se("accountKey"), B.blob(s.length, "encodedWritableIndexesLength"), B.seq(B.u8(), r.writableIndexes.length, "writableIndexes"), B.blob(i.length, "encodedReadonlyIndexesLength"), B.seq(B.u8(), r.readonlyIndexes.length, "readonlyIndexes")]);
|
|
16333
16333
|
e += o.encode({
|
|
16334
16334
|
accountKey: r.accountKey.toBytes(),
|
|
16335
16335
|
encodedWritableIndexesLength: new Uint8Array(s),
|
|
@@ -16355,18 +16355,18 @@ class Ki {
|
|
|
16355
16355
|
a.push(new be(qt(n, 0, jn)));
|
|
16356
16356
|
const m = Pt.encode(qt(n, 0, jn)), g = Gt(n), x = [];
|
|
16357
16357
|
for (let F = 0; F < g; F++) {
|
|
16358
|
-
const
|
|
16358
|
+
const M = xn(n), k = Gt(n), K = qt(n, 0, k), Y = Gt(n), V = new Uint8Array(qt(n, 0, Y));
|
|
16359
16359
|
x.push({
|
|
16360
|
-
programIdIndex:
|
|
16360
|
+
programIdIndex: M,
|
|
16361
16361
|
accountKeyIndexes: K,
|
|
16362
16362
|
data: V
|
|
16363
16363
|
});
|
|
16364
16364
|
}
|
|
16365
16365
|
const O = Gt(n), N = [];
|
|
16366
16366
|
for (let F = 0; F < O; F++) {
|
|
16367
|
-
const
|
|
16367
|
+
const M = new be(qt(n, 0, jn)), k = Gt(n), K = qt(n, 0, k), Y = Gt(n), V = qt(n, 0, Y);
|
|
16368
16368
|
N.push({
|
|
16369
|
-
accountKey:
|
|
16369
|
+
accountKey: M,
|
|
16370
16370
|
writableIndexes: K,
|
|
16371
16371
|
readonlyIndexes: V
|
|
16372
16372
|
});
|
|
@@ -16506,34 +16506,34 @@ class Wi {
|
|
|
16506
16506
|
r = this.signatures[0].publicKey;
|
|
16507
16507
|
else
|
|
16508
16508
|
throw new Error("Transaction fee payer required");
|
|
16509
|
-
for (let
|
|
16510
|
-
if (n[
|
|
16511
|
-
throw new Error(`Transaction instruction index ${
|
|
16509
|
+
for (let M = 0; M < n.length; M++)
|
|
16510
|
+
if (n[M].programId === void 0)
|
|
16511
|
+
throw new Error(`Transaction instruction index ${M} has undefined program id`);
|
|
16512
16512
|
const s = [], i = [];
|
|
16513
|
-
n.forEach((
|
|
16514
|
-
|
|
16513
|
+
n.forEach((M) => {
|
|
16514
|
+
M.keys.forEach((K) => {
|
|
16515
16515
|
i.push({
|
|
16516
16516
|
...K
|
|
16517
16517
|
});
|
|
16518
16518
|
});
|
|
16519
|
-
const k =
|
|
16519
|
+
const k = M.programId.toString();
|
|
16520
16520
|
s.includes(k) || s.push(k);
|
|
16521
|
-
}), s.forEach((
|
|
16521
|
+
}), s.forEach((M) => {
|
|
16522
16522
|
i.push({
|
|
16523
|
-
pubkey: new be(
|
|
16523
|
+
pubkey: new be(M),
|
|
16524
16524
|
isSigner: !1,
|
|
16525
16525
|
isWritable: !1
|
|
16526
16526
|
});
|
|
16527
16527
|
});
|
|
16528
16528
|
const o = [];
|
|
16529
|
-
i.forEach((
|
|
16530
|
-
const k =
|
|
16531
|
-
K > -1 ? (o[K].isWritable = o[K].isWritable ||
|
|
16532
|
-
}), o.sort(function(
|
|
16533
|
-
if (
|
|
16534
|
-
return
|
|
16535
|
-
if (
|
|
16536
|
-
return
|
|
16529
|
+
i.forEach((M) => {
|
|
16530
|
+
const k = M.pubkey.toString(), K = o.findIndex((Y) => Y.pubkey.toString() === k);
|
|
16531
|
+
K > -1 ? (o[K].isWritable = o[K].isWritable || M.isWritable, o[K].isSigner = o[K].isSigner || M.isSigner) : o.push(M);
|
|
16532
|
+
}), o.sort(function(M, k) {
|
|
16533
|
+
if (M.isSigner !== k.isSigner)
|
|
16534
|
+
return M.isSigner ? -1 : 1;
|
|
16535
|
+
if (M.isWritable !== k.isWritable)
|
|
16536
|
+
return M.isWritable ? -1 : 1;
|
|
16537
16537
|
const K = {
|
|
16538
16538
|
localeMatcher: "best fit",
|
|
16539
16539
|
usage: "sort",
|
|
@@ -16542,47 +16542,47 @@ class Wi {
|
|
|
16542
16542
|
numeric: !1,
|
|
16543
16543
|
caseFirst: "lower"
|
|
16544
16544
|
};
|
|
16545
|
-
return
|
|
16545
|
+
return M.pubkey.toBase58().localeCompare(k.pubkey.toBase58(), "en", K);
|
|
16546
16546
|
});
|
|
16547
|
-
const a = o.findIndex((
|
|
16547
|
+
const a = o.findIndex((M) => M.pubkey.equals(r));
|
|
16548
16548
|
if (a > -1) {
|
|
16549
|
-
const [
|
|
16550
|
-
|
|
16549
|
+
const [M] = o.splice(a, 1);
|
|
16550
|
+
M.isSigner = !0, M.isWritable = !0, o.unshift(M);
|
|
16551
16551
|
} else
|
|
16552
16552
|
o.unshift({
|
|
16553
16553
|
pubkey: r,
|
|
16554
16554
|
isSigner: !0,
|
|
16555
16555
|
isWritable: !0
|
|
16556
16556
|
});
|
|
16557
|
-
for (const
|
|
16558
|
-
const k = o.findIndex((K) => K.pubkey.equals(
|
|
16557
|
+
for (const M of this.signatures) {
|
|
16558
|
+
const k = o.findIndex((K) => K.pubkey.equals(M.publicKey));
|
|
16559
16559
|
if (k > -1)
|
|
16560
16560
|
o[k].isSigner || (o[k].isSigner = !0, console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));
|
|
16561
16561
|
else
|
|
16562
|
-
throw new Error(`unknown signer: ${
|
|
16562
|
+
throw new Error(`unknown signer: ${M.publicKey.toString()}`);
|
|
16563
16563
|
}
|
|
16564
16564
|
let d = 0, m = 0, g = 0;
|
|
16565
16565
|
const x = [], O = [];
|
|
16566
16566
|
o.forEach(({
|
|
16567
|
-
pubkey:
|
|
16567
|
+
pubkey: M,
|
|
16568
16568
|
isSigner: k,
|
|
16569
16569
|
isWritable: K
|
|
16570
16570
|
}) => {
|
|
16571
|
-
k ? (x.push(
|
|
16571
|
+
k ? (x.push(M.toString()), d += 1, K || (m += 1)) : (O.push(M.toString()), K || (g += 1));
|
|
16572
16572
|
});
|
|
16573
|
-
const N = x.concat(O), F = n.map((
|
|
16573
|
+
const N = x.concat(O), F = n.map((M) => {
|
|
16574
16574
|
const {
|
|
16575
16575
|
data: k,
|
|
16576
16576
|
programId: K
|
|
16577
|
-
} =
|
|
16577
|
+
} = M;
|
|
16578
16578
|
return {
|
|
16579
16579
|
programIdIndex: N.indexOf(K.toString()),
|
|
16580
|
-
accounts:
|
|
16580
|
+
accounts: M.keys.map((Y) => N.indexOf(Y.pubkey.toString())),
|
|
16581
16581
|
data: Pt.encode(k)
|
|
16582
16582
|
};
|
|
16583
16583
|
});
|
|
16584
|
-
return F.forEach((
|
|
16585
|
-
gt(
|
|
16584
|
+
return F.forEach((M) => {
|
|
16585
|
+
gt(M.programIdIndex >= 0), M.accounts.forEach((k) => gt(k >= 0));
|
|
16586
16586
|
}), new jr({
|
|
16587
16587
|
header: {
|
|
16588
16588
|
numRequiredSignatures: d,
|
|
@@ -16876,7 +16876,7 @@ class cu {
|
|
|
16876
16876
|
serialize() {
|
|
16877
16877
|
const e = this.message.serialize(), n = Array();
|
|
16878
16878
|
Ht(n, this.signatures.length);
|
|
16879
|
-
const r =
|
|
16879
|
+
const r = B.struct([B.blob(n.length, "encodedSignaturesLength"), B.seq(CA(), this.signatures.length, "signatures"), B.blob(e.length, "serializedMessage")]), s = new Uint8Array(2048), i = r.encode({
|
|
16880
16880
|
encodedSignaturesLength: new Uint8Array(n),
|
|
16881
16881
|
signatures: this.signatures,
|
|
16882
16882
|
serializedMessage: e
|
|
@@ -16913,10 +16913,10 @@ new be("SysvarRewards111111111111111111111111111111");
|
|
|
16913
16913
|
new be("SysvarS1otHashes111111111111111111111111111");
|
|
16914
16914
|
new be("SysvarS1otHistory11111111111111111111111111");
|
|
16915
16915
|
new be("SysvarStakeHistory1111111111111111111111111");
|
|
16916
|
-
const UA =
|
|
16916
|
+
const UA = B.nu64("lamportsPerSignature"), DA = B.struct([B.u32("version"), B.u32("state"), Se("authorizedPubkey"), Se("nonce"), B.struct([UA], "feeCalculator")]);
|
|
16917
16917
|
DA.span;
|
|
16918
16918
|
function Vr(t) {
|
|
16919
|
-
const e =
|
|
16919
|
+
const e = B.blob(8, t), n = e.decode.bind(e), r = e.encode.bind(e), s = e, i = JR();
|
|
16920
16920
|
return s.decode = (o, a) => {
|
|
16921
16921
|
const d = n(o, a);
|
|
16922
16922
|
return i.decode(d);
|
|
@@ -16928,67 +16928,67 @@ function Vr(t) {
|
|
|
16928
16928
|
Object.freeze({
|
|
16929
16929
|
Create: {
|
|
16930
16930
|
index: 0,
|
|
16931
|
-
layout:
|
|
16931
|
+
layout: B.struct([B.u32("instruction"), B.ns64("lamports"), B.ns64("space"), Se("programId")])
|
|
16932
16932
|
},
|
|
16933
16933
|
Assign: {
|
|
16934
16934
|
index: 1,
|
|
16935
|
-
layout:
|
|
16935
|
+
layout: B.struct([B.u32("instruction"), Se("programId")])
|
|
16936
16936
|
},
|
|
16937
16937
|
Transfer: {
|
|
16938
16938
|
index: 2,
|
|
16939
|
-
layout:
|
|
16939
|
+
layout: B.struct([B.u32("instruction"), Vr("lamports")])
|
|
16940
16940
|
},
|
|
16941
16941
|
CreateWithSeed: {
|
|
16942
16942
|
index: 3,
|
|
16943
|
-
layout:
|
|
16943
|
+
layout: B.struct([B.u32("instruction"), Se("base"), Sr("seed"), B.ns64("lamports"), B.ns64("space"), Se("programId")])
|
|
16944
16944
|
},
|
|
16945
16945
|
AdvanceNonceAccount: {
|
|
16946
16946
|
index: 4,
|
|
16947
|
-
layout:
|
|
16947
|
+
layout: B.struct([B.u32("instruction")])
|
|
16948
16948
|
},
|
|
16949
16949
|
WithdrawNonceAccount: {
|
|
16950
16950
|
index: 5,
|
|
16951
|
-
layout:
|
|
16951
|
+
layout: B.struct([B.u32("instruction"), B.ns64("lamports")])
|
|
16952
16952
|
},
|
|
16953
16953
|
InitializeNonceAccount: {
|
|
16954
16954
|
index: 6,
|
|
16955
|
-
layout:
|
|
16955
|
+
layout: B.struct([B.u32("instruction"), Se("authorized")])
|
|
16956
16956
|
},
|
|
16957
16957
|
AuthorizeNonceAccount: {
|
|
16958
16958
|
index: 7,
|
|
16959
|
-
layout:
|
|
16959
|
+
layout: B.struct([B.u32("instruction"), Se("authorized")])
|
|
16960
16960
|
},
|
|
16961
16961
|
Allocate: {
|
|
16962
16962
|
index: 8,
|
|
16963
|
-
layout:
|
|
16963
|
+
layout: B.struct([B.u32("instruction"), B.ns64("space")])
|
|
16964
16964
|
},
|
|
16965
16965
|
AllocateWithSeed: {
|
|
16966
16966
|
index: 9,
|
|
16967
|
-
layout:
|
|
16967
|
+
layout: B.struct([B.u32("instruction"), Se("base"), Sr("seed"), B.ns64("space"), Se("programId")])
|
|
16968
16968
|
},
|
|
16969
16969
|
AssignWithSeed: {
|
|
16970
16970
|
index: 10,
|
|
16971
|
-
layout:
|
|
16971
|
+
layout: B.struct([B.u32("instruction"), Se("base"), Sr("seed"), Se("programId")])
|
|
16972
16972
|
},
|
|
16973
16973
|
TransferWithSeed: {
|
|
16974
16974
|
index: 11,
|
|
16975
|
-
layout:
|
|
16975
|
+
layout: B.struct([B.u32("instruction"), Vr("lamports"), Sr("seed"), Se("programId")])
|
|
16976
16976
|
},
|
|
16977
16977
|
UpgradeNonceAccount: {
|
|
16978
16978
|
index: 12,
|
|
16979
|
-
layout:
|
|
16979
|
+
layout: B.struct([B.u32("instruction")])
|
|
16980
16980
|
}
|
|
16981
16981
|
});
|
|
16982
16982
|
new be("11111111111111111111111111111111");
|
|
16983
16983
|
new be("BPFLoader2111111111111111111111111111111111");
|
|
16984
|
-
|
|
16985
|
-
|
|
16984
|
+
B.struct([
|
|
16985
|
+
B.u32("typeIndex"),
|
|
16986
16986
|
Vr("deactivationSlot"),
|
|
16987
|
-
|
|
16988
|
-
|
|
16989
|
-
|
|
16987
|
+
B.nu64("lastExtendedSlot"),
|
|
16988
|
+
B.u8("lastExtendedStartIndex"),
|
|
16989
|
+
B.u8(),
|
|
16990
16990
|
// option
|
|
16991
|
-
|
|
16991
|
+
B.seq(Se(), B.offset(B.u8(), -1), "authority")
|
|
16992
16992
|
]);
|
|
16993
16993
|
const Ze = Js(ru(be), se(), (t) => new be(t)), Lh = su([se(), Ge("base64")]), uu = Js(ru(xe.Buffer), Lh, (t) => xe.Buffer.from(t[0], "base64"));
|
|
16994
16994
|
function Ph(t) {
|
|
@@ -17524,50 +17524,50 @@ Q({
|
|
|
17524
17524
|
Object.freeze({
|
|
17525
17525
|
CreateLookupTable: {
|
|
17526
17526
|
index: 0,
|
|
17527
|
-
layout:
|
|
17527
|
+
layout: B.struct([B.u32("instruction"), Vr("recentSlot"), B.u8("bumpSeed")])
|
|
17528
17528
|
},
|
|
17529
17529
|
FreezeLookupTable: {
|
|
17530
17530
|
index: 1,
|
|
17531
|
-
layout:
|
|
17531
|
+
layout: B.struct([B.u32("instruction")])
|
|
17532
17532
|
},
|
|
17533
17533
|
ExtendLookupTable: {
|
|
17534
17534
|
index: 2,
|
|
17535
|
-
layout:
|
|
17535
|
+
layout: B.struct([B.u32("instruction"), Vr(), B.seq(Se(), B.offset(B.u32(), -8), "addresses")])
|
|
17536
17536
|
},
|
|
17537
17537
|
DeactivateLookupTable: {
|
|
17538
17538
|
index: 3,
|
|
17539
|
-
layout:
|
|
17539
|
+
layout: B.struct([B.u32("instruction")])
|
|
17540
17540
|
},
|
|
17541
17541
|
CloseLookupTable: {
|
|
17542
17542
|
index: 4,
|
|
17543
|
-
layout:
|
|
17543
|
+
layout: B.struct([B.u32("instruction")])
|
|
17544
17544
|
}
|
|
17545
17545
|
});
|
|
17546
17546
|
new be("AddressLookupTab1e1111111111111111111111111");
|
|
17547
17547
|
Object.freeze({
|
|
17548
17548
|
RequestUnits: {
|
|
17549
17549
|
index: 0,
|
|
17550
|
-
layout:
|
|
17550
|
+
layout: B.struct([B.u8("instruction"), B.u32("units"), B.u32("additionalFee")])
|
|
17551
17551
|
},
|
|
17552
17552
|
RequestHeapFrame: {
|
|
17553
17553
|
index: 1,
|
|
17554
|
-
layout:
|
|
17554
|
+
layout: B.struct([B.u8("instruction"), B.u32("bytes")])
|
|
17555
17555
|
},
|
|
17556
17556
|
SetComputeUnitLimit: {
|
|
17557
17557
|
index: 2,
|
|
17558
|
-
layout:
|
|
17558
|
+
layout: B.struct([B.u8("instruction"), B.u32("units")])
|
|
17559
17559
|
},
|
|
17560
17560
|
SetComputeUnitPrice: {
|
|
17561
17561
|
index: 3,
|
|
17562
|
-
layout:
|
|
17562
|
+
layout: B.struct([B.u8("instruction"), Vr("microLamports")])
|
|
17563
17563
|
}
|
|
17564
17564
|
});
|
|
17565
17565
|
new be("ComputeBudget111111111111111111111111111111");
|
|
17566
|
-
|
|
17566
|
+
B.struct([B.u8("numSignatures"), B.u8("padding"), B.u16("signatureOffset"), B.u16("signatureInstructionIndex"), B.u16("publicKeyOffset"), B.u16("publicKeyInstructionIndex"), B.u16("messageDataOffset"), B.u16("messageDataSize"), B.u16("messageInstructionIndex")]);
|
|
17567
17567
|
new be("Ed25519SigVerify111111111111111111111111111");
|
|
17568
17568
|
Gc.utils.isValidPrivateKey;
|
|
17569
17569
|
Gc.getPublicKey;
|
|
17570
|
-
|
|
17570
|
+
B.struct([B.u8("numSignatures"), B.u16("signatureOffset"), B.u8("signatureInstructionIndex"), B.u16("ethAddressOffset"), B.u8("ethAddressInstructionIndex"), B.u16("messageDataOffset"), B.u16("messageDataSize"), B.u8("messageInstructionIndex"), B.blob(20, "ethAddress"), B.blob(64, "signature"), B.u8("recoveryId")]);
|
|
17571
17571
|
new be("KeccakSecp256k11111111111111111111111111111");
|
|
17572
17572
|
var Hh;
|
|
17573
17573
|
new be("StakeConfig11111111111111111111111111111111");
|
|
@@ -17587,58 +17587,58 @@ qh.default = new Hh(0, 0, be.default);
|
|
|
17587
17587
|
Object.freeze({
|
|
17588
17588
|
Initialize: {
|
|
17589
17589
|
index: 0,
|
|
17590
|
-
layout:
|
|
17590
|
+
layout: B.struct([B.u32("instruction"), MA(), BA()])
|
|
17591
17591
|
},
|
|
17592
17592
|
Authorize: {
|
|
17593
17593
|
index: 1,
|
|
17594
|
-
layout:
|
|
17594
|
+
layout: B.struct([B.u32("instruction"), Se("newAuthorized"), B.u32("stakeAuthorizationType")])
|
|
17595
17595
|
},
|
|
17596
17596
|
Delegate: {
|
|
17597
17597
|
index: 2,
|
|
17598
|
-
layout:
|
|
17598
|
+
layout: B.struct([B.u32("instruction")])
|
|
17599
17599
|
},
|
|
17600
17600
|
Split: {
|
|
17601
17601
|
index: 3,
|
|
17602
|
-
layout:
|
|
17602
|
+
layout: B.struct([B.u32("instruction"), B.ns64("lamports")])
|
|
17603
17603
|
},
|
|
17604
17604
|
Withdraw: {
|
|
17605
17605
|
index: 4,
|
|
17606
|
-
layout:
|
|
17606
|
+
layout: B.struct([B.u32("instruction"), B.ns64("lamports")])
|
|
17607
17607
|
},
|
|
17608
17608
|
Deactivate: {
|
|
17609
17609
|
index: 5,
|
|
17610
|
-
layout:
|
|
17610
|
+
layout: B.struct([B.u32("instruction")])
|
|
17611
17611
|
},
|
|
17612
17612
|
Merge: {
|
|
17613
17613
|
index: 7,
|
|
17614
|
-
layout:
|
|
17614
|
+
layout: B.struct([B.u32("instruction")])
|
|
17615
17615
|
},
|
|
17616
17616
|
AuthorizeWithSeed: {
|
|
17617
17617
|
index: 8,
|
|
17618
|
-
layout:
|
|
17618
|
+
layout: B.struct([B.u32("instruction"), Se("newAuthorized"), B.u32("stakeAuthorizationType"), Sr("authoritySeed"), Se("authorityOwner")])
|
|
17619
17619
|
}
|
|
17620
17620
|
});
|
|
17621
17621
|
new be("Stake11111111111111111111111111111111111111");
|
|
17622
17622
|
Object.freeze({
|
|
17623
17623
|
InitializeAccount: {
|
|
17624
17624
|
index: 0,
|
|
17625
|
-
layout:
|
|
17625
|
+
layout: B.struct([B.u32("instruction"), kA()])
|
|
17626
17626
|
},
|
|
17627
17627
|
Authorize: {
|
|
17628
17628
|
index: 1,
|
|
17629
|
-
layout:
|
|
17629
|
+
layout: B.struct([B.u32("instruction"), Se("newAuthorized"), B.u32("voteAuthorizationType")])
|
|
17630
17630
|
},
|
|
17631
17631
|
Withdraw: {
|
|
17632
17632
|
index: 3,
|
|
17633
|
-
layout:
|
|
17633
|
+
layout: B.struct([B.u32("instruction"), B.ns64("lamports")])
|
|
17634
17634
|
},
|
|
17635
17635
|
UpdateValidatorIdentity: {
|
|
17636
17636
|
index: 4,
|
|
17637
|
-
layout:
|
|
17637
|
+
layout: B.struct([B.u32("instruction")])
|
|
17638
17638
|
},
|
|
17639
17639
|
AuthorizeWithSeed: {
|
|
17640
17640
|
index: 10,
|
|
17641
|
-
layout:
|
|
17641
|
+
layout: B.struct([B.u32("instruction"), LA()])
|
|
17642
17642
|
}
|
|
17643
17643
|
});
|
|
17644
17644
|
new be("Vote111111111111111111111111111111111111111");
|
|
@@ -17651,23 +17651,23 @@ Q({
|
|
|
17651
17651
|
keybaseUsername: fe(se())
|
|
17652
17652
|
});
|
|
17653
17653
|
new be("Vote111111111111111111111111111111111111111");
|
|
17654
|
-
|
|
17654
|
+
B.struct([
|
|
17655
17655
|
Se("nodePubkey"),
|
|
17656
17656
|
Se("authorizedWithdrawer"),
|
|
17657
|
-
|
|
17658
|
-
|
|
17657
|
+
B.u8("commission"),
|
|
17658
|
+
B.nu64(),
|
|
17659
17659
|
// votes.length
|
|
17660
|
-
|
|
17661
|
-
|
|
17662
|
-
|
|
17663
|
-
|
|
17660
|
+
B.seq(B.struct([B.nu64("slot"), B.u32("confirmationCount")]), B.offset(B.u32(), -8), "votes"),
|
|
17661
|
+
B.u8("rootSlotValid"),
|
|
17662
|
+
B.nu64("rootSlot"),
|
|
17663
|
+
B.nu64(),
|
|
17664
17664
|
// authorizedVoters.length
|
|
17665
|
-
|
|
17666
|
-
|
|
17667
|
-
|
|
17665
|
+
B.seq(B.struct([B.nu64("epoch"), Se("authorizedVoter")]), B.offset(B.u32(), -8), "authorizedVoters"),
|
|
17666
|
+
B.struct([B.seq(B.struct([Se("authorizedPubkey"), B.nu64("epochOfLastAuthorizedSwitch"), B.nu64("targetEpoch")]), 32, "buf"), B.nu64("idx"), B.u8("isEmpty")], "priorVoters"),
|
|
17667
|
+
B.nu64(),
|
|
17668
17668
|
// epochCredits.length
|
|
17669
|
-
|
|
17670
|
-
|
|
17669
|
+
B.seq(B.struct([B.nu64("epoch"), B.nu64("credits"), B.nu64("prevCredits")]), B.offset(B.u32(), -8), "epochCredits"),
|
|
17670
|
+
B.struct([B.nu64("slot"), B.nu64("timestamp")], "lastTimestamp")
|
|
17671
17671
|
]);
|
|
17672
17672
|
const cx = (t) => ({
|
|
17673
17673
|
request: t,
|
|
@@ -19736,19 +19736,19 @@ function e2(t) {
|
|
|
19736
19736
|
sessionToken: x,
|
|
19737
19737
|
farcasterMiniApp: O,
|
|
19738
19738
|
wagmiConfig: N
|
|
19739
|
-
} = t, [F,
|
|
19739
|
+
} = t, [F, M] = Sn(0), [k, K] = Sn(""), [Y, V] = Sn(null), [L, z] = Sn(!1), J = wi(null), te = wi(!1);
|
|
19740
19740
|
un(() => {
|
|
19741
|
-
const
|
|
19742
|
-
if (
|
|
19741
|
+
const C = n?.theme;
|
|
19742
|
+
if (C === "dark") {
|
|
19743
19743
|
z(!0);
|
|
19744
19744
|
return;
|
|
19745
19745
|
}
|
|
19746
|
-
if (
|
|
19746
|
+
if (C === "light") {
|
|
19747
19747
|
z(!1);
|
|
19748
19748
|
return;
|
|
19749
19749
|
}
|
|
19750
|
-
const
|
|
19751
|
-
return
|
|
19750
|
+
const P = window.matchMedia("(prefers-color-scheme: dark)"), j = () => z(P.matches);
|
|
19751
|
+
return j(), P.addEventListener("change", j), () => P.removeEventListener("change", j);
|
|
19752
19752
|
}, [n?.theme]), Me.config({
|
|
19753
19753
|
api_key: "",
|
|
19754
19754
|
// @ts-expect-error
|
|
@@ -19756,121 +19756,126 @@ function e2(t) {
|
|
|
19756
19756
|
}), un(() => {
|
|
19757
19757
|
K(Me.getPayModalUrl(e));
|
|
19758
19758
|
}, [e]), un(() => {
|
|
19759
|
-
const
|
|
19760
|
-
if (!
|
|
19759
|
+
const C = n?.theme;
|
|
19760
|
+
if (!C || fT.includes(C)) {
|
|
19761
19761
|
V(null);
|
|
19762
19762
|
return;
|
|
19763
19763
|
}
|
|
19764
|
-
let
|
|
19764
|
+
let P = !1;
|
|
19765
19765
|
return (async () => {
|
|
19766
19766
|
try {
|
|
19767
|
-
const
|
|
19768
|
-
if (!
|
|
19769
|
-
const
|
|
19770
|
-
!
|
|
19771
|
-
} catch (
|
|
19772
|
-
console.error("Failed to fetch theme:",
|
|
19767
|
+
const E = Me.getBaseUrl(), c = await fetch(`${E}/themes/${C}`);
|
|
19768
|
+
if (!c.ok) return;
|
|
19769
|
+
const h = await c.json();
|
|
19770
|
+
!P && h.status === "approved" && h.cssContent && V(h.cssContent);
|
|
19771
|
+
} catch (E) {
|
|
19772
|
+
console.error("Failed to fetch theme:", E);
|
|
19773
19773
|
}
|
|
19774
19774
|
})(), () => {
|
|
19775
|
-
|
|
19775
|
+
P = !0;
|
|
19776
19776
|
};
|
|
19777
19777
|
}, [n?.theme]), un(() => {
|
|
19778
|
-
const
|
|
19779
|
-
s ? (document.body.style.overflow = "hidden", document.body.style.overflow = "hidden") : document.body.style.overflow =
|
|
19780
|
-
const
|
|
19781
|
-
if (
|
|
19778
|
+
const C = document.body.style.overflow;
|
|
19779
|
+
s ? (document.body.style.overflow = "hidden", document.body.style.overflow = "hidden") : document.body.style.overflow = C || "";
|
|
19780
|
+
const P = async (j) => {
|
|
19781
|
+
if (j.data === dn.CLOSED && (a(), d?.()), j?.data?.type === dn.COMPLETED) {
|
|
19782
19782
|
window.setTimeout(a, 2e3);
|
|
19783
|
-
const
|
|
19784
|
-
transactionHash:
|
|
19783
|
+
const h = j?.data?.transactionHash ? {
|
|
19784
|
+
transactionHash: j.data.transactionHash
|
|
19785
19785
|
} : void 0;
|
|
19786
|
-
m?.(
|
|
19786
|
+
m?.(h);
|
|
19787
19787
|
}
|
|
19788
|
-
if (
|
|
19788
|
+
if (j.data === dn.REQUEST_FARCASTER_CONNECT)
|
|
19789
19789
|
try {
|
|
19790
19790
|
await aT(J, N, O);
|
|
19791
|
-
} catch (
|
|
19792
|
-
console.error(
|
|
19791
|
+
} catch (h) {
|
|
19792
|
+
console.error(h);
|
|
19793
19793
|
}
|
|
19794
|
-
if (
|
|
19794
|
+
if (j.data === dn.REQUEST_FARCASTER_DISCONNECT)
|
|
19795
19795
|
try {
|
|
19796
19796
|
await cT(J, N, O);
|
|
19797
|
-
} catch (
|
|
19798
|
-
console.error(
|
|
19797
|
+
} catch (h) {
|
|
19798
|
+
console.error(h);
|
|
19799
19799
|
}
|
|
19800
|
-
const
|
|
19801
|
-
if (
|
|
19800
|
+
const c = j.data;
|
|
19801
|
+
if (c?.type === dn.REQUEST_FARCASTER_SEND_TRANSACTION && typeof c.requestId == "string" && c.params)
|
|
19802
19802
|
try {
|
|
19803
|
-
const
|
|
19804
|
-
|
|
19803
|
+
const h = await uT(c.params, N, O, J.current, c.requestId);
|
|
19804
|
+
h ? [hi, pi].forEach((y) => {
|
|
19805
19805
|
J.current?.contentWindow?.postMessage({
|
|
19806
19806
|
type: dn.FARCASTER_SEND_TRANSACTION_RESULT,
|
|
19807
|
-
requestId:
|
|
19808
|
-
hash:
|
|
19809
|
-
},
|
|
19810
|
-
}) : [hi, pi].forEach((
|
|
19807
|
+
requestId: c.requestId,
|
|
19808
|
+
hash: h
|
|
19809
|
+
}, y);
|
|
19810
|
+
}) : [hi, pi].forEach((y) => {
|
|
19811
19811
|
J.current?.contentWindow?.postMessage({
|
|
19812
19812
|
type: dn.FARCASTER_SEND_TRANSACTION_RESULT,
|
|
19813
|
-
requestId:
|
|
19813
|
+
requestId: c.requestId,
|
|
19814
19814
|
error: "sendTransaction not configured or returned no hash"
|
|
19815
|
-
},
|
|
19815
|
+
}, y);
|
|
19816
19816
|
});
|
|
19817
|
-
} catch (
|
|
19818
|
-
console.log(
|
|
19817
|
+
} catch (h) {
|
|
19818
|
+
console.log(h);
|
|
19819
19819
|
}
|
|
19820
19820
|
};
|
|
19821
|
-
return window.addEventListener("message",
|
|
19822
|
-
document.body.style.overflow =
|
|
19821
|
+
return window.addEventListener("message", P), () => {
|
|
19822
|
+
document.body.style.overflow = C || "", window.removeEventListener("message", P);
|
|
19823
19823
|
};
|
|
19824
19824
|
}, [s, d, m, a, O, N]), un(() => {
|
|
19825
19825
|
if (!x) return;
|
|
19826
|
-
const
|
|
19827
|
-
const
|
|
19826
|
+
const C = t.css || Y || void 0, P = async () => {
|
|
19827
|
+
const E = await f0.isInMiniApp(), c = r?.map(iT) || [], h = N ? dT(N) : void 0;
|
|
19828
19828
|
return {
|
|
19829
19829
|
type: "session",
|
|
19830
19830
|
session_token: x,
|
|
19831
19831
|
environment: Me.getEnv() || yc.PRODUCTION,
|
|
19832
19832
|
styles: n,
|
|
19833
19833
|
props: {
|
|
19834
|
-
excludeChains:
|
|
19835
|
-
isFarcasterMiniApp:
|
|
19836
|
-
...
|
|
19837
|
-
supportedChains:
|
|
19834
|
+
excludeChains: c.join(","),
|
|
19835
|
+
isFarcasterMiniApp: E,
|
|
19836
|
+
...h?.length ? {
|
|
19837
|
+
supportedChains: h
|
|
19838
19838
|
} : {}
|
|
19839
19839
|
},
|
|
19840
|
-
...
|
|
19841
|
-
css:
|
|
19840
|
+
...C ? {
|
|
19841
|
+
css: C
|
|
19842
19842
|
} : {}
|
|
19843
19843
|
};
|
|
19844
19844
|
};
|
|
19845
|
-
let
|
|
19846
|
-
return
|
|
19847
|
-
|
|
19848
|
-
J.current?.contentWindow?.postMessage(
|
|
19845
|
+
let j = !1;
|
|
19846
|
+
return P().then((E) => {
|
|
19847
|
+
j || ([hi, pi].forEach((c) => {
|
|
19848
|
+
J.current?.contentWindow?.postMessage(E, c);
|
|
19849
19849
|
}), window.setTimeout(() => {
|
|
19850
|
-
|
|
19851
|
-
J.current?.contentWindow?.postMessage(
|
|
19850
|
+
j || [hi, pi].forEach((c) => {
|
|
19851
|
+
J.current?.contentWindow?.postMessage(E, c);
|
|
19852
19852
|
});
|
|
19853
19853
|
}, 1e3));
|
|
19854
19854
|
}), () => {
|
|
19855
|
-
|
|
19855
|
+
j = !0;
|
|
19856
19856
|
};
|
|
19857
19857
|
}, [x, F, s, n, Y]), un(() => {
|
|
19858
19858
|
if (!s) return;
|
|
19859
|
-
const
|
|
19860
|
-
C
|
|
19859
|
+
const C = te.current;
|
|
19860
|
+
M(C ? Math.random() : 0);
|
|
19861
19861
|
}, [s]);
|
|
19862
19862
|
function ne() {
|
|
19863
|
-
te.current = !0,
|
|
19863
|
+
te.current = !0, M(Math.random());
|
|
19864
19864
|
}
|
|
19865
19865
|
un(() => {
|
|
19866
|
-
const
|
|
19867
|
-
|
|
19866
|
+
const C = document.querySelector(".payment-modal-loader-container"), P = document.querySelector(".payment-modal-loader-logo");
|
|
19867
|
+
C.style.opacity = "1", C.style.transform = "translateX(-50%)", P.style.opacity = "1", P.style.transform = "scale(1)", P.style.filter = "blur(0px)";
|
|
19868
19868
|
}, []);
|
|
19869
|
-
const q = F === 0 || i
|
|
19869
|
+
const q = F === 0 || i;
|
|
19870
19870
|
return /* @__PURE__ */ Oa("div", {
|
|
19871
19871
|
className: Ko("payment-modal-wrapper", s ? "open" : "closed"),
|
|
19872
19872
|
children: [/* @__PURE__ */ En("div", {
|
|
19873
|
-
className: Ko(
|
|
19873
|
+
className: Ko(
|
|
19874
|
+
"payment-modal-loader-container",
|
|
19875
|
+
L ? "dark-mode" : "light-mode",
|
|
19876
|
+
// hasAmount ? "has-amount" : "no-amount",
|
|
19877
|
+
"no-amount"
|
|
19878
|
+
),
|
|
19874
19879
|
children: /* @__PURE__ */ En(lT, {})
|
|
19875
19880
|
}), /* @__PURE__ */ En("iframe", {
|
|
19876
19881
|
allow: "clipboard-read *; clipboard-write *",
|
|
@@ -20095,8 +20100,8 @@ function B0(t = {}) {
|
|
|
20095
20100
|
s
|
|
20096
20101
|
), F = RT(t, N);
|
|
20097
20102
|
no.set(t, F);
|
|
20098
|
-
const
|
|
20099
|
-
return ur.set(F,
|
|
20103
|
+
const M = [t, o, x];
|
|
20104
|
+
return ur.set(F, M), Reflect.ownKeys(t).forEach((k) => {
|
|
20100
20105
|
const K = Object.getOwnPropertyDescriptor(
|
|
20101
20106
|
t,
|
|
20102
20107
|
k
|
|
@@ -20189,15 +20194,15 @@ function t2({
|
|
|
20189
20194
|
a(!1);
|
|
20190
20195
|
}
|
|
20191
20196
|
const F = () => {
|
|
20192
|
-
const
|
|
20197
|
+
const M = Date.now();
|
|
20193
20198
|
Ln.isPending = !0, Ln.error = null, Ln.data = null, fetch(t, {
|
|
20194
20199
|
headers: {
|
|
20195
20200
|
"Content-Type": "application/json"
|
|
20196
20201
|
}
|
|
20197
20202
|
}).then((k) => k.json()).then((k) => {
|
|
20198
|
-
|
|
20203
|
+
M < d || (Ln.data = k, Ln.isPending = !1, m(M));
|
|
20199
20204
|
}).catch((k) => {
|
|
20200
|
-
|
|
20205
|
+
M < d || (Ln.error = k?.toString(), Ln.isPending = !1, m(M), setInterval(F, 5e3));
|
|
20201
20206
|
});
|
|
20202
20207
|
};
|
|
20203
20208
|
return un(() => {
|
|
@@ -20228,10 +20233,10 @@ function n2({
|
|
|
20228
20233
|
}) {
|
|
20229
20234
|
const [o, a] = Sn(!1), [d, m] = Sn(t), [g, x] = Sn(e);
|
|
20230
20235
|
function O({
|
|
20231
|
-
sessionToken:
|
|
20236
|
+
sessionToken: M,
|
|
20232
20237
|
amount: k
|
|
20233
20238
|
}) {
|
|
20234
|
-
m(
|
|
20239
|
+
m(M), x(k);
|
|
20235
20240
|
}
|
|
20236
20241
|
un(() => {
|
|
20237
20242
|
m(t);
|