@casperid/react 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -29
- package/dist/index.cjs +1 -178
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +217 -3809
- package/dist/index.mjs.map +1 -1
- package/package.json +18 -19
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +0 -2
- package/dist/_commonjsHelpers-DKOUU3wS.cjs.map +0 -1
- package/dist/_commonjsHelpers-DaMA6jEr.js +0 -9
- package/dist/_commonjsHelpers-DaMA6jEr.js.map +0 -1
- package/dist/camera_utils-BQaOSBPu.js +0 -397
- package/dist/camera_utils-BQaOSBPu.js.map +0 -1
- package/dist/camera_utils-wchtqrQn.cjs +0 -2
- package/dist/camera_utils-wchtqrQn.cjs.map +0 -1
- package/dist/face_mesh-DYMPc5Ce.js +0 -4212
- package/dist/face_mesh-DYMPc5Ce.js.map +0 -1
- package/dist/face_mesh-fEvyDoPt.cjs +0 -19
- package/dist/face_mesh-fEvyDoPt.cjs.map +0 -1
- package/dist/style.css +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,3846 +1,254 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* @license lucide-react v0.400.0 - ISC
|
|
40
|
-
*
|
|
41
|
-
* This source code is licensed under the ISC license.
|
|
42
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/
|
|
44
|
-
const gt = Ze(
|
|
45
|
-
({
|
|
46
|
-
color: r = "currentColor",
|
|
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
|
-
"svg",
|
|
56
|
-
{
|
|
57
|
-
ref: s,
|
|
58
|
-
...xt,
|
|
59
|
-
width: a,
|
|
60
|
-
height: a,
|
|
61
|
-
stroke: r,
|
|
62
|
-
strokeWidth: l ? Number(n) * 24 / Number(a) : n,
|
|
63
|
-
className: Xe("lucide", N),
|
|
64
|
-
...m
|
|
65
|
-
},
|
|
66
|
-
[
|
|
67
|
-
...f.map(([c, d]) => je(c, d)),
|
|
68
|
-
...Array.isArray(p) ? p : [p]
|
|
69
|
-
]
|
|
70
|
-
)
|
|
71
|
-
);
|
|
72
|
-
/**
|
|
73
|
-
* @license lucide-react v0.400.0 - ISC
|
|
74
|
-
*
|
|
75
|
-
* This source code is licensed under the ISC license.
|
|
76
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
-
*/
|
|
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
|
-
})
|
|
86
|
-
);
|
|
87
|
-
return n.displayName = `${r}`, n;
|
|
88
|
-
};
|
|
89
|
-
/**
|
|
90
|
-
* @license lucide-react v0.400.0 - ISC
|
|
91
|
-
*
|
|
92
|
-
* This source code is licensed under the ISC license.
|
|
93
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/
|
|
95
|
-
const Oe = j("ArrowRight", [
|
|
96
|
-
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
97
|
-
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
98
|
-
]);
|
|
99
|
-
/**
|
|
100
|
-
* @license lucide-react v0.400.0 - ISC
|
|
101
|
-
*
|
|
102
|
-
* This source code is licensed under the ISC license.
|
|
103
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
-
*/
|
|
105
|
-
const Fe = j("BadgeCheck", [
|
|
106
|
-
[
|
|
107
|
-
"path",
|
|
108
|
-
{
|
|
109
|
-
d: "M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",
|
|
110
|
-
key: "3c2336"
|
|
111
|
-
}
|
|
112
|
-
],
|
|
113
|
-
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
114
|
-
]);
|
|
115
|
-
/**
|
|
116
|
-
* @license lucide-react v0.400.0 - ISC
|
|
117
|
-
*
|
|
118
|
-
* This source code is licensed under the ISC license.
|
|
119
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
-
*/
|
|
121
|
-
const vt = j("Calendar", [
|
|
122
|
-
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
123
|
-
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
124
|
-
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
125
|
-
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
126
|
-
]);
|
|
127
|
-
/**
|
|
128
|
-
* @license lucide-react v0.400.0 - ISC
|
|
129
|
-
*
|
|
130
|
-
* This source code is licensed under the ISC license.
|
|
131
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
-
*/
|
|
133
|
-
const wt = j("Camera", [
|
|
134
|
-
[
|
|
135
|
-
"path",
|
|
136
|
-
{
|
|
137
|
-
d: "M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",
|
|
138
|
-
key: "1tc9qg"
|
|
139
|
-
}
|
|
140
|
-
],
|
|
141
|
-
["circle", { cx: "12", cy: "13", r: "3", key: "1vg3eu" }]
|
|
142
|
-
]);
|
|
143
|
-
/**
|
|
144
|
-
* @license lucide-react v0.400.0 - ISC
|
|
145
|
-
*
|
|
146
|
-
* This source code is licensed under the ISC license.
|
|
147
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
-
*/
|
|
149
|
-
const Le = j("ChevronRight", [
|
|
150
|
-
["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
|
|
151
|
-
]);
|
|
152
|
-
/**
|
|
153
|
-
* @license lucide-react v0.400.0 - ISC
|
|
154
|
-
*
|
|
155
|
-
* This source code is licensed under the ISC license.
|
|
156
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
-
*/
|
|
158
|
-
const ve = j("CircleAlert", [
|
|
159
|
-
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
160
|
-
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
161
|
-
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
162
|
-
]);
|
|
163
|
-
/**
|
|
164
|
-
* @license lucide-react v0.400.0 - ISC
|
|
165
|
-
*
|
|
166
|
-
* This source code is licensed under the ISC license.
|
|
167
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
-
*/
|
|
169
|
-
const Ce = j("CircleCheck", [
|
|
170
|
-
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
171
|
-
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
172
|
-
]);
|
|
173
|
-
/**
|
|
174
|
-
* @license lucide-react v0.400.0 - ISC
|
|
175
|
-
*
|
|
176
|
-
* This source code is licensed under the ISC license.
|
|
177
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
-
*/
|
|
179
|
-
const kt = j("CircleHelp", [
|
|
180
|
-
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
181
|
-
["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
|
|
182
|
-
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
183
|
-
]);
|
|
184
|
-
/**
|
|
185
|
-
* @license lucide-react v0.400.0 - ISC
|
|
186
|
-
*
|
|
187
|
-
* This source code is licensed under the ISC license.
|
|
188
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
-
*/
|
|
190
|
-
const Qe = j("CreditCard", [
|
|
191
|
-
["rect", { width: "20", height: "14", x: "2", y: "5", rx: "2", key: "ynyp8z" }],
|
|
192
|
-
["line", { x1: "2", x2: "22", y1: "10", y2: "10", key: "1b3vmo" }]
|
|
193
|
-
]);
|
|
194
|
-
/**
|
|
195
|
-
* @license lucide-react v0.400.0 - ISC
|
|
196
|
-
*
|
|
197
|
-
* This source code is licensed under the ISC license.
|
|
198
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
-
*/
|
|
200
|
-
const Nt = j("Delete", [
|
|
201
|
-
["path", { d: "M20 5H9l-7 7 7 7h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2Z", key: "1oy587" }],
|
|
202
|
-
["line", { x1: "18", x2: "12", y1: "9", y2: "15", key: "1olkx5" }],
|
|
203
|
-
["line", { x1: "12", x2: "18", y1: "9", y2: "15", key: "1n50pc" }]
|
|
204
|
-
]);
|
|
205
|
-
/**
|
|
206
|
-
* @license lucide-react v0.400.0 - ISC
|
|
207
|
-
*
|
|
208
|
-
* This source code is licensed under the ISC license.
|
|
209
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/
|
|
211
|
-
const Ie = j("Fingerprint", [
|
|
212
|
-
["path", { d: "M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4", key: "1nerag" }],
|
|
213
|
-
["path", { d: "M14 13.12c0 2.38 0 6.38-1 8.88", key: "o46ks0" }],
|
|
214
|
-
["path", { d: "M17.29 21.02c.12-.6.43-2.3.5-3.02", key: "ptglia" }],
|
|
215
|
-
["path", { d: "M2 12a10 10 0 0 1 18-6", key: "ydlgp0" }],
|
|
216
|
-
["path", { d: "M2 16h.01", key: "1gqxmh" }],
|
|
217
|
-
["path", { d: "M21.8 16c.2-2 .131-5.354 0-6", key: "drycrb" }],
|
|
218
|
-
["path", { d: "M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2", key: "1tidbn" }],
|
|
219
|
-
["path", { d: "M8.65 22c.21-.66.45-1.32.57-2", key: "13wd9y" }],
|
|
220
|
-
["path", { d: "M9 6.8a6 6 0 0 1 9 5.2v2", key: "1fr1j5" }]
|
|
221
|
-
]);
|
|
222
|
-
/**
|
|
223
|
-
* @license lucide-react v0.400.0 - ISC
|
|
224
|
-
*
|
|
225
|
-
* This source code is licensed under the ISC license.
|
|
226
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
-
*/
|
|
228
|
-
const It = j("Flashlight", [
|
|
229
|
-
[
|
|
230
|
-
"path",
|
|
231
|
-
{
|
|
232
|
-
d: "M18 6c0 2-2 2-2 4v10a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2V10c0-2-2-2-2-4V2h12z",
|
|
233
|
-
key: "1orkel"
|
|
234
|
-
}
|
|
235
|
-
],
|
|
236
|
-
["line", { x1: "6", x2: "18", y1: "6", y2: "6", key: "1z11jq" }],
|
|
237
|
-
["line", { x1: "12", x2: "12", y1: "12", y2: "12", key: "1f4yc1" }]
|
|
238
|
-
]);
|
|
239
|
-
/**
|
|
240
|
-
* @license lucide-react v0.400.0 - ISC
|
|
241
|
-
*
|
|
242
|
-
* This source code is licensed under the ISC license.
|
|
243
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
-
*/
|
|
245
|
-
const et = j("Globe", [
|
|
246
|
-
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
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
|
-
["path", { d: "M2 12h20", key: "9i4pu4" }]
|
|
249
|
-
]);
|
|
250
|
-
/**
|
|
251
|
-
* @license lucide-react v0.400.0 - ISC
|
|
252
|
-
*
|
|
253
|
-
* This source code is licensed under the ISC license.
|
|
254
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
-
*/
|
|
256
|
-
const Ct = j("Key", [
|
|
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
|
-
["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
|
|
259
|
-
["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
|
|
260
|
-
]);
|
|
261
|
-
/**
|
|
262
|
-
* @license lucide-react v0.400.0 - ISC
|
|
263
|
-
*
|
|
264
|
-
* This source code is licensed under the ISC license.
|
|
265
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
-
*/
|
|
267
|
-
const _e = j("LoaderCircle", [
|
|
268
|
-
["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
|
|
269
|
-
]);
|
|
270
|
-
/**
|
|
271
|
-
* @license lucide-react v0.400.0 - ISC
|
|
272
|
-
*
|
|
273
|
-
* This source code is licensed under the ISC license.
|
|
274
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
-
*/
|
|
276
|
-
const tt = j("Lock", [
|
|
277
|
-
["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
|
|
278
|
-
["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
|
|
279
|
-
]);
|
|
280
|
-
/**
|
|
281
|
-
* @license lucide-react v0.400.0 - ISC
|
|
282
|
-
*
|
|
283
|
-
* This source code is licensed under the ISC license.
|
|
284
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
-
*/
|
|
286
|
-
const St = j("Mail", [
|
|
287
|
-
["rect", { width: "20", height: "16", x: "2", y: "4", rx: "2", key: "18n3k1" }],
|
|
288
|
-
["path", { d: "m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7", key: "1ocrg3" }]
|
|
289
|
-
]);
|
|
290
|
-
/**
|
|
291
|
-
* @license lucide-react v0.400.0 - ISC
|
|
292
|
-
*
|
|
293
|
-
* This source code is licensed under the ISC license.
|
|
294
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
-
*/
|
|
296
|
-
const Et = j("Moon", [
|
|
297
|
-
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
|
|
298
|
-
]);
|
|
299
|
-
/**
|
|
300
|
-
* @license lucide-react v0.400.0 - ISC
|
|
301
|
-
*
|
|
302
|
-
* This source code is licensed under the ISC license.
|
|
303
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
-
*/
|
|
305
|
-
const At = j("Network", [
|
|
306
|
-
["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
|
|
307
|
-
["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
|
|
308
|
-
["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
|
|
309
|
-
["path", { d: "M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3", key: "1jsf9p" }],
|
|
310
|
-
["path", { d: "M12 12V8", key: "2874zd" }]
|
|
311
|
-
]);
|
|
312
|
-
/**
|
|
313
|
-
* @license lucide-react v0.400.0 - ISC
|
|
314
|
-
*
|
|
315
|
-
* This source code is licensed under the ISC license.
|
|
316
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
317
|
-
*/
|
|
318
|
-
const Dt = j("Puzzle", [
|
|
319
|
-
[
|
|
320
|
-
"path",
|
|
321
|
-
{
|
|
322
|
-
d: "M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.077.877.528 1.073 1.01a2.5 2.5 0 1 0 3.259-3.259c-.482-.196-.933-.558-1.01-1.073-.05-.336.062-.676.303-.917l1.525-1.525A2.402 2.402 0 0 1 12 1.998c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.237 3.237c-.464.18-.894.527-.967 1.02Z",
|
|
323
|
-
key: "i0oyt7"
|
|
324
|
-
}
|
|
325
|
-
]
|
|
326
|
-
]);
|
|
327
|
-
/**
|
|
328
|
-
* @license lucide-react v0.400.0 - ISC
|
|
329
|
-
*
|
|
330
|
-
* This source code is licensed under the ISC license.
|
|
331
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
332
|
-
*/
|
|
333
|
-
const Te = j("RefreshCw", [
|
|
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
|
-
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
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" }],
|
|
337
|
-
["path", { d: "M8 16H3v5", key: "1cv678" }]
|
|
338
|
-
]);
|
|
339
|
-
/**
|
|
340
|
-
* @license lucide-react v0.400.0 - ISC
|
|
341
|
-
*
|
|
342
|
-
* This source code is licensed under the ISC license.
|
|
343
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
-
*/
|
|
345
|
-
const Rt = j("RotateCcw", [
|
|
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
|
-
["path", { d: "M3 3v5h5", key: "1xhq8a" }]
|
|
348
|
-
]);
|
|
349
|
-
/**
|
|
350
|
-
* @license lucide-react v0.400.0 - ISC
|
|
351
|
-
*
|
|
352
|
-
* This source code is licensed under the ISC license.
|
|
353
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
354
|
-
*/
|
|
355
|
-
const Se = j("ShieldCheck", [
|
|
356
|
-
[
|
|
357
|
-
"path",
|
|
358
|
-
{
|
|
359
|
-
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
|
|
360
|
-
key: "oel41y"
|
|
361
|
-
}
|
|
362
|
-
],
|
|
363
|
-
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
364
|
-
]);
|
|
365
|
-
/**
|
|
366
|
-
* @license lucide-react v0.400.0 - ISC
|
|
367
|
-
*
|
|
368
|
-
* This source code is licensed under the ISC license.
|
|
369
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
-
*/
|
|
371
|
-
const it = j("Shield", [
|
|
372
|
-
[
|
|
373
|
-
"path",
|
|
374
|
-
{
|
|
375
|
-
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
|
|
376
|
-
key: "oel41y"
|
|
377
|
-
}
|
|
378
|
-
]
|
|
379
|
-
]);
|
|
380
|
-
/**
|
|
381
|
-
* @license lucide-react v0.400.0 - ISC
|
|
382
|
-
*
|
|
383
|
-
* This source code is licensed under the ISC license.
|
|
384
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
-
*/
|
|
386
|
-
const qe = j("Smartphone", [
|
|
387
|
-
["rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2", key: "1yt0o3" }],
|
|
388
|
-
["path", { d: "M12 18h.01", key: "mhygvu" }]
|
|
389
|
-
]);
|
|
390
|
-
/**
|
|
391
|
-
* @license lucide-react v0.400.0 - ISC
|
|
392
|
-
*
|
|
393
|
-
* This source code is licensed under the ISC license.
|
|
394
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
-
*/
|
|
396
|
-
const Pt = j("Sparkles", [
|
|
397
|
-
[
|
|
398
|
-
"path",
|
|
399
|
-
{
|
|
400
|
-
d: "M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",
|
|
401
|
-
key: "4pj2yx"
|
|
402
|
-
}
|
|
403
|
-
],
|
|
404
|
-
["path", { d: "M20 3v4", key: "1olli1" }],
|
|
405
|
-
["path", { d: "M22 5h-4", key: "1gvqau" }],
|
|
406
|
-
["path", { d: "M4 17v2", key: "vumght" }],
|
|
407
|
-
["path", { d: "M5 18H3", key: "zchphs" }]
|
|
408
|
-
]);
|
|
409
|
-
/**
|
|
410
|
-
* @license lucide-react v0.400.0 - ISC
|
|
411
|
-
*
|
|
412
|
-
* This source code is licensed under the ISC license.
|
|
413
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
414
|
-
*/
|
|
415
|
-
const Tt = j("Sun", [
|
|
416
|
-
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
417
|
-
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
418
|
-
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
419
|
-
["path", { d: "m4.93 4.93 1.41 1.41", key: "149t6j" }],
|
|
420
|
-
["path", { d: "m17.66 17.66 1.41 1.41", key: "ptbguv" }],
|
|
421
|
-
["path", { d: "M2 12h2", key: "1t8f8n" }],
|
|
422
|
-
["path", { d: "M20 12h2", key: "1q8mjw" }],
|
|
423
|
-
["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
|
|
424
|
-
["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
|
|
425
|
-
]);
|
|
426
|
-
/**
|
|
427
|
-
* @license lucide-react v0.400.0 - ISC
|
|
428
|
-
*
|
|
429
|
-
* This source code is licensed under the ISC license.
|
|
430
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
431
|
-
*/
|
|
432
|
-
const zt = j("User", [
|
|
433
|
-
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
434
|
-
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
435
|
-
]);
|
|
436
|
-
/**
|
|
437
|
-
* @license lucide-react v0.400.0 - ISC
|
|
438
|
-
*
|
|
439
|
-
* This source code is licensed under the ISC license.
|
|
440
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
441
|
-
*/
|
|
442
|
-
const Vt = j("Wallet", [
|
|
443
|
-
[
|
|
444
|
-
"path",
|
|
445
|
-
{
|
|
446
|
-
d: "M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",
|
|
447
|
-
key: "18etb6"
|
|
448
|
-
}
|
|
449
|
-
],
|
|
450
|
-
["path", { d: "M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4", key: "xoc0q4" }]
|
|
451
|
-
]);
|
|
452
|
-
/**
|
|
453
|
-
* @license lucide-react v0.400.0 - ISC
|
|
454
|
-
*
|
|
455
|
-
* This source code is licensed under the ISC license.
|
|
456
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
457
|
-
*/
|
|
458
|
-
const jt = j("X", [
|
|
459
|
-
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
460
|
-
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
461
|
-
]), We = ({
|
|
462
|
-
onClose: r,
|
|
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
|
-
] })
|
|
476
|
-
] }),
|
|
477
|
-
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
478
|
-
/* @__PURE__ */ e(
|
|
479
|
-
"button",
|
|
480
|
-
{
|
|
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
|
-
"aria-label": "Toggle theme",
|
|
484
|
-
children: N === "dark" ? /* @__PURE__ */ e(Tt, { className: "w-5 h-5" }) : /* @__PURE__ */ e(Et, { className: "w-5 h-5" })
|
|
485
|
-
}
|
|
486
|
-
),
|
|
487
|
-
l && /* @__PURE__ */ e(
|
|
488
|
-
"button",
|
|
489
|
-
{
|
|
490
|
-
onClick: r,
|
|
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
|
-
"aria-label": "Close",
|
|
493
|
-
children: /* @__PURE__ */ e(jt, { className: "w-5 h-5" })
|
|
494
|
-
}
|
|
495
|
-
)
|
|
496
|
-
] })
|
|
497
|
-
] }), Ye = ({ children: r }) => /* @__PURE__ */ e("footer", { className: "p-8 text-center relative z-20", children: r }), Ve = {
|
|
498
|
-
EN: {
|
|
499
|
-
welcome_back: "Welcome back",
|
|
500
|
-
enter_email: "Enter your email to receive a verification code.",
|
|
501
|
-
email_address: "Email Address",
|
|
502
|
-
continue: "Continue",
|
|
503
|
-
sending_code: "Sending Code...",
|
|
504
|
-
verify_email: "Verify Email",
|
|
505
|
-
enter_code: "Enter the 6-digit code sent to",
|
|
506
|
-
verification_failed: "Verification Failed",
|
|
507
|
-
verifying: "Verifying...",
|
|
508
|
-
resend_code: "Resend Code",
|
|
509
|
-
resend_in: "Resend in",
|
|
510
|
-
secure_sdk: "SECURE SDK",
|
|
511
|
-
permission_request: "PERMISSION REQUEST",
|
|
512
|
-
review_data: "Review Data",
|
|
513
|
-
mint_identity: "Mint Identity",
|
|
514
|
-
face_scan: "Face Scan",
|
|
515
|
-
document_scan: "Document Scan",
|
|
516
|
-
verification_step: "VERIFICATION STEP",
|
|
517
|
-
kyc_required: "KYC REQUIRED",
|
|
518
|
-
security_upgrade_required: "Security Upgrade Required",
|
|
519
|
-
security_upgrade_desc: "Your account requires a biometric security upgrade to perform this action.",
|
|
520
|
-
biometric_secure: "BIOMETRIC SECURE",
|
|
521
|
-
zero_knowledge: "ZERO KNOWLEDGE",
|
|
522
|
-
start_upgrade: "Start Upgrade",
|
|
523
|
-
do_this_later: "I'll do this later",
|
|
524
|
-
sign_in_with_extension: "Sign in with Extension",
|
|
525
|
-
sign_in_with_otp: "Sign in with OTP",
|
|
526
|
-
extension_detected: "Extension Detected",
|
|
527
|
-
secure_wallet: "Secure Wallet",
|
|
528
|
-
fully_audited: "FULLY AUDITED",
|
|
529
|
-
non_custodial: "NON-CUSTODIAL",
|
|
530
|
-
verify_identity: "Verify Your Identity",
|
|
531
|
-
choose_document: "Choose a document type to begin verification.",
|
|
532
|
-
passport: "Passport",
|
|
533
|
-
drivers_license: "Driver License",
|
|
534
|
-
national_id: "ID Card",
|
|
535
|
-
passport_desc: "All countries supported",
|
|
536
|
-
drivers_license_desc: "Government issued card",
|
|
537
|
-
national_id_desc: "National identity document",
|
|
538
|
-
position_face: "Position your face in the frame",
|
|
539
|
-
blink_slowly: "Blink slowly",
|
|
540
|
-
turn_head_left: "Turn your head slowly to the left",
|
|
541
|
-
turn_head_right: "Turn your head slowly to the right",
|
|
542
|
-
processing: "Processing...",
|
|
543
|
-
camera_permission_denied: "Camera permission denied",
|
|
544
|
-
unable_access_camera: "Unable to access camera",
|
|
545
|
-
live_camera: "LIVE CAMERA",
|
|
546
|
-
initializing: "INITIALIZING",
|
|
547
|
-
processing_verification: "Processing Verification...",
|
|
548
|
-
processing_liveness: "Verifying Liveness...",
|
|
549
|
-
processing_documents: "Processing Documents...",
|
|
550
|
-
processing_subtitle: "Validating your documents and biometrics",
|
|
551
|
-
minting_identity: "Minting your Identity...",
|
|
552
|
-
minting_subtitle: "Securing your decentralized identity on the Casper Network",
|
|
553
|
-
identity_minted: "Identity Minted!",
|
|
554
|
-
minted_subtitle: "Your CasperID has been successfully created",
|
|
555
|
-
verification_failed_subtitle: "There was an issue with your verification",
|
|
556
|
-
try_again: "Try Again",
|
|
557
|
-
credential_hash: "Credential Hash",
|
|
558
|
-
identity_verified: "Identity Verified",
|
|
559
|
-
identity_verified_subtitle: "Your liveness check passed. You are now verified.",
|
|
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.",
|
|
565
|
-
share_data_consent: "Share Data Consent",
|
|
566
|
-
authorize_dapps: "Authorize dApps to access your credentials",
|
|
567
|
-
return_to_app: "Return to App",
|
|
568
|
-
verify_data_desc: "Verify your extracted identity information. This data will be used to mint your CasperID.",
|
|
569
|
-
ocr_confidence: "OCR Confidence",
|
|
570
|
-
first_name: "First Name",
|
|
571
|
-
last_name: "Last Name",
|
|
572
|
-
document_number: "Document Number",
|
|
573
|
-
date_of_birth: "Date of Birth",
|
|
574
|
-
nationality: "Nationality",
|
|
575
|
-
enter_first_name: "Enter first name",
|
|
576
|
-
enter_last_name: "Enter last name",
|
|
577
|
-
enter_nationality: "Enter nationality",
|
|
578
|
-
scanned_successfully: "Scanned Successfully",
|
|
579
|
-
secured_by_casper: "Secured by CasperID Protocol.",
|
|
580
|
-
confirm_mint: "Confirm & Mint",
|
|
581
|
-
submitting: "Submitting...",
|
|
582
|
-
retake_photo: "Retake Photo",
|
|
583
|
-
auth_subtitle: "Secure your Web3 identity with our premium authentication layer.",
|
|
584
|
-
extension_connect_msg: "Click the CasperID extension icon in your browser to connect.",
|
|
585
|
-
extension_not_detected: "CasperID extension not detected. Please install the extension or use OTP sign-in.",
|
|
586
|
-
connecting: "Connecting...",
|
|
587
|
-
two_factor_auth: "Two-Factor Auth",
|
|
588
|
-
security_notice: "Your data is encrypted and never stored on central servers. Powered by Casper Network.",
|
|
589
|
-
e2e_encrypted: "End-to-End Encrypted",
|
|
590
|
-
error_email_required: "Please enter your email",
|
|
591
|
-
error_invalid_email: "Please enter a valid email address",
|
|
592
|
-
error_passkey_registered: "You have a passkey registered. Please use extension sign-in.",
|
|
593
|
-
error_send_code_failed: "Failed to send verification code. Please try again.",
|
|
594
|
-
error_connection_failed: "Unable to connect. Please check your internet connection.",
|
|
595
|
-
verify_code: "Verification Code",
|
|
596
|
-
code_expired: "Code expired",
|
|
597
|
-
invalid_code: "Invalid code",
|
|
598
|
-
error_pin_incomplete: "Please enter all 6 digits",
|
|
599
|
-
verify: "Verify",
|
|
600
|
-
invalid_code_attempts: "Invalid code. {attempts} attempts remaining.",
|
|
601
|
-
awaiting_calibration: "Awaiting Calibration",
|
|
602
|
-
transaction_status: "Transaction Status",
|
|
603
|
-
complete_percent: "{percent}% Complete",
|
|
604
|
-
validating_docs: "Validating documents...",
|
|
605
|
-
broadcasting_tx: "Broadcasting to Casper Mainnet Node...",
|
|
606
|
-
tx_confirmed: "Transaction confirmed on Casper Network",
|
|
607
|
-
scan_instruction: "Scan {side} of your {docType}",
|
|
608
|
-
review_capture: "Review your capture. Ensure all text is clearly visible.",
|
|
609
|
-
align_document: "Align your document within the glowing frame. Ensure all four corners are visible.",
|
|
610
|
-
next_back_side: "Next: Back Side",
|
|
611
|
-
confirm: "Confirm",
|
|
612
|
-
capture: "Capture",
|
|
613
|
-
verify_data_carefully: "Please verify the extracted data carefully.",
|
|
614
|
-
enter_doc_number: "Enter document number",
|
|
615
|
-
date_format: "DD/MM/YYYY",
|
|
616
|
-
error_required_fields: "Please fill in all required fields.",
|
|
617
|
-
front: "front",
|
|
618
|
-
back: "back",
|
|
619
|
-
requesting_access: "Requesting Access",
|
|
620
|
-
privacy_note: "Privacy Note",
|
|
621
|
-
privacy_desc: "Only cryptographic proofs are shared. No private keys are ever exposed.",
|
|
622
|
-
approve_verify: "Approve & Verify",
|
|
623
|
-
deny: "Deny",
|
|
624
|
-
perm_identity: "Verify Identity Status",
|
|
625
|
-
perm_profile: "Read Public Profile",
|
|
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",
|
|
632
|
-
full_name: "FULL NAME",
|
|
633
|
-
id_number: "ID NUMBER",
|
|
634
|
-
// Passkey Auth
|
|
635
|
-
passkey_auth_subtitle: "Use your passkey to sign in securely.",
|
|
636
|
-
signing_in_as: "Signing in as",
|
|
637
|
-
use_passkey: "Use Your Passkey",
|
|
638
|
-
authenticating: "Authenticating...",
|
|
639
|
-
authentication_failed: "Authentication Failed",
|
|
640
|
-
passkey_auth_hint: "Touch ID, Face ID, or security key",
|
|
641
|
-
passkey_cancelled: "Authentication was cancelled. Try again when ready.",
|
|
642
|
-
authenticate: "Authenticate",
|
|
643
|
-
use_email_instead: "Use email code instead",
|
|
644
|
-
biometric_secured: "Biometric Secured",
|
|
645
|
-
webauthn_not_supported: "Your browser doesn't support passkeys. Please use email verification.",
|
|
646
|
-
// Passkey Registration
|
|
647
|
-
create_passkey: "Create Your Passkey",
|
|
648
|
-
passkey_register_subtitle: "Set up biometric authentication for secure, passwordless sign-in.",
|
|
649
|
-
passkey_benefits_title: "Why use a passkey?",
|
|
650
|
-
passkey_benefit_1: "No passwords to remember",
|
|
651
|
-
passkey_benefit_2: "Phishing-resistant security",
|
|
652
|
-
passkey_benefit_3: "Works across your devices",
|
|
653
|
-
register_passkey: "Create Passkey",
|
|
654
|
-
creating_passkey: "Creating passkey...",
|
|
655
|
-
passkey_created: "Passkey created successfully!",
|
|
656
|
-
passkey_create_failed: "Failed to create passkey",
|
|
657
|
-
// L1 Setup
|
|
658
|
-
l1_setup_title: "Setting Up Your Identity",
|
|
659
|
-
l1_setup_subtitle: "Creating your secure wallet and decentralized identity.",
|
|
660
|
-
generating_wallet: "Generating secure wallet...",
|
|
661
|
-
minting_did: "Minting your DID...",
|
|
662
|
-
l1_complete: "Identity setup complete!",
|
|
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"
|
|
668
|
-
},
|
|
669
|
-
ES: {
|
|
670
|
-
welcome_back: "Bienvenido de nuevo",
|
|
671
|
-
enter_email: "Ingrese su correo para recibir un código.",
|
|
672
|
-
email_address: "Correo electrónico",
|
|
673
|
-
continue: "Continuar",
|
|
674
|
-
sending_code: "Enviando código...",
|
|
675
|
-
verify_email: "Verificar correo",
|
|
676
|
-
enter_code: "Ingrese el código de 6 dígitos enviado a",
|
|
677
|
-
verification_failed: "Error de verificación",
|
|
678
|
-
verifying: "Verificando...",
|
|
679
|
-
resend_code: "Reenviar código",
|
|
680
|
-
resend_in: "Reenviar en",
|
|
681
|
-
secure_sdk: "SDK SEGURO",
|
|
682
|
-
permission_request: "SOLICITUD DE PERMISO",
|
|
683
|
-
review_data: "Revisar datos",
|
|
684
|
-
mint_identity: "Mint Identidad",
|
|
685
|
-
face_scan: "Escaneo facial",
|
|
686
|
-
document_scan: "Escaneo de documentos",
|
|
687
|
-
verification_step: "PASO DE VERIFICACIÓN",
|
|
688
|
-
kyc_required: "KYC REQUERIDO",
|
|
689
|
-
security_upgrade_required: "Actualización de Seguridad Requerida",
|
|
690
|
-
security_upgrade_desc: "Su cuenta requiere una actualización de seguridad biométrica para esta acción.",
|
|
691
|
-
biometric_secure: "BIOMÉTRICO SEGURO",
|
|
692
|
-
zero_knowledge: "CONOCIMIENTO CERO",
|
|
693
|
-
start_upgrade: "Iniciar actualización",
|
|
694
|
-
do_this_later: "Lo haré más tarde",
|
|
695
|
-
sign_in_with_extension: "Iniciar sesión con extensión",
|
|
696
|
-
sign_in_with_otp: "Iniciar sesión con OTP",
|
|
697
|
-
extension_detected: "Extensión detectada",
|
|
698
|
-
secure_wallet: "Billetera segura",
|
|
699
|
-
fully_audited: "TOTALMENTE AUDITADO",
|
|
700
|
-
non_custodial: "SIN CUSTODIA",
|
|
701
|
-
verify_identity: "Verifique su identidad",
|
|
702
|
-
choose_document: "Elija un tipo de documento para comenzar.",
|
|
703
|
-
passport: "Pasaporte",
|
|
704
|
-
drivers_license: "Licencia de conducir",
|
|
705
|
-
national_id: "DNI / Cédula",
|
|
706
|
-
passport_desc: "Todos los países soportados",
|
|
707
|
-
drivers_license_desc: "Tarjeta emitida por el gobierno",
|
|
708
|
-
national_id_desc: "Documento nacional de identidad",
|
|
709
|
-
position_face: "Coloque su cara en el marco",
|
|
710
|
-
blink_slowly: "Parpadee lentamente",
|
|
711
|
-
turn_head_left: "Gire la cabeza hacia la izquierda",
|
|
712
|
-
turn_head_right: "Gire la cabeza hacia la derecha",
|
|
713
|
-
processing: "Procesando...",
|
|
714
|
-
camera_permission_denied: "Permiso de cámara denegado",
|
|
715
|
-
unable_access_camera: "No se puede acceder a la cámara",
|
|
716
|
-
live_camera: "CÁMARA EN VIVO",
|
|
717
|
-
initializing: "INICIALIZANDO",
|
|
718
|
-
processing_verification: "Procesando verificación...",
|
|
719
|
-
processing_liveness: "Verificando vivacidad...",
|
|
720
|
-
processing_documents: "Procesando documentos...",
|
|
721
|
-
processing_subtitle: "Validando sus documentos y biometría",
|
|
722
|
-
minting_identity: "Minting identidad...",
|
|
723
|
-
minting_subtitle: "Asegurando su identidad descentralizada en Casper Network",
|
|
724
|
-
identity_minted: "¡Identidad Minted!",
|
|
725
|
-
minted_subtitle: "Su CasperID ha sido creado con éxito",
|
|
726
|
-
verification_failed_subtitle: "Hubo un problema con su verificación",
|
|
727
|
-
try_again: "Intentar de nuevo",
|
|
728
|
-
credential_hash: "Hash de credencial",
|
|
729
|
-
identity_verified: "Identidad verificada",
|
|
730
|
-
identity_verified_subtitle: "Su verificación de vida fue exitosa. Ahora está verificado.",
|
|
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.",
|
|
736
|
-
share_data_consent: "Consentimiento de datos",
|
|
737
|
-
authorize_dapps: "Autorizar dApps para acceder a credenciales",
|
|
738
|
-
return_to_app: "Volver a la aplicación",
|
|
739
|
-
verify_data_desc: "Verifique su información de identidad. Estos datos se usarán para crear su CasperID.",
|
|
740
|
-
ocr_confidence: "Confianza OCR",
|
|
741
|
-
first_name: "Nombre",
|
|
742
|
-
last_name: "Apellido",
|
|
743
|
-
document_number: "Número de documento",
|
|
744
|
-
date_of_birth: "Fecha de nacimiento",
|
|
745
|
-
nationality: "Nacionalidad",
|
|
746
|
-
enter_first_name: "Ingrese nombre",
|
|
747
|
-
enter_last_name: "Ingrese apellido",
|
|
748
|
-
enter_nationality: "Ingrese nacionalidad",
|
|
749
|
-
scanned_successfully: "Escaneado con éxito",
|
|
750
|
-
secured_by_casper: "Protegido por CasperID Protocol.",
|
|
751
|
-
confirm_mint: "Confirmar y crear",
|
|
752
|
-
submitting: "Enviando...",
|
|
753
|
-
retake_photo: "Tomar otra foto",
|
|
754
|
-
auth_subtitle: "Asegure su identidad Web3 con nuestra capa de autenticación premium.",
|
|
755
|
-
extension_connect_msg: "Haga clic en el icono de la extensión CasperID en su navegador para conectarse.",
|
|
756
|
-
extension_not_detected: "No se detectó la extensión CasperID. Instale la extensión o use el inicio de sesión OTP.",
|
|
757
|
-
connecting: "Conectando...",
|
|
758
|
-
two_factor_auth: "Autenticación de dos factores",
|
|
759
|
-
security_notice: "Sus datos están encriptados y nunca se almacenan en servidores centrales. Desarrollado por Casper Network.",
|
|
760
|
-
e2e_encrypted: "Cifrado de extremo a extremo",
|
|
761
|
-
error_email_required: "Por favor ingrese su correo",
|
|
762
|
-
error_invalid_email: "Por favor ingrese un correo válido",
|
|
763
|
-
error_passkey_registered: "Tiene una clave de paso registrada. Utilice el inicio de sesión por extensión.",
|
|
764
|
-
error_send_code_failed: "Error al enviar el código de verificación. Inténtelo de nuevo.",
|
|
765
|
-
error_connection_failed: "No se puede conectar. Compruebe su conexión a internet.",
|
|
766
|
-
verify_code: "Código de verificación",
|
|
767
|
-
code_expired: "Código expirado",
|
|
768
|
-
invalid_code: "Código inválido",
|
|
769
|
-
error_pin_incomplete: "Por favor ingrese los 6 dígitos",
|
|
770
|
-
verify: "Verificar",
|
|
771
|
-
invalid_code_attempts: "Código inválido. {attempts} intentos restantes.",
|
|
772
|
-
awaiting_calibration: "Esperando calibración",
|
|
773
|
-
transaction_status: "Estado de la transacción",
|
|
774
|
-
complete_percent: "{percent}% completado",
|
|
775
|
-
validating_docs: "Validando documentos...",
|
|
776
|
-
broadcasting_tx: "Transmitiendo al nodo principal de Casper...",
|
|
777
|
-
tx_confirmed: "Transacción confirmada en Casper Network",
|
|
778
|
-
scan_instruction: "Escanee el {side} de su {docType}",
|
|
779
|
-
review_capture: "Revise su captura. Asegúrese de que todo el texto sea visible.",
|
|
780
|
-
align_document: "Alinee su documento dentro del marco brillante. Asegúrese de que las cuatro esquinas sean visibles.",
|
|
781
|
-
next_back_side: "Siguiente: Reverso",
|
|
782
|
-
confirm: "Confirmar",
|
|
783
|
-
capture: "Capturar",
|
|
784
|
-
verify_data_carefully: "Verifique los datos extraídos cuidadosamente.",
|
|
785
|
-
enter_doc_number: "Ingrese el número de documento",
|
|
786
|
-
date_format: "DD/MM/AAAA",
|
|
787
|
-
error_required_fields: "Por favor complete todos los campos obligatorios.",
|
|
788
|
-
front: "frente",
|
|
789
|
-
back: "reverso",
|
|
790
|
-
requesting_access: "Solicitando acceso",
|
|
791
|
-
privacy_note: "Nota de privacidad",
|
|
792
|
-
privacy_desc: "Solo se comparten pruebas criptográficas. Nunca se exponen las claves privadas.",
|
|
793
|
-
approve_verify: "Aprobar y Verificar",
|
|
794
|
-
deny: "Denegar",
|
|
795
|
-
perm_identity: "Verificar estado de identidad",
|
|
796
|
-
perm_profile: "Leer perfil público",
|
|
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",
|
|
803
|
-
full_name: "NOMBRE COMPLETO",
|
|
804
|
-
id_number: "NÚMERO DE IDENTIFICACIÓN",
|
|
805
|
-
// Passkey Auth
|
|
806
|
-
passkey_auth_subtitle: "Use su clave de paso para iniciar sesión de forma segura.",
|
|
807
|
-
signing_in_as: "Iniciando sesión como",
|
|
808
|
-
use_passkey: "Use su clave de paso",
|
|
809
|
-
authenticating: "Autenticando...",
|
|
810
|
-
authentication_failed: "Autenticación fallida",
|
|
811
|
-
passkey_auth_hint: "Touch ID, Face ID o llave de seguridad",
|
|
812
|
-
passkey_cancelled: "Autenticación cancelada. Intente de nuevo cuando esté listo.",
|
|
813
|
-
authenticate: "Autenticar",
|
|
814
|
-
use_email_instead: "Usar código de correo",
|
|
815
|
-
biometric_secured: "Biométrico seguro",
|
|
816
|
-
webauthn_not_supported: "Su navegador no admite claves de paso. Use verificación por correo.",
|
|
817
|
-
// Passkey Registration
|
|
818
|
-
create_passkey: "Crear su clave de paso",
|
|
819
|
-
passkey_register_subtitle: "Configure autenticación biométrica para inicio de sesión sin contraseña.",
|
|
820
|
-
passkey_benefits_title: "¿Por qué usar clave de paso?",
|
|
821
|
-
passkey_benefit_1: "Sin contraseñas que recordar",
|
|
822
|
-
passkey_benefit_2: "Seguridad resistente al phishing",
|
|
823
|
-
passkey_benefit_3: "Funciona en todos sus dispositivos",
|
|
824
|
-
register_passkey: "Crear clave de paso",
|
|
825
|
-
creating_passkey: "Creando clave de paso...",
|
|
826
|
-
passkey_created: "¡Clave de paso creada!",
|
|
827
|
-
passkey_create_failed: "Error al crear clave de paso",
|
|
828
|
-
// L1 Setup
|
|
829
|
-
l1_setup_title: "Configurando su identidad",
|
|
830
|
-
l1_setup_subtitle: "Creando su billetera segura e identidad descentralizada.",
|
|
831
|
-
generating_wallet: "Generando billetera segura...",
|
|
832
|
-
minting_did: "Minting su DID...",
|
|
833
|
-
l1_complete: "¡Configuración de identidad completa!",
|
|
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"
|
|
839
|
-
},
|
|
840
|
-
FR: {
|
|
841
|
-
welcome_back: "Bon retour",
|
|
842
|
-
enter_email: "Entrez votre email pour un code.",
|
|
843
|
-
email_address: "Adresse email",
|
|
844
|
-
continue: "Continuer",
|
|
845
|
-
sending_code: "Envoi du code...",
|
|
846
|
-
verify_email: "Vérifier l'email",
|
|
847
|
-
enter_code: "Entrez le code à 6 chiffres envoyé à",
|
|
848
|
-
verification_failed: "Échec de vérification",
|
|
849
|
-
verifying: "Vérification...",
|
|
850
|
-
resend_code: "Renvoyer le code",
|
|
851
|
-
resend_in: "Renvoyer dans",
|
|
852
|
-
secure_sdk: "SDK SÉCURISÉ",
|
|
853
|
-
permission_request: "DEMANDE DE PERMISSION",
|
|
854
|
-
review_data: "Réviser les données",
|
|
855
|
-
mint_identity: "Mint Identité",
|
|
856
|
-
face_scan: "Scan du visage",
|
|
857
|
-
document_scan: "Scan du document",
|
|
858
|
-
verification_step: "ÉTAPE DE VÉRIFICATION",
|
|
859
|
-
kyc_required: "KYC REQUIS",
|
|
860
|
-
security_upgrade_required: "Mise à niveau de sécurité requise",
|
|
861
|
-
security_upgrade_desc: "Votre compte nécessite une mise à niveau biométrique pour cette action.",
|
|
862
|
-
biometric_secure: "BIOMÉTRIE SÉCURISÉE",
|
|
863
|
-
zero_knowledge: "ZÉRO CONNAISSANCE",
|
|
864
|
-
start_upgrade: "Démarrer la mise à jour",
|
|
865
|
-
do_this_later: "Je ferai ça plus tard",
|
|
866
|
-
sign_in_with_extension: "Connexion avec l'extension",
|
|
867
|
-
sign_in_with_otp: "Connexion avec OTP",
|
|
868
|
-
extension_detected: "Extension détectée",
|
|
869
|
-
secure_wallet: "Portefeuille sécurisé",
|
|
870
|
-
fully_audited: "ENTIÈREMENT AUDITÉ",
|
|
871
|
-
non_custodial: "NON FONGIBLE",
|
|
872
|
-
verify_identity: "Vérifiez votre identité",
|
|
873
|
-
choose_document: "Choisissez un type de document.",
|
|
874
|
-
passport: "Passeport",
|
|
875
|
-
drivers_license: "Permis de conduire",
|
|
876
|
-
national_id: "Carte d'identité",
|
|
877
|
-
passport_desc: "Tous les pays supportés",
|
|
878
|
-
drivers_license_desc: "Carte émise par le gouvernement",
|
|
879
|
-
national_id_desc: "Document d'identité national",
|
|
880
|
-
position_face: "Placez votre visage dans le cadre",
|
|
881
|
-
blink_slowly: "Clignez des yeux lentement",
|
|
882
|
-
turn_head_left: "Tournez la tête vers la gauche",
|
|
883
|
-
turn_head_right: "Tournez la tête vers la droite",
|
|
884
|
-
processing: "Traitement...",
|
|
885
|
-
camera_permission_denied: "Permission caméra refusée",
|
|
886
|
-
unable_access_camera: "Accès caméra impossible",
|
|
887
|
-
live_camera: "CAMÉRA EN DIRECT",
|
|
888
|
-
initializing: "INITIALISATION",
|
|
889
|
-
processing_verification: "Traitement de la vérification...",
|
|
890
|
-
processing_liveness: "Vérification de la vivacité...",
|
|
891
|
-
processing_documents: "Traitement des documents...",
|
|
892
|
-
processing_subtitle: "Validation de vos documents et biométrie",
|
|
893
|
-
minting_identity: "Mint Identité en cours...",
|
|
894
|
-
minting_subtitle: "Sécurisation de votre identité sur le réseau Casper",
|
|
895
|
-
identity_minted: "Identité créée !",
|
|
896
|
-
minted_subtitle: "Votre CasperID a été créé avec succès",
|
|
897
|
-
verification_failed_subtitle: "Il y a eu un problème avec votre vérification",
|
|
898
|
-
try_again: "Réessayer",
|
|
899
|
-
credential_hash: "Hachage de créance",
|
|
900
|
-
identity_verified: "Identité vérifiée",
|
|
901
|
-
identity_verified_subtitle: "Votre vérification de vivacité a réussi. Vous êtes maintenant vérifié.",
|
|
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é.",
|
|
907
|
-
share_data_consent: "Partage de données",
|
|
908
|
-
authorize_dapps: "Autoriser dApps à accéder aux identifiants",
|
|
909
|
-
return_to_app: "Retour à l'application",
|
|
910
|
-
verify_data_desc: "Vérifiez vos informations d'identité. Ces données seront utilisées pour créer votre CasperID.",
|
|
911
|
-
ocr_confidence: "Confiance OCR",
|
|
912
|
-
first_name: "Prénom",
|
|
913
|
-
last_name: "Nom",
|
|
914
|
-
document_number: "Numéro de document",
|
|
915
|
-
date_of_birth: "Date de naissance",
|
|
916
|
-
nationality: "Nationalité",
|
|
917
|
-
enter_first_name: "Entrez le prénom",
|
|
918
|
-
enter_last_name: "Entrez le nom",
|
|
919
|
-
enter_nationality: "Entrez la nationalité",
|
|
920
|
-
scanned_successfully: "Scanné avec succès",
|
|
921
|
-
secured_by_casper: "Sécurisé par CasperID Protocol.",
|
|
922
|
-
confirm_mint: "Confirmer et Créer",
|
|
923
|
-
submitting: "Soumission...",
|
|
924
|
-
retake_photo: "Reprendre la photo",
|
|
925
|
-
auth_subtitle: "Sécurisez votre identité Web3 avec notre couche d'authentification premium.",
|
|
926
|
-
extension_connect_msg: "Cliquez sur l'icône de l'extension CasperID dans votre navigateur pour vous connecter.",
|
|
927
|
-
extension_not_detected: "Extension CasperID non détectée. Veuillez installer l'extension ou utiliser la connexion OTP.",
|
|
928
|
-
connecting: "Connexion...",
|
|
929
|
-
two_factor_auth: "Authentification à deux facteurs",
|
|
930
|
-
security_notice: "Vos données sont cryptées et ne sont jamais stockées sur des serveurs centraux. Propulsé par Casper Network.",
|
|
931
|
-
e2e_encrypted: "Chiffré de bout en bout",
|
|
932
|
-
error_email_required: "Veuillez entrer votre email",
|
|
933
|
-
error_invalid_email: "Veuillez entrer une adresse email valide",
|
|
934
|
-
error_passkey_registered: "Vous avez une clé de sécurité enregistrée. Veuillez utiliser la connexion par extension.",
|
|
935
|
-
error_send_code_failed: "Échec de l'envoi du code de vérification. Veuillez réessayer.",
|
|
936
|
-
error_connection_failed: "Impossible de se connecter. Veuillez vérifier votre connexion internet.",
|
|
937
|
-
verify_code: "Code de vérification",
|
|
938
|
-
code_expired: "Code expiré",
|
|
939
|
-
invalid_code: "Code invalide",
|
|
940
|
-
error_pin_incomplete: "Veuillez entrer les 6 chiffres",
|
|
941
|
-
verify: "Vérifier",
|
|
942
|
-
invalid_code_attempts: "Code invalide. {attempts} tentatives restantes.",
|
|
943
|
-
awaiting_calibration: "En attente de calibrage",
|
|
944
|
-
transaction_status: "Statut de la transaction",
|
|
945
|
-
complete_percent: "{percent}% terminé",
|
|
946
|
-
validating_docs: "Validation des documents...",
|
|
947
|
-
broadcasting_tx: "Diffusion sur le nœud Casper Mainnet...",
|
|
948
|
-
tx_confirmed: "Transaction confirmée sur le réseau Casper",
|
|
949
|
-
scan_instruction: "Scannez le {side} de votre {docType}",
|
|
950
|
-
review_capture: "Réviser votre capture. Assurez-vous que tout le texte est visible.",
|
|
951
|
-
align_document: "Alignez votre document dans le cadre. Assurez-vous que les quatre coins sont visibles.",
|
|
952
|
-
next_back_side: "Suivant: Verso",
|
|
953
|
-
confirm: "Confirmer",
|
|
954
|
-
capture: "Capturer",
|
|
955
|
-
verify_data_carefully: "Veuillez vérifier soigneusement les données extraites.",
|
|
956
|
-
enter_doc_number: "Entrez le numéro du document",
|
|
957
|
-
date_format: "JJ/MM/AAAA",
|
|
958
|
-
error_required_fields: "Veuillez remplir tous les champs obligatoires.",
|
|
959
|
-
front: "recto",
|
|
960
|
-
back: "verso",
|
|
961
|
-
requesting_access: "Demande d'accès",
|
|
962
|
-
privacy_note: "Note de confidentialité",
|
|
963
|
-
privacy_desc: "Seules des preuves cryptographiques sont partagées. Aucune clé privée n'est jamais exposée.",
|
|
964
|
-
approve_verify: "Approuver et Vérifier",
|
|
965
|
-
deny: "Refuser",
|
|
966
|
-
perm_identity: "Vérifier le statut d'identité",
|
|
967
|
-
perm_profile: "Lire le profil public",
|
|
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",
|
|
974
|
-
full_name: "NOM COMPLET",
|
|
975
|
-
id_number: "NUMÉRO DE DOCUMENT",
|
|
976
|
-
// Passkey Auth
|
|
977
|
-
passkey_auth_subtitle: "Utilisez votre clé d'accès pour vous connecter en toute sécurité.",
|
|
978
|
-
signing_in_as: "Connexion en tant que",
|
|
979
|
-
use_passkey: "Utilisez votre clé d'accès",
|
|
980
|
-
authenticating: "Authentification...",
|
|
981
|
-
authentication_failed: "Échec de l'authentification",
|
|
982
|
-
passkey_auth_hint: "Touch ID, Face ID ou clé de sécurité",
|
|
983
|
-
passkey_cancelled: "Authentification annulée. Réessayez quand vous êtes prêt.",
|
|
984
|
-
authenticate: "Authentifier",
|
|
985
|
-
use_email_instead: "Utiliser un code par email",
|
|
986
|
-
biometric_secured: "Sécurisé biométrique",
|
|
987
|
-
webauthn_not_supported: "Votre navigateur ne prend pas en charge les clés d'accès. Utilisez la vérification par email.",
|
|
988
|
-
// Passkey Registration
|
|
989
|
-
create_passkey: "Créer votre clé d'accès",
|
|
990
|
-
passkey_register_subtitle: "Configurez l'authentification biométrique pour une connexion sans mot de passe.",
|
|
991
|
-
passkey_benefits_title: "Pourquoi utiliser une clé d'accès?",
|
|
992
|
-
passkey_benefit_1: "Pas de mot de passe à retenir",
|
|
993
|
-
passkey_benefit_2: "Sécurité résistante au phishing",
|
|
994
|
-
passkey_benefit_3: "Fonctionne sur tous vos appareils",
|
|
995
|
-
register_passkey: "Créer la clé d'accès",
|
|
996
|
-
creating_passkey: "Création de la clé d'accès...",
|
|
997
|
-
passkey_created: "Clé d'accès créée!",
|
|
998
|
-
passkey_create_failed: "Échec de la création de la clé d'accès",
|
|
999
|
-
// L1 Setup
|
|
1000
|
-
l1_setup_title: "Configuration de votre identité",
|
|
1001
|
-
l1_setup_subtitle: "Création de votre portefeuille sécurisé et identité décentralisée.",
|
|
1002
|
-
generating_wallet: "Génération du portefeuille sécurisé...",
|
|
1003
|
-
minting_did: "Création de votre DID...",
|
|
1004
|
-
l1_complete: "Configuration d'identité terminée!",
|
|
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"
|
|
1010
|
-
},
|
|
1011
|
-
DE: {
|
|
1012
|
-
welcome_back: "Willkommen zurück",
|
|
1013
|
-
enter_email: "E-Mail für Bestätigungscode eingeben.",
|
|
1014
|
-
email_address: "E-Mail-Adresse",
|
|
1015
|
-
continue: "Weiter",
|
|
1016
|
-
sending_code: "Code wird gesendet...",
|
|
1017
|
-
verify_email: "E-Mail verifizieren",
|
|
1018
|
-
enter_code: "6-stelligen Code eingeben, gesendet an",
|
|
1019
|
-
verification_failed: "Verifizierung fehlgeschlagen",
|
|
1020
|
-
verifying: "Verifizierung...",
|
|
1021
|
-
resend_code: "Code erneut senden",
|
|
1022
|
-
resend_in: "Erneut in",
|
|
1023
|
-
secure_sdk: "SICHERES SDK",
|
|
1024
|
-
permission_request: "BERECHTIGUNGSANFRAGE",
|
|
1025
|
-
review_data: "Daten überprüfen",
|
|
1026
|
-
mint_identity: "Identität prägen",
|
|
1027
|
-
face_scan: "Gesichtsscan",
|
|
1028
|
-
document_scan: "Dokumentenscan",
|
|
1029
|
-
verification_step: "VERIFIZIERUNGSSCHRITT",
|
|
1030
|
-
kyc_required: "KYC ERFORDERLICH",
|
|
1031
|
-
security_upgrade_required: "Sicherheits-Upgrade erforderlich",
|
|
1032
|
-
security_upgrade_desc: "Ihr Konto erfordert ein biometrisches Upgrade für diese Aktion.",
|
|
1033
|
-
biometric_secure: "BIOMETRISCH SICHER",
|
|
1034
|
-
zero_knowledge: "ZERO-KNOWLEDGE",
|
|
1035
|
-
start_upgrade: "Upgrade starten",
|
|
1036
|
-
do_this_later: "Später erledigen",
|
|
1037
|
-
sign_in_with_extension: "Mit Erweiterung anmelden",
|
|
1038
|
-
sign_in_with_otp: "Mit OTP anmelden",
|
|
1039
|
-
extension_detected: "Erweiterung erkannt",
|
|
1040
|
-
secure_wallet: "Sichere Wallet",
|
|
1041
|
-
fully_audited: "VOLLSTÄNDIG GEPRÜFT",
|
|
1042
|
-
non_custodial: "NON-CUSTODIAL",
|
|
1043
|
-
verify_identity: "Identität verifizieren",
|
|
1044
|
-
choose_document: "Dokumenttyp auswählen.",
|
|
1045
|
-
passport: "Reisepass",
|
|
1046
|
-
drivers_license: "Führerschein",
|
|
1047
|
-
national_id: "Personalausweis",
|
|
1048
|
-
passport_desc: "Alle Länder unterstützt",
|
|
1049
|
-
drivers_license_desc: "Staatlicher Ausweis",
|
|
1050
|
-
national_id_desc: "Nationaler Identitätsnachweis",
|
|
1051
|
-
position_face: "Gesicht im Rahmen positionieren",
|
|
1052
|
-
blink_slowly: "Langsam blinzeln",
|
|
1053
|
-
turn_head_left: "Kopf langsam nach links drehen",
|
|
1054
|
-
turn_head_right: "Kopf langsam nach rechts drehen",
|
|
1055
|
-
processing: "Verarbeitung...",
|
|
1056
|
-
camera_permission_denied: "Kamerazugriff verweigert",
|
|
1057
|
-
unable_access_camera: "Kamerazugriff nicht möglich",
|
|
1058
|
-
live_camera: "LIVE-KAMERA",
|
|
1059
|
-
initializing: "INITIALISIERUNG",
|
|
1060
|
-
processing_verification: "Verifizierung wird verarbeitet...",
|
|
1061
|
-
processing_liveness: "Lebendigkeitsprüfung läuft...",
|
|
1062
|
-
processing_documents: "Dokumente werden verarbeitet...",
|
|
1063
|
-
processing_subtitle: "Dokumente und Biometrie werden validiert",
|
|
1064
|
-
minting_identity: "Identität wird geprägt...",
|
|
1065
|
-
minting_subtitle: "Ihre dezentrale Identität wird im Casper-Netzwerk gesichert",
|
|
1066
|
-
identity_minted: "Identität geprägt!",
|
|
1067
|
-
minted_subtitle: "Ihre CasperID wurde erfolgreich erstellt",
|
|
1068
|
-
verification_failed_subtitle: "Es gab ein Problem mit Ihrer Verifizierung",
|
|
1069
|
-
try_again: "Erneut versuchen",
|
|
1070
|
-
credential_hash: "Anmeldedaten-Hash",
|
|
1071
|
-
identity_verified: "Identität verifiziert",
|
|
1072
|
-
identity_verified_subtitle: "Ihre Lebendigkeitsprüfung war erfolgreich. Sie sind jetzt verifiziert.",
|
|
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.",
|
|
1078
|
-
share_data_consent: "Datenfreigabe",
|
|
1079
|
-
authorize_dapps: "dApps Zugriff auf Anmeldedaten erlauben",
|
|
1080
|
-
return_to_app: "Zurück zur App",
|
|
1081
|
-
verify_data_desc: "Überprüfen Sie Ihre Identitätsdaten. Diese werden zur Erstellung Ihrer CasperID verwendet.",
|
|
1082
|
-
ocr_confidence: "OCR-Vertrauen",
|
|
1083
|
-
first_name: "Vorname",
|
|
1084
|
-
last_name: "Nachname",
|
|
1085
|
-
document_number: "Ausweisnummer",
|
|
1086
|
-
date_of_birth: "Geburtsdatum",
|
|
1087
|
-
nationality: "Nationalität",
|
|
1088
|
-
enter_first_name: "Vorname eingeben",
|
|
1089
|
-
enter_last_name: "Nachname eingeben",
|
|
1090
|
-
enter_nationality: "Nationalität eingeben",
|
|
1091
|
-
scanned_successfully: "Erfolgreich gescannt",
|
|
1092
|
-
secured_by_casper: "Gesichert durch CasperID Protocol.",
|
|
1093
|
-
confirm_mint: "Bestätigen & Prägen",
|
|
1094
|
-
submitting: "Wird gesendet...",
|
|
1095
|
-
retake_photo: "Foto erneut aufnehmen",
|
|
1096
|
-
auth_subtitle: "Sichern Sie Ihre Web3-Identität mit unserer Premium-Authentifizierungsschicht.",
|
|
1097
|
-
extension_connect_msg: "Klicken Sie auf das CasperID-Erweiterungssymbol in Ihrem Browser, um eine Verbindung herzustellen.",
|
|
1098
|
-
extension_not_detected: "CasperID-Erweiterung nicht erkannt. Bitte installieren Sie die Erweiterung oder verwenden Sie die OTP-Anmeldung.",
|
|
1099
|
-
connecting: "Verbindung wird hergestellt...",
|
|
1100
|
-
two_factor_auth: "Zwei-Faktor-Authentifizierung",
|
|
1101
|
-
security_notice: "Ihre Daten sind verschlüsselt und werden niemals auf zentralen Servern gespeichert. Unterstützt von Casper Network.",
|
|
1102
|
-
e2e_encrypted: "Ende-zu-Ende verschlüsselt",
|
|
1103
|
-
error_email_required: "Bitte geben Sie Ihre E-Mail-Adresse ein",
|
|
1104
|
-
error_invalid_email: "Bitte geben Sie eine gültige E-Mail-Adresse ein",
|
|
1105
|
-
error_passkey_registered: "Sie haben einen Passkey registriert. Bitte verwenden Sie die Anmeldung über die Erweiterung.",
|
|
1106
|
-
error_send_code_failed: "Der Verifizierungscode konnte nicht gesendet werden. Bitte versuchen Sie es erneut.",
|
|
1107
|
-
error_connection_failed: "Verbindung nicht möglich. Bitte überprüfen Sie Ihre Internetverbindung.",
|
|
1108
|
-
verify_code: "Verifizierungscode",
|
|
1109
|
-
code_expired: "Code abgelaufen",
|
|
1110
|
-
invalid_code: "Ungültiger Code",
|
|
1111
|
-
error_pin_incomplete: "Bitte alle 6 Ziffern eingeben",
|
|
1112
|
-
verify: "Verifizieren",
|
|
1113
|
-
invalid_code_attempts: "Ungültiger Code. {attempts} Versuche übrig.",
|
|
1114
|
-
error_verify_failed: "Verifizierung nicht möglich. Bitte erneut versuchen.",
|
|
1115
|
-
error_resend_failed: "Code konnte nicht gesendet werden. Bitte erneut versuchen.",
|
|
1116
|
-
sending: "Senden...",
|
|
1117
|
-
facial_verification: "Gesichtsverifizierung",
|
|
1118
|
-
secure_face_scan_desc: "Sicherer Gesichtsscan • Verschlüsselt",
|
|
1119
|
-
analyzing_liveness: "Lebendigkeitsprüfung",
|
|
1120
|
-
calibration_complete: "Kalibrierung abgeschlossen",
|
|
1121
|
-
awaiting_calibration: "Warten auf Kalibrierung",
|
|
1122
|
-
transaction_status: "Transaktionsstatus",
|
|
1123
|
-
complete_percent: "{percent}% abgeschlossen",
|
|
1124
|
-
validating_docs: "Dokumente werden validiert...",
|
|
1125
|
-
broadcasting_tx: "Übertragung an Casper Mainnet Node...",
|
|
1126
|
-
tx_confirmed: "Transaktion im Casper-Netzwerk bestätigt",
|
|
1127
|
-
scan_instruction: "Scannen Sie die {side} Ihres {docType}",
|
|
1128
|
-
review_capture: "Überprüfen Sie Ihre Aufnahme. Stellen Sie sicher, dass der Text lesbar ist.",
|
|
1129
|
-
align_document: "Richten Sie Ihr Dokument im Rahmen aus. Alle vier Ecken müssen sichtbar sein.",
|
|
1130
|
-
next_back_side: "Weiter: Rückseite",
|
|
1131
|
-
confirm: "Bestätigen",
|
|
1132
|
-
capture: "Aufnehmen",
|
|
1133
|
-
verify_data_carefully: "Bitte überprüfen Sie die extrahierten Daten sorgfältig.",
|
|
1134
|
-
enter_doc_number: "Ausweisnummer eingeben",
|
|
1135
|
-
date_format: "TT/MM/JJJJ",
|
|
1136
|
-
error_required_fields: "Bitte füllen Sie alle Pflichtfelder aus.",
|
|
1137
|
-
front: "Vorderseite",
|
|
1138
|
-
back: "Rückseite",
|
|
1139
|
-
requesting_access: "Zugriff anfordern",
|
|
1140
|
-
privacy_note: "Datenschutzhinweis",
|
|
1141
|
-
privacy_desc: "Es werden nur kryptografische Beweise geteilt. Private Schlüssel werden niemals offengelegt.",
|
|
1142
|
-
approve_verify: "Genehmigen & Verifizieren",
|
|
1143
|
-
deny: "Ablehnen",
|
|
1144
|
-
perm_identity: "Identitätsstatus überprüfen",
|
|
1145
|
-
perm_profile: "Öffentliches Profil lesen",
|
|
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",
|
|
1152
|
-
full_name: "VOLLSTÄNDIGER NAME",
|
|
1153
|
-
id_number: "AUSWEISNUMMER",
|
|
1154
|
-
// Passkey Auth
|
|
1155
|
-
passkey_auth_subtitle: "Verwenden Sie Ihren Passkey für sichere Anmeldung.",
|
|
1156
|
-
signing_in_as: "Anmeldung als",
|
|
1157
|
-
use_passkey: "Passkey verwenden",
|
|
1158
|
-
authenticating: "Authentifizierung...",
|
|
1159
|
-
authentication_failed: "Authentifizierung fehlgeschlagen",
|
|
1160
|
-
passkey_auth_hint: "Touch ID, Face ID oder Sicherheitsschlüssel",
|
|
1161
|
-
passkey_cancelled: "Authentifizierung abgebrochen. Versuchen Sie es erneut.",
|
|
1162
|
-
authenticate: "Authentifizieren",
|
|
1163
|
-
use_email_instead: "E-Mail-Code verwenden",
|
|
1164
|
-
biometric_secured: "Biometrisch gesichert",
|
|
1165
|
-
webauthn_not_supported: "Ihr Browser unterstützt keine Passkeys. Verwenden Sie E-Mail-Verifizierung.",
|
|
1166
|
-
// Passkey Registration
|
|
1167
|
-
create_passkey: "Passkey erstellen",
|
|
1168
|
-
passkey_register_subtitle: "Richten Sie biometrische Authentifizierung für passwortlose Anmeldung ein.",
|
|
1169
|
-
passkey_benefits_title: "Warum einen Passkey verwenden?",
|
|
1170
|
-
passkey_benefit_1: "Keine Passwörter merken",
|
|
1171
|
-
passkey_benefit_2: "Phishing-resistente Sicherheit",
|
|
1172
|
-
passkey_benefit_3: "Funktioniert auf allen Geräten",
|
|
1173
|
-
register_passkey: "Passkey erstellen",
|
|
1174
|
-
creating_passkey: "Passkey wird erstellt...",
|
|
1175
|
-
passkey_created: "Passkey erstellt!",
|
|
1176
|
-
passkey_create_failed: "Passkey-Erstellung fehlgeschlagen",
|
|
1177
|
-
// L1 Setup
|
|
1178
|
-
l1_setup_title: "Identität einrichten",
|
|
1179
|
-
l1_setup_subtitle: "Sichere Wallet und dezentrale Identität werden erstellt.",
|
|
1180
|
-
generating_wallet: "Sichere Wallet wird generiert...",
|
|
1181
|
-
minting_did: "DID wird geprägt...",
|
|
1182
|
-
l1_complete: "Identitätseinrichtung abgeschlossen!",
|
|
1183
|
-
l1_failed: "Einrichtung fehlgeschlagen. Erneut versuchen."
|
|
1
|
+
import { jsx as R } from "react/jsx-runtime";
|
|
2
|
+
import { useState as k, useRef as P, useEffect as L } from "react";
|
|
3
|
+
const $ = "casperid_authorization:", A = "casperid_authorization_result:", O = "casperid_authorization_popup:", V = 1800 * 1e3;
|
|
4
|
+
function E(e) {
|
|
5
|
+
let t = "";
|
|
6
|
+
return e.forEach((r) => {
|
|
7
|
+
t += String.fromCharCode(r);
|
|
8
|
+
}), btoa(t).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
9
|
+
}
|
|
10
|
+
function z(e = 32) {
|
|
11
|
+
const t = new Uint8Array(e);
|
|
12
|
+
return crypto.getRandomValues(t), E(t);
|
|
13
|
+
}
|
|
14
|
+
async function q(e) {
|
|
15
|
+
const t = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(e));
|
|
16
|
+
return E(new Uint8Array(t));
|
|
17
|
+
}
|
|
18
|
+
function U(e) {
|
|
19
|
+
return `${$}${e}`;
|
|
20
|
+
}
|
|
21
|
+
function v(e) {
|
|
22
|
+
return `${A}${e}`;
|
|
23
|
+
}
|
|
24
|
+
function y(e) {
|
|
25
|
+
return `${O}${e}`;
|
|
26
|
+
}
|
|
27
|
+
function N(e) {
|
|
28
|
+
sessionStorage.setItem(U(e.state), JSON.stringify(e));
|
|
29
|
+
}
|
|
30
|
+
function D(e) {
|
|
31
|
+
const t = sessionStorage.getItem(U(e));
|
|
32
|
+
if (!t) return null;
|
|
33
|
+
try {
|
|
34
|
+
return JSON.parse(t);
|
|
35
|
+
} catch {
|
|
36
|
+
return null;
|
|
1184
37
|
}
|
|
1185
|
-
}, t = (r, a = "EN") => {
|
|
1186
|
-
const n = a.toUpperCase();
|
|
1187
|
-
return (Ve[n] || Ve.EN)[r] || Ve.EN[r] || r;
|
|
1188
|
-
}, Mt = ({
|
|
1189
|
-
onNext: r,
|
|
1190
|
-
onExtensionSuccess: a,
|
|
1191
|
-
onError: n,
|
|
1192
|
-
language: l = "EN",
|
|
1193
|
-
platform: N = "desktop"
|
|
1194
|
-
}) => {
|
|
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));
|
|
1201
|
-
};
|
|
1202
|
-
return window.addEventListener("casperid-login", o), () => {
|
|
1203
|
-
window.removeEventListener("casperid-login", o);
|
|
1204
|
-
};
|
|
1205
|
-
}, [a]);
|
|
1206
|
-
const D = J(() => {
|
|
1207
|
-
const o = document.getElementById("casperid-draggable-anchor");
|
|
1208
|
-
let I = null;
|
|
1209
|
-
try {
|
|
1210
|
-
I = localStorage.getItem("casperid_user");
|
|
1211
|
-
} catch {
|
|
1212
|
-
}
|
|
1213
|
-
return o || I ? (s(!0), !0) : (setTimeout(() => {
|
|
1214
|
-
const g = document.getElementById("casperid-draggable-anchor");
|
|
1215
|
-
s(!!g);
|
|
1216
|
-
}, 500), !1);
|
|
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("");
|
|
1219
|
-
try {
|
|
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);
|
|
1225
|
-
return;
|
|
1226
|
-
}
|
|
1227
|
-
}
|
|
1228
|
-
} catch {
|
|
1229
|
-
}
|
|
1230
|
-
const o = document.getElementById("casperid-draggable-anchor");
|
|
1231
|
-
o ? (o.click(), setTimeout(() => {
|
|
1232
|
-
f(!1);
|
|
1233
|
-
try {
|
|
1234
|
-
localStorage.getItem("casperid_user") || d(t("extension_connect_msg", l));
|
|
1235
|
-
} catch {
|
|
1236
|
-
d(t("extension_connect_msg", l));
|
|
1237
|
-
}
|
|
1238
|
-
}, 3e3)) : (f(!1), d(t("extension_not_detected", l)), n == null || n("Extension not installed"));
|
|
1239
|
-
}, _ = () => {
|
|
1240
|
-
d(""), r("otp");
|
|
1241
|
-
};
|
|
1242
|
-
return /* @__PURE__ */ i(
|
|
1243
|
-
P.div,
|
|
1244
|
-
{
|
|
1245
|
-
initial: { opacity: 0, y: 20 },
|
|
1246
|
-
animate: { opacity: 1, y: 0 },
|
|
1247
|
-
exit: { opacity: 0, y: -20 },
|
|
1248
|
-
className: "flex-1 px-8 flex flex-col justify-center gap-8",
|
|
1249
|
-
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: [
|
|
1252
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-0 bg-brand-20 blur-2xl rounded-full" }),
|
|
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" }) })
|
|
1254
|
-
] }),
|
|
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) })
|
|
1257
|
-
] }),
|
|
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 })
|
|
1261
|
-
] }),
|
|
1262
|
-
/* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
1263
|
-
N === "desktop" && /* @__PURE__ */ i(
|
|
1264
|
-
"button",
|
|
1265
|
-
{
|
|
1266
|
-
onClick: A,
|
|
1267
|
-
disabled: p,
|
|
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",
|
|
1269
|
-
children: [
|
|
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) })
|
|
1274
|
-
] }),
|
|
1275
|
-
/* @__PURE__ */ e(Le, { className: "ml-auto w-4 h-4 opacity-50 group-hover:opacity-100 transition-opacity" })
|
|
1276
|
-
]
|
|
1277
|
-
}
|
|
1278
|
-
),
|
|
1279
|
-
/* @__PURE__ */ i(
|
|
1280
|
-
"button",
|
|
1281
|
-
{
|
|
1282
|
-
onClick: _,
|
|
1283
|
-
disabled: p,
|
|
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",
|
|
1285
|
-
children: [
|
|
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) })
|
|
1290
|
-
] }),
|
|
1291
|
-
/* @__PURE__ */ e(Le, { className: "ml-auto w-4 h-4 opacity-50 group-hover:opacity-100 transition-opacity" })
|
|
1292
|
-
]
|
|
1293
|
-
}
|
|
1294
|
-
)
|
|
1295
|
-
] }),
|
|
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) })
|
|
1300
|
-
] }),
|
|
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) })
|
|
1304
|
-
] })
|
|
1305
|
-
] })
|
|
1306
|
-
]
|
|
1307
|
-
}
|
|
1308
|
-
);
|
|
1309
|
-
}, Lt = ({
|
|
1310
|
-
onNext: r,
|
|
1311
|
-
onPasskeyUser: a,
|
|
1312
|
-
onError: n,
|
|
1313
|
-
apiBaseUrl: l = "https://apis.casperid.com",
|
|
1314
|
-
apiKey: N = "",
|
|
1315
|
-
previewMode: p = !1,
|
|
1316
|
-
language: f = "EN"
|
|
1317
|
-
}) => {
|
|
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));
|
|
1321
|
-
return;
|
|
1322
|
-
}
|
|
1323
|
-
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(m)) {
|
|
1324
|
-
h(t("error_invalid_email", f));
|
|
1325
|
-
return;
|
|
1326
|
-
}
|
|
1327
|
-
if (d(!0), h(""), p) {
|
|
1328
|
-
setTimeout(() => {
|
|
1329
|
-
d(!1), r(m.trim().toLowerCase(), "mock-v-id-123456789");
|
|
1330
|
-
}, 1e3);
|
|
1331
|
-
return;
|
|
1332
|
-
}
|
|
1333
|
-
try {
|
|
1334
|
-
const I = await fetch(`${l}/api/auth/send-otp`, {
|
|
1335
|
-
method: "POST",
|
|
1336
|
-
headers: {
|
|
1337
|
-
"Content-Type": "application/json",
|
|
1338
|
-
...N ? { "X-App-Id": N } : {}
|
|
1339
|
-
},
|
|
1340
|
-
body: JSON.stringify({ email: m.trim().toLowerCase() })
|
|
1341
|
-
});
|
|
1342
|
-
if (!I.ok) {
|
|
1343
|
-
const k = await I.json().catch(() => ({}));
|
|
1344
|
-
throw new Error(k.error || `Request failed with status ${I.status}`);
|
|
1345
|
-
}
|
|
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);
|
|
1350
|
-
return;
|
|
1351
|
-
}
|
|
1352
|
-
g.verificationId ? r(m.trim().toLowerCase(), g.verificationId) : h(t("error_send_code_failed", f));
|
|
1353
|
-
} else
|
|
1354
|
-
h(g.error || t("error_send_code_failed", f)), n == null || n(g.error || t("error_send_code_failed", f));
|
|
1355
|
-
} catch {
|
|
1356
|
-
const g = t("error_connection_failed", f);
|
|
1357
|
-
h(g), n == null || n(g);
|
|
1358
|
-
} finally {
|
|
1359
|
-
d(!1);
|
|
1360
|
-
}
|
|
1361
|
-
}, _ = (o) => {
|
|
1362
|
-
o.key === "Enter" && !c && A();
|
|
1363
|
-
};
|
|
1364
|
-
return /* @__PURE__ */ i(
|
|
1365
|
-
P.div,
|
|
1366
|
-
{
|
|
1367
|
-
initial: { opacity: 0, x: 20 },
|
|
1368
|
-
animate: { opacity: 1, x: 0 },
|
|
1369
|
-
exit: { opacity: 0, x: -20 },
|
|
1370
|
-
className: "flex-1 flex flex-col px-8 pt-12",
|
|
1371
|
-
children: [
|
|
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) })
|
|
1375
|
-
] }),
|
|
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: [
|
|
1380
|
-
/* @__PURE__ */ e(
|
|
1381
|
-
"input",
|
|
1382
|
-
{
|
|
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`,
|
|
1384
|
-
placeholder: "name@example.com",
|
|
1385
|
-
type: "email",
|
|
1386
|
-
value: m,
|
|
1387
|
-
onChange: (o) => {
|
|
1388
|
-
s(o.target.value), D && h("");
|
|
1389
|
-
},
|
|
1390
|
-
onKeyDown: _,
|
|
1391
|
-
disabled: c,
|
|
1392
|
-
autoComplete: "email",
|
|
1393
|
-
autoFocus: !0
|
|
1394
|
-
}
|
|
1395
|
-
),
|
|
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" }) })
|
|
1397
|
-
] }),
|
|
1398
|
-
D && /* @__PURE__ */ e("p", { className: "text-red-500 text-xs font-medium ml-1 mt-1", children: D })
|
|
1399
|
-
] }),
|
|
1400
|
-
/* @__PURE__ */ e(
|
|
1401
|
-
"button",
|
|
1402
|
-
{
|
|
1403
|
-
onClick: A,
|
|
1404
|
-
disabled: c,
|
|
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",
|
|
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" })
|
|
1412
|
-
] })
|
|
1413
|
-
}
|
|
1414
|
-
)
|
|
1415
|
-
] }),
|
|
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) })
|
|
1420
|
-
] }) }),
|
|
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) })
|
|
1424
|
-
] })
|
|
1425
|
-
] })
|
|
1426
|
-
]
|
|
1427
|
-
}
|
|
1428
|
-
);
|
|
1429
|
-
};
|
|
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, "");
|
|
1436
38
|
}
|
|
1437
|
-
function
|
|
1438
|
-
const
|
|
1439
|
-
|
|
1440
|
-
N[p] = l.charCodeAt(p);
|
|
1441
|
-
return N.buffer;
|
|
39
|
+
function S(e) {
|
|
40
|
+
const t = D(e);
|
|
41
|
+
return sessionStorage.removeItem(U(e)), t;
|
|
1442
42
|
}
|
|
1443
|
-
function
|
|
1444
|
-
|
|
43
|
+
function H(e) {
|
|
44
|
+
localStorage.setItem(v(e.state), JSON.stringify(e));
|
|
1445
45
|
}
|
|
1446
|
-
|
|
1447
|
-
|
|
46
|
+
function M(e) {
|
|
47
|
+
const t = localStorage.getItem(v(e));
|
|
48
|
+
if (!t) return null;
|
|
1448
49
|
try {
|
|
1449
|
-
return
|
|
50
|
+
return JSON.parse(t);
|
|
1450
51
|
} catch {
|
|
1451
|
-
return
|
|
52
|
+
return null;
|
|
1452
53
|
}
|
|
1453
54
|
}
|
|
1454
|
-
function
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
return
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
}
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
const
|
|
1507
|
-
return {
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
},
|
|
1517
|
-
clientExtensionResults: r.getClientExtensionResults()
|
|
1518
|
-
};
|
|
1519
|
-
}
|
|
1520
|
-
async function Ht(r) {
|
|
1521
|
-
if (!Ee())
|
|
1522
|
-
throw new Error("WebAuthn is not supported in this browser");
|
|
1523
|
-
const a = qt(r), n = await navigator.credentials.create({
|
|
1524
|
-
publicKey: a
|
|
1525
|
-
});
|
|
1526
|
-
if (!n)
|
|
1527
|
-
throw new Error("Passkey creation was cancelled or failed");
|
|
1528
|
-
return $t(n);
|
|
1529
|
-
}
|
|
1530
|
-
async function Wt(r) {
|
|
1531
|
-
if (!Ee())
|
|
1532
|
-
throw new Error("WebAuthn is not supported in this browser");
|
|
1533
|
-
const a = Ut(r), n = await navigator.credentials.get({
|
|
1534
|
-
publicKey: a
|
|
1535
|
-
});
|
|
1536
|
-
if (!n)
|
|
1537
|
-
throw new Error("Passkey authentication was cancelled or failed");
|
|
1538
|
-
return Bt(n);
|
|
1539
|
-
}
|
|
1540
|
-
const Yt = ({
|
|
1541
|
-
email: r,
|
|
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"
|
|
1549
|
-
}) => {
|
|
1550
|
-
const [s, c] = y(!1), [d, D] = y(""), [h, A] = y(!0), [_, o] = y(!1);
|
|
1551
|
-
ce(() => {
|
|
1552
|
-
(async () => {
|
|
1553
|
-
const k = Ee(), V = await at();
|
|
1554
|
-
A(k && V), (!k || !V) && D(t("webauthn_not_supported", m));
|
|
1555
|
-
})();
|
|
1556
|
-
}, [m]), ce(() => {
|
|
1557
|
-
if (h && !_ && !f) {
|
|
1558
|
-
o(!0);
|
|
1559
|
-
const g = setTimeout(() => {
|
|
1560
|
-
I();
|
|
1561
|
-
}, 500);
|
|
1562
|
-
return () => clearTimeout(g);
|
|
1563
|
-
}
|
|
1564
|
-
}, [h, _, f]);
|
|
1565
|
-
const I = async () => {
|
|
1566
|
-
if (!s) {
|
|
1567
|
-
if (c(!0), D(""), f) {
|
|
1568
|
-
setTimeout(() => {
|
|
1569
|
-
c(!1), a("mock-session-token", {
|
|
1570
|
-
user_id: "mock-user-id",
|
|
1571
|
-
email: r,
|
|
1572
|
-
tier: "layer_1"
|
|
1573
|
-
});
|
|
1574
|
-
}, 1500);
|
|
55
|
+
function I(e) {
|
|
56
|
+
localStorage.removeItem(v(e));
|
|
57
|
+
}
|
|
58
|
+
function x(e) {
|
|
59
|
+
localStorage.setItem(y(e), "1");
|
|
60
|
+
}
|
|
61
|
+
function B(e) {
|
|
62
|
+
return localStorage.getItem(y(e)) === "1";
|
|
63
|
+
}
|
|
64
|
+
function m(e) {
|
|
65
|
+
localStorage.removeItem(y(e));
|
|
66
|
+
}
|
|
67
|
+
function J() {
|
|
68
|
+
return new URLSearchParams(window.location.search).get("casperid_debug") === "true" || localStorage.getItem("casperid_debug") === "true";
|
|
69
|
+
}
|
|
70
|
+
const F = /* @__PURE__ */ J();
|
|
71
|
+
function d(...e) {
|
|
72
|
+
F && console.log("[CasperID SDK DEBUG]", ...e);
|
|
73
|
+
}
|
|
74
|
+
function K() {
|
|
75
|
+
return /Android|iPhone|iPad|iPod|Mobile/i.test(navigator.userAgent);
|
|
76
|
+
}
|
|
77
|
+
async function X(e) {
|
|
78
|
+
const t = new URL(e.accountUrl || "https://account.casperid.com"), r = e.state || z(), n = z(48), s = await q(n), c = new URL(e.redirectUri).toString();
|
|
79
|
+
return t.pathname = "/authorize", t.search = new URLSearchParams({
|
|
80
|
+
response_type: "code",
|
|
81
|
+
client_id: e.clientId,
|
|
82
|
+
redirect_uri: c,
|
|
83
|
+
state: r,
|
|
84
|
+
code_challenge: s,
|
|
85
|
+
code_challenge_method: "S256"
|
|
86
|
+
}).toString(), N({
|
|
87
|
+
state: r,
|
|
88
|
+
codeVerifier: n,
|
|
89
|
+
redirectUri: c,
|
|
90
|
+
accountOrigin: t.origin
|
|
91
|
+
}), d("buildHostedAuthorizationUrl → url:", t.toString(), "state:", r), { url: t.toString(), state: r };
|
|
92
|
+
}
|
|
93
|
+
async function j(e) {
|
|
94
|
+
const t = e.mode === "auto" || !e.mode ? K() ? "redirect" : "popup" : e.mode, r = await X(e);
|
|
95
|
+
if (d("authorizeWithCasperID → mode:", t, "authUrl:", r.url), t === "redirect")
|
|
96
|
+
return window.location.assign(r.url), new Promise(() => {
|
|
97
|
+
});
|
|
98
|
+
const n = new URL(r.url);
|
|
99
|
+
n.searchParams.set("response_mode", "web_message"), n.searchParams.set("response_origin", window.location.origin), x(r.state);
|
|
100
|
+
const s = window.open(n.toString(), "casperid_authorization", "popup=yes,width=520,height=720");
|
|
101
|
+
if (!s) {
|
|
102
|
+
if (d("popup was blocked!"), m(r.state), !e.mode || e.mode === "auto")
|
|
103
|
+
return window.location.assign(r.url), new Promise(() => {
|
|
104
|
+
});
|
|
105
|
+
throw S(r.state), new Error("CasperID authorization popup was blocked.");
|
|
106
|
+
}
|
|
107
|
+
const c = s;
|
|
108
|
+
return d("popup opened successfully. popup.closed:", c.closed, "origin:", window.location.origin), new Promise((u, l) => {
|
|
109
|
+
let h = !1;
|
|
110
|
+
const _ = e.timeoutMs ?? V, g = _ > 0 ? window.setTimeout(() => p(new Error("CasperID authorization timed out.")), _) : null;
|
|
111
|
+
let w = 0;
|
|
112
|
+
const C = window.setInterval(() => {
|
|
113
|
+
w++;
|
|
114
|
+
const o = M(r.state);
|
|
115
|
+
if (o != null && o.error) {
|
|
116
|
+
p(new Error(o.errorDescription || o.error));
|
|
1575
117
|
return;
|
|
1576
118
|
}
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
method: "POST",
|
|
1580
|
-
headers: {
|
|
1581
|
-
"Content-Type": "application/json",
|
|
1582
|
-
...p ? { "X-App-Id": p } : {}
|
|
1583
|
-
},
|
|
1584
|
-
credentials: "include",
|
|
1585
|
-
body: JSON.stringify({ email: r })
|
|
1586
|
-
});
|
|
1587
|
-
if (!g.ok) {
|
|
1588
|
-
const Y = await g.json().catch(() => ({}));
|
|
1589
|
-
throw new Error(Y.error || "Failed to initialize authentication");
|
|
1590
|
-
}
|
|
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`, {
|
|
1595
|
-
method: "POST",
|
|
1596
|
-
headers: {
|
|
1597
|
-
"Content-Type": "application/json",
|
|
1598
|
-
...p ? { "X-App-Id": p } : {}
|
|
1599
|
-
},
|
|
1600
|
-
credentials: "include",
|
|
1601
|
-
body: JSON.stringify({
|
|
1602
|
-
email: r,
|
|
1603
|
-
challengeId: k.challengeId,
|
|
1604
|
-
credential: V
|
|
1605
|
-
})
|
|
1606
|
-
});
|
|
1607
|
-
if (!w.ok) {
|
|
1608
|
-
const Y = await w.json().catch(() => ({}));
|
|
1609
|
-
throw new Error(Y.error || "Authentication failed");
|
|
1610
|
-
}
|
|
1611
|
-
const T = await w.json();
|
|
1612
|
-
if (T.success && T.session_token)
|
|
1613
|
-
a(T.session_token, T.user, T.business_token);
|
|
1614
|
-
else
|
|
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));
|
|
1619
|
-
} finally {
|
|
1620
|
-
c(!1);
|
|
1621
|
-
}
|
|
1622
|
-
}
|
|
1623
|
-
};
|
|
1624
|
-
return /* @__PURE__ */ i(
|
|
1625
|
-
P.div,
|
|
1626
|
-
{
|
|
1627
|
-
initial: { opacity: 0, x: 20 },
|
|
1628
|
-
animate: { opacity: 1, x: 0 },
|
|
1629
|
-
exit: { opacity: 0, x: -20 },
|
|
1630
|
-
className: "flex-1 flex flex-col px-8 pt-12",
|
|
1631
|
-
children: [
|
|
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) })
|
|
1635
|
-
] }),
|
|
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) }),
|
|
1638
|
-
/* @__PURE__ */ e("p", { className: "text-main font-semibold", children: r })
|
|
1639
|
-
] }),
|
|
1640
|
-
/* @__PURE__ */ i("div", { className: "flex-1 flex flex-col items-center justify-center py-8", children: [
|
|
1641
|
-
/* @__PURE__ */ e(
|
|
1642
|
-
P.div,
|
|
1643
|
-
{
|
|
1644
|
-
animate: s ? {
|
|
1645
|
-
scale: [1, 1.1, 1],
|
|
1646
|
-
opacity: [1, 0.7, 1]
|
|
1647
|
-
} : {},
|
|
1648
|
-
transition: {
|
|
1649
|
-
duration: 1.5,
|
|
1650
|
-
repeat: s ? 1 / 0 : 0,
|
|
1651
|
-
ease: "easeInOut"
|
|
1652
|
-
},
|
|
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" })
|
|
1655
|
-
}
|
|
1656
|
-
),
|
|
1657
|
-
/* @__PURE__ */ e("p", { className: "text-main font-semibold text-center mb-2", children: t(s ? "authenticating" : d ? "authentication_failed" : "use_passkey", m) }),
|
|
1658
|
-
d && /* @__PURE__ */ e("p", { className: "text-red-500 text-sm text-center mb-4 max-w-xs", children: d }),
|
|
1659
|
-
!s && /* @__PURE__ */ e("p", { className: "text-muted text-sm text-center max-w-xs", children: t("passkey_auth_hint", m) })
|
|
1660
|
-
] }),
|
|
1661
|
-
/* @__PURE__ */ i("div", { className: "space-y-3 pb-8", children: [
|
|
1662
|
-
!s && /* @__PURE__ */ e(
|
|
1663
|
-
"button",
|
|
1664
|
-
{
|
|
1665
|
-
onClick: I,
|
|
1666
|
-
disabled: !h,
|
|
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",
|
|
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) })
|
|
1674
|
-
] })
|
|
1675
|
-
}
|
|
1676
|
-
),
|
|
1677
|
-
l && /* @__PURE__ */ e(
|
|
1678
|
-
"button",
|
|
1679
|
-
{
|
|
1680
|
-
onClick: l,
|
|
1681
|
-
disabled: s,
|
|
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",
|
|
1683
|
-
children: t("use_email_instead", m)
|
|
1684
|
-
}
|
|
1685
|
-
)
|
|
1686
|
-
] }),
|
|
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) })
|
|
1690
|
-
] })
|
|
1691
|
-
]
|
|
1692
|
-
}
|
|
1693
|
-
);
|
|
1694
|
-
}, Gt = ({
|
|
1695
|
-
email: r,
|
|
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"
|
|
1704
|
-
}) => {
|
|
1705
|
-
const [c, d] = y(!1), [D, h] = y(""), [A, _] = y(!0), [o, I] = y(!1);
|
|
1706
|
-
ce(() => {
|
|
1707
|
-
(async () => {
|
|
1708
|
-
const w = Ee(), T = await at();
|
|
1709
|
-
_(w && T), (!w || !T) && h(t("webauthn_not_supported", s));
|
|
1710
|
-
})();
|
|
1711
|
-
}, [s]);
|
|
1712
|
-
const g = async () => {
|
|
1713
|
-
if (!c) {
|
|
1714
|
-
if (d(!0), h(""), m) {
|
|
1715
|
-
setTimeout(() => {
|
|
1716
|
-
d(!1), I(!0), setTimeout(() => {
|
|
1717
|
-
n({
|
|
1718
|
-
user_id: "mock-user-id",
|
|
1719
|
-
email: r,
|
|
1720
|
-
tier: "layer_0"
|
|
1721
|
-
});
|
|
1722
|
-
}, 1e3);
|
|
1723
|
-
}, 1500);
|
|
119
|
+
if (o != null && o.code) {
|
|
120
|
+
d(`tick #${w}: shared result found via localStorage`), p(void 0, o.code, o);
|
|
1724
121
|
return;
|
|
1725
122
|
}
|
|
123
|
+
c.closed && d(`tick #${w}: popup.closed === true; ignored because opener isolation can sever the reference`);
|
|
1726
124
|
try {
|
|
1727
|
-
const
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
const B = await V.json().catch(() => ({}));
|
|
1739
|
-
throw new Error(B.error || "Failed to initialize registration");
|
|
1740
|
-
}
|
|
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`, {
|
|
1745
|
-
method: "POST",
|
|
1746
|
-
headers: {
|
|
1747
|
-
"Content-Type": "application/json",
|
|
1748
|
-
Authorization: `Bearer ${a}`,
|
|
1749
|
-
...f ? { "X-App-Id": f } : {}
|
|
1750
|
-
},
|
|
1751
|
-
credentials: "include",
|
|
1752
|
-
body: JSON.stringify({
|
|
1753
|
-
userId: w.userId,
|
|
1754
|
-
credential: T,
|
|
1755
|
-
deviceInfo: {
|
|
1756
|
-
userAgent: navigator.userAgent
|
|
1757
|
-
}
|
|
1758
|
-
})
|
|
125
|
+
const i = new URL(c.location.href);
|
|
126
|
+
if (d(`tick #${w}: popup URL readable → origin: ${i.origin}, pathname: ${i.pathname}`), i.origin !== window.location.origin)
|
|
127
|
+
return;
|
|
128
|
+
const a = i.searchParams.get("code"), f = i.searchParams.get("state");
|
|
129
|
+
if (d(`tick #${w}: same origin! code=${a}, state=${f}, expected_state=${r.state}`), !a || f !== r.state)
|
|
130
|
+
return;
|
|
131
|
+
p(void 0, a, {
|
|
132
|
+
authorizationStatus: i.searchParams.get("authorization_status") || void 0,
|
|
133
|
+
verificationStatus: i.searchParams.get("verification_status") || void 0,
|
|
134
|
+
grantedTier: i.searchParams.get("granted_tier") || void 0,
|
|
135
|
+
requiredTier: i.searchParams.get("required_tier") || void 0
|
|
1759
136
|
});
|
|
1760
|
-
|
|
1761
|
-
const B = await Y.json().catch(() => ({}));
|
|
1762
|
-
throw new Error(B.error || "Registration failed");
|
|
1763
|
-
}
|
|
1764
|
-
const W = await Y.json();
|
|
1765
|
-
if (W.success)
|
|
1766
|
-
I(!0), setTimeout(() => {
|
|
1767
|
-
n(W.user, W.business_token);
|
|
1768
|
-
}, 1e3);
|
|
1769
|
-
else
|
|
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));
|
|
1774
|
-
} finally {
|
|
1775
|
-
d(!1);
|
|
137
|
+
} catch {
|
|
1776
138
|
}
|
|
1777
|
-
}
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
className: "flex-1 flex flex-col px-8 pt-12",
|
|
1790
|
-
children: [
|
|
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) })
|
|
1794
|
-
] }),
|
|
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) }),
|
|
1797
|
-
/* @__PURE__ */ e("p", { className: "text-main font-semibold", children: r })
|
|
1798
|
-
] }),
|
|
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)) })
|
|
1805
|
-
] }),
|
|
1806
|
-
(c || o || D) && /* @__PURE__ */ i("div", { className: "flex-1 flex flex-col items-center justify-center py-4", children: [
|
|
1807
|
-
/* @__PURE__ */ e(
|
|
1808
|
-
P.div,
|
|
1809
|
-
{
|
|
1810
|
-
animate: c ? {
|
|
1811
|
-
scale: [1, 1.1, 1],
|
|
1812
|
-
opacity: [1, 0.7, 1]
|
|
1813
|
-
} : {},
|
|
1814
|
-
transition: {
|
|
1815
|
-
duration: 1.5,
|
|
1816
|
-
repeat: c ? 1 / 0 : 0,
|
|
1817
|
-
ease: "easeInOut"
|
|
1818
|
-
},
|
|
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" })
|
|
1821
|
-
}
|
|
1822
|
-
),
|
|
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 })
|
|
1825
|
-
] }),
|
|
1826
|
-
/* @__PURE__ */ i("div", { className: "mt-auto space-y-3 pb-8", children: [
|
|
1827
|
-
!o && /* @__PURE__ */ e(
|
|
1828
|
-
"button",
|
|
1829
|
-
{
|
|
1830
|
-
onClick: g,
|
|
1831
|
-
disabled: !A || c,
|
|
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",
|
|
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) })
|
|
1839
|
-
] })
|
|
1840
|
-
}
|
|
1841
|
-
),
|
|
1842
|
-
N && !c && !o && /* @__PURE__ */ e(
|
|
1843
|
-
"button",
|
|
1844
|
-
{
|
|
1845
|
-
onClick: N,
|
|
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",
|
|
1847
|
-
children: t("do_this_later", s)
|
|
1848
|
-
}
|
|
1849
|
-
)
|
|
1850
|
-
] }),
|
|
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) })
|
|
1854
|
-
] })
|
|
1855
|
-
]
|
|
1856
|
-
}
|
|
1857
|
-
);
|
|
1858
|
-
}, Jt = ({
|
|
1859
|
-
email: r,
|
|
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"
|
|
1867
|
-
}) => {
|
|
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);
|
|
1873
|
-
}
|
|
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;
|
|
1881
|
-
});
|
|
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] = "";
|
|
1888
|
-
break;
|
|
1889
|
-
}
|
|
1890
|
-
return C;
|
|
1891
|
-
});
|
|
1892
|
-
}, []);
|
|
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()));
|
|
139
|
+
}, 500), T = (o) => {
|
|
140
|
+
if (!(o.key !== v(r.state) || !o.newValue))
|
|
141
|
+
try {
|
|
142
|
+
const i = JSON.parse(o.newValue);
|
|
143
|
+
i.state === r.state && (i.error ? p(new Error(i.errorDescription || i.error)) : i.code && p(void 0, i.code, i));
|
|
144
|
+
} catch {
|
|
145
|
+
}
|
|
146
|
+
}, b = (o) => {
|
|
147
|
+
const i = D(r.state);
|
|
148
|
+
if (!i || o.origin !== i.accountOrigin || o.source !== c) return;
|
|
149
|
+
const a = o.data;
|
|
150
|
+
a.type !== "casperid:authorization" || a.state !== r.state || (a.error ? p(new Error(a.error_description || a.error)) : a.code && p(void 0, a.code, a));
|
|
1896
151
|
};
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
const b = s.join("");
|
|
1901
|
-
if (b.length !== 6) {
|
|
1902
|
-
o(t("error_pin_incomplete", m));
|
|
1903
|
-
return;
|
|
1904
|
-
}
|
|
1905
|
-
if (D(!0), o(""), f) {
|
|
1906
|
-
setTimeout(() => {
|
|
1907
|
-
D(!1), n("mock-session-token", null);
|
|
1908
|
-
}, 1e3);
|
|
1909
|
-
return;
|
|
1910
|
-
}
|
|
1911
|
-
try {
|
|
1912
|
-
const C = await fetch(`${N}/api/auth/verify-otp`, {
|
|
1913
|
-
method: "POST",
|
|
1914
|
-
headers: {
|
|
1915
|
-
"Content-Type": "application/json",
|
|
1916
|
-
"X-App-ID": p || ""
|
|
1917
|
-
},
|
|
1918
|
-
body: JSON.stringify({
|
|
1919
|
-
verificationId: k,
|
|
1920
|
-
otp: b
|
|
1921
|
-
})
|
|
1922
|
-
});
|
|
1923
|
-
if (!C.ok) {
|
|
1924
|
-
const L = await C.json().catch(() => ({}));
|
|
1925
|
-
throw new Error(L.error || `Verification failed with status ${C.status}`);
|
|
1926
|
-
}
|
|
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)));
|
|
1929
|
-
} catch {
|
|
1930
|
-
const S = t("error_verify_failed", m);
|
|
1931
|
-
o(S), c(["", "", "", "", "", ""]), l == null || l(S);
|
|
1932
|
-
} finally {
|
|
1933
|
-
D(!1);
|
|
1934
|
-
}
|
|
1935
|
-
}, W = async () => {
|
|
1936
|
-
if (!(I > 0 || h)) {
|
|
1937
|
-
if (A(!0), o(""), f) {
|
|
1938
|
-
setTimeout(() => {
|
|
1939
|
-
A(!1), g(60), c(["", "", "", "", "", ""]);
|
|
1940
|
-
}, 800);
|
|
152
|
+
function p(o, i, a = {}) {
|
|
153
|
+
if (h) {
|
|
154
|
+
d("finish called but already settled — skipping");
|
|
1941
155
|
return;
|
|
1942
156
|
}
|
|
157
|
+
d("finish called — error:", o == null ? void 0 : o.message, "code:", i), h = !0, g !== null && window.clearTimeout(g), window.clearInterval(C), window.removeEventListener("storage", T), window.removeEventListener("message", b);
|
|
1943
158
|
try {
|
|
1944
|
-
|
|
1945
|
-
method: "POST",
|
|
1946
|
-
headers: {
|
|
1947
|
-
"Content-Type": "application/json"
|
|
1948
|
-
},
|
|
1949
|
-
body: JSON.stringify({ verificationId: k })
|
|
1950
|
-
});
|
|
1951
|
-
if (!b.ok) {
|
|
1952
|
-
const S = await b.json().catch(() => ({}));
|
|
1953
|
-
throw new Error(S.error || `Request failed with status ${b.status}`);
|
|
1954
|
-
}
|
|
1955
|
-
const C = await b.json();
|
|
1956
|
-
C.success ? (g(60), c(["", "", "", "", "", ""])) : o(C.error || t("error_resend_failed", m));
|
|
159
|
+
c.close();
|
|
1957
160
|
} catch {
|
|
1958
|
-
|
|
1959
|
-
} finally {
|
|
1960
|
-
A(!1);
|
|
161
|
+
d("popup reference is inaccessible due to opener isolation");
|
|
1961
162
|
}
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
P.div,
|
|
1966
|
-
{
|
|
1967
|
-
initial: { opacity: 0, scale: 0.95 },
|
|
1968
|
-
animate: { opacity: 1, scale: 1 },
|
|
1969
|
-
exit: { opacity: 0, scale: 1.05 },
|
|
1970
|
-
className: "flex-1 flex flex-col px-8 pt-12",
|
|
1971
|
-
children: [
|
|
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),
|
|
1976
|
-
" ",
|
|
1977
|
-
/* @__PURE__ */ e("span", { className: "text-main font-semibold", children: B })
|
|
1978
|
-
] })
|
|
1979
|
-
] }),
|
|
1980
|
-
/* @__PURE__ */ e("div", { className: "flex justify-between gap-2 mb-6", children: s.map((b, C) => /* @__PURE__ */ i(
|
|
1981
|
-
"div",
|
|
1982
|
-
{
|
|
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" : ""}`,
|
|
1984
|
-
children: [
|
|
1985
|
-
b,
|
|
1986
|
-
!b && s.findIndex((S) => S === "") === C && /* @__PURE__ */ e("div", { className: "w-0.5 h-6 bg-brand animate-pulse" })
|
|
1987
|
-
]
|
|
1988
|
-
},
|
|
1989
|
-
C
|
|
1990
|
-
)) }),
|
|
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(
|
|
1994
|
-
"button",
|
|
1995
|
-
{
|
|
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
|
|
2000
|
-
},
|
|
2001
|
-
b
|
|
2002
|
-
)),
|
|
2003
|
-
/* @__PURE__ */ e("div", { className: "h-14" }),
|
|
2004
|
-
/* @__PURE__ */ e(
|
|
2005
|
-
"button",
|
|
2006
|
-
{
|
|
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",
|
|
2010
|
-
children: "0"
|
|
2011
|
-
}
|
|
2012
|
-
),
|
|
2013
|
-
/* @__PURE__ */ e(
|
|
2014
|
-
"button",
|
|
2015
|
-
{
|
|
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" })
|
|
2020
|
-
}
|
|
2021
|
-
)
|
|
2022
|
-
] }),
|
|
2023
|
-
/* @__PURE__ */ i("div", { className: "mt-auto pb-8 space-y-4", children: [
|
|
2024
|
-
/* @__PURE__ */ e(
|
|
2025
|
-
"button",
|
|
2026
|
-
{
|
|
2027
|
-
onClick: Y,
|
|
2028
|
-
disabled: d || s.some((b) => b === ""),
|
|
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",
|
|
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" })
|
|
2036
|
-
] })
|
|
2037
|
-
}
|
|
2038
|
-
),
|
|
2039
|
-
/* @__PURE__ */ e(
|
|
2040
|
-
"button",
|
|
2041
|
-
{
|
|
2042
|
-
onClick: W,
|
|
2043
|
-
disabled: I > 0 || h,
|
|
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",
|
|
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),
|
|
2050
|
-
" (",
|
|
2051
|
-
I,
|
|
2052
|
-
"s)"
|
|
2053
|
-
] }) : /* @__PURE__ */ i(re, { children: [
|
|
2054
|
-
/* @__PURE__ */ e(Te, { className: "w-4 h-4" }),
|
|
2055
|
-
/* @__PURE__ */ e("span", { children: t("resend_code", m) })
|
|
2056
|
-
] })
|
|
2057
|
-
}
|
|
2058
|
-
)
|
|
2059
|
-
] })
|
|
2060
|
-
]
|
|
2061
|
-
}
|
|
2062
|
-
);
|
|
2063
|
-
}, Kt = ({ onNext: r, onSkip: a, language: n = "EN" }) => /* @__PURE__ */ i(
|
|
2064
|
-
P.div,
|
|
2065
|
-
{
|
|
2066
|
-
initial: { opacity: 0 },
|
|
2067
|
-
animate: { opacity: 1 },
|
|
2068
|
-
exit: { opacity: 0 },
|
|
2069
|
-
className: "flex-1 flex flex-col",
|
|
2070
|
-
children: [
|
|
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) })
|
|
2075
|
-
] }),
|
|
2076
|
-
/* @__PURE__ */ e("div", { className: "w-full bg-brand-10 h-1.5 rounded-full overflow-hidden", children: /* @__PURE__ */ e(
|
|
2077
|
-
"div",
|
|
2078
|
-
{
|
|
2079
|
-
className: "bg-brand h-full rounded-full",
|
|
2080
|
-
style: { width: "40%" }
|
|
2081
|
-
}
|
|
2082
|
-
) })
|
|
2083
|
-
] }),
|
|
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: [
|
|
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" }),
|
|
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" }) })
|
|
2089
|
-
] }),
|
|
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) })
|
|
2093
|
-
] }),
|
|
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) })
|
|
2097
|
-
] })
|
|
2098
|
-
] }),
|
|
2099
|
-
/* @__PURE__ */ i("div", { className: "p-8 space-y-4", children: [
|
|
2100
|
-
/* @__PURE__ */ e(
|
|
2101
|
-
"button",
|
|
2102
|
-
{
|
|
2103
|
-
onClick: r,
|
|
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]",
|
|
2105
|
-
children: t("start_upgrade", n)
|
|
2106
|
-
}
|
|
2107
|
-
),
|
|
2108
|
-
a && /* @__PURE__ */ e(
|
|
2109
|
-
"button",
|
|
2110
|
-
{
|
|
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)
|
|
2114
|
-
}
|
|
2115
|
-
)
|
|
2116
|
-
] })
|
|
2117
|
-
]
|
|
2118
|
-
}
|
|
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 = ({
|
|
2126
|
-
requestId: r,
|
|
2127
|
-
onNext: a,
|
|
2128
|
-
onError: n,
|
|
2129
|
-
apiBaseUrl: l = "https://apis.casperid.com",
|
|
2130
|
-
apiKey: N = "",
|
|
2131
|
-
previewMode: p = !1,
|
|
2132
|
-
language: f = "EN"
|
|
2133
|
-
}) => {
|
|
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 () => {
|
|
2144
|
-
try {
|
|
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}`
|
|
2147
|
-
});
|
|
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");
|
|
2165
|
-
}
|
|
2166
|
-
})(), () => {
|
|
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) {
|
|
2206
|
-
setTimeout(() => {
|
|
2207
|
-
w(!1), a(!0);
|
|
2208
|
-
}, 2e3);
|
|
2209
|
-
return;
|
|
2210
|
-
}
|
|
2211
|
-
try {
|
|
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, {
|
|
2228
|
-
method: "POST",
|
|
2229
|
-
headers: {
|
|
2230
|
-
...N ? { "X-App-Id": N } : {}
|
|
2231
|
-
},
|
|
2232
|
-
body: z,
|
|
2233
|
-
credentials: "include"
|
|
2234
|
-
});
|
|
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;
|
|
163
|
+
if (o) {
|
|
164
|
+
S(r.state), I(r.state), m(r.state), d("rejecting with:", o.message), l(o);
|
|
165
|
+
return;
|
|
2245
166
|
}
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
k(""), ue(0), te(0), q(0), d.current = [], w(!1), de.current = !1;
|
|
2251
|
-
};
|
|
2252
|
-
return T ? /* @__PURE__ */ i(
|
|
2253
|
-
P.div,
|
|
2254
|
-
{
|
|
2255
|
-
initial: { opacity: 0 },
|
|
2256
|
-
animate: { opacity: 1 },
|
|
2257
|
-
className: "flex-1 flex flex-col items-center justify-center px-8 text-center bg-black",
|
|
2258
|
-
children: [
|
|
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." }),
|
|
2262
|
-
/* @__PURE__ */ e(
|
|
2263
|
-
"button",
|
|
2264
|
-
{
|
|
2265
|
-
onClick: () => window.location.reload(),
|
|
2266
|
-
className: "px-6 py-3 bg-[#8651e1] text-white rounded-2xl font-bold",
|
|
2267
|
-
children: "Try Again"
|
|
2268
|
-
}
|
|
2269
|
-
)
|
|
2270
|
-
]
|
|
2271
|
-
}
|
|
2272
|
-
) : /* @__PURE__ */ i(
|
|
2273
|
-
P.div,
|
|
2274
|
-
{
|
|
2275
|
-
initial: { opacity: 0 },
|
|
2276
|
-
animate: { opacity: 1 },
|
|
2277
|
-
exit: { opacity: 0 },
|
|
2278
|
-
className: "flex-1 flex flex-col relative bg-black overflow-hidden",
|
|
2279
|
-
children: [
|
|
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: [
|
|
2292
|
-
/* @__PURE__ */ e(
|
|
2293
|
-
"canvas",
|
|
2294
|
-
{
|
|
2295
|
-
ref: s,
|
|
2296
|
-
width: 640,
|
|
2297
|
-
height: 480,
|
|
2298
|
-
className: "w-full h-full object-cover"
|
|
2299
|
-
}
|
|
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" })
|
|
2303
|
-
] }),
|
|
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,
|
|
2316
|
-
{
|
|
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 }
|
|
2324
|
-
},
|
|
2325
|
-
M
|
|
2326
|
-
)) }),
|
|
2327
|
-
/* @__PURE__ */ i("div", { className: "absolute -inset-6 z-40", children: [
|
|
2328
|
-
/* @__PURE__ */ e(
|
|
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,
|
|
2338
|
-
{
|
|
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]"
|
|
2342
|
-
}
|
|
2343
|
-
),
|
|
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..." })
|
|
2425
|
-
] })
|
|
2426
|
-
] })
|
|
2427
|
-
]
|
|
2428
|
-
}
|
|
2429
|
-
);
|
|
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,
|
|
2436
|
-
{
|
|
2437
|
-
initial: { opacity: 0, x: 20 },
|
|
2438
|
-
animate: { opacity: 1, x: 0 },
|
|
2439
|
-
exit: { opacity: 0, x: -20 },
|
|
2440
|
-
className: "flex-1 px-6 pt-4 flex flex-col",
|
|
2441
|
-
children: [
|
|
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(
|
|
2446
|
-
"button",
|
|
2447
|
-
{
|
|
2448
|
-
onClick: () => r(n),
|
|
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",
|
|
2450
|
-
children: [
|
|
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) })
|
|
2455
|
-
] }),
|
|
2456
|
-
/* @__PURE__ */ e(Le, { className: "text-brand w-5 h-5" })
|
|
2457
|
-
]
|
|
2458
|
-
},
|
|
2459
|
-
n
|
|
2460
|
-
)),
|
|
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: [
|
|
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" }),
|
|
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" }),
|
|
2465
|
-
/* @__PURE__ */ e("p", { className: "text-[10px] text-muted uppercase tracking-tighter font-bold", children: "Encrypted E2E" })
|
|
2466
|
-
] })
|
|
2467
|
-
] })
|
|
2468
|
-
] })
|
|
2469
|
-
]
|
|
2470
|
-
}
|
|
2471
|
-
), ei = (r) => ({
|
|
2472
|
-
passport: t("passport", r),
|
|
2473
|
-
drivers_license: t("drivers_license", r),
|
|
2474
|
-
national_id: t("national_id", r)
|
|
2475
|
-
}), ti = ({
|
|
2476
|
-
requestId: r,
|
|
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"
|
|
2484
|
-
}) => {
|
|
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 () => {
|
|
2487
|
-
try {
|
|
2488
|
-
const O = await navigator.mediaDevices.getUserMedia({
|
|
2489
|
-
video: {
|
|
2490
|
-
facingMode: "environment",
|
|
2491
|
-
// Use back camera for documents
|
|
2492
|
-
width: { ideal: 1280 },
|
|
2493
|
-
height: { ideal: 720 }
|
|
2494
|
-
}
|
|
2495
|
-
});
|
|
2496
|
-
d.current = O, s.current && (s.current.srcObject = O, s.current.onloadedmetadata = () => {
|
|
2497
|
-
h(!0);
|
|
2498
|
-
});
|
|
2499
|
-
} catch {
|
|
2500
|
-
try {
|
|
2501
|
-
const F = await navigator.mediaDevices.getUserMedia({
|
|
2502
|
-
video: { facingMode: "user", width: { ideal: 1280 }, height: { ideal: 720 } }
|
|
2503
|
-
});
|
|
2504
|
-
d.current = F, s.current && (s.current.srcObject = F, s.current.onloadedmetadata = () => {
|
|
2505
|
-
h(!0);
|
|
2506
|
-
});
|
|
2507
|
-
} catch {
|
|
2508
|
-
w(t("unable_access_camera", m)), l == null || l("Camera access failed");
|
|
167
|
+
const f = S(r.state);
|
|
168
|
+
if (!f || !i) {
|
|
169
|
+
d("transaction missing or no code — rejecting"), I(r.state), m(r.state), l(new Error("CasperID authorization transaction is missing."));
|
|
170
|
+
return;
|
|
2509
171
|
}
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
}, "image/jpeg", 0.9));
|
|
2520
|
-
}, C = () => {
|
|
2521
|
-
o && URL.revokeObjectURL(o), _(null), I(null), w("");
|
|
2522
|
-
}, S = async () => {
|
|
2523
|
-
if (k(!0), f) {
|
|
2524
|
-
setTimeout(() => {
|
|
2525
|
-
k(!1), n({
|
|
2526
|
-
first_name: "JOHN",
|
|
2527
|
-
last_name: "DOE",
|
|
2528
|
-
date_of_birth: "01 JAN 1990",
|
|
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
|
-
});
|
|
2536
|
-
}, 2e3);
|
|
2537
|
-
return;
|
|
2538
|
-
}
|
|
2539
|
-
if (!A) {
|
|
2540
|
-
k(!1);
|
|
2541
|
-
return;
|
|
2542
|
-
}
|
|
2543
|
-
if (T === "front" && a !== "passport") {
|
|
2544
|
-
B(A), _(null), I(null), Y("back"), k(!1);
|
|
2545
|
-
return;
|
|
2546
|
-
}
|
|
2547
|
-
k(!0), w("");
|
|
2548
|
-
try {
|
|
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`, {
|
|
2552
|
-
method: "POST",
|
|
2553
|
-
body: L,
|
|
2554
|
-
credentials: "include",
|
|
2555
|
-
headers: {
|
|
2556
|
-
"X-Request-Id": r,
|
|
2557
|
-
...p ? { "X-App-Id": p } : {}
|
|
2558
|
-
}
|
|
172
|
+
I(r.state), m(r.state), d("resolving successfully"), u({
|
|
173
|
+
code: i,
|
|
174
|
+
state: f.state,
|
|
175
|
+
codeVerifier: f.codeVerifier,
|
|
176
|
+
redirectUri: f.redirectUri,
|
|
177
|
+
authorizationStatus: a.authorizationStatus,
|
|
178
|
+
verificationStatus: a.verificationStatus,
|
|
179
|
+
grantedTier: a.grantedTier,
|
|
180
|
+
requiredTier: a.requiredTier
|
|
2559
181
|
});
|
|
2560
|
-
if (!O.ok) {
|
|
2561
|
-
const G = await O.json().catch(() => ({}));
|
|
2562
|
-
throw new Error(G.error || `Document upload failed with status ${O.status}`);
|
|
2563
|
-
}
|
|
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));
|
|
2571
|
-
} catch {
|
|
2572
|
-
w("Upload failed. Please try again."), k(!1), l == null || l("Document upload failed");
|
|
2573
182
|
}
|
|
183
|
+
window.addEventListener("storage", T), window.addEventListener("message", b);
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
function G(e = window.location.href) {
|
|
187
|
+
const t = new URL(e), r = t.searchParams.get("code"), n = t.searchParams.get("state"), s = t.searchParams.get("error"), c = t.searchParams.get("error_description"), u = {
|
|
188
|
+
authorizationStatus: t.searchParams.get("authorization_status") || void 0,
|
|
189
|
+
verificationStatus: t.searchParams.get("verification_status") || void 0,
|
|
190
|
+
grantedTier: t.searchParams.get("granted_tier") || void 0,
|
|
191
|
+
requiredTier: t.searchParams.get("required_tier") || void 0
|
|
2574
192
|
};
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
o ? /* @__PURE__ */ e(
|
|
2591
|
-
"img",
|
|
2592
|
-
{
|
|
2593
|
-
src: o,
|
|
2594
|
-
alt: "Captured document",
|
|
2595
|
-
className: "absolute inset-0 w-full h-full object-cover rounded-2xl"
|
|
2596
|
-
}
|
|
2597
|
-
) : /* @__PURE__ */ e(
|
|
2598
|
-
"video",
|
|
2599
|
-
{
|
|
2600
|
-
ref: s,
|
|
2601
|
-
autoPlay: !0,
|
|
2602
|
-
playsInline: !0,
|
|
2603
|
-
muted: !0,
|
|
2604
|
-
className: "absolute inset-0 w-full h-full object-cover rounded-2xl"
|
|
2605
|
-
}
|
|
2606
|
-
),
|
|
2607
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-0 border border-[#6DE8EC] rounded-2xl shadow-[0_0_20px_rgba(109,232,236,0.3),inset_0_0_15px_rgba(109,232,236,0.2)]" }),
|
|
2608
|
-
/* @__PURE__ */ e("div", { className: "absolute top-0 left-0 w-8 h-8 border-t-4 border-l-4 border-[#6DE8EC] rounded-tl-2xl" }),
|
|
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" }),
|
|
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" }),
|
|
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" }),
|
|
2612
|
-
!o && D && /* @__PURE__ */ e(
|
|
2613
|
-
P.div,
|
|
2614
|
-
{
|
|
2615
|
-
animate: { top: ["0%", "100%", "0%"] },
|
|
2616
|
-
transition: { duration: 4, repeat: 1 / 0, ease: "linear" },
|
|
2617
|
-
className: "absolute left-0 w-full h-[2px] bg-gradient-to-r from-transparent via-[#6DE8EC] to-transparent opacity-50"
|
|
2618
|
-
}
|
|
2619
|
-
),
|
|
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" }) })
|
|
2621
|
-
] }) }),
|
|
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 })
|
|
2625
|
-
] }),
|
|
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: [
|
|
2629
|
-
/* @__PURE__ */ e(
|
|
2630
|
-
"button",
|
|
2631
|
-
{
|
|
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" })
|
|
2636
|
-
}
|
|
2637
|
-
),
|
|
2638
|
-
/* @__PURE__ */ e(
|
|
2639
|
-
"button",
|
|
2640
|
-
{
|
|
2641
|
-
onClick: S,
|
|
2642
|
-
disabled: g,
|
|
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",
|
|
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) })
|
|
2648
|
-
}
|
|
2649
|
-
),
|
|
2650
|
-
/* @__PURE__ */ e("div", { className: "w-12 h-12" }),
|
|
2651
|
-
" "
|
|
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(
|
|
2655
|
-
"button",
|
|
2656
|
-
{
|
|
2657
|
-
onClick: b,
|
|
2658
|
-
disabled: !D,
|
|
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",
|
|
2660
|
-
children: [
|
|
2661
|
-
/* @__PURE__ */ e(wt, { className: "w-6 h-6" }),
|
|
2662
|
-
/* @__PURE__ */ e("span", { children: t("capture", m) })
|
|
2663
|
-
]
|
|
2664
|
-
}
|
|
2665
|
-
),
|
|
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" }) })
|
|
2667
|
-
] }) }),
|
|
2668
|
-
/* @__PURE__ */ e("div", { className: "w-32 h-1.5 bg-brand-10 rounded-full mx-auto mt-8" })
|
|
2669
|
-
] })
|
|
2670
|
-
]
|
|
2671
|
-
}
|
|
2672
|
-
);
|
|
2673
|
-
}, ii = ({
|
|
2674
|
-
requestId: r,
|
|
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"
|
|
2689
|
-
}) => {
|
|
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", _));
|
|
2702
|
-
return;
|
|
2703
|
-
}
|
|
2704
|
-
if (k(!0), w(""), A) {
|
|
2705
|
-
setTimeout(() => {
|
|
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
|
|
2714
|
-
});
|
|
2715
|
-
}, 1500);
|
|
2716
|
-
return;
|
|
2717
|
-
}
|
|
2718
|
-
try {
|
|
2719
|
-
const b = await fetch(`${D}/api/v2/verification/layer3/submit`, {
|
|
2720
|
-
method: "POST",
|
|
2721
|
-
headers: {
|
|
2722
|
-
"Content-Type": "application/json",
|
|
2723
|
-
...h ? { "X-App-Id": h } : {}
|
|
2724
|
-
},
|
|
2725
|
-
credentials: "include",
|
|
2726
|
-
body: JSON.stringify({
|
|
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
|
|
2734
|
-
document_data: {
|
|
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
|
|
2742
|
-
}
|
|
2743
|
-
})
|
|
2744
|
-
});
|
|
2745
|
-
if (!b.ok) {
|
|
2746
|
-
const S = await b.json().catch(() => ({}));
|
|
2747
|
-
throw new Error(S.error || `Data submission failed with status ${b.status}`);
|
|
2748
|
-
}
|
|
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));
|
|
2759
|
-
} catch {
|
|
2760
|
-
w("Failed to submit data. Please try again."), k(!1), d == null || d("Data submission failed");
|
|
2761
|
-
}
|
|
2762
|
-
}, W = n.confidence || 0, B = Math.round(W);
|
|
2763
|
-
return /* @__PURE__ */ i(
|
|
2764
|
-
P.div,
|
|
2765
|
-
{
|
|
2766
|
-
initial: { opacity: 0, y: 20 },
|
|
2767
|
-
animate: { opacity: 1, y: 0 },
|
|
2768
|
-
exit: { opacity: 0, y: -20 },
|
|
2769
|
-
className: "flex-1 overflow-y-auto px-6 pb-6",
|
|
2770
|
-
children: [
|
|
2771
|
-
/* @__PURE__ */ e("div", { className: "flex gap-1 mb-6", children: [1, 2, 3, 0].map((b, C) => /* @__PURE__ */ e(
|
|
2772
|
-
"div",
|
|
2773
|
-
{
|
|
2774
|
-
className: `h-1 flex-1 rounded-xl ${b ? "bg-brand" : "bg-brand/20"}`
|
|
2775
|
-
},
|
|
2776
|
-
C
|
|
2777
|
-
)) }),
|
|
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", _) })
|
|
2781
|
-
] }),
|
|
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,
|
|
2787
|
-
"%"
|
|
2788
|
-
] })
|
|
2789
|
-
] }),
|
|
2790
|
-
/* @__PURE__ */ e("div", { className: "w-full h-1.5 bg-brand-10 rounded-full overflow-hidden", children: /* @__PURE__ */ e(
|
|
2791
|
-
"div",
|
|
2792
|
-
{
|
|
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}%` }
|
|
2795
|
-
}
|
|
2796
|
-
) }),
|
|
2797
|
-
B < 80 && /* @__PURE__ */ e("p", { className: "text-[10px] text-yellow-500 mt-2", children: t("verify_data_carefully", _) })
|
|
2798
|
-
] }),
|
|
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 })
|
|
2802
|
-
] }),
|
|
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(
|
|
2824
|
-
"input",
|
|
2825
|
-
{
|
|
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",
|
|
2827
|
-
type: "text",
|
|
2828
|
-
value: o.lastName,
|
|
2829
|
-
onChange: (b) => T("lastName", b.target.value),
|
|
2830
|
-
placeholder: t("enter_last_name", _) || "Last name"
|
|
2831
|
-
}
|
|
2832
|
-
) }) })
|
|
2833
|
-
] })
|
|
2834
|
-
] }),
|
|
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" }),
|
|
2839
|
-
/* @__PURE__ */ e(
|
|
2840
|
-
"input",
|
|
2841
|
-
{
|
|
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",
|
|
2843
|
-
type: "text",
|
|
2844
|
-
value: o.documentNumber,
|
|
2845
|
-
onChange: (b) => T("documentNumber", b.target.value),
|
|
2846
|
-
placeholder: t("enter_doc_number", _)
|
|
2847
|
-
}
|
|
2848
|
-
)
|
|
2849
|
-
] })
|
|
2850
|
-
] }),
|
|
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" }),
|
|
2855
|
-
/* @__PURE__ */ e(
|
|
2856
|
-
"input",
|
|
2857
|
-
{
|
|
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",
|
|
2859
|
-
type: "text",
|
|
2860
|
-
value: o.dateOfBirth,
|
|
2861
|
-
onChange: (b) => T("dateOfBirth", b.target.value),
|
|
2862
|
-
placeholder: t("date_format", _)
|
|
2863
|
-
}
|
|
2864
|
-
)
|
|
2865
|
-
] })
|
|
2866
|
-
] }),
|
|
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" }),
|
|
2871
|
-
/* @__PURE__ */ e(
|
|
2872
|
-
"input",
|
|
2873
|
-
{
|
|
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",
|
|
2875
|
-
type: "text",
|
|
2876
|
-
value: o.nationality,
|
|
2877
|
-
onChange: (b) => T("nationality", b.target.value),
|
|
2878
|
-
placeholder: t("enter_nationality", _)
|
|
2879
|
-
}
|
|
2880
|
-
)
|
|
2881
|
-
] })
|
|
2882
|
-
] }),
|
|
2883
|
-
/* @__PURE__ */ i("div", { className: "mt-8 relative h-32 w-full rounded-2xl overflow-hidden border border-brand-20 group", children: [
|
|
2884
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-0 bg-gradient-to-tr from-brand-20 to-cyan-500/10 blur-sm" }),
|
|
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", _) })
|
|
2889
|
-
] }),
|
|
2890
|
-
c && /* @__PURE__ */ e(
|
|
2891
|
-
"button",
|
|
2892
|
-
{
|
|
2893
|
-
onClick: c,
|
|
2894
|
-
className: "mt-2 text-[10px] text-brand underline font-medium",
|
|
2895
|
-
type: "button",
|
|
2896
|
-
children: t("retake_photo", _)
|
|
2897
|
-
}
|
|
2898
|
-
)
|
|
2899
|
-
] })
|
|
2900
|
-
] })
|
|
2901
|
-
] }),
|
|
2902
|
-
/* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
2903
|
-
/* @__PURE__ */ e(
|
|
2904
|
-
"button",
|
|
2905
|
-
{
|
|
2906
|
-
onClick: Y,
|
|
2907
|
-
disabled: g,
|
|
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",
|
|
2909
|
-
children: g ? /* @__PURE__ */ i(re, { children: [
|
|
2910
|
-
/* @__PURE__ */ e("div", { className: "w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin" }),
|
|
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" })
|
|
2915
|
-
] })
|
|
2916
|
-
}
|
|
2917
|
-
),
|
|
2918
|
-
/* @__PURE__ */ e("p", { className: "text-center text-[10px] mt-4 text-muted", children: t("secured_by_casper", _) })
|
|
2919
|
-
] })
|
|
2920
|
-
]
|
|
2921
|
-
}
|
|
2922
|
-
);
|
|
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" ? {
|
|
2941
|
-
processing: {
|
|
2942
|
-
title: t("processing_liveness", a),
|
|
2943
|
-
subtitle: t("processing_subtitle", a)
|
|
2944
|
-
},
|
|
2945
|
-
minting: {
|
|
2946
|
-
title: t("minting_identity", a),
|
|
2947
|
-
subtitle: t("minting_subtitle", a)
|
|
2948
|
-
},
|
|
2949
|
-
completed: {
|
|
2950
|
-
title: t("identity_verified", a),
|
|
2951
|
-
subtitle: t("identity_verified_subtitle", a)
|
|
2952
|
-
},
|
|
2953
|
-
failed: {
|
|
2954
|
-
title: t("verification_failed", a),
|
|
2955
|
-
subtitle: t("verification_failed_subtitle", a)
|
|
2956
|
-
}
|
|
2957
|
-
} : {
|
|
2958
|
-
processing: {
|
|
2959
|
-
title: t("processing_documents", a),
|
|
2960
|
-
subtitle: t("processing_subtitle", a)
|
|
2961
|
-
},
|
|
2962
|
-
minting: {
|
|
2963
|
-
title: t("submitting_for_review", a),
|
|
2964
|
-
subtitle: t("submitting_review_subtitle", a)
|
|
2965
|
-
},
|
|
2966
|
-
completed: {
|
|
2967
|
-
title: t("verification_submitted", a),
|
|
2968
|
-
subtitle: t("verification_submitted_subtitle", a)
|
|
2969
|
-
},
|
|
2970
|
-
failed: {
|
|
2971
|
-
title: t("verification_failed", a),
|
|
2972
|
-
subtitle: t("verification_failed_subtitle", a)
|
|
2973
|
-
}
|
|
2974
|
-
}, ri = ({
|
|
2975
|
-
tier: r,
|
|
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"
|
|
2984
|
-
}) => {
|
|
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());
|
|
2988
|
-
}, []);
|
|
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({
|
|
2991
|
-
wallet: "account-hash-abc123...",
|
|
2992
|
-
didAddress: "did:casper:abc123...",
|
|
2993
|
-
credentialHash: "mock-credential-hash-xyz"
|
|
2994
|
-
});
|
|
2995
|
-
}, S = async () => {
|
|
2996
|
-
try {
|
|
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);
|
|
3001
|
-
}
|
|
3002
|
-
}, L = async () => {
|
|
3003
|
-
var me;
|
|
3004
|
-
d("processing"), h(10);
|
|
3005
|
-
const ie = await fetch(`${p}/api/passkey/wallet/generate`, {
|
|
3006
|
-
method: "POST",
|
|
3007
|
-
headers: {
|
|
3008
|
-
"Content-Type": "application/json",
|
|
3009
|
-
Authorization: `Bearer ${a}`,
|
|
3010
|
-
...f ? { "X-App-Id": f } : {}
|
|
3011
|
-
},
|
|
3012
|
-
credentials: "include"
|
|
3013
|
-
});
|
|
3014
|
-
if (!ie.ok) {
|
|
3015
|
-
const ee = await ie.json().catch(() => ({}));
|
|
3016
|
-
throw new Error(ee.error || "Failed to generate wallet");
|
|
3017
|
-
}
|
|
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`, {
|
|
3023
|
-
method: "POST",
|
|
3024
|
-
headers: {
|
|
3025
|
-
"Content-Type": "application/json",
|
|
3026
|
-
Authorization: `Bearer ${a}`,
|
|
3027
|
-
...f ? { "X-App-Id": f } : {}
|
|
3028
|
-
},
|
|
3029
|
-
credentials: "include"
|
|
3030
|
-
});
|
|
3031
|
-
if (!pe.ok) {
|
|
3032
|
-
const ee = await pe.json().catch(() => ({}));
|
|
3033
|
-
throw new Error(ee.error || "Failed to mint DID");
|
|
3034
|
-
}
|
|
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
|
|
3042
|
-
});
|
|
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 = () => {
|
|
3083
|
-
if (r === "layer_1") {
|
|
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);
|
|
3087
|
-
} else {
|
|
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);
|
|
3091
|
-
}
|
|
3092
|
-
return "";
|
|
193
|
+
if (!r && !s || !n) return null;
|
|
194
|
+
const l = S(n);
|
|
195
|
+
if (!l) throw new Error("CasperID authorization state is invalid or expired.");
|
|
196
|
+
if (window.opener || B(n))
|
|
197
|
+
return d("popup callback detected; publishing result for opener"), H({ code: r || void 0, state: n, error: s || void 0, errorDescription: c || void 0, ...u }), m(n), window.close(), null;
|
|
198
|
+
if (s) throw new Error(c || s);
|
|
199
|
+
return {
|
|
200
|
+
code: r,
|
|
201
|
+
state: n,
|
|
202
|
+
codeVerifier: l.codeVerifier,
|
|
203
|
+
redirectUri: l.redirectUri,
|
|
204
|
+
authorizationStatus: u.authorizationStatus,
|
|
205
|
+
verificationStatus: u.verificationStatus,
|
|
206
|
+
grantedTier: u.grantedTier,
|
|
207
|
+
requiredTier: u.requiredTier
|
|
3093
208
|
};
|
|
3094
|
-
return /* @__PURE__ */ i(
|
|
3095
|
-
P.div,
|
|
3096
|
-
{
|
|
3097
|
-
initial: { opacity: 0 },
|
|
3098
|
-
animate: { opacity: 1 },
|
|
3099
|
-
exit: { opacity: 0 },
|
|
3100
|
-
className: "flex-1 flex flex-col items-center justify-center px-8 text-center",
|
|
3101
|
-
children: [
|
|
3102
|
-
/* @__PURE__ */ i("div", { className: "relative w-64 h-64 flex items-center justify-center mb-12", children: [
|
|
3103
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-0 rounded-full border-4 border-dashed border-brand-20 animate-[spin_10s_linear_infinite]" }),
|
|
3104
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-4 rounded-full border-2 border-[#6DE8EC]/20 animate-[spin_6s_linear_infinite_reverse]" }),
|
|
3105
|
-
/* @__PURE__ */ i(
|
|
3106
|
-
P.div,
|
|
3107
|
-
{
|
|
3108
|
-
animate: c !== "failed" ? { rotateY: [0, 180, 360], y: [-10, 10, -10] } : {},
|
|
3109
|
-
transition: { duration: 6, repeat: 1 / 0, ease: "easeInOut" },
|
|
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)]"}`,
|
|
3111
|
-
children: [
|
|
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"}` })
|
|
3115
|
-
] }),
|
|
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"}` })
|
|
3119
|
-
] }),
|
|
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,
|
|
3125
|
-
{
|
|
3126
|
-
initial: { opacity: 0 },
|
|
3127
|
-
animate: { opacity: 1 },
|
|
3128
|
-
className: "text-[10px] font-bold text-slate-800 dark:text-white/90 truncate w-full text-left",
|
|
3129
|
-
children: T
|
|
3130
|
-
}
|
|
3131
|
-
) : /* @__PURE__ */ e("div", { className: "h-1.5 w-12 bg-white/20 rounded-full mb-1" }),
|
|
3132
|
-
/* @__PURE__ */ e("div", { className: "h-1 w-8 bg-slate-200 dark:bg-white/10 rounded-full" })
|
|
3133
|
-
] })
|
|
3134
|
-
] }),
|
|
3135
|
-
c !== "failed" && c !== "completed" && /* @__PURE__ */ e(
|
|
3136
|
-
P.div,
|
|
3137
|
-
{
|
|
3138
|
-
animate: { top: ["0%", "100%", "0%"] },
|
|
3139
|
-
transition: { duration: 2, repeat: 1 / 0 },
|
|
3140
|
-
className: "absolute inset-0 bg-gradient-to-b from-transparent via-brand-10 to-transparent h-1/2 w-full"
|
|
3141
|
-
}
|
|
3142
|
-
)
|
|
3143
|
-
]
|
|
3144
|
-
}
|
|
3145
|
-
)
|
|
3146
|
-
] }),
|
|
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 })
|
|
3150
|
-
] }),
|
|
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 }),
|
|
3153
|
-
/* @__PURE__ */ e(
|
|
3154
|
-
"button",
|
|
3155
|
-
{
|
|
3156
|
-
onClick: de,
|
|
3157
|
-
className: "px-6 py-3 bg-brand text-white rounded-2xl font-bold",
|
|
3158
|
-
children: t("try_again", s)
|
|
3159
|
-
}
|
|
3160
|
-
)
|
|
3161
|
-
] }),
|
|
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),
|
|
3166
|
-
"...",
|
|
3167
|
-
o.slice(-10)
|
|
3168
|
-
] })
|
|
3169
|
-
] }),
|
|
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),
|
|
3174
|
-
"..."
|
|
3175
|
-
] })
|
|
3176
|
-
] }),
|
|
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()) })
|
|
3181
|
-
] }),
|
|
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(
|
|
3183
|
-
P.div,
|
|
3184
|
-
{
|
|
3185
|
-
initial: { width: "0%" },
|
|
3186
|
-
animate: { width: `${D}%` },
|
|
3187
|
-
transition: { duration: 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)]`
|
|
3189
|
-
}
|
|
3190
|
-
) }),
|
|
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() })
|
|
3194
|
-
] })
|
|
3195
|
-
] })
|
|
3196
|
-
]
|
|
3197
|
-
}
|
|
3198
|
-
);
|
|
3199
|
-
}, ni = ({ onNext: r, language: a = "EN" }) => /* @__PURE__ */ i(
|
|
3200
|
-
P.div,
|
|
3201
|
-
{
|
|
3202
|
-
initial: { opacity: 0, scale: 0.9 },
|
|
3203
|
-
animate: { opacity: 1, scale: 1 },
|
|
3204
|
-
exit: { opacity: 0, scale: 1.1 },
|
|
3205
|
-
className: "flex-1 flex flex-col items-center justify-center px-8 text-center",
|
|
3206
|
-
children: [
|
|
3207
|
-
/* @__PURE__ */ i("div", { className: "relative mb-10 group", children: [
|
|
3208
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-0 bg-[#6fe8ec]/30 rounded-3xl blur-3xl group-hover:blur-2xl transition-all" }),
|
|
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" }) })
|
|
3210
|
-
] }),
|
|
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) })
|
|
3217
|
-
] }),
|
|
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" }) })
|
|
3219
|
-
] }),
|
|
3220
|
-
/* @__PURE__ */ i(
|
|
3221
|
-
"button",
|
|
3222
|
-
{
|
|
3223
|
-
onClick: r,
|
|
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",
|
|
3225
|
-
children: [
|
|
3226
|
-
t("return_to_app", a),
|
|
3227
|
-
/* @__PURE__ */ e(Oe, { className: "w-5 h-5" })
|
|
3228
|
-
]
|
|
3229
|
-
}
|
|
3230
|
-
)
|
|
3231
|
-
]
|
|
3232
|
-
}
|
|
3233
|
-
), si = [
|
|
3234
|
-
"verify:identity",
|
|
3235
|
-
"read:profile",
|
|
3236
|
-
"read:kyc_level"
|
|
3237
|
-
], ci = ({
|
|
3238
|
-
appName: r = "This App",
|
|
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() }) })
|
|
3258
|
-
] }),
|
|
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
|
-
)
|
|
3309
|
-
] })
|
|
3310
|
-
]
|
|
3311
|
-
}
|
|
3312
|
-
);
|
|
3313
|
-
};
|
|
3314
|
-
function Ge(r = "light") {
|
|
3315
|
-
return r === "system" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : r;
|
|
3316
209
|
}
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
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
|
|
3338
|
-
}) => {
|
|
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({
|
|
3350
|
-
email: "",
|
|
3351
|
-
userExists: !1,
|
|
3352
|
-
hasPasskey: !1,
|
|
3353
|
-
userAccount: null
|
|
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;
|
|
3364
|
-
}
|
|
3365
|
-
`;
|
|
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);
|
|
3370
|
-
} else
|
|
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);
|
|
3379
|
-
return;
|
|
3380
|
-
}
|
|
3381
|
-
(async () => {
|
|
3382
|
-
try {
|
|
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
|
|
3392
|
-
}));
|
|
3393
|
-
}
|
|
3394
|
-
} catch (x) {
|
|
3395
|
-
console.warn("[CasperID] Failed to fetch app metadata:", x);
|
|
3396
|
-
} finally {
|
|
3397
|
-
w(!1);
|
|
3398
|
-
}
|
|
3399
|
-
})();
|
|
3400
|
-
}, [a, H, s]);
|
|
3401
|
-
const Ue = () => ue((u) => u === "dark" ? "light" : "dark"), R = J((u) => ie(u), []), ze = J(async (u) => {
|
|
210
|
+
function Q({
|
|
211
|
+
onSuccess: e,
|
|
212
|
+
onError: t,
|
|
213
|
+
children: r = "Continue with CasperID",
|
|
214
|
+
className: n,
|
|
215
|
+
disabled: s,
|
|
216
|
+
id: c,
|
|
217
|
+
...u
|
|
218
|
+
}) {
|
|
219
|
+
const [l, h] = k(!1);
|
|
220
|
+
return /* @__PURE__ */ R("button", { id: c, type: "button", className: n, disabled: s || l, onClick: async () => {
|
|
221
|
+
h(!0);
|
|
3402
222
|
try {
|
|
3403
|
-
const
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
credentials: "include",
|
|
3410
|
-
body: JSON.stringify({
|
|
3411
|
-
purpose: "sdk_verification",
|
|
3412
|
-
...u === "layer_3" ? { verificationMethod: "document" } : {}
|
|
3413
|
-
})
|
|
3414
|
-
});
|
|
3415
|
-
if (!E.ok) {
|
|
3416
|
-
const le = await E.json().catch(() => ({}));
|
|
3417
|
-
throw new Error(le.error || `Request failed with status ${E.status}`);
|
|
3418
|
-
}
|
|
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;
|
|
3429
|
-
}
|
|
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
|
|
3449
|
-
} : null
|
|
3450
|
-
})), Re(x == null ? void 0 : x.tier);
|
|
3451
|
-
}, []), ct = J((u, x) => {
|
|
3452
|
-
ne((E) => ({
|
|
3453
|
-
...E,
|
|
3454
|
-
hasPasskey: !0,
|
|
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");
|
|
3465
|
-
return;
|
|
223
|
+
const g = await j(u);
|
|
224
|
+
e == null || e(g);
|
|
225
|
+
} catch (g) {
|
|
226
|
+
t == null || t(g instanceof Error ? g : new Error("CasperID authorization failed."));
|
|
227
|
+
} finally {
|
|
228
|
+
h(!1);
|
|
3466
229
|
}
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
userAccount: {
|
|
3476
|
-
...$.userAccount,
|
|
3477
|
-
user_id: ((le = $.userAccount) == null ? void 0 : le.user_id) || "",
|
|
3478
|
-
wallet: u.wallet,
|
|
3479
|
-
did_address: u.didAddress,
|
|
3480
|
-
tier: "layer_1"
|
|
3481
|
-
}
|
|
3482
|
-
};
|
|
3483
|
-
}), u != null && u.credentialHash && z(u.credentialHash), K && !s)
|
|
230
|
+
}, children: l ? "Opening CasperID..." : r });
|
|
231
|
+
}
|
|
232
|
+
function Y(e, t) {
|
|
233
|
+
const r = P(!1), n = P(e), s = P(t);
|
|
234
|
+
n.current = e, s.current = t, L(() => {
|
|
235
|
+
var c;
|
|
236
|
+
if (!r.current) {
|
|
237
|
+
r.current = !0;
|
|
3484
238
|
try {
|
|
3485
|
-
const
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
});
|
|
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
|
|
3496
|
-
})));
|
|
3497
|
-
}
|
|
3498
|
-
} catch ($) {
|
|
3499
|
-
console.warn("[CasperID SDK] Failed to refresh token after verification:", $);
|
|
3500
|
-
}
|
|
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"));
|
|
3530
|
-
return;
|
|
3531
|
-
}
|
|
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)
|
|
3542
|
-
return /* @__PURE__ */ e(
|
|
3543
|
-
"div",
|
|
3544
|
-
{
|
|
3545
|
-
className: "fixed inset-0 z-[9999] flex items-center justify-center p-4",
|
|
3546
|
-
style: { backgroundColor: "rgba(0,0,0,0.6)", backdropFilter: "blur(6px)" },
|
|
3547
|
-
children: /* @__PURE__ */ e("div", { className: "w-12 h-12 border-3 border-white/20 border-t-white/80 rounded-full animate-spin" })
|
|
239
|
+
const u = G();
|
|
240
|
+
u && n.current(u);
|
|
241
|
+
} catch (u) {
|
|
242
|
+
(c = s.current) == null || c.call(s, u instanceof Error ? u : new Error("CasperID authorization callback failed."));
|
|
3548
243
|
}
|
|
3549
|
-
);
|
|
3550
|
-
const $e = () => {
|
|
3551
|
-
switch (te) {
|
|
3552
|
-
case "AuthSelection":
|
|
3553
|
-
return /* @__PURE__ */ e(
|
|
3554
|
-
Mt,
|
|
3555
|
-
{
|
|
3556
|
-
onNext: (x) => R(x === "otp" ? "Login" : "SecurityUpgrade"),
|
|
3557
|
-
onExtensionSuccess: lt,
|
|
3558
|
-
onError: be,
|
|
3559
|
-
language: _,
|
|
3560
|
-
platform: Q
|
|
3561
|
-
}
|
|
3562
|
-
);
|
|
3563
|
-
case "Login":
|
|
3564
|
-
return /* @__PURE__ */ e(
|
|
3565
|
-
Lt,
|
|
3566
|
-
{
|
|
3567
|
-
onNext: bt,
|
|
3568
|
-
onPasskeyUser: nt,
|
|
3569
|
-
onError: be,
|
|
3570
|
-
apiBaseUrl: H,
|
|
3571
|
-
apiKey: a,
|
|
3572
|
-
previewMode: s,
|
|
3573
|
-
language: _
|
|
3574
|
-
}
|
|
3575
|
-
);
|
|
3576
|
-
case "PasskeyAuth":
|
|
3577
|
-
return /* @__PURE__ */ e(
|
|
3578
|
-
Yt,
|
|
3579
|
-
{
|
|
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: _
|
|
3588
|
-
}
|
|
3589
|
-
);
|
|
3590
|
-
case "PasskeyRegister":
|
|
3591
|
-
return /* @__PURE__ */ e(
|
|
3592
|
-
Gt,
|
|
3593
|
-
{
|
|
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: _
|
|
3602
|
-
}
|
|
3603
|
-
);
|
|
3604
|
-
case "PinVerification":
|
|
3605
|
-
return /* @__PURE__ */ e(
|
|
3606
|
-
Jt,
|
|
3607
|
-
{
|
|
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: _
|
|
3616
|
-
}
|
|
3617
|
-
);
|
|
3618
|
-
case "SecurityUpgrade":
|
|
3619
|
-
return /* @__PURE__ */ e(
|
|
3620
|
-
Kt,
|
|
3621
|
-
{
|
|
3622
|
-
onNext: dt,
|
|
3623
|
-
onSkip: () => R("IdentityVerified"),
|
|
3624
|
-
language: _
|
|
3625
|
-
}
|
|
3626
|
-
);
|
|
3627
|
-
case "FaceScan":
|
|
3628
|
-
return /* @__PURE__ */ e(
|
|
3629
|
-
Zt,
|
|
3630
|
-
{
|
|
3631
|
-
requestId: U.requestId,
|
|
3632
|
-
onNext: ut,
|
|
3633
|
-
onError: be,
|
|
3634
|
-
apiBaseUrl: H,
|
|
3635
|
-
apiKey: a,
|
|
3636
|
-
previewMode: s,
|
|
3637
|
-
language: _
|
|
3638
|
-
}
|
|
3639
|
-
);
|
|
3640
|
-
case "VerifyIdentityChoice":
|
|
3641
|
-
return /* @__PURE__ */ e(
|
|
3642
|
-
Qt,
|
|
3643
|
-
{
|
|
3644
|
-
onNext: mt,
|
|
3645
|
-
language: _
|
|
3646
|
-
}
|
|
3647
|
-
);
|
|
3648
|
-
case "DocumentScan":
|
|
3649
|
-
return /* @__PURE__ */ e(
|
|
3650
|
-
ti,
|
|
3651
|
-
{
|
|
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: _
|
|
3660
|
-
}
|
|
3661
|
-
);
|
|
3662
|
-
case "ReviewData":
|
|
3663
|
-
return /* @__PURE__ */ e(
|
|
3664
|
-
ii,
|
|
3665
|
-
{
|
|
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: _
|
|
3681
|
-
}
|
|
3682
|
-
);
|
|
3683
|
-
case "MintingIdentity":
|
|
3684
|
-
const u = U.requestId ? U.verificationTier : "layer_1";
|
|
3685
|
-
return /* @__PURE__ */ e(
|
|
3686
|
-
ri,
|
|
3687
|
-
{
|
|
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: _
|
|
3697
|
-
}
|
|
3698
|
-
);
|
|
3699
|
-
case "IdentityVerified":
|
|
3700
|
-
return /* @__PURE__ */ e(ni, { onNext: () => R("PermissionsRequest"), language: _ });
|
|
3701
|
-
case "PermissionsRequest":
|
|
3702
|
-
return /* @__PURE__ */ e(
|
|
3703
|
-
ci,
|
|
3704
|
-
{
|
|
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
|
|
3711
|
-
}
|
|
3712
|
-
);
|
|
3713
|
-
default:
|
|
3714
|
-
return null;
|
|
3715
244
|
}
|
|
3716
|
-
};
|
|
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,
|
|
3722
|
-
{
|
|
3723
|
-
onClose: p,
|
|
3724
|
-
showClose: te !== "AuthSelection",
|
|
3725
|
-
subtitle: te === "PermissionsRequest" ? "PERMISSION REQUEST" : "SECURE SDK",
|
|
3726
|
-
theme: de,
|
|
3727
|
-
toggleTheme: Ue
|
|
3728
|
-
}
|
|
3729
|
-
),
|
|
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: [
|
|
3732
|
-
"By connecting, you agree to our",
|
|
3733
|
-
" ",
|
|
3734
|
-
/* @__PURE__ */ e("a", { className: "text-brand hover:underline ml-1", href: D, target: "_blank", rel: "noopener noreferrer", children: "Terms of Service" }),
|
|
3735
|
-
" ",
|
|
3736
|
-
"&",
|
|
3737
|
-
" ",
|
|
3738
|
-
/* @__PURE__ */ e("a", { className: "text-brand hover:underline ml-1", href: h, target: "_blank", rel: "noopener noreferrer", children: "Privacy Policy" })
|
|
3739
|
-
] }) })
|
|
3740
|
-
] }) })
|
|
3741
|
-
] }) : /* @__PURE__ */ i(re, { children: [
|
|
3742
|
-
/* @__PURE__ */ e("style", { children: De }, Ae),
|
|
3743
|
-
/* @__PURE__ */ i(
|
|
3744
|
-
"div",
|
|
3745
|
-
{
|
|
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()),
|
|
3749
|
-
children: [
|
|
3750
|
-
G !== "fullscreen" && /* @__PURE__ */ i("div", { className: "absolute inset-0 pointer-events-none overflow-hidden", children: [
|
|
3751
|
-
/* @__PURE__ */ e(
|
|
3752
|
-
"div",
|
|
3753
|
-
{
|
|
3754
|
-
className: "absolute top-[-10%] left-[-10%] w-[60%] h-[40%] rounded-full blur-[120px]",
|
|
3755
|
-
style: { backgroundColor: `${L}1a` }
|
|
3756
|
-
}
|
|
3757
|
-
),
|
|
3758
|
-
/* @__PURE__ */ e("div", { className: "absolute bottom-[-5%] right-[-5%] w-[50%] h-[30%] bg-[#6DE8EC]/5 blur-[100px] rounded-full" })
|
|
3759
|
-
] }),
|
|
3760
|
-
/* @__PURE__ */ e(
|
|
3761
|
-
P.div,
|
|
3762
|
-
{
|
|
3763
|
-
id: `casperid-modal-${ae}`,
|
|
3764
|
-
initial: G === "fullscreen" ? { opacity: 0 } : { opacity: 0, scale: 0.95, y: 20 },
|
|
3765
|
-
animate: { opacity: 1, scale: 1, y: 0 },
|
|
3766
|
-
exit: G === "fullscreen" ? { opacity: 0 } : { opacity: 0, scale: 0.95, y: 20 },
|
|
3767
|
-
transition: { type: "spring", damping: 28, stiffness: 300 },
|
|
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,
|
|
3773
|
-
{
|
|
3774
|
-
onClose: p,
|
|
3775
|
-
showClose: te !== "AuthSelection",
|
|
3776
|
-
subtitle: te === "PermissionsRequest" ? "PERMISSION REQUEST" : "SECURE SDK",
|
|
3777
|
-
theme: de,
|
|
3778
|
-
toggleTheme: Ue
|
|
3779
|
-
}
|
|
3780
|
-
),
|
|
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: [
|
|
3783
|
-
"By connecting, you agree to our",
|
|
3784
|
-
" ",
|
|
3785
|
-
/* @__PURE__ */ e("a", { className: "text-brand hover:underline ml-1", href: D, target: "_blank", rel: "noopener noreferrer", children: "Terms of Service" }),
|
|
3786
|
-
" ",
|
|
3787
|
-
"&",
|
|
3788
|
-
" ",
|
|
3789
|
-
/* @__PURE__ */ e("a", { className: "text-brand hover:underline ml-1", href: h, target: "_blank", rel: "noopener noreferrer", children: "Privacy Policy" })
|
|
3790
|
-
] }) })
|
|
3791
|
-
] })
|
|
3792
|
-
}
|
|
3793
|
-
)
|
|
3794
|
-
]
|
|
3795
|
-
}
|
|
3796
|
-
)
|
|
3797
|
-
] });
|
|
3798
|
-
};
|
|
3799
|
-
async function fi(r, a = {}, n = 3e4) {
|
|
3800
|
-
const l = new AbortController(), N = setTimeout(() => l.abort(), n);
|
|
3801
|
-
try {
|
|
3802
|
-
return await fetch(r, {
|
|
3803
|
-
...a,
|
|
3804
|
-
signal: l.signal
|
|
3805
|
-
});
|
|
3806
|
-
} finally {
|
|
3807
|
-
clearTimeout(N);
|
|
3808
|
-
}
|
|
3809
|
-
}
|
|
3810
|
-
class li extends Error {
|
|
3811
|
-
constructor(a, n) {
|
|
3812
|
-
super(a), this.name = "ApiError", this.status = n;
|
|
3813
|
-
}
|
|
3814
|
-
}
|
|
3815
|
-
async function hi(r) {
|
|
3816
|
-
if (!r.ok) {
|
|
3817
|
-
const a = await r.json().catch(() => ({}));
|
|
3818
|
-
throw new li(
|
|
3819
|
-
a.error || a.message || `Request failed with status ${r.status}`,
|
|
3820
|
-
r.status
|
|
3821
|
-
);
|
|
3822
|
-
}
|
|
3823
|
-
return r.json();
|
|
245
|
+
}, []);
|
|
3824
246
|
}
|
|
3825
247
|
export {
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
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
|
|
248
|
+
Q as CasperIDButton,
|
|
249
|
+
j as authorizeWithCasperID,
|
|
250
|
+
X as buildHostedAuthorizationUrl,
|
|
251
|
+
G as consumeHostedAuthorizationCallback,
|
|
252
|
+
Y as useHostedAuthorizationCallback
|
|
3845
253
|
};
|
|
3846
254
|
//# sourceMappingURL=index.mjs.map
|