@casperid/react 1.0.1 → 1.1.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.
Files changed (42) hide show
  1. package/dist/_commonjsHelpers-DKOUU3wS.cjs +2 -0
  2. package/dist/_commonjsHelpers-DKOUU3wS.cjs.map +1 -0
  3. package/dist/_commonjsHelpers-DaMA6jEr.js +9 -0
  4. package/dist/_commonjsHelpers-DaMA6jEr.js.map +1 -0
  5. package/dist/camera_utils-BQaOSBPu.js +397 -0
  6. package/dist/camera_utils-BQaOSBPu.js.map +1 -0
  7. package/dist/camera_utils-wchtqrQn.cjs +2 -0
  8. package/dist/camera_utils-wchtqrQn.cjs.map +1 -0
  9. package/dist/face_mesh-DYMPc5Ce.js +4212 -0
  10. package/dist/face_mesh-DYMPc5Ce.js.map +1 -0
  11. package/dist/face_mesh-fEvyDoPt.cjs +19 -0
  12. package/dist/face_mesh-fEvyDoPt.cjs.map +1 -0
  13. package/dist/index.cjs +41 -41
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.mjs +1786 -1501
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/style.css +1 -1
  18. package/package.json +11 -11
  19. package/src/CasperIDModal.tsx +0 -777
  20. package/src/index.css +0 -217
  21. package/src/index.ts +0 -41
  22. package/src/screens/AuthSelection.tsx +0 -221
  23. package/src/screens/DocumentScan.tsx +0 -348
  24. package/src/screens/FaceScan.tsx +0 -368
  25. package/src/screens/IdentityVerified.tsx +0 -51
  26. package/src/screens/L1Setup.tsx +0 -335
  27. package/src/screens/Login.tsx +0 -186
  28. package/src/screens/MintingIdentity.tsx +0 -446
  29. package/src/screens/PasskeyAuth.tsx +0 -259
  30. package/src/screens/PasskeyRegister.tsx +0 -281
  31. package/src/screens/PermissionsRequest.tsx +0 -96
  32. package/src/screens/PinVerification.tsx +0 -321
  33. package/src/screens/ReviewData.tsx +0 -315
  34. package/src/screens/SecurityUpgrade.tsx +0 -83
  35. package/src/screens/VerifyIdentityChoice.tsx +0 -59
  36. package/src/shared/Footer.tsx +0 -13
  37. package/src/shared/GlassContainer.tsx +0 -17
  38. package/src/shared/Header.tsx +0 -62
  39. package/src/types.ts +0 -342
  40. package/src/utils/fetchWithTimeout.ts +0 -52
  41. package/src/utils/i18n.ts +0 -640
  42. package/src/utils/webauthn.ts +0 -261
