@prosopo/client-bundle-example 2.5.5 → 2.8.0
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/CHANGELOG.md +23 -0
- package/dist/assets/ProcaptchaWidget-DrBDhP6X.js +636 -0
- package/dist/assets/ProcaptchaWidget-rAM-9Rap.js +360 -0
- package/dist/assets/Signer-DP9drQ55.js +23 -0
- package/dist/assets/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/assets/asU8a-CJdNkNEq.js +9 -0
- package/dist/assets/bip39-Du2cANEV.js +365 -0
- package/dist/assets/browser-ponyfill-Dy1JBTMg.js +339 -0
- package/dist/assets/captcha-BhkVCEXM.css +1 -0
- package/dist/assets/captchaComponentProvider-DmV1WTrT.js +1242 -0
- package/dist/assets/captchaRenderer-RIsSZXCC.js +70 -0
- package/dist/assets/components.d.ts +5 -0
- package/dist/assets/components.d.ts.map +1 -0
- package/dist/assets/emotion-element-5486c51c.browser.esm-C3u8NMUC.js +1807 -0
- package/dist/assets/fp.esm-DYWeNGcH.js +1654 -0
- package/dist/assets/frictionless-explicit-Dq_sNGRK.js +1 -0
- package/dist/assets/frictionless-implicit-Dq_sNGRK.js +1 -0
- package/dist/assets/hash-_rWungeW.js +1268 -0
- package/dist/assets/i18nFrontend-CsPT71ro.js +2273 -0
- package/dist/assets/image-explicit-DQvfVB7-.js +4 -0
- package/dist/assets/image-implicit-Bwa9QJO5.js +1 -0
- package/dist/assets/index-BVr9fC_3.js +4386 -0
- package/dist/assets/index-BjRdPnnE.js +1198 -0
- package/dist/assets/index-Cu5oL_7b.js +81 -0
- package/dist/assets/index-Dpt_5E72.js +1 -0
- package/dist/assets/index-DxIFpl6U.js +5416 -0
- package/dist/assets/index-QVME9Prx.js +32 -0
- package/dist/assets/index-Wgw2GQWq.js +596 -0
- package/dist/assets/index.d.ts +16 -0
- package/dist/assets/index.d.ts.map +1 -0
- package/dist/assets/invisible-frictionless-explicit-DugBtRe4.js +4 -0
- package/dist/assets/invisible-frictionless-implicit-DYYos8W9.js +1 -0
- package/dist/assets/invisible-image-explicit-C5Z4gSb1.js +4 -0
- package/dist/assets/invisible-image-implicit-DfNFNlFj.js +1 -0
- package/dist/assets/invisible-pow-explicit-DjqGWFUb.js +4 -0
- package/dist/assets/invisible-pow-implicit-BRXL14FH.js +4 -0
- package/dist/assets/locales/ar/translation.json +56 -0
- package/dist/assets/locales/az/translation.json +56 -0
- package/dist/assets/locales/cs/translation.json +56 -0
- package/dist/assets/locales/de/translation.json +56 -0
- package/dist/assets/locales/el/translation.json +56 -0
- package/dist/assets/locales/en/translation.json +56 -0
- package/dist/assets/locales/es/translation.json +56 -0
- package/dist/assets/locales/fi/translation.json +56 -0
- package/dist/assets/locales/fr/translation.json +56 -0
- package/dist/assets/locales/hi/translation.json +56 -0
- package/dist/assets/locales/hu/translation.json +56 -0
- package/dist/assets/locales/id/translation.json +56 -0
- package/dist/assets/locales/it/translation.json +56 -0
- package/dist/assets/locales/ja/translation.json +56 -0
- package/dist/assets/locales/jv/translation.json +56 -0
- package/dist/assets/locales/ko/translation.json +56 -0
- package/dist/assets/locales/ml/translation.json +56 -0
- package/dist/assets/locales/ms/translation.json +56 -0
- package/dist/assets/locales/nl/translation.json +56 -0
- package/dist/assets/locales/no/translation.json +56 -0
- package/dist/assets/locales/pl/translation.json +56 -0
- package/dist/assets/locales/pt/translation.json +56 -0
- package/dist/assets/locales/pt-br/translation.json +56 -0
- package/dist/assets/locales/ro/translation.json +56 -0
- package/dist/assets/locales/ru/translation.json +56 -0
- package/dist/assets/locales/sr/translation.json +56 -0
- package/dist/assets/locales/sv/translation.json +56 -0
- package/dist/assets/locales/th/translation.json +56 -0
- package/dist/assets/locales/tr/translation.json +56 -0
- package/dist/assets/locales/uk/translation.json +56 -0
- package/dist/assets/locales/vi/translation.json +56 -0
- package/dist/assets/locales/zh-cn/translation.json +56 -0
- package/dist/assets/pow-explicit-BexxbnHM.js +4 -0
- package/dist/assets/pow-implicit-Dpt_5E72.js +1 -0
- package/dist/assets/procaptcha.bundle.js +7 -0
- package/dist/assets/spread-DEmVz7RJ.js +15 -0
- package/dist/assets/tests/util/captchaType.test.d.ts +2 -0
- package/dist/assets/tests/util/captchaType.test.d.ts.map +1 -0
- package/dist/assets/tests/util/config.test.d.ts +2 -0
- package/dist/assets/tests/util/config.test.d.ts.map +1 -0
- package/dist/assets/tests/util/renderLogic.test.d.ts +2 -0
- package/dist/assets/tests/util/renderLogic.test.d.ts.map +1 -0
- package/dist/assets/toU8a-C68WUzs_.js +24 -0
- package/dist/assets/translations-DEL070wJ.js +2918 -0
- package/dist/assets/useTranslation-CJplXtqb.js +158 -0
- package/dist/assets/util/captcha/captchaComponentProvider.d.ts +8 -0
- package/dist/assets/util/captcha/captchaComponentProvider.d.ts.map +1 -0
- package/dist/assets/util/captcha/captchaComponentsList.d.ts +6 -0
- package/dist/assets/util/captcha/captchaComponentsList.d.ts.map +1 -0
- package/dist/assets/util/captcha/captchaProps.d.ts +9 -0
- package/dist/assets/util/captcha/captchaProps.d.ts.map +1 -0
- package/dist/assets/util/captcha/captchaRenderer.d.ts +24 -0
- package/dist/assets/util/captcha/captchaRenderer.d.ts.map +1 -0
- package/dist/assets/util/captcha/captchaType.d.ts +2 -0
- package/dist/assets/util/captcha/captchaType.d.ts.map +1 -0
- package/dist/assets/util/captcha/components/frictionlessCaptcha.d.ts +4 -0
- package/dist/assets/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -0
- package/dist/assets/util/captcha/components/imageCaptcha.d.ts +4 -0
- package/dist/assets/util/captcha/components/imageCaptcha.d.ts.map +1 -0
- package/dist/assets/util/captcha/components/powCaptcha.d.ts +4 -0
- package/dist/assets/util/captcha/components/powCaptcha.d.ts.map +1 -0
- package/dist/assets/util/config.d.ts +6 -0
- package/dist/assets/util/config.d.ts.map +1 -0
- package/dist/assets/util/configCreator.d.ts +5 -0
- package/dist/assets/util/configCreator.d.ts.map +1 -0
- package/dist/assets/util/language.d.ts +3 -0
- package/dist/assets/util/language.d.ts.map +1 -0
- package/dist/assets/util/timeout.d.ts +3 -0
- package/dist/assets/util/timeout.d.ts.map +1 -0
- package/dist/assets/util/widgetFactory.d.ts +18 -0
- package/dist/assets/util/widgetFactory.d.ts.map +1 -0
- package/dist/assets/util/widgetThemeResolver.d.ts +9 -0
- package/dist/assets/util/widgetThemeResolver.d.ts.map +1 -0
- package/dist/frictionless-explicit.html +881 -0
- package/dist/frictionless-implicit.html +874 -0
- package/dist/image-explicit.html +877 -0
- package/dist/index.html +575 -74
- package/dist/invisible-frictionless-explicit.html +626 -283
- package/dist/invisible-frictionless-implicit.html +631 -173
- package/dist/invisible-image-explicit.html +627 -284
- package/dist/invisible-image-implicit.html +631 -173
- package/dist/invisible-pow-explicit.html +627 -284
- package/dist/invisible-pow-implicit.html +629 -177
- package/dist/plugins/explanation-injector.ts +250 -0
- package/dist/plugins/form-filler-injector.ts +233 -0
- package/dist/plugins/navigation-injector.ts +237 -89
- package/dist/plugins/status-log-injector.ts +199 -0
- package/dist/pow-explicit.html +877 -0
- package/dist/pow-implicit.html +881 -0
- package/package.json +7 -2
- package/vite.config.ts +32 -3
- package/dist/assets/captchaType-CYBmmAZe.js +0 -1
- package/dist/assets/frictionless-BVSPLzWe.js +0 -1
- package/dist/assets/index-BWsu-rGU.js +0 -1
- package/dist/assets/invisible-frictionless-explicit-DgCaJtPg.js +0 -1
- package/dist/assets/invisible-image-explicit-DgCaJtPg.js +0 -1
- package/dist/assets/invisible-pow-explicit-DgCaJtPg.js +0 -1
- package/dist/assets/pow-O0V5Dqo9.js +0 -1
- package/dist/frictionless.html +0 -344
- package/dist/pow.html +0 -324
- /package/dist/assets/{modulepreload-polyfill-B5Qt9EMX.js → captcha-ByKnSsbG.js} +0 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { D as X, C as ue, a6 as Z, a7 as j, M as D, a8 as Ze, a9 as g, aa as ea, ab as w, ac as be, ad as pe, ae as H, af as fe, ag as me, ah as ge, ai as ye, aj as B, ak as U, al as $, am as C, an as q, ao as N, ap as xe, aq as we, H as ve, ar as ee, J as ke, I as R, K as He, as as Ae, a3 as Ie, j as V, at as J, u as W, au as je, l as Ee, i as Se, av as ze, S as Be, aw as Ce, ax as De } from "./hash-_rWungeW.js";
|
|
2
|
+
import { a as Le } from "./asU8a-CJdNkNEq.js";
|
|
3
|
+
import { s as Y } from "./toU8a-C68WUzs_.js";
|
|
4
|
+
const _e = /* @__PURE__ */ Uint32Array.from([
|
|
5
|
+
1116352408,
|
|
6
|
+
1899447441,
|
|
7
|
+
3049323471,
|
|
8
|
+
3921009573,
|
|
9
|
+
961987163,
|
|
10
|
+
1508970993,
|
|
11
|
+
2453635748,
|
|
12
|
+
2870763221,
|
|
13
|
+
3624381080,
|
|
14
|
+
310598401,
|
|
15
|
+
607225278,
|
|
16
|
+
1426881987,
|
|
17
|
+
1925078388,
|
|
18
|
+
2162078206,
|
|
19
|
+
2614888103,
|
|
20
|
+
3248222580,
|
|
21
|
+
3835390401,
|
|
22
|
+
4022224774,
|
|
23
|
+
264347078,
|
|
24
|
+
604807628,
|
|
25
|
+
770255983,
|
|
26
|
+
1249150122,
|
|
27
|
+
1555081692,
|
|
28
|
+
1996064986,
|
|
29
|
+
2554220882,
|
|
30
|
+
2821834349,
|
|
31
|
+
2952996808,
|
|
32
|
+
3210313671,
|
|
33
|
+
3336571891,
|
|
34
|
+
3584528711,
|
|
35
|
+
113926993,
|
|
36
|
+
338241895,
|
|
37
|
+
666307205,
|
|
38
|
+
773529912,
|
|
39
|
+
1294757372,
|
|
40
|
+
1396182291,
|
|
41
|
+
1695183700,
|
|
42
|
+
1986661051,
|
|
43
|
+
2177026350,
|
|
44
|
+
2456956037,
|
|
45
|
+
2730485921,
|
|
46
|
+
2820302411,
|
|
47
|
+
3259730800,
|
|
48
|
+
3345764771,
|
|
49
|
+
3516065817,
|
|
50
|
+
3600352804,
|
|
51
|
+
4094571909,
|
|
52
|
+
275423344,
|
|
53
|
+
430227734,
|
|
54
|
+
506948616,
|
|
55
|
+
659060556,
|
|
56
|
+
883997877,
|
|
57
|
+
958139571,
|
|
58
|
+
1322822218,
|
|
59
|
+
1537002063,
|
|
60
|
+
1747873779,
|
|
61
|
+
1955562222,
|
|
62
|
+
2024104815,
|
|
63
|
+
2227730452,
|
|
64
|
+
2361852424,
|
|
65
|
+
2428436474,
|
|
66
|
+
2756734187,
|
|
67
|
+
3204031479,
|
|
68
|
+
3329325298
|
|
69
|
+
]), E = /* @__PURE__ */ new Uint32Array(64);
|
|
70
|
+
class Fe extends Z {
|
|
71
|
+
constructor(e = 32) {
|
|
72
|
+
super(64, e, 8, !1), this.A = j[0] | 0, this.B = j[1] | 0, this.C = j[2] | 0, this.D = j[3] | 0, this.E = j[4] | 0, this.F = j[5] | 0, this.G = j[6] | 0, this.H = j[7] | 0;
|
|
73
|
+
}
|
|
74
|
+
get() {
|
|
75
|
+
const { A: e, B: c, C: a, D: t, E: s, F: i, G: o, H: l } = this;
|
|
76
|
+
return [e, c, a, t, s, i, o, l];
|
|
77
|
+
}
|
|
78
|
+
// prettier-ignore
|
|
79
|
+
set(e, c, a, t, s, i, o, l) {
|
|
80
|
+
this.A = e | 0, this.B = c | 0, this.C = a | 0, this.D = t | 0, this.E = s | 0, this.F = i | 0, this.G = o | 0, this.H = l | 0;
|
|
81
|
+
}
|
|
82
|
+
process(e, c) {
|
|
83
|
+
for (let r = 0; r < 16; r++, c += 4)
|
|
84
|
+
E[r] = e.getUint32(c, !1);
|
|
85
|
+
for (let r = 16; r < 64; r++) {
|
|
86
|
+
const h = E[r - 15], p = E[r - 2], m = w(h, 7) ^ w(h, 18) ^ h >>> 3, f = w(p, 17) ^ w(p, 19) ^ p >>> 10;
|
|
87
|
+
E[r] = f + E[r - 7] + m + E[r - 16] | 0;
|
|
88
|
+
}
|
|
89
|
+
let { A: a, B: t, C: s, D: i, E: o, F: l, G: d, H: b } = this;
|
|
90
|
+
for (let r = 0; r < 64; r++) {
|
|
91
|
+
const h = w(o, 6) ^ w(o, 11) ^ w(o, 25), p = b + h + me(o, l, d) + _e[r] + E[r] | 0, f = (w(a, 2) ^ w(a, 13) ^ w(a, 22)) + ge(a, t, s) | 0;
|
|
92
|
+
b = d, d = l, l = o, o = i + p | 0, i = s, s = t, t = a, a = p + f | 0;
|
|
93
|
+
}
|
|
94
|
+
a = a + this.A | 0, t = t + this.B | 0, s = s + this.C | 0, i = i + this.D | 0, o = o + this.E | 0, l = l + this.F | 0, d = d + this.G | 0, b = b + this.H | 0, this.set(a, t, s, i, o, l, d, b);
|
|
95
|
+
}
|
|
96
|
+
roundClean() {
|
|
97
|
+
D(E);
|
|
98
|
+
}
|
|
99
|
+
destroy() {
|
|
100
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0), D(this.buffer);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const ae = ue([
|
|
104
|
+
"0x428a2f98d728ae22",
|
|
105
|
+
"0x7137449123ef65cd",
|
|
106
|
+
"0xb5c0fbcfec4d3b2f",
|
|
107
|
+
"0xe9b5dba58189dbbc",
|
|
108
|
+
"0x3956c25bf348b538",
|
|
109
|
+
"0x59f111f1b605d019",
|
|
110
|
+
"0x923f82a4af194f9b",
|
|
111
|
+
"0xab1c5ed5da6d8118",
|
|
112
|
+
"0xd807aa98a3030242",
|
|
113
|
+
"0x12835b0145706fbe",
|
|
114
|
+
"0x243185be4ee4b28c",
|
|
115
|
+
"0x550c7dc3d5ffb4e2",
|
|
116
|
+
"0x72be5d74f27b896f",
|
|
117
|
+
"0x80deb1fe3b1696b1",
|
|
118
|
+
"0x9bdc06a725c71235",
|
|
119
|
+
"0xc19bf174cf692694",
|
|
120
|
+
"0xe49b69c19ef14ad2",
|
|
121
|
+
"0xefbe4786384f25e3",
|
|
122
|
+
"0x0fc19dc68b8cd5b5",
|
|
123
|
+
"0x240ca1cc77ac9c65",
|
|
124
|
+
"0x2de92c6f592b0275",
|
|
125
|
+
"0x4a7484aa6ea6e483",
|
|
126
|
+
"0x5cb0a9dcbd41fbd4",
|
|
127
|
+
"0x76f988da831153b5",
|
|
128
|
+
"0x983e5152ee66dfab",
|
|
129
|
+
"0xa831c66d2db43210",
|
|
130
|
+
"0xb00327c898fb213f",
|
|
131
|
+
"0xbf597fc7beef0ee4",
|
|
132
|
+
"0xc6e00bf33da88fc2",
|
|
133
|
+
"0xd5a79147930aa725",
|
|
134
|
+
"0x06ca6351e003826f",
|
|
135
|
+
"0x142929670a0e6e70",
|
|
136
|
+
"0x27b70a8546d22ffc",
|
|
137
|
+
"0x2e1b21385c26c926",
|
|
138
|
+
"0x4d2c6dfc5ac42aed",
|
|
139
|
+
"0x53380d139d95b3df",
|
|
140
|
+
"0x650a73548baf63de",
|
|
141
|
+
"0x766a0abb3c77b2a8",
|
|
142
|
+
"0x81c2c92e47edaee6",
|
|
143
|
+
"0x92722c851482353b",
|
|
144
|
+
"0xa2bfe8a14cf10364",
|
|
145
|
+
"0xa81a664bbc423001",
|
|
146
|
+
"0xc24b8b70d0f89791",
|
|
147
|
+
"0xc76c51a30654be30",
|
|
148
|
+
"0xd192e819d6ef5218",
|
|
149
|
+
"0xd69906245565a910",
|
|
150
|
+
"0xf40e35855771202a",
|
|
151
|
+
"0x106aa07032bbd1b8",
|
|
152
|
+
"0x19a4c116b8d2d0c8",
|
|
153
|
+
"0x1e376c085141ab53",
|
|
154
|
+
"0x2748774cdf8eeb99",
|
|
155
|
+
"0x34b0bcb5e19b48a8",
|
|
156
|
+
"0x391c0cb3c5c95a63",
|
|
157
|
+
"0x4ed8aa4ae3418acb",
|
|
158
|
+
"0x5b9cca4f7763e373",
|
|
159
|
+
"0x682e6ff3d6b2b8a3",
|
|
160
|
+
"0x748f82ee5defb2fc",
|
|
161
|
+
"0x78a5636f43172f60",
|
|
162
|
+
"0x84c87814a1f0ab72",
|
|
163
|
+
"0x8cc702081a6439ec",
|
|
164
|
+
"0x90befffa23631e28",
|
|
165
|
+
"0xa4506cebde82bde9",
|
|
166
|
+
"0xbef9a3f7b2c67915",
|
|
167
|
+
"0xc67178f2e372532b",
|
|
168
|
+
"0xca273eceea26619c",
|
|
169
|
+
"0xd186b8c721c0c207",
|
|
170
|
+
"0xeada7dd6cde0eb1e",
|
|
171
|
+
"0xf57d4f7fee6ed178",
|
|
172
|
+
"0x06f067aa72176fba",
|
|
173
|
+
"0x0a637dc5a2c898a6",
|
|
174
|
+
"0x113f9804bef90dae",
|
|
175
|
+
"0x1b710b35131c471b",
|
|
176
|
+
"0x28db77f523047d84",
|
|
177
|
+
"0x32caab7b40c72493",
|
|
178
|
+
"0x3c9ebe0a15c9bebc",
|
|
179
|
+
"0x431d67c49c100d4c",
|
|
180
|
+
"0x4cc5d4becb3e42b6",
|
|
181
|
+
"0x597f299cfc657e2a",
|
|
182
|
+
"0x5fcb6fab3ad6faec",
|
|
183
|
+
"0x6c44198c4a475817"
|
|
184
|
+
].map((n) => BigInt(n))), Ue = ae[0], qe = ae[1], S = /* @__PURE__ */ new Uint32Array(80), z = /* @__PURE__ */ new Uint32Array(80);
|
|
185
|
+
class Ge extends Z {
|
|
186
|
+
constructor(e = 64) {
|
|
187
|
+
super(128, e, 16, !1), this.Ah = g[0] | 0, this.Al = g[1] | 0, this.Bh = g[2] | 0, this.Bl = g[3] | 0, this.Ch = g[4] | 0, this.Cl = g[5] | 0, this.Dh = g[6] | 0, this.Dl = g[7] | 0, this.Eh = g[8] | 0, this.El = g[9] | 0, this.Fh = g[10] | 0, this.Fl = g[11] | 0, this.Gh = g[12] | 0, this.Gl = g[13] | 0, this.Hh = g[14] | 0, this.Hl = g[15] | 0;
|
|
188
|
+
}
|
|
189
|
+
// prettier-ignore
|
|
190
|
+
get() {
|
|
191
|
+
const { Ah: e, Al: c, Bh: a, Bl: t, Ch: s, Cl: i, Dh: o, Dl: l, Eh: d, El: b, Fh: r, Fl: h, Gh: p, Gl: m, Hh: f, Hl: y } = this;
|
|
192
|
+
return [e, c, a, t, s, i, o, l, d, b, r, h, p, m, f, y];
|
|
193
|
+
}
|
|
194
|
+
// prettier-ignore
|
|
195
|
+
set(e, c, a, t, s, i, o, l, d, b, r, h, p, m, f, y) {
|
|
196
|
+
this.Ah = e | 0, this.Al = c | 0, this.Bh = a | 0, this.Bl = t | 0, this.Ch = s | 0, this.Cl = i | 0, this.Dh = o | 0, this.Dl = l | 0, this.Eh = d | 0, this.El = b | 0, this.Fh = r | 0, this.Fl = h | 0, this.Gh = p | 0, this.Gl = m | 0, this.Hh = f | 0, this.Hl = y | 0;
|
|
197
|
+
}
|
|
198
|
+
process(e, c) {
|
|
199
|
+
for (let u = 0; u < 16; u++, c += 4)
|
|
200
|
+
S[u] = e.getUint32(c), z[u] = e.getUint32(c += 4);
|
|
201
|
+
for (let u = 16; u < 80; u++) {
|
|
202
|
+
const A = S[u - 15] | 0, I = z[u - 15] | 0, G = C(A, I, 1) ^ C(A, I, 8) ^ N(A, I, 7), T = B(A, I, 1) ^ B(A, I, 8) ^ $(A, I, 7), v = S[u - 2] | 0, k = z[u - 2] | 0, _ = C(v, k, 19) ^ q(v, k, 61) ^ N(v, k, 6), M = B(v, k, 19) ^ U(v, k, 61) ^ $(v, k, 6), F = be(T, M, z[u - 7], z[u - 16]), O = pe(F, G, _, S[u - 7], S[u - 16]);
|
|
203
|
+
S[u] = O | 0, z[u] = F | 0;
|
|
204
|
+
}
|
|
205
|
+
let { Ah: a, Al: t, Bh: s, Bl: i, Ch: o, Cl: l, Dh: d, Dl: b, Eh: r, El: h, Fh: p, Fl: m, Gh: f, Gl: y, Hh: x, Hl: L } = this;
|
|
206
|
+
for (let u = 0; u < 80; u++) {
|
|
207
|
+
const A = C(r, h, 14) ^ C(r, h, 18) ^ q(r, h, 41), I = B(r, h, 14) ^ B(r, h, 18) ^ U(r, h, 41), G = r & p ^ ~r & f, T = h & m ^ ~h & y, v = we(L, I, T, qe[u], z[u]), k = xe(v, x, A, G, Ue[u], S[u]), _ = v | 0, M = C(a, t, 28) ^ q(a, t, 34) ^ q(a, t, 39), F = B(a, t, 28) ^ U(a, t, 34) ^ U(a, t, 39), O = a & s ^ a & o ^ s & o, de = t & i ^ t & l ^ i & l;
|
|
208
|
+
x = f | 0, L = y | 0, f = p | 0, y = m | 0, p = r | 0, m = h | 0, { h: r, l: h } = H(d | 0, b | 0, k | 0, _ | 0), d = o | 0, b = l | 0, o = s | 0, l = i | 0, s = a | 0, i = t | 0;
|
|
209
|
+
const P = ye(_, F, de);
|
|
210
|
+
a = fe(P, k, M, O), t = P | 0;
|
|
211
|
+
}
|
|
212
|
+
({ h: a, l: t } = H(this.Ah | 0, this.Al | 0, a | 0, t | 0)), { h: s, l: i } = H(this.Bh | 0, this.Bl | 0, s | 0, i | 0), { h: o, l } = H(this.Ch | 0, this.Cl | 0, o | 0, l | 0), { h: d, l: b } = H(this.Dh | 0, this.Dl | 0, d | 0, b | 0), { h: r, l: h } = H(this.Eh | 0, this.El | 0, r | 0, h | 0), { h: p, l: m } = H(this.Fh | 0, this.Fl | 0, p | 0, m | 0), { h: f, l: y } = H(this.Gh | 0, this.Gl | 0, f | 0, y | 0), { h: x, l: L } = H(this.Hh | 0, this.Hl | 0, x | 0, L | 0), this.set(a, t, s, i, o, l, d, b, r, h, p, m, f, y, x, L);
|
|
213
|
+
}
|
|
214
|
+
roundClean() {
|
|
215
|
+
D(S, z);
|
|
216
|
+
}
|
|
217
|
+
destroy() {
|
|
218
|
+
D(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
const Te = /* @__PURE__ */ X(() => new Fe()), Me = /* @__PURE__ */ X(() => new Ge());
|
|
222
|
+
class te extends ve {
|
|
223
|
+
constructor(e, c) {
|
|
224
|
+
super(), this.finished = !1, this.destroyed = !1, ee(e);
|
|
225
|
+
const a = ke(c);
|
|
226
|
+
if (this.iHash = e.create(), typeof this.iHash.update != "function")
|
|
227
|
+
throw new Error("Expected instance of class which extends utils.Hash");
|
|
228
|
+
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
|
|
229
|
+
const t = this.blockLen, s = new Uint8Array(t);
|
|
230
|
+
s.set(a.length > t ? e.create().update(a).digest() : a);
|
|
231
|
+
for (let i = 0; i < s.length; i++)
|
|
232
|
+
s[i] ^= 54;
|
|
233
|
+
this.iHash.update(s), this.oHash = e.create();
|
|
234
|
+
for (let i = 0; i < s.length; i++)
|
|
235
|
+
s[i] ^= 106;
|
|
236
|
+
this.oHash.update(s), D(s);
|
|
237
|
+
}
|
|
238
|
+
update(e) {
|
|
239
|
+
return R(this), this.iHash.update(e), this;
|
|
240
|
+
}
|
|
241
|
+
digestInto(e) {
|
|
242
|
+
R(this), He(e, this.outputLen), this.finished = !0, this.iHash.digestInto(e), this.oHash.update(e), this.oHash.digestInto(e), this.destroy();
|
|
243
|
+
}
|
|
244
|
+
digest() {
|
|
245
|
+
const e = new Uint8Array(this.oHash.outputLen);
|
|
246
|
+
return this.digestInto(e), e;
|
|
247
|
+
}
|
|
248
|
+
_cloneInto(e) {
|
|
249
|
+
e || (e = Object.create(Object.getPrototypeOf(this), {}));
|
|
250
|
+
const { oHash: c, iHash: a, finished: t, destroyed: s, blockLen: i, outputLen: o } = this;
|
|
251
|
+
return e = e, e.finished = t, e.destroyed = s, e.blockLen = i, e.outputLen = o, e.oHash = c._cloneInto(e.oHash), e.iHash = a._cloneInto(e.iHash), e;
|
|
252
|
+
}
|
|
253
|
+
clone() {
|
|
254
|
+
return this._cloneInto();
|
|
255
|
+
}
|
|
256
|
+
destroy() {
|
|
257
|
+
this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
const se = (n, e, c) => new te(n, e).update(c).digest();
|
|
261
|
+
se.create = (n, e) => new te(n, e);
|
|
262
|
+
const Oe = Te, re = Me;
|
|
263
|
+
function Ve(n, e, c, a) {
|
|
264
|
+
ee(n);
|
|
265
|
+
const t = Ie({ dkLen: 32, asyncTick: 10 }, a), { c: s, dkLen: i, asyncTick: o } = t;
|
|
266
|
+
if (V(s), V(i), V(o), s < 1)
|
|
267
|
+
throw new Error("iterations (c) should be >= 1");
|
|
268
|
+
const l = J(e), d = J(c), b = new Uint8Array(i), r = se.create(n, l), h = r._cloneInto().update(d);
|
|
269
|
+
return { c: s, dkLen: i, asyncTick: o, DK: b, PRF: r, PRFSalt: h };
|
|
270
|
+
}
|
|
271
|
+
function We(n, e, c, a, t) {
|
|
272
|
+
return n.destroy(), e.destroy(), a && a.destroy(), D(t), c;
|
|
273
|
+
}
|
|
274
|
+
function Ke(n, e, c, a) {
|
|
275
|
+
const { c: t, dkLen: s, DK: i, PRF: o, PRFSalt: l } = Ve(n, e, c, a);
|
|
276
|
+
let d;
|
|
277
|
+
const b = new Uint8Array(4), r = Ae(b), h = new Uint8Array(o.outputLen);
|
|
278
|
+
for (let p = 1, m = 0; m < s; p++, m += o.outputLen) {
|
|
279
|
+
const f = i.subarray(m, m + o.outputLen);
|
|
280
|
+
r.setInt32(0, p, !1), (d = l._cloneInto(d)).update(b).digestInto(h), f.set(h.subarray(0, f.length));
|
|
281
|
+
for (let y = 1; y < t; y++) {
|
|
282
|
+
o._cloneInto(d).update(h).digestInto(h);
|
|
283
|
+
for (let x = 0; x < f.length; x++)
|
|
284
|
+
f[x] ^= h[x];
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
return We(o, l, i, d, h);
|
|
288
|
+
}
|
|
289
|
+
function Pe(n, e = Le(), c = 2048, a) {
|
|
290
|
+
const t = W(n), s = W(e);
|
|
291
|
+
return {
|
|
292
|
+
password: !Ee || Se() ? je(t, s, c) : Ke(re, t, s, { c, dkLen: 64 }),
|
|
293
|
+
rounds: c,
|
|
294
|
+
salt: e
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
const $e = /* @__PURE__ */ Be({ 256: De, 512: Ce }, { 256: Oe, 512: re }), Ne = /* @__PURE__ */ ze(256, $e), ie = "abandon|ability|able|about|above|absent|absorb|abstract|absurd|abuse|access|accident|account|accuse|achieve|acid|acoustic|acquire|across|act|action|actor|actress|actual|adapt|add|addict|address|adjust|admit|adult|advance|advice|aerobic|affair|afford|afraid|again|age|agent|agree|ahead|aim|air|airport|aisle|alarm|album|alcohol|alert|alien|all|alley|allow|almost|alone|alpha|already|also|alter|always|amateur|amazing|among|amount|amused|analyst|anchor|ancient|anger|angle|angry|animal|ankle|announce|annual|another|answer|antenna|antique|anxiety|any|apart|apology|appear|apple|approve|april|arch|arctic|area|arena|argue|arm|armed|armor|army|around|arrange|arrest|arrive|arrow|art|artefact|artist|artwork|ask|aspect|assault|asset|assist|assume|asthma|athlete|atom|attack|attend|attitude|attract|auction|audit|august|aunt|author|auto|autumn|average|avocado|avoid|awake|aware|away|awesome|awful|awkward|axis|baby|bachelor|bacon|badge|bag|balance|balcony|ball|bamboo|banana|banner|bar|barely|bargain|barrel|base|basic|basket|battle|beach|bean|beauty|because|become|beef|before|begin|behave|behind|believe|below|belt|bench|benefit|best|betray|better|between|beyond|bicycle|bid|bike|bind|biology|bird|birth|bitter|black|blade|blame|blanket|blast|bleak|bless|blind|blood|blossom|blouse|blue|blur|blush|board|boat|body|boil|bomb|bone|bonus|book|boost|border|boring|borrow|boss|bottom|bounce|box|boy|bracket|brain|brand|brass|brave|bread|breeze|brick|bridge|brief|bright|bring|brisk|broccoli|broken|bronze|broom|brother|brown|brush|bubble|buddy|budget|buffalo|build|bulb|bulk|bullet|bundle|bunker|burden|burger|burst|bus|business|busy|butter|buyer|buzz|cabbage|cabin|cable|cactus|cage|cake|call|calm|camera|camp|can|canal|cancel|candy|cannon|canoe|canvas|canyon|capable|capital|captain|car|carbon|card|cargo|carpet|carry|cart|case|cash|casino|castle|casual|cat|catalog|catch|category|cattle|caught|cause|caution|cave|ceiling|celery|cement|census|century|cereal|certain|chair|chalk|champion|change|chaos|chapter|charge|chase|chat|cheap|check|cheese|chef|cherry|chest|chicken|chief|child|chimney|choice|choose|chronic|chuckle|chunk|churn|cigar|cinnamon|circle|citizen|city|civil|claim|clap|clarify|claw|clay|clean|clerk|clever|click|client|cliff|climb|clinic|clip|clock|clog|close|cloth|cloud|clown|club|clump|cluster|clutch|coach|coast|coconut|code|coffee|coil|coin|collect|color|column|combine|come|comfort|comic|common|company|concert|conduct|confirm|congress|connect|consider|control|convince|cook|cool|copper|copy|coral|core|corn|correct|cost|cotton|couch|country|couple|course|cousin|cover|coyote|crack|cradle|craft|cram|crane|crash|crater|crawl|crazy|cream|credit|creek|crew|cricket|crime|crisp|critic|crop|cross|crouch|crowd|crucial|cruel|cruise|crumble|crunch|crush|cry|crystal|cube|culture|cup|cupboard|curious|current|curtain|curve|cushion|custom|cute|cycle|dad|damage|damp|dance|danger|daring|dash|daughter|dawn|day|deal|debate|debris|decade|december|decide|decline|decorate|decrease|deer|defense|define|defy|degree|delay|deliver|demand|demise|denial|dentist|deny|depart|depend|deposit|depth|deputy|derive|describe|desert|design|desk|despair|destroy|detail|detect|develop|device|devote|diagram|dial|diamond|diary|dice|diesel|diet|differ|digital|dignity|dilemma|dinner|dinosaur|direct|dirt|disagree|discover|disease|dish|dismiss|disorder|display|distance|divert|divide|divorce|dizzy|doctor|document|dog|doll|dolphin|domain|donate|donkey|donor|door|dose|double|dove|draft|dragon|drama|drastic|draw|dream|dress|drift|drill|drink|drip|drive|drop|drum|dry|duck|dumb|dune|during|dust|dutch|duty|dwarf|dynamic|eager|eagle|early|earn|earth|easily|east|easy|echo|ecology|economy|edge|edit|educate|effort|egg|eight|either|elbow|elder|electric|elegant|element|elephant|elevator|elite|else|embark|embody|embrace|emerge|emotion|employ|empower|empty|enable|enact|end|endless|endorse|enemy|energy|enforce|engage|engine|enhance|enjoy|enlist|enough|enrich|enroll|ensure|enter|entire|entry|envelope|episode|equal|equip|era|erase|erode|erosion|error|erupt|escape|essay|essence|estate|eternal|ethics|evidence|evil|evoke|evolve|exact|example|excess|exchange|excite|exclude|excuse|execute|exercise|exhaust|exhibit|exile|exist|exit|exotic|expand|expect|expire|explain|expose|express|extend|extra|eye|eyebrow|fabric|face|faculty|fade|faint|faith|fall|false|fame|family|famous|fan|fancy|fantasy|farm|fashion|fat|fatal|father|fatigue|fault|favorite|feature|february|federal|fee|feed|feel|female|fence|festival|fetch|fever|few|fiber|fiction|field|figure|file|film|filter|final|find|fine|finger|finish|fire|firm|first|fiscal|fish|fit|fitness|fix|flag|flame|flash|flat|flavor|flee|flight|flip|float|flock|floor|flower|fluid|flush|fly|foam|focus|fog|foil|fold|follow|food|foot|force|forest|forget|fork|fortune|forum|forward|fossil|foster|found|fox|fragile|frame|frequent|fresh|friend|fringe|frog|front|frost|frown|frozen|fruit|fuel|fun|funny|furnace|fury|future|gadget|gain|galaxy|gallery|game|gap|garage|garbage|garden|garlic|garment|gas|gasp|gate|gather|gauge|gaze|general|genius|genre|gentle|genuine|gesture|ghost|giant|gift|giggle|ginger|giraffe|girl|give|glad|glance|glare|glass|glide|glimpse|globe|gloom|glory|glove|glow|glue|goat|goddess|gold|good|goose|gorilla|gospel|gossip|govern|gown|grab|grace|grain|grant|grape|grass|gravity|great|green|grid|grief|grit|grocery|group|grow|grunt|guard|guess|guide|guilt|guitar|gun|gym|habit|hair|half|hammer|hamster|hand|happy|harbor|hard|harsh|harvest|hat|have|hawk|hazard|head|health|heart|heavy|hedgehog|height|hello|helmet|help|hen|hero|hidden|high|hill|hint|hip|hire|history|hobby|hockey|hold|hole|holiday|hollow|home|honey|hood|hope|horn|horror|horse|hospital|host|hotel|hour|hover|hub|huge|human|humble|humor|hundred|hungry|hunt|hurdle|hurry|hurt|husband|hybrid|ice|icon|idea|identify|idle|ignore|ill|illegal|illness|image|imitate|immense|immune|impact|impose|improve|impulse|inch|include|income|increase|index|indicate|indoor|industry|infant|inflict|inform|inhale|inherit|initial|inject|injury|inmate|inner|innocent|input|inquiry|insane|insect|inside|inspire|install|intact|interest|into|invest|invite|involve|iron|island|isolate|issue|item|ivory|jacket|jaguar|jar|jazz|jealous|jeans|jelly|jewel|job|join|joke|journey|joy|judge|juice|jump|jungle|junior|junk|just|kangaroo|keen|keep|ketchup|key|kick|kid|kidney|kind|kingdom|kiss|kit|kitchen|kite|kitten|kiwi|knee|knife|knock|know|lab|label|labor|ladder|lady|lake|lamp|language|laptop|large|later|latin|laugh|laundry|lava|law|lawn|lawsuit|layer|lazy|leader|leaf|learn|leave|lecture|left|leg|legal|legend|leisure|lemon|lend|length|lens|leopard|lesson|letter|level|liar|liberty|library|license|life|lift|light|like|limb|limit|link|lion|liquid|list|little|live|lizard|load|loan|lobster|local|lock|logic|lonely|long|loop|lottery|loud|lounge|love|loyal|lucky|luggage|lumber|lunar|lunch|luxury|lyrics|machine|mad|magic|magnet|maid|mail|main|major|make|mammal|man|manage|mandate|mango|mansion|manual|maple|marble|march|margin|marine|market|marriage|mask|mass|master|match|material|math|matrix|matter|maximum|maze|meadow|mean|measure|meat|mechanic|medal|media|melody|melt|member|memory|mention|menu|mercy|merge|merit|merry|mesh|message|metal|method|middle|midnight|milk|million|mimic|mind|minimum|minor|minute|miracle|mirror|misery|miss|mistake|mix|mixed|mixture|mobile|model|modify|mom|moment|monitor|monkey|monster|month|moon|moral|more|morning|mosquito|mother|motion|motor|mountain|mouse|move|movie|much|muffin|mule|multiply|muscle|museum|mushroom|music|must|mutual|myself|mystery|myth|naive|name|napkin|narrow|nasty|nation|nature|near|neck|need|negative|neglect|neither|nephew|nerve|nest|net|network|neutral|never|news|next|nice|night|noble|noise|nominee|noodle|normal|north|nose|notable|note|nothing|notice|novel|now|nuclear|number|nurse|nut|oak|obey|object|oblige|obscure|observe|obtain|obvious|occur|ocean|october|odor|off|offer|office|often|oil|okay|old|olive|olympic|omit|once|one|onion|online|only|open|opera|opinion|oppose|option|orange|orbit|orchard|order|ordinary|organ|orient|original|orphan|ostrich|other|outdoor|outer|output|outside|oval|oven|over|own|owner|oxygen|oyster|ozone|pact|paddle|page|pair|palace|palm|panda|panel|panic|panther|paper|parade|parent|park|parrot|party|pass|patch|path|patient|patrol|pattern|pause|pave|payment|peace|peanut|pear|peasant|pelican|pen|penalty|pencil|people|pepper|perfect|permit|person|pet|phone|photo|phrase|physical|piano|picnic|picture|piece|pig|pigeon|pill|pilot|pink|pioneer|pipe|pistol|pitch|pizza|place|planet|plastic|plate|play|please|pledge|pluck|plug|plunge|poem|poet|point|polar|pole|police|pond|pony|pool|popular|portion|position|possible|post|potato|pottery|poverty|powder|power|practice|praise|predict|prefer|prepare|present|pretty|prevent|price|pride|primary|print|priority|prison|private|prize|problem|process|produce|profit|program|project|promote|proof|property|prosper|protect|proud|provide|public|pudding|pull|pulp|pulse|pumpkin|punch|pupil|puppy|purchase|purity|purpose|purse|push|put|puzzle|pyramid|quality|quantum|quarter|question|quick|quit|quiz|quote|rabbit|raccoon|race|rack|radar|radio|rail|rain|raise|rally|ramp|ranch|random|range|rapid|rare|rate|rather|raven|raw|razor|ready|real|reason|rebel|rebuild|recall|receive|recipe|record|recycle|reduce|reflect|reform|refuse|region|regret|regular|reject|relax|release|relief|rely|remain|remember|remind|remove|render|renew|rent|reopen|repair|repeat|replace|report|require|rescue|resemble|resist|resource|response|result|retire|retreat|return|reunion|reveal|review|reward|rhythm|rib|ribbon|rice|rich|ride|ridge|rifle|right|rigid|ring|riot|ripple|risk|ritual|rival|river|road|roast|robot|robust|rocket|romance|roof|rookie|room|rose|rotate|rough|round|route|royal|rubber|rude|rug|rule|run|runway|rural|sad|saddle|sadness|safe|sail|salad|salmon|salon|salt|salute|same|sample|sand|satisfy|satoshi|sauce|sausage|save|say|scale|scan|scare|scatter|scene|scheme|school|science|scissors|scorpion|scout|scrap|screen|script|scrub|sea|search|season|seat|second|secret|section|security|seed|seek|segment|select|sell|seminar|senior|sense|sentence|series|service|session|settle|setup|seven|shadow|shaft|shallow|share|shed|shell|sheriff|shield|shift|shine|ship|shiver|shock|shoe|shoot|shop|short|shoulder|shove|shrimp|shrug|shuffle|shy|sibling|sick|side|siege|sight|sign|silent|silk|silly|silver|similar|simple|since|sing|siren|sister|situate|six|size|skate|sketch|ski|skill|skin|skirt|skull|slab|slam|sleep|slender|slice|slide|slight|slim|slogan|slot|slow|slush|small|smart|smile|smoke|smooth|snack|snake|snap|sniff|snow|soap|soccer|social|sock|soda|soft|solar|soldier|solid|solution|solve|someone|song|soon|sorry|sort|soul|sound|soup|source|south|space|spare|spatial|spawn|speak|special|speed|spell|spend|sphere|spice|spider|spike|spin|spirit|split|spoil|sponsor|spoon|sport|spot|spray|spread|spring|spy|square|squeeze|squirrel|stable|stadium|staff|stage|stairs|stamp|stand|start|state|stay|steak|steel|stem|step|stereo|stick|still|sting|stock|stomach|stone|stool|story|stove|strategy|street|strike|strong|struggle|student|stuff|stumble|style|subject|submit|subway|success|such|sudden|suffer|sugar|suggest|suit|summer|sun|sunny|sunset|super|supply|supreme|sure|surface|surge|surprise|surround|survey|suspect|sustain|swallow|swamp|swap|swarm|swear|sweet|swift|swim|swing|switch|sword|symbol|symptom|syrup|system|table|tackle|tag|tail|talent|talk|tank|tape|target|task|taste|tattoo|taxi|teach|team|tell|ten|tenant|tennis|tent|term|test|text|thank|that|theme|then|theory|there|they|thing|this|thought|three|thrive|throw|thumb|thunder|ticket|tide|tiger|tilt|timber|time|tiny|tip|tired|tissue|title|toast|tobacco|today|toddler|toe|together|toilet|token|tomato|tomorrow|tone|tongue|tonight|tool|tooth|top|topic|topple|torch|tornado|tortoise|toss|total|tourist|toward|tower|town|toy|track|trade|traffic|tragic|train|transfer|trap|trash|travel|tray|treat|tree|trend|trial|tribe|trick|trigger|trim|trip|trophy|trouble|truck|true|truly|trumpet|trust|truth|try|tube|tuition|tumble|tuna|tunnel|turkey|turn|turtle|twelve|twenty|twice|twin|twist|two|type|typical|ugly|umbrella|unable|unaware|uncle|uncover|under|undo|unfair|unfold|unhappy|uniform|unique|unit|universe|unknown|unlock|until|unusual|unveil|update|upgrade|uphold|upon|upper|upset|urban|urge|usage|use|used|useful|useless|usual|utility|vacant|vacuum|vague|valid|valley|valve|van|vanish|vapor|various|vast|vault|vehicle|velvet|vendor|venture|venue|verb|verify|version|very|vessel|veteran|viable|vibrant|vicious|victory|video|view|village|vintage|violin|virtual|virus|visa|visit|visual|vital|vivid|vocal|voice|void|volcano|volume|vote|voyage|wage|wagon|wait|walk|wall|walnut|want|warfare|warm|warrior|wash|wasp|waste|water|wave|way|wealth|weapon|wear|weasel|weather|web|wedding|weekend|weird|welcome|west|wet|whale|what|wheat|wheel|when|where|whip|whisper|wide|width|wife|wild|will|win|window|wine|wing|wink|winner|winter|wire|wisdom|wise|wish|witness|wolf|woman|wonder|wood|wool|word|work|world|worry|worth|wrap|wreck|wrestle|wrist|write|wrong|yard|year|yellow|you|young|youth|zebra|zero|zone|zoo".split("|"), Q = "Invalid mnemonic", oe = "Invalid entropy", Re = "Invalid mnemonic checksum";
|
|
298
|
+
function K(n) {
|
|
299
|
+
return (n || "").normalize("NFKD");
|
|
300
|
+
}
|
|
301
|
+
function ne(n) {
|
|
302
|
+
return parseInt(n, 2);
|
|
303
|
+
}
|
|
304
|
+
function ce(n) {
|
|
305
|
+
return n.map((e) => e.toString(2).padStart(8, "0")).join("");
|
|
306
|
+
}
|
|
307
|
+
function le(n) {
|
|
308
|
+
return ce(Array.from(Ne(n))).slice(0, n.length * 8 / 32);
|
|
309
|
+
}
|
|
310
|
+
function Je(n, e) {
|
|
311
|
+
return Pe(Y(K(n)), Y(`mnemonic${K(e)}`)).password;
|
|
312
|
+
}
|
|
313
|
+
function he(n, e = ie) {
|
|
314
|
+
const c = K(n).split(" ");
|
|
315
|
+
if (c.length % 3 !== 0)
|
|
316
|
+
throw new Error(Q);
|
|
317
|
+
const a = c.map((b) => {
|
|
318
|
+
const r = e.indexOf(b);
|
|
319
|
+
if (r === -1)
|
|
320
|
+
throw new Error(Q);
|
|
321
|
+
return r.toString(2).padStart(11, "0");
|
|
322
|
+
}).join(""), t = Math.floor(a.length / 33) * 32, s = a.slice(0, t), i = a.slice(t), o = s.match(/(.{1,8})/g), l = o == null ? void 0 : o.map(ne);
|
|
323
|
+
if (!l || l.length % 4 !== 0 || l.length < 16 || l.length > 32)
|
|
324
|
+
throw new Error(oe);
|
|
325
|
+
const d = W(l);
|
|
326
|
+
if (le(d) !== i)
|
|
327
|
+
throw new Error(Re);
|
|
328
|
+
return d;
|
|
329
|
+
}
|
|
330
|
+
function Ye(n, e = ie) {
|
|
331
|
+
if (n.length % 4 !== 0 || n.length < 16 || n.length > 32)
|
|
332
|
+
throw new Error(oe);
|
|
333
|
+
const c = `${ce(Array.from(n))}${le(n)}`.match(/(.{1,11})/g), a = c == null ? void 0 : c.map((t) => e[ne(t)]);
|
|
334
|
+
if (!a || a.length < 12)
|
|
335
|
+
throw new Error("Unable to map entropy to mnemonic");
|
|
336
|
+
return a.join(" ");
|
|
337
|
+
}
|
|
338
|
+
function Qe(n, e) {
|
|
339
|
+
try {
|
|
340
|
+
he(n, e);
|
|
341
|
+
} catch {
|
|
342
|
+
return !1;
|
|
343
|
+
}
|
|
344
|
+
return !0;
|
|
345
|
+
}
|
|
346
|
+
const sa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
347
|
+
__proto__: null,
|
|
348
|
+
entropyToMnemonic: Ye,
|
|
349
|
+
mnemonicToEntropy: he,
|
|
350
|
+
mnemonicToSeedSync: Je,
|
|
351
|
+
validateMnemonic: Qe
|
|
352
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
353
|
+
export {
|
|
354
|
+
Me as a,
|
|
355
|
+
re as b,
|
|
356
|
+
Oe as c,
|
|
357
|
+
Je as d,
|
|
358
|
+
Ke as e,
|
|
359
|
+
sa as f,
|
|
360
|
+
se as h,
|
|
361
|
+
he as m,
|
|
362
|
+
Pe as p,
|
|
363
|
+
Te as s,
|
|
364
|
+
Qe as v
|
|
365
|
+
};
|