package/dist/index.mjs CHANGED
@@ -1,12 +1,12 @@
1
- import { jsx as e, jsxs as a, Fragment as $ } from "react/jsx-runtime";
2
- import mt, { forwardRef as Be, createElement as Ne, useState as y, useEffect as F, useCallback as q, useRef as re } from "react";
3
- import { motion as V, AnimatePresence as Ce } from "framer-motion";
4
- const Ve = ({ children: r, className: i = "", theme: s = "" }) => (
1
+ import { jsx as e, jsxs as i, Fragment as re } from "react/jsx-runtime";
2
+ import _t, { forwardRef as Ze, createElement as je, useState as y, useEffect as ce, useCallback as J, useRef as se } from "react";
3
+ import { motion as P, AnimatePresence as Me } from "framer-motion";
4
+ const He = ({ children: r, className: a = "", theme: n = "" }) => (
5
5
  // Destructure theme and provide default
6
6
  /* @__PURE__ */ e(
7
7
  "div",
8
8
  {
9
- className: `glass-container relative w-full h-full rounded-[var(--casperid-radius,1.5rem)] overflow-hidden flex flex-col shadow-2xl border dark:border-white/10 border-white/40 ${i} ${s}`,
9
+ className: `glass-container relative w-full h-full rounded-[var(--casperid-radius,1.5rem)] overflow-hidden flex flex-col shadow-2xl border dark:border-white/10 border-white/40 ${a} ${n}`,
10
10
  children: r
11
11
  }
12
12
  )
@@ -17,14 +17,14 @@ const Ve = ({ children: r, className: i = "", theme: s = "" }) => (
17
17
  * This source code is licensed under the ISC license.
18
18
  * See the LICENSE file in the root directory of this source tree.
19
19
  */
20
- const pt = (r) => r.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), He = (...r) => r.filter((i, s, o) => !!i && o.indexOf(i) === s).join(" ");
20
+ const yt = (r) => r.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Xe = (...r) => r.filter((a, n, l) => !!a && l.indexOf(a) === n).join(" ");
21
21
  /**
22
22
  * @license lucide-react v0.400.0 - ISC
23
23
  *
24
24
  * This source code is licensed under the ISC license.
25
25
  * See the LICENSE file in the root directory of this source tree.
26
26
  */
27
- var ht = {
27
+ var xt = {
28
28
  xmlns: "http://www.w3.org/2000/svg",
29
29
  width: 24,
30
30
  height: 24,
@@ -41,31 +41,31 @@ var ht = {
41
41
  * This source code is licensed under the ISC license.
42
42
  * See the LICENSE file in the root directory of this source tree.
43
43
  */
44
- const ft = Be(
44
+ const gt = Ze(
45
45
  ({
46
46
  color: r = "currentColor",
47
- size: i = 24,
48
- strokeWidth: s = 2,
49
- absoluteStrokeWidth: o,
50
- className: x = "",
51
- children: l,
52
- iconNode: u,
53
- ...c
54
- }, n) => Ne(
47
+ size: a = 24,
48
+ strokeWidth: n = 2,
49
+ absoluteStrokeWidth: l,
50
+ className: N = "",
51
+ children: p,
52
+ iconNode: f,
53
+ ...m
54
+ }, s) => je(
55
55
  "svg",
56
56
  {
57
- ref: n,
58
- ...ht,
59
- width: i,
60
- height: i,
57
+ ref: s,
58
+ ...xt,
59
+ width: a,
60
+ height: a,
61
61
  stroke: r,
62
- strokeWidth: o ? Number(s) * 24 / Number(i) : s,
63
- className: He("lucide", x),
64
- ...c
62
+ strokeWidth: l ? Number(n) * 24 / Number(a) : n,
63
+ className: Xe("lucide", N),
64
+ ...m
65
65
  },
66
66
  [
67
- ...u.map(([d, m]) => Ne(d, m)),
68
- ...Array.isArray(l) ? l : [l]
67
+ ...f.map(([c, d]) => je(c, d)),
68
+ ...Array.isArray(p) ? p : [p]
69
69
  ]
70
70
  )
71
71
  );
@@ -75,16 +75,16 @@ const ft = Be(
75
75
  * This source code is licensed under the ISC license.
76
76
  * See the LICENSE file in the root directory of this source tree.
77
77
  */
78
- const M = (r, i) => {
79
- const s = Be(
80
- ({ className: o, ...x }, l) => Ne(ft, {
81
- ref: l,
82
- iconNode: i,
83
- className: He(`lucide-${pt(r)}`, o),
84
- ...x
78
+ const j = (r, a) => {
79
+ const n = Ze(
80
+ ({ className: l, ...N }, p) => je(gt, {
81
+ ref: p,
82
+ iconNode: a,
83
+ className: Xe(`lucide-${yt(r)}`, l),
84
+ ...N
85
85
  })
86
86
  );
87
- return s.displayName = `${r}`, s;
87
+ return n.displayName = `${r}`, n;
88
88
  };
89
89
  /**
90
90
  * @license lucide-react v0.400.0 - ISC
@@ -92,7 +92,7 @@ const M = (r, i) => {
92
92
  * This source code is licensed under the ISC license.
93
93
  * See the LICENSE file in the root directory of this source tree.
94
94
  */
95
- const Se = M("ArrowRight", [
95
+ const Oe = j("ArrowRight", [
96
96
  ["path", { d: "M5 12h14", key: "1ays0h" }],
97
97
  ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
98
98
  ]);
@@ -102,7 +102,7 @@ const Se = M("ArrowRight", [
102
102
  * This source code is licensed under the ISC license.
103
103
  * See the LICENSE file in the root directory of this source tree.
104
104
  */
105
- const Ee = M("BadgeCheck", [
105
+ const Fe = j("BadgeCheck", [
106
106
  [
107
107
  "path",
108
108
  {
@@ -118,7 +118,7 @@ const Ee = M("BadgeCheck", [
118
118
  * This source code is licensed under the ISC license.
119
119
  * See the LICENSE file in the root directory of this source tree.
120
120
  */
121
- const bt = M("Calendar", [
121
+ const vt = j("Calendar", [
122
122
  ["path", { d: "M8 2v4", key: "1cmpym" }],
123
123
  ["path", { d: "M16 2v4", key: "4m81vk" }],
124
124
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
@@ -130,7 +130,7 @@ const bt = M("Calendar", [
130
130
  * This source code is licensed under the ISC license.
131
131
  * See the LICENSE file in the root directory of this source tree.
132
132
  */
133
- const _t = M("Camera", [
133
+ const wt = j("Camera", [
134
134
  [
135
135
  "path",
136
136
  {
@@ -146,7 +146,7 @@ const _t = M("Camera", [
146
146
  * This source code is licensed under the ISC license.
147
147
  * See the LICENSE file in the root directory of this source tree.
148
148
  */
149
- const Ie = M("ChevronRight", [
149
+ const Le = j("ChevronRight", [
150
150
  ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
151
151
  ]);
152
152
  /**
@@ -155,7 +155,7 @@ const Ie = M("ChevronRight", [
155
155
  * This source code is licensed under the ISC license.
156
156
  * See the LICENSE file in the root directory of this source tree.
157
157
  */
158
- const se = M("CircleAlert", [
158
+ const ve = j("CircleAlert", [
159
159
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
160
160
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
161
161
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
@@ -166,7 +166,7 @@ const se = M("CircleAlert", [
166
166
  * This source code is licensed under the ISC license.
167
167
  * See the LICENSE file in the root directory of this source tree.
168
168
  */
169
- const he = M("CircleCheck", [
169
+ const Ce = j("CircleCheck", [
170
170
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
171
171
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
172
172
  ]);
@@ -176,7 +176,7 @@ const he = M("CircleCheck", [
176
176
  * This source code is licensed under the ISC license.
177
177
  * See the LICENSE file in the root directory of this source tree.
178
178
  */
179
- const yt = M("CircleHelp", [
179
+ const kt = j("CircleHelp", [
180
180
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
181
181
  ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
182
182
  ["path", { d: "M12 17h.01", key: "p32p05" }]
@@ -187,7 +187,7 @@ const yt = M("CircleHelp", [
187
187
  * This source code is licensed under the ISC license.
188
188
  * See the LICENSE file in the root directory of this source tree.
189
189
  */
190
- const Ke = M("CreditCard", [
190
+ const Qe = j("CreditCard", [
191
191
  ["rect", { width: "20", height: "14", x: "2", y: "5", rx: "2", key: "ynyp8z" }],
192
192
  ["line", { x1: "2", x2: "22", y1: "10", y2: "10", key: "1b3vmo" }]
193
193
  ]);
@@ -197,7 +197,7 @@ const Ke = M("CreditCard", [
197
197
  * This source code is licensed under the ISC license.
198
198
  * See the LICENSE file in the root directory of this source tree.
199
199
  */
200
- const xt = M("Delete", [
200
+ const Nt = j("Delete", [
201
201
  ["path", { d: "M20 5H9l-7 7 7 7h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2Z", key: "1oy587" }],
202
202
  ["line", { x1: "18", x2: "12", y1: "9", y2: "15", key: "1olkx5" }],
203
203
  ["line", { x1: "12", x2: "18", y1: "9", y2: "15", key: "1n50pc" }]
@@ -208,7 +208,7 @@ const xt = M("Delete", [
208
208
  * This source code is licensed under the ISC license.
209
209
  * See the LICENSE file in the root directory of this source tree.
210
210
  */
211
- const pe = M("Fingerprint", [
211
+ const Ie = j("Fingerprint", [
212
212
  ["path", { d: "M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4", key: "1nerag" }],
213
213
  ["path", { d: "M14 13.12c0 2.38 0 6.38-1 8.88", key: "o46ks0" }],
214
214
  ["path", { d: "M17.29 21.02c.12-.6.43-2.3.5-3.02", key: "ptglia" }],
@@ -225,7 +225,7 @@ const pe = M("Fingerprint", [
225
225
  * This source code is licensed under the ISC license.
226
226
  * See the LICENSE file in the root directory of this source tree.
227
227
  */
228
- const gt = M("Flashlight", [
228
+ const It = j("Flashlight", [
229
229
  [
230
230
  "path",
231
231
  {
@@ -242,7 +242,7 @@ const gt = M("Flashlight", [
242
242
  * This source code is licensed under the ISC license.
243
243
  * See the LICENSE file in the root directory of this source tree.
244
244
  */
245
- const We = M("Globe", [
245
+ const et = j("Globe", [
246
246
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
247
247
  ["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
248
248
  ["path", { d: "M2 12h20", key: "9i4pu4" }]
@@ -253,7 +253,7 @@ const We = M("Globe", [
253
253
  * This source code is licensed under the ISC license.
254
254
  * See the LICENSE file in the root directory of this source tree.
255
255
  */
256
- const vt = M("Key", [
256
+ const Ct = j("Key", [
257
257
  ["path", { d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4", key: "g0fldk" }],
258
258
  ["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
259
259
  ["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
@@ -264,7 +264,7 @@ const vt = M("Key", [
264
264
  * This source code is licensed under the ISC license.
265
265
  * See the LICENSE file in the root directory of this source tree.
266
266
  */
267
- const ee = M("LoaderCircle", [
267
+ const _e = j("LoaderCircle", [
268
268
  ["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
269
269
  ]);
270
270
  /**
@@ -273,7 +273,7 @@ const ee = M("LoaderCircle", [
273
273
  * This source code is licensed under the ISC license.
274
274
  * See the LICENSE file in the root directory of this source tree.
275
275
  */
276
- const Ae = M("Lock", [
276
+ const tt = j("Lock", [
277
277
  ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
278
278
  ["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
279
279
  ]);
@@ -283,7 +283,7 @@ const Ae = M("Lock", [
283
283
  * This source code is licensed under the ISC license.
284
284
  * See the LICENSE file in the root directory of this source tree.
285
285
  */
286
- const wt = M("Mail", [
286
+ const St = j("Mail", [
287
287
  ["rect", { width: "20", height: "16", x: "2", y: "4", rx: "2", key: "18n3k1" }],
288
288
  ["path", { d: "m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7", key: "1ocrg3" }]
289
289
  ]);
@@ -293,7 +293,7 @@ const wt = M("Mail", [
293
293
  * This source code is licensed under the ISC license.
294
294
  * See the LICENSE file in the root directory of this source tree.
295
295
  */
296
- const kt = M("Moon", [
296
+ const Et = j("Moon", [
297
297
  ["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
298
298
  ]);
299
299
  /**
@@ -302,7 +302,7 @@ const kt = M("Moon", [
302
302
  * This source code is licensed under the ISC license.
303
303
  * See the LICENSE file in the root directory of this source tree.
304
304
  */
305
- const Nt = M("Network", [
305
+ const At = j("Network", [
306
306
  ["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
307
307
  ["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
308
308
  ["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
@@ -315,7 +315,7 @@ const Nt = M("Network", [
315
315
  * This source code is licensed under the ISC license.
316
316
  * See the LICENSE file in the root directory of this source tree.
317
317
  */
318
- const Ct = M("Puzzle", [
318
+ const Dt = j("Puzzle", [
319
319
  [
320
320
  "path",
321
321
  {
@@ -330,7 +330,7 @@ const Ct = M("Puzzle", [
330
330
  * This source code is licensed under the ISC license.
331
331
  * See the LICENSE file in the root directory of this source tree.
332
332
  */
333
- const xe = M("RefreshCw", [
333
+ const Te = j("RefreshCw", [
334
334
  ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
335
335
  ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
336
336
  ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
@@ -342,7 +342,7 @@ const xe = M("RefreshCw", [
342
342
  * This source code is licensed under the ISC license.
343
343
  * See the LICENSE file in the root directory of this source tree.
344
344
  */
345
- const It = M("RotateCcw", [
345
+ const Rt = j("RotateCcw", [
346
346
  ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
347
347
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
348
348
  ]);
@@ -352,7 +352,7 @@ const It = M("RotateCcw", [
352
352
  * This source code is licensed under the ISC license.
353
353
  * See the LICENSE file in the root directory of this source tree.
354
354
  */
355
- const fe = M("ShieldCheck", [
355
+ const Se = j("ShieldCheck", [
356
356
  [
357
357
  "path",
358
358
  {
@@ -368,7 +368,7 @@ const fe = M("ShieldCheck", [
368
368
  * This source code is licensed under the ISC license.
369
369
  * See the LICENSE file in the root directory of this source tree.
370
370
  */
371
- const Ge = M("Shield", [
371
+ const it = j("Shield", [
372
372
  [
373
373
  "path",
374
374
  {
@@ -383,7 +383,7 @@ const Ge = M("Shield", [
383
383
  * This source code is licensed under the ISC license.
384
384
  * See the LICENSE file in the root directory of this source tree.
385
385
  */
386
- const De = M("Smartphone", [
386
+ const qe = j("Smartphone", [
387
387
  ["rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2", key: "1yt0o3" }],
388
388
  ["path", { d: "M12 18h.01", key: "mhygvu" }]
389
389
  ]);
@@ -393,7 +393,7 @@ const De = M("Smartphone", [
393
393
  * This source code is licensed under the ISC license.
394
394
  * See the LICENSE file in the root directory of this source tree.
395
395
  */
396
- const St = M("Sparkles", [
396
+ const Pt = j("Sparkles", [
397
397
  [
398
398
  "path",
399
399
  {
@@ -412,7 +412,7 @@ const St = M("Sparkles", [
412
412
  * This source code is licensed under the ISC license.
413
413
  * See the LICENSE file in the root directory of this source tree.
414
414
  */
415
- const Et = M("Sun", [
415
+ const Tt = j("Sun", [
416
416
  ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
417
417
  ["path", { d: "M12 2v2", key: "tus03m" }],
418
418
  ["path", { d: "M12 20v2", key: "1lh1kg" }],
@@ -429,7 +429,7 @@ const Et = M("Sun", [
429
429
  * This source code is licensed under the ISC license.
430
430
  * See the LICENSE file in the root directory of this source tree.
431
431
  */
432
- const At = M("User", [
432
+ const zt = j("User", [
433
433
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
434
434
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
435
435
  ]);
@@ -439,7 +439,7 @@ const At = M("User", [
439
439
  * This source code is licensed under the ISC license.
440
440
  * See the LICENSE file in the root directory of this source tree.
441
441
  */
442
- const Dt = M("Wallet", [
442
+ const Vt = j("Wallet", [
443
443
  [
444
444
  "path",
445
445
  {
@@ -455,46 +455,46 @@ const Dt = M("Wallet", [
455
455
  * This source code is licensed under the ISC license.
456
456
  * See the LICENSE file in the root directory of this source tree.
457
457
  */
458
- const Rt = M("X", [
458
+ const jt = j("X", [
459
459
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
460
460
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
461
- ]), Le = ({
461
+ ]), We = ({
462
462
  onClose: r,
463
- title: i = "CasperID",
464
- subtitle: s = "SECURE SDK",
465
- showClose: o = !0,
466
- theme: x,
467
- toggleTheme: l,
468
- logoUrl: u
469
- }) => /* @__PURE__ */ a("header", { className: "flex items-center justify-between px-6 pt-8 pb-4 relative z-20", children: [
470
- /* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
471
- /* @__PURE__ */ e("div", { className: "p-2 bg-brand rounded-xl flex items-center justify-center shadow-brand", children: u ? /* @__PURE__ */ e("img", { src: u, alt: i, className: "w-5 h-5 object-contain" }) : /* @__PURE__ */ e(Ge, { className: "text-white w-5 h-5" }) }),
472
- /* @__PURE__ */ a("div", { children: [
473
- /* @__PURE__ */ e("h2", { className: "text-lg font-bold tracking-tight text-main", children: i }),
474
- s && /* @__PURE__ */ e("p", { className: "text-[10px] uppercase tracking-widest text-brand font-bold", children: s })
463
+ title: a = "CasperID",
464
+ subtitle: n = "SECURE SDK",
465
+ showClose: l = !0,
466
+ theme: N,
467
+ toggleTheme: p,
468
+ logoUrl: f
469
+ }) => /* @__PURE__ */ i("header", { className: "flex items-center justify-between px-6 pt-8 pb-4 relative z-20", children: [
470
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-3", children: [
471
+ /* @__PURE__ */ e("div", { className: "p-2 bg-brand rounded-xl flex items-center justify-center shadow-brand", children: f ? /* @__PURE__ */ e("img", { src: f, alt: a, className: "w-5 h-5 object-contain" }) : /* @__PURE__ */ e(it, { className: "text-white w-5 h-5" }) }),
472
+ /* @__PURE__ */ i("div", { children: [
473
+ /* @__PURE__ */ e("h2", { className: "text-lg font-bold tracking-tight text-main", children: a }),
474
+ n && /* @__PURE__ */ e("p", { className: "text-[10px] uppercase tracking-widest text-brand font-bold", children: n })
475
475
  ] })
476
476
  ] }),
477
- /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
477
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
478
478
  /* @__PURE__ */ e(
479
479
  "button",
480
480
  {
481
- onClick: l,
482
- className: "p-2 dark:hover:bg-white/10 hover:bg-slate-200/50 rounded-xl transition-colors text-muted",
481
+ onClick: p,
482
+ className: "p-2 dark:hover:bg-slate-200 dark:bg-white/10 hover:bg-slate-200/50 rounded-xl transition-colors text-muted",
483
483
  "aria-label": "Toggle theme",
484
- children: x === "dark" ? /* @__PURE__ */ e(Et, { className: "w-5 h-5" }) : /* @__PURE__ */ e(kt, { className: "w-5 h-5" })
484
+ children: N === "dark" ? /* @__PURE__ */ e(Tt, { className: "w-5 h-5" }) : /* @__PURE__ */ e(Et, { className: "w-5 h-5" })
485
485
  }
486
486
  ),
487
- o && /* @__PURE__ */ e(
487
+ l && /* @__PURE__ */ e(
488
488
  "button",
489
489
  {
490
490
  onClick: r,
491
- className: "p-2 dark:hover:bg-white/10 hover:bg-slate-200/50 rounded-full transition-colors text-muted",
491
+ className: "p-2 dark:hover:bg-slate-200 dark:bg-white/10 hover:bg-slate-200/50 rounded-full transition-colors text-muted",
492
492
  "aria-label": "Close",
493
- children: /* @__PURE__ */ e(Rt, { className: "w-5 h-5" })
493
+ children: /* @__PURE__ */ e(jt, { className: "w-5 h-5" })
494
494
  }
495
495
  )
496
496
  ] })
497
- ] }), qe = ({ children: r }) => /* @__PURE__ */ e("footer", { className: "p-8 text-center relative z-20", children: r }), ke = {
497
+ ] }), Ye = ({ children: r }) => /* @__PURE__ */ e("footer", { className: "p-8 text-center relative z-20", children: r }), Ve = {
498
498
  EN: {
499
499
  welcome_back: "Welcome back",
500
500
  enter_email: "Enter your email to receive a verification code.",
@@ -545,6 +545,8 @@ const Rt = M("X", [
545
545
  live_camera: "LIVE CAMERA",
546
546
  initializing: "INITIALIZING",
547
547
  processing_verification: "Processing Verification...",
548
+ processing_liveness: "Verifying Liveness...",
549
+ processing_documents: "Processing Documents...",
548
550
  processing_subtitle: "Validating your documents and biometrics",
549
551
  minting_identity: "Minting your Identity...",
550
552
  minting_subtitle: "Securing your decentralized identity on the Casper Network",
@@ -554,7 +556,12 @@ const Rt = M("X", [
554
556
  try_again: "Try Again",
555
557
  credential_hash: "Credential Hash",
556
558
  identity_verified: "Identity Verified",
559
+ identity_verified_subtitle: "Your liveness check passed. You are now verified.",
557
560
  identity_verified_desc: "Your CasperID has been successfully authenticated on the Casper blockchain. You're ready to go.",
561
+ submitting_for_review: "Submitting for Review...",
562
+ submitting_review_subtitle: "Your documents are being prepared for verification",
563
+ verification_submitted: "Verification Submitted",
564
+ verification_submitted_subtitle: "Your documents are under review. You'll be notified once verified.",
558
565
  share_data_consent: "Share Data Consent",
559
566
  authorize_dapps: "Authorize dApps to access your credentials",
560
567
  return_to_app: "Return to App",
@@ -617,6 +624,11 @@ const Rt = M("X", [
617
624
  perm_identity: "Verify Identity Status",
618
625
  perm_profile: "Read Public Profile",
619
626
  perm_kyc: "Share KYC Level",
627
+ "verify:identity": "Verify Identity Status",
628
+ "read:profile": "Read Public Profile",
629
+ "read:kyc_level": "Share KYC Level",
630
+ "read:email": "Access Email Address",
631
+ "read:wallet": "View Wallet Address",
620
632
  full_name: "FULL NAME",
621
633
  id_number: "ID NUMBER",
622
634
  // Passkey Auth
@@ -648,7 +660,11 @@ const Rt = M("X", [
648
660
  generating_wallet: "Generating secure wallet...",
649
661
  minting_did: "Minting your DID...",
650
662
  l1_complete: "Identity setup complete!",
651
- l1_failed: "Setup failed. Please try again."
663
+ l1_failed: "Setup failed. Please try again.",
664
+ facial_verification: "Facial Verification",
665
+ secure_face_scan_desc: "Secure Face Scan • Encrypted",
666
+ analyzing_liveness: "Analyzing Liveness",
667
+ calibration_complete: "Calibration Complete"
652
668
  },
653
669
  ES: {
654
670
  welcome_back: "Bienvenido de nuevo",
@@ -700,6 +716,8 @@ const Rt = M("X", [
700
716
  live_camera: "CÁMARA EN VIVO",
701
717
  initializing: "INICIALIZANDO",
702
718
  processing_verification: "Procesando verificación...",
719
+ processing_liveness: "Verificando vivacidad...",
720
+ processing_documents: "Procesando documentos...",
703
721
  processing_subtitle: "Validando sus documentos y biometría",
704
722
  minting_identity: "Minting identidad...",
705
723
  minting_subtitle: "Asegurando su identidad descentralizada en Casper Network",
@@ -709,7 +727,12 @@ const Rt = M("X", [
709
727
  try_again: "Intentar de nuevo",
710
728
  credential_hash: "Hash de credencial",
711
729
  identity_verified: "Identidad verificada",
730
+ identity_verified_subtitle: "Su verificación de vida fue exitosa. Ahora está verificado.",
712
731
  identity_verified_desc: "Su CasperID ha sido autenticado con éxito en la cadena de bloques Casper.",
732
+ submitting_for_review: "Enviando para revisión...",
733
+ submitting_review_subtitle: "Sus documentos están siendo preparados para verificación",
734
+ verification_submitted: "Verificación Enviada",
735
+ verification_submitted_subtitle: "Sus documentos están en revisión. Le notificaremos una vez verificado.",
713
736
  share_data_consent: "Consentimiento de datos",
714
737
  authorize_dapps: "Autorizar dApps para acceder a credenciales",
715
738
  return_to_app: "Volver a la aplicación",
@@ -772,6 +795,11 @@ const Rt = M("X", [
772
795
  perm_identity: "Verificar estado de identidad",
773
796
  perm_profile: "Leer perfil público",
774
797
  perm_kyc: "Compartir nivel de KYC",
798
+ "verify:identity": "Verificar estado de identidad",
799
+ "read:profile": "Leer perfil público",
800
+ "read:kyc_level": "Compartir nivel de KYC",
801
+ "read:email": "Acceso a correo electrónico",
802
+ "read:wallet": "Ver dirección de billetera",
775
803
  full_name: "NOMBRE COMPLETO",
776
804
  id_number: "NÚMERO DE IDENTIFICACIÓN",
777
805
  // Passkey Auth
@@ -803,7 +831,11 @@ const Rt = M("X", [
803
831
  generating_wallet: "Generando billetera segura...",
804
832
  minting_did: "Minting su DID...",
805
833
  l1_complete: "¡Configuración de identidad completa!",
806
- l1_failed: "Configuración fallida. Intente de nuevo."
834
+ l1_failed: "Configuración fallida. Intente de nuevo.",
835
+ facial_verification: "Verificación Facial",
836
+ secure_face_scan_desc: "Escaneo Facial Seguro • Encriptado",
837
+ analyzing_liveness: "Analizando Vivacidad",
838
+ calibration_complete: "Calibración Completa"
807
839
  },
808
840
  FR: {
809
841
  welcome_back: "Bon retour",
@@ -855,6 +887,8 @@ const Rt = M("X", [
855
887
  live_camera: "CAMÉRA EN DIRECT",
856
888
  initializing: "INITIALISATION",
857
889
  processing_verification: "Traitement de la vérification...",
890
+ processing_liveness: "Vérification de la vivacité...",
891
+ processing_documents: "Traitement des documents...",
858
892
  processing_subtitle: "Validation de vos documents et biométrie",
859
893
  minting_identity: "Mint Identité en cours...",
860
894
  minting_subtitle: "Sécurisation de votre identité sur le réseau Casper",
@@ -864,7 +898,12 @@ const Rt = M("X", [
864
898
  try_again: "Réessayer",
865
899
  credential_hash: "Hachage de créance",
866
900
  identity_verified: "Identité vérifiée",
901
+ identity_verified_subtitle: "Votre vérification de vivacité a réussi. Vous êtes maintenant vérifié.",
867
902
  identity_verified_desc: "Votre CasperID a été authentifié avec succès sur la blockchain Casper.",
903
+ submitting_for_review: "Soumission pour révision...",
904
+ submitting_review_subtitle: "Vos documents sont en cours de préparation pour la vérification",
905
+ verification_submitted: "Vérification Soumise",
906
+ verification_submitted_subtitle: "Vos documents sont en cours de révision. Vous serez notifié une fois vérifié.",
868
907
  share_data_consent: "Partage de données",
869
908
  authorize_dapps: "Autoriser dApps à accéder aux identifiants",
870
909
  return_to_app: "Retour à l'application",
@@ -927,6 +966,11 @@ const Rt = M("X", [
927
966
  perm_identity: "Vérifier le statut d'identité",
928
967
  perm_profile: "Lire le profil public",
929
968
  perm_kyc: "Partager le niveau KYC",
969
+ "verify:identity": "Vérifier le statut d'identité",
970
+ "read:profile": "Lire le profil public",
971
+ "read:kyc_level": "Partager le niveau KYC",
972
+ "read:email": "Accéder à l'adresse email",
973
+ "read:wallet": "Voir l'adresse du portefeuille",
930
974
  full_name: "NOM COMPLET",
931
975
  id_number: "NUMÉRO DE DOCUMENT",
932
976
  // Passkey Auth
@@ -958,7 +1002,11 @@ const Rt = M("X", [
958
1002
  generating_wallet: "Génération du portefeuille sécurisé...",
959
1003
  minting_did: "Création de votre DID...",
960
1004
  l1_complete: "Configuration d'identité terminée!",
961
- l1_failed: "Échec de la configuration. Réessayez."
1005
+ l1_failed: "Échec de la configuration. Réessayez.",
1006
+ facial_verification: "Vérification Faciale",
1007
+ secure_face_scan_desc: "Scan Facial Sécurisé • Crypté",
1008
+ analyzing_liveness: "Analyse de Vivacité",
1009
+ calibration_complete: "Calibration Terminée"
962
1010
  },
963
1011
  DE: {
964
1012
  welcome_back: "Willkommen zurück",
@@ -1010,6 +1058,8 @@ const Rt = M("X", [
1010
1058
  live_camera: "LIVE-KAMERA",
1011
1059
  initializing: "INITIALISIERUNG",
1012
1060
  processing_verification: "Verifizierung wird verarbeitet...",
1061
+ processing_liveness: "Lebendigkeitsprüfung läuft...",
1062
+ processing_documents: "Dokumente werden verarbeitet...",
1013
1063
  processing_subtitle: "Dokumente und Biometrie werden validiert",
1014
1064
  minting_identity: "Identität wird geprägt...",
1015
1065
  minting_subtitle: "Ihre dezentrale Identität wird im Casper-Netzwerk gesichert",
@@ -1019,7 +1069,12 @@ const Rt = M("X", [
1019
1069
  try_again: "Erneut versuchen",
1020
1070
  credential_hash: "Anmeldedaten-Hash",
1021
1071
  identity_verified: "Identität verifiziert",
1072
+ identity_verified_subtitle: "Ihre Lebendigkeitsprüfung war erfolgreich. Sie sind jetzt verifiziert.",
1022
1073
  identity_verified_desc: "Ihre CasperID wurde erfolgreich in der Casper-Blockchain authentifiziert.",
1074
+ submitting_for_review: "Zur Überprüfung einreichen...",
1075
+ submitting_review_subtitle: "Ihre Dokumente werden für die Verifizierung vorbereitet",
1076
+ verification_submitted: "Verifizierung eingereicht",
1077
+ verification_submitted_subtitle: "Ihre Dokumente werden überprüft. Sie werden benachrichtigt, sobald verifiziert.",
1023
1078
  share_data_consent: "Datenfreigabe",
1024
1079
  authorize_dapps: "dApps Zugriff auf Anmeldedaten erlauben",
1025
1080
  return_to_app: "Zurück zur App",
@@ -1059,6 +1114,7 @@ const Rt = M("X", [
1059
1114
  error_verify_failed: "Verifizierung nicht möglich. Bitte erneut versuchen.",
1060
1115
  error_resend_failed: "Code konnte nicht gesendet werden. Bitte erneut versuchen.",
1061
1116
  sending: "Senden...",
1117
+ facial_verification: "Gesichtsverifizierung",
1062
1118
  secure_face_scan_desc: "Sicherer Gesichtsscan • Verschlüsselt",
1063
1119
  analyzing_liveness: "Lebendigkeitsprüfung",
1064
1120
  calibration_complete: "Kalibrierung abgeschlossen",
@@ -1088,6 +1144,11 @@ const Rt = M("X", [
1088
1144
  perm_identity: "Identitätsstatus überprüfen",
1089
1145
  perm_profile: "Öffentliches Profil lesen",
1090
1146
  perm_kyc: "KYC-Level teilen",
1147
+ "verify:identity": "Identitätsstatus überprüfen",
1148
+ "read:profile": "Öffentliches Profil lesen",
1149
+ "read:kyc_level": "KYC-Level teilen",
1150
+ "read:email": "E-Mail-Adresse zugreifen",
1151
+ "read:wallet": "Wallet-Adresse anzeigen",
1091
1152
  full_name: "VOLLSTÄNDIGER NAME",
1092
1153
  id_number: "AUSWEISNUMMER",
1093
1154
  // Passkey Auth
@@ -1121,387 +1182,391 @@ const Rt = M("X", [
1121
1182
  l1_complete: "Identitätseinrichtung abgeschlossen!",
1122
1183
  l1_failed: "Einrichtung fehlgeschlagen. Erneut versuchen."
1123
1184
  }
1124
- }, t = (r, i = "EN") => {
1125
- const s = i.toUpperCase();
1126
- return (ke[s] || ke.EN)[r] || ke.EN[r] || r;
1127
- }, Pt = ({
1185
+ }, t = (r, a = "EN") => {
1186
+ const n = a.toUpperCase();
1187
+ return (Ve[n] || Ve.EN)[r] || Ve.EN[r] || r;
1188
+ }, Mt = ({
1128
1189
  onNext: r,
1129
- onExtensionSuccess: i,
1130
- onError: s,
1131
- language: o = "EN"
1190
+ onExtensionSuccess: a,
1191
+ onError: n,
1192
+ language: l = "EN",
1193
+ platform: N = "desktop"
1132
1194
  }) => {
1133
- const [x, l] = y(!1), [u, c] = y(null), [n, d] = y("");
1134
- F(() => {
1135
- m();
1136
- }, []), F(() => {
1137
- const h = (_) => {
1138
- l(!1), _.detail && _.detail.wallet && (i == null || i(_.detail));
1195
+ const [p, f] = y(!1), [m, s] = y(null), [c, d] = y("");
1196
+ ce(() => {
1197
+ D();
1198
+ }, []), ce(() => {
1199
+ const o = (I) => {
1200
+ f(!1), I.detail && I.detail.wallet && (a == null || a(I.detail));
1139
1201
  };
1140
- return window.addEventListener("casperid-login", h), () => {
1141
- window.removeEventListener("casperid-login", h);
1202
+ return window.addEventListener("casperid-login", o), () => {
1203
+ window.removeEventListener("casperid-login", o);
1142
1204
  };
1143
- }, [i]);
1144
- const m = q(() => {
1145
- const h = document.getElementById("casperid-draggable-anchor");
1146
- let _ = null;
1205
+ }, [a]);
1206
+ const D = J(() => {
1207
+ const o = document.getElementById("casperid-draggable-anchor");
1208
+ let I = null;
1147
1209
  try {
1148
- _ = localStorage.getItem("casperid_user");
1210
+ I = localStorage.getItem("casperid_user");
1149
1211
  } catch {
1150
1212
  }
1151
- return h || _ ? (c(!0), !0) : (setTimeout(() => {
1152
- const f = document.getElementById("casperid-draggable-anchor");
1153
- c(!!f);
1213
+ return o || I ? (s(!0), !0) : (setTimeout(() => {
1214
+ const g = document.getElementById("casperid-draggable-anchor");
1215
+ s(!!g);
1154
1216
  }, 500), !1);
1155
- }, []), g = (h) => typeof h == "object" && h !== null && "wallet" in h && typeof h.wallet == "string" && h.wallet.length > 0, z = async () => {
1156
- l(!0), d("");
1217
+ }, []), h = (o) => typeof o == "object" && o !== null && "wallet" in o && typeof o.wallet == "string" && o.wallet.length > 0, A = async () => {
1218
+ f(!0), d("");
1157
1219
  try {
1158
- const _ = localStorage.getItem("casperid_user");
1159
- if (_) {
1160
- const f = JSON.parse(_);
1161
- if (g(f)) {
1162
- l(!1), i == null || i(f);
1220
+ const I = localStorage.getItem("casperid_user");
1221
+ if (I) {
1222
+ const g = JSON.parse(I);
1223
+ if (h(g)) {
1224
+ f(!1), a == null || a(g);
1163
1225
  return;
1164
1226
  }
1165
1227
  }
1166
1228
  } catch {
1167
1229
  }
1168
- const h = document.getElementById("casperid-draggable-anchor");
1169
- h ? (h.click(), setTimeout(() => {
1170
- l(!1);
1230
+ const o = document.getElementById("casperid-draggable-anchor");
1231
+ o ? (o.click(), setTimeout(() => {
1232
+ f(!1);
1171
1233
  try {
1172
- localStorage.getItem("casperid_user") || d(t("extension_connect_msg", o));
1234
+ localStorage.getItem("casperid_user") || d(t("extension_connect_msg", l));
1173
1235
  } catch {
1174
- d(t("extension_connect_msg", o));
1236
+ d(t("extension_connect_msg", l));
1175
1237
  }
1176
- }, 3e3)) : (l(!1), d(t("extension_not_detected", o)), s == null || s("Extension not installed"));
1177
- }, O = () => {
1238
+ }, 3e3)) : (f(!1), d(t("extension_not_detected", l)), n == null || n("Extension not installed"));
1239
+ }, _ = () => {
1178
1240
  d(""), r("otp");
1179
1241
  };
1180
- return /* @__PURE__ */ a(
1181
- V.div,
1242
+ return /* @__PURE__ */ i(
1243
+ P.div,
1182
1244
  {
1183
1245
  initial: { opacity: 0, y: 20 },
1184
1246
  animate: { opacity: 1, y: 0 },
1185
1247
  exit: { opacity: 0, y: -20 },
1186
1248
  className: "flex-1 px-8 flex flex-col justify-center gap-8",
1187
1249
  children: [
1188
- /* @__PURE__ */ a("div", { className: "text-center space-y-3", children: [
1189
- /* @__PURE__ */ a("div", { className: "relative w-24 h-24 mx-auto mb-6", children: [
1250
+ /* @__PURE__ */ i("div", { className: "text-center space-y-3", children: [
1251
+ /* @__PURE__ */ i("div", { className: "relative w-24 h-24 mx-auto mb-6", children: [
1190
1252
  /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-brand-20 blur-2xl rounded-full" }),
1191
- /* @__PURE__ */ e("div", { className: "relative w-full h-full glass-container flex items-center justify-center rounded-2xl border border-brand-30", children: /* @__PURE__ */ e(pe, { className: "w-10 h-10 text-brand" }) })
1253
+ /* @__PURE__ */ e("div", { className: "relative w-full h-full glass-container flex items-center justify-center rounded-2xl border border-brand-30", children: /* @__PURE__ */ e(Ie, { className: "w-10 h-10 text-brand" }) })
1192
1254
  ] }),
1193
- /* @__PURE__ */ e("h1", { className: "text-2xl font-extrabold leading-tight tracking-tight text-main", children: t("welcome_back", o) }),
1194
- /* @__PURE__ */ e("p", { className: "text-muted text-sm leading-relaxed", children: t("auth_subtitle", o) })
1255
+ /* @__PURE__ */ e("h1", { className: "text-2xl font-extrabold leading-tight tracking-tight text-main", children: t("welcome_back", l) }),
1256
+ /* @__PURE__ */ e("p", { className: "text-muted text-sm leading-relaxed", children: t("auth_subtitle", l) })
1195
1257
  ] }),
1196
- n && /* @__PURE__ */ a("div", { className: "flex items-start gap-3 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-2xl", children: [
1197
- /* @__PURE__ */ e(se, { className: "w-5 h-5 text-red-500 shrink-0 mt-0.5" }),
1198
- /* @__PURE__ */ e("p", { className: "text-red-600 dark:text-red-400 text-sm font-medium", children: n })
1258
+ c && /* @__PURE__ */ i("div", { className: "flex items-start gap-3 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-2xl", children: [
1259
+ /* @__PURE__ */ e(ve, { className: "w-5 h-5 text-red-500 shrink-0 mt-0.5" }),
1260
+ /* @__PURE__ */ e("p", { className: "text-red-600 dark:text-red-400 text-sm font-medium", children: c })
1199
1261
  ] }),
1200
- /* @__PURE__ */ a("div", { className: "space-y-4", children: [
1201
- /* @__PURE__ */ a(
1262
+ /* @__PURE__ */ i("div", { className: "space-y-4", children: [
1263
+ N === "desktop" && /* @__PURE__ */ i(
1202
1264
  "button",
1203
1265
  {
1204
- onClick: z,
1205
- disabled: x,
1266
+ onClick: A,
1267
+ disabled: p,
1206
1268
  className: "w-full group relative overflow-hidden flex items-center gap-4 bg-brand hover:bg-brand-90 text-white py-5 px-6 rounded-2xl font-bold transition-all transform active:scale-[0.98] disabled:opacity-70 disabled:cursor-not-allowed shadow-brand",
1207
1269
  children: [
1208
- /* @__PURE__ */ e("div", { className: "bg-white/20 p-2 rounded-lg", children: x ? /* @__PURE__ */ e(ee, { className: "w-5 h-5 animate-spin" }) : /* @__PURE__ */ e(Ct, { className: "w-5 h-5" }) }),
1209
- /* @__PURE__ */ a("div", { className: "flex flex-col items-start", children: [
1210
- /* @__PURE__ */ e("span", { className: "text-base", children: t(x ? "connecting" : "sign_in_with_extension", o) }),
1211
- /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-widest text-white/70", children: t(u === !0 ? "extension_detected" : "secure_wallet", o) })
1270
+ /* @__PURE__ */ e("div", { className: "bg-white/20 p-2 rounded-lg", children: p ? /* @__PURE__ */ e(_e, { className: "w-5 h-5 animate-spin" }) : /* @__PURE__ */ e(Dt, { className: "w-5 h-5" }) }),
1271
+ /* @__PURE__ */ i("div", { className: "flex flex-col items-start", children: [
1272
+ /* @__PURE__ */ e("span", { className: "text-base", children: t(p ? "connecting" : "sign_in_with_extension", l) }),
1273
+ /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-widest text-slate-600 dark:text-white/70", children: t(m === !0 ? "extension_detected" : "secure_wallet", l) })
1212
1274
  ] }),
1213
- /* @__PURE__ */ e(Ie, { className: "ml-auto w-4 h-4 opacity-50 group-hover:opacity-100 transition-opacity" })
1275
+ /* @__PURE__ */ e(Le, { className: "ml-auto w-4 h-4 opacity-50 group-hover:opacity-100 transition-opacity" })
1214
1276
  ]
1215
1277
  }
1216
1278
  ),
1217
- /* @__PURE__ */ a(
1279
+ /* @__PURE__ */ i(
1218
1280
  "button",
1219
1281
  {
1220
- onClick: O,
1221
- disabled: x,
1282
+ onClick: _,
1283
+ disabled: p,
1222
1284
  className: "w-full group relative overflow-hidden flex items-center gap-4 dark:bg-white/5 bg-slate-100/50 hover:dark:bg-white/10 hover:bg-slate-200/80 border dark:border-white/10 border-slate-200 text-main py-5 px-6 rounded-2xl font-bold transition-all transform active:scale-[0.98] disabled:opacity-50",
1223
1285
  children: [
1224
- /* @__PURE__ */ e("div", { className: "bg-brand-10 p-2 rounded-lg", children: /* @__PURE__ */ e(De, { className: "w-5 h-5 text-brand" }) }),
1225
- /* @__PURE__ */ a("div", { className: "flex flex-col items-start", children: [
1226
- /* @__PURE__ */ e("span", { className: "text-base", children: t("sign_in_with_otp", o) }),
1227
- /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-widest text-brand font-bold", children: t("two_factor_auth", o) })
1286
+ /* @__PURE__ */ e("div", { className: "bg-brand-10 p-2 rounded-lg", children: /* @__PURE__ */ e(qe, { className: "w-5 h-5 text-brand" }) }),
1287
+ /* @__PURE__ */ i("div", { className: "flex flex-col items-start", children: [
1288
+ /* @__PURE__ */ e("span", { className: "text-base", children: t("sign_in_with_otp", l) }),
1289
+ /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-widest text-brand font-bold", children: t("two_factor_auth", l) })
1228
1290
  ] }),
1229
- /* @__PURE__ */ e(Ie, { className: "ml-auto w-4 h-4 opacity-50 group-hover:opacity-100 transition-opacity" })
1291
+ /* @__PURE__ */ e(Le, { className: "ml-auto w-4 h-4 opacity-50 group-hover:opacity-100 transition-opacity" })
1230
1292
  ]
1231
1293
  }
1232
1294
  )
1233
1295
  ] }),
1234
- /* @__PURE__ */ a("div", { className: "grid grid-cols-2 gap-3", children: [
1235
- /* @__PURE__ */ a("div", { className: "glass-container p-4 rounded-2xl flex flex-col items-center gap-2 text-center border-slate-200/50", children: [
1236
- /* @__PURE__ */ e(fe, { className: "w-5 h-5 text-brand" }),
1237
- /* @__PURE__ */ e("span", { className: "text-[10px] font-bold text-muted", children: t("fully_audited", o) })
1296
+ /* @__PURE__ */ i("div", { className: "grid grid-cols-2 gap-3", children: [
1297
+ /* @__PURE__ */ i("div", { className: "glass-container p-4 rounded-2xl flex flex-col items-center gap-2 text-center border-slate-200/50", children: [
1298
+ /* @__PURE__ */ e(Se, { className: "w-5 h-5 text-brand" }),
1299
+ /* @__PURE__ */ e("span", { className: "text-[10px] font-bold text-muted", children: t("fully_audited", l) })
1238
1300
  ] }),
1239
- /* @__PURE__ */ a("div", { className: "glass-container p-4 rounded-2xl flex flex-col items-center gap-2 text-center border-slate-200/50", children: [
1240
- /* @__PURE__ */ e(xe, { className: "w-5 h-5 text-brand" }),
1241
- /* @__PURE__ */ e("span", { className: "text-[10px] font-bold text-muted", children: t("non_custodial", o) })
1301
+ /* @__PURE__ */ i("div", { className: "glass-container p-4 rounded-2xl flex flex-col items-center gap-2 text-center border-slate-200/50", children: [
1302
+ /* @__PURE__ */ e(Te, { className: "w-5 h-5 text-brand" }),
1303
+ /* @__PURE__ */ e("span", { className: "text-[10px] font-bold text-muted", children: t("non_custodial", l) })
1242
1304
  ] })
1243
1305
  ] })
1244
1306
  ]
1245
1307
  }
1246
1308
  );
1247
- }, Tt = ({
1309
+ }, Lt = ({
1248
1310
  onNext: r,
1249
- onPasskeyUser: i,
1250
- onError: s,
1251
- apiBaseUrl: o = "https://apis.casperid.com",
1252
- previewMode: x = !1,
1253
- language: l = "EN"
1311
+ onPasskeyUser: a,
1312
+ onError: n,
1313
+ apiBaseUrl: l = "https://apis.casperid.com",
1314
+ apiKey: N = "",
1315
+ previewMode: p = !1,
1316
+ language: f = "EN"
1254
1317
  }) => {
1255
- const [u, c] = y(""), [n, d] = y(!1), [m, g] = y(""), z = async () => {
1256
- if (!u.trim()) {
1257
- g(t("error_email_required", l));
1318
+ const [m, s] = y(""), [c, d] = y(!1), [D, h] = y(""), A = async () => {
1319
+ if (!m.trim()) {
1320
+ h(t("error_email_required", f));
1258
1321
  return;
1259
1322
  }
1260
- if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(u)) {
1261
- g(t("error_invalid_email", l));
1323
+ if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(m)) {
1324
+ h(t("error_invalid_email", f));
1262
1325
  return;
1263
1326
  }
1264
- if (d(!0), g(""), x) {
1327
+ if (d(!0), h(""), p) {
1265
1328
  setTimeout(() => {
1266
- d(!1), r(u.trim().toLowerCase(), "mock-v-id-123456789");
1329
+ d(!1), r(m.trim().toLowerCase(), "mock-v-id-123456789");
1267
1330
  }, 1e3);
1268
1331
  return;
1269
1332
  }
1270
1333
  try {
1271
- const _ = await fetch(`${o}/api/auth/send-otp`, {
1334
+ const I = await fetch(`${l}/api/auth/send-otp`, {
1272
1335
  method: "POST",
1273
1336
  headers: {
1274
- "Content-Type": "application/json"
1337
+ "Content-Type": "application/json",
1338
+ ...N ? { "X-App-Id": N } : {}
1275
1339
  },
1276
- body: JSON.stringify({ email: u.trim().toLowerCase() })
1340
+ body: JSON.stringify({ email: m.trim().toLowerCase() })
1277
1341
  });
1278
- if (!_.ok) {
1279
- const I = await _.json().catch(() => ({}));
1280
- throw new Error(I.error || `Request failed with status ${_.status}`);
1342
+ if (!I.ok) {
1343
+ const k = await I.json().catch(() => ({}));
1344
+ throw new Error(k.error || `Request failed with status ${I.status}`);
1281
1345
  }
1282
- const f = await _.json();
1283
- if (f.success) {
1284
- if (f.userExists && f.hasPasskey) {
1285
- i ? i(u.trim().toLowerCase()) : g(t("error_passkey_registered", l)), d(!1);
1346
+ const g = await I.json();
1347
+ if (g.success) {
1348
+ if (g.userExists && g.hasPasskey) {
1349
+ a ? a(m.trim().toLowerCase()) : h(t("error_passkey_registered", f)), d(!1);
1286
1350
  return;
1287
1351
  }
1288
- f.verificationId ? r(u.trim().toLowerCase(), f.verificationId) : g(t("error_send_code_failed", l));
1352
+ g.verificationId ? r(m.trim().toLowerCase(), g.verificationId) : h(t("error_send_code_failed", f));
1289
1353
  } else
1290
- g(f.error || t("error_send_code_failed", l)), s == null || s(f.error || t("error_send_code_failed", l));
1354
+ h(g.error || t("error_send_code_failed", f)), n == null || n(g.error || t("error_send_code_failed", f));
1291
1355
  } catch {
1292
- const f = t("error_connection_failed", l);
1293
- g(f), s == null || s(f);
1356
+ const g = t("error_connection_failed", f);
1357
+ h(g), n == null || n(g);
1294
1358
  } finally {
1295
1359
  d(!1);
1296
1360
  }
1297
- }, O = (h) => {
1298
- h.key === "Enter" && !n && z();
1361
+ }, _ = (o) => {
1362
+ o.key === "Enter" && !c && A();
1299
1363
  };
1300
- return /* @__PURE__ */ a(
1301
- V.div,
1364
+ return /* @__PURE__ */ i(
1365
+ P.div,
1302
1366
  {
1303
1367
  initial: { opacity: 0, x: 20 },
1304
1368
  animate: { opacity: 1, x: 0 },
1305
1369
  exit: { opacity: 0, x: -20 },
1306
1370
  className: "flex-1 flex flex-col px-8 pt-12",
1307
1371
  children: [
1308
- /* @__PURE__ */ a("div", { className: "mb-8", children: [
1309
- /* @__PURE__ */ e("h2", { className: "text-3xl font-extrabold text-main tracking-tight leading-tight", children: t("welcome_back", l) }),
1310
- /* @__PURE__ */ e("p", { className: "text-muted mt-3 text-sm leading-relaxed", children: t("enter_email", l) })
1372
+ /* @__PURE__ */ i("div", { className: "mb-8", children: [
1373
+ /* @__PURE__ */ e("h2", { className: "text-3xl font-extrabold text-main tracking-tight leading-tight", children: t("welcome_back", f) }),
1374
+ /* @__PURE__ */ e("p", { className: "text-muted mt-3 text-sm leading-relaxed", children: t("enter_email", f) })
1311
1375
  ] }),
1312
- /* @__PURE__ */ a("div", { className: "space-y-6", children: [
1313
- /* @__PURE__ */ a("div", { className: "space-y-2", children: [
1314
- /* @__PURE__ */ e("label", { className: "text-xs font-bold text-slate-500 uppercase tracking-widest ml-1", children: t("email_address", l) }),
1315
- /* @__PURE__ */ a("div", { className: "relative", children: [
1376
+ /* @__PURE__ */ i("div", { className: "space-y-6", children: [
1377
+ /* @__PURE__ */ i("div", { className: "space-y-2", children: [
1378
+ /* @__PURE__ */ e("label", { className: "text-xs font-bold text-slate-500 uppercase tracking-widest ml-1", children: t("email_address", f) }),
1379
+ /* @__PURE__ */ i("div", { className: "relative", children: [
1316
1380
  /* @__PURE__ */ e(
1317
1381
  "input",
1318
1382
  {
1319
- className: `w-full dark:bg-black/20 bg-slate-100/50 border ${m ? "border-red-400 dark:border-red-500" : "dark:border-white/10 border-slate-200"} rounded-2xl h-14 px-5 text-main placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-brand-30 transition-all font-medium`,
1383
+ className: `w-full dark:bg-black/20 bg-slate-100/50 border ${D ? "border-red-400 dark:border-red-500" : "dark:border-white/10 border-slate-200"} rounded-2xl h-14 px-5 text-main placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-brand-30 transition-all font-medium`,
1320
1384
  placeholder: "name@example.com",
1321
1385
  type: "email",
1322
- value: u,
1323
- onChange: (h) => {
1324
- c(h.target.value), m && g("");
1386
+ value: m,
1387
+ onChange: (o) => {
1388
+ s(o.target.value), D && h("");
1325
1389
  },
1326
- onKeyDown: O,
1327
- disabled: n,
1390
+ onKeyDown: _,
1391
+ disabled: c,
1328
1392
  autoComplete: "email",
1329
1393
  autoFocus: !0
1330
1394
  }
1331
1395
  ),
1332
- /* @__PURE__ */ e("div", { className: "absolute right-4 top-1/2 -translate-y-1/2 flex items-center text-slate-400", children: /* @__PURE__ */ e(wt, { className: "w-5 h-5" }) })
1396
+ /* @__PURE__ */ e("div", { className: "absolute right-4 top-1/2 -translate-y-1/2 flex items-center text-slate-400", children: /* @__PURE__ */ e(St, { className: "w-5 h-5" }) })
1333
1397
  ] }),
1334
- m && /* @__PURE__ */ e("p", { className: "text-red-500 text-xs font-medium ml-1 mt-1", children: m })
1398
+ D && /* @__PURE__ */ e("p", { className: "text-red-500 text-xs font-medium ml-1 mt-1", children: D })
1335
1399
  ] }),
1336
1400
  /* @__PURE__ */ e(
1337
1401
  "button",
1338
1402
  {
1339
- onClick: z,
1340
- disabled: n,
1403
+ onClick: A,
1404
+ disabled: c,
1341
1405
  className: "w-full h-14 bg-brand hover:bg-brand/90 text-white font-bold rounded-2xl shadow-xl shadow-brand flex items-center justify-center gap-2 transition-transform active:scale-[0.98] disabled:opacity-70 disabled:cursor-not-allowed",
1342
- children: n ? /* @__PURE__ */ a($, { children: [
1343
- /* @__PURE__ */ e(ee, { className: "w-5 h-5 animate-spin" }),
1344
- /* @__PURE__ */ e("span", { children: t("sending_code", l) })
1345
- ] }) : /* @__PURE__ */ a($, { children: [
1346
- /* @__PURE__ */ e("span", { children: t("continue", l) }),
1347
- /* @__PURE__ */ e(Se, { className: "w-5 h-5" })
1406
+ children: c ? /* @__PURE__ */ i(re, { children: [
1407
+ /* @__PURE__ */ e(_e, { className: "w-5 h-5 animate-spin" }),
1408
+ /* @__PURE__ */ e("span", { children: t("sending_code", f) })
1409
+ ] }) : /* @__PURE__ */ i(re, { children: [
1410
+ /* @__PURE__ */ e("span", { children: t("continue", f) }),
1411
+ /* @__PURE__ */ e(Oe, { className: "w-5 h-5" })
1348
1412
  ] })
1349
1413
  }
1350
1414
  )
1351
1415
  ] }),
1352
- /* @__PURE__ */ a("div", { className: "mt-auto pb-8", children: [
1353
- /* @__PURE__ */ e("div", { className: "p-4 dark:bg-white/5 bg-slate-100/50 rounded-2xl mb-6", children: /* @__PURE__ */ a("div", { className: "flex items-start gap-3", children: [
1354
- /* @__PURE__ */ e(Ee, { className: "text-[#6DE8EC] w-5 h-5 mt-0.5 shrink-0" }),
1355
- /* @__PURE__ */ e("p", { className: "text-[11px] text-muted leading-normal font-medium", children: t("security_notice", l) })
1416
+ /* @__PURE__ */ i("div", { className: "mt-auto pb-8", children: [
1417
+ /* @__PURE__ */ e("div", { className: "p-4 dark:bg-white/5 bg-slate-100/50 rounded-2xl mb-6", children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
1418
+ /* @__PURE__ */ e(Fe, { className: "text-[#6DE8EC] w-5 h-5 mt-0.5 shrink-0" }),
1419
+ /* @__PURE__ */ e("p", { className: "text-[11px] text-muted leading-normal font-medium", children: t("security_notice", f) })
1356
1420
  ] }) }),
1357
- /* @__PURE__ */ a("div", { className: "flex items-center justify-center gap-2 opacity-50", children: [
1358
- /* @__PURE__ */ e(Ae, { className: "text-muted w-3 h-3" }),
1359
- /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.2em] font-bold text-muted", children: t("e2e_encrypted", l) })
1421
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-center gap-2 opacity-50", children: [
1422
+ /* @__PURE__ */ e(tt, { className: "text-muted w-3 h-3" }),
1423
+ /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.2em] font-bold text-muted", children: t("e2e_encrypted", f) })
1360
1424
  ] })
1361
1425
  ] })
1362
1426
  ]
1363
1427
  }
1364
1428
  );
1365
1429
  };
1366
- function ie(r) {
1367
- const i = new Uint8Array(r);
1368
- let s = "";
1369
- for (let o = 0; o < i.byteLength; o++)
1370
- s += String.fromCharCode(i[o]);
1371
- return btoa(s).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
1430
+ function xe(r) {
1431
+ const a = new Uint8Array(r);
1432
+ let n = "";
1433
+ for (let l = 0; l < a.byteLength; l++)
1434
+ n += String.fromCharCode(a[l]);
1435
+ return btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
1372
1436
  }
1373
- function me(r) {
1374
- const i = "=".repeat((4 - r.length % 4) % 4), s = r.replace(/-/g, "+").replace(/_/g, "/") + i, o = atob(s), x = new Uint8Array(o.length);
1375
- for (let l = 0; l < o.length; l++)
1376
- x[l] = o.charCodeAt(l);
1377
- return x.buffer;
1437
+ function Ne(r) {
1438
+ const a = "=".repeat((4 - r.length % 4) % 4), n = r.replace(/-/g, "+").replace(/_/g, "/") + a, l = atob(n), N = new Uint8Array(l.length);
1439
+ for (let p = 0; p < l.length; p++)
1440
+ N[p] = l.charCodeAt(p);
1441
+ return N.buffer;
1378
1442
  }
1379
- function be() {
1443
+ function Ee() {
1380
1444
  return !!(window.PublicKeyCredential && typeof window.PublicKeyCredential == "function");
1381
1445
  }
1382
- async function Ye() {
1383
- if (!be()) return !1;
1446
+ async function at() {
1447
+ if (!Ee()) return !1;
1384
1448
  try {
1385
1449
  return await PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable();
1386
1450
  } catch {
1387
1451
  return !1;
1388
1452
  }
1389
1453
  }
1390
- function zt() {
1454
+ function Ot() {
1391
1455
  const r = navigator.userAgent.toLowerCase();
1392
1456
  return /iphone|ipod|android.*mobile|windows phone|blackberry/i.test(r) ? "mobile" : /ipad|android(?!.*mobile)|tablet/i.test(r) ? "tablet" : "desktop";
1393
1457
  }
1394
- function jt() {
1458
+ function Ft() {
1395
1459
  return {
1396
1460
  platform: navigator.platform || "unknown",
1397
1461
  userAgent: navigator.userAgent,
1398
- deviceType: zt()
1462
+ deviceType: Ot()
1399
1463
  };
1400
1464
  }
1401
- function Mt(r) {
1402
- var i;
1465
+ function qt(r) {
1466
+ var a;
1403
1467
  return {
1404
1468
  ...r,
1405
- challenge: me(r.challenge),
1469
+ challenge: Ne(r.challenge),
1406
1470
  user: {
1407
1471
  ...r.user,
1408
- id: me(r.user.id)
1472
+ id: Ne(r.user.id)
1409
1473
  },
1410
- excludeCredentials: (i = r.excludeCredentials) == null ? void 0 : i.map((s) => ({
1411
- ...s,
1412
- id: me(s.id)
1474
+ excludeCredentials: (a = r.excludeCredentials) == null ? void 0 : a.map((n) => ({
1475
+ ...n,
1476
+ id: Ne(n.id)
1413
1477
  }))
1414
1478
  };
1415
1479
  }
1416
- function Ot(r) {
1417
- var i;
1480
+ function Ut(r) {
1481
+ var a;
1418
1482
  return {
1419
1483
  ...r,
1420
- challenge: me(r.challenge),
1421
- allowCredentials: (i = r.allowCredentials) == null ? void 0 : i.map((s) => ({
1422
- ...s,
1423
- id: me(s.id)
1484
+ challenge: Ne(r.challenge),
1485
+ allowCredentials: (a = r.allowCredentials) == null ? void 0 : a.map((n) => ({
1486
+ ...n,
1487
+ id: Ne(n.id)
1424
1488
  }))
1425
1489
  };
1426
1490
  }
1427
- function Vt(r) {
1428
- const i = r.response;
1491
+ function $t(r) {
1492
+ const a = r.response;
1429
1493
  return {
1430
1494
  id: r.id,
1431
- rawId: ie(r.rawId),
1495
+ rawId: xe(r.rawId),
1432
1496
  type: r.type,
1433
1497
  response: {
1434
- clientDataJSON: ie(i.clientDataJSON),
1435
- attestationObject: ie(i.attestationObject)
1498
+ clientDataJSON: xe(a.clientDataJSON),
1499
+ attestationObject: xe(a.attestationObject)
1436
1500
  },
1437
1501
  clientExtensionResults: r.getClientExtensionResults(),
1438
- deviceInfo: jt()
1502
+ deviceInfo: Ft()
1439
1503
  };
1440
1504
  }
1441
- function Lt(r) {
1442
- const i = r.response;
1505
+ function Bt(r) {
1506
+ const a = r.response;
1443
1507
  return {
1444
1508
  id: r.id,
1445
- rawId: ie(r.rawId),
1509
+ rawId: xe(r.rawId),
1446
1510
  type: r.type,
1447
1511
  response: {
1448
- clientDataJSON: ie(i.clientDataJSON),
1449
- authenticatorData: ie(i.authenticatorData),
1450
- signature: ie(i.signature),
1451
- userHandle: i.userHandle ? ie(i.userHandle) : null
1512
+ clientDataJSON: xe(a.clientDataJSON),
1513
+ authenticatorData: xe(a.authenticatorData),
1514
+ signature: xe(a.signature),
1515
+ userHandle: a.userHandle ? xe(a.userHandle) : null
1452
1516
  },
1453
1517
  clientExtensionResults: r.getClientExtensionResults()
1454
1518
  };
1455
1519
  }
1456
- async function qt(r) {
1457
- if (!be())
1520
+ async function Ht(r) {
1521
+ if (!Ee())
1458
1522
  throw new Error("WebAuthn is not supported in this browser");
1459
- const i = Mt(r), s = await navigator.credentials.create({
1460
- publicKey: i
1523
+ const a = qt(r), n = await navigator.credentials.create({
1524
+ publicKey: a
1461
1525
  });
1462
- if (!s)
1526
+ if (!n)
1463
1527
  throw new Error("Passkey creation was cancelled or failed");
1464
- return Vt(s);
1528
+ return $t(n);
1465
1529
  }
1466
- async function Ut(r) {
1467
- if (!be())
1530
+ async function Wt(r) {
1531
+ if (!Ee())
1468
1532
  throw new Error("WebAuthn is not supported in this browser");
1469
- const i = Ot(r), s = await navigator.credentials.get({
1470
- publicKey: i
1533
+ const a = Ut(r), n = await navigator.credentials.get({
1534
+ publicKey: a
1471
1535
  });
1472
- if (!s)
1536
+ if (!n)
1473
1537
  throw new Error("Passkey authentication was cancelled or failed");
1474
- return Lt(s);
1538
+ return Bt(n);
1475
1539
  }
1476
- const $t = ({
1540
+ const Yt = ({
1477
1541
  email: r,
1478
- onSuccess: i,
1479
- onError: s,
1480
- onFallbackToOTP: o,
1481
- apiBaseUrl: x = "https://apis.casperid.com",
1482
- previewMode: l = !1,
1483
- language: u = "EN"
1542
+ onSuccess: a,
1543
+ onError: n,
1544
+ onFallbackToOTP: l,
1545
+ apiBaseUrl: N = "https://apis.casperid.com",
1546
+ apiKey: p = "",
1547
+ previewMode: f = !1,
1548
+ language: m = "EN"
1484
1549
  }) => {
1485
- const [c, n] = y(!1), [d, m] = y(""), [g, z] = y(!0), [O, h] = y(!1);
1486
- F(() => {
1550
+ const [s, c] = y(!1), [d, D] = y(""), [h, A] = y(!0), [_, o] = y(!1);
1551
+ ce(() => {
1487
1552
  (async () => {
1488
- const I = be(), T = await Ye();
1489
- z(I && T), (!I || !T) && m(t("webauthn_not_supported", u));
1553
+ const k = Ee(), V = await at();
1554
+ A(k && V), (!k || !V) && D(t("webauthn_not_supported", m));
1490
1555
  })();
1491
- }, [u]), F(() => {
1492
- if (g && !O && !l) {
1493
- h(!0);
1494
- const f = setTimeout(() => {
1495
- _();
1556
+ }, [m]), ce(() => {
1557
+ if (h && !_ && !f) {
1558
+ o(!0);
1559
+ const g = setTimeout(() => {
1560
+ I();
1496
1561
  }, 500);
1497
- return () => clearTimeout(f);
1562
+ return () => clearTimeout(g);
1498
1563
  }
1499
- }, [g, O, l]);
1500
- const _ = async () => {
1501
- if (!c) {
1502
- if (n(!0), m(""), l) {
1564
+ }, [h, _, f]);
1565
+ const I = async () => {
1566
+ if (!s) {
1567
+ if (c(!0), D(""), f) {
1503
1568
  setTimeout(() => {
1504
- n(!1), i("mock-session-token", {
1569
+ c(!1), a("mock-session-token", {
1505
1570
  user_id: "mock-user-id",
1506
1571
  email: r,
1507
1572
  tier: "layer_1"
@@ -1510,138 +1575,146 @@ const $t = ({
1510
1575
  return;
1511
1576
  }
1512
1577
  try {
1513
- const f = await fetch(`${x}/api/passkey/auth/begin`, {
1578
+ const g = await fetch(`${N}/api/passkey/auth/begin`, {
1514
1579
  method: "POST",
1515
- headers: { "Content-Type": "application/json" },
1580
+ headers: {
1581
+ "Content-Type": "application/json",
1582
+ ...p ? { "X-App-Id": p } : {}
1583
+ },
1516
1584
  credentials: "include",
1517
1585
  body: JSON.stringify({ email: r })
1518
1586
  });
1519
- if (!f.ok) {
1520
- const j = await f.json().catch(() => ({}));
1521
- throw new Error(j.error || "Failed to initialize authentication");
1587
+ if (!g.ok) {
1588
+ const Y = await g.json().catch(() => ({}));
1589
+ throw new Error(Y.error || "Failed to initialize authentication");
1522
1590
  }
1523
- const I = await f.json();
1524
- if (!I.success || !I.options)
1525
- throw new Error(I.error || "Invalid authentication options");
1526
- const T = await Ut(I.options), C = await fetch(`${x}/api/passkey/auth/finish`, {
1591
+ const k = await g.json();
1592
+ if (!k.success || !k.options)
1593
+ throw new Error(k.error || "Invalid authentication options");
1594
+ const V = await Wt(k.options), w = await fetch(`${N}/api/passkey/auth/finish`, {
1527
1595
  method: "POST",
1528
- headers: { "Content-Type": "application/json" },
1596
+ headers: {
1597
+ "Content-Type": "application/json",
1598
+ ...p ? { "X-App-Id": p } : {}
1599
+ },
1529
1600
  credentials: "include",
1530
1601
  body: JSON.stringify({
1531
1602
  email: r,
1532
- credential: T
1603
+ challengeId: k.challengeId,
1604
+ credential: V
1533
1605
  })
1534
1606
  });
1535
- if (!C.ok) {
1536
- const j = await C.json().catch(() => ({}));
1537
- throw new Error(j.error || "Authentication failed");
1607
+ if (!w.ok) {
1608
+ const Y = await w.json().catch(() => ({}));
1609
+ throw new Error(Y.error || "Authentication failed");
1538
1610
  }
1539
- const N = await C.json();
1540
- if (N.success && N.session_token)
1541
- i(N.session_token, N.user, N.business_token);
1611
+ const T = await w.json();
1612
+ if (T.success && T.session_token)
1613
+ a(T.session_token, T.user, T.business_token);
1542
1614
  else
1543
- throw new Error(N.error || "Authentication failed");
1544
- } catch (f) {
1545
- const I = f instanceof Error ? f.message : "Authentication failed";
1546
- I.includes("cancelled") || I.includes("NotAllowedError") ? m(t("passkey_cancelled", u)) : (m(I), s == null || s(I));
1615
+ throw new Error(T.error || "Authentication failed");
1616
+ } catch (g) {
1617
+ const k = g instanceof Error ? g.message : "Authentication failed";
1618
+ k.includes("cancelled") || k.includes("NotAllowedError") ? D(t("passkey_cancelled", m)) : (D(k), n == null || n(k));
1547
1619
  } finally {
1548
- n(!1);
1620
+ c(!1);
1549
1621
  }
1550
1622
  }
1551
1623
  };
1552
- return /* @__PURE__ */ a(
1553
- V.div,
1624
+ return /* @__PURE__ */ i(
1625
+ P.div,
1554
1626
  {
1555
1627
  initial: { opacity: 0, x: 20 },
1556
1628
  animate: { opacity: 1, x: 0 },
1557
1629
  exit: { opacity: 0, x: -20 },
1558
1630
  className: "flex-1 flex flex-col px-8 pt-12",
1559
1631
  children: [
1560
- /* @__PURE__ */ a("div", { className: "mb-8", children: [
1561
- /* @__PURE__ */ e("h2", { className: "text-3xl font-extrabold text-main tracking-tight leading-tight", children: t("welcome_back", u) }),
1562
- /* @__PURE__ */ e("p", { className: "text-muted mt-3 text-sm leading-relaxed", children: t("passkey_auth_subtitle", u) })
1632
+ /* @__PURE__ */ i("div", { className: "mb-8", children: [
1633
+ /* @__PURE__ */ e("h2", { className: "text-3xl font-extrabold text-main tracking-tight leading-tight", children: t("welcome_back", m) }),
1634
+ /* @__PURE__ */ e("p", { className: "text-muted mt-3 text-sm leading-relaxed", children: t("passkey_auth_subtitle", m) })
1563
1635
  ] }),
1564
- /* @__PURE__ */ a("div", { className: "mb-6 p-4 dark:bg-white/5 bg-slate-100/50 rounded-2xl", children: [
1565
- /* @__PURE__ */ e("p", { className: "text-xs text-muted mb-1", children: t("signing_in_as", u) }),
1636
+ /* @__PURE__ */ i("div", { className: "mb-6 p-4 dark:bg-white/5 bg-slate-100/50 rounded-2xl", children: [
1637
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted mb-1", children: t("signing_in_as", m) }),
1566
1638
  /* @__PURE__ */ e("p", { className: "text-main font-semibold", children: r })
1567
1639
  ] }),
1568
- /* @__PURE__ */ a("div", { className: "flex-1 flex flex-col items-center justify-center py-8", children: [
1640
+ /* @__PURE__ */ i("div", { className: "flex-1 flex flex-col items-center justify-center py-8", children: [
1569
1641
  /* @__PURE__ */ e(
1570
- V.div,
1642
+ P.div,
1571
1643
  {
1572
- animate: c ? {
1644
+ animate: s ? {
1573
1645
  scale: [1, 1.1, 1],
1574
1646
  opacity: [1, 0.7, 1]
1575
1647
  } : {},
1576
1648
  transition: {
1577
1649
  duration: 1.5,
1578
- repeat: c ? 1 / 0 : 0,
1650
+ repeat: s ? 1 / 0 : 0,
1579
1651
  ease: "easeInOut"
1580
1652
  },
1581
- className: `w-24 h-24 rounded-full flex items-center justify-center mb-6 ${c ? "bg-brand/20 border-2 border-brand" : d ? "bg-red-500/10 border-2 border-red-400" : "bg-brand/10 border-2 border-brand/30"}`,
1582
- children: c ? /* @__PURE__ */ e(ee, { className: "w-10 h-10 text-brand animate-spin" }) : d ? /* @__PURE__ */ e(se, { className: "w-10 h-10 text-red-400" }) : /* @__PURE__ */ e(pe, { className: "w-10 h-10 text-brand" })
1653
+ className: `w-24 h-24 rounded-full flex items-center justify-center mb-6 ${s ? "bg-brand/20 border-2 border-brand" : d ? "bg-red-500/10 border-2 border-red-400" : "bg-brand/10 border-2 border-brand/30"}`,
1654
+ children: s ? /* @__PURE__ */ e(_e, { className: "w-10 h-10 text-brand animate-spin" }) : d ? /* @__PURE__ */ e(ve, { className: "w-10 h-10 text-red-400" }) : /* @__PURE__ */ e(Ie, { className: "w-10 h-10 text-brand" })
1583
1655
  }
1584
1656
  ),
1585
- /* @__PURE__ */ e("p", { className: "text-main font-semibold text-center mb-2", children: t(c ? "authenticating" : d ? "authentication_failed" : "use_passkey", u) }),
1657
+ /* @__PURE__ */ e("p", { className: "text-main font-semibold text-center mb-2", children: t(s ? "authenticating" : d ? "authentication_failed" : "use_passkey", m) }),
1586
1658
  d && /* @__PURE__ */ e("p", { className: "text-red-500 text-sm text-center mb-4 max-w-xs", children: d }),
1587
- !c && /* @__PURE__ */ e("p", { className: "text-muted text-sm text-center max-w-xs", children: t("passkey_auth_hint", u) })
1659
+ !s && /* @__PURE__ */ e("p", { className: "text-muted text-sm text-center max-w-xs", children: t("passkey_auth_hint", m) })
1588
1660
  ] }),
1589
- /* @__PURE__ */ a("div", { className: "space-y-3 pb-8", children: [
1590
- !c && /* @__PURE__ */ e(
1661
+ /* @__PURE__ */ i("div", { className: "space-y-3 pb-8", children: [
1662
+ !s && /* @__PURE__ */ e(
1591
1663
  "button",
1592
1664
  {
1593
- onClick: _,
1594
- disabled: !g,
1665
+ onClick: I,
1666
+ disabled: !h,
1595
1667
  className: "w-full h-14 bg-brand hover:bg-brand/90 text-white font-bold rounded-2xl shadow-xl shadow-brand/30 flex items-center justify-center gap-2 transition-transform active:scale-[0.98] disabled:opacity-50 disabled:cursor-not-allowed",
1596
- children: d ? /* @__PURE__ */ a($, { children: [
1597
- /* @__PURE__ */ e(xe, { className: "w-5 h-5" }),
1598
- /* @__PURE__ */ e("span", { children: t("try_again", u) })
1599
- ] }) : /* @__PURE__ */ a($, { children: [
1600
- /* @__PURE__ */ e(pe, { className: "w-5 h-5" }),
1601
- /* @__PURE__ */ e("span", { children: t("authenticate", u) })
1668
+ children: d ? /* @__PURE__ */ i(re, { children: [
1669
+ /* @__PURE__ */ e(Te, { className: "w-5 h-5" }),
1670
+ /* @__PURE__ */ e("span", { children: t("try_again", m) })
1671
+ ] }) : /* @__PURE__ */ i(re, { children: [
1672
+ /* @__PURE__ */ e(Ie, { className: "w-5 h-5" }),
1673
+ /* @__PURE__ */ e("span", { children: t("authenticate", m) })
1602
1674
  ] })
1603
1675
  }
1604
1676
  ),
1605
- o && /* @__PURE__ */ e(
1677
+ l && /* @__PURE__ */ e(
1606
1678
  "button",
1607
1679
  {
1608
- onClick: o,
1609
- disabled: c,
1680
+ onClick: l,
1681
+ disabled: s,
1610
1682
  className: "w-full h-12 bg-transparent border dark:border-white/10 border-slate-200 text-muted hover:text-main font-medium rounded-2xl flex items-center justify-center gap-2 transition-colors disabled:opacity-50",
1611
- children: t("use_email_instead", u)
1683
+ children: t("use_email_instead", m)
1612
1684
  }
1613
1685
  )
1614
1686
  ] }),
1615
- /* @__PURE__ */ a("div", { className: "flex items-center justify-center gap-2 pb-4 opacity-50", children: [
1616
- /* @__PURE__ */ e(fe, { className: "text-muted w-3 h-3" }),
1617
- /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.2em] font-bold text-muted", children: t("biometric_secured", u) })
1687
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-center gap-2 pb-4 opacity-50", children: [
1688
+ /* @__PURE__ */ e(Se, { className: "text-muted w-3 h-3" }),
1689
+ /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.2em] font-bold text-muted", children: t("biometric_secured", m) })
1618
1690
  ] })
1619
1691
  ]
1620
1692
  }
1621
1693
  );
1622
- }, Ft = ({
1694
+ }, Gt = ({
1623
1695
  email: r,
1624
- sessionToken: i,
1625
- onSuccess: s,
1626
- onError: o,
1627
- onSkip: x,
1628
- apiBaseUrl: l = "https://apis.casperid.com",
1629
- previewMode: u = !1,
1630
- language: c = "EN"
1696
+ sessionToken: a,
1697
+ onSuccess: n,
1698
+ onError: l,
1699
+ onSkip: N,
1700
+ apiBaseUrl: p = "https://apis.casperid.com",
1701
+ apiKey: f = "",
1702
+ previewMode: m = !1,
1703
+ language: s = "EN"
1631
1704
  }) => {
1632
- const [n, d] = y(!1), [m, g] = y(""), [z, O] = y(!0), [h, _] = y(!1);
1633
- F(() => {
1705
+ const [c, d] = y(!1), [D, h] = y(""), [A, _] = y(!0), [o, I] = y(!1);
1706
+ ce(() => {
1634
1707
  (async () => {
1635
- const C = be(), N = await Ye();
1636
- O(C && N), (!C || !N) && g(t("webauthn_not_supported", c));
1708
+ const w = Ee(), T = await at();
1709
+ _(w && T), (!w || !T) && h(t("webauthn_not_supported", s));
1637
1710
  })();
1638
- }, [c]);
1639
- const f = async () => {
1640
- if (!n) {
1641
- if (d(!0), g(""), u) {
1711
+ }, [s]);
1712
+ const g = async () => {
1713
+ if (!c) {
1714
+ if (d(!0), h(""), m) {
1642
1715
  setTimeout(() => {
1643
- d(!1), _(!0), setTimeout(() => {
1644
- s({
1716
+ d(!1), I(!0), setTimeout(() => {
1717
+ n({
1645
1718
  user_id: "mock-user-id",
1646
1719
  email: r,
1647
1720
  tier: "layer_0"
@@ -1651,333 +1724,335 @@ const $t = ({
1651
1724
  return;
1652
1725
  }
1653
1726
  try {
1654
- const T = await fetch(`${l}/api/passkey/register/begin`, {
1727
+ const V = await fetch(`${p}/api/passkey/register/begin`, {
1655
1728
  method: "POST",
1656
1729
  headers: {
1657
1730
  "Content-Type": "application/json",
1658
- Authorization: `Bearer ${i}`
1731
+ Authorization: `Bearer ${a}`,
1732
+ ...f ? { "X-App-Id": f } : {}
1659
1733
  },
1660
1734
  credentials: "include",
1661
1735
  body: JSON.stringify({ email: r })
1662
1736
  });
1663
- if (!T.ok) {
1664
- const R = await T.json().catch(() => ({}));
1665
- throw new Error(R.error || "Failed to initialize registration");
1737
+ if (!V.ok) {
1738
+ const B = await V.json().catch(() => ({}));
1739
+ throw new Error(B.error || "Failed to initialize registration");
1666
1740
  }
1667
- const C = await T.json();
1668
- if (!C.success || !C.options)
1669
- throw new Error(C.error || "Invalid registration options");
1670
- const N = await qt(C.options), j = await fetch(`${l}/api/passkey/register/finish`, {
1741
+ const w = await V.json();
1742
+ if (!w.success || !w.options)
1743
+ throw new Error(w.error || "Invalid registration options");
1744
+ const T = await Ht(w.options), Y = await fetch(`${p}/api/passkey/register/finish`, {
1671
1745
  method: "POST",
1672
1746
  headers: {
1673
1747
  "Content-Type": "application/json",
1674
- Authorization: `Bearer ${i}`
1748
+ Authorization: `Bearer ${a}`,
1749
+ ...f ? { "X-App-Id": f } : {}
1675
1750
  },
1676
1751
  credentials: "include",
1677
1752
  body: JSON.stringify({
1678
- userId: C.userId,
1679
- credential: N,
1753
+ userId: w.userId,
1754
+ credential: T,
1680
1755
  deviceInfo: {
1681
1756
  userAgent: navigator.userAgent
1682
1757
  }
1683
1758
  })
1684
1759
  });
1685
- if (!j.ok) {
1686
- const R = await j.json().catch(() => ({}));
1687
- throw new Error(R.error || "Registration failed");
1760
+ if (!Y.ok) {
1761
+ const B = await Y.json().catch(() => ({}));
1762
+ throw new Error(B.error || "Registration failed");
1688
1763
  }
1689
- const E = await j.json();
1690
- if (E.success)
1691
- _(!0), setTimeout(() => {
1692
- s(E.user, E.business_token);
1764
+ const W = await Y.json();
1765
+ if (W.success)
1766
+ I(!0), setTimeout(() => {
1767
+ n(W.user, W.business_token);
1693
1768
  }, 1e3);
1694
1769
  else
1695
- throw new Error(E.error || "Registration failed");
1696
- } catch (T) {
1697
- const C = T instanceof Error ? T.message : "Registration failed";
1698
- C.includes("cancelled") || C.includes("NotAllowedError") ? g(t("passkey_cancelled", c)) : (g(C), o == null || o(C));
1770
+ throw new Error(W.error || "Registration failed");
1771
+ } catch (V) {
1772
+ const w = V instanceof Error ? V.message : "Registration failed";
1773
+ w.includes("cancelled") || w.includes("NotAllowedError") ? h(t("passkey_cancelled", s)) : (h(w), l == null || l(w));
1699
1774
  } finally {
1700
1775
  d(!1);
1701
1776
  }
1702
1777
  }
1703
- }, I = [
1704
- { icon: vt, text: t("passkey_benefit_1", c) },
1705
- { icon: fe, text: t("passkey_benefit_2", c) },
1706
- { icon: De, text: t("passkey_benefit_3", c) }
1778
+ }, k = [
1779
+ { icon: Ct, text: t("passkey_benefit_1", s) },
1780
+ { icon: Se, text: t("passkey_benefit_2", s) },
1781
+ { icon: qe, text: t("passkey_benefit_3", s) }
1707
1782
  ];
1708
- return /* @__PURE__ */ a(
1709
- V.div,
1783
+ return /* @__PURE__ */ i(
1784
+ P.div,
1710
1785
  {
1711
1786
  initial: { opacity: 0, x: 20 },
1712
1787
  animate: { opacity: 1, x: 0 },
1713
1788
  exit: { opacity: 0, x: -20 },
1714
1789
  className: "flex-1 flex flex-col px-8 pt-12",
1715
1790
  children: [
1716
- /* @__PURE__ */ a("div", { className: "mb-8", children: [
1717
- /* @__PURE__ */ e("h2", { className: "text-3xl font-extrabold text-main tracking-tight leading-tight", children: t("create_passkey", c) }),
1718
- /* @__PURE__ */ e("p", { className: "text-muted mt-3 text-sm leading-relaxed", children: t("passkey_register_subtitle", c) })
1791
+ /* @__PURE__ */ i("div", { className: "mb-8", children: [
1792
+ /* @__PURE__ */ e("h2", { className: "text-3xl font-extrabold text-main tracking-tight leading-tight", children: t("create_passkey", s) }),
1793
+ /* @__PURE__ */ e("p", { className: "text-muted mt-3 text-sm leading-relaxed", children: t("passkey_register_subtitle", s) })
1719
1794
  ] }),
1720
- /* @__PURE__ */ a("div", { className: "mb-6 p-4 dark:bg-white/5 bg-slate-100/50 rounded-2xl", children: [
1721
- /* @__PURE__ */ e("p", { className: "text-xs text-muted mb-1", children: t("signing_in_as", c) }),
1795
+ /* @__PURE__ */ i("div", { className: "mb-6 p-4 dark:bg-white/5 bg-slate-100/50 rounded-2xl", children: [
1796
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted mb-1", children: t("signing_in_as", s) }),
1722
1797
  /* @__PURE__ */ e("p", { className: "text-main font-semibold", children: r })
1723
1798
  ] }),
1724
- /* @__PURE__ */ a("div", { className: "mb-8", children: [
1725
- /* @__PURE__ */ e("p", { className: "text-sm font-semibold text-main mb-4", children: t("passkey_benefits_title", c) }),
1726
- /* @__PURE__ */ e("div", { className: "space-y-3", children: I.map((T, C) => /* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
1727
- /* @__PURE__ */ e("div", { className: "w-10 h-10 rounded-xl bg-brand/10 flex items-center justify-center", children: /* @__PURE__ */ e(T.icon, { className: "w-5 h-5 text-brand" }) }),
1728
- /* @__PURE__ */ e("span", { className: "text-sm text-muted", children: T.text })
1729
- ] }, C)) })
1799
+ /* @__PURE__ */ i("div", { className: "mb-8", children: [
1800
+ /* @__PURE__ */ e("p", { className: "text-sm font-semibold text-main mb-4", children: t("passkey_benefits_title", s) }),
1801
+ /* @__PURE__ */ e("div", { className: "space-y-3", children: k.map((V, w) => /* @__PURE__ */ i("div", { className: "flex items-center gap-3", children: [
1802
+ /* @__PURE__ */ e("div", { className: "w-10 h-10 rounded-xl bg-brand/10 flex items-center justify-center", children: /* @__PURE__ */ e(V.icon, { className: "w-5 h-5 text-brand" }) }),
1803
+ /* @__PURE__ */ e("span", { className: "text-sm text-muted", children: V.text })
1804
+ ] }, w)) })
1730
1805
  ] }),
1731
- (n || h || m) && /* @__PURE__ */ a("div", { className: "flex-1 flex flex-col items-center justify-center py-4", children: [
1806
+ (c || o || D) && /* @__PURE__ */ i("div", { className: "flex-1 flex flex-col items-center justify-center py-4", children: [
1732
1807
  /* @__PURE__ */ e(
1733
- V.div,
1808
+ P.div,
1734
1809
  {
1735
- animate: n ? {
1810
+ animate: c ? {
1736
1811
  scale: [1, 1.1, 1],
1737
1812
  opacity: [1, 0.7, 1]
1738
1813
  } : {},
1739
1814
  transition: {
1740
1815
  duration: 1.5,
1741
- repeat: n ? 1 / 0 : 0,
1816
+ repeat: c ? 1 / 0 : 0,
1742
1817
  ease: "easeInOut"
1743
1818
  },
1744
- className: `w-20 h-20 rounded-full flex items-center justify-center mb-4 ${h ? "bg-green-500/20 border-2 border-green-400" : n ? "bg-brand/20 border-2 border-brand" : "bg-red-500/10 border-2 border-red-400"}`,
1745
- children: h ? /* @__PURE__ */ e(he, { className: "w-10 h-10 text-green-400" }) : n ? /* @__PURE__ */ e(ee, { className: "w-10 h-10 text-brand animate-spin" }) : /* @__PURE__ */ e(se, { className: "w-10 h-10 text-red-400" })
1819
+ className: `w-20 h-20 rounded-full flex items-center justify-center mb-4 ${o ? "bg-green-500/20 border-2 border-green-400" : c ? "bg-brand/20 border-2 border-brand" : "bg-red-500/10 border-2 border-red-400"}`,
1820
+ children: o ? /* @__PURE__ */ e(Ce, { className: "w-10 h-10 text-green-400" }) : c ? /* @__PURE__ */ e(_e, { className: "w-10 h-10 text-brand animate-spin" }) : /* @__PURE__ */ e(ve, { className: "w-10 h-10 text-red-400" })
1746
1821
  }
1747
1822
  ),
1748
- /* @__PURE__ */ e("p", { className: "text-main font-semibold text-center", children: t(h ? "passkey_created" : n ? "creating_passkey" : "passkey_create_failed", c) }),
1749
- m && /* @__PURE__ */ e("p", { className: "text-red-500 text-sm text-center mt-2 max-w-xs", children: m })
1823
+ /* @__PURE__ */ e("p", { className: "text-main font-semibold text-center", children: t(o ? "passkey_created" : c ? "creating_passkey" : "passkey_create_failed", s) }),
1824
+ D && /* @__PURE__ */ e("p", { className: "text-red-500 text-sm text-center mt-2 max-w-xs", children: D })
1750
1825
  ] }),
1751
- /* @__PURE__ */ a("div", { className: "mt-auto space-y-3 pb-8", children: [
1752
- !h && /* @__PURE__ */ e(
1826
+ /* @__PURE__ */ i("div", { className: "mt-auto space-y-3 pb-8", children: [
1827
+ !o && /* @__PURE__ */ e(
1753
1828
  "button",
1754
1829
  {
1755
- onClick: f,
1756
- disabled: !z || n,
1830
+ onClick: g,
1831
+ disabled: !A || c,
1757
1832
  className: "w-full h-14 bg-brand hover:bg-brand/90 text-white font-bold rounded-2xl shadow-xl shadow-brand/30 flex items-center justify-center gap-2 transition-transform active:scale-[0.98] disabled:opacity-50 disabled:cursor-not-allowed",
1758
- children: n ? /* @__PURE__ */ a($, { children: [
1759
- /* @__PURE__ */ e(ee, { className: "w-5 h-5 animate-spin" }),
1760
- /* @__PURE__ */ e("span", { children: t("creating_passkey", c) })
1761
- ] }) : /* @__PURE__ */ a($, { children: [
1762
- /* @__PURE__ */ e(pe, { className: "w-5 h-5" }),
1763
- /* @__PURE__ */ e("span", { children: t("register_passkey", c) })
1833
+ children: c ? /* @__PURE__ */ i(re, { children: [
1834
+ /* @__PURE__ */ e(_e, { className: "w-5 h-5 animate-spin" }),
1835
+ /* @__PURE__ */ e("span", { children: t("creating_passkey", s) })
1836
+ ] }) : /* @__PURE__ */ i(re, { children: [
1837
+ /* @__PURE__ */ e(Ie, { className: "w-5 h-5" }),
1838
+ /* @__PURE__ */ e("span", { children: t("register_passkey", s) })
1764
1839
  ] })
1765
1840
  }
1766
1841
  ),
1767
- x && !n && !h && /* @__PURE__ */ e(
1842
+ N && !c && !o && /* @__PURE__ */ e(
1768
1843
  "button",
1769
1844
  {
1770
- onClick: x,
1845
+ onClick: N,
1771
1846
  className: "w-full h-12 bg-transparent border dark:border-white/10 border-slate-200 text-muted hover:text-main font-medium rounded-2xl flex items-center justify-center transition-colors",
1772
- children: t("do_this_later", c)
1847
+ children: t("do_this_later", s)
1773
1848
  }
1774
1849
  )
1775
1850
  ] }),
1776
- /* @__PURE__ */ a("div", { className: "flex items-center justify-center gap-2 pb-4 opacity-50", children: [
1777
- /* @__PURE__ */ e(Ae, { className: "text-muted w-3 h-3" }),
1778
- /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.2em] font-bold text-muted", children: t("e2e_encrypted", c) })
1851
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-center gap-2 pb-4 opacity-50", children: [
1852
+ /* @__PURE__ */ e(tt, { className: "text-muted w-3 h-3" }),
1853
+ /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.2em] font-bold text-muted", children: t("e2e_encrypted", s) })
1779
1854
  ] })
1780
1855
  ]
1781
1856
  }
1782
1857
  );
1783
- }, Bt = ({
1858
+ }, Jt = ({
1784
1859
  email: r,
1785
- verificationId: i,
1786
- onNext: s,
1787
- onError: o,
1788
- apiBaseUrl: x = "https://apis.casperid.com",
1789
- apiKey: l,
1790
- previewMode: u = !1,
1791
- language: c = "EN"
1860
+ verificationId: a,
1861
+ onNext: n,
1862
+ onError: l,
1863
+ apiBaseUrl: N = "https://apis.casperid.com",
1864
+ apiKey: p,
1865
+ previewMode: f = !1,
1866
+ language: m = "EN"
1792
1867
  }) => {
1793
- const [n, d] = y(["", "", "", "", "", ""]), [m, g] = y(!1), [z, O] = y(!1), [h, _] = y(""), [f, I] = y(0), [T, C] = y(i);
1794
- F(() => {
1795
- if (f > 0) {
1796
- const v = setTimeout(() => I(f - 1), 1e3);
1797
- return () => clearTimeout(v);
1868
+ const [s, c] = y(["", "", "", "", "", ""]), [d, D] = y(!1), [h, A] = y(!1), [_, o] = y(""), [I, g] = y(0), [k, V] = y(a);
1869
+ ce(() => {
1870
+ if (I > 0) {
1871
+ const b = setTimeout(() => g(I - 1), 1e3);
1872
+ return () => clearTimeout(b);
1798
1873
  }
1799
- }, [f]), F(() => {
1800
- n.every((v) => v !== "") && !m && E();
1801
- }, [n]);
1802
- const N = q((v) => {
1803
- _(""), d((k) => {
1804
- const w = [...k], A = w.findIndex((P) => P === "");
1805
- return A !== -1 && (w[A] = v), w;
1874
+ }, [I]), ce(() => {
1875
+ s.every((b) => b !== "") && !d && Y();
1876
+ }, [s]);
1877
+ const w = J((b) => {
1878
+ o(""), c((C) => {
1879
+ const S = [...C], L = S.findIndex((O) => O === "");
1880
+ return L !== -1 && (S[L] = b), S;
1806
1881
  });
1807
- }, []), j = q(() => {
1808
- _(""), d((v) => {
1809
- const k = [...v];
1810
- for (let w = k.length - 1; w >= 0; w--)
1811
- if (k[w] !== "") {
1812
- k[w] = "";
1882
+ }, []), T = J(() => {
1883
+ o(""), c((b) => {
1884
+ const C = [...b];
1885
+ for (let S = C.length - 1; S >= 0; S--)
1886
+ if (C[S] !== "") {
1887
+ C[S] = "";
1813
1888
  break;
1814
1889
  }
1815
- return k;
1890
+ return C;
1816
1891
  });
1817
1892
  }, []);
1818
- F(() => {
1819
- const v = (k) => {
1820
- m || (/^[0-9]$/.test(k.key) ? (k.preventDefault(), N(k.key)) : (k.key === "Backspace" || k.key === "Delete") && (k.preventDefault(), j()));
1893
+ ce(() => {
1894
+ const b = (C) => {
1895
+ d || (/^[0-9]$/.test(C.key) ? (C.preventDefault(), w(C.key)) : (C.key === "Backspace" || C.key === "Delete") && (C.preventDefault(), T()));
1821
1896
  };
1822
- return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
1823
- }, [m, N, j]);
1824
- const E = async () => {
1825
- const v = n.join("");
1826
- if (v.length !== 6) {
1827
- _(t("error_pin_incomplete", c));
1897
+ return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
1898
+ }, [d, w, T]);
1899
+ const Y = async () => {
1900
+ const b = s.join("");
1901
+ if (b.length !== 6) {
1902
+ o(t("error_pin_incomplete", m));
1828
1903
  return;
1829
1904
  }
1830
- if (g(!0), _(""), u) {
1905
+ if (D(!0), o(""), f) {
1831
1906
  setTimeout(() => {
1832
- g(!1), s("mock-session-token", null);
1907
+ D(!1), n("mock-session-token", null);
1833
1908
  }, 1e3);
1834
1909
  return;
1835
1910
  }
1836
1911
  try {
1837
- const k = await fetch(`${x}/api/auth/verify-otp`, {
1912
+ const C = await fetch(`${N}/api/auth/verify-otp`, {
1838
1913
  method: "POST",
1839
1914
  headers: {
1840
1915
  "Content-Type": "application/json",
1841
- "X-App-ID": l || ""
1916
+ "X-App-ID": p || ""
1842
1917
  },
1843
1918
  body: JSON.stringify({
1844
- verificationId: T,
1845
- otp: v
1919
+ verificationId: k,
1920
+ otp: b
1846
1921
  })
1847
1922
  });
1848
- if (!k.ok) {
1849
- const A = await k.json().catch(() => ({}));
1850
- throw new Error(A.error || `Verification failed with status ${k.status}`);
1923
+ if (!C.ok) {
1924
+ const L = await C.json().catch(() => ({}));
1925
+ throw new Error(L.error || `Verification failed with status ${C.status}`);
1851
1926
  }
1852
- const w = await k.json();
1853
- w.success && w.sessionToken ? s(w.sessionToken, w.userAccount, w.business_token) : (_(w.error || t("invalid_code", c)), w.attemptsLeft !== void 0 && _(t("invalid_code_attempts", c).replace("{attempts}", w.attemptsLeft.toString())), d(["", "", "", "", "", ""]), o == null || o(w.error || t("verification_failed", c)));
1927
+ const S = await C.json();
1928
+ S.success && S.sessionToken ? n(S.sessionToken, S.userAccount, S.business_token) : (o(S.error || t("invalid_code", m)), S.attemptsLeft !== void 0 && o(t("invalid_code_attempts", m).replace("{attempts}", S.attemptsLeft.toString())), c(["", "", "", "", "", ""]), l == null || l(S.error || t("verification_failed", m)));
1854
1929
  } catch {
1855
- const w = t("error_verify_failed", c);
1856
- _(w), d(["", "", "", "", "", ""]), o == null || o(w);
1930
+ const S = t("error_verify_failed", m);
1931
+ o(S), c(["", "", "", "", "", ""]), l == null || l(S);
1857
1932
  } finally {
1858
- g(!1);
1933
+ D(!1);
1859
1934
  }
1860
- }, R = async () => {
1861
- if (!(f > 0 || z)) {
1862
- if (O(!0), _(""), u) {
1935
+ }, W = async () => {
1936
+ if (!(I > 0 || h)) {
1937
+ if (A(!0), o(""), f) {
1863
1938
  setTimeout(() => {
1864
- O(!1), I(60), d(["", "", "", "", "", ""]);
1939
+ A(!1), g(60), c(["", "", "", "", "", ""]);
1865
1940
  }, 800);
1866
1941
  return;
1867
1942
  }
1868
1943
  try {
1869
- const v = await fetch(`${x}/api/auth/resend-otp`, {
1944
+ const b = await fetch(`${N}/api/auth/resend-otp`, {
1870
1945
  method: "POST",
1871
1946
  headers: {
1872
1947
  "Content-Type": "application/json"
1873
1948
  },
1874
- body: JSON.stringify({ verificationId: T })
1949
+ body: JSON.stringify({ verificationId: k })
1875
1950
  });
1876
- if (!v.ok) {
1877
- const w = await v.json().catch(() => ({}));
1878
- throw new Error(w.error || `Request failed with status ${v.status}`);
1951
+ if (!b.ok) {
1952
+ const S = await b.json().catch(() => ({}));
1953
+ throw new Error(S.error || `Request failed with status ${b.status}`);
1879
1954
  }
1880
- const k = await v.json();
1881
- k.success ? (I(60), d(["", "", "", "", "", ""])) : _(k.error || t("error_resend_failed", c));
1955
+ const C = await b.json();
1956
+ C.success ? (g(60), c(["", "", "", "", "", ""])) : o(C.error || t("error_resend_failed", m));
1882
1957
  } catch {
1883
- _(t("error_resend_failed", c));
1958
+ o(t("error_resend_failed", m));
1884
1959
  } finally {
1885
- O(!1);
1960
+ A(!1);
1886
1961
  }
1887
1962
  }
1888
- }, U = r.replace(/(.{2})(.*)(@.*)/, "$1***$3");
1889
- return /* @__PURE__ */ a(
1890
- V.div,
1963
+ }, B = r.replace(/(.{2})(.*)(@.*)/, "$1***$3");
1964
+ return /* @__PURE__ */ i(
1965
+ P.div,
1891
1966
  {
1892
1967
  initial: { opacity: 0, scale: 0.95 },
1893
1968
  animate: { opacity: 1, scale: 1 },
1894
1969
  exit: { opacity: 0, scale: 1.05 },
1895
1970
  className: "flex-1 flex flex-col px-8 pt-12",
1896
1971
  children: [
1897
- /* @__PURE__ */ a("div", { className: "space-y-2 mb-8", children: [
1898
- /* @__PURE__ */ e("h1", { className: "text-3xl font-bold tracking-tight text-main", children: t("verify_email", c) }),
1899
- /* @__PURE__ */ a("p", { className: "text-muted text-sm font-medium", children: [
1900
- t("enter_code", c),
1972
+ /* @__PURE__ */ i("div", { className: "space-y-2 mb-8", children: [
1973
+ /* @__PURE__ */ e("h1", { className: "text-3xl font-bold tracking-tight text-main", children: t("verify_email", m) }),
1974
+ /* @__PURE__ */ i("p", { className: "text-muted text-sm font-medium", children: [
1975
+ t("enter_code", m),
1901
1976
  " ",
1902
- /* @__PURE__ */ e("span", { className: "text-main font-semibold", children: U })
1977
+ /* @__PURE__ */ e("span", { className: "text-main font-semibold", children: B })
1903
1978
  ] })
1904
1979
  ] }),
1905
- /* @__PURE__ */ e("div", { className: "flex justify-between gap-2 mb-6", children: n.map((v, k) => /* @__PURE__ */ a(
1980
+ /* @__PURE__ */ e("div", { className: "flex justify-between gap-2 mb-6", children: s.map((b, C) => /* @__PURE__ */ i(
1906
1981
  "div",
1907
1982
  {
1908
- className: `size-12 rounded-2xl dark:bg-black/20 bg-slate-100/50 flex items-center justify-center text-xl font-bold border transition-all ${v ? "text-brand dark:border-brand-30 border-brand-50" : "text-muted dark:border-white/10 border-slate-200"} ${h ? "border-red-400 dark:border-red-500" : ""}`,
1983
+ className: `size-12 rounded-2xl dark:bg-black/20 bg-slate-100/50 flex items-center justify-center text-xl font-bold border transition-all ${b ? "text-brand dark:border-brand-30 border-brand-50" : "text-muted dark:border-white/10 border-slate-200"} ${_ ? "border-red-400 dark:border-red-500" : ""}`,
1909
1984
  children: [
1910
- v,
1911
- !v && n.findIndex((w) => w === "") === k && /* @__PURE__ */ e("div", { className: "w-0.5 h-6 bg-brand animate-pulse" })
1985
+ b,
1986
+ !b && s.findIndex((S) => S === "") === C && /* @__PURE__ */ e("div", { className: "w-0.5 h-6 bg-brand animate-pulse" })
1912
1987
  ]
1913
1988
  },
1914
- k
1989
+ C
1915
1990
  )) }),
1916
- h && /* @__PURE__ */ e("p", { className: "text-red-500 text-xs font-medium text-center mb-4", children: h }),
1917
- /* @__PURE__ */ a("div", { className: "grid grid-cols-3 gap-4 mb-8", children: [
1918
- [1, 2, 3, 4, 5, 6, 7, 8, 9].map((v) => /* @__PURE__ */ e(
1991
+ _ && /* @__PURE__ */ e("p", { className: "text-red-500 text-xs font-medium text-center mb-4", children: _ }),
1992
+ /* @__PURE__ */ i("div", { className: "grid grid-cols-3 gap-4 mb-8", children: [
1993
+ [1, 2, 3, 4, 5, 6, 7, 8, 9].map((b) => /* @__PURE__ */ e(
1919
1994
  "button",
1920
1995
  {
1921
- onClick: () => N(v.toString()),
1922
- disabled: m,
1923
- className: "h-14 rounded-2xl dark:hover:bg-white/5 hover:bg-slate-100 flex items-center justify-center text-xl font-bold transition-colors text-main disabled:opacity-50",
1924
- children: v
1996
+ onClick: () => w(b.toString()),
1997
+ disabled: d,
1998
+ className: "h-14 rounded-2xl dark:hover:bg-slate-100 dark:bg-white/5 hover:bg-slate-100 flex items-center justify-center text-xl font-bold transition-colors text-main disabled:opacity-50",
1999
+ children: b
1925
2000
  },
1926
- v
2001
+ b
1927
2002
  )),
1928
2003
  /* @__PURE__ */ e("div", { className: "h-14" }),
1929
2004
  /* @__PURE__ */ e(
1930
2005
  "button",
1931
2006
  {
1932
- onClick: () => N("0"),
1933
- disabled: m,
1934
- className: "h-14 rounded-2xl dark:hover:bg-white/5 hover:bg-slate-100 flex items-center justify-center text-xl font-bold transition-colors text-main disabled:opacity-50",
2007
+ onClick: () => w("0"),
2008
+ disabled: d,
2009
+ className: "h-14 rounded-2xl dark:hover:bg-slate-100 dark:bg-white/5 hover:bg-slate-100 flex items-center justify-center text-xl font-bold transition-colors text-main disabled:opacity-50",
1935
2010
  children: "0"
1936
2011
  }
1937
2012
  ),
1938
2013
  /* @__PURE__ */ e(
1939
2014
  "button",
1940
2015
  {
1941
- onClick: j,
1942
- disabled: m,
1943
- className: "h-14 rounded-2xl dark:hover:bg-white/5 hover:bg-slate-100 flex items-center justify-center transition-colors text-main disabled:opacity-50",
1944
- children: /* @__PURE__ */ e(xt, { className: "w-6 h-6" })
2016
+ onClick: T,
2017
+ disabled: d,
2018
+ className: "h-14 rounded-2xl dark:hover:bg-slate-100 dark:bg-white/5 hover:bg-slate-100 flex items-center justify-center transition-colors text-main disabled:opacity-50",
2019
+ children: /* @__PURE__ */ e(Nt, { className: "w-6 h-6" })
1945
2020
  }
1946
2021
  )
1947
2022
  ] }),
1948
- /* @__PURE__ */ a("div", { className: "mt-auto pb-8 space-y-4", children: [
2023
+ /* @__PURE__ */ i("div", { className: "mt-auto pb-8 space-y-4", children: [
1949
2024
  /* @__PURE__ */ e(
1950
2025
  "button",
1951
2026
  {
1952
- onClick: E,
1953
- disabled: m || n.some((v) => v === ""),
2027
+ onClick: Y,
2028
+ disabled: d || s.some((b) => b === ""),
1954
2029
  className: "w-full h-14 bg-brand hover:bg-brand/90 text-white font-bold rounded-2xl transition-all shadow-lg shadow-brand flex items-center justify-center gap-2 group disabled:opacity-50 disabled:cursor-not-allowed",
1955
- children: m ? /* @__PURE__ */ a($, { children: [
1956
- /* @__PURE__ */ e(ee, { className: "w-5 h-5 animate-spin" }),
1957
- /* @__PURE__ */ e("span", { children: t("verifying", c) })
1958
- ] }) : /* @__PURE__ */ a($, { children: [
1959
- /* @__PURE__ */ e("span", { children: t("verify", c) }),
1960
- /* @__PURE__ */ e(Se, { className: "w-5 h-5 group-hover:translate-x-1 transition-transform" })
2030
+ children: d ? /* @__PURE__ */ i(re, { children: [
2031
+ /* @__PURE__ */ e(_e, { className: "w-5 h-5 animate-spin" }),
2032
+ /* @__PURE__ */ e("span", { children: t("verifying", m) })
2033
+ ] }) : /* @__PURE__ */ i(re, { children: [
2034
+ /* @__PURE__ */ e("span", { children: t("verify", m) }),
2035
+ /* @__PURE__ */ e(Oe, { className: "w-5 h-5 group-hover:translate-x-1 transition-transform" })
1961
2036
  ] })
1962
2037
  }
1963
2038
  ),
1964
2039
  /* @__PURE__ */ e(
1965
2040
  "button",
1966
2041
  {
1967
- onClick: R,
1968
- disabled: f > 0 || z,
2042
+ onClick: W,
2043
+ disabled: I > 0 || h,
1969
2044
  className: "w-full h-14 dark:bg-white/5 hover:dark:bg-white/10 bg-slate-100 hover:bg-slate-200 text-muted font-bold rounded-2xl transition-all border dark:border-white/10 border-slate-200 flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",
1970
- children: z ? /* @__PURE__ */ a($, { children: [
1971
- /* @__PURE__ */ e(ee, { className: "w-4 h-4 animate-spin" }),
1972
- /* @__PURE__ */ e("span", { children: t("sending", c) })
1973
- ] }) : f > 0 ? /* @__PURE__ */ a("span", { children: [
1974
- t("resend_code", c),
2045
+ children: h ? /* @__PURE__ */ i(re, { children: [
2046
+ /* @__PURE__ */ e(_e, { className: "w-4 h-4 animate-spin" }),
2047
+ /* @__PURE__ */ e("span", { children: t("sending", m) })
2048
+ ] }) : I > 0 ? /* @__PURE__ */ i("span", { children: [
2049
+ t("resend_code", m),
1975
2050
  " (",
1976
- f,
2051
+ I,
1977
2052
  "s)"
1978
- ] }) : /* @__PURE__ */ a($, { children: [
1979
- /* @__PURE__ */ e(xe, { className: "w-4 h-4" }),
1980
- /* @__PURE__ */ e("span", { children: t("resend_code", c) })
2053
+ ] }) : /* @__PURE__ */ i(re, { children: [
2054
+ /* @__PURE__ */ e(Te, { className: "w-4 h-4" }),
2055
+ /* @__PURE__ */ e("span", { children: t("resend_code", m) })
1981
2056
  ] })
1982
2057
  }
1983
2058
  )
@@ -1985,20 +2060,20 @@ const $t = ({
1985
2060
  ]
1986
2061
  }
1987
2062
  );
1988
- }, Ht = ({ onNext: r, onSkip: i, language: s = "EN" }) => /* @__PURE__ */ a(
1989
- V.div,
2063
+ }, Kt = ({ onNext: r, onSkip: a, language: n = "EN" }) => /* @__PURE__ */ i(
2064
+ P.div,
1990
2065
  {
1991
2066
  initial: { opacity: 0 },
1992
2067
  animate: { opacity: 1 },
1993
2068
  exit: { opacity: 0 },
1994
2069
  className: "flex-1 flex flex-col",
1995
2070
  children: [
1996
- /* @__PURE__ */ a("div", { className: "p-6 pb-2", children: [
1997
- /* @__PURE__ */ a("div", { className: "flex justify-between items-center mb-4", children: [
1998
- /* @__PURE__ */ e("span", { className: "text-xs font-semibold uppercase tracking-widest text-brand/80", children: t("verification_step", s) }),
1999
- /* @__PURE__ */ e("span", { className: "text-xs font-bold text-muted", children: t("kyc_required", s) })
2071
+ /* @__PURE__ */ i("div", { className: "p-6 pb-2", children: [
2072
+ /* @__PURE__ */ i("div", { className: "flex justify-between items-center mb-4", children: [
2073
+ /* @__PURE__ */ e("span", { className: "text-xs font-semibold uppercase tracking-widest text-brand/80", children: t("verification_step", n) }),
2074
+ /* @__PURE__ */ e("span", { className: "text-xs font-bold text-muted", children: t("kyc_required", n) })
2000
2075
  ] }),
2001
- /* @__PURE__ */ e("div", { className: "w-full bg-brand/10 h-1.5 rounded-full overflow-hidden", children: /* @__PURE__ */ e(
2076
+ /* @__PURE__ */ e("div", { className: "w-full bg-brand-10 h-1.5 rounded-full overflow-hidden", children: /* @__PURE__ */ e(
2002
2077
  "div",
2003
2078
  {
2004
2079
  className: "bg-brand h-full rounded-full",
@@ -2006,319 +2081,411 @@ const $t = ({
2006
2081
  }
2007
2082
  ) })
2008
2083
  ] }),
2009
- /* @__PURE__ */ a("div", { className: "flex-1 flex flex-col items-center justify-center px-8 text-center gap-8", children: [
2010
- /* @__PURE__ */ a("div", { className: "relative group", children: [
2084
+ /* @__PURE__ */ i("div", { className: "flex-1 flex flex-col items-center justify-center px-8 text-center gap-8", children: [
2085
+ /* @__PURE__ */ i("div", { className: "relative group", children: [
2011
2086
  /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-cyan-400/20 blur-3xl rounded-full scale-75 group-hover:scale-100 transition-transform duration-500" }),
2012
- /* @__PURE__ */ e("div", { className: "relative w-32 h-32 rounded-full bg-gradient-to-tr from-brand-20 to-brand-5 flex items-center justify-center border border-brand-30 shadow-inner", children: /* @__PURE__ */ e(Ee, { className: "w-16 h-16 text-brand" }) }),
2013
- /* @__PURE__ */ e("div", { className: "absolute bottom-1 right-1 w-8 h-8 rounded-full dark:bg-[#171220] bg-white border-2 border-brand flex items-center justify-center", children: /* @__PURE__ */ e(xe, { className: "w-4 h-4 text-brand" }) })
2087
+ /* @__PURE__ */ e("div", { className: "relative w-32 h-32 rounded-full bg-gradient-to-tr from-brand-20 to-brand-5 flex items-center justify-center border border-brand-30 shadow-inner", children: /* @__PURE__ */ e(Fe, { className: "w-16 h-16 text-brand" }) }),
2088
+ /* @__PURE__ */ e("div", { className: "absolute bottom-1 right-1 w-8 h-8 rounded-full glass-container border-2 border-brand flex items-center justify-center", children: /* @__PURE__ */ e(Te, { className: "w-4 h-4 text-brand" }) })
2014
2089
  ] }),
2015
- /* @__PURE__ */ a("div", { className: "space-y-4", children: [
2016
- /* @__PURE__ */ e("h1", { className: "text-2xl font-bold tracking-tight text-main leading-tight", children: t("security_upgrade_required", s) }),
2017
- /* @__PURE__ */ e("p", { className: "text-muted text-base leading-relaxed font-medium", children: t("security_upgrade_desc", s) })
2090
+ /* @__PURE__ */ i("div", { className: "space-y-4", children: [
2091
+ /* @__PURE__ */ e("h1", { className: "text-2xl font-bold tracking-tight text-main leading-tight", children: t("security_upgrade_required", n) }),
2092
+ /* @__PURE__ */ e("p", { className: "text-muted text-base leading-relaxed font-medium", children: t("security_upgrade_desc", n) })
2018
2093
  ] }),
2019
- /* @__PURE__ */ a("div", { className: "flex flex-wrap justify-center gap-2", children: [
2020
- /* @__PURE__ */ e("span", { className: "px-3 py-1 bg-brand/10 rounded-xl text-[10px] font-bold text-brand uppercase tracking-tighter border border-brand-10", children: t("biometric_secure", s) }),
2021
- /* @__PURE__ */ e("span", { className: "px-3 py-1 bg-cyan-400/10 rounded-xl text-[10px] font-bold text-cyan-500 uppercase tracking-tighter border border-cyan-400/10", children: t("zero_knowledge", s) })
2094
+ /* @__PURE__ */ i("div", { className: "flex flex-wrap justify-center gap-2", children: [
2095
+ /* @__PURE__ */ e("span", { className: "px-3 py-1 bg-brand/10 rounded-xl text-[10px] font-bold text-brand uppercase tracking-tighter border border-brand-10", children: t("biometric_secure", n) }),
2096
+ /* @__PURE__ */ e("span", { className: "px-3 py-1 bg-cyan-400/10 rounded-xl text-[10px] font-bold text-cyan-500 uppercase tracking-tighter border border-cyan-400/10", children: t("zero_knowledge", n) })
2022
2097
  ] })
2023
2098
  ] }),
2024
- /* @__PURE__ */ a("div", { className: "p-8 space-y-4", children: [
2099
+ /* @__PURE__ */ i("div", { className: "p-8 space-y-4", children: [
2025
2100
  /* @__PURE__ */ e(
2026
2101
  "button",
2027
2102
  {
2028
2103
  onClick: r,
2029
2104
  className: "w-full bg-brand hover:bg-brand/90 text-white rounded-2xl py-4 font-bold text-lg shadow-xl shadow-brand transition-all active:scale-[0.98]",
2030
- children: t("start_upgrade", s)
2105
+ children: t("start_upgrade", n)
2031
2106
  }
2032
2107
  ),
2033
- i && /* @__PURE__ */ e(
2108
+ a && /* @__PURE__ */ e(
2034
2109
  "button",
2035
2110
  {
2036
- onClick: i,
2037
- className: "w-full dark:text-slate-400 text-slate-500 text-sm font-bold dark:hover:text-slate-200 hover:text-slate-800 transition-colors",
2038
- children: t("do_this_later", s)
2111
+ onClick: a,
2112
+ className: "w-full text-muted text-sm font-bold hover:text-main transition-colors",
2113
+ children: t("do_this_later", n)
2039
2114
  }
2040
2115
  )
2041
2116
  ] })
2042
2117
  ]
2043
2118
  }
2044
- ), de = [
2045
- "position_face",
2046
- "blink_slowly",
2047
- "turn_head_left",
2048
- "turn_head_right",
2049
- "processing"
2050
- ], Kt = ({
2119
+ ), ke = [
2120
+ "Position your face in the frame",
2121
+ "Blink 3 times naturally",
2122
+ "Open your mouth",
2123
+ "Hold still",
2124
+ "Processing verification..."
2125
+ ], Pe = (r, a) => Math.sqrt(Math.pow(r.x - a.x, 2) + Math.pow(r.y - a.y, 2)), Zt = ({
2051
2126
  requestId: r,
2052
- onNext: i,
2053
- onError: s,
2054
- apiBaseUrl: o = "https://apis.casperid.com",
2055
- previewMode: x = !1,
2056
- language: l = "EN"
2127
+ onNext: a,
2128
+ onError: n,
2129
+ apiBaseUrl: l = "https://apis.casperid.com",
2130
+ apiKey: N = "",
2131
+ previewMode: p = !1,
2132
+ language: f = "EN"
2057
2133
  }) => {
2058
- const u = re(null), c = re(null), n = re(null), d = re([]), [m, g] = y(0), [z, O] = y(!1), [h, _] = y(""), [f, I] = y(!1), [T, C] = y(!1);
2059
- F(() => ((async () => {
2134
+ const m = se(null), s = se(null), c = se(null), d = se([]), D = se(null), h = se(null), [A, _] = y(0), [o, I] = y(!1), [g, k] = y(""), [V, w] = y(!1), [T, Y] = y(!1), [W, B] = y(0), [b, C] = y(!1), [S, L] = y(0), O = se(0), F = se(0), G = se(!1), Q = se(0), de = se(!1), ue = (v) => {
2135
+ O.current = v, _(v);
2136
+ }, te = (v) => {
2137
+ F.current = v, B(v);
2138
+ }, ie = (v) => {
2139
+ G.current = v, C(v);
2140
+ }, q = (v) => {
2141
+ Q.current = v, L(v);
2142
+ }, pe = A === 0 ? 0 : A === 1 ? W / 3 * 100 : A === 2 ? S : A === 3 ? 100 : Math.min(100, Math.round(A / (ke.length - 1) * 100));
2143
+ ce(() => ((async () => {
2060
2144
  try {
2061
- const R = await navigator.mediaDevices.getUserMedia({
2062
- video: { facingMode: "user", width: 640, height: 480 }
2063
- });
2064
- n.current = R, u.current && (u.current.srcObject = R, u.current.onloadedmetadata = () => {
2065
- O(!0);
2145
+ const { FaceMesh: M } = await import("./face_mesh-DYMPc5Ce.js").then((z) => z.f), { Camera: Z } = await import("./camera_utils-BQaOSBPu.js").then((z) => z.c), fe = new M({
2146
+ locateFile: (z) => `https://cdn.jsdelivr.net/npm/@mediapipe/face_mesh/${z}`
2066
2147
  });
2067
- } catch (R) {
2068
- R.name === "NotAllowedError" ? (C(!0), _(t("camera_permission_denied", l))) : _(t("unable_access_camera", l)), s == null || s("Camera access failed");
2148
+ if (fe.setOptions({
2149
+ maxNumFaces: 1,
2150
+ refineLandmarks: !0,
2151
+ minDetectionConfidence: 0.3,
2152
+ minTrackingConfidence: 0.3
2153
+ }), console.log("✅ MediaPipe FaceMesh loaded successfully"), fe.onResults(K), D.current = fe, m.current) {
2154
+ const z = new Z(m.current, {
2155
+ onFrame: async () => {
2156
+ D.current && m.current && await D.current.send({ image: m.current });
2157
+ },
2158
+ width: 640,
2159
+ height: 480
2160
+ });
2161
+ await z.start(), h.current = z, I(!0), console.log("📹 Camera started successfully");
2162
+ }
2163
+ } catch (M) {
2164
+ console.error("FaceMesh initialization error:", M), M.name === "NotAllowedError" ? (Y(!0), k("Camera permission denied. Please enable camera access.")) : k("Unable to initialize face detection. Please try again."), n == null || n("FaceMesh initialization failed");
2069
2165
  }
2070
2166
  })(), () => {
2071
- n.current && n.current.getTracks().forEach((R) => R.stop());
2072
- }), [s]), q(() => {
2073
- if (!u.current || !c.current) return null;
2074
- const E = c.current, R = u.current, U = E.getContext("2d");
2075
- return U ? (E.width = R.videoWidth, E.height = R.videoHeight, U.drawImage(R, 0, 0), new Promise((v) => {
2076
- E.toBlob((k) => v(k), "image/jpeg", 0.8);
2077
- })) : null;
2078
- }, []), F(() => {
2079
- if (!z || f) return;
2080
- const R = setTimeout(async () => {
2081
- const U = await new Promise((v) => {
2082
- if (!u.current || !c.current) {
2083
- v(null);
2084
- return;
2085
- }
2086
- const k = c.current, w = u.current, A = k.getContext("2d");
2087
- if (!A) {
2088
- v(null);
2089
- return;
2090
- }
2091
- k.width = w.videoWidth, k.height = w.videoHeight, A.drawImage(w, 0, 0), k.toBlob((P) => v(P), "image/jpeg", 0.8);
2092
- });
2093
- U && d.current.push(U), m < de.length - 1 ? g((v) => v + 1) : N();
2094
- }, 2500);
2095
- return () => clearTimeout(R);
2096
- }, [m, z, f]);
2097
- const N = async () => {
2098
- var E;
2099
- if (I(!0), g(4), x) {
2167
+ h.current && h.current.stop(), c.current && c.current.getTracks().forEach((M) => M.stop());
2168
+ }), []);
2169
+ const K = (v) => {
2170
+ if (!s.current || V) return;
2171
+ const M = s.current, Z = M.getContext("2d");
2172
+ if (!(!Z || !v.image))
2173
+ if (Z.save(), Z.clearRect(0, 0, M.width, M.height), Z.translate(M.width, 0), Z.scale(-1, 1), Z.drawImage(v.image, 0, 0, M.width, M.height), Z.restore(), v.multiFaceLandmarks && v.multiFaceLandmarks.length > 0) {
2174
+ const fe = v.multiFaceLandmarks[0];
2175
+ me(fe);
2176
+ } else
2177
+ console.log("⚠️ No face detected in frame");
2178
+ }, me = (v) => {
2179
+ const M = O.current, Z = F.current, fe = G.current;
2180
+ if (M === 0) {
2181
+ const z = v[1], X = z.x > 0.35 && z.x < 0.65 && z.y > 0.35 && z.y < 0.65;
2182
+ Math.random() < 0.05 && console.log(`📍 Face position: x=${z.x.toFixed(2)}, y=${z.y.toFixed(2)} (centered: ${X})`), X && (console.log("✅ Face centered! Advancing to blink detection..."), setTimeout(() => ue(1), 500));
2183
+ } else if (M === 1) {
2184
+ const z = Pe(v[159], v[145]), X = Pe(v[33], v[133]), he = z / X;
2185
+ if (Math.random() < 0.1 && console.log(`👁️ Eye ratio: ${he.toFixed(3)} (threshold: 0.16, ${he < 0.16 ? "CLOSED" : "OPEN"})`), he < 0.16)
2186
+ fe || (console.log("👁️ Blink started (eye closed)"), ie(!0));
2187
+ else if (fe) {
2188
+ const H = Z + 1;
2189
+ console.log(`✅ Blink detected! Count: ${H}/3`), ie(!1), te(H), ee(), H >= 3 && (console.log("🎉 All 3 blinks completed! Moving to mouth opening step..."), setTimeout(() => {
2190
+ ue(2), q(0);
2191
+ }, 300));
2192
+ }
2193
+ } else if (M === 2) {
2194
+ const z = v[13], X = v[14], he = Pe(z, X), H = v[10], oe = v[152], ge = Pe(H, oe), ae = he / ge, ye = Math.min(ae / 0.15 * 100, 100);
2195
+ q(ye), d.current.length < 15 && ee(), ae > 0.12 && d.current.length >= 10 && !de.current && (de.current = !0, ee(), setTimeout(() => {
2196
+ ue(3), ne();
2197
+ }, 500));
2198
+ }
2199
+ }, ee = () => {
2200
+ !s.current || d.current.length >= 25 || s.current.toBlob((v) => {
2201
+ v && d.current.push(v);
2202
+ }, "image/jpeg", 0.8);
2203
+ }, ne = async () => {
2204
+ var v, M, Z, fe;
2205
+ if (w(!0), ue(4), p) {
2100
2206
  setTimeout(() => {
2101
- I(!1), i(!0);
2207
+ w(!1), a(!0);
2102
2208
  }, 2e3);
2103
2209
  return;
2104
2210
  }
2105
2211
  try {
2106
- const R = new FormData();
2107
- R.append("requestId", r), d.current.forEach((k, w) => {
2108
- R.append("imageFrames", k, `frame_${w}.jpg`);
2109
- }), R.append("metadata", JSON.stringify({
2110
- capturedAt: (/* @__PURE__ */ new Date()).toISOString(),
2111
- frameCount: d.current.length,
2112
- instructions: de.slice(0, -1)
2113
- }));
2114
- const U = await fetch(`${o}/api/v2/verification/liveness`, {
2212
+ const z = new FormData(), X = !!r, he = X ? `${l}/api/v2/verification/liveness` : `${l}/api/ai/verify-liveness-sequence`;
2213
+ if (X) {
2214
+ z.append("requestId", r);
2215
+ const ae = {
2216
+ totalFrames: d.current.length,
2217
+ stepSequence: ["blink", "open_mouth"],
2218
+ timestamp: Date.now()
2219
+ };
2220
+ z.append("metadata", JSON.stringify(ae)), d.current.slice(-10).forEach((Ae, De) => {
2221
+ z.append("imageFrames", Ae, `frame_${De}.jpg`);
2222
+ });
2223
+ } else
2224
+ d.current.forEach((ae, ye) => {
2225
+ z.append(`frame_${ye}`, ae, `frame_${ye}.jpg`);
2226
+ }), z.append("totalFrames", d.current.length.toString()), z.append("stepSequence", JSON.stringify(["blink", "open_mouth"]));
2227
+ const H = await fetch(he, {
2115
2228
  method: "POST",
2116
- body: R,
2229
+ headers: {
2230
+ ...N ? { "X-App-Id": N } : {}
2231
+ },
2232
+ body: z,
2117
2233
  credentials: "include"
2118
2234
  });
2119
- if (!U.ok) {
2120
- const k = await U.json().catch(() => ({}));
2121
- throw new Error(k.error || `Liveness check failed with status ${U.status}`);
2235
+ if (!H.ok) {
2236
+ const ae = await H.json().catch(() => ({}));
2237
+ throw new Error(ae.error || `Liveness check failed with status ${H.status}`);
2238
+ }
2239
+ const oe = await H.json();
2240
+ if (X ? oe.success && (((v = oe.liveness) == null ? void 0 : v.success) || ((M = oe.liveness) == null ? void 0 : M.status) === "completed" || ((Z = oe.liveness) == null ? void 0 : Z.status) === "approved") : oe.success && oe.passed)
2241
+ h.current && h.current.stop(), c.current && c.current.getTracks().forEach((ae) => ae.stop()), a(!0);
2242
+ else {
2243
+ const ae = oe.error || ((fe = oe.liveness) == null ? void 0 : fe.error) || "Liveness check failed. Please try again.";
2244
+ k(ae), ue(0), te(0), q(0), d.current = [], w(!1), de.current = !1;
2122
2245
  }
2123
- const v = await U.json();
2124
- v.success && ((E = v.liveness) != null && E.passed) ? (n.current && n.current.getTracks().forEach((k) => k.stop()), i(!0)) : (_(v.error || "Liveness check failed. Please try again."), g(0), d.current = [], I(!1));
2125
2246
  } catch {
2126
- _("Verification failed. Please try again."), g(0), d.current = [], I(!1), s == null || s("Liveness submission failed");
2247
+ k("Verification failed. Please try again."), ue(0), te(0), q(0), d.current = [], w(!1), n == null || n("Liveness submission failed");
2127
2248
  }
2128
- }, j = () => {
2129
- _(""), g(0), d.current = [], I(!1);
2249
+ }, U = () => {
2250
+ k(""), ue(0), te(0), q(0), d.current = [], w(!1), de.current = !1;
2130
2251
  };
2131
- return T ? /* @__PURE__ */ a(
2132
- V.div,
2252
+ return T ? /* @__PURE__ */ i(
2253
+ P.div,
2133
2254
  {
2134
2255
  initial: { opacity: 0 },
2135
2256
  animate: { opacity: 1 },
2136
- className: "flex-1 flex flex-col items-center justify-center px-8 text-center",
2257
+ className: "flex-1 flex flex-col items-center justify-center px-8 text-center bg-black",
2137
2258
  children: [
2138
- /* @__PURE__ */ e(se, { className: "w-16 h-16 text-red-500 mb-6" }),
2139
- /* @__PURE__ */ e("h2", { className: "text-xl font-bold text-main mb-3", children: "Camera Access Required" }),
2140
- /* @__PURE__ */ e("p", { className: "text-muted text-sm mb-6", children: "Please enable camera access in your browser settings to continue with face verification." }),
2259
+ /* @__PURE__ */ e("div", { className: "w-16 h-16 text-red-500 mb-6 text-5xl", children: "⚠️" }),
2260
+ /* @__PURE__ */ e("h2", { className: "text-xl font-bold text-white mb-3", children: "Camera Access Required" }),
2261
+ /* @__PURE__ */ e("p", { className: "text-gray-400 text-sm mb-6", children: "Please enable camera access in your browser settings to continue with face verification." }),
2141
2262
  /* @__PURE__ */ e(
2142
2263
  "button",
2143
2264
  {
2144
2265
  onClick: () => window.location.reload(),
2145
- className: "px-6 py-3 bg-brand text-white rounded-2xl font-bold",
2266
+ className: "px-6 py-3 bg-[#8651e1] text-white rounded-2xl font-bold",
2146
2267
  children: "Try Again"
2147
2268
  }
2148
2269
  )
2149
2270
  ]
2150
2271
  }
2151
- ) : /* @__PURE__ */ a(
2152
- V.div,
2272
+ ) : /* @__PURE__ */ i(
2273
+ P.div,
2153
2274
  {
2154
2275
  initial: { opacity: 0 },
2155
2276
  animate: { opacity: 1 },
2156
2277
  exit: { opacity: 0 },
2157
- className: "flex-1 flex flex-col relative dark:bg-[#050a0a] bg-slate-50 overflow-hidden",
2278
+ className: "flex-1 flex flex-col relative bg-black overflow-hidden",
2158
2279
  children: [
2159
- /* @__PURE__ */ e("canvas", { ref: c, className: "hidden" }),
2160
- /* @__PURE__ */ e("div", { className: "absolute inset-0 z-0", children: /* @__PURE__ */ e("div", { className: "w-full h-full opacity-20 bg-[radial-gradient(circle_at_center,_var(--tw-gradient-stops))] from-[#6fe8ec]/30 via-transparent to-transparent" }) }),
2161
- /* @__PURE__ */ e("div", { className: "relative z-40 pt-12 pb-4 flex items-center justify-center", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2 px-4 py-1.5 dark:bg-black/40 bg-white/40 backdrop-blur-md rounded-xl border dark:border-white/5 border-black/5", children: [
2162
- /* @__PURE__ */ e("div", { className: `w-2 h-2 rounded-full ${z ? "bg-[#6fe8ec] shadow-[0_0_8px_#6fe8ec]" : "bg-yellow-500 animate-pulse"}` }),
2163
- /* @__PURE__ */ e("span", { className: "text-[10px] text-muted uppercase tracking-[0.2em] font-bold", children: t(z ? "live_camera" : "initializing", l) })
2164
- ] }) }),
2165
- /* @__PURE__ */ a("div", { className: "relative z-20 flex-1 flex items-center justify-center", children: [
2166
- /* @__PURE__ */ e(
2167
- "div",
2168
- {
2169
- className: "absolute inset-0 z-10 dark:bg-[#050a0a]/80 bg-white/80 backdrop-blur-[2px]",
2170
- style: {
2171
- mask: "radial-gradient(ellipse 100px 145px at center, transparent 99%, black 100%)",
2172
- WebkitMask: "radial-gradient(ellipse 100px 145px at center, transparent 99%, black 100%)"
2173
- }
2174
- }
2175
- ),
2176
- /* @__PURE__ */ a("div", { className: "relative z-30 flex items-center justify-center", children: [
2177
- /* @__PURE__ */ a("div", { className: "w-[200px] h-[290px] flex-shrink-0 rounded-full border-[3px] border-[#6fe8ec] shadow-[0_0_40px_rgba(111,232,236,0.4),inset_0_0_20px_rgba(111,232,236,0.2)] relative overflow-hidden", children: [
2178
- /* @__PURE__ */ e(
2179
- "video",
2180
- {
2181
- ref: u,
2182
- autoPlay: !0,
2183
- playsInline: !0,
2184
- muted: !0,
2185
- className: "absolute inset-0 w-full h-full object-cover scale-x-[-1]"
2186
- }
2187
- ),
2188
- /* @__PURE__ */ e(
2189
- V.div,
2190
- {
2191
- animate: { opacity: [0.4, 1, 0.4] },
2192
- transition: { duration: 2, repeat: 1 / 0 },
2193
- className: "absolute inset-0 rounded-full border-[1px] border-white/30"
2194
- }
2195
- ),
2196
- /* @__PURE__ */ e(
2197
- V.div,
2198
- {
2199
- animate: { top: ["-10%", "110%"] },
2200
- transition: { duration: 3, repeat: 1 / 0, ease: "easeInOut" },
2201
- className: "absolute left-0 w-full h-[3px] bg-gradient-to-r from-transparent via-[#6fe8ec] to-transparent shadow-[0_0_20px_#6fe8ec] z-10"
2202
- }
2203
- )
2204
- ] }),
2205
- /* @__PURE__ */ a("div", { className: "absolute w-[280px] h-[380px] pointer-events-none flex items-center justify-center", children: [
2206
- /* @__PURE__ */ e("div", { className: "absolute top-0 left-0 w-10 h-10 border-t-2 border-l-2 border-[#6fe8ec]/30 rounded-tl-2xl" }),
2207
- /* @__PURE__ */ e("div", { className: "absolute top-0 right-0 w-10 h-10 border-t-2 border-r-2 border-[#6fe8ec]/30 rounded-tr-2xl" }),
2208
- /* @__PURE__ */ e("div", { className: "absolute bottom-0 left-0 w-10 h-10 border-b-2 border-l-2 border-[#6fe8ec]/30 rounded-bl-2xl" }),
2209
- /* @__PURE__ */ e("div", { className: "absolute bottom-0 right-0 w-10 h-10 border-b-2 border-r-2 border-[#6fe8ec]/30 rounded-br-2xl" })
2210
- ] })
2211
- ] })
2212
- ] }),
2213
- /* @__PURE__ */ a("footer", { className: "relative z-40 p-8 flex flex-col items-center gap-6", children: [
2214
- h ? /* @__PURE__ */ a("div", { className: "dark:bg-red-900/30 bg-red-50 backdrop-blur-2xl border border-red-500/30 w-full p-6 rounded-[2.5rem] text-center", children: [
2215
- /* @__PURE__ */ e("p", { className: "text-red-500 font-bold text-lg mb-4", children: h }),
2280
+ /* @__PURE__ */ e(
2281
+ "video",
2282
+ {
2283
+ ref: m,
2284
+ className: "hidden",
2285
+ playsInline: !0,
2286
+ muted: !0
2287
+ }
2288
+ ),
2289
+ /* @__PURE__ */ e("div", { className: "absolute inset-0 z-0 bg-gradient-to-b from-transparent via-[#8651e1]/5 to-[#8651e1]/10 pointer-events-none" }),
2290
+ /* @__PURE__ */ e("div", { className: "relative z-20 flex-1 flex flex-col items-center justify-center pt-8", children: /* @__PURE__ */ i("div", { className: "relative w-72 h-96 flex items-center justify-center", children: [
2291
+ /* @__PURE__ */ i("div", { className: "absolute inset-0 rounded-[3rem] overflow-hidden border-2 border-slate-200 dark:border-white/10 shadow-2xl", children: [
2216
2292
  /* @__PURE__ */ e(
2217
- "button",
2293
+ "canvas",
2218
2294
  {
2219
- onClick: j,
2220
- className: "px-6 py-2 bg-red-500 text-white rounded-xl font-bold",
2221
- children: "Try Again"
2295
+ ref: s,
2296
+ width: 640,
2297
+ height: 480,
2298
+ className: "w-full h-full object-cover"
2222
2299
  }
2223
- )
2224
- ] }) : /* @__PURE__ */ a("div", { className: "dark:bg-[#0a1515]/95 bg-white/90 backdrop-blur-2xl border dark:border-white/10 border-black/5 w-full p-6 rounded-2xl text-center shadow-2xl", children: [
2225
- /* @__PURE__ */ e(Ce, { mode: "wait", children: /* @__PURE__ */ e(
2226
- V.p,
2227
- {
2228
- initial: { opacity: 0, y: 10 },
2229
- animate: { opacity: 1, y: 0 },
2230
- exit: { opacity: 0, y: -10 },
2231
- className: "text-[#6fe8ec] font-bold text-2xl tracking-tight mb-2",
2232
- children: f ? /* @__PURE__ */ a("span", { className: "flex items-center justify-center gap-3", children: [
2233
- /* @__PURE__ */ e(ee, { className: "w-6 h-6 animate-spin" }),
2234
- "Verifying..."
2235
- ] }) : t(de[m], l)
2236
- },
2237
- m
2238
- ) }),
2239
- /* @__PURE__ */ a("div", { className: "flex items-center justify-center gap-2 text-muted text-[10px] font-bold uppercase tracking-widest", children: [
2240
- /* @__PURE__ */ e(Ae, { className: "w-3 h-3" }),
2241
- t("secure_face_scan_desc", l)
2242
- ] })
2300
+ ),
2301
+ /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-[#8651e1]/10 mix-blend-overlay" }),
2302
+ /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-gradient-to-t from-black via-transparent to-transparent h-1/3 mt-auto" })
2243
2303
  ] }),
2244
- /* @__PURE__ */ e("div", { className: "flex gap-2 w-full max-w-[140px]", children: [0, 1, 2].map((E) => /* @__PURE__ */ e(
2245
- "div",
2304
+ /* @__PURE__ */ e("div", { className: "absolute inset-0 z-30 pointer-events-none", children: [
2305
+ { t: "30%", l: "50%" },
2306
+ { t: "35%", l: "40%" },
2307
+ { t: "35%", l: "60%" },
2308
+ { t: "45%", l: "50%" },
2309
+ { t: "52%", l: "35%" },
2310
+ { t: "52%", l: "65%" },
2311
+ { t: "60%", l: "45%" },
2312
+ { t: "60%", l: "55%" },
2313
+ { t: "70%", l: "50%" }
2314
+ ].map((v, M) => /* @__PURE__ */ e(
2315
+ P.div,
2246
2316
  {
2247
- className: `h-1.5 flex-1 rounded-full transition-all duration-700 ${E <= Math.floor(m / (de.length - 1) * 2) ? "bg-[#6fe8ec] shadow-[0_0_15px_#6fe8ec]" : "dark:bg-slate-800 bg-slate-200"}`
2317
+ initial: { scale: 0, opacity: 0 },
2318
+ animate: {
2319
+ scale: [0, 1.5, 1],
2320
+ opacity: pe > M * 11 ? 1 : 0
2321
+ },
2322
+ className: "absolute w-2 h-2 bg-[#6DE8EC] rounded-full shadow-[0_0_12px_#6DE8EC]",
2323
+ style: { top: v.t, left: v.l }
2248
2324
  },
2249
- E
2325
+ M
2250
2326
  )) }),
2251
- /* @__PURE__ */ a("div", { className: "px-6 py-2.5 dark:bg-black/60 bg-white/60 backdrop-blur-md rounded-xl border dark:border-white/5 border-black/5 flex items-center gap-3", children: [
2327
+ /* @__PURE__ */ i("div", { className: "absolute -inset-6 z-40", children: [
2252
2328
  /* @__PURE__ */ e(
2253
- "div",
2329
+ P.div,
2330
+ {
2331
+ animate: { opacity: [0.3, 1, 0.3] },
2332
+ transition: { duration: 2, repeat: 1 / 0 },
2333
+ className: "absolute top-0 left-0 w-20 h-20 border-t-4 border-l-4 border-[#14b8a6] rounded-tl-[3.5rem]"
2334
+ }
2335
+ ),
2336
+ /* @__PURE__ */ e(
2337
+ P.div,
2254
2338
  {
2255
- className: `w-2 h-2 rounded-full ${f ? "bg-yellow-400 animate-pulse" : m === de.length - 1 ? "bg-emerald-400 shadow-[0_0_10px_#34d399]" : "bg-[#6fe8ec] animate-pulse"}`
2339
+ animate: { opacity: [0.3, 1, 0.3] },
2340
+ transition: { duration: 2, repeat: 1 / 0 },
2341
+ className: "absolute top-0 right-0 w-20 h-20 border-t-4 border-r-4 border-[#14b8a6] rounded-tr-[3.5rem]"
2256
2342
  }
2257
2343
  ),
2258
- /* @__PURE__ */ e("span", { className: "text-[10px] dark:text-slate-400 text-slate-600 uppercase tracking-[0.25em] font-black", children: f ? t("analyzing_liveness", l) : m === de.length - 1 ? t("calibration_complete", l) : t("awaiting_calibration", l) })
2344
+ /* @__PURE__ */ e(
2345
+ P.div,
2346
+ {
2347
+ animate: { opacity: [0.3, 1, 0.3] },
2348
+ transition: { duration: 2, repeat: 1 / 0 },
2349
+ className: "absolute bottom-0 left-0 w-20 h-20 border-b-4 border-l-4 border-[#14b8a6] rounded-bl-[3.5rem]"
2350
+ }
2351
+ ),
2352
+ /* @__PURE__ */ e(
2353
+ P.div,
2354
+ {
2355
+ animate: { opacity: [0.3, 1, 0.3] },
2356
+ transition: { duration: 2, repeat: 1 / 0 },
2357
+ className: "absolute bottom-0 right-0 w-20 h-20 border-b-4 border-r-4 border-[#14b8a6] rounded-br-[3.5rem]"
2358
+ }
2359
+ )
2360
+ ] }),
2361
+ /* @__PURE__ */ e(
2362
+ P.div,
2363
+ {
2364
+ animate: { top: ["0%", "100%"] },
2365
+ transition: { duration: 3, repeat: 1 / 0, ease: "linear" },
2366
+ className: "absolute left-0 right-0 h-1 bg-gradient-to-r from-transparent via-[#6DE8EC] to-transparent shadow-[0_0_15px_#6DE8EC] z-50 pointer-events-none",
2367
+ style: { borderRadius: "100%" }
2368
+ }
2369
+ )
2370
+ ] }) }),
2371
+ /* @__PURE__ */ i("div", { className: "relative z-50 px-8 pb-20 pt-4 flex flex-col items-center gap-6", children: [
2372
+ g ? /* @__PURE__ */ i(
2373
+ P.div,
2374
+ {
2375
+ initial: { opacity: 0, scale: 0.9 },
2376
+ animate: { opacity: 1, scale: 1 },
2377
+ className: "bg-red-900/30 border border-red-500/50 p-6 rounded-3xl w-full text-center",
2378
+ children: [
2379
+ /* @__PURE__ */ e("p", { className: "text-red-400 font-bold text-lg mb-4", children: g }),
2380
+ /* @__PURE__ */ e(
2381
+ "button",
2382
+ {
2383
+ onClick: U,
2384
+ className: "px-8 py-3 bg-red-500 hover:bg-red-600 text-white rounded-xl font-bold transition-colors",
2385
+ children: "Try Again"
2386
+ }
2387
+ )
2388
+ ]
2389
+ }
2390
+ ) : /* @__PURE__ */ e(Me, { mode: "wait", children: /* @__PURE__ */ e(
2391
+ P.div,
2392
+ {
2393
+ initial: { opacity: 0, y: 10, filter: "blur(5px)" },
2394
+ animate: { opacity: 1, y: 0, filter: "blur(0px)" },
2395
+ exit: { opacity: 0, y: -10, filter: "blur(5px)" },
2396
+ className: "text-white text-center font-bold text-xl leading-tight min-h-[3rem] flex items-center justify-center drop-shadow-lg flex-col gap-2",
2397
+ children: V && A === 4 ? /* @__PURE__ */ i("span", { className: "flex items-center gap-3", children: [
2398
+ /* @__PURE__ */ i("svg", { className: "animate-spin h-5 w-5", viewBox: "0 0 24 24", children: [
2399
+ /* @__PURE__ */ e("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4", fill: "none" }),
2400
+ /* @__PURE__ */ e("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
2401
+ ] }),
2402
+ ke[A]
2403
+ ] }) : /* @__PURE__ */ i(re, { children: [
2404
+ /* @__PURE__ */ e("span", { children: ke[A] }),
2405
+ A === 1 && /* @__PURE__ */ i("span", { className: "text-[#6DE8EC] text-2xl", children: [
2406
+ "(",
2407
+ W,
2408
+ "/3)"
2409
+ ] })
2410
+ ] })
2411
+ },
2412
+ A === 1 ? `${ke[A]}-${W}` : ke[A]
2413
+ ) }),
2414
+ /* @__PURE__ */ e("div", { className: "w-full max-w-[240px] h-1.5 bg-slate-200 dark:bg-white/10 rounded-full overflow-hidden", children: /* @__PURE__ */ e(
2415
+ P.div,
2416
+ {
2417
+ className: "h-full bg-gradient-to-r from-[#8651e1] to-[#6DE8EC]",
2418
+ animate: { width: `${pe}%` },
2419
+ transition: { duration: 0.3 }
2420
+ }
2421
+ ) }),
2422
+ !g && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 text-gray-400 text-xs", children: [
2423
+ /* @__PURE__ */ e("div", { className: `w-2 h-2 rounded-full ${o ? "bg-[#6DE8EC] shadow-[0_0_8px_#6DE8EC]" : "bg-yellow-500 animate-pulse"}` }),
2424
+ /* @__PURE__ */ e("span", { className: "uppercase tracking-widest font-bold", children: o ? "LIVE CAMERA" : "INITIALIZING..." })
2259
2425
  ] })
2260
2426
  ] })
2261
2427
  ]
2262
2428
  }
2263
2429
  );
2264
- }, Wt = [
2265
- { id: "passport", title: "Passport", desc: "All countries supported", Icon: We },
2266
- { id: "drivers_license", title: "Driver License", desc: "Government issued card", Icon: Ke },
2267
- { id: "national_id", title: "ID Card", desc: "National identity document", Icon: De }
2268
- ], Gt = ({ onNext: r, language: i = "EN" }) => /* @__PURE__ */ a(
2269
- V.div,
2430
+ }, Xt = [
2431
+ { id: "passport", title: "Passport", desc: "All countries supported", Icon: et },
2432
+ { id: "drivers_license", title: "Driver License", desc: "Government issued card", Icon: Qe },
2433
+ { id: "national_id", title: "ID Card", desc: "National identity document", Icon: qe }
2434
+ ], Qt = ({ onNext: r, language: a = "EN" }) => /* @__PURE__ */ i(
2435
+ P.div,
2270
2436
  {
2271
2437
  initial: { opacity: 0, x: 20 },
2272
2438
  animate: { opacity: 1, x: 0 },
2273
2439
  exit: { opacity: 0, x: -20 },
2274
2440
  className: "flex-1 px-6 pt-4 flex flex-col",
2275
2441
  children: [
2276
- /* @__PURE__ */ e("h3", { className: "text-2xl font-bold mb-2 text-main", children: t("verify_identity", i) }),
2277
- /* @__PURE__ */ e("p", { className: "text-muted text-sm mb-8 leading-relaxed", children: t("choose_document", i) }),
2278
- /* @__PURE__ */ a("div", { className: "space-y-4 overflow-y-auto pr-1 pb-6", children: [
2279
- Wt.map(({ id: s, title: o, desc: x, Icon: l }) => /* @__PURE__ */ a(
2442
+ /* @__PURE__ */ e("h3", { className: "text-2xl font-bold mb-2 text-main", children: t("verify_identity", a) }),
2443
+ /* @__PURE__ */ e("p", { className: "text-muted text-sm mb-8 leading-relaxed", children: t("choose_document", a) }),
2444
+ /* @__PURE__ */ i("div", { className: "space-y-4 overflow-y-auto pr-1 pb-6", children: [
2445
+ Xt.map(({ id: n, title: l, desc: N, Icon: p }) => /* @__PURE__ */ i(
2280
2446
  "button",
2281
2447
  {
2282
- onClick: () => r(s),
2448
+ onClick: () => r(n),
2283
2449
  className: "w-full group cursor-pointer dark:bg-white/5 bg-slate-100/50 border dark:border-white/10 border-slate-200 rounded-2xl p-5 flex items-center gap-4 hover:dark:bg-brand/15 hover:bg-brand/5 hover:dark:border-brand-40 hover:border-brand-30 transition-all transform hover:-translate-y-1",
2284
2450
  children: [
2285
- /* @__PURE__ */ e("div", { className: "w-14 h-14 rounded-xl dark:bg-slate-800/50 bg-white flex items-center justify-center text-brand group-hover:bg-brand/20 transition-colors border dark:border-transparent border-slate-100", children: /* @__PURE__ */ e(l, { className: "w-8 h-8" }) }),
2286
- /* @__PURE__ */ a("div", { className: "flex-1 text-left", children: [
2287
- /* @__PURE__ */ e("h4", { className: "font-bold text-base text-main", children: t(s, i) }),
2288
- /* @__PURE__ */ e("p", { className: "text-xs text-muted font-medium", children: t(`${s}_desc`, i) })
2451
+ /* @__PURE__ */ e("div", { className: "w-14 h-14 rounded-xl dark:bg-slate-800/50 bg-white flex items-center justify-center text-brand group-hover:bg-brand/20 transition-colors border dark:border-transparent border-slate-100", children: /* @__PURE__ */ e(p, { className: "w-8 h-8" }) }),
2452
+ /* @__PURE__ */ i("div", { className: "flex-1 text-left", children: [
2453
+ /* @__PURE__ */ e("h4", { className: "font-bold text-base text-main", children: t(n, a) }),
2454
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted font-medium", children: t(`${n}_desc`, a) })
2289
2455
  ] }),
2290
- /* @__PURE__ */ e(Ie, { className: "text-brand w-5 h-5" })
2456
+ /* @__PURE__ */ e(Le, { className: "text-brand w-5 h-5" })
2291
2457
  ]
2292
2458
  },
2293
- s
2459
+ n
2294
2460
  )),
2295
- /* @__PURE__ */ a("div", { className: "mt-8 relative h-32 w-full rounded-2xl overflow-hidden dark:bg-white/5 bg-slate-100/30 flex items-center justify-center border border-dashed dark:border-brand-30 border-brand-40", children: [
2461
+ /* @__PURE__ */ i("div", { className: "mt-8 relative h-32 w-full rounded-2xl overflow-hidden dark:bg-white/5 bg-slate-100/30 flex items-center justify-center border border-dashed dark:border-brand-30 border-brand-40", children: [
2296
2462
  /* @__PURE__ */ e("div", { className: "absolute inset-0 opacity-10 bg-[radial-gradient(circle_at_center,_var(--tw-gradient-stops))] from-brand via-transparent to-transparent" }),
2297
- /* @__PURE__ */ a("div", { className: "text-center z-10", children: [
2298
- /* @__PURE__ */ e(fe, { className: "text-brand/40 w-10 h-10 mx-auto mb-1" }),
2463
+ /* @__PURE__ */ i("div", { className: "text-center z-10", children: [
2464
+ /* @__PURE__ */ e(Se, { className: "text-brand/40 w-10 h-10 mx-auto mb-1" }),
2299
2465
  /* @__PURE__ */ e("p", { className: "text-[10px] text-muted uppercase tracking-tighter font-bold", children: "Encrypted E2E" })
2300
2466
  ] })
2301
2467
  ] })
2302
2468
  ] })
2303
2469
  ]
2304
2470
  }
2305
- ), Yt = (r) => ({
2471
+ ), ei = (r) => ({
2306
2472
  passport: t("passport", r),
2307
2473
  drivers_license: t("drivers_license", r),
2308
2474
  national_id: t("national_id", r)
2309
- }), Jt = ({
2475
+ }), ti = ({
2310
2476
  requestId: r,
2311
- documentType: i,
2312
- onNext: s,
2313
- onError: o,
2314
- apiBaseUrl: x = "https://apis.casperid.com",
2315
- previewMode: l = !1,
2316
- language: u = "EN"
2477
+ documentType: a,
2478
+ onNext: n,
2479
+ onError: l,
2480
+ apiBaseUrl: N = "https://apis.casperid.com",
2481
+ apiKey: p = "",
2482
+ previewMode: f = !1,
2483
+ language: m = "EN"
2317
2484
  }) => {
2318
- const c = re(null), n = re(null), d = re(null), [m, g] = y(!1), [z, O] = y(null), [h, _] = y(null), [f, I] = y(!1), [T, C] = y(""), [N, j] = y("front"), [E, R] = y(null);
2319
- F(() => ((async () => {
2485
+ const s = se(null), c = se(null), d = se(null), [D, h] = y(!1), [A, _] = y(null), [o, I] = y(null), [g, k] = y(!1), [V, w] = y(""), [T, Y] = y("front"), [W, B] = y(null);
2486
+ ce(() => ((async () => {
2320
2487
  try {
2321
- const A = await navigator.mediaDevices.getUserMedia({
2488
+ const O = await navigator.mediaDevices.getUserMedia({
2322
2489
  video: {
2323
2490
  facingMode: "environment",
2324
2491
  // Use back camera for documents
@@ -2326,100 +2493,111 @@ const $t = ({
2326
2493
  height: { ideal: 720 }
2327
2494
  }
2328
2495
  });
2329
- d.current = A, c.current && (c.current.srcObject = A, c.current.onloadedmetadata = () => {
2330
- g(!0);
2496
+ d.current = O, s.current && (s.current.srcObject = O, s.current.onloadedmetadata = () => {
2497
+ h(!0);
2331
2498
  });
2332
2499
  } catch {
2333
2500
  try {
2334
- const P = await navigator.mediaDevices.getUserMedia({
2501
+ const F = await navigator.mediaDevices.getUserMedia({
2335
2502
  video: { facingMode: "user", width: { ideal: 1280 }, height: { ideal: 720 } }
2336
2503
  });
2337
- d.current = P, c.current && (c.current.srcObject = P, c.current.onloadedmetadata = () => {
2338
- g(!0);
2504
+ d.current = F, s.current && (s.current.srcObject = F, s.current.onloadedmetadata = () => {
2505
+ h(!0);
2339
2506
  });
2340
2507
  } catch {
2341
- C(t("unable_access_camera", u)), o == null || o("Camera access failed");
2508
+ w(t("unable_access_camera", m)), l == null || l("Camera access failed");
2342
2509
  }
2343
2510
  }
2344
2511
  })(), () => {
2345
- d.current && d.current.getTracks().forEach((A) => A.stop()), h && URL.revokeObjectURL(h);
2346
- }), [o]);
2347
- const U = async () => {
2348
- if (!c.current || !n.current) return;
2349
- const w = n.current, A = c.current, P = w.getContext("2d");
2350
- P && (w.width = A.videoWidth, w.height = A.videoHeight, P.drawImage(A, 0, 0), w.toBlob((K) => {
2351
- K && (O(K), _(URL.createObjectURL(K)));
2512
+ d.current && d.current.getTracks().forEach((O) => O.stop()), o && URL.revokeObjectURL(o);
2513
+ }), [l]);
2514
+ const b = async () => {
2515
+ if (!s.current || !c.current) return;
2516
+ const L = c.current, O = s.current, F = L.getContext("2d");
2517
+ F && (L.width = O.videoWidth, L.height = O.videoHeight, F.drawImage(O, 0, 0), L.toBlob((G) => {
2518
+ G && (_(G), I(URL.createObjectURL(G)));
2352
2519
  }, "image/jpeg", 0.9));
2353
- }, v = () => {
2354
- h && URL.revokeObjectURL(h), O(null), _(null), C("");
2355
- }, k = async () => {
2356
- if (I(!0), l) {
2520
+ }, C = () => {
2521
+ o && URL.revokeObjectURL(o), _(null), I(null), w("");
2522
+ }, S = async () => {
2523
+ if (k(!0), f) {
2357
2524
  setTimeout(() => {
2358
- I(!1), s({
2525
+ k(!1), n({
2359
2526
  first_name: "JOHN",
2360
2527
  last_name: "DOE",
2361
2528
  date_of_birth: "01 JAN 1990",
2362
- nationality: "Nigerian"
2363
- }, "mock-upload-id-789");
2529
+ nationality: ""
2530
+ }, "mock-upload-id-789", {
2531
+ frontImageUrl: "mock-front-url",
2532
+ frontImageFileId: "mock-front-id",
2533
+ backImageUrl: "mock-back-url",
2534
+ backImageFileId: "mock-back-id"
2535
+ });
2364
2536
  }, 2e3);
2365
2537
  return;
2366
2538
  }
2367
- if (!z) {
2368
- I(!1);
2539
+ if (!A) {
2540
+ k(!1);
2369
2541
  return;
2370
2542
  }
2371
- if (N === "front" && i !== "passport") {
2372
- R(z), O(null), _(null), j("back"), I(!1);
2543
+ if (T === "front" && a !== "passport") {
2544
+ B(A), _(null), I(null), Y("back"), k(!1);
2373
2545
  return;
2374
2546
  }
2375
- I(!0), C("");
2547
+ k(!0), w("");
2376
2548
  try {
2377
- const w = new FormData();
2378
- w.append("document_type", i), E ? (w.append("front_image", E, "front.jpg"), w.append("back_image", z, "back.jpg")) : w.append("front_image", z, "document.jpg");
2379
- const A = await fetch(`${x}/api/v2/verification/layer3/documents/upload`, {
2549
+ const L = new FormData();
2550
+ L.append("document_type", a), W ? (L.append("front_image", W, "front.jpg"), L.append("back_image", A, "back.jpg")) : L.append("front_image", A, "document.jpg");
2551
+ const O = await fetch(`${N}/api/v2/verification/layer3/documents/upload`, {
2380
2552
  method: "POST",
2381
- body: w,
2553
+ body: L,
2382
2554
  credentials: "include",
2383
2555
  headers: {
2384
- "X-Request-Id": r
2556
+ "X-Request-Id": r,
2557
+ ...p ? { "X-App-Id": p } : {}
2385
2558
  }
2386
2559
  });
2387
- if (!A.ok) {
2388
- const K = await A.json().catch(() => ({}));
2389
- throw new Error(K.error || `Document upload failed with status ${A.status}`);
2560
+ if (!O.ok) {
2561
+ const G = await O.json().catch(() => ({}));
2562
+ throw new Error(G.error || `Document upload failed with status ${O.status}`);
2390
2563
  }
2391
- const P = await A.json();
2392
- P.success && P.extracted_data ? (d.current && d.current.getTracks().forEach((K) => K.stop()), s(P.extracted_data, P.upload_id || "")) : (C(P.error || "Failed to process document. Please try again."), I(!1));
2564
+ const F = await O.json();
2565
+ F.success && F.extracted_data ? (d.current && d.current.getTracks().forEach((G) => G.stop()), n(F.extracted_data, F.upload_id || "", {
2566
+ frontImageUrl: F.front_image_url,
2567
+ frontImageFileId: F.front_image_file_id,
2568
+ backImageUrl: F.back_image_url,
2569
+ backImageFileId: F.back_image_file_id
2570
+ })) : (w(F.error || "Failed to process document. Please try again."), k(!1));
2393
2571
  } catch {
2394
- C("Upload failed. Please try again."), I(!1), o == null || o("Document upload failed");
2572
+ w("Upload failed. Please try again."), k(!1), l == null || l("Document upload failed");
2395
2573
  }
2396
2574
  };
2397
- return /* @__PURE__ */ a(
2398
- V.div,
2575
+ return /* @__PURE__ */ i(
2576
+ P.div,
2399
2577
  {
2400
2578
  initial: { opacity: 0 },
2401
2579
  animate: { opacity: 1 },
2402
2580
  exit: { opacity: 0 },
2403
2581
  className: "flex-1 flex flex-col relative",
2404
2582
  children: [
2405
- /* @__PURE__ */ e("canvas", { ref: n, className: "hidden" }),
2406
- /* @__PURE__ */ a("div", { className: "absolute inset-0 z-0", children: [
2407
- /* @__PURE__ */ e("div", { className: "w-full h-full bg-slate-800 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-full h-full opacity-30 bg-[radial-gradient(circle_at_center,_var(--tw-gradient-stops))] from-[#6DE8EC]/20 via-transparent to-transparent" }) }),
2583
+ /* @__PURE__ */ e("canvas", { ref: c, className: "hidden" }),
2584
+ /* @__PURE__ */ i("div", { className: "absolute inset-0 z-0", children: [
2585
+ /* @__PURE__ */ e("div", { className: "w-full h-full bg-main opacity-10 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-full h-full opacity-30 bg-[radial-gradient(circle_at_center,_var(--tw-gradient-stops))] from-[#6DE8EC]/20 via-transparent to-transparent" }) }),
2408
2586
  /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-black/30 backdrop-blur-[2px]" })
2409
2587
  ] }),
2410
- /* @__PURE__ */ e("div", { className: "relative z-10 p-6 flex flex-col items-center", children: /* @__PURE__ */ e("div", { className: "text-center px-4 py-2 dark:bg-black/40 bg-white/40 backdrop-blur-xl rounded-full border dark:border-white/10 border-black/5", children: /* @__PURE__ */ e("h3", { className: "text-main text-sm font-medium tracking-wide uppercase", children: t("scan_instruction", u).replace("{side}", t(N, u)).replace("{docType}", Yt(u)[i]) }) }) }),
2411
- /* @__PURE__ */ e("div", { className: "relative z-10 flex-1 flex items-center justify-center px-6", children: /* @__PURE__ */ a("div", { className: "w-full aspect-[1.58/1] relative", children: [
2412
- h ? /* @__PURE__ */ e(
2588
+ /* @__PURE__ */ e("div", { className: "relative z-10 p-6 flex flex-col items-center", children: /* @__PURE__ */ e("div", { className: "text-center px-4 py-2 bg-brand-10 backdrop-blur-xl rounded-full border border-brand-10", children: /* @__PURE__ */ e("h3", { className: "text-main text-sm font-medium tracking-wide uppercase", children: t("scan_instruction", m).replace("{side}", t(T, m)).replace("{docType}", ei(m)[a]) }) }) }),
2589
+ /* @__PURE__ */ e("div", { className: "relative z-10 flex-1 flex items-center justify-center px-6", children: /* @__PURE__ */ i("div", { className: "w-full aspect-[1.58/1] relative", children: [
2590
+ o ? /* @__PURE__ */ e(
2413
2591
  "img",
2414
2592
  {
2415
- src: h,
2593
+ src: o,
2416
2594
  alt: "Captured document",
2417
2595
  className: "absolute inset-0 w-full h-full object-cover rounded-2xl"
2418
2596
  }
2419
2597
  ) : /* @__PURE__ */ e(
2420
2598
  "video",
2421
2599
  {
2422
- ref: c,
2600
+ ref: s,
2423
2601
  autoPlay: !0,
2424
2602
  playsInline: !0,
2425
2603
  muted: !0,
@@ -2431,453 +2609,531 @@ const $t = ({
2431
2609
  /* @__PURE__ */ e("div", { className: "absolute top-0 right-0 w-8 h-8 border-t-4 border-r-4 border-[#6DE8EC] rounded-tr-2xl" }),
2432
2610
  /* @__PURE__ */ e("div", { className: "absolute bottom-0 left-0 w-8 h-8 border-b-4 border-l-4 border-[#6DE8EC] rounded-bl-2xl" }),
2433
2611
  /* @__PURE__ */ e("div", { className: "absolute bottom-0 right-0 w-8 h-8 border-b-4 border-r-4 border-[#6DE8EC] rounded-br-2xl" }),
2434
- !h && m && /* @__PURE__ */ e(
2435
- V.div,
2612
+ !o && D && /* @__PURE__ */ e(
2613
+ P.div,
2436
2614
  {
2437
2615
  animate: { top: ["0%", "100%", "0%"] },
2438
2616
  transition: { duration: 4, repeat: 1 / 0, ease: "linear" },
2439
2617
  className: "absolute left-0 w-full h-[2px] bg-gradient-to-r from-transparent via-[#6DE8EC] to-transparent opacity-50"
2440
2618
  }
2441
2619
  ),
2442
- !m && !h && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-black/50 rounded-2xl", children: /* @__PURE__ */ e(ee, { className: "w-8 h-8 text-[#6DE8EC] animate-spin" }) })
2620
+ !D && !o && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-black/50 rounded-2xl", children: /* @__PURE__ */ e(_e, { className: "w-8 h-8 text-[#6DE8EC] animate-spin" }) })
2443
2621
  ] }) }),
2444
- T && /* @__PURE__ */ a("div", { className: "relative z-10 mx-6 mb-4 p-4 bg-red-500/20 border border-red-500/30 rounded-xl flex items-center gap-3", children: [
2445
- /* @__PURE__ */ e(se, { className: "w-5 h-5 text-red-500 shrink-0" }),
2446
- /* @__PURE__ */ e("p", { className: "text-red-400 text-sm font-medium", children: T })
2622
+ V && /* @__PURE__ */ i("div", { className: "relative z-10 mx-6 mb-4 p-4 bg-red-500/20 border border-red-500/30 rounded-xl flex items-center gap-3", children: [
2623
+ /* @__PURE__ */ e(ve, { className: "w-5 h-5 text-red-500 shrink-0" }),
2624
+ /* @__PURE__ */ e("p", { className: "text-red-400 text-sm font-medium", children: V })
2447
2625
  ] }),
2448
- /* @__PURE__ */ a("div", { className: "relative z-10 p-8 dark:bg-black/60 bg-white/60 backdrop-blur-2xl border-t dark:border-white/10 border-black/5 rounded-t-3xl", children: [
2449
- /* @__PURE__ */ e("p", { className: "text-muted text-xs text-center mb-6 font-medium", children: t(h ? "review_capture" : "align_document", u) }),
2450
- /* @__PURE__ */ e("div", { className: "flex items-center justify-between gap-4", children: h ? /* @__PURE__ */ a($, { children: [
2626
+ /* @__PURE__ */ i("div", { className: "relative z-10 p-8 glass-container backdrop-blur-2xl border-t border-brand-10 rounded-t-3xl", children: [
2627
+ /* @__PURE__ */ e("p", { className: "text-muted text-xs text-center mb-6 font-medium", children: t(o ? "review_capture" : "align_document", m) }),
2628
+ /* @__PURE__ */ e("div", { className: "flex items-center justify-between gap-4", children: o ? /* @__PURE__ */ i(re, { children: [
2451
2629
  /* @__PURE__ */ e(
2452
2630
  "button",
2453
2631
  {
2454
- onClick: v,
2455
- disabled: f,
2456
- className: "w-12 h-12 rounded-xl dark:bg-white/5 bg-black/5 flex items-center justify-center text-muted disabled:opacity-50",
2457
- children: /* @__PURE__ */ e(It, { className: "w-6 h-6" })
2632
+ onClick: C,
2633
+ disabled: g,
2634
+ className: "w-12 h-12 rounded-xl bg-brand-5 flex items-center justify-center text-muted disabled:opacity-50",
2635
+ children: /* @__PURE__ */ e(Rt, { className: "w-6 h-6" })
2458
2636
  }
2459
2637
  ),
2460
2638
  /* @__PURE__ */ e(
2461
2639
  "button",
2462
2640
  {
2463
- onClick: k,
2464
- disabled: f,
2641
+ onClick: S,
2642
+ disabled: g,
2465
2643
  className: "flex-1 bg-brand hover:bg-brand/90 text-white h-14 rounded-2xl flex items-center justify-center gap-2 font-bold text-lg transition-all active:scale-95 shadow-[0_0_25px_rgba(130,66,240,0.5)] disabled:opacity-70",
2466
- children: f ? /* @__PURE__ */ a($, { children: [
2467
- /* @__PURE__ */ e(ee, { className: "w-6 h-6 animate-spin" }),
2468
- /* @__PURE__ */ e("span", { children: t("processing", u) })
2469
- ] }) : /* @__PURE__ */ e("span", { children: t(N === "front" && i !== "passport" ? "next_back_side" : "confirm", u) })
2644
+ children: g ? /* @__PURE__ */ i(re, { children: [
2645
+ /* @__PURE__ */ e(_e, { className: "w-6 h-6 animate-spin" }),
2646
+ /* @__PURE__ */ e("span", { children: t("processing", m) })
2647
+ ] }) : /* @__PURE__ */ e("span", { children: t(T === "front" && a !== "passport" ? "next_back_side" : "confirm", m) })
2470
2648
  }
2471
2649
  ),
2472
2650
  /* @__PURE__ */ e("div", { className: "w-12 h-12" }),
2473
2651
  " "
2474
- ] }) : /* @__PURE__ */ a($, { children: [
2475
- /* @__PURE__ */ e("button", { className: "w-12 h-12 rounded-xl dark:bg-white/5 bg-black/5 flex items-center justify-center text-muted", children: /* @__PURE__ */ e(gt, { className: "w-6 h-6" }) }),
2476
- /* @__PURE__ */ a(
2652
+ ] }) : /* @__PURE__ */ i(re, { children: [
2653
+ /* @__PURE__ */ e("button", { className: "w-12 h-12 rounded-xl bg-brand-5 flex items-center justify-center text-muted", children: /* @__PURE__ */ e(It, { className: "w-6 h-6" }) }),
2654
+ /* @__PURE__ */ i(
2477
2655
  "button",
2478
2656
  {
2479
- onClick: U,
2480
- disabled: !m,
2657
+ onClick: b,
2658
+ disabled: !D,
2481
2659
  className: "flex-1 bg-brand hover:bg-brand/90 text-white h-14 rounded-2xl flex items-center justify-center gap-2 font-bold text-lg transition-all active:scale-95 shadow-[0_0_25px_rgba(130,66,240,0.5)] disabled:opacity-50",
2482
2660
  children: [
2483
- /* @__PURE__ */ e(_t, { className: "w-6 h-6" }),
2484
- /* @__PURE__ */ e("span", { children: t("capture", u) })
2661
+ /* @__PURE__ */ e(wt, { className: "w-6 h-6" }),
2662
+ /* @__PURE__ */ e("span", { children: t("capture", m) })
2485
2663
  ]
2486
2664
  }
2487
2665
  ),
2488
- /* @__PURE__ */ e("button", { className: "w-12 h-12 rounded-xl dark:bg-white/5 bg-black/5 flex items-center justify-center text-muted", children: /* @__PURE__ */ e(yt, { className: "w-6 h-6" }) })
2666
+ /* @__PURE__ */ e("button", { className: "w-12 h-12 rounded-xl bg-brand-5 flex items-center justify-center text-muted", children: /* @__PURE__ */ e(kt, { className: "w-6 h-6" }) })
2489
2667
  ] }) }),
2490
- /* @__PURE__ */ e("div", { className: "w-32 h-1.5 bg-slate-600/30 rounded-full mx-auto mt-8" })
2668
+ /* @__PURE__ */ e("div", { className: "w-32 h-1.5 bg-brand-10 rounded-full mx-auto mt-8" })
2491
2669
  ] })
2492
2670
  ]
2493
2671
  }
2494
2672
  );
2495
- }, Zt = ({
2673
+ }, ii = ({
2496
2674
  requestId: r,
2497
- documentType: i,
2498
- extractedData: s,
2499
- uploadId: o,
2500
- onNext: x,
2501
- onRetake: l,
2502
- onError: u,
2503
- apiBaseUrl: c = "https://apis.casperid.com",
2504
- previewMode: n = !1,
2505
- language: d = "EN"
2675
+ documentType: a,
2676
+ extractedData: n,
2677
+ uploadId: l,
2678
+ frontImageUrl: N,
2679
+ frontImageFileId: p,
2680
+ backImageUrl: f,
2681
+ backImageFileId: m,
2682
+ onNext: s,
2683
+ onRetake: c,
2684
+ onError: d,
2685
+ apiBaseUrl: D = "https://apis.casperid.com",
2686
+ apiKey: h = "",
2687
+ previewMode: A = !1,
2688
+ language: _ = "EN"
2506
2689
  }) => {
2507
- const [m, g] = y({
2508
- firstName: s.first_name || "",
2509
- lastName: s.last_name || "",
2510
- documentNumber: s.document_number || "",
2511
- dateOfBirth: s.date_of_birth || "",
2512
- nationality: s.nationality || "",
2513
- gender: s.gender || ""
2514
- }), [z, O] = y(!1), [h, _] = y(""), f = (N, j) => {
2515
- g((E) => ({ ...E, [N]: j }));
2516
- }, I = async () => {
2517
- if (!m.firstName || !m.lastName || !m.documentNumber) {
2518
- _(t("error_required_fields", d));
2690
+ const [o, I] = y({
2691
+ firstName: n.first_name || "",
2692
+ lastName: n.last_name || "",
2693
+ documentNumber: n.document_number || "",
2694
+ dateOfBirth: n.date_of_birth || "",
2695
+ nationality: n.nationality || "",
2696
+ gender: n.gender || ""
2697
+ }), [g, k] = y(!1), [V, w] = y(""), T = (b, C) => {
2698
+ I((S) => ({ ...S, [b]: C }));
2699
+ }, Y = async () => {
2700
+ if (!o.firstName || !o.lastName || !o.documentNumber) {
2701
+ w(t("error_required_fields", _));
2519
2702
  return;
2520
2703
  }
2521
- if (O(!0), _(""), n) {
2704
+ if (k(!0), w(""), A) {
2522
2705
  setTimeout(() => {
2523
- O(!1), x({
2524
- first_name: m.firstName,
2525
- last_name: m.lastName,
2526
- document_number: m.documentNumber,
2527
- date_of_birth: m.dateOfBirth,
2528
- nationality: m.nationality,
2529
- gender: m.gender,
2530
- document_type: i
2706
+ k(!1), s({
2707
+ first_name: o.firstName,
2708
+ last_name: o.lastName,
2709
+ document_number: o.documentNumber,
2710
+ date_of_birth: o.dateOfBirth,
2711
+ nationality: o.nationality,
2712
+ gender: o.gender,
2713
+ document_type: a
2531
2714
  });
2532
2715
  }, 1500);
2533
2716
  return;
2534
2717
  }
2535
2718
  try {
2536
- const N = await fetch(`${c}/api/v2/verification/layer3/submit`, {
2719
+ const b = await fetch(`${D}/api/v2/verification/layer3/submit`, {
2537
2720
  method: "POST",
2538
2721
  headers: {
2539
- "Content-Type": "application/json"
2722
+ "Content-Type": "application/json",
2723
+ ...h ? { "X-App-Id": h } : {}
2540
2724
  },
2541
2725
  credentials: "include",
2542
2726
  body: JSON.stringify({
2543
- upload_id: o,
2544
- liveness_verified: !0,
2727
+ upload_id: l,
2728
+ front_image_url: N,
2729
+ front_image_file_id: p,
2730
+ back_image_url: f,
2731
+ back_image_file_id: m,
2732
+ liveness_verified: !1,
2733
+ // Will be updated after FaceScan
2545
2734
  document_data: {
2546
- first_name: m.firstName,
2547
- last_name: m.lastName,
2548
- document_number: m.documentNumber,
2549
- date_of_birth: m.dateOfBirth,
2550
- nationality: m.nationality,
2551
- gender: m.gender,
2552
- document_type: i
2735
+ first_name: o.firstName,
2736
+ last_name: o.lastName,
2737
+ document_number: o.documentNumber,
2738
+ date_of_birth: o.dateOfBirth,
2739
+ nationality: o.nationality,
2740
+ gender: o.gender,
2741
+ document_type: a
2553
2742
  }
2554
2743
  })
2555
2744
  });
2556
- if (!N.ok) {
2557
- const E = await N.json().catch(() => ({}));
2558
- throw new Error(E.error || `Data submission failed with status ${N.status}`);
2745
+ if (!b.ok) {
2746
+ const S = await b.json().catch(() => ({}));
2747
+ throw new Error(S.error || `Data submission failed with status ${b.status}`);
2559
2748
  }
2560
- const j = await N.json();
2561
- j.success ? x({
2562
- first_name: m.firstName,
2563
- last_name: m.lastName,
2564
- document_number: m.documentNumber,
2565
- date_of_birth: m.dateOfBirth,
2566
- nationality: m.nationality,
2567
- gender: m.gender,
2568
- document_type: i
2569
- }) : (_(j.error || "Failed to submit data. Please try again."), O(!1));
2749
+ const C = await b.json();
2750
+ C.success ? s({
2751
+ first_name: o.firstName,
2752
+ last_name: o.lastName,
2753
+ document_number: o.documentNumber,
2754
+ date_of_birth: o.dateOfBirth,
2755
+ nationality: o.nationality,
2756
+ gender: o.gender,
2757
+ document_type: a
2758
+ }) : (w(C.error || "Failed to submit data. Please try again."), k(!1));
2570
2759
  } catch {
2571
- _("Failed to submit data. Please try again."), O(!1), u == null || u("Data submission failed");
2760
+ w("Failed to submit data. Please try again."), k(!1), d == null || d("Data submission failed");
2572
2761
  }
2573
- }, T = s.confidence || 0, C = Math.round(T * 100);
2574
- return /* @__PURE__ */ a(
2575
- V.div,
2762
+ }, W = n.confidence || 0, B = Math.round(W);
2763
+ return /* @__PURE__ */ i(
2764
+ P.div,
2576
2765
  {
2577
2766
  initial: { opacity: 0, y: 20 },
2578
2767
  animate: { opacity: 1, y: 0 },
2579
2768
  exit: { opacity: 0, y: -20 },
2580
2769
  className: "flex-1 overflow-y-auto px-6 pb-6",
2581
2770
  children: [
2582
- /* @__PURE__ */ e("div", { className: "flex gap-1 mb-6", children: [1, 2, 3, 0].map((N, j) => /* @__PURE__ */ e(
2771
+ /* @__PURE__ */ e("div", { className: "flex gap-1 mb-6", children: [1, 2, 3, 0].map((b, C) => /* @__PURE__ */ e(
2583
2772
  "div",
2584
2773
  {
2585
- className: `h-1 flex-1 rounded-xl ${N ? "bg-brand" : "bg-brand/20"}`
2774
+ className: `h-1 flex-1 rounded-xl ${b ? "bg-brand" : "bg-brand/20"}`
2586
2775
  },
2587
- j
2776
+ C
2588
2777
  )) }),
2589
- /* @__PURE__ */ a("div", { className: "mb-6", children: [
2590
- /* @__PURE__ */ e("h1", { className: "text-2xl font-bold text-main mb-2", children: t("review_data", d) }),
2591
- /* @__PURE__ */ e("p", { className: "text-muted text-sm leading-relaxed", children: t("verify_data_desc", d) })
2778
+ /* @__PURE__ */ i("div", { className: "mb-6", children: [
2779
+ /* @__PURE__ */ e("h1", { className: "text-2xl font-bold text-main mb-2", children: t("review_data", _) }),
2780
+ /* @__PURE__ */ e("p", { className: "text-muted text-sm leading-relaxed", children: t("verify_data_desc", _) })
2592
2781
  ] }),
2593
- T > 0 && /* @__PURE__ */ a("div", { className: "mb-6 p-3 rounded-xl dark:bg-white/5 bg-black/5 border dark:border-white/10 border-black/5", children: [
2594
- /* @__PURE__ */ a("div", { className: "flex items-center justify-between mb-2", children: [
2595
- /* @__PURE__ */ e("span", { className: "text-xs font-semibold text-muted", children: t("ocr_confidence", d) }),
2596
- /* @__PURE__ */ a("span", { className: `text-xs font-bold ${C >= 80 ? "text-green-500" : C >= 60 ? "text-yellow-500" : "text-red-500"}`, children: [
2597
- C,
2782
+ W > 0 && /* @__PURE__ */ i("div", { className: "mb-6 p-3 rounded-xl bg-brand-5 border border-brand-10", children: [
2783
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-2", children: [
2784
+ /* @__PURE__ */ e("span", { className: "text-xs font-semibold text-muted", children: t("ocr_confidence", _) }),
2785
+ /* @__PURE__ */ i("span", { className: `text-xs font-bold ${B >= 80 ? "text-green-500" : B >= 60 ? "text-yellow-500" : "text-red-500"}`, children: [
2786
+ B,
2598
2787
  "%"
2599
2788
  ] })
2600
2789
  ] }),
2601
- /* @__PURE__ */ e("div", { className: "w-full h-1.5 dark:bg-white/10 bg-black/10 rounded-full overflow-hidden", children: /* @__PURE__ */ e(
2790
+ /* @__PURE__ */ e("div", { className: "w-full h-1.5 bg-brand-10 rounded-full overflow-hidden", children: /* @__PURE__ */ e(
2602
2791
  "div",
2603
2792
  {
2604
- className: `h-full rounded-full transition-all ${C >= 80 ? "bg-green-500" : C >= 60 ? "bg-yellow-500" : "bg-red-500"}`,
2605
- style: { width: `${C}%` }
2793
+ className: `h-full rounded-full transition-all ${B >= 80 ? "bg-green-500" : B >= 60 ? "bg-yellow-500" : "bg-red-500"}`,
2794
+ style: { width: `${B}%` }
2606
2795
  }
2607
2796
  ) }),
2608
- C < 80 && /* @__PURE__ */ e("p", { className: "text-[10px] text-yellow-500 mt-2", children: t("verify_data_carefully", d) })
2797
+ B < 80 && /* @__PURE__ */ e("p", { className: "text-[10px] text-yellow-500 mt-2", children: t("verify_data_carefully", _) })
2609
2798
  ] }),
2610
- h && /* @__PURE__ */ a("div", { className: "mb-4 p-3 bg-red-500/20 border border-red-500/30 rounded-xl flex items-center gap-2", children: [
2611
- /* @__PURE__ */ e(se, { className: "w-4 h-4 text-red-500 shrink-0" }),
2612
- /* @__PURE__ */ e("p", { className: "text-red-400 text-xs font-medium", children: h })
2799
+ V && /* @__PURE__ */ i("div", { className: "mb-4 p-3 bg-red-500/20 border border-red-500/30 rounded-xl flex items-center gap-2", children: [
2800
+ /* @__PURE__ */ e(ve, { className: "w-4 h-4 text-red-500 shrink-0" }),
2801
+ /* @__PURE__ */ e("p", { className: "text-red-400 text-xs font-medium", children: V })
2613
2802
  ] }),
2614
- /* @__PURE__ */ a("div", { className: "space-y-5", children: [
2615
- /* @__PURE__ */ a("div", { className: "space-y-3", children: [
2616
- /* @__PURE__ */ e("label", { className: "text-xs font-bold uppercase tracking-[0.15em] text-brand ml-1", children: t("full_name", d) }),
2617
- /* @__PURE__ */ a("div", { className: "flex items-center px-1 transition-all", children: [
2618
- /* @__PURE__ */ e(At, { className: "text-brand mr-4 w-6 h-6 shrink-0" }),
2619
- /* @__PURE__ */ e("div", { className: "flex flex-col w-full", children: /* @__PURE__ */ e(
2803
+ /* @__PURE__ */ i("div", { className: "space-y-5", children: [
2804
+ /* @__PURE__ */ i("div", { className: "grid grid-cols-2 gap-4", children: [
2805
+ /* @__PURE__ */ i("div", { className: "space-y-3", children: [
2806
+ /* @__PURE__ */ e("label", { className: "text-xs font-bold uppercase tracking-[0.15em] text-brand ml-1", children: t("first_name", _) || "First Name" }),
2807
+ /* @__PURE__ */ i("div", { className: "flex items-center px-1 transition-all", children: [
2808
+ /* @__PURE__ */ e(zt, { className: "text-brand mr-3 w-5 h-5 shrink-0" }),
2809
+ /* @__PURE__ */ e("div", { className: "flex flex-col w-full", children: /* @__PURE__ */ e(
2810
+ "input",
2811
+ {
2812
+ className: "bg-transparent border-none p-0 w-full focus:ring-0 text-main font-bold text-lg focus:outline-none placeholder:text-muted",
2813
+ type: "text",
2814
+ value: o.firstName,
2815
+ onChange: (b) => T("firstName", b.target.value),
2816
+ placeholder: t("enter_first_name", _) || "First name"
2817
+ }
2818
+ ) })
2819
+ ] })
2820
+ ] }),
2821
+ /* @__PURE__ */ i("div", { className: "space-y-3", children: [
2822
+ /* @__PURE__ */ e("label", { className: "text-xs font-bold uppercase tracking-[0.15em] text-brand ml-1", children: t("last_name", _) || "Last Name" }),
2823
+ /* @__PURE__ */ e("div", { className: "flex items-center px-1 transition-all", children: /* @__PURE__ */ e("div", { className: "flex flex-col w-full", children: /* @__PURE__ */ e(
2620
2824
  "input",
2621
2825
  {
2622
- className: "bg-transparent border-none p-0 w-full focus:ring-0 text-main font-bold text-lg focus:outline-none placeholder:text-slate-300",
2826
+ className: "bg-transparent border-none p-0 w-full focus:ring-0 text-main font-bold text-lg focus:outline-none placeholder:text-muted",
2623
2827
  type: "text",
2624
- value: `${m.firstName} ${m.lastName}`,
2625
- onChange: (N) => {
2626
- const j = N.target.value.split(" ");
2627
- f("firstName", j[0] || ""), f("lastName", j.slice(1).join(" ") || "");
2628
- },
2629
- placeholder: t("enter_first_name", d)
2828
+ value: o.lastName,
2829
+ onChange: (b) => T("lastName", b.target.value),
2830
+ placeholder: t("enter_last_name", _) || "Last name"
2630
2831
  }
2631
- ) })
2832
+ ) }) })
2632
2833
  ] })
2633
2834
  ] }),
2634
- /* @__PURE__ */ a("div", { className: "space-y-3", children: [
2635
- /* @__PURE__ */ e("label", { className: "text-xs font-bold uppercase tracking-[0.15em] text-brand ml-1", children: t("id_number", d) }),
2636
- /* @__PURE__ */ a("div", { className: "flex items-center px-1 transition-all", children: [
2637
- /* @__PURE__ */ e(Ke, { className: "text-brand mr-4 w-6 h-6 shrink-0" }),
2835
+ /* @__PURE__ */ i("div", { className: "space-y-3", children: [
2836
+ /* @__PURE__ */ e("label", { className: "text-xs font-bold uppercase tracking-[0.15em] text-brand ml-1", children: t("id_number", _) }),
2837
+ /* @__PURE__ */ i("div", { className: "flex items-center px-1 transition-all", children: [
2838
+ /* @__PURE__ */ e(Qe, { className: "text-brand mr-4 w-6 h-6 shrink-0" }),
2638
2839
  /* @__PURE__ */ e(
2639
2840
  "input",
2640
2841
  {
2641
- className: "bg-transparent border-none p-0 w-full focus:ring-0 text-main font-bold text-lg focus:outline-none placeholder:text-slate-300",
2842
+ className: "bg-transparent border-none p-0 w-full focus:ring-0 text-main font-bold text-lg focus:outline-none placeholder:text-muted",
2642
2843
  type: "text",
2643
- value: m.documentNumber,
2644
- onChange: (N) => f("documentNumber", N.target.value),
2645
- placeholder: t("enter_doc_number", d)
2844
+ value: o.documentNumber,
2845
+ onChange: (b) => T("documentNumber", b.target.value),
2846
+ placeholder: t("enter_doc_number", _)
2646
2847
  }
2647
2848
  )
2648
2849
  ] })
2649
2850
  ] }),
2650
- /* @__PURE__ */ a("div", { className: "space-y-3", children: [
2651
- /* @__PURE__ */ e("label", { className: "text-xs font-bold uppercase tracking-[0.15em] text-brand ml-1", children: t("date_of_birth", d) }),
2652
- /* @__PURE__ */ a("div", { className: "flex items-center px-1 transition-all", children: [
2653
- /* @__PURE__ */ e(bt, { className: "text-brand mr-4 w-6 h-6 shrink-0" }),
2851
+ /* @__PURE__ */ i("div", { className: "space-y-3", children: [
2852
+ /* @__PURE__ */ e("label", { className: "text-xs font-bold uppercase tracking-[0.15em] text-brand ml-1", children: t("date_of_birth", _) }),
2853
+ /* @__PURE__ */ i("div", { className: "flex items-center px-1 transition-all", children: [
2854
+ /* @__PURE__ */ e(vt, { className: "text-brand mr-4 w-6 h-6 shrink-0" }),
2654
2855
  /* @__PURE__ */ e(
2655
2856
  "input",
2656
2857
  {
2657
- className: "bg-transparent border-none p-0 w-full focus:ring-0 text-main font-bold text-lg focus:outline-none placeholder:text-slate-300",
2858
+ className: "bg-transparent border-none p-0 w-full focus:ring-0 text-main font-bold text-lg focus:outline-none placeholder:text-muted",
2658
2859
  type: "text",
2659
- value: m.dateOfBirth,
2660
- onChange: (N) => f("dateOfBirth", N.target.value),
2661
- placeholder: t("date_format", d)
2860
+ value: o.dateOfBirth,
2861
+ onChange: (b) => T("dateOfBirth", b.target.value),
2862
+ placeholder: t("date_format", _)
2662
2863
  }
2663
2864
  )
2664
2865
  ] })
2665
2866
  ] }),
2666
- /* @__PURE__ */ a("div", { className: "space-y-3", children: [
2667
- /* @__PURE__ */ e("label", { className: "text-xs font-bold uppercase tracking-[0.15em] text-brand ml-1", children: t("nationality", d) }),
2668
- /* @__PURE__ */ a("div", { className: "flex items-center px-1 transition-all", children: [
2669
- /* @__PURE__ */ e(We, { className: "text-brand mr-4 w-6 h-6 shrink-0" }),
2867
+ /* @__PURE__ */ i("div", { className: "space-y-3", children: [
2868
+ /* @__PURE__ */ e("label", { className: "text-xs font-bold uppercase tracking-[0.15em] text-brand ml-1", children: t("nationality", _) }),
2869
+ /* @__PURE__ */ i("div", { className: "flex items-center px-1 transition-all", children: [
2870
+ /* @__PURE__ */ e(et, { className: "text-brand mr-4 w-6 h-6 shrink-0" }),
2670
2871
  /* @__PURE__ */ e(
2671
2872
  "input",
2672
2873
  {
2673
- className: "bg-transparent border-none p-0 w-full focus:ring-0 text-main font-bold text-lg focus:outline-none placeholder:text-slate-300",
2874
+ className: "bg-transparent border-none p-0 w-full focus:ring-0 text-main font-bold text-lg focus:outline-none placeholder:text-muted",
2674
2875
  type: "text",
2675
- value: m.nationality,
2676
- onChange: (N) => f("nationality", N.target.value),
2677
- placeholder: t("enter_nationality", d)
2876
+ value: o.nationality,
2877
+ onChange: (b) => T("nationality", b.target.value),
2878
+ placeholder: t("enter_nationality", _)
2678
2879
  }
2679
2880
  )
2680
2881
  ] })
2681
2882
  ] }),
2682
- /* @__PURE__ */ a("div", { className: "mt-8 relative h-32 w-full rounded-2xl overflow-hidden border border-brand-20 group", children: [
2883
+ /* @__PURE__ */ i("div", { className: "mt-8 relative h-32 w-full rounded-2xl overflow-hidden border border-brand-20 group", children: [
2683
2884
  /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-gradient-to-tr from-brand-20 to-cyan-500/10 blur-sm" }),
2684
- /* @__PURE__ */ a("div", { className: "absolute inset-0 bg-brand/10 flex flex-col items-center justify-center p-4", children: [
2685
- /* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
2686
- /* @__PURE__ */ e(he, { className: "text-brand w-5 h-5" }),
2687
- /* @__PURE__ */ e("span", { className: "text-xs font-bold dark:text-slate-200 text-slate-700", children: t("scanned_successfully", d) })
2885
+ /* @__PURE__ */ i("div", { className: "absolute inset-0 bg-brand/10 flex flex-col items-center justify-center p-4", children: [
2886
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-3", children: [
2887
+ /* @__PURE__ */ e(Ce, { className: "text-brand w-5 h-5" }),
2888
+ /* @__PURE__ */ e("span", { className: "text-xs font-bold text-main", children: t("scanned_successfully", _) })
2688
2889
  ] }),
2689
- l && /* @__PURE__ */ e(
2890
+ c && /* @__PURE__ */ e(
2690
2891
  "button",
2691
2892
  {
2692
- onClick: l,
2893
+ onClick: c,
2693
2894
  className: "mt-2 text-[10px] text-brand underline font-medium",
2694
2895
  type: "button",
2695
- children: t("retake_photo", d)
2896
+ children: t("retake_photo", _)
2696
2897
  }
2697
2898
  )
2698
2899
  ] })
2699
2900
  ] })
2700
2901
  ] }),
2701
- /* @__PURE__ */ a("div", { className: "mt-8", children: [
2902
+ /* @__PURE__ */ i("div", { className: "mt-8", children: [
2702
2903
  /* @__PURE__ */ e(
2703
2904
  "button",
2704
2905
  {
2705
- onClick: I,
2706
- disabled: z,
2906
+ onClick: Y,
2907
+ disabled: g,
2707
2908
  className: "w-full bg-brand hover:bg-brand/90 text-white font-bold py-4 rounded-2xl shadow-lg shadow-brand flex items-center justify-center gap-2 transition-transform active:scale-95 disabled:opacity-70",
2708
- children: z ? /* @__PURE__ */ a($, { children: [
2909
+ children: g ? /* @__PURE__ */ i(re, { children: [
2709
2910
  /* @__PURE__ */ e("div", { className: "w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin" }),
2710
- /* @__PURE__ */ e("span", { children: t("submitting", d) })
2711
- ] }) : /* @__PURE__ */ a($, { children: [
2712
- /* @__PURE__ */ e("span", { children: t("confirm_mint", d) }),
2713
- /* @__PURE__ */ e(St, { className: "w-5 h-5" })
2911
+ /* @__PURE__ */ e("span", { children: t("submitting", _) })
2912
+ ] }) : /* @__PURE__ */ i(re, { children: [
2913
+ /* @__PURE__ */ e("span", { children: t("confirm_mint", _) }),
2914
+ /* @__PURE__ */ e(Pt, { className: "w-5 h-5" })
2714
2915
  ] })
2715
2916
  }
2716
2917
  ),
2717
- /* @__PURE__ */ e("p", { className: "text-center text-[10px] mt-4 text-slate-500", children: t("secured_by_casper", d) })
2918
+ /* @__PURE__ */ e("p", { className: "text-center text-[10px] mt-4 text-muted", children: t("secured_by_casper", _) })
2718
2919
  ] })
2719
2920
  ]
2720
2921
  }
2721
2922
  );
2722
- }, Qt = (r, i) => r === "layer_1" ? {
2923
+ }, ai = (r, a) => r === "layer_1" ? {
2924
+ processing: {
2925
+ title: t("generating_wallet", a),
2926
+ subtitle: t("wallet_subtitle", a)
2927
+ },
2928
+ minting: {
2929
+ title: t("minting_did", a),
2930
+ subtitle: t("did_subtitle", a)
2931
+ },
2932
+ completed: {
2933
+ title: t("identity_created", a),
2934
+ subtitle: t("identity_created_subtitle", a)
2935
+ },
2936
+ failed: {
2937
+ title: t("setup_failed", a),
2938
+ subtitle: t("setup_failed_subtitle", a)
2939
+ }
2940
+ } : r === "layer_2" ? {
2723
2941
  processing: {
2724
- title: t("generating_wallet", i),
2725
- subtitle: t("wallet_subtitle", i)
2942
+ title: t("processing_liveness", a),
2943
+ subtitle: t("processing_subtitle", a)
2726
2944
  },
2727
2945
  minting: {
2728
- title: t("minting_did", i),
2729
- subtitle: t("did_subtitle", i)
2946
+ title: t("minting_identity", a),
2947
+ subtitle: t("minting_subtitle", a)
2730
2948
  },
2731
2949
  completed: {
2732
- title: t("identity_created", i),
2733
- subtitle: t("identity_created_subtitle", i)
2950
+ title: t("identity_verified", a),
2951
+ subtitle: t("identity_verified_subtitle", a)
2734
2952
  },
2735
2953
  failed: {
2736
- title: t("setup_failed", i),
2737
- subtitle: t("setup_failed_subtitle", i)
2954
+ title: t("verification_failed", a),
2955
+ subtitle: t("verification_failed_subtitle", a)
2738
2956
  }
2739
2957
  } : {
2740
2958
  processing: {
2741
- title: t(r === "layer_2" ? "processing_liveness" : "processing_documents", i),
2742
- subtitle: t("processing_subtitle", i)
2959
+ title: t("processing_documents", a),
2960
+ subtitle: t("processing_subtitle", a)
2743
2961
  },
2744
2962
  minting: {
2745
- title: t("minting_identity", i),
2746
- subtitle: t("minting_subtitle", i)
2963
+ title: t("submitting_for_review", a),
2964
+ subtitle: t("submitting_review_subtitle", a)
2747
2965
  },
2748
2966
  completed: {
2749
- title: t("verification_submitted", i),
2750
- subtitle: t("verification_submitted_subtitle", i)
2967
+ title: t("verification_submitted", a),
2968
+ subtitle: t("verification_submitted_subtitle", a)
2751
2969
  },
2752
2970
  failed: {
2753
- title: t("verification_failed", i),
2754
- subtitle: t("verification_failed_subtitle", i)
2971
+ title: t("verification_failed", a),
2972
+ subtitle: t("verification_failed_subtitle", a)
2755
2973
  }
2756
- }, Xt = ({
2974
+ }, ri = ({
2757
2975
  tier: r,
2758
- sessionToken: i,
2759
- requestId: s,
2760
- onNext: o,
2761
- onError: x,
2762
- apiBaseUrl: l = "https://apis.casperid.com",
2763
- previewMode: u = !1,
2764
- language: c = "EN"
2976
+ sessionToken: a,
2977
+ requestId: n,
2978
+ onNext: l,
2979
+ onError: N,
2980
+ apiBaseUrl: p = "https://apis.casperid.com",
2981
+ apiKey: f = "",
2982
+ previewMode: m = !1,
2983
+ language: s = "EN"
2765
2984
  }) => {
2766
- const [n, d] = y("processing"), [m, g] = y(0), [z, O] = y(""), [h, _] = y(null), [f, I] = y(null), [T, C] = y(null), [N, j] = y(null), E = re(!1), U = Qt(r, c)[n];
2767
- F(() => {
2768
- E.current || (E.current = !0, u ? v() : k());
2985
+ const [c, d] = y("processing"), [D, h] = y(0), [A, _] = y(""), [o, I] = y(null), [g, k] = y(null), [V, w] = y(null), [T, Y] = y(null), W = se(!1), b = ai(r, s)[c];
2986
+ ce(() => {
2987
+ W.current || (W.current = !0, m ? C() : S());
2769
2988
  }, []);
2770
- const v = async () => {
2771
- d("processing"), g(20), await P(1e3), g(50), await P(1e3), d("minting"), g(70), await P(1e3), g(100), d("completed"), r === "layer_1" ? (_("account-hash-abc123..."), j("casper-user-1234"), I("did:casper:abc123...")) : C("mock-credential-hash-xyz"), await P(1500), o({
2989
+ const C = async () => {
2990
+ d("processing"), h(20), await Q(1e3), h(50), await Q(1e3), d("minting"), h(70), await Q(1e3), h(100), d("completed"), r === "layer_1" ? (I("account-hash-abc123..."), Y("casper-user-1234"), k("did:casper:abc123...")) : w("mock-credential-hash-xyz"), await Q(1500), l({
2772
2991
  wallet: "account-hash-abc123...",
2773
2992
  didAddress: "did:casper:abc123...",
2774
2993
  credentialHash: "mock-credential-hash-xyz"
2775
2994
  });
2776
- }, k = async () => {
2995
+ }, S = async () => {
2777
2996
  try {
2778
- r === "layer_1" ? await w() : await A();
2779
- } catch (G) {
2780
- const B = G instanceof Error ? G.message : "Setup failed";
2781
- O(B), d("failed"), x == null || x(B);
2997
+ r === "layer_1" ? await L() : await G();
2998
+ } catch (ie) {
2999
+ const q = ie instanceof Error ? ie.message : "Setup failed";
3000
+ _(q), d("failed"), N == null || N(q);
2782
3001
  }
2783
- }, w = async () => {
2784
- var X;
2785
- d("processing"), g(10);
2786
- const G = await fetch(`${l}/api/passkey/wallet/generate`, {
3002
+ }, L = async () => {
3003
+ var me;
3004
+ d("processing"), h(10);
3005
+ const ie = await fetch(`${p}/api/passkey/wallet/generate`, {
2787
3006
  method: "POST",
2788
3007
  headers: {
2789
3008
  "Content-Type": "application/json",
2790
- Authorization: `Bearer ${i}`
3009
+ Authorization: `Bearer ${a}`,
3010
+ ...f ? { "X-App-Id": f } : {}
2791
3011
  },
2792
3012
  credentials: "include"
2793
3013
  });
2794
- if (!G.ok) {
2795
- const W = await G.json().catch(() => ({}));
2796
- throw new Error(W.error || "Failed to generate wallet");
3014
+ if (!ie.ok) {
3015
+ const ee = await ie.json().catch(() => ({}));
3016
+ throw new Error(ee.error || "Failed to generate wallet");
2797
3017
  }
2798
- const B = await G.json();
2799
- if (!B.success || !((X = B.walletInfo) != null && X.walletAddress))
2800
- throw new Error(B.error || "Wallet generation failed");
2801
- _(B.walletInfo.walletAddress), B.walletInfo.humanId && j(B.walletInfo.humanId), g(50), d("minting"), g(60);
2802
- const Y = await fetch(`${l}/api/passkey/did/mint`, {
3018
+ const q = await ie.json();
3019
+ if (!q.success || !((me = q.walletInfo) != null && me.walletAddress))
3020
+ throw new Error(q.error || "Wallet generation failed");
3021
+ I(q.walletInfo.walletAddress), q.walletInfo.humanId && Y(q.walletInfo.humanId), h(50), d("minting"), h(60);
3022
+ const pe = await fetch(`${p}/api/passkey/did/mint`, {
2803
3023
  method: "POST",
2804
3024
  headers: {
2805
3025
  "Content-Type": "application/json",
2806
- Authorization: `Bearer ${i}`
3026
+ Authorization: `Bearer ${a}`,
3027
+ ...f ? { "X-App-Id": f } : {}
2807
3028
  },
2808
3029
  credentials: "include"
2809
3030
  });
2810
- if (!Y.ok) {
2811
- const W = await Y.json().catch(() => ({}));
2812
- throw new Error(W.error || "Failed to mint DID");
3031
+ if (!pe.ok) {
3032
+ const ee = await pe.json().catch(() => ({}));
3033
+ throw new Error(ee.error || "Failed to mint DID");
2813
3034
  }
2814
- const J = await Y.json();
2815
- if (!J.success)
2816
- throw new Error(J.error || "DID minting failed");
2817
- I(J.did_address), C(J.transaction_hash), g(100), d("completed"), await P(1500), o({
2818
- wallet: B.walletInfo.walletAddress,
2819
- didAddress: J.did_address,
2820
- credentialHash: J.transaction_hash
3035
+ const K = await pe.json();
3036
+ if (!K.success)
3037
+ throw new Error(K.error || "DID minting failed");
3038
+ k(K.did_address), w(K.transaction_hash), h(100), d("completed"), await Q(1500), l({
3039
+ wallet: q.walletInfo.walletAddress,
3040
+ didAddress: K.did_address,
3041
+ credentialHash: K.transaction_hash
2821
3042
  });
2822
- }, A = async () => {
2823
- d("processing"), g(30), await P(500), g(60), d("minting"), g(80), await P(500), g(100), d("completed"), await P(1500), o({ credentialHash: s });
2824
- }, P = (G) => new Promise((B) => setTimeout(B, G)), K = () => {
2825
- d("processing"), g(0), O(""), E.current = !1, u ? v() : k();
2826
- }, Q = () => r === "layer_1" ? n === "minting" ? /* @__PURE__ */ e(pe, { className: "text-brand w-4 h-4" }) : /* @__PURE__ */ e(Dt, { className: "text-brand w-4 h-4" }) : /* @__PURE__ */ e(Ge, { className: "text-brand w-4 h-4" }), le = () => {
3043
+ }, O = async () => {
3044
+ var pe, K, me, ee;
3045
+ if (d("processing"), h(20), !n)
3046
+ throw new Error("No verification request ID provided");
3047
+ const ie = 10, q = 1500;
3048
+ for (let ne = 0; ne < ie; ne++)
3049
+ try {
3050
+ const U = await fetch(`${p}/api/v2/verification/${n}/status`, {
3051
+ method: "GET",
3052
+ headers: {
3053
+ "Content-Type": "application/json",
3054
+ ...f ? { "X-App-Id": f } : {}
3055
+ },
3056
+ credentials: "include"
3057
+ });
3058
+ if (!U.ok)
3059
+ throw new Error("Failed to check verification status");
3060
+ const v = await U.json(), M = (pe = v.verification) == null ? void 0 : pe.status;
3061
+ if (h(Math.min(20 + ne * 8, 80)), M === "completed") {
3062
+ d("minting"), h(90), await Q(500), h(100), d("completed");
3063
+ const Z = (me = (K = v.verification) == null ? void 0 : K.results) == null ? void 0 : me.proofHash;
3064
+ await Q(1500), l({ credentialHash: Z || n });
3065
+ return;
3066
+ }
3067
+ if (M === "failed")
3068
+ throw new Error(((ee = v.verification) == null ? void 0 : ee.error) || "Verification failed");
3069
+ await Q(q);
3070
+ } catch (U) {
3071
+ if (ne === ie - 1)
3072
+ throw U;
3073
+ await Q(q);
3074
+ }
3075
+ d("minting"), h(90), await Q(500), h(100), d("completed"), await Q(1500), l({ credentialHash: n });
3076
+ }, F = async () => {
3077
+ d("processing"), h(30), await Q(800), h(60), d("minting"), h(80), await Q(800), h(100), d("completed"), await Q(2e3), l({ credentialHash: n });
3078
+ }, G = async () => {
3079
+ r === "layer_2" ? await O() : await F();
3080
+ }, Q = (ie) => new Promise((q) => setTimeout(q, ie)), de = () => {
3081
+ d("processing"), h(0), _(""), W.current = !1, m ? C() : S();
3082
+ }, ue = () => r === "layer_1" ? c === "minting" ? /* @__PURE__ */ e(Ie, { className: "text-brand w-4 h-4" }) : /* @__PURE__ */ e(Vt, { className: "text-brand w-4 h-4" }) : /* @__PURE__ */ e(it, { className: "text-brand w-4 h-4" }), te = () => {
2827
3083
  if (r === "layer_1") {
2828
- if (n === "processing") return t("creating_wallet", c);
2829
- if (n === "minting") return t("minting_did_chain", c);
2830
- if (n === "completed") return t("identity_live", c);
3084
+ if (c === "processing") return t("creating_wallet", s);
3085
+ if (c === "minting") return t("minting_did_chain", s);
3086
+ if (c === "completed") return t("identity_live", s);
2831
3087
  } else {
2832
- if (n === "processing") return t("validating_docs", c);
2833
- if (n === "minting") return t("submitting_verification", c);
2834
- if (n === "completed") return t("verification_queued", c);
3088
+ if (c === "processing") return t("validating_docs", s);
3089
+ if (c === "minting") return t("submitting_verification", s);
3090
+ if (c === "completed") return t("verification_queued", s);
2835
3091
  }
2836
3092
  return "";
2837
3093
  };
2838
- return /* @__PURE__ */ a(
2839
- V.div,
3094
+ return /* @__PURE__ */ i(
3095
+ P.div,
2840
3096
  {
2841
3097
  initial: { opacity: 0 },
2842
3098
  animate: { opacity: 1 },
2843
3099
  exit: { opacity: 0 },
2844
3100
  className: "flex-1 flex flex-col items-center justify-center px-8 text-center",
2845
3101
  children: [
2846
- /* @__PURE__ */ a("div", { className: "relative w-64 h-64 flex items-center justify-center mb-12", children: [
3102
+ /* @__PURE__ */ i("div", { className: "relative w-64 h-64 flex items-center justify-center mb-12", children: [
2847
3103
  /* @__PURE__ */ e("div", { className: "absolute inset-0 rounded-full border-4 border-dashed border-brand-20 animate-[spin_10s_linear_infinite]" }),
2848
3104
  /* @__PURE__ */ e("div", { className: "absolute inset-4 rounded-full border-2 border-[#6DE8EC]/20 animate-[spin_6s_linear_infinite_reverse]" }),
2849
- /* @__PURE__ */ a(
2850
- V.div,
3105
+ /* @__PURE__ */ i(
3106
+ P.div,
2851
3107
  {
2852
- animate: n !== "failed" ? { rotateY: [0, 180, 360], y: [-10, 10, -10] } : {},
3108
+ animate: c !== "failed" ? { rotateY: [0, 180, 360], y: [-10, 10, -10] } : {},
2853
3109
  transition: { duration: 6, repeat: 1 / 0, ease: "easeInOut" },
2854
- className: `relative w-40 h-56 backdrop-blur-xl border rounded-2xl flex flex-col p-4 ${n === "completed" ? "bg-green-500/10 border-green-500/30 shadow-[0_0_50px_-12px_rgba(34,197,94,0.5)]" : n === "failed" ? "bg-red-500/10 border-red-500/30 shadow-[0_0_50px_-12px_rgba(239,68,68,0.5)]" : "bg-brand/10 border-brand-30 shadow-[0_0_50px_-12px_rgba(114,43,238,0.5)]"}`,
3110
+ className: `relative w-40 h-56 backdrop-blur-xl border rounded-2xl flex flex-col p-4 ${c === "completed" ? "bg-green-500/10 border-green-500/30 shadow-[0_0_50px_-12px_rgba(34,197,94,0.5)]" : c === "failed" ? "bg-red-500/10 border-red-500/30 shadow-[0_0_50px_-12px_rgba(239,68,68,0.5)]" : "bg-brand/10 border-brand-30 shadow-[0_0_50px_-12px_rgba(114,43,238,0.5)]"}`,
2855
3111
  children: [
2856
- /* @__PURE__ */ a("div", { className: "flex justify-between items-start mb-6", children: [
2857
- /* @__PURE__ */ e("div", { className: `w-8 h-8 rounded flex items-center justify-center ${n === "completed" ? "bg-green-500/30" : n === "failed" ? "bg-red-500/30" : "bg-brand/30"}`, children: n === "completed" ? /* @__PURE__ */ e(he, { className: "text-green-500 w-4 h-4" }) : n === "failed" ? /* @__PURE__ */ e(se, { className: "text-red-500 w-4 h-4" }) : Q() }),
2858
- /* @__PURE__ */ e("div", { className: `w-6 h-1 rounded-full ${n === "completed" ? "bg-green-500/40" : n === "failed" ? "bg-red-500/40" : "bg-brand/40"}` })
3112
+ /* @__PURE__ */ i("div", { className: "flex justify-between items-start mb-6", children: [
3113
+ /* @__PURE__ */ e("div", { className: `w-8 h-8 rounded flex items-center justify-center ${c === "completed" ? "bg-green-500/30" : c === "failed" ? "bg-red-500/30" : "bg-brand/30"}`, children: c === "completed" ? /* @__PURE__ */ e(Ce, { className: "text-green-500 w-4 h-4" }) : c === "failed" ? /* @__PURE__ */ e(ve, { className: "text-red-500 w-4 h-4" }) : ue() }),
3114
+ /* @__PURE__ */ e("div", { className: `w-6 h-1 rounded-full ${c === "completed" ? "bg-green-500/40" : c === "failed" ? "bg-red-500/40" : "bg-brand/40"}` })
2859
3115
  ] }),
2860
- /* @__PURE__ */ a("div", { className: "space-y-3 mb-auto", children: [
2861
- /* @__PURE__ */ e("div", { className: `h-2 w-3/4 rounded-full ${n === "completed" ? "bg-green-500/20" : n === "failed" ? "bg-red-500/20" : "bg-brand/20"}` }),
2862
- /* @__PURE__ */ e("div", { className: `h-2 w-1/2 rounded-full ${n === "completed" ? "bg-green-500/20" : n === "failed" ? "bg-red-500/20" : "bg-brand/20"}` })
3116
+ /* @__PURE__ */ i("div", { className: "space-y-3 mb-auto", children: [
3117
+ /* @__PURE__ */ e("div", { className: `h-2 w-3/4 rounded-full ${c === "completed" ? "bg-green-500/20" : c === "failed" ? "bg-red-500/20" : "bg-brand/20"}` }),
3118
+ /* @__PURE__ */ e("div", { className: `h-2 w-1/2 rounded-full ${c === "completed" ? "bg-green-500/20" : c === "failed" ? "bg-red-500/20" : "bg-brand/20"}` })
2863
3119
  ] }),
2864
- /* @__PURE__ */ a("div", { className: "flex items-center gap-2 mt-4", children: [
2865
- /* @__PURE__ */ e("div", { className: `size-6 rounded-full overflow-hidden border border-white/10 ${n === "completed" ? "bg-gradient-to-tr from-green-500 to-[#6DE8EC]" : n === "failed" ? "bg-gradient-to-tr from-red-500 to-orange-500" : "bg-gradient-to-tr from-brand to-[#6DE8EC]"}` }),
2866
- /* @__PURE__ */ a("div", { className: "flex flex-col items-start max-w-[80px]", children: [
2867
- N ? /* @__PURE__ */ e(
2868
- V.span,
3120
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-2 mt-4", children: [
3121
+ /* @__PURE__ */ e("div", { className: `size-6 rounded-full overflow-hidden border border-slate-200 dark:border-white/10 ${c === "completed" ? "bg-gradient-to-tr from-green-500 to-[#6DE8EC]" : c === "failed" ? "bg-gradient-to-tr from-red-500 to-orange-500" : "bg-gradient-to-tr from-brand to-[#6DE8EC]"}` }),
3122
+ /* @__PURE__ */ i("div", { className: "flex flex-col items-start max-w-[80px]", children: [
3123
+ T ? /* @__PURE__ */ e(
3124
+ P.span,
2869
3125
  {
2870
3126
  initial: { opacity: 0 },
2871
3127
  animate: { opacity: 1 },
2872
- className: "text-[10px] font-bold text-white/90 truncate w-full text-left",
2873
- children: N
3128
+ className: "text-[10px] font-bold text-slate-800 dark:text-white/90 truncate w-full text-left",
3129
+ children: T
2874
3130
  }
2875
3131
  ) : /* @__PURE__ */ e("div", { className: "h-1.5 w-12 bg-white/20 rounded-full mb-1" }),
2876
- /* @__PURE__ */ e("div", { className: "h-1 w-8 bg-white/10 rounded-full" })
3132
+ /* @__PURE__ */ e("div", { className: "h-1 w-8 bg-slate-200 dark:bg-white/10 rounded-full" })
2877
3133
  ] })
2878
3134
  ] }),
2879
- n !== "failed" && n !== "completed" && /* @__PURE__ */ e(
2880
- V.div,
3135
+ c !== "failed" && c !== "completed" && /* @__PURE__ */ e(
3136
+ P.div,
2881
3137
  {
2882
3138
  animate: { top: ["0%", "100%", "0%"] },
2883
3139
  transition: { duration: 2, repeat: 1 / 0 },
@@ -2888,385 +3144,401 @@ const $t = ({
2888
3144
  }
2889
3145
  )
2890
3146
  ] }),
2891
- /* @__PURE__ */ a("div", { className: "space-y-4", children: [
2892
- /* @__PURE__ */ e("h2", { className: `text-2xl font-bold bg-clip-text ${n === "completed" ? "text-green-500" : n === "failed" ? "text-red-500" : "dark:bg-gradient-to-r dark:from-slate-100 dark:to-slate-400 bg-slate-900 dark:text-transparent text-slate-900"}`, children: U.title }),
2893
- /* @__PURE__ */ e("p", { className: "dark:text-slate-400 text-slate-500 text-sm leading-relaxed max-w-[280px] mx-auto", children: U.subtitle })
3147
+ /* @__PURE__ */ i("div", { className: "space-y-4", children: [
3148
+ /* @__PURE__ */ e("h2", { className: `text-2xl font-bold bg-clip-text ${c === "completed" ? "text-green-500" : c === "failed" ? "text-red-500" : "dark:bg-gradient-to-r dark:from-slate-100 dark:to-slate-400 bg-slate-900 dark:text-transparent text-slate-900"}`, children: b.title }),
3149
+ /* @__PURE__ */ e("p", { className: "dark:text-slate-400 text-slate-500 text-sm leading-relaxed max-w-[280px] mx-auto", children: b.subtitle })
2894
3150
  ] }),
2895
- n === "failed" && /* @__PURE__ */ a("div", { className: "mt-6 space-y-3", children: [
2896
- /* @__PURE__ */ e("p", { className: "text-red-500 text-sm", children: z }),
3151
+ c === "failed" && /* @__PURE__ */ i("div", { className: "mt-6 space-y-3", children: [
3152
+ /* @__PURE__ */ e("p", { className: "text-red-500 text-sm", children: A }),
2897
3153
  /* @__PURE__ */ e(
2898
3154
  "button",
2899
3155
  {
2900
- onClick: K,
3156
+ onClick: de,
2901
3157
  className: "px-6 py-3 bg-brand text-white rounded-2xl font-bold",
2902
- children: t("try_again", c)
3158
+ children: t("try_again", s)
2903
3159
  }
2904
3160
  )
2905
3161
  ] }),
2906
- r === "layer_1" && h && n === "completed" && /* @__PURE__ */ a("div", { className: "mt-6 p-3 dark:bg-white/5 bg-black/5 rounded-xl border dark:border-white/10 border-black/5", children: [
2907
- /* @__PURE__ */ e("p", { className: "text-[10px] text-muted mb-1", children: t("your_wallet", c) }),
2908
- /* @__PURE__ */ a("p", { className: "text-xs font-mono text-main break-all", children: [
2909
- h.slice(0, 20),
3162
+ r === "layer_1" && o && c === "completed" && /* @__PURE__ */ i("div", { className: "mt-6 p-3 dark:bg-white/5 bg-black/5 rounded-xl border dark:border-white/10 border-black/5", children: [
3163
+ /* @__PURE__ */ e("p", { className: "text-[10px] text-muted mb-1", children: t("your_wallet", s) }),
3164
+ /* @__PURE__ */ i("p", { className: "text-xs font-mono text-main break-all", children: [
3165
+ o.slice(0, 20),
2910
3166
  "...",
2911
- h.slice(-10)
3167
+ o.slice(-10)
2912
3168
  ] })
2913
3169
  ] }),
2914
- r !== "layer_1" && T && n === "completed" && /* @__PURE__ */ a("div", { className: "mt-6 p-3 dark:bg-white/5 bg-black/5 rounded-xl border dark:border-white/10 border-black/5", children: [
2915
- /* @__PURE__ */ e("p", { className: "text-[10px] text-muted mb-1", children: t("verification_id", c) }),
2916
- /* @__PURE__ */ a("p", { className: "text-xs font-mono text-main break-all", children: [
2917
- T.slice(0, 20),
3170
+ r !== "layer_1" && V && c === "completed" && /* @__PURE__ */ i("div", { className: "mt-6 p-3 dark:bg-white/5 bg-black/5 rounded-xl border dark:border-white/10 border-black/5", children: [
3171
+ /* @__PURE__ */ e("p", { className: "text-[10px] text-muted mb-1", children: t("verification_id", s) }),
3172
+ /* @__PURE__ */ i("p", { className: "text-xs font-mono text-main break-all", children: [
3173
+ V.slice(0, 20),
2918
3174
  "..."
2919
3175
  ] })
2920
3176
  ] }),
2921
- n !== "failed" && /* @__PURE__ */ a("div", { className: "w-full mt-12 p-6 dark:bg-brand/5 bg-brand/5 border-t dark:border-white/5 border-black/5", children: [
2922
- /* @__PURE__ */ a("div", { className: "flex justify-between items-center mb-3", children: [
2923
- /* @__PURE__ */ e("span", { className: "text-xs font-medium text-brand uppercase tracking-widest", children: t(r === "layer_1" ? "setup_status" : "transaction_status", c) }),
2924
- /* @__PURE__ */ e("span", { className: `text-xs font-bold ${n === "completed" ? "text-green-500" : "text-[#6DE8EC]"}`, children: t("complete_percent", c).replace("{percent}", m.toString()) })
3177
+ c !== "failed" && /* @__PURE__ */ i("div", { className: "w-full mt-12 p-6 dark:bg-brand/5 bg-brand/5 border-t dark:border-white/5 border-black/5", children: [
3178
+ /* @__PURE__ */ i("div", { className: "flex justify-between items-center mb-3", children: [
3179
+ /* @__PURE__ */ e("span", { className: "text-xs font-medium text-brand uppercase tracking-widest", children: t(r === "layer_1" ? "setup_status" : "transaction_status", s) }),
3180
+ /* @__PURE__ */ e("span", { className: `text-xs font-bold ${c === "completed" ? "text-green-500" : "text-[#6DE8EC]"}`, children: t("complete_percent", s).replace("{percent}", D.toString()) })
2925
3181
  ] }),
2926
3182
  /* @__PURE__ */ e("div", { className: "w-full h-1.5 dark:bg-brand/10 bg-brand/10 rounded-full overflow-hidden mb-4", children: /* @__PURE__ */ e(
2927
- V.div,
3183
+ P.div,
2928
3184
  {
2929
3185
  initial: { width: "0%" },
2930
- animate: { width: `${m}%` },
3186
+ animate: { width: `${D}%` },
2931
3187
  transition: { duration: 0.5 },
2932
- className: `h-full rounded-full ${n === "completed" ? "bg-gradient-to-r from-green-500 to-[#6DE8EC]" : "bg-gradient-to-r from-brand to-[#6DE8EC]"} shadow-[0_0_10px_rgba(114,43,238,0.5)]`
3188
+ className: `h-full rounded-full ${c === "completed" ? "bg-gradient-to-r from-green-500 to-[#6DE8EC]" : "bg-gradient-to-r from-brand to-[#6DE8EC]"} shadow-[0_0_10px_rgba(114,43,238,0.5)]`
2933
3189
  }
2934
3190
  ) }),
2935
- /* @__PURE__ */ a("div", { className: "flex items-center gap-3 px-3 py-2 dark:bg-brand/10 bg-brand/10 rounded-xl border dark:border-brand-10 border-brand-5", children: [
2936
- /* @__PURE__ */ e(Nt, { className: `w-4 h-4 ${n === "completed" ? "text-green-500" : "text-brand"}` }),
2937
- /* @__PURE__ */ e("p", { className: "text-[10px] dark:text-slate-300 text-slate-600 font-medium", children: le() })
3191
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-3 px-3 py-2 dark:bg-brand/10 bg-brand/10 rounded-xl border dark:border-brand-10 border-brand-5", children: [
3192
+ /* @__PURE__ */ e(At, { className: `w-4 h-4 ${c === "completed" ? "text-green-500" : "text-brand"}` }),
3193
+ /* @__PURE__ */ e("p", { className: "text-[10px] dark:text-slate-300 text-slate-600 font-medium", children: te() })
2938
3194
  ] })
2939
3195
  ] })
2940
3196
  ]
2941
3197
  }
2942
3198
  );
2943
- }, ea = ({ onNext: r, language: i = "EN" }) => /* @__PURE__ */ a(
2944
- V.div,
3199
+ }, ni = ({ onNext: r, language: a = "EN" }) => /* @__PURE__ */ i(
3200
+ P.div,
2945
3201
  {
2946
3202
  initial: { opacity: 0, scale: 0.9 },
2947
3203
  animate: { opacity: 1, scale: 1 },
2948
3204
  exit: { opacity: 0, scale: 1.1 },
2949
3205
  className: "flex-1 flex flex-col items-center justify-center px-8 text-center",
2950
3206
  children: [
2951
- /* @__PURE__ */ a("div", { className: "relative mb-10 group", children: [
3207
+ /* @__PURE__ */ i("div", { className: "relative mb-10 group", children: [
2952
3208
  /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-[#6fe8ec]/30 rounded-3xl blur-3xl group-hover:blur-2xl transition-all" }),
2953
- /* @__PURE__ */ e("div", { className: "relative w-32 h-32 rounded-2xl bg-[#6fe8ec] flex items-center justify-center shadow-[0_0_40px_rgba(111,232,236,0.4)] border-4 dark:border-white border-slate-100", children: /* @__PURE__ */ e(he, { className: "text-slate-900 w-16 h-16" }) })
3209
+ /* @__PURE__ */ e("div", { className: "relative w-32 h-32 rounded-2xl bg-[#6fe8ec] flex items-center justify-center shadow-[0_0_40px_rgba(111,232,236,0.4)] border-4 dark:border-white border-slate-100", children: /* @__PURE__ */ e(Ce, { className: "text-slate-900 w-16 h-16" }) })
2954
3210
  ] }),
2955
- /* @__PURE__ */ e("h1", { className: "text-main text-3xl font-bold leading-tight mb-3", children: t("identity_verified", i) }),
2956
- /* @__PURE__ */ e("p", { className: "text-muted text-base leading-relaxed mb-12", children: t("identity_verified_desc", i) }),
2957
- /* @__PURE__ */ a("div", { className: "w-full dark:bg-white/5 bg-black/5 rounded-2xl p-5 mb-8 flex items-center justify-between text-left", children: [
2958
- /* @__PURE__ */ a("div", { className: "flex flex-col gap-0.5", children: [
2959
- /* @__PURE__ */ e("span", { className: "text-main font-bold text-sm", children: t("share_data_consent", i) }),
2960
- /* @__PURE__ */ e("p", { className: "text-muted text-xs leading-normal", children: t("authorize_dapps", i) })
3211
+ /* @__PURE__ */ e("h1", { className: "text-main text-3xl font-bold leading-tight mb-3", children: t("identity_verified", a) }),
3212
+ /* @__PURE__ */ e("p", { className: "text-muted text-base leading-relaxed mb-12", children: t("identity_verified_desc", a) }),
3213
+ /* @__PURE__ */ i("div", { className: "w-full bg-white dark:bg-white/5 shadow-sm border border-slate-200 dark:border-white/10 rounded-2xl p-5 mb-8 flex items-center justify-between text-left", children: [
3214
+ /* @__PURE__ */ i("div", { className: "flex flex-col gap-0.5", children: [
3215
+ /* @__PURE__ */ e("span", { className: "text-main font-bold text-sm", children: t("share_data_consent", a) }),
3216
+ /* @__PURE__ */ e("p", { className: "text-muted text-xs leading-normal", children: t("authorize_dapps", a) })
2961
3217
  ] }),
2962
3218
  /* @__PURE__ */ e("div", { className: "w-11 h-6 bg-brand rounded-full relative p-1 cursor-pointer", children: /* @__PURE__ */ e("div", { className: "absolute right-1 top-1 size-4 bg-white rounded-full" }) })
2963
3219
  ] }),
2964
- /* @__PURE__ */ a(
3220
+ /* @__PURE__ */ i(
2965
3221
  "button",
2966
3222
  {
2967
3223
  onClick: r,
2968
3224
  className: "w-full bg-[#6fe8ec] hover:brightness-105 active:scale-[0.98] transition-all text-slate-900 font-bold py-4 rounded-2xl shadow-lg shadow-[#6fe8ec]/20 flex items-center justify-center gap-2",
2969
3225
  children: [
2970
- t("return_to_app", i),
2971
- /* @__PURE__ */ e(Se, { className: "w-5 h-5" })
3226
+ t("return_to_app", a),
3227
+ /* @__PURE__ */ e(Oe, { className: "w-5 h-5" })
2972
3228
  ]
2973
3229
  }
2974
3230
  )
2975
3231
  ]
2976
3232
  }
2977
- ), ta = [
2978
- "perm_identity",
2979
- "perm_profile",
2980
- "perm_kyc"
2981
- ], aa = ({
3233
+ ), si = [
3234
+ "verify:identity",
3235
+ "read:profile",
3236
+ "read:kyc_level"
3237
+ ], ci = ({
2982
3238
  appName: r = "This App",
2983
- appLogo: i,
2984
- onApprove: s,
2985
- onDeny: o,
2986
- language: x = "EN"
2987
- }) => /* @__PURE__ */ a(
2988
- V.div,
2989
- {
2990
- initial: { opacity: 0, y: 20 },
2991
- animate: { opacity: 1, y: 0 },
2992
- exit: { opacity: 0, y: -20 },
2993
- className: "flex-1 px-8 pt-8 flex flex-col items-center",
2994
- children: [
2995
- /* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-4 mb-10", children: [
2996
- /* @__PURE__ */ a("div", { className: "relative", children: [
2997
- /* @__PURE__ */ e("div", { className: "absolute inset-0 rounded-full shadow-[0_0_20px_rgba(134,81,225,0.3)] animate-pulse" }),
2998
- /* @__PURE__ */ e("div", { className: "relative w-24 h-24 rounded-full border-2 border-brand-40 p-1 dark:bg-black/50 bg-white", children: i ? /* @__PURE__ */ e("div", { className: "w-full h-full rounded-full overflow-hidden", children: /* @__PURE__ */ e("img", { src: i, alt: r, className: "w-full h-full object-cover" }) }) : /* @__PURE__ */ e("div", { className: "w-full h-full rounded-full bg-gradient-to-br from-emerald-500 to-teal-700 flex items-center justify-center text-white font-bold text-2xl", children: r.slice(0, 2).toUpperCase() }) })
2999
- ] }),
3000
- /* @__PURE__ */ a("div", { className: "text-center", children: [
3001
- /* @__PURE__ */ e("h1", { className: "text-2xl font-bold tracking-tight text-main", children: r }),
3002
- /* @__PURE__ */ e("p", { className: "text-brand/70 text-sm font-medium mt-1 uppercase tracking-wider", children: t("requesting_access", x) })
3003
- ] })
3004
- ] }),
3005
- /* @__PURE__ */ a("div", { className: "w-full space-y-3", children: [
3006
- /* @__PURE__ */ e("h3", { className: "text-xs font-semibold uppercase tracking-widest text-slate-500 mb-4 px-1", children: t("permission_request", x) }),
3007
- ta.map((l) => /* @__PURE__ */ a(
3008
- "div",
3009
- {
3010
- className: "flex items-center gap-4 p-4 rounded-2xl dark:bg-white/5 bg-black/5 transition-all",
3011
- children: [
3012
- /* @__PURE__ */ e("div", { className: "flex items-center justify-center w-8 h-8 rounded-full bg-cyan-400/10 text-cyan-400 shrink-0", children: /* @__PURE__ */ e(he, { className: "w-5 h-5" }) }),
3013
- /* @__PURE__ */ e("p", { className: "text-sm font-medium text-main", children: t(l, x) })
3014
- ]
3015
- },
3016
- l
3017
- ))
3018
- ] }),
3019
- /* @__PURE__ */ a("div", { className: "mt-8 flex gap-3 p-4 rounded-2xl dark:bg-brand/5 bg-brand/5", children: [
3020
- /* @__PURE__ */ e(fe, { className: "text-brand w-5 h-5 shrink-0" }),
3021
- /* @__PURE__ */ a("p", { className: "text-xs leading-relaxed text-muted", children: [
3022
- /* @__PURE__ */ a("span", { className: "font-bold text-main", children: [
3023
- t("privacy_note", x),
3024
- ":"
3239
+ appLogo: a,
3240
+ requestedScopes: n,
3241
+ onApprove: l,
3242
+ onDeny: N,
3243
+ language: p = "EN"
3244
+ }) => {
3245
+ const f = n || si;
3246
+ return /* @__PURE__ */ i(
3247
+ P.div,
3248
+ {
3249
+ initial: { opacity: 0, y: 20 },
3250
+ animate: { opacity: 1, y: 0 },
3251
+ exit: { opacity: 0, y: -20 },
3252
+ className: "flex-1 px-8 pt-8 flex flex-col items-center",
3253
+ children: [
3254
+ /* @__PURE__ */ i("div", { className: "flex flex-col items-center gap-4 mb-10", children: [
3255
+ /* @__PURE__ */ i("div", { className: "relative", children: [
3256
+ /* @__PURE__ */ e("div", { className: "absolute inset-0 rounded-full shadow-[0_0_20px_rgba(134,81,225,0.3)] animate-pulse" }),
3257
+ /* @__PURE__ */ e("div", { className: "relative w-24 h-24 rounded-full border-2 border-brand-40 p-1 dark:bg-black/50 bg-white", children: a ? /* @__PURE__ */ e("div", { className: "w-full h-full rounded-full overflow-hidden", children: /* @__PURE__ */ e("img", { src: a, alt: r, className: "w-full h-full object-cover" }) }) : /* @__PURE__ */ e("div", { className: "w-full h-full rounded-full bg-gradient-to-br from-emerald-500 to-teal-700 flex items-center justify-center text-white font-bold text-2xl", children: r.slice(0, 2).toUpperCase() }) })
3025
3258
  ] }),
3026
- " ",
3027
- t("privacy_desc", x)
3259
+ /* @__PURE__ */ i("div", { className: "text-center", children: [
3260
+ /* @__PURE__ */ e("h1", { className: "text-2xl font-bold tracking-tight text-main", children: r }),
3261
+ /* @__PURE__ */ e("p", { className: "text-brand/70 text-sm font-medium mt-1 uppercase tracking-wider", children: t("requesting_access", p) })
3262
+ ] })
3263
+ ] }),
3264
+ /* @__PURE__ */ i("div", { className: "w-full space-y-3", children: [
3265
+ /* @__PURE__ */ e("h3", { className: "text-xs font-semibold uppercase tracking-widest text-slate-500 mb-4 px-1", children: t("permission_request", p) }),
3266
+ f.map((m) => /* @__PURE__ */ i(
3267
+ "div",
3268
+ {
3269
+ className: "flex items-center gap-4 p-4 rounded-2xl dark:bg-white/5 bg-black/5 transition-all",
3270
+ children: [
3271
+ /* @__PURE__ */ e("div", { className: "flex items-center justify-center w-8 h-8 rounded-full bg-cyan-400/10 text-cyan-400 shrink-0", children: /* @__PURE__ */ e(Ce, { className: "w-5 h-5" }) }),
3272
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium text-main", children: t(m, p) })
3273
+ ]
3274
+ },
3275
+ m
3276
+ ))
3277
+ ] }),
3278
+ /* @__PURE__ */ i("div", { className: "mt-8 flex gap-3 p-4 rounded-2xl dark:bg-brand/5 bg-brand/5", children: [
3279
+ /* @__PURE__ */ e(Se, { className: "text-brand w-5 h-5 shrink-0" }),
3280
+ /* @__PURE__ */ i("p", { className: "text-xs leading-relaxed text-muted", children: [
3281
+ /* @__PURE__ */ i("span", { className: "font-bold text-main", children: [
3282
+ t("privacy_note", p),
3283
+ ":"
3284
+ ] }),
3285
+ " ",
3286
+ t("privacy_desc", p)
3287
+ ] })
3288
+ ] }),
3289
+ /* @__PURE__ */ i("footer", { className: "mt-auto w-full pb-8 flex flex-col gap-3", children: [
3290
+ /* @__PURE__ */ i(
3291
+ "button",
3292
+ {
3293
+ onClick: l,
3294
+ className: "w-full py-4 rounded-2xl bg-brand hover:bg-brand-90 text-white font-bold text-base shadow-xl shadow-brand transition-all flex items-center justify-center gap-2",
3295
+ children: [
3296
+ t("approve_verify", p),
3297
+ /* @__PURE__ */ e(Fe, { className: "w-5 h-5" })
3298
+ ]
3299
+ }
3300
+ ),
3301
+ /* @__PURE__ */ e(
3302
+ "button",
3303
+ {
3304
+ onClick: N,
3305
+ className: "w-full py-3 rounded-2xl bg-transparent dark:hover:bg-slate-100 dark:bg-white/5 hover:bg-black/5 dark:text-slate-400 text-slate-500 font-semibold text-sm transition-all",
3306
+ children: t("deny", p)
3307
+ }
3308
+ )
3028
3309
  ] })
3029
- ] }),
3030
- /* @__PURE__ */ a("footer", { className: "mt-auto w-full pb-8 flex flex-col gap-3", children: [
3031
- /* @__PURE__ */ a(
3032
- "button",
3033
- {
3034
- onClick: s,
3035
- className: "w-full py-4 rounded-2xl bg-brand hover:bg-brand-90 text-white font-bold text-base shadow-xl shadow-brand transition-all flex items-center justify-center gap-2",
3036
- children: [
3037
- t("approve_verify", x),
3038
- /* @__PURE__ */ e(Ee, { className: "w-5 h-5" })
3039
- ]
3040
- }
3041
- ),
3042
- /* @__PURE__ */ e(
3043
- "button",
3044
- {
3045
- onClick: o,
3046
- className: "w-full py-3 rounded-2xl bg-transparent dark:hover:bg-white/5 hover:bg-black/5 dark:text-slate-400 text-slate-500 font-semibold text-sm transition-all",
3047
- children: t("deny", x)
3048
- }
3049
- )
3050
- ] })
3051
- ]
3052
- }
3053
- );
3054
- function Ue(r = "light") {
3310
+ ]
3311
+ }
3312
+ );
3313
+ };
3314
+ function Ge(r = "light") {
3055
3315
  return r === "system" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : r;
3056
3316
  }
3057
- const $e = ["AuthSelection", "Login", "PasskeyAuth", "PinVerification", "PasskeyRegister"], ia = "https://apis.casperid.com", Fe = {
3317
+ const Je = ["AuthSelection", "Login", "PasskeyAuth", "PinVerification", "PasskeyRegister"], oi = "https://apis.casperid.com", Ke = {
3058
3318
  requestId: "",
3059
3319
  verificationTier: "layer_3"
3060
- }, la = ({
3320
+ }, pi = ({
3061
3321
  isOpen: r,
3062
- apiKey: i,
3063
- theme: s = {},
3064
- requiredTier: o,
3065
- onSuccess: x,
3066
- onClose: l,
3067
- onError: u,
3068
- mode: c = "login",
3069
- previewMode: n = !1,
3070
- initialScreen: d,
3071
- apiBaseUrl: m,
3072
- termsUrl: g = "#",
3073
- privacyUrl: z = "#",
3074
- logoUrl: O,
3075
- language: h = "EN",
3076
- layout: _
3322
+ apiKey: a,
3323
+ theme: n = {},
3324
+ requiredTier: l,
3325
+ onSuccess: N,
3326
+ onClose: p,
3327
+ onError: f,
3328
+ mode: m = "login",
3329
+ previewMode: s = !1,
3330
+ initialScreen: c,
3331
+ apiBaseUrl: d,
3332
+ termsUrl: D = "#",
3333
+ privacyUrl: h = "#",
3334
+ logoUrl: A,
3335
+ language: _ = "EN",
3336
+ layout: o,
3337
+ platform: I
3077
3338
  }) => {
3078
- var Oe;
3079
- const [f, I] = y({}), [T, C] = y(!n && !!i), {
3080
- primaryColor: N,
3081
- borderRadius: j,
3082
- fontFamily: E,
3083
- mode: R = "light",
3084
- layout: U
3085
- } = s, v = N || f.primaryColor || "#8651e1", k = j || f.borderRadius || "12", w = E || f.fontFamily || "Inter", A = _ || U || f.layout || "auto", [P, K] = y(Ue(R)), [Q, le] = y(
3086
- d ?? (c === "verify" ? "SecurityUpgrade" : "AuthSelection")
3087
- ), [G, B] = y({ email: "", verificationId: "" }), [Y, J] = y(null), [X, W] = y({
3339
+ var Be;
3340
+ const [g, k] = y({}), [V, w] = y(!s && !!a), {
3341
+ primaryColor: T,
3342
+ borderRadius: Y,
3343
+ fontFamily: W,
3344
+ mode: B = "light",
3345
+ layout: b,
3346
+ platform: C
3347
+ } = n || {}, S = typeof navigator < "u" && /iPhone|iPad|iPod|Android/i.test(navigator.userAgent), L = T || g.primaryColor || "#8651e1", O = Y || g.borderRadius || "12", F = W || g.fontFamily || "Inter", G = o || b || g.layout || "auto", Q = I || C || g.platform || (S ? "mobile" : "desktop"), [de, ue] = y(Ge(B)), [te, ie] = y(
3348
+ c ?? (m === "verify" ? "SecurityUpgrade" : "AuthSelection")
3349
+ ), [q, pe] = y({ email: "", verificationId: "" }), [K, me] = y(null), [ee, ne] = y({
3088
3350
  email: "",
3089
3351
  userExists: !1,
3090
3352
  hasPasskey: !1,
3091
3353
  userAccount: null
3092
- }), [te, ne] = y(Fe), [Je, ge] = y(""), [na, Re] = y(""), [ce, Ze] = y(null), Z = m || ia, ve = k.toString().endsWith("px") ? k.toString() : `${k}px`, we = w.includes(" ") ? `"${w}", sans-serif` : `${w}, sans-serif`, oe = mt.useId().replace(/:/g, ""), Pe = {
3093
- "--casperid-primary": v,
3094
- "--casperid-radius": ve,
3095
- "--casperid-font": we
3096
- }, Te = `${oe}-${v}-${ve}-${we}`, ze = `
3097
- #casperid-modal-${oe},
3098
- #casperid-modal-${oe} * {
3099
- --casperid-primary: ${v} !important;
3100
- --casperid-radius: ${ve} !important;
3101
- --casperid-font: ${we} !important;
3354
+ }), [U, v] = y(Ke), [M, Z] = y(""), [fe, z] = y(""), [X, he] = y(null), H = d || oi, oe = O.toString().endsWith("px") ? O.toString() : `${O}px`, ge = F.includes(" ") ? `"${F}", sans-serif` : `${F}, sans-serif`, ae = _t.useId().replace(/:/g, ""), ye = {
3355
+ "--casperid-primary": L,
3356
+ "--casperid-radius": oe,
3357
+ "--casperid-font": ge
3358
+ }, Ae = `${ae}-${L}-${oe}-${ge}`, De = `
3359
+ #casperid-modal-${ae},
3360
+ #casperid-modal-${ae} * {
3361
+ --casperid-primary: ${L} !important;
3362
+ --casperid-radius: ${oe} !important;
3363
+ --casperid-font: ${ge} !important;
3102
3364
  }
3103
3365
  `;
3104
- F(() => {
3105
- if (R === "system") {
3106
- const p = window.matchMedia("(prefers-color-scheme: dark)"), b = (S) => K(S.matches ? "dark" : "light");
3107
- return p.addEventListener("change", b), () => p.removeEventListener("change", b);
3366
+ ce(() => {
3367
+ if (B === "system") {
3368
+ const u = window.matchMedia("(prefers-color-scheme: dark)"), x = (E) => ue(E.matches ? "dark" : "light");
3369
+ return u.addEventListener("change", x), () => u.removeEventListener("change", x);
3108
3370
  } else
3109
- K(Ue(R));
3110
- }, [R]), F(() => {
3111
- n && d && le(d);
3112
- }, [n, d]), F(() => {
3113
- r && !n && (le(d ?? (c === "verify" ? "SecurityUpgrade" : "AuthSelection")), B({ email: "", verificationId: "" }), J(null), W({ email: "", userExists: !1, hasPasskey: !1, userAccount: null }), ne(Fe), ge(""), Re(""));
3114
- }, [r, c, n, d]), F(() => {
3115
- if (!i || n) {
3116
- C(!1);
3371
+ ue(Ge(B));
3372
+ }, [B]), ce(() => {
3373
+ s && c && ie(c);
3374
+ }, [s, c]), ce(() => {
3375
+ r && !s && (ie(c ?? (m === "verify" ? "SecurityUpgrade" : "AuthSelection")), pe({ email: "", verificationId: "" }), me(null), ne({ email: "", userExists: !1, hasPasskey: !1, userAccount: null }), v(Ke), Z(""), z(""));
3376
+ }, [r, m, s, c]), ce(() => {
3377
+ if (!a || s) {
3378
+ w(!1);
3117
3379
  return;
3118
3380
  }
3119
3381
  (async () => {
3120
3382
  try {
3121
- const b = await fetch(`${Z}/api/business/app-metadata/${i}`);
3122
- if (b.ok) {
3123
- const S = await b.json();
3124
- S.success && S.app && (Ze(S.app), S.app.theme && I({
3125
- primaryColor: S.app.theme.primaryColor,
3126
- borderRadius: S.app.theme.borderRadius,
3127
- fontFamily: S.app.theme.fontFamily,
3128
- layout: S.app.theme.layout
3383
+ const x = await fetch(`${H}/api/business/app-metadata/${a}`);
3384
+ if (x.ok) {
3385
+ const E = await x.json();
3386
+ E.success && E.app && (he(E.app), E.app.theme && k({
3387
+ primaryColor: E.app.theme.primaryColor,
3388
+ borderRadius: E.app.theme.borderRadius,
3389
+ fontFamily: E.app.theme.fontFamily,
3390
+ layout: E.app.theme.layout,
3391
+ platform: E.app.theme.platform
3129
3392
  }));
3130
3393
  }
3131
- } catch (b) {
3132
- console.warn("[CasperID] Failed to fetch app metadata:", b);
3394
+ } catch (x) {
3395
+ console.warn("[CasperID] Failed to fetch app metadata:", x);
3133
3396
  } finally {
3134
- C(!1);
3397
+ w(!1);
3135
3398
  }
3136
3399
  })();
3137
- }, [i, Z, n]);
3138
- const je = () => K((p) => p === "dark" ? "light" : "dark"), D = q((p) => le(p), []), _e = q(async (p) => {
3400
+ }, [a, H, s]);
3401
+ const Ue = () => ue((u) => u === "dark" ? "light" : "dark"), R = J((u) => ie(u), []), ze = J(async (u) => {
3139
3402
  try {
3140
- const b = p === "layer_2" ? `${m}/api/v2/verification/layer2/start` : `${m}/api/v2/verification/layer3/start`, S = await fetch(b, {
3403
+ const x = u === "layer_2" ? `${d}/api/v2/verification/layer2/start` : `${d}/api/v2/verification/layer3/start`, E = await fetch(x, {
3141
3404
  method: "POST",
3142
3405
  headers: {
3143
3406
  "Content-Type": "application/json",
3144
- "X-API-Key": i
3407
+ "X-API-Key": a
3145
3408
  },
3146
3409
  credentials: "include",
3147
3410
  body: JSON.stringify({
3148
3411
  purpose: "sdk_verification",
3149
- ...p === "layer_3" ? { verificationMethod: "document" } : {}
3412
+ ...u === "layer_3" ? { verificationMethod: "document" } : {}
3150
3413
  })
3151
3414
  });
3152
- if (!S.ok) {
3153
- const H = await S.json().catch(() => ({}));
3154
- throw new Error(H.error || `Request failed with status ${S.status}`);
3415
+ if (!E.ok) {
3416
+ const le = await E.json().catch(() => ({}));
3417
+ throw new Error(le.error || `Request failed with status ${E.status}`);
3155
3418
  }
3156
- const L = await S.json();
3157
- if (L.success && L.verification)
3158
- return ne((H) => ({
3159
- ...H,
3160
- requestId: L.verification.requestId,
3161
- verificationTier: p
3162
- })), L.verification.requestId;
3163
- throw new Error(L.error || "Failed to start verification");
3164
- } catch (b) {
3165
- return u == null || u(b instanceof Error ? b : new Error("Failed to start verification")), null;
3419
+ const $ = await E.json();
3420
+ if ($.success && $.verification)
3421
+ return v((le) => ({
3422
+ ...le,
3423
+ requestId: $.verification.requestId,
3424
+ verificationTier: u
3425
+ })), $.verification.requestId;
3426
+ throw new Error($.error || "Failed to start verification");
3427
+ } catch (x) {
3428
+ return f == null || f(x instanceof Error ? x : new Error("Failed to start verification")), null;
3166
3429
  }
3167
- }, [m, i, u]), Qe = q((p, b, S) => {
3168
- J(p), W((L) => ({
3169
- ...L,
3170
- sessionToken: p,
3171
- businessToken: S,
3172
- userAccount: b || null
3173
- })), b != null && b.wallet && (b != null && b.did_address) && X.hasPasskey ? ye(b.tier) : D("PasskeyRegister");
3174
- }, [D, X.hasPasskey]), Xe = q((p) => {
3175
- W((b) => ({ ...b, email: p, hasPasskey: !0, userExists: !0 })), D("PasskeyAuth");
3176
- }, [D]), et = q((p, b, S) => {
3177
- J(p), W((L) => ({
3178
- ...L,
3179
- sessionToken: p,
3180
- businessToken: S,
3181
- userAccount: b ? {
3182
- user_id: b.user_id,
3183
- wallet: b.wallet,
3184
- tier: b.tier,
3185
- did_address: b.did_address
3430
+ }, [d, a, f]), rt = J((u, x, E) => {
3431
+ me(u), ne(($) => ({
3432
+ ...$,
3433
+ sessionToken: u,
3434
+ businessToken: E,
3435
+ userAccount: x || null
3436
+ })), x != null && x.wallet && (x != null && x.did_address) && ee.hasPasskey ? Re(x.tier) : R("PasskeyRegister");
3437
+ }, [R, ee.hasPasskey]), nt = J((u) => {
3438
+ ne((x) => ({ ...x, email: u, hasPasskey: !0, userExists: !0 })), R("PasskeyAuth");
3439
+ }, [R]), st = J((u, x, E) => {
3440
+ me(u), ne(($) => ({
3441
+ ...$,
3442
+ sessionToken: u,
3443
+ businessToken: E,
3444
+ userAccount: x ? {
3445
+ user_id: x.user_id,
3446
+ wallet: x.wallet,
3447
+ tier: x.tier,
3448
+ did_address: x.did_address
3186
3449
  } : null
3187
- })), ye(b == null ? void 0 : b.tier);
3188
- }, []), tt = q((p, b) => {
3189
- W((S) => ({
3190
- ...S,
3450
+ })), Re(x == null ? void 0 : x.tier);
3451
+ }, []), ct = J((u, x) => {
3452
+ ne((E) => ({
3453
+ ...E,
3191
3454
  hasPasskey: !0,
3192
- businessToken: b,
3193
- userAccount: p ? {
3194
- user_id: p.user_id,
3195
- tier: p.tier
3196
- } : S.userAccount
3197
- })), D("MintingIdentity");
3198
- }, [D]), ye = q((p) => {
3199
- const b = p || "layer_0";
3200
- if (!o) {
3201
- D("IdentityVerified");
3455
+ businessToken: x,
3456
+ userAccount: u ? {
3457
+ user_id: u.user_id,
3458
+ tier: u.tier
3459
+ } : E.userAccount
3460
+ })), R("MintingIdentity");
3461
+ }, [R]), Re = J((u) => {
3462
+ const x = u || "layer_0";
3463
+ if (!l) {
3464
+ R("IdentityVerified");
3202
3465
  return;
3203
3466
  }
3204
- const S = o === "L1" ? "layer_1" : o === "L2" ? "layer_2" : o === "L3" ? "layer_3" : "layer_1", L = ["layer_0", "layer_1", "layer_2", "layer_3"], H = L.indexOf(b), ue = L.indexOf(S);
3205
- H >= ue ? D("IdentityVerified") : ue >= 2 ? D("SecurityUpgrade") : D("IdentityVerified");
3206
- }, [o, D]), at = q(async (p) => {
3207
- var S;
3208
- if (p != null && p.wallet && W((L) => {
3209
- var H;
3467
+ const E = l === "L1" ? "layer_1" : l === "L2" ? "layer_2" : l === "L3" ? "layer_3" : "layer_1", $ = ["layer_0", "layer_1", "layer_2", "layer_3"], le = $.indexOf(x), we = $.indexOf(E);
3468
+ le >= we ? R("IdentityVerified") : we >= 2 ? R("SecurityUpgrade") : R("IdentityVerified");
3469
+ }, [l, R]), ot = J(async (u) => {
3470
+ var E;
3471
+ if (u != null && u.wallet && ne(($) => {
3472
+ var le;
3210
3473
  return {
3211
- ...L,
3474
+ ...$,
3212
3475
  userAccount: {
3213
- ...L.userAccount,
3214
- user_id: ((H = L.userAccount) == null ? void 0 : H.user_id) || "",
3215
- wallet: p.wallet,
3216
- did_address: p.didAddress,
3476
+ ...$.userAccount,
3477
+ user_id: ((le = $.userAccount) == null ? void 0 : le.user_id) || "",
3478
+ wallet: u.wallet,
3479
+ did_address: u.didAddress,
3217
3480
  tier: "layer_1"
3218
3481
  }
3219
3482
  };
3220
- }), p != null && p.credentialHash && Re(p.credentialHash), Y && !n)
3483
+ }), u != null && u.credentialHash && z(u.credentialHash), K && !s)
3221
3484
  try {
3222
- const L = await fetch(`${Z}/api/casperid/refresh`, {
3485
+ const $ = await fetch(`${H}/api/casperid/refresh`, {
3223
3486
  method: "POST",
3224
3487
  headers: { "Content-Type": "application/json" },
3225
- body: JSON.stringify({ token: Y, apiKey: i })
3488
+ body: JSON.stringify({ token: K, apiKey: a })
3226
3489
  });
3227
- if (L.ok) {
3228
- const H = await L.json();
3229
- H.success && H.token && (console.log("[CasperID SDK] Token refreshed after verification"), J(H.token), W((ue) => ({
3230
- ...ue,
3231
- sessionToken: H.token,
3232
- businessToken: H.business_token || ue.businessToken
3490
+ if ($.ok) {
3491
+ const le = await $.json();
3492
+ le.success && le.token && (console.log("[CasperID SDK] Token refreshed after verification"), me(le.token), ne((we) => ({
3493
+ ...we,
3494
+ sessionToken: le.token,
3495
+ businessToken: le.business_token || we.businessToken
3233
3496
  })));
3234
3497
  }
3235
- } catch (L) {
3236
- console.warn("[CasperID SDK] Failed to refresh token after verification:", L);
3498
+ } catch ($) {
3499
+ console.warn("[CasperID SDK] Failed to refresh token after verification:", $);
3237
3500
  }
3238
- const b = p != null && p.wallet ? "layer_1" : ((S = X.userAccount) == null ? void 0 : S.tier) || "layer_1";
3239
- ye(b);
3240
- }, [(Oe = X.userAccount) == null ? void 0 : Oe.tier, ye, Y, Z, n]), it = q((p) => {
3241
- const b = (p == null ? void 0 : p.sessionToken) || (p == null ? void 0 : p.token), S = (p == null ? void 0 : p.business_token) || (p == null ? void 0 : p.businessToken);
3242
- b && J(b), S && W((L) => ({ ...L, businessToken: S })), D("SecurityUpgrade");
3243
- }, [D]), rt = q(async () => {
3244
- await _e("layer_2") && D("FaceScan");
3245
- }, [_e, D]), nt = q(async (p) => {
3246
- ne((b) => ({ ...b, livenessVerified: p })), o === "L3" ? await _e("layer_3") && D("VerifyIdentityChoice") : D("MintingIdentity");
3247
- }, [o, _e, D]), st = q((p) => {
3248
- ne((b) => ({ ...b, documentType: p })), D("DocumentScan");
3249
- }, [D]), ct = q((p, b) => {
3250
- ne((S) => ({ ...S, extractedData: p })), ge(b), D("ReviewData");
3251
- }, [D]), dt = q((p) => {
3252
- ne((b) => ({ ...b, extractedData: p })), D("MintingIdentity");
3253
- }, [D]), lt = q(() => {
3254
- ne((p) => ({ ...p, extractedData: void 0 })), ge(""), D("DocumentScan");
3255
- }, [D]), ot = q(() => {
3256
- if (!Y) {
3257
- u == null || u(new Error("No valid session token available"));
3501
+ let x = u != null && u.wallet ? "layer_1" : ((E = ee.userAccount) == null ? void 0 : E.tier) || "layer_1";
3502
+ U.livenessVerified && U.verificationTier === "layer_2" ? x = "layer_2" : U.documentType && U.verificationTier === "layer_3" && (x = "layer_3"), Re(x);
3503
+ }, [(Be = ee.userAccount) == null ? void 0 : Be.tier, Re, K, H, s, U]), lt = J((u) => {
3504
+ const x = (u == null ? void 0 : u.sessionToken) || (u == null ? void 0 : u.token), E = (u == null ? void 0 : u.business_token) || (u == null ? void 0 : u.businessToken);
3505
+ x && me(x), E && ne(($) => ({ ...$, businessToken: E })), R("SecurityUpgrade");
3506
+ }, [R]), dt = J(async () => {
3507
+ l === "L3" ? await ze("layer_3") && R("VerifyIdentityChoice") : await ze("layer_2") && R("FaceScan");
3508
+ }, [l, ze, R]), ut = J(async (u) => {
3509
+ v((x) => ({ ...x, livenessVerified: u })), R("MintingIdentity");
3510
+ }, [R]), mt = J((u) => {
3511
+ v((x) => ({ ...x, documentType: u })), R("DocumentScan");
3512
+ }, [R]), pt = J((u, x, E) => {
3513
+ v(($) => ({
3514
+ ...$,
3515
+ extractedData: u,
3516
+ frontImageUrl: E.frontImageUrl,
3517
+ frontImageFileId: E.frontImageFileId,
3518
+ backImageUrl: E.backImageUrl,
3519
+ backImageFileId: E.backImageFileId
3520
+ })), Z(x), R("ReviewData");
3521
+ }, [R]), ft = J((u) => {
3522
+ v((x) => ({ ...x, extractedData: u })), R("FaceScan");
3523
+ }, [R]);
3524
+ J(() => {
3525
+ v((u) => ({ ...u, extractedData: void 0 })), Z(""), R("DocumentScan");
3526
+ }, [R]);
3527
+ const ht = J(() => {
3528
+ if (!K) {
3529
+ f == null || f(new Error("No valid session token available"));
3258
3530
  return;
3259
3531
  }
3260
- x == null || x(Y, {
3261
- businessToken: X.businessToken
3262
- }), l == null || l();
3263
- }, [Y, X.businessToken, x, l, u]), ae = q((p) => {
3264
- u == null || u(new Error(p));
3265
- }, [u]), ut = q((p, b) => {
3266
- B({ email: p, verificationId: b }), W((S) => ({ ...S, email: p })), D("PinVerification");
3267
- }, [D]);
3268
- if (!r && !n) return null;
3269
- if (T && !n)
3532
+ N == null || N(K, {
3533
+ businessToken: ee.businessToken
3534
+ }), p == null || p();
3535
+ }, [K, ee.businessToken, N, p, f]), be = J((u) => {
3536
+ f == null || f(new Error(u));
3537
+ }, [f]), bt = J((u, x) => {
3538
+ pe({ email: u, verificationId: x }), ne((E) => ({ ...E, email: u })), R("PinVerification");
3539
+ }, [R]);
3540
+ if (!r && !s) return null;
3541
+ if (V && !s)
3270
3542
  return /* @__PURE__ */ e(
3271
3543
  "div",
3272
3544
  {
@@ -3275,233 +3547,246 @@ const $e = ["AuthSelection", "Login", "PasskeyAuth", "PinVerification", "Passkey
3275
3547
  children: /* @__PURE__ */ e("div", { className: "w-12 h-12 border-3 border-white/20 border-t-white/80 rounded-full animate-spin" })
3276
3548
  }
3277
3549
  );
3278
- const Me = () => {
3279
- switch (Q) {
3550
+ const $e = () => {
3551
+ switch (te) {
3280
3552
  case "AuthSelection":
3281
3553
  return /* @__PURE__ */ e(
3282
- Pt,
3554
+ Mt,
3283
3555
  {
3284
- onNext: (b) => D(b === "otp" ? "Login" : "SecurityUpgrade"),
3285
- onExtensionSuccess: it,
3286
- onError: ae,
3287
- language: h
3556
+ onNext: (x) => R(x === "otp" ? "Login" : "SecurityUpgrade"),
3557
+ onExtensionSuccess: lt,
3558
+ onError: be,
3559
+ language: _,
3560
+ platform: Q
3288
3561
  }
3289
3562
  );
3290
3563
  case "Login":
3291
3564
  return /* @__PURE__ */ e(
3292
- Tt,
3565
+ Lt,
3293
3566
  {
3294
- onNext: ut,
3295
- onPasskeyUser: Xe,
3296
- onError: ae,
3297
- apiBaseUrl: Z,
3298
- previewMode: n,
3299
- language: h
3567
+ onNext: bt,
3568
+ onPasskeyUser: nt,
3569
+ onError: be,
3570
+ apiBaseUrl: H,
3571
+ apiKey: a,
3572
+ previewMode: s,
3573
+ language: _
3300
3574
  }
3301
3575
  );
3302
3576
  case "PasskeyAuth":
3303
3577
  return /* @__PURE__ */ e(
3304
- $t,
3578
+ Yt,
3305
3579
  {
3306
- email: X.email,
3307
- onSuccess: et,
3308
- onError: ae,
3309
- onFallbackToOTP: () => D("Login"),
3310
- apiBaseUrl: Z,
3311
- previewMode: n,
3312
- language: h
3580
+ email: ee.email,
3581
+ onSuccess: st,
3582
+ onError: be,
3583
+ onFallbackToOTP: () => R("Login"),
3584
+ apiBaseUrl: H,
3585
+ apiKey: a,
3586
+ previewMode: s,
3587
+ language: _
3313
3588
  }
3314
3589
  );
3315
3590
  case "PasskeyRegister":
3316
3591
  return /* @__PURE__ */ e(
3317
- Ft,
3592
+ Gt,
3318
3593
  {
3319
- email: X.email || G.email,
3320
- sessionToken: Y || "",
3321
- onSuccess: tt,
3322
- onError: ae,
3323
- apiBaseUrl: Z,
3324
- previewMode: n,
3325
- language: h
3594
+ email: ee.email || q.email,
3595
+ sessionToken: K || "",
3596
+ onSuccess: ct,
3597
+ onError: be,
3598
+ apiBaseUrl: H,
3599
+ apiKey: a,
3600
+ previewMode: s,
3601
+ language: _
3326
3602
  }
3327
3603
  );
3328
3604
  case "PinVerification":
3329
3605
  return /* @__PURE__ */ e(
3330
- Bt,
3606
+ Jt,
3331
3607
  {
3332
- email: G.email,
3333
- verificationId: G.verificationId,
3334
- onNext: Qe,
3335
- onError: ae,
3336
- apiBaseUrl: Z,
3337
- apiKey: i,
3338
- previewMode: n,
3339
- language: h
3608
+ email: q.email,
3609
+ verificationId: q.verificationId,
3610
+ onNext: rt,
3611
+ onError: be,
3612
+ apiBaseUrl: H,
3613
+ apiKey: a,
3614
+ previewMode: s,
3615
+ language: _
3340
3616
  }
3341
3617
  );
3342
3618
  case "SecurityUpgrade":
3343
3619
  return /* @__PURE__ */ e(
3344
- Ht,
3620
+ Kt,
3345
3621
  {
3346
- onNext: rt,
3347
- onSkip: () => D("IdentityVerified"),
3348
- language: h
3622
+ onNext: dt,
3623
+ onSkip: () => R("IdentityVerified"),
3624
+ language: _
3349
3625
  }
3350
3626
  );
3351
3627
  case "FaceScan":
3352
3628
  return /* @__PURE__ */ e(
3353
- Kt,
3629
+ Zt,
3354
3630
  {
3355
- requestId: te.requestId,
3356
- onNext: nt,
3357
- onError: ae,
3358
- apiBaseUrl: Z,
3359
- previewMode: n,
3360
- language: h
3631
+ requestId: U.requestId,
3632
+ onNext: ut,
3633
+ onError: be,
3634
+ apiBaseUrl: H,
3635
+ apiKey: a,
3636
+ previewMode: s,
3637
+ language: _
3361
3638
  }
3362
3639
  );
3363
3640
  case "VerifyIdentityChoice":
3364
3641
  return /* @__PURE__ */ e(
3365
- Gt,
3642
+ Qt,
3366
3643
  {
3367
- onNext: st,
3368
- language: h
3644
+ onNext: mt,
3645
+ language: _
3369
3646
  }
3370
3647
  );
3371
3648
  case "DocumentScan":
3372
3649
  return /* @__PURE__ */ e(
3373
- Jt,
3650
+ ti,
3374
3651
  {
3375
- requestId: te.requestId,
3376
- documentType: te.documentType || "passport",
3377
- onNext: ct,
3378
- onError: ae,
3379
- apiBaseUrl: Z,
3380
- previewMode: n,
3381
- language: h
3652
+ requestId: U.requestId,
3653
+ documentType: U.documentType,
3654
+ onNext: pt,
3655
+ onError: be,
3656
+ apiBaseUrl: H,
3657
+ apiKey: a,
3658
+ previewMode: s,
3659
+ language: _
3382
3660
  }
3383
3661
  );
3384
3662
  case "ReviewData":
3385
3663
  return /* @__PURE__ */ e(
3386
- Zt,
3664
+ ii,
3387
3665
  {
3388
- requestId: te.requestId,
3389
- documentType: te.documentType || "passport",
3390
- extractedData: te.extractedData || {},
3391
- uploadId: Je,
3392
- onNext: dt,
3393
- onRetake: lt,
3394
- onError: ae,
3395
- apiBaseUrl: Z,
3396
- previewMode: n,
3397
- language: h
3666
+ requestId: U.requestId,
3667
+ documentType: U.documentType,
3668
+ extractedData: U.extractedData,
3669
+ uploadId: M,
3670
+ frontImageUrl: U.frontImageUrl,
3671
+ frontImageFileId: U.frontImageFileId,
3672
+ backImageUrl: U.backImageUrl,
3673
+ backImageFileId: U.backImageFileId,
3674
+ onNext: ft,
3675
+ onRetake: () => R("DocumentScan"),
3676
+ onError: be,
3677
+ apiBaseUrl: H,
3678
+ apiKey: a,
3679
+ previewMode: s,
3680
+ language: _
3398
3681
  }
3399
3682
  );
3400
3683
  case "MintingIdentity":
3401
- const p = te.requestId ? te.verificationTier : "layer_1";
3684
+ const u = U.requestId ? U.verificationTier : "layer_1";
3402
3685
  return /* @__PURE__ */ e(
3403
- Xt,
3686
+ ri,
3404
3687
  {
3405
- tier: p,
3406
- sessionToken: Y || "",
3407
- requestId: te.requestId,
3408
- onNext: at,
3409
- onError: ae,
3410
- apiBaseUrl: Z,
3411
- previewMode: n,
3412
- language: h
3688
+ tier: u,
3689
+ sessionToken: K || "",
3690
+ requestId: U.requestId,
3691
+ onNext: ot,
3692
+ onError: be,
3693
+ apiBaseUrl: H,
3694
+ apiKey: a,
3695
+ previewMode: s,
3696
+ language: _
3413
3697
  }
3414
3698
  );
3415
3699
  case "IdentityVerified":
3416
- return /* @__PURE__ */ e(ea, { onNext: () => D("PermissionsRequest"), language: h });
3700
+ return /* @__PURE__ */ e(ni, { onNext: () => R("PermissionsRequest"), language: _ });
3417
3701
  case "PermissionsRequest":
3418
3702
  return /* @__PURE__ */ e(
3419
- aa,
3703
+ ci,
3420
3704
  {
3421
- onApprove: ot,
3422
- onDeny: () => l == null ? void 0 : l(),
3423
- language: h,
3424
- appName: ce == null ? void 0 : ce.name,
3425
- appLogo: O || (ce == null ? void 0 : ce.logo_url)
3705
+ onApprove: ht,
3706
+ onDeny: () => p == null ? void 0 : p(),
3707
+ language: _,
3708
+ appName: X == null ? void 0 : X.name,
3709
+ appLogo: A || (X == null ? void 0 : X.logo_url),
3710
+ requestedScopes: X == null ? void 0 : X.requested_scopes
3426
3711
  }
3427
3712
  );
3428
3713
  default:
3429
3714
  return null;
3430
3715
  }
3431
3716
  };
3432
- return n ? /* @__PURE__ */ a($, { children: [
3433
- /* @__PURE__ */ e("style", { children: ze }, Te),
3434
- /* @__PURE__ */ e("div", { id: `casperid-modal-${oe}`, style: Pe, className: `relative ${P}`, children: /* @__PURE__ */ a(Ve, { className: "backdrop-blur-3xl", theme: P, children: [
3435
- /* @__PURE__ */ e(
3436
- Le,
3717
+ return s ? /* @__PURE__ */ i(re, { children: [
3718
+ /* @__PURE__ */ e("style", { children: De }, Ae),
3719
+ /* @__PURE__ */ e("div", { id: `casperid-modal-${ae}`, style: ye, className: `relative ${de}`, children: /* @__PURE__ */ i(He, { className: "backdrop-blur-3xl", theme: de, children: [
3720
+ te !== "FaceScan" && /* @__PURE__ */ e(
3721
+ We,
3437
3722
  {
3438
- onClose: l,
3439
- showClose: Q !== "AuthSelection",
3440
- subtitle: Q === "PermissionsRequest" ? "PERMISSION REQUEST" : "SECURE SDK",
3441
- theme: P,
3442
- toggleTheme: je
3723
+ onClose: p,
3724
+ showClose: te !== "AuthSelection",
3725
+ subtitle: te === "PermissionsRequest" ? "PERMISSION REQUEST" : "SECURE SDK",
3726
+ theme: de,
3727
+ toggleTheme: Ue
3443
3728
  }
3444
3729
  ),
3445
- /* @__PURE__ */ e("div", { className: "flex-1 flex flex-col relative overflow-hidden", children: /* @__PURE__ */ e(Ce, { mode: "wait", children: /* @__PURE__ */ e(V.div, { className: "flex-1 flex flex-col", children: Me() }, Q) }) }),
3446
- $e.includes(Q) && /* @__PURE__ */ e(qe, { children: /* @__PURE__ */ a("p", { className: "text-[11px] text-slate-500 font-medium", children: [
3730
+ /* @__PURE__ */ e("div", { className: "flex-1 flex flex-col relative overflow-hidden", children: /* @__PURE__ */ e(Me, { mode: "wait", children: /* @__PURE__ */ e(P.div, { className: "flex-1 flex flex-col", children: $e() }, te) }) }),
3731
+ Je.includes(te) && /* @__PURE__ */ e(Ye, { children: /* @__PURE__ */ i("p", { className: "text-[11px] text-slate-500 font-medium", children: [
3447
3732
  "By connecting, you agree to our",
3448
3733
  " ",
3449
- /* @__PURE__ */ e("a", { className: "text-brand hover:underline ml-1", href: g, target: "_blank", rel: "noopener noreferrer", children: "Terms of Service" }),
3734
+ /* @__PURE__ */ e("a", { className: "text-brand hover:underline ml-1", href: D, target: "_blank", rel: "noopener noreferrer", children: "Terms of Service" }),
3450
3735
  " ",
3451
3736
  "&",
3452
3737
  " ",
3453
- /* @__PURE__ */ e("a", { className: "text-brand hover:underline ml-1", href: z, target: "_blank", rel: "noopener noreferrer", children: "Privacy Policy" })
3738
+ /* @__PURE__ */ e("a", { className: "text-brand hover:underline ml-1", href: h, target: "_blank", rel: "noopener noreferrer", children: "Privacy Policy" })
3454
3739
  ] }) })
3455
3740
  ] }) })
3456
- ] }) : /* @__PURE__ */ a($, { children: [
3457
- /* @__PURE__ */ e("style", { children: ze }, Te),
3458
- /* @__PURE__ */ a(
3741
+ ] }) : /* @__PURE__ */ i(re, { children: [
3742
+ /* @__PURE__ */ e("style", { children: De }, Ae),
3743
+ /* @__PURE__ */ i(
3459
3744
  "div",
3460
3745
  {
3461
- className: `fixed inset-0 z-[9999] flex items-center justify-center ${A === "fullscreen" ? "p-0" : "p-4"}`,
3462
- style: { backgroundColor: A === "fullscreen" ? "transparent" : "rgba(0,0,0,0.6)", backdropFilter: A === "fullscreen" ? "none" : "blur(6px)" },
3463
- onClick: (p) => p.target === p.currentTarget && (l == null ? void 0 : l()),
3746
+ className: `fixed inset-0 z-[9999] flex items-center justify-center ${G === "fullscreen" ? "p-0" : "p-4"}`,
3747
+ style: { backgroundColor: G === "fullscreen" ? "transparent" : "rgba(0,0,0,0.6)", backdropFilter: G === "fullscreen" ? "none" : "blur(6px)" },
3748
+ onClick: (u) => u.target === u.currentTarget && (p == null ? void 0 : p()),
3464
3749
  children: [
3465
- A !== "fullscreen" && /* @__PURE__ */ a("div", { className: "absolute inset-0 pointer-events-none overflow-hidden", children: [
3750
+ G !== "fullscreen" && /* @__PURE__ */ i("div", { className: "absolute inset-0 pointer-events-none overflow-hidden", children: [
3466
3751
  /* @__PURE__ */ e(
3467
3752
  "div",
3468
3753
  {
3469
3754
  className: "absolute top-[-10%] left-[-10%] w-[60%] h-[40%] rounded-full blur-[120px]",
3470
- style: { backgroundColor: `${v}1a` }
3755
+ style: { backgroundColor: `${L}1a` }
3471
3756
  }
3472
3757
  ),
3473
3758
  /* @__PURE__ */ e("div", { className: "absolute bottom-[-5%] right-[-5%] w-[50%] h-[30%] bg-[#6DE8EC]/5 blur-[100px] rounded-full" })
3474
3759
  ] }),
3475
3760
  /* @__PURE__ */ e(
3476
- V.div,
3761
+ P.div,
3477
3762
  {
3478
- id: `casperid-modal-${oe}`,
3479
- initial: A === "fullscreen" ? { opacity: 0 } : { opacity: 0, scale: 0.95, y: 20 },
3763
+ id: `casperid-modal-${ae}`,
3764
+ initial: G === "fullscreen" ? { opacity: 0 } : { opacity: 0, scale: 0.95, y: 20 },
3480
3765
  animate: { opacity: 1, scale: 1, y: 0 },
3481
- exit: A === "fullscreen" ? { opacity: 0 } : { opacity: 0, scale: 0.95, y: 20 },
3766
+ exit: G === "fullscreen" ? { opacity: 0 } : { opacity: 0, scale: 0.95, y: 20 },
3482
3767
  transition: { type: "spring", damping: 28, stiffness: 300 },
3483
- style: Pe,
3484
- className: `relative selection:bg-brand/30 ${P} ${A === "fullscreen" ? "w-full h-full" : ""}`,
3485
- children: /* @__PURE__ */ a(Ve, { className: `backdrop-blur-3xl ${A === "fullscreen" ? "w-full h-full rounded-none" : ""}`, theme: P, children: [
3486
- /* @__PURE__ */ e(
3487
- Le,
3768
+ style: ye,
3769
+ className: `relative selection:bg-brand/30 ${de} ${G === "fullscreen" ? "w-full h-full" : Q === "mobile" ? "w-full max-w-md h-[90vh] max-h-[800px]" : "w-full max-w-xl h-[85vh] max-h-[900px]"}`,
3770
+ children: /* @__PURE__ */ i(He, { className: `backdrop-blur-3xl ${G === "fullscreen" ? "w-full h-full rounded-none" : ""}`, theme: de, children: [
3771
+ te !== "FaceScan" && /* @__PURE__ */ e(
3772
+ We,
3488
3773
  {
3489
- onClose: l,
3490
- showClose: Q !== "AuthSelection",
3491
- subtitle: Q === "PermissionsRequest" ? "PERMISSION REQUEST" : "SECURE SDK",
3492
- theme: P,
3493
- toggleTheme: je
3774
+ onClose: p,
3775
+ showClose: te !== "AuthSelection",
3776
+ subtitle: te === "PermissionsRequest" ? "PERMISSION REQUEST" : "SECURE SDK",
3777
+ theme: de,
3778
+ toggleTheme: Ue
3494
3779
  }
3495
3780
  ),
3496
- /* @__PURE__ */ e("div", { className: "flex-1 flex flex-col relative overflow-hidden", children: /* @__PURE__ */ e(Ce, { mode: "wait", children: /* @__PURE__ */ e(V.div, { className: "flex-1 flex flex-col", children: Me() }, Q) }) }),
3497
- $e.includes(Q) && /* @__PURE__ */ e(qe, { children: /* @__PURE__ */ a("p", { className: "text-[11px] text-slate-500 font-medium", children: [
3781
+ /* @__PURE__ */ e("div", { className: "flex-1 flex flex-col relative overflow-hidden", children: /* @__PURE__ */ e(Me, { mode: "wait", children: /* @__PURE__ */ e(P.div, { className: "flex-1 flex flex-col", children: $e() }, te) }) }),
3782
+ Je.includes(te) && /* @__PURE__ */ e(Ye, { children: /* @__PURE__ */ i("p", { className: "text-[11px] text-slate-500 font-medium", children: [
3498
3783
  "By connecting, you agree to our",
3499
3784
  " ",
3500
- /* @__PURE__ */ e("a", { className: "text-brand hover:underline ml-1", href: g, target: "_blank", rel: "noopener noreferrer", children: "Terms of Service" }),
3785
+ /* @__PURE__ */ e("a", { className: "text-brand hover:underline ml-1", href: D, target: "_blank", rel: "noopener noreferrer", children: "Terms of Service" }),
3501
3786
  " ",
3502
3787
  "&",
3503
3788
  " ",
3504
- /* @__PURE__ */ e("a", { className: "text-brand hover:underline ml-1", href: z, target: "_blank", rel: "noopener noreferrer", children: "Privacy Policy" })
3789
+ /* @__PURE__ */ e("a", { className: "text-brand hover:underline ml-1", href: h, target: "_blank", rel: "noopener noreferrer", children: "Privacy Policy" })
3505
3790
  ] }) })
3506
3791
  ] })
3507
3792
  }
@@ -3511,51 +3796,51 @@ const $e = ["AuthSelection", "Login", "PasskeyAuth", "PinVerification", "Passkey
3511
3796
  )
3512
3797
  ] });
3513
3798
  };
3514
- async function oa(r, i = {}, s = 3e4) {
3515
- const o = new AbortController(), x = setTimeout(() => o.abort(), s);
3799
+ async function fi(r, a = {}, n = 3e4) {
3800
+ const l = new AbortController(), N = setTimeout(() => l.abort(), n);
3516
3801
  try {
3517
3802
  return await fetch(r, {
3518
- ...i,
3519
- signal: o.signal
3803
+ ...a,
3804
+ signal: l.signal
3520
3805
  });
3521
3806
  } finally {
3522
- clearTimeout(x);
3807
+ clearTimeout(N);
3523
3808
  }
3524
3809
  }
3525
- class ra extends Error {
3526
- constructor(i, s) {
3527
- super(i), this.name = "ApiError", this.status = s;
3810
+ class li extends Error {
3811
+ constructor(a, n) {
3812
+ super(a), this.name = "ApiError", this.status = n;
3528
3813
  }
3529
3814
  }
3530
- async function ua(r) {
3815
+ async function hi(r) {
3531
3816
  if (!r.ok) {
3532
- const i = await r.json().catch(() => ({}));
3533
- throw new ra(
3534
- i.error || i.message || `Request failed with status ${r.status}`,
3817
+ const a = await r.json().catch(() => ({}));
3818
+ throw new li(
3819
+ a.error || a.message || `Request failed with status ${r.status}`,
3535
3820
  r.status
3536
3821
  );
3537
3822
  }
3538
3823
  return r.json();
3539
3824
  }
3540
3825
  export {
3541
- ra as ApiError,
3542
- Pt as AuthSelectionScreen,
3543
- la as CasperIDModal,
3544
- Jt as DocumentScanScreen,
3545
- Kt as FaceScanScreen,
3546
- qe as Footer,
3547
- Ve as GlassContainer,
3548
- Le as Header,
3549
- ea as IdentityVerifiedScreen,
3550
- Tt as LoginScreen,
3551
- Xt as MintingIdentityScreen,
3552
- aa as PermissionsRequestScreen,
3553
- Bt as PinVerificationScreen,
3554
- Zt as ReviewDataScreen,
3555
- Ht as SecurityUpgradeScreen,
3556
- Gt as VerifyIdentityChoiceScreen,
3557
- la as default,
3558
- oa as fetchWithTimeout,
3559
- ua as handleApiResponse
3826
+ li as ApiError,
3827
+ Mt as AuthSelectionScreen,
3828
+ pi as CasperIDModal,
3829
+ ti as DocumentScanScreen,
3830
+ Zt as FaceScanScreen,
3831
+ Ye as Footer,
3832
+ He as GlassContainer,
3833
+ We as Header,
3834
+ ni as IdentityVerifiedScreen,
3835
+ Lt as LoginScreen,
3836
+ ri as MintingIdentityScreen,
3837
+ ci as PermissionsRequestScreen,
3838
+ Jt as PinVerificationScreen,
3839
+ ii as ReviewDataScreen,
3840
+ Kt as SecurityUpgradeScreen,
3841
+ Qt as VerifyIdentityChoiceScreen,
3842
+ pi as default,
3843
+ fi as fetchWithTimeout,
3844
+ hi as handleApiResponse
3560
3845
  };
3561
3846
  //# sourceMappingURL=index.mjs.map